-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathopenapi.yaml
More file actions
441 lines (417 loc) · 10.6 KB
/
Copy pathopenapi.yaml
File metadata and controls
441 lines (417 loc) · 10.6 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
openapi: 3.0.0
info:
title: Agent Relay Dashboard API
description: |
Dashboard server API for Agent Relay - WebSocket event subscriptions, proxy mode, and HTTP endpoints.
version: 1.0.0
contact:
name: Agent Relay
url: https://github.com/AgentWorkforce/relay-dashboard
license:
name: Apache 2.0
servers:
- url: http://localhost:3889
description: Local dashboard server (standalone mode)
- url: http://localhost:5000
description: Proxy mode server
- url: http://localhost:6000
description: Mock mode server
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: Bearer token for proxy mode
wsAuth:
type: apiKey
in: header
name: Authorization
description: WebSocket auth token
schemas:
Message:
type: object
properties:
id:
type: string
type:
type: string
enum: [agent_output, agent_status, message, error, system]
agent:
type: string
content:
type: string
timestamp:
type: string
format: date-time
metadata:
type: object
MessageBuffer:
type: object
properties:
messageId:
type: string
agentName:
type: string
content:
type: string
timestamp:
type: string
format: date-time
SystemStatus:
type: object
properties:
mode:
type: string
enum: [standalone, proxy, mock]
connected:
type: boolean
agents:
type: array
items:
type: object
properties:
name:
type: string
status:
type: string
uptime:
type: integer
Error:
type: object
properties:
error:
type: string
code:
type: string
paths:
/health:
get:
summary: Health check
description: Dashboard server health status
tags:
- System
responses:
'200':
description: Server is healthy
content:
application/json:
schema:
type: object
properties:
status:
type: string
mode:
type: string
/api/status:
get:
summary: Get system status
description: Get dashboard system status and connection info
tags:
- System
responses:
'200':
description: System status
content:
application/json:
schema:
$ref: '#/components/schemas/SystemStatus'
/ws:
get:
summary: WebSocket upgrade
description: |
Upgrade connection to WebSocket for real-time message updates.
**Connection:**
- Establish WebSocket connection to `/ws`
- Optional query param: `workspaceId=<id>` to filter messages
**Authentication (proxy mode):**
- Pass `Authorization: Bearer <token>` header
**Message Format:**
```json
{
"type": "subscribe|unsubscribe|message",
"agent": "agent_name",
"content": "...",
"metadata": {...}
}
```
**Subscription:**
Subscribe to specific agent outputs:
```json
{"type": "subscribe", "agent": "Lead"}
```
**Unsubscription:**
Stop receiving agent output:
```json
{"type": "unsubscribe", "agent": "Lead"}
```
tags:
- WebSocket
security:
- wsAuth: []
parameters:
- name: workspaceId
in: query
schema:
type: string
description: Workspace ID to filter messages (proxy mode)
responses:
'101':
description: WebSocket connection established
'401':
description: Unauthorized (proxy mode)
'400':
description: Bad WebSocket upgrade request
/api/messages:
get:
summary: Get message history
description: Retrieve recent message history (available in standalone/mock modes)
tags:
- Messages
parameters:
- name: agent
in: query
schema:
type: string
description: Filter by agent name
- name: limit
in: query
schema:
type: integer
default: 50
description: Number of messages to return
responses:
'200':
description: Message history
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Message'
'501':
description: Not supported in this mode
/api/agents:
get:
summary: List agents
description: Get list of all connected agents (standalone/mock modes)
tags:
- Agents
responses:
'200':
description: List of agents
content:
application/json:
schema:
type: array
items:
type: object
properties:
name:
type: string
status:
type: string
model:
type: string
'501':
description: Not supported in this mode
/api/agents/{name}:
get:
summary: Get agent details
description: Get detailed information about an agent
tags:
- Agents
parameters:
- name: name
in: path
required: true
schema:
type: string
responses:
'200':
description: Agent details
content:
application/json:
schema:
type: object
properties:
name:
type: string
status:
type: string
model:
type: string
uptime:
type: integer
lastSeen:
type: string
format: date-time
'404':
description: Agent not found
/api/agents/{name}/logs:
get:
summary: Get agent logs
description: Retrieve logs for a specific agent
tags:
- Agents
parameters:
- name: name
in: path
required: true
schema:
type: string
- name: lines
in: query
schema:
type: integer
default: 50
responses:
'200':
description: Agent logs
content:
application/json:
schema:
type: object
properties:
logs:
type: array
items:
type: string
/api/daemon/info:
get:
summary: Get daemon info
description: Get information about the connected daemon
tags:
- Daemon
security:
- bearerAuth: []
responses:
'200':
description: Daemon information
content:
application/json:
schema:
type: object
properties:
id:
type: string
name:
type: string
version:
type: string
uptime:
type: integer
'401':
description: Unauthorized (proxy mode)
'503':
description: Daemon not connected
/api/proxy/{path}:
get:
summary: Proxy request to daemon
description: Proxy HTTP request to connected daemon (proxy mode)
tags:
- Proxy
security:
- bearerAuth: []
parameters:
- name: path
in: path
required: true
schema:
type: string
description: Path to proxy to daemon
responses:
'200':
description: Proxied response
'401':
description: Unauthorized
'503':
description: Daemon not available
'502':
description: Daemon proxy error
post:
summary: Proxy request to daemon
description: Proxy HTTP POST request to connected daemon (proxy mode)
tags:
- Proxy
security:
- bearerAuth: []
parameters:
- name: path
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
responses:
'200':
description: Proxied response
'401':
description: Unauthorized
'502':
description: Daemon proxy error
/api/mock/spawn:
post:
summary: Spawn mock agent
description: Spawn a mock agent for testing (mock mode only)
tags:
- Mock
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
behavior:
type: string
enum: [slow, fast, error, streaming]
responses:
'201':
description: Mock agent spawned
'405':
description: Not available in this mode
/api/mock/simulate:
post:
summary: Simulate events
description: Simulate agent events for testing (mock mode only)
tags:
- Mock
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
agent:
type: string
event:
type: string
content:
type: string
responses:
'201':
description: Event simulated
'405':
description: Not available in this mode
tags:
- name: System
description: Dashboard system status
- name: WebSocket
description: Real-time WebSocket communication
- name: Messages
description: Message history and retrieval
- name: Agents
description: Agent information and logs
- name: Daemon
description: Daemon information (proxy mode)
- name: Proxy
description: Proxy requests to daemon (proxy mode)
- name: Mock
description: Mock agent simulation (mock mode)