cohorte 2.10.0 → 3.0.0-dev.0

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 (211) hide show
  1. package/README.md +7 -0
  2. package/assets/manifest.json +193 -0
  3. package/assets/migrations/config/README.md +12 -0
  4. package/assets/migrations/state/0001_init.sql +154 -0
  5. package/assets/prompts/README.md +11 -0
  6. package/assets/prompts/agents/fixer.md +7 -0
  7. package/assets/prompts/agents/implementer.md +12 -0
  8. package/assets/prompts/agents/reviewer.md +8 -0
  9. package/assets/prompts/agents/security-reviewer.md +7 -0
  10. package/assets/prompts/phases/build.md +5 -0
  11. package/assets/prompts/phases/review.md +5 -0
  12. package/assets/prompts/phases/test.md +5 -0
  13. package/assets/prompts/system.md +11 -0
  14. package/assets/schemas/agent-output.schema.json +225 -0
  15. package/assets/schemas/auth-status.schema.json +87 -0
  16. package/assets/schemas/command-result.schema.json +192 -0
  17. package/assets/schemas/commands.schema.json +952 -0
  18. package/assets/schemas/config.schema.json +2259 -0
  19. package/assets/schemas/doctor-report.schema.json +104 -0
  20. package/assets/schemas/events.schema.json +8514 -0
  21. package/assets/schemas/fake-script.schema.json +549 -0
  22. package/assets/schemas/inspect.schema.json +3133 -0
  23. package/assets/schemas/manifest.schema.json +79 -0
  24. package/assets/schemas/ownership.schema.json +52 -0
  25. package/assets/schemas/policy-verdict.schema.json +282 -0
  26. package/assets/schemas/project-model.schema.json +783 -0
  27. package/assets/schemas/project-status.schema.json +217 -0
  28. package/assets/schemas/reconcile-plan.schema.json +155 -0
  29. package/assets/schemas/run-diff.schema.json +177 -0
  30. package/assets/schemas/run-snapshot-manifest.schema.json +2104 -0
  31. package/assets/schemas/run-state.schema.json +1755 -0
  32. package/assets/schemas/runtime-capabilities.schema.json +1545 -0
  33. package/assets/schemas/sandbox-capabilities.schema.json +116 -0
  34. package/assets/schemas/skill.schema.json +87 -0
  35. package/assets/schemas/spec.schema.json +202 -0
  36. package/assets/schemas/tool-catalogue.schema.json +655 -0
  37. package/assets/schemas/trust-record.schema.json +38 -0
  38. package/assets/skills/README.md +9 -0
  39. package/assets/skills/inspect-surface.md +4 -0
  40. package/dist/agent-host.mjs +50 -0
  41. package/dist/agent-host.mjs.map +1 -0
  42. package/dist/bundle-manifest.json +102 -0
  43. package/dist/chunks/__host-DgGPyco9.mjs +18 -0
  44. package/dist/chunks/__host-DgGPyco9.mjs.map +1 -0
  45. package/dist/chunks/approve-Cv135UqI.mjs +19 -0
  46. package/dist/chunks/approve-Cv135UqI.mjs.map +1 -0
  47. package/dist/chunks/auth-BT5oVp76.mjs +132 -0
  48. package/dist/chunks/auth-BT5oVp76.mjs.map +1 -0
  49. package/dist/chunks/auth-D8rCVY33.mjs +84 -0
  50. package/dist/chunks/auth-D8rCVY33.mjs.map +1 -0
  51. package/dist/chunks/brainstorm-CU10T1tm.mjs +7 -0
  52. package/dist/chunks/brainstorm-CU10T1tm.mjs.map +1 -0
  53. package/dist/chunks/cancel-KV_cpsqS.mjs +15 -0
  54. package/dist/chunks/cancel-KV_cpsqS.mjs.map +1 -0
  55. package/dist/chunks/canonical-C8UxeEmB.mjs +57 -0
  56. package/dist/chunks/canonical-C8UxeEmB.mjs.map +1 -0
  57. package/dist/chunks/catalogue-BvwSrM_j.mjs +1549 -0
  58. package/dist/chunks/catalogue-BvwSrM_j.mjs.map +1 -0
  59. package/dist/chunks/compose-Cr0hP0qm.mjs +7303 -0
  60. package/dist/chunks/compose-Cr0hP0qm.mjs.map +1 -0
  61. package/dist/chunks/config-DefHA2Lw.mjs +96 -0
  62. package/dist/chunks/config-DefHA2Lw.mjs.map +1 -0
  63. package/dist/chunks/contract-B0ra2-bm.mjs +295 -0
  64. package/dist/chunks/contract-B0ra2-bm.mjs.map +1 -0
  65. package/dist/chunks/contract-vYbwYr0Y.mjs +123 -0
  66. package/dist/chunks/contract-vYbwYr0Y.mjs.map +1 -0
  67. package/dist/chunks/deny-ClTxSvHJ.mjs +15 -0
  68. package/dist/chunks/deny-ClTxSvHJ.mjs.map +1 -0
  69. package/dist/chunks/diff-Qw0II0sj.mjs +101 -0
  70. package/dist/chunks/diff-Qw0II0sj.mjs.map +1 -0
  71. package/dist/chunks/discover-30Ciya_0.mjs +20 -0
  72. package/dist/chunks/discover-30Ciya_0.mjs.map +1 -0
  73. package/dist/chunks/doctor-DfCrKpfT.mjs +222 -0
  74. package/dist/chunks/doctor-DfCrKpfT.mjs.map +1 -0
  75. package/dist/chunks/fix-D4Tj8RVA.mjs +18 -0
  76. package/dist/chunks/fix-D4Tj8RVA.mjs.map +1 -0
  77. package/dist/chunks/gc-BBXlBF5w.mjs +161 -0
  78. package/dist/chunks/gc-BBXlBF5w.mjs.map +1 -0
  79. package/dist/chunks/init-Okz4mlhW.mjs +30 -0
  80. package/dist/chunks/init-Okz4mlhW.mjs.map +1 -0
  81. package/dist/chunks/inspect-Buby4cQD.mjs +22 -0
  82. package/dist/chunks/inspect-Buby4cQD.mjs.map +1 -0
  83. package/dist/chunks/logs-Giq5sUau.mjs +25 -0
  84. package/dist/chunks/logs-Giq5sUau.mjs.map +1 -0
  85. package/dist/chunks/migrate-DRoFUg53.mjs +19 -0
  86. package/dist/chunks/migrate-DRoFUg53.mjs.map +1 -0
  87. package/dist/chunks/models-Btp6X2YZ.mjs +24 -0
  88. package/dist/chunks/models-Btp6X2YZ.mjs.map +1 -0
  89. package/dist/chunks/pause-BASBfKLO.mjs +16 -0
  90. package/dist/chunks/pause-BASBfKLO.mjs.map +1 -0
  91. package/dist/chunks/policy-DUIgzF3W.mjs +139 -0
  92. package/dist/chunks/policy-DUIgzF3W.mjs.map +1 -0
  93. package/dist/chunks/providers-Dx78imKj.mjs +19 -0
  94. package/dist/chunks/providers-Dx78imKj.mjs.map +1 -0
  95. package/dist/chunks/reconcile-BfD785gd.mjs +26 -0
  96. package/dist/chunks/reconcile-BfD785gd.mjs.map +1 -0
  97. package/dist/chunks/render-DyZr5Lgi.mjs +53 -0
  98. package/dist/chunks/render-DyZr5Lgi.mjs.map +1 -0
  99. package/dist/chunks/resume-GJQRb2Eb.mjs +15 -0
  100. package/dist/chunks/resume-GJQRb2Eb.mjs.map +1 -0
  101. package/dist/chunks/retry-CLrUem1H.mjs +15 -0
  102. package/dist/chunks/retry-CLrUem1H.mjs.map +1 -0
  103. package/dist/chunks/review-BDdjb6kB.mjs +17 -0
  104. package/dist/chunks/review-BDdjb6kB.mjs.map +1 -0
  105. package/dist/chunks/run-CgTWYlcd.mjs +82 -0
  106. package/dist/chunks/run-CgTWYlcd.mjs.map +1 -0
  107. package/dist/chunks/run-tool-C3rAv4XF.mjs +26 -0
  108. package/dist/chunks/run-tool-C3rAv4XF.mjs.map +1 -0
  109. package/dist/chunks/schema-C9QbUW4H.mjs +578 -0
  110. package/dist/chunks/schema-C9QbUW4H.mjs.map +1 -0
  111. package/dist/chunks/send-BdnJ85Nz.mjs +19 -0
  112. package/dist/chunks/send-BdnJ85Nz.mjs.map +1 -0
  113. package/dist/chunks/ship-DTuLGoaJ.mjs +19 -0
  114. package/dist/chunks/ship-DTuLGoaJ.mjs.map +1 -0
  115. package/dist/chunks/shutdown-BM92Iyv2.mjs +15 -0
  116. package/dist/chunks/shutdown-BM92Iyv2.mjs.map +1 -0
  117. package/dist/chunks/skip-DZG5kpcH.mjs +18 -0
  118. package/dist/chunks/skip-DZG5kpcH.mjs.map +1 -0
  119. package/dist/chunks/spec-Bq0P3jVh.mjs +20 -0
  120. package/dist/chunks/spec-Bq0P3jVh.mjs.map +1 -0
  121. package/dist/chunks/src-CId6kMsY.mjs +1689 -0
  122. package/dist/chunks/src-CId6kMsY.mjs.map +1 -0
  123. package/dist/chunks/src-CfAOde7C.mjs +5403 -0
  124. package/dist/chunks/src-CfAOde7C.mjs.map +1 -0
  125. package/dist/chunks/src-Cu3TxNob.mjs +783 -0
  126. package/dist/chunks/src-Cu3TxNob.mjs.map +1 -0
  127. package/dist/chunks/src-DcU4IXMe.mjs +117 -0
  128. package/dist/chunks/src-DcU4IXMe.mjs.map +1 -0
  129. package/dist/chunks/src-JxawBQBn.mjs +446 -0
  130. package/dist/chunks/src-JxawBQBn.mjs.map +1 -0
  131. package/dist/chunks/src-s7YRvk0t.mjs +2116 -0
  132. package/dist/chunks/src-s7YRvk0t.mjs.map +1 -0
  133. package/dist/chunks/status-SMjiOMYy.mjs +29 -0
  134. package/dist/chunks/status-SMjiOMYy.mjs.map +1 -0
  135. package/dist/chunks/tail-BuhT-2PH.mjs +25 -0
  136. package/dist/chunks/tail-BuhT-2PH.mjs.map +1 -0
  137. package/dist/chunks/update-BXIppsbi.mjs +16 -0
  138. package/dist/chunks/update-BXIppsbi.mjs.map +1 -0
  139. package/dist/cli.mjs +175 -0
  140. package/dist/cli.mjs.map +1 -0
  141. package/package.json +17 -32
  142. package/CHANGELOG.md +0 -1453
  143. package/bin/cli.js +0 -812
  144. package/bin/report.js +0 -141
  145. package/core/adapter/render.js +0 -389
  146. package/core/agents/implementer.template.md +0 -142
  147. package/core/agents/profile-reader.md +0 -50
  148. package/core/agents/release.md +0 -58
  149. package/core/agents/review.md +0 -179
  150. package/core/commands/cohorte-align-ds.md +0 -33
  151. package/core/commands/cohorte-audit.md +0 -58
  152. package/core/commands/cohorte-brainstorm.md +0 -70
  153. package/core/commands/cohorte-build.md +0 -219
  154. package/core/commands/cohorte-doctor.md +0 -170
  155. package/core/commands/cohorte-fix.md +0 -80
  156. package/core/commands/cohorte-fleet.md +0 -103
  157. package/core/commands/cohorte-init-pipeline.md +0 -31
  158. package/core/commands/cohorte-intake.md +0 -92
  159. package/core/commands/cohorte-patch.md +0 -118
  160. package/core/commands/cohorte-refactor.md +0 -59
  161. package/core/commands/cohorte-retro.md +0 -85
  162. package/core/commands/cohorte-review.md +0 -270
  163. package/core/commands/cohorte-ship.md +0 -122
  164. package/core/commands/cohorte-spec.md +0 -101
  165. package/core/commands/cohorte-update-pipeline.md +0 -134
  166. package/core/hooks/gate.py +0 -580
  167. package/core/runtimes/claude.json +0 -74
  168. package/core/runtimes/codex.json +0 -83
  169. package/core/runtimes/cursor.json +0 -76
  170. package/core/runtimes/gemini.json +0 -76
  171. package/core/runtimes/opencode.json +0 -73
  172. package/core/templates/agent-handoff.md +0 -34
  173. package/core/templates/brainstorm-return.md +0 -36
  174. package/core/templates/decisions.template.md +0 -42
  175. package/core/templates/design-brief.md +0 -44
  176. package/core/templates/patch.template.md +0 -86
  177. package/core/templates/pr-body.md +0 -25
  178. package/core/templates/review-feedback.md +0 -38
  179. package/core/templates/spec.template.md +0 -87
  180. package/core/templates/steps/init-pipeline/01-detect-stack.md +0 -44
  181. package/core/templates/steps/init-pipeline/02-interview-gaps.md +0 -55
  182. package/core/templates/steps/init-pipeline/03-draft-profile.md +0 -10
  183. package/core/templates/steps/init-pipeline/04-write-render.md +0 -115
  184. package/core/templates/steps/init-pipeline/05-report.md +0 -12
  185. package/core/workflows/audit.js +0 -240
  186. package/core/workflows/loop.js +0 -641
  187. package/core/workflows/refactor.js +0 -276
  188. package/core/workflows/review.js +0 -456
  189. package/install.ps1 +0 -103
  190. package/install.sh +0 -114
  191. package/lib/doctor.js +0 -504
  192. package/lib/runtime.js +0 -134
  193. package/lib/versions.js +0 -149
  194. package/lib/yaml.js +0 -129
  195. package/profile/PIPELINE.template.md +0 -251
  196. package/profile/SCHEMA.md +0 -698
  197. package/profile/cohorte.config.template.yaml +0 -43
  198. package/scripts/assert-gate-hook.mjs +0 -75
  199. package/scripts/kanban-move.sh +0 -313
  200. package/scripts/metrics/collect.mjs +0 -531
  201. package/scripts/metrics/prices.json +0 -42
  202. package/scripts/new-feature.sh.template +0 -98
  203. package/scripts/preflight.sh +0 -124
  204. package/scripts/remove-feature.sh.template +0 -56
  205. package/scripts/test-adapter.mjs +0 -368
  206. package/scripts/test-gate.mjs +0 -428
  207. package/scripts/test-kanban.mjs +0 -304
  208. package/scripts/test-lib.mjs +0 -310
  209. package/scripts/test-metrics.mjs +0 -156
  210. package/scripts/test-workflows.mjs +0 -758
  211. package/scripts/validate-core.mjs +0 -320
