coding

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 67 Imported by: 0

Documentation

Overview

Package coding composes the product-level Coding Agent runtime and defines its stable event and state boundaries.

Index

Constants

View Source
const (
	ModeAgent = config.ModeAgent
	ModePlan  = config.ModePlan
)

Supported Coding Agent operating modes.

View Source
const (
	// EventSchema is the current Coding Agent event envelope schema.
	EventSchema = "pips.coding.event/v1alpha1"
)
View Source
const (
	// MaxPromptTextBytes is the largest UTF-8 text prompt accepted by Coding
	// frontends and Runtime.
	MaxPromptTextBytes = maxEventTextBytes
)

Variables

View Source
var (
	// ErrInvalidEvent means an event or payload violates the Coding event contract.
	ErrInvalidEvent = errors.New("coding event: invalid event")
	// ErrEventProtocol means an event cannot follow the preceding reducer state.
	ErrEventProtocol = errors.New("coding event: protocol violation")
	// ErrUnsafeEventEncoding prevents direct serialization that bypasses disclosure.
	ErrUnsafeEventEncoding = errors.New("coding event: disclosure projection required")
)
View Source
var (
	// ErrEventGap means a subscriber can no longer continue from its cursor.
	// Callers must obtain a fresh snapshot and subscription.
	ErrEventGap = errors.New("coding runtime: event subscription gap")
	// ErrEventStreamClosed means the Runtime no longer accepts subscriptions.
	ErrEventStreamClosed = errors.New("coding runtime: event stream closed")
)
View Source
var (
	// ErrRuntimeBusy means another Runtime operation owns the session.
	ErrRuntimeBusy = errors.New("coding runtime: busy")
	// ErrRuntimeClosed means the Runtime no longer owns its resources.
	ErrRuntimeClosed = errors.New("coding runtime: closed")
	// ErrRuntimePending means durable tool calls must be continued or resolved.
	ErrRuntimePending = errors.New("coding runtime: pending approval")
	// ErrRuntimeNotPaused means approval resolution requires a paused interaction.
	ErrRuntimeNotPaused = errors.New("coding runtime: not paused")
	// ErrRuntimeInvalid means Runtime construction input is incomplete or inconsistent.
	ErrRuntimeInvalid = errors.New("coding runtime: invalid options")
	// ErrAgentDraft means a model-generated Agent proposal or explicit local
	// promotion violated the non-executable draft contract.
	ErrAgentDraft = errors.New("coding runtime: invalid Agent draft")
	// ErrInputRequired means a non-interactive client encountered a structured
	// user question that it must not answer implicitly.
	ErrInputRequired = errors.New("coding runtime: structured user input required")
	// ErrPlanReviewRequired means a non-interactive client encountered a Plan
	// review decision that it must not answer implicitly.
	ErrPlanReviewRequired = errors.New("coding runtime: Plan review required")
	// ErrLegacyToolCallUnresolved means a resumed Session contains a pending
	// call for a removed pre-P1 Coding Tool protocol. It is never replayed or
	// guessed under the replacement name.
	ErrLegacyToolCallUnresolved = errors.New("coding runtime: legacy tool call unresolved")
	// ErrCompactionUnavailable means current configuration or history cannot
	// produce a safe compaction plan.
	ErrCompactionUnavailable = errors.New("coding runtime: compaction unavailable")
	// ErrCompactionStale means history changed after preview and confirmation
	// must be requested again.
	ErrCompactionStale = errors.New("coding runtime: compaction preview is stale")
	// ErrCompactionRetrySuppressed prevents automatic compaction thrashing on
	// an unchanged leaf after a prior model or persistence failure.
	ErrCompactionRetrySuppressed = errors.New("coding runtime: automatic compaction retry suppressed")
	// ErrHookDenied means a trusted UserPromptSubmit lifecycle hook explicitly
	// rejected a prompt before an interaction was created.
	ErrHookDenied = errors.New("coding runtime: prompt denied by hook")
	// ErrHookStopped means a lifecycle hook stopped the event-specific
	// continuation without turning it into a Runtime failure.
	ErrHookStopped = errors.New("coding runtime: lifecycle event stopped by hook")
)
View Source
var (
	// ErrTeamAdmission reports a malformed or unavailable Team admission.
	ErrTeamAdmission = errors.New("coding Team admission failed")
	// ErrTeamRepositoryRequired reports a Workspace that cannot provide the
	// committed repository root required for isolated Worker Worktrees.
	ErrTeamRepositoryRequired = errors.New("coding Team requires a repository root with HEAD")
	// ErrTeamActive reports an existing proposal or admitted Team owner.
	ErrTeamActive = errors.New("coding Team is already active")
	// ErrTeamProposalNotFound reports an unknown or already consumed proposal.
	ErrTeamProposalNotFound = errors.New("coding Team proposal not found")
	// ErrTeamProposalStale reports repository or Runtime drift after preview.
	ErrTeamProposalStale = errors.New("coding Team proposal is stale")
	// ErrTeamDirty requires an explicit HEAD-only admission choice.
	ErrTeamDirty = errors.New("coding Team workspace has uncommitted changes")
	// ErrTeamInteractionRequired prevents implicit writable non-interactive admission.
	ErrTeamInteractionRequired = errors.New("interaction_required")
)
View Source
var (
	// ErrTeamCleanupUnavailable means there is no exact active Team cleanup owner.
	ErrTeamCleanupUnavailable = errors.New("coding Team cleanup unavailable")
	// ErrTeamCleanupStale means the reviewed Team resource revision changed.
	ErrTeamCleanupStale = errors.New("coding Team cleanup review is stale")
	// ErrTeamCleanupIntegrationRequired means Integration must be applied, recovered, or rejected first.
	ErrTeamCleanupIntegrationRequired = errors.New("coding Team cleanup requires an Integration decision")
	// ErrTeamCleanupRetained means one or more exact resources were deliberately preserved.
	ErrTeamCleanupRetained = errors.New("coding Team cleanup retained resources")
)
View Source
var (
	// ErrTeamIntegrationUnavailable means there is no admitted parent Team.
	ErrTeamIntegrationUnavailable = errors.New("coding Team integration unavailable")
	// ErrTeamIntegrationSelection means selected Tasks do not have one exact captured result closure.
	ErrTeamIntegrationSelection = errors.New("coding Team integration selection is invalid")
)
View Source
var (
	// ErrTeamRecoveryNotFound means the requested Team is not a retained
	// candidate owned by the current Lead Session.
	ErrTeamRecoveryNotFound = errors.New("coding Team recovery candidate not found")
	// ErrTeamRecoveryStale means durable state changed after the candidate was
	// presented and the user must review a fresh candidate.
	ErrTeamRecoveryStale = errors.New("coding Team recovery candidate is stale")
	// ErrTeamRecoveryBlocked means exact identity or lifecycle validation does
	// not permit automatic recovery.
	ErrTeamRecoveryBlocked = errors.New("coding Team recovery is blocked")
	// ErrTeamRecoveryDecisionRequired prevents replaying interrupted Work
	// without an explicit user decision.
	ErrTeamRecoveryDecisionRequired = errors.New("coding Team recovery decision is required")
)
View Source
var (
	// ErrTeamReadUnavailable means the selected Runtime does not own the requested Team.
	ErrTeamReadUnavailable = errors.New("coding Team view unavailable")
	// ErrTeamReadStale means a caller supplied a cursor newer than durable Team state.
	ErrTeamReadStale = errors.New("coding Team view cursor is stale")
)
View Source
var ErrAttemptBaseConflict = errors.New("coding Team dependency base conflict")

ErrAttemptBaseConflict tells the trusted AttemptBasePreparer that captured dependency deltas cannot be composed without choosing a conflicting side. The owner projects it to blocked/conflicted state without opening a Worker.

View Source
var ErrInvalidPrompt = errors.New("coding prompt: invalid text")

ErrInvalidPrompt means prompt text is empty, malformed, or exceeds the bounded Runtime input contract.

View Source
var ErrTeamWorkerStale = errors.New("coding Team Worker target is stale")

ErrTeamWorkerStale means an inspection target no longer identifies the exact durable Attempt owner generation reviewed by the caller.

Functions

func MarshalEvent

func MarshalEvent(event Event) ([]byte, error)

MarshalEvent performs explicit full-content serialization for trusted local round trips. Persistence and process boundaries should marshal ExportEvent.

func PublishedReloadGeneration

func PublishedReloadGeneration(err error) (uint64, bool)

PublishedReloadGeneration reports whether err describes a reload whose candidate was already published. The returned generation ID is zero when err is nil or when the failure happened before publication.

func ValidateAgentLibrary

func ValidateAgentLibrary(library AgentLibrary) error

ValidateAgentLibrary is retained as a narrow invariant check for callers that cache Library data across UI updates.

func ValidateEvent

func ValidateEvent(event Event) error

ValidateEvent verifies the envelope, payload discriminator, and bounded content.

func ValidatePromptText

func ValidatePromptText(text string) error

ValidatePromptText validates a text-only prompt without normalizing it.

Types

type AgentDraft

type AgentDraft struct {
	Summary    AgentDraftSummary
	Origin     AgentDraftOrigin
	Definition []byte
	Preview    AgentDraftPreview
}

AgentDraft is the full local review surface. Definition is never written to a Session, Event, telemetry projection, or filesystem before promotion.

func (AgentDraft) Clone

func (d AgentDraft) Clone() AgentDraft

Clone returns a fully detached Draft.

type AgentDraftOrigin

type AgentDraftOrigin struct {
	SessionID     string      `json:"session_id"`
	InteractionID string      `json:"interaction_id"`
	RunID         string      `json:"run_id"`
	Provider      ai.Provider `json:"provider"`
	Model         string      `json:"model"`
	GenerationID  uint64      `json:"generation_id"`
}

AgentDraftOrigin is content-free provenance for one ephemeral proposal run.

type AgentDraftPreview

type AgentDraftPreview struct {
	GenerationID      uint64                         `json:"generation_id"`
	PlanDigest        string                         `json:"plan_digest"`
	Model             string                         `json:"model"`
	DeclaredTools     []string                       `json:"declared_tools"`
	Capabilities      []subagent.EffectiveCapability `json:"capabilities"`
	DeclaredSkills    []string                       `json:"declared_skills"`
	Skills            []string                       `json:"skills"`
	PreloadedSkills   []string                       `json:"preloaded_skills"`
	DelegationTargets []string                       `json:"delegation_targets"`
	PrivateMCP        []string                       `json:"private_mcp"`
	PrivateHooks      []string                       `json:"private_hooks"`
	ToolSearch        bool                           `json:"tool_search"`
	Limits            subagent.Limits                `json:"limits"`
	Output            subagent.OutputContract        `json:"output"`
}

AgentDraftPreview is the detached declared/effective authority comparison compiled from the immutable generation captured during proposal review.

func (AgentDraftPreview) Clone

Clone returns a fully detached preview.

type AgentDraftPromotion

type AgentDraftPromotion struct {
	AgentID          string          `json:"agent_id"`
	Scope            AgentDraftScope `json:"scope"`
	DefinitionDigest string          `json:"definition_digest"`
	Target           string          `json:"target"`
	GenerationID     uint64          `json:"generation_id"`
	ReloadRequired   bool            `json:"reload_required"`
}

AgentDraftPromotion is the explicit local result. Target is returned only to the user-facing caller and is not written to Runtime events or telemetry.

type AgentDraftScope

type AgentDraftScope string

AgentDraftScope selects the only two private Pips Agent roots eligible for explicit draft promotion.

const (
	// AgentDraftScopeUser targets the user-owned Pips Agent root.
	AgentDraftScopeUser AgentDraftScope = "user"
	// AgentDraftScopeProject targets the trusted Workspace's Pips Agent root.
	AgentDraftScopeProject AgentDraftScope = "project"
)

type AgentDraftSummary

type AgentDraftSummary struct {
	DraftID             string          `json:"draft_id"`
	AgentID             string          `json:"agent_id"`
	Scope               AgentDraftScope `json:"scope"`
	DefinitionDigest    string          `json:"definition_digest"`
	CreatedAt           time.Time       `json:"created_at"`
	GenerationID        uint64          `json:"generation_id"`
	EffectiveToolCount  int             `json:"effective_tool_count"`
	SelectedSkillCount  int             `json:"selected_skill_count"`
	PrivateBindingCount int             `json:"private_binding_count"`
}

AgentDraftSummary is safe for list views. It deliberately omits model output, description, selectors, definition content, paths, and opaque plan bindings.

type AgentLibrary

type AgentLibrary struct {
	Entries []AgentLibraryEntry
}

AgentLibrary is the content-safe, user-facing view of the immutable Agent registry. It deliberately excludes definition instructions and output JSON Schema: those are execution inputs, not library metadata.

func (AgentLibrary) Clone

func (l AgentLibrary) Clone() AgentLibrary

Clone returns a detached library snapshot.

type AgentLibraryDiagnostic

type AgentLibraryDiagnostic struct {
	Code    string
	Source  string
	Message string
}

AgentLibraryDiagnostic is a bounded, content-free profile diagnostic.

type AgentLibraryEntry

