index
Module: vibex/index
Space - The top-level container for VibeX work (formerly Space)
A Space represents a project context that contains multiple tasks. Each space is managed by an XAgent that serves as its orchestrator.
Key concepts:
- Space: Project container with shared configuration
- Task: Individual conversation threads within a space
- Each task has its own conversation history and artifacts
Classes
Space
View sourceProperties:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
userId | string | |
config | SpaceConfig | |
history | ConversationHistory | |
tasks | Map<string, SpaceTask> | |
messageQueue | MessageQueue | |
agents | Map<string, Agent> | |
goal | string | |
name | string | |
xAgent | XAgent | |
createdAt | Date | |
updatedAt | Date | |
plan | Plan | |
artifacts | any[] | |
collaborationManager | AgentCollaborationManager | |
parallelEngine | ParallelExecutionEngine | |
collaborativePlanner | CollaborativePlanner |
Methods:
getOrCreateTask
View sourceGet or create a task within this space
function getOrCreateTask(taskId: string, title?: string): SpaceTaskParameters:
| Name | Type | Description |
|---|---|---|
taskId | string | |
title | string (optional) |
getTask
View sourceGet task by ID
function getTask(taskId: string): SpaceTask | undefinedParameters:
| Name | Type | Description |
|---|---|---|
taskId | string |
getAllTasks
View sourceGet all tasks in this space
function getAllTasks(): SpaceTask[]updateSpaceTaskStatus
View sourceUpdate space task status (for conversation tasks, not Plan tasks)
function updateSpaceTaskStatus(taskId: string, status: "active" | "completed" | "archived"): booleanParameters:
| Name | Type | Description |
|---|---|---|
taskId | string | |
status | "active" | "completed" | "archived" |
getAgent
View sourcefunction getAgent(name: string): Agent | undefinedParameters:
| Name | Type | Description |
|---|---|---|
name | string |
registerAgent
View sourcefunction registerAgent(name: string, agent: Agent): voidParameters:
| Name | Type | Description |
|---|---|---|
name | string | |
agent | Agent |
complete
View sourcefunction complete(): voidgetContext
View sourcefunction getContext(): Record<string, any>createPlan
View sourcefunction createPlan(plan: Plan): Promise<void>Parameters:
| Name | Type | Description |
|---|---|---|
plan | Plan |
updatePlan
View sourcefunction updatePlan(plan: Plan): Promise<void>Parameters:
| Name | Type | Description |
|---|---|---|
plan | Plan |
setName
View sourcefunction setName(name: string): Promise<void>Parameters:
| Name | Type | Description |
|---|---|---|
name | string |
getNextTask
View sourcefunction getNextTask(): Promise<Task | undefined>getParallelTasks
View sourcefunction getParallelTasks(maxTasks: number = 3): Promise<Task[]>Parameters:
| Name | Type | Description |
|---|---|---|
maxTasks | number | (default: 3) |
updateTaskStatus
View sourcefunction updateTaskStatus(taskId: string, status: TaskStatus): Promise<boolean>Parameters:
| Name | Type | Description |
|---|---|---|
taskId | string | |
status | TaskStatus |
assignTask
View sourcefunction assignTask(taskId: string, agentName: string): Promise<boolean>Parameters:
| Name | Type | Description |
|---|---|---|
taskId | string | |
agentName | string |
isPlanComplete
View sourcefunction isPlanComplete(): booleanhasFailedTasks
View sourcefunction hasFailedTasks(): booleanpersistState
View sourcefunction persistState(): Promise<void>loadState
View sourcefunction loadState(): Promise<boolean>loadPlan
View sourcefunction loadPlan(): Promise<Plan | undefined>getState
View sourcefunction getState(): SpaceStateInterfaces
SpaceState
View sourceProperties:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
name | string | |
goal | string | |
createdAt | string | |
updatedAt | string | |
teamSize | number | |
tasks | object | (optional) |
progressPercentage | number | (optional) |
SpaceTask
View sourceProperties:
| Name | Type | Description |
|---|---|---|
id | string | |
spaceId | string | |
title | string | |
history | ConversationHistory | |
artifactIds | string[] | |
status | "active" | "completed" | "archived" | |
createdAt | Date | |
updatedAt | Date |
Functions
startSpace
View sourceStart a new space
function startSpace({
goal,
spaceId,
userId,
name,
model,
}: {
goal: string;
spaceId?: string;
userId?: string;
name?: string;
model?: string;
}): Promise<Space>Parameters:
| Name | Type | Description |
|---|---|---|
options | object |