Documentation
¶
Overview ¶
Package agent is the embedded AI Agent Runtime package (PRD §23). It owns the agent.Tool extension point (TAD §2.6) and exposes custom tool registration; the full execute loop, context/planning, safety, and approval machinery are implemented in Phase 8 (agent/runtime, agent/planner, agent/safety).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTool ¶
func RegisterTool(tool Tool)
RegisterTool registers a custom agent tool (PRD §24.3). Registrations are merged into every ToolRegistry's ForIdentity output per TAD §10.4. Mirrors the package-level registration patterns of api.RegisterMethod and schema.RegisterValidator; call from package init or main.
func WithApprovals ¶
func WithApprovals(a runtime.ApprovalGateway) runtime.ExecuteOption
func WithProvider ¶
func WithProvider(p llm.Provider) runtime.ExecuteOption
Types ¶
type ExecuteOption ¶
type ExecuteOption = runtime.ExecuteOption
ExecuteOption, WithProvider, and WithApprovals are re-exported from agent/runtime (TAD §3.3). They let a caller override the LLM provider and approval gateway for a single Execute turn — which is the hook orjanda/testing.MockLLM uses to script agent turns from a test (TAD §17).
type Tool ¶
Tool is a hand-authored custom agent tool. It is re-exported from agent/tools (where ToolRegistry lives) so callers reference it as agent.Tool exactly as TAD §2.6 declares. Custom tools bypass Registry-derived generation and are merged into ToolRegistry.ForIdentity filtered only by their own AllowedRoles (TAD §10.4). The Handler is executed by the Agent Executor in Phase 8.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package llm defines the llm.Provider interface and implements the OpenAI, openai_compatible, and Anthropic adapters with streaming, tool-calling, structured-output support, failover, circuit-breaking, and token tracking.
|
Package llm defines the llm.Provider interface and implements the OpenAI, openai_compatible, and Anthropic adapters with streaming, tool-calling, structured-output support, failover, circuit-breaking, and token tracking. |
|
Package planner defines the Plan/PlanStep structured-output contract and the whole-plan pre-execution validation logic used in Plan-and-Execute mode.
|
Package planner defines the Plan/PlanStep structured-output contract and the whole-plan pre-execution validation logic used in Plan-and-Execute mode. |
|
Package runtime implements the agent execution loop (Runtime.Execute), Session Manager, and Context Manager with the discovery/operation tool split (TAD §11.1) and ReAct/Plan-and-Execute mode switching (TAD §11.2).
|
Package runtime implements the agent execution loop (Runtime.Execute), Session Manager, and Context Manager with the discovery/operation tool split (TAD §11.1) and ReAct/Plan-and-Execute mode switching (TAD §11.2). |
|
Package safety implements SafetyPolicy and SafetyLayer: the five-step approval-evaluation order (Always → Bulk → RoleOverride → RequireApproval → AutoApprove), rate limiting, token budgets, and tool allowlists.
|
Package safety implements SafetyPolicy and SafetyLayer: the five-step approval-evaluation order (Always → Bulk → RoleOverride → RequireApproval → AutoApprove), rate limiting, token budgets, and tool allowlists. |
|
Package tools implements the ToolRegistry: Compile (run once after Registry.Compile) and ForIdentity (run per agent turn) following the deterministic O(len(CompiledDocs)) generation algorithm in TAD §10.
|
Package tools implements the ToolRegistry: Compile (run once after Registry.Compile) and ForIdentity (run per agent turn) following the deterministic O(len(CompiledDocs)) generation algorithm in TAD §10. |