Skip to main content

Module task

Module task 

Source
Expand description

Task types and utilities translated from TypeScript Task.ts

Structs§

AbortController
Abort controller for cancelling operations
AbortSignal
Abort signal for cancellation
LocalShellSpawnInput
Input for spawning a local shell task
TaskContext
Context passed to tasks containing abort controller and state access
TaskHandle
Handle to a task, including its ID and optional cleanup callback
TaskStateBase
Base fields shared by all task states

Enums§

ShellKind
Shell kind for UI display
TaskStatus
Status of a task
TaskType
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§

AppState
Trait for application state
Task
Task trait for kill operations

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§

SetAppState
Function type for updating application state