Skip to Content
SDKvibexExports

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 source

Properties:

NameTypeDescription
spaceIdstring
userIdstring
configSpaceConfig
historyConversationHistory
tasksMap<string, SpaceTask>
messageQueueMessageQueue
agentsMap<string, Agent>
goalstring
namestring
xAgentXAgent
createdAtDate
updatedAtDate
planPlan
artifactsany[]
collaborationManagerAgentCollaborationManager
parallelEngineParallelExecutionEngine
collaborativePlannerCollaborativePlanner

Methods:

getOrCreateTask

View source

Get or create a task within this space

function getOrCreateTask(taskId: string, title?: string): SpaceTask

Parameters:

NameTypeDescription
taskIdstring
titlestring (optional)

getTask

View source

Get task by ID

function getTask(taskId: string): SpaceTask | undefined

Parameters:

NameTypeDescription
taskIdstring

getAllTasks

View source

Get all tasks in this space

function getAllTasks(): SpaceTask[]

updateSpaceTaskStatus

View source

Update space task status (for conversation tasks, not Plan tasks)

function updateSpaceTaskStatus(taskId: string, status: "active" | "completed" | "archived"): boolean

Parameters:

NameTypeDescription
taskIdstring
status"active" | "completed" | "archived"

getAgent

View source
function getAgent(name: string): Agent | undefined

Parameters:

NameTypeDescription
namestring

registerAgent

View source
function registerAgent(name: string, agent: Agent): void

Parameters:

NameTypeDescription
namestring
agentAgent

complete

View source
function complete(): void

getContext

View source
function getContext(): Record<string, any>

createPlan

View source
function createPlan(plan: Plan): Promise<void>

Parameters:

NameTypeDescription
planPlan

updatePlan

View source
function updatePlan(plan: Plan): Promise<void>

Parameters:

NameTypeDescription
planPlan

setName

View source
function setName(name: string): Promise<void>

Parameters:

NameTypeDescription
namestring

getNextTask

View source
function getNextTask(): Promise<Task | undefined>

getParallelTasks

View source
function getParallelTasks(maxTasks: number = 3): Promise<Task[]>

Parameters:

NameTypeDescription
maxTasksnumber(default: 3)

updateTaskStatus

View source
function updateTaskStatus(taskId: string, status: TaskStatus): Promise<boolean>

Parameters:

NameTypeDescription
taskIdstring
statusTaskStatus

assignTask

View source
function assignTask(taskId: string, agentName: string): Promise<boolean>

Parameters:

NameTypeDescription
taskIdstring
agentNamestring

isPlanComplete

View source
function isPlanComplete(): boolean

hasFailedTasks

View source
function hasFailedTasks(): boolean

persistState

View source
function persistState(): Promise<void>

loadState

View source
function loadState(): Promise<boolean>

loadPlan

View source
function loadPlan(): Promise<Plan | undefined>

getState

View source
function getState(): SpaceState


Interfaces

SpaceState

View source

Properties:

NameTypeDescription
spaceIdstring
namestring
goalstring
createdAtstring
updatedAtstring
teamSizenumber
tasksobject(optional)
progressPercentagenumber(optional)

SpaceTask

View source

Properties:

NameTypeDescription
idstring
spaceIdstring
titlestring
historyConversationHistory
artifactIdsstring[]
status"active" | "completed" | "archived"
createdAtDate
updatedAtDate

Functions

startSpace

View source

Start a new space

function startSpace({ goal, spaceId, userId, name, model, }: { goal: string; spaceId?: string; userId?: string; name?: string; model?: string; }): Promise<Space>

Parameters:

NameTypeDescription
optionsobject