exec

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteExec

func ExecuteExec(ctx context.Context, cfg *model.RuntimeConfig, scope model.RunScope) error

ExecuteExec runs one headless exec turn with optional persistence, ACP resume, and an optional pre-opened run scope.

func IsExecErrorReported

func IsExecErrorReported(err error) bool

IsExecErrorReported returns true when a failed exec already emitted its JSON failure payload.

func WriteExecJSONFailure

func WriteExecJSONFailure(dst io.Writer, runID string, err error) error

WriteExecJSONFailure emits a single JSON failure object to stdout/stderr-neutral writers.

Types

type PersistedExecRun

type PersistedExecRun struct {
	Version              int         `json:"version"`
	Mode                 string      `json:"mode"`
	RunID                string      `json:"run_id"`
	Status               string      `json:"status"`
	WorkspaceRoot        string      `json:"workspace_root"`
	IDE                  string      `json:"ide"`
	Model                string      `json:"model"`
	ReasoningEffort      string      `json:"reasoning_effort"`
	AccessMode           string      `json:"access_mode"`
	AddDirs              []string    `json:"add_dirs,omitempty"`
	CreatedAt            time.Time   `json:"created_at"`
	UpdatedAt            time.Time   `json:"updated_at"`
	TurnCount            int         `json:"turn_count"`
	ACPSessionID         string      `json:"acp_session_id,omitempty"`
	AgentSessionID       string      `json:"agent_session_id,omitempty"`
	LoadSessionSupported bool        `json:"load_session_supported,omitempty"`
	Usage                model.Usage `json:"usage,omitempty"`
	LastError            string      `json:"last_error,omitempty"`
	EventsPath           string      `json:"events_path,omitempty"`
	TurnsDir             string      `json:"turns_dir,omitempty"`
}

PersistedExecRun is the persisted run contract for resumable exec sessions.

func LoadPersistedExecRun

func LoadPersistedExecRun(workspaceRoot, runID string) (PersistedExecRun, error)

LoadPersistedExecRun reads one persisted exec run from .productize/runs/<run-id>/run.json.

type PreparedPromptResult

type PreparedPromptResult struct {
	RunID    string
	Output   string
	Snapshot SessionViewSnapshot
	Identity agent.SessionIdentity
}

PreparedPromptResult captures the stable nested-execution details needed by the reserved `run_agent` engine.

func ExecutePreparedPrompt

func ExecutePreparedPrompt(
	ctx context.Context,
	cfg *model.RuntimeConfig,
	promptText string,
	agentExecution *reusableagents.ExecutionContext,
	buildMCPServers SessionMCPBuilder,
) (PreparedPromptResult, error)

ExecutePreparedPrompt runs one real ACP-backed exec prompt without emitting nested output to the parent stdout stream.

type SessionMCPBuilder

type SessionMCPBuilder func(runID string) ([]model.MCPServer, error)

SessionMCPBuilder builds the final session MCP list after the child run id is allocated but before the ACP session is opened.

type SessionViewSnapshot

type SessionViewSnapshot = transcript.SessionViewSnapshot

Jump to

Keyboard shortcuts

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