mission
Module: vibex/mission
Mission - User’s substantial intent within a Space
A Mission represents a high-level goal that requires multiple tasks to complete. Example: “Write a research paper on AI” is a Mission containing tasks like “Research sources”, “Create outline”, “Write introduction”, etc.
Hierarchy: Space (persistent container) └── Mission (user’s intent, has lifecycle) └── Plan (strategy, evolves) └── Task[] (individual work items)
Classes
Mission
View sourceProperties:
| Name | Type | Description |
|---|---|---|
id | string | |
title | string | |
description | string | |
status | MissionStatus | |
priority | "low" | "medium" | "high" | |
tags | string[] | |
metadata | Record<string, unknown> | |
plan | Plan | |
createdAt | Date | |
updatedAt | Date | |
completedAt | Date |
Methods:
setPlan
View sourceSet the plan for this mission
function setPlan(plan: Plan): voidParameters:
| Name | Type | Description |
|---|---|---|
plan | Plan |
getTasks
View sourceGet all tasks from the plan
function getTasks(): Task[]getTasksByStatus
View sourceGet tasks by status
function getTasksByStatus(status: TaskStatus): Task[]Parameters:
| Name | Type | Description |
|---|---|---|
status | TaskStatus |
getNextTask
View sourceGet the next actionable task
function getNextTask(): Task | undefinedgetCurrentTask
View sourceGet current running task
function getCurrentTask(): Task | undefinedgetProgress
View sourceCalculate mission progress (0-100)
function getProgress(): numberpause
View sourcePause the mission
function pause(): voidresume
View sourceResume a paused mission
function resume(): voidcomplete
View sourceComplete the mission
function complete(): voidabandon
View sourceAbandon the mission
function abandon(): voidisFinished
View sourceCheck if mission is finished (completed or abandoned)
function isFinished(): booleantoJSON
View sourceSerialize to JSON
function toJSON(): Record<string, unknown>fromJSON
View sourceDeserialize from JSON
function fromJSON(data: Record<string, unknown>): MissionParameters:
| Name | Type | Description |
|---|---|---|
data | Record<string, unknown> |
Interfaces
MissionConfig
View sourceProperties:
| Name | Type | Description |
|---|---|---|
id | string | |
title | string | |
description | string | (optional) |
priority | "low" | "medium" | "high" | (optional) |
tags | string[] | (optional) |
metadata | Record<string, unknown> | (optional) |
Types
MissionStatus
View sourcetype MissionStatus = | "active" // Mission is being worked on
| "paused" // User paused the mission
| "completed" // All tasks done, goal achieved
| "abandoned"