Documentation
¶
Overview ¶
Package wiring assembles the personal runner (provider, tools, store, rules) shared by the CLI and ACP front ends.
Index ¶
- Constants
- func ApprovalRuleSourceChanged(before, after ApprovalRuleSource) bool
- func BuiltinLangRuleFiles() []codeintel.BuiltinRuleFile
- func BuiltinNudgeRulesYAML() []byte
- func BuiltinOutputRuleFiles() []native.BuiltinRuleFile
- func ContextNotices(tr i18n.Translator, c ManifestContext, skills ManifestSkills) []string
- func InspectNudgeRules(workspace string) ([]NudgeRuleReport, []RuleFileSkip)
- func NewManifestTool(source ManifestSource) *manifestTool
- func NewTaskManager(onNotice func(tasks.Info)) (*tasks.Manager, appconfig.TaskSettings, error)
- func OpenEmbeddedMemory(ctx context.Context, workspaceRoot string, repo *store.Store, ...) (*memory.Governed, error)
- func PersistApprovalRule(path string, destination rules.Source, rule rules.Rule, ...) error
- func ReadImageAt(workspace, path string) (agentcore.ImagePart, string, error)
- func SessionModelReference(ctx context.Context, sessionID string) (string, error)
- func SessionRunMode(ctx context.Context, sessionID string) (string, error)
- func SetBuildVersion(v string)
- func SetupLogging() error
- func TotalSuggestion() string
- func WriteApprovalRule(path string, rule rules.Rule) error
- type ApprovalRuleEvent
- type ApprovalRulePersistEvent
- type ApprovalRulePersistReporter
- type ApprovalRuleSource
- type ApprovalRules
- type BuiltinLangRuleFile
- type BuiltinOutputRuleFile
- type ContextFile
- type ContextPart
- type ContextReport
- type EnvHooks
- type EnvMCPServer
- type EnvRuleFile
- type EnvRules
- type EnvSkill
- type EnvTool
- type LocalEnv
- type Manifest
- type ManifestApprovalDefaults
- type ManifestApprovalIgnoredRule
- type ManifestApprovalRules
- type ManifestApprovalSource
- type ManifestContext
- type ManifestContextFile
- type ManifestContextPart
- type ManifestContextTruncated
- type ManifestInput
- type ManifestLanguage
- type ManifestMCPServer
- type ManifestMemory
- type ManifestModel
- type ManifestModels
- type ManifestNudgeRule
- type ManifestOptions
- type ManifestOutput
- type ManifestPreferred
- type ManifestReadRoot
- type ManifestRuleLayer
- type ManifestSkillShadow
- type ManifestSkillSkipped
- type ManifestSkills
- type ManifestSource
- type ManifestTaint
- type ManifestTool
- type ManifestToolConflict
- type ManifestWritePolicy
- type MemoryBackendChoice
- type MemoryConfig
- type MemoryConfirmFunc
- type MemoryExecConfig
- type MemorySetup
- type ModelOption
- type NudgeRuleReport
- type Options
- type PreferredToolStatus
- type ResidentContext
- type ResidentReport
- type RuleFileFingerprint
- type RuleFileSkip
- type Runtime
- func (rt *Runtime) ApplyAddDirs(ctx context.Context, sessionID string) error
- func (p *Runtime) Close() error
- func (rt *Runtime) LocalCommands() *native.LocalCommand
- func (rt *Runtime) ModelOptions() []ModelOption
- func (rt *Runtime) PasteImageCallback() func() (agentcore.ImagePart, string, error)
- func (rt *Runtime) ReadImage(path string) (agentcore.ImagePart, string, error)
- func (p *Runtime) SessionAddDirs() *SessionAddDirs
- func (rt *Runtime) SessionEnv(ctx context.Context) []string
- func (p *Runtime) SetCallRewriter(rewriter tools.CallRewriter)
- func (rt *Runtime) SwitchModel(ctx context.Context, sessionID, ref string) (ModelOption, error)
- func (rt *Runtime) VisionGate() *tools.VisionGate
- type SessionAddDirs
- func (h *SessionAddDirs) Add(ctx context.Context, value, source string) (adddir.Dir, error)
- func (h *SessionAddDirs) ImagesDir() string
- func (h *SessionAddDirs) List(ctx context.Context) ([]adddir.Dir, error)
- func (h *SessionAddDirs) Remove(ctx context.Context, value string) (bool, error)
- func (h *SessionAddDirs) SessionID() string
- func (h *SessionAddDirs) Workspace() string
- type SkillInfo
Constants ¶
const ( ResidentRulesSoftBytes = 32 * 1024 ResidentMemoryIndexSoftBytes = 8 * 1024 ResidentSkillsSoftBytes = 8 * 1024 ResidentTotalSoftBytes = 64 * 1024 )
Resident context soft thresholds (docs/design, harness2 exploration 3.6). They are warnings, never limits: nothing is dropped because a part crossed one, but the manifest marks the part and chat says it once at session start. The values follow what the first (uncached) request of every session pays:
- rules 32KB: an AGENTS.md chain beyond this is usually history rather than instructions (the hard cap stays 128KB, see personal/rules.go);
- memory index 8KB: the index lists titles only, so growth means entries should be merged into summaries;
- skills listing 8KB: past this the listing costs more per turn than loading a skill on demand with the skill tool;
- total 64KB: keeps a provider prefix-cache miss cheap.
const ( MemoryReasonConfig = "config" // memory.<scope>.backend set explicitly MemoryReasonRepoIndex = "repo_memory_md" // MEMORY.md exists at the repository root MemoryReasonGoferTracker = "gofer_tracker" // .gofer/tracker exists at the repository root MemoryReasonDefault = "default" // built-in files backend under SUGA_HOME )
Reasons recorded in MemoryBackendChoice.Reason (shown by the manifest).
const ( SkillSourceProject = "host.skills.source.project" SkillSourceBuiltin = "host.skills.source.builtin" SkillSourceUser = "host.skills.source.user" )
catalog keys of SkillInfo.Source, one per kind of root (translated by SkillInfos).
Variables ¶
This section is empty.
Functions ¶
func ApprovalRuleSourceChanged ¶
func ApprovalRuleSourceChanged(before, after ApprovalRuleSource) bool
ApprovalRuleSourceChanged compares all reload metadata, not only mtime. It is useful to callers that want to avoid rebuilding a Policy for an unchanged source while still detecting same-size timestamp-preserving edits.
func BuiltinLangRuleFiles ¶
func BuiltinLangRuleFiles() []codeintel.BuiltinRuleFile
BuiltinLangRuleFiles returns the embedded language rule files in load order.
func BuiltinNudgeRulesYAML ¶
func BuiltinNudgeRulesYAML() []byte
BuiltinNudgeRulesYAML returns the built-in nudge rules as a rule file (the built-in rules live in Go code, so the dump is generated).
func BuiltinOutputRuleFiles ¶
func BuiltinOutputRuleFiles() []native.BuiltinRuleFile
BuiltinOutputRuleFiles returns the embedded output rule files in load order.
func ContextNotices ¶
func ContextNotices(tr i18n.Translator, c ManifestContext, skills ManifestSkills) []string
ContextNotices returns the resident context problems chat prints once when it opens a session. Each line names what is wrong and the command that shows the details; run and ACP log the same facts instead (see Runtime.ResidentReport).
func InspectNudgeRules ¶
func InspectNudgeRules(workspace string) ([]NudgeRuleReport, []RuleFileSkip)
InspectNudgeRules returns the effective nudge rules and the files that did not apply. Read-only: no runner or process state is touched.
func NewManifestTool ¶
func NewManifestTool(source ManifestSource) *manifestTool
NewManifestTool creates the suga_manifest tool reading from source.
func NewTaskManager ¶
NewTaskManager returns the background task manager of a host process (chat, run, acp) with the tasks.* limits; task output goes to the session's outputs directory, so recall reads it. onNotice (may be nil) is told of every notice left for the model (a task that ended unseen, a running task's notice), e.g. to wake an idle chat. The host closes it.
Every task end is recorded in the session's trace through its own store handle, not the turn's runner: ACP opens a runtime per prompt, so a task may end between turns (or at shutdown) when no runner is open.
func OpenEmbeddedMemory ¶
func OpenEmbeddedMemory(ctx context.Context, workspaceRoot string, repo *store.Store, tainted func(context.Context) bool, confirm MemoryConfirmFunc) (*memory.Governed, error)
OpenEmbeddedMemory builds the governed memory store of workspaceRoot: the user and project backends the agent runtime selects (configuration, MEMORY.md, .gofer/tracker), wrapped with the configured write policy (memory.write / memory.write_tainted) and the host's confirmation.
repo backs the provenance records and the derived index and must stay open while the store is used. tainted reports whether the writing session has seen external content (nil: never); confirm approves such a write (nil: refuse, fail closed). The workspace must not be empty: the project scope is derived from it.
func PersistApprovalRule ¶
func PersistApprovalRule(path string, destination rules.Source, rule rules.Rule, reporter ApprovalRulePersistReporter) error
PersistApprovalRule is the writeback seam for chat. Project files accept only deny rules: a project allow would turn a model-writable file into a privilege grant. The reporter is optional so wiring can connect this operation to trace without making the rules package depend on personal storage.
func ReadImageAt ¶
ReadImageAt loads a picture with the rules of Runtime.ReadImage, resolving a relative path against workspace. `suga send --image` uses it with the sender's own working directory, so both ends check, scale and name a picture the same way (design send --image).
The path is one the person typed (:image, run --image, send --image), not a model's tool call, so it is not confined to the workspace: its own directory is added as a read root. Every other view_image check (regular file only, input size, pixel and format limits) still applies.
func SessionModelReference ¶
SessionModelReference reads the last main model of a persisted session before runtime assembly. Chat uses it so --resume follows :model unless --model was explicitly supplied on the command line.
func SessionRunMode ¶ added in v0.51.0
SessionRunMode reads the run mode the session last ran a turn in ("" when it never recorded one). `suga session compact` assembles its runtime with it: the tools of a turn depend on the mode, and the break rebuilds the last turn's request, which only a matching tool table can continue (H4).
func SetBuildVersion ¶
func SetBuildVersion(v string)
SetBuildVersion records the suga version for the manifest.
func SetupLogging ¶
func SetupLogging() error
SetupLogging installs the process logger from the log.* configuration (see internal/config/log.go). A record goes to the rotating log file and, per log.stderr (auto|always|never), additionally to stderr: what a person needs is printed by the run itself (the session id, the model, a retry, a wrap-up reason are plain notices on stderr) and Gofer reads stdout as protocol, so free-form log lines would only clutter the terminal or the job log. An invalid log.* value is returned as an error naming the key, so a typo stops the run at startup instead of being silently replaced by a default.
func TotalSuggestion ¶
func TotalSuggestion() string
TotalSuggestion is the action shown when the resident context total is over its soft threshold.
func WriteApprovalRule ¶
WriteApprovalRule appends a restrictive rule to a rule file. An allow needs an explicit destination through PersistApprovalRule; inferring that destination from rule.Source would let a session rule accidentally grant a project file's allow permission.
Types ¶
type ApprovalRuleEvent ¶
ApprovalRuleEvent is deliberately small so the personal trace layer can consume reload warnings later without depending on filesystem internals.
type ApprovalRulePersistEvent ¶
ApprovalRulePersistEvent is the stable event shape used by trace adapters. Its three fields correspond to the file, action and result attributes in the approval_rule_persist event contract.
type ApprovalRulePersistReporter ¶
type ApprovalRulePersistReporter func(ApprovalRulePersistEvent)
ApprovalRulePersistReporter receives a best-effort writeback observation.
type ApprovalRuleSource ¶
type ApprovalRuleSource struct {
Path string
Source rules.Source
Content []byte
AST *ast.File
Rules []rules.Rule
Fingerprint RuleFileFingerprint
}
ApprovalRuleSource is one parsed rule file. The AST and original bytes are retained for the later read-modify-write task; parsing itself never rewrites a user's file or expands YAML aliases.
type ApprovalRules ¶
type ApprovalRules struct {
Workspace string
Settings axconfig.ApprovalRulesSettings
User ApprovalRuleSource
Project ApprovalRuleSource
Events []ApprovalRuleEvent
}
ApprovalRules is the validated user/project rule snapshot used by later wiring tasks. Disabled settings return an empty snapshot without reading either rule file, preserving the legacy approval path.
func InspectApprovalRules ¶
func InspectApprovalRules(workspace string) (ApprovalRules, error)
InspectApprovalRules loads the approval rule snapshot for the inspect command. It is the manifest's load (fail-closed): a malformed file is an error, never a skip.
func LoadApprovalRules ¶
func LoadApprovalRules(workspace string) (ApprovalRules, error)
LoadApprovalRules loads and validates the two independent rule files for a workspace. A missing file means an empty source; an existing malformed file is an error because approval configuration is security-sensitive.
func ReloadApprovalRules ¶
func ReloadApprovalRules(previous ApprovalRules, workspace string) (ApprovalRules, error)
ReloadApprovalRules performs an all-or-nothing per-turn reload. A deleted, changed-but-invalid, or otherwise unreadable file leaves the previous valid snapshot in place and emits a warning event; callers can attach that event to trace without making a failed reload fatal to the current turn.
func (ApprovalRules) EffectiveRules ¶
func (a ApprovalRules) EffectiveRules() []rules.Rule
EffectiveRules merges sources while enforcing the project trust boundary. Project allow rules are ignored unless the exact workspace and file hash were trusted; project deny rules are never filtered out.
func (ApprovalRules) IgnoredApprovalRules ¶
func (a ApprovalRules) IgnoredApprovalRules() []ManifestApprovalIgnoredRule
IgnoredApprovalRules returns the parsed project rules that the effective set leaves out: project allows are ignored unless the workspace hash was trusted (deny and ask rules always apply).
func (ApprovalRules) ProjectAllowTrusted ¶
func (a ApprovalRules) ProjectAllowTrusted() bool
ProjectAllowTrusted reports whether the currently loaded project file is the exact file explicitly trusted for this workspace. Missing trust never grants project allows; project deny rules remain available to tighten a policy.
func (ApprovalRules) ProjectRoot ¶
func (a ApprovalRules) ProjectRoot() string
ProjectRoot returns the workspace root encoded by the project rule source.
func (ApprovalRules) ProjectTrustReason ¶
func (a ApprovalRules) ProjectTrustReason() string
ProjectTrustReason returns why project allow rules are in or out of the effective set (shared by the manifest and `suga inspect rules approval`).
type BuiltinLangRuleFile ¶
type BuiltinLangRuleFile = codeintel.BuiltinRuleFile
BuiltinOutputRuleFile and BuiltinLangRuleFile are the embedded rule files' shared shape, aliased from their packages so the CLI does not need both.
type BuiltinOutputRuleFile ¶
type BuiltinOutputRuleFile = native.BuiltinRuleFile
BuiltinOutputRuleFile and BuiltinLangRuleFile are the embedded rule files' shared shape, aliased from their packages so the CLI does not need both.
type ContextFile ¶
ContextFile is one file inside a part: the rule sources a session reads at start, with what each contributed.
type ContextPart ¶
type ContextPart struct {
Name string
Bytes int
Tokens int
Note string
Files []ContextFile
}
ContextPart is one measured part of the context composition chat's :context lists; the figures are the manifest's, so the command, `suga inspect manifest` and the context trace event describe the same strings.
type ContextReport ¶
type ContextReport struct {
Parts []ContextPart
Deferred int
Loaded int
}
ContextReport is what chat's :context prints of the resident context, plus the deferred native tools the session has not loaded yet (Deferred) and how many of them it loaded (Loaded).
func BuildContextReport ¶
func BuildContextReport(rep ResidentReport, deferred, loaded int) ContextReport
BuildContextReport turns a resident report into the ordered parts :context lists; deferred and loaded are the visibility layer's native deferred counts.
type EnvHooks ¶
type EnvHooks struct {
Enabled bool `json:"enabled"`
Off bool `json:"off"` // SUGA_HOOKS=off
Config string `json:"config,omitempty"`
Error string `json:"error,omitempty"`
}
EnvHooks is the chat hook configuration (hooks run in chat only).
type EnvMCPServer ¶
type EnvMCPServer struct {
ID string `json:"id"`
Command string `json:"command"`
Args []string `json:"args,omitempty"`
EnvKeys []string `json:"env_keys,omitempty"`
}
EnvMCPServer is a configured MCP server; env values are not shown.
type EnvRuleFile ¶
type EnvRuleFile struct {
Path string `json:"path"`
Exists bool `json:"exists"`
Bytes int64 `json:"bytes"`
}
EnvRuleFile is a rule file candidate.
type EnvRules ¶
type EnvRules struct {
File string `json:"file"` // rules.file
Files []EnvRuleFile `json:"files"`
Text string `json:"text"`
Hash string `json:"hash"` // compares with turn_context rules_hash
Error string `json:"error,omitempty"`
}
EnvRules are the rule files read for the workspace and their merged text.
type EnvSkill ¶
type EnvSkill struct {
Name string `json:"name"`
Description string `json:"description"`
Path string `json:"path"`
Workspace bool `json:"workspace"`
Shown string `json:"shown"`
}
EnvSkill is one installed skill and how the skills listing presents it: "preloaded", "listed" (with its description), "named" (name only) or "counted" (past the names budget).
type EnvTool ¶
type EnvTool struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema map[string]any `json:"input_schema,omitempty"`
}
EnvTool is a tool's description and input schema (its flags are in Manifest.Tools).
type LocalEnv ¶
type LocalEnv struct {
Workspace string `json:"workspace"`
Manifest Manifest `json:"manifest"`
Tools []EnvTool `json:"tools"`
Skills []EnvSkill `json:"skills"`
SkillsStats personal.SkillsStats `json:"skills_stats"`
SkillsText string `json:"skills_text"`
Rules EnvRules `json:"rules"`
Hooks EnvHooks `json:"hooks"`
MCPServers []EnvMCPServer `json:"mcp_servers"`
}
LocalEnv is what a session in a workspace would get on this machine now: the manifest plus the details behind it (tool schemas, each skill and how the listing presents it, the rule files, hooks and MCP servers). The trace page shows it next to what the session recorded, so the two can be compared. It is read from the configuration only: no provider, no MCP server, no hook command is started.
func LoadLocalEnv ¶
LoadLocalEnv reads the local environment for workspace ("" = the configured workspace).
type Manifest ¶
type Manifest struct {
Version string `json:"version"`
Language ManifestLanguage `json:"language"`
Models ManifestModels `json:"models"`
Tools []ManifestTool `json:"tools"`
MCPServers []ManifestMCPServer `json:"mcp_servers"`
Preferred []ManifestPreferred `json:"preferred_tools"`
Skills ManifestSkills `json:"skills"`
Context ManifestContext `json:"context"`
Memory []ManifestMemory `json:"memory"`
Output ManifestOutput `json:"output"`
ReadRoots []ManifestReadRoot `json:"read_roots"`
Taint ManifestTaint `json:"taint"`
WritePolicy ManifestWritePolicy `json:"write_policy"`
ApprovalRules ManifestApprovalRules `json:"approval_rules"`
// NudgeRules lists the effective nudge rules (name, kind, source layer).
NudgeRules []ManifestNudgeRule `json:"nudge_rules"`
// OutputRules lists the effective output rules (name, source layer), and
// OutputRuleSkips the output rule files that did not load: a typo would
// otherwise silently disable the whole file.
OutputRules []ManifestRuleLayer `json:"output_rules"`
OutputRuleSkips []RuleFileSkip `json:"output_rule_skips"`
// LangRules lists the effective declaration languages of file_symbols and
// file_refs (name, extensions, source layer), and LangRuleSkips the language
// rule files that did not load with their reason: a rule file with a typo
// would otherwise silently not apply.
LangRules []codeintel.LangManifest `json:"lang_rules"`
LangRuleSkips []codeintel.LangRuleSkip `json:"lang_rule_skips"`
// ToolConflicts lists same-name tool collisions of the live registry; it is
// always present and stays empty when nothing collided.
ToolConflicts []ManifestToolConflict `json:"tool_conflicts"`
}
Manifest describes what this suga instance can do (design D15). It holds no secrets: no API keys, base URLs, MCP arguments or environment values.
func BuildManifest ¶
func BuildManifest(in ManifestInput) Manifest
BuildManifest summarizes in. It only reads the given structures: no network, no process, no gofer command.
func LoadManifest ¶
func LoadManifest(opts ManifestOptions) (Manifest, error)
LoadManifest builds the manifest from the current configuration without opening the runtime: the provider is not built or contacted, MCP servers are not started and the session database is not opened. Tools are the built-in set with every mode enabled (see ManifestTool.NeedsAllowWrite).
type ManifestApprovalDefaults ¶
type ManifestApprovalDefaults struct {
ToolsApproval string `json:"tools_approval"`
}
ManifestApprovalDefaults records the old chat configuration in action terms.
type ManifestApprovalIgnoredRule ¶
type ManifestApprovalIgnoredRule struct {
Index int `json:"index"`
Action string `json:"action"`
Summary string `json:"summary"`
Reason string `json:"reason"`
}
ManifestApprovalIgnoredRule explains why a parsed rule was not effective.
type ManifestApprovalRules ¶
type ManifestApprovalRules struct {
Enabled bool `json:"enabled"`
User ManifestApprovalSource `json:"user"`
Project ManifestApprovalSource `json:"project"`
Defaults ManifestApprovalDefaults `json:"defaults"`
}
ManifestApprovalRules describes both rule files and the default used by the legacy tools.approval setting. It deliberately reports diagnostics rather than the full rule pool, so a manifest explains trust without duplicating the policy used by the approval layer.
type ManifestApprovalSource ¶
type ManifestApprovalSource struct {
Path string `json:"path"`
Hash string `json:"hash,omitempty"`
EffectiveRules int `json:"effective_rules"`
Ignored []ManifestApprovalIgnoredRule `json:"ignored"`
Trusted bool `json:"trusted,omitempty"`
TrustReason string `json:"trust_reason,omitempty"`
}
ManifestApprovalSource is the diagnostic summary for one rule file.
type ManifestContext ¶
type ManifestContext struct {
SystemPrompt ManifestContextPart `json:"system_prompt"`
Environment ManifestContextPart `json:"environment"`
Rules ManifestContextPart `json:"rules"`
MemoryIndex ManifestContextPart `json:"memory_index"`
Skills ManifestContextPart `json:"skills"`
AppendPrompt ManifestContextPart `json:"append_prompt"`
// HostContext measures the section an embedding host adds (Options.HostContext).
HostContext ManifestContextPart `json:"host_context"`
DeferredTools ManifestContextPart `json:"deferred_tools"`
TotalBytes int `json:"total_bytes"`
TotalTokens int `json:"total_tokens"`
OverBudget []string `json:"over_budget"`
}
ManifestContext reports the size of the resident context and the parts that crossed a soft threshold (OverBudget, by part name, plus "total").
func BuildManifestContext ¶
func BuildManifestContext(in ResidentContext) ManifestContext
BuildManifestContext measures the resident context parts, lists the rule source files and flags every part (and the total) over its soft threshold.
func (ManifestContext) Part ¶
func (c ManifestContext) Part(name string) ManifestContextPart
Part returns the named context part (the zero part for an unknown name).
type ManifestContextFile ¶
type ManifestContextFile struct {
Path string `json:"path"`
Bytes int `json:"bytes"`
Tokens int `json:"tokens"`
Truncated bool `json:"truncated,omitempty"`
Included bool `json:"included,omitempty"`
}
ManifestContextFile is one rule source file and what it contributes.
type ManifestContextPart ¶
type ManifestContextPart struct {
Bytes int `json:"bytes"`
Tokens int `json:"tokens"`
// LimitBytes is the soft threshold of this part (0 = no threshold).
LimitBytes int `json:"limit_bytes,omitempty"`
Over bool `json:"over,omitempty"`
Suggestion string `json:"suggestion,omitempty"`
Files []ManifestContextFile `json:"files,omitempty"`
Truncated *ManifestContextTruncated `json:"truncated,omitempty"`
Note string `json:"note,omitempty"`
}
ManifestContextPart is the size report of one resident context part.
type ManifestContextTruncated ¶
type ManifestContextTruncated struct {
OriginalBytes int `json:"original_bytes"`
KeptBytes int `json:"kept_bytes"`
}
ManifestContextTruncated is set when the rules exceeded the 128KB total (or a single file the 64KB cap) and were cut: the original size of the read files and the rule bytes that were kept.
type ManifestInput ¶
type ManifestInput struct {
Version string
Settings appconfig.ModelSettings
Language ManifestLanguage
// Registry is the base tool registry (MCP tools included when running).
Registry *tools.Registry
MCPServers []mcp.ServerSettings
// ToolConflicts are the same-name collisions registered during startup; it
// stays empty for the standalone manifest, which never starts a server.
ToolConflicts []mcp.Conflict
// Preferred is the discovery snapshot shown by the manifest; nil = no
// declared tool. The runtime manifest reuses its startup snapshot.
Preferred []PreferredToolStatus
SkillRoots []capskills.Root
Skills *capskills.Registry
// Context is the resident context size report (built by the caller from the
// same sources the session uses).
Context ManifestContext
Memory *MemorySetup
Policy memoryWritePolicy
// Approval is the exact file snapshot used to assemble the runtime policy.
Approval ApprovalRules
// ToolsApproval is the effective legacy chat default rendered as an action.
ToolsApproval string
InlineBytes, SpillBytes int
SessionsDir string
TaintTools, TaintOnSpill []string
// NudgeRules are the effective nudge rules (LoadNudgeRules result).
NudgeRules []personal.NudgeRule
// OutputRules are the effective output rules (native.LoadOutputRules over
// the layered files); the manifest summarizes their names and layers and
// files the load skipped.
OutputRules []native.OutputRule
// OutputRuleSkips are the rule files the load did not apply, with reasons.
OutputRuleSkips []RuleFileSkip
// ReadRoots are the read-only root directories the read-only file tools may
// read (labels included, so a manifest shows their source).
ReadRoots []native.ReadRoot
// LangRules is the effective language registry of file_symbols/file_refs and
// the test command recognition; its skipped files are shown too.
LangRules codeintel.LangRegistry
}
ManifestInput is everything BuildManifest summarizes.
type ManifestLanguage ¶
type ManifestLanguage struct {
Setting string `json:"setting"`
Resolved string `json:"resolved"`
Source string `json:"source"`
Locale string `json:"locale,omitempty"`
}
ManifestLanguage reports the configured setting, resolved UI language and provenance. Locale is populated only when setting is auto.
func AssembleTranslator ¶
func AssembleTranslator() (i18n.Translator, ManifestLanguage, error)
AssembleTranslator resolves the startup UI catalog from configuration and SUGA_LANGUAGE, the way Open and the manifest do. The ACP server resolves it once at startup, before any runtime is opened, for the notices it sends the client itself.
type ManifestMCPServer ¶
ManifestMCPServer is a configured MCP server. Its tools are only listed when the runtime is running (the manifest command never starts servers).
type ManifestMemory ¶
type ManifestMemory struct {
Scope string `json:"scope"`
Backend string `json:"backend"`
Reason string `json:"reason"`
Location string `json:"location"`
// Replaceable is true for every scope: any backend can be swapped for an
// exec backend through memory.<scope>.backend.
Replaceable bool `json:"replaceable"`
}
ManifestMemory is the backend serving one memory scope.
type ManifestModel ¶
type ManifestModel struct {
Provider string `json:"provider"`
Model string `json:"model"`
ModelID string `json:"model_id,omitempty"` // sent to the provider when it differs from model
ContextWindow int `json:"context_window"`
Thinking string `json:"thinking,omitempty"` // effective thinking level ("" = provider default)
// ThinkingStyle is the declared thinking request shape ("" = model-name heuristic).
ThinkingStyle string `json:"thinking_style,omitempty"`
// StreamRequired marks a model whose endpoint answers only streamed requests.
StreamRequired bool `json:"stream_required,omitempty"`
// Vision reports whether the model accepts images (see appconfig.VisionFor).
Vision bool `json:"vision"`
}
ManifestModel is one model and the provider serving it.
type ManifestModels ¶
type ManifestModels struct {
Main ManifestModel `json:"main"`
Compact *ManifestModel `json:"compact,omitempty"`
// Idle/Handoff are the per-scenario overrides (models.idle / models.handoff);
// nil means the scenario falls back to the compact model, then the main one.
Idle *ManifestModel `json:"idle,omitempty"`
Handoff *ManifestModel `json:"handoff,omitempty"`
Fallbacks []ManifestModel `json:"fallbacks,omitempty"`
}
ManifestModels is the effective model selection.
type ManifestNudgeRule ¶
type ManifestNudgeRule struct {
Name string `json:"name"`
Kind string `json:"kind"`
Source string `json:"source"`
}
ManifestNudgeRule is one effective nudge rule: its name, fixed kind and where it came from (builtin, or the loaded rule file's path).
type ManifestOptions ¶
type ManifestOptions struct {
// Model overrides the configured model (like --model).
Model string
// Thinking overrides the main model's thinking level (like --thinking).
Thinking string
// Workspace is the directory whose skills and rules apply; "" resolves
// the configured workspace (or the current directory).
Workspace string
}
ManifestOptions selects the model and workspace of LoadManifest
type ManifestOutput ¶
type ManifestOutput struct {
InlineBytes int `json:"inline_bytes"`
SpillBytes int `json:"spill_bytes"`
SessionsDir string `json:"sessions_dir"`
}
ManifestOutput reports the tool output governance limits.
type ManifestPreferred ¶
type ManifestPreferred struct {
Name string `json:"name"`
Kind string `json:"kind"`
When string `json:"when"`
Present bool `json:"present"`
Reason string `json:"reason"`
}
ManifestPreferred is one declared preferred tool (tools.preferred) with its discovery reason. Declarations that are not available are kept so a manifest can explain why they are missing from the prompt. It holds no command path, MCP argument or environment value.
type ManifestReadRoot ¶
ManifestReadRoot is one read-only root directory outside the workspace the read-only file tools may read (dependency sources, idev-std sources, skill directories, tools.read_roots). It carries no secrets.
type ManifestRuleLayer ¶
ManifestRuleLayer is one effective rule's name and the layer it came from ("builtin", or the rule file's path); shared by the output rule summary.
type ManifestSkillShadow ¶
type ManifestSkillShadow struct {
Name string `json:"name"`
Winner string `json:"winner"`
Loser string `json:"loser"`
}
ManifestSkillShadow is one same-name skill that lost to an earlier root.
type ManifestSkillSkipped ¶
ManifestSkillSkipped is one SKILL.md that was found but not registered.
type ManifestSkills ¶
type ManifestSkills struct {
Roots []string `json:"roots"`
Count int `json:"count"`
Skipped []ManifestSkillSkipped `json:"skipped"`
Shadowed []ManifestSkillShadow `json:"shadowed"`
}
ManifestSkills reports the skill roots and how many skills were found, plus the load diagnostics: SKILL.md files that were skipped (parse or validation error) and same-name skills shadowed by an earlier root.
type ManifestSource ¶
ManifestSource produces the manifest value (any JSON-encodable value) on demand. The caller injects it so the tool has no dependency on the configuration layer.
type ManifestTaint ¶
type ManifestTaint struct {
TaintTools []string `json:"taint_tools"`
TaintOnSpill []string `json:"taint_on_spill"`
}
ManifestTaint reports which tool results mark a session as tainted.
type ManifestTool ¶
type ManifestTool struct {
Name string `json:"name"`
Category string `json:"category"`
ReadOnly bool `json:"read_only"`
External bool `json:"external"`
Rereadable bool `json:"rereadable"`
AgentState bool `json:"agent_state"`
MCP bool `json:"mcp"`
MCPServer string `json:"mcp_server,omitempty"`
// NeedsAllowWrite: the tool changes the workspace or runs commands, so it
// is only exposed with --allow-write (or tools.allow_write in chat).
NeedsAllowWrite bool `json:"needs_allow_write"`
}
ManifestTool is one registered tool with its metadata.
type ManifestToolConflict ¶
type ManifestToolConflict struct {
Server string `json:"server"`
Tool string `json:"tool"`
KeptBy string `json:"kept_by"`
}
ManifestToolConflict is one same-name tool collision seen while registering the runtime tools (design D8): Tool keeps its first owner (KeptBy) and the dropped Server is listed here. It carries no endpoint, argument, environment variable or header value.
type ManifestWritePolicy ¶
type ManifestWritePolicy struct {
MemoryWrite string `json:"memory_write"`
MemoryWriteTainted string `json:"memory_write_tainted"`
}
ManifestWritePolicy is memory.write / memory.write_tainted.
type MemoryBackendChoice ¶
type MemoryBackendChoice struct {
Scope memory.Scope
Backend string // files, gofer or exec
Reason string // MemoryReason*
// Location is the files layout root (directory or repository root) or,
// for gofer, the working directory gofer runs in; for exec, the command.
Location string
}
MemoryBackendChoice describes the backend serving one scope and why it was chosen.
type MemoryConfig ¶
type MemoryConfig struct {
// UserBackend is memory.user.backend: "" (files), files or exec.
UserBackend string
// ProjectBackend is memory.project.backend: "" (auto), files, gofer or exec.
ProjectBackend string
// UserExec / ProjectExec are memory.<scope>.command/args/timeout_sec,
// used only when that scope's backend is exec.
UserExec, ProjectExec MemoryExecConfig
// SugaHome is the absolute SUGA_HOME used for the built-in file layouts.
SugaHome string
}
MemoryConfig is the memory part of the suga configuration.
type MemoryConfirmFunc ¶
MemoryConfirmFunc asks the person to approve a memory write from a tainted session (memory.Policy.Confirm). It receives the op before sanitizing.
type MemoryExecConfig ¶
MemoryExecConfig is the external command of an exec memory backend. The command comes only from the configuration file; nothing is auto-discovered.
type MemorySetup ¶
type MemorySetup struct {
Router *memory.Router
User MemoryBackendChoice
Project MemoryBackendChoice
// contains filtered or unexported fields
}
MemorySetup is the memory router with the user and project scopes registered, plus the selection for each scope.
func OpenMemoryStore ¶
func OpenMemoryStore(workspaceRoot string) (*MemorySetup, error)
OpenMemoryStore builds the memory backends of workspaceRoot from the loaded configuration: the same selection the agent runtime uses, so maintenance commands and the agent always see the same entries. It runs no backend command.
func (*MemorySetup) Bind ¶
func (s *MemorySetup) Bind(repo *store.Store)
Bind attaches the session database to files-backed memory index wrappers. Manifest construction does not call this, so it remains a read-only path.
type ModelOption ¶
type ModelOption struct {
Provider string
Model string
Thinking string
ContextWindow int
MaxOutputTokens int
}
Runtime is one assembled personal runner and the resources it owns. ModelOption is one configured model that chat can select with :model.
func (ModelOption) Ref ¶
func (m ModelOption) Ref() string
Ref returns the canonical provider/model spelling used by :model.
type NudgeRuleReport ¶
type NudgeRuleReport struct {
Name string `json:"name"`
Source string `json:"source"`
Kind string `json:"kind"`
Enabled bool `json:"enabled"`
Patterns []string `json:"patterns,omitempty"`
WriteTools []string `json:"write_tools,omitempty"`
CheckTools []string `json:"check_tools,omitempty"`
CheckCommand string `json:"check_command,omitempty"`
}
NudgeRuleReport is one effective nudge rule for the inspect command: the fields a rule file writes plus the layer it came from.
type Options ¶
type Options struct {
// Workspace is the tool workspace root; RuleCWD is where project rules are read.
// Both are filled by OpenCLI.
Workspace string
RuleCWD string
Model string
// SessionOrigin is the meta.origin an embedded host records on the sessions
// it creates (e.g. personal.OriginXhen for xhen): its sessions then stay out
// of the default `suga session list` list and of gc --retention. Empty keeps the
// entry point's own origin (chat, run, ACP).
SessionOrigin string
// Thinking overrides the main model's thinking level (--thinking).
Thinking string
// AllowWrite exposes workspace write and shell tools.
AllowWrite bool
// ReadOnly (OpenCLI only) narrows the MCP gate to tools.read_only_allow and
// overrides AllowWrite.
ReadOnly bool
// Servers are extra MCP servers (from --mcp-config or the ACP session).
Servers []mcp.ServerSettings
// PreferredTools is the runtime discovery snapshot shown in segment context.
PreferredTools []PreferredToolStatus
// MCPConfigs are Claude-style config files read by OpenCLI into Servers.
MCPConfigs []string
// ExtraTools are the host's in-process tools (a program embedding suga, e.g.
// xhen): Open registers them next to the built-in ones of the main session,
// so they are in the tool table, the manifest and tool_search, and
// tools.disabled removes them like any other tool. A name a built-in or MCP
// tool already has (or one the runtime registers itself, see
// runtimeToolNames) is a startup error. Sub-agents never get them. Execute
// reads tools.InvocationID(ctx) - the id of the call, stable across the
// hooks and unique within the session - so a host can key its own
// side-effect ledger on it.
ExtraTools []api.Tool
// HostContext returns the host's context text (persona, topic index, verbatim
// constraints) and a hash of it; nil = no host context. The segment start
// freezes it in the segment context and every turn compares the hash: a
// change inside a segment appends a context update. An empty text means none.
HostContext func() (content, hash string)
Hooks []agentcore.Hook
// Approver is the permission policy of the approval layer (run: MCP
// allowlist; chat: chat approver set by OpenCLI; ACP: RequestPermission);
// nil denies every tool call (fail closed).
Approver tools.Approver
AppendSystemPrompt string
// ClearAppendSystemPrompt drops the session's saved append prompt. An empty
// AppendSystemPrompt keeps it instead: argv templates (job runners)
// often always pass the flag and render it empty when there is no prompt.
ClearAppendSystemPrompt bool
NoProjectRules bool
// CLIMode always exposes configured MCP tools; the dispatch gate enforces permissions.
CLIMode bool
// ChatMode (OpenCLI only) marks the interactive chat: tools.allow_write may
// enable write tools there, and tools are approved by the chat approver.
ChatMode bool
// MemoryReadOnly (--read-only, ACP read_only) limits the memory tool to
// get/search. The zero value allows memory writes: memory is suga's own
// state, not the workspace, so a plain run may write it.
MemoryReadOnly bool
// Tasks runs shell_exec with background: true and backs the task tool
// (write modes only); nil leaves background tasks off. The host owns it
// and closes it (killing its tasks) when the session or process ends.
Tasks *tasks.Manager
// MaxSteps overrides the config's max_steps for the main agent's turns
// (--max-steps, run only); 0 uses SUGA_MAX_STEPS, then max_steps.
MaxSteps int
// Budget carries raw run/chat flag overrides. Zero values defer to
// SUGA_BUDGET_* and budget.* settings.
Budget appconfig.BudgetFlags
// MaxOutputTokens overrides the configured output token limit for this
// invocation (--max-output-tokens); 0 uses SUGA_MAX_OUTPUT_TOKENS, then
// providers.<id>.models.<m>.max_output_tokens /
// providers.<id>.max_output_tokens (see appconfig.ResolveMaxOutputTokens).
MaxOutputTokens int
// MemoryConfirm confirms memory writes of tainted sessions (ACP: the turn
// gate's permission request; chat: set by OpenCLI to ask at the terminal).
// nil (run) refuses them.
MemoryConfirm MemoryConfirmFunc
// AddDirs are the additional directories this invocation asks for
// (--add-dir, SUGA_ADD_DIRS, already parsed by the front end). A session
// keeps them in its metadata; ApplyAddDirs publishes the merged set.
AddDirs []adddir.Dir
// Translator is an already-resolved host UI catalog; nil makes Open resolve
// the language from config and SUGA_LANGUAGE itself.
Translator i18n.Translator
// contains filtered or unexported fields
}
Options carries everything needed to assemble one runtime.
type PreferredToolStatus ¶
PreferredToolStatus is the safe runtime fact used by later prompt and manifest layers. It intentionally carries no command path, MCP arguments, or environment values.
func ResolvePreferredTools ¶
func ResolvePreferredTools(registry *tools.Registry, extraServers []mcp.ServerSettings) ([]PreferredToolStatus, error)
ResolvePreferredTools validates the configured declarations and resolves their current availability without executing a command. MCP availability is inferred from the already-built registry, so this function never starts a second provider or changes provider lifecycle. A nil registry means the caller has no runtime (the standalone manifest): a configured MCP server is then reported as configured only.
type ResidentContext ¶
type ResidentContext struct {
SystemPrompt string
Environment string
Rules string
RuleStats personal.RuleStats
MemoryIndex string // rendered memory section (see personal.RenderMemorySection)
Skills string
AppendPrompt string
// HostContext is the embedding host's context text (Options.HostContext);
// empty when the host provides none (the section is then not rendered).
HostContext string
DeferredTools string
// MemoryIndexNote explains a memory index that was not read (a command
// backend is never run to size it).
MemoryIndexNote string
// DeferredToolsNote explains an empty deferred listing of a standalone
// manifest (no MCP server is started, so nothing is deferred).
DeferredToolsNote string
}
ResidentContext is the text sent with every request of a session besides its history: the system prompt plus the segment context parts. The manifest and the chat start notice measure exactly these strings, so the numbers describe what the provider receives.
type ResidentReport ¶
type ResidentReport struct {
Context ManifestContext
Skills ManifestSkills
}
ResidentReport is the resident context of a runtime plus the skills load diagnostics: chat's start notice needs both, the manifest tool builds its context part from Context (its skills part carries the diagnostics).
func NewResidentReport ¶
func NewResidentReport(rc ResidentContext, reg *capskills.Registry) ResidentReport
NewResidentReport measures rc and pairs it with the skill diagnostics.
type RuleFileFingerprint ¶
RuleFileFingerprint is the complete reload identity. Size and mtime make the common unchanged-file check cheap; Hash protects against same-size timestamp races and is the value used by project trust.
type RuleFileSkip ¶
type RuleFileSkip struct {
// File is the rule file's absolute path; the rule kind's name when the
// reason belongs to no single file.
File string `json:"file"`
Err string `json:"err"`
}
RuleFileSkip is one rule file that did not apply, with the reason. The manifest and `suga inspect rules` show it, because a rule file with a typo would otherwise silently do nothing.
func InspectLangRules ¶
func InspectLangRules(workspace string) (codeintel.LangRegistry, []RuleFileSkip)
InspectLangRules returns the effective language registry and the files that did not apply, without installing the registry into the process.
func InspectOutputRules ¶
func InspectOutputRules(workspace string) ([]native.OutputRule, []RuleFileSkip)
InspectOutputRules returns the effective output rules (the built-in ones overridden and extended by the layered files, disabled rules removed) and the files that did not apply. Read-only: nothing in SUGA_HOME is written.
type Runtime ¶
type Runtime struct {
Runner *personal.Runner
// Registry is the base tool registry (lets ACP tell MCP tools apart).
Registry *tools.Registry
// PreferredTools is the startup discovery snapshot used by prompt and
// manifest layers; it is frozen for this runtime.
PreferredTools []PreferredToolStatus
// ACPPolicy exposes the same compiled policy to the ACP permission hook
// without coupling the internal wiring package to the ACP server package.
ACPPolicy func(agentcore.ToolCall, agentcore.Tool) (action, rule, scope string)
// Translator is the immutable host UI catalog. It is never passed to agentcore.
Translator i18n.Translator
// Language is the resolved startup UI language.
Language ManifestLanguage
// ContextWindow is the window of the model actually used by the provider.
ContextWindow int
// Budget is the resolved budget input retained for later runner/provider
// assembly. Its zero value means that budgeting is disabled.
Budget appconfig.BudgetSettings
// Thinking is the main model's effective thinking level ("" = the
// provider's default).
Thinking string
// Asker (chat mode only, else nil) is where the chat approver asks its
// questions; chat binds its terminal input to it. Unbound, every tool that
// needs a confirmation is refused.
Asker *tools.BindableAsker
// WriteTools reports whether workspace write and shell tools are exposed.
WriteTools bool
// AddDirs is the session's additional-directory set (--add-dir): the tools
// read it at every call, so the front end fills it once the session is known
// (ApplyAddDirs).
AddDirs *native.AddDirs
// Resident reports the resident context of this runtime (system prompt,
// environment, rules, memory index, skills, append prompt, deferred tools)
// for the manifest and the chat start notice; nil leaves both without it.
Resident func(context.Context) ResidentReport
// Skills lists the runtime's loaded skills for chat's :skills; nil leaves
// the command without a listing.
Skills func() []SkillInfo
// ContextReport reports the resident context parts and the deferred native
// tool counts for chat's :context (same measurement as Resident); nil
// leaves the command without it.
ContextReport func(context.Context) ContextReport
// contains filtered or unexported fields
}
func OpenCLI ¶
OpenCLI resolves the workspace, cwd, MCP configs and the CLI MCP gate from opts, then assembles the runtime via Open.
func (*Runtime) ApplyAddDirs ¶
ApplyAddDirs publishes the session's additional directories (--add-dir): the ones its metadata already carries plus the ones this invocation requested (a path named again takes this invocation's mode). The metadata records the requested mode and source, so resuming the session keeps the directories, their permissions and where they came from; the tools see the effective view, which a read-only runtime downgrades (it has no write tool at all).
The front end calls it once the session is open (run: after openRequestedSession, chat: through chat.Options.SetupSession) and before the first turn.
func (*Runtime) LocalCommands ¶
func (rt *Runtime) LocalCommands() *native.LocalCommand
LocalCommands is the runner of chat's local commands ("!cmd"/"!!cmd"): chat runs a line typed at the prompt through it. It is nil for a nil runtime.
func (*Runtime) ModelOptions ¶
func (rt *Runtime) ModelOptions() []ModelOption
ModelOptions returns the configured models in deterministic order.
func (*Runtime) PasteImageCallback ¶
PasteImageCallback wires chat's Alt+V (design 0.3): the platform clipboard reader plus the view_image pipeline (the same checks and scaling), so a paste and a :image path end up identical for the model.
func (*Runtime) ReadImage ¶
ReadImage loads a picture for chat's :image / the Alt+V clipboard paste with the view_image rules (design 0.3): the same path resolution, input limits and scaling, so both sides hand the model identical pictures.
func (*Runtime) SessionAddDirs ¶
func (p *Runtime) SessionAddDirs() *SessionAddDirs
SessionAddDirs is the runtime's handle on the session's added directories (--add-dir): the chat front end lists and changes them through it after the session is open (ApplyAddDirs).
func (*Runtime) SessionEnv ¶
SessionEnv is the environment suga exports to a subprocess of ctx's session: SUGA_SESSION_ID, SUGA_SESSION_NAME (only when the session has a short name) and SUGA_TURN_ID (only inside a turn). A nil runtime exports nothing.
func (*Runtime) SetCallRewriter ¶
func (p *Runtime) SetCallRewriter(rewriter tools.CallRewriter)
SetCallRewriter installs the rewriter the approval layer runs before its own decision (chat's PreToolUse hook, see internal/chat/hooks_gate.go): the policy decides on the rewritten call and a failing rewriter refuses the call. It has to be set before the first turn runs.
func (*Runtime) SwitchModel ¶
SwitchModel builds the selected main provider, retaining the runtime's fallback pool, then asks the runner to persist and activate it for the next turn.
func (*Runtime) VisionGate ¶
func (rt *Runtime) VisionGate() *tools.VisionGate
VisionGate exposes the live "the current model can see" gate: chat refuses :image / Alt+V while the current model cannot accept pictures.
type SessionAddDirs ¶
type SessionAddDirs struct {
// contains filtered or unexported fields
}
SessionAddDirs is the live handle on the added directories of one session: the CLI's ApplyAddDirs fills it when the session opens, chat's :add-dir/:dirs/ :rm-dir commands go through it, and the outside-directory authorization (chat.ask_outside_dirs) is answered with it. Both the session metadata (add_dirs) and the set the tools read (native.AddDirs) change in this one place, so a command takes effect on the next tool call and survives a resume.
func (*SessionAddDirs) Add ¶
Add authorizes one directory for this session: value is "<absolute directory>[:ro|:rw]" (default :ro), as typed after chat's :add-dir, and source is where it came from (adddir.SourceSession for a typed command, adddir.SourceAsk for an outside-directory authorization). The path must be an existing directory; in a --read-only session only the read-only mode is accepted. It returns the entry that took effect.
func (*SessionAddDirs) ImagesDir ¶
func (h *SessionAddDirs) ImagesDir() string
ImagesDir is the images directory of the session being served ("" until one opens): view_image resolves a session image ref (images/<sha256>.<ext>, design 0.3) against it.
func (*SessionAddDirs) List ¶
List returns the directories the session may reach: the workspace first (the caller tells it apart by Workspace), then the added ones in order, each with the mode in effect for this process and where it came from (an adddir.Source* value; "" for the workspace and for a directory stored by an older version).
func (*SessionAddDirs) Remove ¶
Remove revokes a directory: value is "<directory>" (a :ro/:rw suffix and "~" are accepted and ignored, since a directory may be gone from disk by now). It reports whether the directory was part of the session's set at all.
func (*SessionAddDirs) SessionID ¶
func (h *SessionAddDirs) SessionID() string
SessionID is the session the handle currently serves ("" until one opens, through apply or a :add-dir publish).
func (*SessionAddDirs) Workspace ¶
func (h *SessionAddDirs) Workspace() string
Workspace is the workspace root the session's tools are confined to.
type SkillInfo ¶
type SkillInfo struct {
Name string
Description string
// Source is the translated label of the root the skill was found in: project
// (a workspace skills directory), builtin (the skills released into
// SUGA_HOME) or user (the user's own ~/.agents/skills).
Source string
Path string
AlwaysLoad bool
}
SkillInfo is one loaded skill as chat's :skills lists it: its name, the one-line description, where it came from and the SKILL.md it was read from.
func SkillInfos ¶
func SkillInfos(tr i18n.Translator, reg *capskills.Registry) []SkillInfo
SkillInfos lists the registered skills sorted by name (Registry.List order) with the source of each. The registry keeps no source itself: it is derived from the root a skill was found under, and a workspace skill wins the name, so Workspace decides the project source and SUGA_HOME/skills holds the released built-ins. tr is the startup-resolved host catalog.
Source Files
¶
- approval_policy.go
- builtin_skills.go
- capabilities.go
- chat_approver.go
- cli_mcp.go
- context.go
- danger_guard.go
- embed.go
- localenv.go
- logging.go
- manifest.go
- manifest_tool.go
- memory.go
- memory_runtime.go
- model_texts.go
- native_tools.go
- network_proxy.go
- preferred_tools.go
- prompt.go
- rename_other.go
- rules.go
- rules_inspect.go
- rules_lock_other.go
- rules_write.go
- runtime.go
- runtime_build.go
- runtime_methods.go
- session_message.go
- sessionadddirs.go
- sessionenv.go
- skills.go
- snapshots.go
- subagent.go
- tasks.go
- tools_disabled.go