agentskillpolicy

package
v0.64.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package agentskillpolicy owns the versioned Agent Skill activation setting.

Index

Constants

View Source
const Version = 1

Variables

View Source
var ErrCommitOutcomeUnknown = errors.New("AgentSkillPolicy commit outcome unknown")

ErrCommitOutcomeUnknown means PostgreSQL returned an error from COMMIT after accepting a policy mutation. The transaction may already be durable; callers must reconcile current policy truth instead of assuming a rollback.

Functions

func ValidateRef

func ValidateRef(ref string) error

ValidateRef accepts only policy-addressable scopes and the existing Skill name grammar: lowercase alphanumerics separated by single hyphens, max 64.

Types

type Policy

type Policy struct {
	Disabled []string
}

Policy is the decoded, immutable value of agent.enabled_builtin_skills. Despite the historical column name it applies to builtin, system, and system_agent Skills.

func Decode

func Decode(raw json.RawMessage) (Policy, error)

Decode reads the strict versioned storage format. The database migration canonicalizes historical arrays before this code runs and a constraint keeps them from returning; accepting any other shape here would fail open by silently changing which instructions the model receives.

func (Policy) CanonicalJSON

func (p Policy) CanonicalJSON() (json.RawMessage, error)

CanonicalJSON returns deterministic bytes for a policy mutation.

func (Policy) DisabledRef

func (p Policy) DisabledRef(ref string) bool

func (Policy) SetEnabled

func (p Policy) SetEnabled(ref string, enabled bool) (Policy, error)

SetEnabled changes exactly one logical ref. Enabling is deliberately allowed for a stored dangling ref, which is the sole explicit prune operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL