wicked-crew 0.7.40 → 0.7.45

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 (360) hide show
  1. package/dist/api/audit.d.ts +3 -0
  2. package/dist/api/audit.d.ts.map +1 -1
  3. package/dist/api/audit.js +2 -0
  4. package/dist/api/audit.js.map +1 -1
  5. package/dist/api/capture.d.ts +149 -0
  6. package/dist/api/capture.d.ts.map +1 -0
  7. package/dist/api/capture.js +330 -0
  8. package/dist/api/capture.js.map +1 -0
  9. package/dist/api/chat-citations.d.ts +174 -0
  10. package/dist/api/chat-citations.d.ts.map +1 -0
  11. package/dist/api/chat-citations.js +528 -0
  12. package/dist/api/chat-citations.js.map +1 -0
  13. package/dist/api/chat-transcripts.d.ts +20 -1
  14. package/dist/api/chat-transcripts.d.ts.map +1 -1
  15. package/dist/api/chat-transcripts.js +29 -0
  16. package/dist/api/chat-transcripts.js.map +1 -1
  17. package/dist/api/delivery-cache.d.ts +2 -2
  18. package/dist/api/delivery-freeze.d.ts +66 -0
  19. package/dist/api/delivery-freeze.d.ts.map +1 -0
  20. package/dist/api/delivery-freeze.js +104 -0
  21. package/dist/api/delivery-freeze.js.map +1 -0
  22. package/dist/api/delivery-index.d.ts +53 -9
  23. package/dist/api/delivery-index.d.ts.map +1 -1
  24. package/dist/api/delivery-index.js +115 -22
  25. package/dist/api/delivery-index.js.map +1 -1
  26. package/dist/api/demo.d.ts +90 -0
  27. package/dist/api/demo.d.ts.map +1 -0
  28. package/dist/api/demo.js +492 -0
  29. package/dist/api/demo.js.map +1 -0
  30. package/dist/api/diagnostics.d.ts +64 -1
  31. package/dist/api/diagnostics.d.ts.map +1 -1
  32. package/dist/api/diagnostics.js +129 -1
  33. package/dist/api/diagnostics.js.map +1 -1
  34. package/dist/api/eval-sample.d.ts +6 -6
  35. package/dist/api/governance-steering.d.ts +2 -2
  36. package/dist/api/mcp.d.ts +282 -0
  37. package/dist/api/mcp.d.ts.map +1 -0
  38. package/dist/api/mcp.js +521 -0
  39. package/dist/api/mcp.js.map +1 -0
  40. package/dist/api/plan-schema.d.ts +56 -0
  41. package/dist/api/plan-schema.d.ts.map +1 -0
  42. package/dist/api/plan-schema.js +26 -0
  43. package/dist/api/plan-schema.js.map +1 -0
  44. package/dist/api/roster-standing.d.ts +15 -2
  45. package/dist/api/roster-standing.d.ts.map +1 -1
  46. package/dist/api/roster-standing.js +55 -3
  47. package/dist/api/roster-standing.js.map +1 -1
  48. package/dist/api/routes.d.ts +630 -51
  49. package/dist/api/routes.d.ts.map +1 -1
  50. package/dist/api/routes.js +738 -127
  51. package/dist/api/routes.js.map +1 -1
  52. package/dist/api/run-files.d.ts.map +1 -1
  53. package/dist/api/run-files.js +31 -2
  54. package/dist/api/run-files.js.map +1 -1
  55. package/dist/api/run-liveness.d.ts +41 -0
  56. package/dist/api/run-liveness.d.ts.map +1 -0
  57. package/dist/api/run-liveness.js +166 -0
  58. package/dist/api/run-liveness.js.map +1 -0
  59. package/dist/api/seat-health.d.ts.map +1 -1
  60. package/dist/api/seat-health.js +20 -4
  61. package/dist/api/seat-health.js.map +1 -1
  62. package/dist/api/seat-probe.d.ts +141 -0
  63. package/dist/api/seat-probe.d.ts.map +1 -0
  64. package/dist/api/seat-probe.js +257 -0
  65. package/dist/api/seat-probe.js.map +1 -0
  66. package/dist/api/seat-record.d.ts +40 -0
  67. package/dist/api/seat-record.d.ts.map +1 -0
  68. package/dist/api/seat-record.js +218 -0
  69. package/dist/api/seat-record.js.map +1 -0
  70. package/dist/api/seat-signin.d.ts.map +1 -1
  71. package/dist/api/seat-signin.js +3 -1
  72. package/dist/api/seat-signin.js.map +1 -1
  73. package/dist/api/seat-standing.d.ts +24 -4
  74. package/dist/api/seat-standing.d.ts.map +1 -1
  75. package/dist/api/seat-standing.js +50 -3
  76. package/dist/api/seat-standing.js.map +1 -1
  77. package/dist/api/server.d.ts +34 -48
  78. package/dist/api/server.d.ts.map +1 -1
  79. package/dist/api/server.js +283 -107
  80. package/dist/api/server.js.map +1 -1
  81. package/dist/api/skills.d.ts +3 -1
  82. package/dist/api/skills.d.ts.map +1 -1
  83. package/dist/api/skills.js +7 -2
  84. package/dist/api/skills.js.map +1 -1
  85. package/dist/api/stall-watchdog.d.ts +34 -3
  86. package/dist/api/stall-watchdog.d.ts.map +1 -1
  87. package/dist/api/stall-watchdog.js +107 -8
  88. package/dist/api/stall-watchdog.js.map +1 -1
  89. package/dist/api/steering-landing.d.ts +6 -6
  90. package/dist/api/steering-landing.d.ts.map +1 -1
  91. package/dist/api/steering-landing.js +7 -9
  92. package/dist/api/steering-landing.js.map +1 -1
  93. package/dist/api/testing.d.ts +6 -4
  94. package/dist/api/testing.d.ts.map +1 -1
  95. package/dist/api/testing.js +82 -47
  96. package/dist/api/testing.js.map +1 -1
  97. package/dist/campaign/boot-resume.d.ts +34 -0
  98. package/dist/campaign/boot-resume.d.ts.map +1 -0
  99. package/dist/campaign/boot-resume.js +45 -0
  100. package/dist/campaign/boot-resume.js.map +1 -0
  101. package/dist/campaigns/rollup.d.ts +4 -1
  102. package/dist/campaigns/rollup.d.ts.map +1 -1
  103. package/dist/campaigns/rollup.js +6 -1
  104. package/dist/campaigns/rollup.js.map +1 -1
  105. package/dist/campaigns/routes.d.ts +2 -2
  106. package/dist/cli/bearer.d.ts +27 -1
  107. package/dist/cli/bearer.d.ts.map +1 -1
  108. package/dist/cli/bearer.js +62 -2
  109. package/dist/cli/bearer.js.map +1 -1
  110. package/dist/cli/governance.d.ts +11 -0
  111. package/dist/cli/governance.d.ts.map +1 -1
  112. package/dist/cli/governance.js +8 -2
  113. package/dist/cli/governance.js.map +1 -1
  114. package/dist/cli/index.d.ts.map +1 -1
  115. package/dist/cli/index.js +140 -75
  116. package/dist/cli/index.js.map +1 -1
  117. package/dist/cli/mcp.d.ts +11 -0
  118. package/dist/cli/mcp.d.ts.map +1 -1
  119. package/dist/cli/mcp.js +40 -9
  120. package/dist/cli/mcp.js.map +1 -1
  121. package/dist/cli/service.d.ts +78 -0
  122. package/dist/cli/service.d.ts.map +1 -0
  123. package/dist/cli/service.js +334 -0
  124. package/dist/cli/service.js.map +1 -0
  125. package/dist/core/adapter.d.ts +238 -12
  126. package/dist/core/adapter.d.ts.map +1 -1
  127. package/dist/core/adapter.js +619 -157
  128. package/dist/core/adapter.js.map +1 -1
  129. package/dist/core/bridge-reaper.d.ts +4 -1
  130. package/dist/core/bridge-reaper.d.ts.map +1 -1
  131. package/dist/core/bridge-reaper.js +15 -1
  132. package/dist/core/bridge-reaper.js.map +1 -1
  133. package/dist/core/bus-notice.d.ts +27 -0
  134. package/dist/core/bus-notice.d.ts.map +1 -0
  135. package/dist/core/bus-notice.js +24 -0
  136. package/dist/core/bus-notice.js.map +1 -0
  137. package/dist/core/bus.d.ts +99 -0
  138. package/dist/core/bus.d.ts.map +1 -0
  139. package/dist/core/bus.js +176 -0
  140. package/dist/core/bus.js.map +1 -0
  141. package/dist/core/deliver-exclusions.d.ts +71 -0
  142. package/dist/core/deliver-exclusions.d.ts.map +1 -0
  143. package/dist/core/deliver-exclusions.js +110 -0
  144. package/dist/core/deliver-exclusions.js.map +1 -0
  145. package/dist/core/deliver-text.d.ts +61 -14
  146. package/dist/core/deliver-text.d.ts.map +1 -1
  147. package/dist/core/deliver-text.js +178 -30
  148. package/dist/core/deliver-text.js.map +1 -1
  149. package/dist/core/deliver-triage.d.ts +11 -2
  150. package/dist/core/deliver-triage.d.ts.map +1 -1
  151. package/dist/core/deliver-triage.js +19 -1
  152. package/dist/core/deliver-triage.js.map +1 -1
  153. package/dist/core/deliver.d.ts +161 -3
  154. package/dist/core/deliver.d.ts.map +1 -1
  155. package/dist/core/deliver.js +463 -25
  156. package/dist/core/deliver.js.map +1 -1
  157. package/dist/core/deliverable-floor.d.ts.map +1 -1
  158. package/dist/core/deliverable-floor.js +5 -7
  159. package/dist/core/deliverable-floor.js.map +1 -1
  160. package/dist/core/engine-bus.d.ts +40 -0
  161. package/dist/core/engine-bus.d.ts.map +1 -0
  162. package/dist/core/engine-bus.js +27 -0
  163. package/dist/core/engine-bus.js.map +1 -0
  164. package/dist/core/estate-mcp-client.d.ts +87 -5
  165. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  166. package/dist/core/estate-mcp-client.js +90 -11
  167. package/dist/core/estate-mcp-client.js.map +1 -1
  168. package/dist/core/linked-issues.d.ts +46 -0
  169. package/dist/core/linked-issues.d.ts.map +1 -0
  170. package/dist/core/linked-issues.js +123 -0
  171. package/dist/core/linked-issues.js.map +1 -0
  172. package/dist/core/run-identity.d.ts +100 -0
  173. package/dist/core/run-identity.d.ts.map +1 -0
  174. package/dist/core/run-identity.js +178 -0
  175. package/dist/core/run-identity.js.map +1 -0
  176. package/dist/core/shutdown.d.ts +16 -0
  177. package/dist/core/shutdown.d.ts.map +1 -0
  178. package/dist/core/shutdown.js +39 -0
  179. package/dist/core/shutdown.js.map +1 -0
  180. package/dist/core/types.d.ts +15 -1
  181. package/dist/core/types.d.ts.map +1 -1
  182. package/dist/core/types.js +4 -0
  183. package/dist/core/types.js.map +1 -1
  184. package/dist/interactive/bridge-pool.d.ts +67 -3
  185. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  186. package/dist/interactive/bridge-pool.js +129 -13
  187. package/dist/interactive/bridge-pool.js.map +1 -1
  188. package/dist/interactive/bridge-root.d.ts +9 -0
  189. package/dist/interactive/bridge-root.d.ts.map +1 -1
  190. package/dist/interactive/bridge-root.js +11 -4
  191. package/dist/interactive/bridge-root.js.map +1 -1
  192. package/dist/interactive/chat-events.d.ts +14 -9
  193. package/dist/interactive/chat-events.d.ts.map +1 -1
  194. package/dist/interactive/chat-events.js +55 -57
  195. package/dist/interactive/chat-events.js.map +1 -1
  196. package/dist/interactive/council-outcome.d.ts +1 -0
  197. package/dist/interactive/council-outcome.d.ts.map +1 -1
  198. package/dist/interactive/council-outcome.js +33 -0
  199. package/dist/interactive/council-outcome.js.map +1 -1
  200. package/dist/interactive/draft-events.d.ts +36 -17
  201. package/dist/interactive/draft-events.d.ts.map +1 -1
  202. package/dist/interactive/draft-events.js +121 -92
  203. package/dist/interactive/draft-events.js.map +1 -1
  204. package/dist/interactive/draft-skill.d.ts +59 -0
  205. package/dist/interactive/draft-skill.d.ts.map +1 -1
  206. package/dist/interactive/draft-skill.js +233 -0
  207. package/dist/interactive/draft-skill.js.map +1 -1
  208. package/dist/interactive/edit-events.d.ts +1 -14
  209. package/dist/interactive/edit-events.d.ts.map +1 -1
  210. package/dist/interactive/edit-events.js +37 -70
  211. package/dist/interactive/edit-events.js.map +1 -1
  212. package/dist/interactive/proxy-routes.d.ts +2 -2
  213. package/dist/interactive/proxy-routes.d.ts.map +1 -1
  214. package/dist/interactive/proxy-routes.js +4 -13
  215. package/dist/interactive/proxy-routes.js.map +1 -1
  216. package/dist/interactive/ws-relay.d.ts +9 -10
  217. package/dist/interactive/ws-relay.d.ts.map +1 -1
  218. package/dist/interactive/ws-relay.js +23 -50
  219. package/dist/interactive/ws-relay.js.map +1 -1
  220. package/dist/mcp/broker.d.ts +88 -0
  221. package/dist/mcp/broker.d.ts.map +1 -0
  222. package/dist/mcp/broker.js +307 -0
  223. package/dist/mcp/broker.js.map +1 -0
  224. package/dist/mcp/call-records.d.ts +61 -0
  225. package/dist/mcp/call-records.d.ts.map +1 -0
  226. package/dist/mcp/call-records.js +135 -0
  227. package/dist/mcp/call-records.js.map +1 -0
  228. package/dist/mcp/classify.d.ts +45 -0
  229. package/dist/mcp/classify.d.ts.map +1 -0
  230. package/dist/mcp/classify.js +83 -0
  231. package/dist/mcp/classify.js.map +1 -0
  232. package/dist/mcp/discovery.d.ts +24 -0
  233. package/dist/mcp/discovery.d.ts.map +1 -0
  234. package/dist/mcp/discovery.js +78 -0
  235. package/dist/mcp/discovery.js.map +1 -0
  236. package/dist/mcp/invoke.d.ts +36 -0
  237. package/dist/mcp/invoke.d.ts.map +1 -0
  238. package/dist/mcp/invoke.js +80 -0
  239. package/dist/mcp/invoke.js.map +1 -0
  240. package/dist/mcp/policies.d.ts +110 -0
  241. package/dist/mcp/policies.d.ts.map +1 -0
  242. package/dist/mcp/policies.js +400 -0
  243. package/dist/mcp/policies.js.map +1 -0
  244. package/dist/mcp/probe.d.ts +66 -0
  245. package/dist/mcp/probe.d.ts.map +1 -0
  246. package/dist/mcp/probe.js +116 -0
  247. package/dist/mcp/probe.js.map +1 -0
  248. package/dist/mcp/redact.d.ts +34 -0
  249. package/dist/mcp/redact.d.ts.map +1 -0
  250. package/dist/mcp/redact.js +84 -0
  251. package/dist/mcp/redact.js.map +1 -0
  252. package/dist/mcp/registry-store.d.ts +69 -0
  253. package/dist/mcp/registry-store.d.ts.map +1 -0
  254. package/dist/mcp/registry-store.js +82 -0
  255. package/dist/mcp/registry-store.js.map +1 -0
  256. package/dist/mcp/registry.d.ts +147 -0
  257. package/dist/mcp/registry.d.ts.map +1 -0
  258. package/dist/mcp/registry.js +509 -0
  259. package/dist/mcp/registry.js.map +1 -0
  260. package/dist/mcp/rest.d.ts +111 -0
  261. package/dist/mcp/rest.d.ts.map +1 -0
  262. package/dist/mcp/rest.js +606 -0
  263. package/dist/mcp/rest.js.map +1 -0
  264. package/dist/mcp/secrets.d.ts +66 -0
  265. package/dist/mcp/secrets.d.ts.map +1 -0
  266. package/dist/mcp/secrets.js +180 -0
  267. package/dist/mcp/secrets.js.map +1 -0
  268. package/dist/mcp/tool-list.d.ts +25 -0
  269. package/dist/mcp/tool-list.d.ts.map +1 -0
  270. package/dist/mcp/tool-list.js +62 -0
  271. package/dist/mcp/tool-list.js.map +1 -0
  272. package/dist/mcp/upstream-error.d.ts +12 -0
  273. package/dist/mcp/upstream-error.d.ts.map +1 -0
  274. package/dist/mcp/upstream-error.js +14 -0
  275. package/dist/mcp/upstream-error.js.map +1 -0
  276. package/dist/mcp/usage.d.ts +31 -0
  277. package/dist/mcp/usage.d.ts.map +1 -0
  278. package/dist/mcp/usage.js +159 -0
  279. package/dist/mcp/usage.js.map +1 -0
  280. package/dist/presets/routes.d.ts +53 -0
  281. package/dist/presets/routes.d.ts.map +1 -0
  282. package/dist/presets/routes.js +115 -0
  283. package/dist/presets/routes.js.map +1 -0
  284. package/dist/projects/activity.d.ts +6 -18
  285. package/dist/projects/activity.d.ts.map +1 -1
  286. package/dist/projects/activity.js +17 -60
  287. package/dist/projects/activity.js.map +1 -1
  288. package/dist/projects/events.d.ts +6 -5
  289. package/dist/projects/events.d.ts.map +1 -1
  290. package/dist/projects/events.js +33 -58
  291. package/dist/projects/events.js.map +1 -1
  292. package/dist/projects/routes.d.ts.map +1 -1
  293. package/dist/projects/routes.js +19 -0
  294. package/dist/projects/routes.js.map +1 -1
  295. package/dist/projects/state-home-preflight.d.ts.map +1 -1
  296. package/dist/projects/state-home-preflight.js +7 -0
  297. package/dist/projects/state-home-preflight.js.map +1 -1
  298. package/dist/projects/state-home-registry.d.ts.map +1 -1
  299. package/dist/projects/state-home-registry.js +9 -1
  300. package/dist/projects/state-home-registry.js.map +1 -1
  301. package/dist/qe/acceptance.d.ts +28 -28
  302. package/dist/qe/acceptance.d.ts.map +1 -1
  303. package/dist/qe/acceptance.js +60 -61
  304. package/dist/qe/acceptance.js.map +1 -1
  305. package/dist/qe/test-sets.d.ts +3 -5
  306. package/dist/qe/test-sets.d.ts.map +1 -1
  307. package/dist/qe/test-sets.js +5 -7
  308. package/dist/qe/test-sets.js.map +1 -1
  309. package/dist/skills/installed.d.ts +51 -0
  310. package/dist/skills/installed.d.ts.map +1 -0
  311. package/dist/skills/installed.js +46 -0
  312. package/dist/skills/installed.js.map +1 -0
  313. package/dist/standing-orders/evaluator.d.ts +113 -0
  314. package/dist/standing-orders/evaluator.d.ts.map +1 -0
  315. package/dist/standing-orders/evaluator.js +225 -0
  316. package/dist/standing-orders/evaluator.js.map +1 -0
  317. package/dist/standing-orders/history.d.ts +58 -0
  318. package/dist/standing-orders/history.d.ts.map +1 -0
  319. package/dist/standing-orders/history.js +117 -0
  320. package/dist/standing-orders/history.js.map +1 -0
  321. package/dist/standing-orders/parse.d.ts +19 -0
  322. package/dist/standing-orders/parse.d.ts.map +1 -0
  323. package/dist/standing-orders/parse.js +75 -0
  324. package/dist/standing-orders/parse.js.map +1 -0
  325. package/dist/standing-orders/routes.d.ts +180 -0
  326. package/dist/standing-orders/routes.d.ts.map +1 -0
  327. package/dist/standing-orders/routes.js +95 -0
  328. package/dist/standing-orders/routes.js.map +1 -0
  329. package/dist/standing-orders/store.d.ts +154 -0
  330. package/dist/standing-orders/store.d.ts.map +1 -0
  331. package/dist/standing-orders/store.js +189 -0
  332. package/dist/standing-orders/store.js.map +1 -0
  333. package/dist/studio/assets/index-CvV5qITf.css +32 -0
  334. package/dist/studio/assets/index-jCOy6Ns7.js +568 -0
  335. package/dist/studio/index.html +3 -3
  336. package/dist/studio/testid-inventory.json +3274 -894
  337. package/dist/team/key.d.ts +5 -0
  338. package/dist/team/key.d.ts.map +1 -0
  339. package/dist/team/key.js +21 -0
  340. package/dist/team/key.js.map +1 -0
  341. package/dist/team/routes.d.ts +196 -0
  342. package/dist/team/routes.d.ts.map +1 -0
  343. package/dist/team/routes.js +274 -0
  344. package/dist/team/routes.js.map +1 -0
  345. package/dist/team/ws-relay.d.ts +39 -0
  346. package/dist/team/ws-relay.d.ts.map +1 -0
  347. package/dist/team/ws-relay.js +63 -0
  348. package/dist/team/ws-relay.js.map +1 -0
  349. package/endpoint-manifest.json +502 -6
  350. package/package.json +6 -6
  351. package/dist/interactive/demo-events.d.ts +0 -367
  352. package/dist/interactive/demo-events.d.ts.map +0 -1
  353. package/dist/interactive/demo-events.js +0 -1293
  354. package/dist/interactive/demo-events.js.map +0 -1
  355. package/dist/qe/gate-events.d.ts +0 -113
  356. package/dist/qe/gate-events.d.ts.map +0 -1
  357. package/dist/qe/gate-events.js +0 -172
  358. package/dist/qe/gate-events.js.map +0 -1
  359. package/dist/studio/assets/index-Bg7Z3BR-.css +0 -32
  360. package/dist/studio/assets/index-BvOFMjf9.js +0 -554
