wicked-crew 0.18.19 → 0.18.21

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 (700) hide show
  1. package/README.md +9 -6
  2. package/dist/api/ask-paths.d.ts +2 -0
  3. package/dist/api/ask-paths.d.ts.map +1 -1
  4. package/dist/api/ask-paths.js +6 -0
  5. package/dist/api/ask-paths.js.map +1 -1
  6. package/dist/api/auth.d.ts +7 -5
  7. package/dist/api/auth.d.ts.map +1 -1
  8. package/dist/api/auth.js +23 -9
  9. package/dist/api/auth.js.map +1 -1
  10. package/dist/api/capture.d.ts +5 -2
  11. package/dist/api/capture.d.ts.map +1 -1
  12. package/dist/api/capture.js +13 -10
  13. package/dist/api/capture.js.map +1 -1
  14. package/dist/api/chat-attachments.d.ts.map +1 -1
  15. package/dist/api/chat-attachments.js +69 -19
  16. package/dist/api/chat-attachments.js.map +1 -1
  17. package/dist/api/chat-citations.d.ts.map +1 -1
  18. package/dist/api/chat-citations.js +22 -0
  19. package/dist/api/chat-citations.js.map +1 -1
  20. package/dist/api/chat-context.d.ts +16 -1
  21. package/dist/api/chat-context.d.ts.map +1 -1
  22. package/dist/api/chat-context.js +75 -14
  23. package/dist/api/chat-context.js.map +1 -1
  24. package/dist/api/chat-freshness.js +2 -2
  25. package/dist/api/chat-freshness.js.map +1 -1
  26. package/dist/api/chat-history.d.ts +13 -0
  27. package/dist/api/chat-history.d.ts.map +1 -1
  28. package/dist/api/chat-history.js +25 -0
  29. package/dist/api/chat-history.js.map +1 -1
  30. package/dist/api/chat-jobs.d.ts +67 -6
  31. package/dist/api/chat-jobs.d.ts.map +1 -1
  32. package/dist/api/chat-jobs.js +243 -22
  33. package/dist/api/chat-jobs.js.map +1 -1
  34. package/dist/api/chat-proposals.d.ts +69 -6
  35. package/dist/api/chat-proposals.d.ts.map +1 -1
  36. package/dist/api/chat-proposals.js +310 -49
  37. package/dist/api/chat-proposals.js.map +1 -1
  38. package/dist/api/chat-requirements.d.ts.map +1 -1
  39. package/dist/api/chat-requirements.js +4 -1
  40. package/dist/api/chat-requirements.js.map +1 -1
  41. package/dist/api/chat-scope.d.ts +17 -9
  42. package/dist/api/chat-scope.d.ts.map +1 -1
  43. package/dist/api/chat-scope.js +55 -21
  44. package/dist/api/chat-scope.js.map +1 -1
  45. package/dist/api/cluster-status.d.ts +24 -12
  46. package/dist/api/cluster-status.d.ts.map +1 -1
  47. package/dist/api/cluster-status.js +82 -4
  48. package/dist/api/cluster-status.js.map +1 -1
  49. package/dist/api/codebase-archive.d.ts +4 -3
  50. package/dist/api/codebase-archive.d.ts.map +1 -1
  51. package/dist/api/codebase-archive.js +6 -5
  52. package/dist/api/codebase-archive.js.map +1 -1
  53. package/dist/api/delivery-cache.d.ts +2 -0
  54. package/dist/api/delivery-cache.d.ts.map +1 -1
  55. package/dist/api/delivery-cache.js +1 -2
  56. package/dist/api/delivery-cache.js.map +1 -1
  57. package/dist/api/delivery-index.d.ts +2 -2
  58. package/dist/api/delivery-index.d.ts.map +1 -1
  59. package/dist/api/delivery-index.js +1 -2
  60. package/dist/api/delivery-index.js.map +1 -1
  61. package/dist/api/eval-compare.d.ts +1 -1
  62. package/dist/api/eval-compare.js +1 -1
  63. package/dist/api/eval-sample.d.ts +7 -0
  64. package/dist/api/eval-sample.d.ts.map +1 -1
  65. package/dist/api/eval-sample.js +20 -0
  66. package/dist/api/eval-sample.js.map +1 -1
  67. package/dist/api/gate-cache.d.ts +1 -0
  68. package/dist/api/gate-cache.d.ts.map +1 -1
  69. package/dist/api/gate-cache.js +19 -6
  70. package/dist/api/gate-cache.js.map +1 -1
  71. package/dist/api/governance-steering.d.ts +17 -4
  72. package/dist/api/governance-steering.d.ts.map +1 -1
  73. package/dist/api/governance-steering.js +56 -7
  74. package/dist/api/governance-steering.js.map +1 -1
  75. package/dist/api/mcp.d.ts +12 -2
  76. package/dist/api/mcp.d.ts.map +1 -1
  77. package/dist/api/mcp.js +56 -12
  78. package/dist/api/mcp.js.map +1 -1
  79. package/dist/api/needs.d.ts +20 -0
  80. package/dist/api/needs.d.ts.map +1 -1
  81. package/dist/api/needs.js +120 -19
  82. package/dist/api/needs.js.map +1 -1
  83. package/dist/api/onboarding-capture.d.ts +21 -1
  84. package/dist/api/onboarding-capture.d.ts.map +1 -1
  85. package/dist/api/onboarding-capture.js +112 -8
  86. package/dist/api/onboarding-capture.js.map +1 -1
  87. package/dist/api/policy-landing.d.ts +36 -0
  88. package/dist/api/policy-landing.d.ts.map +1 -1
  89. package/dist/api/policy-landing.js +123 -4
  90. package/dist/api/policy-landing.js.map +1 -1
  91. package/dist/api/post-hoc-deliver.d.ts.map +1 -1
  92. package/dist/api/post-hoc-deliver.js +2 -1
  93. package/dist/api/post-hoc-deliver.js.map +1 -1
  94. package/dist/api/product.d.ts +1 -1
  95. package/dist/api/proposal-decisions.d.ts +44 -0
  96. package/dist/api/proposal-decisions.d.ts.map +1 -0
  97. package/dist/api/proposal-decisions.js +85 -0
  98. package/dist/api/proposal-decisions.js.map +1 -0
  99. package/dist/api/proposal-onboard.d.ts +38 -1
  100. package/dist/api/proposal-onboard.d.ts.map +1 -1
  101. package/dist/api/proposal-onboard.js +203 -14
  102. package/dist/api/proposal-onboard.js.map +1 -1
  103. package/dist/api/recording.d.ts +1 -1
  104. package/dist/api/recording.d.ts.map +1 -1
  105. package/dist/api/recording.js +4 -5
  106. package/dist/api/recording.js.map +1 -1
  107. package/dist/api/redeliver.d.ts.map +1 -1
  108. package/dist/api/redeliver.js +11 -7
  109. package/dist/api/redeliver.js.map +1 -1
  110. package/dist/api/repo-input.d.ts.map +1 -1
  111. package/dist/api/repo-input.js +5 -2
  112. package/dist/api/repo-input.js.map +1 -1
  113. package/dist/api/repo-origins.d.ts +24 -0
  114. package/dist/api/repo-origins.d.ts.map +1 -0
  115. package/dist/api/repo-origins.js +71 -0
  116. package/dist/api/repo-origins.js.map +1 -0
  117. package/dist/api/requirements.d.ts +37 -16
  118. package/dist/api/requirements.d.ts.map +1 -1
  119. package/dist/api/requirements.js +73 -2
  120. package/dist/api/requirements.js.map +1 -1
  121. package/dist/api/retry-index.d.ts +2 -0
  122. package/dist/api/retry-index.d.ts.map +1 -1
  123. package/dist/api/retry-index.js +16 -8
  124. package/dist/api/retry-index.js.map +1 -1
  125. package/dist/api/review-change.d.ts +5 -6
  126. package/dist/api/review-change.d.ts.map +1 -1
  127. package/dist/api/review-change.js +45 -8
  128. package/dist/api/review-change.js.map +1 -1
  129. package/dist/api/roster-standing.d.ts +2 -0
  130. package/dist/api/roster-standing.d.ts.map +1 -1
  131. package/dist/api/roster-standing.js +8 -1
  132. package/dist/api/roster-standing.js.map +1 -1
  133. package/dist/api/routes.d.ts +55 -12
  134. package/dist/api/routes.d.ts.map +1 -1
  135. package/dist/api/routes.js +961 -277
  136. package/dist/api/routes.js.map +1 -1
  137. package/dist/api/run-documents.d.ts +9 -1
  138. package/dist/api/run-documents.d.ts.map +1 -1
  139. package/dist/api/run-documents.js +63 -5
  140. package/dist/api/run-documents.js.map +1 -1
  141. package/dist/api/run-sources.d.ts +11 -1
  142. package/dist/api/run-sources.d.ts.map +1 -1
  143. package/dist/api/run-sources.js +26 -3
  144. package/dist/api/run-sources.js.map +1 -1
  145. package/dist/api/run-timing-index.d.ts +47 -0
  146. package/dist/api/run-timing-index.d.ts.map +1 -1
  147. package/dist/api/run-timing-index.js +196 -86
  148. package/dist/api/run-timing-index.js.map +1 -1
  149. package/dist/api/runtime-state.d.ts +6 -0
  150. package/dist/api/runtime-state.d.ts.map +1 -1
  151. package/dist/api/runtime-state.js +14 -3
  152. package/dist/api/runtime-state.js.map +1 -1
  153. package/dist/api/seat-agents.d.ts.map +1 -1
  154. package/dist/api/seat-agents.js +3 -3
  155. package/dist/api/seat-agents.js.map +1 -1
  156. package/dist/api/seat-container-login.d.ts +6 -2
  157. package/dist/api/seat-container-login.d.ts.map +1 -1
  158. package/dist/api/seat-container-login.js +17 -9
  159. package/dist/api/seat-container-login.js.map +1 -1
  160. package/dist/api/seat-governance.d.ts +3 -2
  161. package/dist/api/seat-governance.d.ts.map +1 -1
  162. package/dist/api/seat-governance.js +31 -9
  163. package/dist/api/seat-governance.js.map +1 -1
  164. package/dist/api/seat-standing.d.ts +8 -0
  165. package/dist/api/seat-standing.d.ts.map +1 -1
  166. package/dist/api/seat-standing.js +26 -1
  167. package/dist/api/seat-standing.js.map +1 -1
  168. package/dist/api/server.d.ts +7 -0
  169. package/dist/api/server.d.ts.map +1 -1
  170. package/dist/api/server.js +172 -59
  171. package/dist/api/server.js.map +1 -1
  172. package/dist/api/stall-watchdog.d.ts +6 -0
  173. package/dist/api/stall-watchdog.d.ts.map +1 -1
  174. package/dist/api/stall-watchdog.js +28 -0
  175. package/dist/api/stall-watchdog.js.map +1 -1
  176. package/dist/api/start-on-login.d.ts +4 -0
  177. package/dist/api/start-on-login.d.ts.map +1 -0
  178. package/dist/api/start-on-login.js +35 -0
  179. package/dist/api/start-on-login.js.map +1 -0
  180. package/dist/api/steering-landing.d.ts +33 -8
  181. package/dist/api/steering-landing.d.ts.map +1 -1
  182. package/dist/api/steering-landing.js +235 -51
  183. package/dist/api/steering-landing.js.map +1 -1
  184. package/dist/api/system-snapshot.d.ts +5 -0
  185. package/dist/api/system-snapshot.d.ts.map +1 -1
  186. package/dist/api/system-snapshot.js +22 -10
  187. package/dist/api/system-snapshot.js.map +1 -1
  188. package/dist/api/testing.d.ts +2 -2
  189. package/dist/api/ui-text.js +2 -2
  190. package/dist/api/ui-text.js.map +1 -1
  191. package/dist/api/worktree-sweep.d.ts +7 -3
  192. package/dist/api/worktree-sweep.d.ts.map +1 -1
  193. package/dist/api/worktree-sweep.js +10 -6
  194. package/dist/api/worktree-sweep.js.map +1 -1
  195. package/dist/apps/actions/api-action.js +5 -2
  196. package/dist/apps/actions/api-action.js.map +1 -1
  197. package/dist/apps/actions/write-path.d.ts +9 -0
  198. package/dist/apps/actions/write-path.d.ts.map +1 -1
  199. package/dist/apps/actions/write-path.js +17 -9
  200. package/dist/apps/actions/write-path.js.map +1 -1
  201. package/dist/apps/exec/executor.d.ts +8 -15
  202. package/dist/apps/exec/executor.d.ts.map +1 -1
  203. package/dist/apps/exec/executor.js +10 -3
  204. package/dist/apps/exec/executor.js.map +1 -1
  205. package/dist/apps/exec/recall.d.ts.map +1 -1
  206. package/dist/apps/exec/recall.js +4 -4
  207. package/dist/apps/exec/recall.js.map +1 -1
  208. package/dist/apps/exec/redescribe.d.ts +37 -0
  209. package/dist/apps/exec/redescribe.d.ts.map +1 -0
  210. package/dist/apps/exec/redescribe.js +86 -0
  211. package/dist/apps/exec/redescribe.js.map +1 -0
  212. package/dist/apps/exec/source-stage.d.ts +3 -1
  213. package/dist/apps/exec/source-stage.d.ts.map +1 -1
  214. package/dist/apps/exec/source-stage.js +13 -3
  215. package/dist/apps/exec/source-stage.js.map +1 -1
  216. package/dist/apps/exec/sources.d.ts +6 -0
  217. package/dist/apps/exec/sources.d.ts.map +1 -1
  218. package/dist/apps/exec/sources.js +8 -0
  219. package/dist/apps/exec/sources.js.map +1 -1
  220. package/dist/apps/git.js +2 -2
  221. package/dist/apps/git.js.map +1 -1
  222. package/dist/apps/publish/manifest.d.ts +8 -1
  223. package/dist/apps/publish/manifest.d.ts.map +1 -1
  224. package/dist/apps/publish/manifest.js +14 -3
  225. package/dist/apps/publish/manifest.js.map +1 -1
  226. package/dist/apps/publish/run.d.ts +15 -2
  227. package/dist/apps/publish/run.d.ts.map +1 -1
  228. package/dist/apps/publish/run.js +100 -17
  229. package/dist/apps/publish/run.js.map +1 -1
  230. package/dist/apps/routes.d.ts +3 -0
  231. package/dist/apps/routes.d.ts.map +1 -1
  232. package/dist/apps/routes.js +58 -2
  233. package/dist/apps/routes.js.map +1 -1
  234. package/dist/apps/store.d.ts +24 -3
  235. package/dist/apps/store.d.ts.map +1 -1
  236. package/dist/apps/store.js +26 -9
  237. package/dist/apps/store.js.map +1 -1
  238. package/dist/apps/turns.d.ts +25 -2
  239. package/dist/apps/turns.d.ts.map +1 -1
  240. package/dist/apps/turns.js +276 -11
  241. package/dist/apps/turns.js.map +1 -1
  242. package/dist/apps-server/Dockerfile +2 -2
  243. package/dist/apps-server/runners/sqlite-runner.mjs +67 -12
  244. package/dist/apps-server/server/lib/bundle/server.mjs +353 -159
  245. package/dist/cli/governance.d.ts +5 -2
  246. package/dist/cli/governance.d.ts.map +1 -1
  247. package/dist/cli/governance.js +8 -5
  248. package/dist/cli/governance.js.map +1 -1
  249. package/dist/cli/index.d.ts.map +1 -1
  250. package/dist/cli/index.js +6 -5
  251. package/dist/cli/index.js.map +1 -1
  252. package/dist/cli/service.d.ts +10 -6
  253. package/dist/cli/service.d.ts.map +1 -1
  254. package/dist/cli/service.js +39 -23
  255. package/dist/cli/service.js.map +1 -1
  256. package/dist/core/adapter.d.ts +61 -29
  257. package/dist/core/adapter.d.ts.map +1 -1
  258. package/dist/core/adapter.js +214 -83
  259. package/dist/core/adapter.js.map +1 -1
  260. package/dist/core/ado-deliver-helper.d.ts +2 -1
  261. package/dist/core/ado-deliver-helper.d.ts.map +1 -1
  262. package/dist/core/ado-deliver-helper.js +26 -1
  263. package/dist/core/ado-deliver-helper.js.map +1 -1
  264. package/dist/core/assurance.d.ts +45 -42
  265. package/dist/core/assurance.d.ts.map +1 -1
  266. package/dist/core/assurance.js +74 -67
  267. package/dist/core/assurance.js.map +1 -1
  268. package/dist/core/deliver-text.d.ts +14 -0
  269. package/dist/core/deliver-text.d.ts.map +1 -1
  270. package/dist/core/deliver-text.js +41 -2
  271. package/dist/core/deliver-text.js.map +1 -1
  272. package/dist/core/deliver.d.ts +66 -1
  273. package/dist/core/deliver.d.ts.map +1 -1
  274. package/dist/core/deliver.js +183 -10
  275. package/dist/core/deliver.js.map +1 -1
  276. package/dist/core/engine-roster.d.ts +2 -0
  277. package/dist/core/engine-roster.d.ts.map +1 -1
  278. package/dist/core/engine-roster.js +13 -0
  279. package/dist/core/engine-roster.js.map +1 -1
  280. package/dist/core/estate-mcp-client.d.ts +13 -14
  281. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  282. package/dist/core/estate-mcp-client.js +49 -68
  283. package/dist/core/estate-mcp-client.js.map +1 -1
  284. package/dist/core/exec.d.ts +24 -0
  285. package/dist/core/exec.d.ts.map +1 -1
  286. package/dist/core/exec.js +45 -2
  287. package/dist/core/exec.js.map +1 -1
  288. package/dist/core/linked-issues.d.ts +13 -2
  289. package/dist/core/linked-issues.d.ts.map +1 -1
  290. package/dist/core/linked-issues.js +135 -4
  291. package/dist/core/linked-issues.js.map +1 -1
  292. package/dist/core/pr-checks-helper.d.ts +8 -4
  293. package/dist/core/pr-checks-helper.d.ts.map +1 -1
  294. package/dist/core/pr-checks-helper.js +39 -17
  295. package/dist/core/pr-checks-helper.js.map +1 -1
  296. package/dist/core/redeliver.js +2 -2
  297. package/dist/core/redeliver.js.map +1 -1
  298. package/dist/core/repo-clone.d.ts +64 -0
  299. package/dist/core/repo-clone.d.ts.map +1 -0
  300. package/dist/core/repo-clone.js +306 -0
  301. package/dist/core/repo-clone.js.map +1 -0
  302. package/dist/core/repoPaths.d.ts +2 -4
  303. package/dist/core/repoPaths.d.ts.map +1 -1
  304. package/dist/core/repoPaths.js +4 -6
  305. package/dist/core/repoPaths.js.map +1 -1
  306. package/dist/core/run-identity.d.ts.map +1 -1
  307. package/dist/core/run-identity.js +3 -0
  308. package/dist/core/run-identity.js.map +1 -1
  309. package/dist/core/run-read-lane.d.ts +30 -0
  310. package/dist/core/run-read-lane.d.ts.map +1 -0
  311. package/dist/core/run-read-lane.js +103 -0
  312. package/dist/core/run-read-lane.js.map +1 -0
  313. package/dist/core/types.d.ts +10 -0
  314. package/dist/core/types.d.ts.map +1 -1
  315. package/dist/core/types.js +2 -0
  316. package/dist/core/types.js.map +1 -1
  317. package/dist/core/walkthrough-root.d.ts.map +1 -1
  318. package/dist/core/walkthrough-root.js +3 -5
  319. package/dist/core/walkthrough-root.js.map +1 -1
  320. package/dist/core/wicked-home.d.ts +9 -0
  321. package/dist/core/wicked-home.d.ts.map +1 -0
  322. package/dist/core/wicked-home.js +25 -0
  323. package/dist/core/wicked-home.js.map +1 -0
  324. package/dist/decisions/consider.d.ts +2 -1
  325. package/dist/decisions/consider.d.ts.map +1 -1
  326. package/dist/decisions/consider.js +2 -2
  327. package/dist/decisions/consider.js.map +1 -1
  328. package/dist/decisions/land.d.ts +2 -0
  329. package/dist/decisions/land.d.ts.map +1 -1
  330. package/dist/decisions/land.js +16 -3
  331. package/dist/decisions/land.js.map +1 -1
  332. package/dist/decisions/rules-brief.d.ts +4 -1
  333. package/dist/decisions/rules-brief.d.ts.map +1 -1
  334. package/dist/decisions/rules-brief.js +3 -2
  335. package/dist/decisions/rules-brief.js.map +1 -1
  336. package/dist/editors/conformance-runtime.d.ts +0 -2
  337. package/dist/editors/conformance-runtime.d.ts.map +1 -1
  338. package/dist/editors/conformance-runtime.js +0 -4
  339. package/dist/editors/conformance-runtime.js.map +1 -1
  340. package/dist/editors/csp.d.ts +6 -0
  341. package/dist/editors/csp.d.ts.map +1 -1
  342. package/dist/editors/csp.js +10 -0
  343. package/dist/editors/csp.js.map +1 -1
  344. package/dist/editors/pack-install.d.ts +11 -15
  345. package/dist/editors/pack-install.d.ts.map +1 -1
  346. package/dist/editors/pack-install.js +52 -65
  347. package/dist/editors/pack-install.js.map +1 -1
  348. package/dist/editors/registry.d.ts +31 -13
  349. package/dist/editors/registry.d.ts.map +1 -1
  350. package/dist/editors/registry.js +51 -18
  351. package/dist/editors/registry.js.map +1 -1
  352. package/dist/editors/routes.d.ts +4 -2
  353. package/dist/editors/routes.d.ts.map +1 -1
  354. package/dist/editors/routes.js +23 -6
  355. package/dist/editors/routes.js.map +1 -1
  356. package/dist/editors/visuals.d.ts +4 -3
  357. package/dist/editors/visuals.d.ts.map +1 -1
  358. package/dist/editors/visuals.js +17 -7
  359. package/dist/editors/visuals.js.map +1 -1
  360. package/dist/evals/runner.js +1 -1
  361. package/dist/evals/runner.js.map +1 -1
  362. package/dist/evals/shape-corrections.js +1 -1
  363. package/dist/evals/shape-corrections.js.map +1 -1
  364. package/dist/evals/shape.d.ts +7 -1
  365. package/dist/evals/shape.d.ts.map +1 -1
  366. package/dist/evals/shape.js +26 -6
  367. package/dist/evals/shape.js.map +1 -1
  368. package/dist/evals/workflow.d.ts +16 -3
  369. package/dist/evals/workflow.d.ts.map +1 -1
  370. package/dist/evals/workflow.js +32 -6
  371. package/dist/evals/workflow.js.map +1 -1
  372. package/dist/governance/rule-revision.d.ts +7 -0
  373. package/dist/governance/rule-revision.d.ts.map +1 -0
  374. package/dist/governance/rule-revision.js +23 -0
  375. package/dist/governance/rule-revision.js.map +1 -0
  376. package/dist/insights/review-service.d.ts +26 -3
  377. package/dist/insights/review-service.d.ts.map +1 -1
  378. package/dist/insights/review-service.js +101 -11
  379. package/dist/insights/review-service.js.map +1 -1
  380. package/dist/insights/routes.d.ts +2 -1
  381. package/dist/insights/routes.d.ts.map +1 -1
  382. package/dist/insights/routes.js +19 -4
  383. package/dist/insights/routes.js.map +1 -1
  384. package/dist/insights/run-facts.d.ts +5 -0
  385. package/dist/insights/run-facts.d.ts.map +1 -1
  386. package/dist/insights/run-facts.js +15 -0
  387. package/dist/insights/run-facts.js.map +1 -1
  388. package/dist/insights/workflow.d.ts +2 -1
  389. package/dist/insights/workflow.d.ts.map +1 -1
  390. package/dist/insights/workflow.js +4 -4
  391. package/dist/insights/workflow.js.map +1 -1
  392. package/dist/inspect/service.d.ts +3 -2
  393. package/dist/inspect/service.d.ts.map +1 -1
  394. package/dist/inspect/service.js +4 -4
  395. package/dist/inspect/service.js.map +1 -1
  396. package/dist/interactive/bridge-pool.d.ts +2 -0
  397. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  398. package/dist/interactive/bridge-pool.js +18 -8
  399. package/dist/interactive/bridge-pool.js.map +1 -1
  400. package/dist/interactive/chat-events.d.ts +3 -0
  401. package/dist/interactive/chat-events.d.ts.map +1 -1
  402. package/dist/interactive/chat-events.js +20 -5
  403. package/dist/interactive/chat-events.js.map +1 -1
  404. package/dist/interactive/doc-delete-routes.d.ts +1 -0
  405. package/dist/interactive/doc-delete-routes.d.ts.map +1 -1
  406. package/dist/interactive/doc-delete-routes.js +126 -123
  407. package/dist/interactive/doc-delete-routes.js.map +1 -1
  408. package/dist/interactive/draft-events.d.ts +11 -7
  409. package/dist/interactive/draft-events.d.ts.map +1 -1
  410. package/dist/interactive/draft-events.js +29 -22
  411. package/dist/interactive/draft-events.js.map +1 -1
  412. package/dist/interactive/draft-skill.d.ts +56 -3
  413. package/dist/interactive/draft-skill.d.ts.map +1 -1
  414. package/dist/interactive/draft-skill.js +129 -20
  415. package/dist/interactive/draft-skill.js.map +1 -1
  416. package/dist/interactive/landing-guard.d.ts +30 -5
  417. package/dist/interactive/landing-guard.d.ts.map +1 -1
  418. package/dist/interactive/landing-guard.js +121 -5
  419. package/dist/interactive/landing-guard.js.map +1 -1
  420. package/dist/interactive/proposal-create.d.ts +9 -11
  421. package/dist/interactive/proposal-create.d.ts.map +1 -1
  422. package/dist/interactive/proposal-create.js +28 -21
  423. package/dist/interactive/proposal-create.js.map +1 -1
  424. package/dist/interactive/proposal-refine.d.ts +4 -4
  425. package/dist/interactive/proposal-refine.d.ts.map +1 -1
  426. package/dist/interactive/proposal-refine.js +40 -7
  427. package/dist/interactive/proposal-refine.js.map +1 -1
  428. package/dist/interactive/proxy-routes.d.ts +10 -5
  429. package/dist/interactive/proxy-routes.d.ts.map +1 -1
  430. package/dist/interactive/proxy-routes.js +108 -11
  431. package/dist/interactive/proxy-routes.js.map +1 -1
  432. package/dist/interactive/review-events.js +1 -1
  433. package/dist/interactive/review-events.js.map +1 -1
  434. package/dist/interactive/run-units.d.ts.map +1 -1
  435. package/dist/interactive/run-units.js +3 -2
  436. package/dist/interactive/run-units.js.map +1 -1
  437. package/dist/interactive/source-packet.d.ts +13 -1
  438. package/dist/interactive/source-packet.d.ts.map +1 -1
  439. package/dist/interactive/source-packet.js +108 -34
  440. package/dist/interactive/source-packet.js.map +1 -1
  441. package/dist/knowledge/adapters/toolbox/memory.d.ts +2 -0
  442. package/dist/knowledge/adapters/toolbox/memory.d.ts.map +1 -0
  443. package/dist/knowledge/adapters/toolbox/memory.js +43 -0
  444. package/dist/knowledge/adapters/toolbox/memory.js.map +1 -0
  445. package/dist/knowledge/adapters/toolbox/supervisor.d.ts +30 -4
  446. package/dist/knowledge/adapters/toolbox/supervisor.d.ts.map +1 -1
  447. package/dist/knowledge/adapters/toolbox/supervisor.js +112 -28
  448. package/dist/knowledge/adapters/toolbox/supervisor.js.map +1 -1
  449. package/dist/knowledge/estate-write.d.ts +5 -0
  450. package/dist/knowledge/estate-write.d.ts.map +1 -1
  451. package/dist/knowledge/estate-write.js +7 -0
  452. package/dist/knowledge/estate-write.js.map +1 -1
  453. package/dist/knowledge/gate/gate.d.ts.map +1 -1
  454. package/dist/knowledge/gate/gate.js +4 -1
  455. package/dist/knowledge/gate/gate.js.map +1 -1
  456. package/dist/knowledge/gate/record.d.ts +15 -2
  457. package/dist/knowledge/gate/record.d.ts.map +1 -1
  458. package/dist/knowledge/gate/record.js +108 -29
  459. package/dist/knowledge/gate/record.js.map +1 -1
  460. package/dist/knowledge/projector.d.ts +60 -5
  461. package/dist/knowledge/projector.d.ts.map +1 -1
  462. package/dist/knowledge/projector.js +264 -21
  463. package/dist/knowledge/projector.js.map +1 -1
  464. package/dist/knowledge/registry/entry.d.ts +7 -0
  465. package/dist/knowledge/registry/entry.d.ts.map +1 -1
  466. package/dist/knowledge/registry/entry.js +4 -0
  467. package/dist/knowledge/registry/entry.js.map +1 -1
  468. package/dist/knowledge/shapes/map.d.ts.map +1 -1
  469. package/dist/knowledge/shapes/map.js +12 -2
  470. package/dist/knowledge/shapes/map.js.map +1 -1
  471. package/dist/knowledge/shapes/routes.d.ts +1 -1
  472. package/dist/knowledge/shapes/routes.d.ts.map +1 -1
  473. package/dist/knowledge/shapes/routes.js +42 -16
  474. package/dist/knowledge/shapes/routes.js.map +1 -1
  475. package/dist/knowledge/shapes/shapes.d.ts +60 -13
  476. package/dist/knowledge/shapes/shapes.d.ts.map +1 -1
  477. package/dist/knowledge/shapes/shapes.js +199 -31
  478. package/dist/knowledge/shapes/shapes.js.map +1 -1
  479. package/dist/knowledge/shapes/verified.d.ts.map +1 -1
  480. package/dist/knowledge/shapes/verified.js +3 -2
  481. package/dist/knowledge/shapes/verified.js.map +1 -1
  482. package/dist/knowledge/trackers/addresses.d.ts +27 -3
  483. package/dist/knowledge/trackers/addresses.d.ts.map +1 -1
  484. package/dist/knowledge/trackers/addresses.js +33 -5
  485. package/dist/knowledge/trackers/addresses.js.map +1 -1
  486. package/dist/knowledge/trackers/gate-pm.d.ts.map +1 -1
  487. package/dist/knowledge/trackers/gate-pm.js +4 -2
  488. package/dist/knowledge/trackers/gate-pm.js.map +1 -1
  489. package/dist/knowledge/trackers/projector.d.ts +3 -1
  490. package/dist/knowledge/trackers/projector.d.ts.map +1 -1
  491. package/dist/knowledge/trackers/projector.js +59 -8
  492. package/dist/knowledge/trackers/projector.js.map +1 -1
  493. package/dist/learn/scheduler.d.ts.map +1 -1
  494. package/dist/learn/scheduler.js +13 -3
  495. package/dist/learn/scheduler.js.map +1 -1
  496. package/dist/learnings/estate.d.ts.map +1 -1
  497. package/dist/learnings/estate.js +3 -14
  498. package/dist/learnings/estate.js.map +1 -1
  499. package/dist/learnings/extract.d.ts +9 -3
  500. package/dist/learnings/extract.d.ts.map +1 -1
  501. package/dist/learnings/extract.js +62 -4
  502. package/dist/learnings/extract.js.map +1 -1
  503. package/dist/learnings/replacement-lineage.d.ts +3 -2
  504. package/dist/learnings/replacement-lineage.d.ts.map +1 -1
  505. package/dist/learnings/replacement-lineage.js +7 -6
  506. package/dist/learnings/replacement-lineage.js.map +1 -1
  507. package/dist/learnings/service.d.ts +12 -2
  508. package/dist/learnings/service.d.ts.map +1 -1
  509. package/dist/learnings/service.js +30 -5
  510. package/dist/learnings/service.js.map +1 -1
  511. package/dist/mcp/broker.d.ts.map +1 -1
  512. package/dist/mcp/broker.js +19 -5
  513. package/dist/mcp/broker.js.map +1 -1
  514. package/dist/mcp/env.d.ts +12 -4
  515. package/dist/mcp/env.d.ts.map +1 -1
  516. package/dist/mcp/env.js +24 -4
  517. package/dist/mcp/env.js.map +1 -1
  518. package/dist/mcp/estate-relay.d.ts +3 -0
  519. package/dist/mcp/estate-relay.d.ts.map +1 -1
  520. package/dist/mcp/estate-relay.js +7 -6
  521. package/dist/mcp/estate-relay.js.map +1 -1
  522. package/dist/mcp/invoke.d.ts.map +1 -1
  523. package/dist/mcp/invoke.js +6 -5
  524. package/dist/mcp/invoke.js.map +1 -1
  525. package/dist/mcp/probe.d.ts +14 -1
  526. package/dist/mcp/probe.d.ts.map +1 -1
  527. package/dist/mcp/probe.js +55 -10
  528. package/dist/mcp/probe.js.map +1 -1
  529. package/dist/mcp/redact.d.ts +1 -1
  530. package/dist/mcp/redact.d.ts.map +1 -1
  531. package/dist/mcp/redact.js +61 -4
  532. package/dist/mcp/redact.js.map +1 -1
  533. package/dist/mcp/registry-store.d.ts +37 -0
  534. package/dist/mcp/registry-store.d.ts.map +1 -1
  535. package/dist/mcp/registry-store.js +43 -0
  536. package/dist/mcp/registry-store.js.map +1 -1
  537. package/dist/mcp/registry.d.ts +38 -6
  538. package/dist/mcp/registry.d.ts.map +1 -1
  539. package/dist/mcp/registry.js +145 -14
  540. package/dist/mcp/registry.js.map +1 -1
  541. package/dist/mcp/rest.js +4 -4
  542. package/dist/mcp/rest.js.map +1 -1
  543. package/dist/mcp/run-fence.d.ts +2 -0
  544. package/dist/mcp/run-fence.d.ts.map +1 -1
  545. package/dist/mcp/run-fence.js +9 -0
  546. package/dist/mcp/run-fence.js.map +1 -1
  547. package/dist/mcp/secrets.d.ts +1 -1
  548. package/dist/mcp/secrets.d.ts.map +1 -1
  549. package/dist/mcp/secrets.js +10 -11
  550. package/dist/mcp/secrets.js.map +1 -1
  551. package/dist/mcp/upstream-error.d.ts +6 -2
  552. package/dist/mcp/upstream-error.d.ts.map +1 -1
  553. package/dist/mcp/upstream-error.js +5 -1
  554. package/dist/mcp/upstream-error.js.map +1 -1
  555. package/dist/projects/graph.d.ts +15 -5
  556. package/dist/projects/graph.d.ts.map +1 -1
  557. package/dist/projects/graph.js +354 -26
  558. package/dist/projects/graph.js.map +1 -1
  559. package/dist/projects/repo-watch.d.ts +2 -2
  560. package/dist/projects/repo-watch.d.ts.map +1 -1
  561. package/dist/projects/repo-watch.js +26 -9
  562. package/dist/projects/repo-watch.js.map +1 -1
  563. package/dist/projects/routes.d.ts +9 -1
  564. package/dist/projects/routes.d.ts.map +1 -1
  565. package/dist/projects/routes.js +63 -6
  566. package/dist/projects/routes.js.map +1 -1
  567. package/dist/projects/state-home-preflight.d.ts +5 -0
  568. package/dist/projects/state-home-preflight.d.ts.map +1 -1
  569. package/dist/projects/state-home-preflight.js +48 -8
  570. package/dist/projects/state-home-preflight.js.map +1 -1
  571. package/dist/projects/state-home-registry.d.ts.map +1 -1
  572. package/dist/projects/state-home-registry.js +9 -0
  573. package/dist/projects/state-home-registry.js.map +1 -1
  574. package/dist/projects/state-home.d.ts +11 -0
  575. package/dist/projects/state-home.d.ts.map +1 -1
  576. package/dist/projects/state-home.js +14 -0
  577. package/dist/projects/state-home.js.map +1 -1
  578. package/dist/qe/author-workflow.d.ts +4 -0
  579. package/dist/qe/author-workflow.d.ts.map +1 -1
  580. package/dist/qe/author-workflow.js +4 -0
  581. package/dist/qe/author-workflow.js.map +1 -1
  582. package/dist/qe/test-sets.d.ts +5 -6
  583. package/dist/qe/test-sets.d.ts.map +1 -1
  584. package/dist/qe/test-sets.js +4 -3
  585. package/dist/qe/test-sets.js.map +1 -1
  586. package/dist/schedules/routes.d.ts +5 -0
  587. package/dist/schedules/routes.d.ts.map +1 -1
  588. package/dist/schedules/routes.js +32 -5
  589. package/dist/schedules/routes.js.map +1 -1
  590. package/dist/schedules/scheduler.d.ts +8 -1
  591. package/dist/schedules/scheduler.d.ts.map +1 -1
  592. package/dist/schedules/scheduler.js +10 -1
  593. package/dist/schedules/scheduler.js.map +1 -1
  594. package/dist/schedules/store.d.ts +7 -0
  595. package/dist/schedules/store.d.ts.map +1 -1
  596. package/dist/schedules/store.js +19 -4
  597. package/dist/schedules/store.js.map +1 -1
  598. package/dist/skills/plugin-source.js +4 -4
  599. package/dist/skills/plugin-source.js.map +1 -1
  600. package/dist/sources/ask.d.ts.map +1 -1
  601. package/dist/sources/ask.js +12 -12
  602. package/dist/sources/ask.js.map +1 -1
  603. package/dist/sources/dialer.d.ts +6 -1
  604. package/dist/sources/dialer.d.ts.map +1 -1
  605. package/dist/sources/dialer.js +53 -31
  606. package/dist/sources/dialer.js.map +1 -1
  607. package/dist/sources/drivers/mysql.d.ts +2 -0
  608. package/dist/sources/drivers/mysql.d.ts.map +1 -1
  609. package/dist/sources/drivers/mysql.js +18 -2
  610. package/dist/sources/drivers/mysql.js.map +1 -1
  611. package/dist/sources/drivers/postgres.d.ts +2 -0
  612. package/dist/sources/drivers/postgres.d.ts.map +1 -1
  613. package/dist/sources/drivers/postgres.js +10 -3
  614. package/dist/sources/drivers/postgres.js.map +1 -1
  615. package/dist/sources/drivers/sqlite.d.ts +33 -3
  616. package/dist/sources/drivers/sqlite.d.ts.map +1 -1
  617. package/dist/sources/drivers/sqlite.js +18 -6
  618. package/dist/sources/drivers/sqlite.js.map +1 -1
  619. package/dist/sources/drivers/types.d.ts +3 -1
  620. package/dist/sources/drivers/types.d.ts.map +1 -1
  621. package/dist/sources/drivers/types.js +3 -1
  622. package/dist/sources/drivers/types.js.map +1 -1
  623. package/dist/sources/routes.d.ts.map +1 -1
  624. package/dist/sources/routes.js +1 -0
  625. package/dist/sources/routes.js.map +1 -1
  626. package/dist/sources/uploads.d.ts +22 -15
  627. package/dist/sources/uploads.d.ts.map +1 -1
  628. package/dist/sources/uploads.js +124 -436
  629. package/dist/sources/uploads.js.map +1 -1
  630. package/dist/standing-orders/history.d.ts +5 -3
  631. package/dist/standing-orders/history.d.ts.map +1 -1
  632. package/dist/standing-orders/history.js +6 -2
  633. package/dist/standing-orders/history.js.map +1 -1
  634. package/dist/standing-orders/parse.d.ts +8 -0
  635. package/dist/standing-orders/parse.d.ts.map +1 -1
  636. package/dist/standing-orders/parse.js +52 -5
  637. package/dist/standing-orders/parse.js.map +1 -1
  638. package/dist/studio/apps-standalone/fixture.js +3 -3
  639. package/dist/studio/apps-standalone/runtime.js +1 -1
  640. package/dist/studio/assets/{KnowledgeGraph-DWw0I8RJ.js → KnowledgeGraph-yP4WsnST.js} +1 -1
  641. package/dist/studio/assets/index-DNaLjJ7M.css +32 -0
  642. package/dist/studio/assets/index-DW53FKuT.js +1114 -0
  643. package/dist/studio/editors/wicked-apps/editor.json +1 -1
  644. package/dist/studio/editors/wicked-apps/index.html +2 -2
  645. package/dist/studio/editors/wicked-deck/editor.json +1 -1
  646. package/dist/studio/editors/wicked-deck/index.html +2 -2
  647. package/dist/studio/editors/wicked-doc/editor.json +1 -1
  648. package/dist/studio/editors/wicked-doc/index.html +1 -1
  649. package/dist/studio/editors/wicked-insights/editor.json +1 -1
  650. package/dist/studio/editors/wicked-insights/index.html +1 -1
  651. package/dist/studio/editors/wicked-page/editor.json +1 -1
  652. package/dist/studio/editors/wicked-page/index.html +1 -1
  653. package/dist/studio/editors/wicked-video/editor.json +1 -1
  654. package/dist/studio/editors/wicked-video/index.html +1 -1
  655. package/dist/studio/index.html +2 -2
  656. package/dist/studio/testid-inventory.json +1589 -281
  657. package/dist/team/routes.d.ts +11 -1
  658. package/dist/team/routes.d.ts.map +1 -1
  659. package/dist/team/routes.js +8 -4
  660. package/dist/team/routes.js.map +1 -1
  661. package/dist/voice/tts.d.ts +12 -0
  662. package/dist/voice/tts.d.ts.map +1 -1
  663. package/dist/voice/tts.js +118 -28
  664. package/dist/voice/tts.js.map +1 -1
  665. package/dist/workflow-catalog/build-v2.d.ts +34 -0
  666. package/dist/workflow-catalog/build-v2.d.ts.map +1 -1
  667. package/dist/workflow-catalog/build-v2.js +131 -10
  668. package/dist/workflow-catalog/build-v2.js.map +1 -1
  669. package/dist/workflow-catalog/catalog-data-v2.d.ts +6 -2
  670. package/dist/workflow-catalog/catalog-data-v2.d.ts.map +1 -1
  671. package/dist/workflow-catalog/catalog-data-v2.js.map +1 -1
  672. package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
  673. package/dist/workflow-catalog/catalog-data.js +0 -2
  674. package/dist/workflow-catalog/catalog-data.js.map +1 -1
  675. package/dist/workflow-catalog/detect.d.ts +18 -3
  676. package/dist/workflow-catalog/detect.d.ts.map +1 -1
  677. package/dist/workflow-catalog/detect.js +43 -8
  678. package/dist/workflow-catalog/detect.js.map +1 -1
  679. package/dist/workflow-catalog/shape.d.ts +1 -1
  680. package/dist/working-doc/event-lines.d.ts +12 -2
  681. package/dist/working-doc/event-lines.d.ts.map +1 -1
  682. package/dist/working-doc/event-lines.js +62 -10
  683. package/dist/working-doc/event-lines.js.map +1 -1
  684. package/dist/working-doc/sections.d.ts +3 -0
  685. package/dist/working-doc/sections.d.ts.map +1 -1
  686. package/dist/working-doc/sections.js +5 -0
  687. package/dist/working-doc/sections.js.map +1 -1
  688. package/dist/working-doc/service.d.ts +23 -3
  689. package/dist/working-doc/service.d.ts.map +1 -1
  690. package/dist/working-doc/service.js +93 -54
  691. package/dist/working-doc/service.js.map +1 -1
  692. package/endpoint-manifest.json +148 -8
  693. package/evals/corpora/shape-v1.json +25 -1
  694. package/evals/corpora/shape-v1.seat-fixture.json +25 -1
  695. package/package.json +4 -4
  696. package/runners/sqlite-runner.mjs +67 -12
  697. package/runners/upload-parse.d.mts +13 -0
  698. package/runners/upload-parse.mjs +364 -0
  699. package/dist/studio/assets/index-C4Xj-zxa.css +0 -32
  700. package/dist/studio/assets/index-CrNY3d06.js +0 -1109
