extensions

package
v1.5.37 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 38 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package extensions owns the host-side extension boundary. Discovery does not execute code; approved sources are connected only explicitly or after a tool gate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() string

func DisplayText

func DisplayText(s string, limit int) string

DisplayText is for terminal-facing data, not for rewriting executable input.

func ModelName

func ModelName(ref SourceRef, name string) string

ModelName is deterministic even when multiple wire names sanitize alike.

func WriteSource

func WriteSource(path string, ref SourceRef, c *SourceConfig) error

WriteSource edits just one canonical source table, preserving unrelated tables/comments. Noncanonical dotted/inline representations fail closed.

Types

type Catalog

type Catalog struct {
	Protocol  string               `json:"protocol,omitempty"`
	Version   string               `json:"version,omitempty"`
	Tools     []extension.ToolSpec `json:"tools"`
	Commands  []Item               `json:"commands,omitempty"`
	Events    []string             `json:"events,omitempty"`
	Prompts   []Item               `json:"prompts,omitempty"`
	Resources []Item               `json:"resources,omitempty"`
}

type Config

type Config struct {
	Plugins map[string]SourceConfig `toml:"plugins"`
	MCP     struct {
		Servers map[string]SourceConfig `toml:"servers"`
	} `toml:"mcp"`
}

func LoadConfig

func LoadConfig(path string) (Config, error)

type Item

type Item struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	URI         string `json:"uri,omitempty"`
}

type Manager

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

func New

func New(opts Options) (*Manager, error)

func (*Manager) Approve

func (m *Manager) Approve(ref SourceRef) error

func (*Manager) ApproveSession

func (m *Manager) ApproveSession(ref SourceRef) error

ApproveSession must not become persistent when a later probe saves its catalog. Session admission and remembered trust are separate state.

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) Config

func (m *Manager) Config(ref SourceRef) (SourceConfig, error)

func (*Manager) Connect

func (m *Manager) Connect(ctx context.Context, ref SourceRef) error

func (*Manager) Cwd

func (m *Manager) Cwd() string

func (*Manager) Disable

func (m *Manager) Disable(ref SourceRef) error

func (*Manager) Disconnect

func (m *Manager) Disconnect(ref SourceRef) error

func (*Manager) Enable

func (m *Manager) Enable(ref SourceRef) error

func (*Manager) KnownTools

func (m *Manager) KnownTools() []agentcore.AgentTool

KnownTools is used for validating explicit operator tool names before the allow/deny filter. It is never registered directly for execution.

func (*Manager) List

func (m *Manager) List() []Snapshot

func (*Manager) Logs

func (m *Manager) Logs(ref SourceRef) (string, error)

func (*Manager) Observe

func (m *Manager) Observe(ev agentcore.AgentEvent)

Observe only queues host-owned metadata. Message bodies, tool arguments and result text are never copied into an extension event subscription.

func (*Manager) PackageSkills

func (m *Manager) PackageSkills() map[string]string

PackageSkills returns only approved enabled package roots. Independent skills retain their existing discovery order and win same-name collisions upstream.

func (*Manager) Prompt

func (m *Manager) Prompt(ctx context.Context, ref SourceRef, name string, args map[string]string) (string, error)

func (*Manager) Refresh

func (m *Manager) Refresh(ctx context.Context, ref SourceRef) error

func (*Manager) RefreshDirty

func (m *Manager) RefreshDirty(ctx context.Context)

RefreshDirty only uses already-established sessions. No new process or connection can be introduced by a list_changed notification.

func (*Manager) Reset added in v1.5.16

func (m *Manager) Reset(ref SourceRef) error

Reset clears only this source HOME, with its persistent parent lock retained. The caller must obtain a separate explicit operator confirmation.

func (*Manager) Resource

func (m *Manager) Resource(ctx context.Context, ref SourceRef, uri string) (string, error)

func (*Manager) Revision

func (m *Manager) Revision() uint64

func (*Manager) SetSkillEnabled

func (m *Manager) SetSkillEnabled(name string, enabled bool) bool

func (*Manager) SetSkills

func (m *Manager) SetSkills(skills []*runtime.Skill, off bool)

func (*Manager) Setup added in v1.5.16

func (m *Manager) Setup(ctx context.Context, ref SourceRef, show func(setupevent.Event) error) error

Setup is an explicit operator action, never a model tool or handshake side effect. Its callback runs as events arrive, while the child keeps polling.

func (*Manager) SetupVariant added in v1.5.16

func (m *Manager) SetupVariant(ctx context.Context, ref SourceRef, variant string, show func(setupevent.Event) error) error

