Documentation
¶
Index ¶
- Constants
- func DigestDirectory(sourceDir string) (string, error)
- func MaterializeRuntimeBundle(base fs.FS, snapshot CatalogSnapshot) (fs.FS, error)
- func SaveMCPAccess(stateDir string, state MCPAccessState) error
- func ValidateIdentity(identity string) error
- func ValidateMCPAccessRule(rule MCPAccessRule) error
- type ActivationDiagnostic
- type CatalogItem
- type CatalogSnapshot
- type ComposeInput
- type DiscoverSkillsOptions
- type DiscoveredSkill
- type InstallLocalAgentRequest
- type InstallLocalSkillsRequest
- type LocalAgentService
- func (s *LocalAgentService) CopyBundledAgent(ctx context.Context, bundle fs.FS, bundleDigest, from, to string, dryRun bool) (ManifestEntry, error)
- func (s *LocalAgentService) CopyManagedAgent(ctx context.Context, from, to string, dryRun bool) (bool, error)
- func (s *LocalAgentService) InstallAgentContent(ctx context.Context, name string, data []byte, req InstallLocalAgentRequest) (ManifestEntry, error)
- func (s *LocalAgentService) InstallLocalAgent(ctx context.Context, req InstallLocalAgentRequest) (ManifestEntry, error)
- func (s *LocalAgentService) InstallTranslatedAgent(ctx context.Context, name string, normalized, source []byte, sourceName string, ...) (ManifestEntry, error)
- func (s *LocalAgentService) InstallTranslatedAgents(ctx context.Context, installs []TranslatedAgentInstall) ([]ManifestEntry, error)
- func (s *LocalAgentService) ListManagedAgents(ctx context.Context) ([]ManifestEntry, error)
- func (s *LocalAgentService) RemoveManagedAgent(ctx context.Context, name string, dryRun bool) (bool, error)
- func (s *LocalAgentService) RenameManagedAgent(ctx context.Context, from, to string, dryRun bool) (bool, error)
- func (s *LocalAgentService) SetManagedAgentRuntime(ctx context.Context, agentID string, target RuntimeTarget, dryRun bool) (ManifestEntry, error)
- func (s *LocalAgentService) UpdateManagedAgentSkillBinding(ctx context.Context, agentID, skillName, origin string, add, dryRun bool) (ManifestEntry, error)
- func (s *LocalAgentService) UpdateManagedAgentSkills(ctx context.Context, agentID, skillName string, add, dryRun bool) (ManifestEntry, error)
- type LocalSkillService
- func (s *LocalSkillService) InstallLocalSkills(ctx context.Context, req InstallLocalSkillsRequest) ([]ManifestEntry, error)
- func (s *LocalSkillService) InstallResolvedSkills(ctx context.Context, fsys fs.FS, rootName, source string, ...) ([]ManifestEntry, error)
- func (s *LocalSkillService) InstallResolvedSkillsWithProvenance(ctx context.Context, fsys fs.FS, ...) ([]ManifestEntry, error)
- func (s *LocalSkillService) ListManagedSkills(ctx context.Context) ([]ManifestEntry, error)
- func (s *LocalSkillService) RemoveManagedSkill(ctx context.Context, name string, dryRun bool) (bool, error)
- func (s *LocalSkillService) RenameManagedSkill(ctx context.Context, from, to string, dryRun bool) (bool, error)
- type MCPAccessRule
- type MCPAccessState
- type Manifest
- type ManifestEntry
- type Provenance
- type RuntimeBatchObject
- func PlanBundledAgentCopy(bundle fs.FS, bundleDigest, from, to string) (RuntimeBatchObject, error)
- func PlanBundledAgentCopyWithOptions(bundle fs.FS, bundleDigest, from, to, displayName string, skills []string, ...) (RuntimeBatchObject, error)
- func PlanExistingAgentUpdate(stateDir, identity, displayName string, skills []string, overrideSkills bool, ...) (RuntimeBatchObject, error)
- func PlanSkillObject(fsys fs.FS, root, identity, source, revision, subpath, sourceDigest string, ...) (RuntimeBatchObject, error)
- func PlanTranslatedAgentObject(item TranslatedAgentInstall) (RuntimeBatchObject, error)
- type RuntimeBatchRequest
- type RuntimeTarget
- type SkillBinding
- type Store
- func (s *Store) BeginTransaction(ctx context.Context) (*Transaction, error)
- func (s *Store) EnsureInitialized(ctx context.Context) error
- func (s *Store) LoadManifest() (Manifest, error)
- func (s *Store) LockPath() string
- func (s *Store) ManifestPath() string
- func (s *Store) ObjectRoot() string
- func (s *Store) ObjectsDir() string
- func (s *Store) PutObject(content []byte) (digest string, objectPath string, err error)
- func (s *Store) Recover(ctx context.Context) (bool, error)
- func (s *Store) RecoverAndLoadManifest(ctx context.Context) (Manifest, bool, error)
- func (s *Store) SaveManifest(manifest Manifest) error
- func (s *Store) TxnDir() string
- type Transaction
- func (tx *Transaction) AbortUnchanged() error
- func (tx *Transaction) Commit() error
- func (tx *Transaction) ReplaceManifest(manifest Manifest)
- func (tx *Transaction) Rollback() error
- func (tx *Transaction) StageMCPAccess(state MCPAccessState) error
- func (tx *Transaction) UpsertEntry(entry ManifestEntry)
- type TranslatedAgentInstall
Constants ¶
const ( MCPAccessModeDefault = "default" MCPAccessModeCustom = "custom" MCPAccessModeNone = "none" )
const ManifestVersion = 1
Variables ¶
This section is empty.
Functions ¶
func DigestDirectory ¶
DigestDirectory returns the immutable object digest for a local package.
func MaterializeRuntimeBundle ¶
MaterializeRuntimeBundle overlays active managed extension content onto the immutable bundled runtime so agent/skill registries can execute managed items.
func SaveMCPAccess ¶
func SaveMCPAccess(stateDir string, state MCPAccessState) error
func ValidateIdentity ¶
ValidateIdentity accepts one portable agent/skill identity that is safe to use as both a manifest key and a runtime overlay path component.
func ValidateMCPAccessRule ¶
func ValidateMCPAccessRule(rule MCPAccessRule) error
ValidateMCPAccessRule verifies a rule before a CLI preview or update.
Types ¶
type ActivationDiagnostic ¶
type CatalogItem ¶
type CatalogItem struct {
ID string `json:"id"`
Kind string `json:"kind"`
Origin string `json:"origin"` // bundled | managed
Active bool `json:"active"`
Digest string `json:"digest,omitempty"`
Source string `json:"source,omitempty"`
ObjectPath string `json:"object_path,omitempty"`
ObjectRoot string `json:"-"`
Reason string `json:"reason,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
Diagnostics []ActivationDiagnostic `json:"diagnostics,omitempty"`
Runtime *RuntimeTarget `json:"runtime_target,omitempty"`
}
type CatalogSnapshot ¶
type CatalogSnapshot struct {
CreatedAt time.Time `json:"created_at"`
Agents []CatalogItem `json:"agents"`
Skills []CatalogItem `json:"skills"`
}
func ComposeCatalog ¶
func ComposeCatalog(input ComposeInput) (CatalogSnapshot, error)
type ComposeInput ¶
type DiscoverSkillsOptions ¶
type DiscoveredSkill ¶
func DiscoverLocalSkills ¶
func DiscoverLocalSkills(source string, opts DiscoverSkillsOptions) ([]DiscoveredSkill, error)
func DiscoverSkillsFS ¶
func DiscoverSkillsFS(fsys fs.FS, rootName string, opts DiscoverSkillsOptions) ([]DiscoveredSkill, error)
DiscoverSkillsFS discovers Agent Skills from a filesystem returned by a bounded source resolver. Paths are slash-separated and relative to fsys.
type InstallLocalAgentRequest ¶
type InstallLocalAgentRequest struct {
Source string
As string
Replace bool
DryRun bool
SourceURI string
Revision string
Subpath string
Runtime *RuntimeTarget
Provenance Provenance
SkillBindings []SkillBinding
}
type InstallLocalSkillsRequest ¶
type InstallLocalSkillsRequest struct {
Source string
Discover DiscoverSkillsOptions
As string
Replace bool
DryRun bool
}
type LocalAgentService ¶
type LocalAgentService struct {
// contains filtered or unexported fields
}
func NewLocalAgentService ¶
func NewLocalAgentService(stateDir string) *LocalAgentService
func (*LocalAgentService) CopyBundledAgent ¶
func (s *LocalAgentService) CopyBundledAgent(ctx context.Context, bundle fs.FS, bundleDigest, from, to string, dryRun bool) (ManifestEntry, error)
CopyBundledAgent creates an independent managed package from one immutable bundled agent, including a materialized constitution when the source uses a constitution_path.
func (*LocalAgentService) CopyManagedAgent ¶
func (*LocalAgentService) InstallAgentContent ¶
func (s *LocalAgentService) InstallAgentContent(ctx context.Context, name string, data []byte, req InstallLocalAgentRequest) (ManifestEntry, error)
InstallAgentContent stores a fully translated agent definition without requiring a temporary source file. It is used by guided imports and copies.
func (*LocalAgentService) InstallLocalAgent ¶
func (s *LocalAgentService) InstallLocalAgent(ctx context.Context, req InstallLocalAgentRequest) (ManifestEntry, error)
func (*LocalAgentService) InstallTranslatedAgent ¶
func (s *LocalAgentService) InstallTranslatedAgent(ctx context.Context, name string, normalized, source []byte, sourceName string, importConfig []byte, req InstallLocalAgentRequest) (ManifestEntry, error)
InstallTranslatedAgent preserves the original source and optional import decisions beside the normalized runtime definition in one immutable object.
func (*LocalAgentService) InstallTranslatedAgents ¶
func (s *LocalAgentService) InstallTranslatedAgents(ctx context.Context, installs []TranslatedAgentInstall) ([]ManifestEntry, error)
InstallTranslatedAgents activates a selected import batch atomically. Source bytes and import decisions are published in the same immutable objects; no agent from the batch becomes visible if validation or publication fails.
func (*LocalAgentService) ListManagedAgents ¶
func (s *LocalAgentService) ListManagedAgents(ctx context.Context) ([]ManifestEntry, error)
func (*LocalAgentService) RemoveManagedAgent ¶
func (*LocalAgentService) RenameManagedAgent ¶
func (*LocalAgentService) SetManagedAgentRuntime ¶
func (s *LocalAgentService) SetManagedAgentRuntime(ctx context.Context, agentID string, target RuntimeTarget, dryRun bool) (ManifestEntry, error)
SetManagedAgentRuntime updates the normalized model and its selected runtime target together so execution drift can be detected.
func (*LocalAgentService) UpdateManagedAgentSkillBinding ¶
func (s *LocalAgentService) UpdateManagedAgentSkillBinding(ctx context.Context, agentID, skillName, origin string, add, dryRun bool) (ManifestEntry, error)
func (*LocalAgentService) UpdateManagedAgentSkills ¶
func (s *LocalAgentService) UpdateManagedAgentSkills(ctx context.Context, agentID, skillName string, add, dryRun bool) (ManifestEntry, error)
UpdateManagedAgentSkills adds or removes one explicit managed-agent skill binding. Availability is validated by the caller against the effective catalog before an addition.
type LocalSkillService ¶
type LocalSkillService struct {
// contains filtered or unexported fields
}
func NewLocalSkillService ¶
func NewLocalSkillService(stateDir string) *LocalSkillService
func (*LocalSkillService) InstallLocalSkills ¶
func (s *LocalSkillService) InstallLocalSkills(ctx context.Context, req InstallLocalSkillsRequest) ([]ManifestEntry, error)
func (*LocalSkillService) InstallResolvedSkills ¶
func (s *LocalSkillService) InstallResolvedSkills(ctx context.Context, fsys fs.FS, rootName, source string, opts DiscoverSkillsOptions, replace, dryRun bool) ([]ManifestEntry, error)
InstallResolvedSkills materializes selected skills from a resolver-owned filesystem into the content-addressed store before the resolver is cleaned up. It supports local and remote resolvers without exposing source paths in runtime object references.
func (*LocalSkillService) InstallResolvedSkillsWithProvenance ¶
func (s *LocalSkillService) InstallResolvedSkillsWithProvenance(ctx context.Context, fsys fs.FS, rootName, source, revision, subpath, sourceDigest string, opts DiscoverSkillsOptions, replace, dryRun bool) ([]ManifestEntry, error)
func (*LocalSkillService) ListManagedSkills ¶
func (s *LocalSkillService) ListManagedSkills(ctx context.Context) ([]ManifestEntry, error)
func (*LocalSkillService) RemoveManagedSkill ¶
func (*LocalSkillService) RenameManagedSkill ¶
func (s *LocalSkillService) RenameManagedSkill(ctx context.Context, from, to string, dryRun bool) (bool, error)
RenameManagedSkill creates a new immutable object whose SKILL.md name matches the manifest identity. Existing managed-agent bindings are updated in the same transaction.
type MCPAccessRule ¶
type MCPAccessState ¶
type MCPAccessState struct {
DefaultServers []string `yaml:"default_servers,omitempty" json:"default_servers,omitempty"`
Agents map[string]MCPAccessRule `yaml:"agents,omitempty" json:"agents,omitempty"`
}
func LoadMCPAccess ¶
func LoadMCPAccess(stateDir string) (MCPAccessState, bool, error)
func UpdateMCPAccess ¶
func UpdateMCPAccess(ctx context.Context, stateDir string, update func(*MCPAccessState) error) (MCPAccessState, error)
UpdateMCPAccess serializes the full read-modify-write operation with the extension manifest lock and recovery journal so batch activation can include access policy without exposing partial state.
func (MCPAccessState) AllowedServers ¶
func (s MCPAccessState) AllowedServers(agentID string, all []string, hasConfig bool) []string
type Manifest ¶
type Manifest struct {
Version int `yaml:"version" json:"version"`
Entries []ManifestEntry `yaml:"entries" json:"entries"`
MCPAccess *MCPAccessState `yaml:"mcp_access,omitempty" json:"mcp_access,omitempty"`
}
func EmptyManifest ¶
func EmptyManifest() Manifest
type ManifestEntry ¶
type ManifestEntry struct {
Identity string `yaml:"identity" json:"identity"`
Kind string `yaml:"kind" json:"kind"`
Source string `yaml:"source" json:"source"`
Revision string `yaml:"revision,omitempty" json:"revision,omitempty"`
Subpath string `yaml:"subpath,omitempty" json:"subpath,omitempty"`
Digest string `yaml:"digest" json:"digest"`
ObjectPath string `yaml:"object_path" json:"object_path"`
InstalledAt time.Time `yaml:"installed_at" json:"installed_at"`
Provenance Provenance `yaml:"provenance,omitempty" json:"provenance,omitempty"`
Runtime *RuntimeTarget `yaml:"runtime_target,omitempty" json:"runtime_target,omitempty"`
SkillBindings []SkillBinding `yaml:"skill_bindings,omitempty" json:"skill_bindings,omitempty"`
Diagnostics []ActivationDiagnostic `yaml:"activation_diagnostics,omitempty" json:"activation_diagnostics,omitempty"`
}
func ActivateRuntimeBatch ¶
func ActivateRuntimeBatch(ctx context.Context, stateDir string, req RuntimeBatchRequest) ([]ManifestEntry, error)
func (ManifestEntry) Clone ¶
func (e ManifestEntry) Clone() ManifestEntry
type Provenance ¶
type Provenance struct {
Installer string `yaml:"installer,omitempty" json:"installer,omitempty"`
Host string `yaml:"host,omitempty" json:"host,omitempty"`
Actor string `yaml:"actor,omitempty" json:"actor,omitempty"`
SourceDigest string `yaml:"source_digest,omitempty" json:"source_digest,omitempty"`
SourceModel string `yaml:"source_model,omitempty" json:"source_model,omitempty"`
Adapter string `yaml:"adapter,omitempty" json:"adapter,omitempty"`
AdapterDigest string `yaml:"adapter_digest,omitempty" json:"adapter_digest,omitempty"`
ImportConfig string `yaml:"import_config_digest,omitempty" json:"import_config_digest,omitempty"`
CopiedFrom string `yaml:"copied_from,omitempty" json:"copied_from,omitempty"`
BundleDigest string `yaml:"bundle_digest,omitempty" json:"bundle_digest,omitempty"`
}
type RuntimeBatchObject ¶
type RuntimeBatchObject struct {
Entry ManifestEntry
Files map[string][]byte
Replace bool
ExpectedDigest string
}
RuntimeBatchObject is a validated immutable package waiting for one manifest publication. Files are relative to the content-addressed object root.
func PlanBundledAgentCopy ¶
func PlanBundledAgentCopy(bundle fs.FS, bundleDigest, from, to string) (RuntimeBatchObject, error)
func PlanBundledAgentCopyWithOptions ¶
func PlanBundledAgentCopyWithOptions(bundle fs.FS, bundleDigest, from, to, displayName string, skills []string, overrideSkills bool) (RuntimeBatchObject, error)
PlanBundledAgentCopyWithOptions creates an independent managed copy while applying the operator's final display-name and skill choices before digesting the package.
func PlanExistingAgentUpdate ¶
func PlanExistingAgentUpdate(stateDir, identity, displayName string, skills []string, overrideSkills bool, bindings []SkillBinding) (RuntimeBatchObject, error)
PlanExistingAgentUpdate includes an existing managed package in a runtime batch, retaining its support/provenance files and replacing only explicitly selected agent fields.
func PlanSkillObject ¶
func PlanTranslatedAgentObject ¶
func PlanTranslatedAgentObject(item TranslatedAgentInstall) (RuntimeBatchObject, error)
type RuntimeBatchRequest ¶
type RuntimeBatchRequest struct {
Objects []RuntimeBatchObject
MCPAccess *MCPAccessState
DryRun bool
}
type RuntimeTarget ¶
type RuntimeTarget struct {
Engine string `yaml:"engine" json:"engine"`
BaseURL string `yaml:"base_url" json:"base_url"`
Model string `yaml:"model" json:"model"`
ResolvedDigest string `yaml:"resolved_digest,omitempty" json:"resolved_digest,omitempty"`
}
func (RuntimeTarget) Drifted ¶
func (t RuntimeTarget) Drifted(current RuntimeTarget) bool
func (RuntimeTarget) Validate ¶
func (t RuntimeTarget) Validate() error
type SkillBinding ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) BeginTransaction ¶
func (s *Store) BeginTransaction(ctx context.Context) (*Transaction, error)
func (*Store) EnsureInitialized ¶
EnsureInitialized creates an empty manifest through the normal transaction path. It intentionally creates no objects or extension bindings.
func (*Store) LoadManifest ¶
func (*Store) ManifestPath ¶
func (*Store) ObjectRoot ¶
ObjectRoot returns the canonical root expected to contain content-addressed extension objects.
func (*Store) ObjectsDir ¶
func (*Store) RecoverAndLoadManifest ¶
func (*Store) SaveManifest ¶
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) AbortUnchanged ¶
func (tx *Transaction) AbortUnchanged() error
AbortUnchanged releases a transaction that planned no mutable changes without rewriting the manifest or creating a new activation timestamp.
func (*Transaction) Commit ¶
func (tx *Transaction) Commit() error
func (*Transaction) ReplaceManifest ¶
func (tx *Transaction) ReplaceManifest(manifest Manifest)
ReplaceManifest stages a complete, previously validated manifest. It is intended for compensating a multi-step activation after a later step fails.
func (*Transaction) Rollback ¶
func (tx *Transaction) Rollback() error
func (*Transaction) StageMCPAccess ¶
func (tx *Transaction) StageMCPAccess(state MCPAccessState) error
StageMCPAccess includes the access policy in the same recovery journal and publication boundary as the extension manifest.
func (*Transaction) UpsertEntry ¶
func (tx *Transaction) UpsertEntry(entry ManifestEntry)