@@ -1,24 +1,30 @@
1
+ import { RuleChangedError, ruleRevision } from '../governance/rule-revision.js';
1
2
  import { builtinDefs as deriveBuiltinDefs, engineDefOf } from './builtin-catalog.js';
2
3
  import { createRequire } from 'node:module';
3
4
  import { attachEngineBus, detachEngineBus } from './bus.js';
4
5
  import { mkdir, access, readFile, writeFile, chmod, rm, link, rename, realpath, stat, lstat } from 'node:fs/promises';
5
- import { existsSync, readFileSync } from 'node:fs';
6
+ import { existsSync, readFileSync, statSync } from 'node:fs';
6
7
  import { join, dirname, resolve, isAbsolute, relative, sep } from 'node:path';
7
8
  import { isPlainRunId, WALKTHROUGH_AUTHOR_SUBDIR, walkthroughRootDir } from './walkthrough-root.js';
8
- import { crewStateHome, isDefaultStateHome } from '../projects/state-home.js';
9
+ import { mcpStateDir } from '../mcp/registry-store.js';
10
+ import { resolveMemoryDbPath } from './estate-mcp-client.js';
11
+ import { crewStateHome, isDefaultStateHome, wickedWorkRoot } from '../projects/state-home.js';
9
12
  import { fileURLToPath } from 'node:url';