@@ -1,11 +1,11 @@
1
1
  import type { FastifyInstance } from 'fastify';
2
+ import { PlanSchema } from './plan-schema.js';
2
3
  import type { RecordedStallFrame } from './stall-frame-index.js';
3
4
  import { z } from 'zod';
4
5
  import { CoreAdapter } from '../core/adapter.js';
5
6
  import type { CodeGraphData, CoreEvent, RepoFinding } from '../core/types.js';
6
7
  import { type GateCache } from './gate-cache.js';
7
8
  import type { ElicitationCache } from './elicitation-cache.js';
8
- import { QeGateCache } from '../qe/gate-events.js';
9
9
  import type { ConformanceRule, SessionView, SteeringType } from '../core/types.js';
10
10
  import { SeatHealthTracker } from './seat-health.js';
11
11
  import { type RosterWithStanding } from './roster-standing.js';
@@ -16,6 +16,9 @@ import { DocRunIndex } from '../interactive/doc-run-index.js';
16
16
  import { TestSetIndex } from '../qe/test-sets.js';
17
17
  import { parseEstateTotals } from '../projects/graph.js';
18
18
  import { type ProjectRoutesDeps } from '../projects/routes.js';
19
+ import type { McpBroker } from '../mcp/broker.js';
20
+ import type { McpCallRecordSource } from '../mcp/call-records.js';
21
+ import type { McpRegistry } from '../mcp/registry.js';
19
22
  import { type SkillsRuntime } from '../skills/runtime.js';
