macro-agent 0.0.13 → 0.0.15

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 (143) hide show
  1. package/.claude/settings.local.json +59 -0
  2. package/dist/agent/agent-manager.d.ts.map +1 -1
  3. package/dist/agent/agent-manager.js +10 -4
  4. package/dist/agent/agent-manager.js.map +1 -1
  5. package/dist/cli/acp.d.ts +6 -0
  6. package/dist/cli/acp.d.ts.map +1 -1
  7. package/dist/cli/acp.js +16 -2
  8. package/dist/cli/acp.js.map +1 -1
  9. package/dist/map/adapter/index.d.ts +1 -1
  10. package/dist/map/adapter/index.d.ts.map +1 -1
  11. package/dist/map/adapter/index.js +1 -1
  12. package/dist/map/adapter/index.js.map +1 -1
  13. package/dist/map/utils/address-translation.d.ts +99 -0
  14. package/dist/map/utils/address-translation.d.ts.map +1 -0
  15. package/dist/map/utils/address-translation.js +285 -0
  16. package/dist/map/utils/address-translation.js.map +1 -0
  17. package/dist/map/utils/index.d.ts +7 -0
  18. package/dist/map/utils/index.d.ts.map +1 -0
  19. package/dist/map/utils/index.js +7 -0
  20. package/dist/map/utils/index.js.map +1 -0
  21. package/dist/server/combined-server.d.ts.map +1 -1
  22. package/dist/server/combined-server.js +8 -1
  23. package/dist/server/combined-server.js.map +1 -1
  24. package/dist/store/event-store.js +9 -2
  25. package/dist/store/event-store.js.map +1 -1
  26. package/dist/store/types/agents.d.ts +2 -0
  27. package/dist/store/types/agents.d.ts.map +1 -1
  28. package/package.json +4 -4
  29. package/references/acp-factory-ref/CHANGELOG.md +33 -0
  30. package/references/acp-factory-ref/LICENSE +21 -0
  31. package/references/acp-factory-ref/README.md +341 -0
  32. package/references/acp-factory-ref/package-lock.json +3102 -0
  33. package/references/acp-factory-ref/package.json +96 -0
  34. package/references/acp-factory-ref/python/CHANGELOG.md +33 -0
  35. package/references/acp-factory-ref/python/LICENSE +21 -0
  36. package/references/acp-factory-ref/python/Makefile +57 -0
  37. package/references/acp-factory-ref/python/README.md +253 -0
  38. package/references/acp-factory-ref/python/pyproject.toml +73 -0
  39. package/references/acp-factory-ref/python/tests/__init__.py +0 -0
  40. package/references/acp-factory-ref/python/tests/e2e/__init__.py +1 -0
  41. package/references/acp-factory-ref/python/tests/e2e/test_codex_e2e.py +349 -0
  42. package/references/acp-factory-ref/python/tests/e2e/test_gemini_e2e.py +165 -0
  43. package/references/acp-factory-ref/python/tests/e2e/test_opencode_e2e.py +296 -0
  44. package/references/acp-factory-ref/python/tests/test_client_handler.py +543 -0
  45. package/references/acp-factory-ref/python/tests/test_pushable.py +199 -0
  46. package/references/claude-code-acp/.github/workflows/ci.yml +45 -0
  47. package/references/claude-code-acp/.github/workflows/publish.yml +34 -0
  48. package/references/claude-code-acp/.prettierrc.json +4 -0
  49. package/references/claude-code-acp/CHANGELOG.md +249 -0
  50. package/references/claude-code-acp/LICENSE +222 -0
  51. package/references/claude-code-acp/README.md +53 -0
  52. package/references/claude-code-acp/docs/RELEASES.md +24 -0
  53. package/references/claude-code-acp/eslint.config.js +48 -0
  54. package/references/claude-code-acp/package-lock.json +4570 -0
  55. package/references/claude-code-acp/package.json +88 -0
  56. package/references/claude-code-acp/scripts/release.sh +119 -0
  57. package/references/claude-code-acp/src/acp-agent.ts +2079 -0
  58. package/references/claude-code-acp/src/index.ts +26 -0
  59. package/references/claude-code-acp/src/lib.ts +38 -0
  60. package/references/claude-code-acp/src/mcp-server.ts +911 -0
  61. package/references/claude-code-acp/src/settings.ts +522 -0
  62. package/references/claude-code-acp/src/tests/.claude/commands/quick-math.md +5 -0
  63. package/references/claude-code-acp/src/tests/.claude/commands/say-hello.md +6 -0
  64. package/references/claude-code-acp/src/tests/acp-agent-fork.test.ts +479 -0
  65. package/references/claude-code-acp/src/tests/acp-agent.test.ts +1502 -0
  66. package/references/claude-code-acp/src/tests/extract-lines.test.ts +103 -0
  67. package/references/claude-code-acp/src/tests/fork-session.test.ts +335 -0
  68. package/references/claude-code-acp/src/tests/replace-and-calculate-location.test.ts +334 -0
  69. package/references/claude-code-acp/src/tests/settings.test.ts +617 -0
  70. package/references/claude-code-acp/src/tests/skills-options.test.ts +187 -0
  71. package/references/claude-code-acp/src/tests/tools.test.ts +318 -0
  72. package/references/claude-code-acp/src/tests/typescript-declarations.test.ts +558 -0
  73. package/references/claude-code-acp/src/tools.ts +819 -0
  74. package/references/claude-code-acp/src/utils.ts +171 -0
  75. package/references/claude-code-acp/tsconfig.json +18 -0
  76. package/references/claude-code-acp/vitest.config.ts +19 -0
  77. package/references/multi-agent-protocol/.sudocode/issues.jsonl +111 -0
  78. package/references/multi-agent-protocol/.sudocode/specs.jsonl +13 -0
  79. package/references/multi-agent-protocol/LICENSE +21 -0
  80. package/references/multi-agent-protocol/README.md +113 -0
  81. package/references/multi-agent-protocol/docs/00-design-specification.md +496 -0
  82. package/references/multi-agent-protocol/docs/01-open-questions.md +1050 -0
  83. package/references/multi-agent-protocol/docs/02-wire-protocol.md +296 -0
  84. package/references/multi-agent-protocol/docs/03-streaming-semantics.md +252 -0
  85. package/references/multi-agent-protocol/docs/04-error-handling.md +231 -0
  86. package/references/multi-agent-protocol/docs/05-connection-model.md +244 -0
  87. package/references/multi-agent-protocol/docs/06-visibility-permissions.md +243 -0
  88. package/references/multi-agent-protocol/docs/07-federation.md +259 -0
  89. package/references/multi-agent-protocol/docs/08-macro-agent-migration.md +253 -0
  90. package/references/multi-agent-protocol/docs/09-authentication.md +680 -0
  91. package/references/multi-agent-protocol/docs/10-mail-protocol.md +553 -0
  92. package/references/multi-agent-protocol/docs/agent-iam-integration.md +877 -0
  93. package/references/multi-agent-protocol/docs/agentic-mesh-integration-draft.md +459 -0
  94. package/references/multi-agent-protocol/docs/git-transport-draft.md +251 -0
  95. package/references/multi-agent-protocol/docs-site/Gemfile +22 -0
  96. package/references/multi-agent-protocol/docs-site/README.md +82 -0
  97. package/references/multi-agent-protocol/docs-site/_config.yml +91 -0
  98. package/references/multi-agent-protocol/docs-site/_includes/head_custom.html +20 -0
  99. package/references/multi-agent-protocol/docs-site/_sass/color_schemes/map.scss +42 -0
  100. package/references/multi-agent-protocol/docs-site/_sass/custom/custom.scss +34 -0
  101. package/references/multi-agent-protocol/docs-site/examples/full-integration.md +510 -0
  102. package/references/multi-agent-protocol/docs-site/examples/index.md +138 -0
  103. package/references/multi-agent-protocol/docs-site/examples/simple-chat.md +282 -0
  104. package/references/multi-agent-protocol/docs-site/examples/task-queue.md +399 -0
  105. package/references/multi-agent-protocol/docs-site/getting-started/index.md +98 -0
  106. package/references/multi-agent-protocol/docs-site/getting-started/installation.md +219 -0
  107. package/references/multi-agent-protocol/docs-site/getting-started/overview.md +172 -0
  108. package/references/multi-agent-protocol/docs-site/getting-started/quickstart.md +237 -0
  109. package/references/multi-agent-protocol/docs-site/index.md +136 -0
  110. package/references/multi-agent-protocol/docs-site/protocol/authentication.md +391 -0
  111. package/references/multi-agent-protocol/docs-site/protocol/connection-model.md +376 -0
  112. package/references/multi-agent-protocol/docs-site/protocol/design.md +284 -0
  113. package/references/multi-agent-protocol/docs-site/protocol/error-handling.md +312 -0
  114. package/references/multi-agent-protocol/docs-site/protocol/federation.md +449 -0
  115. package/references/multi-agent-protocol/docs-site/protocol/index.md +129 -0
  116. package/references/multi-agent-protocol/docs-site/protocol/permissions.md +398 -0
  117. package/references/multi-agent-protocol/docs-site/protocol/streaming.md +353 -0
  118. package/references/multi-agent-protocol/docs-site/protocol/wire-protocol.md +369 -0
  119. package/references/multi-agent-protocol/docs-site/sdk/api/agent.md +357 -0
  120. package/references/multi-agent-protocol/docs-site/sdk/api/client.md +380 -0
  121. package/references/multi-agent-protocol/docs-site/sdk/api/index.md +62 -0
  122. package/references/multi-agent-protocol/docs-site/sdk/api/server.md +453 -0
  123. package/references/multi-agent-protocol/docs-site/sdk/api/types.md +468 -0
  124. package/references/multi-agent-protocol/docs-site/sdk/guides/agent.md +375 -0
  125. package/references/multi-agent-protocol/docs-site/sdk/guides/authentication.md +405 -0
  126. package/references/multi-agent-protocol/docs-site/sdk/guides/client.md +352 -0
  127. package/references/multi-agent-protocol/docs-site/sdk/guides/index.md +89 -0
  128. package/references/multi-agent-protocol/docs-site/sdk/guides/server.md +360 -0
  129. package/references/multi-agent-protocol/docs-site/sdk/guides/testing.md +446 -0
  130. package/references/multi-agent-protocol/docs-site/sdk/guides/transports.md +363 -0
  131. package/references/multi-agent-protocol/docs-site/sdk/index.md +206 -0
  132. package/references/multi-agent-protocol/package-lock.json +3886 -0
  133. package/references/multi-agent-protocol/package.json +56 -0
  134. package/references/multi-agent-protocol/schema/meta.json +467 -0
  135. package/references/multi-agent-protocol/schema/schema.json +2558 -0
  136. package/src/agent/__tests__/agent-manager.test.ts +67 -1
  137. package/src/agent/agent-manager.ts +10 -4
  138. package/src/cli/__tests__/stable-instance-id.test.ts +57 -0
  139. package/src/cli/acp.ts +17 -2
  140. package/src/map/adapter/index.ts +3 -0
  141. package/src/server/combined-server.ts +10 -0
  142. package/src/store/event-store.ts +10 -3
  143. package/src/store/types/agents.ts +2 -0
