Skip to Content

plan

Module: vibex/plan

Plan - Strategy for achieving a Mission

A Plan contains the breakdown of Tasks needed to complete a Mission. Plans can evolve as the Mission progresses - tasks can be added, removed, or reordered based on user feedback and agent discoveries.

Hierarchy: Space (persistent container) └── Mission (user’s intent) └── Plan (strategy) ‹— This file └── Task[] (individual work items)

Classes

Plan

View source

Properties:

NameTypeDescription
goalstring
tasksTask[]
metadataRecord<string, unknown>
createdAtDate
updatedAtDate

Methods:

addTask

View source

Add a task to the plan

function addTask(task: Task): void

Parameters:

NameTypeDescription
taskTask

createTask

View source

Create and add a new task

function createTask(config: TaskConfig): Task

Parameters:

NameTypeDescription
configTaskConfig

removeTask

View source

Remove a task from the plan

function removeTask(taskId: string): boolean

Parameters:

NameTypeDescription
taskIdstring

getTaskById

View source

Get task by ID

function getTaskById(taskId: string): Task | undefined

Parameters:

NameTypeDescription
taskIdstring

updateTaskStatus

View source

Update a task’s status

function updateTaskStatus(taskId: string, status: TaskStatus): boolean

Parameters:

NameTypeDescription
taskIdstring
statusTaskStatus

getNextActionableTask

View source

Get the next task that can be started

function getNextActionableTask(): Task | undefined

getAllActionableTasks

View source

Get all tasks that can be started (for parallel execution)

function getAllActionableTasks(maxTasks?: number): Task[]

Parameters:

NameTypeDescription
maxTasksnumber (optional)

getTasksByStatus

View source

Get tasks by status

function getTasksByStatus(status: TaskStatus): Task[]

Parameters:

NameTypeDescription
statusTaskStatus

getTasksByAssignee

View source

Get tasks assigned to a specific agent

function getTasksByAssignee(assignee: string): Task[]

Parameters:

NameTypeDescription
assigneestring

isComplete

View source

Check if all tasks are complete

function isComplete(): boolean

hasFailedTasks

View source

Check if any tasks have failed

function hasFailedTasks(): boolean

hasBlockedTasks

View source

Check if any tasks are blocked

function hasBlockedTasks(): boolean

getProgressSummary

View source

Get a summary of plan progress

function getProgressSummary(): PlanSummary

reorderTasks

View source

Reorder tasks in the plan

function reorderTasks(fromIndex: number, toIndex: number): void

Parameters:

NameTypeDescription
fromIndexnumber
toIndexnumber

toJSON

View source

Serialize to JSON

function toJSON(): Record<string, unknown>

fromJSON

View source

Deserialize from JSON

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

Parameters:

NameTypeDescription
dataRecord<string, unknown>


Interfaces

PlanSummary

View source

Properties:

NameTypeDescription
totalTasksnumber
completedTasksnumber
runningTasksnumber
pendingTasksnumber
failedTasksnumber
blockedTasksnumber
progressPercentagenumber

PlanConfig

View source

Properties:

NameTypeDescription
goalstring
tasksTask[](optional)
metadataRecord<string, unknown>(optional)