20
23
  import { type PhaseSkillArming, type RunSkillGapIndex } from '../skills/phase-skill-gaps.js';
21
24
  import { type StateHomeWatch } from '../projects/state-home-preflight.js';
@@ -24,9 +27,11 @@ import { InteractiveBridgePool } from '../interactive/bridge-pool.js';
24
27
  import { type PullRequestResolution } from '../core/deliver.js';
25
28
  import type { DocGroundingStore } from '../interactive/doc-grounding.js';
26
29
  import type { DocLedgerSweep } from '../interactive/doc-ledger-sweep.js';
30
+ import { type LinkedIssuesResult } from '../core/linked-issues.js';
27
31
  import { AuditLog } from './audit.js';
28
32
  import { type ErrorRing } from './diagnostics.js';
29
33
  import { RetryIndex } from './retry-index.js';
34
+ import { DeliveryFreeze } from './delivery-freeze.js';
30
35
  import { GroupIndex } from './group-index.js';
31
36
  import { RunTimingIndex } from './run-timing-index.js';
32
37
  import { GuidanceIndex } from './guidance-index.js';
@@ -35,6 +40,10 @@ import { DeliveryDerivationCache } from './delivery-cache.js';
35
40
  import { type DeliverExec, type WorktreeReprovisioner } from './post-hoc-deliver.js';
36
41
  import { type AuthMode } from './auth.js';
37
42
  export { API_PREFIX } from './api-prefix.js';
43
+ /** How long `GET /health` waits on the engine's actor before answering `ping: "busy"` (crew#471). */
44
+ export declare const HEALTH_PING_WAIT_MS = 1000;
45
+ /** `HealthResponse.ping` while the engine's actor is occupied: the daemon serves, the engine is busy. */
46
+ export declare const ENGINE_BUSY_PING = "busy";
38
47
  /**
39
48
  * `codeGraphDb(repo)` for a repo surface, or `null` after answering **503** — a CURRENT engine that
40
49
  * resolved no repo-graph root (`code_graph_root_unresolvable`, wicked-core#406) is a daemon-
@@ -91,7 +100,8 @@ export declare function policyProposalToRule(proposalId: string, kindType: strin
91
100
  * schema does not accept — so `.strict()` is what turns that trip into a 400 instead of an
92
101
  * unworkflowed run reported as `201`.
93
102
  */
