Documentation
¶
Overview ¶
Package native is Fort's NativeRuntime (backlog AO-014): it spawns agent CLIs itself — no Multica — normalizes their stdout into runtime.RunEvents, injects stdin for Signal (human-in-the-loop), and tracks exit codes.
The executor is provider-agnostic: a Provider maps an agent name to argv and an optional line parser. DefaultProviders() encodes the AO-002 recon contract for claude/codex/hermes/openclaw (including the verified OpenClaw contract in spec 023).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Classified ¶ added in v0.10.0
Classified is one typed event extracted from a provider stdout line.
type Provider ¶
type Provider struct {
Name string
// Probe is a token-free command that proves the provider's non-interactive
// entry point still exists in the installed CLI. Dispatch fails closed when
// it exits non-zero, preventing a removed subcommand from accepting work.
Probe []string
// Command builds the argv for a run (argv[0] is the binary).
Command func(spec runtime.RunSpec) []string
// Failure recognizes a terminal provider error written to stdout. Some
// agent CLIs report retry exhaustion or API rejection but still exit zero;
// those lines must fail the run rather than produce a false success.
Failure func(line string) (message string, ok bool)
// Parse optionally normalizes a stdout line into a message. When ok is
// false the line is emitted as a raw EventStdout.
Parse func(line string) (msg string, ok bool)
// Classify optionally turns a stdout line into typed events (spec 030). A
// line may yield several (text + tool_use blocks). When set it supersedes
// Parse; ok=false falls through to a raw EventStdout.
Classify func(line string) ([]Classified, bool)
// Interactive opts the provider into a stdin PIPE so Signal can inject input
// mid-run (HITL). Default false: the child gets /dev/null and so an immediate
// EOF. This matters — a CLI that drains stdin (e.g. `codex exec`, which
// prints "Reading additional input from stdin...") hangs forever on an open
// pipe that is never written to nor closed. None of the shipped agent CLIs
// read their prompt from stdin; they take it as argv.
Interactive bool
}
Provider describes how to launch one agent CLI headless.
func DefaultProviders ¶
func DefaultProviders() []Provider
DefaultProviders returns the built-in provider set encoding the AO-002 recon contract (docs/notes/runtime-recon.md) for all four agents.
type Runtime ¶
type Runtime struct {
// EnvAllow, when non-empty, restricts which host environment variables are
// passed to spawned CLIs (least privilege, AO-041). Empty = pass the full
// environment (the relaxed default; providers need their own auth keys).
EnvAllow []string
// contains filtered or unexported fields
}
Runtime is the native executor.
func (*Runtime) UseVerifiedExecutables ¶ added in v0.13.0
func (r *Runtime) UseVerifiedExecutables(resolver VerifiedExecutableResolver)
UseVerifiedExecutables binds future provider probes and starts to executable bytes authorized by capability discovery. Leaving it unset preserves the legacy PATH-resolved runtime used when capability planning is disabled. Configure it before the runtime is published to concurrent callers.
type VerifiedExecutableResolver ¶ added in v0.13.0
type VerifiedExecutableResolver interface {
ResolveVerifiedExecutable(name string) (string, error)
}
VerifiedExecutableResolver returns an immutable executable path only when the command's current PATH target still matches bytes authorized by the capability probe. Implementations must fail closed without exposing paths or digests in their errors.