Documentation
¶
Overview ¶
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
Package host implements the optional local Host. It has no dependency on the control plane, Tailcat, relay admission, or the client's SSH implementation.
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0 Copyright 2026 Nimote contributors
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- func AtomicWrite(path string, data []byte) error
- func Call(ctx context.Context, dir string, req RPCRequest) ([]byte, error)
- func CanonicalDirectory(path string) string
- func CheckStateName(dir string) error
- func ControlLock(dir string) (*os.File, error)
- func DecodeJSON(data []byte, value any) error
- func DefaultDir() (string, error)
- func DeviceContext(ctx context.Context, id string) context.Context
- func DeviceSSHCommand(binary, id string) (string, error)
- func Fail(w http.ResponseWriter, status int, message string)
- func GitEvidence(ctx context.Context, dir string, args ...string) ([]byte, error)
- func InitializeToolEnvironment(ctx context.Context, dir string) error
- func InspectAgents(ctx context.Context) map[string]AgentInstallation
- func MutationFailure(w http.ResponseWriter, err error)
- func NewRequestID() (string, error)
- func PrivateDir(path string) error
- func ReadJSON(w http.ResponseWriter, r *http.Request, value any) bool
- func ReadPrivateLimit(path string, limit int64) ([]byte, error)
- func ReadRunLog(dir string) (string, error)
- func Respond(w http.ResponseWriter, status int, value any)
- func RevokeDevice(dir, id string) error
- func RunEvidenceProcess(ctx context.Context, cmd *exec.Cmd, input io.Reader) ([]byte, error)
- func RunOnce[T any](m *WorkflowRuntime, id, operation string, payload any, run func() (T, error)) (T, error)
- func SameWorkspaceDirectory(a, b string) bool
- func SaveConfig(dir string, c Config) error
- func Serve(ctx context.Context, dir string, ready io.Writer) error
- func ServeMCP(ctx context.Context, dir string, in io.Reader, out io.Writer, write bool) error
- func ServeRPCStream(ctx context.Context, dir string, input io.Reader, output io.Writer) error
- func ServeWithExtension(ctx context.Context, dir string, ready io.Writer, extension Extension) error
- func StateIdle(dir string) (bool, error)
- func SupportsStructuredAgent(agent string) bool
- func ValidExecutionPolicy(policy string) bool
- func ValidID(id string) bool
- type Activity
- type ActivityPage
- type AgentInstallation
- type AgentMessage
- type AgentResume
- type AgentStatement
- type Capabilities
- type CodeVersion
- type Config
- type ConflictWarning
- type Device
- type Event
- type EventPage
- type ExecutionIdentity
- type Extension
- type ExternalAttachment
- type ExternalConnection
- type ExternalSessionCapabilities
- type HistoryAggregate
- type InboxItem
- type InboxPage
- type InboxReview
- type Manager
- func (m *Manager) Activity(id string, after uint64) (ActivityPage, error)
- func (m *Manager) AgentMessage(id string, req AgentMessage) error
- func (m *Manager) AgentSnapshot(id string) (map[string]any, error)
- func (m *Manager) Cancel(id string) error
- func (m *Manager) CaptureVerification(ctx context.Context, id string) (VerificationReport, error)
- func (m *Manager) Close()
- func (m *Manager) Conflicts(ctx context.Context, allowed func(string) bool) []ConflictWarning
- func (m *Manager) Delete(id string) error
- func (m *Manager) Events(after uint64) EventPage
- func (m *Manager) Get(id string) (Session, error)
- func (m *Manager) Inbox(allowed func(string) bool) (InboxPage, error)
- func (m *Manager) Input(id string, data []byte) error
- func (m *Manager) List(after uint64) []Session
- func (m *Manager) OpenInputStream(id, principal string) (string, error)
- func (m *Manager) Output(id string, offset int64) ([]byte, int64, error)
- func (m *Manager) OutputPage(id string, offset int64) ([]byte, int64, int64, error)
- func (m *Manager) PrepareIdleShutdown() error
- func (m *Manager) RequestStorage() *RequestStorageStatus
- func (m *Manager) Resize(id string, rows, cols uint16) error
- func (m *Manager) Resources() ResourceStatus
- func (m *Manager) ReviewInbox(id, revision, status string) error
- func (m *Manager) Start(req StartRequest) (Session, error)
- func (m *Manager) StartVerification(ctx context.Context, id string, commands []TestCommand) (VerificationReport, error)
- func (m *Manager) StreamInput(id, principal, streamID string, sequence uint64, data []byte) (inputStreamReceipt, error)
- func (m *Manager) Verification(ctx context.Context, id string) (VerificationReport, error)
- type MutationReceipt
- type RPCRequest
- type RecoveryFile
- type RecoveryPlan
- type RecoveryResult
- type RequestStorageStatus
- type ResourceEnforcement
- type ResourceLimits
- type ResourceStatus
- type RunLog
- type ScopedHandler
- type Server
- type Session
- type StartRequest
- type TaskReference
- type TestCommand
- type TestEvidence
- type ToolEnvironmentConfig
- type ToolEnvironmentStatus
- type VerificationReport
- type WorkflowRuntime
- func (m *WorkflowRuntime) BeginMutation() (func(), bool)
- func (m *WorkflowRuntime) Context() context.Context
- func (m *WorkflowRuntime) Launch(id string, run func()) bool
- func (m *WorkflowRuntime) MarkVerificationRemoteStale(id, reason string) error
- func (m *WorkflowRuntime) ReadReceipt(id string) (requestRecord, error)
- func (m *WorkflowRuntime) Running(id string) bool
- func (m *WorkflowRuntime) SaveVerification(id string, report VerificationReport) error
- func (m *WorkflowRuntime) SessionDir() string
- func (m *WorkflowRuntime) Start(req StartRequest, baseCommit string) (Session, error)
- func (m *WorkflowRuntime) Stopped() bool
- func (m *WorkflowRuntime) WaitAgentReady(id string) error
- type WorktreeRequest
Constants ¶
const Address = "127.0.0.1:47831"
const Protocol = 1
const StructuredAgentSupported = structuredAgentSupported
Variables ¶
var Edition = "community"
Edition is set by the downstream Connect release build.
var ErrRequestConflict = errRequestConflict
var ErrRequestUncertain = errRequestUncertain
var Version = "2.5.0-community"
Version is set by the release build; protocol compatibility is tracked separately.
Functions ¶
func AtomicWrite ¶
func CanonicalDirectory ¶
func CheckStateName ¶
CheckStateName prevents a status probe or a new GUI from creating a second identity before setup has migrated a legacy installation.
func ControlLock ¶
ControlLock serializes management across GUI processes without owning Host lifetime.
func DecodeJSON ¶
func DefaultDir ¶
func DeviceSSHCommand ¶
DeviceSSHCommand generates the forced command only. Administrators bind it to a unique public key with OpenSSH restrict,command="..."; never a normal shell key.
func GitEvidence ¶
func InitializeToolEnvironment ¶
InitializeToolEnvironment resolves the logged-in account's tools once. Shell failure is reported in diagnostics and falls back to platform directories. Invalid explicit configuration fails closed and never replaces a good snapshot.
func InspectAgents ¶
func InspectAgents(ctx context.Context) map[string]AgentInstallation
InspectAgents is an explicit local diagnostic, never called by capabilities polling. A --version result is descriptive only; live handshakes decide safety. Uses the same owned process backend, bounded output and tree cancellation.
func MutationFailure ¶
func MutationFailure(w http.ResponseWriter, err error)
func NewRequestID ¶
NewRequestID creates an expiring, cryptographically random mutation key. Reuse it unchanged for retries. After seven days the Host rejects the key, allowing its receipt to be removed without permitting delayed execution. Clients must check mutation_expiry_v1 before using this format with old Hosts.
func PrivateDir ¶
func ReadRunLog ¶
func RevokeDevice ¶
func RunEvidenceProcess ¶
func RunOnce ¶
func RunOnce[T any](m *WorkflowRuntime, id, operation string, payload any, run func() (T, error)) (T, error)
RunOnce uses the same receipt store and request fingerprint as core RPC.
func SameWorkspaceDirectory ¶
func SaveConfig ¶
SaveConfig only changes stopped Hosts. Callers serialize lifecycle operations.
func Serve ¶
Serve reserves the loopback listener before reading or recovering session state. A second daemon cannot mark the live daemon's processes interrupted.
func ServeMCP ¶
ServeMCP delegates JSON-RPC, lifecycle and protocol negotiation to the official SDK. Host retains tool authorization and authenticated loopback RPC only.
func ServeRPCStream ¶
ServeRPCStream carries bounded, multiplexed requests over one SSH exec channel. The credential stays on the host. EOF only detaches the client; processes belong to the daemon, never to this bridge.
func ServeWithExtension ¶
func StateIdle ¶
StateIdle distinguishes a closed RPC listener from completion of process and session cleanup. A new detached daemon must wait until the previous owner releases this lock, even after the shutdown response has been delivered.
func SupportsStructuredAgent ¶
func ValidExecutionPolicy ¶
Types ¶
type Activity ¶
type Activity struct {
Sequence uint64 `json:"sequence"`
Type string `json:"type"`
State string `json:"state,omitempty"`
ReferenceID string `json:"reference_id,omitempty"`
OutputOffset int64 `json:"output_offset"`
Time time.Time `json:"time"`
}
Activity is a small history reference, never a second copy of terminal/tool content. OutputOffset points into the existing rolling byte log.
type ActivityPage ¶
type AgentInstallation ¶
type AgentInstallation struct {
PathSource string `json:"path_source,omitempty"`
DiscoveryError string `json:"discovery_error,omitempty"`
SessionCapabilities *ExternalSessionCapabilities `json:"session_capabilities,omitempty"`
CLIPath string `json:"cli_path,omitempty"`
CLIDiscovered bool `json:"cli_discovered"`
History string `json:"history"`
Resume string `json:"resume"`
LiveAttach bool `json:"live_attach"`
LiveAttachReason string `json:"live_attach_reason"`
Path string `json:"path,omitempty"`
Protocol string `json:"protocol"`
ProtocolVersion int `json:"protocol_version,omitempty"`
Installed bool `json:"installed"`
Version string `json:"version,omitempty"`
ProbeStatus string `json:"probe_status"`
}
type AgentMessage ¶
type AgentMessage struct {
Action string `json:"action"`
RequestID string `json:"request_id,omitempty"`
Text string `json:"text,omitempty"`
TurnID string `json:"turn_id,omitempty"`
ApprovalID string `json:"approval_id,omitempty"`
Decision string `json:"decision,omitempty"`
OptionID string `json:"option_id,omitempty"`
Value string `json:"value,omitempty"`
}
AgentMessage is a semantic operation, never terminal input or arbitrary RPC.
type AgentResume ¶
type AgentResume struct {
ConversationID string `json:"conversation_id"`
}
type AgentStatement ¶
type Capabilities ¶
type Capabilities struct {
Enforcement *ResourceEnforcement `json:"enforcement,omitempty"`
Version string `json:"version"`
Protocol int `json:"protocol"`
MinProtocol int `json:"min_protocol"`
Platform string `json:"platform"`
Arch string `json:"arch"`
HostID string `json:"host_id"`
Features map[string]bool `json:"features"`
Tools map[string]string `json:"tools"`
Agents map[string]AgentInstallation `json:"agents,omitempty"`
}
type CodeVersion ¶
type CodeVersion struct {
Root string `json:"root"`
CommonDir string `json:"common_dir"`
Branch string `json:"branch"`
Head string `json:"head"`
Fingerprint string `json:"fingerprint"`
Dirty bool `json:"dirty"`
Files []string `json:"files"`
DiffStat string `json:"diff_stat"`
Unknown string `json:"unknown,omitempty"`
}
func CaptureCode ¶
func CaptureCode(ctx context.Context, dir string) (CodeVersion, string)
type Config ¶
Config is shared by every local client. The SSH RPC wire protocol is unchanged.
func ReadConfig ¶
type ConflictWarning ¶
type ConflictWarning struct {
Sessions []string `json:"sessions"`
Agents []string `json:"agents"`
Directories []string `json:"directories"`
Kind string `json:"kind"`
Severity string `json:"severity"`
Files []string `json:"files"`
Evidence string `json:"evidence"`
Attribution string `json:"attribution"`
}
type Device ¶
type Device struct {
ID string `json:"id"`
Name string `json:"name"`
Role string `json:"role"`
Created time.Time `json:"created"`
Revoked *time.Time `json:"revoked,omitempty"`
Sessions []string `json:"sessions,omitempty"`
IdentityScopes map[string]uint32 `json:"identity_scopes,omitempty"`
}
Devices are deliberately read-only. Giving a same-user client command execution would let it read the owner's credential and bypass device revocation.
func CreateControllerDevice ¶
func CreateDevice ¶
func CreateScopedDevice ¶
CreateScopedDevice grants observation, or cancellation/decline only, to an explicit set of existing session IDs. It never grants OS-user execution.
func ListDevices ¶
type Event ¶
type Event struct {
Revision uint64 `json:"revision"`
SessionID string `json:"session_id"`
State string `json:"state"`
Time time.Time `json:"time"`
}
Event is a durable state-change notification, independent of client lifetime. Output remains in the per-session byte log and is retrieved with its cursor.
type ExecutionIdentity ¶
Advanced Linux-only execution boundary. A fresh dedicated numeric UID is reserved for one session forever; it is not the Host's account or another session's identity. Unsupported/nonprivileged backends fail before execution.
type Extension ¶
type Extension struct {
Path string
NewHandler func(*WorkflowRuntime) ScopedHandler
Features func(map[string]string) map[string]bool
}
Extension registers a workflow handler and its negotiated feature flags.
type ExternalAttachment ¶
type ExternalAttachment struct {
ExternalConnection
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
type ExternalConnection ¶
type ExternalConnection struct {
Transport string `json:"transport"`
Endpoint string `json:"endpoint"`
}
Only non-secret connection identity is persisted with Session. Credentials travel in authenticated POST bodies, never query strings, args or Session.
type ExternalSessionCapabilities ¶
type ExternalSessionCapabilities struct {
DiscoveryTransports []string `json:"discovery_transports,omitempty"`
LiveTransports []string `json:"live_transports,omitempty"`
Discovery string `json:"discovery"`
History string `json:"history"`
Resume string `json:"resume"`
LiveControl string `json:"live_control"`
HistoryMode string `json:"history_mode"`
Reason string `json:"reason"`
}
Values are supported, conditional, or unsupported. Conditional requires a successful native request; installation or a saved ID is not sufficient.
type HistoryAggregate ¶
type InboxReview ¶
type InboxReview struct {
CompletedTurnSequence uint64 `json:"completed_turn_sequence,omitempty"`
Status string `json:"status"`
Revision uint64 `json:"revision"`
Sequence uint64 `json:"sequence"`
Updated time.Time `json:"updated"`
}
Review markers acknowledge one observed revision, never future turns.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManagerWithLimits ¶
func NewManagerWithLimits(dir string, limits ResourceLimits) (*Manager, error)
func (*Manager) Activity ¶
func (m *Manager) Activity(id string, after uint64) (ActivityPage, error)
func (*Manager) AgentMessage ¶
func (m *Manager) AgentMessage(id string, req AgentMessage) error
func (*Manager) CaptureVerification ¶
func (*Manager) OpenInputStream ¶
Streams are allocated by the daemon, never reconstructed from client input. Losing a stream (restart or bounded eviction) makes every old frame invalid. This is safe because terminal processes do not survive a daemon restart.
func (*Manager) Output ¶
Output keeps the protocol-1 byte cursor contract. OutputPage also reports where retained output starts when an old cursor has fallen behind.
func (*Manager) OutputPage ¶
func (*Manager) PrepareIdleShutdown ¶
PrepareIdleShutdown atomically rejects shutdown if any process is still owned and prevents new sessions from starting once an idle shutdown is accepted.
func (*Manager) RequestStorage ¶
func (m *Manager) RequestStorage() *RequestStorageStatus
RequestStorage is local operational metadata; it contains no mutation payloads. Legacy receipts cannot be safely discarded without changing the old protocol.
func (*Manager) Resources ¶
func (m *Manager) Resources() ResourceStatus
func (*Manager) ReviewInbox ¶
func (*Manager) Start ¶
func (m *Manager) Start(req StartRequest) (Session, error)
Auto mode probes a live stable-protocol handshake before a prompt is accepted. This wrapper never holds the manager lock while waiting for the agent, so an upgrade-incompatible CLI cannot freeze other terminals. No user turn is sent during probing, and running turns are never retried through another adapter.
func (*Manager) StartVerification ¶
func (m *Manager) StartVerification(ctx context.Context, id string, commands []TestCommand) (VerificationReport, error)
func (*Manager) StreamInput ¶
func (m *Manager) StreamInput(id, principal, streamID string, sequence uint64, data []byte) (inputStreamReceipt, error)
Only the next sequence can write. The latest receipt can be queried again with the same bytes; older frames and changed duplicates are never replayed. A failed/partial write poisons the stream, including all subsequent frames. inputMu also serializes writes from legacy clients and other devices.
func (*Manager) Verification ¶
type MutationReceipt ¶
type MutationReceipt = mutationReceipt
type RPCRequest ¶
type RPCRequest = hostclient.Request
RPCRequest is one authenticated request transported over an existing SSH exec channel. No credential is returned to the phone or placed in argv.
type RecoveryFile ¶
type RecoveryFile struct {
Name string `json:"name"`
SHA256 string `json:"sha256"`
Size int64 `json:"size"`
Issue string `json:"issue,omitempty"`
Action string `json:"action,omitempty"`
}
Recovery is explicit local maintenance on a stopped Host. Unknown/unsafe files block repair; request receipts, credentials, outputs and activity are never reset.
type RecoveryPlan ¶
type RecoveryPlan struct {
ID string `json:"id"`
Files []RecoveryFile `json:"files"`
Blocked bool `json:"blocked"`
ResetRevision uint64 `json:"reset_revision"`
}
func InspectRecovery ¶
func InspectRecovery(dir string) (RecoveryPlan, error)
type RecoveryResult ¶
type RecoveryResult struct {
Changed bool `json:"changed"`
Backup string `json:"backup,omitempty"`
}
func ApplyRecovery ¶
func ApplyRecovery(dir, planID string) (RecoveryResult, error)
type RequestStorageStatus ¶
type RequestStorageStatus struct {
Receipts int `json:"receipts"`
LegacyReceipts int `json:"legacy_receipts"`
Bytes int64 `json:"bytes"`
ReservedBytes int64 `json:"reserved_bytes"`
Active int `json:"active"`
ReceiptLimit int `json:"receipt_limit"`
ByteLimit int64 `json:"byte_limit"`
RetentionSeconds int64 `json:"retention_seconds"`
CapacityWarning bool `json:"capacity_warning"`
}
type ResourceEnforcement ¶
type ResourceLimits ¶
type ResourceLimits struct {
MaxActiveSessions int `json:"max_active_sessions"`
MaxRetainedSessions int `json:"max_retained_sessions"`
MaxRuntimeSeconds int64 `json:"max_runtime_seconds"`
MinFreeDiskBytes uint64 `json:"min_free_disk_bytes"`
CPUPercent int `json:"cpu_percent,omitempty"`
MemoryBytes uint64 `json:"memory_bytes,omitempty"`
MaxProcesses int `json:"max_processes,omitempty"`
CgroupRoot string `json:"cgroup_root,omitempty"`
// contains filtered or unexported fields
}
ResourceLimits governs Host admission and supervised process lifetimes. It is separate from GUI-owned config.json, so old clients cannot silently erase it. Zero runtime means unlimited. Native quotas require a supported kernel containment backend.
func DefaultResourceLimits ¶
func DefaultResourceLimits() ResourceLimits
func ReadResourceLimits ¶
func ReadResourceLimits(dir string) (ResourceLimits, error)
func (ResourceLimits) Validate ¶
func (l ResourceLimits) Validate() error
type ResourceStatus ¶
type ResourceStatus struct {
Limits ResourceLimits `json:"limits"`
Active int `json:"active"`
Retained int `json:"retained"`
FreeDiskBytes uint64 `json:"free_disk_bytes"`
DiskAvailable bool `json:"disk_available"`
}
type RunLog ¶
type RunLog struct {
// contains filtered or unexported fields
}
RunLog retains a bounded native-service log, never terminal or Agent output.
func OpenRunLog ¶
type ScopedHandler ¶
ScopedHandler runs after Host authentication, protocol and request limits. A non-nil session predicate limits reads to the caller's authorized sessions. Only the owner can call mutation methods.
type Session ¶
type Session struct {
External *ExternalConnection `json:"external,omitempty"`
SourceDirectory string `json:"source_directory,omitempty"`
BaseCommit string `json:"base_commit,omitempty"`
ExecutionPolicy string `json:"execution_policy,omitempty"`
ActivitySequence uint64 `json:"activity_sequence,omitempty"`
Task *TaskReference `json:"task,omitempty"`
AgentStatus string `json:"agent_status,omitempty"`
StartRequestID string `json:"start_request_id,omitempty"`
CompatibilityFallback string `json:"compatibility_fallback,omitempty"`
Interaction string `json:"interaction,omitempty"`
OutputBytes int64 `json:"output_bytes"`
OutputTruncated bool `json:"output_truncated"`
ID string `json:"id"`
ConversationID string `json:"conversation_id,omitempty"`
Kind string `json:"kind"`
Agent string `json:"agent,omitempty"`
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Directory string `json:"directory"`
State string `json:"state"`
Started time.Time `json:"started"`
Finished *time.Time `json:"finished,omitempty"`
ExitCode *int `json:"exit_code,omitempty"`
Error string `json:"error,omitempty"`
Revision uint64 `json:"revision"`
}
type StartRequest ¶
type StartRequest struct {
Attach *ExternalAttachment `json:"attach,omitempty"`
Worktree *WorktreeRequest `json:"worktree,omitempty"`
Identity *ExecutionIdentity `json:"execution_identity,omitempty"`
ExecutionPolicy string `json:"execution_policy,omitempty"`
Task *TaskReference `json:"task,omitempty"`
RequestID string `json:"request_id,omitempty"`
Interaction string `json:"interaction,omitempty"` // terminal (default), structured, or auto
Kind string `json:"kind"` // task, terminal, agent
Command string `json:"command"`
Args []string `json:"args"`
Directory string `json:"directory"`
Agent string `json:"agent"` // codex, claude, opencode
Resume *AgentResume `json:"resume,omitempty"`
// contains filtered or unexported fields
}
type TaskReference ¶
A client Task reference scoped by the session's Host and workspace. It never authorizes executing that Task or bypassing approvals.
type TestCommand ¶
type TestEvidence ¶
type TestEvidence struct {
TestCommand
SessionID string `json:"session_id,omitempty"`
Started *time.Time `json:"started,omitempty"`
Finished *time.Time `json:"finished,omitempty"`
ExitCode *int `json:"exit_code"`
Status string `json:"status"`
Version string `json:"version"`
Source string `json:"source"`
OutputPath string `json:"output_path,omitempty"`
}
type ToolEnvironmentConfig ¶
type ToolEnvironmentConfig struct {
Executables map[string]string `json:"executables,omitempty"`
SearchPaths []string `json:"search_paths,omitempty"`
DisableShell bool `json:"disable_shell,omitempty"`
}
ToolEnvironmentConfig is intentionally separate from config.json: GUI settings writers and older clients must not erase executable overrides when saving ports.
type ToolEnvironmentStatus ¶
type VerificationReport ¶
type VerificationReport struct {
AgentStatement *AgentStatement `json:"agent_statement,omitempty"`
BaseCommit string `json:"base_commit,omitempty"`
TestedTree string `json:"tested_tree,omitempty"`
RemoteStale bool `json:"remote_stale,omitempty"`
PublishedCommit string `json:"published_commit,omitempty"`
SessionID string `json:"session_id"`
Task *TaskReference `json:"task"`
Workspace string `json:"workspace"`
Goal string `json:"goal"`
Result string `json:"result"`
ResultSource string `json:"result_source"`
Captured time.Time `json:"captured"`
Version CodeVersion `json:"version"`
Source string `json:"source"`
Status string `json:"status"`
Tests []TestEvidence `json:"tests"`
Stale bool `json:"stale"`
PRURL *string `json:"pr_url"`
Unknown []string `json:"unknown"`
DiffSHA string `json:"diff_sha"`
DiffPath string `json:"diff_path"`
OutputPath string `json:"output_path"`
ActivitySequence uint64 `json:"activity_sequence"`
Diff string `json:"-"`
}
type WorkflowRuntime ¶
type WorkflowRuntime struct {
*Manager
}
WorkflowRuntime lets linked orchestration use the live Host manager and its durable ledger while keeping the session and process internals private.
func NewWorkflowRuntime ¶
func NewWorkflowRuntime(manager *Manager) *WorkflowRuntime
func (*WorkflowRuntime) BeginMutation ¶
func (m *WorkflowRuntime) BeginMutation() (func(), bool)
BeginMutation keeps idle shutdown from interrupting a synchronous workflow mutation before its asynchronous worker has been registered.
func (*WorkflowRuntime) Context ¶
func (m *WorkflowRuntime) Context() context.Context
func (*WorkflowRuntime) Launch ¶
func (m *WorkflowRuntime) Launch(id string, run func()) bool
func (*WorkflowRuntime) MarkVerificationRemoteStale ¶
func (m *WorkflowRuntime) MarkVerificationRemoteStale(id, reason string) error
func (*WorkflowRuntime) ReadReceipt ¶
func (m *WorkflowRuntime) ReadReceipt(id string) (requestRecord, error)
func (*WorkflowRuntime) Running ¶
func (m *WorkflowRuntime) Running(id string) bool
func (*WorkflowRuntime) SaveVerification ¶
func (m *WorkflowRuntime) SaveVerification(id string, report VerificationReport) error
func (*WorkflowRuntime) SessionDir ¶
func (m *WorkflowRuntime) SessionDir() string
func (*WorkflowRuntime) Start ¶
func (m *WorkflowRuntime) Start(req StartRequest, baseCommit string) (Session, error)
func (*WorkflowRuntime) Stopped ¶
func (m *WorkflowRuntime) Stopped() bool
func (*WorkflowRuntime) WaitAgentReady ¶
func (m *WorkflowRuntime) WaitAgentReady(id string) error
type WorktreeRequest ¶
Source Files
¶
- acp_agent.go
- acp_events.go
- activity.go
- admission.go
- agent.go
- agent_adapter.go
- agent_compatibility.go
- agent_controls.go
- agent_execution_policy.go
- agent_history_acp.go
- agent_history_bounds.go
- agent_history_codex.go
- agent_history_http.go
- agent_io.go
- agent_permissions.go
- agent_requests.go
- agent_rpc.go
- cgroup_linux.go
- claude_discovery.go
- codex_agent.go
- codex_agent_unix.go
- codex_attachment_reader.go
- codex_attachment_socket.go
- codex_events.go
- codex_history_replay.go
- codex_socket_security_unix.go
- config.go
- conflicts.go
- devices.go
- discovery.go
- events.go
- execution_identity.go
- execution_identity_linux.go
- extension.go
- external_attachment.go
- external_sessions.go
- history_discovery.go
- idempotency.go
- identity_filter_linux.go
- inbox.go
- input_stream.go
- log.go
- manager.go
- mcp.go
- opencode_attachment.go
- opencode_attachment_v1.go
- output.go
- platform_unix.go
- plugins.go
- protocol.go
- protocol_process.go
- recovery.go
- request_retention.go
- resource_capabilities.go
- resource_caps_linux.go
- resources.go
- resources_unix.go
- rpc_client.go
- rpc_refused_unix.go
- rpc_stream.go
- server.go
- storage.go
- storage_sync_unix.go
- supervisor_unix.go
- tool_environment.go
- tool_environment_unix.go
- verification.go
- wait_exit_linux.go
- workflow_runtime.go
- worktree.go