94
- export declare const LaunchSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
103
+ export { PlanSchema };
104
+ export declare const LaunchSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
95
105
  problem: z.ZodString;
96
106
  sessionId: z.ZodOptional<z.ZodString>;
97
107
  clisJson: z.ZodOptional<z.ZodString>;
@@ -99,6 +109,52 @@ export declare const LaunchSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodE
99
109
  humanConfirm: z.ZodOptional<z.ZodString>;
100
110
  repoRef: z.ZodOptional<z.ZodString>;
101
111
  workflow: z.ZodOptional<z.ZodString>;
112
+ /** DES-TEAMING-002 T3 — a user-composed plan (`LaunchRunBody.plan`), forwarded to the engine,
113
+ * which publishes `plan.proposed{by:"human"}` and holds it at a `plan_approval` gate when the
114
+ * approval matrix says so. Mutually exclusive with `workflow` (refine below). */
115
+ plan: z.ZodOptional<z.ZodObject<{
116
+ steps: z.ZodArray<z.ZodObject<{
117
+ catalog: z.ZodString;
118
+ id: z.ZodOptional<z.ZodString>;
119
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
120
+ catalog: z.ZodString;
121
+ id: z.ZodOptional<z.ZodString>;
122
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
123
+ catalog: z.ZodString;
124
+ id: z.ZodOptional<z.ZodString>;
125
+ }, z.ZodTypeAny, "passthrough">>, "many">;
126
+ touch: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
127
+ override: z.ZodOptional<z.ZodObject<{
128
+ remove: z.ZodArray<z.ZodString, "many">;
129
+ reason: z.ZodString;
130
+ }, "strict", z.ZodTypeAny, {
131
+ reason: string;
132
+ remove: string[];
133
+ }, {
134
+ reason: string;
135
+ remove: string[];
136
+ }>>;
137
+ }, "strict", z.ZodTypeAny, {
138
+ steps: z.objectOutputType<{
139
+ catalog: z.ZodString;
140
+ id: z.ZodOptional<z.ZodString>;
141
+ }, z.ZodTypeAny, "passthrough">[];
142
+ override?: {
143
+ reason: string;
144
+ remove: string[];
145
+ } | undefined;
146
+ touch?: string[] | undefined;
147
+ }, {
148
+ steps: z.objectInputType<{
149
+ catalog: z.ZodString;
150
+ id: z.ZodOptional<z.ZodString>;
151
+ }, z.ZodTypeAny, "passthrough">[];
152
+ override?: {
153
+ reason: string;
154
+ remove: string[];
155
+ } | undefined;
156
+ touch?: string[] | undefined;
157
+ }>>;
102
158
  /** DES-PROJECT-001 §2.2 — file the run into a project; membership attaches atomically with
103
159
  * the launch record. Unknown/archived ⇒ the launch fails (never a silent unfiled run). */
104
160
  projectId: z.ZodOptional<z.ZodString>;
@@ -154,258 +210,750 @@ export declare const LaunchSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodE
154
210
  workflow?: string | undefined;
155
211
  deliver?: "pr" | "none" | undefined;
156
212
  revisesPr?: number | undefined;
213
+ plan?: {
214
+ steps: z.objectOutputType<{
215
+ catalog: z.ZodString;
216
+ id: z.ZodOptional<z.ZodString>;
217
+ }, z.ZodTypeAny, "passthrough">[];
218
+ override?: {
219
+ reason: string;
220
+ remove: string[];
221
+ } | undefined;
222
+ touch?: string[] | undefined;
223
+ } | undefined;
157
224
  projectId?: string | undefined;
158
225
  repoRef?: string | undefined;
159
226
  actor?: string | undefined;
227
+ sessionId?: string | undefined;
160
228
  chatId?: string | undefined;
161
229
  channel?: "cli" | "studio" | "api" | undefined;
230
+ clisJson?: string | undefined;
231
+ humanConfirm?: string | undefined;
162
232
  campaignId?: string | undefined;
163
233
  groupLabel?: string | undefined;
164
- clisJson?: string | undefined;
165
- sessionId?: string | undefined;
166
234
  retryOf?: string | undefined;
167
235
  entityMode?: "shared" | "isolated" | undefined;
168
- humanConfirm?: string | undefined;
169
236
  deliverGate?: "auto" | "human" | undefined;
