Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildArgs ¶
BuildArgs maps RunOpts to agent-run CLI arguments after the binary name. The returned slice always starts with "run".
func IsSessionReady ¶
IsSessionReady reports whether tty status stdout is banner + sendable yes.
func ParseTTYStatus ¶
ParseTTYStatus extracts screen status and sendable token from `agent-run tty status` human stdout.
Lines:
- "screen status: <value>" → screen (trimmed value after colon)
- "sendable: <token> ..." → first whitespace-separated token of the value
Types ¶
type InteractiveOpenOpts ¶
type InteractiveOpenOpts struct {
SessionID, Prompt, WorkspaceDir, Binary, AgentRunner, RunnerConfigHome string
NoSubmit bool
// ReadyTimeout / ReadyPollInterval optional; 0 → Run defaults (60s / 500ms).
ReadyTimeout time.Duration
ReadyPollInterval time.Duration
LookPath func(file string) (string, error)
RunCommand func(name string, args ...string) error
RunOutput func(name string, args ...string) (string, error)
Logf func(format string, args ...any)
}
InteractiveOpenOpts is the minimal interactive --open profile. RunInteractiveOpen fills assumed RunOpts flags and calls Run only.
type RunOpts ¶
type RunOpts struct {
Prompt, SessionID, Binary, AgentRunner, RunnerConfigHome, WorkspaceDir string
AutoSendOrResume, KeepTTY, NewTerminal, Open, NoSubmit, Stateless bool
WaitReady bool
ReadyTimeout, ReadyPollInterval time.Duration
CaptureStdout bool
LookPath func(file string) (string, error)
RunCommand func(name string, args ...string) error
RunOutput func(name string, args ...string) (string, error)
Logf func(format string, args ...any)
}
RunOpts is the full-config entrypoint for launching agent-run.
type RunResult ¶
type RunResult struct {
Stdout string
}
RunResult holds optional captured launch stdout.
func Run ¶
Run resolves the binary, builds argv, launches agent-run, and optionally polls tty status until the session is ready.
func RunInteractiveOpen ¶
func RunInteractiveOpen(opts InteractiveOpenOpts) (RunResult, error)
RunInteractiveOpen fills the interactive open RunOpts profile and calls Run.
Defaults filled:
AutoSendOrResume, NewTerminal, Open, WaitReady = true CaptureStdout = false AgentRunner = firstNonEmpty(opts.AgentRunner, "grok-tty")