type AgentLibraryEntry struct {
	ID            string
	Kind          string
	Scope         string
	Source        string
	Digest        string
	Status        string
	SuppressedBy  string
	Name          string
	Description   string
	Model         string
	UserVisible   bool
	ModelVisible  bool
	Delivery      []string
	DeclaredTools []string
	RequiredTools []string
	ToolSearch    bool
	Skills        []string
	Preloaded     []string
	OutputFormat  string
	Available     bool
	Unavailable   string
	Diagnostics   []AgentLibraryDiagnostic
}

AgentLibraryEntry is a content-safe discovery and availability projection. DeclaredTools and RequiredTools are requests made by the definition; they are not an authority grant. Effective capabilities are captured in the durable child execution plan when a child is actually admitted.

type AgentRunRequest

type AgentRunRequest struct {
	AgentID string
	Task    string
}

AgentRunRequest is an explicit user-authored foreground invocation. The selected Agent ID is never inferred from a model response. Custom IDs are resolved only through the interaction-scoped visibility.user dispatcher.

type ApprovalKind

type ApprovalKind string

ApprovalKind identifies the approval overlay content.

const (
	ApprovalNone      ApprovalKind = ""
	ApprovalReview    ApprovalKind = "review"
	ApprovalUncertain ApprovalKind = "unknown"
)

Approval overlay states.

type ApprovalRequired

type ApprovalRequired struct {
	RequestID     string            `json:"request_id"`
	CallID        string            `json:"call_id"`
	Tool          string            `json:"tool"`
	Command       []string          `json:"command,omitempty"`
	CWD           string            `json:"cwd,omitempty"`
	Justification string            `json:"justification,omitempty"`
	Choices       []approval.Choice `json:"choices"`
}

ApprovalRequired describes an exact pending operation for the approval overlay.

type ApprovalResolved

type ApprovalResolved struct {
	RequestID string          `json:"request_id"`
	Choice    approval.Choice `json:"choice"`
}

ApprovalResolved carries the explicit choice durably applied to a request.

type ApprovalState

type ApprovalState struct {
	Kind        ApprovalKind      `json:"kind,omitempty"`
	RequestedAt time.Time         `json:"requested_at,omitzero"`
	Required    *ApprovalRequired `json:"required,omitempty"`
	Unknown     *ApprovalUnknown  `json:"unknown,omitempty"`
}

ApprovalState is the current approval overlay projection.

func (ApprovalState) NonInteractiveError

func (state ApprovalState) NonInteractiveError() error

NonInteractiveError projects the approval overlay into the fail-fast contract shared by non-interactive frontends.

type ApprovalUnknown

type ApprovalUnknown struct {
	RequestID   string            `json:"request_id"`
	CallID      string            `json:"call_id"`
	Tool        string            `json:"tool"`
	Fingerprint string            `json:"fingerprint"`
	Attempt     int               `json:"attempt"`
	Pending     bool              `json:"pending"`
	Reason      string            `json:"reason,omitempty"`
	Recoverable bool              `json:"recoverable"`
	Choices     []approval.Choice `json:"choices"`
}

ApprovalUnknown describes an operation whose durable result is uncertain.

type AttemptBase

type AttemptBase struct {
	OID      string
	Evidence string
	Resource teamstate.AttemptBaseResource
}

AttemptBase identifies the exact commit and bounded evidence exposed to a Worker. Base preparation is trusted control-plane work, never model input.

type AttemptBasePreparer

type AttemptBasePreparer interface {
	PrepareAttemptBase(context.Context, AttemptBaseRequest) (AttemptBase, error)
}

AttemptBasePreparer composes the immutable Git base for one Attempt.

type AttemptBaseRequest

type AttemptBaseRequest struct {
	Team      team.Team
	Task      team.Task
	AttemptID team.AttemptID
	Resources teamstate.Snapshot
}

AttemptBaseRequest is the immutable input for dependency-aware base preparation. The default implementation accepts only dependency-free tasks; the Integration phase supplies composition for captured dependency results.

type BootstrapOptions

type BootstrapOptions struct {
	SessionID           string
	Provider            ai.Provider
	ModelID             string
	ContextWindow       int
	PlanMode            planmode.State
	Path                []harness.Entry
	HasPendingToolCalls bool
	Tree                harness.TreeSnapshot
}

BootstrapOptions describe one already-open durable Harness session.

type BootstrapResult

type BootstrapResult struct {
	State    State
	Recovery InteractionRecovery
}

BootstrapResult contains restart state and the interaction journal projection.

func BootstrapState

func BootstrapState(options BootstrapOptions) (BootstrapResult, error)

BootstrapState reconstructs durable frontend state without allocating live event sequence numbers.

type CandidateIdentity

type CandidateIdentity struct {
	RunID string `json:"run_id"`
	Turn  int    `json:"turn"`
}

CandidateIdentity binds provisional deltas and their eventual commit or discard to one Agent run and turn. Text equality is never ownership.

func (CandidateIdentity) Key

func (identity CandidateIdentity) Key() string

Key returns a stable frontend-local identity string.

type ChildControlState

type ChildControlState struct {
	ChildSessionID string
	Pause          ChildPauseKind
	Approval       approval.State
	Question       *question.Request
}

ChildControlState is the bounded, targetable control projection for one running custom child. It intentionally excludes raw tool output and profile instructions; durable detail remains in the child session.

func (ChildControlState) Clone

Clone returns a detached child-control projection.

type ChildPauseKind

type ChildPauseKind string

ChildPauseKind identifies the independently resolvable input owner of a live custom child execution.

const (
	// ChildPauseNone means the child has no unresolved input boundary.
	ChildPauseNone ChildPauseKind = ""
	// ChildPauseApproval means the child is waiting for its own approval decision.
	ChildPauseApproval ChildPauseKind = "approval"
	// ChildPauseQuestion means the child is waiting for its own structured answer.
	ChildPauseQuestion ChildPauseKind = "question"
)

type CompactionCompleted

type CompactionCompleted struct {
	Mode           CompactionMode `json:"mode"`
	TokensBefore   int            `json:"tokens_before"`
	TokensAfter    int            `json:"tokens_after"`
	FirstKeptID    string         `json:"first_kept_id"`
	DurationMillis int64          `json:"duration_ms"`
}

CompactionCompleted announces one durably committed compaction.

type CompactionMode

type CompactionMode string

CompactionMode identifies why compaction runs.

const (
	CompactionManual    CompactionMode = "manual"
	CompactionAutomatic CompactionMode = "automatic"
)

Compaction modes.

type CompactionPreview

type CompactionPreview struct {
	Available          bool   `json:"available"`
	DisabledReason     string `json:"disabled_reason,omitempty"`
	Token              string `json:"token,omitempty"`
	EstimatedTokens    int    `json:"estimated_tokens"`
	ThresholdTokens    int    `json:"threshold_tokens"`
	SummarizedMessages int    `json:"summarized_messages"`
	KeptMessages       int    `json:"kept_messages"`
	FirstKeptID        string `json:"first_kept_id,omitempty"`
	SplitTurn          bool   `json:"split_turn"`
}

CompactionPreview is a content-free, point-in-time compaction plan. Token binds confirmation to the exact durable leaf and budget snapshot.

type CompactionRequest

type CompactionRequest struct {
	PreviewToken string
	Instructions string
}

CompactionRequest confirms a preview. Instructions are content-bearing and are never copied into Coding events or telemetry.

type CompactionStarted

type CompactionStarted struct {
	Mode    CompactionMode    `json:"mode"`
	Preview CompactionPreview `json:"preview"`
}

CompactionStarted announces a manual or automatic compaction before model I/O.

type CompactionState

type CompactionState struct {
	Active         bool              `json:"active"`
	Mode           CompactionMode    `json:"mode,omitempty"`
	Preview        CompactionPreview `json:"preview"`
	TokensBefore   int               `json:"tokens_before"`
	TokensAfter    int               `json:"tokens_after"`
	FirstKeptID    string            `json:"first_kept_id,omitempty"`
	DurationMillis int64             `json:"duration_ms"`
}

CompactionState is the latest reducer projection of compaction lifecycle.

type Disclosure

type Disclosure uint8

Disclosure selects the content retained at a serialization boundary.

const (
	DisclosureSafe Disclosure = iota
	DisclosureContent
)

Disclosure policies. Safe is the default for JSONL and non-interactive use.

type DurableState

type DurableState struct {
	SessionID         string           `json:"session_id"`
	SessionOpen       bool             `json:"session_open"`
	Provider          ai.Provider      `json:"provider,omitempty"`
	ModelID           string           `json:"model_id,omitempty"`
	Interaction       InteractionState `json:"interaction"`
	Transcript        ai.Messages      `json:"transcript"`
	SyntheticMessages []int            `json:"synthetic_messages,omitempty"`
	Approval          ApprovalState    `json:"approval"`
	Tree              SessionTree      `json:"tree"`
	Compaction        CompactionState  `json:"compaction"`
}

DurableState is the restart-stable subset of State.

type Event

type Event struct {
	Schema        string       `json:"schema"`
	Sequence      uint64       `json:"sequence"`
	Time          time.Time    `json:"time"`
	SessionID     string       `json:"session_id"`
	InteractionID string       `json:"interaction_id,omitempty"`
	RunID         string       `json:"run_id,omitempty"`
	Type          EventType    `json:"type"`
	Payload       EventPayload `json:"-"`
}

Event is one immutable-by-contract increment in a Runtime event stream. Serialize it only through Project or MarshalEvent.

func UnmarshalEvent

func UnmarshalEvent(data []byte) (Event, error)

UnmarshalEvent strictly decodes one complete Coding event object.

func (Event) MarshalJSON

func (Event) MarshalJSON() ([]byte, error)

MarshalJSON rejects direct Event serialization so callers cannot bypass the disclosure projection required at persistence and process boundaries.

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(data []byte) error

UnmarshalJSON performs strict event decoding.

type EventObservation

type EventObservation struct {
	State        State
	Children     map[string]State
	Cursor       uint64
	Subscription *EventSubscription
}

EventObservation atomically pairs the current Runtime State with a subscription that starts immediately after Cursor.

type EventPayload

type EventPayload interface {
	// contains filtered or unexported methods
}

EventPayload is the sealed set of Coding event payloads.

type EventRecord

type EventRecord struct {
	Cursor uint64
	Event  Event
}

EventRecord pairs a Runtime-local broadcast cursor with one Coding event. Cursor is intentionally independent from Event.Sequence so a future hub can also carry child Session events without changing the per-Session protocol.

type EventSubscription

type EventSubscription struct {
	// contains filtered or unexported fields
}

EventSubscription is one bounded, independently cancelable Runtime event consumer. A slow consumer is closed with ErrEventGap; it never applies backpressure to the Runtime or its Agent execution.

func (*EventSubscription) Close

func (s *EventSubscription) Close()

Close stops this consumer without affecting the Runtime or other consumers.

func (*EventSubscription) Err

func (s *EventSubscription) Err() error

Err reports why the subscription ended. It returns nil for an explicit Close or a normal Runtime event-stream close.

func (*EventSubscription) Events

func (s *EventSubscription) Events() <-chan EventRecord

Events returns the ordered event channel owned by the subscription.

type EventType

type EventType string

EventType discriminates Coding Agent event payloads.

const (
	EventSessionOpened            EventType = "session.opened"
	EventSessionClosed            EventType = "session.closed"
	EventSessionTreeChanged       EventType = "session.tree_changed"
	EventSessionNavigated         EventType = "session.navigated"
	EventSessionForked            EventType = "session.forked"
	EventCompactionStarted        EventType = "compaction.started"
	EventCompactionCompleted      EventType = "compaction.completed"
	EventModeChanged              EventType = "mode.changed"
	EventInteractionStarted       EventType = "interaction.started"
	EventInteractionCompleted     EventType = "interaction.completed"
	EventRunStarted               EventType = "run.started"
	EventRunCompleted             EventType = "run.completed"
	EventTurnStarted              EventType = "turn.started"
	EventTurnCompleted            EventType = "turn.completed"
	EventMessageCommitted         EventType = "message.committed"
	EventMessageDelta             EventType = "message.delta"
	EventMessageDiscarded         EventType = "message.discarded"
	EventToolStarted              EventType = "tool.started"
	EventToolUpdated              EventType = "tool.updated"
	EventToolCompleted            EventType = "tool.completed"
	EventSubagentCreated          EventType = "subagent.created"
	EventSubagentStarted          EventType = "subagent.started"
	EventSubagentProgress         EventType = "subagent.progress"
	EventSubagentCompleted        EventType = "subagent.completed"
	EventSubagentFailed           EventType = "subagent.failed"
	EventSubagentCanceled         EventType = "subagent.canceled"
	EventSubagentInterrupted      EventType = "subagent.interrupted"
	EventTeamLifecycle            EventType = "team.lifecycle"
	EventTeamControlLifecycle     EventType = "team.control"
	EventTeamIntegrationLifecycle EventType = "team.integration"
	EventApprovalRequired         EventType = "approval.required"
	EventApprovalUnknown          EventType = "approval.unknown"
	EventApprovalResolved         EventType = "approval.resolved"
	EventQuestionRequired         EventType = "question.required"
	EventQuestionResolved         EventType = "question.resolved"
	EventQuestionRejected         EventType = "question.rejected"
	EventPlanReviewRequired       EventType = "plan_review.required"
	EventPlanReviewResolved       EventType = "plan_review.resolved"
	EventPlanModeChanged          EventType = "plan_mode.changed"
	EventWorkspaceChanged         EventType = "workspace.changed"
	EventStatusChanged            EventType = "status.changed"
	EventIntegrationDiagnostic    EventType = "integration.diagnostic"
	EventError                    EventType = "error"
)

