Documentation
¶
Overview ¶
Package main is the entry point for the yaah CLI.
yaah — Yet Another Agent Harness. A vendor-free, open-source AI agent CLI that follows the emerging cross-tool standards (~/.agents/, SKILL.md, AGENTS.md, MCP over stdio JSON-RPC). See ./README.md and the design plan at Markdown/agentic/yaah-plan.md.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
yaah
control_driver.go holds the cmd-side half of the control-plane bridge in internal/control: the transport adapters that turn a surface's channel or SSE stream into a control.Surface, and the installer that wires the shared question and approval bridges onto a session.
|
control_driver.go holds the cmd-side half of the control-plane bridge in internal/control: the transport adapters that turn a surface's channel or SSE stream into a control.Surface, and the installer that wires the shared question and approval bridges onto a session. |
|
internal
|
|
|
acp
Package acp implements an agent (server) for the Agent Client Protocol v1 (https://agentclientprotocol.com): newline-delimited JSON-RPC 2.0 over stdio, the agent-event-to-update view translator, the control-channel policy for a headless client, the session/request_permission bridge for tool approvals with the four permission option kinds (allow/reject × once/always, remembered per session), and the elicitation/create bridge for question-tool prompts.
|
Package acp implements an agent (server) for the Agent Client Protocol v1 (https://agentclientprotocol.com): newline-delimited JSON-RPC 2.0 over stdio, the agent-event-to-update view translator, the control-channel policy for a headless client, the session/request_permission bridge for tool approvals with the four permission option kinds (allow/reject × once/always, remembered per session), and the elicitation/create bridge for question-tool prompts. |
|
agent
Package agent provides the core agent loop for yaah.
|
Package agent provides the core agent loop for yaah. |
|
agent/budget
Package budget resolves the loop budget a sub-agent runs with.
|
Package budget resolves the loop budget a sub-agent runs with. |
|
agent/context
Package context provides pure helper functions for agent context-window management: token estimation, payload sizing, turn splitting, pruning, chunked compaction, and tool-result truncation.
|
Package context provides pure helper functions for agent context-window management: token estimation, payload sizing, turn splitting, pruning, chunked compaction, and tool-result truncation. |
|
agent/errorclassify
Package errorclassify provides structured error classification for LLM provider failures.
|
Package errorclassify provides structured error classification for LLM provider failures. |
|
agent/events
Package events defines the typed event system for the agent loop.
|
Package events defines the typed event system for the agent loop. |
|
agent/pipeline
Package pipeline — soft-prune core.
|
Package pipeline — soft-prune core. |
|
agent/recovery
Package recovery rebuilds the shepherd scope registry from the durable trace at startup (adoption plan R1, decision D5): the trace is the registry — scope lifecycle events, checkpoint blobs, and settlement records are durably recorded, so a restarted process recovers its supervision state instead of forgetting it.
|
Package recovery rebuilds the shepherd scope registry from the durable trace at startup (adoption plan R1, decision D5): the trace is the registry — scope lifecycle events, checkpoint blobs, and settlement records are durably recorded, so a restarted process recovers its supervision state instead of forgetting it. |
|
agent/runner
Package runner wires sub-agent execution: it builds the per-role tool registries, resolves provider/model/timeout/iteration budgets, assembles the sub-agent system prompt, and constructs the top-level DelegateTool that the planner uses to spawn sub-agents.
|
Package runner wires sub-agent execution: it builds the per-role tool registries, resolves provider/model/timeout/iteration budgets, assembles the sub-agent system prompt, and constructs the top-level DelegateTool that the planner uses to spawn sub-agents. |
|
agent/subagent
Package subagent owns the dispatch-world ladder (yaah-ihfh.3): which substrate a dispatch runs in, and whether stepping down is legal.
|
Package subagent owns the dispatch-world ladder (yaah-ihfh.3): which substrate a dispatch runs in, and whether stepping down is legal. |
|
agent/supervision
Package supervision bridges shepherd scopes to the loops that run under them (shepherd-adoption plan D2): a scope's interventions must reach execution, not just the trace.
|
Package supervision bridges shepherd scopes to the loops that run under them (shepherd-adoption plan D2): a scope's interventions must reach execution, not just the trace. |
|
atomicfile
Package atomicfile replaces a file atomically, with one behaviour on every platform: the caller writes a temp file beside the target, and this package moves it into place.
|
Package atomicfile replaces a file atomically, with one behaviour on every platform: the caller writes a temp file beside the target, and this package moves it into place. |
|
banner
Package banner provides the figlet + lolcat startup banner shared between the CLI REPL and the TUI.
|
Package banner provides the figlet + lolcat startup banner shared between the CLI REPL and the TUI. |
|
config
Package config loads and manages the yaah configuration file at ~/.yaah/config.yaml (or $YAAH_HOME/config.yaml if the env var is set).
|
Package config loads and manages the yaah configuration file at ~/.yaah/config.yaml (or $YAAH_HOME/config.yaml if the env var is set). |
|
control
bridge.go carries the control-plane delivery policy every UI surface and the ACP server share: how long a prompt may take to be accepted, how long the user may take to answer it, and what happens when either bound is hit.
|
bridge.go carries the control-plane delivery policy every UI surface and the ACP server share: how long a prompt may take to be accepted, how long the user may take to answer it, and what happens when either bound is hit. |
|
cwdpath
Package cwdpath canonicalizes working directories so that every surface which writes or filters on a session cwd spells the same path the same way: the ACP session intake, the persisted session store, the engine-level session registry (internal/sessions), the `yaah sessions` CLI, and the web session picker.
|
Package cwdpath canonicalizes working directories so that every surface which writes or filters on a session cwd spells the same path the same way: the ACP session intake, the persisted session store, the engine-level session registry (internal/sessions), the `yaah sessions` CLI, and the web session picker. |
|
envelopecheck
Package envelopecheck implements the result-envelope/doc parity gate (yaah-c3z3.4) shared by every package that emits model-facing envelopes.
|
Package envelopecheck implements the result-envelope/doc parity gate (yaah-c3z3.4) shared by every package that emits model-facing envelopes. |
|
instructions
Package instructions discovers and loads project instruction files (AGENTS.md, CLAUDE.md, CONTEXT.md) by walking up from the current working directory to the worktree root.
|
Package instructions discovers and loads project instruction files (AGENTS.md, CLAUDE.md, CONTEXT.md) by walking up from the current working directory to the worktree root. |
|
jail
Package jail selects yaah's per-platform containment backend.
|
Package jail selects yaah's per-platform containment backend. |
|
jobs
context.go defines the context-key contract between the task tool, the sub-agent runner, and the agent loop: model writeback, start notification, usage accumulation, and stuck-child heartbeats.
|
context.go defines the context-key contract between the task tool, the sub-agent runner, and the agent loop: model writeback, start notification, usage accumulation, and stuck-child heartbeats. |
|
mcp
Package mcp implements the Model Context Protocol (MCP) client for yaah.
|
Package mcp implements the Model Context Protocol (MCP) client for yaah. |
|
memory
Package memory provides the SQLite-backed persistence layer for yaah.
|
Package memory provides the SQLite-backed persistence layer for yaah. |
|
observability
Package observability provides OpenTelemetry tracing and metrics for the yaah agent harness.
|
Package observability provides OpenTelemetry tracing and metrics for the yaah agent harness. |
|
parity
Package parity owns the Shepherd parity ledger's drift guard: the pinned upstream inputs and the dispatch-world vocabulary are asserted against the code and docs, so "parity" stays a checked claim instead of a document that quietly ages.
|
Package parity owns the Shepherd parity ledger's drift guard: the pinned upstream inputs and the dispatch-world vocabulary are asserted against the code and docs, so "parity" stays a checked claim instead of a document that quietly ages. |
|
permissions
Package permissions is the ruleset engine behind role-file and global `permissions:` configuration (parity W5): ordered per-tool rules with an allow/deny/ask effect and a glob resource, evaluated last-match-wins.
|
Package permissions is the ruleset engine behind role-file and global `permissions:` configuration (parity W5): ordered per-tool rules with an allow/deny/ask effect and a glob resource, evaluated last-match-wins. |
|
plans
Package plans discovers and parses PLAN.md files from the standard locations: project (.agents/plans/) and user-level (~/.agents/plans/).
|
Package plans discovers and parses PLAN.md files from the standard locations: project (.agents/plans/) and user-level (~/.agents/plans/). |
|
prompts
Package prompts provides the embedded system prompt identity and assembly functions for constructing the full system prompt from multiple layers: embedded identity, user context, project context, memory, and skills.
|
Package prompts provides the embedded system prompt identity and assembly functions for constructing the full system prompt from multiple layers: embedded identity, user context, project context, memory, and skills. |
|
providers
apierror.go defines the structured error type for non-2xx provider responses.
|
apierror.go defines the structured error type for non-2xx provider responses. |
|
providers/catalog
Package catalog serves a pinned, build-time snapshot of the models.dev catalog (https://models.dev/api.json).
|
Package catalog serves a pinned, build-time snapshot of the models.dev catalog (https://models.dev/api.json). |
|
repl
Package repl implements the interactive read-eval-print loop for yaah.
|
Package repl implements the interactive read-eval-print loop for yaah. |
|
retention
Package retention implements the caller's half of the owner-scoped eviction design for session deletion: the kernel-first ordering (docs/retention-gc.md §5) and the coalesced garbage-collection sweep (§6, decision 6).
|
Package retention implements the caller's half of the owner-scoped eviction design for session deletion: the kernel-first ordering (docs/retention-gc.md §5) and the coalesced garbage-collection sweep (§6, decision 6). |
|
rolefile
Package rolefile is the single parser/marshaler for sub-agent role files (markdown with YAML frontmatter).
|
Package rolefile is the single parser/marshaler for sub-agent role files (markdown with YAML frontmatter). |
|
runs
Package runs defines the protocol-neutral run record behind yaah's task-style surfaces: a unit of work a caller starts and can poll until it settles.
|
Package runs defines the protocol-neutral run record behind yaah's task-style surfaces: a unit of work a caller starts and can poll until it settles. |
|
sandboxfake
Package sandboxfake provides an in-memory goatherdsandbox.Sandbox test double.
|
Package sandboxfake provides an in-memory goatherdsandbox.Sandbox test double. |
|
sessions
Package sessions is the engine-level session registry: one read-and-delete seam over the persisted conversation store that every consumer shares — the ACP session/list and session/delete callbacks, the web session picker endpoint, the `yaah sessions` CLI, and the interactive resume picker.
|
Package sessions is the engine-level session registry: one read-and-delete seam over the persisted conversation store that every consumer shares — the ACP session/list and session/delete callbacks, the web session picker endpoint, the `yaah sessions` CLI, and the interactive resume picker. |
|
skills
Package skills discovers and parses SKILL.md files from the standard locations: project (.agents/skills/), yaah (~/.yaah/skills/), and user-level cross-tool (~/.agents/skills/).
|
Package skills discovers and parses SKILL.md files from the standard locations: project (.agents/skills/), yaah (~/.yaah/skills/), and user-level cross-tool (~/.agents/skills/). |
|
spinner
Package spinner provides a simple terminal spinner for indicating background processing.
|
Package spinner provides a simple terminal spinner for indicating background processing. |
|
toolfmt
Package toolfmt provides shared tool result formatting helpers used by the ACP view, the REPL terminal view, and the web view.
|
Package toolfmt provides shared tool result formatting helpers used by the ACP view, the REPL terminal view, and the web view. |
|
tools
subagent_aliases.go re-exports the sub-agent I/O contract and context-key helpers from internal/jobs so existing consumers keep compiling while the implementation lives in the jobs package.
|
subagent_aliases.go re-exports the sub-agent I/O contract and context-key helpers from internal/jobs so existing consumers keep compiling while the implementation lives in the jobs package. |
|
tools/substrate
Package substrate holds the tool substrate: the policy and authority types the leaf tools are written against, with no dependency on any tool implementation.
|
Package substrate holds the tool substrate: the policy and authority types the leaf tools are written against, with no dependency on any tool implementation. |
|
tui
state.go — focus state and query helpers.
|
state.go — focus state and query helpers. |
|
tui/colors
Package colors provides shared tview color tokens and helpers used by all TUI component packages.
|
Package colors provides shared tview color tokens and helpers used by all TUI component packages. |
|
tui/components/activity
Package activity renders the dedicated activity line for the TUI: a tvxwidgets.Spinner (or ActivityModeGauge during compaction) plus a state label, all in a single reserved Flex row that is never removed from the layout.
|
Package activity renders the dedicated activity line for the TUI: a tvxwidgets.Spinner (or ActivityModeGauge during compaction) plus a state label, all in a single reserved Flex row that is never removed from the layout. |
|
tui/components/agentpicker
Package agentpicker implements the persona picker modal for the TUI (yaah-21uk.10): one entry per primary-capable persona, its description as the secondary line.
|
Package agentpicker implements the persona picker modal for the TUI (yaah-21uk.10): one entry per primary-capable persona, its description as the secondary line. |
|
tui/components/approval
Package approval renders interactive approval modals for tool calls.
|
Package approval renders interactive approval modals for tool calls. |
|
tui/components/backgroundjobs
Package backgroundjobs renders running background sub-agents in a compact side-pane format.
|
Package backgroundjobs renders running background sub-agents in a compact side-pane format. |
|
tui/components/command
Package command implements the colon command parser and command palette for the TUI.
|
Package command implements the colon command parser and command palette for the TUI. |
|
tui/components/contextinfo
Package contextinfo formats the context-window / token usage section.
|
Package contextinfo formats the context-window / token usage section. |
|
tui/components/errdialog
Package errdialog displays error messages using tvxwidgets.MessageDialog.
|
Package errdialog displays error messages using tvxwidgets.MessageDialog. |
|
tui/components/help
Package help renders the help overlay showing keybindings and commands.
|
Package help renders the help overlay showing keybindings and commands. |
|
tui/components/mcpinfo
Package mcpinfo formats the MCP server status section.
|
Package mcpinfo formats the MCP server status section. |
|
tui/components/messages
Package messages builds and renders the conversation message area.
|
Package messages builds and renders the conversation message area. |
|
tui/components/modal
Package modal provides a common modal wrapper for consistent sizing and centering across all TUI overlays.
|
Package modal provides a common modal wrapper for consistent sizing and centering across all TUI overlays. |
|
tui/components/question
Package question renders interactive question modals in the TUI.
|
Package question renders interactive question modals in the TUI. |
|
tui/components/sessioninfo
Package sessioninfo formats the agent info section.
|
Package sessioninfo formats the agent info section. |
|
tui/components/todo
Package todo renders the TODO list in the infopane right side panel.
|
Package todo renders the TODO list in the infopane right side panel. |
|
tui/components/worldinfo
Package worldinfo formats the workspace / dispatch-world rows of the info pane.
|
Package worldinfo formats the workspace / dispatch-world rows of the info pane. |
|
tui/lolcat
Package lolcat provides tview-compatible rainbow coloring for the TUI.
|
Package lolcat provides tview-compatible rainbow coloring for the TUI. |
|
types
Package types defines the core data structures for yaah's provider communication layer: chat messages, tool definitions, and provider request/response shapes.
|
Package types defines the core data structures for yaah's provider communication layer: chat messages, tool definitions, and provider request/response shapes. |
|
update
selfupdate.go downloads a release asset and replaces the running binary.
|
selfupdate.go downloads a release asset and replaces the running binary. |
|
wake
Package wake implements yaah's event-driven waiting: one predicate engine with two faces —
|
Package wake implements yaah's event-driven waiting: one predicate engine with two faces — |
|
workflow/assert
Package assert is the fixed registry of named deterministic checks a `gate` node may name (yaah-0u0v.21).
|
Package assert is the fixed registry of named deterministic checks a `gate` node may name (yaah-0u0v.21). |
|
workflow/host
Package host runs a resolved workflow graph on this machine.
|
Package host runs a resolved workflow graph on this machine. |
|
workflow/ir
Package ir resolves a decoded workflow spec into the immutable graph the validators and executor consume: defaults folded into dispatch nodes, fan-out/loop bodies expanded into stable node paths, templates compiled into segment lists, and structured selectors compiled into a small AST.
|
Package ir resolves a decoded workflow spec into the immutable graph the validators and executor consume: defaults folded into dispatch nodes, fan-out/loop bodies expanded into stable node paths, templates compiled into segment lists, and structured selectors compiled into a small AST. |
|
workflow/registry
Package registry resolves a call node's `workflow` name to a validated, resolved subworkflow document (yaah-0u0v.23).
|
Package registry resolves a call node's `workflow` name to a validated, resolved subworkflow document (yaah-0u0v.23). |
|
workflow/replay
Package replay is the `--replay` door (yaah-0u0v.25): a workflow run's recorded trace, replayed through the same scheduler with zero model calls.
|
Package replay is the `--replay` door (yaah-0u0v.25): a workflow run's recorded trace, replayed through the same scheduler with zero model calls. |
|
workflow/spec
Package spec defines the typed v1 workflow document over dispatch and proposal settlement: strict YAML and JSON decoding with path-bearing errors, canonical JSON encoding, the stable spec hash, and the generated JSON Schema.
|
Package spec defines the typed v1 workflow document over dispatch and proposal settlement: strict YAML and JSON decoding with path-bearing errors, canonical JSON encoding, the stable spec hash, and the generated JSON Schema. |
|
workflow/store
Package store is the SQLite adapter for durable workflow run state (yaah-0u0v.16).
|
Package store is the SQLite adapter for durable workflow run state (yaah-0u0v.16). |
|
workflow/trace
Package trace defines the typed record a workflow run's trace surface reads (yaah-0u0v.17).
|
Package trace defines the typed record a workflow run's trace surface reads (yaah-0u0v.17). |
|
workflow/validate
Package validate holds the workflow DSL validators.
|
Package validate holds the workflow DSL validators. |
|
worldinfo
Package worldinfo derives the session's workspace and dispatch-world posture for display: what substrate the session runs on, what bounds a sub-agent dispatch, and which world the configured request resolves to on this host.
|
Package worldinfo derives the session's workspace and dispatch-world posture for display: what substrate the session runs on, what bounds a sub-agent dispatch, and which world the configured request resolves to on this host. |
|
tools
|
|
|
cataloggen
command
Command cataloggen regenerates internal/providers/catalog/data.json from https://models.dev/api.json.
|
Command cataloggen regenerates internal/providers/catalog/data.json from https://models.dev/api.json. |