Skip to Content
SDKvibexManager

manager

Module: vibex/manager

SpaceManager - Unified Data Access Layer

This is the single source of truth for all VibeX data operations. It unifies ResourceAdapter (resources), KnowledgeAdapter (vectors), and StorageAdapter (files) into one interface.

Classes

SpaceManager

View source

SpaceManager - Central data access layer for space operations

Methods:

createServer

View source

Create a server-side instance

function createServer(): Promise<SpaceManager>

createServerSync

View source

Create a server-side instance synchronously

function createServerSync(): SpaceManager

getSpace

View source
function getSpace(spaceId: string): Promise<SpaceType | null>

Parameters:

NameTypeDescription
spaceIdstring

listSpaces

View source
function listSpaces(filters?: SpaceFilters): Promise<SpaceType[]>

Parameters:

NameTypeDescription
filtersSpaceFilters (optional)

createSpace

View source
function createSpace(space: Partial<SpaceType>): Promise<SpaceType>

Parameters:

NameTypeDescription
spacePartial<SpaceType>

updateSpace

View source
function updateSpace(spaceId: string, updates: Partial<SpaceType>): Promise<SpaceType>

Parameters:

NameTypeDescription
spaceIdstring
updatesPartial<SpaceType>

deleteSpace

View source
function deleteSpace(spaceId: string): Promise<void>

Parameters:

NameTypeDescription
spaceIdstring

subscribeToSpace

View source
function subscribeToSpace(spaceId: string, callback: SubscriptionCallback<SpaceType | null>): Unsubscribe

Parameters:

NameTypeDescription
spaceIdstring
callbackSubscriptionCallback<SpaceType | null>

subscribeToSpaces

View source
function subscribeToSpaces(callback: SubscriptionCallback<SpaceType[]>): Unsubscribe

Parameters:

NameTypeDescription
callbackSubscriptionCallback<SpaceType[]>

getArtifacts

View source
function getArtifacts(spaceId: string, filters?: ArtifactFilters): Promise<ArtifactType[]>

Parameters:

NameTypeDescription
spaceIdstring
filtersArtifactFilters (optional)

getArtifact

View source
function getArtifact(artifactId: string): Promise<ArtifactType | null>

Parameters:

NameTypeDescription
artifactIdstring

createArtifact

View source
function createArtifact(spaceId: string, artifact: Partial<ArtifactType>): Promise<ArtifactType>

Parameters:

NameTypeDescription
spaceIdstring
artifactPartial<ArtifactType>

updateArtifact

View source
function updateArtifact(artifactId: string, updates: Partial<ArtifactType>): Promise<ArtifactType>

Parameters:

NameTypeDescription
artifactIdstring
updatesPartial<ArtifactType>

deleteArtifact

View source
function deleteArtifact(artifactId: string, spaceId: string): Promise<void>

Parameters:

NameTypeDescription
artifactIdstring
spaceIdstring

subscribeToArtifacts

View source
function subscribeToArtifacts(spaceId: string, callback: SubscriptionCallback<ArtifactType[]>): Unsubscribe

Parameters:

NameTypeDescription
spaceIdstring
callbackSubscriptionCallback<ArtifactType[]>

getConversations

View source
function getConversations(spaceId: string, filters?: ConversationFilters): Promise<ConversationType[]>

Parameters:

NameTypeDescription
spaceIdstring
filtersConversationFilters (optional)

getConversation

View source
function getConversation(taskId: string): Promise<ConversationType | null>

Parameters:

NameTypeDescription
taskIdstring

createTask

View source
function createTask(spaceId: string, task: Partial<ConversationType>): Promise<ConversationType>

Parameters:

NameTypeDescription
spaceIdstring
taskPartial<ConversationType>

updateTask

View source
function updateTask(taskId: string, updates: Partial<ConversationType>): Promise<ConversationType>

Parameters:

NameTypeDescription
taskIdstring
updatesPartial<ConversationType>

createConversation

View source
function createConversation(spaceId: string, conversation: Partial<ConversationType>): Promise<ConversationType>

Parameters:

NameTypeDescription
spaceIdstring
conversationPartial<ConversationType>

updateConversation

View source
function updateConversation(conversationId: string, updates: Partial<ConversationType>): Promise<ConversationType>