@@ -0,0 +1,952 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cohorte.dev/schemas/3/commands.schema.json",
4
+ "title": "Cohorte Protocol command envelope",
5
+ "type": "object",
6
+ "required": [
7
+ "protocolVersion",
8
+ "commandId",
9
+ "type",
10
+ "issuedAt",
11
+ "actor",
12
+ "payload"
13
+ ],
14
+ "properties": {
15
+ "protocolVersion": {
16
+ "type": "string",
17
+ "const": "1.0"
18
+ },
19
+ "commandId": {
20
+ "type": "string",
21
+ "pattern": "^cmd_[0-9a-f]{32}$"
22
+ },
23
+ "type": {
24
+ "type": "string",
25
+ "minLength": 1
26
+ },
27
+ "runId": {
28
+ "type": "string",
29
+ "pattern": "^run_[0-9a-f]{32}$"
30
+ },
31
+ "issuedAt": {
32
+ "type": "string",
33
+ "format": "date-time",
34
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
35
+ },
36
+ "actor": {
37
+ "type": "object",
38
+ "required": [
39
+ "kind",
40
+ "id",
41
+ "transport"
42
+ ],
43
+ "properties": {
44
+ "kind": {
45
+ "type": "string",
46
+ "enum": [
47
+ "human",
48
+ "client",
49
+ "system"
50
+ ]
51
+ },
52
+ "id": {
53
+ "type": "string"
54
+ },
55
+ "transport": {
56
+ "type": "string",
57
+ "x-cohorte-known": [
58
+ "cli"
59
+ ]
60
+ }
61
+ }
62
+ },
63
+ "expectedSequence": {
64
+ "type": "integer",
65
+ "minimum": 0
66
+ },
67
+ "payload": {},
68
+ "auth": {
69
+ "type": "object",
70
+ "required": [
71
+ "scheme",
72
+ "value"
73
+ ],
74
+ "properties": {
75
+ "scheme": {
76
+ "type": "string",
77
+ "x-cohorte-known": [
78
+ "hmac-sha256"
79
+ ]
80
+ },
81
+ "value": {
82
+ "type": "string",
83
+ "minLength": 1
84
+ }
85
+ }
86
+ }
87
+ },
88
+ "oneOf": [
89
+ {
90
+ "title": "start",
91
+ "properties": {
92
+ "type": {
93
+ "const": "start"
94
+ },
95
+ "payload": {
96
+ "type": "object",
97
+ "required": [
98
+ "profile",
99
+ "unattended"
100
+ ],
101
+ "properties": {
102
+ "profile": {
103
+ "type": "string",
104
+ "x-cohorte-known": [
105
+ "feature",
106
+ "bugfix",
107
+ "review"
108
+ ]
109
+ },
110
+ "spec": {
111
+ "anyOf": [
112
+ {
113
+ "type": "object",
114
+ "required": [
115
+ "id"
116
+ ],
117
+ "properties": {
118
+ "id": {
119
+ "type": "string",
120
+ "pattern": "^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$"
121
+ }
122
+ }
123
+ },
124
+ {
125
+ "type": "object",
126
+ "required": [
127
+ "path"
128
+ ],
129
+ "properties": {
130
+ "path": {
131
+ "type": "string"
132
+ }
133
+ }
134
+ }
135
+ ]
136
+ },
137
+ "reviewTarget": {
138
+ "anyOf": [
139
+ {
140
+ "type": "object",
141
+ "required": [
142
+ "ref"
143
+ ],
144
+ "properties": {
145
+ "ref": {
146
+ "type": "string"
147
+ }
148
+ }
149
+ },
150
+ {
151
+ "type": "object",
152
+ "required": [
153
+ "base",
154
+ "head"
155
+ ],
156
+ "properties": {
157
+ "base": {
158
+ "type": "string"
159
+ },
160
+ "head": {
161
+ "type": "string"
162
+ }
163
+ }
164
+ },
165
+ {
166
+ "type": "object",
167
+ "required": [
168
+ "runId"
169
+ ],
170
+ "properties": {
171
+ "runId": {
172
+ "type": "string",
173
+ "pattern": "^run_[0-9a-f]{32}$"
174
+ }
175
+ }
176
+ }
177
+ ]
178
+ },
179
+ "withFix": {
180
+ "type": "boolean"
181
+ },
182
+ "phases": {
183
+ "type": "array",
184
+ "items": {
185
+ "type": "string",
186
+ "enum": [
187
+ "BRAINSTORM",
188
+ "SPEC",
189
+ "PREFLIGHT",
190
+ "BUILD",
191
+ "TEST",
192
+ "REVIEW",
193
+ "FIX",
194
+ "SHIP"
195
+ ]
196
+ }
197
+ },
198
+ "modelOverrides": {
199
+ "type": "object",
200
+ "patternProperties": {
201
+ "^.*$": {
202
+ "type": "object",
203
+ "required": [
204
+ "provider",
205
+ "model"
206
+ ],
207
+ "properties": {
208
+ "provider": {
209
+ "type": "string"
210
+ },
211
+ "model": {
212
+ "type": "string"
213
+ },
214
+ "capability": {
215
+ "anyOf": [
216
+ {
217
+ "type": "string",
218
+ "const": "fast"
219
+ },
220
+ {
221
+ "type": "string",
222
+ "const": "coding"
223
+ },
224
+ {
225
+ "type": "string",
226
+ "const": "reasoning"
227
+ },
228
+ {
229
+ "type": "string",
230
+ "const": "vision"
231
+ },
232
+ {
233
+ "type": "string",
234
+ "const": "cheap"
235
+ }
236
+ ]
237
+ }
238
+ }
239
+ }
240
+ }
241
+ },
242
+ "runtime": {
243
+ "type": "string"
244
+ },
245
+ "fakeScript": {
246
+ "type": "string"
247
+ },
248
+ "unattended": {
249
+ "type": "boolean"
250
+ },
251
+ "budgets": {
252
+ "type": "object",
253
+ "properties": {
254
+ "tokens": {
255
+ "type": "integer",
256
+ "minimum": 0
257
+ },
258
+ "modelRequests": {
259
+ "type": "integer",
260
+ "minimum": 0
261
+ },
262
+ "toolCalls": {
263
+ "type": "integer",
264
+ "minimum": 0
265
+ },
266
+ "wallClockMs": {
267
+ "type": "number",
268
+ "minimum": 0
269
+ },
270
+ "retries": {
271
+ "type": "integer",
272
+ "minimum": 0
273
+ },
274
+ "fixRounds": {
275
+ "type": "integer",
276
+ "minimum": 0
277
+ },
278
+ "contextTokens": {
279
+ "type": "integer",
280
+ "minimum": 0
281
+ },
282
+ "concurrentAgents": {
283
+ "type": "integer",
284
+ "minimum": 0
285
+ },
286
+ "estimatedQuotaPercent": {
287
+ "type": "number",
288
+ "minimum": 0
289
+ }
290
+ }
291
+ },
292
+ "sandboxRequire": {
293
+ "type": "string",
294
+ "enum": [
295
+ "native",
296
+ "best-effort"
297
+ ]
298
+ },
299
+ "consent": {
300
+ "type": "object",
301
+ "required": [
302
+ "policySha256",
303
+ "via"
304
+ ],
305
+ "properties": {
306
+ "policySha256": {
307
+ "type": "string",
308
+ "pattern": "^[0-9a-f]{64}$"
309
+ },
310
+ "via": {
311
+ "type": "string",
312
+ "const": "cli-flag"
313
+ }
314
+ }
315
+ }
316
+ }
317
+ }
318
+ }
319
+ },
320
+ {
321
+ "title": "status",
322
+ "properties": {
323
+ "type": {
324
+ "const": "status"
325
+ },
326
+ "payload": {
327
+ "type": "object",
328
+ "properties": {
329
+ "runId": {
330
+ "type": "string",
331
+ "pattern": "^run_[0-9a-f]{32}$"
332
+ }
333
+ }
334
+ }
335
+ }
336
+ },
337
+ {
338
+ "title": "inspect",
339
+ "properties": {
340
+ "type": {
341
+ "const": "inspect"
342
+ },
343
+ "payload": {
344
+ "type": "object",
345
+ "required": [
346
+ "target"
347
+ ],
348
+ "properties": {
349
+ "target": {
350
+ "anyOf": [
351
+ {
352
+ "type": "object",
353
+ "required": [
354
+ "kind",
355
+ "agentId"
356
+ ],
357
+ "properties": {
358
+ "kind": {
359
+ "type": "string",
360
+ "const": "agent"
361
+ },
362
+ "agentId": {
363
+ "type": "string",
364
+ "maxLength": 128,
365
+ "pattern": "^agt_[A-Za-z0-9.-]+_[A-Za-z0-9_.-]+$"
366
+ }
367
+ }
368
+ },
369
+ {
370
+ "type": "object",
371
+ "required": [
372
+ "kind",
373
+ "agentId",
374
+ "incarnation"
375
+ ],
376
+ "properties": {
377
+ "kind": {
378
+ "type": "string",
379
+ "const": "context"
380
+ },
381
+ "agentId": {
382
+ "type": "string",
383
+ "maxLength": 128,
384
+ "pattern": "^agt_[A-Za-z0-9.-]+_[A-Za-z0-9_.-]+$"
385
+ },
386
+ "incarnation": {
387
+ "type": "integer",
388
+ "minimum": 0
389
+ }
390
+ }
391
+ },
392
+ {
393
+ "type": "object",
394
+ "required": [
395
+ "kind",
396
+ "approvalId"
397
+ ],
398
+ "properties": {
399
+ "kind": {
400
+ "type": "string",
401
+ "const": "approval"
402
+ },
403
+ "approvalId": {
404
+ "type": "string",
405
+ "pattern": "^apr_[0-9a-f]{32}$"
406
+ }
407
+ }
408
+ },
409
+ {
410
+ "type": "object",
411
+ "required": [
412
+ "kind",
413
+ "effectId"
414
+ ],
415
+ "properties": {
416
+ "kind": {
417
+ "type": "string",
418
+ "const": "effect"
419
+ },
420
+ "effectId": {
421
+ "type": "string",
422
+ "pattern": "^eff_[0-9a-f]{32}$"
423
+ }
424
+ }
425
+ },
426
+ {
427
+ "type": "object",
428
+ "required": [
429
+ "kind"
430
+ ],
431
+ "properties": {
432
+ "kind": {
433
+ "type": "string",
434
+ "const": "snapshot"
435
+ }
436
+ }
437
+ },
438
+ {
439
+ "type": "object",
440
+ "required": [
441
+ "kind"
442
+ ],
443
+ "properties": {
444
+ "kind": {
445
+ "type": "string",
446
+ "const": "locks"
447
+ }
448
+ }
449
+ },
450
+ {
451
+ "type": "object",
452
+ "required": [
453
+ "kind"
454
+ ],
455
+ "properties": {
456
+ "kind": {
457
+ "type": "string",
458
+ "const": "diff"
459
+ },
460
+ "surface": {
461
+ "type": "string",
462
+ "pattern": "^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$"
463
+ }
464
+ }
465
+ },
466
+ {
467
+ "type": "object",
468
+ "required": [
469
+ "kind",
470
+ "artifactId"
471
+ ],
472
+ "properties": {
473
+ "kind": {
474
+ "type": "string",
475
+ "const": "artifact"
476
+ },
477
+ "artifactId": {
478
+ "type": "string",
479
+ "pattern": "^art_[0-9a-f]{32}$"
480
+ },
481
+ "maxBytes": {
482
+ "type": "integer",
483
+ "minimum": 1,
484
+ "maximum": 3145728,
485
+ "default": 1048576
486
+ },
487
+ "offset": {
488
+ "type": "integer",
489
+ "minimum": 0
490
+ }
491
+ }
492
+ }
493
+ ]
494
+ }
495
+ }
496
+ }
497
+ }
498
+ },
499
+ {
500
+ "title": "tail",
501
+ "properties": {
502
+ "type": {
503
+ "const": "tail"
504
+ },
505
+ "payload": {
506
+ "type": "object",
507
+ "required": [
508
+ "follow",
509
+ "ephemeral"
510
+ ],
511
+ "properties": {
512
+ "sinceSequence": {
513
+ "type": "integer",
514
+ "minimum": 0
515
+ },
516
+ "replay": {
517
+ "type": "integer",
518
+ "minimum": 0
519
+ },
520
+ "follow": {
521
+ "type": "boolean"
522
+ },
523
+ "ephemeral": {
524
+ "type": "boolean"
525
+ }
526
+ }
527
+ }
528
+ }
529
+ },
530
+ {
531
+ "title": "pause",
532
+ "properties": {
533
+ "type": {
534
+ "const": "pause"
535
+ },
536
+ "payload": {
537
+ "type": "object",
538
+ "properties": {
539
+ "reason": {
540
+ "type": "string"
541
+ }
542
+ }
543
+ }
544
+ }
545
+ },
546
+ {
547
+ "title": "resume",
548
+ "properties": {
549
+ "type": {
550
+ "const": "resume"
551
+ },
552
+ "payload": {
553
+ "type": "object",
554
+ "properties": {
555
+ "acknowledge": {
556
+ "type": "string",
557
+ "const": "blocked-inspected"
558
+ },
559
+ "raiseBudgets": {
560
+ "type": "object",
561
+ "properties": {
562
+ "tokens": {
563
+ "type": "integer",
564
+ "minimum": 0
565
+ },
566
+ "modelRequests": {
567
+ "type": "integer",
568
+ "minimum": 0
569
+ },
570
+ "toolCalls": {
571
+ "type": "integer",
572
+ "minimum": 0
573
+ },
574
+ "wallClockMs": {
575
+ "type": "number",
576
+ "minimum": 0
577
+ },
578
+ "retries": {
579
+ "type": "integer",
580
+ "minimum": 0
581
+ },
582
+ "fixRounds": {
583
+ "type": "integer",
584
+ "minimum": 0
585
+ },
586
+ "contextTokens": {
587
+ "type": "integer",
588
+ "minimum": 0
589
+ },
590
+ "concurrentAgents": {
591
+ "type": "integer",
592
+ "minimum": 0
593
+ },
594
+ "estimatedQuotaPercent": {
595
+ "type": "number",
596
+ "minimum": 0
597
+ }
598
+ }
599
+ },
600
+ "takeover": {
601
+ "type": "boolean"
602
+ }
603
+ }
604
+ }
605
+ }
606
+ },
607
+ {
608
+ "title": "cancel",
609
+ "properties": {
610
+ "type": {
611
+ "const": "cancel"
612
+ },
613
+ "payload": {
614
+ "type": "object",
615
+ "required": [
616
+ "keepWorktrees"
617
+ ],
618
+ "properties": {
619
+ "reason": {
620
+ "type": "string"
621
+ },
622
+ "keepWorktrees": {
623
+ "type": "boolean"
624
+ }
625
+ }
626
+ }
627
+ }
628
+ },
629
+ {
630
+ "title": "approve",
631
+ "properties": {
632
+ "type": {
633
+ "const": "approve"
634
+ },
635
+ "payload": {
636
+ "type": "object",
637
+ "required": [
638
+ "approvalId",
639
+ "scope"
640
+ ],
641
+ "properties": {
642
+ "approvalId": {
643
+ "type": "string",
644
+ "pattern": "^apr_[0-9a-f]{32}$"
645
+ },
646
+ "scope": {
647
+ "type": "string",
648
+ "enum": [
649
+ "once",
650
+ "run"
651
+ ]
652
+ },
653
+ "answer": {
654
+ "type": "string"
655
+ },
656
+ "note": {
657
+ "type": "string"
658
+ }
659
+ }
660
+ }
661
+ }
662
+ },
663
+ {
664
+ "title": "deny",
665
+ "properties": {
666
+ "type": {
667
+ "const": "deny"
668
+ },
669
+ "payload": {
670
+ "type": "object",
671
+ "required": [
672
+ "approvalId"
673
+ ],
674
+ "properties": {
675
+ "approvalId": {
676
+ "type": "string",
677
+ "pattern": "^apr_[0-9a-f]{32}$"
678
+ },
679
+ "note": {
680
+ "type": "string"
681
+ }
682
+ }
683
+ }
684
+ }
685
+ },
686
+ {
687
+ "title": "retry",
688
+ "properties": {
689
+ "type": {
690
+ "const": "retry"
691
+ },
692
+ "payload": {
693
+ "type": "object",
694
+ "required": [
695
+ "target"
696
+ ],
697
+ "properties": {
698
+ "target": {
699
+ "anyOf": [
700
+ {
701
+ "type": "object",
702
+ "required": [
703
+ "kind"
704
+ ],
705
+ "properties": {
706
+ "kind": {
707
+ "type": "string",
708
+ "const": "phase"
709
+ },
710
+ "state": {
711
+ "type": "string",
712
+ "enum": [
713
+ "BRAINSTORM",
714
+ "SPEC",
715
+ "PREFLIGHT",
716
+ "BUILD",
717
+ "TEST",
718
+ "REVIEW",
719
+ "FIX",
720
+ "SHIP"
721
+ ]
722
+ }
723
+ }
724
+ },
725
+ {
726
+ "type": "object",
727
+ "required": [
728
+ "kind",
729
+ "agentId"
730
+ ],
731
+ "properties": {
732
+ "kind": {
733
+ "type": "string",
734
+ "const": "agent"
735
+ },
736
+ "agentId": {
737
+ "type": "string",
738
+ "maxLength": 128,
739
+ "pattern": "^agt_[A-Za-z0-9.-]+_[A-Za-z0-9_.-]+$"
740
+ }
741
+ }
742
+ }
743
+ ]
744
+ }
745
+ }
746
+ }
747
+ }
748
+ },
749
+ {
750
+ "title": "skip",
751
+ "properties": {
752
+ "type": {
753
+ "const": "skip"
754
+ },
755
+ "payload": {
756
+ "type": "object",
757
+ "required": [
758
+ "phase",
759
+ "justification"
760
+ ],
761
+ "properties": {
762
+ "phase": {
763
+ "type": "string",
764
+ "enum": [
765
+ "BRAINSTORM",
766
+ "SPEC",
767
+ "PREFLIGHT",
768
+ "BUILD",
769
+ "TEST",
770
+ "REVIEW",
771
+ "FIX",
772
+ "SHIP"
773
+ ]
774
+ },
775
+ "justification": {
776
+ "type": "string",
777
+ "minLength": 1
778
+ }
779
+ }
780
+ }
781
+ }
782
+ },
783
+ {
784
+ "title": "run-tool",
785
+ "properties": {
786
+ "type": {
787
+ "const": "run-tool"
788
+ },
789
+ "payload": {
790
+ "type": "object",
791
+ "required": [
792
+ "tool",
793
+ "input",
794
+ "justification"
795
+ ],
796
+ "properties": {
797
+ "agentId": {
798
+ "type": "string",
799
+ "maxLength": 128,
800
+ "pattern": "^agt_[A-Za-z0-9.-]+_[A-Za-z0-9_.-]+$"
801
+ },
802
+ "tool": {
803
+ "type": "string",
804
+ "minLength": 1
805
+ },
806
+ "input": {
807
+ "$ref": "#/$defs/JsonValue"
808
+ },
809
+ "justification": {
810
+ "type": "string",
811
+ "minLength": 1
812
+ }
813
+ }
814
+ }
815
+ }
816
+ },
817
+ {
818
+ "title": "reconcile",
819
+ "properties": {
820
+ "type": {
821
+ "const": "reconcile"
822
+ },
823
+ "payload": {
824
+ "type": "object",
825
+ "required": [
826
+ "mode"
827
+ ],
828
+ "properties": {
829
+ "mode": {
830
+ "type": "string",
831
+ "enum": [
832
+ "plan",
833
+ "apply"
834
+ ]
835
+ }
836
+ }
837
+ }
838
+ }
839
+ },
840
+ {
841
+ "title": "shutdown",
842
+ "properties": {
843
+ "type": {
844
+ "const": "shutdown"
845
+ },
846
+ "payload": {
847
+ "type": "object",
848
+ "required": [
849
+ "graceMs"
850
+ ],
851
+ "properties": {
852
+ "graceMs": {
853
+ "type": "integer",
854
+ "minimum": 0
855
+ }
856
+ }
857
+ }
858
+ }
859
+ },
860
+ {
861
+ "title": "agent.send",
862
+ "properties": {
863
+ "type": {
864
+ "const": "agent.send"
865
+ },
866
+ "payload": {
867
+ "type": "object",
868
+ "required": [
869
+ "agentId",
870
+ "text",
871
+ "delivery"
872
+ ],
873
+ "properties": {
874
+ "agentId": {
875
+ "type": "string",
876
+ "maxLength": 128,
877
+ "pattern": "^agt_[A-Za-z0-9.-]+_[A-Za-z0-9_.-]+$"
878
+ },
879
+ "text": {
880
+ "type": "string"
881
+ },
882
+ "delivery": {
883
+ "type": "string",
884
+ "enum": [
885
+ "steer",
886
+ "follow-up"
887
+ ]
888
+ }
889
+ }
890
+ }
891
+ }
892
+ },
893
+ {
894
+ "title": "a type added by a later minor version: readers MUST ignore it",
895
+ "properties": {
896
+ "type": {
897
+ "not": {
898
+ "enum": [
899
+ "start",
900
+ "status",
901
+ "inspect",
902
+ "tail",
903
+ "pause",
904
+ "resume",
905
+ "cancel",
906
+ "approve",
907
+ "deny",
908
+ "retry",
909
+ "skip",
910
+ "run-tool",
911
+ "reconcile",
912
+ "shutdown",
913
+ "agent.send"
914
+ ]
915
+ }
916
+ }
917
+ }
918
+ }
919
+ ],
920
+ "$defs": {
921
+ "JsonValue": {
922
+ "anyOf": [
923
+ {
924
+ "type": "null"
925
+ },
926
+ {
927
+ "type": "boolean"
928
+ },
929
+ {
930
+ "type": "number"
931
+ },
932
+ {
933
+ "type": "string"
934
+ },
935
+ {
936
+ "type": "array",
937
+ "items": {
938
+ "$ref": "#/$defs/JsonValue"
939
+ }
940
+ },
941
+ {
942
+ "type": "object",
943
+ "patternProperties": {
944
+ "^.*$": {
945
+ "$ref": "#/$defs/JsonValue"
946
+ }
947
+ }
948
+ }
949
+ ]
950
+ }
951
+ }
952
+ }