170
237
  }, {
171
238
  problem: string;
172
239
  workflow?: string | undefined;
173
240
  deliver?: "pr" | "none" | undefined;
174
241
  revisesPr?: number | undefined;
242
+ plan?: {
243
+ steps: z.objectInputType<{
244
+ catalog: z.ZodString;
245
+ id: z.ZodOptional<z.ZodString>;
246
+ }, z.ZodTypeAny, "passthrough">[];
247
+ override?: {
248
+ reason: string;
249
+ remove: string[];
250
+ } | undefined;
251
+ touch?: string[] | undefined;
252
+ } | undefined;
175
253
  projectId?: string | undefined;
176
254
  repoRef?: string | undefined;
177
255
  actor?: string | undefined;
256
+ sessionId?: string | undefined;
178
257
  chatId?: string | undefined;
179
258
  channel?: "cli" | "studio" | "api" | undefined;
259
+ clisJson?: string | undefined;
260
+ humanConfirm?: string | undefined;
180
261
  campaignId?: string | undefined;
181
262
  groupLabel?: string | undefined;
182
- clisJson?: string | undefined;
183
- sessionId?: string | undefined;
184
263
  retryOf?: string | undefined;
185
264
  entityMode?: "shared" | "isolated" | undefined;
186
- humanConfirm?: string | undefined;
187
265
  deliverGate?: "auto" | "human" | undefined;
188
266
  }>, {
189
267
  problem: string;
190
268
  workflow?: string | undefined;
191
269
  deliver?: "pr" | "none" | undefined;
192
270
  revisesPr?: number | undefined;
271
+ plan?: {
272
+ steps: z.objectOutputType<{
273
+ catalog: z.ZodString;
274
+ id: z.ZodOptional<z.ZodString>;
275
+ }, z.ZodTypeAny, "passthrough">[];
276
+ override?: {
277
+ reason: string;
278
+ remove: string[];
279
+ } | undefined;
280
+ touch?: string[] | undefined;
281
+ } | undefined;
193
282
  projectId?: string | undefined;
194
283
  repoRef?: string | undefined;
195
284
  actor?: string | undefined;
285
+ sessionId?: string | undefined;
196
286
  chatId?: string | undefined;
197
287
  channel?: "cli" | "studio" | "api" | undefined;
288
+ clisJson?: string | undefined;
289
+ humanConfirm?: string | undefined;
198
290
  campaignId?: string | undefined;
199
291
  groupLabel?: string | undefined;
200
- clisJson?: string | undefined;
201
- sessionId?: string | undefined;
202
292
  retryOf?: string | undefined;
203
293
  entityMode?: "shared" | "isolated" | undefined;
204
- humanConfirm?: string | undefined;
205
294
  deliverGate?: "auto" | "human" | undefined;
206
295
  }, {
207
296
  problem: string;
208
297
  workflow?: string | undefined;
209
298
  deliver?: "pr" | "none" | undefined;
210
299
  revisesPr?: number | undefined;
300
+ plan?: {
301
+ steps: z.objectInputType<{
302
+ catalog: z.ZodString;
303
+ id: z.ZodOptional<z.ZodString>;
304
+ }, z.ZodTypeAny, "passthrough">[];
305
+ override?: {
306
+ reason: string;
307
+ remove: string[];
308
+ } | undefined;
309
+ touch?: string[] | undefined;
310
+ } | undefined;
211
311
  projectId?: string | undefined;
212
312
  repoRef?: string | undefined;
213
313
  actor?: string | undefined;
314
+ sessionId?: string | undefined;
214
315
  chatId?: string | undefined;
215
316
  channel?: "cli" | "studio" | "api" | undefined;
317
+ clisJson?: string | undefined;
318
+ humanConfirm?: string | undefined;
216
319
  campaignId?: string | undefined;
217
320
  groupLabel?: string | undefined;
218
- clisJson?: string | undefined;
219
- sessionId?: string | undefined;
220
321
  retryOf?: string | undefined;
221
322
  entityMode?: "shared" | "isolated" | undefined;
222
- humanConfirm?: string | undefined;
223
323
  deliverGate?: "auto" | "human" | undefined;
224
324
  }>, {
225
325
  problem: string;
226
326
  workflow?: string | undefined;
227
327
  deliver?: "pr" | "none" | undefined;
228
328
  revisesPr?: number | undefined;
329
+ plan?: {
330
+ steps: z.objectOutputType<{
331
+ catalog: z.ZodString;
332
+ id: z.ZodOptional<z.ZodString>;
333
+ }, z.ZodTypeAny, "passthrough">[];
334
+ override?: {
335
+ reason: string;
336
+ remove: string[];
337
+ } | undefined;
338
+ touch?: string[] | undefined;
339
+ } | undefined;
229
340
  projectId?: string | undefined;
230
341
  repoRef?: string | undefined;
231
342
  actor?: string | undefined;
343
+ sessionId?: string | undefined;
232
344
  chatId?: string | undefined;
233
345
  channel?: "cli" | "studio" | "api" | undefined;
346
+ clisJson?: string | undefined;
347
+ humanConfirm?: string | undefined;
234
348
  campaignId?: string | undefined;
235
349
  groupLabel?: string | undefined;
236
- clisJson?: string | undefined;
237
- sessionId?: string | undefined;
238
350
  retryOf?: string | undefined;
239
351
  entityMode?: "shared" | "isolated" | undefined;
240
- humanConfirm?: string | undefined;
241
352
  deliverGate?: "auto" | "human" | undefined;
242
353
  }, {
243
354
  problem: string;
244
355
  workflow?: string | undefined;
245
356
  deliver?: "pr" | "none" | undefined;
246
357
  revisesPr?: number | undefined;
358
+ plan?: {
359
+ steps: z.objectInputType<{
360
+ catalog: z.ZodString;
361
+ id: z.ZodOptional<z.ZodString>;
362
+ }, z.ZodTypeAny, "passthrough">[];
363
+ override?: {
364
+ reason: string;
365
+ remove: string[];
366
+ } | undefined;
367
+ touch?: string[] | undefined;
368
+ } | undefined;
247
369
  projectId?: string | undefined;
248
370
  repoRef?: string | undefined;
249
371
  actor?: string | undefined;
372
+ sessionId?: string | undefined;
250
373
  chatId?: string | undefined;
251
374
  channel?: "cli" | "studio" | "api" | undefined;
375
+ clisJson?: string | undefined;
376
+ humanConfirm?: string | undefined;
252
377
  campaignId?: string | undefined;
253
378
  groupLabel?: string | undefined;
254
- clisJson?: string | undefined;
255
- sessionId?: string | undefined;
256
379
  retryOf?: string | undefined;
257
380
  entityMode?: "shared" | "isolated" | undefined;
258
- humanConfirm?: string | undefined;
259
381
  deliverGate?: "auto" | "human" | undefined;
260
382
  }>, {
261
383
  problem: string;
262
384
  workflow?: string | undefined;
263
385
  deliver?: "pr" | "none" | undefined;
264
386
  revisesPr?: number | undefined;
387
+ plan?: {
388
+ steps: z.objectOutputType<{
389
+ catalog: z.ZodString;
390
+ id: z.ZodOptional<z.ZodString>;
391
+ }, z.ZodTypeAny, "passthrough">[];
392
+ override?: {
393
+ reason: string;
394
+ remove: string[];
395
+ } | undefined;
396
+ touch?: string[] | undefined;
397
+ } | undefined;
265
398
  projectId?: string | undefined;
266
399
  repoRef?: string | undefined;
267
400
  actor?: string | undefined;
401
+ sessionId?: string | undefined;
268
402
  chatId?: string | undefined;
269
403
  channel?: "cli" | "studio" | "api" | undefined;
404
+ clisJson?: string | undefined;
405
+ humanConfirm?: string | undefined;
270
406
  campaignId?: string | undefined;
271
407
  groupLabel?: string | undefined;
272
- clisJson?: string | undefined;
273
- sessionId?: string | undefined;
274
408
  retryOf?: string | undefined;
275
409
  entityMode?: "shared" | "isolated" | undefined;
276
- humanConfirm?: string | undefined;
277
410
  deliverGate?: "auto" | "human" | undefined;
278
411
  }, {
279
412
  problem: string;
280
413
  workflow?: string | undefined;
281
414
  deliver?: "pr" | "none" | undefined;
282
415
  revisesPr?: number | undefined;
416
+ plan?: {
417
+ steps: z.objectInputType<{
418
+ catalog: z.ZodString;
419
+ id: z.ZodOptional<z.ZodString>;
420
+ }, z.ZodTypeAny, "passthrough">[];
421
+ override?: {
422
+ reason: string;
423
+ remove: string[];
424
+ } | undefined;
425
+ touch?: string[] | undefined;
426
+ } | undefined;
283
427
  projectId?: string | undefined;
284
428
  repoRef?: string | undefined;
285
429
  actor?: string | undefined;
430
+ sessionId?: string | undefined;
286
431
  chatId?: string | undefined;
287
432
  channel?: "cli" | "studio" | "api" | undefined;
433
+ clisJson?: string | undefined;
434
+ humanConfirm?: string | undefined;
288
435
  campaignId?: string | undefined;
289
436
  groupLabel?: string | undefined;
290
- clisJson?: string | undefined;
291
- sessionId?: string | undefined;
292
437
  retryOf?: string | undefined;
293
438
  entityMode?: "shared" | "isolated" | undefined;
294
- humanConfirm?: string | undefined;
295
439
  deliverGate?: "auto" | "human" | undefined;
296
440
  }>, {
297
441
  problem: string;
298
442
  workflow?: string | undefined;
299
443
  deliver?: "pr" | "none" | undefined;
300
444
  revisesPr?: number | undefined;
445
+ plan?: {
446
+ steps: z.objectOutputType<{
447
+ catalog: z.ZodString;
448
+ id: z.ZodOptional<z.ZodString>;
449
+ }, z.ZodTypeAny, "passthrough">[];
450
+ override?: {
451
+ reason: string;
452
+ remove: string[];
453
+ } | undefined;
454
+ touch?: string[] | undefined;
455
+ } | undefined;
301
456
  projectId?: string | undefined;
302
457
  repoRef?: string | undefined;
303
458
  actor?: string | undefined;
459
+ sessionId?: string | undefined;
304
460
  chatId?: string | undefined;
305
461
  channel?: "cli" | "studio" | "api" | undefined;
462
+ clisJson?: string | undefined;
463
+ humanConfirm?: string | undefined;
306
464
  campaignId?: string | undefined;
307
465
  groupLabel?: string | undefined;
308
- clisJson?: string | undefined;
309
- sessionId?: string | undefined;
310
466
  retryOf?: string | undefined;
311
467
  entityMode?: "shared" | "isolated" | undefined;
312
- humanConfirm?: string | undefined;
313
468
  deliverGate?: "auto" | "human" | undefined;
314
469
  }, {
315
470
  problem: string;
316
471
  workflow?: string | undefined;
317
472
  deliver?: "pr" | "none" | undefined;
318
473
  revisesPr?: number | undefined;
474
+ plan?: {
475
+ steps: z.objectInputType<{
476
+ catalog: z.ZodString;
477
+ id: z.ZodOptional<z.ZodString>;
478
+ }, z.ZodTypeAny, "passthrough">[];
479
+ override?: {
480
+ reason: string;
481
+ remove: string[];
482
+ } | undefined;
483
+ touch?: string[] | undefined;
484
+ } | undefined;
319
485
  projectId?: string | undefined;
320
486
  repoRef?: string | undefined;
321
487
  actor?: string | undefined;
488
+ sessionId?: string | undefined;
322
489
  chatId?: string | undefined;
323
490
  channel?: "cli" | "studio" | "api" | undefined;
491
+ clisJson?: string | undefined;
492
+ humanConfirm?: string | undefined;
324
493
  campaignId?: string | undefined;
325
494
  groupLabel?: string | undefined;
326
- clisJson?: string | undefined;
327
- sessionId?: string | undefined;
328
495
  retryOf?: string | undefined;
329
496
  entityMode?: "shared" | "isolated" | undefined;
330
- humanConfirm?: string | undefined;
331
497
  deliverGate?: "auto" | "human" | undefined;
332
498
  }>, {
333
499
  problem: string;
334
500
  workflow?: string | undefined;
335
501
  deliver?: "pr" | "none" | undefined;
336
502
  revisesPr?: number | undefined;
503
+ plan?: {
504
+ steps: z.objectOutputType<{
505
+ catalog: z.ZodString;
506
+ id: z.ZodOptional<z.ZodString>;
507
+ }, z.ZodTypeAny, "passthrough">[];
508
+ override?: {
509
+ reason: string;
510
+ remove: string[];
511
+ } | undefined;
512
+ touch?: string[] | undefined;
513
+ } | undefined;
337
514
  projectId?: string | undefined;
338
515
  repoRef?: string | undefined;
339
516
  actor?: string | undefined;
517
+ sessionId?: string | undefined;
340
518
  chatId?: string | undefined;
341
519
  channel?: "cli" | "studio" | "api" | undefined;
520
+ clisJson?: string | undefined;
521
+ humanConfirm?: string | undefined;
342
522
  campaignId?: string | undefined;
343
523
  groupLabel?: string | undefined;
344
- clisJson?: string | undefined;
345
- sessionId?: string | undefined;
346
524
  retryOf?: string | undefined;
347
525
  entityMode?: "shared" | "isolated" | undefined;
348
- humanConfirm?: string | undefined;
349
526
  deliverGate?: "auto" | "human" | undefined;
350
527
  }, {
351
528
  problem: string;
352
529
  workflow?: string | undefined;
353
530
  deliver?: "pr" | "none" | undefined;
354
531
  revisesPr?: number | undefined;
532
+ plan?: {
533
+ steps: z.objectInputType<{
534
+ catalog: z.ZodString;
535
+ id: z.ZodOptional<z.ZodString>;
536
+ }, z.ZodTypeAny, "passthrough">[];
537
+ override?: {
538
+ reason: string;
539
+ remove: string[];
540
+ } | undefined;
541
+ touch?: string[] | undefined;
542
+ } | undefined;
355
543
  projectId?: string | undefined;
356
544
  repoRef?: string | undefined;
357
545
  actor?: string | undefined;
546
+ sessionId?: string | undefined;
358
547
  chatId?: string | undefined;
359
548
  channel?: "cli" | "studio" | "api" | undefined;
549
+ clisJson?: string | undefined;
550
+ humanConfirm?: string | undefined;
360
551
  campaignId?: string | undefined;
361
552
  groupLabel?: string | undefined;
362
- clisJson?: string | undefined;
553
+ retryOf?: string | undefined;
554
+ entityMode?: "shared" | "isolated" | undefined;
555
+ deliverGate?: "auto" | "human" | undefined;
556
+ }>, {
557
+ problem: string;
558
+ workflow?: string | undefined;
559
+ deliver?: "pr" | "none" | undefined;
560
+ revisesPr?: number | undefined;
561
+ plan?: {
562
+ steps: z.objectOutputType<{
563
+ catalog: z.ZodString;
564
+ id: z.ZodOptional<z.ZodString>;
565
+ }, z.ZodTypeAny, "passthrough">[];
566
+ override?: {
567
+ reason: string;
568
+ remove: string[];
569
+ } | undefined;
570
+ touch?: string[] | undefined;
571
+ } | undefined;
572
+ projectId?: string | undefined;
573
+ repoRef?: string | undefined;
574
+ actor?: string | undefined;
363
575
  sessionId?: string | undefined;
576
+ chatId?: string | undefined;
577
+ channel?: "cli" | "studio" | "api" | undefined;
578
+ clisJson?: string | undefined;
579
+ humanConfirm?: string | undefined;
580
+ campaignId?: string | undefined;
581
+ groupLabel?: string | undefined;
364
582
  retryOf?: string | undefined;
365
583
  entityMode?: "shared" | "isolated" | undefined;
584
+ deliverGate?: "auto" | "human" | undefined;
585
+ }, {
586
+ problem: string;
587
+ workflow?: string | undefined;
588
+ deliver?: "pr" | "none" | undefined;
589
+ revisesPr?: number | undefined;
590
+ plan?: {
591
+ steps: z.objectInputType<{
592
+ catalog: z.ZodString;
593
+ id: z.ZodOptional<z.ZodString>;
594
+ }, z.ZodTypeAny, "passthrough">[];
595
+ override?: {
596
+ reason: string;
597
+ remove: string[];
598
+ } | undefined;
599
+ touch?: string[] | undefined;
600
+ } | undefined;
601
+ projectId?: string | undefined;
602
+ repoRef?: string | undefined;
603
+ actor?: string | undefined;
604
+ sessionId?: string | undefined;
605
+ chatId?: string | undefined;
606
+ channel?: "cli" | "studio" | "api" | undefined;
607
+ clisJson?: string | undefined;
366
608
  humanConfirm?: string | undefined;
609
+ campaignId?: string | undefined;
610
+ groupLabel?: string | undefined;
611
+ retryOf?: string | undefined;
612
+ entityMode?: "shared" | "isolated" | undefined;
367
613
  deliverGate?: "auto" | "human" | undefined;
368
614
  }>;
