subagentprofile

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package subagentprofile loads the declarative role and persona presets that parameterize a delegated child. It owns discovery and validation only; the Runtime resolves a preset against its captured model and tool catalogs before any child runs, so a preset can never grant authority by itself.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalid reports a malformed preset declaration or option set.
	ErrInvalid = errors.New("coding subagent profile: invalid")
	// ErrLimitExceeded reports bounded preset discovery or content exhaustion.
	ErrLimitExceeded = errors.New("coding subagent profile: limit exceeded")
	// ErrInsecure reports an unsafe user-owned preset root.
	ErrInsecure = errors.New("coding subagent profile: insecure root")
)

Functions

func IsolationWorktree

func IsolationWorktree(value string) bool

IsolationWorktree reports whether the isolation spelling requests a worktree.

Types

type Diagnostic

type Diagnostic struct {
	Code       string
	Source     string
	Winner     string
	Suppressed string
	Message    string
}

Diagnostic is a bounded, content-free discovery decision.

type Limits

type Limits struct {
	MaxEntries    int
	MaxPresets    int
	MaxFileBytes  int64
	MaxTotalBytes int64
	// MaxPromptBytes bounds one resolved role prompt or persona instruction
	// file.
	MaxPromptBytes int64
	MaxNameBytes   int
}

Limits bounds preset discovery and content.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns the production preset discovery bounds.

type Options

type Options struct {
	Paths          paths.Layout
	Tree           *workspace.Tree
	ProjectTrusted bool
	InlineRoles    map[string]config.SubagentRole
	InlinePersonas map[string]config.SubagentPersona
	Limits         Limits
}

Options select the user root, the optional trusted project root, and the inline declarations that take precedence over both.

type Registry

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

Registry is an immutable snapshot of the resolved presets. It has no model, Tool, or credential dependency, so holding it cannot grant authority.

func Load

func Load(ctx context.Context, options Options) (Registry, error)

Load discovers role and persona presets from the user root, the trusted project root, and the inline declarations, then returns one detached snapshot. Project roots are never inspected until ProjectTrusted is true. Inline declarations win over project files, which win over user files.

func (Registry) Clone

func (r Registry) Clone() Registry

Clone returns a detached registry snapshot.

func (Registry) Diagnostics

func (r Registry) Diagnostics() []Diagnostic

Diagnostics returns deterministic discovery diagnostics.

func (Registry) Persona

func (r Registry) Persona(name string) (config.SubagentPersona, bool)

Persona returns the resolved persona for name.

func (Registry) Role

func (r Registry) Role(name string) (config.SubagentRole, bool)

Role returns the resolved role for name.

Jump to

Keyboard shortcuts

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