Documentation
¶
Index ¶
- Constants
- func AGUIExamplePolicy() adaptor.SharedOption
- func Check(condition bool, format string, args ...any)
- func CommandEnvForAgent(agent string) string
- func CommandSummary(cfg LiveAgentConfig) map[string]any
- func DefaultCommandForAgent(agent string) string
- func DefaultModelForAgent(agent string) string
- func DiscoverHealthyAgentCommand(agent, override string) (string, string, bool)
- func DriverTypeForAgent(agent string) string
- func EnsureWindowsProcessEnv(base []string) []string
- func Fatalf(format string, args ...any)
- func LiveAgentSummary(cfg LiveAgentConfig) map[string]any
- func ModelEnvForAgent(agent string) string
- func Must(err error, format string, args ...any)
- func NewAGUIStreamingAgent(cwd string) (*adaptor.Agent, string)
- func NewLiveDriver(cfg LiveAgentConfig) driver.Driver
- func NonInteractive(agent string, sandbox adaptor.SandboxLevel) adaptor.SharedOption
- func NonInteractivePolicy(agent string, sandbox adaptor.SandboxLevel) adaptor.Policy
- func PrintJSON(value any)
- func ProbeAgentCommand(command string) bool
- func RequireHealthyAgentCommand(agent, override string) (string, string)
- func ResolveAGUIAgent() string
- func ResolveAgentModel(agent, override string) string
- func ResolveLiveAgent(raw string) string
- func SupportedAgents() string
- func WrapCommandForPlatform(command string, args []string) (string, []string)
- type LiveAgentConfig
Constants ¶
const ( AgentCodex = "codex" AgentClaude = "claude" AgentCursor = "cursor" AgentCodebuddy = "codebuddy" )
Variables ¶
This section is empty.
Functions ¶
func AGUIExamplePolicy ¶
func AGUIExamplePolicy() adaptor.SharedOption
AGUIExamplePolicy returns the policy option appropriate for the resolved AG-UI agent driver:
- claude: enable interactive PlanReview + Question approvals. Permission stays auto-approve because the demo has no host-side tool executor; the CLI would hang on Bash/Edit/Write waiting for a tool_result otherwise.
- codex/cursor/codebuddy: skip approvals & questions by default so the demo can run end-to-end on the local CLI.
It is a SharedOption, so it can seed adaptor.New (as here) or override a single Run/Stream call.
func CommandEnvForAgent ¶
func CommandSummary ¶
func CommandSummary(cfg LiveAgentConfig) map[string]any
func DefaultCommandForAgent ¶
func DefaultModelForAgent ¶
func DriverTypeForAgent ¶
func EnsureWindowsProcessEnv ¶
func LiveAgentSummary ¶
func LiveAgentSummary(cfg LiveAgentConfig) map[string]any
func ModelEnvForAgent ¶
func NewAGUIStreamingAgent ¶
NewAGUIStreamingAgent builds the Agent used by web-chat/aguiclient and web-chat/copilotkit. The returned string is the resolved driver name.
v1 shape: one adaptor.New call taking the driver value plus agent-level defaults. WithThreadStore is what makes agent.Thread(key) work — the AG-UI frontend always sends threadId, and the bridge turns it into a thread key.
func NewLiveDriver ¶
func NewLiveDriver(cfg LiveAgentConfig) driver.Driver
NewLiveDriver builds a driver value for the resolved local CLI. The four built-in packages all expose the same one-line shape — codex.Driver(codex.Config{...}) — so the example helper is just a switch over which Config type to fill.
func NonInteractive ¶
func NonInteractive(agent string, sandbox adaptor.SandboxLevel) adaptor.SharedOption
NonInteractive returns the policy as a SharedOption, so the same value works as an adaptor.New default and as a per-call Run/Stream override.
func NonInteractivePolicy ¶
func NonInteractivePolicy(agent string, sandbox adaptor.SandboxLevel) adaptor.Policy
NonInteractivePolicy combines portable unattended approval routing with the requested sandbox when the selected Driver advertises isolation. A non-zero unsupported policy is rejected before launch, so sandbox remains inherited for providers that do not expose an isolation control.
func ProbeAgentCommand ¶
func ResolveAGUIAgent ¶
func ResolveAGUIAgent() string
ResolveAGUIAgent returns the driver name for AG-UI streaming examples. Env AGUI_AGENT (or first positional override via scripts): "codex" | "claude" | "cursor". Default is codex. Unknown values abort the example process.
func ResolveAgentModel ¶
func ResolveLiveAgent ¶
func SupportedAgents ¶
func SupportedAgents() string
Types ¶
type LiveAgentConfig ¶
type LiveAgentConfig struct {
Agent string
DriverType string
Model string
Command string
CommandNote string
CWD string
Env []driver.EnvBinding
ExtraArgs []string
}
LiveAgentConfig is the resolved local-CLI agent configuration shared by the examples. Command is always a runnable binary discovered from PATH, a provider-specific env var, or an explicit -command flag.
func ResolveLiveAgentConfig ¶
func ResolveLiveAgentConfig(rawAgent, rawModel, rawCommand, cwd string) LiveAgentConfig