Versions in this module Expand all Collapse all v0 v0.4.0 Oct 22, 2026 Changes in this version + const AbortConfirmAfter + const ActionAssignSessionID + const ActionBindAgent + const ActionBound + const ActionCandidate + const ActionRestoreBinding + const ActionSkip + const AgentAdoptedPending + const AgentHuman + const AgentIdle + const AgentNotLaunched + const AgentPaneExited + const AgentRetired + const AgentRunning + const AgentStaleBind + const AgentUnknown + const BasisEventLog + const BasisMarker + const BasisOwnerConfirmed + const BridgeCancelProtocol + const BridgeKindUnavailable + const BridgeKindUpgrade + const BridgeProgressProtocol + const BridgeProtocol + const BridgeStaleAfter + const CancelAbortPending + const CancelAbortSent + const CancelAbortUnconfirmed + const CancelAborted + const CancelBeforeAcceptance + const CancelBeforeDelivery + const CancelFinishedFirst + const CancelLegacyRequested + const CancelOutcomeUnknown + const CancelSuperseded + const CancelWithheld + const EventProgress + const LeaseHuman + const LeaseManaged + const MarkerActionCandidate + const MarkerActionPresent + const MarkerActionRestore + const MarkerActionSkip + const MarkerRepairMaxCreationGap + const MarkerSkipAdopted + const MarkerSkipBackupConflict + const MarkerSkipBackupInstanceID + const MarkerSkipClaimants + const MarkerSkipContainer + const MarkerSkipExposed + const MarkerSkipForeignID + const MarkerSkipGap + const MarkerSkipInstance + const MarkerSkipNoBackupWitness + const MarkerSkipNoEvent + const MarkerSkipNoSession + const MarkerSkipNoTimes + const MarkerSkipNotMCP + const MarkerSkipOrdering + const MarkerSkipOtherMarker + const MarkerSkipPath + const MarkerSkipProject + const MarkerSkipRetired + const MarkerSkipSharedWorktree + const MarkerSkipTmuxMismatch + const MarkerSkipTmuxMissing + const MarkerSkipWitnessError + const MaxEditsPerTask + const MaxEventsPage + const MaxEventsResponseBytes + const MaxExcerptBytes + const MaxProgressExcerptBytes + const MaxProgressToolBytes + const MaxPromptBytes + const MaxPromptPreview + const MaxQueuePending + const MaxRecent + const MaxResultChunk + const MaxSessionListBytes + const PhaseAccepted + const PhaseDelivered + const PhaseFinished + const PhaseQueued + const ReasonAdoptedMarker + const ReasonNoMarker + const SkipBothMarkers + const SkipBoundElsewhere + const SkipBoundIDMissing + const SkipContainer + const SkipDuplicateClaim + const SkipForeignMarker + const SkipInvalidSessionID + const SkipNoSession + const SkipNoTimes + const SkipPathMismatch + const SkipProjectMismatch + const SkipRetired + const SkipSessionHasID + const SkipSessionNewer + const SkipSharedWorktree + const TaskCancelled + const TaskCompleted + const TaskFailed + const TaskRunning + const TaskUnknown + const TaskWaiting + const WaitBindingStale + const WaitBridgeOnline + const WaitBusy + const WaitDelivering + const WaitHumanControl + const WaitQueued + var ErrBridgeUpgradeRequired = errors.New("bridge upgrade required") + var ErrConflict = errors.New("conflict") + var ErrEditLimit = errors.New("edit limit reached") + var ErrJournalNotInPlan = errors.New("journal entry is not a write in this run's plan") + var ErrLaunchedSinceCheck = errors.New("agent was launched since it was checked") + var ErrNotFound = errors.New("not found") + var ErrPlanStale = errors.New(...) + var ErrTmuxUnavailable = errors.New("tmux could not be queried") + func AcquireOwnedLock(path string) (func(), error) + func ApplyInstancePlan(p *InstancePlan, st InstanceStores) error + func ApplyMarkerPlan(p *MarkerPlan, st MarkerStores) error + func BridgeSource() []byte + func Denied(format string, a ...any) error + func IsPermissionDenied(err error) bool + func JournalMatchesPlan(e MarkerJournalEntry, p *MarkerPlan) bool + func Obj(props map[string]any, required ...string) map[string]any + func Redact(s string) string + func RollbackInstancePlan(p *InstancePlan, entries []JournalEntry, st InstanceStores) (reverted int, skipped []string, err error) + func RollbackMarkers(entries []MarkerJournalEntry, st MarkerStores) (reverted int, skipped []string, err error) + func ValidAgentID(id string) bool + func ValidTaskID(id string) bool + func ValidateInstanceJournal(p *InstancePlan, entries []JournalEntry) error + func WriteBridge(root string) (string, error) + type AdoptRequest struct + By string + PaneID string + PiSessionID string + Session string + type AdoptResult struct + AgentID string + Pane string + Replayed bool + Session string + type AdoptedSession struct + CreatedAt time.Time + InstanceID string + Name string + Path string + Project string + TmuxName string + type Agent struct + Adopted bool + Binding Binding + CreatedAt time.Time + CreatedBy string + DevxSession string + ID string + LastLaunchAt time.Time + LaunchCount int + LaunchNonce string + Lease Lease + PaneLaunched bool + PiSessionID string + Project string + RetiredAt *time.Time + SessionCreatedAt time.Time + SessionInstanceID string + StartIdemHash string + StartTaskID string + UpdatedAt time.Time + Worktree string + type AgentPlanItem struct + Action string + Adopted bool + AgentID string + Basis string + CurrentBindings string + Marker string + Reason string + Retired bool + Session string + SessionCreatedAt time.Time + SessionInstanceID string + SessionVsAgent string + type AgentView struct + Agent *Agent + AttachHint string + BindingOK bool + Bridge *Bridge + BridgeDead bool + BridgeOnline bool + BridgeProtocol int + BridgeUpgradeNeeded bool + CurrentTask string + Detail string + LastSeq int64 + LatestProgress *ProgressView + PaneAlive bool + PaneForeign bool + State string + Waiting int + type Binding struct + PaneID string + TmuxSession string + WindowID string + type Bridge struct + CurrentTask string + Heartbeat time.Time + HumanTyping bool + Idle bool + Instance string + Mode string + Nonce string + PID int + Pane string + PiSessionFile string + PiSessionID string + Protocol int + type BridgeUpgradeError struct + AgentID string + Kind string + Protocol int + Reason string + TaskID string + func (e *BridgeUpgradeError) Error() string + func (e *BridgeUpgradeError) Unwrap() error + type CancelRequest struct + AgentID string + ExpectedRevision *int64 + TaskID string + type Config struct + AllowedProjects []string + DevxExecutable string + LaunchPolicyErr error + PassEnv []string + PiArgs []string + PiCommand string + PiCommandArgs []string + WindowName string + type ConflictError struct + Current int64 + Expected int64 + Phase string + Reason string + State string + TaskID string + func (e *ConflictError) Error() string + func (e *ConflictError) Unwrap() error + type CreatedSession struct + CreatedAt time.Time + InstanceID string + Name string + Path string + Project string + TmuxName string + type CreationEvent struct + Seq int64 + Session string + SessionInstanceID string + type EditResult struct + ReplacementTaskID string + Replayed bool + Revision int64 + TaskID string + type Event struct + Data map[string]any + Seq int64 + Source string + TaskID string + Time time.Time + Type string + type InstancePlan struct + Agents []AgentPlanItem + Hash string + Notes []string + OwnerConfirmed []string + Sessions []SessionPlanItem + Summary map[string]int + UnknownConfirmations []string + Version int + func PlanInstances(sessions map[string]*session.Session, agents []*Agent, ...) *InstancePlan + func PlanInstancesWithHistory(sessions map[string]*session.Session, agents []*Agent, ...) *InstancePlan + func PlanInstancesWithOptions(sessions map[string]*session.Session, agents []*Agent, ...) *InstancePlan + func (p *InstancePlan) HasWork() bool + func (p *InstancePlan) VerifyHash() bool + type InstanceStores struct + Agents *Store + Journal func(JournalEntry) error + LoadSessions func() (map[string]*session.Session, error) + MutateSessions func(fn func(map[string]*session.Session) error) error + Now func() time.Time + type JournalEntry struct + Basis string + InstanceID string + Kind string + Name string + PlanHash string + Restored bool + Time time.Time + type Lease struct + By string + Generation int64 + Holder string + Reason string + Since time.Time + type MCPServer struct + Client string + Extra ToolProvider + M *Manager + Name string + Version string + func (s *MCPServer) Serve(in io.Reader, out io.Writer) error + type Manager struct + Config Config + Creator SessionCreator + Store *Store + Tmux Tmux + func NewManager(store *Store, tmux Tmux, creator SessionCreator, cfg Config) *Manager + func (m *Manager) Adopt(req AdoptRequest) (*AdoptResult, error) + func (m *Manager) AgentStatus(agentID string) (*AgentView, error) + func (m *Manager) Cancel(taskID string) (*Task, error) + func (m *Manager) CancelTask(req CancelRequest) (*Task, error) + func (m *Manager) Events(agentID string, after int64, limit int, wait time.Duration) ([]Event, int64, error) + func (m *Manager) Inspect(agentID string, lines int) (string, error) + func (m *Manager) List() ([]*AgentView, error) + func (m *Manager) PeekStatus(agentID string) (*AgentView, error) + func (m *Manager) Queue(agentID string, recent int) (*QueueView, error) + func (m *Manager) Relaunch(agentID string, force bool) error + func (m *Manager) RelaunchIfUnchanged(agentID string, expectLaunchCount int) error + func (m *Manager) Release(agentID, by string, dropQueued bool) (*Agent, error) + func (m *Manager) Result(taskID string, offset, maxBytes int) (*ResultChunk, error) + func (m *Manager) RetireForSession(agentID, session string) error + func (m *Manager) Send(req SendRequest) (*SendResult, error) + func (m *Manager) Start(req StartRequest) (*StartResult, error) + func (m *Manager) SupersedePending(req SupersedePendingRequest) (*EditResult, error) + func (m *Manager) Takeover(agentID, by string) (*Agent, error) + func (m *Manager) TaskStatus(taskID string) (*TaskView, *AgentView, error) + func (m *Manager) UpdatePending(req UpdatePendingRequest) (*EditResult, error) + type MarkerBackup struct + Path string + SHA256 string + Sessions map[string]*session.Session + type MarkerBackupRef struct + Path string + SHA256 string + type MarkerJournalEntry struct + AgentID string + Kind string + Marker session.LocalOnlyMeta + PlanHash string + Session string + SessionCreatedAt time.Time + SessionInstanceID string + SessionPath string + Time time.Time + type MarkerPlan struct + Backups []MarkerBackupRef + Hash string + Items []MarkerPlanItem + Notes []string + OwnerConfirmed []string + Summary map[string]int + UnknownConfirmations []string + Version int + func PlanMarkerRepair(sessions map[string]*session.Session, agents []*Agent, opts MarkerPlanOptions) *MarkerPlan + func (p *MarkerPlan) HasWork() bool + func (p *MarkerPlan) VerifyHash() bool + type MarkerPlanItem struct + Action string + AgentBoundID string + AgentCreatedAt time.Time + AgentID string + CreationSeq int64 + Marker *session.LocalOnlyMeta + Reason string + Session string + SessionCreatedAt time.Time + SessionInstanceID string + SessionPath string + SessionVsAgent string + TmuxTag string + Witnesses []string + type MarkerPlanOptions struct + Backups []MarkerBackup + Confirmed []string + Witnesses MarkerWitnesses + type MarkerStores struct + Agents *Store + Journal func(MarkerJournalEntry) error + MutateSessions func(fn func(map[string]*session.Session) error) error + Now func() time.Time + TmuxTag func(sessionName string) (string, bool, error) + VerifyBackup func(path string) (string, error) + type MarkerWitnesses struct + Creation func(agentID string) (CreationEvent, bool, error) + TmuxTag func(sessionName string) (value string, present bool, err error) + type PaneInfo struct + Command string + Dead bool + Exists bool + HasStartCommand bool + LinkedSessions []string + PID string + QueryFailed bool + SessionName string + StartCommand string + WindowID string + func (p PaneInfo) InSession(session string) bool + type PermissionError struct + Msg string + func (e *PermissionError) Error() string + type PlanOptions struct + Confirmed []string + Recorded RecordedBindingFunc + type Progress struct + At time.Time + Excerpt string + ExcerptTruncated bool + LastTool string + TaskID string + Turn int + type ProgressView struct + At time.Time + Excerpt string + ExcerptTruncated bool + LastTool string + Turn int + type QueueItem struct + AcceptedAs string + AcceptedAt *time.Time + AgeSeconds int64 + CancelOutcome string + CreatedAt time.Time + DeliveredAt *time.Time + Editable bool + FinishedAt *time.Time + Note string + Order int64 + Phase string + PreviewTrunc bool + PromptBytes int + PromptPreview string + Revision int64 + State string + SupersededBy string + Supersedes string + TaskID string + WaitingReason string + type QueueView struct + AgentID string + Control string + InFlight []QueueItem + LastSeq int64 + LeaseGen int64 + Pending []QueueItem + PendingTotal int + PendingTruncated bool + Recent []QueueItem + State string + type RecordedBindingFunc func(agentID string) (string, time.Time, error) + type ResultChunk struct + Available bool + EOF bool + NextOffset int + Offset int + State string + TaskID string + Text string + TotalBytes int + type SendRequest struct + AgentID string + IdempotencyKey string + Prompt string + type SendResult struct + Replayed bool + TaskID string + type SessionAdopter interface + Adopt func(name, agentID string) (AdoptedSession, error) + ReleaseAdoption func(name, agentID string) error + VerifyAdopted func(name string, a *Agent) (AdoptedSession, error) + type SessionCreator interface + Create func(name, project, agentID string) (CreatedSession, error) + EnsureTmux func(name string, a *Agent) error + Exists func(name string) (bool, error) + type SessionPlanItem struct + Action string + CreatedAt time.Time + Existing bool + InstanceID string + Path string + Reason string + Session string + type StartRequest struct + By string + IdempotencyKey string + Project string + Prompt string + SessionName string + type StartResult struct + AgentID string + PiSessionID string + Replayed bool + Session string + TaskID string + type Store struct + Root string + func NewStore(root string) *Store + func (s *Store) AgentDir(id string) string + func (s *Store) AppendEvent(agentID string, ev Event) (Event, error) + func (s *Store) CreationEventOf(agentID string) (CreationEvent, bool, error) + func (s *Store) FindTask(taskID string) (*Task, error) + func (s *Store) ListAgents() ([]*Agent, error) + func (s *Store) ListAgentsLenient() ([]*Agent, map[string]error, error) + func (s *Store) ListTasks(agentID string) ([]*Task, error) + func (s *Store) LoadAgent(id string) (*Agent, error) + func (s *Store) LoadBridge(agentID string) (*Bridge, error) + func (s *Store) LoadTask(agentID, taskID string) (*Task, error) + func (s *Store) ReadEvents(agentID string, after int64, limit int) ([]Event, int64, error) + func (s *Store) ReadProgress(agentID, taskID string) *ProgressView + func (s *Store) ReadResult(agentID, taskID string) (string, bool, error) + func (s *Store) RecordedBinding(agentID string) (string, time.Time, error) + func (s *Store) SaveAgent(a *Agent) error + func (s *Store) SaveTask(t *Task) error + func (s *Store) WithAgentLock(id string, fn func() error) error + type SupersedePendingRequest struct + AgentID string + ExpectedRevision int64 + IdempotencyKey string + Prompt string + TaskID string + type Task struct + AbortSentAt *time.Time + AbortWithheld string + AcceptedAs string + AgentID string + BridgeInstance string + CancelLeaseGeneration int64 + CancelProtocol int + CancelRequested bool + CancelRequestedAt *time.Time + ConfirmedAt *time.Time + CreatedAt time.Time + DeliveredAt *time.Time + EditKeys []string + Error string + FinishedAt *time.Time + HumanIntervened bool + ID string + IdempotencyHash string + LeaseGeneration int64 + Note string + Order int64 + Prompt string + ResultBytes int64 + Revision int64 + State string + StopReason string + SupersededBy string + Supersedes string + UpdatedAt time.Time + func (t *Task) CancelOutcome(now time.Time) string + func (t *Task) Phase() string + func (t *Task) Terminal() bool + type TaskView struct + AbortSentAt *time.Time + AbortWithheld string + AcceptedAs string + AcceptedAt *time.Time + AgentID string + CancelOutcome string + CancelRequested bool + CreatedAt time.Time + DeliveredAt *time.Time + Error string + Excerpt string + ExcerptTrunc bool + FinishedAt *time.Time + HumanIntervened bool + LatestProgress *ProgressView + Note string + Phase string + ResultBytes int + Revision int64 + State string + StopReason string + SupersededBy string + Supersedes string + TaskID string + WaitingReason string + type Tmux struct + Exec func(args ...string) (string, error) + func (t Tmux) Capture(paneID string, lines int) (string, error) + func (t Tmux) HasSession(name string) bool + func (t Tmux) NewWindow(session, name, dir, command string) (windowID, paneID string, err error) + func (t Tmux) Pane(paneID string) PaneInfo + func (t Tmux) RespawnPane(paneID, dir, command string) error + func (t Tmux) Run(a ...string) (string, error) + type Tool = tool + type ToolProvider interface + CallTool func(name string, args json.RawMessage) (result map[string]any, handled bool) + Instructions func() string + TaskArtifacts func(agent *Agent, task *TaskView) []map[string]any + Tools func() []Tool + type UpdatePendingRequest struct + AgentID string + ExpectedRevision int64 + IdempotencyKey string + Prompt string + TaskID string