615
+ /** The escalation arms (wicked-core#469 / #467): approve-shaped, no `amend` / `amendScope`.
616
+ * `extend` | `targeted` | `accept_partial` answer the gate of a repo-checks floor that did not
617
+ * finish (`repo_checks_timeout`) — the engine re-runs the floor on the tree as it stands with 2×
618
+ * bounds, the targeted test set, or the unfinished checks waived; `accept_suggestion` adopts the
619
+ * evaluator's discarded, pinned edit as the creator's amendment. The ENGINE refuses each at any
620
+ * other gate (a 409 naming the gate it answers). */
621
+ export declare const ESCALATION_ACTIONS: readonly ["extend", "targeted", "accept_partial", "accept_suggestion"];
369
622
  /** `POST /runs/:id/gate` (api-types 0.38.0 `GateDecision`; DES-L1 PR-2). Additive arms: `action`
370
623
  * names the arm (`approve` | `request_changes` | `reject`; absent = today's two-arm mapping of
371
624
  * `approve`), `amendScope` says where an approve's `amend` lands (`cursor` = the gated unit, today's
372
625
  * behaviour | `creator` = the first creator phase at/after the cursor — an intake steer reaches the
373
626
  * phase that implements). `request_changes` sends a NOT-PASS review back to the creator with the
374
627
  * findings in context (`amend` = the operator's note). A disagreement between `action` and
375
- * `approve` is a 400 that names both. */
376
- export declare const GateSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
628
+ * `approve` is a 400 that names both. The escalation arms ({@link ESCALATION_ACTIONS}) require
629
+ * `approve: true` and take no `amend` / `amendScope` / `plan`.
630
+ *
631
+ * `amend_intent` (wicked-core#555) approves the gate AND AMENDS THE RUN'S INTENT: `amend` is
632
+ * what the acceptance list now says (required, non-empty), `approve: true`, and no `amendScope`
633
+ * — an intent amendment reaches every unit at or after the cursor, which is what makes it reach
634
+ * the LATER EVALUATOR. It is the only arm that can descope a run mid-flight. */
635
+ export declare const GateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
377
636
  approve: z.ZodBoolean;
378
637
  amend: z.ZodOptional<z.ZodString>;
379
- action: z.ZodOptional<z.ZodEnum<["approve", "request_changes", "reject"]>>;
638
+ action: z.ZodOptional<z.ZodEnum<["approve", "request_changes", "reject", "edit_plan", "amend_intent", "extend", "targeted", "accept_partial", "accept_suggestion"]>>;
380
639
  amendScope: z.ZodOptional<z.ZodEnum<["cursor", "creator"]>>;
640
+ /** DES-TEAMING-002 T3 — approve a `plan_approval` gate WITH AN EDIT (`GateDecision.plan`). */
641
+ plan: z.ZodOptional<z.ZodObject<{
642
+ steps: z.ZodArray<z.ZodObject<{
643
+ catalog: z.ZodString;
644
+ id: z.ZodOptional<z.ZodString>;
645
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
646
+ catalog: z.ZodString;
647
+ id: z.ZodOptional<z.ZodString>;
648
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
649
+ catalog: z.ZodString;
650
+ id: z.ZodOptional<z.ZodString>;
651
+ }, z.ZodTypeAny, "passthrough">>, "many">;
652
+ touch: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
653
+ override: z.ZodOptional<z.ZodObject<{
654
+ remove: z.ZodArray<z.ZodString, "many">;
655
+ reason: z.ZodString;
656
+ }, "strict", z.ZodTypeAny, {
657
+ reason: string;
658
+ remove: string[];
659
+ }, {
660
+ reason: string;
661
+ remove: string[];
662
+ }>>;
663
+ }, "strict", z.ZodTypeAny, {
664
+ steps: z.objectOutputType<{
665
+ catalog: z.ZodString;
666
+ id: z.ZodOptional<z.ZodString>;
667
+ }, z.ZodTypeAny, "passthrough">[];
668
+ override?: {
669
+ reason: string;
670
+ remove: string[];
671
+ } | undefined;
672
+ touch?: string[] | undefined;
673
+ }, {
674
+ steps: z.objectInputType<{
675
+ catalog: z.ZodString;
676
+ id: z.ZodOptional<z.ZodString>;
677
+ }, z.ZodTypeAny, "passthrough">[];
678
+ override?: {
679
+ reason: string;
680
+ remove: string[];
681
+ } | undefined;
682
+ touch?: string[] | undefined;
683
+ }>>;
684
+ /** api-types 0.44.0 — the gate this decision answers (its unit `ord`). A mismatch with the run's
685
+ * open gate is a 409 `gate_changed`: the decision was made on a gate that is no longer open. */
686
+ ord: z.ZodOptional<z.ZodNumber>;
381
687
  }, "strict", z.ZodTypeAny, {
382
688
  approve: boolean;
383
- action?: "approve" | "request_changes" | "reject" | undefined;
689
+ plan?: {
690
+ steps: z.objectOutputType<{
691
+ catalog: z.ZodString;
692
+ id: z.ZodOptional<z.ZodString>;
693
+ }, z.ZodTypeAny, "passthrough">[];
694
+ override?: {
695
+ reason: string;
696
+ remove: string[];
697
+ } | undefined;
698
+ touch?: string[] | undefined;
699
+ } | undefined;
700
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
701
+ ord?: number | undefined;
702
+ amend?: string | undefined;
703
+ amendScope?: "creator" | "cursor" | undefined;
704
+ }, {
705
+ approve: boolean;
706
+ plan?: {
707
+ steps: z.objectInputType<{
708
+ catalog: z.ZodString;
709
+ id: z.ZodOptional<z.ZodString>;
710
+ }, z.ZodTypeAny, "passthrough">[];
711
+ override?: {
712
+ reason: string;
713
+ remove: string[];
714
+ } | undefined;
715
+ touch?: string[] | undefined;
716
+ } | undefined;
717
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
718
+ ord?: number | undefined;
719
+ amend?: string | undefined;
720
+ amendScope?: "creator" | "cursor" | undefined;
721
+ }>, {
722
+ approve: boolean;
723
+ plan?: {
724
+ steps: z.objectOutputType<{
725
+ catalog: z.ZodString;
726
+ id: z.ZodOptional<z.ZodString>;
727
+ }, z.ZodTypeAny, "passthrough">[];
728
+ override?: {
729
+ reason: string;
730
+ remove: string[];
731
+ } | undefined;
732
+ touch?: string[] | undefined;
733
+ } | undefined;
734
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
735
+ ord?: number | undefined;
736
+ amend?: string | undefined;
737
+ amendScope?: "creator" | "cursor" | undefined;
738
+ }, {
739
+ approve: boolean;
740
+ plan?: {
741
+ steps: z.objectInputType<{
742
+ catalog: z.ZodString;
743
+ id: z.ZodOptional<z.ZodString>;
744
+ }, z.ZodTypeAny, "passthrough">[];
745
+ override?: {
746
+ reason: string;
747
+ remove: string[];
748
+ } | undefined;
749
+ touch?: string[] | undefined;
750
+ } | undefined;
751
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
752
+ ord?: number | undefined;
753
+ amend?: string | undefined;
754
+ amendScope?: "creator" | "cursor" | undefined;
755
+ }>, {
756
+ approve: boolean;
757
+ plan?: {
758
+ steps: z.objectOutputType<{
759
+ catalog: z.ZodString;
760
+ id: z.ZodOptional<z.ZodString>;
761
+ }, z.ZodTypeAny, "passthrough">[];
762
+ override?: {
763
+ reason: string;
764
+ remove: string[];
765
+ } | undefined;
766
+ touch?: string[] | undefined;
767
+ } | undefined;
768
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
769
+ ord?: number | undefined;
770
+ amend?: string | undefined;
771
+ amendScope?: "creator" | "cursor" | undefined;
772
+ }, {
773
+ approve: boolean;
774
+ plan?: {
775
+ steps: z.objectInputType<{
776
+ catalog: z.ZodString;
777
+ id: z.ZodOptional<z.ZodString>;
778
+ }, z.ZodTypeAny, "passthrough">[];
779
+ override?: {
780
+ reason: string;
781
+ remove: string[];
782
+ } | undefined;
783
+ touch?: string[] | undefined;
784
+ } | undefined;
785
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
786
+ ord?: number | undefined;
787
+ amend?: string | undefined;
788
+ amendScope?: "creator" | "cursor" | undefined;
789
+ }>, {
790
+ approve: boolean;
791
+ plan?: {
792
+ steps: z.objectOutputType<{
793
+ catalog: z.ZodString;
794
+ id: z.ZodOptional<z.ZodString>;
795
+ }, z.ZodTypeAny, "passthrough">[];
796
+ override?: {
797
+ reason: string;
798
+ remove: string[];
799
+ } | undefined;
800
+ touch?: string[] | undefined;
801
+ } | undefined;
802
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
803
+ ord?: number | undefined;
804
+ amend?: string | undefined;
805
+ amendScope?: "creator" | "cursor" | undefined;
806
+ }, {
807
+ approve: boolean;
808
+ plan?: {
809
+ steps: z.objectInputType<{
810
+ catalog: z.ZodString;
811
+ id: z.ZodOptional<z.ZodString>;
812
+ }, z.ZodTypeAny, "passthrough">[];
813
+ override?: {
814
+ reason: string;
815
+ remove: string[];
816
+ } | undefined;
817
+ touch?: string[] | undefined;
818
+ } | undefined;
819
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
820
+ ord?: number | undefined;
821
+ amend?: string | undefined;
822
+ amendScope?: "creator" | "cursor" | undefined;
823
+ }>, {
824
+ approve: boolean;
825
+ plan?: {
826
+ steps: z.objectOutputType<{
827
+ catalog: z.ZodString;
828
+ id: z.ZodOptional<z.ZodString>;
829
+ }, z.ZodTypeAny, "passthrough">[];
830
+ override?: {
831
+ reason: string;
832
+ remove: string[];
833
+ } | undefined;
834
+ touch?: string[] | undefined;
835
+ } | undefined;
836
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
837
+ ord?: number | undefined;
384
838
  amend?: string | undefined;
385
839
  amendScope?: "creator" | "cursor" | undefined;
386
840
  }, {
387
841
  approve: boolean;
388
- action?: "approve" | "request_changes" | "reject" | undefined;
842
+ plan?: {
843
+ steps: z.objectInputType<{
844
+ catalog: z.ZodString;
845
+ id: z.ZodOptional<z.ZodString>;
846
+ }, z.ZodTypeAny, "passthrough">[];
847
+ override?: {
848
+ reason: string;
849
+ remove: string[];
850
+ } | undefined;
851
+ touch?: string[] | undefined;
852
+ } | undefined;
853
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
854
+ ord?: number | undefined;
389
855
  amend?: string | undefined;
390
856
  amendScope?: "creator" | "cursor" | undefined;
391
857
  }>, {
392
858
  approve: boolean;
393
- action?: "approve" | "request_changes" | "reject" | undefined;
859
+ plan?: {
860
+ steps: z.objectOutputType<{
861
+ catalog: z.ZodString;
862
+ id: z.ZodOptional<z.ZodString>;
863
+ }, z.ZodTypeAny, "passthrough">[];
864
+ override?: {
865
+ reason: string;
866
+ remove: string[];
867
+ } | undefined;
868
+ touch?: string[] | undefined;
869
+ } | undefined;
870
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
871
+ ord?: number | undefined;
394
872
  amend?: string | undefined;
395
873
  amendScope?: "creator" | "cursor" | undefined;
396
874
  }, {
397
875
  approve: boolean;
398
- action?: "approve" | "request_changes" | "reject" | undefined;
876
+ plan?: {
877
+ steps: z.objectInputType<{
878
+ catalog: z.ZodString;
879
+ id: z.ZodOptional<z.ZodString>;
880
+ }, z.ZodTypeAny, "passthrough">[];
881
+ override?: {
882
+ reason: string;
883
+ remove: string[];
884
+ } | undefined;
885
+ touch?: string[] | undefined;
886
+ } | undefined;
887
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
888
+ ord?: number | undefined;
399
889
  amend?: string | undefined;
400
890
  amendScope?: "creator" | "cursor" | undefined;
401
891
  }>, {
402
892
  approve: boolean;
403
- action?: "approve" | "request_changes" | "reject" | undefined;
893
+ plan?: {
894
+ steps: z.objectOutputType<{
895
+ catalog: z.ZodString;
896
+ id: z.ZodOptional<z.ZodString>;
897
+ }, z.ZodTypeAny, "passthrough">[];
898
+ override?: {
899
+ reason: string;
900
+ remove: string[];
901
+ } | undefined;
902
+ touch?: string[] | undefined;
903
+ } | undefined;
904
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
905
+ ord?: number | undefined;
404
906
  amend?: string | undefined;
405
907
  amendScope?: "creator" | "cursor" | undefined;
406
908
  }, {
407
909
  approve: boolean;
408
- action?: "approve" | "request_changes" | "reject" | undefined;
910
+ plan?: {
911
+ steps: z.objectInputType<{
912
+ catalog: z.ZodString;
913
+ id: z.ZodOptional<z.ZodString>;
914
+ }, z.ZodTypeAny, "passthrough">[];
915
+ override?: {
916
+ reason: string;
917
+ remove: string[];
918
+ } | undefined;
919
+ touch?: string[] | undefined;
920
+ } | undefined;
921
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
922
+ ord?: number | undefined;
923
+ amend?: string | undefined;
924
+ amendScope?: "creator" | "cursor" | undefined;
925
+ }>, {
926
+ approve: boolean;
927
+ plan?: {
928
+ steps: z.objectOutputType<{
929
+ catalog: z.ZodString;
930
+ id: z.ZodOptional<z.ZodString>;
931
+ }, z.ZodTypeAny, "passthrough">[];
932
+ override?: {
933
+ reason: string;
934
+ remove: string[];
935
+ } | undefined;
936
+ touch?: string[] | undefined;
937
+ } | undefined;
938
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
939
+ ord?: number | undefined;
940
+ amend?: string | undefined;
941
+ amendScope?: "creator" | "cursor" | undefined;
942
+ }, {
943
+ approve: boolean;
944
+ plan?: {
945
+ steps: z.objectInputType<{
946
+ catalog: z.ZodString;
947
+ id: z.ZodOptional<z.ZodString>;
948
+ }, z.ZodTypeAny, "passthrough">[];
949
+ override?: {
950
+ reason: string;
951
+ remove: string[];
952
+ } | undefined;
953
+ touch?: string[] | undefined;
954
+ } | undefined;
955
+ action?: "edit_plan" | "approve" | "extend" | "targeted" | "accept_partial" | "accept_suggestion" | "request_changes" | "reject" | "amend_intent" | undefined;
956
+ ord?: number | undefined;
409
957
  amend?: string | undefined;
410
958
  amendScope?: "creator" | "cursor" | undefined;
411
959
  }>;
