task
Module: vibex/task
Task - Individual work item within a Mission’s Plan
A Task is a discrete, actionable unit of work. Tasks have their own lifecycle and can be assigned to specific agents.
Hierarchy: Space (persistent container) └── Mission (user’s intent) └── Plan (strategy) └── Task[] (individual work items) ‹— This file
Note: This is different from AI SDK’s “steps” which refers to multi-turn tool execution loops. Our Task is a higher-level work item.
Classes
Task
View sourceProperties:
| Name | Type | Description |
|---|---|---|
id | string | |
title | string | |
description | string | |
status | TaskStatus | |
assignedTo | string | |
priority | "low" | "medium" | "high" | |
estimatedTime | string | |
actualTime | string | |
dependencies | TaskDependency[] | |
tags | string[] | |
metadata | Record<string, unknown> | |
result | unknown | |
error | string | |
createdAt | Date | |
updatedAt | Date | |
startedAt | Date | |
completedAt | Date |
Methods:
start
View sourceStart the task
function start(): voidcomplete
View sourceComplete the task with optional result
function complete(result?: unknown): voidParameters:
| Name | Type | Description |
|---|---|---|
result | unknown (optional) |
fail
View sourceMark task as failed
function fail(error: string): voidParameters:
| Name | Type | Description |
|---|---|---|
error | string |
block
View sourceBlock the task (waiting on something)
function block(reason: string): voidParameters:
| Name | Type | Description |
|---|---|---|
reason | string |
cancel
View sourceCancel the task
function cancel(): voidisActionable
View sourceCheck if task can be started
function isActionable(): booleanisFinished
View sourceCheck if task is finished (completed, failed, or cancelled)
function isFinished(): booleanhasBlockingDependencies
View sourceCheck for blocking dependencies Note: In real implementation, this would check against other tasks
function hasBlockingDependencies(): booleantoJSON
View sourceSerialize to JSON
function toJSON(): Record<string, unknown>fromJSON
View sourceDeserialize from JSON
function fromJSON(data: Record<string, unknown>): TaskParameters:
| Name | Type | Description |
|---|---|---|
data | Record<string, unknown> |
Interfaces
TaskDependency
View sourceProperties:
| Name | Type | Description |
|---|---|---|
taskId | string | |
type | "required" | "optional" |
TaskConfig
View sourceProperties:
| Name | Type | Description |
|---|---|---|
id | string | |
title | string | |
description | string | (optional) |
assignedTo | string | (optional) |
priority | "low" | "medium" | "high" | (optional) |
estimatedTime | string | (optional) |
dependencies | TaskDependency[] | (optional) |
tags | string[] | (optional) |
metadata | Record<string, unknown> | (optional) |
Enums
TaskStatus
View sourceTask - Individual work item within a Mission’s Plan
A Task is a discrete, actionable unit of work. Tasks have their own lifecycle and can be assigned to specific agents.
Hierarchy: Space (persistent container) └── Mission (user’s intent) └── Plan (strategy) └── Task[] (individual work items) ‹— This file
Note: This is different from AI SDK’s “steps” which refers to multi-turn tool execution loops. Our Task is a higher-level work item.
Values:
PENDING="pending"RUNNING="running"COMPLETED="completed"FAILED="failed"BLOCKED="blocked"CANCELLED="cancelled"