10
13
  import { homedir } from 'node:os';
11
14
  import { randomUUID } from 'node:crypto';
15
+ import { RunReadLane } from './run-read-lane.js';
12
16
  import { AskError, AskUnsupportedError } from './types.js';
13
17
  import { DEFAULT_SETTINGS } from './types.js';
14
18
  import { BASE_SKILL_REF_SHAPE } from '../skills/base-skill.js';
15
- import { execCapped } from './exec.js';
19
+ import { cloneRepository } from './repo-clone.js';
20
+ import { gitCommitIdents, usableGitIdent } from '../setup/known.js';
16
21
  import { composeDeliverWorkflow, DELIVER_PHASE_ID, deliverPresetStep, deliverIdentityFor, deliverRepoFor, isGitHubLogin, pushIdentityOf, readDeliverOriginUrl } from './deliver.js';
17
22
  import { engineCampaignDef, engineRosterJson } from './engine-roster.js';
18
23
  import { composeDeliverableFloor } from './deliverable-floor.js';
19
24
  import { deliverCredentialsProbe } from './deliver-credentials.js';
20
25
  import { isSyntheticWorkflowId, resolveRunIdentity, verifiedEvidenceCatalog, wireIdentity, withPresetSystemFlag, withSystemFlag, } from './run-identity.js';
