Skip to Content

space

Module: @vibex/core/space

Space Types - Data persistence layer types

This file contains all types related to VibeX’s data persistence:

  • Data types (what gets stored)
  • Adapter interfaces (how data is accessed)

Concrete implementations live in separate packages:

  • @vibex/local: SQLite + filesystem
  • @vibex/supabase: Supabase backend

Interfaces

AgentType

View source

Space Types - Data persistence layer types

This file contains all types related to VibeX’s data persistence:

  • Data types (what gets stored)
  • Adapter interfaces (how data is accessed)

Concrete implementations live in separate packages:

  • @vibex/local: SQLite + filesystem
  • @vibex/supabase: Supabase backend

Properties:

NameTypeDescription
idstring
userIdstring(optional)
namestring
descriptionstring
categorystring(optional)
iconstring(optional)
logoUrlstring(optional)
tagsstring[](optional)
systemPromptstring(optional)
llmobject(optional)
toolsstring[](optional)
authorstring(optional)
versionstring(optional)
usageExamplesstring[](optional)
requirementsstring[](optional)
createdAtstring(optional)
updatedAtstring(optional)

ToolType

View source

Tool data type

Properties:

NameTypeDescription
idstring
userIdstring(optional)
namestring
descriptionstring
type"builtin" | "mcp" | "custom"
vendorstring(optional)
categorystring(optional)
iconstring(optional)
logoUrlstring(optional)
configRecord<string, unknown>(optional)
configSchemaunknown[](optional)
featuresstring[](optional)
tagsstring[](optional)
status"active" | "inactive" | "deprecated"(optional)
readyboolean(optional)
createdAtstring(optional)
updatedAtstring(optional)

SpaceType

View source

Space data type

Properties:

NameTypeDescription
idstring
userIdstring(optional)
namestring
descriptionstring(optional)
goalstring(optional)
iconstring(optional)
agentsstring[](optional)
toolsstring[](optional)
configRecord<string, unknown>(optional)
activeArtifactIdstring(optional)
createdAtstring(optional)
updatedAtstring(optional)

ArtifactType

View source

Artifact data type

Properties:

NameTypeDescription
idstring
spaceIdstring(optional)
conversationIdstring(optional)
userIdstring(optional)
category"input" | "intermediate" | "output"(optional)
storageKeystring
originalNamestring
mimeTypestring
sizeBytesnumber
metadataRecord<string, unknown>(optional)
createdAtstring(optional)
updatedAtstring(optional)

ConversationType

View source

Conversation data type (chat session within a space)

Properties:

NameTypeDescription
idstring
spaceIdstring(optional)
userIdstring(optional)
titlestring(optional)
messagesunknown[](optional)
metadataRecord<string, unknown>(optional)
createdAtstring(optional)
updatedAtstring(optional)

PlanSummaryType

View source

Plan summary for progress tracking

Properties:

NameTypeDescription
totalTasksnumber
completedTasksnumber
runningTasksnumber
pendingTasksnumber
failedTasksnumber
blockedTasksnumber
progressPercentagenumber

PlanType

View source

Plan data type (stored per space, contains tasks)

Properties:

NameTypeDescription
spaceIdstring
planRecord<string, unknown>
statusstring(optional)
summaryPlanSummaryType(optional)
createdAtstring(optional)
updatedAtstring(optional)

ModelProviderType

View source

Model provider configuration

Properties:

NameTypeDescription
idstring
namestring
providerstring
enabledboolean(optional)
baseUrlstring(optional)
apiKeystring(optional)
modelsstring[] | \{ id: string; name: string \}[](optional)
configRecord<string, unknown>(optional)
createdAtstring(optional)
updatedAtstring(optional)

DatasetType

View source

Dataset for knowledge management

Properties:

NameTypeDescription
idstring
namestring
typestring
iconstring
descriptionstring
itemsnumber
lastUpdatedstring
sizestring

KnowledgeDocumentType

View source

Document in a dataset

Properties:

NameTypeDescription
idstring
namestring
typestring
sizestring
lastModifiedstring

DocumentChunkType

View source

Document chunk with embedding for vector search

Properties:

NameTypeDescription
idstring
contentstring
metadataRecord<string, unknown>
embeddingnumber[](optional)

ArtifactInfo

View source

Artifact info for storage operations

Properties:

