Expand description
Task types and utilities translated from TypeScript Task.ts
Structs§
- Abort
Controller - Abort controller for cancelling operations
- Abort
Signal - Abort signal for cancellation
- Local
Shell Spawn Input - Input for spawning a local shell task
- Task
Context - Context passed to tasks containing abort controller and state access
- Task
Handle - Handle to a task, including its ID and optional cleanup callback
- Task
State Base - Base fields shared by all task states
Enums§
- Shell
Kind - Shell kind for UI display
- Task
Status - Status of a task
- Task
Type - Types of tasks that can be created
Constants§
- TASK_
ID_ ALPHABET - Case-insensitive-safe alphabet (digits + lowercase) for task IDs. 36^8 ≈ 2.8 trillion combinations, sufficient to resist brute-force symlink attacks.
- TASK_
ID_ PREFIXES - Task ID prefixes for backward compatibility
Traits§
Functions§
- create_
task_ state_ base - Create a base task state
- generate_
task_ id - Generate a unique task ID for a given task type
- get_
task_ id_ prefix - Get task ID prefix for a task type
- get_
task_ output_ path - Get the output file path for a task
- is_
terminal_ task_ status - True when a task is in a terminal state and will not transition further. Used to guard against injecting messages into dead teammates, evicting finished tasks from AppState, and orphan-cleanup paths.
Type Aliases§
- SetApp
State - Function type for updating application state