agentrunbridge

package
v0.0.57 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 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
	// 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

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