actions
Module: @vibex/react/actions
VibeX Server Actions
This file contains Next.js Server Actions that expose VibeX functionality to client components. All VibeX operations must go through these actions since VibeX requires server-side access to Supabase.
Usage in client components:
"use client";
import { getSpace, updateSpace } from "@/vibex/server/actions";
const space = await getSpace(spaceId);
await updateSpace(spaceId, { name: "New Name" });Interfaces
SpaceFilters
View sourceProperties:
| Name | Type | Description |
|---|---|---|
userId | string | (optional) |
name | string | (optional) |
createdAfter | Date | (optional) |
createdBefore | Date | (optional) |
ArtifactFilters
View sourceProperties:
| Name | Type | Description |
|---|---|---|
spaceId | string | (optional) |
conversationId | string | (optional) |
category | "input" | "intermediate" | "output" | (optional) |
mimeType | string | (optional) |
ConversationFilters
View sourceProperties:
| Name | Type | Description |
|---|---|---|
title | string | (optional) |
createdAfter | Date | (optional) |
TaskFilters
View sourceProperties:
| Name | Type | Description |
|---|---|---|
title | string | (optional) |
createdAfter | Date | (optional) |
Functions
getSpace
View sourcefunction getSpace(spaceId: string): Promise<SpaceType | null>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string |
listSpaces
View sourcefunction listSpaces(filters?: SpaceFilters): Promise<SpaceType[]>Parameters:
| Name | Type | Description |
|---|---|---|
filters | SpaceFilters (optional) |
createSpace
View sourcefunction createSpace(space: Partial<SpaceType>): Promise<SpaceType>Parameters:
| Name | Type | Description |
|---|---|---|
space | Partial<SpaceType> |
updateSpace
View sourcefunction updateSpace(spaceId: string, updates: Partial<SpaceType>): Promise<SpaceType>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
updates | Partial<SpaceType> |
deleteSpace
View sourcefunction deleteSpace(spaceId: string): Promise<void>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string |
getArtifacts
View sourcefunction getArtifacts(spaceId: string, filters?: ArtifactFilters): Promise<ArtifactType[]>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
filters | ArtifactFilters (optional) |
getArtifact
View sourcefunction getArtifact(artifactId: string): Promise<ArtifactType | null>Parameters:
| Name | Type | Description |
|---|---|---|
artifactId | string |
createArtifact
View sourcefunction createArtifact(spaceId: string, artifact: Partial<ArtifactType>): Promise<ArtifactType>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
artifact | Partial<ArtifactType> |
updateArtifact
View sourcefunction updateArtifact(artifactId: string, updates: Partial<ArtifactType>): Promise<ArtifactType>Parameters:
| Name | Type | Description |
|---|---|---|
artifactId | string | |
updates | Partial<ArtifactType> |
deleteArtifact
View sourcefunction deleteArtifact(artifactId: string, spaceId: string): Promise<void>Parameters:
| Name | Type | Description |
|---|---|---|
artifactId | string | |
spaceId | string |
getConversations
View sourcefunction getConversations(spaceId: string, filters?: ConversationFilters): Promise<ConversationType[]>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
filters | ConversationFilters (optional) |
getConversation
View sourcefunction getConversation(taskId: string): Promise<ConversationType | null>Parameters:
| Name | Type | Description |
|---|---|---|
taskId | string |
createConversation
View sourcefunction createConversation(spaceId: string, task: Partial<ConversationType>): Promise<ConversationType>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
task | Partial<ConversationType> |
updateConversation
View sourcefunction updateConversation(taskId: string, updates: Partial<ConversationType>): Promise<ConversationType>Parameters:
| Name | Type | Description |
|---|---|---|
taskId | string | |
updates | Partial<ConversationType> |
deleteConversation
View sourcefunction deleteConversation(taskId: string, spaceId: string): Promise<void>Parameters:
| Name | Type | Description |
|---|---|---|
taskId | string | |
spaceId | string |
getAgents
View sourcefunction getAgents(): Promise<AgentType[]>getAgent
View sourcefunction getAgent(agentId: string): Promise<AgentType | null>Parameters:
| Name | Type | Description |
|---|---|---|
agentId | string |
getTools
View sourcefunction getTools(): Promise<ToolType[]>getTool
View sourcefunction getTool(toolId: string): Promise<ToolType | null>Parameters:
| Name | Type | Description |
|---|---|---|
toolId | string |
getTasks
View sourcefunction getTasks(spaceId: string, filters?: TaskFilters): Promise<ConversationType[]>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
filters | TaskFilters (optional) |
getTask
View sourcefunction getTask(taskId: string): Promise<ConversationType | null>Parameters:
| Name | Type | Description |
|---|---|---|
taskId | string |
createTask
View sourcefunction createTask(spaceId: string, task: Partial<ConversationType>): Promise<ConversationType>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
task | Partial<ConversationType> |
updateTask
View sourcefunction updateTask(taskId: string, updates: Partial<ConversationType>): Promise<ConversationType>Parameters:
| Name | Type | Description |
|---|---|---|
taskId | string | |
updates | Partial<ConversationType> |
deleteTask
View sourcefunction deleteTask(taskId: string, spaceId: string): Promise<void>Parameters:
| Name | Type | Description |
|---|---|---|
taskId | string | |
spaceId | string |
getSpaceStorage
View sourcefunction getSpaceStorage(spaceId: string): voidParameters:
| Name | Type | Description |
|---|---|---|
spaceId | string |
deleteArtifactFile
View sourcefunction deleteArtifactFile(spaceId: string, storageKey: string): Promise<void>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
storageKey | string |