@creatornader/agent-bridge 0.2.0 → 0.3.1

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 (115) hide show
  1. package/CHANGELOG.md +86 -4
  2. package/README.md +567 -55
  3. package/ROADMAP.md +114 -0
  4. package/SECURITY.md +90 -0
  5. package/SKILL.md +68 -2
  6. package/bin/agent-bridge +2 -2
  7. package/clients/claude-desktop.json +3 -1
  8. package/dist/archive.d.ts +163 -0
  9. package/dist/archive.js +50 -0
  10. package/dist/archive.js.map +1 -0
  11. package/dist/bridge-domain-CBX3IVqC.d.ts +153 -0
  12. package/dist/{bridge-service-CfqMcMAn.d.ts → bridge-service-hX1ZQp4W.d.ts} +15 -5
  13. package/dist/bridge-store-DPVSCwfs.d.ts +102 -0
  14. package/dist/bridge.d.ts +76 -17
  15. package/dist/bridge.js +52 -24
  16. package/dist/chunk-2DFNOLMO.js +618 -0
  17. package/dist/chunk-2DFNOLMO.js.map +1 -0
  18. package/dist/{chunk-KVR4JBRF.js → chunk-2EVLG3YA.js} +2 -2
  19. package/dist/{chunk-KVR4JBRF.js.map → chunk-2EVLG3YA.js.map} +1 -1
  20. package/dist/chunk-45BZGB77.js +709 -0
  21. package/dist/chunk-45BZGB77.js.map +1 -0
  22. package/dist/chunk-4VB44KJU.js +230 -0
  23. package/dist/chunk-4VB44KJU.js.map +1 -0
  24. package/dist/chunk-5GMB3A77.js +1013 -0
  25. package/dist/chunk-5GMB3A77.js.map +1 -0
  26. package/dist/chunk-A6W4QALF.js +1258 -0
  27. package/dist/chunk-A6W4QALF.js.map +1 -0
  28. package/dist/chunk-BZLMF5O5.js +328 -0
  29. package/dist/chunk-BZLMF5O5.js.map +1 -0
  30. package/dist/{chunk-AXL2I7FH.js → chunk-CEXBMOI5.js} +240 -79
  31. package/dist/chunk-CEXBMOI5.js.map +1 -0
  32. package/dist/chunk-GADH244D.js +527 -0
  33. package/dist/chunk-GADH244D.js.map +1 -0
  34. package/dist/chunk-MBPZXTJA.js +2428 -0
  35. package/dist/chunk-MBPZXTJA.js.map +1 -0
  36. package/dist/chunk-NCO7RLBM.js +146 -0
  37. package/dist/chunk-NCO7RLBM.js.map +1 -0
  38. package/dist/chunk-Q6PPMXJC.js +1050 -0
  39. package/dist/chunk-Q6PPMXJC.js.map +1 -0
  40. package/dist/{chunk-4KAOBC5X.js → chunk-SPSMZOCJ.js} +190 -165
  41. package/dist/chunk-SPSMZOCJ.js.map +1 -0
  42. package/dist/chunk-UAHMP6GC.js +54 -0
  43. package/dist/chunk-UAHMP6GC.js.map +1 -0
  44. package/dist/{chunk-YD6YJATN.js → chunk-VOQIDTCJ.js} +4 -2
  45. package/dist/chunk-VOQIDTCJ.js.map +1 -0
  46. package/dist/chunk-WAI2IYIQ.js +554 -0
  47. package/dist/chunk-WAI2IYIQ.js.map +1 -0
  48. package/dist/cli.d.ts +2 -1
  49. package/dist/cli.js +3555 -214
  50. package/dist/cli.js.map +1 -1
  51. package/dist/client-config.d.ts +1 -1
  52. package/dist/client-config.js +1 -1
  53. package/dist/client-runtime.d.ts +10 -6
  54. package/dist/client-runtime.js +9 -6
  55. package/dist/contracts/generate.d.ts +2 -0
  56. package/dist/contracts/generate.js +247 -0
  57. package/dist/contracts/generate.js.map +1 -0
  58. package/dist/dr.d.ts +324 -0
  59. package/dist/dr.js +124 -0
  60. package/dist/dr.js.map +1 -0
  61. package/dist/gateway-CggQ8vTC.d.ts +78 -0
  62. package/dist/gateway-main.js +190 -8
  63. package/dist/gateway-main.js.map +1 -1
  64. package/dist/gateway.d.ts +4 -3
  65. package/dist/gateway.js +4 -3
  66. package/dist/index.js +11 -8
  67. package/dist/index.js.map +1 -1
  68. package/dist/postgres-bridge-store-Bfd3hRId.d.ts +49 -0
  69. package/dist/server.d.ts +3 -2
  70. package/dist/server.js +13 -8
  71. package/dist/sqlite.d.ts +94 -12
  72. package/dist/sqlite.js +7 -4
  73. package/docs/architecture-v2.md +394 -0
  74. package/docs/decisions/0001-protocol-layers-and-acknowledgment-semantics.md +85 -0
  75. package/docs/decisions/0002-canonical-operation-contract-registry.md +46 -0
  76. package/docs/decisions/0003-host-adapters-and-consumer-instance-keys.md +88 -0
  77. package/docs/ecosystem.md +86 -0
  78. package/docs/postmortems/2026-07-08-wrapper-source-drift.md +82 -0
  79. package/docs/troubleshooting.md +89 -0
  80. package/llms.txt +107 -6
  81. package/openapi/agent-bridge-v2.openapi.json +9610 -0
  82. package/package.json +24 -4
  83. package/schemas/agent-bridge-v2.capabilities.json +1829 -0
  84. package/schemas/agent-bridge-v2.mcp.json +2074 -0
  85. package/schemas/agent-bridge-v2.schema.json +4560 -0
  86. package/sql/migrations/008_message_projects.sql +36 -0
  87. package/sql/migrations/009_mailbox_query_indexes.sql +28 -0
  88. package/sql/migrations/010_publisher_delivery_policy.sql +210 -0
  89. package/sql/migrations/011_credential_security.sql +875 -0
  90. package/sql/migrations/012_request_authority.sql +177 -0
  91. package/sql/migrations/013_row_isolation.sql +495 -0
  92. package/sql/migrations/014_owner_control_plane.sql +1641 -0
  93. package/sql/migrations/015_portable_archives.sql +1813 -0
  94. package/sql/migrations/016_native_dr_fence.sql +1005 -0
  95. package/bin/CLAUDE.md +0 -11
  96. package/dist/bridge-domain-BcnBeHOn.d.ts +0 -97
  97. package/dist/bridge-store-BuGjxTn4.d.ts +0 -61
  98. package/dist/chunk-4KAOBC5X.js.map +0 -1
  99. package/dist/chunk-6MAZ6YLZ.js +0 -146
  100. package/dist/chunk-6MAZ6YLZ.js.map +0 -1
  101. package/dist/chunk-AXL2I7FH.js.map +0 -1
  102. package/dist/chunk-BV6W4AJK.js +0 -211
  103. package/dist/chunk-BV6W4AJK.js.map +0 -1
  104. package/dist/chunk-CKSKUBDQ.js +0 -153
  105. package/dist/chunk-CKSKUBDQ.js.map +0 -1
  106. package/dist/chunk-JOUBDRYX.js +0 -272
  107. package/dist/chunk-JOUBDRYX.js.map +0 -1
  108. package/dist/chunk-JTC5YURG.js +0 -49
  109. package/dist/chunk-JTC5YURG.js.map +0 -1
  110. package/dist/chunk-O26W5QHS.js +0 -409
  111. package/dist/chunk-O26W5QHS.js.map +0 -1
  112. package/dist/chunk-WEULPMUY.js +0 -988
  113. package/dist/chunk-WEULPMUY.js.map +0 -1
  114. package/dist/chunk-YD6YJATN.js.map +0 -1
  115. package/dist/gateway-BULozv3K.d.ts +0 -54