21
- const TERMINAL_RUN_STATUSES = new Set(['completed', 'cancelled', 'failed']);
26
+ export const TERMINAL_RUN_STATUSES = new Set(['completed', 'cancelled', 'failed']);
27
+ const ACTIVE_RUN_STATUSES = new Set(['planning', 'distributing', 'executing']);
22
28
  import { resolveProjectGraphBinding } from '../projects/graph.js';
23
29
  import { applyGovernanceStoreEnv, isStoreSpec } from './governance-store.js';
24
30
  import { isCouncilSize, isCouncilStaggerMs } from './council-settings.js';
@@ -27,11 +33,6 @@ import { QE_OFF_REASON, launchRequiresQe, qeAcceptanceMode, qeSettingSkipReason
27
33
  import { applyVaultBinEnv, BOOT_VAULT_BIN, resolveShippedVaultBin } from './vault-bin.js';
28
34
  import { withFolderFindings } from './repoPaths.js';
29
35
  import { NEW_WORK_SEATS_FIX, NewWorkSeatsRefusal, isSeatKeyList } from './job-seats.js';
30
- /** Resolved path under the user's home directory. */
31
- export function wickedDir(...parts) {
32
- const home = process.env.HOME ?? process.env.USERPROFILE ?? '/tmp';
33
- return join(home, '.wicked', ...parts);
34
- }
35
36
  /**
36
37
  * Parse a JSON string a napi binding returned. The bindings type their return loosely (`unknown`
37
38
  * until a `ts_return_type` regen), so guard BOTH a non-string return and invalid JSON with an error
@@ -113,6 +114,8 @@ export async function readNewWorkSeats() {
113
114
  // Absent only when no entry is there at all: a settings link whose target is gone is a file that can't be read.
114
115
  if (err.code === 'ENOENT' && !(await lstat(path).then(() => true, () => false)))
115
116
  return null;
117
+ if (err instanceof NewWorkSeatsRefusal)
118
+ throw err;
116
119
  const why = err.code ?? (err instanceof Error ? err.message : String(err));
117
120
  throw new NewWorkSeatsRefusal('settings_unavailable', `crew can't read its settings file (${why}), so it can't tell which seats new work may use (newWorkSeats); it won't start new work on every seat instead. Fix ${path}, or ${NEW_WORK_SEATS_FIX}`);
118
121
  }
@@ -140,25 +143,31 @@ export async function readNewWorkSeats() {
140
143
  * crew#756 migration, once: a non-default state home with no settings file of its own starts from a
141
144
  * COPY of the shared file, so a daemon upgraded onto this rule keeps its configuration while every
142
145
  * later write stays in its own state home. Exclusive copy (never overwrites); a missing shared file
143
- * is no seed. A daemon with an explicit `WICKED_CREW_SYSTEM_SETTINGS` or on the default home skips it.
146
+ * seeds an empty object. An unreadable or invalid shared file leaves the home unseeded for a retry.
147
+ * A daemon with an explicit `WICKED_CREW_SYSTEM_SETTINGS` or on the default home skips it.
144
148
  */
145
149
  async function seedStateHomeSettings(path) {
146
150
  const override = process.env['WICKED_CREW_SYSTEM_SETTINGS'];
147
151
  if ((override !== undefined && override !== '') || isDefaultStateHome() || existsSync(path))
148
152
  return;
149
- // The seed is a VALIDATED snapshot: the shared file's text only when it parses as a JSON object,
150
- // else an empty object — so a missing, partial or corrupt shared file starts the home empty and is
151
- // never retried (Copilot on #760). Published with `link`, which is atomic and never replaces an
152
- // existing file: a racing first read either publishes or finds a complete file.
153
+ // Published with `link`, so a racing first read either publishes or finds a complete file.
154
+ const shared = sharedSettingsFilePath();
153
155
  let body = '{}';
154
156
  try {
155
- const raw = await readFile(sharedSettingsFilePath(), 'utf8');
156
- const parsed = JSON.parse(raw);
157
- if (parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed))
158
- body = raw;
157
+ body = await readFile(shared, 'utf8');
159
158
  }
160
- catch {
161
- /* absent or not JSON: start empty */
159
+ catch (err) {
160
+ if (err.code !== 'ENOENT') {
161
+ throw new NewWorkSeatsRefusal('settings_unavailable', `Cannot read ${shared}: ${err instanceof Error ? err.message : String(err)}. Fix this file to start new work.`);
162
+ }
163
+ }
164
+ try {
165
+ const parsed = JSON.parse(body);
166
+ if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed))
167
+ throw new Error('expected a JSON object');
168
+ }
169
+ catch (err) {
170
+ throw new NewWorkSeatsRefusal('settings_unavailable', `Cannot use ${shared}: ${err instanceof Error ? err.message : String(err)}. Fix this file to start new work.`);
162
171
  }
