Documentation
¶
Overview ¶
Package catalog is the tool/skill/MCP discovery seam: where the set of available tools, skills, and MCP servers comes from. The core ships a fixed (Static) and filesystem-backed provider; pkg/memorylayer supplies a workspace-aware remote provider. The catalog types are protocol-neutral.
Index ¶
- Constants
- func AsToolCatalogError(err error) (spec.ToolCatalogError, bool)
- func EntryResourceFamilyPattern(context spec.ToolCatalogContext) (string, error)
- func EntryResourceID(context spec.ToolCatalogContext, ref spec.ToolReference) (string, error)
- func InvocationCatalogAction(effect spec.ToolEffect) (string, error)
- func MutationCorrelation(action, providerID, registrationID, generation string, sequence uint64) string
- func ProviderResourceID(context spec.ToolCatalogContext, providerID string) (string, error)
- func RevisionFrom(ctx context.Context) (string, bool)
- func WithRevision(ctx context.Context, revision string) context.Context
- type AetherLiveBackend
- func (b *AetherLiveBackend) CompareAndSwapState(ctx context.Context, current LiveStateRecord, next LiveState) (bool, error)
- func (b *AetherLiveBackend) LoadSnapshot(ctx context.Context, snapshotID string) (RetainedSnapshot, bool, error)
- func (b *AetherLiveBackend) LoadState(ctx context.Context) (LiveStateRecord, error)
- func (b *AetherLiveBackend) StoreSnapshot(ctx context.Context, snapshot RetainedSnapshot, ttl time.Duration) (RetainedSnapshot, error)
- type AetherLiveBackendOptions
- type AllowAllEntryAuthorizer
- type BatchEntryAuthorizer
- type BoundWorkspaceProvider
- type Catalog
- type CatalogError
- type EntryAuthorizer
- type EntryAuthorizerFunc
- type GenerationTombstone
- type InvocationAuthorityProfile
- type InvocationAuthorityResolver
- type InvocationAuthorityResolverFunc
- type InvocationAuthorityResourceScope
- type InvocationAuthorityRule
- type LiveBackend
- type LiveService
- func (s *LiveService) Describe(ctx context.Context, binding QueryBinding, ...) (spec.ToolCatalogDescribeResult, error)
- func (s *LiveService) DescribeResolved(ctx context.Context, binding QueryBinding, ...) (ResolvedCatalogDescribeResult, error)
- func (s *LiveService) Publish(ctx context.Context, binding MutationBinding, ...) (spec.ToolCatalogMutationResult, error)
- func (s *LiveService) Query(ctx context.Context, binding QueryBinding, query spec.ToolCatalogQuery) (spec.ToolCatalogPage, error)
- func (s *LiveService) QueryResolved(ctx context.Context, binding QueryBinding, query spec.ToolCatalogQuery) (ResolvedCatalogPage, error)
- func (s *LiveService) Renew(ctx context.Context, binding MutationBinding, ...) (spec.ToolCatalogMutationResult, error)
- func (s *LiveService) ResolveInvocation(ctx context.Context, binding QueryBinding, ref spec.ToolReference) (spec.ToolCatalogEntry, error)
- func (s *LiveService) ResolveInvocationRecord(ctx context.Context, binding QueryBinding, ref spec.ToolReference) (ResolvedCatalogEntry, error)
- func (s *LiveService) Revoke(ctx context.Context, binding MutationBinding, ...) (spec.ToolCatalogMutationResult, error)
- type LiveServiceOptions
- type LiveState
- type LiveStateRecord
- type MCPServerSpec
- type MCPToolSpec
- type MemoryBackend
- func (b *MemoryBackend) CompareAndSwapState(_ context.Context, current LiveStateRecord, next LiveState) (bool, error)
- func (b *MemoryBackend) LoadSnapshot(_ context.Context, snapshotID string) (RetainedSnapshot, bool, error)
- func (b *MemoryBackend) LoadState(context.Context) (LiveStateRecord, error)
- func (b *MemoryBackend) StoreSnapshot(_ context.Context, snapshot RetainedSnapshot, ttl time.Duration) (RetainedSnapshot, error)
- type MutationBinding
- type Provider
- type ProviderFunc
- type ProviderRouteBinding
- type PublicationLiveness
- type PublicationLivenessFunc
- type QueryBinding
- type ResolvedCatalogDescribeResult
- type ResolvedCatalogEntry
- type ResolvedCatalogPage
- type ResourceRevision
- type RetainedSnapshot
- type SkillSpec
- type StaticInvocationAuthorityPolicy
- type ToolSpec
- type WorkspaceProvider
- type WorkspaceProviderFunc
Constants ¶
const ( // Canonical catalog resource operations used by EntryAuthorizer. CatalogActionDiscover = "tool.discover" CatalogActionDescribe = "tool.describe" CatalogActionInvokeRead = "tool.invoke.read" CatalogActionInvokeWrite = "tool.invoke.write" CatalogActionInvokeExecute = "tool.invoke.execute" CatalogActionInvokeExternal = "tool.invoke.external" CatalogActionInvokeInteraction = "tool.invoke.interaction" CatalogErrorStaleGeneration = "stale_generation" CatalogErrorStaleSequence = "stale_sequence" CatalogErrorLeaseExpired = "lease_expired" CatalogErrorStaleCursor = "stale_cursor" CatalogErrorStaleSnapshot = "stale_snapshot" CatalogErrorAmbiguousRef = "ambiguous_reference" CatalogErrorInvalidRequest = "invalid_request" CatalogErrorConcurrentUpdate = "concurrent_update" )
const InvocationAuthorityModeCallerOBO = "caller_obo"
const LiveStateSchemaVersion = "3"
LiveStateSchemaVersion versions the backend record and retained-snapshot representation independently of the portable ecosystem protocol.
Variables ¶
This section is empty.
Functions ¶
func AsToolCatalogError ¶ added in v0.0.2
func AsToolCatalogError(err error) (spec.ToolCatalogError, bool)
AsToolCatalogError returns the stable transport projection for err.
func EntryResourceFamilyPattern ¶ added in v0.0.2
func EntryResourceFamilyPattern(context spec.ToolCatalogContext) (string, error)
EntryResourceFamilyPattern returns the narrow Aether glob for every provider tool in one exact authenticated selector context. Only the final provider and tool slots are globs; user-controlled context values remain encoded segments.
func EntryResourceID ¶ added in v0.0.2
func EntryResourceID(context spec.ToolCatalogContext, ref spec.ToolReference) (string, error)
EntryResourceID is the canonical Aether resource path for one exact catalog entry in one authenticated selector context. Optional selector components use the reserved "!" sentinel; all user-controlled segments are percent-encoded with uppercase hexadecimal so every producer computes the same ACL key.
func InvocationCatalogAction ¶ added in v0.0.2
func InvocationCatalogAction(effect spec.ToolEffect) (string, error)
InvocationCatalogAction maps the admitted effect to the canonical Aether resource operation. Unknown effects fail closed.
func MutationCorrelation ¶ added in v0.0.2
func MutationCorrelation(action, providerID, registrationID, generation string, sequence uint64) string
MutationCorrelation binds a checked provider mutation receipt to its exact method, provider generation, and monotonic sequence.
func ProviderResourceID ¶ added in v0.0.2
func ProviderResourceID(context spec.ToolCatalogContext, providerID string) (string, error)
ProviderResourceID is the canonical Aether resource path for mutating one provider registration family in an authenticated selector context.
func RevisionFrom ¶ added in v0.0.2
RevisionFrom returns the catalog revision bound to the current execution.
Types ¶
type AetherLiveBackend ¶ added in v0.0.2
type AetherLiveBackend struct {
// contains filtered or unexported fields
}
AetherLiveBackend persists the current catalog state with Aether KV CAS and retains immutable snapshots as TTL keys. Protocol leases remain explicit in the publication state; snapshot retention additionally uses native KV TTL.
func NewAetherLiveBackend ¶ added in v0.0.2
func NewAetherLiveBackend(kv *aether.KV, options AetherLiveBackendOptions) (*AetherLiveBackend, error)
NewAetherLiveBackend adapts an Aether SDK KV client to LiveBackend.
func (*AetherLiveBackend) CompareAndSwapState ¶ added in v0.0.2
func (b *AetherLiveBackend) CompareAndSwapState(ctx context.Context, current LiveStateRecord, next LiveState) (bool, error)
func (*AetherLiveBackend) LoadSnapshot ¶ added in v0.0.2
func (b *AetherLiveBackend) LoadSnapshot(ctx context.Context, snapshotID string) (RetainedSnapshot, bool, error)
func (*AetherLiveBackend) LoadState ¶ added in v0.0.2
func (b *AetherLiveBackend) LoadState(ctx context.Context) (LiveStateRecord, error)
func (*AetherLiveBackend) StoreSnapshot ¶ added in v0.0.2
func (b *AetherLiveBackend) StoreSnapshot(ctx context.Context, snapshot RetainedSnapshot, ttl time.Duration) (RetainedSnapshot, error)
type AetherLiveBackendOptions ¶ added in v0.0.2
type AetherLiveBackendOptions struct {
KeyPrefix string
Scope aether.KVScope
UserID string
Workspace string
Timeout time.Duration
}
AetherLiveBackendOptions binds operational catalog state to one Aether KV namespace. Workspace scope is the default so separate coding projects can have independent live catalogs while sharing the same Aether deployment.
type AllowAllEntryAuthorizer ¶ added in v0.0.2
type AllowAllEntryAuthorizer struct{}
AllowAllEntryAuthorizer is intended for the explicitly single-user standalone runtime. Distributed/enterprise composition should supply an Aether-backed authorizer instead.
func (AllowAllEntryAuthorizer) AuthorizeCatalogEntry ¶ added in v0.0.2
func (AllowAllEntryAuthorizer) AuthorizeCatalogEntry(context.Context, string, QueryBinding, spec.ToolCatalogEntry) (bool, error)
type BatchEntryAuthorizer ¶ added in v0.0.2
type BatchEntryAuthorizer interface {
AuthorizeCatalogEntries(ctx context.Context, action string, binding QueryBinding, entries []spec.ToolCatalogEntry) ([]bool, error)
}
BatchEntryAuthorizer lets distributed adapters evaluate catalog entries in bounded transport batches while preserving the per-entry allow/deny result. LiveService validates result cardinality and fails the whole operation on a malformed or failed batch. EntryAuthorizer remains the standalone seam.
type BoundWorkspaceProvider ¶ added in v0.0.2
type BoundWorkspaceProvider struct {
Provider WorkspaceProvider
LogicalDefault string
BackendDefault string
}
BoundWorkspaceProvider maps only the selected logical default workspace to a backend-specific default. Other explicit workspaces pass through unchanged, preventing one configured MemoryLayer workspace from becoming every logical workspace's catalog.
func (BoundWorkspaceProvider) LoadWorkspace ¶ added in v0.0.2
type Catalog ¶
type Catalog struct {
// Revision is the deterministic content identity of the enabled catalog
// snapshot. Providers may supply it; hosts recompute it after local overlays.
Revision string `json:"revision,omitempty"`
Tools []ToolSpec `json:"tools"`
Skills []SkillSpec `json:"skills"`
MCPServers []MCPServerSpec `json:"mcp_servers"`
}
Catalog is the discovered set of tools, skills, and MCP servers.
func WithComputedRevision ¶ added in v0.0.2
WithComputedRevision returns a copy carrying a deterministic revision over the protocol-neutral catalog content. The existing Revision is excluded.
type CatalogError ¶ added in v0.0.2
type CatalogError struct {
Protocol spec.ToolCatalogError
}
CatalogError projects a stable ecosystem catalog error while remaining a Go error suitable for errors.As.
func (*CatalogError) Error ¶ added in v0.0.2
func (e *CatalogError) Error() string
type EntryAuthorizer ¶ added in v0.0.2
type EntryAuthorizer interface {
AuthorizeCatalogEntry(ctx context.Context, action string, binding QueryBinding, entry spec.ToolCatalogEntry) (bool, error)
}
EntryAuthorizer independently decides discovery and describe access for one exact provider-qualified entry. Enterprise adapters should delegate this to Aether decisions; standalone mode uses AllowAllEntryAuthorizer explicitly.
type EntryAuthorizerFunc ¶ added in v0.0.2
type EntryAuthorizerFunc func(context.Context, string, QueryBinding, spec.ToolCatalogEntry) (bool, error)
EntryAuthorizerFunc adapts a function to EntryAuthorizer.
func (EntryAuthorizerFunc) AuthorizeCatalogEntry ¶ added in v0.0.2
func (f EntryAuthorizerFunc) AuthorizeCatalogEntry(ctx context.Context, action string, binding QueryBinding, entry spec.ToolCatalogEntry) (bool, error)
type GenerationTombstone ¶ added in v0.0.2
type GenerationTombstone struct {
ProviderID string `json:"provider_id"`
RegistrationID string `json:"registration_id"`
Generation string `json:"generation"`
ProviderRoute string `json:"provider_route,omitempty"`
Sequence uint64 `json:"sequence"`
RetainUntil string `json:"retain_until"`
}
GenerationTombstone remembers the final accepted sequence for a generation after it is replaced, expires, or is revoked.
type InvocationAuthorityProfile ¶ added in v0.0.2
type InvocationAuthorityProfile struct {
Mode string `json:"mode"`
ResourceScope []InvocationAuthorityResourceScope `json:"resource_scope"`
OperationScope []string `json:"operation_scope"`
MaxAccessLevel int32 `json:"max_access_level"`
}
InvocationAuthorityProfile is a server-owned maximum downstream authority for one exact catalog entry. Workspace scope is always the exact trusted ToolCatalogContext workspace and is therefore not provider-configurable.
func (InvocationAuthorityProfile) Validate ¶ added in v0.0.2
func (p InvocationAuthorityProfile) Validate() error
type InvocationAuthorityResolver ¶ added in v0.0.2
type InvocationAuthorityResolver interface {
ResolveInvocationAuthority(context.Context, spec.ToolCatalogContext, spec.ToolCatalogEntry) (*InvocationAuthorityProfile, error)
}
InvocationAuthorityResolver supplies trusted deployment policy for an exact live entry. nil means no forwarded caller authority.
type InvocationAuthorityResolverFunc ¶ added in v0.0.2
type InvocationAuthorityResolverFunc func(context.Context, spec.ToolCatalogContext, spec.ToolCatalogEntry) (*InvocationAuthorityProfile, error)
func (InvocationAuthorityResolverFunc) ResolveInvocationAuthority ¶ added in v0.0.2
func (f InvocationAuthorityResolverFunc) ResolveInvocationAuthority(ctx context.Context, catalogContext spec.ToolCatalogContext, entry spec.ToolCatalogEntry) (*InvocationAuthorityProfile, error)
type InvocationAuthorityResourceScope ¶ added in v0.0.2
type InvocationAuthorityResourceScope struct {
ResourceType string `json:"resource_type"`
Patterns []string `json:"patterns"`
}
InvocationAuthorityResourceScope is the catalog-private projection of one Aether authority-grant resource family. It deliberately does not live in the portable tool descriptor or invocation envelope.
type InvocationAuthorityRule ¶ added in v0.0.2
type InvocationAuthorityRule struct {
Ref spec.ToolReference `json:"ref"`
Profile InvocationAuthorityProfile `json:"profile"`
}
InvocationAuthorityRule binds a profile to one exact immutable tool reference. Revisions or generations changing require an explicit policy update rather than silently carrying authority onto new provider code.
type LiveBackend ¶ added in v0.0.2
type LiveBackend interface {
LoadState(ctx context.Context) (LiveStateRecord, error)
CompareAndSwapState(ctx context.Context, current LiveStateRecord, next LiveState) (bool, error)
StoreSnapshot(ctx context.Context, snapshot RetainedSnapshot, ttl time.Duration) (RetainedSnapshot, error)
LoadSnapshot(ctx context.Context, snapshotID string) (RetainedSnapshot, bool, error)
}
LiveBackend is the complete storage contract needed by LiveService. State replacement is CAS-protected; snapshots are immutable by SnapshotID. If a snapshot with the same ID already exists, StoreSnapshot returns that existing record rather than replacing it.
type LiveService ¶ added in v0.0.2
type LiveService struct {
// contains filtered or unexported fields
}
LiveService implements the ecosystem tool-catalog publication, lease, deterministic query/cursor, and exact describe semantics over LiveBackend.
func NewLiveService ¶ added in v0.0.2
func NewLiveService(backend LiveBackend, options LiveServiceOptions) (*LiveService, error)
NewLiveService constructs a service over any backend. A missing authorizer fails closed. Use NewStandaloneLiveService for the explicit single-user allow-all configuration.
func NewStandaloneLiveService ¶ added in v0.0.2
func NewStandaloneLiveService(options LiveServiceOptions) (*LiveService, error)
NewStandaloneLiveService constructs the dependency-free, single-user service. A supplied Authorizer is honored; otherwise standalone allow-all is selected explicitly.
func (*LiveService) Describe ¶ added in v0.0.2
func (s *LiveService) Describe(ctx context.Context, binding QueryBinding, request spec.ToolCatalogDescribeRequest) (spec.ToolCatalogDescribeResult, error)
Describe resolves one exact immutable reference, optionally within a retained query snapshot, and independently authorizes describe access.
func (*LiveService) DescribeResolved ¶ added in v0.0.2
func (s *LiveService) DescribeResolved(ctx context.Context, binding QueryBinding, request spec.ToolCatalogDescribeRequest) (ResolvedCatalogDescribeResult, error)
DescribeResolved is Describe's service-private context-preserving form.
func (*LiveService) Publish ¶ added in v0.0.2
func (s *LiveService) Publish(ctx context.Context, binding MutationBinding, publication spec.ToolCatalogPublication) (spec.ToolCatalogMutationResult, error)
Publish atomically replaces one registration after validating its trusted provider binding, generation transition, sequence, lease, and immutable refs.
func (*LiveService) Query ¶ added in v0.0.2
func (s *LiveService) Query(ctx context.Context, binding QueryBinding, query spec.ToolCatalogQuery) (spec.ToolCatalogPage, error)
Query returns a deterministic authorized page. Continuations load the exact retained snapshot and never merge it with current catalog state.
func (*LiveService) QueryResolved ¶ added in v0.0.2
func (s *LiveService) QueryResolved(ctx context.Context, binding QueryBinding, query spec.ToolCatalogQuery) (ResolvedCatalogPage, error)
QueryResolved returns the same deterministic snapshot/cursor result as Query while retaining each entry's trusted publication context for an edge adapter. It is an internal service projection, not a new ecosystem message.
func (*LiveService) Renew ¶ added in v0.0.2
func (s *LiveService) Renew(ctx context.Context, binding MutationBinding, request spec.ToolCatalogRenewRequest) (spec.ToolCatalogMutationResult, error)
Renew advances the current generation's sequence and extends its bounded lease without changing descriptors.
func (*LiveService) ResolveInvocation ¶ added in v0.0.2
func (s *LiveService) ResolveInvocation(ctx context.Context, binding QueryBinding, ref spec.ToolReference) (spec.ToolCatalogEntry, error)
ResolveInvocation resolves an exact reference only against the currently live, context-matching, routable generation, then performs the independent effect-specific invocation decision. It never falls back to a bare name, another revision, or a retained discovery decision.
func (*LiveService) ResolveInvocationRecord ¶ added in v0.0.2
func (s *LiveService) ResolveInvocationRecord(ctx context.Context, binding QueryBinding, ref spec.ToolReference) (ResolvedCatalogEntry, error)
ResolveInvocationRecord performs exact current-generation invocation resolution and returns the trusted publication context beside the entry.
func (*LiveService) Revoke ¶ added in v0.0.2
func (s *LiveService) Revoke(ctx context.Context, binding MutationBinding, request spec.ToolCatalogRevokeRequest) (spec.ToolCatalogMutationResult, error)
Revoke advances the sequence, removes the current generation, and writes a replay tombstone.
type LiveServiceOptions ¶ added in v0.0.2
type LiveServiceOptions struct {
Authorizer EntryAuthorizer
Liveness PublicationLiveness
InvocationAuthority InvocationAuthorityResolver
CursorKey []byte
MaxLease time.Duration
TombstoneRetention time.Duration
SnapshotRetention time.Duration
MaxCASRetries int
Now func() time.Time
}
LiveServiceOptions controls bounded leases, replay protection, retained snapshots, and cursor integrity. CursorKey should be stable across replicas; when omitted a process-local random key is generated (appropriate for standalone mode only).
type LiveState ¶ added in v0.0.2
type LiveState struct {
SchemaVersion string `json:"schema_version"`
Publications []spec.ToolCatalogPublication `json:"publications"`
ProviderRoutes []ProviderRouteBinding `json:"provider_routes,omitempty"`
Tombstones []GenerationTombstone `json:"tombstones,omitempty"`
}
LiveState is the backend-neutral, CAS-protected operational catalog state. Publications contain only the current generation for each provider registration. Tombstones reject delayed messages from replaced or revoked generations during a bounded replay-retention window.
type LiveStateRecord ¶ added in v0.0.2
LiveStateRecord is one backend read. Token is opaque and must be passed back unchanged to CompareAndSwapState. Exists distinguishes an absent initial state from a stored state.
type MCPServerSpec ¶
type MCPServerSpec struct {
Name string `json:"name"`
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Env []string `json:"env,omitempty"`
IdleTTLSeconds int `json:"idle_ttl_seconds,omitempty"`
Tools []MCPToolSpec `json:"tools,omitempty"`
Source *ResourceRevision `json:"source,omitempty"`
}
func (MCPServerSpec) IdleTTL ¶
func (s MCPServerSpec) IdleTTL() time.Duration
type MCPToolSpec ¶
type MCPToolSpec struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
InputSchema json.RawMessage `json:"input_schema,omitempty"`
Enabled bool `json:"enabled"`
}
type MemoryBackend ¶ added in v0.0.2
type MemoryBackend struct {
// contains filtered or unexported fields
}
MemoryBackend is the dependency-free LiveBackend used by standalone Sahara. It is safe for concurrent use within one process.
func NewMemoryBackend ¶ added in v0.0.2
func NewMemoryBackend() *MemoryBackend
NewMemoryBackend constructs an empty in-process catalog backend.
func (*MemoryBackend) CompareAndSwapState ¶ added in v0.0.2
func (b *MemoryBackend) CompareAndSwapState(_ context.Context, current LiveStateRecord, next LiveState) (bool, error)
func (*MemoryBackend) LoadSnapshot ¶ added in v0.0.2
func (b *MemoryBackend) LoadSnapshot(_ context.Context, snapshotID string) (RetainedSnapshot, bool, error)
func (*MemoryBackend) LoadState ¶ added in v0.0.2
func (b *MemoryBackend) LoadState(context.Context) (LiveStateRecord, error)
func (*MemoryBackend) StoreSnapshot ¶ added in v0.0.2
func (b *MemoryBackend) StoreSnapshot(_ context.Context, snapshot RetainedSnapshot, ttl time.Duration) (RetainedSnapshot, error)
type MutationBinding ¶ added in v0.0.2
type MutationBinding struct {
ProviderID string
RegistrationID string
Generation string
ProviderRoute string
RequiredContext spec.ToolCatalogContext
GenerationReplacement bool
}
MutationBinding is trusted transport state for one provider registration. RequiredContext is an authenticated confinement boundary: every non-empty field must be present and equal in a publication. GenerationReplacement is set only for a trusted reconnect/registration transition.
type Provider ¶
Provider supplies the catalog. Implementations include Static, filesystem discovery, and pkg/memorylayer.CatalogProvider.
type ProviderFunc ¶
ProviderFunc adapts a function to Provider (e.g. a store's LoadCatalog).
type ProviderRouteBinding ¶ added in v0.0.2
type ProviderRouteBinding struct {
ProviderID string `json:"provider_id"`
RegistrationID string `json:"registration_id"`
Generation string `json:"generation"`
ProviderRoute string `json:"provider_route"`
}
ProviderRouteBinding is authenticated operational state for one live provider generation. It is deliberately separate from the portable ToolCatalogContext: availability selectors describe where a tool applies, while ProviderRoute identifies the exact Aether recipient that executes it.
type PublicationLiveness ¶ added in v0.0.2
type PublicationLiveness interface {
CatalogPublicationRoutable(ctx context.Context, publication spec.ToolCatalogPublication) (bool, error)
}
PublicationLiveness lets an adapter add a trusted route/presence check on top of the protocol lease. nil means that the backend's live publication is routable, which is the correct standalone behavior.
type PublicationLivenessFunc ¶ added in v0.0.2
PublicationLivenessFunc adapts a function to PublicationLiveness.
func (PublicationLivenessFunc) CatalogPublicationRoutable ¶ added in v0.0.2
func (f PublicationLivenessFunc) CatalogPublicationRoutable(ctx context.Context, publication spec.ToolCatalogPublication) (bool, error)
type QueryBinding ¶ added in v0.0.2
type QueryBinding struct {
SubjectID string
PolicyEpoch string
AuthorityLineageID string
Context spec.ToolCatalogContext
}
QueryBinding is trusted edge state. SubjectID and PolicyEpoch are never copied from catalog payloads; they bind retained snapshots and cursors to the authenticated caller and current authorization epoch.
func StandaloneQueryBinding ¶ added in v0.0.2
func StandaloneQueryBinding(c spec.ToolCatalogContext) QueryBinding
StandaloneQueryBinding supplies explicit single-user authority for the dependency-free runtime while retaining the same snapshot/cursor boundary.
type ResolvedCatalogDescribeResult ¶ added in v0.0.2
type ResolvedCatalogDescribeResult struct {
SchemaVersion string `json:"schema_version"`
SnapshotID string `json:"snapshot_id"`
CatalogRevision string `json:"catalog_revision"`
Record ResolvedCatalogEntry `json:"record"`
}
ResolvedCatalogDescribeResult retains the trusted publication context for a service adapter while preserving Describe's independent authorization.
type ResolvedCatalogEntry ¶ added in v0.0.2
type ResolvedCatalogEntry struct {
Entry spec.ToolCatalogEntry `json:"entry"`
Context spec.ToolCatalogContext `json:"context"`
ProviderRoute string `json:"provider_route,omitempty"`
InvocationAuthority *InvocationAuthorityProfile `json:"invocation_authority,omitempty"`
}
ResolvedCatalogEntry retains the authenticated publication context beside an ecosystem catalog entry. The portable query page intentionally carries only entries; service adapters need this backend-owned context to route an exact invocation without copying provider routes into model-owned arguments.
type ResolvedCatalogPage ¶ added in v0.0.2
type ResolvedCatalogPage struct {
SchemaVersion string `json:"schema_version"`
SnapshotID string `json:"snapshot_id"`
CatalogRevision string `json:"catalog_revision"`
Records []ResolvedCatalogEntry `json:"records"`
AmbiguousNames []string `json:"ambiguous_names,omitempty"`
NextCursor string `json:"next_cursor,omitempty"`
}
ResolvedCatalogPage is the service-private projection of one deterministic catalog page. AmbiguousNames is computed over the complete retained snapshot, not merely this page, so a same-name collision that straddles a cursor boundary can never be exposed as an apparently unique bare tool name.
type ResourceRevision ¶ added in v0.0.2
type ResourceRevision struct {
System string `json:"system"`
ID string `json:"id"`
Revision int `json:"revision,omitempty"`
ETag string `json:"etag,omitempty"`
ManifestDigest string `json:"manifest_digest,omitempty"`
BundleDigest string `json:"bundle_digest,omitempty"`
}
ResourceRevision identifies the authoritative catalog resource from which an executable descriptor was projected. The catalog digest includes these fields, so an ETag or artifact change rotates the admitted snapshot even when a projection happens to render the same prompt text.
type RetainedSnapshot ¶ added in v0.0.2
type RetainedSnapshot struct {
SchemaVersion string `json:"schema_version"`
SnapshotID string `json:"snapshot_id"`
CatalogRevision string `json:"catalog_revision"`
BindingDigest string `json:"binding_digest"`
QueryDigest string `json:"query_digest"`
Limit uint32 `json:"limit"`
CreatedAt string `json:"created_at"`
ExpiresAt string `json:"expires_at"`
Records []ResolvedCatalogEntry `json:"records"`
}
RetainedSnapshot is an immutable, authorization-bound query result retained long enough to serve deterministic continuation cursors.
type SkillSpec ¶
type SkillSpec struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Path string `json:"path,omitempty"`
Content string `json:"content,omitempty"`
Enabled bool `json:"enabled"`
// AllowedTools is the skill's declared tool scope, parsed from an optional
// `allowed-tools` SKILL.md frontmatter key (YAML list or comma-separated
// string). Surfaced to the model only — enforcement is a turn-loop follow-up.
AllowedTools []string `json:"allowed_tools,omitempty"`
// Prereqs / PreferredModel carry metadata.scitrera.{prereq_skills,preferred_model}
// when the SOURCE already has it structured (e.g. a MemoryLayer catalog, which
// strips SKILL.md frontmatter into a metadata field and leaves Content
// frontmatter-less). BuildRegistry prefers these; when empty it falls back to
// parsing the body frontmatter (the on-disk SKILL.md path).
Prereqs []string `json:"prereq_skills,omitempty"`
PreferredModel string `json:"preferred_model,omitempty"`
Source *ResourceRevision `json:"source,omitempty"`
}
func MergeSkills ¶ added in v0.0.2
MergeSkills combines a lower-precedence catalog with a higher-precedence catalog deterministically. The first occurrence fixes ordering; a later duplicate replaces its value. This lets workspace filesystem skills override MemoryLayer skills without making the prompt order depend on map iteration.
type StaticInvocationAuthorityPolicy ¶ added in v0.0.2
type StaticInvocationAuthorityPolicy struct {
// contains filtered or unexported fields
}
func NewStaticInvocationAuthorityPolicy ¶ added in v0.0.2
func NewStaticInvocationAuthorityPolicy(rules []InvocationAuthorityRule) (*StaticInvocationAuthorityPolicy, error)
func (*StaticInvocationAuthorityPolicy) ResolveInvocationAuthority ¶ added in v0.0.2
func (p *StaticInvocationAuthorityPolicy) ResolveInvocationAuthority(_ context.Context, _ spec.ToolCatalogContext, entry spec.ToolCatalogEntry) (*InvocationAuthorityProfile, error)
type ToolSpec ¶
type ToolSpec struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
InputSchema json.RawMessage `json:"input_schema,omitempty"`
Enabled bool `json:"enabled"`
}
type WorkspaceProvider ¶ added in v0.0.2
type WorkspaceProvider interface {
LoadWorkspace(ctx context.Context, workspaceID string) (Catalog, error)
}
WorkspaceProvider loads a catalog for one resolved logical workspace. Empty workspace identifiers select the provider's configured default.
func BindWorkspaceProvider ¶ added in v0.0.2
func BindWorkspaceProvider(provider WorkspaceProvider, logicalDefault, backendDefault string) WorkspaceProvider
BindWorkspaceProvider applies a logical-to-backend default mapping. A nil provider remains nil so filesystem-only hosts need no special case.
type WorkspaceProviderFunc ¶ added in v0.0.2
WorkspaceProviderFunc adapts a function to WorkspaceProvider.
func (WorkspaceProviderFunc) LoadWorkspace ¶ added in v0.0.2
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package catalogrpc exposes the Go live catalog through a small private service boundary.
|
Package catalogrpc exposes the Go live catalog through a small private service boundary. |