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