apteva 0.4.56 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -54
- package/cli.js +35 -0
- package/install.js +92 -0
- package/package.json +12 -79
- package/LICENSE +0 -63
- package/bin/apteva.js +0 -196
- package/dist/ActivityPage.kxzzb4yc.js +0 -3
- package/dist/ApiDocsPage.zq998hbm.js +0 -4
- package/dist/App.55rea8mn.js +0 -61
- package/dist/App.5ywb23z4.js +0 -53
- package/dist/App.6thds120.js +0 -4
- package/dist/App.9tctxzqm.js +0 -8
- package/dist/App.a8r8ttaz.js +0 -4
- package/dist/App.agsv5bje.js +0 -4
- package/dist/App.cepapqmx.js +0 -4
- package/dist/App.dp041gb3.js +0 -221
- package/dist/App.fds72zb5.js +0 -4
- package/dist/App.fg9qj2dq.js +0 -4
- package/dist/App.ndfejbm9.js +0 -4
- package/dist/App.nxmfmq1h.js +0 -13
- package/dist/App.qdfyt8ba.js +0 -4
- package/dist/App.x2d0ygt6.js +0 -4
- package/dist/App.yt9p4nr3.js +0 -20
- package/dist/App.zn4mw16t.js +0 -1
- package/dist/ConnectionsPage.8r96ryw7.js +0 -3
- package/dist/McpPage.3cwh0gnd.js +0 -3
- package/dist/SettingsPage.ykgdh5ev.js +0 -3
- package/dist/SkillsPage.4np1s65b.js +0 -3
- package/dist/TasksPage.4g08t7p6.js +0 -3
- package/dist/TelemetryPage.72w9pwcp.js +0 -3
- package/dist/TestsPage.z4fk3r7r.js +0 -3
- package/dist/ThreadsPage.63tcajeh.js +0 -3
- package/dist/apteva-kit.css +0 -1
- package/dist/icon.png +0 -0
- package/dist/index.html +0 -16
- package/dist/styles.css +0 -1
- package/scripts/postinstall.mjs +0 -102
- package/src/auth/index.ts +0 -394
- package/src/auth/middleware.ts +0 -213
- package/src/binary.ts +0 -536
- package/src/channels/index.ts +0 -40
- package/src/channels/telegram.ts +0 -311
- package/src/crypto.ts +0 -301
- package/src/db-tests.ts +0 -174
- package/src/db.ts +0 -3133
- package/src/integrations/agentdojo.ts +0 -559
- package/src/integrations/composio.ts +0 -437
- package/src/integrations/index.ts +0 -87
- package/src/integrations/skillsmp.ts +0 -318
- package/src/mcp-client.ts +0 -605
- package/src/mcp-handler.ts +0 -394
- package/src/mcp-platform.ts +0 -2370
- package/src/openapi.ts +0 -2410
- package/src/providers.ts +0 -597
- package/src/routes/api/agent-utils.ts +0 -890
- package/src/routes/api/agents.ts +0 -916
- package/src/routes/api/api-keys.ts +0 -95
- package/src/routes/api/channels.ts +0 -182
- package/src/routes/api/helpers.ts +0 -12
- package/src/routes/api/integrations.ts +0 -639
- package/src/routes/api/mcp.ts +0 -574
- package/src/routes/api/meta-agent.ts +0 -195
- package/src/routes/api/projects.ts +0 -112
- package/src/routes/api/providers.ts +0 -424
- package/src/routes/api/skills.ts +0 -537
- package/src/routes/api/system.ts +0 -333
- package/src/routes/api/telemetry.ts +0 -203
- package/src/routes/api/tests.ts +0 -148
- package/src/routes/api/triggers.ts +0 -518
- package/src/routes/api/users.ts +0 -148
- package/src/routes/api/webhooks.ts +0 -171
- package/src/routes/api.ts +0 -53
- package/src/routes/auth.ts +0 -251
- package/src/routes/share.ts +0 -86
- package/src/routes/static.ts +0 -131
- package/src/server.ts +0 -642
- package/src/test-runner.ts +0 -598
- package/src/triggers/agentdojo.ts +0 -253
- package/src/triggers/composio.ts +0 -264
- package/src/triggers/index.ts +0 -71
- package/src/tui/AgentList.tsx +0 -145
- package/src/tui/App.tsx +0 -102
- package/src/tui/Login.tsx +0 -104
- package/src/tui/api.ts +0 -72
- package/src/tui/index.tsx +0 -7
- package/src/web/App.tsx +0 -455
- package/src/web/components/activity/ActivityPage.tsx +0 -314
- package/src/web/components/activity/index.ts +0 -1
- package/src/web/components/agents/AgentCard.tsx +0 -189
- package/src/web/components/agents/AgentPanel.tsx +0 -2244
- package/src/web/components/agents/AgentsView.tsx +0 -180
- package/src/web/components/agents/CreateAgentModal.tsx +0 -475
- package/src/web/components/agents/index.ts +0 -4
- package/src/web/components/api/ApiDocsPage.tsx +0 -842
- package/src/web/components/auth/CreateAccountStep.tsx +0 -176
- package/src/web/components/auth/LoginPage.tsx +0 -91
- package/src/web/components/auth/index.ts +0 -2
- package/src/web/components/common/Icons.tsx +0 -250
- package/src/web/components/common/LoadingSpinner.tsx +0 -44
- package/src/web/components/common/Modal.tsx +0 -199
- package/src/web/components/common/Select.tsx +0 -97
- package/src/web/components/common/index.ts +0 -20
- package/src/web/components/connections/ConnectionsPage.tsx +0 -54
- package/src/web/components/connections/IntegrationsTab.tsx +0 -170
- package/src/web/components/connections/OverviewTab.tsx +0 -137
- package/src/web/components/connections/TriggersTab.tsx +0 -1346
- package/src/web/components/dashboard/Dashboard.tsx +0 -572
- package/src/web/components/dashboard/index.ts +0 -1
- package/src/web/components/index.ts +0 -21
- package/src/web/components/layout/ErrorBanner.tsx +0 -18
- package/src/web/components/layout/Header.tsx +0 -332
- package/src/web/components/layout/Sidebar.tsx +0 -231
- package/src/web/components/layout/index.ts +0 -3
- package/src/web/components/mcp/IntegrationsPanel.tsx +0 -857
- package/src/web/components/mcp/McpPage.tsx +0 -2515
- package/src/web/components/mcp/index.ts +0 -1
- package/src/web/components/meta-agent/MetaAgent.tsx +0 -245
- package/src/web/components/onboarding/OnboardingWizard.tsx +0 -404
- package/src/web/components/onboarding/index.ts +0 -1
- package/src/web/components/settings/SettingsPage.tsx +0 -2776
- package/src/web/components/settings/index.ts +0 -1
- package/src/web/components/skills/SkillsPage.tsx +0 -1200
- package/src/web/components/tasks/TasksPage.tsx +0 -1116
- package/src/web/components/tasks/index.ts +0 -1
- package/src/web/components/telemetry/TelemetryPage.tsx +0 -1129
- package/src/web/components/tests/TestsPage.tsx +0 -594
- package/src/web/components/threads/ThreadsPage.tsx +0 -315
- package/src/web/context/AuthContext.tsx +0 -242
- package/src/web/context/ProjectContext.tsx +0 -214
- package/src/web/context/TelemetryContext.tsx +0 -299
- package/src/web/context/ThemeContext.tsx +0 -90
- package/src/web/context/UIModeContext.tsx +0 -49
- package/src/web/context/index.ts +0 -12
- package/src/web/hooks/index.ts +0 -3
- package/src/web/hooks/useAgents.ts +0 -115
- package/src/web/hooks/useOnboarding.ts +0 -20
- package/src/web/hooks/useProviders.ts +0 -75
- package/src/web/icon.png +0 -0
- package/src/web/index.html +0 -16
- package/src/web/styles.css +0 -118
- package/src/web/themes.ts +0 -162
- package/src/web/types.ts +0 -298
package/src/openapi.ts
DELETED
|
@@ -1,2410 +0,0 @@
|
|
|
1
|
-
// OpenAPI 3.0 Specification for Apteva API
|
|
2
|
-
|
|
3
|
-
export const openApiSpec = {
|
|
4
|
-
openapi: "3.0.3",
|
|
5
|
-
info: {
|
|
6
|
-
title: "Apteva API",
|
|
7
|
-
description: `API for managing AI agents, MCP servers, and related resources.
|
|
8
|
-
|
|
9
|
-
## Authentication
|
|
10
|
-
|
|
11
|
-
All endpoints (except /health, /version, and /auth/*) require JWT authentication.
|
|
12
|
-
|
|
13
|
-
### Getting a Token
|
|
14
|
-
|
|
15
|
-
\`\`\`bash
|
|
16
|
-
curl -X POST /api/auth/login \\
|
|
17
|
-
-H "Content-Type: application/json" \\
|
|
18
|
-
-d '{"username": "admin", "password": "yourpassword"}'
|
|
19
|
-
\`\`\`
|
|
20
|
-
|
|
21
|
-
Response (refresh token set as httpOnly cookie):
|
|
22
|
-
\`\`\`json
|
|
23
|
-
{
|
|
24
|
-
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
|
|
25
|
-
"expiresIn": 900,
|
|
26
|
-
"user": { "id": "...", "username": "admin", "role": "admin" }
|
|
27
|
-
}
|
|
28
|
-
\`\`\`
|
|
29
|
-
|
|
30
|
-
### Using the Token
|
|
31
|
-
|
|
32
|
-
Include the access token in the Authorization header:
|
|
33
|
-
|
|
34
|
-
\`\`\`bash
|
|
35
|
-
curl /api/agents \\
|
|
36
|
-
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
|
|
37
|
-
\`\`\`
|
|
38
|
-
|
|
39
|
-
### Token Refresh
|
|
40
|
-
|
|
41
|
-
Access tokens expire after 15 minutes. The refresh token is stored as an httpOnly cookie, so just call:
|
|
42
|
-
|
|
43
|
-
\`\`\`bash
|
|
44
|
-
curl -X POST /api/auth/refresh
|
|
45
|
-
\`\`\`
|
|
46
|
-
|
|
47
|
-
The new access token will be returned and a new refresh token cookie will be set.
|
|
48
|
-
`,
|
|
49
|
-
version: "0.2.8",
|
|
50
|
-
contact: {
|
|
51
|
-
name: "Apteva",
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
servers: [
|
|
55
|
-
{
|
|
56
|
-
url: "/api",
|
|
57
|
-
description: "Apteva API",
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
tags: [
|
|
61
|
-
{ name: "Auth", description: "Authentication endpoints" },
|
|
62
|
-
{ name: "Agents", description: "AI Agent management" },
|
|
63
|
-
{ name: "Chat", description: "Agent conversations" },
|
|
64
|
-
{ name: "Threads", description: "Conversation threads" },
|
|
65
|
-
{ name: "Memory", description: "Agent memory/knowledge" },
|
|
66
|
-
{ name: "Files", description: "Agent file management" },
|
|
67
|
-
{ name: "Tasks", description: "Scheduled tasks" },
|
|
68
|
-
{ name: "Telemetry", description: "Agent telemetry and usage tracking" },
|
|
69
|
-
{ name: "MCP", description: "Model Context Protocol servers" },
|
|
70
|
-
{ name: "Providers", description: "LLM providers and API keys" },
|
|
71
|
-
{ name: "Projects", description: "Agent grouping" },
|
|
72
|
-
{ name: "Skills", description: "Agent skills management" },
|
|
73
|
-
{ name: "System", description: "Health and version info" },
|
|
74
|
-
],
|
|
75
|
-
security: [{ BearerAuth: [] }],
|
|
76
|
-
paths: {
|
|
77
|
-
"/auth/login": {
|
|
78
|
-
post: {
|
|
79
|
-
tags: ["Auth"],
|
|
80
|
-
summary: "Login and get access token",
|
|
81
|
-
security: [],
|
|
82
|
-
requestBody: {
|
|
83
|
-
required: true,
|
|
84
|
-
content: {
|
|
85
|
-
"application/json": {
|
|
86
|
-
schema: { $ref: "#/components/schemas/LoginRequest" },
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
responses: {
|
|
91
|
-
"200": {
|
|
92
|
-
description: "Login successful",
|
|
93
|
-
content: {
|
|
94
|
-
"application/json": {
|
|
95
|
-
schema: { $ref: "#/components/schemas/LoginResponse" },
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
"401": { description: "Invalid credentials" },
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
"/auth/refresh": {
|
|
104
|
-
post: {
|
|
105
|
-
tags: ["Auth"],
|
|
106
|
-
summary: "Refresh access token",
|
|
107
|
-
description: "Refresh token is read from httpOnly cookie (set during login). No request body needed.",
|
|
108
|
-
security: [],
|
|
109
|
-
responses: {
|
|
110
|
-
"200": {
|
|
111
|
-
description: "Token refreshed. New refresh token set as httpOnly cookie.",
|
|
112
|
-
content: {
|
|
113
|
-
"application/json": {
|
|
114
|
-
schema: { $ref: "#/components/schemas/RefreshResponse" },
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
"401": { description: "Invalid or expired refresh token" },
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
"/auth/logout": {
|
|
123
|
-
post: {
|
|
124
|
-
tags: ["Auth"],
|
|
125
|
-
summary: "Logout and invalidate tokens",
|
|
126
|
-
responses: {
|
|
127
|
-
"200": { description: "Logged out successfully" },
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
"/health": {
|
|
132
|
-
get: {
|
|
133
|
-
tags: ["System"],
|
|
134
|
-
summary: "Health check",
|
|
135
|
-
security: [],
|
|
136
|
-
responses: {
|
|
137
|
-
"200": {
|
|
138
|
-
description: "Service is healthy",
|
|
139
|
-
content: {
|
|
140
|
-
"application/json": {
|
|
141
|
-
schema: { $ref: "#/components/schemas/HealthResponse" },
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
"/version": {
|
|
149
|
-
get: {
|
|
150
|
-
tags: ["System"],
|
|
151
|
-
summary: "Get version info",
|
|
152
|
-
security: [],
|
|
153
|
-
responses: {
|
|
154
|
-
"200": {
|
|
155
|
-
description: "Version information",
|
|
156
|
-
content: {
|
|
157
|
-
"application/json": {
|
|
158
|
-
schema: { $ref: "#/components/schemas/VersionResponse" },
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
"/version/update": {
|
|
166
|
-
post: {
|
|
167
|
-
tags: ["System"],
|
|
168
|
-
summary: "Update agent binary",
|
|
169
|
-
description: "Downloads the latest agent binary. Stops all running agents, updates, then restarts them.",
|
|
170
|
-
responses: {
|
|
171
|
-
"200": {
|
|
172
|
-
description: "Update result",
|
|
173
|
-
content: {
|
|
174
|
-
"application/json": {
|
|
175
|
-
schema: {
|
|
176
|
-
type: "object",
|
|
177
|
-
properties: {
|
|
178
|
-
success: { type: "boolean" },
|
|
179
|
-
version: { type: "string" },
|
|
180
|
-
restarted: {
|
|
181
|
-
type: "array",
|
|
182
|
-
items: {
|
|
183
|
-
type: "object",
|
|
184
|
-
properties: {
|
|
185
|
-
id: { type: "string" },
|
|
186
|
-
name: { type: "string" },
|
|
187
|
-
success: { type: "boolean" },
|
|
188
|
-
error: { type: "string", nullable: true },
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
"500": { description: "Update failed" },
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
"/features": {
|
|
202
|
-
get: {
|
|
203
|
-
tags: ["System"],
|
|
204
|
-
summary: "Get feature flags",
|
|
205
|
-
security: [],
|
|
206
|
-
responses: {
|
|
207
|
-
"200": {
|
|
208
|
-
description: "Feature flags",
|
|
209
|
-
content: {
|
|
210
|
-
"application/json": {
|
|
211
|
-
schema: {
|
|
212
|
-
type: "object",
|
|
213
|
-
properties: {
|
|
214
|
-
projects: { type: "boolean" },
|
|
215
|
-
metaAgent: { type: "boolean" },
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
"/stats": {
|
|
225
|
-
get: {
|
|
226
|
-
tags: ["System"],
|
|
227
|
-
summary: "Get agent statistics",
|
|
228
|
-
responses: {
|
|
229
|
-
"200": {
|
|
230
|
-
description: "Agent statistics",
|
|
231
|
-
content: {
|
|
232
|
-
"application/json": {
|
|
233
|
-
schema: {
|
|
234
|
-
type: "object",
|
|
235
|
-
properties: {
|
|
236
|
-
totalAgents: { type: "integer" },
|
|
237
|
-
runningAgents: { type: "integer" },
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
"/binary": {
|
|
247
|
-
get: {
|
|
248
|
-
tags: ["System"],
|
|
249
|
-
summary: "Get binary status",
|
|
250
|
-
responses: {
|
|
251
|
-
"200": {
|
|
252
|
-
description: "Binary availability info",
|
|
253
|
-
content: {
|
|
254
|
-
"application/json": {
|
|
255
|
-
schema: {
|
|
256
|
-
type: "object",
|
|
257
|
-
properties: {
|
|
258
|
-
exists: { type: "boolean" },
|
|
259
|
-
platform: { type: "string" },
|
|
260
|
-
arch: { type: "string" },
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
},
|
|
267
|
-
},
|
|
268
|
-
},
|
|
269
|
-
"/dashboard": {
|
|
270
|
-
get: {
|
|
271
|
-
tags: ["System"],
|
|
272
|
-
summary: "Get dashboard statistics",
|
|
273
|
-
responses: {
|
|
274
|
-
"200": {
|
|
275
|
-
description: "Dashboard stats",
|
|
276
|
-
content: {
|
|
277
|
-
"application/json": {
|
|
278
|
-
schema: { $ref: "#/components/schemas/DashboardStats" },
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
"/agents": {
|
|
286
|
-
get: {
|
|
287
|
-
tags: ["Agents"],
|
|
288
|
-
summary: "List all agents",
|
|
289
|
-
responses: {
|
|
290
|
-
"200": {
|
|
291
|
-
description: "List of agents",
|
|
292
|
-
content: {
|
|
293
|
-
"application/json": {
|
|
294
|
-
schema: { $ref: "#/components/schemas/AgentListResponse" },
|
|
295
|
-
},
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
post: {
|
|
301
|
-
tags: ["Agents"],
|
|
302
|
-
summary: "Create a new agent",
|
|
303
|
-
requestBody: {
|
|
304
|
-
required: true,
|
|
305
|
-
content: {
|
|
306
|
-
"application/json": {
|
|
307
|
-
schema: { $ref: "#/components/schemas/CreateAgent" },
|
|
308
|
-
},
|
|
309
|
-
},
|
|
310
|
-
},
|
|
311
|
-
responses: {
|
|
312
|
-
"201": {
|
|
313
|
-
description: "Agent created",
|
|
314
|
-
content: {
|
|
315
|
-
"application/json": {
|
|
316
|
-
schema: { $ref: "#/components/schemas/AgentResponse" },
|
|
317
|
-
},
|
|
318
|
-
},
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
"/agents/{agentId}": {
|
|
324
|
-
get: {
|
|
325
|
-
tags: ["Agents"],
|
|
326
|
-
summary: "Get agent by ID",
|
|
327
|
-
parameters: [
|
|
328
|
-
{
|
|
329
|
-
name: "agentId",
|
|
330
|
-
in: "path",
|
|
331
|
-
required: true,
|
|
332
|
-
schema: { type: "string" },
|
|
333
|
-
},
|
|
334
|
-
],
|
|
335
|
-
responses: {
|
|
336
|
-
"200": {
|
|
337
|
-
description: "Agent details",
|
|
338
|
-
content: {
|
|
339
|
-
"application/json": {
|
|
340
|
-
schema: { $ref: "#/components/schemas/AgentResponse" },
|
|
341
|
-
},
|
|
342
|
-
},
|
|
343
|
-
},
|
|
344
|
-
"404": { description: "Agent not found" },
|
|
345
|
-
},
|
|
346
|
-
},
|
|
347
|
-
put: {
|
|
348
|
-
tags: ["Agents"],
|
|
349
|
-
summary: "Update agent",
|
|
350
|
-
parameters: [
|
|
351
|
-
{
|
|
352
|
-
name: "agentId",
|
|
353
|
-
in: "path",
|
|
354
|
-
required: true,
|
|
355
|
-
schema: { type: "string" },
|
|
356
|
-
},
|
|
357
|
-
],
|
|
358
|
-
requestBody: {
|
|
359
|
-
required: true,
|
|
360
|
-
content: {
|
|
361
|
-
"application/json": {
|
|
362
|
-
schema: { $ref: "#/components/schemas/UpdateAgent" },
|
|
363
|
-
},
|
|
364
|
-
},
|
|
365
|
-
},
|
|
366
|
-
responses: {
|
|
367
|
-
"200": {
|
|
368
|
-
description: "Agent updated",
|
|
369
|
-
content: {
|
|
370
|
-
"application/json": {
|
|
371
|
-
schema: { $ref: "#/components/schemas/AgentResponse" },
|
|
372
|
-
},
|
|
373
|
-
},
|
|
374
|
-
},
|
|
375
|
-
},
|
|
376
|
-
},
|
|
377
|
-
delete: {
|
|
378
|
-
tags: ["Agents"],
|
|
379
|
-
summary: "Delete agent",
|
|
380
|
-
parameters: [
|
|
381
|
-
{
|
|
382
|
-
name: "agentId",
|
|
383
|
-
in: "path",
|
|
384
|
-
required: true,
|
|
385
|
-
schema: { type: "string" },
|
|
386
|
-
},
|
|
387
|
-
],
|
|
388
|
-
responses: {
|
|
389
|
-
"200": { description: "Agent deleted" },
|
|
390
|
-
},
|
|
391
|
-
},
|
|
392
|
-
},
|
|
393
|
-
"/agents/{agentId}/start": {
|
|
394
|
-
post: {
|
|
395
|
-
tags: ["Agents"],
|
|
396
|
-
summary: "Start an agent",
|
|
397
|
-
parameters: [
|
|
398
|
-
{
|
|
399
|
-
name: "agentId",
|
|
400
|
-
in: "path",
|
|
401
|
-
required: true,
|
|
402
|
-
schema: { type: "string" },
|
|
403
|
-
},
|
|
404
|
-
],
|
|
405
|
-
responses: {
|
|
406
|
-
"200": {
|
|
407
|
-
description: "Agent started",
|
|
408
|
-
content: {
|
|
409
|
-
"application/json": {
|
|
410
|
-
schema: {
|
|
411
|
-
type: "object",
|
|
412
|
-
properties: {
|
|
413
|
-
success: { type: "boolean" },
|
|
414
|
-
port: { type: "integer" },
|
|
415
|
-
},
|
|
416
|
-
},
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
},
|
|
421
|
-
},
|
|
422
|
-
},
|
|
423
|
-
"/agents/{agentId}/stop": {
|
|
424
|
-
post: {
|
|
425
|
-
tags: ["Agents"],
|
|
426
|
-
summary: "Stop an agent",
|
|
427
|
-
parameters: [
|
|
428
|
-
{
|
|
429
|
-
name: "agentId",
|
|
430
|
-
in: "path",
|
|
431
|
-
required: true,
|
|
432
|
-
schema: { type: "string" },
|
|
433
|
-
},
|
|
434
|
-
],
|
|
435
|
-
responses: {
|
|
436
|
-
"200": {
|
|
437
|
-
description: "Agent stopped",
|
|
438
|
-
content: {
|
|
439
|
-
"application/json": {
|
|
440
|
-
schema: {
|
|
441
|
-
type: "object",
|
|
442
|
-
properties: {
|
|
443
|
-
success: { type: "boolean" },
|
|
444
|
-
},
|
|
445
|
-
},
|
|
446
|
-
},
|
|
447
|
-
},
|
|
448
|
-
},
|
|
449
|
-
},
|
|
450
|
-
},
|
|
451
|
-
},
|
|
452
|
-
"/agents/{agentId}/chat": {
|
|
453
|
-
post: {
|
|
454
|
-
tags: ["Chat"],
|
|
455
|
-
summary: "Send a message to an agent",
|
|
456
|
-
description: `Proxies the chat request to the running agent and streams the response.
|
|
457
|
-
|
|
458
|
-
**Requirements:**
|
|
459
|
-
- Agent must be running (status: "running")
|
|
460
|
-
- Agent must have an assigned port
|
|
461
|
-
|
|
462
|
-
**Response Format:**
|
|
463
|
-
The response is streamed as Server-Sent Events (SSE) or newline-delimited JSON.
|
|
464
|
-
|
|
465
|
-
**Event Types:**
|
|
466
|
-
- \`content\` - Text content from the agent
|
|
467
|
-
- \`tool_call\` - Agent is calling a tool
|
|
468
|
-
- \`tool_result\` - Result from a tool call
|
|
469
|
-
- \`done\` - Response complete
|
|
470
|
-
- \`error\` - Error occurred
|
|
471
|
-
|
|
472
|
-
**Example:**
|
|
473
|
-
\`\`\`javascript
|
|
474
|
-
const response = await fetch('/api/agents/{id}/chat', {
|
|
475
|
-
method: 'POST',
|
|
476
|
-
headers: { 'Content-Type': 'application/json' },
|
|
477
|
-
body: JSON.stringify({ message: 'Hello!' })
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
const reader = response.body.getReader();
|
|
481
|
-
while (true) {
|
|
482
|
-
const { done, value } = await reader.read();
|
|
483
|
-
if (done) break;
|
|
484
|
-
// Process streaming chunks
|
|
485
|
-
}
|
|
486
|
-
\`\`\``,
|
|
487
|
-
parameters: [
|
|
488
|
-
{
|
|
489
|
-
name: "agentId",
|
|
490
|
-
in: "path",
|
|
491
|
-
required: true,
|
|
492
|
-
schema: { type: "string" },
|
|
493
|
-
description: "The agent's unique ID",
|
|
494
|
-
},
|
|
495
|
-
],
|
|
496
|
-
requestBody: {
|
|
497
|
-
required: true,
|
|
498
|
-
content: {
|
|
499
|
-
"application/json": {
|
|
500
|
-
schema: {
|
|
501
|
-
type: "object",
|
|
502
|
-
required: ["message"],
|
|
503
|
-
properties: {
|
|
504
|
-
message: { type: "string", description: "The user's message to send to the agent" },
|
|
505
|
-
threadId: { type: "string", description: "Optional thread ID for conversation context. If omitted, uses default thread." },
|
|
506
|
-
images: {
|
|
507
|
-
type: "array",
|
|
508
|
-
items: { type: "string" },
|
|
509
|
-
description: "Optional array of image URLs or base64 data (requires vision feature)",
|
|
510
|
-
},
|
|
511
|
-
},
|
|
512
|
-
},
|
|
513
|
-
example: {
|
|
514
|
-
message: "What can you help me with?",
|
|
515
|
-
threadId: "thread_abc123",
|
|
516
|
-
},
|
|
517
|
-
},
|
|
518
|
-
},
|
|
519
|
-
},
|
|
520
|
-
responses: {
|
|
521
|
-
"200": {
|
|
522
|
-
description: "Streaming response from the agent",
|
|
523
|
-
content: {
|
|
524
|
-
"text/event-stream": {
|
|
525
|
-
schema: {
|
|
526
|
-
type: "string",
|
|
527
|
-
description: "SSE stream with events: content, tool_call, tool_result, done, error",
|
|
528
|
-
},
|
|
529
|
-
},
|
|
530
|
-
},
|
|
531
|
-
},
|
|
532
|
-
"400": {
|
|
533
|
-
description: "Agent is not running",
|
|
534
|
-
content: {
|
|
535
|
-
"application/json": {
|
|
536
|
-
schema: {
|
|
537
|
-
type: "object",
|
|
538
|
-
properties: {
|
|
539
|
-
error: { type: "string", example: "Agent is not running" },
|
|
540
|
-
},
|
|
541
|
-
},
|
|
542
|
-
},
|
|
543
|
-
},
|
|
544
|
-
},
|
|
545
|
-
"404": {
|
|
546
|
-
description: "Agent not found",
|
|
547
|
-
content: {
|
|
548
|
-
"application/json": {
|
|
549
|
-
schema: {
|
|
550
|
-
type: "object",
|
|
551
|
-
properties: {
|
|
552
|
-
error: { type: "string", example: "Agent not found" },
|
|
553
|
-
},
|
|
554
|
-
},
|
|
555
|
-
},
|
|
556
|
-
},
|
|
557
|
-
},
|
|
558
|
-
},
|
|
559
|
-
},
|
|
560
|
-
},
|
|
561
|
-
"/agents/{agentId}/threads": {
|
|
562
|
-
get: {
|
|
563
|
-
tags: ["Threads"],
|
|
564
|
-
summary: "List agent threads",
|
|
565
|
-
parameters: [
|
|
566
|
-
{
|
|
567
|
-
name: "agentId",
|
|
568
|
-
in: "path",
|
|
569
|
-
required: true,
|
|
570
|
-
schema: { type: "string" },
|
|
571
|
-
},
|
|
572
|
-
],
|
|
573
|
-
responses: {
|
|
574
|
-
"200": {
|
|
575
|
-
description: "List of threads",
|
|
576
|
-
content: {
|
|
577
|
-
"application/json": {
|
|
578
|
-
schema: {
|
|
579
|
-
type: "array",
|
|
580
|
-
items: { $ref: "#/components/schemas/Thread" },
|
|
581
|
-
},
|
|
582
|
-
},
|
|
583
|
-
},
|
|
584
|
-
},
|
|
585
|
-
},
|
|
586
|
-
},
|
|
587
|
-
post: {
|
|
588
|
-
tags: ["Threads"],
|
|
589
|
-
summary: "Create a new thread",
|
|
590
|
-
parameters: [
|
|
591
|
-
{
|
|
592
|
-
name: "agentId",
|
|
593
|
-
in: "path",
|
|
594
|
-
required: true,
|
|
595
|
-
schema: { type: "string" },
|
|
596
|
-
},
|
|
597
|
-
],
|
|
598
|
-
requestBody: {
|
|
599
|
-
content: {
|
|
600
|
-
"application/json": {
|
|
601
|
-
schema: {
|
|
602
|
-
type: "object",
|
|
603
|
-
properties: {
|
|
604
|
-
title: { type: "string" },
|
|
605
|
-
},
|
|
606
|
-
},
|
|
607
|
-
},
|
|
608
|
-
},
|
|
609
|
-
},
|
|
610
|
-
responses: {
|
|
611
|
-
"201": {
|
|
612
|
-
description: "Thread created",
|
|
613
|
-
content: {
|
|
614
|
-
"application/json": {
|
|
615
|
-
schema: { $ref: "#/components/schemas/Thread" },
|
|
616
|
-
},
|
|
617
|
-
},
|
|
618
|
-
},
|
|
619
|
-
},
|
|
620
|
-
},
|
|
621
|
-
},
|
|
622
|
-
"/agents/{agentId}/threads/{threadId}": {
|
|
623
|
-
get: {
|
|
624
|
-
tags: ["Threads"],
|
|
625
|
-
summary: "Get thread details",
|
|
626
|
-
parameters: [
|
|
627
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
628
|
-
{ name: "threadId", in: "path", required: true, schema: { type: "string" } },
|
|
629
|
-
],
|
|
630
|
-
responses: {
|
|
631
|
-
"200": {
|
|
632
|
-
description: "Thread details with messages",
|
|
633
|
-
content: {
|
|
634
|
-
"application/json": {
|
|
635
|
-
schema: { $ref: "#/components/schemas/Thread" },
|
|
636
|
-
},
|
|
637
|
-
},
|
|
638
|
-
},
|
|
639
|
-
},
|
|
640
|
-
},
|
|
641
|
-
delete: {
|
|
642
|
-
tags: ["Threads"],
|
|
643
|
-
summary: "Delete a thread",
|
|
644
|
-
parameters: [
|
|
645
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
646
|
-
{ name: "threadId", in: "path", required: true, schema: { type: "string" } },
|
|
647
|
-
],
|
|
648
|
-
responses: {
|
|
649
|
-
"200": { description: "Thread deleted" },
|
|
650
|
-
},
|
|
651
|
-
},
|
|
652
|
-
},
|
|
653
|
-
"/agents/{agentId}/threads/{threadId}/messages": {
|
|
654
|
-
get: {
|
|
655
|
-
tags: ["Threads"],
|
|
656
|
-
summary: "List thread messages",
|
|
657
|
-
description: "Get all messages in a thread. Agent must be running.",
|
|
658
|
-
parameters: [
|
|
659
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
660
|
-
{ name: "threadId", in: "path", required: true, schema: { type: "string" } },
|
|
661
|
-
],
|
|
662
|
-
responses: {
|
|
663
|
-
"200": {
|
|
664
|
-
description: "List of messages",
|
|
665
|
-
content: {
|
|
666
|
-
"application/json": {
|
|
667
|
-
schema: {
|
|
668
|
-
type: "array",
|
|
669
|
-
items: { $ref: "#/components/schemas/Message" },
|
|
670
|
-
},
|
|
671
|
-
},
|
|
672
|
-
},
|
|
673
|
-
},
|
|
674
|
-
"400": { description: "Agent is not running" },
|
|
675
|
-
"404": { description: "Agent not found" },
|
|
676
|
-
},
|
|
677
|
-
},
|
|
678
|
-
},
|
|
679
|
-
"/agents/{agentId}/memories": {
|
|
680
|
-
get: {
|
|
681
|
-
tags: ["Memory"],
|
|
682
|
-
summary: "List agent memories",
|
|
683
|
-
parameters: [
|
|
684
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
685
|
-
{ name: "thread_id", in: "query", schema: { type: "string" }, description: "Filter memories by thread ID" },
|
|
686
|
-
],
|
|
687
|
-
responses: {
|
|
688
|
-
"200": {
|
|
689
|
-
description: "List of memories",
|
|
690
|
-
content: {
|
|
691
|
-
"application/json": {
|
|
692
|
-
schema: {
|
|
693
|
-
type: "array",
|
|
694
|
-
items: { $ref: "#/components/schemas/Memory" },
|
|
695
|
-
},
|
|
696
|
-
},
|
|
697
|
-
},
|
|
698
|
-
},
|
|
699
|
-
},
|
|
700
|
-
},
|
|
701
|
-
post: {
|
|
702
|
-
tags: ["Memory"],
|
|
703
|
-
summary: "Add a memory",
|
|
704
|
-
parameters: [
|
|
705
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
706
|
-
],
|
|
707
|
-
requestBody: {
|
|
708
|
-
required: true,
|
|
709
|
-
content: {
|
|
710
|
-
"application/json": {
|
|
711
|
-
schema: {
|
|
712
|
-
type: "object",
|
|
713
|
-
required: ["content"],
|
|
714
|
-
properties: {
|
|
715
|
-
content: { type: "string" },
|
|
716
|
-
type: { type: "string", enum: ["fact", "preference", "instruction"] },
|
|
717
|
-
},
|
|
718
|
-
},
|
|
719
|
-
},
|
|
720
|
-
},
|
|
721
|
-
},
|
|
722
|
-
responses: {
|
|
723
|
-
"201": { description: "Memory added" },
|
|
724
|
-
},
|
|
725
|
-
},
|
|
726
|
-
delete: {
|
|
727
|
-
tags: ["Memory"],
|
|
728
|
-
summary: "Clear all memories",
|
|
729
|
-
description: "Deletes all memories for the agent.",
|
|
730
|
-
parameters: [
|
|
731
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
732
|
-
],
|
|
733
|
-
responses: {
|
|
734
|
-
"200": { description: "All memories cleared" },
|
|
735
|
-
},
|
|
736
|
-
},
|
|
737
|
-
},
|
|
738
|
-
"/agents/{agentId}/memories/{memoryId}": {
|
|
739
|
-
delete: {
|
|
740
|
-
tags: ["Memory"],
|
|
741
|
-
summary: "Delete a memory",
|
|
742
|
-
parameters: [
|
|
743
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
744
|
-
{ name: "memoryId", in: "path", required: true, schema: { type: "string" } },
|
|
745
|
-
],
|
|
746
|
-
responses: {
|
|
747
|
-
"200": { description: "Memory deleted" },
|
|
748
|
-
},
|
|
749
|
-
},
|
|
750
|
-
},
|
|
751
|
-
"/agents/{agentId}/files": {
|
|
752
|
-
get: {
|
|
753
|
-
tags: ["Files"],
|
|
754
|
-
summary: "List agent files",
|
|
755
|
-
parameters: [
|
|
756
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
757
|
-
{ name: "thread_id", in: "query", schema: { type: "string" }, description: "Filter files by thread ID" },
|
|
758
|
-
{ name: "limit", in: "query", schema: { type: "integer" }, description: "Max files to return" },
|
|
759
|
-
],
|
|
760
|
-
responses: {
|
|
761
|
-
"200": {
|
|
762
|
-
description: "List of files",
|
|
763
|
-
content: {
|
|
764
|
-
"application/json": {
|
|
765
|
-
schema: {
|
|
766
|
-
type: "array",
|
|
767
|
-
items: { $ref: "#/components/schemas/File" },
|
|
768
|
-
},
|
|
769
|
-
},
|
|
770
|
-
},
|
|
771
|
-
},
|
|
772
|
-
},
|
|
773
|
-
},
|
|
774
|
-
post: {
|
|
775
|
-
tags: ["Files"],
|
|
776
|
-
summary: "Upload a file",
|
|
777
|
-
parameters: [
|
|
778
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
779
|
-
],
|
|
780
|
-
requestBody: {
|
|
781
|
-
required: true,
|
|
782
|
-
content: {
|
|
783
|
-
"multipart/form-data": {
|
|
784
|
-
schema: {
|
|
785
|
-
type: "object",
|
|
786
|
-
properties: {
|
|
787
|
-
file: { type: "string", format: "binary" },
|
|
788
|
-
},
|
|
789
|
-
},
|
|
790
|
-
},
|
|
791
|
-
},
|
|
792
|
-
},
|
|
793
|
-
responses: {
|
|
794
|
-
"201": { description: "File uploaded" },
|
|
795
|
-
},
|
|
796
|
-
},
|
|
797
|
-
},
|
|
798
|
-
"/agents/{agentId}/files/{fileId}": {
|
|
799
|
-
get: {
|
|
800
|
-
tags: ["Files"],
|
|
801
|
-
summary: "Get file metadata",
|
|
802
|
-
parameters: [
|
|
803
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
804
|
-
{ name: "fileId", in: "path", required: true, schema: { type: "string" } },
|
|
805
|
-
],
|
|
806
|
-
responses: {
|
|
807
|
-
"200": {
|
|
808
|
-
description: "File metadata",
|
|
809
|
-
content: {
|
|
810
|
-
"application/json": {
|
|
811
|
-
schema: { $ref: "#/components/schemas/File" },
|
|
812
|
-
},
|
|
813
|
-
},
|
|
814
|
-
},
|
|
815
|
-
},
|
|
816
|
-
},
|
|
817
|
-
delete: {
|
|
818
|
-
tags: ["Files"],
|
|
819
|
-
summary: "Delete a file",
|
|
820
|
-
parameters: [
|
|
821
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
822
|
-
{ name: "fileId", in: "path", required: true, schema: { type: "string" } },
|
|
823
|
-
],
|
|
824
|
-
responses: {
|
|
825
|
-
"200": { description: "File deleted" },
|
|
826
|
-
},
|
|
827
|
-
},
|
|
828
|
-
},
|
|
829
|
-
"/agents/{agentId}/files/{fileId}/download": {
|
|
830
|
-
get: {
|
|
831
|
-
tags: ["Files"],
|
|
832
|
-
summary: "Download a file",
|
|
833
|
-
parameters: [
|
|
834
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
835
|
-
{ name: "fileId", in: "path", required: true, schema: { type: "string" } },
|
|
836
|
-
],
|
|
837
|
-
responses: {
|
|
838
|
-
"200": {
|
|
839
|
-
description: "File content",
|
|
840
|
-
content: {
|
|
841
|
-
"application/octet-stream": {},
|
|
842
|
-
},
|
|
843
|
-
},
|
|
844
|
-
},
|
|
845
|
-
},
|
|
846
|
-
},
|
|
847
|
-
"/agents/{agentId}/tasks": {
|
|
848
|
-
get: {
|
|
849
|
-
tags: ["Tasks"],
|
|
850
|
-
summary: "List agent tasks",
|
|
851
|
-
parameters: [
|
|
852
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
853
|
-
{ name: "status", in: "query", schema: { type: "string", enum: ["all", "pending", "running", "completed", "failed", "cancelled"], default: "all" }, description: "Filter tasks by status" },
|
|
854
|
-
],
|
|
855
|
-
responses: {
|
|
856
|
-
"200": {
|
|
857
|
-
description: "List of tasks",
|
|
858
|
-
content: {
|
|
859
|
-
"application/json": {
|
|
860
|
-
schema: {
|
|
861
|
-
type: "array",
|
|
862
|
-
items: { $ref: "#/components/schemas/Task" },
|
|
863
|
-
},
|
|
864
|
-
},
|
|
865
|
-
},
|
|
866
|
-
},
|
|
867
|
-
},
|
|
868
|
-
},
|
|
869
|
-
},
|
|
870
|
-
"/agents/{agentId}/api-key": {
|
|
871
|
-
get: {
|
|
872
|
-
tags: ["Agents"],
|
|
873
|
-
summary: "Get agent API key (masked)",
|
|
874
|
-
description: "Returns the agent's API key with most characters masked for security.",
|
|
875
|
-
parameters: [
|
|
876
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
877
|
-
],
|
|
878
|
-
responses: {
|
|
879
|
-
"200": {
|
|
880
|
-
description: "Masked API key",
|
|
881
|
-
content: {
|
|
882
|
-
"application/json": {
|
|
883
|
-
schema: {
|
|
884
|
-
type: "object",
|
|
885
|
-
properties: {
|
|
886
|
-
apiKey: { type: "string", description: "Masked API key (first 8 chars + last 4)" },
|
|
887
|
-
hasKey: { type: "boolean" },
|
|
888
|
-
},
|
|
889
|
-
},
|
|
890
|
-
},
|
|
891
|
-
},
|
|
892
|
-
},
|
|
893
|
-
"404": { description: "Agent or key not found" },
|
|
894
|
-
},
|
|
895
|
-
},
|
|
896
|
-
post: {
|
|
897
|
-
tags: ["Agents"],
|
|
898
|
-
summary: "Regenerate agent API key",
|
|
899
|
-
description: "Generates a new API key for the agent. The full key is only shown once in the response.",
|
|
900
|
-
parameters: [
|
|
901
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
902
|
-
],
|
|
903
|
-
responses: {
|
|
904
|
-
"200": {
|
|
905
|
-
description: "New API key (only time full key is visible)",
|
|
906
|
-
content: {
|
|
907
|
-
"application/json": {
|
|
908
|
-
schema: {
|
|
909
|
-
type: "object",
|
|
910
|
-
properties: {
|
|
911
|
-
apiKey: { type: "string", description: "Full new API key" },
|
|
912
|
-
message: { type: "string" },
|
|
913
|
-
},
|
|
914
|
-
},
|
|
915
|
-
},
|
|
916
|
-
},
|
|
917
|
-
},
|
|
918
|
-
"404": { description: "Agent not found" },
|
|
919
|
-
},
|
|
920
|
-
},
|
|
921
|
-
},
|
|
922
|
-
"/agents/{agentId}/peers": {
|
|
923
|
-
get: {
|
|
924
|
-
tags: ["Agents"],
|
|
925
|
-
summary: "List peer agents (for multi-agent)",
|
|
926
|
-
parameters: [
|
|
927
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" } },
|
|
928
|
-
],
|
|
929
|
-
responses: {
|
|
930
|
-
"200": {
|
|
931
|
-
description: "List of peer agents",
|
|
932
|
-
content: {
|
|
933
|
-
"application/json": {
|
|
934
|
-
schema: {
|
|
935
|
-
type: "array",
|
|
936
|
-
items: { $ref: "#/components/schemas/Agent" },
|
|
937
|
-
},
|
|
938
|
-
},
|
|
939
|
-
},
|
|
940
|
-
},
|
|
941
|
-
},
|
|
942
|
-
},
|
|
943
|
-
},
|
|
944
|
-
"/discovery/agents": {
|
|
945
|
-
get: {
|
|
946
|
-
tags: ["Agents"],
|
|
947
|
-
summary: "Central agent discovery",
|
|
948
|
-
description: "Discovery endpoint for agents to find running peers in the same group.",
|
|
949
|
-
parameters: [
|
|
950
|
-
{ name: "group", in: "query", schema: { type: "string" }, description: "Filter by agent group" },
|
|
951
|
-
{ name: "exclude", in: "query", schema: { type: "string" }, description: "Agent ID to exclude from results" },
|
|
952
|
-
],
|
|
953
|
-
responses: {
|
|
954
|
-
"200": {
|
|
955
|
-
description: "List of discoverable agents",
|
|
956
|
-
content: {
|
|
957
|
-
"application/json": {
|
|
958
|
-
schema: {
|
|
959
|
-
type: "object",
|
|
960
|
-
properties: {
|
|
961
|
-
agents: {
|
|
962
|
-
type: "array",
|
|
963
|
-
items: {
|
|
964
|
-
type: "object",
|
|
965
|
-
properties: {
|
|
966
|
-
id: { type: "string" },
|
|
967
|
-
name: { type: "string" },
|
|
968
|
-
url: { type: "string" },
|
|
969
|
-
mode: { type: "string" },
|
|
970
|
-
group: { type: "string", nullable: true },
|
|
971
|
-
},
|
|
972
|
-
},
|
|
973
|
-
},
|
|
974
|
-
},
|
|
975
|
-
},
|
|
976
|
-
},
|
|
977
|
-
},
|
|
978
|
-
},
|
|
979
|
-
},
|
|
980
|
-
},
|
|
981
|
-
},
|
|
982
|
-
"/tasks": {
|
|
983
|
-
get: {
|
|
984
|
-
tags: ["Tasks"],
|
|
985
|
-
summary: "List all tasks",
|
|
986
|
-
description: "Fetches tasks from all running agents. Supports filtering by status and project.",
|
|
987
|
-
parameters: [
|
|
988
|
-
{ name: "status", in: "query", schema: { type: "string", enum: ["all", "pending", "running", "completed", "failed", "cancelled"], default: "all" }, description: "Filter tasks by status" },
|
|
989
|
-
{ name: "project_id", in: "query", schema: { type: "string" }, description: "Filter by project ID. Use 'unassigned' for agents without a project." },
|
|
990
|
-
],
|
|
991
|
-
responses: {
|
|
992
|
-
"200": {
|
|
993
|
-
description: "List of tasks",
|
|
994
|
-
content: {
|
|
995
|
-
"application/json": {
|
|
996
|
-
schema: {
|
|
997
|
-
type: "object",
|
|
998
|
-
properties: {
|
|
999
|
-
tasks: { type: "array", items: { $ref: "#/components/schemas/Task" } },
|
|
1000
|
-
count: { type: "integer" },
|
|
1001
|
-
},
|
|
1002
|
-
},
|
|
1003
|
-
},
|
|
1004
|
-
},
|
|
1005
|
-
},
|
|
1006
|
-
},
|
|
1007
|
-
},
|
|
1008
|
-
},
|
|
1009
|
-
"/tasks/{agentId}": {
|
|
1010
|
-
post: {
|
|
1011
|
-
tags: ["Tasks"],
|
|
1012
|
-
summary: "Create a task on an agent",
|
|
1013
|
-
description: "Create a new task on a running agent. The agent must have the tasks feature enabled.",
|
|
1014
|
-
parameters: [
|
|
1015
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" }, description: "Agent ID to create the task on" },
|
|
1016
|
-
],
|
|
1017
|
-
requestBody: {
|
|
1018
|
-
required: true,
|
|
1019
|
-
content: {
|
|
1020
|
-
"application/json": {
|
|
1021
|
-
schema: {
|
|
1022
|
-
type: "object",
|
|
1023
|
-
properties: {
|
|
1024
|
-
title: { type: "string", description: "Task title" },
|
|
1025
|
-
description: { type: "string", description: "Task description" },
|
|
1026
|
-
type: { type: "string", enum: ["once", "recurring"], default: "once" },
|
|
1027
|
-
priority: { type: "integer", minimum: 1, maximum: 10, default: 5 },
|
|
1028
|
-
execute_at: { type: "string", format: "date-time", description: "Scheduled execution time (for one-time tasks)" },
|
|
1029
|
-
recurrence: { type: "string", description: "Cron expression (for recurring tasks)" },
|
|
1030
|
-
},
|
|
1031
|
-
required: ["title"],
|
|
1032
|
-
},
|
|
1033
|
-
},
|
|
1034
|
-
},
|
|
1035
|
-
},
|
|
1036
|
-
responses: {
|
|
1037
|
-
"201": { description: "Task created successfully" },
|
|
1038
|
-
"400": { description: "Agent is not running or invalid input" },
|
|
1039
|
-
"404": { description: "Agent not found" },
|
|
1040
|
-
},
|
|
1041
|
-
},
|
|
1042
|
-
},
|
|
1043
|
-
"/tasks/{agentId}/{taskId}": {
|
|
1044
|
-
get: {
|
|
1045
|
-
tags: ["Tasks"],
|
|
1046
|
-
summary: "Get a single task",
|
|
1047
|
-
description: "Get full details for a specific task from a specific agent, including execution trajectory.",
|
|
1048
|
-
parameters: [
|
|
1049
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" }, description: "Agent ID that owns the task" },
|
|
1050
|
-
{ name: "taskId", in: "path", required: true, schema: { type: "string" }, description: "Task ID" },
|
|
1051
|
-
],
|
|
1052
|
-
responses: {
|
|
1053
|
-
"200": {
|
|
1054
|
-
description: "Task details with trajectory",
|
|
1055
|
-
content: {
|
|
1056
|
-
"application/json": {
|
|
1057
|
-
schema: {
|
|
1058
|
-
type: "object",
|
|
1059
|
-
properties: {
|
|
1060
|
-
task: { $ref: "#/components/schemas/TaskDetail" },
|
|
1061
|
-
},
|
|
1062
|
-
},
|
|
1063
|
-
},
|
|
1064
|
-
},
|
|
1065
|
-
},
|
|
1066
|
-
"400": { description: "Agent is not running" },
|
|
1067
|
-
"404": { description: "Agent not found" },
|
|
1068
|
-
},
|
|
1069
|
-
},
|
|
1070
|
-
put: {
|
|
1071
|
-
tags: ["Tasks"],
|
|
1072
|
-
summary: "Update a task on an agent",
|
|
1073
|
-
description: "Update an existing task on a running agent.",
|
|
1074
|
-
parameters: [
|
|
1075
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" }, description: "Agent ID" },
|
|
1076
|
-
{ name: "taskId", in: "path", required: true, schema: { type: "string" }, description: "Task ID to update" },
|
|
1077
|
-
],
|
|
1078
|
-
requestBody: {
|
|
1079
|
-
required: true,
|
|
1080
|
-
content: {
|
|
1081
|
-
"application/json": {
|
|
1082
|
-
schema: {
|
|
1083
|
-
type: "object",
|
|
1084
|
-
properties: {
|
|
1085
|
-
title: { type: "string" },
|
|
1086
|
-
description: { type: "string" },
|
|
1087
|
-
type: { type: "string", enum: ["once", "recurring"] },
|
|
1088
|
-
priority: { type: "integer", minimum: 1, maximum: 10 },
|
|
1089
|
-
execute_at: { type: "string", format: "date-time" },
|
|
1090
|
-
recurrence: { type: "string" },
|
|
1091
|
-
},
|
|
1092
|
-
},
|
|
1093
|
-
},
|
|
1094
|
-
},
|
|
1095
|
-
},
|
|
1096
|
-
responses: {
|
|
1097
|
-
"200": { description: "Task updated" },
|
|
1098
|
-
"400": { description: "Agent is not running or invalid input" },
|
|
1099
|
-
"404": { description: "Agent or task not found" },
|
|
1100
|
-
},
|
|
1101
|
-
},
|
|
1102
|
-
delete: {
|
|
1103
|
-
tags: ["Tasks"],
|
|
1104
|
-
summary: "Delete a task on an agent",
|
|
1105
|
-
description: "Delete a task from a running agent.",
|
|
1106
|
-
parameters: [
|
|
1107
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" }, description: "Agent ID" },
|
|
1108
|
-
{ name: "taskId", in: "path", required: true, schema: { type: "string" }, description: "Task ID to delete" },
|
|
1109
|
-
],
|
|
1110
|
-
responses: {
|
|
1111
|
-
"200": { description: "Task deleted" },
|
|
1112
|
-
"400": { description: "Agent is not running" },
|
|
1113
|
-
"404": { description: "Agent or task not found" },
|
|
1114
|
-
},
|
|
1115
|
-
},
|
|
1116
|
-
},
|
|
1117
|
-
"/tasks/{agentId}/{taskId}/execute": {
|
|
1118
|
-
post: {
|
|
1119
|
-
tags: ["Tasks"],
|
|
1120
|
-
summary: "Execute a task immediately",
|
|
1121
|
-
description: "Immediately execute a task on a running agent, regardless of its schedule.",
|
|
1122
|
-
parameters: [
|
|
1123
|
-
{ name: "agentId", in: "path", required: true, schema: { type: "string" }, description: "Agent ID" },
|
|
1124
|
-
{ name: "taskId", in: "path", required: true, schema: { type: "string" }, description: "Task ID to execute" },
|
|
1125
|
-
],
|
|
1126
|
-
responses: {
|
|
1127
|
-
"200": { description: "Task execution started" },
|
|
1128
|
-
"400": { description: "Agent is not running" },
|
|
1129
|
-
"404": { description: "Agent or task not found" },
|
|
1130
|
-
},
|
|
1131
|
-
},
|
|
1132
|
-
},
|
|
1133
|
-
"/mcp/servers": {
|
|
1134
|
-
get: {
|
|
1135
|
-
tags: ["MCP"],
|
|
1136
|
-
summary: "List MCP servers",
|
|
1137
|
-
responses: {
|
|
1138
|
-
"200": {
|
|
1139
|
-
description: "List of MCP servers",
|
|
1140
|
-
content: {
|
|
1141
|
-
"application/json": {
|
|
1142
|
-
schema: { $ref: "#/components/schemas/McpServerListResponse" },
|
|
1143
|
-
},
|
|
1144
|
-
},
|
|
1145
|
-
},
|
|
1146
|
-
},
|
|
1147
|
-
},
|
|
1148
|
-
post: {
|
|
1149
|
-
tags: ["MCP"],
|
|
1150
|
-
summary: "Create MCP server",
|
|
1151
|
-
requestBody: {
|
|
1152
|
-
required: true,
|
|
1153
|
-
content: {
|
|
1154
|
-
"application/json": {
|
|
1155
|
-
schema: { $ref: "#/components/schemas/CreateMcpServer" },
|
|
1156
|
-
},
|
|
1157
|
-
},
|
|
1158
|
-
},
|
|
1159
|
-
responses: {
|
|
1160
|
-
"201": {
|
|
1161
|
-
description: "MCP server created",
|
|
1162
|
-
content: {
|
|
1163
|
-
"application/json": {
|
|
1164
|
-
schema: { $ref: "#/components/schemas/McpServer" },
|
|
1165
|
-
},
|
|
1166
|
-
},
|
|
1167
|
-
},
|
|
1168
|
-
},
|
|
1169
|
-
},
|
|
1170
|
-
},
|
|
1171
|
-
"/mcp/servers/{serverId}": {
|
|
1172
|
-
delete: {
|
|
1173
|
-
tags: ["MCP"],
|
|
1174
|
-
summary: "Delete MCP server",
|
|
1175
|
-
parameters: [
|
|
1176
|
-
{ name: "serverId", in: "path", required: true, schema: { type: "string" } },
|
|
1177
|
-
],
|
|
1178
|
-
responses: {
|
|
1179
|
-
"200": { description: "Server deleted" },
|
|
1180
|
-
},
|
|
1181
|
-
},
|
|
1182
|
-
},
|
|
1183
|
-
"/mcp/servers/{serverId}/start": {
|
|
1184
|
-
post: {
|
|
1185
|
-
tags: ["MCP"],
|
|
1186
|
-
summary: "Start MCP server",
|
|
1187
|
-
parameters: [
|
|
1188
|
-
{ name: "serverId", in: "path", required: true, schema: { type: "string" } },
|
|
1189
|
-
],
|
|
1190
|
-
responses: {
|
|
1191
|
-
"200": {
|
|
1192
|
-
description: "Server started",
|
|
1193
|
-
content: {
|
|
1194
|
-
"application/json": {
|
|
1195
|
-
schema: {
|
|
1196
|
-
type: "object",
|
|
1197
|
-
properties: {
|
|
1198
|
-
success: { type: "boolean" },
|
|
1199
|
-
port: { type: "integer" },
|
|
1200
|
-
},
|
|
1201
|
-
},
|
|
1202
|
-
},
|
|
1203
|
-
},
|
|
1204
|
-
},
|
|
1205
|
-
},
|
|
1206
|
-
},
|
|
1207
|
-
},
|
|
1208
|
-
"/mcp/servers/{serverId}/stop": {
|
|
1209
|
-
post: {
|
|
1210
|
-
tags: ["MCP"],
|
|
1211
|
-
summary: "Stop MCP server",
|
|
1212
|
-
parameters: [
|
|
1213
|
-
{ name: "serverId", in: "path", required: true, schema: { type: "string" } },
|
|
1214
|
-
],
|
|
1215
|
-
responses: {
|
|
1216
|
-
"200": { description: "Server stopped" },
|
|
1217
|
-
},
|
|
1218
|
-
},
|
|
1219
|
-
},
|
|
1220
|
-
"/mcp/servers/{serverId}/tools": {
|
|
1221
|
-
get: {
|
|
1222
|
-
tags: ["MCP"],
|
|
1223
|
-
summary: "List tools from MCP server",
|
|
1224
|
-
parameters: [
|
|
1225
|
-
{ name: "serverId", in: "path", required: true, schema: { type: "string" } },
|
|
1226
|
-
],
|
|
1227
|
-
responses: {
|
|
1228
|
-
"200": {
|
|
1229
|
-
description: "List of tools",
|
|
1230
|
-
content: {
|
|
1231
|
-
"application/json": {
|
|
1232
|
-
schema: {
|
|
1233
|
-
type: "array",
|
|
1234
|
-
items: { $ref: "#/components/schemas/McpTool" },
|
|
1235
|
-
},
|
|
1236
|
-
},
|
|
1237
|
-
},
|
|
1238
|
-
},
|
|
1239
|
-
},
|
|
1240
|
-
},
|
|
1241
|
-
},
|
|
1242
|
-
"/mcp/servers/{serverId}/tools/{toolName}/call": {
|
|
1243
|
-
post: {
|
|
1244
|
-
tags: ["MCP"],
|
|
1245
|
-
summary: "Call an MCP tool",
|
|
1246
|
-
parameters: [
|
|
1247
|
-
{ name: "serverId", in: "path", required: true, schema: { type: "string" } },
|
|
1248
|
-
{ name: "toolName", in: "path", required: true, schema: { type: "string" } },
|
|
1249
|
-
],
|
|
1250
|
-
requestBody: {
|
|
1251
|
-
required: true,
|
|
1252
|
-
content: {
|
|
1253
|
-
"application/json": {
|
|
1254
|
-
schema: {
|
|
1255
|
-
type: "object",
|
|
1256
|
-
description: "Tool arguments (varies by tool)",
|
|
1257
|
-
},
|
|
1258
|
-
},
|
|
1259
|
-
},
|
|
1260
|
-
},
|
|
1261
|
-
responses: {
|
|
1262
|
-
"200": {
|
|
1263
|
-
description: "Tool result",
|
|
1264
|
-
content: {
|
|
1265
|
-
"application/json": {
|
|
1266
|
-
schema: { $ref: "#/components/schemas/McpToolResult" },
|
|
1267
|
-
},
|
|
1268
|
-
},
|
|
1269
|
-
},
|
|
1270
|
-
},
|
|
1271
|
-
},
|
|
1272
|
-
},
|
|
1273
|
-
"/mcp/registry": {
|
|
1274
|
-
get: {
|
|
1275
|
-
tags: ["MCP"],
|
|
1276
|
-
summary: "Search MCP registry (Smithery)",
|
|
1277
|
-
parameters: [
|
|
1278
|
-
{ name: "q", in: "query", schema: { type: "string" }, description: "Search query" },
|
|
1279
|
-
],
|
|
1280
|
-
responses: {
|
|
1281
|
-
"200": {
|
|
1282
|
-
description: "Registry results",
|
|
1283
|
-
content: {
|
|
1284
|
-
"application/json": {
|
|
1285
|
-
schema: {
|
|
1286
|
-
type: "array",
|
|
1287
|
-
items: {
|
|
1288
|
-
type: "object",
|
|
1289
|
-
properties: {
|
|
1290
|
-
name: { type: "string" },
|
|
1291
|
-
description: { type: "string" },
|
|
1292
|
-
package: { type: "string" },
|
|
1293
|
-
},
|
|
1294
|
-
},
|
|
1295
|
-
},
|
|
1296
|
-
},
|
|
1297
|
-
},
|
|
1298
|
-
},
|
|
1299
|
-
},
|
|
1300
|
-
},
|
|
1301
|
-
},
|
|
1302
|
-
"/providers": {
|
|
1303
|
-
get: {
|
|
1304
|
-
tags: ["Providers"],
|
|
1305
|
-
summary: "List available providers",
|
|
1306
|
-
responses: {
|
|
1307
|
-
"200": {
|
|
1308
|
-
description: "List of providers",
|
|
1309
|
-
content: {
|
|
1310
|
-
"application/json": {
|
|
1311
|
-
schema: {
|
|
1312
|
-
type: "array",
|
|
1313
|
-
items: { $ref: "#/components/schemas/Provider" },
|
|
1314
|
-
},
|
|
1315
|
-
},
|
|
1316
|
-
},
|
|
1317
|
-
},
|
|
1318
|
-
},
|
|
1319
|
-
},
|
|
1320
|
-
},
|
|
1321
|
-
"/keys/{providerId}": {
|
|
1322
|
-
post: {
|
|
1323
|
-
tags: ["Providers"],
|
|
1324
|
-
summary: "Save API key for provider",
|
|
1325
|
-
parameters: [
|
|
1326
|
-
{ name: "providerId", in: "path", required: true, schema: { type: "string" } },
|
|
1327
|
-
],
|
|
1328
|
-
requestBody: {
|
|
1329
|
-
required: true,
|
|
1330
|
-
content: {
|
|
1331
|
-
"application/json": {
|
|
1332
|
-
schema: {
|
|
1333
|
-
type: "object",
|
|
1334
|
-
required: ["key"],
|
|
1335
|
-
properties: {
|
|
1336
|
-
key: { type: "string" },
|
|
1337
|
-
},
|
|
1338
|
-
},
|
|
1339
|
-
},
|
|
1340
|
-
},
|
|
1341
|
-
},
|
|
1342
|
-
responses: {
|
|
1343
|
-
"200": { description: "Key saved" },
|
|
1344
|
-
},
|
|
1345
|
-
},
|
|
1346
|
-
},
|
|
1347
|
-
"/keys/{providerId}/test": {
|
|
1348
|
-
post: {
|
|
1349
|
-
tags: ["Providers"],
|
|
1350
|
-
summary: "Test API key validity",
|
|
1351
|
-
parameters: [
|
|
1352
|
-
{ name: "providerId", in: "path", required: true, schema: { type: "string" } },
|
|
1353
|
-
],
|
|
1354
|
-
responses: {
|
|
1355
|
-
"200": {
|
|
1356
|
-
description: "Key validation result",
|
|
1357
|
-
content: {
|
|
1358
|
-
"application/json": {
|
|
1359
|
-
schema: {
|
|
1360
|
-
type: "object",
|
|
1361
|
-
properties: {
|
|
1362
|
-
valid: { type: "boolean" },
|
|
1363
|
-
error: { type: "string" },
|
|
1364
|
-
},
|
|
1365
|
-
},
|
|
1366
|
-
},
|
|
1367
|
-
},
|
|
1368
|
-
},
|
|
1369
|
-
},
|
|
1370
|
-
},
|
|
1371
|
-
},
|
|
1372
|
-
"/projects": {
|
|
1373
|
-
get: {
|
|
1374
|
-
tags: ["Projects"],
|
|
1375
|
-
summary: "List projects",
|
|
1376
|
-
responses: {
|
|
1377
|
-
"200": {
|
|
1378
|
-
description: "List of projects",
|
|
1379
|
-
content: {
|
|
1380
|
-
"application/json": {
|
|
1381
|
-
schema: {
|
|
1382
|
-
type: "array",
|
|
1383
|
-
items: { $ref: "#/components/schemas/Project" },
|
|
1384
|
-
},
|
|
1385
|
-
},
|
|
1386
|
-
},
|
|
1387
|
-
},
|
|
1388
|
-
},
|
|
1389
|
-
},
|
|
1390
|
-
post: {
|
|
1391
|
-
tags: ["Projects"],
|
|
1392
|
-
summary: "Create project",
|
|
1393
|
-
requestBody: {
|
|
1394
|
-
required: true,
|
|
1395
|
-
content: {
|
|
1396
|
-
"application/json": {
|
|
1397
|
-
schema: {
|
|
1398
|
-
type: "object",
|
|
1399
|
-
required: ["name"],
|
|
1400
|
-
properties: {
|
|
1401
|
-
name: { type: "string" },
|
|
1402
|
-
description: { type: "string" },
|
|
1403
|
-
},
|
|
1404
|
-
},
|
|
1405
|
-
},
|
|
1406
|
-
},
|
|
1407
|
-
},
|
|
1408
|
-
responses: {
|
|
1409
|
-
"201": { description: "Project created" },
|
|
1410
|
-
},
|
|
1411
|
-
},
|
|
1412
|
-
},
|
|
1413
|
-
"/projects/{projectId}": {
|
|
1414
|
-
put: {
|
|
1415
|
-
tags: ["Projects"],
|
|
1416
|
-
summary: "Update project",
|
|
1417
|
-
parameters: [
|
|
1418
|
-
{ name: "projectId", in: "path", required: true, schema: { type: "string" } },
|
|
1419
|
-
],
|
|
1420
|
-
requestBody: {
|
|
1421
|
-
content: {
|
|
1422
|
-
"application/json": {
|
|
1423
|
-
schema: {
|
|
1424
|
-
type: "object",
|
|
1425
|
-
properties: {
|
|
1426
|
-
name: { type: "string" },
|
|
1427
|
-
description: { type: "string" },
|
|
1428
|
-
},
|
|
1429
|
-
},
|
|
1430
|
-
},
|
|
1431
|
-
},
|
|
1432
|
-
},
|
|
1433
|
-
responses: {
|
|
1434
|
-
"200": { description: "Project updated" },
|
|
1435
|
-
},
|
|
1436
|
-
},
|
|
1437
|
-
delete: {
|
|
1438
|
-
tags: ["Projects"],
|
|
1439
|
-
summary: "Delete project",
|
|
1440
|
-
parameters: [
|
|
1441
|
-
{ name: "projectId", in: "path", required: true, schema: { type: "string" } },
|
|
1442
|
-
],
|
|
1443
|
-
responses: {
|
|
1444
|
-
"200": { description: "Project deleted" },
|
|
1445
|
-
},
|
|
1446
|
-
},
|
|
1447
|
-
},
|
|
1448
|
-
"/telemetry": {
|
|
1449
|
-
post: {
|
|
1450
|
-
tags: ["Telemetry"],
|
|
1451
|
-
summary: "Receive telemetry events from agents",
|
|
1452
|
-
description: `Endpoint for agents to send telemetry data. Agents are configured to send to this endpoint automatically.
|
|
1453
|
-
|
|
1454
|
-
Events are batched and sent periodically. Debug-level events are filtered out.`,
|
|
1455
|
-
requestBody: {
|
|
1456
|
-
required: true,
|
|
1457
|
-
content: {
|
|
1458
|
-
"application/json": {
|
|
1459
|
-
schema: { $ref: "#/components/schemas/TelemetryBatch" },
|
|
1460
|
-
},
|
|
1461
|
-
},
|
|
1462
|
-
},
|
|
1463
|
-
responses: {
|
|
1464
|
-
"200": {
|
|
1465
|
-
description: "Events received",
|
|
1466
|
-
content: {
|
|
1467
|
-
"application/json": {
|
|
1468
|
-
schema: {
|
|
1469
|
-
type: "object",
|
|
1470
|
-
properties: {
|
|
1471
|
-
received: { type: "integer", description: "Number of events received" },
|
|
1472
|
-
inserted: { type: "integer", description: "Number of events inserted" },
|
|
1473
|
-
},
|
|
1474
|
-
},
|
|
1475
|
-
},
|
|
1476
|
-
},
|
|
1477
|
-
},
|
|
1478
|
-
},
|
|
1479
|
-
},
|
|
1480
|
-
},
|
|
1481
|
-
"/telemetry/stream": {
|
|
1482
|
-
get: {
|
|
1483
|
-
tags: ["Telemetry"],
|
|
1484
|
-
summary: "Real-time telemetry stream (SSE)",
|
|
1485
|
-
description: `Server-Sent Events stream for real-time telemetry updates.
|
|
1486
|
-
|
|
1487
|
-
Connect to this endpoint to receive live telemetry events as they are received from agents.
|
|
1488
|
-
Events are broadcast immediately when agents send them, enabling real-time activity feeds.
|
|
1489
|
-
|
|
1490
|
-
**Initial Connection:**
|
|
1491
|
-
On connect, you'll receive: \`{"connected":true}\`
|
|
1492
|
-
|
|
1493
|
-
**Event Format:**
|
|
1494
|
-
Each event is a JSON object matching the TelemetryEvent schema.
|
|
1495
|
-
|
|
1496
|
-
**Example - React hook for real-time activity:**
|
|
1497
|
-
\`\`\`javascript
|
|
1498
|
-
const eventSource = new EventSource('/api/telemetry/stream');
|
|
1499
|
-
|
|
1500
|
-
eventSource.onmessage = (event) => {
|
|
1501
|
-
const data = JSON.parse(event.data);
|
|
1502
|
-
if (data.type === 'thread_activity') {
|
|
1503
|
-
// Update activity feed
|
|
1504
|
-
console.log(\`[\${data.agent_id}] \${data.data?.activity}\`);
|
|
1505
|
-
}
|
|
1506
|
-
};
|
|
1507
|
-
|
|
1508
|
-
eventSource.onerror = () => {
|
|
1509
|
-
// Reconnect logic
|
|
1510
|
-
eventSource.close();
|
|
1511
|
-
};
|
|
1512
|
-
\`\`\``,
|
|
1513
|
-
responses: {
|
|
1514
|
-
"200": {
|
|
1515
|
-
description: "SSE stream of telemetry events",
|
|
1516
|
-
content: {
|
|
1517
|
-
"text/event-stream": {
|
|
1518
|
-
schema: {
|
|
1519
|
-
type: "string",
|
|
1520
|
-
description: "Server-Sent Events stream. Each event contains JSON with telemetry data.",
|
|
1521
|
-
},
|
|
1522
|
-
},
|
|
1523
|
-
},
|
|
1524
|
-
},
|
|
1525
|
-
},
|
|
1526
|
-
},
|
|
1527
|
-
},
|
|
1528
|
-
"/telemetry/events": {
|
|
1529
|
-
get: {
|
|
1530
|
-
tags: ["Telemetry"],
|
|
1531
|
-
summary: "Query telemetry events",
|
|
1532
|
-
description: `Query stored telemetry events with optional filters.
|
|
1533
|
-
|
|
1534
|
-
**Common Event Types:**
|
|
1535
|
-
- \`thread_activity\` - Agent activity updates (used for dashboard activity feed)
|
|
1536
|
-
- \`llm_request\` / \`llm_response\` - LLM API calls
|
|
1537
|
-
- \`tool_call\` / \`tool_result\` - Tool executions
|
|
1538
|
-
- \`memory_store\` / \`memory_recall\` - Memory operations
|
|
1539
|
-
- \`task_start\` / \`task_complete\` - Task lifecycle
|
|
1540
|
-
- \`agent_start\` / \`agent_stop\` - Agent lifecycle
|
|
1541
|
-
- \`error\` - Error events
|
|
1542
|
-
|
|
1543
|
-
**Example - Get recent activity for dashboard:**
|
|
1544
|
-
\`\`\`
|
|
1545
|
-
GET /api/telemetry/events?type=thread_activity&limit=20
|
|
1546
|
-
\`\`\``,
|
|
1547
|
-
parameters: [
|
|
1548
|
-
{ name: "agent_id", in: "query", schema: { type: "string" }, description: "Filter by agent ID" },
|
|
1549
|
-
{ name: "project_id", in: "query", schema: { type: "string" }, description: "Filter by project ID (use 'null' for unassigned)" },
|
|
1550
|
-
{ name: "category", in: "query", schema: { type: "string", enum: ["llm", "tool", "memory", "task", "agent", "mcp", "system"] }, description: "Filter by category" },
|
|
1551
|
-
{ name: "type", in: "query", schema: { type: "string" }, description: "Filter by event type (e.g., thread_activity, llm_request, tool_call)" },
|
|
1552
|
-
{ name: "level", in: "query", schema: { type: "string", enum: ["info", "warn", "error"] }, description: "Filter by level" },
|
|
1553
|
-
{ name: "trace_id", in: "query", schema: { type: "string" }, description: "Filter by trace ID" },
|
|
1554
|
-
{ name: "since", in: "query", schema: { type: "string", format: "date-time" }, description: "Events after this timestamp" },
|
|
1555
|
-
{ name: "until", in: "query", schema: { type: "string", format: "date-time" }, description: "Events before this timestamp" },
|
|
1556
|
-
{ name: "limit", in: "query", schema: { type: "integer", default: 100 }, description: "Max events to return" },
|
|
1557
|
-
{ name: "offset", in: "query", schema: { type: "integer", default: 0 }, description: "Offset for pagination" },
|
|
1558
|
-
],
|
|
1559
|
-
responses: {
|
|
1560
|
-
"200": {
|
|
1561
|
-
description: "List of telemetry events",
|
|
1562
|
-
content: {
|
|
1563
|
-
"application/json": {
|
|
1564
|
-
schema: {
|
|
1565
|
-
type: "object",
|
|
1566
|
-
properties: {
|
|
1567
|
-
events: {
|
|
1568
|
-
type: "array",
|
|
1569
|
-
items: { $ref: "#/components/schemas/TelemetryEvent" },
|
|
1570
|
-
},
|
|
1571
|
-
},
|
|
1572
|
-
},
|
|
1573
|
-
},
|
|
1574
|
-
},
|
|
1575
|
-
},
|
|
1576
|
-
},
|
|
1577
|
-
},
|
|
1578
|
-
},
|
|
1579
|
-
"/telemetry/usage": {
|
|
1580
|
-
get: {
|
|
1581
|
-
tags: ["Telemetry"],
|
|
1582
|
-
summary: "Get usage statistics",
|
|
1583
|
-
description: "Get token usage statistics, optionally grouped by agent or day.",
|
|
1584
|
-
parameters: [
|
|
1585
|
-
{ name: "agent_id", in: "query", schema: { type: "string" }, description: "Filter by agent ID" },
|
|
1586
|
-
{ name: "project_id", in: "query", schema: { type: "string" }, description: "Filter by project ID" },
|
|
1587
|
-
{ name: "since", in: "query", schema: { type: "string", format: "date-time" }, description: "Start of time range" },
|
|
1588
|
-
{ name: "until", in: "query", schema: { type: "string", format: "date-time" }, description: "End of time range" },
|
|
1589
|
-
{ name: "group_by", in: "query", schema: { type: "string", enum: ["agent", "day"] }, description: "Group results by agent or day" },
|
|
1590
|
-
],
|
|
1591
|
-
responses: {
|
|
1592
|
-
"200": {
|
|
1593
|
-
description: "Usage statistics",
|
|
1594
|
-
content: {
|
|
1595
|
-
"application/json": {
|
|
1596
|
-
schema: { $ref: "#/components/schemas/TelemetryUsage" },
|
|
1597
|
-
},
|
|
1598
|
-
},
|
|
1599
|
-
},
|
|
1600
|
-
},
|
|
1601
|
-
},
|
|
1602
|
-
},
|
|
1603
|
-
"/telemetry/stats": {
|
|
1604
|
-
get: {
|
|
1605
|
-
tags: ["Telemetry"],
|
|
1606
|
-
summary: "Get summary statistics",
|
|
1607
|
-
description: "Get aggregated telemetry statistics for dashboard display.",
|
|
1608
|
-
parameters: [
|
|
1609
|
-
{ name: "agent_id", in: "query", schema: { type: "string" }, description: "Filter by agent ID" },
|
|
1610
|
-
{ name: "project_id", in: "query", schema: { type: "string" }, description: "Filter by project ID" },
|
|
1611
|
-
],
|
|
1612
|
-
responses: {
|
|
1613
|
-
"200": {
|
|
1614
|
-
description: "Summary statistics",
|
|
1615
|
-
content: {
|
|
1616
|
-
"application/json": {
|
|
1617
|
-
schema: { $ref: "#/components/schemas/TelemetryStats" },
|
|
1618
|
-
},
|
|
1619
|
-
},
|
|
1620
|
-
},
|
|
1621
|
-
},
|
|
1622
|
-
},
|
|
1623
|
-
},
|
|
1624
|
-
"/telemetry/clear": {
|
|
1625
|
-
post: {
|
|
1626
|
-
tags: ["Telemetry"],
|
|
1627
|
-
summary: "Clear all telemetry data",
|
|
1628
|
-
description: "Permanently deletes all stored telemetry data. Use with caution.",
|
|
1629
|
-
responses: {
|
|
1630
|
-
"200": {
|
|
1631
|
-
description: "Telemetry cleared",
|
|
1632
|
-
content: {
|
|
1633
|
-
"application/json": {
|
|
1634
|
-
schema: {
|
|
1635
|
-
type: "object",
|
|
1636
|
-
properties: {
|
|
1637
|
-
deleted: { type: "integer", description: "Number of events deleted" },
|
|
1638
|
-
},
|
|
1639
|
-
},
|
|
1640
|
-
},
|
|
1641
|
-
},
|
|
1642
|
-
},
|
|
1643
|
-
},
|
|
1644
|
-
},
|
|
1645
|
-
},
|
|
1646
|
-
"/integrations/composio/configs": {
|
|
1647
|
-
get: {
|
|
1648
|
-
tags: ["MCP"],
|
|
1649
|
-
summary: "List Composio MCP server configs",
|
|
1650
|
-
description: "Lists MCP server configurations from your Composio account.",
|
|
1651
|
-
responses: {
|
|
1652
|
-
"200": {
|
|
1653
|
-
description: "List of Composio configs",
|
|
1654
|
-
content: {
|
|
1655
|
-
"application/json": {
|
|
1656
|
-
schema: {
|
|
1657
|
-
type: "object",
|
|
1658
|
-
properties: {
|
|
1659
|
-
configs: {
|
|
1660
|
-
type: "array",
|
|
1661
|
-
items: {
|
|
1662
|
-
type: "object",
|
|
1663
|
-
properties: {
|
|
1664
|
-
id: { type: "string" },
|
|
1665
|
-
name: { type: "string" },
|
|
1666
|
-
toolkits: { type: "array", items: { type: "string" } },
|
|
1667
|
-
toolsCount: { type: "integer" },
|
|
1668
|
-
},
|
|
1669
|
-
},
|
|
1670
|
-
},
|
|
1671
|
-
},
|
|
1672
|
-
},
|
|
1673
|
-
},
|
|
1674
|
-
},
|
|
1675
|
-
},
|
|
1676
|
-
},
|
|
1677
|
-
},
|
|
1678
|
-
},
|
|
1679
|
-
"/integrations/composio/configs/{configId}/add": {
|
|
1680
|
-
post: {
|
|
1681
|
-
tags: ["MCP"],
|
|
1682
|
-
summary: "Add Composio config as MCP server",
|
|
1683
|
-
description: "Creates an MCP server from a Composio config. Automatically fetches your Composio user ID from connected accounts.",
|
|
1684
|
-
parameters: [
|
|
1685
|
-
{ name: "configId", in: "path", required: true, schema: { type: "string" } },
|
|
1686
|
-
],
|
|
1687
|
-
responses: {
|
|
1688
|
-
"200": {
|
|
1689
|
-
description: "MCP server created from Composio config",
|
|
1690
|
-
content: {
|
|
1691
|
-
"application/json": {
|
|
1692
|
-
schema: { $ref: "#/components/schemas/McpServerResponse" },
|
|
1693
|
-
},
|
|
1694
|
-
},
|
|
1695
|
-
},
|
|
1696
|
-
},
|
|
1697
|
-
},
|
|
1698
|
-
},
|
|
1699
|
-
// Skills endpoints
|
|
1700
|
-
"/skills": {
|
|
1701
|
-
get: {
|
|
1702
|
-
tags: ["Skills"],
|
|
1703
|
-
summary: "List all skills",
|
|
1704
|
-
description: "Returns all installed skills. Can filter by project.",
|
|
1705
|
-
parameters: [
|
|
1706
|
-
{ name: "project", in: "query", schema: { type: "string" }, description: "Filter: 'all', 'global', or project ID" },
|
|
1707
|
-
{ name: "forAgent", in: "query", schema: { type: "string" }, description: "Agent's project ID (shows global + project)" },
|
|
1708
|
-
],
|
|
1709
|
-
responses: {
|
|
1710
|
-
"200": {
|
|
1711
|
-
description: "List of skills",
|
|
1712
|
-
content: {
|
|
1713
|
-
"application/json": {
|
|
1714
|
-
schema: {
|
|
1715
|
-
type: "object",
|
|
1716
|
-
properties: {
|
|
1717
|
-
skills: { type: "array", items: { $ref: "#/components/schemas/Skill" } },
|
|
1718
|
-
},
|
|
1719
|
-
},
|
|
1720
|
-
},
|
|
1721
|
-
},
|
|
1722
|
-
},
|
|
1723
|
-
},
|
|
1724
|
-
},
|
|
1725
|
-
post: {
|
|
1726
|
-
tags: ["Skills"],
|
|
1727
|
-
summary: "Create a new skill",
|
|
1728
|
-
requestBody: {
|
|
1729
|
-
required: true,
|
|
1730
|
-
content: {
|
|
1731
|
-
"application/json": {
|
|
1732
|
-
schema: { $ref: "#/components/schemas/SkillCreate" },
|
|
1733
|
-
},
|
|
1734
|
-
},
|
|
1735
|
-
},
|
|
1736
|
-
responses: {
|
|
1737
|
-
"201": {
|
|
1738
|
-
description: "Skill created",
|
|
1739
|
-
content: {
|
|
1740
|
-
"application/json": {
|
|
1741
|
-
schema: { $ref: "#/components/schemas/Skill" },
|
|
1742
|
-
},
|
|
1743
|
-
},
|
|
1744
|
-
},
|
|
1745
|
-
},
|
|
1746
|
-
},
|
|
1747
|
-
},
|
|
1748
|
-
"/skills/github/{owner}/{repo}": {
|
|
1749
|
-
get: {
|
|
1750
|
-
tags: ["Skills"],
|
|
1751
|
-
summary: "List skills from GitHub repo",
|
|
1752
|
-
description: "Fetches and lists all skills from a GitHub repository. Skills should be in subdirectories with SKILL.md files.",
|
|
1753
|
-
parameters: [
|
|
1754
|
-
{ name: "owner", in: "path", required: true, schema: { type: "string" }, description: "GitHub repo owner" },
|
|
1755
|
-
{ name: "repo", in: "path", required: true, schema: { type: "string" }, description: "GitHub repo name" },
|
|
1756
|
-
],
|
|
1757
|
-
responses: {
|
|
1758
|
-
"200": {
|
|
1759
|
-
description: "List of skills from repo",
|
|
1760
|
-
content: {
|
|
1761
|
-
"application/json": {
|
|
1762
|
-
schema: {
|
|
1763
|
-
type: "object",
|
|
1764
|
-
properties: {
|
|
1765
|
-
skills: {
|
|
1766
|
-
type: "array",
|
|
1767
|
-
items: {
|
|
1768
|
-
type: "object",
|
|
1769
|
-
properties: {
|
|
1770
|
-
name: { type: "string" },
|
|
1771
|
-
description: { type: "string" },
|
|
1772
|
-
path: { type: "string" },
|
|
1773
|
-
size: { type: "integer" },
|
|
1774
|
-
downloadUrl: { type: "string" },
|
|
1775
|
-
},
|
|
1776
|
-
},
|
|
1777
|
-
},
|
|
1778
|
-
repo: {
|
|
1779
|
-
type: "object",
|
|
1780
|
-
properties: {
|
|
1781
|
-
owner: { type: "string" },
|
|
1782
|
-
repo: { type: "string" },
|
|
1783
|
-
url: { type: "string" },
|
|
1784
|
-
},
|
|
1785
|
-
},
|
|
1786
|
-
},
|
|
1787
|
-
},
|
|
1788
|
-
},
|
|
1789
|
-
},
|
|
1790
|
-
},
|
|
1791
|
-
"404": { description: "Repository not found" },
|
|
1792
|
-
},
|
|
1793
|
-
},
|
|
1794
|
-
},
|
|
1795
|
-
"/skills/github/install": {
|
|
1796
|
-
post: {
|
|
1797
|
-
tags: ["Skills"],
|
|
1798
|
-
summary: "Install skill from GitHub",
|
|
1799
|
-
description: "Downloads and installs a skill from a GitHub repository.",
|
|
1800
|
-
requestBody: {
|
|
1801
|
-
required: true,
|
|
1802
|
-
content: {
|
|
1803
|
-
"application/json": {
|
|
1804
|
-
schema: {
|
|
1805
|
-
type: "object",
|
|
1806
|
-
required: ["owner", "repo", "skillName", "downloadUrl"],
|
|
1807
|
-
properties: {
|
|
1808
|
-
owner: { type: "string", description: "GitHub repo owner" },
|
|
1809
|
-
repo: { type: "string", description: "GitHub repo name" },
|
|
1810
|
-
skillName: { type: "string", description: "Name of the skill to install" },
|
|
1811
|
-
downloadUrl: { type: "string", description: "Raw URL to the SKILL.md file" },
|
|
1812
|
-
projectId: { type: "string", nullable: true, description: "Project ID (null for global)" },
|
|
1813
|
-
},
|
|
1814
|
-
},
|
|
1815
|
-
},
|
|
1816
|
-
},
|
|
1817
|
-
},
|
|
1818
|
-
responses: {
|
|
1819
|
-
"201": {
|
|
1820
|
-
description: "Skill installed",
|
|
1821
|
-
content: {
|
|
1822
|
-
"application/json": {
|
|
1823
|
-
schema: { $ref: "#/components/schemas/Skill" },
|
|
1824
|
-
},
|
|
1825
|
-
},
|
|
1826
|
-
},
|
|
1827
|
-
"400": { description: "Skill already exists or invalid request" },
|
|
1828
|
-
},
|
|
1829
|
-
},
|
|
1830
|
-
},
|
|
1831
|
-
"/skills/{skillId}": {
|
|
1832
|
-
get: {
|
|
1833
|
-
tags: ["Skills"],
|
|
1834
|
-
summary: "Get skill by ID",
|
|
1835
|
-
parameters: [
|
|
1836
|
-
{ name: "skillId", in: "path", required: true, schema: { type: "string" } },
|
|
1837
|
-
],
|
|
1838
|
-
responses: {
|
|
1839
|
-
"200": {
|
|
1840
|
-
description: "Skill details",
|
|
1841
|
-
content: {
|
|
1842
|
-
"application/json": {
|
|
1843
|
-
schema: { $ref: "#/components/schemas/Skill" },
|
|
1844
|
-
},
|
|
1845
|
-
},
|
|
1846
|
-
},
|
|
1847
|
-
"404": { description: "Skill not found" },
|
|
1848
|
-
},
|
|
1849
|
-
},
|
|
1850
|
-
delete: {
|
|
1851
|
-
tags: ["Skills"],
|
|
1852
|
-
summary: "Delete skill",
|
|
1853
|
-
parameters: [
|
|
1854
|
-
{ name: "skillId", in: "path", required: true, schema: { type: "string" } },
|
|
1855
|
-
],
|
|
1856
|
-
responses: {
|
|
1857
|
-
"200": { description: "Skill deleted" },
|
|
1858
|
-
"404": { description: "Skill not found" },
|
|
1859
|
-
},
|
|
1860
|
-
},
|
|
1861
|
-
},
|
|
1862
|
-
},
|
|
1863
|
-
components: {
|
|
1864
|
-
securitySchemes: {
|
|
1865
|
-
BearerAuth: {
|
|
1866
|
-
type: "http",
|
|
1867
|
-
scheme: "bearer",
|
|
1868
|
-
bearerFormat: "JWT",
|
|
1869
|
-
description: "JWT token obtained from /auth/login",
|
|
1870
|
-
},
|
|
1871
|
-
},
|
|
1872
|
-
schemas: {
|
|
1873
|
-
// Auth schemas
|
|
1874
|
-
LoginRequest: {
|
|
1875
|
-
type: "object",
|
|
1876
|
-
required: ["username", "password"],
|
|
1877
|
-
properties: {
|
|
1878
|
-
username: { type: "string", example: "admin" },
|
|
1879
|
-
password: { type: "string", example: "yourpassword" },
|
|
1880
|
-
},
|
|
1881
|
-
},
|
|
1882
|
-
LoginResponse: {
|
|
1883
|
-
type: "object",
|
|
1884
|
-
properties: {
|
|
1885
|
-
accessToken: { type: "string", description: "JWT access token (expires in 15min)" },
|
|
1886
|
-
expiresIn: { type: "integer", description: "Token expiry in seconds", example: 900 },
|
|
1887
|
-
user: { $ref: "#/components/schemas/User" },
|
|
1888
|
-
},
|
|
1889
|
-
description: "Refresh token is set as httpOnly cookie",
|
|
1890
|
-
},
|
|
1891
|
-
RefreshResponse: {
|
|
1892
|
-
type: "object",
|
|
1893
|
-
properties: {
|
|
1894
|
-
accessToken: { type: "string" },
|
|
1895
|
-
expiresIn: { type: "integer", description: "Token expiry in seconds" },
|
|
1896
|
-
},
|
|
1897
|
-
description: "Refresh token read from httpOnly cookie, new one set as cookie",
|
|
1898
|
-
},
|
|
1899
|
-
User: {
|
|
1900
|
-
type: "object",
|
|
1901
|
-
properties: {
|
|
1902
|
-
id: { type: "string" },
|
|
1903
|
-
username: { type: "string" },
|
|
1904
|
-
email: { type: "string", format: "email", nullable: true },
|
|
1905
|
-
role: { type: "string", example: "admin" },
|
|
1906
|
-
createdAt: { type: "string", format: "date-time" },
|
|
1907
|
-
lastLoginAt: { type: "string", format: "date-time", nullable: true },
|
|
1908
|
-
},
|
|
1909
|
-
},
|
|
1910
|
-
// System schemas
|
|
1911
|
-
HealthResponse: {
|
|
1912
|
-
type: "object",
|
|
1913
|
-
properties: {
|
|
1914
|
-
status: { type: "string", example: "ok" },
|
|
1915
|
-
version: { type: "string", example: "0.2.8" },
|
|
1916
|
-
agents: {
|
|
1917
|
-
type: "object",
|
|
1918
|
-
properties: {
|
|
1919
|
-
total: { type: "integer", example: 3 },
|
|
1920
|
-
running: { type: "integer", example: 1 },
|
|
1921
|
-
},
|
|
1922
|
-
},
|
|
1923
|
-
},
|
|
1924
|
-
},
|
|
1925
|
-
VersionResponse: {
|
|
1926
|
-
type: "object",
|
|
1927
|
-
properties: {
|
|
1928
|
-
apteva: { $ref: "#/components/schemas/VersionInfo" },
|
|
1929
|
-
agent: { $ref: "#/components/schemas/VersionInfo" },
|
|
1930
|
-
isDocker: { type: "boolean" },
|
|
1931
|
-
},
|
|
1932
|
-
},
|
|
1933
|
-
VersionInfo: {
|
|
1934
|
-
type: "object",
|
|
1935
|
-
properties: {
|
|
1936
|
-
installed: { type: "string", nullable: true, example: "0.2.8" },
|
|
1937
|
-
latest: { type: "string", nullable: true, example: "0.2.9" },
|
|
1938
|
-
updateAvailable: { type: "boolean" },
|
|
1939
|
-
lastChecked: { type: "string", format: "date-time", nullable: true },
|
|
1940
|
-
},
|
|
1941
|
-
},
|
|
1942
|
-
// Agent schemas
|
|
1943
|
-
Agent: {
|
|
1944
|
-
type: "object",
|
|
1945
|
-
properties: {
|
|
1946
|
-
id: { type: "string" },
|
|
1947
|
-
name: { type: "string" },
|
|
1948
|
-
model: { type: "string" },
|
|
1949
|
-
provider: { type: "string" },
|
|
1950
|
-
systemPrompt: { type: "string" },
|
|
1951
|
-
status: { type: "string", enum: ["stopped", "running"] },
|
|
1952
|
-
port: { type: "integer" },
|
|
1953
|
-
features: { $ref: "#/components/schemas/AgentFeatures" },
|
|
1954
|
-
mcpServers: { type: "array", items: { type: "string" } },
|
|
1955
|
-
projectId: { type: "string", nullable: true },
|
|
1956
|
-
createdAt: { type: "string", format: "date-time" },
|
|
1957
|
-
},
|
|
1958
|
-
},
|
|
1959
|
-
AgentResponse: {
|
|
1960
|
-
type: "object",
|
|
1961
|
-
properties: {
|
|
1962
|
-
agent: { $ref: "#/components/schemas/Agent" },
|
|
1963
|
-
},
|
|
1964
|
-
},
|
|
1965
|
-
AgentListResponse: {
|
|
1966
|
-
type: "object",
|
|
1967
|
-
properties: {
|
|
1968
|
-
agents: {
|
|
1969
|
-
type: "array",
|
|
1970
|
-
items: { $ref: "#/components/schemas/Agent" },
|
|
1971
|
-
},
|
|
1972
|
-
},
|
|
1973
|
-
},
|
|
1974
|
-
CreateAgent: {
|
|
1975
|
-
type: "object",
|
|
1976
|
-
required: ["name", "model", "provider"],
|
|
1977
|
-
properties: {
|
|
1978
|
-
name: { type: "string" },
|
|
1979
|
-
model: { type: "string" },
|
|
1980
|
-
provider: { type: "string" },
|
|
1981
|
-
systemPrompt: { type: "string" },
|
|
1982
|
-
features: { $ref: "#/components/schemas/AgentFeatures" },
|
|
1983
|
-
mcpServers: { type: "array", items: { type: "string" } },
|
|
1984
|
-
projectId: { type: "string" },
|
|
1985
|
-
},
|
|
1986
|
-
},
|
|
1987
|
-
UpdateAgent: {
|
|
1988
|
-
type: "object",
|
|
1989
|
-
properties: {
|
|
1990
|
-
name: { type: "string" },
|
|
1991
|
-
model: { type: "string" },
|
|
1992
|
-
provider: { type: "string" },
|
|
1993
|
-
systemPrompt: { type: "string" },
|
|
1994
|
-
features: { $ref: "#/components/schemas/AgentFeatures" },
|
|
1995
|
-
mcpServers: { type: "array", items: { type: "string" } },
|
|
1996
|
-
projectId: { type: "string", nullable: true },
|
|
1997
|
-
},
|
|
1998
|
-
},
|
|
1999
|
-
AgentFeatures: {
|
|
2000
|
-
type: "object",
|
|
2001
|
-
properties: {
|
|
2002
|
-
memory: { type: "boolean" },
|
|
2003
|
-
tasks: { type: "boolean" },
|
|
2004
|
-
vision: { type: "boolean" },
|
|
2005
|
-
operator: { type: "boolean" },
|
|
2006
|
-
mcp: { type: "boolean" },
|
|
2007
|
-
realtime: { type: "boolean" },
|
|
2008
|
-
files: { type: "boolean" },
|
|
2009
|
-
agents: { type: "boolean" },
|
|
2010
|
-
},
|
|
2011
|
-
},
|
|
2012
|
-
Thread: {
|
|
2013
|
-
type: "object",
|
|
2014
|
-
properties: {
|
|
2015
|
-
id: { type: "string" },
|
|
2016
|
-
title: { type: "string" },
|
|
2017
|
-
createdAt: { type: "string", format: "date-time" },
|
|
2018
|
-
updatedAt: { type: "string", format: "date-time" },
|
|
2019
|
-
messageCount: { type: "integer" },
|
|
2020
|
-
},
|
|
2021
|
-
},
|
|
2022
|
-
Memory: {
|
|
2023
|
-
type: "object",
|
|
2024
|
-
properties: {
|
|
2025
|
-
id: { type: "string" },
|
|
2026
|
-
content: { type: "string" },
|
|
2027
|
-
type: { type: "string" },
|
|
2028
|
-
createdAt: { type: "string", format: "date-time" },
|
|
2029
|
-
},
|
|
2030
|
-
},
|
|
2031
|
-
File: {
|
|
2032
|
-
type: "object",
|
|
2033
|
-
properties: {
|
|
2034
|
-
id: { type: "string" },
|
|
2035
|
-
name: { type: "string" },
|
|
2036
|
-
size: { type: "integer" },
|
|
2037
|
-
mimeType: { type: "string" },
|
|
2038
|
-
createdAt: { type: "string", format: "date-time" },
|
|
2039
|
-
},
|
|
2040
|
-
},
|
|
2041
|
-
Message: {
|
|
2042
|
-
type: "object",
|
|
2043
|
-
properties: {
|
|
2044
|
-
id: { type: "string" },
|
|
2045
|
-
role: { type: "string", enum: ["user", "assistant", "system"] },
|
|
2046
|
-
content: { type: "string" },
|
|
2047
|
-
threadId: { type: "string" },
|
|
2048
|
-
createdAt: { type: "string", format: "date-time" },
|
|
2049
|
-
},
|
|
2050
|
-
},
|
|
2051
|
-
Task: {
|
|
2052
|
-
type: "object",
|
|
2053
|
-
properties: {
|
|
2054
|
-
id: { type: "string" },
|
|
2055
|
-
title: { type: "string" },
|
|
2056
|
-
description: { type: "string" },
|
|
2057
|
-
type: { type: "string", enum: ["once", "recurring"] },
|
|
2058
|
-
status: { type: "string", enum: ["pending", "running", "completed", "failed", "cancelled"] },
|
|
2059
|
-
priority: { type: "integer" },
|
|
2060
|
-
source: { type: "string", enum: ["local", "delegated"] },
|
|
2061
|
-
created_at: { type: "string", format: "date-time" },
|
|
2062
|
-
execute_at: { type: "string", format: "date-time", nullable: true },
|
|
2063
|
-
executed_at: { type: "string", format: "date-time", nullable: true },
|
|
2064
|
-
completed_at: { type: "string", format: "date-time", nullable: true },
|
|
2065
|
-
recurrence: { type: "string", nullable: true, description: "Cron expression for recurring tasks" },
|
|
2066
|
-
next_run: { type: "string", format: "date-time", nullable: true, description: "Next scheduled run for recurring tasks" },
|
|
2067
|
-
result: { type: "object", nullable: true, description: "Task result data (present when completed)" },
|
|
2068
|
-
error: { type: "string", nullable: true, description: "Error message (present when failed)" },
|
|
2069
|
-
agentId: { type: "string", description: "ID of the agent that owns this task" },
|
|
2070
|
-
agentName: { type: "string", description: "Name of the agent that owns this task" },
|
|
2071
|
-
},
|
|
2072
|
-
},
|
|
2073
|
-
TaskDetail: {
|
|
2074
|
-
type: "object",
|
|
2075
|
-
description: "Full task detail including trajectory (returned by single task endpoint)",
|
|
2076
|
-
properties: {
|
|
2077
|
-
id: { type: "string" },
|
|
2078
|
-
title: { type: "string" },
|
|
2079
|
-
description: { type: "string" },
|
|
2080
|
-
type: { type: "string", enum: ["once", "recurring"] },
|
|
2081
|
-
status: { type: "string", enum: ["pending", "running", "completed", "failed", "cancelled"] },
|
|
2082
|
-
priority: { type: "integer" },
|
|
2083
|
-
source: { type: "string", enum: ["local", "delegated"] },
|
|
2084
|
-
created_at: { type: "string", format: "date-time" },
|
|
2085
|
-
execute_at: { type: "string", format: "date-time", nullable: true },
|
|
2086
|
-
executed_at: { type: "string", format: "date-time", nullable: true },
|
|
2087
|
-
completed_at: { type: "string", format: "date-time", nullable: true },
|
|
2088
|
-
recurrence: { type: "string", nullable: true },
|
|
2089
|
-
next_run: { type: "string", format: "date-time", nullable: true },
|
|
2090
|
-
result: { type: "object", nullable: true },
|
|
2091
|
-
error: { type: "string", nullable: true },
|
|
2092
|
-
agentId: { type: "string" },
|
|
2093
|
-
agentName: { type: "string" },
|
|
2094
|
-
trajectory: {
|
|
2095
|
-
type: "array",
|
|
2096
|
-
nullable: true,
|
|
2097
|
-
description: "Step-by-step execution trajectory of the task",
|
|
2098
|
-
items: { $ref: "#/components/schemas/TaskTrajectoryStep" },
|
|
2099
|
-
},
|
|
2100
|
-
},
|
|
2101
|
-
},
|
|
2102
|
-
TaskTrajectoryStep: {
|
|
2103
|
-
type: "object",
|
|
2104
|
-
properties: {
|
|
2105
|
-
id: { type: "string" },
|
|
2106
|
-
role: { type: "string", enum: ["user", "assistant"] },
|
|
2107
|
-
content: {
|
|
2108
|
-
description: "Text content or array of tool use/result blocks",
|
|
2109
|
-
oneOf: [
|
|
2110
|
-
{ type: "string" },
|
|
2111
|
-
{
|
|
2112
|
-
type: "array",
|
|
2113
|
-
items: {
|
|
2114
|
-
type: "object",
|
|
2115
|
-
properties: {
|
|
2116
|
-
type: { type: "string", enum: ["tool_use", "tool_result"] },
|
|
2117
|
-
id: { type: "string" },
|
|
2118
|
-
name: { type: "string", description: "Tool name (for tool_use)" },
|
|
2119
|
-
input: { type: "object", description: "Tool input (for tool_use)" },
|
|
2120
|
-
tool_use_id: { type: "string", description: "Referenced tool_use ID (for tool_result)" },
|
|
2121
|
-
content: { type: "string", description: "Result text (for tool_result)" },
|
|
2122
|
-
is_error: { type: "boolean", description: "Whether the tool errored (for tool_result)" },
|
|
2123
|
-
},
|
|
2124
|
-
},
|
|
2125
|
-
},
|
|
2126
|
-
],
|
|
2127
|
-
},
|
|
2128
|
-
created_at: { type: "string", format: "date-time" },
|
|
2129
|
-
model: { type: "string", nullable: true },
|
|
2130
|
-
},
|
|
2131
|
-
},
|
|
2132
|
-
Skill: {
|
|
2133
|
-
type: "object",
|
|
2134
|
-
properties: {
|
|
2135
|
-
id: { type: "string" },
|
|
2136
|
-
name: { type: "string" },
|
|
2137
|
-
description: { type: "string" },
|
|
2138
|
-
content: { type: "string" },
|
|
2139
|
-
version: { type: "string" },
|
|
2140
|
-
license: { type: "string", nullable: true },
|
|
2141
|
-
compatibility: { type: "string", nullable: true },
|
|
2142
|
-
metadata: { type: "object" },
|
|
2143
|
-
allowed_tools: { type: "array", items: { type: "string" } },
|
|
2144
|
-
source: { type: "string", enum: ["local", "skillsmp", "github", "import"] },
|
|
2145
|
-
source_url: { type: "string", nullable: true },
|
|
2146
|
-
enabled: { type: "boolean" },
|
|
2147
|
-
project_id: { type: "string", nullable: true },
|
|
2148
|
-
created_at: { type: "string", format: "date-time" },
|
|
2149
|
-
updated_at: { type: "string", format: "date-time" },
|
|
2150
|
-
},
|
|
2151
|
-
},
|
|
2152
|
-
SkillCreate: {
|
|
2153
|
-
type: "object",
|
|
2154
|
-
required: ["name", "description", "content"],
|
|
2155
|
-
properties: {
|
|
2156
|
-
name: { type: "string", description: "Skill name (lowercase, hyphens allowed)" },
|
|
2157
|
-
description: { type: "string", description: "What this skill does" },
|
|
2158
|
-
content: { type: "string", description: "Skill instructions in markdown" },
|
|
2159
|
-
source: { type: "string", enum: ["local", "skillsmp", "github", "import"] },
|
|
2160
|
-
project_id: { type: "string", nullable: true, description: "Project ID (null for global)" },
|
|
2161
|
-
},
|
|
2162
|
-
},
|
|
2163
|
-
McpServer: {
|
|
2164
|
-
type: "object",
|
|
2165
|
-
properties: {
|
|
2166
|
-
id: { type: "string" },
|
|
2167
|
-
name: { type: "string" },
|
|
2168
|
-
type: { type: "string", enum: ["npm", "github", "http", "custom"] },
|
|
2169
|
-
package: { type: "string", nullable: true },
|
|
2170
|
-
command: { type: "string", nullable: true },
|
|
2171
|
-
url: { type: "string", nullable: true },
|
|
2172
|
-
port: { type: "integer", nullable: true },
|
|
2173
|
-
status: { type: "string", enum: ["stopped", "running"] },
|
|
2174
|
-
source: { type: "string", nullable: true },
|
|
2175
|
-
},
|
|
2176
|
-
},
|
|
2177
|
-
McpServerResponse: {
|
|
2178
|
-
type: "object",
|
|
2179
|
-
properties: {
|
|
2180
|
-
server: { $ref: "#/components/schemas/McpServer" },
|
|
2181
|
-
},
|
|
2182
|
-
},
|
|
2183
|
-
McpServerListResponse: {
|
|
2184
|
-
type: "object",
|
|
2185
|
-
properties: {
|
|
2186
|
-
servers: {
|
|
2187
|
-
type: "array",
|
|
2188
|
-
items: { $ref: "#/components/schemas/McpServer" },
|
|
2189
|
-
},
|
|
2190
|
-
},
|
|
2191
|
-
},
|
|
2192
|
-
CreateMcpServer: {
|
|
2193
|
-
type: "object",
|
|
2194
|
-
required: ["name", "type"],
|
|
2195
|
-
properties: {
|
|
2196
|
-
name: { type: "string" },
|
|
2197
|
-
type: { type: "string", enum: ["npm", "github", "http", "custom"] },
|
|
2198
|
-
package: { type: "string", description: "NPM package name (for npm type)" },
|
|
2199
|
-
command: { type: "string", description: "Command to run (for custom type)" },
|
|
2200
|
-
url: { type: "string", description: "Server URL (for http type)" },
|
|
2201
|
-
headers: { type: "object", description: "HTTP headers (for http type)" },
|
|
2202
|
-
},
|
|
2203
|
-
},
|
|
2204
|
-
McpTool: {
|
|
2205
|
-
type: "object",
|
|
2206
|
-
properties: {
|
|
2207
|
-
name: { type: "string" },
|
|
2208
|
-
description: { type: "string" },
|
|
2209
|
-
inputSchema: { type: "object" },
|
|
2210
|
-
},
|
|
2211
|
-
},
|
|
2212
|
-
McpToolResult: {
|
|
2213
|
-
type: "object",
|
|
2214
|
-
properties: {
|
|
2215
|
-
content: {
|
|
2216
|
-
type: "array",
|
|
2217
|
-
items: {
|
|
2218
|
-
type: "object",
|
|
2219
|
-
properties: {
|
|
2220
|
-
type: { type: "string", enum: ["text", "image", "resource"] },
|
|
2221
|
-
text: { type: "string" },
|
|
2222
|
-
data: { type: "string" },
|
|
2223
|
-
mimeType: { type: "string" },
|
|
2224
|
-
},
|
|
2225
|
-
},
|
|
2226
|
-
},
|
|
2227
|
-
isError: { type: "boolean" },
|
|
2228
|
-
},
|
|
2229
|
-
},
|
|
2230
|
-
Provider: {
|
|
2231
|
-
type: "object",
|
|
2232
|
-
properties: {
|
|
2233
|
-
id: { type: "string" },
|
|
2234
|
-
name: { type: "string" },
|
|
2235
|
-
type: { type: "string", enum: ["llm", "integration"] },
|
|
2236
|
-
docsUrl: { type: "string" },
|
|
2237
|
-
models: {
|
|
2238
|
-
type: "array",
|
|
2239
|
-
items: {
|
|
2240
|
-
type: "object",
|
|
2241
|
-
properties: {
|
|
2242
|
-
value: { type: "string" },
|
|
2243
|
-
label: { type: "string" },
|
|
2244
|
-
recommended: { type: "boolean" },
|
|
2245
|
-
},
|
|
2246
|
-
},
|
|
2247
|
-
},
|
|
2248
|
-
hasKey: { type: "boolean" },
|
|
2249
|
-
isValid: { type: "boolean", nullable: true },
|
|
2250
|
-
},
|
|
2251
|
-
},
|
|
2252
|
-
Project: {
|
|
2253
|
-
type: "object",
|
|
2254
|
-
properties: {
|
|
2255
|
-
id: { type: "string" },
|
|
2256
|
-
name: { type: "string" },
|
|
2257
|
-
description: { type: "string" },
|
|
2258
|
-
createdAt: { type: "string", format: "date-time" },
|
|
2259
|
-
},
|
|
2260
|
-
},
|
|
2261
|
-
DashboardStats: {
|
|
2262
|
-
type: "object",
|
|
2263
|
-
properties: {
|
|
2264
|
-
agents: {
|
|
2265
|
-
type: "object",
|
|
2266
|
-
properties: {
|
|
2267
|
-
total: { type: "integer" },
|
|
2268
|
-
running: { type: "integer" },
|
|
2269
|
-
},
|
|
2270
|
-
},
|
|
2271
|
-
tasks: {
|
|
2272
|
-
type: "object",
|
|
2273
|
-
properties: {
|
|
2274
|
-
total: { type: "integer" },
|
|
2275
|
-
pending: { type: "integer" },
|
|
2276
|
-
running: { type: "integer" },
|
|
2277
|
-
completed: { type: "integer" },
|
|
2278
|
-
},
|
|
2279
|
-
},
|
|
2280
|
-
providers: {
|
|
2281
|
-
type: "object",
|
|
2282
|
-
properties: {
|
|
2283
|
-
configured: { type: "integer" },
|
|
2284
|
-
},
|
|
2285
|
-
},
|
|
2286
|
-
},
|
|
2287
|
-
},
|
|
2288
|
-
// Telemetry schemas
|
|
2289
|
-
TelemetryBatch: {
|
|
2290
|
-
type: "object",
|
|
2291
|
-
required: ["agent_id", "events"],
|
|
2292
|
-
properties: {
|
|
2293
|
-
agent_id: { type: "string", description: "ID of the agent sending telemetry" },
|
|
2294
|
-
sent_at: { type: "string", format: "date-time", description: "When the batch was sent" },
|
|
2295
|
-
events: {
|
|
2296
|
-
type: "array",
|
|
2297
|
-
items: { $ref: "#/components/schemas/TelemetryEventInput" },
|
|
2298
|
-
},
|
|
2299
|
-
},
|
|
2300
|
-
},
|
|
2301
|
-
TelemetryEventInput: {
|
|
2302
|
-
type: "object",
|
|
2303
|
-
required: ["id", "timestamp", "category", "type", "level"],
|
|
2304
|
-
properties: {
|
|
2305
|
-
id: { type: "string", description: "Unique event ID" },
|
|
2306
|
-
timestamp: { type: "string", format: "date-time" },
|
|
2307
|
-
category: {
|
|
2308
|
-
type: "string",
|
|
2309
|
-
description: "Event category",
|
|
2310
|
-
enum: ["llm", "tool", "memory", "task", "agent", "mcp", "system"],
|
|
2311
|
-
},
|
|
2312
|
-
type: { type: "string", description: "Event type within category (e.g., 'request', 'response', 'error')" },
|
|
2313
|
-
level: { type: "string", enum: ["debug", "info", "warn", "error"] },
|
|
2314
|
-
trace_id: { type: "string", description: "Trace ID for correlating related events" },
|
|
2315
|
-
span_id: { type: "string", description: "Span ID within a trace" },
|
|
2316
|
-
thread_id: { type: "string", description: "Conversation thread ID" },
|
|
2317
|
-
data: {
|
|
2318
|
-
type: "object",
|
|
2319
|
-
description: "Event-specific data (tokens, model, tool name, etc.)",
|
|
2320
|
-
},
|
|
2321
|
-
metadata: { type: "object", description: "Additional metadata" },
|
|
2322
|
-
duration_ms: { type: "integer", description: "Duration in milliseconds (for timed events)" },
|
|
2323
|
-
error: { type: "string", description: "Error message if event represents an error" },
|
|
2324
|
-
},
|
|
2325
|
-
},
|
|
2326
|
-
TelemetryEvent: {
|
|
2327
|
-
type: "object",
|
|
2328
|
-
description: `A telemetry event from an agent. Events capture LLM calls, tool usage, memory operations, and agent activity.
|
|
2329
|
-
|
|
2330
|
-
**Common type values by category:**
|
|
2331
|
-
- **llm**: request, response, error
|
|
2332
|
-
- **tool**: call, result, error
|
|
2333
|
-
- **memory**: store, recall, consolidate
|
|
2334
|
-
- **task**: start, complete, fail
|
|
2335
|
-
- **agent**: start, stop, thread_activity
|
|
2336
|
-
- **system**: startup, shutdown, error`,
|
|
2337
|
-
properties: {
|
|
2338
|
-
id: { type: "string", description: "Unique event ID" },
|
|
2339
|
-
agent_id: { type: "string", description: "ID of the agent that generated this event" },
|
|
2340
|
-
timestamp: { type: "string", format: "date-time", description: "When the event occurred" },
|
|
2341
|
-
category: { type: "string", enum: ["llm", "tool", "memory", "task", "agent", "mcp", "system"], description: "Event category" },
|
|
2342
|
-
type: { type: "string", description: "Event type within category (e.g., 'thread_activity', 'request', 'call')" },
|
|
2343
|
-
level: { type: "string", enum: ["info", "warn", "error"], description: "Severity level" },
|
|
2344
|
-
trace_id: { type: "string", nullable: true, description: "Trace ID for correlating related events" },
|
|
2345
|
-
thread_id: { type: "string", nullable: true, description: "Conversation thread ID" },
|
|
2346
|
-
data: {
|
|
2347
|
-
type: "object",
|
|
2348
|
-
nullable: true,
|
|
2349
|
-
description: "Event-specific data. For thread_activity: { activity: string }. For llm: { model, tokens, prompt_tokens, completion_tokens }. For tool: { tool_name, input, output }."
|
|
2350
|
-
},
|
|
2351
|
-
duration_ms: { type: "integer", nullable: true, description: "Duration in milliseconds (for timed operations)" },
|
|
2352
|
-
error: { type: "string", nullable: true, description: "Error message if this is an error event" },
|
|
2353
|
-
},
|
|
2354
|
-
},
|
|
2355
|
-
TelemetryUsage: {
|
|
2356
|
-
type: "object",
|
|
2357
|
-
properties: {
|
|
2358
|
-
usage: {
|
|
2359
|
-
type: "object",
|
|
2360
|
-
properties: {
|
|
2361
|
-
total_tokens: { type: "integer" },
|
|
2362
|
-
prompt_tokens: { type: "integer" },
|
|
2363
|
-
completion_tokens: { type: "integer" },
|
|
2364
|
-
request_count: { type: "integer" },
|
|
2365
|
-
by_agent: {
|
|
2366
|
-
type: "array",
|
|
2367
|
-
items: {
|
|
2368
|
-
type: "object",
|
|
2369
|
-
properties: {
|
|
2370
|
-
agent_id: { type: "string" },
|
|
2371
|
-
total_tokens: { type: "integer" },
|
|
2372
|
-
request_count: { type: "integer" },
|
|
2373
|
-
},
|
|
2374
|
-
},
|
|
2375
|
-
},
|
|
2376
|
-
by_day: {
|
|
2377
|
-
type: "array",
|
|
2378
|
-
items: {
|
|
2379
|
-
type: "object",
|
|
2380
|
-
properties: {
|
|
2381
|
-
date: { type: "string", format: "date" },
|
|
2382
|
-
total_tokens: { type: "integer" },
|
|
2383
|
-
request_count: { type: "integer" },
|
|
2384
|
-
},
|
|
2385
|
-
},
|
|
2386
|
-
},
|
|
2387
|
-
},
|
|
2388
|
-
},
|
|
2389
|
-
},
|
|
2390
|
-
},
|
|
2391
|
-
TelemetryStats: {
|
|
2392
|
-
type: "object",
|
|
2393
|
-
properties: {
|
|
2394
|
-
stats: {
|
|
2395
|
-
type: "object",
|
|
2396
|
-
properties: {
|
|
2397
|
-
total_events: { type: "integer" },
|
|
2398
|
-
events_by_category: { type: "object", additionalProperties: { type: "integer" } },
|
|
2399
|
-
events_by_level: { type: "object", additionalProperties: { type: "integer" } },
|
|
2400
|
-
total_tokens: { type: "integer" },
|
|
2401
|
-
total_requests: { type: "integer" },
|
|
2402
|
-
avg_response_time_ms: { type: "number" },
|
|
2403
|
-
error_count: { type: "integer" },
|
|
2404
|
-
},
|
|
2405
|
-
},
|
|
2406
|
-
},
|
|
2407
|
-
},
|
|
2408
|
-
},
|
|
2409
|
-
},
|
|
2410
|
-
};
|