extensions

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package extensions owns immutable, framework-free extension catalog snapshots.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound  = errors.New("extension not found")
	ErrAmbiguous = errors.New("extension name is ambiguous")
	ErrUntrusted = errors.New("extension is not trusted for invocation")
	ErrInactive  = errors.New("extension is not active for the current session")
	ErrChanged   = errors.New("extension source changed after snapshot")
	ErrResource  = errors.New("invalid skill resource")
	ErrClosed    = errors.New("extension store is closed")
)

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog is immutable after publication by Store.StartSession.

func (Catalog) AllSkills

func (c Catalog) AllSkills() []Skill

func (Catalog) AllowedMCPNames

func (c Catalog) AllowedMCPNames() []string

AllowedMCPNames returns exact qualified activation names in stable order.

func (Catalog) CompiledPlugins

func (c Catalog) CompiledPlugins() []CompiledPlugin

func (Catalog) Instructions

func (c Catalog) Instructions() []Instruction

func (Catalog) LoadSkill

func (c Catalog) LoadSkill(ctx context.Context, name string, model bool) (LoadedSkill, error)

LoadSkill bounded-reads and digest-verifies the selected snapshot source.

func (Catalog) LoadSkillResource

func (c Catalog) LoadSkillResource(ctx context.Context, name, resource string, model bool) (string, error)

LoadSkillResource reads one confined regular UTF-8 resource on demand.

func (Catalog) LoadTemplate

func (c Catalog) LoadTemplate(ctx context.Context, name string, model bool) (LoadedTemplate, error)

LoadTemplate bounded-reads and digest-verifies the selected template source.

func (Catalog) MCPServers

func (c Catalog) MCPServers() []MCPServer

func (Catalog) ResolveMCP

func (c Catalog) ResolveMCP(name string) (config.MCPServer, error)

ResolveMCP returns one consent-gated runtime descriptor. Secrets remain out of list records and warnings.

func (Catalog) Skills

func (c Catalog) Skills() []Skill

func (Catalog) Templates

func (c Catalog) Templates() []Template

func (Catalog) Warnings

func (c Catalog) Warnings() []warning.Warning

type CompiledPlugin

type CompiledPlugin struct {
	Name       string       `json:"name"`
	Provenance []Provenance `json:"provenance"`
}

type Instruction

type Instruction struct {
	Name       string       `json:"name"`
	Provenance []Provenance `json:"provenance"`
}

Instruction and CompiledPlugin complete the normalized catalog kinds.

type LoadedSkill

type LoadedSkill struct {
	Skill              Skill
	SelectedName       string
	SelectedProvenance Provenance
	Root               string
	PluginRoot         string
	PluginData         string
	Body               string
	Arguments          []string
	Globs              []string
	AllowedTools       []ToolPattern
	DeniedTools        []ToolPattern
	Restricted         bool
	Warnings           []warning.Warning
}

LoadedSkill is one digest-verified lazy body and invocation policy.

type LoadedTemplate

type LoadedTemplate struct {
	Template           Template
	SelectedName       string
	SelectedProvenance Provenance
	Root               string
	PluginRoot         string
	PluginData         string
	Body               string
	Arguments          []string
	AllowedTools       []ToolPattern
	DeniedTools        []ToolPattern
	Restricted         bool
	Warnings           []warning.Warning
}

LoadedTemplate is one digest-verified lazy template and invocation policy.

type MCPServer

type MCPServer struct {
	Name           string       `json:"name"`
	QualifiedNames []string     `json:"qualified_names"`
	Transport      string       `json:"transport"`
	Foreign        bool         `json:"foreign"`
	Allowed        bool         `json:"allowed"`
	Provenance     []Provenance `json:"provenance"`
}

MCPServer is a secret-free activation descriptor.

type Metadata

type Metadata struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Metadata is one deterministic Agent Skills metadata entry.

type Options

type Options struct {
	WorkingDir       string
	HomeDir          string
	SkillRoots       []string
	Foreign          foreign.Options
	Claude           bool
	Codex            bool
	Copilot          bool
	MCP              config.MCP
	Instructions     []Instruction
	CompiledPlugins  []CompiledPlugin
	MaxResourceBytes int64
	MaxEntries       int
	WarningSink      warning.Warner
}

Options configures stable per-session extension snapshots.

type Provenance

type Provenance struct {
	Host           string `json:"host"`
	Scope          string `json:"scope"`
	SourcePath     string `json:"source_path"`
	PluginID       string `json:"plugin_id"`
	PluginVersion  string `json:"plugin_version"`
	Enabled        bool   `json:"enabled"`
	Trusted        bool   `json:"trusted"`
	Classification string `json:"classification"`
}

Provenance identifies one retained source without activation secrets.

type Skill

type Skill struct {
	Name           string       `json:"name"`
	QualifiedNames []string     `json:"qualified_names"`
	Description    string       `json:"description"`
	License        string       `json:"license"`
	Compatibility  string       `json:"compatibility"`
	Metadata       []Metadata   `json:"metadata"`
	Globs          []string     `json:"globs"`
	Provenance     []Provenance `json:"provenance"`
	ModelInvocable bool         `json:"model_invocable"`
	UserInvocable  bool         `json:"user_invocable"`
}

Skill is safe list metadata. Bodies and resources are never retained here.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store owns immutable catalog snapshots keyed by session.

func NewStore

func NewStore(options Options) (*Store, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) DropSession

func (s *Store) DropSession(sessionID string)

func (*Store) Format

func (*Store) Format(state fmt.State, _ rune)

Format prevents secret-bearing activation configuration from appearing in diagnostic formatting.

func (*Store) LogValue

func (*Store) LogValue() slog.Value

LogValue prevents structured logging from reflecting activation internals.

func (*Store) ObserveTouch

func (s *Store) ObserveTouch(_ context.Context, touch workspace.Touch)

ObserveTouch activates path-scoped skills in the touched session. Catalog records remain stable; only model exposure changes monotonically.

func (*Store) Snapshot

func (s *Store) Snapshot(sessionID string) (Catalog, bool)

func (*Store) StartSession

func (s *Store) StartSession(ctx context.Context, sessionID string) error

func (*Store) StartSessionWithInstructions

func (s *Store) StartSessionWithInstructions(ctx context.Context, sessionID string, instructions []Instruction) error

StartSessionWithInstructions captures one snapshot and appends instruction metadata discovered by the Harness-owned context resolver.

type Template

type Template struct {
	Name           string       `json:"name"`
	QualifiedNames []string     `json:"qualified_names"`
	Provenance     []Provenance `json:"provenance"`
	ModelInvocable bool         `json:"model_invocable"`
	UserInvocable  bool         `json:"user_invocable"`
}

Template is safe template list metadata.

type ToolPattern

type ToolPattern struct {
	Tool     string `json:"tool"`
	Argument string `json:"argument"`
}

ToolPattern is the framework-free public projection of a tool policy row.

Jump to

Keyboard shortcuts

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