native

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 11 Imported by: 0

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 (openclaw argv is a best guess — spec 023).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Name string
	// Command builds the argv for a run (argv[0] is the binary).
	Command func(spec runtime.RunSpec) []string
	// 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)
}

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 New

func New(workRoot string, providers ...Provider) *Runtime

New builds a native runtime rooted at workRoot with the given providers.

func (*Runtime) Dispatch

func (r *Runtime) Dispatch(ctx context.Context, spec runtime.RunSpec) (runtime.Run, error)

Dispatch launches spec via its provider.

func (*Runtime) Name

func (r *Runtime) Name() string

Name implements runtime.Runtime.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL