Versions in this module Expand all Collapse all v0 v0.1.9 Oct 19, 2026 Changes in this version + const AutoKillThreshold + const BatchLimit + const BufferLimit + const KillTaskToolName + const LineLimit + const PollInterval + const RateLimitCapacity + const RateLimitRefill + const ReadLimit + const StatusCancelled + const StatusCompleted + const StatusFailed + const StatusInitializing + const StatusNotFound + const StatusRunning + const StatusTimedOut + const TaskOutputToolName + var ErrClosed = errors.New("coding background: registry closed") + var ErrInvalid = errors.New("coding background: invalid registry request") + func BoundTaskOutputText(text string) (string, bool, int64) + func MonitorBatchText(events []Event, toolHint string) string + func MonitorCompletionText(completion Completion) string + func MonitorRunningWarning(running []Snapshot, now time.Time, killToolName string) string + func RenderMultiTaskOutputBody(mode string, records []TaskOutput, summary string) string + func RenderTaskOutputBody(record TaskOutput) string + func ShellCompletionText(completion Completion) string + func TotalTruncationHint(total int64) string + type Completion struct + KillResultDelivered bool + Killed bool + Snapshot Snapshot + Source KillSource + type Event struct + Description string + TaskID string + Text string + Wrapped string + type KillSource uint8 + const KillModel + const KillPromptEnd + const KillUser + type Kind string + const KindMonitor + const KindShell + type LineProcessor struct + func (p *LineProcessor) Flush() (string, bool) + func (p *LineProcessor) Push(chunk []byte) []string + type Observer interface + BackgroundCompleted func(Completion) + BackgroundEvent func(Event) + BackgroundStarted func(Snapshot) + type Options struct + KillToolName string + Now func() time.Time + Observer Observer + OutputBytes int64 + OutputDir string + ShellOutputBytes int64 + TailBytes int64 + type Outcome string + const OutcomeAlreadyExited + const OutcomeKilled + const OutcomeNotFound + type Registry struct + func NewRegistry(options Options) (*Registry, error) + func (r *Registry) CancelOwned(owner string, source KillSource) int + func (r *Registry) Kill(id string, source KillSource) Outcome + func (r *Registry) Launch(parent context.Context, request Request) (Snapshot, error) + func (r *Registry) List() []Snapshot + func (r *Registry) OutputPath(id string) (string, bool) + func (r *Registry) Reap(ctx context.Context) error + func (r *Registry) Result(id string) (execution.Result, bool, error) + func (r *Registry) ResultTaken(id string) bool + func (r *Registry) Snapshot(id string) (Snapshot, bool) + func (r *Registry) Tail(id string, limit int64) (string, bool) + func (r *Registry) TaskOutput(id string) TaskOutput + func (r *Registry) TaskOutputs(ids []string) []TaskOutput + func (r *Registry) Wait(ctx context.Context, ids []string, waitAny bool, budget time.Duration) ([]TaskOutput, WaitOutcome) + type Request struct + CWD string + Command string + Description string + Kind Kind + NoDeadline bool + Owner string + Start Start + Timeout time.Duration + type Snapshot struct + CWD string + Command string + Completed bool + Description string + End time.Time + ExitCode int + ID string + Killed bool + Kind Kind + Owner string + Signal string + Start time.Time + TimedOut bool + type Start func(ctx context.Context, sink execution.Sink) (execution.Result, error) + type Subject string + const SubjectSubagent + const SubjectTask + type TaskOutput struct + Command string + DurationSecs float64 + Ended time.Time + ExitCode *int + Found bool + Output string + OutputFile string + RawOutputBytes int64 + Started time.Time + Status string + Subject Subject + TaskID string + Truncated bool + TruncationHint string + func ApplyWaitHint(record TaskOutput, hint WaitHint, requested, waited time.Duration) TaskOutput + func NotFoundTaskOutput(id string) TaskOutput + func (r TaskOutput) Live() bool + type WaitHint uint8 + const WaitHintElapsed + const WaitHintPoll + const WaitHintReturnedEarly + type WaitOutcome string + const WaitOutcomeCanceled + const WaitOutcomeCompleted + const WaitOutcomeDeadline