Skip to Content

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 source

Properties:

NameTypeDescription
idstring
titlestring
descriptionstring
statusTaskStatus
assignedTostring
priority"low" | "medium" | "high"
estimatedTimestring
actualTimestring
dependenciesTaskDependency[]
tagsstring[]
metadataRecord<string, unknown>
resultunknown
errorstring
createdAtDate
updatedAtDate
startedAtDate
completedAtDate

Methods:

start

View source

Start the task

function start(): void

complete

View source

Complete the task with optional result

function complete(result?: unknown): void

Parameters:

NameTypeDescription
resultunknown (optional)

fail

View source

Mark task as failed

function fail(error: string): void

Parameters:

NameTypeDescription
errorstring

block

View source

Block the task (waiting on something)

function block(reason: string): void

Parameters:

NameTypeDescription
reasonstring

cancel

View source

Cancel the task

function cancel(): void

isActionable

View source

Check if task can be started

function isActionable(): boolean

isFinished

View source

Check if task is finished (completed, failed, or cancelled)

function isFinished(): boolean

hasBlockingDependencies

View source

Check for blocking dependencies Note: In real implementation, this would check against other tasks

function hasBlockingDependencies(): boolean

toJSON

View source

Serialize to JSON

function toJSON(): Record<string, unknown>

fromJSON

View source

Deserialize from JSON

function fromJSON(data: Record<string, unknown>): Task

Parameters:

NameTypeDescription
dataRecord<string, unknown>


Interfaces

TaskDependency

View source

Properties:

NameTypeDescription
taskIdstring
type"required" | "optional"

TaskConfig

View source

Properties:

NameTypeDescription
idstring
titlestring
descriptionstring(optional)
assignedTostring(optional)
priority"low" | "medium" | "high"(optional)
estimatedTimestring(optional)
dependenciesTaskDependency[](optional)
tagsstring[](optional)
metadataRecord<string, unknown>(optional)

Enums

TaskStatus

View source

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.

Values:

  • PENDING = "pending"
  • RUNNING = "running"
  • COMPLETED = "completed"
  • FAILED = "failed"
  • BLOCKED = "blocked"
  • CANCELLED = "cancelled"