Versions in this module Expand all Collapse all v0 v0.0.7 Jun 4, 2026 v0.0.6 Jun 3, 2026 v0.0.5 May 29, 2026 v0.0.4 May 27, 2026 v0.0.3 May 27, 2026 v0.0.2 May 27, 2026 v0.0.1 May 26, 2026retracted Changes in this version + var ErrOwnershipValidationFailed = errors.New("toolruntime: process ownership validation failed") + var ErrProcessNotFound = errors.New("toolruntime: process not found") + type BootReconcileReport struct + Checked int + Recovered int + Stale int + type Handle struct + func (h *Handle) Checkpoint(ctx context.Context, checkpoint ProcessCheckpoint) error + func (h *Handle) Complete(ctx context.Context, completion ProcessCompletion) error + func (h *Handle) ID() string + type InterruptFunc func(context.Context, ProcessRecord) error + type InterruptReport struct + Matched int + Signaled int + Stale int + Unavailable int + type InterruptScope struct + ExtensionName string + HookName string + ProcessID string + Reason string + SessionID string + Source ProcessSource + TerminalID string + ToolCallID string + TurnID string + func (s InterruptScope) IsZero() bool + func (s InterruptScope) Normalize() InterruptScope + type Interrupter interface + InterruptProcess func(ctx context.Context, record ProcessRecord) error + type MemoryStore struct + func NewMemoryStore() *MemoryStore + func (s *MemoryStore) ListProcessRecords(_ context.Context, query ProcessQuery) ([]ProcessRecord, error) + func (s *MemoryStore) UpdateProcessRecordState(_ context.Context, update ProcessStateUpdate) error + func (s *MemoryStore) UpsertProcessRecord(_ context.Context, record ProcessRecord) error + type Option func(*Registry) + func WithDaemonPID(pid int) Option + func WithInterrupter(interrupter Interrupter) Option + func WithLogger(logger *slog.Logger) Option + func WithNow(now func() time.Time) Option + func WithVerifier(verifier Verifier) Option + type ProcessCheckpoint struct + Error string + Owner *ProcessOwner + PID *int + ProcessGroupID *int + StartedAt *time.Time + State ProcessState + UpdatedAt time.Time + type ProcessCompletion struct + Err error + Error string + ExitCode *int + type ProcessOwner struct + ExtensionName string + HookName string + SandboxID string + SessionID string + TerminalID string + ToolCallID string + TurnID string + type ProcessQuery struct + IDs []string + Limit int + Scope InterruptScope + States []ProcessState + type ProcessRecord struct + Args []string + Command string + CompletedAt *time.Time + CreatedAt time.Time + Cwd string + Error string + ExitCode *int + ID string + Owner ProcessOwner + PID int + ProcessGroupID int + Source ProcessSource + StartedAt time.Time + StartedByPID int + State ProcessState + UpdatedAt time.Time + type ProcessSource string + const ProcessSourceACPAgent + const ProcessSourceACPTerminal + const ProcessSourceExtension + const ProcessSourceHook + const ProcessSourceSandboxTerminal + const ProcessSourceSubprocess + func (s ProcessSource) Validate() error + type ProcessState string + const ProcessStateCompleted + const ProcessStateFailed + const ProcessStateInterrupted + const ProcessStateInterrupting + const ProcessStateRunning + const ProcessStateStale + func (s ProcessState) Validate() error + type ProcessStateUpdate struct + CompletedAt *time.Time + Error string + ExitCode *int + ID string + State ProcessState + UpdatedAt time.Time + type RegisterConfig struct + Args []string + Command string + Cwd string + ID string + Interrupt InterruptFunc + Owner ProcessOwner + PID int + ProcessGroupID int + Source ProcessSource + StartedAt time.Time + type Registry struct + func NewRegistry(store Store, opts ...Option) *Registry + func (r *Registry) Interrupt(ctx context.Context, scope InterruptScope) (InterruptReport, error) + func (r *Registry) ReconcileBoot(ctx context.Context) (BootReconcileReport, error) + func (r *Registry) Register(ctx context.Context, cfg RegisterConfig) (*Handle, error) + type Store interface + ListProcessRecords func(ctx context.Context, query ProcessQuery) ([]ProcessRecord, error) + UpdateProcessRecordState func(ctx context.Context, update ProcessStateUpdate) error + UpsertProcessRecord func(ctx context.Context, record ProcessRecord) error + type Verifier func(pid int, startedAt time.Time) bool