Coding Agent event types.

type ExecutionOptions

type ExecutionOptions struct {
	TempRoot    string
	GitPath     string
	Environment func(string) (string, bool)
	// HooksEnvironment is the invoking process environment snapshot supplied
	// to reviewed lifecycle hook commands. It is intentionally distinct from
	// Environment, which is a lookup used by Coding tool execution.
	HooksEnvironment []string
	SandboxProbe     func(context.Context, *execution.Executor) error
	ToolTimeout      time.Duration

	HTTPClient         *http.Client
	MCPClient          *sdk.Implementation
	MCPTerminate       time.Duration
	MCPMaxTools        int
	ResourceLimits     resource.Limits
	AgentProfileLimits agentprofile.Limits
	AgentPluginLimits  agentplugin.Limits
	MCPLimits          codingmcp.Limits
	MCPDefinitions     codingmcp.Definitions
	ToolLimits         tools.Limits
	GitLimits          git.Limits
	Subagent           subagent.ExecutionOptions
}

ExecutionOptions contain process- and resource-bound Runtime dependencies. Zero limits select the package production defaults.

type ExportEvent

type ExportEvent struct {
	// contains filtered or unexported fields
}

ExportEvent is an event that has passed an explicit disclosure projection.

func Project

func Project(event Event, disclosure Disclosure) (ExportEvent, error)

Project applies an explicit disclosure policy and returns a defensive event.

func (ExportEvent) Event

func (e ExportEvent) Event() Event

Event returns a defensive copy of the projected event.

func (ExportEvent) MarshalJSON

func (e ExportEvent) MarshalJSON() ([]byte, error)

MarshalJSON serializes the already-projected event.

func (*ExportEvent) UnmarshalJSON

