agentrunbridge

package
v0.0.59 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildArgs

func BuildArgs(opts RunOpts) []string

BuildArgs maps RunOpts to agent-run CLI arguments after the binary name. The returned slice always starts with "run".

func IsSessionReady

func IsSessionReady(stdout string) bool

IsSessionReady reports whether tty status stdout is banner + sendable yes.

func ParseTTYStatus

func ParseTTYStatus(stdout string) (screen, sendable string)

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
	// Env is forwarded to RunOpts (each "KEY=VALUE" → agent-run -e KEY=VALUE).
	Env []string
	// 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
	// Env is a list of "KEY=VALUE" pairs passed to agent-run as repeatable -e flags.
	Env        []string
	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

func Run(opts RunOpts) (RunResult, error)

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")

Jump to

Keyboard shortcuts

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