plugins

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Overview

Package plugins contains orb's default-off first-party extensions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Catalog

func Catalog(option ...Options) map[string]extensions.Factory

Catalog returns fresh extension factories for embedders to select per instance.

func Control

func Control(cwd, agentDir string, settings *config.SettingsManager) extensions.Factory

Control registers /plugins independently of the default-off plugin catalog. cwd and agentDir feed the in-window package installer; empty values disable it (SDK embedders composing their own assemblies).

func Description

func Description(name string) string

Description returns the one-line description used by the CLI and TUI.

func MemoryWithStore

func MemoryWithStore(store memorysdk.Store) extensions.Factory

MemoryWithStore returns the dormant memory plugin with a caller-supplied, tenant-scoped Store.

func Names

func Names() []string

Names returns the stable first-party plugin order.

func SandboxMode

func SandboxMode(settings *config.SettingsManager) (sandbox.Mode, error)

SandboxMode returns the filesystem sandbox selected by the enabled permissions plugin.

Types

type Action

type Action string

Action is the ecosystem-standard three-state permission result.

const (
	Allow Action = "allow"
	Deny  Action = "deny"
	Ask   Action = "ask"
)

type Decision

type Decision struct {
	Time       int64  `json:"time"`
	Tool       string `json:"tool"`
	Action     Action `json:"action"`
	Resolved   Action `json:"resolved"`
	Mode       string `json:"mode"`
	Rule       int    `json:"rule,omitempty"`
	Matcher    string `json:"matcher,omitempty"`
	Input      string `json:"input,omitempty"`
	Resolution string `json:"resolution,omitempty"`
}

Decision records the matched policy and its runtime resolution.

type Options

type Options struct {
	StreamFn   engine.StreamFn
	HTTPClient *http.Client
	Settings   *config.SettingsManager
	Policy     *Policy
	AgentDir   string
}

Options supplies explicit runtime seams so bundled plugins remain instance-scoped.

type Policy

type Policy struct {
	// Sandbox is consumed by cmd/orb through SandboxMode (settings-driven);
	// embedders wire sandbox.Wrap into their own bash tool themselves.
	Sandbox     sandbox.Mode `json:"sandbox,omitempty"`
	Mode        string       `json:"mode,omitempty"`
	AskFallback Action       `json:"askFallback,omitempty"`
	Rules       []Rule       `json:"rules,omitempty"`

	Authorizer func(context.Context, ToolCallInfo) (Action, error) `json:"-"`
	// Guards are hard deny-only constraints: any non-empty reason denies,
	// even in log mode.
	Guards []func(context.Context, ToolCallInfo) string `json:"-"`
	// contains filtered or unexported fields
}

Policy is constructible by SDK embedders and shared with in-process children.

func (*Policy) Evaluate

func (policy *Policy) Evaluate(ctx context.Context, info ToolCallInfo) Decision

Evaluate applies the authorizer, deny-only guards, then last-match-wins rules.

func (*Policy) SetMode

func (policy *Policy) SetMode(mode string)

type Rule

type Rule struct {
	Tool    string `json:"tool,omitempty"`
	Command string `json:"command,omitempty"`
	Path    string `json:"path,omitempty"`
	Action  Action `json:"action"`
}

Rule is one ordered permission rule. Empty Tool means "*".

type ToolCallInfo

type ToolCallInfo struct {
	Tool      string
	Args      any
	CWD       string
	SessionID string
}

ToolCallInfo is the low-level SDK authorization input.

Jump to

Keyboard shortcuts

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