Documentation
¶
Index ¶
- func Bridge(extensionTool ExtensionTool) toolspkg.Tool
- func CanTransitionMCP(from, to ExtensionStatus) bool
- func NormalizeLegacySkill(skill skillspkg.Skill) skillspkg.Skill
- func ResolvePolicyToolSets(policy skillspkg.ToolPolicy, bindings []BridgeBinding) (map[string]struct{}, map[string]struct{}, error)
- func SkillExtensionID(skillName string) string
- func StableToolKey(source ExtensionKind, extensionID, toolName string) (string, error)
- func ValidateMCPTransition(from, to ExtensionStatus) error
- type BridgeBinding
- type BridgeRegisterOptions
- type CapabilitySet
- type ErrorCode
- type Extension
- type ExtensionError
- type ExtensionEvent
- type ExtensionInfo
- type ExtensionKind
- type ExtensionScope
- type ExtensionSource
- type ExtensionStatus
- type ExtensionTool
- type HealthSnapshot
- type HealthTester
- type Invalidator
- type Manager
- type Manifest
- type NopManager
- func (NopManager) Get(_ context.Context, extensionID string) (ExtensionInfo, error)
- func (NopManager) Invalidate(_ string)
- func (NopManager) List(_ context.Context) ([]ExtensionInfo, error)
- func (NopManager) Load(_ context.Context, _ string) (ExtensionInfo, error)
- func (NopManager) Reload(_ context.Context) error
- func (NopManager) ResolveAllTools(_ context.Context) ([]ExtensionTool, error)
- func (NopManager) Test(_ context.Context, _ string) (HealthSnapshot, error)
- func (NopManager) Unload(_ context.Context, _ string) error
- type Reloader
- type ToolResolver
- type ToolUseContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bridge ¶
func Bridge(extensionTool ExtensionTool) toolspkg.Tool
Bridge projects an extension tool to the source-aware tool namespace. Invalid inputs are returned unchanged; callers that need strict validation should use RegisterBridgedTool.
func CanTransitionMCP ¶
func CanTransitionMCP(from, to ExtensionStatus) bool
func ResolvePolicyToolSets ¶
func ResolvePolicyToolSets(policy skillspkg.ToolPolicy, bindings []BridgeBinding) (map[string]struct{}, map[string]struct{}, error)
func SkillExtensionID ¶
SkillExtensionID builds the canonical extension id from a skill name. It intentionally prefixes with "skill." even when the input already has that prefix to keep backward compatibility with existing extension ids.
func StableToolKey ¶
func StableToolKey(source ExtensionKind, extensionID, toolName string) (string, error)
func ValidateMCPTransition ¶
func ValidateMCPTransition(from, to ExtensionStatus) error
Types ¶
type BridgeBinding ¶
type BridgeBinding struct {
Source ExtensionKind
ExtensionID string
OriginalName string
StableKey string
}
func RegisterBridgedTool ¶
func RegisterBridgedTool(registry *toolspkg.Registry, extensionTool ExtensionTool) (BridgeBinding, error)
func RegisterBridgedToolWithOptions ¶
func RegisterBridgedToolWithOptions(registry *toolspkg.Registry, extensionTool ExtensionTool, opts BridgeRegisterOptions) (BridgeBinding, error)
type BridgeRegisterOptions ¶
type BridgeRegisterOptions struct {
AllowOriginalNameShadowBuiltin bool
}
type ErrorCode ¶
type ErrorCode string
const ( ErrCodeInvalidSource ErrorCode = "invalid_source" ErrCodeInvalidManifest ErrorCode = "invalid_manifest" ErrCodeInvalidExtension ErrorCode = "invalid_extension" ErrCodeInvalidTransition ErrorCode = "invalid_transition" ErrCodeNotFound ErrorCode = "not_found" ErrCodeDuplicate ErrorCode = "duplicate_extension" ErrCodeAlreadyLoaded ErrorCode = "already_loaded" ErrCodeConflict ErrorCode = "conflict" ErrCodeBusy ErrorCode = "busy" ErrCodeLoadFailed ErrorCode = "load_failed" ErrCodeUnloadFailed ErrorCode = "unload_failed" )
type Extension ¶
type Extension interface {
Info() ExtensionInfo
ResolveTools(ctx context.Context) ([]ExtensionTool, error)
Health(ctx context.Context) (HealthSnapshot, error)
}
Extension models a loadable extension source (for example skill or mcp). Implementations should keep failures local to the extension instance and expose health degradation through Health rather than process-level errors.
type ExtensionError ¶
func (*ExtensionError) CodeString ¶
func (e *ExtensionError) CodeString() string
func (*ExtensionError) Error ¶
func (e *ExtensionError) Error() string
func (*ExtensionError) Unwrap ¶
func (e *ExtensionError) Unwrap() error
type ExtensionEvent ¶
type ExtensionEvent struct {
Type string
ExtensionID string
Kind ExtensionKind
Status ExtensionStatus
Reason string
ErrorCode ErrorCode
OccurredAt string
Message string
}
type ExtensionInfo ¶
type ExtensionInfo struct {
ID string
Name string
Kind ExtensionKind
Version string
Title string
Description string
Source ExtensionSource
Status ExtensionStatus
Capabilities CapabilitySet
Manifest Manifest
Health HealthSnapshot
}
func (ExtensionInfo) IsZero ¶
func (info ExtensionInfo) IsZero() bool
func (ExtensionInfo) Valid ¶
func (info ExtensionInfo) Valid() bool
type ExtensionKind ¶
type ExtensionKind string
const ( ExtensionMCP ExtensionKind = "mcp" ExtensionSkill ExtensionKind = "skill" )
type ExtensionScope ¶
type ExtensionScope string
const ( ExtensionScopeBuiltin ExtensionScope = "builtin" ExtensionScopeUser ExtensionScope = "user" ExtensionScopeProject ExtensionScope = "project" ExtensionScopeRemote ExtensionScope = "remote" )
type ExtensionSource ¶
type ExtensionSource struct {
Scope ExtensionScope
Ref string
}
type ExtensionStatus ¶
type ExtensionStatus string
const ( ExtensionStatusUnknown ExtensionStatus = "unknown" ExtensionStatusPending ExtensionStatus = "pending" ExtensionStatusLoaded ExtensionStatus = "loaded" ExtensionStatusActive ExtensionStatus = "active" ExtensionStatusReady ExtensionStatus = "ready" ExtensionStatusDegraded ExtensionStatus = "degraded" ExtensionStatusFailed ExtensionStatus = "failed" ExtensionStatusStopped ExtensionStatus = "stopped" )
type ExtensionTool ¶
type ExtensionTool struct {
Source ExtensionKind
ExtensionID string
Tool toolspkg.Tool
}
type HealthSnapshot ¶
type HealthSnapshot struct {
Status ExtensionStatus
Message string
LastError ErrorCode
CheckedAtUTC string
}
type HealthTester ¶
type HealthTester interface {
Test(ctx context.Context, extensionID string) (HealthSnapshot, error)
}
HealthTester is an optional manager capability used by /mcp and CLI health checks to force a server probe and return the latest snapshot.
type Invalidator ¶
type Invalidator interface {
Invalidate(extensionID string)
}
Invalidator is an optional manager capability for marking extension runtime caches dirty so the next sync can refresh eagerly.
type Manager ¶
type Manager interface {
Load(ctx context.Context, source string) (ExtensionInfo, error)
Unload(ctx context.Context, extensionID string) error
Get(ctx context.Context, extensionID string) (ExtensionInfo, error)
List(ctx context.Context) ([]ExtensionInfo, error)
}
func NewManager ¶
func NewManagerWithDirs ¶
type Manifest ¶
type Manifest struct {
Name string
Version string
Title string
Description string
Kind ExtensionKind
Source ExtensionSource
Capabilities CapabilitySet
}
type NopManager ¶
type NopManager struct{}
NopManager keeps extension layer explicit while integration is incremental.
func (NopManager) Get ¶
func (NopManager) Get(_ context.Context, extensionID string) (ExtensionInfo, error)
func (NopManager) Invalidate ¶
func (NopManager) Invalidate(_ string)
func (NopManager) List ¶
func (NopManager) List(_ context.Context) ([]ExtensionInfo, error)
func (NopManager) Load ¶
func (NopManager) Load(_ context.Context, _ string) (ExtensionInfo, error)
func (NopManager) ResolveAllTools ¶
func (NopManager) ResolveAllTools(_ context.Context) ([]ExtensionTool, error)
func (NopManager) Test ¶
func (NopManager) Test(_ context.Context, _ string) (HealthSnapshot, error)
type Reloader ¶
Reloader is an optional manager capability for force-refreshing extension runtime state (for example after config mutations).
type ToolResolver ¶
type ToolResolver interface {
ResolveAllTools(ctx context.Context) ([]ExtensionTool, error)
}
ToolResolver is an optional manager capability for resolving extension tools into bridgeable tool definitions for registry sync.