Expand description
Task framework utilities. Contains task management, polling, and notification logic.
Structs§
- Task
Attachment - Attachment type for task status updates
- Task
Output - Task output structure
- Task
State Base - Base task state
Enums§
- Task
Status - Task status
- Task
Type - Task types
Constants§
- MAX_
TASK_ OUTPUT_ BYTES - Maximum task output size in bytes
- MAX_
TASK_ OUTPUT_ BYTES_ DISPLAY - Maximum task output size for display
- OUTPUT_
FILE_ TAG - PANEL_
GRACE_ MS - Grace period for terminal local_agent tasks in the coordinator panel
- POLL_
INTERVAL_ MS - Standard polling interval for all tasks
- STATUS_
TAG - STOPPED_
DISPLAY_ MS - Duration to display killed tasks before eviction
- SUMMARY_
TAG - TASK_
ID_ TAG - TASK_
NOTIFICATION_ TAG - TASK_
TYPE_ TAG - TOOL_
USE_ ID_ TAG
Traits§
- Task
State Trait - Task state trait for type-safe updates
Functions§
- append_
task_ output - Append to task output
- apply_
task_ offsets_ and_ evictions - Apply the outputOffset patches and evictions from generate_task_attachments. Merges patches against fresh state.
- cleanup_
task_ output - Cleanup task output
- evict_
task_ output - Evict task output (remove old outputs)
- evict_
terminal_ task - Eagerly evict a terminal task from AppState. The task must be in a terminal state (completed/failed/killed) with notified=true.
- flush_
task_ output - Flush task output (ensure written to disk)
- format_
task_ notification - Helper to format task notification XML
- generate_
task_ attachments - Generate attachments for tasks with new output or status changes. Called by the framework to create push notifications.
- get_
running_ tasks - Get all running tasks.
- get_
task_ output - Get task output
- get_
task_ output_ delta - Get task output delta (for streaming)
- get_
task_ output_ path - Get task output path
- get_
task_ output_ size - Get task output size
- init_
task_ output - Initialize task output
- init_
task_ output_ as_ symlink - Initialize task output as symlink
- is_
terminal_ task_ status - True when a task is in a terminal state and will not transition further.
- poll_
tasks - Poll all running tasks and check for updates. This is the main polling loop called by the framework.
- register_
task - Register a new task in AppState.
- update_
task_ state - Update a task’s state in AppState. Helper function for task implementations. Generic to allow type-safe updates for specific task types.
Type Aliases§
- AppState
- Type alias for app state
- SetApp
State - Type alias for set app state function