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 sourceProperties:
| Name | Type | Description |
|---|---|---|
goal | string | |
tasks | Task[] | |
metadata | Record<string, unknown> | |
createdAt | Date | |
updatedAt | Date |
Methods:
addTask
View sourceAdd a task to the plan
function addTask(task: Task): voidParameters:
| Name | Type | Description |
|---|---|---|
task | Task |
createTask
View sourceCreate and add a new task
function createTask(config: TaskConfig): TaskParameters:
| Name | Type | Description |
|---|---|---|
config | TaskConfig |
removeTask
View sourceRemove a task from the plan
function removeTask(taskId: string): booleanParameters:
| Name | Type | Description |
|---|---|---|
taskId | string |
getTaskById
View sourceGet task by ID
function getTaskById(taskId: string): Task | undefinedParameters:
| Name | Type | Description |
|---|---|---|
taskId | string |
updateTaskStatus
View sourceUpdate a task’s status
function updateTaskStatus(taskId: string, status: TaskStatus): booleanParameters:
| Name | Type | Description |
|---|---|---|
taskId | string | |
status | TaskStatus |
getNextActionableTask
View sourceGet the next task that can be started
function getNextActionableTask(): Task | undefinedgetAllActionableTasks
View sourceGet all tasks that can be started (for parallel execution)
function getAllActionableTasks(maxTasks?: number): Task[]Parameters:
| Name | Type | Description |
|---|---|---|
maxTasks | number (optional) |
getTasksByStatus
View sourceGet tasks by status
function getTasksByStatus(status: TaskStatus): Task[]Parameters:
| Name | Type | Description |
|---|---|---|
status | TaskStatus |
getTasksByAssignee
View sourceGet tasks assigned to a specific agent
function getTasksByAssignee(assignee: string): Task[]Parameters:
| Name | Type | Description |
|---|---|---|
assignee | string |
isComplete
View sourceCheck if all tasks are complete
function isComplete(): booleanhasFailedTasks
View sourceCheck if any tasks have failed
function hasFailedTasks(): booleanhasBlockedTasks
View sourceCheck if any tasks are blocked
function hasBlockedTasks(): booleangetProgressSummary
View sourceGet a summary of plan progress
function getProgressSummary(): PlanSummaryreorderTasks
View sourceReorder tasks in the plan
function reorderTasks(fromIndex: number, toIndex: number): voidParameters:
| Name | Type | Description |
|---|---|---|
fromIndex | number | |
toIndex | number |
toJSON
View sourceSerialize to JSON
function toJSON(): Record<string, unknown>fromJSON
View sourceDeserialize from JSON
function fromJSON(data: Record<string, unknown>): PlanParameters:
| Name | Type | Description |
|---|---|---|
data | Record<string, unknown> |
Interfaces
PlanSummary
View sourceProperties:
| Name | Type | Description |
|---|---|---|
totalTasks | number | |
completedTasks | number | |
runningTasks | number | |
pendingTasks | number | |
failedTasks | number | |
blockedTasks | number | |
progressPercentage | number |
PlanConfig
View sourceProperties:
| Name | Type | Description |
|---|---|---|
goal | string | |
tasks | Task[] | (optional) |
metadata | Record<string, unknown> | (optional) |