Spaces:
Paused
Paused
File size: 1,197 Bytes
0b9dc2e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | import { client } from './client';
import type { AddSkillRequest, MCPClient, MCPClientStatus, Skill } from './types';
export const workspaceApi = {
mcp: {
list: (agentId: string, sessionId: string) =>
client.get<MCPClientStatus[]>('/workspace/mcp', {
agent_id: agentId,
session_id: sessionId,
}),
add: (agentId: string, sessionId: string, mcp: MCPClient) =>
client.post<void>('/workspace/mcp', mcp, { agent_id: agentId, session_id: sessionId }),
remove: (mcpName: string, agentId: string, sessionId: string) =>
client.delete(`/workspace/mcp/${mcpName}`, {
agent_id: agentId,
session_id: sessionId,
}),
},
skill: {
list: (agentId: string, sessionId: string) =>
client.get<Skill[]>('/workspace/skill', { agent_id: agentId, session_id: sessionId }),
add: (agentId: string, sessionId: string, body: AddSkillRequest) =>
client.post<void>('/workspace/skill', body, {
agent_id: agentId,
session_id: sessionId,
}),
remove: (skillName: string, agentId: string, sessionId: string) =>
client.delete(`/workspace/skill/${skillName}`, {
agent_id: agentId,
session_id: sessionId,
}),
},
};
|