func (*Manager) Skill

func (m *Manager) Skill(name string) *runtime.Skill

func (*Manager) SkillRoots

func (m *Manager) SkillRoots() []string

func (*Manager) SkillViews

func (m *Manager) SkillViews() []SkillView

func (*Manager) Skills

func (m *Manager) Skills() []*runtime.Skill

func (*Manager) Tools

func (m *Manager) Tools() []agentcore.AgentTool

type Options

type Options struct {
	Cwd           string
	ConfigPath    string
	Allow         func(string) bool
	Permissions   *permissions.State
	NoTools       bool
	IgnoreSources bool // embedders opt in separately from built-in tools
}

type SkillView

type SkillView struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Path        string `json:"path"`
	State       string `json:"state"`
	ProvidedBy  string `json:"provided_by,omitempty"`
}

type Snapshot

type Snapshot struct {
	Ref            SourceRef      `json:"source"`
	Type           string         `json:"type"`
	Enabled        bool           `json:"enabled"`
	Trust          string         `json:"trust"`
	State          string         `json:"state"`
	Authentication string         `json:"authentication"`
	Endpoint       string         `json:"endpoint,omitempty"`
	Version        string         `json:"version,omitempty"`
	Protocol       string         `json:"protocol,omitempty"`
	LastError      string         `json:"last_error,omitempty"`
	Tools          []ToolView     `json:"tools"`
	Commands       []Item         `json:"commands,omitempty"`
	Events         []string       `json:"events,omitempty"`
	Prompts        []Item         `json:"prompts,omitempty"`
	Resources      []Item         `json:"resources,omitempty"`
	Revision       uint64         `json:"revision"`
	Capabilities   map[string]any `json:"capabilities,omitempty"`
}

type SourceConfig

type SourceConfig struct {
	Enabled         bool                `toml:"enabled" json:"enabled"`
	Runtime         string              `toml:"runtime,omitempty" json:"runtime,omitempty"`
	Manifest        string              `toml:"manifest,omitempty" json:"manifest,omitempty"`
	Transport       string              `toml:"transport,omitempty" json:"transport,omitempty"`
	Command         string              `toml:"command,omitempty" json:"command,omitempty"`
	Args            []string            `toml:"args,omitempty" json:"args,omitempty"`
	URL             string              `toml:"url,omitempty" json:"url,omitempty"`
	Dir             string              `toml:"dir,omitempty" json:"dir,omitempty"`
	Env             map[string]string   `toml:"env,omitempty" json:"env,omitempty"`
	EnvPassthrough  []string            `toml:"env_passthrough,omitempty" json:"env_passthrough,omitempty"`
	Headers         map[string]string   `toml:"headers,omitempty" json:"headers,omitempty"`
	AllowedTools    []string            `toml:"allowed_tools,omitempty" json:"allowed_tools,omitempty"`
	DisallowedTools []string            `toml:"disallowed_tools,omitempty" json:"disallowed_tools,omitempty"`
	StartupTimeout  string              `toml:"startup_timeout,omitempty" json:"startup_timeout,omitempty"`
	CallTimeout     string              `toml:"call_timeout,omitempty" json:"call_timeout,omitempty"`
	Network         bool                `toml:"network,omitempty" json:"network,omitempty"`
	StateDir        bool                `toml:"state_dir,omitempty" json:"state_dir,omitempty"`
	Setup           []string            `toml:"setup,omitempty" json:"setup,omitempty"`
	SetupVariants   map[string][]string `toml:"setup_variants,omitempty" json:"setup_variants,omitempty"`
	SetupOrigins    []string            `toml:"setup_origins,omitempty" json:"setup_origins,omitempty"`
	Executables     []string            `toml:"executables,omitempty" json:"executables,omitempty"`
	Skills          string              `toml:"skills,omitempty" json:"skills,omitempty"`
	ConfirmTools    []string            `toml:"confirm_tools,omitempty" json:"confirm_tools,omitempty"`
	AggregateTools  []string            `toml:"aggregate_tools,omitempty" json:"aggregate_tools,omitempty"`
	// contains filtered or unexported fields
}

SourceConfig is an operator declaration, never a model argument. Network is the immutable launch ceiling of a local process, not a per-call grant.

type SourceRef

type SourceRef = extension.SourceRef

type ToolView

type ToolView struct {
	Spec      extension.ToolSpec `json:"spec"`
	ModelName string             `json:"model_name"`
	State     string             `json:"state"`
	Reason    string             `json:"reason,omitempty"`
}

Jump to

Keyboard shortcuts

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