163
172
  await publishSettingsFile(path, body, false);
164
173
  }
@@ -360,6 +369,7 @@ const VIEW_NEUTRAL_CALLS = new Set([
360
369
  'campaignDetail',
361
370
  'sessions',
362
371
  'sessionsDetail',
372
+ 'sessionDetail',
363
373
  'workOutput',
364
374
  'unitTranscript',
365
375
  'runEvents',
@@ -566,6 +576,22 @@ function addonAtLeast(maj, min, pat) {
566
576
  // ── Built-in workflows (X-MIG M11) ───────────────────────────────────────────
567
577
  // No mirrors: the built-ins are the engine's built-in presets, read once at boot and laid over the
568
578
  // phase catalog (`core/builtin-catalog.ts`, `loadBuiltinCatalog`). One source; nothing to drift.
579
+ /** Refusing new work while this daemon drains; restarting clears the in-memory state. */
580
+ export class MaintenanceDrainError extends Error {
581
+ code = 'maintenance_drain';
582
+ hint = 'Wait for maintenance to finish, or POST /api/v1/maintenance with {"drain":false} to admit work again.';
583
+ constructor() {
584
+ super('This daemon is draining for maintenance and is refusing new work.');
585
+ this.name = 'MaintenanceDrainError';
586
+ }
587
+ }
588
+ /** The linked engine predates repository removal (wicked-core `unregisterRepo`). */
589
+ export class RepoUnregisterUnsupportedError extends Error {
590
+ constructor() {
591
+ super('Removing a repository requires an engine with unregisterRepo; upgrade wicked-core-ts.');
592
+ this.name = 'RepoUnregisterUnsupportedError';
593
+ }
594
+ }
569
595
  /**
570
596
  * Chat is not available in this deployment at all — a capability gap, never a bad request.
571
597
  *
@@ -770,10 +796,13 @@ export class CoreAdapter {
770
796
  listeners = new Set();
771
797
  /** F35: the views version, moved by every engine frame (bar the live streams) and every engine call that may write. */
772
798
  viewsEpoch = 0;
799
+ /** crew#1779: one-run reads a frame's listeners start wait in this lane, behind every request's read. */
800
+ runReads = new RunReadLane((runId) => this.runViewRead(runId), (view) => (view === undefined ? undefined : structuredClone(view)));
773
801
  launchListeners = new Set();
774
802
  /** crew#1145: what each engine launch awaits first (`setLaunchGate`); `null` = nothing. */
775
803
  launchGate = null;
776
804
  closed = false;
805
+ drainSince = null;
777
806
  /**
778
807
  * The estate db the Core actor was spawned over (`CoreAdapterOptions.dbPath` — the `--db`
779
808
  * flag / `~/.wicked-crew/core.db` default). Kept because some engine bindings take the db
@@ -991,14 +1020,17 @@ export class CoreAdapter {
991
1020
  // any listener runs, so a read a listener starts sees the change).
992
1021
  if (!VIEW_NEUTRAL_EVENTS.has(event.type))
993
1022
  this.viewsEpoch++;
994
- for (const listener of this.listeners) {
995
- try {
996
- listener(event);
997
- }
998
- catch {
999
- /* isolate a faulty listener */
1023
+ // crew#1779: a one-run read any listener starts from here takes the frame lane (`runView`).
1024
+ this.runReads.inFrame(() => {
1025
+ for (const listener of this.listeners) {
1026
+ try {
1027
+ listener(event);
1028
+ }
1029
+ catch {
1030
+ /* isolate a faulty listener */
1031
+ }
1000
1032
  }
1001
- }
1033
+ });
1002
1034
  }
1003
1035
  /**
1004
1036
  * The engine's EVENT-node counter over an estate store (`Core.eventStoreCount`, crew#495's
@@ -1175,6 +1207,17 @@ export class CoreAdapter {
1175
1207
  if (failure !== null)
1176
1208
  throw failure.err instanceof Error ? failure.err : new Error(String(failure.err));
1177
1209
  }
1210
+ /** Toggle admission without persisting a setting; repeated enable keeps the original time. */
1211
+ setDraining(drain) {
1212
+ this.drainSince = drain ? (this.drainSince ?? Date.now()) : null;
1213
+ }
1214
+ /** Parked and human-held runs are idle for maintenance, but still hold their repository. */
1215
+ async maintenanceState() {
1216
+ const active = (await this.sessionsDetail())
1217
+ .filter((v) => ACTIVE_RUN_STATUSES.has(v.session.status))
1218
+ .map((v) => ({ runId: v.session.id, status: v.session.status }));
1219
+ return { draining: this.drainSince !== null, since: this.drainSince, idle: active.length === 0, active };
1220
+ }
1178
1221
  /**
1179
1222
  * Hand a launch to the engine with its notices: `handed` BEFORE the call (the pin is open before
1180
1223
  * any spawn can read the env), `rejected` when the call throws (nothing will spawn — the pin is
@@ -1186,10 +1229,12 @@ export class CoreAdapter {
1186
1229
  * never swallowed (codex round 6). A listener failing on `rejected` cannot un-launch anything;
1187
1230
  * the primary error keeps precedence and the secondary one is logged, not lost.
1188
1231
  */
1189
- async handedToEngine(kind, id, call, workflow) {
1232
+ async handedToEngine(kind, id, call, workflow, resumesWork = true) {
1190
1233
  // No gate, no extra turn: a launch without one is handed exactly as before.
1191
1234
  if (this.launchGate !== null)
1192
1235
  await this.launchGate();
1236
+ if (resumesWork && this.drainSince !== null)
1237
+ throw new MaintenanceDrainError();
1193
1238
  try {
1194
1239
  this.notifyLaunch({ kind, id, status: 'handed', ...(workflow !== undefined ? { workflow } : {}) });
1195
1240
  }
@@ -1243,6 +1288,10 @@ export class CoreAdapter {
1243
1288
  static roster() {
1244
1289
  return JSON.parse(Core.registryRoster());
1245
1290
  }
1291
+ /** The engine's judge coverage, absent on an addon that predates the static. */
1292
+ static judgeCoverage(clisJson, bound) {
1293
+ return typeof Core.judgeCoverage === 'function' ? Core.judgeCoverage(clisJson, bound) : null;
1294
+ }
1246
1295
  /**
1247
1296
  * core#920: the seats the engine benches on a run bound to one repository, keyed by seat with the
1248
1297
  * engine's reason — or `null` when the linked addon predates the predicate. `seats` must be
@@ -1324,16 +1373,19 @@ export class CoreAdapter {
1324
1373
  */
1325
1374
  async resolveDeliverIdentity(repoRef) {
1326
1375
  let login = '';
1376
+ let authorNoreply = false;
1327
1377
  let source = 'setting';
1328
1378
  try {
1329
- ({ login, source } = deliverIdentityFor(await this.getSettings(), repoRef));
1379
+ const settings = await this.getSettings();
1380
+ ({ login, source } = deliverIdentityFor(settings, repoRef));
1381
+ authorNoreply = settings.deliverAuthorNoreply === true;
1330
1382
  }
1331
1383
  catch {
1332
1384
  // A settings file that cannot be read leaves the identity unconfigured rather than
1333
1385
  // failing the launch — the deliver script still cross-checks gh against git's credential.
1334
1386
  login = '';
1335
1387
  }
1336
- return { login, source };
1388
+ return { login, source, authorNoreply };
1337
1389
  }
1338
1390
  /**
1339
1391
  * The origin the deliver push will actually go to (F2) so the deliver GATE CARD says what will
@@ -1369,6 +1421,24 @@ export class CoreAdapter {
1369
1421
  return null;
1370
1422
  }
1371
1423
  }
1424
+ /** (crew#1667) Read once at compose from the registered root, as for the F2 origin read.
1425
+ * The future run worktree shares this config. No repo means no author sentence. */
1426
+ async resolveDeliverCommitIdents(repoRef) {
1427
+ if (repoRef === null || repoRef === undefined || repoRef === '')
1428
+ return undefined;
1429
+ try {
1430
+ const hit = deliverRepoFor(await this.listRepos(), repoRef);
1431
+ if (hit === undefined || hit.root_path === '')
1432
+ return undefined;
1433
+ const idents = await gitCommitIdents({ cwd: hit.root_path });
1434
+ return idents !== null && usableGitIdent(idents.author) && usableGitIdent(idents.committer)
1435
+ ? { author: idents.author, committer: idents.committer }
1436
+ : null;
1437
+ }
1438
+ catch {
1439
+ return null;
1440
+ }
1441
+ }
1372
1442
  /** The launcher's `deliver` step for a plan (`name` null) or a preset launch (DES-TEAMING-002
1373
1443
  * §8.5): the engine appends it to the plan and puts it in the floor. */
1374
1444
  deliverStep(name, phases, input,
@@ -1377,17 +1447,20 @@ export class CoreAdapter {
1377
1447
  /** (crew#737) The identity this launch resolved — launch-local, never adapter state. */
1378
1448
  identity,
1379
1449
  /** (crew#720) The provider credential preflight this launch read. */
1380
- credentials) {
1450
+ credentials, commitIdents) {
1381
1451
  return deliverPresetStep(name, phases, input.sessionId, input.problem, {
1382
1452
  repoRef: input.repoRef ?? null,
1453
+ ...(input.trackerRefs !== undefined ? { trackerRefs: input.trackerRefs } : {}),
1383
1454
  apiOrigin: this.deliverApiOrigin?.() ?? null,
1384
1455
  revisesPr: input.revisesPr ?? null,
1385
1456
  ghAccount: process.env['GH_ACCOUNT'] ?? null,
1386
1457
  ghTokenPinned: typeof process.env['GH_TOKEN'] === 'string' && process.env['GH_TOKEN'] !== '',
1387
1458
  originUrl,
1388
1459
  deliverIdentity: identity.login,
1460
+ deliverAuthorNoreply: identity.authorNoreply,
1389
1461
  deliverIdentitySource: identity.source,
1390
1462
  credentials,
1463
+ ...(commitIdents !== undefined ? { commitIdents } : {}),
1391
1464
  });
1392
1465
  }
1393
1466
  /** Launch an interactive, resumable run → the run id. */
@@ -1398,6 +1471,7 @@ export class CoreAdapter {
1398
1471
  // (F2) And the origin the push would go to — read once, for the gate card's target sentence.
1399
1472
  // Only a delivering launch composes a deliver phase, so only a delivering launch pays for it.
1400
1473
  const deliverOriginUrl = input.deliver === 'pr' ? await this.resolveDeliverOrigin(input.repoRef) : null;
1474
+ const deliverCommitIdents = input.deliver === 'pr' ? await this.resolveDeliverCommitIdents(input.repoRef) : undefined;
1401
1475
  // (crew#720) And whether the provider credential is there — presence only, read once.
1402
1476
  const deliverCredentials = input.deliver === 'pr' ? await deliverCredentialsProbe(deliverOriginUrl, process.env, undefined, pushIdentityOf(deliverIdentity.login)) : null;
1403
1477
  const opts = {
@@ -1577,7 +1651,7 @@ export class CoreAdapter {
1577
1651
  this.passLaunchDeliverables(opts, input.requireDeliverables ?? [], 'a plan');
1578
1652
  // T8: a delivering plan hands the engine its deliver step, exactly as a preset launch does.
1579
1653
  if (input.deliver === 'pr') {
1580
- opts.deliverStepJson = JSON.stringify(this.deliverStep(null, [], input, deliverOriginUrl, deliverIdentity, deliverCredentials));
1654
+ opts.deliverStepJson = JSON.stringify(this.deliverStep(null, [], input, deliverOriginUrl, deliverIdentity, deliverCredentials, deliverCommitIdents));
1581
1655
  }
1582
1656
  }
1583
1657
  // DES-TEAMING-002 T3: a workflow that names a PRESET is a plan the engine floor-fills and gates.
@@ -1598,7 +1672,7 @@ export class CoreAdapter {
1598
1672
  // Only a DELIVERING preset gets the deliver step: a preset launched for its deliverables alone
1599
1673
  // pushes nothing (codex r1 on #930).
1600
1674
  if (input.deliver === 'pr') {
1601
- const step = this.deliverStep(input.workflow, this.getWorkflow(input.workflow)?.phases ?? [], input, deliverOriginUrl, deliverIdentity, deliverCredentials);
1675
+ const step = this.deliverStep(input.workflow, this.getWorkflow(input.workflow)?.phases ?? [], input, deliverOriginUrl, deliverIdentity, deliverCredentials, deliverCommitIdents);
1602
1676
  opts.deliverStepJson = JSON.stringify(step);
1603
1677
  }
1604
1678
  opts.workflow = input.workflow;
@@ -1659,6 +1733,8 @@ export class CoreAdapter {
1659
1733
  // def and one registration below, never two armed ids.
1660
1734
  composed = composeDeliverWorkflow(composed, input.sessionId, input.problem, {
1661
1735
  repoRef: input.repoRef ?? null,
1736
+ // crew#1352: the tracker issues the launch resolved, so the embedded fallback links them back.
1737
+ ...(input.trackerRefs !== undefined ? { trackerRefs: input.trackerRefs } : {}),
1662
1738
  apiOrigin: this.deliverApiOrigin?.() ?? null,
1663
1739
  // DES-L9: the revised PR (push target) and the push identity for the gate card —
1664
1740
  // GH_ACCOUNT's value and whether GH_TOKEN is exported (presence only, never the value).
@@ -1668,10 +1744,12 @@ export class CoreAdapter {
1668
1744
  // F2 — the origin the push will actually go to, so the gate card cannot promise a
1669
1745
  // pull request on a remote that can never carry one.
1670
1746
  originUrl: deliverOriginUrl,
1747
+ ...(deliverCommitIdents !== undefined ? { commitIdents: deliverCommitIdents } : {}),
1671
1748
  // crew#549 — the configured deliver identity, baked into the script so the refusal
1672
1749
  // holds on a daemon started without GH_ACCOUNT exported; crew#737 — the repository's
1673
1750
  // own pin wins, and the card says when it is not signed in here.
1674
1751
  deliverIdentity: deliverIdentity.login,
1752
+ deliverAuthorNoreply: deliverIdentity.authorNoreply,
1675
1753
  deliverIdentitySource: deliverIdentity.source,
1676
1754
  // crew#720 — the provider credential preflight, said on the card before approval.
1677
1755
  credentials: deliverCredentials,
@@ -1780,6 +1858,7 @@ export class CoreAdapter {
1780
1858
  // (operator ruling 2026-10-11) WHO answered — recorded by the gate route just before this call
1781
1859
  // (`recordGateActor`), consumed once. The engine records it when the answer is an operator
1782
1860
  // judgment ("judged by operator", core-ts ≥ 0.9.7); an older addon ignores the trailing argument.
1861
+ const resumesWork = plan !== undefined || approve || (action !== undefined && action !== 'reject');
1783
1862
  const actorLabel = this.gateActors.get(runId);
1784
1863
  this.gateActors.delete(runId);
1785
1864
  if (expect !== undefined) {
@@ -1798,7 +1877,7 @@ export class CoreAdapter {
1798
1877
  return plan !== undefined
1799
1878
  ? core.confirmGate(runId, true, note ?? null, 'edit_plan', null, JSON.stringify(plan), actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null)
1800
1879
  : core.confirmGate(runId, approve, amend ?? null, action ?? null, amendScope ?? null, null, actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null);
1801
- });
1880
+ }, undefined, resumesWork);
1802
1881
  }
1803
1882
  return this.handedToEngine('run', runId, () => {
1804
1883
  if (actorLabel !== undefined && plan === undefined) {
@@ -1836,7 +1915,7 @@ export class CoreAdapter {
1836
1915
  // The 0.7.27 binding takes the two trailing optionals; typed here until the pin moves.
1837
1916
  const core = this.core;
1838
1917
  return core.confirmGate(runId, approve, amend, action, amendScope);
1839
- });
1918
+ }, undefined, resumesWork);
1840
1919
  }
1841
1920
  /** Cancel a run → the status token. */
1842
1921
  cancelRun(runId) {
@@ -1995,6 +2074,8 @@ export class CoreAdapter {
1995
2074
  }
1996
2075
  /** (program DES-POWER-MODE) Answer a power run's checkpoint pause; resolves to its `PowerState`. */
1997
2076
  async answerPowerPause(runId, decision, note, actor) {
2077
+ if (decision !== 'stop' && this.drainSince !== null)
2078
+ throw new MaintenanceDrainError();
1998
2079
  if (typeof this.core.answerPowerPause !== 'function')
1999
2080
  throw new Error('refused: this wicked-core build has no power mode');
2000
2081
  return JSON.parse(await this.core.answerPowerPause(runId, decision, note, actor));
@@ -2118,16 +2199,24 @@ export class CoreAdapter {
2118
2199
  }
2119
2200
  /**
2120
2201
  * One run's view (as `sessionsDetail` serves it), or `undefined` for an unknown id: the caller's own
2121
- * copy of that run only, so a request about one run costs O(1) in the number of runs on the store
2122
- * once the snapshot is read (F35). `fresh`: the caller holds a newer record of the store than the
2123
- * snapshot's (say a gate row the engine wrote before its frame landed), so the run is read from a
2124
- * fold that starts after this call.
2125
- */
2126
- async runView(runId, opts) {
2127
- if (opts?.fresh === true)
2128
- this.viewsEpoch++;
2129
- const view = (await this.viewsRead()).byId.get(runId);
2130
- return view === undefined ? undefined : structuredClone(view);
2202
+ * copy. crew#1775: read through the engine's per-run read (`sessionDetail`, core#1346), off the actor,
2203
+ * so a request about one run never folds the store. The whole-store snapshot was invalidated by every
2204
+ * engine frame, so while runs were active each gate read paid for a fresh fold of every run (and its
2205
+ * parse on the event loop), and studio's per-page gate reads queued behind those folds. The read
2206
+ * starts now, so it is never older than a change this adapter made or a frame it delivered.
2207
+ * crew#1779: a read a frame listener starts takes the frame lane ({@link RunReadLane}): it waits
2208
+ * behind no request's read, and the listeners of one frame share one read of the run.
2209
+ */
2210
+ async runView(runId) {
2211
+ return this.runReads.get(runId);
2212
+ }
2213
+ /** One run's read and its identity, as one operation: the frame lane shares and bounds all of it (crew#1779). */
2214
+ async runViewRead(runId) {
2215
+ const view = JSON.parse(await this.core.sessionDetail(runId));
2216
+ if (view === null)
2217
+ return undefined;
2218
+ await this.resolveIdentities([view]);
2219
+ return view;
2131
2220
  }
2132
2221
  /**
2133
2222
  * The shared, deep-frozen views snapshot itself — the same object for every caller until the store
@@ -2182,7 +2271,7 @@ export class CoreAdapter {
2182
2271
  const views = JSON.parse(await this.core.sessionsDetail());
2183
2272
  await this.resolveIdentities(views);
2184
2273
  deepFreeze(views);
2185
- const done = { epoch, at, snapshot: Object.freeze({ views }), byId: new Map(views.map((v) => [v.session.id, v])) };
2274
+ const done = { epoch, at, snapshot: Object.freeze({ views }) };
2186
2275
  this.viewsLatest = done;
2187
2276
  return done;
2188
2277
  })();
@@ -2330,6 +2419,7 @@ export class CoreAdapter {
2330
2419
  // (F2) The preview shows the deliver step's gate-card text, so it reads the same origin the
2331
2420
  // launch would. Local to this call, like the launch's.
2332
2421
  const previewOriginUrl = opts.deliver === true ? await this.resolveDeliverOrigin(opts.repoRef) : null;
2422
+ const previewCommitIdents = opts.deliver === true ? await this.resolveDeliverCommitIdents(opts.repoRef) : undefined;
2333
2423
  const previewIdentity = await this.resolveDeliverIdentity(opts.repoRef);
2334
2424
  const previewCredentials = opts.deliver === true ? await deliverCredentialsProbe(previewOriginUrl, process.env, undefined, pushIdentityOf(previewIdentity.login)) : null;
2335
2425
  const deliverStep = opts.deliver === true
@@ -2341,7 +2431,7 @@ export class CoreAdapter {
2341
2431
  problem: '',
2342
2432
  clisJson: '[]',
2343
2433
  ...(opts.repoRef !== undefined ? { repoRef: opts.repoRef } : {}),
2344
- }, previewOriginUrl, previewIdentity, previewCredentials))
2434
+ }, previewOriginUrl, previewIdentity, previewCredentials, previewCommitIdents))
2345
2435
  : null;
2346
2436
  return JSON.parse(await fn.call(this.core, JSON.stringify(plan), opts.projectId ?? null, opts.humanConfirm ?? null, opts.repoRef ?? null, deliverStep));
2347
2437
  }
@@ -2572,12 +2662,18 @@ export class CoreAdapter {
2572
2662
  const real = await realpath(rootPath).catch(() => rootPath);
2573
2663
  return JSON.parse(await this.core.registerRepo(name, real));
2574
2664
  }
2665
+ /** Remove only the engine registration; the checkout and graph stay on disk. */
2666
+ async unregisterRepo(id) {
2667
+ if (typeof this.core.unregisterRepo !== 'function')
2668
+ throw new RepoUnregisterUnsupportedError();
2669
+ return parseEngineJson(await this.core.unregisterRepo(id), 'unregisterRepo');
2670
+ }
2575
2671
  /**
2576
2672
  * Clone a remote git URL and return the persisted `RepoEntry` from registration.
2577
- * `checkoutPath` overrides the default clone destination (`~/.wicked/repos/<name>`).
2673
+ * `checkoutPath` overrides the state-home-derived repos destination.
2578
2674
  */
2579
2675
  async cloneAndRegister(name, gitUrl, checkoutPath, opts = {}) {
2580
- const reposRoot = wickedDir('repos');
2676
+ const reposRoot = wickedWorkRoot('repos');
2581
2677
  let cloneDir;
2582
2678
  if (checkoutPath) {
2583
2679
  // Expand leading ~/ so callers can use home-relative paths.
@@ -2626,12 +2722,8 @@ export class CoreAdapter {
2626
2722
  catch { /* not yet cloned */ }
2627
2723
  if (needsClone) {
2628
2724
  try {
2629
- await execCapped('git', ['clone', '--', gitUrl, cloneDir], {
2630
- timeout: 5 * 60 * 1000,
2631
- // crew-0182: a repository that needs a sign-in fails in seconds with git's own reason, instead of waiting on a
2632
- // credential prompt no one can answer until the 5-minute timeout.
2633
- env: { ...process.env, GIT_TERMINAL_PROMPT: '0', ...(opts.allowProtocols !== undefined ? { GIT_ALLOW_PROTOCOL: opts.allowProtocols } : {}) },
2634
- });
2725
+ // crew#1839: an Azure DevOps URL clones with the daemon's Azure DevOps credential when it holds one.
2726
+ await cloneRepository(gitUrl, cloneDir, opts);
2635
2727
  }
2636
2728
  catch (err) {
2637
2729
  // Cleanup is best-effort: swallow any cleanup error so the original
@@ -2842,9 +2934,30 @@ export class CoreAdapter {
2842
2934
  async upsertPolicy(policy) {
2843
2935
  await this.core.upsertPolicy(JSON.stringify(policy));
2844
2936
  }
2845
- /** Upsert a conformance rule via the single-writer actor. */
2846
- async upsertConformanceRule(rule) {
2847
- await this.core.upsertConformanceRule(JSON.stringify(rule));
2937
+ ruleWriteTails = new Map();
2938
+ ruleExclusively(id, write) {
2939
+ const result = (this.ruleWriteTails.get(id) ?? Promise.resolve()).then(write);
2940
+ const tail = result.catch(() => undefined);
2941
+ this.ruleWriteTails.set(id, tail);
2942
+ void tail.then(() => {
2943
+ if (this.ruleWriteTails.get(id) === tail)
2944
+ this.ruleWriteTails.delete(id);
2945
+ });
2946
+ return result;
2947
+ }
2948
+ /** Compare and write under the same lock as every crew writer of this rule. */
2949
+ async upsertConformanceRule(rule, expectedRevision) {
2950
+ return this.ruleExclusively(rule.id, async () => {
2951
+ if (expectedRevision !== undefined) {
2952
+ const current = (await this.listConformanceRules()).find((r) => r.id === rule.id);
2953
+ const revision = current === undefined ? null : ruleRevision(current);
2954
+ if (revision !== expectedRevision)
2955
+ throw new RuleChangedError(revision);
2956
+ }
2957
+ const stored = { ...rule };
2958
+ delete stored.revision;
2959
+ await this.core.upsertConformanceRule(JSON.stringify(stored));
2960
+ });
2848
2961
  }
2849
2962
  /**
2850
2963
  * Withdraw a policy from enforcement. Resolves `true` if a policy with that id existed.
@@ -2862,11 +2975,13 @@ export class CoreAdapter {
2862
2975
  }
2863
2976
  /** Withdraw a conformance rule from recall. Same contract as {@link retirePolicy}. */
2864
2977
  async retireConformanceRule(id) {
2865
- const retire = this.core.retireConformanceRule;
2866
- if (typeof retire !== 'function') {
2867
- throw new Error('Retiring a conformance rule is not yet supported by this wicked-core build');
2868
- }
2869
- return JSON.parse(await retire.call(this.core, id));
2978
+ return this.ruleExclusively(id, async () => {
2979
+ const retire = this.core.retireConformanceRule;
2980
+ if (typeof retire !== 'function') {
2981
+ throw new Error('Retiring a conformance rule is not yet supported by this wicked-core build');
2982
+ }
2983
+ return JSON.parse(await retire.call(this.core, id));
2984
+ });
2870
2985
  }
2871
2986
  /** Recall conformance rules matching a facet query (read-only, does not block actor). */
2872
2987
  async recallRulesPreview(query) {
@@ -3019,19 +3134,32 @@ export class CoreAdapter {
3019
3134
  return typeof this.core.governanceEvals === 'function';
3020
3135
  }
3021
3136
  /**
3022
- * `WICKED_CREW_KNOWLEDGE_DB` overrides the estate knowledge db the evals seams hand the
3023
- * engine — the same escape hatch `WICKED_CREW_SYSTEM_SETTINGS` gives {@link settingsFilePath}.
3024
- * Unset/empty (production) omits `knowledgeDb` from the args so the engine resolves its own
3025
- * default — which is `~/.wicked-estate/knowledge.db` (evals.rs `default_knowledge_db()`, HOME-
3026
- * derived), NOT a dbPath-derived sidecar. That home default is exactly why the test harness
3027
- * arms this seam (tests/setup/hermetic-home.ts): an un-armed corpus-import test writes
3028
- * `evals:` junk into the OPERATOR's real estate knowledge store — the store the mem/search
3029
- * domains answer from (crew#396). Read at call time, not construction time, so a test may
3030
- * re-aim it per fixture.
3137
+ * Explicit WICKED_CREW_KNOWLEDGE_DB wins; isolated homes use <state home>/mcp/evals-knowledge.db,
3138
+ * a file of its own because the engine's vendored store must not share the estate binary's knowledge.db.
3139
+ * The default home omits it so the engine keeps its HOME-derived ~/.wicked-estate/knowledge.db
3140
+ * (evals.rs default_knowledge_db); this is why tests/setup/hermetic-home.ts arms the env seam (crew#396).
3031
3141
  */
3032
- static knowledgeDbOverride() {
3142
+ static governanceKnowledgeDb() {
3033
3143
  const override = process.env['WICKED_CREW_KNOWLEDGE_DB'];
3034
- return override !== undefined && override !== '' ? override : undefined;
3144
+ if (override !== undefined && override !== '')
3145
+ return override;
3146
+ return isDefaultStateHome() ? undefined : join(mcpStateDir(), 'evals-knowledge.db');
3147
+ }
3148
+ /**
3149
+ * (crew#1128) The memory store the evals' memory axis recalls from (core#397): the store this daemon's workers recall
3150
+ * from ({@link resolveMemoryDbPath}: `WICKED_MEMORY_DB`, else `<state home>/mcp/memory.db`, else the operator's
3151
+ * global store), opened read-only by the engine. `undefined` while that file does not exist: the engine refuses a
3152
+ * run whose `memoryDb` is missing, so a daemon with no memories yet keeps the rules-only report (`memory: null`), and
3153
+ * a sample that declares memories gets the engine's own "no memory store" refusal.
3154
+ */
3155
+ static governanceMemoryDb() {
3156
+ const path = resolveMemoryDbPath();
3157
+ try {
3158
+ return statSync(path).isFile() ? path : undefined;
3159
+ }
3160
+ catch {
3161
+ return undefined;
3162
+ }
3035
3163
  }
3036
3164
  /**
3037
3165
  * Run the governance evals: every sample of the corpus (`corpus` = an `evals:<name>` estate
@@ -3042,8 +3170,8 @@ export class CoreAdapter {
3042
3170
  *
3043
3171
  * `dbPath` rides the args because the eval run opens its own read-only connection to the
3044
3172
  * steering store — the SAME store this adapter's actor writes (`this.dbPath`, the one spelling
3045
- * of where it lives). `knowledgeDb` is normally omitted so the engine resolves its own default
3046
- * (`~/.wicked-estate/knowledge.db`) — {@link knowledgeDbOverride} is the env escape hatch.
3173
+ * of where it lives). {@link governanceKnowledgeDb} pins isolated homes; the default home keeps
3174
+ * the engine default (`~/.wicked-estate/knowledge.db`) unless explicitly overridden.
3047
3175
  *
3048
3176
  * Presence-gated (the campaigns doctrine): throws {@link GovernanceEvalsUnsupportedError} on
3049
3177
  * an addon that predates the binding, which the route maps to 501 ("upgrade the engine").
@@ -3053,11 +3181,13 @@ export class CoreAdapter {
3053
3181
  if (typeof fn !== 'function') {
3054
3182
  throw new GovernanceEvalsUnsupportedError('Running governance evals');
3055
3183
  }
3056
- const knowledgeDb = CoreAdapter.knowledgeDbOverride();
3184
+ const knowledgeDb = CoreAdapter.governanceKnowledgeDb();
3185
+ const memoryDb = CoreAdapter.governanceMemoryDb();
3057
3186
  const payload = {
3058
3187
  ...(args.type !== undefined ? { type: args.type } : {}),
3059
3188
  ...(args.corpus !== undefined ? { corpus: args.corpus } : {}),
3060
3189
  ...(knowledgeDb !== undefined ? { knowledgeDb } : {}),
3190
+ ...(memoryDb !== undefined ? { memoryDb } : {}),
3061
3191
  dbPath: this.dbPath,
3062
3192
  };
3063
3193
  return parseEngineJson(await fn.call(this.core, JSON.stringify(payload)), 'governanceEvals');
@@ -3065,8 +3195,7 @@ export class CoreAdapter {
3065
3195
  /**
3066
3196
  * Import a named eval corpus into the knowledge store under the `evals:<name>` scope (the
3067
3197
  * string a later {@link runGovernanceEvals} names as `corpus`). `knowledgeDb` resolves the
3068
- * same way as in {@link runGovernanceEvals} — normally omitted (engine default:
3069
- * `~/.wicked-estate/knowledge.db`), {@link knowledgeDbOverride} wins when set.
3198
+ * same way as in {@link runGovernanceEvals}, through {@link governanceKnowledgeDb}.
3070
3199
  *
3071
3200
  * Gated on the `governanceEvals` sentinel as well as the binding itself: the two ship
3072
3201
  * together, and importing a corpus no engine on this host can ever run would be a trap, not
@@ -3077,7 +3206,7 @@ export class CoreAdapter {
3077
3206
  if (typeof this.core.governanceEvals !== 'function' || typeof importFn !== 'function') {
3078
3207
  throw new GovernanceEvalsUnsupportedError('Importing an eval corpus');
3079
3208
  }
3080
- const knowledgeDb = CoreAdapter.knowledgeDbOverride();
3209
+ const knowledgeDb = CoreAdapter.governanceKnowledgeDb();
3081
3210
  return parseEngineJson(await importFn.call(this.core, JSON.stringify({ name, samples, ...(knowledgeDb !== undefined ? { knowledgeDb } : {}) })), 'governanceCorpusImport');
3082
3211
  }
3083
3212
  // ── Workflow viewer + builder (crew#44) ────────────────────────────────────
@@ -3195,12 +3324,12 @@ export class CoreAdapter {
3195
3324
  return def.id;
3196
3325
  }
3197
3326
  /**
3198
- * Save an inline script to `~/.wicked/scripts/<name>.<ext>`, make it executable,
3327
+ * Save an inline script under the state-home-derived scripts root, make it executable,
3199
3328
  * and return the absolute path. Tool-executor phases use this path as their command.
3200
3329
  */
3201
3330
  async saveScript(name, content, lang) {
3202
3331
  const ext = lang === 'python' ? 'py' : 'sh';
3203
- const dir = wickedDir('scripts');
3332
+ const dir = wickedWorkRoot('scripts');
3204
3333
  await mkdir(dir, { recursive: true });
3205
3334
  const filename = `${name.replace(/[^a-z0-9_-]/gi, '_')}.${ext}`;
3206
3335
  const path = join(dir, filename);
@@ -3282,8 +3411,8 @@ export class CoreAdapter {
3282
3411
  /** The settings as read, and whether the read succeeded: a file that could not be read, parsed or
3283
3412
  * validated serves the defaults (`ok: false`), which the engine's QE mirror reads as a failure. */
3284
3413
  async readSettings() {
3285
- await seedStateHomeSettings(settingsFilePath());
3286
3414
  try {
3415
+ await seedStateHomeSettings(settingsFilePath());
3287
3416
  const raw = await readFile(settingsFilePath(), 'utf8');
3288
3417
  const parsed = JSON.parse(raw);
3289
3418
  // Validate numeric fields; drop anything out-of-range rather than propagate bad values.
@@ -3292,6 +3421,8 @@ export class CoreAdapter {
3292
3421
  if (typeof v !== 'number' || !Number.isInteger(v) || v < 1 || v > 10000)
3293
3422
  delete parsed.graphNodeLimit;
3294
3423
  }
3424
+ if ('deliverAuthorNoreply' in parsed && typeof parsed.deliverAuthorNoreply !== 'boolean')
3425
+ delete parsed.deliverAuthorNoreply;
3295
3426
  // deliverIdentityLogin (crew#549): a LOGIN, and the same charset PUT /settings enforces —
3296
3427
  // a hand-edited settings.json must not enable a value the API rejects (and must never be
3297
3428
  // able to put anything but a login into the deliver script's shell literal). Anything else