func (e *ExportEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON strictly decodes an exported event.

type GenerateAgentDraftRequest

type GenerateAgentDraftRequest struct {
	AgentID string
	Intent  string
	Scope   AgentDraftScope
}

GenerateAgentDraftRequest is explicit user intent for one model proposal. Intent is sent to the configured model but is never stored in the main Session or retained in the resulting Draft.

type HookDeniedError

type HookDeniedError struct {
	Reason string
}

HookDeniedError includes the reviewed hook's bounded reason while preserving a stable sentinel for non-interactive callers.

func (*HookDeniedError) Error

func (e *HookDeniedError) Error() string

func (*HookDeniedError) Unwrap

func (e *HookDeniedError) Unwrap() error

Unwrap exposes the stable hook-denial sentinel.

type HookStoppedError

type HookStoppedError struct {
	Event  hooks.Event
	Reason string
}

HookStoppedError identifies the hook event and bounded reason that stopped a continuation such as compaction or a clean agent turn.

func (*HookStoppedError) Error

func (e *HookStoppedError) Error() string

func (*HookStoppedError) Unwrap

func (e *HookStoppedError) Unwrap() error

Unwrap exposes the stable stop sentinel.

type IntegrationDiagnostic

type IntegrationDiagnostic struct {
	Component string `json:"component"`
	Code      string `json:"code"`
	Message   string `json:"message,omitempty"`
	Disabled  bool   `json:"disabled"`
}

IntegrationDiagnostic reports an optional integration failure or suppression.

type IntegrationGeneration

type IntegrationGeneration struct {
	// contains filtered or unexported fields
}

IntegrationGeneration is one immutable, application-owned snapshot of the interaction-visible integrations. Its owner is the Runtime; interactions acquire leases and keep the complete snapshot until they settle.

The Extension Activation and MCP Connections are leases over executable state. They are released together with the generation, after all interaction leases have drained.

func (*IntegrationGeneration) ID

func (g *IntegrationGeneration) ID() uint64

ID identifies the immutable generation for diagnostics and tests.

type InteractionCompleted

type InteractionCompleted struct {
	Outcome        InteractionOutcome `json:"outcome"`
	Stop           agent.StopReason   `json:"stop,omitempty"`
	Usage          TokenUsage         `json:"usage"`
	DurationMillis int64              `json:"duration_ms"`
}

InteractionCompleted closes one user interaction.

type InteractionOutcome

type InteractionOutcome string

InteractionOutcome classifies a terminal user interaction.

const (
	InteractionSucceeded  InteractionOutcome = "succeeded"
	InteractionFailed     InteractionOutcome = "failed"
	InteractionCanceled   InteractionOutcome = "canceled"
	InteractionIncomplete InteractionOutcome = "incomplete"
)

Interaction outcomes.

type InteractionRecovery

type InteractionRecovery struct {
	PendingID      string
	InterruptedIDs []string
	LastID         string
	LastOutcome    InteractionOutcome
	LastStop       agent.StopReason
	LastUsage      TokenUsage
	LastDurationMS int64
}

InteractionRecovery is the durable interaction journal projection.

func (InteractionRecovery) Clone

func (recovery InteractionRecovery) Clone() InteractionRecovery

Clone returns a defensive recovery snapshot.

type InteractionSource

type InteractionSource string

InteractionSource identifies why an interaction was opened.

const (
	// InteractionSourceUser is the ordinary user-driven flow.
	InteractionSourceUser InteractionSource = ""
	// InteractionSourceAgentNotification is a Runtime-generated continuation
	// for one or more completed background children.
	InteractionSourceAgentNotification InteractionSource = "agent_notification"
)

type InteractionStarted

type InteractionStarted struct {
	Resumed           bool              `json:"resumed"`
	Mode              OperatingMode     `json:"mode"`
	Source            InteractionSource `json:"source,omitempty"`
	RootInteractionID string            `json:"root_interaction_id,omitempty"`
	NotificationIDs   []string          `json:"notification_ids,omitempty"`
}

InteractionStarted opens one interaction, including approval continuations and Runtime-generated Agent completion continuations.

type InteractionState

type InteractionState struct {
	ID                string             `json:"id,omitempty"`
	Active            bool               `json:"active"`
	Resumed           bool               `json:"resumed"`
	Mode              OperatingMode      `json:"mode,omitempty"`
	Source            InteractionSource  `json:"source,omitempty"`
	RootInteractionID string             `json:"root_interaction_id,omitempty"`
	Outcome           InteractionOutcome `json:"outcome,omitempty"`
	Stop              agent.StopReason   `json:"stop,omitempty"`
	Usage             TokenUsage         `json:"usage"`
}

InteractionState is the current or most recently completed user interaction.

type MessageCommitted

type MessageCommitted struct {
	Message   ai.Message `json:"message"`
	Synthetic bool       `json:"synthetic,omitempty"`
}

MessageCommitted carries one message durably appended to the Harness session.

func (*MessageCommitted) UnmarshalJSON

func (payload *MessageCommitted) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes the interface-bearing message through the canonical ai message discriminator.

type MessageDelta

type MessageDelta struct {
	Kind          ai.StreamEventType `json:"kind"`
	Provider      ai.Provider        `json:"provider,omitempty"`
	ResponseID    string             `json:"response_id,omitempty"`
	Model         string             `json:"model,omitempty"`
	Text          string             `json:"text,omitempty"`
	Signature     string             `json:"signature,omitempty"`
	ToolCallIndex int                `json:"tool_call_index,omitempty"`
	ToolCallID    string             `json:"tool_call_id,omitempty"`
	ToolCallName  string             `json:"tool_call_name,omitempty"`
	Arguments     string             `json:"arguments,omitempty"`
	FinishReason  ai.FinishReason    `json:"finish_reason,omitempty"`
	Usage         *TokenUsage        `json:"usage,omitempty"`
}

MessageDelta is one provider-neutral model streaming increment.

type MessageDiscarded

type MessageDiscarded struct {
	Turn int `json:"turn"`
}

MessageDiscarded clears one provisional streaming candidate that was rejected before it could become a committed assistant message.

type ModeChanged

type ModeChanged struct {
	Mode OperatingMode `json:"mode"`
}

ModeChanged records one process-local capability-policy transition.

type OneShotAgentRunRequest

type OneShotAgentRunRequest struct {
	AgentID    string
	Definition []byte
	Task       string
}

OneShotAgentRunRequest supplies one user-authored definition for this exact invocation. Definition is parsed with the same strict profile contract as files, but is never persisted or made discoverable to the parent model.

type OpenOptions

type OpenOptions struct {
	Workspace workspace.Workspace
	Trusted   bool
	Config    config.Config
	Paths     paths.Layout
	Session   SessionTarget

	Credentials credential.Store
	Model       ai.LanguageModel
	Resolved    modelcatalog.ResolvedModel
	Execution   ExecutionOptions
	Extensions  []extension.Extension

	// AgentObservers receive raw run, turn, and tool events. TelemetryObservers
	// receive the content-free Coding product projection.
	AgentObservers     []func(context.Context, agent.Event)
	TelemetryObservers []TelemetryObserver
}

OpenOptions explicitly bind one Runtime to one Workspace, configuration, and durable session. Model is an optional test/embedder override; production callers normally provide Credentials and let Open construct the model.

type OperatingMode

type OperatingMode = config.OperatingMode

OperatingMode selects the process-local Coding Agent capability policy. It is intentionally distinct from Phase, which describes lifecycle state.

type Phase

type Phase string

Phase is the product Runtime state exposed to frontends.

const (
	PhaseIdle    Phase = "idle"
	PhaseRunning Phase = "running"
	PhasePaused  Phase = "paused"
	PhaseClosing Phase = "closing"
	PhaseClosed  Phase = "closed"
)

Runtime phases.

type PlanDocument

type PlanDocument struct {
	Exists  bool   `json:"exists"`
	Content string `json:"content,omitempty"`
	Size    int64  `json:"size"`
}

PlanDocument is the bounded plan-file view exposed to frontends.

type PlanModeChanged

type PlanModeChanged struct {
	State planmode.State `json:"state"`
}

PlanModeChanged records one plan-mode state-machine transition.

type PlanReviewRequired

type PlanReviewRequired struct {
	Request planreview.Request `json:"request"`
}

PlanReviewRequired pauses one Plan interaction for explicit review.

type PlanReviewResolved

type PlanReviewResolved struct {
	RequestID string              `json:"request_id"`
	Kind      planreview.Kind     `json:"kind"`
	Decision  planreview.Decision `json:"decision"`
}

PlanReviewResolved records the exact content-free plan-mode decision.

type PlanReviewState

type PlanReviewState struct {
	RequestedAt time.Time           `json:"requested_at,omitzero"`
	Required    *planreview.Request `json:"required,omitempty"`
}

PlanReviewState is the current explicit plan-mode decision request.

func (PlanReviewState) NonInteractiveError

func (state PlanReviewState) NonInteractiveError() error

NonInteractiveError fails closed when explicit Plan review is pending.

type PromoteAgentDraftRequest

type PromoteAgentDraftRequest struct {
	DraftID        string
	ExpectedDigest string
	Definition     []byte
}

PromoteAgentDraftRequest identifies the exact reviewed Draft. Definition is optional edited Markdown; nil promotes the original bytes, while a non-nil value is parsed and compiled as a complete replacement before any write.

type QuestionRejected

type QuestionRejected struct {
	RequestID    string `json:"request_id"`
	SchemaDigest string `json:"schema_digest"`
}

QuestionRejected records an explicit cancellation without fabricating an answer.

type QuestionRequired

type QuestionRequired struct {
	Request  question.Request `json:"request"`
	Count    int              `json:"count"`
	Redacted bool             `json:"redacted,omitempty"`
}

QuestionRequired pauses one interaction for structured user input.

type QuestionResolved

type QuestionResolved struct {
	Resolution  question.Resolution `json:"resolution"`
	AnswerCount int                 `json:"answer_count"`
	Chat        bool                `json:"chat"`
	Redacted    bool                `json:"redacted,omitempty"`
}

QuestionResolved carries the one accepted structured or chat response.

type QuestionState

type QuestionState struct {
	RequestedAt time.Time         `json:"requested_at,omitzero"`
	Required    *question.Request `json:"required,omitempty"`
}

QuestionState is the current Runtime-owned structured input request.

func (QuestionState) NonInteractiveError

func (state QuestionState) NonInteractiveError() error

NonInteractiveError fails closed when structured input is pending.

type ReloadPublicationError

type ReloadPublicationError struct {
	GenerationID uint64
	Err          error
}

ReloadPublicationError reports cleanup diagnostics after a new integration generation was already published. Its wrapped error is not a candidate construction failure: callers must keep using the published generation while deciding how to surface or retry retirement cleanup.

func (*ReloadPublicationError) Error

func (e *ReloadPublicationError) Error() string

func (*ReloadPublicationError) Unwrap

func (e *ReloadPublicationError) Unwrap() error

type RunCompleted

type RunCompleted struct {
	Stop  agent.StopReason `json:"stop"`
	Turns int              `json:"turns"`
	Usage TokenUsage       `json:"usage"`
}

RunCompleted closes one successful Agent invocation.

type RunStarted

type RunStarted struct {
	ParentRunID string `json:"parent_run_id,omitempty"`
	Agent       string `json:"agent,omitempty"`
}

RunStarted opens one Agent invocation within an interaction.

type RunState

type RunState struct {
	ID          string           `json:"id"`
	ParentRunID string           `json:"parent_run_id,omitempty"`
	Agent       string           `json:"agent,omitempty"`
	Turn        int              `json:"turn"`
	TurnOpen    bool             `json:"turn_open"`
	Active      bool             `json:"active"`
	Stop        agent.StopReason `json:"stop,omitempty"`
	Usage       TokenUsage       `json:"usage"`
}

RunState is one Agent invocation projected for frontend rendering.

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime is the Coding Agent composition root for one Workspace and one writable Harness session.

func Open

func Open(ctx context.Context, options OpenOptions) (*Runtime, error)

Open validates and acquires every Runtime dependency. A failed open releases already-acquired resources in exact reverse order.

func (*Runtime) ApplyTeamIntegration

func (r *Runtime) ApplyTeamIntegration(
	ctx context.Context,
	approval TeamIntegrationApproval,
) (TeamIntegrationResult, error)

ApplyTeamIntegration applies an approved manifest as unstaged/untracked parent changes.

func (*Runtime) Cancel

func (r *Runtime) Cancel() error

Cancel requests cancellation of the current operation.

func (*Runtime) CancelSubagent

func (r *Runtime) CancelSubagent(ctx context.Context, childSessionID string) error

CancelSubagent requests cancellation of one owned child.

func (*Runtime) CleanupTeam

func (r *Runtime) CleanupTeam(
	ctx context.Context,
	request TeamCleanupRequest,
) (TeamCleanupResult, error)

CleanupTeam performs non-force cleanup of exact terminal Team artifacts. Captured Attempt result refs are retained intentionally.

func (*Runtime) Close

func (r *Runtime) Close(ctx context.Context) error

Close starts the Runtime's unique cleanup owner and waits for it. If the caller deadline expires, cleanup continues in the background and a later Close waits for the same result. It is safe for concurrent and repeated calls.

func (*Runtime) Compact

func (r *Runtime) Compact(
	ctx context.Context,
	request CompactionRequest,
) iter.Seq2[Event, error]

Compact confirms a manual preview and durably compacts older context.

func (*Runtime) ConfirmTeam

func (r *Runtime) ConfirmTeam(
	ctx context.Context,
	confirmation TeamConfirmation,
) (TeamReference, error)

ConfirmTeam revalidates and consumes one proposal before crossing the first durable resource boundary.

func (*Runtime) ConfirmTeamNonInteractive

func (r *Runtime) ConfirmTeamNonInteractive(
	context.Context,
	TeamConfirmation,
) (TeamReference, error)

ConfirmTeamNonInteractive always requires an explicit interactive decision.

func (*Runtime) Continue

func (r *Runtime) Continue(ctx context.Context) iter.Seq2[Event, error]

Continue reconciles a durable pending interaction after reopening a session.

func (*Runtime) DeclineTeam

func (r *Runtime) DeclineTeam(ctx context.Context, proposalID string) error

DeclineTeam consumes a proposal without creating resources.

func (*Runtime) DiscardAgentDraft

func (r *Runtime) DiscardAgentDraft(
	ctx context.Context,
	draftID string,
	expectedDigest string,
) error

DiscardAgentDraft removes one exact process-local draft. The expected digest prevents a stale review surface from discarding a replacement.

func (*Runtime) DiscoverTeamRecovery

func (r *Runtime) DiscoverTeamRecovery(ctx context.Context) ([]TeamRecoveryCandidate, error)

DiscoverTeamRecovery performs a fresh bounded, read-only reconciliation for this Lead Session. It never acquires a Team lease, repairs a continuation, opens a child Session, starts a scheduler, or invokes a model or Tool.

func (*Runtime) EnterPlanMode

func (r *Runtime) EnterPlanMode(ctx context.Context) (string, error)

EnterPlanMode executes a direct enter_plan_mode call. Intercepted calls are paused for approval; this path answers calls that need no approval.

func (*Runtime) ExitPlanMode

func (r *Runtime) ExitPlanMode(context.Context) (string, error)

ExitPlanMode executes a direct exit_plan_mode call. Gated calls are paused for the plan approval view, so this path only rejects mistaken calls.

func (*Runtime) FollowUp

func (r *Runtime) FollowUp(messages ...ai.Message) error

FollowUp queues messages after the current Agent invocation settles.

func (*Runtime) Fork

func (r *Runtime) Fork(ctx context.Context, entryID string) (string, error)

Fork creates a new durable Session from one selected node. It does not close or mutate the source; runtimecontrol owns subsequent replacement.

func (*Runtime) GenerateAgentDraft

func (r *Runtime) GenerateAgentDraft(
	ctx context.Context,
	request GenerateAgentDraftRequest,
) (AgentDraft, error)

GenerateAgentDraft runs one isolated proposal Agent and stores only a process-local, non-executable Draft after strict parsing and current- generation compilation succeed.

func (*Runtime) GenerateTeamProposal

func (r *Runtime) GenerateTeamProposal(
	ctx context.Context,
	prompt TeamProposalPrompt,
) (TeamProposal, error)

GenerateTeamProposal runs an isolated, read-only proposal Agent and only installs its validated preview after the run and repository preflight end.

func (*Runtime) InspectAgentDraft

func (r *Runtime) InspectAgentDraft(ctx context.Context, draftID string) (AgentDraft, error)

InspectAgentDraft returns one detached full definition for explicit local review. It is never used by model-facing Tool composition.

func (*Runtime) InspectSubagent

func (r *Runtime) InspectSubagent(
	ctx context.Context,
	childSessionID string,
) (subagent.Detail, error)

InspectSubagent loads one durable child owned by the current parent Session.

func (*Runtime) InspectSubagentState

func (r *Runtime) InspectSubagentState(
	ctx context.Context,
	childSessionID string,
) (State, error)

InspectSubagentState returns the ordinary Coding State used to render a child Session. Live children retain their complete event projection; terminal children reopened from disk fall back to their durable transcript.

func (*Runtime) InspectTeamWorkerState

func (r *Runtime) InspectTeamWorkerState(
	ctx context.Context,
	target TeamWorkerTarget,
) (State, error)

InspectTeamWorkerState reconstructs one terminal Worker's ordinary Coding State from its exact durable Session and releases the read handle before returning. It never opens a model, Tool runtime, or Continuation execution.

func (*Runtime) ListAgentDrafts

func (r *Runtime) ListAgentDrafts(ctx context.Context) ([]AgentDraftSummary, error)

ListAgentDrafts returns deterministic content-safe process-local summaries.

func (*Runtime) ListAgentProfiles

func (r *Runtime) ListAgentProfiles(ctx context.Context) (AgentLibrary, error)

ListAgentProfiles returns the current registry as safe Library metadata. It takes a short immutable-generation lease so a simultaneous reload cannot clear or replace the registry while this view is being derived.

func (*Runtime) ListSubagents

func (r *Runtime) ListSubagents(ctx context.Context) ([]subagent.Summary, error)

ListSubagents returns durable children owned by the current parent Session.

func (*Runtime) ListWorkspaceFiles

func (r *Runtime) ListWorkspaceFiles(ctx context.Context) (attachment.Snapshot, error)

ListWorkspaceFiles returns a bounded content-free snapshot from the active Workspace. File contents are never read during discovery.

func (*Runtime) Navigate

func (r *Runtime) Navigate(
	ctx context.Context,
	entryID string,
	summarize bool,
) iter.Seq2[Event, error]

Navigate moves the current leaf in the same Session. Iteration owns the structural lease and publishes durable tree state after a successful append.

func (*Runtime) ObserveEvents

func (r *Runtime) ObserveEvents() (EventObservation, error)

ObserveEvents atomically returns the current State and a subscription that begins after that State. It is the preferred bootstrap and resubscribe API for interactive frontends.

func (*Runtime) ObserveTeamWorker

func (r *Runtime) ObserveTeamWorker(
	ctx context.Context,
	target TeamWorkerTarget,
) (EventObservation, error)

ObserveTeamWorker atomically snapshots and subscribes to one live Worker Runtime after validating its exact durable Attempt owner generation.

func (*Runtime) PlanDocumentPath

func (r *Runtime) PlanDocumentPath() (string, error)

PlanDocumentPath returns the session plan-file path for frontend presentation. It does not create or read the file.

func (*Runtime) PlanState

func (r *Runtime) PlanState() planmode.State

PlanState reports the current plan-mode state. It implements the plan tooling Service contract.

func (*Runtime) PrepareTeamIntegration

func (r *Runtime) PrepareTeamIntegration(
	ctx context.Context,
	request TeamIntegrationRequest,
) (TeamIntegrationPreview, error)

PrepareTeamIntegration deterministically composes selected captured results.

func (*Runtime) PreviewCompaction

func (r *Runtime) PreviewCompaction(ctx context.Context) (CompactionPreview, error)

PreviewCompaction returns a point-in-time manual plan without model I/O or Session mutation.

func (*Runtime) PromoteAgentDraft

func (r *Runtime) PromoteAgentDraft(
	ctx context.Context,
	request PromoteAgentDraftRequest,
) (AgentDraftPromotion, error)

PromoteAgentDraft reparses and recompiles one exact process-local Draft, then creates its private Pips definition with exclusive no-overwrite semantics. It never mutates the currently published integration generation.

func (*Runtime) Prompt

func (r *Runtime) Prompt(ctx context.Context, messages ...ai.Message) iter.Seq2[Event, error]

Prompt starts one new interaction. Iteration owns cancellation and cleanup.

func (*Runtime) ProposeTeam

func (r *Runtime) ProposeTeam(
	ctx context.Context,
	request TeamProposalRequest,
) (TeamProposal, error)

ProposeTeam validates and previews a Team without creating any durable Team, Continuation, Session, Worktree, branch/ref, lease, or goroutine.

func (*Runtime) ReadPlanDocument

func (r *Runtime) ReadPlanDocument(ctx context.Context) (PlanDocument, error)

ReadPlanDocument returns the current session plan-file content without disclosing more than the file itself.

func (*Runtime) ReadTeam

func (r *Runtime) ReadTeam(ctx context.Context, request TeamReadRequest) (TeamView, error)

ReadTeam returns one current safe Team snapshot plus bounded changes after the supplied exclusive cursors. It never reads full Team history.

func (*Runtime) RecoverTeamIntegration

func (r *Runtime) RecoverTeamIntegration(
	ctx context.Context,
	request TeamIntegrationRecoveryRequest,
) (TeamIntegrationResult, error)

RecoverTeamIntegration explicitly completes or rolls back one journal.

func (*Runtime) RejectQuestion

func (r *Runtime) RejectQuestion(
	ctx context.Context,
	requestID string,
	schemaDigest string,
) iter.Seq2[Event, error]

RejectQuestion records an explicit cancellation and lets the Agent decide whether it can continue without the requested input.

func (*Runtime) RejectSubagentQuestion

func (r *Runtime) RejectSubagentQuestion(
	ctx context.Context,
	childSessionID string,
	requestID string,
	schemaDigest string,
) (ChildControlState, error)

RejectSubagentQuestion records an explicit cancellation on exactly one child-owned question controller.

func (*Runtime) RejectTeamIntegration

func (r *Runtime) RejectTeamIntegration(ctx context.Context, approval TeamIntegrationApproval) error

RejectTeamIntegration consumes a preview token and retains its artifacts.

func (*Runtime) RejectTeamWorkerQuestion

func (r *Runtime) RejectTeamWorkerQuestion(
	ctx context.Context,
	target TeamWorkerTarget,
	requestID string,
	schemaDigest string,
) (TeamControlReference, error)

RejectTeamWorkerQuestion records an exact user rejection for one paused Worker.

func (*Runtime) Reload

func (r *Runtime) Reload(ctx context.Context) (returnErr error)

Reload installs fresh resource, MCP, and Extension generations only at an idle safe boundary. Existing interactions retain their leased snapshot.

func (*Runtime) ReplacementPreflight

func (r *Runtime) ReplacementPreflight(ctx context.Context) error

ReplacementPreflight verifies that the Runtime can be replaced without interrupting an active interaction, approval, question, Plan review, or Team owner. It does not mutate Runtime state.

func (*Runtime) Resolve

func (r *Runtime) Resolve(
	ctx context.Context,
	resolution approval.Resolution,
) iter.Seq2[Event, error]

Resolve applies one explicit approval decision and continues only when the durable pending suffix becomes ready.

func (*Runtime) ResolvePlanReview

func (r *Runtime) ResolvePlanReview(
	ctx context.Context,
	resolution planreview.Resolution,
) iter.Seq2[Event, error]

ResolvePlanReview durably records one explicit Plan review decision and resumes the paused Plan interaction.

func (*Runtime) ResolveQuestion

func (r *Runtime) ResolveQuestion(
	ctx context.Context,
	resolution question.Resolution,
) iter.Seq2[Event, error]

ResolveQuestion durably records one exact structured response and resumes the paused interaction.

func (*Runtime) ResolveSubagentApproval

func (r *Runtime) ResolveSubagentApproval(
	ctx context.Context,
	childSessionID string,
	resolution approval.Resolution,
) (ChildControlState, error)

ResolveSubagentApproval routes a decision to exactly one child-owned approval journal/resolver. It never resolves the parent interaction.

func (*Runtime) ResolveSubagentQuestion

func (r *Runtime) ResolveSubagentQuestion(
	ctx context.Context,
	childSessionID string,
	resolution question.Resolution,
) (ChildControlState, error)

ResolveSubagentQuestion routes a structured answer to exactly one child-owned question controller and resumes only that child when ready.

func (*Runtime) ResolveTeamWorkerApproval

func (r *Runtime) ResolveTeamWorkerApproval(
	ctx context.Context,
	target TeamWorkerTarget,
	resolution approval.Resolution,
) (TeamControlReference, error)

ResolveTeamWorkerApproval records an exact user approval resolution. Lead tools cannot call this Runtime surface and therefore cannot approve a Worker.

func (*Runtime) ResolveTeamWorkerQuestion

func (r *Runtime) ResolveTeamWorkerQuestion(
	ctx context.Context,
	target TeamWorkerTarget,
	resolution question.Resolution,
) (TeamControlReference, error)

ResolveTeamWorkerQuestion records exact structured answers for one paused Worker.

func (*Runtime) ResolveWorkspaceFile

func (r *Runtime) ResolveWorkspaceFile(
	ctx context.Context,
	reference attachment.Reference,
) (attachment.Resolved, error)

ResolveWorkspaceFile reads one stable text or normalized image reference through the active Workspace tree.

func (*Runtime) ResumeTeam

func (r *Runtime) ResumeTeam(
	ctx context.Context,
	teamID team.ID,
	decision TeamResumeDecision,
) (TeamReference, error)

ResumeTeam explicitly reacquires one retained Team and starts only its exact recoverable owners. Startup discovery itself never calls this method.

func (*Runtime) ReviseTeamProposal

func (r *Runtime) ReviseTeamProposal(
	ctx context.Context,
	proposalID string,
	feedback string,
) (TeamProposal, error)

ReviseTeamProposal replaces one exact current proposal only after an isolated proposal run and a fresh preflight both succeed.

func (*Runtime) RunAgent

func (r *Runtime) RunAgent(ctx context.Context, request AgentRunRequest) (subagent.Result, error)

RunAgent starts one user-selected foreground Agent and waits for its durable terminal result. It creates an ordinary, content-free parent interaction so the child has stable ownership and its lifecycle reaches Runs, but it never asks the parent language model to choose or launch the Agent.

A custom Agent must be enabled by the Alpha gate and have visibility.user. Builtin IDs remain available through the legacy-compatible manager path. This blocking API is non-interactive: a child approval or question is durably recorded, then returns its fail-closed error rather than being auto-resolved or waiting without a resolver. Interactive callers use RunAgentEvents and the targetable SubagentControlState APIs instead.

func (*Runtime) RunAgentEvents

func (r *Runtime) RunAgentEvents(
	ctx context.Context,
	request AgentRunRequest,
) iter.Seq2[Event, error]

RunAgentEvents is the event-streaming counterpart of RunAgent. Interactive callers use it so a directly launched child appears in Runs immediately and can be independently approved or answered while the foreground call waits.

func (*Runtime) RunOneShotAgent

func (r *Runtime) RunOneShotAgent(
	ctx context.Context,
	request OneShotAgentRunRequest,
) (subagent.Result, error)

RunOneShotAgent starts one explicitly supplied, non-persistent definition. It follows the same compiler, authority intersection, child controls, and durable plan audit as a discovered profile.

func (*Runtime) SetMode

func (r *Runtime) SetMode(ctx context.Context, mode OperatingMode) error

SetMode applies one user-initiated plan-mode toggle. Entering plan mode waits for the next prompt (Pending); leaving it while a turn is in flight defers the exit until the turn completes (ExitPending).

func (*Runtime) SetSkillEnabled

func (r *Runtime) SetSkillEnabled(
	ctx context.Context,
	id SkillID,
	enabled bool,
) error

SetSkillEnabled persists one project-scoped Skill policy decision and publishes it atomically at an idle Runtime boundary.

func (*Runtime) Skills

func (r *Runtime) Skills(ctx context.Context) (_ SkillSnapshot, returnErr error)

Skills returns the current resolved Skill generation without exposing full instructions or filesystem paths. A concurrent reload wins the Runtime operation lease, so callers never observe mixed resource generations.

func (*Runtime) Snapshot

func (r *Runtime) Snapshot() State

Snapshot returns a defensive reducer state snapshot.

func (*Runtime) Steer

func (r *Runtime) Steer(messages ...ai.Message) error

Steer queues messages into the current Agent invocation.

func (*Runtime) SubagentControlState

func (r *Runtime) SubagentControlState(childSessionID string) (ChildControlState, error)

SubagentControlState returns the independently owned approval/question state for a currently live custom child. Terminal and legacy children have no in-memory control target and therefore cannot be resumed through this path.

func (*Runtime) SubmitTeamControl

func (r *Runtime) SubmitTeamControl(
	ctx context.Context,
	request TeamControlRequest,
) (TeamControlReference, error)

SubmitTeamControl durably records user intent and wakes the owning Team coordinator. Command IDs and timestamps are Runtime-owned and cannot be forged by model or extension input.

func (*Runtime) SubscribeEvents

func (r *Runtime) SubscribeEvents(afterCursor uint64) (*EventSubscription, error)

SubscribeEvents replays Runtime events after cursor when they remain in the bounded hub. Callers receiving ErrEventGap must use Runtime.ObserveEvents.

func (*Runtime) TeamIntegrationRecoveries

func (r *Runtime) TeamIntegrationRecoveries(ctx context.Context) ([]TeamIntegrationRecovery, error)

TeamIntegrationRecoveries discovers interrupted journals without mutation.

func (*Runtime) TeamRecoveryCandidates

func (r *Runtime) TeamRecoveryCandidates() ([]TeamRecoveryCandidate, error)

TeamRecoveryCandidates returns the startup discovery snapshot. Call DiscoverTeamRecovery to refresh it after external state changes.

func (*Runtime) Tree

func (r *Runtime) Tree(ctx context.Context) (SessionTree, error)

Tree returns a consistent, bounded Session tree snapshot. It is read-only and remains available while an interaction runs.

func (*Runtime) WaitSubagent

func (r *Runtime) WaitSubagent(
	ctx context.Context,
	childSessionID string,
) (subagent.Result, error)

WaitSubagent waits for one owned child to become terminal without affecting any other child or the parent interaction.

func (*Runtime) WorkspaceStatus

func (r *Runtime) WorkspaceStatus(ctx context.Context) (changes.WorktreeStatus, error)

WorkspaceStatus returns bounded current Git worktree truth. It does not use or consume the interaction-attribution baseline.

type RuntimeError

type RuntimeError struct {
	Code    string `json:"code"`
	Message string `json:"message,omitempty"`
	Fatal   bool   `json:"fatal"`
}

RuntimeError reports a stable user-visible runtime error classification.

type RuntimeStateError

type RuntimeStateError struct {
	Operation string
	Phase     Phase
	Cause     error
}

RuntimeStateError reports a stable rejected operation and the phase that rejected it. Cause supports errors.Is without exposing mutable internals.

func (*RuntimeStateError) Error

func (e *RuntimeStateError) Error() string

func (*RuntimeStateError) Unwrap

func (e *RuntimeStateError) Unwrap() error

Unwrap returns the stable state sentinel.

type SessionCloseReason

type SessionCloseReason string

SessionCloseReason classifies why a Runtime stopped owning a session.

const (
	SessionClosedNormally SessionCloseReason = "closed"
	SessionClosedFailed   SessionCloseReason = "failed"
	SessionClosedCanceled SessionCloseReason = "canceled"
)

Session close reasons.

type SessionClosed

type SessionClosed struct {
	Reason SessionCloseReason `json:"reason"`
}

SessionClosed carries the final session ownership outcome.

type SessionForked

type SessionForked struct {
	SourceSessionID string `json:"source_session_id"`
	TargetSessionID string `json:"target_session_id"`
	AtEntryID       string `json:"at_entry_id,omitempty"`
}

SessionForked records lineage after a new durable Session is created.

type SessionNavigated

type SessionNavigated struct {
	FromID      string `json:"from_id,omitempty"`
	ToID        string `json:"to_id,omitempty"`
	WithSummary bool   `json:"with_summary"`
}

SessionNavigated records one successful same-file leaf change.

type SessionNode

type SessionNode struct {
	ID           string          `json:"id"`
	ParentID     string          `json:"parent_id,omitempty"`
	Kind         SessionNodeKind `json:"kind"`
	CreatedAt    time.Time       `json:"created_at"`
	Depth        int             `json:"depth"`
	Label        string          `json:"label,omitempty"`
	Current      bool            `json:"current"`
	OnActivePath bool            `json:"on_active_path"`
	HasSummary   bool            `json:"has_summary"`
	Compacted    bool            `json:"compacted"`
}

SessionNode is one flat, bounded Session tree node.

type SessionNodeKind

type SessionNodeKind string

SessionNodeKind is the product-level kind of one durable Session tree node. It deliberately does not expose Harness types to frontends.

const (
	SessionNodeMessage       SessionNodeKind = "message"
	SessionNodeModelChange   SessionNodeKind = "model_change"
	SessionNodeCompaction    SessionNodeKind = "compaction"
	SessionNodeBranchSummary SessionNodeKind = "branch_summary"
	SessionNodeCustom        SessionNodeKind = "custom"
	SessionNodeLabel         SessionNodeKind = "label"
	SessionNodeName          SessionNodeKind = "name"
)

Session tree node kinds.

type SessionOpened

type SessionOpened struct {
	Resumed       bool          `json:"resumed"`
	Provider      ai.Provider   `json:"provider,omitempty"`
	ModelID       string        `json:"model_id,omitempty"`
	ContextWindow int           `json:"context_window"`
	Mode          OperatingMode `json:"mode"`
}

SessionOpened carries the initial durable session metadata.

type SessionTarget

type SessionTarget struct {
	ID          string
	RetainEmpty bool
}

SessionTarget selects a new session when ID is empty or a durable session to reopen when ID is set.

type SessionTree

type SessionTree struct {
	SessionID  string        `json:"session_id"`
	Name       string        `json:"name,omitempty"`
	LeafID     string        `json:"leaf_id,omitempty"`
	Nodes      []SessionNode `json:"nodes"`
	TotalNodes int           `json:"total_nodes"`
	MaxDepth   int           `json:"max_depth"`
	Truncated  bool          `json:"truncated"`
}

SessionTree is the frontend-safe, flat projection of one durable Session.

func (SessionTree) Clone

func (tree SessionTree) Clone() SessionTree

Clone returns a detached Session tree.

type SessionTreeChanged

type SessionTreeChanged struct {
	Tree          SessionTree       `json:"tree"`
	Transcript    ai.Messages       `json:"transcript"`
	ContextTokens int               `json:"context_tokens"`
	Tasks         tasklist.Snapshot `json:"tasks"`
}

SessionTreeChanged replaces the reducer's durable bounded tree projection.

type SkillDiagnostic

type SkillDiagnostic struct {
	Code     string `json:"code"`
	Resource string `json:"resource,omitempty"`
	Message  string `json:"message,omitempty"`
}

SkillDiagnostic is a safe, non-fatal discovery or compatibility decision.

type SkillID

type SkillID string

SkillID is an opaque, generation-stable identifier for a resolved Skill.

type SkillSnapshot

type SkillSnapshot struct {
	Skills      []SkillSummary    `json:"skills"`
	Diagnostics []SkillDiagnostic `json:"diagnostics,omitempty"`
}

SkillSnapshot is an immutable point-in-time projection for frontends.

func (SkillSnapshot) Clone

func (s SkillSnapshot) Clone() SkillSnapshot

Clone returns a defensive copy.

type SkillSource

type SkillSource string

SkillSource is a safe, stable source label for a discovered Skill.

const (
	SkillSourceProjectPips   SkillSource = "project_pips"
	SkillSourceProjectAgents SkillSource = "project_agents"
	SkillSourceUserPips      SkillSource = "user_pips"
	SkillSourceUserAgents    SkillSource = "user_agents"
	SkillSourceExtension     SkillSource = "extension"
	SkillSourceUnknown       SkillSource = "unknown"
)

Skill source labels exposed to product frontends.

type SkillSummary

type SkillSummary struct {
	ID             SkillID     `json:"id"`
	Name           string      `json:"name"`
	Description    string      `json:"description"`
	Source         SkillSource `json:"source"`
	Enabled        bool        `json:"enabled"`
	UserInvocable  bool        `json:"user_invocable"`
	ModelInvocable bool        `json:"model_invocable"`
	ResourceCount  int         `json:"resource_count"`
}

SkillSummary is the content-free product projection of one Skill.

type State

type State struct {
	Sequence      uint64           `json:"sequence"`
	SessionID     string           `json:"session_id,omitempty"`
	SessionOpen   bool             `json:"session_open"`
	Provider      ai.Provider      `json:"provider,omitempty"`
	ModelID       string           `json:"model_id,omitempty"`
	ContextWindow int              `json:"context_window"`
	Mode          OperatingMode    `json:"mode"`
	Phase         Phase            `json:"phase,omitempty"`
	Interaction   InteractionState `json:"interaction"`
	Transcript    ai.Messages      `json:"transcript"`
	// SyntheticMessages contains transcript indexes owned by Runtime-generated
	// protocol input. Frontends render them as neutral activity, not user chat.
	SyntheticMessages []int                           `json:"synthetic_messages,omitempty"`
	Draft             []MessageDelta                  `json:"draft"`
	DraftCandidate    CandidateIdentity               `json:"draft_candidate,omitzero"`
	MessageCandidates []CandidateIdentity             `json:"message_candidates,omitempty"`
	Runs              []RunState                      `json:"runs"`
	Tools             []ToolState                     `json:"tools"`
	Subagents         []SubagentState                 `json:"subagents"`
	Teams             []TeamLifecycleState            `json:"teams,omitempty"`
	TeamControls      []TeamControlLifecycleState     `json:"team_controls,omitempty"`
	TeamIntegrations  []TeamIntegrationLifecycleState `json:"team_integrations,omitempty"`
	Approval          ApprovalState                   `json:"approval"`
	Question          QuestionState                   `json:"question"`
	PlanReview        PlanReviewState                 `json:"plan_review"`
	PlanMode          planmode.State                  `json:"plan_mode"`
	Changes           *WorkspaceChanged               `json:"changes,omitempty"`
	Diagnostics       []IntegrationDiagnostic         `json:"diagnostics"`
	LastError         *RuntimeError                   `json:"last_error,omitempty"`
	Tree              SessionTree                     `json:"tree"`
	Compaction        CompactionState                 `json:"compaction"`
	ContextTokens     int                             `json:"context_tokens"`
	Tasks             tasklist.Snapshot               `json:"tasks"`
	// contains filtered or unexported fields
}

State is the complete reducer projection used by interactive and non-interactive frontends. Use State.Clone when retaining a snapshot.

func Reduce

func Reduce(state State, event Event) (State, error)

Reduce applies one validated event to a defensive copy of state.

func (State) Clone

func (state State) Clone() State

Clone returns a deep defensive copy of State.

func (State) Durable

func (state State) Durable() DurableState

Durable returns the state subset reconstructed from Harness persistence.

func (State) IsSessionProvisional

func (state State) IsSessionProvisional() bool

IsSessionProvisional reports whether the current Session has no accepted interaction or legacy durable conversation state yet.

type StatusChanged

type StatusChanged struct {
	Phase Phase `json:"phase"`
}

StatusChanged projects one Runtime phase transition.

type SubagentLifecycle

type SubagentLifecycle struct {
	Identity            subagent.AgentIdentity   `json:"identity,omitzero"`
	Role                subagent.Role            `json:"role"`
	State               subagent.State           `json:"state"`
	ChildSessionID      string                   `json:"child_session_id"`
	ParentInteractionID string                   `json:"parent_interaction_id,omitempty"`
	ParentRunID         string                   `json:"parent_run_id"`
	ParentToolCallID    string                   `json:"parent_tool_call_id,omitempty"`
	RootInteractionID   string                   `json:"root_interaction_id,omitempty"`
	Delivery            subagent.Delivery        `json:"delivery,omitempty"`
	ChildRunID          string                   `json:"child_run_id,omitempty"`
	Model               string                   `json:"model"`
	TaskPreview         string                   `json:"task_preview,omitempty"`
	Activity            subagent.ActivitySummary `json:"activity,omitzero"`
	Code                string                   `json:"code,omitempty"`
	Stop                agent.StopReason         `json:"stop,omitempty"`
	Turns               int                      `json:"turns"`
	ToolCalls           int                      `json:"tool_calls"`
	Usage               TokenUsage               `json:"usage"`
	DurationMillis      int64                    `json:"duration_ms"`
}

SubagentLifecycle is one content-bounded specialist lifecycle projection. Child transcript, Tool arguments, paths, and structured results are loaded from the child Session only and never copied into this payload.

type SubagentState

type SubagentState struct {
	ChildSessionID      string                   `json:"child_session_id"`
	ParentInteractionID string                   `json:"parent_interaction_id,omitempty"`
	ParentRunID         string                   `json:"parent_run_id"`
	ParentToolCallID    string                   `json:"parent_tool_call_id,omitempty"`
	RootInteractionID   string                   `json:"root_interaction_id,omitempty"`
	Delivery            subagent.Delivery        `json:"delivery,omitempty"`
	ChildRunID          string                   `json:"child_run_id,omitempty"`
	Identity            subagent.AgentIdentity   `json:"identity,omitzero"`
	Role                subagent.Role            `json:"role"`
	State               subagent.State           `json:"state"`
	TaskPreview         string                   `json:"task_preview,omitempty"`
	Activity            subagent.ActivitySummary `json:"activity,omitzero"`
	Model               string                   `json:"model"`
	Code                string                   `json:"code,omitempty"`
	Turns               int                      `json:"turns"`
	ToolCalls           int                      `json:"tool_calls"`
	Usage               TokenUsage               `json:"usage"`
	DurationMillis      int64                    `json:"duration_ms"`
}

SubagentState is the bounded recent lifecycle projection used by live frontends. Durable list/detail data is loaded from child Sessions.

type TeamActivity

type TeamActivity string

TeamActivity is a content-free summary of what an Attempt owner is doing.

const (
	TeamActivityPreparing        TeamActivity = "preparing"
	TeamActivityWorking          TeamActivity = "working"
	TeamActivityAwaitingApproval TeamActivity = "awaiting_approval"
	TeamActivityAwaitingQuestion TeamActivity = "awaiting_question"
	TeamActivityCapturing        TeamActivity = "capturing"
)

Team activity values. They deliberately carry no Tool arguments, paths, or assistant text.

type TeamAdmissionMode

type TeamAdmissionMode string

TeamAdmissionMode records which parent state the user explicitly admitted.

const (
	TeamAdmissionClean    TeamAdmissionMode = "clean"
	TeamAdmissionHEADOnly TeamAdmissionMode = "head_only"
)

type TeamAttemptRecoveryCandidate

type TeamAttemptRecoveryCandidate struct {
	TaskID            team.TaskID
	AttemptID         team.AttemptID
	MemberID          team.MemberID
	ContinuationID    continuation.ID
	SessionID         string
	ResourceState     teamstate.AttemptState
	ContinuationState continuation.Status
	ContinuationPhase continuation.Phase
	RetryWork         bool
	Diagnostic        string
}

TeamAttemptRecoveryCandidate is the bounded identity and durable state of a running Team Attempt discovered without opening its Worker Runtime.

type TeamAttemptView

type TeamAttemptView struct {
	Target         TeamWorkerTarget       `json:"target"`
	Number         int                    `json:"number"`
	StartedAt      time.Time              `json:"started_at"`
	DomainState    team.AttemptStatus     `json:"domain_state"`
	ResourceState  teamstate.AttemptState `json:"resource_state,omitempty"`
	ChildSessionID string                 `json:"child_session_id,omitempty"`
	Cleanup        teamstate.CleanupClass `json:"cleanup,omitempty"`
	LifecycleState TeamLifecycleStatus    `json:"lifecycle_state,omitempty"`
	Activity       TeamActivity           `json:"activity,omitempty"`
	Turns          int                    `json:"turns,omitempty"`
	ToolCalls      int                    `json:"tool_calls,omitempty"`
	Usage          TokenUsage             `json:"usage,omitzero"`
	DurationMillis int64                  `json:"duration_ms,omitempty"`
	Code           string                 `json:"code,omitempty"`
}

TeamAttemptView binds one logical Attempt to its safe UI routing identity.

type TeamChangeView

type TeamChangeView struct {
	Revision  team.Revision  `json:"revision"`
	At        time.Time      `json:"at"`
	Cause     team.Cause     `json:"cause"`
	MemberID  team.MemberID  `json:"member_id,omitempty"`
	TaskID    team.TaskID    `json:"task_id,omitempty"`
	AttemptID team.AttemptID `json:"attempt_id,omitempty"`
	From      team.Status    `json:"from,omitempty"`
	To        team.Status    `json:"to"`
}

TeamChangeView is a content-free Team transition after an exclusive revision.

type TeamCleanupRequest

type TeamCleanupRequest struct {
	TeamID                   team.ID
	ExpectedResourceRevision team.Revision
	CloseWithoutIntegration  bool
}

TeamCleanupRequest binds one explicit cleanup decision to current durable resources.

type TeamCleanupResult

type TeamCleanupResult struct {
	TeamID   team.ID
	State    teamstate.State
	Cleaned  int
	Retained int
}

TeamCleanupResult is a path-free cleanup projection suitable for frontends.

type TeamCleanupView

type TeamCleanupView struct {
	Class    teamstate.CleanupClass `json:"class"`
	Eligible int                    `json:"eligible"`
	Pending  int                    `json:"pending"`
	Retained int                    `json:"retained"`
	Complete int                    `json:"complete"`
}

TeamCleanupView summarizes retained resource classifications without paths or refs.

type TeamConfirmation

type TeamConfirmation struct {
	ProposalID string            `json:"proposal_id"`
	Admission  TeamAdmissionMode `json:"admission"`
}

TeamConfirmation consumes one exact proposal.

type TeamControlAction

type TeamControlAction string

TeamControlAction identifies one user-authorized Team operation.

const (
	TeamControlMessage          TeamControlAction = "message"
	TeamControlFollowUp         TeamControlAction = "follow_up"
	TeamControlInterruptAttempt TeamControlAction = "interrupt_attempt"
	TeamControlCancelTask       TeamControlAction = "cancel_task"
	TeamControlRetryTask        TeamControlAction = "retry_task"
	TeamControlCancelTeam       TeamControlAction = "cancel_team"
	TeamControlResolveApproval  TeamControlAction = "resolve_approval"
	TeamControlResolveQuestion  TeamControlAction = "resolve_question"
	TeamControlRejectQuestion   TeamControlAction = "reject_question"
)

Supported Team control actions.

type TeamControlLifecycle

type TeamControlLifecycle struct {
	TeamID          team.ID           `json:"team_id"`
	Revision        uint64            `json:"revision"`
	CommandID       team.CommandID    `json:"command_id"`
	Action          TeamControlAction `json:"action"`
	MemberID        team.MemberID     `json:"member_id,omitempty"`
	TaskID          team.TaskID       `json:"task_id,omitempty"`
	AttemptID       team.AttemptID    `json:"attempt_id,omitempty"`
	OwnerGeneration uint64            `json:"owner_generation,omitempty"`
	State           TeamControlStatus `json:"state"`
	Code            string            `json:"code,omitempty"`
}

TeamControlLifecycle is the content-free parent projection for one durable operator command. Command text, payloads, and resolved execution identities remain private to the Team control journal.

type TeamControlLifecycleState

type TeamControlLifecycleState struct {
	TeamControlLifecycle
}

TeamControlLifecycleState is the latest content-free projection for one durable operator command.

type TeamControlReference

type TeamControlReference struct {
	CommandID team.CommandID    `json:"command_id"`
	TeamID    team.ID           `json:"team_id"`
	Action    TeamControlAction `json:"action"`
	CreatedAt time.Time         `json:"created_at"`
}

TeamControlReference identifies one durable operator command.

type TeamControlRequest

type TeamControlRequest struct {
	TeamID            team.ID           `json:"team_id"`
	Action            TeamControlAction `json:"action"`
	MemberID          team.MemberID     `json:"member_id,omitempty"`
	TaskID            team.TaskID       `json:"task_id,omitempty"`
	ExpectedAttemptID team.AttemptID    `json:"expected_attempt_id,omitempty"`
	OwnerGeneration   uint64            `json:"owner_generation,omitempty"`
	Text              string            `json:"text,omitempty"`
}

TeamControlRequest supplies stable logical identity. Runtime resolves it to an exact Attempt owner only after the intent has been durably submitted.

type TeamControlStatus

type TeamControlStatus string

TeamControlStatus is the safe lifecycle of one operator command.

const (
	TeamControlPending         TeamControlStatus = "pending"
	TeamControlApplying        TeamControlStatus = "applying"
	TeamControlApplied         TeamControlStatus = "applied"
	TeamControlRejected        TeamControlStatus = "rejected"
	TeamControlStale           TeamControlStatus = "stale"
	TeamControlDeliveryUnknown TeamControlStatus = "delivery_unknown"
)

Team operator control states.

type TeamControlView

type TeamControlView struct {
	Revision        uint64            `json:"revision"`
	CommandID       team.CommandID    `json:"command_id"`
	Action          TeamControlAction `json:"action"`
	MemberID        team.MemberID     `json:"member_id,omitempty"`
	TaskID          team.TaskID       `json:"task_id,omitempty"`
	AttemptID       team.AttemptID    `json:"attempt_id,omitempty"`
	OwnerGeneration uint64            `json:"owner_generation,omitempty"`
	State           TeamControlStatus `json:"state"`
	Code            string            `json:"code,omitempty"`
	CreatedAt       time.Time         `json:"created_at"`
	UpdatedAt       time.Time         `json:"updated_at"`
}

TeamControlView omits operator text, resolution payloads and private resolved identities.

type TeamIntegrationApproval

type TeamIntegrationApproval struct {
	ID    string
	Token string
}

TeamIntegrationApproval binds Apply to the preview the user reviewed.

type TeamIntegrationLifecycle

type TeamIntegrationLifecycle struct {
	TeamID            team.ID               `json:"team_id"`
	IntegrationID     string                `json:"integration_id"`
	State             TeamIntegrationStatus `json:"state"`
	VerificationState string                `json:"verification_state,omitempty"`
	Attempts          int                   `json:"attempts,omitempty"`
	Files             int                   `json:"files,omitempty"`
	Added             int                   `json:"added,omitempty"`
	Changed           int                   `json:"changed,omitempty"`
	Deleted           int                   `json:"deleted,omitempty"`
	Binary            int                   `json:"binary,omitempty"`
	Code              string                `json:"code,omitempty"`
}

TeamIntegrationLifecycle is the content-free projection consumed by frontends and telemetry. Exact evidence remains available through the explicit preview and recovery APIs.

type TeamIntegrationLifecycleState

type TeamIntegrationLifecycleState struct {
	TeamIntegrationLifecycle
}

TeamIntegrationLifecycleState is the latest compact projection for one isolated Team result integration.

type TeamIntegrationPreview

type TeamIntegrationPreview struct {
	ID                      string
	AttemptIDs              []team.AttemptID
	ResourceRevision        team.Revision
	CommitOID               string
	TreeOID                 string
	Manifest                teamintegration.Manifest
	DiffDigest              string
	Verification            teamintegration.Verification
	ApprovalToken           string
	ApprovalTokenHash       string
	ExpiresAt               time.Time
	ProducesUnstagedChanges bool
}

TeamIntegrationPreview is UI-neutral approval evidence.

type TeamIntegrationRecovery

type TeamIntegrationRecovery = teamintegration.RecoveryCandidate

TeamIntegrationRecovery is one read-only interrupted journal projection.

type TeamIntegrationRecoveryRequest

type TeamIntegrationRecoveryRequest struct {
	ID     string
	Action teamintegration.RecoveryAction
}

TeamIntegrationRecoveryRequest selects explicit recovery convergence.

type TeamIntegrationRequest

type TeamIntegrationRequest struct {
	TaskIDs      []team.TaskID
	Verification *execution.OperationSpec
}

TeamIntegrationRequest selects current captured results. Empty TaskIDs selects every completed Task. Verification is optional and runs in the isolated Worktree.

type TeamIntegrationResult

type TeamIntegrationResult struct {
	ID             string
	State          string
	ManifestDigest string
	Files          int
}

TeamIntegrationResult reports a terminal integration transaction.

type TeamIntegrationStatus

type TeamIntegrationStatus string

TeamIntegrationStatus is the bounded frontend-visible state of one isolated Team result integration. Private paths, refs, tokens, and journal contents never enter this event protocol.

const (
	TeamIntegrationConflict           TeamIntegrationStatus = "conflict"
	TeamIntegrationReady              TeamIntegrationStatus = "ready"
	TeamIntegrationVerified           TeamIntegrationStatus = "verified"
	TeamIntegrationVerificationFailed TeamIntegrationStatus = "verification_failed"
	TeamIntegrationApprovalRequired   TeamIntegrationStatus = "approval_required"
	TeamIntegrationApplying           TeamIntegrationStatus = "applying"
	TeamIntegrationApplied            TeamIntegrationStatus = "applied"
	TeamIntegrationRejected           TeamIntegrationStatus = "rejected"
	TeamIntegrationInterrupted        TeamIntegrationStatus = "interrupted"
	TeamIntegrationRecoverable        TeamIntegrationStatus = "recoverable"
	TeamIntegrationRolledBack         TeamIntegrationStatus = "rolled_back"
)

Team result integration lifecycle states.

type TeamLifecycle

type TeamLifecycle struct {
	TeamID         team.ID             `json:"team_id"`
	MemberID       team.MemberID       `json:"member_id,omitempty"`
	TaskID         team.TaskID         `json:"task_id,omitempty"`
	AttemptID      team.AttemptID      `json:"attempt_id,omitempty"`
	ChildSessionID string              `json:"child_session_id,omitempty"`
	State          TeamLifecycleStatus `json:"state"`
	Activity       TeamActivity        `json:"activity,omitempty"`
	Turns          int                 `json:"turns,omitempty"`
	ToolCalls      int                 `json:"tool_calls,omitempty"`
	Usage          TokenUsage          `json:"usage"`
	DurationMillis int64               `json:"duration_ms,omitempty"`
	Code           string              `json:"code,omitempty"`
}

TeamLifecycle is the bounded parent projection for Team execution. Logical IDs are present for frontend routing but are excluded from Telemetry.

type TeamLifecycleState

type TeamLifecycleState struct {
	TeamLifecycle
}

TeamLifecycleState is the latest compact lifecycle projection for one Team or exact Task Attempt. Child Session transcript and Tool detail never enter this parent projection.

type TeamLifecycleStatus

type TeamLifecycleStatus string

TeamLifecycleStatus is the compact parent-visible state of one Team or one exact Task Attempt. Full Worker output remains owned by the child Session.

const (
	TeamLifecycleProposed    TeamLifecycleStatus = "proposed"
	TeamLifecycleAdmitted    TeamLifecycleStatus = "admitted"
	TeamLifecycleWaiting     TeamLifecycleStatus = "waiting"
	TeamLifecycleRunning     TeamLifecycleStatus = "running"
	TeamLifecyclePaused      TeamLifecycleStatus = "paused"
	TeamLifecycleCapturing   TeamLifecycleStatus = "capturing"
	TeamLifecycleCompleted   TeamLifecycleStatus = "completed"
	TeamLifecycleFailed      TeamLifecycleStatus = "failed"
	TeamLifecycleCancelled   TeamLifecycleStatus = "cancelled"
	TeamLifecycleInterrupted TeamLifecycleStatus = "interrupted"
	TeamLifecycleRecoverable TeamLifecycleStatus = "recoverable"
)

Team lifecycle states exposed to frontends and product telemetry.

type TeamMemberView

type TeamMemberView struct {
	ID     team.MemberID     `json:"id"`
	Name   string            `json:"name"`
	Role   string            `json:"role"`
	Status team.MemberStatus `json:"status"`
}

TeamMemberView is the local user-visible identity and state of one Team member.

type TeamProposal

type TeamProposal struct {
	ID        string              `json:"id"`
	Request   TeamProposalRequest `json:"request"`
	Dirty     bool                `json:"dirty"`
	ExpiresAt time.Time           `json:"expires_at"`
}

TeamProposal is a safe preview. The opaque ID binds repository and Runtime truth internally without disclosing local absolute paths.

func (TeamProposal) Clone

func (value TeamProposal) Clone() TeamProposal

Clone returns a fully detached Team proposal preview.

type TeamProposalPrompt

type TeamProposalPrompt struct {
	Objective string `json:"objective"`
}

TeamProposalPrompt is the user-owned objective for one constrained, model-assisted Team proposal run.

type TeamProposalRequest

type TeamProposalRequest struct {
	Objective string           `json:"objective"`
	Workers   []TeamWorkerSpec `json:"workers"`
	Tasks     []TeamTaskSpec   `json:"tasks"`
}

TeamProposalRequest contains the complete model/user-controllable Team shape. It cannot carry approval, policy, repository, or credential data.

type TeamReadRequest

type TeamReadRequest struct {
	TeamID               team.ID       `json:"team_id"`
	AfterRevision        team.Revision `json:"after_revision,omitempty"`
	AfterControlRevision uint64        `json:"after_control_revision,omitempty"`
}

TeamReadRequest selects one current Team and bounded changes after exclusive cursors. Zero cursors request a fresh snapshot without replaying historical transitions.

type TeamRecoveryCandidate

type TeamRecoveryCandidate struct {
	TeamID             team.ID
	ResourceRevision   team.Revision
	ResourceState      teamstate.State
	TeamStatus         team.Status
	Disposition        TeamRecoveryDisposition
	Attempts           []TeamAttemptRecoveryCandidate
	PendingControls    int
	InterruptedControl int
	UpdatedAt          time.Time
	Diagnostics        []TeamRecoveryDiagnostic
}

TeamRecoveryCandidate is the read-only startup projection for one retained Team owned by this Lead Session. It contains no filesystem paths or child transcript content.

type TeamRecoveryDiagnostic

type TeamRecoveryDiagnostic struct {
	Code string
}

TeamRecoveryDiagnostic is a content-free recovery classification. Code is stable for UI decisions; it deliberately carries no path or transcript.

type TeamRecoveryDisposition

type TeamRecoveryDisposition string

TeamRecoveryDisposition is the safe action available for one retained Team.

const (
	TeamRecoveryResume          TeamRecoveryDisposition = "resume"
	TeamRecoveryBlockedIdentity TeamRecoveryDisposition = "blocked_identity"
	TeamRecoveryBlockedState    TeamRecoveryDisposition = "blocked_state"
)

Team recovery dispositions. Only TeamRecoveryResume may be passed to the explicit resume path; blocked candidates require external repair or review.

type TeamReference

type TeamReference struct {
	TeamID     team.ID           `json:"team_id"`
	Admission  TeamAdmissionMode `json:"admission"`
	BaseOID    string            `json:"base_oid"`
	LeadMember team.MemberID     `json:"lead_member_id"`
}

TeamReference identifies the durable admitted Team without exposing its private control-plane paths.

type TeamResumeDecision

type TeamResumeDecision struct {
	ExpectedResourceRevision team.Revision
	RetryInterruptedWork     bool
}

TeamResumeDecision binds explicit recovery to the candidate the user reviewed. RetryInterruptedWork authorizes a new continuation Work attempt only when the previous process died during that Work stage.

type TeamTaskSpec

type TeamTaskSpec struct {
	ID             string   `json:"id"`
	Title          string   `json:"title"`
	Description    string   `json:"description,omitempty"`
	AssignedWorker string   `json:"assigned_worker"`
	Dependencies   []string `json:"dependencies,omitempty"`
}

TeamTaskSpec is one immutable task and its dependency/assignment edges.

type TeamTaskView

type TeamTaskView struct {
	ID               team.TaskID     `json:"id"`
	Title            string          `json:"title"`
	Description      string          `json:"description,omitempty"`
	DependencyIDs    []team.TaskID   `json:"dependency_ids,omitempty"`
	AssignedMemberID team.MemberID   `json:"assigned_member_id,omitempty"`
	Status           team.TaskStatus `json:"status"`
	AttemptLimit     int             `json:"attempt_limit"`
}

TeamTaskView is one bounded task definition and current coordination state.

type TeamView

type TeamView struct {
	TeamID             team.ID           `json:"team_id"`
	LeadMemberID       team.MemberID     `json:"lead_member_id"`
	Revision           team.Revision     `json:"revision"`
	ChangeCursor       team.Revision     `json:"change_cursor"`
	ChangesPending     bool              `json:"changes_pending"`
	ResourceRevision   team.Revision     `json:"resource_revision"`
	ControlRevision    uint64            `json:"control_revision"`
	ControlCursor      uint64            `json:"control_cursor"`
	ControlsPending    bool              `json:"controls_pending"`
	Status             team.Status       `json:"status"`
	ResourceState      teamstate.State   `json:"resource_state"`
	Objective          string            `json:"objective"`
	Members            []TeamMemberView  `json:"members"`
	Tasks              []TeamTaskView    `json:"tasks"`
	Attempts           []TeamAttemptView `json:"attempts"`
	Changes            []TeamChangeView  `json:"changes,omitempty"`
	Controls           []TeamControlView `json:"controls,omitempty"`
	IntegrationPending bool              `json:"integration_pending"`
	Cleanup            TeamCleanupView   `json:"cleanup"`
}

TeamView is a detached UI-neutral current Team projection.

func (TeamView) Clone

func (view TeamView) Clone() TeamView

Clone returns a fully detached Team projection.

type TeamWorkerSpec

type TeamWorkerSpec struct {
	Name string `json:"name"`
	Role string `json:"role"`
}

TeamWorkerSpec is one user-visible logical Worker. Runtime policy, model, paths, credentials, and Git refs are intentionally absent.

type TeamWorkerTarget

type TeamWorkerTarget struct {
	TeamID          team.ID        `json:"team_id"`
	MemberID        team.MemberID  `json:"member_id"`
	TaskID          team.TaskID    `json:"task_id"`
	AttemptID       team.AttemptID `json:"attempt_id"`
	OwnerGeneration uint64         `json:"owner_generation"`
}

TeamWorkerTarget binds a user response to one exact Worker owner generation.

type TelemetryEvent

type TelemetryEvent struct {
	Signal                  TelemetrySignal           `json:"signal,omitempty"`
	Type                    EventType                 `json:"type,omitempty"`
	Time                    time.Time                 `json:"time"`
	Provider                ai.Provider               `json:"provider,omitempty"`
	ModelID                 string                    `json:"model_id,omitempty"`
	Agent                   string                    `json:"agent,omitempty"`
	SubagentRole            string                    `json:"subagent_role,omitempty"`
	SubagentState           string                    `json:"subagent_state,omitempty"`
	SubagentDelivery        subagent.Delivery         `json:"subagent_delivery,omitempty"`
	SubagentDepth           int                       `json:"subagent_depth,omitempty"`
	AdmissionOutcome        subagent.AdmissionOutcome `json:"admission_outcome,omitempty"`
	AdmissionReason         subagent.AdmissionReason  `json:"admission_reason,omitempty"`
	TeamScope               string                    `json:"team_scope,omitempty"`
	TeamState               string                    `json:"team_state,omitempty"`
	TeamActivity            string                    `json:"team_activity,omitempty"`
	TeamControlAction       string                    `json:"team_control_action,omitempty"`
	TeamControlState        string                    `json:"team_control_state,omitempty"`
	IntegrationState        string                    `json:"integration_state,omitempty"`
	IntegrationVerification string                    `json:"integration_verification,omitempty"`
	Tool                    string                    `json:"tool,omitempty"`
	ToolCalls               int                       `json:"tool_calls,omitempty"`
	Stop                    agent.StopReason          `json:"stop,omitempty"`
	Phase                   Phase                     `json:"phase,omitempty"`
	Mode                    OperatingMode             `json:"mode,omitempty"`
	Outcome                 InteractionOutcome        `json:"outcome,omitempty"`
	Component               string                    `json:"component,omitempty"`
	Code                    string                    `json:"code,omitempty"`
	Turns                   int                       `json:"turns,omitempty"`
	Changes                 int                       `json:"changes,omitempty"`
	Attempts                int                       `json:"attempts,omitempty"`
	Files                   int                       `json:"files,omitempty"`
	Nodes                   int                       `json:"nodes,omitempty"`
	Questions               int                       `json:"questions,omitempty"`
	Answers                 int                       `json:"answers,omitempty"`
	Chat                    bool                      `json:"chat,omitempty"`
	PlanBytes               int64                     `json:"plan_bytes,omitempty"`
	PlanDecision            string                    `json:"plan_decision,omitempty"`
	CompactionMode          CompactionMode            `json:"compaction_mode,omitempty"`
	TokensBefore            int                       `json:"tokens_before,omitempty"`
	TokensAfter             int                       `json:"tokens_after,omitempty"`
	DurationMillis          int64                     `json:"duration_ms,omitempty"`
	Usage                   TokenUsage                `json:"usage"`
	Resumed                 bool                      `json:"resumed,omitempty"`
	Failed                  bool                      `json:"failed,omitempty"`
}

TelemetryEvent is a low-cardinality, content-free observation derived from one Coding event or an explicitly non-durable Runtime signal. It never contains session, interaction, run, request, or provider-response identifiers.

func Telemetry

func Telemetry(event Event) (TelemetryEvent, error)

Telemetry projects one validated event into content-free observability data.

type TelemetryObserver

type TelemetryObserver interface {
	Observe(context.Context, TelemetryEvent) error
}

TelemetryObserver consumes the content-free product telemetry projection. Runtime invokes observers synchronously; implementations own any buffering, export scheduling, and shutdown needed by their backend.

type TelemetryObserverFunc

type TelemetryObserverFunc func(context.Context, TelemetryEvent) error

TelemetryObserverFunc adapts a function to TelemetryObserver.

func (TelemetryObserverFunc) Observe

Observe calls the wrapped function.

type TelemetrySignal

type TelemetrySignal string

TelemetrySignal identifies a content-free observation that has no durable Coding event, such as a rejection before child Session creation.

const (
	// TelemetrySignalSubagentAdmission observes a shared-budget decision.
	TelemetrySignalSubagentAdmission TelemetrySignal = "subagent.admission"
)

type TokenUsage

type TokenUsage struct {
	InputTokens       int `json:"input_tokens"`
	OutputTokens      int `json:"output_tokens"`
	ReasoningTokens   int `json:"reasoning_tokens"`
	CachedInputTokens int `json:"cached_input_tokens"`
	CacheWriteTokens  int `json:"cache_write_tokens"`
}

TokenUsage is stable provider-neutral token accounting for Coding events.

type ToolCall

type ToolCall struct {
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	Arguments ai.JSON `json:"arguments,omitempty"`
}

ToolCall is the bounded model request projected into tool lifecycle events.

type ToolCompleted

type ToolCompleted struct {
	Turn   int            `json:"turn"`
	Call   ToolCall       `json:"call"`
	Result ai.ToolMessage `json:"result"`
}

ToolCompleted carries the final tool-result message for one call.

type ToolStarted

type ToolStarted struct {
	Turn int      `json:"turn"`
	Call ToolCall `json:"call"`
}

ToolStarted announces a tool invocation before policy gating and execution.

type ToolState

type ToolState struct {
	RunID  string         `json:"run_id"`
	Turn   int            `json:"turn"`
	Call   ToolCall       `json:"call"`
	Status ToolStatus     `json:"status"`
	Update []ai.Part      `json:"update"`
	Result ai.ToolMessage `json:"result"`
}

ToolState is one tool call and its latest bounded progress/result.

type ToolStatus

type ToolStatus string

ToolStatus is one tool call's lifecycle status.

const (
	ToolStatusRunning   ToolStatus = "running"
	ToolStatusCompleted ToolStatus = "completed"
)

Tool lifecycle states.

type ToolUpdated

type ToolUpdated struct {
	Turn   int       `json:"turn"`
	Call   ToolCall  `json:"call"`
	Update []ai.Part `json:"-"`
}

ToolUpdated carries best-effort progress for an active tool call.

func (ToolUpdated) MarshalJSON

func (payload ToolUpdated) MarshalJSON() ([]byte, error)

MarshalJSON preserves the legacy durable update envelope whose role is "tool" even though progress is not a model ToolMessage.

func (*ToolUpdated) UnmarshalJSON

func (payload *ToolUpdated) UnmarshalJSON(data []byte) error

UnmarshalJSON restores progress parts from the legacy durable tool-role envelope without admitting that envelope into the ai.Message union.

type TurnCompleted

type TurnCompleted struct {
	Turn  int        `json:"turn"`
	Usage TokenUsage `json:"usage"`
}

TurnCompleted closes one Agent model turn.

type TurnStarted

type TurnStarted struct {
	Turn int `json:"turn"`
}

TurnStarted opens one 1-based Agent model turn.

type WorkspaceChange

type WorkspaceChange struct {
	Path         string       `json:"path"`
	PreviousPath string       `json:"previous_path,omitempty"`
	Kind         changes.Kind `json:"kind"`
}

WorkspaceChange is one normalized workspace-relative path change.

type WorkspaceChanged

type WorkspaceChanged struct {
	Entries   []WorkspaceChange `json:"entries"`
	Diff      string            `json:"diff,omitempty"`
	Files     int               `json:"files,omitempty"`
	Additions int               `json:"additions,omitempty"`
	Deletions int               `json:"deletions,omitempty"`
	Truncated bool              `json:"truncated"`
}

WorkspaceChanged carries a bounded change report for the completed interaction.

Directories

Path Synopsis
Package acp exposes the Coding Runtime through Agent Client Protocol v1.
Package acp exposes the Coding Runtime through Agent Client Protocol v1.
Package agentplugin loads portable Agent Plugins 1.0.0 packages.
Package agentplugin loads portable Agent Plugins 1.0.0 packages.
Package agentprofile loads immutable, declarative Coding subagent profiles.
Package agentprofile loads immutable, declarative Coding subagent profiles.
Package approval binds durable user decisions to exact coding operations.
Package approval binds durable user decisions to exact coding operations.
Package attachment owns bounded Workspace attachment discovery and resolution.
Package attachment owns bounded Workspace attachment discovery and resolution.
Package changes defines the application boundary for read-only workspace change attribution.
Package changes defines the application boundary for read-only workspace change attribution.
git
Package git attributes workspace changes relative to an in-memory-owned baseline using fixed read-only Git commands.
Package git attributes workspace changes relative to an in-memory-owned baseline using fixed read-only Git commands.
Package cli provides the Cobra command adapter for the coding application.
Package cli provides the Cobra command adapter for the coding application.
Package clipboard isolates desktop clipboard initialization and image reads from the Coding TUI.
Package clipboard isolates desktop clipboard initialization and image reads from the Coding TUI.
Package config owns the typed, provenance-preserving configuration used by the coding application.
Package config owns the typed, provenance-preserving configuration used by the coding application.
Package credential retrieves provider credentials without putting secrets in application configuration, sessions, logs, or events.
Package credential retrieves provider credentials without putting secrets in application configuration, sessions, logs, or events.
Package execution defines validated coding operations, authorization policy, and platform command execution boundaries.
Package execution defines validated coding operations, authorization policy, and platform command execution boundaries.
gitcontrol
Package gitcontrol runs the fixed Git plumbing operations required by the Coding Team Worktree control plane.
Package gitcontrol runs the fixed Git plumbing operations required by the Coding Team Worktree control plane.
mcpstdio
Package mcpstdio constructs trusted, unsandboxed MCP stdio transports with the Coding Agent's minimal child environment and owned private directories.
Package mcpstdio constructs trusted, unsandboxed MCP stdio transports with the Coding Agent's minimal child environment and owned private directories.
sshclient
Package sshclient owns the fixed system OpenSSH process, terminal proxy, and push-only local clipboard upload lifecycle for pips ssh.
Package sshclient owns the fixed system OpenSSH process, terminal proxy, and push-only local clipboard upload lifecycle for pips ssh.
Package generation compiles resolved model defaults into a fill-only Agent request policy.
Package generation compiles resolved model defaults into a fill-only Agent request policy.
Package hooks owns the Pips-native Coding lifecycle hook configuration, trust records, and reviewed command protocol.
Package hooks owns the Pips-native Coding lifecycle hook configuration, trust records, and reviewed command protocol.
Package imagebridge transports bounded normalized images into one live remote Coding TUI without creating files or durable Runtime events.
Package imagebridge transports bounded normalized images into one live remote Coding TUI without creating files or durable Runtime events.
Package instructions discovers and composes workspace project instructions.
Package instructions discovers and composes workspace project instructions.
Package mcp loads, authorizes, and connects Coding Agent MCP integrations.
Package mcp loads, authorizes, and connects Coding Agent MCP integrations.
Package model composes a typed coding configuration and credential store into an existing provider-neutral language model.
Package model composes a typed coding configuration and credential store into an existing provider-neutral language model.
Package modelcatalog resolves immutable provider/model snapshots from the local coding configuration.
Package modelcatalog resolves immutable provider/model snapshots from the local coding configuration.
observability
otel
Package otel adapts content-free Coding events to OpenTelemetry traces and metrics.
Package otel adapts content-free Coding events to OpenTelemetry traces and metrics.
Package paths defines the user-owned filesystem layout of the coding application without creating any files or directories.
Package paths defines the user-owned filesystem layout of the coding application without creating any files or directories.
Package planmode owns the plan-mode state machine, the session-bound plan file, and the model-facing reminder text.
Package planmode owns the plan-mode state machine, the session-bound plan file, and the model-facing reminder text.
Package planreview coordinates the explicit plan-mode decisions surfaced to the user: the enter approval and the exit review.
Package planreview coordinates the explicit plan-mode decisions surfaced to the user: the enter approval and the exit review.
Package question defines provider-neutral structured user questions.
Package question defines provider-neutral structured user questions.
Package resource loads declarative Coding Agent resources from user and trusted project scopes.
Package resource loads declarative Coding Agent resources from user and trusted project scopes.
Package runtimecontrol owns replacement of one active Coding Runtime.
Package runtimecontrol owns replacement of one active Coding Runtime.
Package session adds coding-application identity and single-writer ownership to the durable Harness session repository.
Package session adds coding-application identity and single-writer ownership to the durable Harness session repository.
Package skillsettings owns trusted project-local Skill enablement policy.
Package skillsettings owns trusted project-local Skill enablement policy.
Package statusline owns the closed inventory and ordering contract for TUI status-line fields.
Package statusline owns the closed inventory and ordering contract for TUI status-line fields.
Package subagent owns durable, read-only specialist executions for the Coding application.
Package subagent owns durable, read-only specialist executions for the Coding application.
Package tasklist owns the bounded update_plan contract and its durable projection from assistant tool calls.
Package tasklist owns the bounded update_plan contract and its durable projection from assistant tool calls.
Package teamcontrol persists operator control intent for Coding Teams.
Package teamcontrol persists operator control intent for Coding Teams.
Package teamintegration composes captured Coding Team results and applies an approved typed manifest without changing parent Git metadata.
Package teamintegration composes captured Coding Team results and applies an approved typed manifest without changing parent Git metadata.
Package teamstate persists Coding Team application resource bindings.
Package teamstate persists Coding Team application resource bindings.
Package teamworktree controls Coding Team Attempt Worktrees and durable Git result refs.
Package teamworktree controls Coding Team Attempt Worktrees and durable Git result refs.
Package tools implements application-owned coding tools for one workspace.
Package tools implements application-owned coding tools for one workspace.
patch
Package patch parses and applies the bounded, model-facing patch grammar used by the coding application.
Package patch parses and applies the bounded, model-facing patch grammar used by the coding application.
Package tui presents the Coding Runtime as a terminal-first chat interface.
Package tui presents the Coding Runtime as a terminal-first chat interface.
Package workspace identifies the filesystem root owned by a coding session and persists explicit user trust outside that root.
Package workspace identifies the filesystem root owned by a coding session and persists explicit user trust outside that root.

Jump to

Keyboard shortcuts

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