agentui

package
v0.0.60 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindJSONPath added in v0.0.57

func BindJSONPath(home, runner, sessionID string) string

BindJSONPath returns the durable bind state path under the agent-run home.

func BuildContinuationPrompt

func BuildContinuationPrompt(prior []types.AgentEvent, newPrompt string) string

BuildContinuationPrompt formats prior timeline messages plus the new user turn for the runner.

func ResolveRunnerPrompt added in v0.0.57

func ResolveRunnerPrompt(resumeID, newPrompt string, prior []types.AgentEvent) string

ResolveRunnerPrompt chooses inject text for this turn. When resumeID is non-empty, the provider session already has context — return newPrompt only. When resumeID is empty, return BuildContinuationPrompt(prior, newPrompt).

func Run

func Run(ctx context.Context, opts RunOptions) error

Run executes the agent runner, streams output, and persists AgentEvents.

Types

type OpenGrokBindState added in v0.0.57

type OpenGrokBindState struct {
	State           string `json:"state"` // in_progress|ok|failed
	StartedAt       string `json:"started_at"`
	FinishedAt      string `json:"finished_at,omitempty"`
	Error           string `json:"error,omitempty"`
	RunnerSessionID string `json:"runner_session_id,omitempty"`
}

OpenGrokBindState is durable bind progress for concurrent status probes. Stored at sessions/<session_id>/bind.json.

func ReadOpenGrokBindState added in v0.0.57

func ReadOpenGrokBindState(home, runner, sessionID string) (OpenGrokBindState, bool)

ReadOpenGrokBindState loads bind.json if present.

type RunOptions

type RunOptions struct {
	Prompt    string
	Runner    string
	Model     string
	SessionID string
	// TerminalSessionID is the TTY registry id. When empty, SessionID is used as
	// the custom terminal id (legacy --session / --session-id-from-prompt).
	// When PreferAutoTerminal is true, TerminalSessionID is ignored and the TTY
	// id is auto-allocated (session-N) while SessionID remains agent storage.
	TerminalSessionID string
	// PreferAutoTerminal forces auto session-N for the TTY registry even when
	// SessionID is set (used by resume fallback when zombie reclaim cannot free
	// the prior terminal id).
	PreferAutoTerminal    bool
	AgentRunnerBinary     string // optional binary name/path or "binary flag..." shell spec
	AgentRunnerConfigHome string // grok/codex data dir; falls back to AGENT_RUNNER_CONFIG_HOME
	// PrependPaths are absolute dirs prepended to the TTY child PATH (persisted on meta).
	PrependPaths []string
	// Env is ordered KEY=VALUE entries for the TTY child (persisted on meta; last-win).
	Env               []string
	JSON              bool
	Workspace         string
	Store             agentstorage.Store
	Stdout            io.Writer
	Stderr            io.Writer
	StreamPhases      bool // web: phased assistant start/update/end; CLI: single message events
	KeepTerminalAlive bool
	// Open is run --open: silent keep-alive TTY start, auto-attach, print id after detach.
	Open bool
	// NoSubmit is run --no-submit: with Open, inject prompt without trailing Enter.
	NoSubmit bool
	// WebManagedGrokSync skips in-process grok sync; caller runs agentsync.EnsureGrokSync.
	WebManagedGrokSync bool
}

RunOptions configures a headless agent-run invocation.

Jump to

Keyboard shortcuts

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