Documentation
¶
Overview ¶
Package api is the public, stable surface for embedding agentsmithy into other Go programs (notably smithy-cli). It re-exports the small set of operations needed to load config, run a server, or chat with an agent, all without depending on the internal/* packages.
Index ¶
Constants ¶
View Source
const ExitError = tmpl.ExitError
ExitError is the ExitKind for error exits.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig reads and parses the config file at path and returns the parsed config along with the resolved project root (the directory containing the file).
Types ¶
type ExitSignal ¶
type ExitSignal = tmpl.ExitSignal
ExitSignal is a sentinel error returned when an agent calls {{ exit_error "reason" }}. Callers use errors.As to detect it.
type ServeOptions ¶
type ServeOptions struct {
// Root is the directory the server is rooted in.
Root string
// Transport is the wire protocol; one of none|stdio|mcp-stdio|a2a|mcp-http.
Transport string
// Addr is the listening address for HTTP-style transports.
Addr string
// Once, when non-empty and Transport is stdio, sends a single prompt and exits.
Once string
// Verbose enables tool-call/intermediate-step tracing on stdio.
Verbose bool
}
ServeOptions controls server behaviour.
Transport selects the wire protocol:
- stdio: line REPL over stdin/stdout for dev/CI use.
- mcp-stdio: agent exposed as an MCP tool over stdin/stdout (the transport VS Code, Claude Desktop, etc. spawn). Required for `provider: borrowed`.
- mcp-http: same MCP surface over streamable HTTP.
- a2a: A2A JSON-RPC server over HTTP, with AgentCard at /.well-known/agent.json.
Click to show internal directories.
Click to hide internal directories.