@@ -427,14 +975,14 @@ export declare const OpenTerminalSchema: z.ZodObject<{
427
975
  governed: z.ZodOptional<z.ZodBoolean>;
428
976
  }, "strict", z.ZodTypeAny, {
429
977
  cwd: string;
430
- cols: number;
431
978
  rows: number;
979
+ cols: number;
432
980
  cmd?: string[] | undefined;
433
981
  governed?: boolean | undefined;
434
982
  }, {
435
983
  cwd: string;
436
- cols: number;
437
984
  rows: number;
985
+ cols: number;
438
986
  cmd?: string[] | undefined;
439
987
  governed?: boolean | undefined;
440
988
  }>;
@@ -460,15 +1008,38 @@ export declare const RetireMemorySchema: z.ZodObject<{
460
1008
  }, {
461
1009
  scope_prefix: string;
462
1010
  }>;
1011
+ /** `POST /memory/retire-item` body (studio#206): ONE memory, by its `memory_id` from `GET /memory`.
1012
+ * `.strict()`: a stray `scope_prefix` is a 400, never read as a wider erase than one row. */
1013
+ export declare const RetireMemoryItemSchema: z.ZodObject<{
1014
+ memory_id: z.ZodString;
1015
+ }, "strict", z.ZodTypeAny, {
1016
+ memory_id: string;
1017
+ }, {
1018
+ memory_id: string;
1019
+ }>;
463
1020
  /** The actor/audit deps (task #88) — threaded from `createServer`. */
