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 sourceSpace 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:
| Name | Type | Description |
|---|---|---|
id | string | |
userId | string | (optional) |
name | string | |
description | string | |
category | string | (optional) |
icon | string | (optional) |
logoUrl | string | (optional) |
tags | string[] | (optional) |
systemPrompt | string | (optional) |
llm | object | (optional) |
tools | string[] | (optional) |
author | string | (optional) |
version | string | (optional) |
usageExamples | string[] | (optional) |
requirements | string[] | (optional) |
createdAt | string | (optional) |
updatedAt | string | (optional) |
ToolType
View sourceTool data type
Properties:
| Name | Type | Description |
|---|---|---|
id | string | |
userId | string | (optional) |
name | string | |
description | string | |
type | "builtin" | "mcp" | "custom" | |
vendor | string | (optional) |
category | string | (optional) |
icon | string | (optional) |
logoUrl | string | (optional) |
config | Record<string, unknown> | (optional) |
configSchema | unknown[] | (optional) |
features | string[] | (optional) |
tags | string[] | (optional) |
status | "active" | "inactive" | "deprecated" | (optional) |
ready | boolean | (optional) |
createdAt | string | (optional) |
updatedAt | string | (optional) |
SpaceType
View sourceSpace data type
Properties:
| Name | Type | Description |
|---|---|---|
id | string | |
userId | string | (optional) |
name | string | |
description | string | (optional) |
goal | string | (optional) |
icon | string | (optional) |
agents | string[] | (optional) |
tools | string[] | (optional) |
config | Record<string, unknown> | (optional) |
activeArtifactId | string | (optional) |
createdAt | string | (optional) |
updatedAt | string | (optional) |
ArtifactType
View sourceArtifact data type
Properties:
| Name | Type | Description |
|---|---|---|
id | string | |
spaceId | string | (optional) |
conversationId | string | (optional) |
userId | string | (optional) |
category | "input" | "intermediate" | "output" | (optional) |
storageKey | string | |
originalName | string | |
mimeType | string | |
sizeBytes | number | |
metadata | Record<string, unknown> | (optional) |
createdAt | string | (optional) |
updatedAt | string | (optional) |
ConversationType
View sourceConversation data type (chat session within a space)
Properties:
| Name | Type | Description |
|---|---|---|
id | string | |
spaceId | string | (optional) |
userId | string | (optional) |
title | string | (optional) |
messages | unknown[] | (optional) |
metadata | Record<string, unknown> | (optional) |
createdAt | string | (optional) |
updatedAt | string | (optional) |
PlanSummaryType
View sourcePlan summary for progress tracking
Properties:
| Name | Type | Description |
|---|---|---|
totalTasks | number | |
completedTasks | number | |
runningTasks | number | |
pendingTasks | number | |
failedTasks | number | |
blockedTasks | number | |
progressPercentage | number |
PlanType
View sourcePlan data type (stored per space, contains tasks)
Properties:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
plan | Record<string, unknown> | |
status | string | (optional) |
summary | PlanSummaryType | (optional) |
createdAt | string | (optional) |
updatedAt | string | (optional) |
ModelProviderType
View sourceModel provider configuration
Properties:
| Name | Type | Description |
|---|---|---|
id | string | |
name | string | |
provider | string | |
enabled | boolean | (optional) |
baseUrl | string | (optional) |
apiKey | string | (optional) |
models | string[] | \{ id: string; name: string \}[] | (optional) |
config | Record<string, unknown> | (optional) |
createdAt | string | (optional) |
updatedAt | string | (optional) |
DatasetType
View sourceDataset for knowledge management
Properties:
| Name | Type | Description |
|---|---|---|
id | string | |
name | string | |
type | string | |
icon | string | |
description | string | |
items | number | |
lastUpdated | string | |
size | string |
KnowledgeDocumentType
View sourceDocument in a dataset
Properties:
| Name | Type | Description |
|---|---|---|
id | string | |
name | string | |
type | string | |
size | string | |
lastModified | string |
DocumentChunkType
View sourceDocument chunk with embedding for vector search
Properties:
| Name | Type | Description |
|---|---|---|
id | string | |
content | string | |
metadata | Record<string, unknown> | |
embedding | number[] | (optional) |
ArtifactInfo
View sourceArtifact info for storage operations
Properties:
| Name | Type | Description |
|---|---|---|
id | string | |
storageKey | string | |
originalName | string | |
mimeType | string | |
sizeBytes | number | |
category | "input" | "intermediate" | "output" | (optional) |
metadata | Record<string, unknown> | (optional) |
createdAt | string | (optional) |
updatedAt | string | (optional) |
ResourceAdapter
View sourceResourceAdapter - 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:
| Name | Type | Description |
|---|
Methods:
getAgents
View sourcegetAgents(): Promise<AgentType[]>getAgent
View sourcegetAgent(id: string): Promise<AgentType | null>saveAgent
View sourcesaveAgent(agent: AgentType): Promise<AgentType>deleteAgent
View sourcedeleteAgent(id: string): Promise<void>cloneAgent
View sourcecloneAgent(id: string): Promise<AgentType>getTools
View sourcegetTools(): Promise<ToolType[]>getTool
View sourcegetTool(id: string): Promise<ToolType | null>saveTool
View sourcesaveTool(tool: ToolType): Promise<ToolType>deleteTool
View sourcedeleteTool(id: string): Promise<void>cloneTool
View sourcecloneTool(id: string): Promise<ToolType>getSpaces
View sourcegetSpaces(): Promise<SpaceType[]>getSpace
View sourcegetSpace(id: string): Promise<SpaceType | null>saveSpace
View sourcesaveSpace(space: SpaceType): Promise<SpaceType>deleteSpace
View sourcedeleteSpace(id: string): Promise<void>getArtifacts
View sourcegetArtifacts(spaceId: string): Promise<ArtifactType[]>getArtifact
View sourcegetArtifact(id: string): Promise<ArtifactType | null>saveArtifact
View sourcesaveArtifact(artifact: ArtifactType): Promise<ArtifactType>deleteArtifact
View sourcedeleteArtifact(id: string): Promise<void>getArtifactsBySpace
View sourcegetArtifactsBySpace(spaceId: string): Promise<ArtifactType[]>getArtifactsByConversation
View sourcegetArtifactsByConversation(conversationId: string): Promise<ArtifactType[]>getArtifactsByCategory
View sourcegetArtifactsByCategory(spaceOrConversationId: string, category: "input" | "intermediate" | "output", isConversation: boolean): Promise<ArtifactType[]>getPlan
View sourcegetPlan(spaceId: string): Promise<PlanType | null>savePlan
View sourcesavePlan(plan: PlanType): Promise<PlanType>deletePlan
View sourcedeletePlan(spaceId: string): Promise<void>getConversations
View sourcegetConversations(spaceId: string): Promise<ConversationType[]>getConversation
View sourcegetConversation(id: string): Promise<ConversationType | null>saveConversation
View sourcesaveConversation(conversation: ConversationType): Promise<ConversationType>deleteConversation
View sourcedeleteConversation(id: string): Promise<void>getModelProviders
View sourcegetModelProviders(): Promise<ModelProviderType[]>getModelProvider
View sourcegetModelProvider(id: string): Promise<ModelProviderType | null>saveModelProvider
View sourcesaveModelProvider(provider: ModelProviderType): Promise<ModelProviderType>deleteModelProvider
View sourcedeleteModelProvider(id: string): Promise<void>StorageAdapter
View sourceStorageAdapter - Interface for file/blob storage
Properties:
| Name | Type | Description |
|---|
Methods:
readFile
View sourcereadFile(path: string): Promise<Buffer>readTextFile
View sourcereadTextFile(path: string): Promise<string>writeFile
View sourcewriteFile(path: string, data: Buffer | string): Promise<void>deleteFile
View sourcedeleteFile(path: string): Promise<void>exists
View sourceexists(path: string): Promise<boolean>mkdir
View sourcemkdir(path: string): Promise<void>readdir
View sourcereaddir(path: string): Promise<string[]>stat
View sourcestat(path: string): Promise<unknown>saveArtifact
View sourcesaveArtifact(spaceId: string, artifact: ArtifactInfo, buffer: Buffer): Promise<ArtifactInfo>getArtifact
View sourcegetArtifact(spaceId: string, artifactId: string): Promise<{ info: ArtifactInfo; buffer: Buffer } | null>getArtifactInfo
View sourcegetArtifactInfo(spaceId: string, artifactId: string): Promise<ArtifactInfo | null>listArtifacts
View sourcelistArtifacts(spaceId: string): Promise<ArtifactInfo[]>deleteArtifact
View sourcedeleteArtifact(spaceId: string, artifactId: string): Promise<void>KnowledgeAdapter
View sourceKnowledgeAdapter - Interface for knowledge/RAG operations
Properties:
| Name | Type | Description |
|---|
Methods:
getDatasets
View sourcegetDatasets(): Promise<DatasetType[]>getDataset
View sourcegetDataset(id: string): Promise<DatasetType | null>saveDataset
View sourcesaveDataset(dataset: DatasetType): Promise<void>deleteDataset
View sourcedeleteDataset(id: string): Promise<void>getDocuments
View sourcegetDocuments(datasetId: string): Promise<KnowledgeDocumentType[]>addDocument
View sourceaddDocument(datasetId: string, document: KnowledgeDocumentType): Promise<void>deleteDocument
View sourcedeleteDocument(datasetId: string, documentId: string): Promise<void>saveChunks
View sourcesaveChunks(chunks: DocumentChunkType[]): Promise<void>searchChunks
View sourcesearchChunks(vector: number[], k: number): Promise<DocumentChunkType[]>deleteChunks
View sourcedeleteChunks(ids: string[]): Promise<void>