@@ -0,0 +1,2074 @@
1
+ {
2
+ "schemaVersion": "agent-bridge-mcp-manifest-v1",
3
+ "protocolVersion": "2.1",
4
+ "scopeEnforcementByProvider": {
5
+ "local": false,
6
+ "gateway": true,
7
+ "legacy-supabase": false
8
+ },
9
+ "tools": [
10
+ {
11
+ "name": "capabilities",
12
+ "description": "Discover operations available on the current surface.",
13
+ "inputSchema": {
14
+ "type": "object",
15
+ "properties": {},
16
+ "additionalProperties": false
17
+ },
18
+ "outputSchema": {
19
+ "type": "object",
20
+ "required": [
21
+ "protocolVersion",
22
+ "currentProtocolVersion",
23
+ "selectedProtocolVersion",
24
+ "supportedProtocolVersions",
25
+ "scopeEnforcement",
26
+ "requestAuthority",
27
+ "rowIsolation",
28
+ "authorizationModel",
29
+ "surface",
30
+ "provider",
31
+ "operations"
32
+ ],
33
+ "properties": {
34
+ "protocolVersion": {
35
+ "type": "string"
36
+ },
37
+ "currentProtocolVersion": {
38
+ "type": "string"
39
+ },
40
+ "selectedProtocolVersion": {
41
+ "type": "string"
42
+ },
43
+ "supportedProtocolVersions": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "string"
47
+ }
48
+ },
49
+ "scopeEnforcement": {
50
+ "type": "boolean"
51
+ },
52
+ "requestAuthority": {
53
+ "type": "boolean"
54
+ },
55
+ "rowIsolation": {
56
+ "type": "boolean"
57
+ },
58
+ "authorizationModel": {
59
+ "enum": [
60
+ "scoped-credential",
61
+ "credential-wide",
62
+ "process-identity",
63
+ "legacy-key"
64
+ ]
65
+ },
66
+ "surface": {
67
+ "enum": [
68
+ "mcp",
69
+ "http",
70
+ "cli"
71
+ ]
72
+ },
73
+ "provider": {
74
+ "enum": [
75
+ "local",
76
+ "gateway",
77
+ "legacy-supabase"
78
+ ]
79
+ },
80
+ "operations": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "object",
84
+ "required": [
85
+ "id",
86
+ "summary",
87
+ "requiredScopes"
88
+ ],
89
+ "properties": {
90
+ "id": {
91
+ "type": "string"
92
+ },
93
+ "summary": {
94
+ "type": "string"
95
+ },
96
+ "requiredScopes": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "string"
100
+ }
101
+ },
102
+ "mcp": {},
103
+ "http": {},
104
+ "cli": {}
105
+ },
106
+ "additionalProperties": true
107
+ }
108
+ }
109
+ },
110
+ "additionalProperties": true
111
+ },
112
+ "requiredScopes": [],
113
+ "providers": [
114
+ "local",
115
+ "gateway",
116
+ "legacy-supabase"
117
+ ]
118
+ },
119
+ {
120
+ "name": "send",
121
+ "description": "Create an immutable Agent Bridge v2 message.",
122
+ "inputSchema": {
123
+ "type": "object",
124
+ "required": [
125
+ "type",
126
+ "content"
127
+ ],
128
+ "properties": {
129
+ "id": {
130
+ "type": "string",
131
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
132
+ },
133
+ "source": {
134
+ "type": "string"
135
+ },
136
+ "project": {
137
+ "type": "string"
138
+ },
139
+ "type": {
140
+ "type": "string"
141
+ },
142
+ "content": {
143
+ "type": "string"
144
+ },
145
+ "contentType": {
146
+ "type": "string"
147
+ },
148
+ "data": {},
149
+ "targets": {
150
+ "type": "array",
151
+ "items": {
152
+ "type": "string"
153
+ }
154
+ },
155
+ "threadId": {
156
+ "type": "string"
157
+ },
158
+ "replyToId": {
159
+ "type": "string"
160
+ },
161
+ "correlationId": {
162
+ "type": "string"
163
+ },
164
+ "causationId": {
165
+ "type": "string"
166
+ },
167
+ "priority": {
168
+ "enum": [
169
+ "info",
170
+ "high",
171
+ "urgent"
172
+ ]
173
+ },
174
+ "expiresAt": {
175
+ "type": "string"
176
+ },
177
+ "idempotencyKey": {
178
+ "type": "string"
179
+ },
180
+ "atribReceiptId": {
181
+ "type": "string"
182
+ },
183
+ "informedBy": {
184
+ "type": "array",
185
+ "items": {
186
+ "type": "string"
187
+ }
188
+ },
189
+ "metadata": {},
190
+ "deliveryPolicy": {
191
+ "type": "object",
192
+ "properties": {
193
+ "mode": {
194
+ "enum": [
195
+ "mailbox",
196
+ "leased"
197
+ ]
198
+ },
199
+ "maxAttempts": {
200
+ "type": "number"
201
+ },
202
+ "retryBaseDelayMs": {
203
+ "type": "number"
204
+ },
205
+ "retryMaxDelayMs": {
206
+ "type": "number"
207
+ },
208
+ "retryJitterRatio": {
209
+ "type": "number"
210
+ },
211
+ "notBefore": {
212
+ "type": "string"
213
+ }
214
+ },
215
+ "additionalProperties": false
216
+ }
217
+ },
218
+ "additionalProperties": false
219
+ },
220
+ "outputSchema": {
221
+ "type": "object",
222
+ "required": [
223
+ "created",
224
+ "message"
225
+ ],
226
+ "properties": {
227
+ "created": {
228
+ "type": "boolean"
229
+ },
230
+ "message": {
231
+ "type": "object",
232
+ "required": [
233
+ "id",
234
+ "workspace",
235
+ "source",
236
+ "type",
237
+ "content",
238
+ "contentType",
239
+ "sequence",
240
+ "createdAt",
241
+ "targets",
242
+ "priority",
243
+ "deliveryPolicy"
244
+ ],
245
+ "properties": {
246
+ "id": {
247
+ "type": "string"
248
+ },
249
+ "workspace": {
250
+ "type": "string"
251
+ },
252
+ "project": {
253
+ "type": "string"
254
+ },
255
+ "source": {
256
+ "type": "string"
257
+ },
258
+ "type": {
259
+ "type": "string"
260
+ },
261
+ "content": {
262
+ "type": "string"
263
+ },
264
+ "contentType": {
265
+ "type": "string"
266
+ },
267
+ "sequence": {
268
+ "type": "string"
269
+ },
270
+ "createdAt": {
271
+ "type": "string"
272
+ },
273
+ "data": {},
274
+ "targets": {
275
+ "type": "array",
276
+ "items": {
277
+ "type": "string"
278
+ }
279
+ },
280
+ "threadId": {
281
+ "type": "string"
282
+ },
283
+ "replyToId": {
284
+ "type": "string"
285
+ },
286
+ "correlationId": {
287
+ "type": "string"
288
+ },
289
+ "causationId": {
290
+ "type": "string"
291
+ },
292
+ "priority": {
293
+ "enum": [
294
+ "info",
295
+ "high",
296
+ "urgent"
297
+ ]
298
+ },
299
+ "expiresAt": {
300
+ "type": "string"
301
+ },
302
+ "idempotencyKey": {
303
+ "type": "string"
304
+ },
305
+ "atribReceiptId": {
306
+ "type": "string"
307
+ },
308
+ "informedBy": {
309
+ "type": "array",
310
+ "items": {
311
+ "type": "string"
312
+ }
313
+ },
314
+ "metadata": {},
315
+ "deliveryPolicy": {
316
+ "anyOf": [
317
+ {
318
+ "type": "object",
319
+ "required": [
320
+ "mode"
321
+ ],
322
+ "properties": {
323
+ "mode": {
324
+ "type": "string",
325
+ "const": "mailbox"
326
+ }
327
+ },
328
+ "additionalProperties": false
329
+ },
330
+ {
331
+ "type": "object",
332
+ "required": [
333
+ "mode",
334
+ "maxAttempts",
335
+ "retryBaseDelayMs",
336
+ "retryMaxDelayMs",
337
+ "retryJitterRatio"
338
+ ],
339
+ "properties": {
340
+ "mode": {
341
+ "type": "string",
342
+ "const": "leased"
343
+ },
344
+ "maxAttempts": {
345
+ "type": "number"
346
+ },
347
+ "retryBaseDelayMs": {
348
+ "type": "number"
349
+ },
350
+ "retryMaxDelayMs": {
351
+ "type": "number"
352
+ },
353
+ "retryJitterRatio": {
354
+ "type": "number"
355
+ },
356
+ "notBefore": {
357
+ "type": "string"
358
+ }
359
+ },
360
+ "additionalProperties": false
361
+ }
362
+ ]
363
+ }
364
+ },
365
+ "additionalProperties": true
366
+ },
367
+ "disposition": {
368
+ "enum": [
369
+ "committed",
370
+ "queued"
371
+ ]
372
+ },
373
+ "authoritative": {
374
+ "type": "boolean"
375
+ }
376
+ },
377
+ "additionalProperties": true
378
+ },
379
+ "requiredScopes": [
380
+ "messages:write"
381
+ ],
382
+ "providers": [
383
+ "local",
384
+ "gateway",
385
+ "legacy-supabase"
386
+ ]
387
+ },
388
+ {
389
+ "name": "history",
390
+ "description": "Read visible messages after an opaque cursor.",
391
+ "inputSchema": {
392
+ "type": "object",
393
+ "properties": {
394
+ "cursor": {
395
+ "type": "string"
396
+ },
397
+ "limit": {
398
+ "type": "number",
399
+ "minimum": 1,
400
+ "maximum": 200
401
+ },
402
+ "types": {
403
+ "type": "array",
404
+ "items": {
405
+ "type": "string"
406
+ }
407
+ },
408
+ "mailbox": {
409
+ "enum": [
410
+ "inbox",
411
+ "sent",
412
+ "all"
413
+ ]
414
+ },
415
+ "receiptState": {
416
+ "enum": [
417
+ "any",
418
+ "unread",
419
+ "read"
420
+ ]
421
+ },
422
+ "includeExpired": {
423
+ "type": "boolean"
424
+ },
425
+ "source": {
426
+ "type": "string"
427
+ },
428
+ "project": {
429
+ "type": "string"
430
+ },
431
+ "since": {
432
+ "type": "string"
433
+ },
434
+ "unacknowledgedBy": {
435
+ "type": "string"
436
+ },
437
+ "threadId": {
438
+ "type": "string"
439
+ },
440
+ "latest": {
441
+ "type": "boolean"
442
+ }
443
+ },
444
+ "additionalProperties": false
445
+ },
446
+ "outputSchema": {
447
+ "type": "object",
448
+ "required": [
449
+ "messages"
450
+ ],
451
+ "properties": {
452
+ "messages": {
453
+ "type": "array",
454
+ "items": {
455
+ "type": "object",
456
+ "required": [
457
+ "id",
458
+ "workspace",
459
+ "source",
460
+ "type",
461
+ "content",
462
+ "contentType",
463
+ "sequence",
464
+ "createdAt",
465
+ "targets",
466
+ "priority",
467
+ "deliveryPolicy"
468
+ ],
469
+ "properties": {
470
+ "id": {
471
+ "type": "string"
472
+ },
473
+ "workspace": {
474
+ "type": "string"
475
+ },
476
+ "project": {
477
+ "type": "string"
478
+ },
479
+ "source": {
480
+ "type": "string"
481
+ },
482
+ "type": {
483
+ "type": "string"
484
+ },
485
+ "content": {
486
+ "type": "string"
487
+ },
488
+ "contentType": {
489
+ "type": "string"
490
+ },
491
+ "sequence": {
492
+ "type": "string"
493
+ },
494
+ "createdAt": {
495
+ "type": "string"
496
+ },
497
+ "data": {},
498
+ "targets": {
499
+ "type": "array",
500
+ "items": {
501
+ "type": "string"
502
+ }
503
+ },
504
+ "threadId": {
505
+ "type": "string"
506
+ },
507
+ "replyToId": {
508
+ "type": "string"
509
+ },
510
+ "correlationId": {
511
+ "type": "string"
512
+ },
513
+ "causationId": {
514
+ "type": "string"
515
+ },
516
+ "priority": {
517
+ "enum": [
518
+ "info",
519
+ "high",
520
+ "urgent"
521
+ ]
522
+ },
523
+ "expiresAt": {
524
+ "type": "string"
525
+ },
526
+ "idempotencyKey": {
527
+ "type": "string"
528
+ },
529
+ "atribReceiptId": {
530
+ "type": "string"
531
+ },
532
+ "informedBy": {
533
+ "type": "array",
534
+ "items": {
535
+ "type": "string"
536
+ }
537
+ },
538
+ "metadata": {},
539
+ "deliveryPolicy": {
540
+ "anyOf": [
541
+ {
542
+ "type": "object",
543
+ "required": [
544
+ "mode"
545
+ ],
546
+ "properties": {
547
+ "mode": {
548
+ "type": "string",
549
+ "const": "mailbox"
550
+ }
551
+ },
552
+ "additionalProperties": false
553
+ },
554
+ {
555
+ "type": "object",
556
+ "required": [
557
+ "mode",
558
+ "maxAttempts",
559
+ "retryBaseDelayMs",
560
+ "retryMaxDelayMs",
561
+ "retryJitterRatio"
562
+ ],
563
+ "properties": {
564
+ "mode": {
565
+ "type": "string",
566
+ "const": "leased"
567
+ },
568
+ "maxAttempts": {
569
+ "type": "number"
570
+ },
571
+ "retryBaseDelayMs": {
572
+ "type": "number"
573
+ },
574
+ "retryMaxDelayMs": {
575
+ "type": "number"
576
+ },
577
+ "retryJitterRatio": {
578
+ "type": "number"
579
+ },
580
+ "notBefore": {
581
+ "type": "string"
582
+ }
583
+ },
584
+ "additionalProperties": false
585
+ }
586
+ ]
587
+ }
588
+ },
589
+ "additionalProperties": true
590
+ }
591
+ },
592
+ "cursor": {
593
+ "type": "string"
594
+ },
595
+ "source": {
596
+ "enum": [
597
+ "remote",
598
+ "cache"
599
+ ]
600
+ },
601
+ "stale": {
602
+ "type": "boolean"
603
+ },
604
+ "degraded": {
605
+ "type": "boolean"
606
+ },
607
+ "acknowledgements": {
608
+ "enum": [
609
+ "authoritative",
610
+ "unknown"
611
+ ]
612
+ },
613
+ "lastSyncedAt": {
614
+ "type": "string"
615
+ }
616
+ },
617
+ "additionalProperties": true
618
+ },
619
+ "requiredScopes": [
620
+ "messages:read"
621
+ ],
622
+ "providers": [
623
+ "local",
624
+ "gateway",
625
+ "legacy-supabase"
626
+ ]
627
+ },
628
+ {
629
+ "name": "claim",
630
+ "description": "Atomically claim the next targeted delivery.",
631
+ "inputSchema": {
632
+ "type": "object",
633
+ "properties": {
634
+ "leaseMs": {
635
+ "type": "number"
636
+ },
637
+ "maxAttempts": {
638
+ "type": "number"
639
+ }
640
+ },
641
+ "additionalProperties": false
642
+ },
643
+ "outputSchema": {
644
+ "type": "object",
645
+ "required": [
646
+ "delivery"
647
+ ],
648
+ "properties": {
649
+ "delivery": {
650
+ "anyOf": [
651
+ {
652
+ "type": "object",
653
+ "required": [
654
+ "id",
655
+ "messageId",
656
+ "workspace",
657
+ "recipient",
658
+ "state",
659
+ "attempt",
660
+ "cycleAttempt",
661
+ "requeueCount",
662
+ "createdAt",
663
+ "priorityRank",
664
+ "availableAt",
665
+ "lastAction"
666
+ ],
667
+ "properties": {
668
+ "id": {
669
+ "type": "string"
670
+ },
671
+ "messageId": {
672
+ "type": "string"
673
+ },
674
+ "workspace": {
675
+ "type": "string"
676
+ },
677
+ "recipient": {
678
+ "type": "string"
679
+ },
680
+ "state": {
681
+ "enum": [
682
+ "pending",
683
+ "claimed",
684
+ "acked",
685
+ "retrying",
686
+ "dead",
687
+ "cancelled"
688
+ ]
689
+ },
690
+ "attempt": {
691
+ "type": "number"
692
+ },
693
+ "cycleAttempt": {
694
+ "type": "number"
695
+ },
696
+ "requeueCount": {
697
+ "type": "number"
698
+ },
699
+ "createdAt": {
700
+ "type": "string"
701
+ },
702
+ "priorityRank": {
703
+ "type": "number"
704
+ },
705
+ "availableAt": {
706
+ "type": "string"
707
+ },
708
+ "leaseToken": {
709
+ "type": "string"
710
+ },
711
+ "leaseOwner": {
712
+ "type": "string"
713
+ },
714
+ "leaseExpiresAt": {
715
+ "type": "string"
716
+ },
717
+ "lastError": {
718
+ "type": "string"
719
+ },
720
+ "lastActor": {
721
+ "type": "string"
722
+ },
723
+ "lastAction": {
724
+ "enum": [
725
+ "created",
726
+ "claim",
727
+ "ack",
728
+ "nack_retry",
729
+ "nack_dead",
730
+ "lease_expired",
731
+ "attempts_exhausted",
732
+ "message_expired",
733
+ "cancel",
734
+ "requeue"
735
+ ]
736
+ }
737
+ },
738
+ "additionalProperties": true
739
+ },
740
+ {
741
+ "type": "null"
742
+ }
743
+ ]
744
+ },
745
+ "leaseToken": {
746
+ "type": "string"
747
+ }
748
+ },
749
+ "additionalProperties": true,
750
+ "oneOf": [
751
+ {
752
+ "properties": {
753
+ "delivery": {
754
+ "type": "null"
755
+ },
756
+ "leaseToken": false
757
+ },
758
+ "required": [
759
+ "delivery"
760
+ ]
761
+ },
762
+ {
763
+ "properties": {
764
+ "delivery": {
765
+ "type": "object",
766
+ "required": [
767
+ "id",
768
+ "messageId",
769
+ "workspace",
770
+ "recipient",
771
+ "state",
772
+ "attempt",
773
+ "cycleAttempt",
774
+ "requeueCount",
775
+ "createdAt",
776
+ "priorityRank",
777
+ "availableAt",
778
+ "lastAction"
779
+ ],
780
+ "properties": {
781
+ "id": {
782
+ "type": "string"
783
+ },
784
+ "messageId": {
785
+ "type": "string"
786
+ },
787
+ "workspace": {
788
+ "type": "string"
789
+ },
790
+ "recipient": {
791
+ "type": "string"
792
+ },
793
+ "state": {
794
+ "enum": [
795
+ "pending",
796
+ "claimed",
797
+ "acked",
798
+ "retrying",
799
+ "dead",
800
+ "cancelled"
801
+ ]
802
+ },
803
+ "attempt": {
804
+ "type": "number"
805
+ },
806
+ "cycleAttempt": {
807
+ "type": "number"
808
+ },
809
+ "requeueCount": {
810
+ "type": "number"
811
+ },
812
+ "createdAt": {
813
+ "type": "string"
814
+ },
815
+ "priorityRank": {
816
+ "type": "number"
817
+ },
818
+ "availableAt": {
819
+ "type": "string"
820
+ },
821
+ "leaseToken": {
822
+ "type": "string"
823
+ },
824
+ "leaseOwner": {
825
+ "type": "string"
826
+ },
827
+ "leaseExpiresAt": {
828
+ "type": "string"
829
+ },
830
+ "lastError": {
831
+ "type": "string"
832
+ },
833
+ "lastActor": {
834
+ "type": "string"
835
+ },
836
+ "lastAction": {
837
+ "enum": [
838
+ "created",
839
+ "claim",
840
+ "ack",
841
+ "nack_retry",
842
+ "nack_dead",
843
+ "lease_expired",
844
+ "attempts_exhausted",
845
+ "message_expired",
846
+ "cancel",
847
+ "requeue"
848
+ ]
849
+ }
850
+ },
851
+ "additionalProperties": true
852
+ },
853
+ "leaseToken": {
854
+ "type": "string"
855
+ }
856
+ },
857
+ "required": [
858
+ "delivery",
859
+ "leaseToken"
860
+ ]
861
+ }
862
+ ]
863
+ },
864
+ "requiredScopes": [
865
+ "deliveries:claim"
866
+ ],
867
+ "providers": [
868
+ "local",
869
+ "gateway"
870
+ ]
871
+ },
872
+ {
873
+ "name": "list_deliveries",
874
+ "description": "List caller-visible deliveries.",
875
+ "inputSchema": {
876
+ "type": "object",
877
+ "properties": {
878
+ "cursor": {
879
+ "type": "string"
880
+ },
881
+ "limit": {
882
+ "type": "number"
883
+ },
884
+ "role": {
885
+ "enum": [
886
+ "recipient",
887
+ "publisher",
888
+ "all"
889
+ ]
890
+ },
891
+ "messageId": {
892
+ "type": "string"
893
+ },
894
+ "recipient": {
895
+ "type": "string"
896
+ },
897
+ "states": {
898
+ "type": "array",
899
+ "items": {
900
+ "enum": [
901
+ "pending",
902
+ "claimed",
903
+ "acked",
904
+ "retrying",
905
+ "dead",
906
+ "cancelled"
907
+ ]
908
+ }
909
+ }
910
+ },
911
+ "additionalProperties": false
912
+ },
913
+ "outputSchema": {
914
+ "type": "object",
915
+ "required": [
916
+ "deliveries"
917
+ ],
918
+ "properties": {
919
+ "deliveries": {
920
+ "type": "array",
921
+ "items": {
922
+ "type": "object",
923
+ "required": [
924
+ "id",
925
+ "messageId",
926
+ "workspace",
927
+ "recipient",
928
+ "state",
929
+ "attempt",
930
+ "cycleAttempt",
931
+ "requeueCount",
932
+ "createdAt",
933
+ "priorityRank",
934
+ "availableAt",
935
+ "lastAction"
936
+ ],
937
+ "properties": {
938
+ "id": {
939
+ "type": "string"
940
+ },
941
+ "messageId": {
942
+ "type": "string"
943
+ },
944
+ "workspace": {
945
+ "type": "string"
946
+ },
947
+ "recipient": {
948
+ "type": "string"
949
+ },
950
+ "state": {
951
+ "enum": [
952
+ "pending",
953
+ "claimed",
954
+ "acked",
955
+ "retrying",
956
+ "dead",
957
+ "cancelled"
958
+ ]
959
+ },
960
+ "attempt": {
961
+ "type": "number"
962
+ },
963
+ "cycleAttempt": {
964
+ "type": "number"
965
+ },
966
+ "requeueCount": {
967
+ "type": "number"
968
+ },
969
+ "createdAt": {
970
+ "type": "string"
971
+ },
972
+ "priorityRank": {
973
+ "type": "number"
974
+ },
975
+ "availableAt": {
976
+ "type": "string"
977
+ },
978
+ "leaseToken": {
979
+ "type": "string"
980
+ },
981
+ "leaseOwner": {
982
+ "type": "string"
983
+ },
984
+ "leaseExpiresAt": {
985
+ "type": "string"
986
+ },
987
+ "lastError": {
988
+ "type": "string"
989
+ },
990
+ "lastActor": {
991
+ "type": "string"
992
+ },
993
+ "lastAction": {
994
+ "enum": [
995
+ "created",
996
+ "claim",
997
+ "ack",
998
+ "nack_retry",
999
+ "nack_dead",
1000
+ "lease_expired",
1001
+ "attempts_exhausted",
1002
+ "message_expired",
1003
+ "cancel",
1004
+ "requeue"
1005
+ ]
1006
+ }
1007
+ },
1008
+ "additionalProperties": true
1009
+ }
1010
+ },
1011
+ "cursor": {
1012
+ "type": "string"
1013
+ }
1014
+ },
1015
+ "additionalProperties": true
1016
+ },
1017
+ "requiredScopes": [
1018
+ "deliveries:read"
1019
+ ],
1020
+ "providers": [
1021
+ "local",
1022
+ "gateway"
1023
+ ]
1024
+ },
1025
+ {
1026
+ "name": "list_delivery_events",
1027
+ "description": "List the append-only event history for a delivery.",
1028
+ "inputSchema": {
1029
+ "type": "object",
1030
+ "required": [
1031
+ "deliveryId"
1032
+ ],
1033
+ "properties": {
1034
+ "deliveryId": {
1035
+ "type": "string"
1036
+ },
1037
+ "cursor": {
1038
+ "type": "string"
1039
+ },
1040
+ "limit": {
1041
+ "type": "number"
1042
+ }
1043
+ },
1044
+ "additionalProperties": false
1045
+ },
1046
+ "outputSchema": {
1047
+ "type": "object",
1048
+ "required": [
1049
+ "events"
1050
+ ],
1051
+ "properties": {
1052
+ "events": {
1053
+ "type": "array",
1054
+ "items": {
1055
+ "type": "object",
1056
+ "required": [
1057
+ "sequence",
1058
+ "deliveryId",
1059
+ "messageId",
1060
+ "workspace",
1061
+ "recipient",
1062
+ "toState",
1063
+ "attempt",
1064
+ "cycleAttempt",
1065
+ "requeueCount",
1066
+ "actor",
1067
+ "action",
1068
+ "createdAt"
1069
+ ],
1070
+ "properties": {
1071
+ "sequence": {
1072
+ "type": "string"
1073
+ },
1074
+ "deliveryId": {
1075
+ "type": "string"
1076
+ },
1077
+ "messageId": {
1078
+ "type": "string"
1079
+ },
1080
+ "workspace": {
1081
+ "type": "string"
1082
+ },
1083
+ "recipient": {
1084
+ "type": "string"
1085
+ },
1086
+ "fromState": {
1087
+ "enum": [
1088
+ "pending",
1089
+ "claimed",
1090
+ "acked",
1091
+ "retrying",
1092
+ "dead",
1093
+ "cancelled"
1094
+ ]
1095
+ },
1096
+ "toState": {
1097
+ "enum": [
1098
+ "pending",
1099
+ "claimed",
1100
+ "acked",
1101
+ "retrying",
1102
+ "dead",
1103
+ "cancelled"
1104
+ ]
1105
+ },
1106
+ "attempt": {
1107
+ "type": "number"
1108
+ },
1109
+ "cycleAttempt": {
1110
+ "type": "number"
1111
+ },
1112
+ "requeueCount": {
1113
+ "type": "number"
1114
+ },
1115
+ "leaseOwner": {
1116
+ "type": "string"
1117
+ },
1118
+ "error": {
1119
+ "type": "string"
1120
+ },
1121
+ "actor": {
1122
+ "type": "string"
1123
+ },
1124
+ "action": {
1125
+ "enum": [
1126
+ "created",
1127
+ "claim",
1128
+ "ack",
1129
+ "nack_retry",
1130
+ "nack_dead",
1131
+ "lease_expired",
1132
+ "attempts_exhausted",
1133
+ "message_expired",
1134
+ "cancel",
1135
+ "requeue"
1136
+ ]
1137
+ },
1138
+ "createdAt": {
1139
+ "type": "string"
1140
+ }
1141
+ },
1142
+ "additionalProperties": true
1143
+ }
1144
+ },
1145
+ "cursor": {
1146
+ "type": "string"
1147
+ }
1148
+ },
1149
+ "additionalProperties": true
1150
+ },
1151
+ "requiredScopes": [
1152
+ "deliveries:read"
1153
+ ],
1154
+ "providers": [
1155
+ "local",
1156
+ "gateway"
1157
+ ]
1158
+ },
1159
+ {
1160
+ "name": "cancel_delivery",
1161
+ "description": "Cancel a delivery as its publisher.",
1162
+ "inputSchema": {
1163
+ "type": "object",
1164
+ "required": [
1165
+ "deliveryId"
1166
+ ],
1167
+ "properties": {
1168
+ "deliveryId": {
1169
+ "type": "string"
1170
+ }
1171
+ },
1172
+ "additionalProperties": false
1173
+ },
1174
+ "outputSchema": {
1175
+ "type": "object",
1176
+ "required": [
1177
+ "delivery"
1178
+ ],
1179
+ "properties": {
1180
+ "delivery": {
1181
+ "anyOf": [
1182
+ {
1183
+ "type": "object",
1184
+ "required": [
1185
+ "id",
1186
+ "messageId",
1187
+ "workspace",
1188
+ "recipient",
1189
+ "state",
1190
+ "attempt",
1191
+ "cycleAttempt",
1192
+ "requeueCount",
1193
+ "createdAt",
1194
+ "priorityRank",
1195
+ "availableAt",
1196
+ "lastAction"
1197
+ ],
1198
+ "properties": {
1199
+ "id": {
1200
+ "type": "string"
1201
+ },
1202
+ "messageId": {
1203
+ "type": "string"
1204
+ },
1205
+ "workspace": {
1206
+ "type": "string"
1207
+ },
1208
+ "recipient": {
1209
+ "type": "string"
1210
+ },
1211
+ "state": {
1212
+ "enum": [
1213
+ "pending",
1214
+ "claimed",
1215
+ "acked",
1216
+ "retrying",
1217
+ "dead",
1218
+ "cancelled"
1219
+ ]
1220
+ },
1221
+ "attempt": {
1222
+ "type": "number"
1223
+ },
1224
+ "cycleAttempt": {
1225
+ "type": "number"
1226
+ },
1227
+ "requeueCount": {
1228
+ "type": "number"
1229
+ },
1230
+ "createdAt": {
1231
+ "type": "string"
1232
+ },
1233
+ "priorityRank": {
1234
+ "type": "number"
1235
+ },
1236
+ "availableAt": {
1237
+ "type": "string"
1238
+ },
1239
+ "leaseToken": {
1240
+ "type": "string"
1241
+ },
1242
+ "leaseOwner": {
1243
+ "type": "string"
1244
+ },
1245
+ "leaseExpiresAt": {
1246
+ "type": "string"
1247
+ },
1248
+ "lastError": {
1249
+ "type": "string"
1250
+ },
1251
+ "lastActor": {
1252
+ "type": "string"
1253
+ },
1254
+ "lastAction": {
1255
+ "enum": [
1256
+ "created",
1257
+ "claim",
1258
+ "ack",
1259
+ "nack_retry",
1260
+ "nack_dead",
1261
+ "lease_expired",
1262
+ "attempts_exhausted",
1263
+ "message_expired",
1264
+ "cancel",
1265
+ "requeue"
1266
+ ]
1267
+ }
1268
+ },
1269
+ "additionalProperties": true
1270
+ },
1271
+ {
1272
+ "type": "null"
1273
+ }
1274
+ ]
1275
+ }
1276
+ },
1277
+ "additionalProperties": true
1278
+ },
1279
+ "requiredScopes": [
1280
+ "deliveries:manage"
1281
+ ],
1282
+ "providers": [
1283
+ "local",
1284
+ "gateway"
1285
+ ]
1286
+ },
1287
+ {
1288
+ "name": "requeue_delivery",
1289
+ "description": "Requeue a delivery as its publisher.",
1290
+ "inputSchema": {
1291
+ "type": "object",
1292
+ "required": [
1293
+ "deliveryId"
1294
+ ],
1295
+ "properties": {
1296
+ "deliveryId": {
1297
+ "type": "string"
1298
+ }
1299
+ },
1300
+ "additionalProperties": false
1301
+ },
1302
+ "outputSchema": {
1303
+ "type": "object",
1304
+ "required": [
1305
+ "delivery"
1306
+ ],
1307
+ "properties": {
1308
+ "delivery": {
1309
+ "anyOf": [
1310
+ {
1311
+ "type": "object",
1312
+ "required": [
1313
+ "id",
1314
+ "messageId",
1315
+ "workspace",
1316
+ "recipient",
1317
+ "state",
1318
+ "attempt",
1319
+ "cycleAttempt",
1320
+ "requeueCount",
1321
+ "createdAt",
1322
+ "priorityRank",
1323
+ "availableAt",
1324
+ "lastAction"
1325
+ ],
1326
+ "properties": {
1327
+ "id": {
1328
+ "type": "string"
1329
+ },
1330
+ "messageId": {
1331
+ "type": "string"
1332
+ },
1333
+ "workspace": {
1334
+ "type": "string"
1335
+ },
1336
+ "recipient": {
1337
+ "type": "string"
1338
+ },
1339
+ "state": {
1340
+ "enum": [
1341
+ "pending",
1342
+ "claimed",
1343
+ "acked",
1344
+ "retrying",
1345
+ "dead",
1346
+ "cancelled"
1347
+ ]
1348
+ },
1349
+ "attempt": {
1350
+ "type": "number"
1351
+ },
1352
+ "cycleAttempt": {
1353
+ "type": "number"
1354
+ },
1355
+ "requeueCount": {
1356
+ "type": "number"
1357
+ },
1358
+ "createdAt": {
1359
+ "type": "string"
1360
+ },
1361
+ "priorityRank": {
1362
+ "type": "number"
1363
+ },
1364
+ "availableAt": {
1365
+ "type": "string"
1366
+ },
1367
+ "leaseToken": {
1368
+ "type": "string"
1369
+ },
1370
+ "leaseOwner": {
1371
+ "type": "string"
1372
+ },
1373
+ "leaseExpiresAt": {
1374
+ "type": "string"
1375
+ },
1376
+ "lastError": {
1377
+ "type": "string"
1378
+ },
1379
+ "lastActor": {
1380
+ "type": "string"
1381
+ },
1382
+ "lastAction": {
1383
+ "enum": [
1384
+ "created",
1385
+ "claim",
1386
+ "ack",
1387
+ "nack_retry",
1388
+ "nack_dead",
1389
+ "lease_expired",
1390
+ "attempts_exhausted",
1391
+ "message_expired",
1392
+ "cancel",
1393
+ "requeue"
1394
+ ]
1395
+ }
1396
+ },
1397
+ "additionalProperties": true
1398
+ },
1399
+ {
1400
+ "type": "null"
1401
+ }
1402
+ ]
1403
+ }
1404
+ },
1405
+ "additionalProperties": true
1406
+ },
1407
+ "requiredScopes": [
1408
+ "deliveries:manage"
1409
+ ],
1410
+ "providers": [
1411
+ "local",
1412
+ "gateway"
1413
+ ]
1414
+ },
1415
+ {
1416
+ "name": "extend",
1417
+ "description": "Extend a claimed delivery lease.",
1418
+ "inputSchema": {
1419
+ "type": "object",
1420
+ "required": [
1421
+ "deliveryId",
1422
+ "leaseToken",
1423
+ "leaseMs"
1424
+ ],
1425
+ "properties": {
1426
+ "deliveryId": {
1427
+ "type": "string"
1428
+ },
1429
+ "leaseToken": {
1430
+ "type": "string"
1431
+ },
1432
+ "leaseMs": {
1433
+ "type": "number"
1434
+ }
1435
+ },
1436
+ "additionalProperties": false
1437
+ },
1438
+ "outputSchema": {
1439
+ "type": "object",
1440
+ "required": [
1441
+ "delivery"
1442
+ ],
1443
+ "properties": {
1444
+ "delivery": {
1445
+ "anyOf": [
1446
+ {
1447
+ "type": "object",
1448
+ "required": [
1449
+ "id",
1450
+ "messageId",
1451
+ "workspace",
1452
+ "recipient",
1453
+ "state",
1454
+ "attempt",
1455
+ "cycleAttempt",
1456
+ "requeueCount",
1457
+ "createdAt",
1458
+ "priorityRank",
1459
+ "availableAt",
1460
+ "lastAction"
1461
+ ],
1462
+ "properties": {
1463
+ "id": {
1464
+ "type": "string"
1465
+ },
1466
+ "messageId": {
1467
+ "type": "string"
1468
+ },
1469
+ "workspace": {
1470
+ "type": "string"
1471
+ },
1472
+ "recipient": {
1473
+ "type": "string"
1474
+ },
1475
+ "state": {
1476
+ "enum": [
1477
+ "pending",
1478
+ "claimed",
1479
+ "acked",
1480
+ "retrying",
1481
+ "dead",
1482
+ "cancelled"
1483
+ ]
1484
+ },
1485
+ "attempt": {
1486
+ "type": "number"
1487
+ },
1488
+ "cycleAttempt": {
1489
+ "type": "number"
1490
+ },
1491
+ "requeueCount": {
1492
+ "type": "number"
1493
+ },
1494
+ "createdAt": {
1495
+ "type": "string"
1496
+ },
1497
+ "priorityRank": {
1498
+ "type": "number"
1499
+ },
1500
+ "availableAt": {
1501
+ "type": "string"
1502
+ },
1503
+ "leaseToken": {
1504
+ "type": "string"
1505
+ },
1506
+ "leaseOwner": {
1507
+ "type": "string"
1508
+ },
1509
+ "leaseExpiresAt": {
1510
+ "type": "string"
1511
+ },
1512
+ "lastError": {
1513
+ "type": "string"
1514
+ },
1515
+ "lastActor": {
1516
+ "type": "string"
1517
+ },
1518
+ "lastAction": {
1519
+ "enum": [
1520
+ "created",
1521
+ "claim",
1522
+ "ack",
1523
+ "nack_retry",
1524
+ "nack_dead",
1525
+ "lease_expired",
1526
+ "attempts_exhausted",
1527
+ "message_expired",
1528
+ "cancel",
1529
+ "requeue"
1530
+ ]
1531
+ }
1532
+ },
1533
+ "additionalProperties": true
1534
+ },
1535
+ {
1536
+ "type": "null"
1537
+ }
1538
+ ]
1539
+ }
1540
+ },
1541
+ "additionalProperties": true
1542
+ },
1543
+ "requiredScopes": [
1544
+ "deliveries:settle"
1545
+ ],
1546
+ "providers": [
1547
+ "local",
1548
+ "gateway"
1549
+ ]
1550
+ },
1551
+ {
1552
+ "name": "acknowledge",
1553
+ "description": "Settle a claimed delivery successfully.",
1554
+ "inputSchema": {
1555
+ "type": "object",
1556
+ "required": [
1557
+ "deliveryId",
1558
+ "leaseToken"
1559
+ ],
1560
+ "properties": {
1561
+ "deliveryId": {
1562
+ "type": "string"
1563
+ },
1564
+ "leaseToken": {
1565
+ "type": "string"
1566
+ }
1567
+ },
1568
+ "additionalProperties": false
1569
+ },
1570
+ "outputSchema": {
1571
+ "type": "object",
1572
+ "required": [
1573
+ "delivery"
1574
+ ],
1575
+ "properties": {
1576
+ "delivery": {
1577
+ "anyOf": [
1578
+ {
1579
+ "type": "object",
1580
+ "required": [
1581
+ "id",
1582
+ "messageId",
1583
+ "workspace",
1584
+ "recipient",
1585
+ "state",
1586
+ "attempt",
1587
+ "cycleAttempt",
1588
+ "requeueCount",
1589
+ "createdAt",
1590
+ "priorityRank",
1591
+ "availableAt",
1592
+ "lastAction"
1593
+ ],
1594
+ "properties": {
1595
+ "id": {
1596
+ "type": "string"
1597
+ },
1598
+ "messageId": {
1599
+ "type": "string"
1600
+ },
1601
+ "workspace": {
1602
+ "type": "string"
1603
+ },
1604
+ "recipient": {
1605
+ "type": "string"
1606
+ },
1607
+ "state": {
1608
+ "enum": [
1609
+ "pending",
1610
+ "claimed",
1611
+ "acked",
1612
+ "retrying",
1613
+ "dead",
1614
+ "cancelled"
1615
+ ]
1616
+ },
1617
+ "attempt": {
1618
+ "type": "number"
1619
+ },
1620
+ "cycleAttempt": {
1621
+ "type": "number"
1622
+ },
1623
+ "requeueCount": {
1624
+ "type": "number"
1625
+ },
1626
+ "createdAt": {
1627
+ "type": "string"
1628
+ },
1629
+ "priorityRank": {
1630
+ "type": "number"
1631
+ },
1632
+ "availableAt": {
1633
+ "type": "string"
1634
+ },
1635
+ "leaseToken": {
1636
+ "type": "string"
1637
+ },
1638
+ "leaseOwner": {
1639
+ "type": "string"
1640
+ },
1641
+ "leaseExpiresAt": {
1642
+ "type": "string"
1643
+ },
1644
+ "lastError": {
1645
+ "type": "string"
1646
+ },
1647
+ "lastActor": {
1648
+ "type": "string"
1649
+ },
1650
+ "lastAction": {
1651
+ "enum": [
1652
+ "created",
1653
+ "claim",
1654
+ "ack",
1655
+ "nack_retry",
1656
+ "nack_dead",
1657
+ "lease_expired",
1658
+ "attempts_exhausted",
1659
+ "message_expired",
1660
+ "cancel",
1661
+ "requeue"
1662
+ ]
1663
+ }
1664
+ },
1665
+ "additionalProperties": true
1666
+ },
1667
+ {
1668
+ "type": "null"
1669
+ }
1670
+ ]
1671
+ }
1672
+ },
1673
+ "additionalProperties": true
1674
+ },
1675
+ "requiredScopes": [
1676
+ "deliveries:settle"
1677
+ ],
1678
+ "providers": [
1679
+ "local",
1680
+ "gateway"
1681
+ ]
1682
+ },
1683
+ {
1684
+ "name": "negative_acknowledge",
1685
+ "description": "Settle a claimed delivery for retry or dead letter.",
1686
+ "inputSchema": {
1687
+ "type": "object",
1688
+ "required": [
1689
+ "deliveryId",
1690
+ "leaseToken",
1691
+ "error"
1692
+ ],
1693
+ "properties": {
1694
+ "deliveryId": {
1695
+ "type": "string"
1696
+ },
1697
+ "leaseToken": {
1698
+ "type": "string"
1699
+ },
1700
+ "error": {
1701
+ "type": "string"
1702
+ },
1703
+ "disposition": {
1704
+ "enum": [
1705
+ "retry",
1706
+ "dead"
1707
+ ]
1708
+ },
1709
+ "dead": {
1710
+ "type": "boolean"
1711
+ },
1712
+ "retryPolicy": {
1713
+ "type": "object",
1714
+ "properties": {
1715
+ "maxAttempts": {
1716
+ "type": "number"
1717
+ },
1718
+ "baseDelayMs": {
1719
+ "type": "number"
1720
+ },
1721
+ "maxDelayMs": {
1722
+ "type": "number"
1723
+ },
1724
+ "jitterRatio": {
1725
+ "type": "number"
1726
+ }
1727
+ },
1728
+ "additionalProperties": false
1729
+ }
1730
+ },
1731
+ "additionalProperties": false
1732
+ },
1733
+ "outputSchema": {
1734
+ "type": "object",
1735
+ "required": [
1736
+ "delivery"
1737
+ ],
1738
+ "properties": {
1739
+ "delivery": {
1740
+ "anyOf": [
1741
+ {
1742
+ "type": "object",
1743
+ "required": [
1744
+ "id",
1745
+ "messageId",
1746
+ "workspace",
1747
+ "recipient",
1748
+ "state",
1749
+ "attempt",
1750
+ "cycleAttempt",
1751
+ "requeueCount",
1752
+ "createdAt",
1753
+ "priorityRank",
1754
+ "availableAt",
1755
+ "lastAction"
1756
+ ],
1757
+ "properties": {
1758
+ "id": {
1759
+ "type": "string"
1760
+ },
1761
+ "messageId": {
1762
+ "type": "string"
1763
+ },
1764
+ "workspace": {
1765
+ "type": "string"
1766
+ },
1767
+ "recipient": {
1768
+ "type": "string"
1769
+ },
1770
+ "state": {
1771
+ "enum": [
1772
+ "pending",
1773
+ "claimed",
1774
+ "acked",
1775
+ "retrying",
1776
+ "dead",
1777
+ "cancelled"
1778
+ ]
1779
+ },
1780
+ "attempt": {
1781
+ "type": "number"
1782
+ },
1783
+ "cycleAttempt": {
1784
+ "type": "number"
1785
+ },
1786
+ "requeueCount": {
1787
+ "type": "number"
1788
+ },
1789
+ "createdAt": {
1790
+ "type": "string"
1791
+ },
1792
+ "priorityRank": {
1793
+ "type": "number"
1794
+ },
1795
+ "availableAt": {
1796
+ "type": "string"
1797
+ },
1798
+ "leaseToken": {
1799
+ "type": "string"
1800
+ },
1801
+ "leaseOwner": {
1802
+ "type": "string"
1803
+ },
1804
+ "leaseExpiresAt": {
1805
+ "type": "string"
1806
+ },
1807
+ "lastError": {
1808
+ "type": "string"
1809
+ },
1810
+ "lastActor": {
1811
+ "type": "string"
1812
+ },
1813
+ "lastAction": {
1814
+ "enum": [
1815
+ "created",
1816
+ "claim",
1817
+ "ack",
1818
+ "nack_retry",
1819
+ "nack_dead",
1820
+ "lease_expired",
1821
+ "attempts_exhausted",
1822
+ "message_expired",
1823
+ "cancel",
1824
+ "requeue"
1825
+ ]
1826
+ }
1827
+ },
1828
+ "additionalProperties": true
1829
+ },
1830
+ {
1831
+ "type": "null"
1832
+ }
1833
+ ]
1834
+ }
1835
+ },
1836
+ "additionalProperties": true
1837
+ },
1838
+ "requiredScopes": [
1839
+ "deliveries:settle"
1840
+ ],
1841
+ "providers": [
1842
+ "local",
1843
+ "gateway"
1844
+ ]
1845
+ },
1846
+ {
1847
+ "name": "heartbeat",
1848
+ "description": "Publish a leased runtime presence record.",
1849
+ "inputSchema": {
1850
+ "type": "object",
1851
+ "properties": {
1852
+ "leaseMs": {
1853
+ "type": "number",
1854
+ "minimum": 1000,
1855
+ "maximum": 900000
1856
+ },
1857
+ "runtimeType": {
1858
+ "type": "string"
1859
+ },
1860
+ "capabilities": {
1861
+ "type": "array",
1862
+ "items": {
1863
+ "type": "string"
1864
+ }
1865
+ }
1866
+ },
1867
+ "additionalProperties": false
1868
+ },
1869
+ "outputSchema": {
1870
+ "type": "object",
1871
+ "required": [
1872
+ "workspace",
1873
+ "agent",
1874
+ "instance",
1875
+ "capabilities",
1876
+ "leaseExpiresAt",
1877
+ "lastSeenAt"
1878
+ ],
1879
+ "properties": {
1880
+ "workspace": {
1881
+ "type": "string"
1882
+ },
1883
+ "agent": {
1884
+ "type": "string"
1885
+ },
1886
+ "instance": {
1887
+ "type": "string"
1888
+ },
1889
+ "runtimeType": {
1890
+ "type": "string"
1891
+ },
1892
+ "capabilities": {
1893
+ "type": "array",
1894
+ "items": {
1895
+ "type": "string"
1896
+ }
1897
+ },
1898
+ "leaseExpiresAt": {
1899
+ "type": "string"
1900
+ },
1901
+ "lastSeenAt": {
1902
+ "type": "string"
1903
+ }
1904
+ },
1905
+ "additionalProperties": true
1906
+ },
1907
+ "requiredScopes": [
1908
+ "presence:write"
1909
+ ],
1910
+ "providers": [
1911
+ "local",
1912
+ "gateway"
1913
+ ]
1914
+ },
1915
+ {
1916
+ "name": "presence",
1917
+ "description": "List active agent runtime instances.",
1918
+ "inputSchema": {
1919
+ "type": "object",
1920
+ "properties": {},
1921
+ "additionalProperties": false
1922
+ },
1923
+ "outputSchema": {
1924
+ "type": "object",
1925
+ "required": [
1926
+ "agents"
1927
+ ],
1928
+ "properties": {
1929
+ "agents": {
1930
+ "type": "array",
1931
+ "items": {
1932
+ "type": "object",
1933
+ "required": [
1934
+ "workspace",
1935
+ "agent",
1936
+ "instance",
1937
+ "capabilities",
1938
+ "leaseExpiresAt",
1939
+ "lastSeenAt"
1940
+ ],
1941
+ "properties": {
1942
+ "workspace": {
1943
+ "type": "string"
1944
+ },
1945
+ "agent": {
1946
+ "type": "string"
1947
+ },
1948
+ "instance": {
1949
+ "type": "string"
1950
+ },
1951
+ "runtimeType": {
1952
+ "type": "string"
1953
+ },
1954
+ "capabilities": {
1955
+ "type": "array",
1956
+ "items": {
1957
+ "type": "string"
1958
+ }
1959
+ },
1960
+ "leaseExpiresAt": {
1961
+ "type": "string"
1962
+ },
1963
+ "lastSeenAt": {
1964
+ "type": "string"
1965
+ }
1966
+ },
1967
+ "additionalProperties": true
1968
+ }
1969
+ }
1970
+ },
1971
+ "additionalProperties": true
1972
+ },
1973
+ "requiredScopes": [
1974
+ "presence:read"
1975
+ ],
1976
+ "providers": [
1977
+ "local",
1978
+ "gateway"
1979
+ ]
1980
+ },
1981
+ {
1982
+ "name": "sync",
1983
+ "description": "Replay a gateway outbox and refresh its inbox cache.",
1984
+ "inputSchema": {
1985
+ "type": "object",
1986
+ "properties": {
1987
+ "maxPush": {
1988
+ "type": "number"
1989
+ },
1990
+ "maxPages": {
1991
+ "type": "number"
1992
+ }
1993
+ },
1994
+ "additionalProperties": false
1995
+ },
1996
+ "outputSchema": {
1997
+ "type": "object",
1998
+ "required": [
1999
+ "online",
2000
+ "pushed",
2001
+ "deduplicated",
2002
+ "pulled",
2003
+ "pending",
2004
+ "blocked",
2005
+ "cached"
2006
+ ],
2007
+ "properties": {
2008
+ "online": {
2009
+ "type": "boolean"
2010
+ },
2011
+ "pushed": {
2012
+ "type": "number"
2013
+ },
2014
+ "deduplicated": {
2015
+ "type": "number"
2016
+ },
2017
+ "pulled": {
2018
+ "type": "number"
2019
+ },
2020
+ "pending": {
2021
+ "type": "number"
2022
+ },
2023
+ "blocked": {
2024
+ "type": "number"
2025
+ },
2026
+ "cached": {
2027
+ "type": "number"
2028
+ },
2029
+ "cursor": {
2030
+ "anyOf": [
2031
+ {
2032
+ "type": "string"
2033
+ },
2034
+ {
2035
+ "type": "null"
2036
+ }
2037
+ ]
2038
+ },
2039
+ "lastSyncedAt": {
2040
+ "anyOf": [
2041
+ {
2042
+ "type": "string"
2043
+ },
2044
+ {
2045
+ "type": "null"
2046
+ }
2047
+ ]
2048
+ },
2049
+ "lastError": {
2050
+ "anyOf": [
2051
+ {
2052
+ "type": "string"
2053
+ },
2054
+ {
2055
+ "type": "null"
2056
+ }
2057
+ ]
2058
+ },
2059
+ "failureRetryable": {
2060
+ "type": "boolean"
2061
+ }
2062
+ },
2063
+ "additionalProperties": true
2064
+ },
2065
+ "requiredScopes": [
2066
+ "messages:write",
2067
+ "messages:read"
2068
+ ],
2069
+ "providers": [
2070
+ "gateway"
2071
+ ]
2072
+ }
2073
+ ]
2074
+ }