Parameters:

NameTypeDescription
conversationIdstring
updatesPartial<ConversationType>

deleteConversation

View source
function deleteConversation(taskId: string, spaceId: string): Promise<void>

Parameters:

NameTypeDescription
taskIdstring
spaceIdstring

subscribeToTasks

View source
function subscribeToTasks(spaceId: string, callback: SubscriptionCallback<ConversationType[]>): Unsubscribe

Parameters:

NameTypeDescription
spaceIdstring
callbackSubscriptionCallback<ConversationType[]>

getAgents

View source
function getAgents(): Promise<AgentType[]>

getAgent

View source
function getAgent(agentId: string): Promise<AgentType | null>

Parameters:

NameTypeDescription
agentIdstring

getTools

View source
function getTools(): Promise<ToolType[]>

getTool

View source
function getTool(toolId: string): Promise<ToolType | null>

Parameters:

NameTypeDescription
toolIdstring

getSpaceStorage

View source
function getSpaceStorage(_spaceId: string): BaseStorage

Parameters:

NameTypeDescription
_spaceIdstring

uploadArtifactFile

View source
function uploadArtifactFile(spaceId: string, artifactId: string, file: File | Blob, filename: string): Promise<string>

Parameters:

NameTypeDescription
spaceIdstring
artifactIdstring
fileFile | Blob
filenamestring

downloadArtifactFile

View source
function downloadArtifactFile(spaceId: string, storageKey: string, artifactId?: string): Promise<Blob>

Parameters:

NameTypeDescription
spaceIdstring
storageKeystring
artifactIdstring (optional)

deleteArtifactFile

View source
function deleteArtifactFile(spaceId: string, storageKey: string): Promise<void>

Parameters:

NameTypeDescription
spaceIdstring
storageKeystring

getDatasets

View source
function getDatasets(): Promise<DatasetType[]>

getDataset

View source
function getDataset(id: string): Promise<DatasetType | null>

Parameters:

NameTypeDescription
idstring

saveDataset

View source
function saveDataset(dataset: DatasetType): Promise<void>

Parameters:

NameTypeDescription
datasetDatasetType

deleteDataset

View source
function deleteDataset(id: string): Promise<void>

Parameters:

NameTypeDescription
idstring

getDocuments

View source
function getDocuments(datasetId: string): Promise<KnowledgeDocumentType[]>

Parameters:

NameTypeDescription
datasetIdstring

addDocument

View source
function addDocument(datasetId: string, document: KnowledgeDocumentType): Promise<void>

Parameters:

NameTypeDescription
datasetIdstring
documentKnowledgeDocumentType

deleteDocument

View source
function deleteDocument(datasetId: string, documentId: string): Promise<void>

Parameters:

NameTypeDescription
datasetIdstring
documentIdstring

saveChunks

View source
function saveChunks(chunks: DocumentChunkType[]): Promise<void>

Parameters:

NameTypeDescription
chunksDocumentChunkType[]

searchChunks

View source
function searchChunks(vector: number[], k: number): Promise<DocumentChunkType[]>

Parameters:

NameTypeDescription
vectornumber[]
knumber

deleteChunks

View source
function deleteChunks(ids: string[]): Promise<void>

Parameters:

NameTypeDescription
idsstring[]


Interfaces

SpaceFilters

View source

Properties:

NameTypeDescription
userIdstring(optional)
namestring(optional)
createdAfterDate(optional)
createdBeforeDate(optional)

ArtifactFilters

View source

Properties:

NameTypeDescription
spaceIdstring(optional)
conversationIdstring(optional)
category"input" | "intermediate" | "output"(optional)
mimeTypestring(optional)

ConversationFilters

View source

Properties:

NameTypeDescription
titlestring(optional)
createdAfterDate(optional)

Types

TaskFilters

View source
type TaskFilters = ConversationFilters

Unsubscribe

View source
type Unsubscribe = () => void

SubscriptionCallback

View source
type SubscriptionCallback = (data: T) => void

Functions

getSpaceManager

View source
function getSpaceManager(): SpaceManager

getSpaceManagerServer

View source

Get server-side SpaceManager

function getSpaceManagerServer(): SpaceManager