Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Structured task ownership for attached agent work.

This module deliberately knows nothing about prompts, models, ACP, or transports. It owns only the facts required to make a child lifecycle finite and observable: an owner, a cancellation signal, a terminal result, and a supervisor that remains responsive while work runs.

Structs§

Cancellation
A cancellation observation passed to task work.
Supervisor
The lifecycle supervisor. It is an actor-style command loop: state changes are synchronous inside the loop, while task work runs outside it. This is what keeps cancellation, completion, and control messages moving while a caller waits for a child.
TaskContext
Context given to one task’s work function.
TaskHandle
A capability for observing and cancelling one task. Cloning a handle does not clone or rerun the work; all handles observe the same terminal record.
TaskId
An identifier unique within one Supervisor.

Enums§

LifecycleError
Errors returned while creating or controlling a task.
TaskState
The only states a task can expose. Running is non-terminal; every other state is terminal and is published at most once.
WaitError
Errors returned by a bounded wait. A timed-out wait is safe to retry: the task’s terminal state remains in the supervisor and is never consumed.