464
1021
  export interface SecurityDeps {
465
1022
  audit: AuditLog;
466
1023
  authMode: AuthMode;
467
1024
  }
1025
+ /** What `registerRoutes` hands back to the server assembly: the ONE gate decision path, for the
1026
+ * daemon-side actors that answer gates (standing orders, behaviour 10). */
1027
+ export interface RegisteredRoutes {
1028
+ decideGate: (id: string, decision: unknown, actor: import('../core/types.js').Actor, extraDetail?: Record<string, unknown>) => Promise<{
1029
+ code: number;
1030
+ body: unknown;
1031
+ }>;
1032
+ }
468
1033
  export interface RuntimeDeps {
1034
+ /** Freeze deliveries (studio idea 15) — `createServer` hydrates one from the audit trail so a
1035
+ * restart keeps the freeze; a directly-driven route set gets a fresh (thawed) switch. */
1036
+ deliveryFreeze?: DeliveryFreeze;
469
1037
  /** DES-L9: how `revisesPr` is resolved to a PR head branch (`gh pr view`, 5 s). Injectable so
470
1038
  * route tests answer without gh; production uses `core/deliver.ts::resolvePullRequest`. */
471
1039
  resolvePullRequest?: (repoRoot: string, number: number) => Promise<PullRequestResolution>;
1040
+ /** crew#627: how the issues a launch's intent links are read (`gh issue view`, 5 s each).
1041
+ * Injectable so route tests answer without gh; production uses `core/linked-issues.ts`. */
1042
+ resolveLinkedIssues?: (problem: string, repoRoot: string | undefined, repoRef: string | undefined) => Promise<LinkedIssuesResult>;
472
1043
  seatHealth?: SeatHealthTracker;
473
1044
  /** wicked-studio#284: the stall watchdog's remembered frames for a run — merged into
474
1045
  * `GET /runs/:id/events` at serve time so a reloaded page sees the `workerStalled` /
@@ -523,7 +1094,7 @@ export interface RuntimeDeps {
523
1094
  * reads then answer the stat-only tri-state until a test sweeps or warms it explicitly. */
524
1095
  deliveryCache?: DeliveryDerivationCache;
525
1096
  /** Def-awareness for the delivery derivation (crew#481 / D-14) — `createServer` injects the
526
- * `runCanDeliver(view, resolveRunWorkflow(view, adapter.listWorkflows()))` closure it also hands
1097
+ * `runCanDeliver(view, runWorkflowDef(view, adapter.listWorkflows()))` closure it also hands
527
1098
  * its cache, so the campaigns rollup and the run DTOs classify from ONE predicate. A
528
1099
  * directly-driven route set derives the same closure over the adapter's registry when it has
529
1100
  * one, else every completed repo-scoped run stays a candidate (today's read). */
@@ -588,6 +1159,14 @@ export interface RuntimeDeps {
588
1159
  * (seeded from the installed plugin, published); a directly-driven route set gets none and
589
1160
  * `/skills*` answers 503 unless a test injects one over a fixture root. */
590
1161
  skills?: SkillsRuntime;
1162
+ /** The MCP tools registry (DES-MCP-TOOLS-001 S2) — `createServer` builds one over
1163
+ * `<state home>/mcp`; a directly-driven route set gets none and `/mcp/*` answers 503 unless a
1164
+ * test injects one over a scratch dir. */
1165
+ mcp?: McpRegistry;
1166
+ /** The MCP broker's call path (DES-MCP-TOOLS-001 S3) over that registry; absent → `POST /mcp/call` 503. */
1167
+ mcpBroker?: McpBroker;
1168
+ /** The broker's call records (DES-MCP-TOOLS-001 S7), the ones `GET /mcp/usage` folds; absent → 503. */
1169
+ mcpCalls?: McpCallRecordSource;
591
1170
  /** crew#661 — each drafting seam's ARM-TIME skill outcome: the subsystems whose phases run without
592
1171
  * a declared skill (`/diagnostics.skills.phaseSkillGaps` + `skills.phase-skill` findings, and
593
1172
  * `/health.warnings`). Absent = nothing armed here (a directly-driven route set): no gaps. */
@@ -644,14 +1223,14 @@ export declare const ChatOpenSchema: z.ZodObject<{
644
1223
  chatId?: string | undefined;
645
1224
  clis?: string[] | undefined;
646
1225
  repoRefs?: string[] | undefined;
647
- scopeKind?: "repo" | "repos" | "none" | "system" | "everything" | "project" | undefined;
1226
+ scopeKind?: "none" | "repo" | "repos" | "system" | "project" | "everything" | undefined;
648
1227
  }, {
649
1228
  projectId?: string | undefined;
650
1229
  repoRef?: string | undefined;
651
1230
  chatId?: string | undefined;
652
1231
  clis?: string[] | undefined;
653
1232
  repoRefs?: string[] | undefined;
654
- scopeKind?: "repo" | "repos" | "none" | "system" | "everything" | "project" | undefined;
1233
+ scopeKind?: "none" | "repo" | "repos" | "system" | "project" | "everything" | undefined;
655
1234
  }>;
656
- export declare function registerRoutes(app: FastifyInstance, adapter: CoreAdapter, gateCache: GateCache, elicitationCache: ElicitationCache, qeGateEvents?: QeGateCache, projects?: ProjectRoutesDeps, security?: SecurityDeps, runtime?: RuntimeDeps): void;
1235
+ export declare function registerRoutes(app: FastifyInstance, adapter: CoreAdapter, gateCache: GateCache, elicitationCache: ElicitationCache, projects?: ProjectRoutesDeps, security?: SecurityDeps, runtime?: RuntimeDeps): RegisteredRoutes;
657
1236
  //# sourceMappingURL=routes.d.ts.map