NameTypeDescription
idstring
storageKeystring
originalNamestring
mimeTypestring
sizeBytesnumber
category"input" | "intermediate" | "output"(optional)
metadataRecord<string, unknown>(optional)
createdAtstring(optional)
updatedAtstring(optional)

ResourceAdapter

View source

ResourceAdapter - Core interface for data persistence

Implementations handle local files (SQLite) or remote database/API. This is an internal interface; external code should use SpaceManager.

Properties:

NameTypeDescription

Methods:

getAgents

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

getAgent

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

saveAgent

View source
saveAgent(agent: AgentType): Promise<AgentType>

deleteAgent

View source
deleteAgent(id: string): Promise<void>

cloneAgent

View source
cloneAgent(id: string): Promise<AgentType>

getTools

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

getTool

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

saveTool

View source
saveTool(tool: ToolType): Promise<ToolType>

deleteTool

View source
deleteTool(id: string): Promise<void>

cloneTool

View source
cloneTool(id: string): Promise<ToolType>

getSpaces

View source
getSpaces(): Promise<SpaceType[]>

getSpace

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

saveSpace

View source
saveSpace(space: SpaceType): Promise<SpaceType>

deleteSpace

View source
deleteSpace(id: string): Promise<void>

getArtifacts

View source
getArtifacts(spaceId: string): Promise<ArtifactType[]>

getArtifact

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

saveArtifact

View source
saveArtifact(artifact: ArtifactType): Promise<ArtifactType>

deleteArtifact

View source
deleteArtifact(id: string): Promise<void>

getArtifactsBySpace

View source
getArtifactsBySpace(spaceId: string): Promise<ArtifactType[]>

getArtifactsByConversation

View source
getArtifactsByConversation(conversationId: string): Promise<ArtifactType[]>

getArtifactsByCategory

View source
getArtifactsByCategory(spaceOrConversationId: string, category: "input" | "intermediate" | "output", isConversation: boolean): Promise<ArtifactType[]>

getPlan

View source
getPlan(spaceId: string): Promise<PlanType | null>

savePlan

View source
savePlan(plan: PlanType): Promise<PlanType>

deletePlan

View source
deletePlan(spaceId: string): Promise<void>

getConversations

View source
getConversations(spaceId: string): Promise<ConversationType[]>

getConversation

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

saveConversation

View source
saveConversation(conversation: ConversationType): Promise<ConversationType>

deleteConversation

View source
deleteConversation(id: string): Promise<void>

getModelProviders

View source
getModelProviders(): Promise<ModelProviderType[]>

getModelProvider

View source
getModelProvider(id: string): Promise<ModelProviderType | null>

saveModelProvider

View source
saveModelProvider(provider: ModelProviderType): Promise<ModelProviderType>

deleteModelProvider

View source
deleteModelProvider(id: string): Promise<void>


StorageAdapter

View source

StorageAdapter - Interface for file/blob storage

Properties:

NameTypeDescription

Methods:

readFile

View source
readFile(path: string): Promise<Buffer>

readTextFile

View source
readTextFile(path: string): Promise<string>

writeFile

View source
writeFile(path: string, data: Buffer | string): Promise<void>

deleteFile

View source
deleteFile(path: string): Promise<void>

exists

View source
exists(path: string): Promise<boolean>

mkdir

View source
mkdir(path: string): Promise<void>

readdir

View source
readdir(path: string): Promise<string[]>

stat

View source
stat(path: string): Promise<unknown>

saveArtifact

View source
saveArtifact(spaceId: string, artifact: ArtifactInfo, buffer: Buffer): Promise<ArtifactInfo>

getArtifact

View source
getArtifact(spaceId: string, artifactId: string): Promise<{ info: ArtifactInfo; buffer: Buffer } | null>

getArtifactInfo

View source
getArtifactInfo(spaceId: string, artifactId: string): Promise<ArtifactInfo | null>

listArtifacts

View source
listArtifacts(spaceId: string): Promise<ArtifactInfo[]>

deleteArtifact

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


KnowledgeAdapter

View source

KnowledgeAdapter - Interface for knowledge/RAG operations

Properties:

NameTypeDescription

Methods:

getDatasets

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

getDataset

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

saveDataset

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

deleteDataset

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

getDocuments

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

addDocument

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

deleteDocument

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

saveChunks

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

searchChunks

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

deleteChunks

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