@@ -0,0 +1,2558 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/alexngai/multi-agent-protocol/schema/schema.json",
4
+ "title": "Multi-Agent Protocol Schema",
5
+ "description": "JSON Schema for the Multi-Agent Protocol (MAP) - a protocol for observing, coordinating, and routing messages within multi-agent AI systems",
6
+ "oneOf": [
7
+ { "$ref": "#/$defs/MAPRequest" },
8
+ { "$ref": "#/$defs/MAPResponse" },
9
+ { "$ref": "#/$defs/MAPNotification" }
10
+ ],
11
+ "$defs": {
12
+ "JsonRpcVersion": {
13
+ "type": "string",
14
+ "const": "2.0",
15
+ "description": "JSON-RPC version, always '2.0'"
16
+ },
17
+ "RequestId": {
18
+ "oneOf": [
19
+ { "type": "string" },
20
+ { "type": "integer" }
21
+ ],
22
+ "description": "Unique identifier for a request, used to correlate responses"
23
+ },
24
+ "MAPRequest": {
25
+ "type": "object",
26
+ "description": "A JSON-RPC 2.0 request message in MAP",
27
+ "properties": {
28
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
29
+ "id": { "$ref": "#/$defs/RequestId" },
30
+ "method": { "type": "string" },
31
+ "params": { "type": "object" }
32
+ },
33
+ "required": ["jsonrpc", "id", "method"],
34
+ "additionalProperties": false,
35
+ "oneOf": [
36
+ { "$ref": "#/$defs/ConnectRequest" },
37
+ { "$ref": "#/$defs/DisconnectRequest" },
38
+ { "$ref": "#/$defs/SessionListRequest" },
39
+ { "$ref": "#/$defs/SessionLoadRequest" },
40
+ { "$ref": "#/$defs/SessionCloseRequest" },
41
+ { "$ref": "#/$defs/AgentsListRequest" },
42
+ { "$ref": "#/$defs/AgentsGetRequest" },
43
+ { "$ref": "#/$defs/AgentsRegisterRequest" },
44
+ { "$ref": "#/$defs/AgentsSpawnRequest" },
45
+ { "$ref": "#/$defs/AgentsUnregisterRequest" },
46
+ { "$ref": "#/$defs/AgentsUpdateRequest" },
47
+ { "$ref": "#/$defs/AgentsStopRequest" },
48
+ { "$ref": "#/$defs/AgentsSuspendRequest" },
49
+ { "$ref": "#/$defs/AgentsResumeRequest" },
50
+ { "$ref": "#/$defs/SendRequest" },
51
+ { "$ref": "#/$defs/SubscribeRequest" },
52
+ { "$ref": "#/$defs/UnsubscribeRequest" },
53
+ { "$ref": "#/$defs/ScopesListRequest" },
54
+ { "$ref": "#/$defs/ScopesGetRequest" },
55
+ { "$ref": "#/$defs/ScopesCreateRequest" },
56
+ { "$ref": "#/$defs/ScopesDeleteRequest" },
57
+ { "$ref": "#/$defs/ScopesJoinRequest" },
58
+ { "$ref": "#/$defs/ScopesLeaveRequest" },
59
+ { "$ref": "#/$defs/ScopesMembersRequest" },
60
+ { "$ref": "#/$defs/StructureGraphRequest" },
61
+ { "$ref": "#/$defs/AuthRefreshRequest" },
62
+ { "$ref": "#/$defs/InjectRequest" },
63
+ { "$ref": "#/$defs/FederationConnectRequest" },
64
+ { "$ref": "#/$defs/FederationRouteRequest" },
65
+ { "$ref": "#/$defs/MailCreateRequest" },
66
+ { "$ref": "#/$defs/MailGetRequest" },
67
+ { "$ref": "#/$defs/MailListRequest" },
68
+ { "$ref": "#/$defs/MailCloseRequest" },
69
+ { "$ref": "#/$defs/MailJoinRequest" },
70
+ { "$ref": "#/$defs/MailLeaveRequest" },
71
+ { "$ref": "#/$defs/MailInviteRequest" },
72
+ { "$ref": "#/$defs/MailTurnRequest" },
73
+ { "$ref": "#/$defs/MailTurnsListRequest" },
74
+ { "$ref": "#/$defs/MailThreadCreateRequest" },
75
+ { "$ref": "#/$defs/MailThreadListRequest" },
76
+ { "$ref": "#/$defs/MailSummaryRequest" },
77
+ { "$ref": "#/$defs/MailReplayRequest" }
78
+ ]
79
+ },
80
+ "MAPResponse": {
81
+ "type": "object",
82
+ "description": "A JSON-RPC 2.0 response message in MAP",
83
+ "properties": {
84
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
85
+ "id": { "$ref": "#/$defs/RequestId" }
86
+ },
87
+ "required": ["jsonrpc", "id"],
88
+ "oneOf": [
89
+ {
90
+ "type": "object",
91
+ "properties": {
92
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
93
+ "id": { "$ref": "#/$defs/RequestId" },
94
+ "result": {}
95
+ },
96
+ "required": ["jsonrpc", "id", "result"],
97
+ "additionalProperties": false
98
+ },
99
+ {
100
+ "type": "object",
101
+ "properties": {
102
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
103
+ "id": { "$ref": "#/$defs/RequestId" },
104
+ "error": { "$ref": "#/$defs/MAPError" }
105
+ },
106
+ "required": ["jsonrpc", "id", "error"],
107
+ "additionalProperties": false
108
+ }
109
+ ]
110
+ },
111
+ "MAPNotification": {
112
+ "type": "object",
113
+ "description": "A JSON-RPC 2.0 notification message in MAP (no response expected)",
114
+ "properties": {
115
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
116
+ "method": { "type": "string" },
117
+ "params": { "type": "object" }
118
+ },
119
+ "required": ["jsonrpc", "method"],
120
+ "additionalProperties": false,
121
+ "oneOf": [
122
+ { "$ref": "#/$defs/EventNotification" },
123
+ { "$ref": "#/$defs/MessageNotification" }
124
+ ]
125
+ },
126
+ "MAPError": {
127
+ "type": "object",
128
+ "description": "JSON-RPC 2.0 error object",
129
+ "properties": {
130
+ "code": {
131
+ "type": "integer",
132
+ "description": "Error code"
133
+ },
134
+ "message": {
135
+ "type": "string",
136
+ "description": "Human-readable error message"
137
+ },
138
+ "data": {
139
+ "description": "Additional error data",
140
+ "$ref": "#/$defs/MAPErrorData"
141
+ }
142
+ },
143
+ "required": ["code", "message"],
144
+ "additionalProperties": false
145
+ },
146
+ "MAPErrorData": {
147
+ "type": "object",
148
+ "description": "Structured error data",
149
+ "properties": {
150
+ "category": { "$ref": "#/$defs/ErrorCategory" },
151
+ "retryable": { "type": "boolean" },
152
+ "retryAfterMs": { "type": "integer" },
153
+ "details": { "type": "object" },
154
+ "_meta": { "$ref": "#/$defs/Meta" }
155
+ },
156
+ "additionalProperties": true
157
+ },
158
+ "ErrorCategory": {
159
+ "type": "string",
160
+ "enum": [
161
+ "protocol",
162
+ "auth",
163
+ "routing",
164
+ "agent",
165
+ "resource",
166
+ "federation",
167
+ "mail",
168
+ "internal"
169
+ ],
170
+ "description": "Category of error for handling decisions"
171
+ },
172
+
173
+ "ParticipantId": {
174
+ "type": "string",
175
+ "description": "Unique identifier for any participant (agent, client, system, gateway)"
176
+ },
177
+ "AgentId": {
178
+ "type": "string",
179
+ "description": "Unique identifier for an agent"
180
+ },
181
+ "ScopeId": {
182
+ "type": "string",
183
+ "description": "Unique identifier for a scope"
184
+ },
185
+ "SessionId": {
186
+ "type": "string",
187
+ "description": "Unique identifier for a session"
188
+ },
189
+ "MessageId": {
190
+ "type": "string",
191
+ "description": "Unique identifier for a message"
192
+ },
193
+ "SubscriptionId": {
194
+ "type": "string",
195
+ "description": "Unique identifier for a subscription"
196
+ },
197
+ "CorrelationId": {
198
+ "type": "string",
199
+ "description": "Identifier for correlating related messages"
200
+ },
201
+ "ProtocolVersion": {
202
+ "type": "integer",
203
+ "const": 1,
204
+ "description": "MAP protocol version"
205
+ },
206
+ "Timestamp": {
207
+ "type": "integer",
208
+ "description": "Unix timestamp in milliseconds"
209
+ },
210
+ "Meta": {
211
+ "type": "object",
212
+ "additionalProperties": true,
213
+ "description": "Vendor extension metadata. Implementations MUST NOT assume specific keys."
214
+ },
215
+
216
+ "ParticipantType": {
217
+ "type": "string",
218
+ "enum": ["agent", "client", "system", "gateway"],
219
+ "description": "Type of participant in the protocol"
220
+ },
221
+ "ParticipantCapabilities": {
222
+ "type": "object",
223
+ "description": "Capabilities of a participant, grouped by category",
224
+ "properties": {
225
+ "observation": {
226
+ "type": "object",
227
+ "properties": {
228
+ "canObserve": {
229
+ "type": "boolean",
230
+ "description": "Can subscribe to event streams"
231
+ },
232
+ "canQuery": {
233
+ "type": "boolean",
234
+ "description": "Can query agents and structure"
235
+ }
236
+ },
237
+ "additionalProperties": false
238
+ },
239
+ "messaging": {
240
+ "type": "object",
241
+ "properties": {
242
+ "canSend": {
243
+ "type": "boolean",
244
+ "description": "Can send messages"
245
+ },
246
+ "canReceive": {
247
+ "type": "boolean",
248
+ "description": "Can receive messages addressed to it"
249
+ },
250
+ "canBroadcast": {
251
+ "type": "boolean",
252
+ "description": "Can send to scopes/roles"
253
+ }
254
+ },
255
+ "additionalProperties": false
256
+ },
257
+ "lifecycle": {
258
+ "type": "object",
259
+ "properties": {
260
+ "canSpawn": {
261
+ "type": "boolean",
262
+ "description": "Can create child agents"
263
+ },
264
+ "canRegister": {
265
+ "type": "boolean",
266
+ "description": "Can register agents (not as children)"
267
+ },
268
+ "canUnregister": {
269
+ "type": "boolean",
270
+ "description": "Can remove agents"
271
+ },
272
+ "canSteer": {
273
+ "type": "boolean",
274
+ "description": "Can inject context/control agents"
275
+ },
276
+ "canStop": {
277
+ "type": "boolean",
278
+ "description": "Can request agent termination"
279
+ }
280
+ },
281
+ "additionalProperties": false
282
+ },
283
+ "scopes": {
284
+ "type": "object",
285
+ "properties": {
286
+ "canCreateScopes": {
287
+ "type": "boolean",
288
+ "description": "Can create new scopes"
289
+ },
290
+ "canManageScopes": {
291
+ "type": "boolean",
292
+ "description": "Can modify and delete scopes"
293
+ }
294
+ },
295
+ "additionalProperties": false
296
+ },
297
+ "mail": {
298
+ "type": "object",
299
+ "description": "Mail protocol capabilities for conversation/turn tracking",
300
+ "properties": {
301
+ "enabled": { "type": "boolean", "description": "Whether mail is enabled (server response only)" },
302
+ "canCreate": { "type": "boolean", "description": "Can create new conversations" },
303
+ "canJoin": { "type": "boolean", "description": "Can join existing conversations" },
304
+ "canInvite": { "type": "boolean", "description": "Can invite participants to conversations" },
305
+ "canViewHistory": { "type": "boolean", "description": "Can view conversation history" },
306
+ "canCreateThreads": { "type": "boolean", "description": "Can create threads within conversations" }
307
+ },
308
+ "additionalProperties": false
309
+ },
310
+ "_meta": { "$ref": "#/$defs/Meta" }
311
+ },
312
+ "additionalProperties": false
313
+ },
314
+ "TransportType": {
315
+ "type": "string",
316
+ "enum": ["websocket", "stdio", "inprocess", "http-sse"],
317
+ "description": "Transport binding type"
318
+ },
319
+ "Participant": {
320
+ "type": "object",
321
+ "description": "A participant in the MAP protocol",
322
+ "properties": {
323
+ "id": { "$ref": "#/$defs/ParticipantId" },
324
+ "type": { "$ref": "#/$defs/ParticipantType" },
325
+ "name": { "type": "string" },
326
+ "capabilities": { "$ref": "#/$defs/ParticipantCapabilities" },
327
+ "transport": { "$ref": "#/$defs/TransportType" },
328
+ "sessionId": { "$ref": "#/$defs/SessionId" },
329
+ "metadata": { "type": "object" },
330
+ "_meta": { "$ref": "#/$defs/Meta" }
331
+ },
332
+ "required": ["id", "type"],
333
+ "additionalProperties": false
334
+ },
335
+
336
+ "AgentState": {
337
+ "type": "string",
338
+ "description": "State of an agent. Standard states are enumerated; custom states use 'x-' prefix.",
339
+ "oneOf": [
340
+ {
341
+ "enum": [
342
+ "registered",
343
+ "active",
344
+ "busy",
345
+ "idle",
346
+ "suspended",
347
+ "stopping",
348
+ "stopped",
349
+ "failed"
350
+ ]
351
+ },
352
+ {
353
+ "type": "string",
354
+ "pattern": "^x-[a-z][a-z0-9-]*$",
355
+ "description": "Custom state with x- prefix"
356
+ }
357
+ ]
358
+ },
359
+ "AgentRelationship": {
360
+ "type": "object",
361
+ "description": "A relationship between agents",
362
+ "properties": {
363
+ "type": {
364
+ "type": "string",
365
+ "enum": ["peer", "supervisor", "supervised", "collaborator"],
366
+ "description": "Type of relationship"
367
+ },
368
+ "agentId": { "$ref": "#/$defs/AgentId" },
369
+ "metadata": { "type": "object" },
370
+ "_meta": { "$ref": "#/$defs/Meta" }
371
+ },
372
+ "required": ["type", "agentId"],
373
+ "additionalProperties": false
374
+ },
375
+ "AgentLifecycle": {
376
+ "type": "object",
377
+ "description": "Lifecycle metadata for an agent",
378
+ "properties": {
379
+ "createdAt": { "$ref": "#/$defs/Timestamp" },
380
+ "startedAt": { "$ref": "#/$defs/Timestamp" },
381
+ "stoppedAt": { "$ref": "#/$defs/Timestamp" },
382
+ "lastActiveAt": { "$ref": "#/$defs/Timestamp" },
383
+ "exitCode": { "type": "integer" },
384
+ "exitReason": { "type": "string" },
385
+ "_meta": { "$ref": "#/$defs/Meta" }
386
+ },
387
+ "additionalProperties": false
388
+ },
389
+ "AgentVisibility": {
390
+ "type": "string",
391
+ "enum": ["public", "parent-only", "scope", "system"],
392
+ "description": "Who can see this agent"
393
+ },
394
+ "Agent": {
395
+ "type": "object",
396
+ "description": "An agent in the multi-agent system",
397
+ "properties": {
398
+ "id": { "$ref": "#/$defs/AgentId" },
399
+ "name": { "type": "string" },
400
+ "description": { "type": "string" },
401
+ "parent": { "$ref": "#/$defs/AgentId" },
402
+ "relationships": {
403
+ "type": "array",
404
+ "items": { "$ref": "#/$defs/AgentRelationship" }
405
+ },
406
+ "state": { "$ref": "#/$defs/AgentState" },
407
+ "role": { "type": "string" },
408
+ "scopes": {
409
+ "type": "array",
410
+ "items": { "$ref": "#/$defs/ScopeId" }
411
+ },
412
+ "visibility": { "$ref": "#/$defs/AgentVisibility" },
413
+ "lifecycle": { "$ref": "#/$defs/AgentLifecycle" },
414
+ "capabilities": { "$ref": "#/$defs/ParticipantCapabilities" },
415
+ "metadata": { "type": "object" },
416
+ "_meta": { "$ref": "#/$defs/Meta" }
417
+ },
418
+ "required": ["id", "state"],
419
+ "additionalProperties": false
420
+ },
421
+
422
+ "Address": {
423
+ "description": "Flexible addressing for any topology",
424
+ "oneOf": [
425
+ {
426
+ "type": "string",
427
+ "description": "Shorthand: agent ID"
428
+ },
429
+ { "$ref": "#/$defs/DirectAddress" },
430
+ { "$ref": "#/$defs/MultiAddress" },
431
+ { "$ref": "#/$defs/ScopeAddress" },
432
+ { "$ref": "#/$defs/RoleAddress" },
433
+ { "$ref": "#/$defs/HierarchicalAddress" },
434
+ { "$ref": "#/$defs/BroadcastAddress" },
435
+ { "$ref": "#/$defs/SystemAddress" },
436
+ { "$ref": "#/$defs/ParticipantAddress" },
437
+ { "$ref": "#/$defs/FederatedAddress" }
438
+ ]
439
+ },
440
+ "DirectAddress": {
441
+ "type": "object",
442
+ "description": "Address a single agent directly",
443
+ "properties": {
444
+ "agent": { "$ref": "#/$defs/AgentId" }
445
+ },
446
+ "required": ["agent"],
447
+ "additionalProperties": false
448
+ },
449
+ "MultiAddress": {
450
+ "type": "object",
451
+ "description": "Address multiple agents",
452
+ "properties": {
453
+ "agents": {
454
+ "type": "array",
455
+ "items": { "$ref": "#/$defs/AgentId" },
456
+ "minItems": 1
457
+ }
458
+ },
459
+ "required": ["agents"],
460
+ "additionalProperties": false
461
+ },
462
+ "ScopeAddress": {
463
+ "type": "object",
464
+ "description": "Address all agents in a scope",
465
+ "properties": {
466
+ "scope": { "$ref": "#/$defs/ScopeId" }
467
+ },
468
+ "required": ["scope"],
469
+ "additionalProperties": false
470
+ },
471
+ "RoleAddress": {
472
+ "type": "object",
473
+ "description": "Address agents by role, optionally within a scope",
474
+ "properties": {
475
+ "role": { "type": "string" },
476
+ "within": { "$ref": "#/$defs/ScopeId" }
477
+ },
478
+ "required": ["role"],
479
+ "additionalProperties": false
480
+ },
481
+ "HierarchicalAddress": {
482
+ "type": "object",
483
+ "description": "Address relative to sender in hierarchy",
484
+ "properties": {
485
+ "parent": {
486
+ "type": "boolean",
487
+ "const": true,
488
+ "description": "Address sender's parent"
489
+ },
490
+ "children": {
491
+ "type": "boolean",
492
+ "const": true,
493
+ "description": "Address sender's children"
494
+ },
495
+ "ancestors": {
496
+ "type": "boolean",
497
+ "const": true,
498
+ "description": "Address ancestors up the tree"
499
+ },
500
+ "descendants": {
501
+ "type": "boolean",
502
+ "const": true,
503
+ "description": "Address descendants down the tree"
504
+ },
505
+ "siblings": {
506
+ "type": "boolean",
507
+ "const": true,
508
+ "description": "Address agents with same parent"
509
+ },
510
+ "depth": {
511
+ "type": "integer",
512
+ "minimum": 1,
513
+ "description": "Limit depth for children/ancestors/descendants"
514
+ }
515
+ },
516
+ "oneOf": [
517
+ { "required": ["parent"] },
518
+ { "required": ["children"] },
519
+ { "required": ["ancestors"] },
520
+ { "required": ["descendants"] },
521
+ { "required": ["siblings"] }
522
+ ],
523
+ "additionalProperties": false
524
+ },
525
+ "BroadcastAddress": {
526
+ "type": "object",
527
+ "description": "Address all agents in the system",
528
+ "properties": {
529
+ "broadcast": {
530
+ "type": "boolean",
531
+ "const": true
532
+ }
533
+ },
534
+ "required": ["broadcast"],
535
+ "additionalProperties": false
536
+ },
537
+ "SystemAddress": {
538
+ "type": "object",
539
+ "description": "Address the system/router itself",
540
+ "properties": {
541
+ "system": {
542
+ "type": "boolean",
543
+ "const": true
544
+ }
545
+ },
546
+ "required": ["system"],
547
+ "additionalProperties": false
548
+ },
549
+ "ParticipantAddress": {
550
+ "type": "object",
551
+ "description": "Address any participant by ID or category",
552
+ "properties": {
553
+ "participant": { "$ref": "#/$defs/ParticipantId" },
554
+ "participants": {
555
+ "type": "string",
556
+ "enum": ["all", "agents", "clients"]
557
+ }
558
+ },
559
+ "oneOf": [
560
+ { "required": ["participant"] },
561
+ { "required": ["participants"] }
562
+ ],
563
+ "additionalProperties": false
564
+ },
565
+ "FederatedAddress": {
566
+ "type": "object",
567
+ "description": "Address an agent in a federated system",
568
+ "properties": {
569
+ "system": {
570
+ "type": "string",
571
+ "description": "Target system identifier"
572
+ },
573
+ "agent": { "$ref": "#/$defs/AgentId" }
574
+ },
575
+ "required": ["system", "agent"],
576
+ "additionalProperties": false
577
+ },
578
+
579
+ "MessagePriority": {
580
+ "type": "string",
581
+ "enum": ["urgent", "high", "normal", "low"],
582
+ "default": "normal"
583
+ },
584
+ "DeliverySemantics": {
585
+ "type": "string",
586
+ "enum": ["fire-and-forget", "acknowledged", "guaranteed"],
587
+ "default": "fire-and-forget",
588
+ "description": "Message delivery guarantees"
589
+ },
590
+ "MessageRelationship": {
591
+ "type": "string",
592
+ "enum": ["parent-to-child", "child-to-parent", "peer", "broadcast"],
593
+ "description": "Relationship context for the message"
594
+ },
595
+ "MessageMeta": {
596
+ "type": "object",
597
+ "description": "Metadata for a message",
598
+ "properties": {
599
+ "timestamp": { "$ref": "#/$defs/Timestamp" },
600
+ "relationship": { "$ref": "#/$defs/MessageRelationship" },
601
+ "expectsResponse": { "type": "boolean" },
602
+ "correlationId": { "$ref": "#/$defs/CorrelationId" },
603
+ "isResult": { "type": "boolean" },
604
+ "priority": { "$ref": "#/$defs/MessagePriority" },
605
+ "delivery": { "$ref": "#/$defs/DeliverySemantics" },
606
+ "ttlMs": {
607
+ "type": "integer",
608
+ "description": "Time-to-live in milliseconds"
609
+ },
610
+ "mail": {
611
+ "$ref": "#/$defs/MailMessageMeta",
612
+ "description": "Mail turn tracking metadata. When present on map/send, an intercepted turn is recorded."
613
+ },
614
+ "_meta": { "$ref": "#/$defs/Meta" }
615
+ },
616
+ "additionalProperties": false
617
+ },
618
+ "Message": {
619
+ "type": "object",
620
+ "description": "A message in the multi-agent system",
621
+ "properties": {
622
+ "id": { "$ref": "#/$defs/MessageId" },
623
+ "from": { "$ref": "#/$defs/ParticipantId" },
624
+ "to": { "$ref": "#/$defs/Address" },
625
+ "payload": {
626
+ "description": "Message payload - structure depends on use case"
627
+ },
628
+ "meta": { "$ref": "#/$defs/MessageMeta" },
629
+ "_meta": { "$ref": "#/$defs/Meta" }
630
+ },
631
+ "required": ["id", "from", "to"],
632
+ "additionalProperties": false
633
+ },
634
+
635
+ "JoinPolicy": {
636
+ "type": "string",
637
+ "enum": ["open", "invite", "role", "system"],
638
+ "description": "Policy for joining a scope"
639
+ },
640
+ "ScopeVisibility": {
641
+ "type": "string",
642
+ "enum": ["public", "members", "system"],
643
+ "description": "Who can see the scope exists and its members"
644
+ },
645
+ "MessageVisibility": {
646
+ "type": "string",
647
+ "enum": ["public", "members", "system"],
648
+ "description": "Who can see messages sent to this scope"
649
+ },
650
+ "SendPolicy": {
651
+ "type": "string",
652
+ "enum": ["members", "any"],
653
+ "description": "Who can send messages to this scope"
654
+ },
655
+ "Scope": {
656
+ "type": "object",
657
+ "description": "A scope for grouping agents",
658
+ "properties": {
659
+ "id": { "$ref": "#/$defs/ScopeId" },
660
+ "name": { "type": "string" },
661
+ "description": { "type": "string" },
662
+ "parent": { "$ref": "#/$defs/ScopeId" },
663
+ "joinPolicy": { "$ref": "#/$defs/JoinPolicy" },
664
+ "autoJoinRoles": {
665
+ "type": "array",
666
+ "items": { "type": "string" },
667
+ "description": "Roles that auto-join this scope"
668
+ },
669
+ "visibility": { "$ref": "#/$defs/ScopeVisibility" },
670
+ "messageVisibility": { "$ref": "#/$defs/MessageVisibility" },
671
+ "sendPolicy": { "$ref": "#/$defs/SendPolicy" },
672
+ "persistent": {
673
+ "type": "boolean",
674
+ "default": true,
675
+ "description": "Survives system restart"
676
+ },
677
+ "autoDelete": {
678
+ "type": "boolean",
679
+ "default": false,
680
+ "description": "Delete when empty"
681
+ },
682
+ "metadata": { "type": "object" },
683
+ "_meta": { "$ref": "#/$defs/Meta" }
684
+ },
685
+ "required": ["id"],
686
+ "additionalProperties": false
687
+ },
688
+
689
+ "EventType": {
690
+ "type": "string",
691
+ "enum": [
692
+ "agent_registered",
693
+ "agent_state_changed",
694
+ "agent_unregistered",
695
+ "message_sent",
696
+ "message_delivered",
697
+ "message_failed",
698
+ "scope_created",
699
+ "scope_deleted",
700
+ "scope_member_joined",
701
+ "scope_member_left",
702
+ "system_error",
703
+ "federation_connected",
704
+ "federation_disconnected",
705
+ "mail.created",
706
+ "mail.closed",
707
+ "mail.participant.joined",
708
+ "mail.participant.left",
709
+ "mail.turn.added",
710
+ "mail.turn.updated",
711
+ "mail.thread.created",
712
+ "mail.summary.generated"
713
+ ],
714
+ "description": "Type of system event"
715
+ },
716
+ "Event": {
717
+ "type": "object",
718
+ "description": "A system event",
719
+ "properties": {
720
+ "id": { "type": "string" },
721
+ "type": { "$ref": "#/$defs/EventType" },
722
+ "timestamp": { "$ref": "#/$defs/Timestamp" },
723
+ "source": { "$ref": "#/$defs/ParticipantId" },
724
+ "data": {
725
+ "type": "object",
726
+ "description": "Event-specific data"
727
+ },
728
+ "causedBy": {
729
+ "type": "array",
730
+ "items": { "type": "string" },
731
+ "description": "IDs of events that caused this one (causal ordering)"
732
+ },
733
+ "_meta": { "$ref": "#/$defs/Meta" }
734
+ },
735
+ "required": ["id", "type", "timestamp"],
736
+ "additionalProperties": false
737
+ },
738
+ "SubscriptionFilter": {
739
+ "type": "object",
740
+ "description": "Filter for event subscriptions",
741
+ "properties": {
742
+ "agents": {
743
+ "type": "array",
744
+ "items": { "$ref": "#/$defs/AgentId" },
745
+ "description": "Only events from these agents"
746
+ },
747
+ "roles": {
748
+ "type": "array",
749
+ "items": { "type": "string" },
750
+ "description": "Only events from agents with these roles"
751
+ },
752
+ "scopes": {
753
+ "type": "array",
754
+ "items": { "$ref": "#/$defs/ScopeId" },
755
+ "description": "Only events in these scopes"
756
+ },
757
+ "eventTypes": {
758
+ "type": "array",
759
+ "items": { "$ref": "#/$defs/EventType" },
760
+ "description": "Only these event types"
761
+ },
762
+ "priorities": {
763
+ "type": "array",
764
+ "items": { "$ref": "#/$defs/MessagePriority" },
765
+ "description": "Only events with these priorities"
766
+ },
767
+ "mail": {
768
+ "$ref": "#/$defs/MailSubscriptionFilter",
769
+ "description": "Mail-specific filter for conversation events"
770
+ },
771
+ "_meta": { "$ref": "#/$defs/Meta" }
772
+ },
773
+ "additionalProperties": false
774
+ },
775
+ "Subscription": {
776
+ "type": "object",
777
+ "description": "An active event subscription",
778
+ "properties": {
779
+ "id": { "$ref": "#/$defs/SubscriptionId" },
780
+ "filter": { "$ref": "#/$defs/SubscriptionFilter" },
781
+ "createdAt": { "$ref": "#/$defs/Timestamp" },
782
+ "replayFrom": {
783
+ "oneOf": [
784
+ { "$ref": "#/$defs/Timestamp" },
785
+ { "type": "string", "description": "Event ID to replay from" }
786
+ ],
787
+ "description": "Replay missed events from this point"
788
+ },
789
+ "_meta": { "$ref": "#/$defs/Meta" }
790
+ },
791
+ "required": ["id"],
792
+ "additionalProperties": false
793
+ },
794
+
795
+ "ConnectRequest": {
796
+ "type": "object",
797
+ "x-method": "map/connect",
798
+ "x-tier": "core",
799
+ "description": "Connect to the MAP system and negotiate capabilities",
800
+ "properties": {
801
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
802
+ "id": { "$ref": "#/$defs/RequestId" },
803
+ "method": { "const": "map/connect" },
804
+ "params": {
805
+ "type": "object",
806
+ "properties": {
807
+ "protocolVersion": { "$ref": "#/$defs/ProtocolVersion" },
808
+ "participantType": { "$ref": "#/$defs/ParticipantType" },
809
+ "participantId": { "$ref": "#/$defs/ParticipantId" },
810
+ "name": { "type": "string" },
811
+ "capabilities": { "$ref": "#/$defs/ParticipantCapabilities" },
812
+ "sessionId": {
813
+ "$ref": "#/$defs/SessionId",
814
+ "description": "Optional session to reconnect to"
815
+ },
816
+ "auth": {
817
+ "type": "object",
818
+ "properties": {
819
+ "method": {
820
+ "type": "string",
821
+ "enum": ["bearer", "api-key", "mtls", "none"]
822
+ },
823
+ "token": { "type": "string" }
824
+ }
825
+ },
826
+ "_meta": { "$ref": "#/$defs/Meta" }
827
+ },
828
+ "required": ["protocolVersion", "participantType"]
829
+ }
830
+ },
831
+ "required": ["jsonrpc", "id", "method", "params"]
832
+ },
833
+ "ConnectResponse": {
834
+ "type": "object",
835
+ "description": "Response to map/connect",
836
+ "properties": {
837
+ "protocolVersion": { "$ref": "#/$defs/ProtocolVersion" },
838
+ "sessionId": { "$ref": "#/$defs/SessionId" },
839
+ "participantId": { "$ref": "#/$defs/ParticipantId" },
840
+ "capabilities": { "$ref": "#/$defs/ParticipantCapabilities" },
841
+ "systemInfo": {
842
+ "type": "object",
843
+ "properties": {
844
+ "name": { "type": "string" },
845
+ "version": { "type": "string" }
846
+ }
847
+ },
848
+ "_meta": { "$ref": "#/$defs/Meta" }
849
+ },
850
+ "required": ["protocolVersion", "sessionId", "participantId", "capabilities"]
851
+ },
852
+ "DisconnectRequest": {
853
+ "type": "object",
854
+ "x-method": "map/disconnect",
855
+ "x-tier": "core",
856
+ "description": "Gracefully disconnect from the MAP system",
857
+ "properties": {
858
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
859
+ "id": { "$ref": "#/$defs/RequestId" },
860
+ "method": { "const": "map/disconnect" },
861
+ "params": {
862
+ "type": "object",
863
+ "properties": {
864
+ "reason": { "type": "string" },
865
+ "_meta": { "$ref": "#/$defs/Meta" }
866
+ }
867
+ }
868
+ },
869
+ "required": ["jsonrpc", "id", "method"]
870
+ },
871
+ "DisconnectResponse": {
872
+ "type": "object",
873
+ "description": "Response to map/disconnect",
874
+ "properties": {
875
+ "acknowledged": { "type": "boolean" },
876
+ "_meta": { "$ref": "#/$defs/Meta" }
877
+ },
878
+ "required": ["acknowledged"]
879
+ },
880
+
881
+ "SessionListRequest": {
882
+ "type": "object",
883
+ "x-method": "map/session/list",
884
+ "x-tier": "core",
885
+ "description": "List participant's sessions",
886
+ "properties": {
887
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
888
+ "id": { "$ref": "#/$defs/RequestId" },
889
+ "method": { "const": "map/session/list" },
890
+ "params": {
891
+ "type": "object",
892
+ "properties": {
893
+ "_meta": { "$ref": "#/$defs/Meta" }
894
+ }
895
+ }
896
+ },
897
+ "required": ["jsonrpc", "id", "method"]
898
+ },
899
+ "SessionListResponse": {
900
+ "type": "object",
901
+ "description": "Response to map/session/list",
902
+ "properties": {
903
+ "sessions": {
904
+ "type": "array",
905
+ "items": {
906
+ "type": "object",
907
+ "properties": {
908
+ "id": { "$ref": "#/$defs/SessionId" },
909
+ "createdAt": { "$ref": "#/$defs/Timestamp" },
910
+ "lastActiveAt": { "$ref": "#/$defs/Timestamp" }
911
+ },
912
+ "required": ["id", "createdAt"]
913
+ }
914
+ },
915
+ "_meta": { "$ref": "#/$defs/Meta" }
916
+ },
917
+ "required": ["sessions"]
918
+ },
919
+ "SessionLoadRequest": {
920
+ "type": "object",
921
+ "x-method": "map/session/load",
922
+ "x-tier": "core",
923
+ "description": "Load/reconnect to an existing session",
924
+ "properties": {
925
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
926
+ "id": { "$ref": "#/$defs/RequestId" },
927
+ "method": { "const": "map/session/load" },
928
+ "params": {
929
+ "type": "object",
930
+ "properties": {
931
+ "sessionId": { "$ref": "#/$defs/SessionId" },
932
+ "_meta": { "$ref": "#/$defs/Meta" }
933
+ },
934
+ "required": ["sessionId"]
935
+ }
936
+ },
937
+ "required": ["jsonrpc", "id", "method", "params"]
938
+ },
939
+ "SessionLoadResponse": {
940
+ "type": "object",
941
+ "description": "Response to map/session/load",
942
+ "properties": {
943
+ "sessionId": { "$ref": "#/$defs/SessionId" },
944
+ "restored": { "type": "boolean" },
945
+ "_meta": { "$ref": "#/$defs/Meta" }
946
+ },
947
+ "required": ["sessionId", "restored"]
948
+ },
949
+ "SessionCloseRequest": {
950
+ "type": "object",
951
+ "x-method": "map/session/close",
952
+ "x-tier": "core",
953
+ "description": "Explicitly end a session",
954
+ "properties": {
955
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
956
+ "id": { "$ref": "#/$defs/RequestId" },
957
+ "method": { "const": "map/session/close" },
958
+ "params": {
959
+ "type": "object",
960
+ "properties": {
961
+ "sessionId": { "$ref": "#/$defs/SessionId" },
962
+ "_meta": { "$ref": "#/$defs/Meta" }
963
+ }
964
+ }
965
+ },
966
+ "required": ["jsonrpc", "id", "method"]
967
+ },
968
+ "SessionCloseResponse": {
969
+ "type": "object",
970
+ "description": "Response to map/session/close",
971
+ "properties": {
972
+ "closed": { "type": "boolean" },
973
+ "_meta": { "$ref": "#/$defs/Meta" }
974
+ },
975
+ "required": ["closed"]
976
+ },
977
+
978
+ "AgentsListRequest": {
979
+ "type": "object",
980
+ "x-method": "map/agents/list",
981
+ "x-tier": "core",
982
+ "description": "List agents with optional filters",
983
+ "properties": {
984
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
985
+ "id": { "$ref": "#/$defs/RequestId" },
986
+ "method": { "const": "map/agents/list" },
987
+ "params": {
988
+ "type": "object",
989
+ "properties": {
990
+ "filter": {
991
+ "type": "object",
992
+ "properties": {
993
+ "states": {
994
+ "type": "array",
995
+ "items": { "$ref": "#/$defs/AgentState" }
996
+ },
997
+ "roles": {
998
+ "type": "array",
999
+ "items": { "type": "string" }
1000
+ },
1001
+ "scopes": {
1002
+ "type": "array",
1003
+ "items": { "$ref": "#/$defs/ScopeId" }
1004
+ },
1005
+ "parent": { "$ref": "#/$defs/AgentId" },
1006
+ "hasChildren": { "type": "boolean" }
1007
+ }
1008
+ },
1009
+ "limit": { "type": "integer", "minimum": 1 },
1010
+ "cursor": { "type": "string" },
1011
+ "_meta": { "$ref": "#/$defs/Meta" }
1012
+ }
1013
+ }
1014
+ },
1015
+ "required": ["jsonrpc", "id", "method"]
1016
+ },
1017
+ "AgentsListResponse": {
1018
+ "type": "object",
1019
+ "description": "Response to map/agents/list",
1020
+ "properties": {
1021
+ "agents": {
1022
+ "type": "array",
1023
+ "items": { "$ref": "#/$defs/Agent" }
1024
+ },
1025
+ "nextCursor": { "type": "string" },
1026
+ "_meta": { "$ref": "#/$defs/Meta" }
1027
+ },
1028
+ "required": ["agents"]
1029
+ },
1030
+ "AgentsGetRequest": {
1031
+ "type": "object",
1032
+ "x-method": "map/agents/get",
1033
+ "x-tier": "core",
1034
+ "description": "Get details for a single agent",
1035
+ "properties": {
1036
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1037
+ "id": { "$ref": "#/$defs/RequestId" },
1038
+ "method": { "const": "map/agents/get" },
1039
+ "params": {
1040
+ "type": "object",
1041
+ "properties": {
1042
+ "agentId": { "$ref": "#/$defs/AgentId" },
1043
+ "_meta": { "$ref": "#/$defs/Meta" }
1044
+ },
1045
+ "required": ["agentId"]
1046
+ }
1047
+ },
1048
+ "required": ["jsonrpc", "id", "method", "params"]
1049
+ },
1050
+ "AgentsGetResponse": {
1051
+ "type": "object",
1052
+ "description": "Response to map/agents/get",
1053
+ "properties": {
1054
+ "agent": { "$ref": "#/$defs/Agent" },
1055
+ "_meta": { "$ref": "#/$defs/Meta" }
1056
+ },
1057
+ "required": ["agent"]
1058
+ },
1059
+
1060
+ "SendRequest": {
1061
+ "type": "object",
1062
+ "x-method": "map/send",
1063
+ "x-tier": "core",
1064
+ "description": "Send a message to an address",
1065
+ "properties": {
1066
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1067
+ "id": { "$ref": "#/$defs/RequestId" },
1068
+ "method": { "const": "map/send" },
1069
+ "params": {
1070
+ "type": "object",
1071
+ "properties": {
1072
+ "to": { "$ref": "#/$defs/Address" },
1073
+ "payload": {},
1074
+ "meta": { "$ref": "#/$defs/MessageMeta" },
1075
+ "_meta": { "$ref": "#/$defs/Meta" }
1076
+ },
1077
+ "required": ["to"]
1078
+ }
1079
+ },
1080
+ "required": ["jsonrpc", "id", "method", "params"]
1081
+ },
1082
+ "SendResponse": {
1083
+ "type": "object",
1084
+ "description": "Response to map/send",
1085
+ "properties": {
1086
+ "messageId": { "$ref": "#/$defs/MessageId" },
1087
+ "delivered": {
1088
+ "type": "array",
1089
+ "items": { "$ref": "#/$defs/ParticipantId" },
1090
+ "description": "Participants the message was delivered to"
1091
+ },
1092
+ "_meta": { "$ref": "#/$defs/Meta" }
1093
+ },
1094
+ "required": ["messageId"]
1095
+ },
1096
+
1097
+ "SubscribeRequest": {
1098
+ "type": "object",
1099
+ "x-method": "map/subscribe",
1100
+ "x-tier": "core",
1101
+ "description": "Subscribe to event streams",
1102
+ "properties": {
1103
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1104
+ "id": { "$ref": "#/$defs/RequestId" },
1105
+ "method": { "const": "map/subscribe" },
1106
+ "params": {
1107
+ "type": "object",
1108
+ "properties": {
1109
+ "filter": { "$ref": "#/$defs/SubscriptionFilter" },
1110
+ "replayFrom": {
1111
+ "oneOf": [
1112
+ { "$ref": "#/$defs/Timestamp" },
1113
+ { "type": "string" }
1114
+ ]
1115
+ },
1116
+ "_meta": { "$ref": "#/$defs/Meta" }
1117
+ }
1118
+ }
1119
+ },
1120
+ "required": ["jsonrpc", "id", "method"]
1121
+ },
1122
+ "SubscribeResponse": {
1123
+ "type": "object",
1124
+ "description": "Response to map/subscribe",
1125
+ "properties": {
1126
+ "subscriptionId": { "$ref": "#/$defs/SubscriptionId" },
1127
+ "_meta": { "$ref": "#/$defs/Meta" }
1128
+ },
1129
+ "required": ["subscriptionId"]
1130
+ },
1131
+ "UnsubscribeRequest": {
1132
+ "type": "object",
1133
+ "x-method": "map/unsubscribe",
1134
+ "x-tier": "core",
1135
+ "description": "Unsubscribe from event streams",
1136
+ "properties": {
1137
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1138
+ "id": { "$ref": "#/$defs/RequestId" },
1139
+ "method": { "const": "map/unsubscribe" },
1140
+ "params": {
1141
+ "type": "object",
1142
+ "properties": {
1143
+ "subscriptionId": { "$ref": "#/$defs/SubscriptionId" },
1144
+ "_meta": { "$ref": "#/$defs/Meta" }
1145
+ },
1146
+ "required": ["subscriptionId"]
1147
+ }
1148
+ },
1149
+ "required": ["jsonrpc", "id", "method", "params"]
1150
+ },
1151
+ "UnsubscribeResponse": {
1152
+ "type": "object",
1153
+ "description": "Response to map/unsubscribe",
1154
+ "properties": {
1155
+ "unsubscribed": { "type": "boolean" },
1156
+ "_meta": { "$ref": "#/$defs/Meta" }
1157
+ },
1158
+ "required": ["unsubscribed"]
1159
+ },
1160
+
1161
+ "AuthRefreshRequest": {
1162
+ "type": "object",
1163
+ "x-method": "map/auth/refresh",
1164
+ "x-tier": "core",
1165
+ "description": "Refresh authentication token in-band",
1166
+ "properties": {
1167
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1168
+ "id": { "$ref": "#/$defs/RequestId" },
1169
+ "method": { "const": "map/auth/refresh" },
1170
+ "params": {
1171
+ "type": "object",
1172
+ "properties": {
1173
+ "refreshToken": { "type": "string" },
1174
+ "_meta": { "$ref": "#/$defs/Meta" }
1175
+ },
1176
+ "required": ["refreshToken"]
1177
+ }
1178
+ },
1179
+ "required": ["jsonrpc", "id", "method", "params"]
1180
+ },
1181
+ "AuthRefreshResponse": {
1182
+ "type": "object",
1183
+ "description": "Response to map/auth/refresh",
1184
+ "properties": {
1185
+ "accessToken": { "type": "string" },
1186
+ "expiresAt": { "$ref": "#/$defs/Timestamp" },
1187
+ "refreshToken": { "type": "string" },
1188
+ "_meta": { "$ref": "#/$defs/Meta" }
1189
+ },
1190
+ "required": ["accessToken", "expiresAt"]
1191
+ },
1192
+
1193
+ "AgentsRegisterRequest": {
1194
+ "type": "object",
1195
+ "x-method": "map/agents/register",
1196
+ "x-tier": "structure",
1197
+ "description": "Register a new agent in the system",
1198
+ "properties": {
1199
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1200
+ "id": { "$ref": "#/$defs/RequestId" },
1201
+ "method": { "const": "map/agents/register" },
1202
+ "params": {
1203
+ "type": "object",
1204
+ "properties": {
1205
+ "agentId": { "$ref": "#/$defs/AgentId" },
1206
+ "name": { "type": "string" },
1207
+ "description": { "type": "string" },
1208
+ "role": { "type": "string" },
1209
+ "parent": { "$ref": "#/$defs/AgentId" },
1210
+ "scopes": {
1211
+ "type": "array",
1212
+ "items": { "$ref": "#/$defs/ScopeId" }
1213
+ },
1214
+ "visibility": { "$ref": "#/$defs/AgentVisibility" },
1215
+ "capabilities": { "$ref": "#/$defs/ParticipantCapabilities" },
1216
+ "metadata": { "type": "object" },
1217
+ "_meta": { "$ref": "#/$defs/Meta" }
1218
+ }
1219
+ }
1220
+ },
1221
+ "required": ["jsonrpc", "id", "method"]
1222
+ },
1223
+ "AgentsRegisterResponse": {
1224
+ "type": "object",
1225
+ "description": "Response to map/agents/register",
1226
+ "properties": {
1227
+ "agent": { "$ref": "#/$defs/Agent" },
1228
+ "_meta": { "$ref": "#/$defs/Meta" }
1229
+ },
1230
+ "required": ["agent"]
1231
+ },
1232
+ "AgentsSpawnRequest": {
1233
+ "type": "object",
1234
+ "x-method": "map/agents/spawn",
1235
+ "x-tier": "structure",
1236
+ "description": "Register agent and assign initial task atomically",
1237
+ "properties": {
1238
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1239
+ "id": { "$ref": "#/$defs/RequestId" },
1240
+ "method": { "const": "map/agents/spawn" },
1241
+ "params": {
1242
+ "type": "object",
1243
+ "properties": {
1244
+ "agentId": { "$ref": "#/$defs/AgentId" },
1245
+ "name": { "type": "string" },
1246
+ "description": { "type": "string" },
1247
+ "role": { "type": "string" },
1248
+ "parent": { "$ref": "#/$defs/AgentId" },
1249
+ "scopes": {
1250
+ "type": "array",
1251
+ "items": { "$ref": "#/$defs/ScopeId" }
1252
+ },
1253
+ "visibility": { "$ref": "#/$defs/AgentVisibility" },
1254
+ "capabilities": { "$ref": "#/$defs/ParticipantCapabilities" },
1255
+ "initialMessage": { "$ref": "#/$defs/Message" },
1256
+ "metadata": { "type": "object" },
1257
+ "_meta": { "$ref": "#/$defs/Meta" }
1258
+ }
1259
+ }
1260
+ },
1261
+ "required": ["jsonrpc", "id", "method"]
1262
+ },
1263
+ "AgentsSpawnResponse": {
1264
+ "type": "object",
1265
+ "description": "Response to map/agents/spawn",
1266
+ "properties": {
1267
+ "agent": { "$ref": "#/$defs/Agent" },
1268
+ "messageId": { "$ref": "#/$defs/MessageId" },
1269
+ "_meta": { "$ref": "#/$defs/Meta" }
1270
+ },
1271
+ "required": ["agent"]
1272
+ },
1273
+ "AgentsUnregisterRequest": {
1274
+ "type": "object",
1275
+ "x-method": "map/agents/unregister",
1276
+ "x-tier": "structure",
1277
+ "description": "Remove an agent from the system",
1278
+ "properties": {
1279
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1280
+ "id": { "$ref": "#/$defs/RequestId" },
1281
+ "method": { "const": "map/agents/unregister" },
1282
+ "params": {
1283
+ "type": "object",
1284
+ "properties": {
1285
+ "agentId": { "$ref": "#/$defs/AgentId" },
1286
+ "reason": { "type": "string" },
1287
+ "_meta": { "$ref": "#/$defs/Meta" }
1288
+ },
1289
+ "required": ["agentId"]
1290
+ }
1291
+ },
1292
+ "required": ["jsonrpc", "id", "method", "params"]
1293
+ },
1294
+ "AgentsUnregisterResponse": {
1295
+ "type": "object",
1296
+ "description": "Response to map/agents/unregister",
1297
+ "properties": {
1298
+ "unregistered": { "type": "boolean" },
1299
+ "_meta": { "$ref": "#/$defs/Meta" }
1300
+ },
1301
+ "required": ["unregistered"]
1302
+ },
1303
+ "AgentsUpdateRequest": {
1304
+ "type": "object",
1305
+ "x-method": "map/agents/update",
1306
+ "x-tier": "structure",
1307
+ "description": "Update agent state or metadata",
1308
+ "properties": {
1309
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1310
+ "id": { "$ref": "#/$defs/RequestId" },
1311
+ "method": { "const": "map/agents/update" },
1312
+ "params": {
1313
+ "type": "object",
1314
+ "properties": {
1315
+ "agentId": { "$ref": "#/$defs/AgentId" },
1316
+ "state": { "$ref": "#/$defs/AgentState" },
1317
+ "metadata": { "type": "object" },
1318
+ "_meta": { "$ref": "#/$defs/Meta" }
1319
+ },
1320
+ "required": ["agentId"]
1321
+ }
1322
+ },
1323
+ "required": ["jsonrpc", "id", "method", "params"]
1324
+ },
1325
+ "AgentsUpdateResponse": {
1326
+ "type": "object",
1327
+ "description": "Response to map/agents/update",
1328
+ "properties": {
1329
+ "agent": { "$ref": "#/$defs/Agent" },
1330
+ "_meta": { "$ref": "#/$defs/Meta" }
1331
+ },
1332
+ "required": ["agent"]
1333
+ },
1334
+ "AgentsStopRequest": {
1335
+ "type": "object",
1336
+ "x-method": "map/agents/stop",
1337
+ "x-tier": "structure",
1338
+ "description": "Request graceful agent stop",
1339
+ "properties": {
1340
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1341
+ "id": { "$ref": "#/$defs/RequestId" },
1342
+ "method": { "const": "map/agents/stop" },
1343
+ "params": {
1344
+ "type": "object",
1345
+ "properties": {
1346
+ "agentId": { "$ref": "#/$defs/AgentId" },
1347
+ "reason": { "type": "string" },
1348
+ "force": { "type": "boolean", "default": false },
1349
+ "_meta": { "$ref": "#/$defs/Meta" }
1350
+ },
1351
+ "required": ["agentId"]
1352
+ }
1353
+ },
1354
+ "required": ["jsonrpc", "id", "method", "params"]
1355
+ },
1356
+ "AgentsStopResponse": {
1357
+ "type": "object",
1358
+ "description": "Response to map/agents/stop",
1359
+ "properties": {
1360
+ "stopping": { "type": "boolean" },
1361
+ "agent": { "$ref": "#/$defs/Agent" },
1362
+ "_meta": { "$ref": "#/$defs/Meta" }
1363
+ },
1364
+ "required": ["stopping"]
1365
+ },
1366
+ "AgentsSuspendRequest": {
1367
+ "type": "object",
1368
+ "x-method": "map/agents/suspend",
1369
+ "x-tier": "structure",
1370
+ "description": "Pause an agent",
1371
+ "properties": {
1372
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1373
+ "id": { "$ref": "#/$defs/RequestId" },
1374
+ "method": { "const": "map/agents/suspend" },
1375
+ "params": {
1376
+ "type": "object",
1377
+ "properties": {
1378
+ "agentId": { "$ref": "#/$defs/AgentId" },
1379
+ "reason": { "type": "string" },
1380
+ "_meta": { "$ref": "#/$defs/Meta" }
1381
+ },
1382
+ "required": ["agentId"]
1383
+ }
1384
+ },
1385
+ "required": ["jsonrpc", "id", "method", "params"]
1386
+ },
1387
+ "AgentsSuspendResponse": {
1388
+ "type": "object",
1389
+ "description": "Response to map/agents/suspend",
1390
+ "properties": {
1391
+ "suspended": { "type": "boolean" },
1392
+ "agent": { "$ref": "#/$defs/Agent" },
1393
+ "_meta": { "$ref": "#/$defs/Meta" }
1394
+ },
1395
+ "required": ["suspended"]
1396
+ },
1397
+ "AgentsResumeRequest": {
1398
+ "type": "object",
1399
+ "x-method": "map/agents/resume",
1400
+ "x-tier": "structure",
1401
+ "description": "Resume a suspended agent",
1402
+ "properties": {
1403
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1404
+ "id": { "$ref": "#/$defs/RequestId" },
1405
+ "method": { "const": "map/agents/resume" },
1406
+ "params": {
1407
+ "type": "object",
1408
+ "properties": {
1409
+ "agentId": { "$ref": "#/$defs/AgentId" },
1410
+ "_meta": { "$ref": "#/$defs/Meta" }
1411
+ },
1412
+ "required": ["agentId"]
1413
+ }
1414
+ },
1415
+ "required": ["jsonrpc", "id", "method", "params"]
1416
+ },
1417
+ "AgentsResumeResponse": {
1418
+ "type": "object",
1419
+ "description": "Response to map/agents/resume",
1420
+ "properties": {
1421
+ "resumed": { "type": "boolean" },
1422
+ "agent": { "$ref": "#/$defs/Agent" },
1423
+ "_meta": { "$ref": "#/$defs/Meta" }
1424
+ },
1425
+ "required": ["resumed"]
1426
+ },
1427
+
1428
+ "StructureGraphRequest": {
1429
+ "type": "object",
1430
+ "x-method": "map/structure/graph",
1431
+ "x-tier": "structure",
1432
+ "description": "Get the agent relationship graph",
1433
+ "properties": {
1434
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1435
+ "id": { "$ref": "#/$defs/RequestId" },
1436
+ "method": { "const": "map/structure/graph" },
1437
+ "params": {
1438
+ "type": "object",
1439
+ "properties": {
1440
+ "rootAgentId": { "$ref": "#/$defs/AgentId" },
1441
+ "depth": { "type": "integer", "minimum": 1 },
1442
+ "includeRelationships": { "type": "boolean", "default": true },
1443
+ "_meta": { "$ref": "#/$defs/Meta" }
1444
+ }
1445
+ }
1446
+ },
1447
+ "required": ["jsonrpc", "id", "method"]
1448
+ },
1449
+ "StructureGraphResponse": {
1450
+ "type": "object",
1451
+ "description": "Response to map/structure/graph",
1452
+ "properties": {
1453
+ "nodes": {
1454
+ "type": "array",
1455
+ "items": { "$ref": "#/$defs/Agent" }
1456
+ },
1457
+ "edges": {
1458
+ "type": "array",
1459
+ "items": {
1460
+ "type": "object",
1461
+ "properties": {
1462
+ "from": { "$ref": "#/$defs/AgentId" },
1463
+ "to": { "$ref": "#/$defs/AgentId" },
1464
+ "type": {
1465
+ "type": "string",
1466
+ "enum": ["parent-child", "peer", "supervisor", "collaborator"]
1467
+ }
1468
+ },
1469
+ "required": ["from", "to", "type"]
1470
+ }
1471
+ },
1472
+ "_meta": { "$ref": "#/$defs/Meta" }
1473
+ },
1474
+ "required": ["nodes", "edges"]
1475
+ },
1476
+
1477
+ "ScopesListRequest": {
1478
+ "type": "object",
1479
+ "x-method": "map/scopes/list",
1480
+ "x-tier": "structure",
1481
+ "description": "List all scopes",
1482
+ "properties": {
1483
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1484
+ "id": { "$ref": "#/$defs/RequestId" },
1485
+ "method": { "const": "map/scopes/list" },
1486
+ "params": {
1487
+ "type": "object",
1488
+ "properties": {
1489
+ "parent": { "$ref": "#/$defs/ScopeId" },
1490
+ "_meta": { "$ref": "#/$defs/Meta" }
1491
+ }
1492
+ }
1493
+ },
1494
+ "required": ["jsonrpc", "id", "method"]
1495
+ },
1496
+ "ScopesListResponse": {
1497
+ "type": "object",
1498
+ "description": "Response to map/scopes/list",
1499
+ "properties": {
1500
+ "scopes": {
1501
+ "type": "array",
1502
+ "items": { "$ref": "#/$defs/Scope" }
1503
+ },
1504
+ "_meta": { "$ref": "#/$defs/Meta" }
1505
+ },
1506
+ "required": ["scopes"]
1507
+ },
1508
+ "ScopesGetRequest": {
1509
+ "type": "object",
1510
+ "x-method": "map/scopes/get",
1511
+ "x-tier": "structure",
1512
+ "description": "Get details for a single scope",
1513
+ "properties": {
1514
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1515
+ "id": { "$ref": "#/$defs/RequestId" },
1516
+ "method": { "const": "map/scopes/get" },
1517
+ "params": {
1518
+ "type": "object",
1519
+ "properties": {
1520
+ "scopeId": { "$ref": "#/$defs/ScopeId" },
1521
+ "_meta": { "$ref": "#/$defs/Meta" }
1522
+ },
1523
+ "required": ["scopeId"]
1524
+ }
1525
+ },
1526
+ "required": ["jsonrpc", "id", "method", "params"]
1527
+ },
1528
+ "ScopesGetResponse": {
1529
+ "type": "object",
1530
+ "description": "Response to map/scopes/get",
1531
+ "properties": {
1532
+ "scope": { "$ref": "#/$defs/Scope" },
1533
+ "_meta": { "$ref": "#/$defs/Meta" }
1534
+ },
1535
+ "required": ["scope"]
1536
+ },
1537
+ "ScopesCreateRequest": {
1538
+ "type": "object",
1539
+ "x-method": "map/scopes/create",
1540
+ "x-tier": "structure",
1541
+ "description": "Create a new scope",
1542
+ "properties": {
1543
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1544
+ "id": { "$ref": "#/$defs/RequestId" },
1545
+ "method": { "const": "map/scopes/create" },
1546
+ "params": {
1547
+ "type": "object",
1548
+ "properties": {
1549
+ "scopeId": { "$ref": "#/$defs/ScopeId" },
1550
+ "name": { "type": "string" },
1551
+ "description": { "type": "string" },
1552
+ "parent": { "$ref": "#/$defs/ScopeId" },
1553
+ "joinPolicy": { "$ref": "#/$defs/JoinPolicy" },
1554
+ "autoJoinRoles": {
1555
+ "type": "array",
1556
+ "items": { "type": "string" }
1557
+ },
1558
+ "visibility": { "$ref": "#/$defs/ScopeVisibility" },
1559
+ "messageVisibility": { "$ref": "#/$defs/MessageVisibility" },
1560
+ "sendPolicy": { "$ref": "#/$defs/SendPolicy" },
1561
+ "persistent": { "type": "boolean" },
1562
+ "autoDelete": { "type": "boolean" },
1563
+ "metadata": { "type": "object" },
1564
+ "_meta": { "$ref": "#/$defs/Meta" }
1565
+ }
1566
+ }
1567
+ },
1568
+ "required": ["jsonrpc", "id", "method"]
1569
+ },
1570
+ "ScopesCreateResponse": {
1571
+ "type": "object",
1572
+ "description": "Response to map/scopes/create",
1573
+ "properties": {
1574
+ "scope": { "$ref": "#/$defs/Scope" },
1575
+ "_meta": { "$ref": "#/$defs/Meta" }
1576
+ },
1577
+ "required": ["scope"]
1578
+ },
1579
+ "ScopesDeleteRequest": {
1580
+ "type": "object",
1581
+ "x-method": "map/scopes/delete",
1582
+ "x-tier": "structure",
1583
+ "description": "Delete a scope",
1584
+ "properties": {
1585
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1586
+ "id": { "$ref": "#/$defs/RequestId" },
1587
+ "method": { "const": "map/scopes/delete" },
1588
+ "params": {
1589
+ "type": "object",
1590
+ "properties": {
1591
+ "scopeId": { "$ref": "#/$defs/ScopeId" },
1592
+ "_meta": { "$ref": "#/$defs/Meta" }
1593
+ },
1594
+ "required": ["scopeId"]
1595
+ }
1596
+ },
1597
+ "required": ["jsonrpc", "id", "method", "params"]
1598
+ },
1599
+ "ScopesDeleteResponse": {
1600
+ "type": "object",
1601
+ "description": "Response to map/scopes/delete",
1602
+ "properties": {
1603
+ "deleted": { "type": "boolean" },
1604
+ "_meta": { "$ref": "#/$defs/Meta" }
1605
+ },
1606
+ "required": ["deleted"]
1607
+ },
1608
+ "ScopesJoinRequest": {
1609
+ "type": "object",
1610
+ "x-method": "map/scopes/join",
1611
+ "x-tier": "structure",
1612
+ "description": "Add an agent to a scope",
1613
+ "properties": {
1614
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1615
+ "id": { "$ref": "#/$defs/RequestId" },
1616
+ "method": { "const": "map/scopes/join" },
1617
+ "params": {
1618
+ "type": "object",
1619
+ "properties": {
1620
+ "scopeId": { "$ref": "#/$defs/ScopeId" },
1621
+ "agentId": { "$ref": "#/$defs/AgentId" },
1622
+ "_meta": { "$ref": "#/$defs/Meta" }
1623
+ },
1624
+ "required": ["scopeId", "agentId"]
1625
+ }
1626
+ },
1627
+ "required": ["jsonrpc", "id", "method", "params"]
1628
+ },
1629
+ "ScopesJoinResponse": {
1630
+ "type": "object",
1631
+ "description": "Response to map/scopes/join",
1632
+ "properties": {
1633
+ "joined": { "type": "boolean" },
1634
+ "_meta": { "$ref": "#/$defs/Meta" }
1635
+ },
1636
+ "required": ["joined"]
1637
+ },
1638
+ "ScopesLeaveRequest": {
1639
+ "type": "object",
1640
+ "x-method": "map/scopes/leave",
1641
+ "x-tier": "structure",
1642
+ "description": "Remove an agent from a scope",
1643
+ "properties": {
1644
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1645
+ "id": { "$ref": "#/$defs/RequestId" },
1646
+ "method": { "const": "map/scopes/leave" },
1647
+ "params": {
1648
+ "type": "object",
1649
+ "properties": {
1650
+ "scopeId": { "$ref": "#/$defs/ScopeId" },
1651
+ "agentId": { "$ref": "#/$defs/AgentId" },
1652
+ "_meta": { "$ref": "#/$defs/Meta" }
1653
+ },
1654
+ "required": ["scopeId", "agentId"]
1655
+ }
1656
+ },
1657
+ "required": ["jsonrpc", "id", "method", "params"]
1658
+ },
1659
+ "ScopesLeaveResponse": {
1660
+ "type": "object",
1661
+ "description": "Response to map/scopes/leave",
1662
+ "properties": {
1663
+ "left": { "type": "boolean" },
1664
+ "_meta": { "$ref": "#/$defs/Meta" }
1665
+ },
1666
+ "required": ["left"]
1667
+ },
1668
+ "ScopesMembersRequest": {
1669
+ "type": "object",
1670
+ "x-method": "map/scopes/members",
1671
+ "x-tier": "structure",
1672
+ "description": "List members of a scope",
1673
+ "properties": {
1674
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1675
+ "id": { "$ref": "#/$defs/RequestId" },
1676
+ "method": { "const": "map/scopes/members" },
1677
+ "params": {
1678
+ "type": "object",
1679
+ "properties": {
1680
+ "scopeId": { "$ref": "#/$defs/ScopeId" },
1681
+ "limit": { "type": "integer", "minimum": 1 },
1682
+ "cursor": { "type": "string" },
1683
+ "_meta": { "$ref": "#/$defs/Meta" }
1684
+ },
1685
+ "required": ["scopeId"]
1686
+ }
1687
+ },
1688
+ "required": ["jsonrpc", "id", "method", "params"]
1689
+ },
1690
+ "ScopesMembersResponse": {
1691
+ "type": "object",
1692
+ "description": "Response to map/scopes/members",
1693
+ "properties": {
1694
+ "members": {
1695
+ "type": "array",
1696
+ "items": { "$ref": "#/$defs/AgentId" }
1697
+ },
1698
+ "nextCursor": { "type": "string" },
1699
+ "_meta": { "$ref": "#/$defs/Meta" }
1700
+ },
1701
+ "required": ["members"]
1702
+ },
1703
+
1704
+ "InjectRequest": {
1705
+ "type": "object",
1706
+ "x-method": "map/inject",
1707
+ "x-tier": "extension",
1708
+ "description": "Inject context into a running agent (steering)",
1709
+ "properties": {
1710
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1711
+ "id": { "$ref": "#/$defs/RequestId" },
1712
+ "method": { "const": "map/inject" },
1713
+ "params": {
1714
+ "type": "object",
1715
+ "properties": {
1716
+ "agentId": { "$ref": "#/$defs/AgentId" },
1717
+ "content": {
1718
+ "description": "Content to inject"
1719
+ },
1720
+ "delivery": {
1721
+ "type": "string",
1722
+ "enum": ["interrupt", "queue", "best-effort"],
1723
+ "default": "best-effort",
1724
+ "description": "How to deliver the injection"
1725
+ },
1726
+ "_meta": { "$ref": "#/$defs/Meta" }
1727
+ },
1728
+ "required": ["agentId", "content"]
1729
+ }
1730
+ },
1731
+ "required": ["jsonrpc", "id", "method", "params"]
1732
+ },
1733
+ "InjectResponse": {
1734
+ "type": "object",
1735
+ "description": "Response to map/inject",
1736
+ "properties": {
1737
+ "injected": { "type": "boolean" },
1738
+ "delivery": {
1739
+ "type": "string",
1740
+ "enum": ["interrupt", "queue", "message"],
1741
+ "description": "Actual delivery method used"
1742
+ },
1743
+ "_meta": { "$ref": "#/$defs/Meta" }
1744
+ },
1745
+ "required": ["injected"]
1746
+ },
1747
+
1748
+ "FederationConnectRequest": {
1749
+ "type": "object",
1750
+ "x-method": "map/federation/connect",
1751
+ "x-tier": "extension",
1752
+ "description": "Connect to a peer MAP system",
1753
+ "properties": {
1754
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1755
+ "id": { "$ref": "#/$defs/RequestId" },
1756
+ "method": { "const": "map/federation/connect" },
1757
+ "params": {
1758
+ "type": "object",
1759
+ "properties": {
1760
+ "systemId": { "type": "string" },
1761
+ "endpoint": { "type": "string", "format": "uri" },
1762
+ "auth": {
1763
+ "type": "object",
1764
+ "properties": {
1765
+ "method": {
1766
+ "type": "string",
1767
+ "enum": ["bearer", "api-key", "mtls"]
1768
+ },
1769
+ "credentials": { "type": "string" }
1770
+ },
1771
+ "required": ["method"]
1772
+ },
1773
+ "_meta": { "$ref": "#/$defs/Meta" }
1774
+ },
1775
+ "required": ["systemId", "endpoint"]
1776
+ }
1777
+ },
1778
+ "required": ["jsonrpc", "id", "method", "params"]
1779
+ },
1780
+ "FederationConnectResponse": {
1781
+ "type": "object",
1782
+ "description": "Response to map/federation/connect",
1783
+ "properties": {
1784
+ "connected": { "type": "boolean" },
1785
+ "systemInfo": {
1786
+ "type": "object",
1787
+ "properties": {
1788
+ "name": { "type": "string" },
1789
+ "version": { "type": "string" },
1790
+ "capabilities": { "$ref": "#/$defs/ParticipantCapabilities" }
1791
+ }
1792
+ },
1793
+ "_meta": { "$ref": "#/$defs/Meta" }
1794
+ },
1795
+ "required": ["connected"]
1796
+ },
1797
+ "FederationRouteRequest": {
1798
+ "type": "object",
1799
+ "x-method": "map/federation/route",
1800
+ "x-tier": "extension",
1801
+ "description": "Route a message to a federated system",
1802
+ "properties": {
1803
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1804
+ "id": { "$ref": "#/$defs/RequestId" },
1805
+ "method": { "const": "map/federation/route" },
1806
+ "params": {
1807
+ "type": "object",
1808
+ "properties": {
1809
+ "systemId": { "type": "string" },
1810
+ "message": { "$ref": "#/$defs/Message" },
1811
+ "_meta": { "$ref": "#/$defs/Meta" }
1812
+ },
1813
+ "required": ["systemId", "message"]
1814
+ }
1815
+ },
1816
+ "required": ["jsonrpc", "id", "method", "params"]
1817
+ },
1818
+ "FederationRouteResponse": {
1819
+ "type": "object",
1820
+ "description": "Response to map/federation/route",
1821
+ "properties": {
1822
+ "routed": { "type": "boolean" },
1823
+ "messageId": { "$ref": "#/$defs/MessageId" },
1824
+ "_meta": { "$ref": "#/$defs/Meta" }
1825
+ },
1826
+ "required": ["routed"]
1827
+ },
1828
+
1829
+ "EventNotification": {
1830
+ "type": "object",
1831
+ "x-method": "map/event",
1832
+ "description": "System event notification (sent to subscribers)",
1833
+ "properties": {
1834
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1835
+ "method": { "const": "map/event" },
1836
+ "params": {
1837
+ "type": "object",
1838
+ "properties": {
1839
+ "subscriptionId": { "$ref": "#/$defs/SubscriptionId" },
1840
+ "sequenceNumber": {
1841
+ "type": "integer",
1842
+ "description": "Monotonic sequence for ordering"
1843
+ },
1844
+ "event": { "$ref": "#/$defs/Event" },
1845
+ "_meta": { "$ref": "#/$defs/Meta" }
1846
+ },
1847
+ "required": ["subscriptionId", "sequenceNumber", "event"]
1848
+ }
1849
+ },
1850
+ "required": ["jsonrpc", "method", "params"]
1851
+ },
1852
+ "MessageNotification": {
1853
+ "type": "object",
1854
+ "x-method": "map/message",
1855
+ "description": "Message delivery notification",
1856
+ "properties": {
1857
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
1858
+ "method": { "const": "map/message" },
1859
+ "params": {
1860
+ "type": "object",
1861
+ "properties": {
1862
+ "message": { "$ref": "#/$defs/Message" },
1863
+ "_meta": { "$ref": "#/$defs/Meta" }
1864
+ },
1865
+ "required": ["message"]
1866
+ }
1867
+ },
1868
+ "required": ["jsonrpc", "method", "params"]
1869
+ },
1870
+
1871
+ "ConversationId": {
1872
+ "type": "string",
1873
+ "description": "Unique identifier for a conversation"
1874
+ },
1875
+ "TurnId": {
1876
+ "type": "string",
1877
+ "description": "Unique identifier for a turn"
1878
+ },
1879
+ "ThreadId": {
1880
+ "type": "string",
1881
+ "description": "Unique identifier for a thread"
1882
+ },
1883
+ "ConversationType": {
1884
+ "type": "string",
1885
+ "enum": ["user-session", "agent-task", "multi-agent", "mixed"],
1886
+ "description": "Type of conversation"
1887
+ },
1888
+ "ConversationStatus": {
1889
+ "type": "string",
1890
+ "enum": ["active", "paused", "completed", "failed", "archived"],
1891
+ "description": "Status of a conversation"
1892
+ },
1893
+ "ParticipantRole": {
1894
+ "type": "string",
1895
+ "enum": ["initiator", "assistant", "worker", "observer", "moderator"],
1896
+ "description": "Role of a participant within a conversation"
1897
+ },
1898
+ "TurnStatus": {
1899
+ "type": "string",
1900
+ "enum": ["pending", "streaming", "complete", "failed"],
1901
+ "description": "Status of a turn's content lifecycle"
1902
+ },
1903
+ "TurnVisibility": {
1904
+ "description": "Visibility of a turn within a conversation",
1905
+ "oneOf": [
1906
+ { "type": "object", "properties": { "type": { "const": "all" } }, "required": ["type"] },
1907
+ { "type": "object", "properties": { "type": { "const": "participants" }, "ids": { "type": "array", "items": { "$ref": "#/$defs/ParticipantId" } } }, "required": ["type", "ids"] },
1908
+ { "type": "object", "properties": { "type": { "const": "role" }, "roles": { "type": "array", "items": { "$ref": "#/$defs/ParticipantRole" } } }, "required": ["type", "roles"] },
1909
+ { "type": "object", "properties": { "type": { "const": "private" } }, "required": ["type"] }
1910
+ ]
1911
+ },
1912
+ "TurnSource": {
1913
+ "description": "How a turn was created",
1914
+ "oneOf": [
1915
+ { "type": "object", "properties": { "type": { "const": "explicit" }, "method": { "const": "mail/turn" } }, "required": ["type", "method"] },
1916
+ { "type": "object", "properties": { "type": { "const": "intercepted" }, "messageId": { "$ref": "#/$defs/MessageId" } }, "required": ["type", "messageId"] }
1917
+ ]
1918
+ },
1919
+ "ConversationPermissions": {
1920
+ "type": "object",
1921
+ "description": "Permissions for a participant within a conversation",
1922
+ "properties": {
1923
+ "canSend": { "type": "boolean" },
1924
+ "canObserve": { "type": "boolean" },
1925
+ "canInvite": { "type": "boolean" },
1926
+ "canRemove": { "type": "boolean" },
1927
+ "canCreateThreads": { "type": "boolean" },
1928
+ "historyAccess": { "type": "string", "enum": ["none", "from-join", "full"] },
1929
+ "canSeeInternal": { "type": "boolean" }
1930
+ },
1931
+ "additionalProperties": false
1932
+ },
1933
+ "Conversation": {
1934
+ "type": "object",
1935
+ "description": "A conversation - container for tracking related interactions",
1936
+ "properties": {
1937
+ "id": { "$ref": "#/$defs/ConversationId" },
1938
+ "type": { "$ref": "#/$defs/ConversationType" },
1939
+ "status": { "$ref": "#/$defs/ConversationStatus" },
1940
+ "subject": { "type": "string" },
1941
+ "participantCount": { "type": "integer" },
1942
+ "parentConversationId": { "$ref": "#/$defs/ConversationId" },
1943
+ "parentTurnId": { "$ref": "#/$defs/TurnId" },
1944
+ "createdAt": { "$ref": "#/$defs/Timestamp" },
1945
+ "updatedAt": { "$ref": "#/$defs/Timestamp" },
1946
+ "closedAt": { "$ref": "#/$defs/Timestamp" },
1947
+ "createdBy": { "$ref": "#/$defs/ParticipantId" },
1948
+ "metadata": { "type": "object" },
1949
+ "_meta": { "$ref": "#/$defs/Meta" }
1950
+ },
1951
+ "required": ["id", "type", "status", "participantCount", "createdAt", "updatedAt", "createdBy"],
1952
+ "additionalProperties": false
1953
+ },
1954
+ "ConversationParticipant": {
1955
+ "type": "object",
1956
+ "description": "A participant in a conversation with role and permissions",
1957
+ "properties": {
1958
+ "id": { "$ref": "#/$defs/ParticipantId" },
1959
+ "type": { "type": "string", "enum": ["user", "agent", "system"] },
1960
+ "role": { "$ref": "#/$defs/ParticipantRole" },
1961
+ "joinedAt": { "$ref": "#/$defs/Timestamp" },
1962
+ "leftAt": { "$ref": "#/$defs/Timestamp" },
1963
+ "permissions": { "$ref": "#/$defs/ConversationPermissions" },
1964
+ "agentInfo": {
1965
+ "type": "object",
1966
+ "properties": {
1967
+ "agentId": { "$ref": "#/$defs/AgentId" },
1968
+ "name": { "type": "string" },
1969
+ "role": { "type": "string" }
1970
+ },
1971
+ "required": ["agentId"]
1972
+ },
1973
+ "_meta": { "$ref": "#/$defs/Meta" }
1974
+ },
1975
+ "required": ["id", "type", "role", "joinedAt", "permissions"],
1976
+ "additionalProperties": false
1977
+ },
1978
+ "Turn": {
1979
+ "type": "object",
1980
+ "description": "A turn - the atomic unit of conversation",
1981
+ "properties": {
1982
+ "id": { "$ref": "#/$defs/TurnId" },
1983
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
1984
+ "participant": { "$ref": "#/$defs/ParticipantId" },
1985
+ "timestamp": { "$ref": "#/$defs/Timestamp" },
1986
+ "contentType": { "type": "string", "description": "Content type: text, data, event, reference, or x-* custom" },
1987
+ "content": { "description": "Content payload - shape determined by contentType" },
1988
+ "threadId": { "$ref": "#/$defs/ThreadId" },
1989
+ "inReplyTo": { "$ref": "#/$defs/TurnId" },
1990
+ "source": { "$ref": "#/$defs/TurnSource" },
1991
+ "visibility": { "$ref": "#/$defs/TurnVisibility" },
1992
+ "status": { "$ref": "#/$defs/TurnStatus" },
1993
+ "metadata": { "type": "object" },
1994
+ "_meta": { "$ref": "#/$defs/Meta" }
1995
+ },
1996
+ "required": ["id", "conversationId", "participant", "timestamp", "contentType", "content", "source"],
1997
+ "additionalProperties": false
1998
+ },
1999
+ "Thread": {
2000
+ "type": "object",
2001
+ "description": "A thread within a conversation for focused discussion",
2002
+ "properties": {
2003
+ "id": { "$ref": "#/$defs/ThreadId" },
2004
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2005
+ "parentThreadId": { "$ref": "#/$defs/ThreadId" },
2006
+ "subject": { "type": "string" },
2007
+ "rootTurnId": { "$ref": "#/$defs/TurnId" },
2008
+ "turnCount": { "type": "integer" },
2009
+ "participantCount": { "type": "integer" },
2010
+ "createdAt": { "$ref": "#/$defs/Timestamp" },
2011
+ "updatedAt": { "$ref": "#/$defs/Timestamp" },
2012
+ "createdBy": { "$ref": "#/$defs/ParticipantId" },
2013
+ "_meta": { "$ref": "#/$defs/Meta" }
2014
+ },
2015
+ "required": ["id", "conversationId", "rootTurnId", "turnCount", "participantCount", "createdAt", "updatedAt", "createdBy"],
2016
+ "additionalProperties": false
2017
+ },
2018
+ "MailMessageMeta": {
2019
+ "type": "object",
2020
+ "description": "Mail metadata for map/send turn tracking",
2021
+ "properties": {
2022
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2023
+ "threadId": { "$ref": "#/$defs/ThreadId" },
2024
+ "inReplyTo": { "$ref": "#/$defs/TurnId" },
2025
+ "visibility": { "$ref": "#/$defs/TurnVisibility" }
2026
+ },
2027
+ "required": ["conversationId"],
2028
+ "additionalProperties": false
2029
+ },
2030
+ "MailSubscriptionFilter": {
2031
+ "type": "object",
2032
+ "description": "Mail-specific subscription filter for conversation events",
2033
+ "properties": {
2034
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2035
+ "threadId": { "$ref": "#/$defs/ThreadId" },
2036
+ "participantId": { "$ref": "#/$defs/ParticipantId" },
2037
+ "contentType": { "type": "string" }
2038
+ },
2039
+ "additionalProperties": false
2040
+ },
2041
+
2042
+ "MailCreateRequest": {
2043
+ "type": "object",
2044
+ "x-method": "mail/create",
2045
+ "x-tier": "extension",
2046
+ "description": "Create a new conversation",
2047
+ "properties": {
2048
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2049
+ "id": { "$ref": "#/$defs/RequestId" },
2050
+ "method": { "const": "mail/create" },
2051
+ "params": {
2052
+ "type": "object",
2053
+ "properties": {
2054
+ "type": { "$ref": "#/$defs/ConversationType" },
2055
+ "subject": { "type": "string" },
2056
+ "parentConversationId": { "$ref": "#/$defs/ConversationId" },
2057
+ "parentTurnId": { "$ref": "#/$defs/TurnId" },
2058
+ "initialParticipants": {
2059
+ "type": "array",
2060
+ "items": {
2061
+ "type": "object",
2062
+ "properties": {
2063
+ "id": { "$ref": "#/$defs/ParticipantId" },
2064
+ "role": { "$ref": "#/$defs/ParticipantRole" },
2065
+ "permissions": { "$ref": "#/$defs/ConversationPermissions" }
2066
+ },
2067
+ "required": ["id"]
2068
+ }
2069
+ },
2070
+ "initialTurn": {
2071
+ "type": "object",
2072
+ "properties": {
2073
+ "contentType": { "type": "string" },
2074
+ "content": {},
2075
+ "visibility": { "$ref": "#/$defs/TurnVisibility" }
2076
+ },
2077
+ "required": ["contentType", "content"]
2078
+ },
2079
+ "metadata": { "type": "object" },
2080
+ "_meta": { "$ref": "#/$defs/Meta" }
2081
+ }
2082
+ }
2083
+ },
2084
+ "required": ["jsonrpc", "id", "method"]
2085
+ },
2086
+ "MailCreateResponse": {
2087
+ "type": "object",
2088
+ "properties": {
2089
+ "conversation": { "$ref": "#/$defs/Conversation" },
2090
+ "participant": { "$ref": "#/$defs/ConversationParticipant" },
2091
+ "initialTurn": { "$ref": "#/$defs/Turn" },
2092
+ "_meta": { "$ref": "#/$defs/Meta" }
2093
+ },
2094
+ "required": ["conversation", "participant"]
2095
+ },
2096
+ "MailGetRequest": {
2097
+ "type": "object",
2098
+ "x-method": "mail/get",
2099
+ "x-tier": "extension",
2100
+ "description": "Get conversation details",
2101
+ "properties": {
2102
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2103
+ "id": { "$ref": "#/$defs/RequestId" },
2104
+ "method": { "const": "mail/get" },
2105
+ "params": {
2106
+ "type": "object",
2107
+ "properties": {
2108
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2109
+ "include": {
2110
+ "type": "object",
2111
+ "properties": {
2112
+ "participants": { "type": "boolean" },
2113
+ "threads": { "type": "boolean" },
2114
+ "recentTurns": { "type": "integer" },
2115
+ "stats": { "type": "boolean" }
2116
+ }
2117
+ },
2118
+ "_meta": { "$ref": "#/$defs/Meta" }
2119
+ },
2120
+ "required": ["conversationId"]
2121
+ }
2122
+ },
2123
+ "required": ["jsonrpc", "id", "method", "params"]
2124
+ },
2125
+ "MailGetResponse": {
2126
+ "type": "object",
2127
+ "properties": {
2128
+ "conversation": { "$ref": "#/$defs/Conversation" },
2129
+ "participants": { "type": "array", "items": { "$ref": "#/$defs/ConversationParticipant" } },
2130
+ "threads": { "type": "array", "items": { "$ref": "#/$defs/Thread" } },
2131
+ "recentTurns": { "type": "array", "items": { "$ref": "#/$defs/Turn" } },
2132
+ "stats": {
2133
+ "type": "object",
2134
+ "properties": {
2135
+ "totalTurns": { "type": "integer" },
2136
+ "turnsByContentType": { "type": "object" },
2137
+ "activeParticipants": { "type": "integer" },
2138
+ "threadCount": { "type": "integer" }
2139
+ }
2140
+ },
2141
+ "_meta": { "$ref": "#/$defs/Meta" }
2142
+ },
2143
+ "required": ["conversation"]
2144
+ },
2145
+ "MailListRequest": {
2146
+ "type": "object",
2147
+ "x-method": "mail/list",
2148
+ "x-tier": "extension",
2149
+ "description": "List conversations with filtering",
2150
+ "properties": {
2151
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2152
+ "id": { "$ref": "#/$defs/RequestId" },
2153
+ "method": { "const": "mail/list" },
2154
+ "params": {
2155
+ "type": "object",
2156
+ "properties": {
2157
+ "filter": {
2158
+ "type": "object",
2159
+ "properties": {
2160
+ "type": { "type": "array", "items": { "$ref": "#/$defs/ConversationType" } },
2161
+ "status": { "type": "array", "items": { "$ref": "#/$defs/ConversationStatus" } },
2162
+ "participantId": { "$ref": "#/$defs/ParticipantId" },
2163
+ "createdAfter": { "$ref": "#/$defs/Timestamp" },
2164
+ "createdBefore": { "$ref": "#/$defs/Timestamp" },
2165
+ "parentConversationId": { "$ref": "#/$defs/ConversationId" }
2166
+ }
2167
+ },
2168
+ "limit": { "type": "integer", "minimum": 1 },
2169
+ "cursor": { "type": "string" },
2170
+ "_meta": { "$ref": "#/$defs/Meta" }
2171
+ }
2172
+ }
2173
+ },
2174
+ "required": ["jsonrpc", "id", "method"]
2175
+ },
2176
+ "MailListResponse": {
2177
+ "type": "object",
2178
+ "properties": {
2179
+ "conversations": { "type": "array", "items": { "$ref": "#/$defs/Conversation" } },
2180
+ "nextCursor": { "type": "string" },
2181
+ "hasMore": { "type": "boolean" },
2182
+ "_meta": { "$ref": "#/$defs/Meta" }
2183
+ },
2184
+ "required": ["conversations", "hasMore"]
2185
+ },
2186
+ "MailCloseRequest": {
2187
+ "type": "object",
2188
+ "x-method": "mail/close",
2189
+ "x-tier": "extension",
2190
+ "description": "Close a conversation",
2191
+ "properties": {
2192
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2193
+ "id": { "$ref": "#/$defs/RequestId" },
2194
+ "method": { "const": "mail/close" },
2195
+ "params": {
2196
+ "type": "object",
2197
+ "properties": {
2198
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2199
+ "reason": { "type": "string" },
2200
+ "_meta": { "$ref": "#/$defs/Meta" }
2201
+ },
2202
+ "required": ["conversationId"]
2203
+ }
2204
+ },
2205
+ "required": ["jsonrpc", "id", "method", "params"]
2206
+ },
2207
+ "MailCloseResponse": {
2208
+ "type": "object",
2209
+ "properties": {
2210
+ "conversation": { "$ref": "#/$defs/Conversation" },
2211
+ "_meta": { "$ref": "#/$defs/Meta" }
2212
+ },
2213
+ "required": ["conversation"]
2214
+ },
2215
+ "MailJoinRequest": {
2216
+ "type": "object",
2217
+ "x-method": "mail/join",
2218
+ "x-tier": "extension",
2219
+ "description": "Join a conversation",
2220
+ "properties": {
2221
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2222
+ "id": { "$ref": "#/$defs/RequestId" },
2223
+ "method": { "const": "mail/join" },
2224
+ "params": {
2225
+ "type": "object",
2226
+ "properties": {
2227
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2228
+ "role": { "$ref": "#/$defs/ParticipantRole" },
2229
+ "catchUp": {
2230
+ "type": "object",
2231
+ "properties": {
2232
+ "from": { "oneOf": [{ "type": "string" }, { "type": "number" }] },
2233
+ "limit": { "type": "integer" },
2234
+ "includeSummary": { "type": "boolean" }
2235
+ }
2236
+ },
2237
+ "_meta": { "$ref": "#/$defs/Meta" }
2238
+ },
2239
+ "required": ["conversationId"]
2240
+ }
2241
+ },
2242
+ "required": ["jsonrpc", "id", "method", "params"]
2243
+ },
2244
+ "MailJoinResponse": {
2245
+ "type": "object",
2246
+ "properties": {
2247
+ "conversation": { "$ref": "#/$defs/Conversation" },
2248
+ "participant": { "$ref": "#/$defs/ConversationParticipant" },
2249
+ "history": { "type": "array", "items": { "$ref": "#/$defs/Turn" } },
2250
+ "historyCursor": { "type": "string" },
2251
+ "summary": { "type": "string" },
2252
+ "_meta": { "$ref": "#/$defs/Meta" }
2253
+ },
2254
+ "required": ["conversation", "participant"]
2255
+ },
2256
+ "MailLeaveRequest": {
2257
+ "type": "object",
2258
+ "x-method": "mail/leave",
2259
+ "x-tier": "extension",
2260
+ "description": "Leave a conversation",
2261
+ "properties": {
2262
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2263
+ "id": { "$ref": "#/$defs/RequestId" },
2264
+ "method": { "const": "mail/leave" },
2265
+ "params": {
2266
+ "type": "object",
2267
+ "properties": {
2268
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2269
+ "reason": { "type": "string" },
2270
+ "_meta": { "$ref": "#/$defs/Meta" }
2271
+ },
2272
+ "required": ["conversationId"]
2273
+ }
2274
+ },
2275
+ "required": ["jsonrpc", "id", "method", "params"]
2276
+ },
2277
+ "MailLeaveResponse": {
2278
+ "type": "object",
2279
+ "properties": {
2280
+ "success": { "type": "boolean" },
2281
+ "leftAt": { "$ref": "#/$defs/Timestamp" },
2282
+ "_meta": { "$ref": "#/$defs/Meta" }
2283
+ },
2284
+ "required": ["success", "leftAt"]
2285
+ },
2286
+ "MailInviteRequest": {
2287
+ "type": "object",
2288
+ "x-method": "mail/invite",
2289
+ "x-tier": "extension",
2290
+ "description": "Invite a participant to a conversation",
2291
+ "properties": {
2292
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2293
+ "id": { "$ref": "#/$defs/RequestId" },
2294
+ "method": { "const": "mail/invite" },
2295
+ "params": {
2296
+ "type": "object",
2297
+ "properties": {
2298
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2299
+ "participant": {
2300
+ "type": "object",
2301
+ "properties": {
2302
+ "id": { "$ref": "#/$defs/ParticipantId" },
2303
+ "role": { "$ref": "#/$defs/ParticipantRole" },
2304
+ "permissions": { "$ref": "#/$defs/ConversationPermissions" }
2305
+ },
2306
+ "required": ["id"]
2307
+ },
2308
+ "message": { "type": "string" },
2309
+ "_meta": { "$ref": "#/$defs/Meta" }
2310
+ },
2311
+ "required": ["conversationId", "participant"]
2312
+ }
2313
+ },
2314
+ "required": ["jsonrpc", "id", "method", "params"]
2315
+ },
2316
+ "MailInviteResponse": {
2317
+ "type": "object",
2318
+ "properties": {
2319
+ "invited": { "type": "boolean" },
2320
+ "participant": { "$ref": "#/$defs/ConversationParticipant" },
2321
+ "invitationId": { "type": "string" },
2322
+ "pending": { "type": "boolean" },
2323
+ "_meta": { "$ref": "#/$defs/Meta" }
2324
+ },
2325
+ "required": ["invited"]
2326
+ },
2327
+ "MailTurnRequest": {
2328
+ "type": "object",
2329
+ "x-method": "mail/turn",
2330
+ "x-tier": "extension",
2331
+ "description": "Record a turn in a conversation",
2332
+ "properties": {
2333
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2334
+ "id": { "$ref": "#/$defs/RequestId" },
2335
+ "method": { "const": "mail/turn" },
2336
+ "params": {
2337
+ "type": "object",
2338
+ "properties": {
2339
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2340
+ "contentType": { "type": "string" },
2341
+ "content": {},
2342
+ "threadId": { "$ref": "#/$defs/ThreadId" },
2343
+ "inReplyTo": { "$ref": "#/$defs/TurnId" },
2344
+ "visibility": { "$ref": "#/$defs/TurnVisibility" },
2345
+ "metadata": { "type": "object" },
2346
+ "_meta": { "$ref": "#/$defs/Meta" }
2347
+ },
2348
+ "required": ["conversationId", "contentType", "content"]
2349
+ }
2350
+ },
2351
+ "required": ["jsonrpc", "id", "method", "params"]
2352
+ },
2353
+ "MailTurnResponse": {
2354
+ "type": "object",
2355
+ "properties": {
2356
+ "turn": { "$ref": "#/$defs/Turn" },
2357
+ "_meta": { "$ref": "#/$defs/Meta" }
2358
+ },
2359
+ "required": ["turn"]
2360
+ },
2361
+ "MailTurnsListRequest": {
2362
+ "type": "object",
2363
+ "x-method": "mail/turns/list",
2364
+ "x-tier": "extension",
2365
+ "description": "List turns in a conversation",
2366
+ "properties": {
2367
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2368
+ "id": { "$ref": "#/$defs/RequestId" },
2369
+ "method": { "const": "mail/turns/list" },
2370
+ "params": {
2371
+ "type": "object",
2372
+ "properties": {
2373
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2374
+ "filter": {
2375
+ "type": "object",
2376
+ "properties": {
2377
+ "threadId": { "$ref": "#/$defs/ThreadId" },
2378
+ "includeAllThreads": { "type": "boolean" },
2379
+ "contentTypes": { "type": "array", "items": { "type": "string" } },
2380
+ "participantId": { "$ref": "#/$defs/ParticipantId" },
2381
+ "afterTurnId": { "$ref": "#/$defs/TurnId" },
2382
+ "beforeTurnId": { "$ref": "#/$defs/TurnId" },
2383
+ "afterTimestamp": { "$ref": "#/$defs/Timestamp" },
2384
+ "beforeTimestamp": { "$ref": "#/$defs/Timestamp" }
2385
+ }
2386
+ },
2387
+ "limit": { "type": "integer", "minimum": 1 },
2388
+ "order": { "type": "string", "enum": ["asc", "desc"] },
2389
+ "_meta": { "$ref": "#/$defs/Meta" }
2390
+ },
2391
+ "required": ["conversationId"]
2392
+ }
2393
+ },
2394
+ "required": ["jsonrpc", "id", "method", "params"]
2395
+ },
2396
+ "MailTurnsListResponse": {
2397
+ "type": "object",
2398
+ "properties": {
2399
+ "turns": { "type": "array", "items": { "$ref": "#/$defs/Turn" } },
2400
+ "hasMore": { "type": "boolean" },
2401
+ "nextCursor": { "type": "string" },
2402
+ "_meta": { "$ref": "#/$defs/Meta" }
2403
+ },
2404
+ "required": ["turns", "hasMore"]
2405
+ },
2406
+ "MailThreadCreateRequest": {
2407
+ "type": "object",
2408
+ "x-method": "mail/thread/create",
2409
+ "x-tier": "extension",
2410
+ "description": "Create a thread within a conversation",
2411
+ "properties": {
2412
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2413
+ "id": { "$ref": "#/$defs/RequestId" },
2414
+ "method": { "const": "mail/thread/create" },
2415
+ "params": {
2416
+ "type": "object",
2417
+ "properties": {
2418
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2419
+ "rootTurnId": { "$ref": "#/$defs/TurnId" },
2420
+ "subject": { "type": "string" },
2421
+ "parentThreadId": { "$ref": "#/$defs/ThreadId" },
2422
+ "_meta": { "$ref": "#/$defs/Meta" }
2423
+ },
2424
+ "required": ["conversationId", "rootTurnId"]
2425
+ }
2426
+ },
2427
+ "required": ["jsonrpc", "id", "method", "params"]
2428
+ },
2429
+ "MailThreadCreateResponse": {
2430
+ "type": "object",
2431
+ "properties": {
2432
+ "thread": { "$ref": "#/$defs/Thread" },
2433
+ "_meta": { "$ref": "#/$defs/Meta" }
2434
+ },
2435
+ "required": ["thread"]
2436
+ },
2437
+ "MailThreadListRequest": {
2438
+ "type": "object",
2439
+ "x-method": "mail/thread/list",
2440
+ "x-tier": "extension",
2441
+ "description": "List threads in a conversation",
2442
+ "properties": {
2443
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2444
+ "id": { "$ref": "#/$defs/RequestId" },
2445
+ "method": { "const": "mail/thread/list" },
2446
+ "params": {
2447
+ "type": "object",
2448
+ "properties": {
2449
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2450
+ "parentThreadId": { "$ref": "#/$defs/ThreadId" },
2451
+ "limit": { "type": "integer", "minimum": 1 },
2452
+ "cursor": { "type": "string" },
2453
+ "_meta": { "$ref": "#/$defs/Meta" }
2454
+ },
2455
+ "required": ["conversationId"]
2456
+ }
2457
+ },
2458
+ "required": ["jsonrpc", "id", "method", "params"]
2459
+ },
2460
+ "MailThreadListResponse": {
2461
+ "type": "object",
2462
+ "properties": {
2463
+ "threads": { "type": "array", "items": { "$ref": "#/$defs/Thread" } },
2464
+ "hasMore": { "type": "boolean" },
2465
+ "nextCursor": { "type": "string" },
2466
+ "_meta": { "$ref": "#/$defs/Meta" }
2467
+ },
2468
+ "required": ["threads", "hasMore"]
2469
+ },
2470
+ "MailSummaryRequest": {
2471
+ "type": "object",
2472
+ "x-method": "mail/summary",
2473
+ "x-tier": "extension",
2474
+ "description": "Get or generate a conversation summary",
2475
+ "properties": {
2476
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2477
+ "id": { "$ref": "#/$defs/RequestId" },
2478
+ "method": { "const": "mail/summary" },
2479
+ "params": {
2480
+ "type": "object",
2481
+ "properties": {
2482
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2483
+ "scope": {
2484
+ "type": "object",
2485
+ "properties": {
2486
+ "fromTurnId": { "$ref": "#/$defs/TurnId" },
2487
+ "toTurnId": { "$ref": "#/$defs/TurnId" },
2488
+ "threadId": { "$ref": "#/$defs/ThreadId" }
2489
+ }
2490
+ },
2491
+ "regenerate": { "type": "boolean" },
2492
+ "include": {
2493
+ "type": "object",
2494
+ "properties": {
2495
+ "keyPoints": { "type": "boolean" },
2496
+ "keyDecisions": { "type": "boolean" },
2497
+ "openQuestions": { "type": "boolean" },
2498
+ "participants": { "type": "boolean" }
2499
+ }
2500
+ },
2501
+ "_meta": { "$ref": "#/$defs/Meta" }
2502
+ },
2503
+ "required": ["conversationId"]
2504
+ }
2505
+ },
2506
+ "required": ["jsonrpc", "id", "method", "params"]
2507
+ },
2508
+ "MailSummaryResponse": {
2509
+ "type": "object",
2510
+ "properties": {
2511
+ "summary": { "type": "string" },
2512
+ "keyPoints": { "type": "array", "items": { "type": "string" } },
2513
+ "keyDecisions": { "type": "array", "items": { "type": "string" } },
2514
+ "openQuestions": { "type": "array", "items": { "type": "string" } },
2515
+ "generated": { "type": "boolean" },
2516
+ "cachedAt": { "$ref": "#/$defs/Timestamp" },
2517
+ "_meta": { "$ref": "#/$defs/Meta" }
2518
+ },
2519
+ "required": ["summary", "generated"]
2520
+ },
2521
+ "MailReplayRequest": {
2522
+ "type": "object",
2523
+ "x-method": "mail/replay",
2524
+ "x-tier": "extension",
2525
+ "description": "Replay conversation turns from a point",
2526
+ "properties": {
2527
+ "jsonrpc": { "$ref": "#/$defs/JsonRpcVersion" },
2528
+ "id": { "$ref": "#/$defs/RequestId" },
2529
+ "method": { "const": "mail/replay" },
2530
+ "params": {
2531
+ "type": "object",
2532
+ "properties": {
2533
+ "conversationId": { "$ref": "#/$defs/ConversationId" },
2534
+ "fromTurnId": { "$ref": "#/$defs/TurnId" },
2535
+ "fromTimestamp": { "$ref": "#/$defs/Timestamp" },
2536
+ "threadId": { "$ref": "#/$defs/ThreadId" },
2537
+ "limit": { "type": "integer", "minimum": 1 },
2538
+ "contentTypes": { "type": "array", "items": { "type": "string" } },
2539
+ "_meta": { "$ref": "#/$defs/Meta" }
2540
+ },
2541
+ "required": ["conversationId"]
2542
+ }
2543
+ },
2544
+ "required": ["jsonrpc", "id", "method", "params"]
2545
+ },
2546
+ "MailReplayResponse": {
2547
+ "type": "object",
2548
+ "properties": {
2549
+ "turns": { "type": "array", "items": { "$ref": "#/$defs/Turn" } },
2550
+ "hasMore": { "type": "boolean" },
2551
+ "nextCursor": { "type": "string" },
2552
+ "missedCount": { "type": "integer" },
2553
+ "_meta": { "$ref": "#/$defs/Meta" }
2554
+ },
2555
+ "required": ["turns", "hasMore", "missedCount"]
2556
+ }
2557
+ }
2558
+ }