miadi 1.0.14

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.
Files changed (53) hide show
  1. package/.env.example +28 -0
  2. package/ARCHITECTURE.md +290 -0
  3. package/CLAUDE.md +269 -0
  4. package/GEMINI.md +80 -0
  5. package/MCP_CONNECTOR_READY.md +219 -0
  6. package/MCP_LEARNING_NOTES.md +178 -0
  7. package/MCP_REBUILD_PLAN.md +159 -0
  8. package/MCP_REMOTE_SERVER_SPEC.md +373 -0
  9. package/MIA.md +344 -0
  10. package/MIETTE.md +195 -0
  11. package/README.md +264 -0
  12. package/REMOTE_MCP_TRANSFORMATION_GUIDE.md +384 -0
  13. package/STATUS.md +191 -0
  14. package/TOOL_SELECTION_PLAN.md +340 -0
  15. package/WAKE_UP_SUMMARY.md +102 -0
  16. package/__PUBLISH.sh +1 -0
  17. package/book/_/ledgers/ledger_miadi_mcp_analysis_250730.md +0 -0
  18. package/conversations/2507301433.claude.issue.11.2025-07-30-this-mcp-is-not-working-another-instance-of-yours.txt +756 -0
  19. package/conversations/2507301601.cursor.reverse_engineer_mcp_service_for.md +808 -0
  20. package/conversations/2508050125.llmcon.claude.MIADI_TOOLS-implement-what-is-in-toolselectionplanmd.txt +1235 -0
  21. package/conversations/2508051939.llmcon.claude.issue-14.TransitionToPlanningIT.implement-what-is-in-toolselectionplanmd.txt +1424 -0
  22. package/conversations/2508082352.llmcon.claude.MCP-Remote-Take-II.txt +1658 -0
  23. package/dist/index-remote.js +54736 -0
  24. package/dist/index.js +32363 -0
  25. package/mcp.sample.json +14 -0
  26. package/openapi.yml +2161 -0
  27. package/package.json +56 -0
  28. package/research/MCP_Research_Perplexity_2508060045.md +410 -0
  29. package/samples/README.md +2 -0
  30. package/scripts/ngrokserve.sh +6 -0
  31. package/scripts/start-remote.sh +141 -0
  32. package/scripts/start-with-ngrok.sh +140 -0
  33. package/src/api-client.ts +254 -0
  34. package/src/index-remote.ts +406 -0
  35. package/src/index-simple.ts +232 -0
  36. package/src/index.ts +510 -0
  37. package/src/tool-registry.ts +223 -0
  38. package/src/tools/ai-tools.ts +69 -0
  39. package/src/tools/capability-tools.ts +79 -0
  40. package/src/tools/forge-tools.ts +51 -0
  41. package/src/tools/memory-tools.ts +137 -0
  42. package/src/tools/session-tools.ts +135 -0
  43. package/src/tools/workflow-tools.ts +65 -0
  44. package/src/types.ts +291 -0
  45. package/src/utils.ts +279 -0
  46. package/tests/quick-test.sh +116 -0
  47. package/tests/run-all-tests.sh +167 -0
  48. package/tests/test-agent-capabilities.sh +364 -0
  49. package/tests/test-connectivity.sh +90 -0
  50. package/tests/test-memory-operations.sh +236 -0
  51. package/tests/test-session-management.sh +320 -0
  52. package/tests/test-tool-discovery.sh +151 -0
  53. package/tsconfig.json +24 -0
