-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathopenapi.yaml
More file actions
438 lines (418 loc) · 12.1 KB
/
openapi.yaml
File metadata and controls
438 lines (418 loc) · 12.1 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
openapi: 3.1.0
info:
title: Network-AI Swarm Orchestrator
description: >
Multi-agent swarm orchestration API. Provides task delegation, shared
blackboard coordination, parallel agent spawning, and permission gating
via AuthGuardian. Requires the companion MCP server:
`npm install -g network-ai && npx network-ai-server --port 3001`
version: 4.11.2
license:
name: MIT
url: https://github.com/Jovancoding/Network-AI/blob/main/LICENSE
servers:
- url: http://localhost:3001
description: Local MCP server (default port)
paths:
/swarm/delegate:
post:
operationId: delegateTask
summary: Delegate a task to a sub-agent
description: >
Route a task to a specialized sub-agent within the swarm. Common agent
types: data_analyst, strategy_advisor, risk_assessor, orchestrator.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DelegateTaskRequest'
responses:
'200':
description: Task accepted and queued
content:
application/json:
schema:
$ref: '#/components/schemas/DelegateTaskResponse'
/swarm/state:
get:
operationId: querySwarmState
summary: Query current swarm state
description: >
Returns active tasks, blackboard contents, agent availability, and
permission grants.
parameters:
- name: scope
in: query
schema:
type: string
enum: [all, agents, tasks, blackboard, permissions]
default: all
description: Scope of state information to retrieve
- name: agentFilter
in: query
schema:
type: array
items:
type: string
description: Filter results to specific agent IDs
- name: includeHistory
in: query
schema:
type: boolean
default: false
description: Include historical task execution data
responses:
'200':
description: Current swarm state
content:
application/json:
schema:
$ref: '#/components/schemas/SwarmStateResponse'
/swarm/parallel:
post:
operationId: spawnParallelAgents
summary: Spawn multiple agents in parallel
description: >
Execute multiple sub-tasks simultaneously and synthesize results.
Useful for multi-perspective analysis.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ParallelAgentsRequest'
responses:
'200':
description: Synthesized results from all parallel agents
content:
application/json:
schema:
$ref: '#/components/schemas/ParallelAgentsResponse'
/auth/permission:
post:
operationId: requestPermission
summary: Request AuthGuardian permission
description: >
Gate access to protected resource types. Always call before DATABASE,
PAYMENTS, EMAIL, or FILE_EXPORT operations.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PermissionRequest'
responses:
'200':
description: Permission decision
content:
application/json:
schema:
$ref: '#/components/schemas/PermissionResponse'
/context/inject:
get:
operationId: injectContext
summary: Get project context for agent injection
description: >
Returns the persistent project context (Layer 3 memory) as a formatted
markdown block. Prepend this to any agent's system prompt so all agents
share the same long-term project awareness: goals, tech stack,
architecture decisions, milestones, and banned approaches.
responses:
'200':
description: Formatted project context block
content:
application/json:
schema:
type: object
properties:
contextMarkdown:
type: string
description: Markdown block ready to inject into system prompt
updatedAt:
type: string
description: ISO timestamp of last context update
/context/update:
post:
operationId: updateContext
summary: Update persistent project context
description: >
Persist a decision, milestone, stack entry, goal, or banned approach
to the project context file (Layer 3 memory). Changes survive across
all agent sessions — every future agent that calls injectContext will
see them.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateContextRequest'
responses:
'200':
description: Context section updated
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
section:
type: string
/blackboard/{key}:
operationId: readBlackboard
summary: Read a blackboard entry
parameters:
- name: key
in: path
required: true
schema:
type: string
description: Blackboard key (e.g. task:001:data_analyst)
responses:
'200':
description: Blackboard entry value (null if expired or not found)
content:
application/json:
schema:
type: object
properties:
key:
type: string
value: {}
expiresAt:
type: string
nullable: true
put:
operationId: updateBlackboard
summary: Write or update a blackboard entry
parameters:
- name: key
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BlackboardWriteRequest'
responses:
'200':
description: Write confirmed
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
previousValue: {}
/qa/harness:
post:
operationId: runQAHarness
summary: Run QA test harness
description: >
Run a batch of blackboard entries through the quality gate and return
aggregate results including pass rate, contradictions, and a regression snapshot.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/QAHarnessRequest'
responses:
'200':
description: QA harness results
content:
application/json:
schema:
$ref: '#/components/schemas/QAHarnessResponse'
components:
schemas:
DelegateTaskRequest:
type: object
required: [targetAgent, taskPayload]
properties:
targetAgent:
type: string
description: Agent identifier (e.g. data_analyst, strategy_advisor)
taskPayload:
type: object
description: Task context, instructions, and required data
priority:
type: string
enum: [low, normal, high, critical]
default: normal
timeout:
type: number
default: 30000
description: Max execution time in milliseconds
requiresAuth:
type: boolean
default: false
DelegateTaskResponse:
type: object
properties:
taskId:
type: string
status:
type: string
result: {}
agentTrace:
type: array
items:
type: object
SwarmStateResponse:
type: object
properties:
timestamp:
type: string
activeAgents:
type: array
items:
type: object
pendingTasks:
type: array
items:
type: object
blackboardSnapshot:
type: object
permissionGrants:
type: array
items:
type: object
ParallelAgentsRequest:
type: object
required: [tasks]
properties:
tasks:
type: array
items:
type: object
required: [agentType, taskPayload]
properties:
agentType:
type: string
taskPayload:
type: object
synthesisStrategy:
type: string
enum: [merge, vote, chain, first-success]
default: merge
ParallelAgentsResponse:
type: object
properties:
synthesizedResult: {}
individualResults:
type: array
items:
type: object
executionMetrics:
type: object
PermissionRequest:
type: object
required: [resourceType, justification]
properties:
resourceType:
type: string
enum: [DATABASE, PAYMENTS, EMAIL, FILE_EXPORT]
justification:
type: string
description: Specific reason for access — must relate to the current task
scope:
type: string
description: Specific access scope (e.g. read:invoices)
PermissionResponse:
type: object
properties:
granted:
type: boolean
grantToken:
type: string
nullable: true
expiresAt:
type: string
nullable: true
restrictions:
type: array
items:
type: string
BlackboardWriteRequest:
type: object
required: [value]
properties:
value: {}
ttl:
type: number
description: Time-to-live in seconds (optional)
UpdateContextRequest:
type: object
required: [section]
properties:
section:
type: string
enum: [decisions, milestones, stack, goals, banned, project]
description: The context section to update
add:
description: Item to append (JSON object or plain string depending on section)
set:
type: object
description: Key-value pairs to merge (used for stack and project sections)
complete:
type: string
description: Milestone name to mark completed (milestones section only)
QAHarnessRequest:
type: object
required: [scenarios]
properties:
scenarios:
type: array
items:
type: object
required: [id, key, value, sourceAgent]
properties:
id:
type: string
key:
type: string
value: {}
sourceAgent:
type: string
minScore:
type: number
qualityThreshold:
type: number
description: Global minimum quality score (0-1). Defaults to 0.7.
QAHarnessResponse:
type: object
properties:
total:
type: integer
passed:
type: integer
failed:
type: integer
passRate:
type: number
contradictions:
type: array
items:
type: object
properties:
key:
type: string
agentA:
type: string
agentB:
type: string
snapshot:
type: object
properties:
timestamp:
type: string
scenariosRun:
type: integer
scenarioPassRate:
type: number