package/openapi.yml ADDED
@@ -0,0 +1,2161 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: Miadi Three-Pathway Agent System API
4
+ description: |
5
+ Production-ready API specification for the Miadi Three-Pathway Agent System featuring:
6
+ - Dynamic agent sessions with persona and mode management
7
+ - Context-aware capability resolution
8
+ - Natural language cue detection for seamless switching
9
+ - Redis memory operations and workflow management
10
+ - AI/OpenAI integration for intelligent responses
11
+ version: 3.1.3
12
+ contact:
13
+ name: Miadi Team
14
+ email: support@jgwill.com
15
+ url: https://github.com/jgwill/Miadi
16
+ license:
17
+ name: MIT
18
+ url: https://opensource.org/licenses/MIT
19
+ servers:
20
+ - url: https://__YOUR_CUSTOM_DOMAIN__.ngrok-free.app
21
+ description: Production server
22
+ paths:
23
+ /api/memory:
24
+ get:
25
+ summary: Retrieve memory data
26
+ description: >-
27
+ Get data from memory storage or list all keys. The server automatically
28
+ detects the Redis data type of the key to prevent WRONGTYPE errors when
29
+ a different type is stored.
30
+ operationId: getMemory
31
+ parameters:
32
+ - name: key
33
+ in: query
34
+ description: Key to retrieve (required unless list=true)
35
+ required: false
36
+ schema:
37
+ type: string
38
+ - name: list
39
+ in: query
40
+ description: Set to 'true' to list all keys (requires writer permission)
41
+ required: false
42
+ schema:
43
+ type: string
44
+ enum: ['true', 'false']
45
+ - name: pattern
46
+ in: query
47
+ description: Pattern to match when listing keys (used with list=true)
48
+ required: false
49
+ schema:
50
+ type: string
51
+ - name: type
52
+ in: query
53
+ description: Redis data type to retrieve (auto, string, hash, list, set, zset)
54
+ required: false
55
+ schema:
56
+ type: string
57
+ enum: ['auto', 'string', 'hash', 'list', 'set', 'zset']
58
+ default: 'auto'
59
+ responses:
60
+ '200':
61
+ description: Successful operation
62
+ content:
63
+ application/json:
64
+ schema:
65
+ oneOf:
66
+ - type: object
67
+ properties:
68
+ key:
69
+ type: string
70
+ type:
71
+ type: string
72
+ enum: ['string', 'hash', 'list', 'set', 'zset']
73
+ value:
74
+ type: object
75
+ timestamp:
76
+ type: string
77
+ format: date-time
78
+ - type: object
79
+ properties:
80
+ keys:
81
+ type: array
82
+ items:
83
+ type: string
84
+ count:
85
+ type: integer
86
+ timestamp:
87
+ type: string
88
+ format: date-time
89
+ '400':
90
+ description: Missing key parameter
91
+ content:
92
+ application/json:
93
+ schema:
94
+ $ref: '#/components/schemas/Error'
95
+ '401':
96
+ description: Unauthorized
97
+ content:
98
+ application/json:
99
+ schema:
100
+ $ref: '#/components/schemas/Error'
101
+ '404':
102
+ description: Key not found
103
+ content:
104
+ application/json:
105
+ schema:
106
+ $ref: '#/components/schemas/Error'
107
+ '500':
108
+ description: Server error
109
+ content:
110
+ application/json:
111
+ schema:
112
+ $ref: '#/components/schemas/Error'
113
+ x-openai-isConsequential: false
114
+ post:
115
+ summary: Store data in memory
116
+ description: Store a value in memory with the given key
117
+ operationId: storeMemory
118
+ requestBody:
119
+ required: true
120
+ content:
121
+ application/json:
122
+ schema:
123
+ type: object
124
+ properties:
125
+ key:
126
+ type: string
127
+ value:
128
+ type: string
129
+ ttl:
130
+ type: integer
131
+ description: Time to live in seconds (-1 for no expiration)
132
+ type:
133
+ type: string
134
+ enum:
135
+ - string
136
+ - hash
137
+ - list
138
+ required:
139
+ - key
140
+ - value
141
+ responses:
142
+ '200':
143
+ description: Key stored successfully
144
+ content:
145
+ application/json:
146
+ schema:
147
+ type: object
148
+ properties:
149
+ key:
150
+ type: string
151
+ value:
152
+ type: string
153
+ ttl:
154
+ type: integer
155
+ description: Time to live in seconds (-1 for no expiration)
156
+ timestamp:
157
+ type: string
158
+ format: date-time
159
+ message:
160
+ type: string
161
+ '400':
162
+ description: Missing parameters
163
+ content:
164
+ application/json:
165
+ schema:
166
+ $ref: '#/components/schemas/Error'
167
+ '401':
168
+ description: Unauthorized
169
+ content:
170
+ application/json:
171
+ schema:
172
+ $ref: '#/components/schemas/Error'
173
+ '500':
174
+ description: Server error
175
+ content:
176
+ application/json:
177
+ schema:
178
+ $ref: '#/components/schemas/Error'
179
+ x-openai-isConsequential: false
180
+ /api/memory/meta:
181
+ get:
182
+ summary: Retrieve memory metadata
183
+ description: >-
184
+ Get metadata for memory storage. Includes the actual Redis data type
185
+ to aid clients in selecting the correct command.
186
+ operationId: getMemoryMeta
187
+ parameters:
188
+ - name: key
189
+ in: query
190
+ description: Key to retrieve metadata for
191
+ required: true
192
+ schema:
193
+ type: string
194
+ responses:
195
+ '200':
196
+ description: Successful operation
197
+ content:
198
+ application/json:
199
+ schema:
200
+ type: object
201
+ properties:
202
+ key:
203
+ type: string
204
+ exists:
205
+ type: boolean
206
+ ttl:
207
+ type: integer
208
+ nullable: true
209
+ type:
210
+ type: string
211
+ dataType:
212
+ type: string
213
+ description: Actual Redis data type
214
+ preview:
215
+ type: string
216
+ nullable: true
217
+ lastModified:
218
+ type: string
219
+ format: date-time
220
+ '400':
221
+ description: Missing key parameter
222
+ content:
223
+ application/json:
224
+ schema:
225
+ $ref: '#/components/schemas/Error'
226
+ '401':
227
+ description: Unauthorized
228
+ content:
229
+ application/json:
230
+ schema:
231
+ $ref: '#/components/schemas/Error'
232
+ '404':
233
+ description: Key not found
234
+ content:
235
+ application/json:
236
+ schema:
237
+ $ref: '#/components/schemas/Error'
238
+ '500':
239
+ description: Server error
240
+ content:
241
+ application/json:
242
+ schema:
243
+ $ref: '#/components/schemas/Error'
244
+ x-openai-isConsequential: false
245
+ /api/memory/ttl:
246
+ post:
247
+ summary: Update TTL for a memory key
248
+ description: Change the expiration time for an existing key
249
+ operationId: updateMemoryTTL
250
+ requestBody:
251
+ required: true
252
+ content:
253
+ application/json:
254
+ schema:
255
+ type: object
256
+ properties:
257
+ key:
258
+ type: string
259
+ ttl:
260
+ type: integer
261
+ description: Time to live in seconds (-1 for no expiration)
262
+ required:
263
+ - key
264
+ responses:
265
+ '200':
266
+ description: TTL updated successfully
267
+ content:
268
+ application/json:
269
+ schema:
270
+ type: object
271
+ properties:
272
+ key:
273
+ type: string
274
+ ttl:
275
+ type: integer
276
+ result:
277
+ type: integer
278
+ timestamp:
279
+ type: string
280
+ format: date-time
281
+ message:
282
+ type: string
283
+ '400':
284
+ description: Missing parameters
285
+ content:
286
+ application/json:
287
+ schema:
288
+ $ref: '#/components/schemas/Error'
289
+ '401':
290
+ description: Unauthorized
291
+ content:
292
+ application/json:
293
+ schema:
294
+ $ref: '#/components/schemas/Error'
295
+ '500':
296
+ description: Server error
297
+ content:
298
+ application/json:
299
+ schema:
300
+ $ref: '#/components/schemas/Error'
301
+ x-openai-isConsequential: false
302
+ /api/forge-state:
303
+ get:
304
+ summary: Get forge state
305
+ description: Check if the forge is open or closed
306
+ operationId: getForgeState
307
+ responses:
308
+ '200':
309
+ description: Forge state retrieved successfully
310
+ content:
311
+ application/json:
312
+ schema:
313
+ $ref: '#/components/schemas/ForgeStateResponse'
314
+ '401':
315
+ description: Unauthorized
316
+ content:
317
+ application/json:
318
+ schema:
319
+ $ref: '#/components/schemas/Error'
320
+ '500':
321
+ description: Server error
322
+ content:
323
+ application/json:
324
+ schema:
325
+ $ref: '#/components/schemas/Error'
326
+ x-openai-isConsequential: false
327
+ post:
328
+ summary: Update forge state
329
+ description: Open or close the forge
330
+ operationId: updateForgeState
331
+ requestBody:
332
+ required: true
333
+ content:
334
+ application/json:
335
+ schema:
336
+ $ref: '#/components/schemas/ForgeStateRequest'
337
+ responses:
338
+ '200':
339
+ description: Forge state updated successfully
340
+ content:
341
+ application/json:
342
+ schema:
343
+ $ref: '#/components/schemas/ForgeStateUpdateResponse'
344
+ '400':
345
+ description: Bad request
346
+ content:
347
+ application/json:
348
+ schema:
349
+ $ref: '#/components/schemas/Error'
350
+ '401':
351
+ description: Unauthorized
352
+ content:
353
+ application/json:
354
+ schema:
355
+ $ref: '#/components/schemas/Error'
356
+ '500':
357
+ description: Server error
358
+ content:
359
+ application/json:
360
+ schema:
361
+ $ref: '#/components/schemas/Error'
362
+ x-openai-isConsequential: false
363
+ /api/scan:
364
+ get:
365
+ summary: Scan Redis keys
366
+ description: Search for Redis keys using pattern matching or regex
367
+ operationId: scanKeys
368
+ parameters:
369
+ - name: pattern
370
+ in: query
371
+ description: Redis glob pattern for key matching
372
+ required: false
373
+ schema:
374
+ type: string
375
+ default: "*"
376
+ - name: regex
377
+ in: query
378
+ description: Regular expression for key matching (writer token only)
379
+ required: false
380
+ schema:
381
+ type: string
382
+ - name: limit
383
+ in: query
384
+ description: Maximum number of keys to return
385
+ required: false
386
+ schema:
387
+ type: integer
388
+ default: 4444
389
+ responses:
390
+ '200':
391
+ description: Keys retrieved successfully
392
+ content:
393
+ application/json:
394
+ schema:
395
+ $ref: '#/components/schemas/ScanResponse'
396
+ '400':
397
+ description: Bad request
398
+ content:
399
+ application/json:
400
+ schema:
401
+ $ref: '#/components/schemas/Error'
402
+ '401':
403
+ description: Unauthorized
404
+ content:
405
+ application/json:
406
+ schema:
407
+ $ref: '#/components/schemas/Error'
408
+ '403':
409
+ description: Forbidden
410
+ content:
411
+ application/json:
412
+ schema:
413
+ $ref: '#/components/schemas/Error'
414
+ '500':
415
+ description: Server error
416
+ content:
417
+ application/json:
418
+ schema:
419
+ $ref: '#/components/schemas/Error'
420
+ x-openai-isConsequential: false
421
+ /api/gather-memory:
422
+ get:
423
+ summary: Gather memory values
424
+ description: Collect Redis keys and their stored values. Useful for quickly reviewing multiple memory entries.
425
+ operationId: gatherMemoryValues
426
+ parameters:
427
+ - name: pattern
428
+ in: query
429
+ description: Redis glob pattern for key matching
430
+ required: false
431
+ schema:
432
+ type: string
433
+ default: "*"
434
+ - name: regex
435
+ in: query
436
+ description: Regular expression for key matching (writer token only)
437
+ required: false
438
+ schema:
439
+ type: string
440
+ - name: limit
441
+ in: query
442
+ description: Maximum number of items to return
443
+ required: false
444
+ schema:
445
+ type: integer
446
+ default: 300
447
+ - name: scanLimit
448
+ in: query
449
+ description: Maximum number of keys to scan for counting
450
+ required: false
451
+ schema:
452
+ type: integer
453
+ default: 3000
454
+ responses:
455
+ '200':
456
+ description: Items retrieved successfully
457
+ content:
458
+ application/json:
459
+ schema:
460
+ $ref: '#/components/schemas/GatherMemoryResponse'
461
+ '400':
462
+ description: Bad request
463
+ content:
464
+ application/json:
465
+ schema:
466
+ $ref: '#/components/schemas/Error'
467
+ '401':
468
+ description: Unauthorized
469
+ content:
470
+ application/json:
471
+ schema:
472
+ $ref: '#/components/schemas/Error'
473
+ '403':
474
+ description: Forbidden
475
+ content:
476
+ application/json:
477
+ schema:
478
+ $ref: '#/components/schemas/Error'
479
+ '500':
480
+ description: Server error
481
+ content:
482
+ application/json:
483
+ schema:
484
+ $ref: '#/components/schemas/Error'
485
+ x-openai-isConsequential: false
486
+ /api/collect-memory:
487
+ post:
488
+ summary: Collect specific memory values
489
+ description: Retrieve listed Redis keys and their stored values in one request.
490
+ operationId: collectMemory
491
+ requestBody:
492
+ required: true
493
+ content:
494
+ application/json:
495
+ schema:
496
+ $ref: '#/components/schemas/CollectMemoryRequest'
497
+ responses:
498
+ '200':
499
+ description: Items retrieved successfully
500
+ content:
501
+ application/json:
502
+ schema:
503
+ $ref: '#/components/schemas/CollectMemoryResponse'
504
+ x-cli-example: node scripts/miadi-cli.js collect-memory redstones:one redstones:two limit=2
505
+ x-openai-isConsequential: false
506
+ /api/cluster/view-key:
507
+ get:
508
+ summary: View key content
509
+ description: Retrieve the content of a Redis key for cluster view
510
+ operationId: viewKeyContent
511
+ parameters:
512
+ - name: key
513
+ in: query
514
+ description: The Redis key to view
515
+ required: true
516
+ schema:
517
+ type: string
518
+ responses:
519
+ '200':
520
+ description: Key content retrieved successfully
521
+ content:
522
+ application/json:
523
+ schema:
524
+ $ref: '#/components/schemas/KeyContentResponse'
525
+ '400':
526
+ description: Bad request
527
+ content:
528
+ application/json:
529
+ schema:
530
+ $ref: '#/components/schemas/Error'
531
+ '404':
532
+ description: Not found
533
+ content:
534
+ application/json:
535
+ schema:
536
+ $ref: '#/components/schemas/Error'
537
+ '500':
538
+ description: Server error
539
+ content:
540
+ application/json:
541
+ schema:
542
+ $ref: '#/components/schemas/Error'
543
+ x-openai-isConsequential: false
544
+ /api/cluster/search:
545
+ get:
546
+ summary: Search cluster
547
+ description: Search for keys in the cluster
548
+ operationId: searchCluster
549
+ parameters:
550
+ - name: term
551
+ in: query
552
+ description: Search term
553
+ required: true
554
+ schema:
555
+ type: string
556
+ responses:
557
+ '200':
558
+ description: Successful operation
559
+ content:
560
+ application/json:
561
+ schema:
562
+ type: object
563
+ properties:
564
+ keys:
565
+ type: array
566
+ items:
567
+ type: string
568
+ '400':
569
+ description: Bad request
570
+ content:
571
+ application/json:
572
+ schema:
573
+ $ref: '#/components/schemas/Error'
574
+ '500':
575
+ description: Server error
576
+ content:
577
+ application/json:
578
+ schema:
579
+ $ref: '#/components/schemas/Error'
580
+ x-openai-isConsequential: false
581
+ /api/glyph-map:
582
+ get:
583
+ summary: Get glyph map
584
+ description: Retrieve the glyph map
585
+ operationId: getGlyphMap
586
+ responses:
587
+ '200':
588
+ description: Successful operation
589
+ content:
590
+ application/json:
591
+ schema:
592
+ type: object
593
+ properties:
594
+ glyphs:
595
+ type: object
596
+ additionalProperties:
597
+ type: object
598
+ properties:
599
+ patterns:
600
+ type: array
601
+ items:
602
+ type: string
603
+ description:
604
+ type: string
605
+ categories:
606
+ type: object
607
+ additionalProperties:
608
+ type: array
609
+ items:
610
+ type: string
611
+ '404':
612
+ description: Not found
613
+ content:
614
+ application/json:
615
+ schema:
616
+ $ref: '#/components/schemas/Error'
617
+ '500':
618
+ description: Server error
619
+ content:
620
+ application/json:
621
+ schema:
622
+ $ref: '#/components/schemas/Error'
623
+ x-openai-isConsequential: false
624
+ /api/openai:
625
+ post:
626
+ summary: Make OpenAI API request
627
+ description: Send a request to OpenAI API
628
+ operationId: openaiRequest
629
+ requestBody:
630
+ required: true
631
+ content:
632
+ application/json:
633
+ schema:
634
+ type: object
635
+ required: [prompt]
636
+ properties:
637
+ modelId:
638
+ type: string
639
+ description: OpenAI model ID (uses default if not provided)
640
+ prompt:
641
+ type: string
642
+ description: Prompt text
643
+ maxTokens:
644
+ type: integer
645
+ description: Maximum tokens to generate
646
+ temperature:
647
+ type: number
648
+ description: Sampling temperature
649
+ stream:
650
+ type: boolean
651
+ description: Whether to stream the response
652
+ responses:
653
+ '200':
654
+ description: OpenAI response
655
+ content:
656
+ application/json:
657
+ schema:
658
+ $ref: '#/components/schemas/OpenAIResponse'
659
+ text/event-stream:
660
+ schema:
661
+ type: string
662
+ description: Stream of events for streaming responses
663
+ '400':
664
+ description: Bad request
665
+ content:
666
+ application/json:
667
+ schema:
668
+ $ref: '#/components/schemas/Error'
669
+ '401':
670
+ description: Unauthorized
671
+ content:
672
+ application/json:
673
+ schema:
674
+ $ref: '#/components/schemas/Error'
675
+ '404':
676
+ description: Model not found
677
+ content:
678
+ application/json:
679
+ schema:
680
+ $ref: '#/components/schemas/Error'
681
+ '500':
682
+ description: Server error
683
+ content:
684
+ application/json:
685
+ schema:
686
+ $ref: '#/components/schemas/Error'
687
+ x-openai-isConsequential: false
688
+
689
+ /api/ai:
690
+ post:
691
+ summary: Make AI request
692
+ description: Send a request to AI model
693
+ operationId: aiRequest
694
+ requestBody:
695
+ required: true
696
+ content:
697
+ application/json:
698
+ schema:
699
+ $ref: '#/components/schemas/AIRequest'
700
+ responses:
701
+ '200':
702
+ description: AI response
703
+ content:
704
+ application/json:
705
+ schema:
706
+ $ref: '#/components/schemas/AIResponse'
707
+ '400':
708
+ description: Bad request
709
+ content:
710
+ application/json:
711
+ schema:
712
+ $ref: '#/components/schemas/Error'
713
+ '401':
714
+ description: Unauthorized
715
+ content:
716
+ application/json:
717
+ schema:
718
+ $ref: '#/components/schemas/Error'
719
+ '404':
720
+ description: Model not found
721
+ content:
722
+ application/json:
723
+ schema:
724
+ $ref: '#/components/schemas/Error'
725
+ '500':
726
+ description: Server error
727
+ content:
728
+ application/json:
729
+ schema:
730
+ $ref: '#/components/schemas/Error'
731
+ x-openai-isConsequential: false
732
+
733
+ /api/workflow/agent-notify:
734
+ get:
735
+ summary: Check for GitHub events
736
+ description: Get GitHub events for an agent
737
+ operationId: getAgentEvents
738
+ parameters:
739
+ - name: agentId
740
+ in: query
741
+ description: Agent ID
742
+ required: true
743
+ schema:
744
+ type: string
745
+ responses:
746
+ '200':
747
+ description: GitHub events for agent
748
+ content:
749
+ application/json:
750
+ schema:
751
+ $ref: '#/components/schemas/AgentEventsResponse'
752
+ '400':
753
+ description: Bad request
754
+ content:
755
+ application/json:
756
+ schema:
757
+ $ref: '#/components/schemas/Error'
758
+ '401':
759
+ description: Unauthorized
760
+ content:
761
+ application/json:
762
+ schema:
763
+ $ref: '#/components/schemas/Error'
764
+ '404':
765
+ description: Agent not found
766
+ content:
767
+ application/json:
768
+ schema:
769
+ $ref: '#/components/schemas/Error'
770
+ '500':
771
+ description: Server error
772
+ content:
773
+ application/json:
774
+ schema:
775
+ $ref: '#/components/schemas/Error'
776
+ x-openai-isConsequential: false
777
+ post:
778
+ summary: Register agent for GitHub events
779
+ description: Subscribe an agent to GitHub event notifications
780
+ operationId: registerAgent
781
+ requestBody:
782
+ required: true
783
+ content:
784
+ application/json:
785
+ schema:
786
+ $ref: '#/components/schemas/AgentRegisterRequest'
787
+ responses:
788
+ '200':
789
+ description: Agent registered successfully
790
+ content:
791
+ application/json:
792
+ schema:
793
+ $ref: '#/components/schemas/AgentRegisterResponse'
794
+ '400':
795
+ description: Bad request
796
+ content:
797
+ application/json:
798
+ schema:
799
+ $ref: '#/components/schemas/Error'
800
+ '401':
801
+ description: Unauthorized
802
+ content:
803
+ application/json:
804
+ schema:
805
+ $ref: '#/components/schemas/Error'
806
+ '500':
807
+ description: Server error
808
+ content:
809
+ application/json:
810
+ schema:
811
+ $ref: '#/components/schemas/Error'
812
+ x-openai-isConsequential: false
813
+ /api/workflow/howto:
814
+ get:
815
+ summary: Get workflow setup guides
816
+ description: Get HOWTO guides for setting up and using the workflow system
817
+ operationId: getWorkflowHowto
818
+ parameters:
819
+ - name: topic
820
+ in: query
821
+ description: Specific topic to get guide for
822
+ required: false
823
+ schema:
824
+ type: string
825
+ enum:
826
+ - github-webhook-setup
827
+ - agent-registration
828
+ - agent-event-polling
829
+ - inter-agent-communication
830
+ - workflow-management
831
+ - authentication
832
+ - troubleshooting
833
+ responses:
834
+ '200':
835
+ description: HOWTO guide(s) retrieved successfully
836
+ content:
837
+ application/json:
838
+ schema:
839
+ oneOf:
840
+ - $ref: '#/components/schemas/WorkflowHowtoListResponse'
841
+ - $ref: '#/components/schemas/WorkflowHowtoResponse'
842
+ '401':
843
+ description: Unauthorized
844
+ content:
845
+ application/json:
846
+ schema:
847
+ $ref: '#/components/schemas/Error'
848
+ '404':
849
+ description: Topic not found
850
+ content:
851
+ application/json:
852
+ schema:
853
+ $ref: '#/components/schemas/Error'
854
+ '500':
855
+ description: Server error
856
+ content:
857
+ application/json:
858
+ schema:
859
+ $ref: '#/components/schemas/Error'
860
+ x-openai-isConsequential: false
861
+
862
+ /api/session/start:
863
+ post:
864
+ summary: Start a new agent session
865
+ description: |
866
+ Creates a new agent session with specified persona and mode.
867
+ Returns session details and resolved capabilities.
868
+
869
+ The session is stored in Redis with a 24-hour TTL and includes
870
+ automatic capability resolution based on persona + mode combination.
871
+ operationId: startSession
872
+ tags:
873
+ - Session Management
874
+ requestBody:
875
+ required: true
876
+ content:
877
+ application/json:
878
+ schema:
879
+ $ref: '#/components/schemas/SessionStartRequest'
880
+ examples:
881
+ basic:
882
+ summary: Basic session start
883
+ value:
884
+ persona: "mia-recursive-architect"
885
+ mode: "desktop"
886
+ userId: "user123"
887
+ with_context:
888
+ summary: Session with context overrides
889
+ value:
890
+ persona: "seraphine-navigator"
891
+ mode: "walking"
892
+ userId: "user123"
893
+ contextOverrides:
894
+ - name: "location"
895
+ type: "location"
896
+ value: "Central Park"
897
+ responses:
898
+ '200':
899
+ description: Session created successfully
900
+ content:
901
+ application/json:
902
+ schema:
903
+ $ref: '#/components/schemas/SessionStartResponse'
904
+ '400':
905
+ description: Invalid request parameters
906
+ content:
907
+ application/json:
908
+ schema:
909
+ $ref: '#/components/schemas/ErrorResponse'
910
+ '404':
911
+ description: Persona or mode not found
912
+ content:
913
+ application/json:
914
+ schema:
915
+ $ref: '#/components/schemas/ErrorResponse'
916
+ '500':
917
+ description: Internal server error
918
+ content:
919
+ application/json:
920
+ schema:
921
+ $ref: '#/components/schemas/ErrorResponse'
922
+ x-openai-isConsequential: false
923
+
924
+ /api/session/current:
925
+ get:
926
+ summary: Get current session details
927
+ description: |
928
+ Retrieves current session information by session ID.
929
+ Updates last activity timestamp and returns current capabilities.
930
+ operationId: getCurrentSession
931
+ tags:
932
+ - Session Management
933
+ parameters:
934
+ - name: sessionId
935
+ in: query
936
+ description: Session ID to retrieve
937
+ required: false
938
+ schema:
939
+ type: string
940
+ format: uuid
941
+ responses:
942
+ '200':
943
+ description: Session details retrieved successfully
944
+ content:
945
+ application/json:
946
+ schema:
947
+ $ref: '#/components/schemas/SessionCurrentResponse'
948
+ '400':
949
+ description: Session ID is required
950
+ content:
951
+ application/json:
952
+ schema:
953
+ $ref: '#/components/schemas/ErrorResponse'
954
+ '404':
955
+ description: Session not found
956
+ content:
957
+ application/json:
958
+ schema:
959
+ $ref: '#/components/schemas/ErrorResponse'
960
+ '500':
961
+ description: Internal server error
962
+ content:
963
+ application/json:
964
+ schema:
965
+ $ref: '#/components/schemas/ErrorResponse'
966
+ x-openai-isConsequential: false
967
+
968
+ /api/session/switch-mode:
969
+ put:
970
+ summary: Switch mode in existing session
971
+ description: |
972
+ Changes the mode in an active session and re-resolves capabilities.
973
+ Preserves the current persona while adapting to new environmental context.
974
+ operationId: switchMode
975
+ tags:
976
+ - Session Management
977
+ requestBody:
978
+ required: true
979
+ content:
980
+ application/json:
981
+ schema:
982
+ $ref: '#/components/schemas/SessionSwitchModeRequest'
983
+ example:
984
+ sessionId: "550e8400-e29b-41d4-a716-446655440000"
985
+ newMode: "walking"
986
+ contextOverrides:
987
+ - name: "pace"
988
+ type: "activity"
989
+ value: "brisk"
990
+ responses:
991
+ '200':
992
+ description: Mode switched successfully
993
+ content:
994
+ application/json:
995
+ schema:
996
+ $ref: '#/components/schemas/SessionCurrentResponse'
997
+ '400':
998
+ description: Invalid request parameters
999
+ content:
1000
+ application/json:
1001
+ schema:
1002
+ $ref: '#/components/schemas/ErrorResponse'
1003
+ '404':
1004
+ description: Session or mode not found
1005
+ content:
1006
+ application/json:
1007
+ schema:
1008
+ $ref: '#/components/schemas/ErrorResponse'
1009
+ '500':
1010
+ description: Internal server error
1011
+ content:
1012
+ application/json:
1013
+ schema:
1014
+ $ref: '#/components/schemas/ErrorResponse'
1015
+ x-openai-isConsequential: false
1016
+
1017
+ /api/session/switch-persona:
1018
+ put:
1019
+ summary: Switch persona in existing session
1020
+ description: |
1021
+ Changes the persona in an active session and re-resolves capabilities.
1022
+ Can optionally preserve the current mode or switch to persona's default mode.
1023
+ operationId: switchPersona
1024
+ tags:
1025
+ - Session Management
1026
+ requestBody:
1027
+ required: true
1028
+ content:
1029
+ application/json:
1030
+ schema:
1031
+ $ref: '#/components/schemas/SessionSwitchPersonaRequest'
1032
+ example:
1033
+ sessionId: "550e8400-e29b-41d4-a716-446655440000"
1034
+ newPersona: "miette-sprite"
1035
+ preserveMode: false
1036
+ responses:
1037
+ '200':
1038
+ description: Persona switched successfully
1039
+ content:
1040
+ application/json:
1041
+ schema:
1042
+ $ref: '#/components/schemas/SessionCurrentResponse'
1043
+ '400':
1044
+ description: Invalid request parameters
1045
+ content:
1046
+ application/json:
1047
+ schema:
1048
+ $ref: '#/components/schemas/ErrorResponse'
1049
+ '404':
1050
+ description: Session or persona not found
1051
+ content:
1052
+ application/json:
1053
+ schema:
1054
+ $ref: '#/components/schemas/ErrorResponse'
1055
+ '500':
1056
+ description: Internal server error
1057
+ content:
1058
+ application/json:
1059
+ schema:
1060
+ $ref: '#/components/schemas/ErrorResponse'
1061
+ x-openai-isConsequential: false
1062
+
1063
+ /api/session/end:
1064
+ delete:
1065
+ summary: End an active session
1066
+ description: |
1067
+ Terminates an active session and cleans up associated data.
1068
+ Session ID must be provided as query parameter.
1069
+ operationId: endSession
1070
+ tags:
1071
+ - Session Management
1072
+ parameters:
1073
+ - name: sessionId
1074
+ in: query
1075
+ description: Session ID to end
1076
+ required: true
1077
+ schema:
1078
+ type: string
1079
+ format: uuid
1080
+ responses:
1081
+ '200':
1082
+ description: Session ended successfully
1083
+ content:
1084
+ application/json:
1085
+ schema:
1086
+ type: object
1087
+ properties:
1088
+ success:
1089
+ type: boolean
1090
+ example: true
1091
+ message:
1092
+ type: string
1093
+ example: "Session ended successfully"
1094
+ timestamp:
1095
+ type: string
1096
+ format: date-time
1097
+ '400':
1098
+ description: Session ID is required
1099
+ content:
1100
+ application/json:
1101
+ schema:
1102
+ $ref: '#/components/schemas/ErrorResponse'
1103
+ '404':
1104
+ description: Session not found
1105
+ content:
1106
+ application/json:
1107
+ schema:
1108
+ $ref: '#/components/schemas/ErrorResponse'
1109
+ '500':
1110
+ description: Internal server error
1111
+ content:
1112
+ application/json:
1113
+ schema:
1114
+ $ref: '#/components/schemas/ErrorResponse'
1115
+ x-openai-isConsequential: false
1116
+
1117
+ /api/capabilities/resolve:
1118
+ post:
1119
+ summary: Resolve capabilities for persona/mode combination
1120
+ description: |
1121
+ Dynamically resolves available capabilities based on persona, mode, and context.
1122
+ Returns prioritized list with conflict resolution and priority scoring.
1123
+ operationId: resolveCapabilities
1124
+ tags:
1125
+ - Capability Resolution
1126
+ requestBody:
1127
+ required: true
1128
+ content:
1129
+ application/json:
1130
+ schema:
1131
+ $ref: '#/components/schemas/CapabilityResolveRequest'
1132
+ example:
1133
+ persona: "mia-recursive-architect"
1134
+ mode: "desktop"
1135
+ context:
1136
+ - name: "screen"
1137
+ type: "device"
1138
+ value: "large"
1139
+ - name: "focus_mode"
1140
+ type: "custom"
1141
+ value: "deep_work"
1142
+ responses:
1143
+ '200':
1144
+ description: Capabilities resolved successfully
1145
+ content:
1146
+ application/json:
1147
+ schema:
1148
+ $ref: '#/components/schemas/CapabilityResolveResponse'
1149
+ '400':
1150
+ description: Invalid request parameters
1151
+ content:
1152
+ application/json:
1153
+ schema:
1154
+ $ref: '#/components/schemas/ErrorResponse'
1155
+ '404':
1156
+ description: Persona or mode not found
1157
+ content:
1158
+ application/json:
1159
+ schema:
1160
+ $ref: '#/components/schemas/ErrorResponse'
1161
+ '500':
1162
+ description: Internal server error
1163
+ content:
1164
+ application/json:
1165
+ schema:
1166
+ $ref: '#/components/schemas/ErrorResponse'
1167
+ x-openai-isConsequential: false
1168
+
1169
+ /api/cues/detect:
1170
+ post:
1171
+ summary: Detect mode/persona switch cues from text
1172
+ description: |
1173
+ Analyzes natural language text for cues indicating mode or persona switches.
1174
+ Returns detected triggers with confidence scores and auto-switch recommendations.
1175
+
1176
+ Uses advanced NLP pattern matching against predefined triggers in modes/personas.
1177
+ operationId: detectCues
1178
+ tags:
1179
+ - Cue Detection
1180
+ requestBody:
1181
+ required: true
1182
+ content:
1183
+ application/json:
1184
+ schema:
1185
+ $ref: '#/components/schemas/CueDetectRequest'
1186
+ examples:
1187
+ mode_switch:
1188
+ summary: Mode switch detection
1189
+ value:
1190
+ text: "I'm going for a walk now"
1191
+ persona_switch:
1192
+ summary: Persona switch detection
1193
+ value:
1194
+ text: "I need Mia's analytical approach for this problem"
1195
+ currentSession:
1196
+ id: "550e8400-e29b-41d4-a716-446655440000"
1197
+ activePersona: "miette-sprite"
1198
+ currentMode: "desktop"
1199
+ responses:
1200
+ '200':
1201
+ description: Cues detected successfully
1202
+ content:
1203
+ application/json:
1204
+ schema:
1205
+ $ref: '#/components/schemas/CueDetectResponse'
1206
+ '400':
1207
+ description: Invalid request parameters
1208
+ content:
1209
+ application/json:
1210
+ schema:
1211
+ $ref: '#/components/schemas/ErrorResponse'
1212
+ '500':
1213
+ description: Internal server error
1214
+ content:
1215
+ application/json:
1216
+ schema:
1217
+ $ref: '#/components/schemas/ErrorResponse'
1218
+ x-openai-isConsequential: false
1219
+
1220
+ /api/session/list:
1221
+ get:
1222
+ summary: List active sessions
1223
+ description: |
1224
+ Lists active sessions with optional filtering by user ID.
1225
+ Supports pagination and returns sessions sorted by last activity.
1226
+ operationId: listSessions
1227
+ tags:
1228
+ - Session Management
1229
+ parameters:
1230
+ - name: userId
1231
+ in: query
1232
+ description: Filter sessions by user ID
1233
+ required: false
1234
+ schema:
1235
+ type: string
1236
+ - name: limit
1237
+ in: query
1238
+ description: Maximum number of sessions to return
1239
+ required: false
1240
+ schema:
1241
+ type: integer
1242
+ default: 10
1243
+ minimum: 1
1244
+ maximum: 100
1245
+ - name: offset
1246
+ in: query
1247
+ description: Number of sessions to skip for pagination
1248
+ required: false
1249
+ schema:
1250
+ type: integer
1251
+ default: 0
1252
+ minimum: 0
1253
+ responses:
1254
+ '200':
1255
+ description: Sessions retrieved successfully
1256
+ content:
1257
+ application/json:
1258
+ schema:
1259
+ $ref: '#/components/schemas/SessionListResponse'
1260
+ '500':
1261
+ description: Internal server error
1262
+ content:
1263
+ application/json:
1264
+ schema:
1265
+ $ref: '#/components/schemas/ErrorResponse'
1266
+ x-openai-isConsequential: false
1267
+
1268
+ /api/agent-info:
1269
+ get:
1270
+ summary: Get agent system information
1271
+ description: |
1272
+ Discovery endpoint that returns all available personas, modes, capabilities,
1273
+ and usage examples. Essential for understanding the Three-Pathway Agent System.
1274
+ operationId: getAgentInfo
1275
+ tags:
1276
+ - System Information
1277
+ responses:
1278
+ '200':
1279
+ description: Agent system information retrieved successfully
1280
+ content:
1281
+ application/json:
1282
+ schema:
1283
+ $ref: '#/components/schemas/AgentInfoResponse'
1284
+ '500':
1285
+ description: Internal server error
1286
+ content:
1287
+ application/json:
1288
+ schema:
1289
+ $ref: '#/components/schemas/ErrorResponse'
1290
+ x-openai-isConsequential: false
1291
+
1292
+ components:
1293
+ securitySchemes:
1294
+ BearerAuth:
1295
+ type: http
1296
+ scheme: bearer
1297
+ bearerFormat: JWT
1298
+ description: |
1299
+ Use either the reader token (ITERAX_TOKEN) for read operations or the writer token (ITERAX_TOKEN_WRITER) for write operations.
1300
+
1301
+ Format: `Bearer YOUR_TOKEN`
1302
+ schemas:
1303
+ Error:
1304
+ type: object
1305
+ properties:
1306
+ error:
1307
+ type: string
1308
+ message:
1309
+ type: string
1310
+ code:
1311
+ type: integer
1312
+ format: int32
1313
+ nullable: true
1314
+ # Memory Management Schemas
1315
+ MemoryResponse:
1316
+ type: object
1317
+ properties:
1318
+ key:
1319
+ type: string
1320
+ description: Redis key
1321
+ value:
1322
+ description: Retrieved value (any type)
1323
+ nullable: true
1324
+ timestamp:
1325
+ type: string
1326
+ format: date-time
1327
+ description: Timestamp of the operation
1328
+ example:
1329
+ key: "user:123"
1330
+ value: {"name": "John Doe", "email": "john@example.com"}
1331
+ timestamp: "2023-04-01T12:34:56.789Z"
1332
+
1333
+ # Forge State API schemas
1334
+ ForgeStateRequest:
1335
+ type: object
1336
+ required:
1337
+ - state
1338
+ properties:
1339
+ state:
1340
+ type: boolean
1341
+ description: New forge state (true for open, false for closed)
1342
+ example:
1343
+ state: true
1344
+ ForgeStateResponse:
1345
+ type: object
1346
+ properties:
1347
+ isOpen:
1348
+ type: boolean
1349
+ description: Current forge state
1350
+ timestamp:
1351
+ type: string
1352
+ format: date-time
1353
+ description: Timestamp of the operation
1354
+ example:
1355
+ isOpen: true
1356
+ timestamp: "2023-04-01T12:34:56.789Z"
1357
+ ForgeStateUpdateResponse:
1358
+ type: object
1359
+ properties:
1360
+ isOpen:
1361
+ type: boolean
1362
+ description: Updated forge state
1363
+ timestamp:
1364
+ type: string
1365
+ format: date-time
1366
+ description: Timestamp of the operation
1367
+ message:
1368
+ type: string
1369
+ description: Success message
1370
+ example:
1371
+ isOpen: true
1372
+ timestamp: "2023-04-01T12:34:56.789Z"
1373
+ message: "Forge is now open"
1374
+ # Simplified Response Schemas
1375
+ ScanResponse:
1376
+ type: object
1377
+ properties:
1378
+ keys:
1379
+ type: array
1380
+ items:
1381
+ type: string
1382
+ description: Matching Redis keys
1383
+ count:
1384
+ type: integer
1385
+ description: Number of keys
1386
+ timestamp:
1387
+ type: string
1388
+ format: date-time
1389
+
1390
+ GatherMemoryResponse:
1391
+ type: object
1392
+ properties:
1393
+ items:
1394
+ type: array
1395
+ items:
1396
+ type: object
1397
+ properties:
1398
+ key:
1399
+ type: string
1400
+ value:
1401
+ nullable: true
1402
+ description: Keys with their values
1403
+ count:
1404
+ type: integer
1405
+ timestamp:
1406
+ type: string
1407
+ format: date-time
1408
+
1409
+ CollectMemoryRequest:
1410
+ type: object
1411
+ properties:
1412
+ keys:
1413
+ type: array
1414
+ items:
1415
+ type: string
1416
+ description: Keys to retrieve
1417
+
1418
+ CollectMemoryResponse:
1419
+ type: object
1420
+ properties:
1421
+ items:
1422
+ type: array
1423
+ items:
1424
+ type: object
1425
+ properties:
1426
+ key:
1427
+ type: string
1428
+ value:
1429
+ nullable: true
1430
+ count:
1431
+ type: integer
1432
+ timestamp:
1433
+ type: string
1434
+ format: date-time
1435
+
1436
+ KeyContentResponse:
1437
+ type: object
1438
+ properties:
1439
+ key:
1440
+ type: string
1441
+ type:
1442
+ type: string
1443
+ value:
1444
+ nullable: true
1445
+ timestamp:
1446
+ type: string
1447
+ format: date-time
1448
+ # AI Integration Schemas
1449
+ OpenAIRequest:
1450
+ type: object
1451
+ required:
1452
+ - prompt
1453
+ properties:
1454
+ modelId:
1455
+ type: string
1456
+ prompt:
1457
+ type: string
1458
+ maxTokens:
1459
+ type: integer
1460
+ temperature:
1461
+ type: number
1462
+ stream:
1463
+ type: boolean
1464
+
1465
+ OpenAIResponse:
1466
+ type: object
1467
+ properties:
1468
+ id:
1469
+ type: string
1470
+ model:
1471
+ type: string
1472
+ choices:
1473
+ type: array
1474
+ items:
1475
+ type: object
1476
+ properties:
1477
+ text:
1478
+ type: string
1479
+ index:
1480
+ type: integer
1481
+ finish_reason:
1482
+ type: string
1483
+ usage:
1484
+ type: object
1485
+ properties:
1486
+ prompt_tokens:
1487
+ type: integer
1488
+ completion_tokens:
1489
+ type: integer
1490
+ total_tokens:
1491
+ type: integer
1492
+
1493
+ AIRequest:
1494
+ type: object
1495
+ required:
1496
+ - prompt
1497
+ properties:
1498
+ modelId:
1499
+ type: string
1500
+ prompt:
1501
+ type: string
1502
+ maxTokens:
1503
+ type: integer
1504
+ temperature:
1505
+ type: number
1506
+
1507
+ AIResponse:
1508
+ type: object
1509
+ properties:
1510
+ id:
1511
+ type: string
1512
+ model:
1513
+ type: string
1514
+ choices:
1515
+ type: array
1516
+ items:
1517
+ type: object
1518
+ properties:
1519
+ text:
1520
+ type: string
1521
+ index:
1522
+ type: integer
1523
+ finish_reason:
1524
+ type: string
1525
+ usage:
1526
+ type: object
1527
+ properties:
1528
+ prompt_tokens:
1529
+ type: integer
1530
+ completion_tokens:
1531
+ type: integer
1532
+ total_tokens:
1533
+ type: integer
1534
+ # Workflow Integration Schemas
1535
+ AgentRegisterRequest:
1536
+ type: object
1537
+ required:
1538
+ - agentId
1539
+ - eventTypes
1540
+ properties:
1541
+ agentId:
1542
+ type: string
1543
+ eventTypes:
1544
+ type: array
1545
+ items:
1546
+ type: string
1547
+ callbackUrl:
1548
+ type: string
1549
+
1550
+ AgentRegisterResponse:
1551
+ type: object
1552
+ properties:
1553
+ message:
1554
+ type: string
1555
+ agentId:
1556
+ type: string
1557
+ eventTypes:
1558
+ type: array
1559
+ items:
1560
+ type: string
1561
+ timestamp:
1562
+ type: string
1563
+ format: date-time
1564
+
1565
+ AgentEventsResponse:
1566
+ type: object
1567
+ properties:
1568
+ agentId:
1569
+ type: string
1570
+ events:
1571
+ type: array
1572
+ items:
1573
+ type: object
1574
+ properties:
1575
+ eventId:
1576
+ type: string
1577
+ type:
1578
+ type: string
1579
+ payload:
1580
+ type: object
1581
+ timestamp:
1582
+ type: string
1583
+ format: date-time
1584
+ count:
1585
+ type: integer
1586
+ timestamp:
1587
+ type: string
1588
+ format: date-time
1589
+
1590
+ WorkflowHowtoResponse:
1591
+ type: object
1592
+ properties:
1593
+ topic:
1594
+ type: string
1595
+ guide:
1596
+ type: object
1597
+ properties:
1598
+ title:
1599
+ type: string
1600
+ steps:
1601
+ type: array
1602
+ items:
1603
+ type: string
1604
+ timestamp:
1605
+ type: string
1606
+ format: date-time
1607
+
1608
+ # Workflow HOWTO API schemas
1609
+ WorkflowHowtoListResponse:
1610
+ type: object
1611
+ properties:
1612
+ message:
1613
+ type: string
1614
+ description: Description message
1615
+ availableTopics:
1616
+ type: array
1617
+ items:
1618
+ type: string
1619
+ description: List of available HOWTO topics
1620
+ usage:
1621
+ type: string
1622
+ description: Usage instructions
1623
+ examples:
1624
+ type: array
1625
+ items:
1626
+ type: string
1627
+ description: Example API calls
1628
+ timestamp:
1629
+ type: string
1630
+ format: date-time
1631
+ description: Timestamp of the operation
1632
+ example:
1633
+ message: "Agent Workflow HOWTO Guide"
1634
+ availableTopics: ["github-webhook-setup", "agent-registration", "agent-event-polling"]
1635
+ usage: "Add ?topic=TOPIC_NAME to get specific guide"
1636
+ examples: ["/api/workflow/howto?topic=github-webhook-setup"]
1637
+ timestamp: "2023-12-22T12:34:56.789Z"
1638
+
1639
+ WebhookResponse:
1640
+ type: object
1641
+ properties:
1642
+ message:
1643
+ type: string
1644
+ description: Status message
1645
+ eventId:
1646
+ type: string
1647
+ description: Generated event ID for this webhook (raw data storage key)
1648
+ structuredKey:
1649
+ type: string
1650
+ description: Structured key for agent-friendly data storage
1651
+ eventType:
1652
+ type: string
1653
+ description: Type of GitHub event received
1654
+ agentDataCreated:
1655
+ type: boolean
1656
+ description: Whether agent-friendly data was created
1657
+ timestamp:
1658
+ type: string
1659
+ format: date-time
1660
+ description: Processing timestamp
1661
+ example:
1662
+ message: "GitHub webhook received and stored"
1663
+ eventId: "github:webhook:250623143900"
1664
+ structuredKey: "Workspace.jgwill.Miadi:issue.34.250623143900"
1665
+ eventType: "issue_comment"
1666
+ agentDataCreated: true
1667
+ timestamp: "2023-12-22T12:34:56.789Z"
1668
+
1669
+
1670
+
1671
+ # Core Types
1672
+ AgentId:
1673
+ type: string
1674
+ enum: ["Mia", "Miette", "Resonova", "Seraphine", "Unified"]
1675
+ description: Available agent identifiers
1676
+
1677
+ ContextVariable:
1678
+ type: object
1679
+ required:
1680
+ - name
1681
+ - type
1682
+ properties:
1683
+ name:
1684
+ type: string
1685
+ description: Variable name
1686
+ type:
1687
+ type: string
1688
+ enum: ["location", "device", "activity", "time", "custom"]
1689
+ description: Variable type
1690
+ value:
1691
+ description: Variable value (any type)
1692
+ description:
1693
+ type: string
1694
+ description: Variable description
1695
+
1696
+ PersonalityTrait:
1697
+ type: object
1698
+ required:
1699
+ - name
1700
+ - value
1701
+ properties:
1702
+ name:
1703
+ type: string
1704
+ description: Trait name
1705
+ value:
1706
+ type: number
1707
+ minimum: 0
1708
+ maximum: 1
1709
+ description: Trait strength (0-1 scale)
1710
+ description:
1711
+ type: string
1712
+ description: Trait description
1713
+
1714
+ Capability:
1715
+ type: object
1716
+ required:
1717
+ - id
1718
+ - description
1719
+ properties:
1720
+ id:
1721
+ type: string
1722
+ description: Capability identifier
1723
+ description:
1724
+ type: string
1725
+ description: Capability description
1726
+ category:
1727
+ type: string
1728
+ enum: ["communication", "analysis", "creation", "navigation", "wellness", "system"]
1729
+ description: Capability category
1730
+ permissions:
1731
+ type: array
1732
+ items:
1733
+ type: string
1734
+ description: Required permissions
1735
+
1736
+ ResolvedCapability:
1737
+ allOf:
1738
+ - $ref: '#/components/schemas/Capability'
1739
+ - type: object
1740
+ required:
1741
+ - source
1742
+ - priority
1743
+ properties:
1744
+ source:
1745
+ type: string
1746
+ enum: ["persona", "mode", "global", "context"]
1747
+ description: Capability source
1748
+ priority:
1749
+ type: number
1750
+ description: Priority score for conflict resolution
1751
+
1752
+ AgentSession:
1753
+ type: object
1754
+ required:
1755
+ - id
1756
+ - activePersona
1757
+ - currentMode
1758
+ - resolvedCapabilities
1759
+ - startTime
1760
+ - lastActivity
1761
+ properties:
1762
+ id:
1763
+ type: string
1764
+ format: uuid
1765
+ description: Session identifier
1766
+ userId:
1767
+ type: string
1768
+ description: User identifier
1769
+ activePersona:
1770
+ type: string
1771
+ description: Current persona ID
1772
+ currentMode:
1773
+ type: string
1774
+ description: Current mode ID
1775
+ resolvedCapabilities:
1776
+ type: array
1777
+ items:
1778
+ $ref: '#/components/schemas/ResolvedCapability'
1779
+ description: Currently available capabilities
1780
+ contextOverrides:
1781
+ type: array
1782
+ items:
1783
+ $ref: '#/components/schemas/ContextVariable'
1784
+ description: Context variable overrides
1785
+ startTime:
1786
+ type: number
1787
+ description: Session start timestamp (Unix)
1788
+ lastActivity:
1789
+ type: number
1790
+ description: Last activity timestamp (Unix)
1791
+ metadata:
1792
+ type: object
1793
+ description: Additional session metadata
1794
+
1795
+ CueTrigger:
1796
+ type: object
1797
+ required:
1798
+ - phrase
1799
+ - confidence
1800
+ - autoSwitch
1801
+ properties:
1802
+ phrase:
1803
+ type: string
1804
+ description: Trigger phrase
1805
+ confidence:
1806
+ type: number
1807
+ minimum: 0
1808
+ maximum: 1
1809
+ description: Confidence threshold (0-1)
1810
+ autoSwitch:
1811
+ type: boolean
1812
+ description: Whether to auto-switch on detection
1813
+
1814
+ CueDetection:
1815
+ type: object
1816
+ required:
1817
+ - targetId
1818
+ - type
1819
+ - confidence
1820
+ - autoSwitch
1821
+ - trigger
1822
+ properties:
1823
+ targetId:
1824
+ type: string
1825
+ description: Target mode or persona ID
1826
+ type:
1827
+ type: string
1828
+ enum: ["mode", "persona"]
1829
+ description: Detection type
1830
+ confidence:
1831
+ type: number
1832
+ minimum: 0
1833
+ maximum: 1
1834
+ description: Detection confidence (0-1)
1835
+ autoSwitch:
1836
+ type: boolean
1837
+ description: Auto-switch recommendation
1838
+ trigger:
1839
+ $ref: '#/components/schemas/CueTrigger'
1840
+
1841
+ # Request/Response Schemas
1842
+ SessionStartRequest:
1843
+ type: object
1844
+ required:
1845
+ - persona
1846
+ - mode
1847
+ properties:
1848
+ persona:
1849
+ type: string
1850
+ description: Persona ID to activate
1851
+ mode:
1852
+ type: string
1853
+ description: Mode ID to activate
1854
+ contextOverrides:
1855
+ type: array
1856
+ items:
1857
+ $ref: '#/components/schemas/ContextVariable'
1858
+ description: Context variable overrides
1859
+ userId:
1860
+ type: string
1861
+ description: User identifier
1862
+
1863
+ SessionStartResponse:
1864
+ type: object
1865
+ required:
1866
+ - session
1867
+ - availableCapabilities
1868
+ - currentContext
1869
+ - timestamp
1870
+ properties:
1871
+ session:
1872
+ $ref: '#/components/schemas/AgentSession'
1873
+ availableCapabilities:
1874
+ type: array
1875
+ items:
1876
+ $ref: '#/components/schemas/ResolvedCapability'
1877
+ currentContext:
1878
+ type: array
1879
+ items:
1880
+ $ref: '#/components/schemas/ContextVariable'
1881
+ timestamp:
1882
+ type: string
1883
+ format: date-time
1884
+
1885
+ SessionCurrentResponse:
1886
+ type: object
1887
+ required:
1888
+ - session
1889
+ - availableCapabilities
1890
+ - currentContext
1891
+ - timestamp
1892
+ properties:
1893
+ session:
1894
+ $ref: '#/components/schemas/AgentSession'
1895
+ nullable: true
1896
+ availableCapabilities:
1897
+ type: array
1898
+ items:
1899
+ $ref: '#/components/schemas/ResolvedCapability'
1900
+ currentContext:
1901
+ type: array
1902
+ items:
1903
+ $ref: '#/components/schemas/ContextVariable'
1904
+ timestamp:
1905
+ type: string
1906
+ format: date-time
1907
+
1908
+ SessionSwitchModeRequest:
1909
+ type: object
1910
+ required:
1911
+ - sessionId
1912
+ - newMode
1913
+ properties:
1914
+ sessionId:
1915
+ type: string
1916
+ format: uuid
1917
+ description: Session ID to modify
1918
+ newMode:
1919
+ type: string
1920
+ description: New mode ID to activate
1921
+ contextOverrides:
1922
+ type: array
1923
+ items:
1924
+ $ref: '#/components/schemas/ContextVariable'
1925
+ description: Context variable overrides
1926
+
1927
+ SessionSwitchPersonaRequest:
1928
+ type: object
1929
+ required:
1930
+ - sessionId
1931
+ - newPersona
1932
+ properties:
1933
+ sessionId:
1934
+ type: string
1935
+ format: uuid
1936
+ description: Session ID to modify
1937
+ newPersona:
1938
+ type: string
1939
+ description: New persona ID to activate
1940
+ preserveMode:
1941
+ type: boolean
1942
+ default: true
1943
+ description: Whether to preserve current mode
1944
+
1945
+ CapabilityResolveRequest:
1946
+ type: object
1947
+ required:
1948
+ - persona
1949
+ - mode
1950
+ properties:
1951
+ persona:
1952
+ type: string
1953
+ description: Persona ID
1954
+ mode:
1955
+ type: string
1956
+ description: Mode ID
1957
+ context:
1958
+ type: array
1959
+ items:
1960
+ $ref: '#/components/schemas/ContextVariable'
1961
+ description: Context variables
1962
+
1963
+ CapabilityResolveResponse:
1964
+ type: object
1965
+ required:
1966
+ - capabilities
1967
+ - timestamp
1968
+ properties:
1969
+ capabilities:
1970
+ type: array
1971
+ items:
1972
+ $ref: '#/components/schemas/ResolvedCapability'
1973
+ timestamp:
1974
+ type: string
1975
+ format: date-time
1976
+
1977
+ CueDetectRequest:
1978
+ type: object
1979
+ required:
1980
+ - text
1981
+ properties:
1982
+ text:
1983
+ type: string
1984
+ description: Text to analyze for cues
1985
+ currentSession:
1986
+ $ref: '#/components/schemas/AgentSession'
1987
+ description: Current session context
1988
+ availableModes:
1989
+ type: array
1990
+ items:
1991
+ type: string
1992
+ description: Available mode IDs
1993
+ availablePersonas:
1994
+ type: array
1995
+ items:
1996
+ type: string
1997
+ description: Available persona IDs
1998
+
1999
+ CueDetectResponse:
2000
+ type: object
2001
+ required:
2002
+ - detections
2003
+ - timestamp
2004
+ properties:
2005
+ detections:
2006
+ type: array
2007
+ items:
2008
+ $ref: '#/components/schemas/CueDetection'
2009
+ suggestedAction:
2010
+ type: object
2011
+ properties:
2012
+ type:
2013
+ type: string
2014
+ enum: ["mode", "persona"]
2015
+ targetId:
2016
+ type: string
2017
+ confidence:
2018
+ type: number
2019
+ autoSwitch:
2020
+ type: boolean
2021
+ description: Suggested action based on highest confidence detection
2022
+ timestamp:
2023
+ type: string
2024
+ format: date-time
2025
+
2026
+ SessionListResponse:
2027
+ type: object
2028
+ required:
2029
+ - sessions
2030
+ - count
2031
+ - limit
2032
+ - offset
2033
+ - timestamp
2034
+ properties:
2035
+ sessions:
2036
+ type: array
2037
+ items:
2038
+ $ref: '#/components/schemas/AgentSession'
2039
+ description: List of active sessions
2040
+ count:
2041
+ type: integer
2042
+ description: Number of sessions returned
2043
+ limit:
2044
+ type: integer
2045
+ description: Maximum sessions requested
2046
+ offset:
2047
+ type: integer
2048
+ description: Number of sessions skipped
2049
+ timestamp:
2050
+ type: string
2051
+ format: date-time
2052
+ description: Response timestamp
2053
+
2054
+ AgentInfoResponse:
2055
+ type: object
2056
+ required:
2057
+ - personas
2058
+ - modes
2059
+ - capabilities
2060
+ - examples
2061
+ properties:
2062
+ personas:
2063
+ type: array
2064
+ items:
2065
+ type: object
2066
+ properties:
2067
+ id:
2068
+ type: string
2069
+ name:
2070
+ type: string
2071
+ agentId:
2072
+ type: string
2073
+ description:
2074
+ type: string
2075
+ capabilities:
2076
+ type: array
2077
+ items:
2078
+ type: string
2079
+ defaultMode:
2080
+ type: string
2081
+ description: Available personas
2082
+ modes:
2083
+ type: array
2084
+ items:
2085
+ type: object
2086
+ properties:
2087
+ id:
2088
+ type: string
2089
+ name:
2090
+ type: string
2091
+ description:
2092
+ type: string
2093
+ defaultCapabilities:
2094
+ type: array
2095
+ items:
2096
+ type: string
2097
+ triggers:
2098
+ type: array
2099
+ items:
2100
+ type: object
2101
+ properties:
2102
+ phrase:
2103
+ type: string
2104
+ confidence:
2105
+ type: number
2106
+ autoSwitch:
2107
+ type: boolean
2108
+ description: Available modes
2109
+ capabilities:
2110
+ type: array
2111
+ items:
2112
+ type: object
2113
+ properties:
2114
+ id:
2115
+ type: string
2116
+ description:
2117
+ type: string
2118
+ category:
2119
+ type: string
2120
+ permissions:
2121
+ type: array
2122
+ items:
2123
+ type: string
2124
+ description: Available capabilities
2125
+ examples:
2126
+ type: object
2127
+ additionalProperties:
2128
+ type: object
2129
+ properties:
2130
+ method:
2131
+ type: string
2132
+ url:
2133
+ type: string
2134
+ body:
2135
+ type: object
2136
+ description: Usage examples
2137
+
2138
+ ErrorResponse:
2139
+ type: object
2140
+ required:
2141
+ - error
2142
+ properties:
2143
+ error:
2144
+ type: string
2145
+ description: Error message
2146
+ message:
2147
+ type: string
2148
+ description: Detailed error description
2149
+
2150
+ tags:
2151
+ - name: Session Management
2152
+ description: Operations for managing agent sessions
2153
+ - name: Capability Resolution
2154
+ description: Dynamic capability resolution based on context
2155
+ - name: Cue Detection
2156
+ description: Natural language cue detection for mode/persona switching
2157
+ - name: System Information
2158
+ description: Discovery and system information endpoints
2159
+
2160
+ security:
2161
+ - BearerAuth: []