wicked-crew 0.18.20 → 0.18.22

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 (640) hide show
  1. package/dist/api/audit.d.ts +28 -1
  2. package/dist/api/audit.d.ts.map +1 -1
  3. package/dist/api/audit.js +90 -9
  4. package/dist/api/audit.js.map +1 -1
  5. package/dist/api/auth.d.ts +7 -0
  6. package/dist/api/auth.d.ts.map +1 -1
  7. package/dist/api/auth.js +53 -10
  8. package/dist/api/auth.js.map +1 -1
  9. package/dist/api/capture.d.ts +16 -4
  10. package/dist/api/capture.d.ts.map +1 -1
  11. package/dist/api/capture.js +20 -12
  12. package/dist/api/capture.js.map +1 -1
  13. package/dist/api/chat-context.d.ts +17 -0
  14. package/dist/api/chat-context.d.ts.map +1 -1
  15. package/dist/api/chat-context.js +94 -5
  16. package/dist/api/chat-context.js.map +1 -1
  17. package/dist/api/chat-freshness.js +2 -2
  18. package/dist/api/chat-freshness.js.map +1 -1
  19. package/dist/api/chat-jobs.d.ts +54 -0
  20. package/dist/api/chat-jobs.d.ts.map +1 -1
  21. package/dist/api/chat-jobs.js +199 -7
  22. package/dist/api/chat-jobs.js.map +1 -1
  23. package/dist/api/chat-proposals.d.ts +62 -12
  24. package/dist/api/chat-proposals.d.ts.map +1 -1
  25. package/dist/api/chat-proposals.js +257 -52
  26. package/dist/api/chat-proposals.js.map +1 -1
  27. package/dist/api/chat-requirements.d.ts.map +1 -1
  28. package/dist/api/chat-requirements.js +4 -1
  29. package/dist/api/chat-requirements.js.map +1 -1
  30. package/dist/api/chat-scope.d.ts +12 -0
  31. package/dist/api/chat-scope.d.ts.map +1 -1
  32. package/dist/api/chat-scope.js +35 -5
  33. package/dist/api/chat-scope.js.map +1 -1
  34. package/dist/api/cluster-status.d.ts +41 -12
  35. package/dist/api/cluster-status.d.ts.map +1 -1
  36. package/dist/api/cluster-status.js +148 -3
  37. package/dist/api/cluster-status.js.map +1 -1
  38. package/dist/api/codebase-archive.js +2 -2
  39. package/dist/api/codebase-archive.js.map +1 -1
  40. package/dist/api/compose-facts.d.ts +35 -0
  41. package/dist/api/compose-facts.d.ts.map +1 -0
  42. package/dist/api/compose-facts.js +46 -0
  43. package/dist/api/compose-facts.js.map +1 -0
  44. package/dist/api/cut-read.d.ts +62 -0
  45. package/dist/api/cut-read.d.ts.map +1 -0
  46. package/dist/api/cut-read.js +101 -0
  47. package/dist/api/cut-read.js.map +1 -0
  48. package/dist/api/delivery-cache.d.ts +2 -0
  49. package/dist/api/delivery-cache.d.ts.map +1 -1
  50. package/dist/api/delivery-cache.js +1 -2
  51. package/dist/api/delivery-cache.js.map +1 -1
  52. package/dist/api/delivery-index.d.ts +2 -2
  53. package/dist/api/delivery-index.d.ts.map +1 -1
  54. package/dist/api/delivery-index.js +1 -2
  55. package/dist/api/delivery-index.js.map +1 -1
  56. package/dist/api/desk-snoozes.d.ts +54 -0
  57. package/dist/api/desk-snoozes.d.ts.map +1 -0
  58. package/dist/api/desk-snoozes.js +174 -0
  59. package/dist/api/desk-snoozes.js.map +1 -0
  60. package/dist/api/diagnostics.d.ts +4 -0
  61. package/dist/api/diagnostics.d.ts.map +1 -1
  62. package/dist/api/diagnostics.js +15 -7
  63. package/dist/api/diagnostics.js.map +1 -1
  64. package/dist/api/disk-stores.d.ts +66 -0
  65. package/dist/api/disk-stores.d.ts.map +1 -0
  66. package/dist/api/disk-stores.js +206 -0
  67. package/dist/api/disk-stores.js.map +1 -0
  68. package/dist/api/eval-compare.d.ts +1 -1
  69. package/dist/api/eval-compare.js +1 -1
  70. package/dist/api/eval-sample.d.ts +7 -0
  71. package/dist/api/eval-sample.d.ts.map +1 -1
  72. package/dist/api/eval-sample.js +20 -0
  73. package/dist/api/eval-sample.js.map +1 -1
  74. package/dist/api/gate-cache.d.ts +8 -0
  75. package/dist/api/gate-cache.d.ts.map +1 -1
  76. package/dist/api/gate-cache.js +8 -1
  77. package/dist/api/gate-cache.js.map +1 -1
  78. package/dist/api/governance-steering.d.ts +13 -0
  79. package/dist/api/governance-steering.d.ts.map +1 -1
  80. package/dist/api/governance-steering.js +56 -7
  81. package/dist/api/governance-steering.js.map +1 -1
  82. package/dist/api/mcp.d.ts +19 -1
  83. package/dist/api/mcp.d.ts.map +1 -1
  84. package/dist/api/mcp.js +123 -3
  85. package/dist/api/mcp.js.map +1 -1
  86. package/dist/api/needs.d.ts +23 -0
  87. package/dist/api/needs.d.ts.map +1 -1
  88. package/dist/api/needs.js +124 -19
  89. package/dist/api/needs.js.map +1 -1
  90. package/dist/api/onboarding-capture.d.ts +21 -1
  91. package/dist/api/onboarding-capture.d.ts.map +1 -1
  92. package/dist/api/onboarding-capture.js +112 -8
  93. package/dist/api/onboarding-capture.js.map +1 -1
  94. package/dist/api/policy-landing.d.ts +36 -0
  95. package/dist/api/policy-landing.d.ts.map +1 -1
  96. package/dist/api/policy-landing.js +123 -4
  97. package/dist/api/policy-landing.js.map +1 -1
  98. package/dist/api/post-hoc-deliver.d.ts +7 -0
  99. package/dist/api/post-hoc-deliver.d.ts.map +1 -1
  100. package/dist/api/post-hoc-deliver.js +17 -5
  101. package/dist/api/post-hoc-deliver.js.map +1 -1
  102. package/dist/api/product-publish.d.ts +242 -0
  103. package/dist/api/product-publish.d.ts.map +1 -0
  104. package/dist/api/product-publish.js +902 -0
  105. package/dist/api/product-publish.js.map +1 -0
  106. package/dist/api/product.d.ts +5 -6
  107. package/dist/api/product.d.ts.map +1 -1
  108. package/dist/api/product.js +4 -4
  109. package/dist/api/product.js.map +1 -1
  110. package/dist/api/proposal-cut.d.ts +95 -0
  111. package/dist/api/proposal-cut.d.ts.map +1 -0
  112. package/dist/api/proposal-cut.js +231 -0
  113. package/dist/api/proposal-cut.js.map +1 -0
  114. package/dist/api/proposal-decisions.d.ts +44 -0
  115. package/dist/api/proposal-decisions.d.ts.map +1 -0
  116. package/dist/api/proposal-decisions.js +85 -0
  117. package/dist/api/proposal-decisions.js.map +1 -0
  118. package/dist/api/proposal-onboard.d.ts +29 -0
  119. package/dist/api/proposal-onboard.d.ts.map +1 -1
  120. package/dist/api/proposal-onboard.js +162 -11
  121. package/dist/api/proposal-onboard.js.map +1 -1
  122. package/dist/api/recording.d.ts.map +1 -1
  123. package/dist/api/recording.js +4 -5
  124. package/dist/api/recording.js.map +1 -1
  125. package/dist/api/redeliver.d.ts.map +1 -1
  126. package/dist/api/redeliver.js +11 -7
  127. package/dist/api/redeliver.js.map +1 -1
  128. package/dist/api/repo-input.d.ts.map +1 -1
  129. package/dist/api/repo-input.js +5 -2
  130. package/dist/api/repo-input.js.map +1 -1
  131. package/dist/api/repo-origins.d.ts +24 -0
  132. package/dist/api/repo-origins.d.ts.map +1 -0
  133. package/dist/api/repo-origins.js +71 -0
  134. package/dist/api/repo-origins.js.map +1 -0
  135. package/dist/api/requirements.d.ts +39 -4
  136. package/dist/api/requirements.d.ts.map +1 -1
  137. package/dist/api/requirements.js +76 -5
  138. package/dist/api/requirements.js.map +1 -1
  139. package/dist/api/review-change.d.ts +5 -6
  140. package/dist/api/review-change.d.ts.map +1 -1
  141. package/dist/api/review-change.js +45 -8
  142. package/dist/api/review-change.js.map +1 -1
  143. package/dist/api/routes.d.ts +48 -4
  144. package/dist/api/routes.d.ts.map +1 -1
  145. package/dist/api/routes.js +926 -268
  146. package/dist/api/routes.js.map +1 -1
  147. package/dist/api/run-liveness.d.ts.map +1 -1
  148. package/dist/api/run-liveness.js +3 -1
  149. package/dist/api/run-liveness.js.map +1 -1
  150. package/dist/api/run-sources.d.ts +11 -1
  151. package/dist/api/run-sources.d.ts.map +1 -1
  152. package/dist/api/run-sources.js +26 -3
  153. package/dist/api/run-sources.js.map +1 -1
  154. package/dist/api/run-timing-index.d.ts +56 -1
  155. package/dist/api/run-timing-index.d.ts.map +1 -1
  156. package/dist/api/run-timing-index.js +164 -10
  157. package/dist/api/run-timing-index.js.map +1 -1
  158. package/dist/api/runtime-state.d.ts +6 -0
  159. package/dist/api/runtime-state.d.ts.map +1 -1
  160. package/dist/api/runtime-state.js +14 -3
  161. package/dist/api/runtime-state.js.map +1 -1
  162. package/dist/api/seat-agents.d.ts.map +1 -1
  163. package/dist/api/seat-agents.js +3 -3
  164. package/dist/api/seat-agents.js.map +1 -1
  165. package/dist/api/seat-container-login.d.ts +17 -19
  166. package/dist/api/seat-container-login.d.ts.map +1 -1
  167. package/dist/api/seat-container-login.js +51 -76
  168. package/dist/api/seat-container-login.js.map +1 -1
  169. package/dist/api/seat-governance.d.ts +3 -2
  170. package/dist/api/seat-governance.d.ts.map +1 -1
  171. package/dist/api/seat-governance.js +31 -9
  172. package/dist/api/seat-governance.js.map +1 -1
  173. package/dist/api/seat-standing.d.ts +8 -0
  174. package/dist/api/seat-standing.d.ts.map +1 -1
  175. package/dist/api/seat-standing.js +26 -1
  176. package/dist/api/seat-standing.js.map +1 -1
  177. package/dist/api/server.d.ts +7 -0
  178. package/dist/api/server.d.ts.map +1 -1
  179. package/dist/api/server.js +93 -39
  180. package/dist/api/server.js.map +1 -1
  181. package/dist/api/start-on-login.d.ts +4 -0
  182. package/dist/api/start-on-login.d.ts.map +1 -0
  183. package/dist/api/start-on-login.js +35 -0
  184. package/dist/api/start-on-login.js.map +1 -0
  185. package/dist/api/steering-landing.d.ts +33 -8
  186. package/dist/api/steering-landing.d.ts.map +1 -1
  187. package/dist/api/steering-landing.js +235 -51
  188. package/dist/api/steering-landing.js.map +1 -1
  189. package/dist/api/system-snapshot.d.ts +2 -1
  190. package/dist/api/system-snapshot.d.ts.map +1 -1
  191. package/dist/api/system-snapshot.js +22 -9
  192. package/dist/api/system-snapshot.js.map +1 -1
  193. package/dist/api/ui-text.d.ts.map +1 -1
  194. package/dist/api/ui-text.js +3 -1
  195. package/dist/api/ui-text.js.map +1 -1
  196. package/dist/api/worktree-sweep.d.ts +7 -3
  197. package/dist/api/worktree-sweep.d.ts.map +1 -1
  198. package/dist/api/worktree-sweep.js +10 -6
  199. package/dist/api/worktree-sweep.js.map +1 -1
  200. package/dist/apps/exec/recall.d.ts.map +1 -1
  201. package/dist/apps/exec/recall.js +4 -4
  202. package/dist/apps/exec/recall.js.map +1 -1
  203. package/dist/apps/git.js +2 -2
  204. package/dist/apps/git.js.map +1 -1
  205. package/dist/apps/publish/manifest.d.ts +2 -0
  206. package/dist/apps/publish/manifest.d.ts.map +1 -1
  207. package/dist/apps/publish/manifest.js +8 -3
  208. package/dist/apps/publish/manifest.js.map +1 -1
  209. package/dist/apps/publish/run.d.ts +11 -1
  210. package/dist/apps/publish/run.d.ts.map +1 -1
  211. package/dist/apps/publish/run.js +97 -17
  212. package/dist/apps/publish/run.js.map +1 -1
  213. package/dist/apps/routes.d.ts +2 -0
  214. package/dist/apps/routes.d.ts.map +1 -1
  215. package/dist/apps/routes.js +45 -2
  216. package/dist/apps/routes.js.map +1 -1
  217. package/dist/apps/store.d.ts +35 -3
  218. package/dist/apps/store.d.ts.map +1 -1
  219. package/dist/apps/store.js +73 -9
  220. package/dist/apps/store.js.map +1 -1
  221. package/dist/apps/turns.d.ts +25 -2
  222. package/dist/apps/turns.d.ts.map +1 -1
  223. package/dist/apps/turns.js +276 -11
  224. package/dist/apps/turns.js.map +1 -1
  225. package/dist/apps-server/runners/sqlite-runner.mjs +39 -1
  226. package/dist/apps-server/server/lib/bundle/server.mjs +124 -14
  227. package/dist/cli/index.d.ts.map +1 -1
  228. package/dist/cli/index.js +27 -52
  229. package/dist/cli/index.js.map +1 -1
  230. package/dist/cli/start-stand-ins.d.ts +13 -0
  231. package/dist/cli/start-stand-ins.d.ts.map +1 -0
  232. package/dist/cli/start-stand-ins.js +30 -0
  233. package/dist/cli/start-stand-ins.js.map +1 -0
  234. package/dist/core/adapter.d.ts +66 -14
  235. package/dist/core/adapter.d.ts.map +1 -1
  236. package/dist/core/adapter.js +228 -56
  237. package/dist/core/adapter.js.map +1 -1
  238. package/dist/core/ado-deliver-helper.d.ts +2 -1
  239. package/dist/core/ado-deliver-helper.d.ts.map +1 -1
  240. package/dist/core/ado-deliver-helper.js +26 -1
  241. package/dist/core/ado-deliver-helper.js.map +1 -1
  242. package/dist/core/ado-env.d.ts +17 -0
  243. package/dist/core/ado-env.d.ts.map +1 -0
  244. package/dist/core/ado-env.js +34 -0
  245. package/dist/core/ado-env.js.map +1 -0
  246. package/dist/core/assurance.d.ts +10 -0
  247. package/dist/core/assurance.d.ts.map +1 -1
  248. package/dist/core/assurance.js +23 -0
  249. package/dist/core/assurance.js.map +1 -1
  250. package/dist/core/deliver-text.d.ts +19 -0
  251. package/dist/core/deliver-text.d.ts.map +1 -1
  252. package/dist/core/deliver-text.js +77 -1
  253. package/dist/core/deliver-text.js.map +1 -1
  254. package/dist/core/deliver.d.ts +49 -1
  255. package/dist/core/deliver.d.ts.map +1 -1
  256. package/dist/core/deliver.js +142 -6
  257. package/dist/core/deliver.js.map +1 -1
  258. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  259. package/dist/core/estate-mcp-client.js +4 -8
  260. package/dist/core/estate-mcp-client.js.map +1 -1
  261. package/dist/core/exec.d.ts +16 -1
  262. package/dist/core/exec.d.ts.map +1 -1
  263. package/dist/core/exec.js +32 -2
  264. package/dist/core/exec.js.map +1 -1
  265. package/dist/core/governance-store.d.ts +3 -1
  266. package/dist/core/governance-store.d.ts.map +1 -1
  267. package/dist/core/governance-store.js +7 -2
  268. package/dist/core/governance-store.js.map +1 -1
  269. package/dist/core/linked-issues.d.ts +13 -2
  270. package/dist/core/linked-issues.d.ts.map +1 -1
  271. package/dist/core/linked-issues.js +135 -4
  272. package/dist/core/linked-issues.js.map +1 -1
  273. package/dist/core/redeliver.js +2 -2
  274. package/dist/core/redeliver.js.map +1 -1
  275. package/dist/core/repo-clone.d.ts +64 -0
  276. package/dist/core/repo-clone.d.ts.map +1 -0
  277. package/dist/core/repo-clone.js +307 -0
  278. package/dist/core/repo-clone.js.map +1 -0
  279. package/dist/core/run-identity.d.ts.map +1 -1
  280. package/dist/core/run-identity.js +3 -0
  281. package/dist/core/run-identity.js.map +1 -1
  282. package/dist/core/run-log-facts.d.ts +56 -0
  283. package/dist/core/run-log-facts.d.ts.map +1 -0
  284. package/dist/core/run-log-facts.js +230 -0
  285. package/dist/core/run-log-facts.js.map +1 -0
  286. package/dist/core/run-read-lane.d.ts +30 -0
  287. package/dist/core/run-read-lane.d.ts.map +1 -0
  288. package/dist/core/run-read-lane.js +103 -0
  289. package/dist/core/run-read-lane.js.map +1 -0
  290. package/dist/core/shutdown.d.ts +27 -0
  291. package/dist/core/shutdown.d.ts.map +1 -1
  292. package/dist/core/shutdown.js +72 -0
  293. package/dist/core/shutdown.js.map +1 -1
  294. package/dist/core/stand-in.d.ts +40 -0
  295. package/dist/core/stand-in.d.ts.map +1 -0
  296. package/dist/core/stand-in.js +118 -0
  297. package/dist/core/stand-in.js.map +1 -0
  298. package/dist/core/types.d.ts +27 -0
  299. package/dist/core/types.d.ts.map +1 -1
  300. package/dist/core/types.js.map +1 -1
  301. package/dist/core/walkthrough-root.d.ts.map +1 -1
  302. package/dist/core/walkthrough-root.js +3 -5
  303. package/dist/core/walkthrough-root.js.map +1 -1
  304. package/dist/core/wicked-home.d.ts +9 -0
  305. package/dist/core/wicked-home.d.ts.map +1 -0
  306. package/dist/core/wicked-home.js +25 -0
  307. package/dist/core/wicked-home.js.map +1 -0
  308. package/dist/decisions/consider.d.ts +2 -1
  309. package/dist/decisions/consider.d.ts.map +1 -1
  310. package/dist/decisions/consider.js +2 -2
  311. package/dist/decisions/consider.js.map +1 -1
  312. package/dist/decisions/land.d.ts +2 -0
  313. package/dist/decisions/land.d.ts.map +1 -1
  314. package/dist/decisions/land.js +16 -3
  315. package/dist/decisions/land.js.map +1 -1
  316. package/dist/decisions/rules-brief.d.ts +2 -1
  317. package/dist/decisions/rules-brief.d.ts.map +1 -1
  318. package/dist/decisions/rules-brief.js +3 -2
  319. package/dist/decisions/rules-brief.js.map +1 -1
  320. package/dist/editors/conformance-runtime.d.ts +0 -2
  321. package/dist/editors/conformance-runtime.d.ts.map +1 -1
  322. package/dist/editors/conformance-runtime.js +0 -4
  323. package/dist/editors/conformance-runtime.js.map +1 -1
  324. package/dist/editors/pack-extras.d.ts +162 -0
  325. package/dist/editors/pack-extras.d.ts.map +1 -0
  326. package/dist/editors/pack-extras.js +596 -0
  327. package/dist/editors/pack-extras.js.map +1 -0
  328. package/dist/editors/pack-install.d.ts +26 -22
  329. package/dist/editors/pack-install.d.ts.map +1 -1
  330. package/dist/editors/pack-install.js +187 -80
  331. package/dist/editors/pack-install.js.map +1 -1
  332. package/dist/editors/registry.d.ts +66 -13
  333. package/dist/editors/registry.d.ts.map +1 -1
  334. package/dist/editors/registry.js +147 -24
  335. package/dist/editors/registry.js.map +1 -1
  336. package/dist/editors/routes.d.ts +10 -5
  337. package/dist/editors/routes.d.ts.map +1 -1
  338. package/dist/editors/routes.js +45 -11
  339. package/dist/editors/routes.js.map +1 -1
  340. package/dist/editors/visuals.d.ts +4 -3
  341. package/dist/editors/visuals.d.ts.map +1 -1
  342. package/dist/editors/visuals.js +17 -7
  343. package/dist/editors/visuals.js.map +1 -1
  344. package/dist/evals/runner.js +1 -1
  345. package/dist/evals/runner.js.map +1 -1
  346. package/dist/evals/shape.d.ts +7 -1
  347. package/dist/evals/shape.d.ts.map +1 -1
  348. package/dist/evals/shape.js +26 -6
  349. package/dist/evals/shape.js.map +1 -1
  350. package/dist/evals/workflow.d.ts +16 -3
  351. package/dist/evals/workflow.d.ts.map +1 -1
  352. package/dist/evals/workflow.js +31 -6
  353. package/dist/evals/workflow.js.map +1 -1
  354. package/dist/insights/review-service.d.ts +24 -3
  355. package/dist/insights/review-service.d.ts.map +1 -1
  356. package/dist/insights/review-service.js +75 -12
  357. package/dist/insights/review-service.js.map +1 -1
  358. package/dist/insights/routes.d.ts +2 -1
  359. package/dist/insights/routes.d.ts.map +1 -1
  360. package/dist/insights/routes.js +19 -4
  361. package/dist/insights/routes.js.map +1 -1
  362. package/dist/insights/run-facts.d.ts +5 -0
  363. package/dist/insights/run-facts.d.ts.map +1 -1
  364. package/dist/insights/run-facts.js +15 -0
  365. package/dist/insights/run-facts.js.map +1 -1
  366. package/dist/insights/workflow.d.ts +2 -1
  367. package/dist/insights/workflow.d.ts.map +1 -1
  368. package/dist/insights/workflow.js +4 -4
  369. package/dist/insights/workflow.js.map +1 -1
  370. package/dist/inspect/service.d.ts +3 -2
  371. package/dist/inspect/service.d.ts.map +1 -1
  372. package/dist/inspect/service.js +4 -4
  373. package/dist/inspect/service.js.map +1 -1
  374. package/dist/interactive/bridge-pool.d.ts +5 -2
  375. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  376. package/dist/interactive/bridge-pool.js +10 -5
  377. package/dist/interactive/bridge-pool.js.map +1 -1
  378. package/dist/interactive/chat-events.d.ts.map +1 -1
  379. package/dist/interactive/chat-events.js +7 -1
  380. package/dist/interactive/chat-events.js.map +1 -1
  381. package/dist/interactive/draft-events.d.ts +3 -0
  382. package/dist/interactive/draft-events.d.ts.map +1 -1
  383. package/dist/interactive/draft-events.js +5 -8
  384. package/dist/interactive/draft-events.js.map +1 -1
  385. package/dist/interactive/draft-skill.d.ts +56 -3
  386. package/dist/interactive/draft-skill.d.ts.map +1 -1
  387. package/dist/interactive/draft-skill.js +129 -20
  388. package/dist/interactive/draft-skill.js.map +1 -1
  389. package/dist/interactive/landing-guard.d.ts +30 -5
  390. package/dist/interactive/landing-guard.d.ts.map +1 -1
  391. package/dist/interactive/landing-guard.js +196 -6
  392. package/dist/interactive/landing-guard.js.map +1 -1
  393. package/dist/interactive/proposal-create.d.ts.map +1 -1
  394. package/dist/interactive/proposal-create.js +1 -0
  395. package/dist/interactive/proposal-create.js.map +1 -1
  396. package/dist/interactive/proposal-refine.d.ts.map +1 -1
  397. package/dist/interactive/proposal-refine.js +16 -1
  398. package/dist/interactive/proposal-refine.js.map +1 -1
  399. package/dist/interactive/review-events.js +1 -1
  400. package/dist/interactive/review-events.js.map +1 -1
  401. package/dist/interactive/run-units.d.ts.map +1 -1
  402. package/dist/interactive/run-units.js +3 -2
  403. package/dist/interactive/run-units.js.map +1 -1
  404. package/dist/interactive/source-packet.d.ts +8 -0
  405. package/dist/interactive/source-packet.d.ts.map +1 -1
  406. package/dist/interactive/source-packet.js +47 -6
  407. package/dist/interactive/source-packet.js.map +1 -1
  408. package/dist/knowledge/adapters/toolbox/memory.d.ts.map +1 -1
  409. package/dist/knowledge/adapters/toolbox/memory.js +3 -2
  410. package/dist/knowledge/adapters/toolbox/memory.js.map +1 -1
  411. package/dist/knowledge/adapters/toolbox/supervisor.d.ts +21 -1
  412. package/dist/knowledge/adapters/toolbox/supervisor.d.ts.map +1 -1
  413. package/dist/knowledge/adapters/toolbox/supervisor.js +76 -26
  414. package/dist/knowledge/adapters/toolbox/supervisor.js.map +1 -1
  415. package/dist/knowledge/estate-write.d.ts +5 -0
  416. package/dist/knowledge/estate-write.d.ts.map +1 -1
  417. package/dist/knowledge/estate-write.js +7 -0
  418. package/dist/knowledge/estate-write.js.map +1 -1
  419. package/dist/knowledge/projector.d.ts +60 -5
  420. package/dist/knowledge/projector.d.ts.map +1 -1
  421. package/dist/knowledge/projector.js +264 -21
  422. package/dist/knowledge/projector.js.map +1 -1
  423. package/dist/knowledge/shapes/map.d.ts.map +1 -1
  424. package/dist/knowledge/shapes/map.js +12 -2
  425. package/dist/knowledge/shapes/map.js.map +1 -1
  426. package/dist/knowledge/shapes/routes.d.ts +1 -1
  427. package/dist/knowledge/shapes/routes.d.ts.map +1 -1
  428. package/dist/knowledge/shapes/routes.js +42 -16
  429. package/dist/knowledge/shapes/routes.js.map +1 -1
  430. package/dist/knowledge/shapes/shapes.d.ts +60 -13
  431. package/dist/knowledge/shapes/shapes.d.ts.map +1 -1
  432. package/dist/knowledge/shapes/shapes.js +199 -31
  433. package/dist/knowledge/shapes/shapes.js.map +1 -1
  434. package/dist/knowledge/shapes/verified.d.ts.map +1 -1
  435. package/dist/knowledge/shapes/verified.js +3 -2
  436. package/dist/knowledge/shapes/verified.js.map +1 -1
  437. package/dist/knowledge/trackers/addresses.d.ts +27 -3
  438. package/dist/knowledge/trackers/addresses.d.ts.map +1 -1
  439. package/dist/knowledge/trackers/addresses.js +33 -5
  440. package/dist/knowledge/trackers/addresses.js.map +1 -1
  441. package/dist/knowledge/trackers/gate-pm.d.ts.map +1 -1
  442. package/dist/knowledge/trackers/gate-pm.js +4 -2
  443. package/dist/knowledge/trackers/gate-pm.js.map +1 -1
  444. package/dist/knowledge/trackers/projector.d.ts +3 -1
  445. package/dist/knowledge/trackers/projector.d.ts.map +1 -1
  446. package/dist/knowledge/trackers/projector.js +59 -8
  447. package/dist/knowledge/trackers/projector.js.map +1 -1
  448. package/dist/knowledge/trackers/set.d.ts +28 -0
  449. package/dist/knowledge/trackers/set.d.ts.map +1 -1
  450. package/dist/knowledge/trackers/set.js +26 -0
  451. package/dist/knowledge/trackers/set.js.map +1 -1
  452. package/dist/learn/scheduler.d.ts.map +1 -1
  453. package/dist/learn/scheduler.js +11 -2
  454. package/dist/learn/scheduler.js.map +1 -1
  455. package/dist/learnings/extract.d.ts +9 -3
  456. package/dist/learnings/extract.d.ts.map +1 -1
  457. package/dist/learnings/extract.js +62 -4
  458. package/dist/learnings/extract.js.map +1 -1
  459. package/dist/learnings/replacement-lineage.d.ts +3 -2
  460. package/dist/learnings/replacement-lineage.d.ts.map +1 -1
  461. package/dist/learnings/replacement-lineage.js +7 -6
  462. package/dist/learnings/replacement-lineage.js.map +1 -1
  463. package/dist/learnings/service.d.ts +12 -2
  464. package/dist/learnings/service.d.ts.map +1 -1
  465. package/dist/learnings/service.js +30 -5
  466. package/dist/learnings/service.js.map +1 -1
  467. package/dist/mcp/broker.d.ts.map +1 -1
  468. package/dist/mcp/broker.js +18 -4
  469. package/dist/mcp/broker.js.map +1 -1
  470. package/dist/mcp/estate-relay.d.ts +3 -0
  471. package/dist/mcp/estate-relay.d.ts.map +1 -1
  472. package/dist/mcp/estate-relay.js +5 -2
  473. package/dist/mcp/estate-relay.js.map +1 -1
  474. package/dist/mcp/invoke.js +2 -2
  475. package/dist/mcp/invoke.js.map +1 -1
  476. package/dist/mcp/policies.d.ts +35 -0
  477. package/dist/mcp/policies.d.ts.map +1 -1
  478. package/dist/mcp/policies.js +138 -1
  479. package/dist/mcp/policies.js.map +1 -1
  480. package/dist/mcp/redact.d.ts +1 -1
  481. package/dist/mcp/redact.d.ts.map +1 -1
  482. package/dist/mcp/redact.js +61 -4
  483. package/dist/mcp/redact.js.map +1 -1
  484. package/dist/mcp/registry-store.d.ts +35 -0
  485. package/dist/mcp/registry-store.d.ts.map +1 -1
  486. package/dist/mcp/registry-store.js +33 -0
  487. package/dist/mcp/registry-store.js.map +1 -1
  488. package/dist/mcp/registry.d.ts +65 -4
  489. package/dist/mcp/registry.d.ts.map +1 -1
  490. package/dist/mcp/registry.js +295 -21
  491. package/dist/mcp/registry.js.map +1 -1
  492. package/dist/mcp/rest.js +3 -3
  493. package/dist/mcp/rest.js.map +1 -1
  494. package/dist/mcp/run-fence.d.ts +2 -0
  495. package/dist/mcp/run-fence.d.ts.map +1 -1
  496. package/dist/mcp/run-fence.js +9 -0
  497. package/dist/mcp/run-fence.js.map +1 -1
  498. package/dist/mcp/trigger-names.d.ts +32 -0
  499. package/dist/mcp/trigger-names.d.ts.map +1 -0
  500. package/dist/mcp/trigger-names.js +529 -0
  501. package/dist/mcp/trigger-names.js.map +1 -0
  502. package/dist/mcp/upstream-error.d.ts +5 -1
  503. package/dist/mcp/upstream-error.d.ts.map +1 -1
  504. package/dist/mcp/upstream-error.js +5 -1
  505. package/dist/mcp/upstream-error.js.map +1 -1
  506. package/dist/projects/graph.d.ts +6 -4
  507. package/dist/projects/graph.d.ts.map +1 -1
  508. package/dist/projects/graph.js +173 -25
  509. package/dist/projects/graph.js.map +1 -1
  510. package/dist/projects/routes.d.ts +7 -1
  511. package/dist/projects/routes.d.ts.map +1 -1
  512. package/dist/projects/routes.js +13 -5
  513. package/dist/projects/routes.js.map +1 -1
  514. package/dist/projects/state-home-preflight.d.ts +5 -0
  515. package/dist/projects/state-home-preflight.d.ts.map +1 -1
  516. package/dist/projects/state-home-preflight.js +48 -8
  517. package/dist/projects/state-home-preflight.js.map +1 -1
  518. package/dist/projects/state-home-registry.d.ts.map +1 -1
  519. package/dist/projects/state-home-registry.js +6 -0
  520. package/dist/projects/state-home-registry.js.map +1 -1
  521. package/dist/projects/state-home.d.ts +6 -2
  522. package/dist/projects/state-home.d.ts.map +1 -1
  523. package/dist/projects/state-home.js +8 -5
  524. package/dist/projects/state-home.js.map +1 -1
  525. package/dist/qe/test-sets.d.ts +1 -1
  526. package/dist/qe/test-sets.d.ts.map +1 -1
  527. package/dist/qe/test-sets.js +2 -2
  528. package/dist/qe/test-sets.js.map +1 -1
  529. package/dist/schedules/routes.d.ts +5 -0
  530. package/dist/schedules/routes.d.ts.map +1 -1
  531. package/dist/schedules/routes.js +32 -5
  532. package/dist/schedules/routes.js.map +1 -1
  533. package/dist/schedules/scheduler.d.ts +8 -1
  534. package/dist/schedules/scheduler.d.ts.map +1 -1
  535. package/dist/schedules/scheduler.js +10 -1
  536. package/dist/schedules/scheduler.js.map +1 -1
  537. package/dist/schedules/store.d.ts +7 -0
  538. package/dist/schedules/store.d.ts.map +1 -1
  539. package/dist/schedules/store.js +19 -4
  540. package/dist/schedules/store.js.map +1 -1
  541. package/dist/skills/plugin-source.js +4 -4
  542. package/dist/skills/plugin-source.js.map +1 -1
  543. package/dist/skills/store.d.ts +11 -1
  544. package/dist/skills/store.d.ts.map +1 -1
  545. package/dist/skills/store.js +37 -3
  546. package/dist/skills/store.js.map +1 -1
  547. package/dist/sources/drivers/sqlite.d.ts +13 -0
  548. package/dist/sources/drivers/sqlite.d.ts.map +1 -1
  549. package/dist/sources/drivers/sqlite.js +11 -0
  550. package/dist/sources/drivers/sqlite.js.map +1 -1
  551. package/dist/sources/routes.d.ts.map +1 -1
  552. package/dist/sources/routes.js +1 -0
  553. package/dist/sources/routes.js.map +1 -1
  554. package/dist/sources/uploads.d.ts +22 -2
  555. package/dist/sources/uploads.d.ts.map +1 -1
  556. package/dist/sources/uploads.js +108 -10
  557. package/dist/sources/uploads.js.map +1 -1
  558. package/dist/standing-orders/parse.d.ts +8 -0
  559. package/dist/standing-orders/parse.d.ts.map +1 -1
  560. package/dist/standing-orders/parse.js +52 -5
  561. package/dist/standing-orders/parse.js.map +1 -1
  562. package/dist/studio/apps-standalone/fixture.js +3 -3
  563. package/dist/studio/assets/{KnowledgeGraph-dfq7Flyj.js → KnowledgeGraph-D6RRLDnV.js} +1 -1
  564. package/dist/studio/assets/index-BLo9vFQI.js +1128 -0
  565. package/dist/studio/assets/index-xW21Gkam.css +32 -0
  566. package/dist/studio/editors/wicked-apps/editor.json +1 -1
  567. package/dist/studio/editors/wicked-apps/index.html +1 -1
  568. package/dist/studio/editors/wicked-deck/editor.json +1 -1
  569. package/dist/studio/editors/wicked-deck/index.html +1 -1
  570. package/dist/studio/editors/wicked-doc/editor.json +1 -1
  571. package/dist/studio/editors/wicked-doc/index.html +1 -1
  572. package/dist/studio/editors/wicked-insights/editor.json +1 -1
  573. package/dist/studio/editors/wicked-insights/index.html +1 -1
  574. package/dist/studio/editors/wicked-page/editor.json +1 -1
  575. package/dist/studio/editors/wicked-page/index.html +1 -1
  576. package/dist/studio/editors/wicked-video/editor.json +1 -1
  577. package/dist/studio/editors/wicked-video/index.html +1 -1
  578. package/dist/studio/index.html +2 -2
  579. package/dist/studio/testid-inventory.json +1687 -236
  580. package/dist/team/routes.d.ts +4 -1
  581. package/dist/team/routes.d.ts.map +1 -1
  582. package/dist/team/routes.js +3 -2
  583. package/dist/team/routes.js.map +1 -1
  584. package/dist/voice/tts.d.ts +18 -0
  585. package/dist/voice/tts.d.ts.map +1 -1
  586. package/dist/voice/tts.js +134 -29
  587. package/dist/voice/tts.js.map +1 -1
  588. package/dist/workflow-catalog/build-v2.d.ts +34 -0
  589. package/dist/workflow-catalog/build-v2.d.ts.map +1 -1
  590. package/dist/workflow-catalog/build-v2.js +131 -10
  591. package/dist/workflow-catalog/build-v2.js.map +1 -1
  592. package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
  593. package/dist/workflow-catalog/catalog-data.js +0 -2
  594. package/dist/workflow-catalog/catalog-data.js.map +1 -1
  595. package/dist/workflow-catalog/detect.d.ts +18 -3
  596. package/dist/workflow-catalog/detect.d.ts.map +1 -1
  597. package/dist/workflow-catalog/detect.js +43 -8
  598. package/dist/workflow-catalog/detect.js.map +1 -1
  599. package/dist/working-doc/event-lines.d.ts +5 -2
  600. package/dist/working-doc/event-lines.d.ts.map +1 -1
  601. package/dist/working-doc/event-lines.js +38 -7
  602. package/dist/working-doc/event-lines.js.map +1 -1
  603. package/dist/working-doc/sections.d.ts +3 -0
  604. package/dist/working-doc/sections.d.ts.map +1 -1
  605. package/dist/working-doc/sections.js +5 -0
  606. package/dist/working-doc/sections.js.map +1 -1
  607. package/dist/working-doc/service.d.ts +23 -3
  608. package/dist/working-doc/service.d.ts.map +1 -1
  609. package/dist/working-doc/service.js +93 -54
  610. package/dist/working-doc/service.js.map +1 -1
  611. package/endpoint-manifest.json +144 -8
  612. package/evals/corpora/shape-v1.json +25 -1
  613. package/evals/corpora/shape-v1.seat-fixture.json +25 -1
  614. package/package.json +4 -4
  615. package/runners/sqlite-runner.mjs +39 -1
  616. package/voice-locks/darwin-arm64-cp310.txt +12 -0
  617. package/voice-locks/darwin-arm64-cp311.txt +8 -0
  618. package/voice-locks/darwin-arm64-cp312.txt +8 -0
  619. package/voice-locks/darwin-arm64-cp313.txt +8 -0
  620. package/voice-locks/darwin-arm64-cp314.txt +8 -0
  621. package/voice-locks/darwin-arm64-cp39.txt +12 -0
  622. package/voice-locks/darwin-x64-cp310.txt +12 -0
  623. package/voice-locks/darwin-x64-cp311.txt +12 -0
  624. package/voice-locks/darwin-x64-cp312.txt +12 -0
  625. package/voice-locks/darwin-x64-cp313.txt +12 -0
  626. package/voice-locks/darwin-x64-cp39.txt +12 -0
  627. package/voice-locks/linux-arm64-cp310.txt +12 -0
  628. package/voice-locks/linux-arm64-cp311.txt +8 -0
  629. package/voice-locks/linux-arm64-cp312.txt +8 -0
  630. package/voice-locks/linux-arm64-cp313.txt +8 -0
  631. package/voice-locks/linux-arm64-cp314.txt +8 -0
  632. package/voice-locks/linux-arm64-cp39.txt +12 -0
  633. package/voice-locks/linux-x64-cp310.txt +12 -0
  634. package/voice-locks/linux-x64-cp311.txt +8 -0
  635. package/voice-locks/linux-x64-cp312.txt +8 -0
  636. package/voice-locks/linux-x64-cp313.txt +8 -0
  637. package/voice-locks/linux-x64-cp314.txt +8 -0
  638. package/voice-locks/linux-x64-cp39.txt +12 -0
  639. package/dist/studio/assets/index-Bame65hj.js +0 -1108
  640. package/dist/studio/assets/index-CtB1BJRI.css +0 -32
@@ -3,18 +3,21 @@ import { builtinDefs as deriveBuiltinDefs, engineDefOf } from './builtin-catalog
3
3
  import { createRequire } from 'node:module';
4
4
  import { attachEngineBus, detachEngineBus } from './bus.js';
5
5
  import { mkdir, access, readFile, writeFile, chmod, rm, link, rename, realpath, stat, lstat } from 'node:fs/promises';
6
- import { existsSync, readFileSync } from 'node:fs';
6
+ import { existsSync, readFileSync, statSync } from 'node:fs';
7
7
  import { join, dirname, resolve, isAbsolute, relative, sep } from 'node:path';
8
8
  import { isPlainRunId, WALKTHROUGH_AUTHOR_SUBDIR, walkthroughRootDir } from './walkthrough-root.js';
9
9
  import { mcpStateDir } from '../mcp/registry-store.js';
10
+ import { resolveMemoryDbPath } from './estate-mcp-client.js';
10
11
  import { crewStateHome, isDefaultStateHome, wickedWorkRoot } from '../projects/state-home.js';
11
12
  import { fileURLToPath } from 'node:url';
12
13
  import { homedir } from 'node:os';
13
14
  import { randomUUID } from 'node:crypto';
15
+ import { RunReadLane } from './run-read-lane.js';
14
16
  import { AskError, AskUnsupportedError } from './types.js';
17
+ import { factsFromEvents, runFingerprint, RunFactsFile } from './run-log-facts.js';
15
18
  import { DEFAULT_SETTINGS } from './types.js';
16
19
  import { BASE_SKILL_REF_SHAPE } from '../skills/base-skill.js';
17
- import { execCapped } from './exec.js';
20
+ import { cloneRepository } from './repo-clone.js';
18
21
  import { gitCommitIdents, usableGitIdent } from '../setup/known.js';
19
22
  import { composeDeliverWorkflow, DELIVER_PHASE_ID, deliverPresetStep, deliverIdentityFor, deliverRepoFor, isGitHubLogin, pushIdentityOf, readDeliverOriginUrl } from './deliver.js';
20
23
  import { engineCampaignDef, engineRosterJson } from './engine-roster.js';
@@ -367,6 +370,7 @@ const VIEW_NEUTRAL_CALLS = new Set([
367
370
  'campaignDetail',
368
371
  'sessions',
369
372
  'sessionsDetail',
373
+ 'sessionDetail',
370
374
  'workOutput',
371
375
  'unitTranscript',
372
376
  'runEvents',
@@ -793,6 +797,8 @@ export class CoreAdapter {
793
797
  listeners = new Set();
794
798
  /** F35: the views version, moved by every engine frame (bar the live streams) and every engine call that may write. */
795
799
  viewsEpoch = 0;
800
+ /** crew#1779: one-run reads a frame's listeners start wait in this lane, behind every request's read. */
801
+ runReads = new RunReadLane((runId) => this.runViewRead(runId), (view) => (view === undefined ? undefined : structuredClone(view)));
796
802
  launchListeners = new Set();
797
803
  /** crew#1145: what each engine launch awaits first (`setLaunchGate`); `null` = nothing. */
798
804
  launchGate = null;
@@ -946,6 +952,10 @@ export class CoreAdapter {
946
952
  applyGovernanceStoreEnv(this.governanceStore);
947
953
  this.stub = opts.stub === true;
948
954
  this.dbPath = opts.dbPath;
955
+ this.runFactsFile =
956
+ typeof opts.dbPath === 'string' && opts.dbPath !== '' && opts.dbPath !== ':memory:'
957
+ ? new RunFactsFile(`${opts.dbPath}.run-facts.jsonl`, opts.dbPath)
958
+ : null;
949
959
  // The QE acceptance setting's engine mirror (`syncEngineQeSetting`) must hold BEFORE the engine
950
960
  // arms its bus bridge inside `spawn`, or a bus request in between would launch under the
951
961
  // default: hand the boot value over in the engine's own variable, read at spawn.
@@ -1015,14 +1025,17 @@ export class CoreAdapter {
1015
1025
  // any listener runs, so a read a listener starts sees the change).
1016
1026
  if (!VIEW_NEUTRAL_EVENTS.has(event.type))
1017
1027
  this.viewsEpoch++;
1018
- for (const listener of this.listeners) {
1019
- try {
1020
- listener(event);
1021
- }
1022
- catch {
1023
- /* isolate a faulty listener */
1028
+ // crew#1779: a one-run read any listener starts from here takes the frame lane (`runView`).
1029
+ this.runReads.inFrame(() => {
1030
+ for (const listener of this.listeners) {
1031
+ try {
1032
+ listener(event);
1033
+ }
1034
+ catch {
1035
+ /* isolate a faulty listener */
1036
+ }
1024
1037
  }
1025
- }
1038
+ });
1026
1039
  }
1027
1040
  /**
1028
1041
  * The engine's EVENT-node counter over an estate store (`Core.eventStoreCount`, crew#495's
@@ -1203,6 +1216,10 @@ export class CoreAdapter {
1203
1216
  setDraining(drain) {
1204
1217
  this.drainSince = drain ? (this.drainSince ?? Date.now()) : null;
1205
1218
  }
1219
+ /** Whether new work is refused for maintenance (the launch's stand-in question is not asked of a draining daemon). */
1220
+ isDraining() {
1221
+ return this.drainSince !== null;
1222
+ }
1206
1223
  /** Parked and human-held runs are idle for maintenance, but still hold their repository. */
1207
1224
  async maintenanceState() {
1208
1225
  const active = (await this.sessionsDetail())
@@ -1442,6 +1459,7 @@ export class CoreAdapter {
1442
1459
  credentials, commitIdents) {
1443
1460
  return deliverPresetStep(name, phases, input.sessionId, input.problem, {
1444
1461
  repoRef: input.repoRef ?? null,
1462
+ ...(input.trackerRefs !== undefined ? { trackerRefs: input.trackerRefs } : {}),
1445
1463
  apiOrigin: this.deliverApiOrigin?.() ?? null,
1446
1464
  revisesPr: input.revisesPr ?? null,
1447
1465
  ghAccount: process.env['GH_ACCOUNT'] ?? null,
@@ -1523,6 +1541,12 @@ export class CoreAdapter {
1523
1541
  if (input.extraReadRoots !== undefined && input.extraReadRoots.length > 0) {
1524
1542
  opts.extraReadRoots = input.extraReadRoots;
1525
1543
  }
1544
+ // wicked-core#1463: an older addon ignores the field, which only keeps every read root
1545
+ // required (today's fail-closed behaviour), so it needs no version gate. Widened locally, as
1546
+ // `primary` and `voice` are, so crew still compiles against an addon's older declarations.
1547
+ if (input.optionalReadRoots !== undefined && input.optionalReadRoots.length > 0) {
1548
+ opts.optionalReadRoots = input.optionalReadRoots;
1549
+ }
1526
1550
  if (input.excludeSeats !== undefined && input.excludeSeats.length > 0) {
1527
1551
  // Fail CLOSED on an old addon (napi ignores undeclared fields): a silently-dropped exclusion
1528
1552
  // would let the seat that wrote the work judge it — the one thing the caller asked to rule out.
@@ -1542,6 +1566,17 @@ export class CoreAdapter {
1542
1566
  }
1543
1567
  opts.reducedAssurance = true;
1544
1568
  }
1569
+ // (DES-STANDIN-001 §3.8, K2a) Fail CLOSED on an addon without stand-ins (napi ignores undeclared fields): the
1570
+ // person's consent would be dropped and the run would hold or fail where they were told it would be checked.
1571
+ if (input.standInAware === true) {
1572
+ if (!this.supportsStandIns()) {
1573
+ throw new Error('stand-in checks need a wicked-core-ts that carries them (Core.independencePreflight and grantStandIns); upgrade the engine');
1574
+ }
1575
+ const o = opts;
1576
+ o.standInAware = true;
1577
+ if (input.standIn !== undefined)
1578
+ o.standInJson = JSON.stringify(input.standIn);
1579
+ }
1545
1580
  // (program DES-POWER-MODE) Fail CLOSED on an addon without power mode (napi ignores an undeclared
1546
1581
  // field): the run would launch phased while its launcher reported power mode on.
1547
1582
  if (input.power === true) {
@@ -1724,6 +1759,8 @@ export class CoreAdapter {
1724
1759
  // def and one registration below, never two armed ids.
1725
1760
  composed = composeDeliverWorkflow(composed, input.sessionId, input.problem, {
1726
1761
  repoRef: input.repoRef ?? null,
1762
+ // crew#1352: the tracker issues the launch resolved, so the embedded fallback links them back.
1763
+ ...(input.trackerRefs !== undefined ? { trackerRefs: input.trackerRefs } : {}),
1727
1764
  apiOrigin: this.deliverApiOrigin?.() ?? null,
1728
1765
  // DES-L9: the revised PR (push target) and the push identity for the gate card —
1729
1766
  // GH_ACCOUNT's value and whether GH_TOKEN is exported (presence only, never the value).
@@ -1863,9 +1900,11 @@ export class CoreAdapter {
1863
1900
  return Promise.reject(new PlanGateNoteUnsupportedError());
1864
1901
  }
1865
1902
  const core = this.core;
1903
+ // (crew#1698, core#1808) `expectGateSeq`: the opening of the gate the record showed; the engine refuses a
1904
+ // gate that closed and re-opened since (`gate_changed:`), at the same ord too.
1866
1905
  return plan !== undefined
1867
- ? core.confirmGate(runId, true, note ?? null, 'edit_plan', null, JSON.stringify(plan), actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null)
1868
- : core.confirmGate(runId, approve, amend ?? null, action ?? null, amendScope ?? null, null, actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null);
1906
+ ? core.confirmGate(runId, true, note ?? null, 'edit_plan', null, JSON.stringify(plan), actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null, expect.gateSeq ?? null)
1907
+ : core.confirmGate(runId, approve, amend ?? null, action ?? null, amendScope ?? null, null, actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null, expect.gateSeq ?? null);
1869
1908
  }, undefined, resumesWork);
1870
1909
  }
1871
1910
  return this.handedToEngine('run', runId, () => {
@@ -2027,6 +2066,45 @@ export class CoreAdapter {
2027
2066
  const C = Core;
2028
2067
  return typeof C.supportsPlanSendBack === 'function' && C.supportsPlanSendBack() === true;
2029
2068
  }
2069
+ /** (DES-STANDIN-001 §3.9, §3.10; K2a) The linked engine takes stand-in launches: it carries both the preflight and
2070
+ * the gate grant (method presence, as core-ts documents). Read at call time. */
2071
+ supportsStandIns() {
2072
+ const c = this.core;
2073
+ return typeof c.independencePreflight === 'function' && typeof c.grantStandIns === 'function';
2074
+ }
2075
+ /**
2076
+ * (DES-STANDIN-001 §3.9) Which independent roles this launch would be short of, on the shape it would take: the
2077
+ * engine resolves the contract through the launch's own code. Rejects as the launch would refuse the shape.
2078
+ */
2079
+ async independencePreflight(input) {
2080
+ const core = this.core;
2081
+ const shape = {
2082
+ ...(input.workflow !== undefined ? { workflow: input.workflow } : {}),
2083
+ ...(input.projectId !== undefined ? { projectId: input.projectId } : {}),
2084
+ ...(input.plan !== undefined ? { planJson: JSON.stringify(input.plan) } : {}),
2085
+ ...(input.power === true ? { power: true } : {}),
2086
+ ...(input.primary !== undefined ? { primary: input.primary } : {}),
2087
+ ...(input.excludeSeats !== undefined && input.excludeSeats.length > 0 ? { excludeSeats: input.excludeSeats } : {}),
2088
+ ...(input.skipQeAcceptanceReason !== undefined ? { skipQeAcceptanceReason: input.skipQeAcceptanceReason } : {}),
2089
+ ...(input.forceQeAcceptance === true ? { forceQeAcceptance: true } : {}),
2090
+ repoBound: input.repoRef !== undefined,
2091
+ };
2092
+ return core.independencePreflight(engineRosterJson(input.clisJson), JSON.stringify(shape));
2093
+ }
2094
+ /**
2095
+ * (DES-STANDIN-001 §3.10, crew#1856) USE STAND-INS at the run's open `stand_in_needed` gate: the person's consent
2096
+ * (`scope`) goes on the run and the held check continues. `gateSeq` is the open gate's opening (its durable row's
2097
+ * `gate_seq`), `actor` the server's name for the person. The engine refuses a stale opening (`gate_changed:`).
2098
+ */
2099
+ grantStandIns(runId, scope, gateSeq, actor, ord) {
2100
+ const core = this.core;
2101
+ return this.handedToEngine('run', runId, () => {
2102
+ if (!this.supportsStandIns()) {
2103
+ return Promise.reject(new Error('Using stand-ins at a gate needs a wicked-core-ts with Core.grantStandIns; upgrade the engine'));
2104
+ }
2105
+ return core.grantStandIns(runId, scope, gateSeq, actor, ord ?? null);
2106
+ }, undefined, true);
2107
+ }
2030
2108
  /** (workdoc-all-runs; core lane context-block-core) The linked engine keeps a per-run CONTEXT BLOCK it hands every
2031
2109
  * seat it spawns (`Core.supportsRunContext`). Until it does, crew's working document re-sends the person's context
2032
2110
  * before each later worker step (the standing note). Read at call time. */
@@ -2122,41 +2200,108 @@ export class CoreAdapter {
2122
2200
  }
2123
2201
  /**
2124
2202
  * Each run's launch name as the engine RECORDED it — `sessionStarted.workflowId` from its event
2125
- * log (the preset, the registered def, `<run>:plan-<rev>`, or `null` for free text). Immutable
2126
- * once written, so it is read once per run: a run whose log holds no `sessionStarted` is memoized
2127
- * only once it is terminal (a live run's frame may not be flushed yet; a finished run's never
2128
- * will be). Seam X2 — the one input `resolveRunIdentity` needs that the session record lacks.
2129
- */
2130
- launchedWorkflows = new Map();
2131
- async launchedWorkflowOf(view) {
2203
+ * log (the preset, the registered def, `<run>:plan-<rev>`, or `null` for free text). Seam X2 — the one input
2204
+ * `resolveRunIdentity` needs that the session record lacks.
2205
+ *
2206
+ * crew#1880: read through the run's log FACTS (run-log-facts.ts), one read per run answering both this and the
2207
+ * `ended_at` backfill ({@link runEndedFact}). A read made while the run is terminal is FINAL (its facts settle);
2208
+ * one made while it is live keeps only a found launch name (a live run's frame may not be flushed yet). A final
2209
+ * read's positive facts are kept beside the store, so the next start reads no log for them.
2210
+ */
2211
+ runFactsMemo = new Map();
2212
+ /** One in-flight read per run and kind (a terminal-time read is never answered by a live-time one). */
2213
+ runFactsReads = new Map();
2214
+ /** crew#1880: `<db>.run-facts.jsonl`; null for an in-memory or unnamed store. */
2215
+ runFactsFile;
2216
+ /** One read of a run's log, shared by concurrent callers. `null` = no event-log binding; a failed read throws. */
2217
+ readRunFacts(view) {
2132
2218
  const id = view.session.id;
2133
- if (this.launchedWorkflows.has(id))
2134
- return this.launchedWorkflows.get(id);
2135
- let events;
2219
+ const final = TERMINAL_RUN_STATUSES.has(view.session.status);
2220
+ const key = `${final ? 'T' : 'L'}:${id}`;
2221
+ const inFlight = this.runFactsReads.get(key);
2222
+ if (inFlight !== undefined)
2223
+ return inFlight;
2224
+ const read = (async () => {
2225
+ const events = await this.runEvents(id);
2226
+ if (events === null)
2227
+ return null;
2228
+ const facts = { ...factsFromEvents(events), final };
2229
+ if (final) {
2230
+ this.runFactsMemo.set(id, facts);
2231
+ this.runFactsFile?.put(id, runFingerprint(view.session.problem), facts);
2232
+ }
2233
+ else if (facts.launched !== undefined && this.runFactsMemo.get(id)?.final !== true) {
2234
+ this.runFactsMemo.set(id, facts);
2235
+ }
2236
+ return facts;
2237
+ })();
2238
+ this.runFactsReads.set(key, read);
2239
+ const clear = () => {
2240
+ if (this.runFactsReads.get(key) === read)
2241
+ this.runFactsReads.delete(key);
2242
+ };
2243
+ read.then(clear, clear);
2244
+ return read;
2245
+ }
2246
+ /** The facts kept for this run on disk (bound to its problem). A kept launch name is folded into the in-process
2247
+ * memo (so later folds skip the hash); the memo is FINAL only when both facts were kept (a negative never is). */
2248
+ keptRunFacts(view) {
2249
+ if (this.runFactsFile === null)
2250
+ return undefined;
2251
+ const kept = this.runFactsFile.get(view.session.id, runFingerprint(view.session.problem));
2252
+ if (kept?.launched !== undefined) {
2253
+ this.runFactsMemo.set(view.session.id, {
2254
+ launched: kept.launched,
2255
+ endedAt: kept.endedAt ?? null,
2256
+ final: kept.endedAt !== undefined,
2257
+ });
2258
+ }
2259
+ return kept;
2260
+ }
2261
+ async launchedWorkflowOf(view) {
2262
+ const known = this.runFactsMemo.get(view.session.id);
2263
+ if (known !== undefined && (known.final || known.launched !== undefined))
2264
+ return known.launched;
2265
+ const kept = this.keptRunFacts(view);
2266
+ if (kept?.launched !== undefined)
2267
+ return kept.launched;
2136
2268
  try {
2137
- events = await this.runEvents(id);
2269
+ return (await this.readRunFacts(view))?.launched;
2138
2270
  }
2139
2271
  catch {
2140
2272
  return undefined;
2141
2273
  }
2142
- if (events === null)
2274
+ }
2275
+ /**
2276
+ * crew#1880: a terminal run's FIRST terminal frame `ts` (millis), for the `ended_at` backfill — from the in-process
2277
+ * memo, the kept facts, or one read of its log (shared with the identity read). `null` = the log holds no terminal
2278
+ * frame; `undefined` = no event-log binding. A failed read throws (the backfill retries it on a later request).
2279
+ */
2280
+ async runEndedFact(view) {
2281
+ const known = this.runFactsMemo.get(view.session.id);
2282
+ if (known?.final === true)
2283
+ return known.endedAt;
2284
+ const kept = this.keptRunFacts(view);
2285
+ if (kept?.endedAt !== undefined)
2286
+ return kept.endedAt;
2287
+ const facts = await this.readRunFacts(view);
2288
+ if (facts === null)
2143
2289
  return undefined;
2144
- const started = events.find((e) => e.type === 'sessionStarted');
2145
- // The engine spells it `workflowId` on the frame (core-ts `CoreEventJson`).
2146
- const raw = started?.['workflowId'];
2147
- const launched = started === undefined ? undefined : typeof raw === 'string' ? raw : null;
2148
- if (launched !== undefined || TERMINAL_RUN_STATUSES.has(view.session.status)) {
2149
- this.launchedWorkflows.set(id, launched);
2150
- }
2151
- return launched;
2290
+ return facts.final ? facts.endedAt : null;
2291
+ }
2292
+ /** crew#1880: write the kept facts still buffered (tests; `close` flushes too). */
2293
+ flushRunFacts() {
2294
+ return this.runFactsFile?.flush() ?? Promise.resolve();
2152
2295
  }
2153
2296
  /**
2154
2297
  * (DES-CATALOG-002 §2.3) The name one run was launched under, as the engine recorded it (`sessionStarted.workflowId`):
2155
2298
  * the run fence's fallback for a run crew no longer holds in memory. Memoized once found; `undefined` = not known.
2156
2299
  */
2157
2300
  async launchedWorkflowOfRun(runId) {
2158
- if (this.launchedWorkflows.has(runId))
2159
- return this.launchedWorkflows.get(runId);
2301
+ // As before crew#1880: a found launch name, or a terminal run's settled "none", answers without a read.
2302
+ const known = this.runFactsMemo.get(runId);
2303
+ if (known !== undefined && (known.final || known.launched !== undefined))
2304
+ return known.launched;
2160
2305
  let events;
2161
2306
  try {
2162
2307
  events = await this.runEvents(runId);
@@ -2164,13 +2309,14 @@ export class CoreAdapter {
2164
2309
  catch {
2165
2310
  return undefined;
2166
2311
  }
2167
- const started = events?.find((e) => e.type === 'sessionStarted');
2168
- if (started === undefined)
2312
+ if (events === null)
2313
+ return undefined;
2314
+ const facts = factsFromEvents(events);
2315
+ if (facts.launched === undefined)
2169
2316
  return undefined;
2170
- const raw = started['workflowId'];
2171
- const launched = typeof raw === 'string' ? raw : null;
2172
- this.launchedWorkflows.set(runId, launched);
2173
- return launched;
2317
+ if (known === undefined)
2318
+ this.runFactsMemo.set(runId, { ...facts, final: false });
2319
+ return facts.launched;
2174
2320
  }
2175
2321
  /**
2176
2322
  * Every run + its ordered units, each with its `run_identity` (seam X2) resolved from the engine's
@@ -2188,16 +2334,24 @@ export class CoreAdapter {
2188
2334
  }
2189
2335
  /**
2190
2336
  * One run's view (as `sessionsDetail` serves it), or `undefined` for an unknown id: the caller's own
2191
- * copy of that run only, so a request about one run costs O(1) in the number of runs on the store
2192
- * once the snapshot is read (F35). `fresh`: the caller holds a newer record of the store than the
2193
- * snapshot's (say a gate row the engine wrote before its frame landed), so the run is read from a
2194
- * fold that starts after this call.
2195
- */
2196
- async runView(runId, opts) {
2197
- if (opts?.fresh === true)
2198
- this.viewsEpoch++;
2199
- const view = (await this.viewsRead()).byId.get(runId);
2200
- return view === undefined ? undefined : structuredClone(view);
2337
+ * copy. crew#1775: read through the engine's per-run read (`sessionDetail`, core#1346), off the actor,
2338
+ * so a request about one run never folds the store. The whole-store snapshot was invalidated by every
2339
+ * engine frame, so while runs were active each gate read paid for a fresh fold of every run (and its
2340
+ * parse on the event loop), and studio's per-page gate reads queued behind those folds. The read
2341
+ * starts now, so it is never older than a change this adapter made or a frame it delivered.
2342
+ * crew#1779: a read a frame listener starts takes the frame lane ({@link RunReadLane}): it waits
2343
+ * behind no request's read, and the listeners of one frame share one read of the run.
2344
+ */
2345
+ async runView(runId) {
2346
+ return this.runReads.get(runId);
2347
+ }
2348
+ /** One run's read and its identity, as one operation: the frame lane shares and bounds all of it (crew#1779). */
2349
+ async runViewRead(runId) {
2350
+ const view = JSON.parse(await this.core.sessionDetail(runId));
2351
+ if (view === null)
2352
+ return undefined;
2353
+ await this.resolveIdentities([view]);
2354
+ return view;
2201
2355
  }
2202
2356
  /**
2203
2357
  * The shared, deep-frozen views snapshot itself — the same object for every caller until the store
@@ -2252,7 +2406,7 @@ export class CoreAdapter {
2252
2406
  const views = JSON.parse(await this.core.sessionsDetail());
2253
2407
  await this.resolveIdentities(views);
2254
2408
  deepFreeze(views);
2255
- const done = { epoch, at, snapshot: Object.freeze({ views }), byId: new Map(views.map((v) => [v.session.id, v])) };
2409
+ const done = { epoch, at, snapshot: Object.freeze({ views }) };
2256
2410
  this.viewsLatest = done;
2257
2411
  return done;
2258
2412
  })();
@@ -2703,12 +2857,8 @@ export class CoreAdapter {
2703
2857
  catch { /* not yet cloned */ }
2704
2858
  if (needsClone) {
2705
2859
  try {
2706
- await execCapped('git', ['clone', '--', gitUrl, cloneDir], {
2707
- timeout: 5 * 60 * 1000,
2708
- // crew-0182: a repository that needs a sign-in fails in seconds with git's own reason, instead of waiting on a
2709
- // credential prompt no one can answer until the 5-minute timeout.
2710
- env: { ...process.env, GIT_TERMINAL_PROMPT: '0', ...(opts.allowProtocols !== undefined ? { GIT_ALLOW_PROTOCOL: opts.allowProtocols } : {}) },
2711
- });
2860
+ // crew#1839: an Azure DevOps URL clones with the daemon's Azure DevOps credential when it holds one.
2861
+ await cloneRepository(gitUrl, cloneDir, opts);
2712
2862
  }
2713
2863
  catch (err) {
2714
2864
  // Cleanup is best-effort: swallow any cleanup error so the original
@@ -3130,6 +3280,22 @@ export class CoreAdapter {
3130
3280
  return override;
3131
3281
  return isDefaultStateHome() ? undefined : join(mcpStateDir(), 'evals-knowledge.db');
3132
3282
  }
3283
+ /**
3284
+ * (crew#1128) The memory store the evals' memory axis recalls from (core#397): the store this daemon's workers recall
3285
+ * from ({@link resolveMemoryDbPath}: `WICKED_MEMORY_DB`, else `<state home>/mcp/memory.db`, else the operator's
3286
+ * global store), opened read-only by the engine. `undefined` while that file does not exist: the engine refuses a
3287
+ * run whose `memoryDb` is missing, so a daemon with no memories yet keeps the rules-only report (`memory: null`), and
3288
+ * a sample that declares memories gets the engine's own "no memory store" refusal.
3289
+ */
3290
+ static governanceMemoryDb() {
3291
+ const path = resolveMemoryDbPath();
3292
+ try {
3293
+ return statSync(path).isFile() ? path : undefined;
3294
+ }
3295
+ catch {
3296
+ return undefined;
3297
+ }
3298
+ }
3133
3299
  /**
3134
3300
  * Run the governance evals: every sample of the corpus (`corpus` = an `evals:<name>` estate
3135
3301
  * scope minted by {@link importGovernanceCorpus}; omitted = the engine's built-in default
@@ -3151,10 +3317,12 @@ export class CoreAdapter {
3151
3317
  throw new GovernanceEvalsUnsupportedError('Running governance evals');
3152
3318
  }
3153
3319
  const knowledgeDb = CoreAdapter.governanceKnowledgeDb();
3320
+ const memoryDb = CoreAdapter.governanceMemoryDb();
3154
3321
  const payload = {
3155
3322
  ...(args.type !== undefined ? { type: args.type } : {}),
3156
3323
  ...(args.corpus !== undefined ? { corpus: args.corpus } : {}),
3157
3324
  ...(knowledgeDb !== undefined ? { knowledgeDb } : {}),
3325
+ ...(memoryDb !== undefined ? { memoryDb } : {}),
3158
3326
  dbPath: this.dbPath,
3159
3327
  };
3160
3328
  return parseEngineJson(await fn.call(this.core, JSON.stringify(payload)), 'governanceEvals');
@@ -3507,6 +3675,9 @@ export class CoreAdapter {
3507
3675
  // powerModeDefault (program DES-POWER-MODE): a boolean only; anything else reads as the shipped default (on).
3508
3676
  if ('powerModeDefault' in parsed && typeof parsed.powerModeDefault !== 'boolean')
3509
3677
  delete parsed.powerModeDefault;
3678
+ // standInReview (DES-STANDIN-001 §4): 'ask' | 'always' only; anything else reads as unset ('ask', asked each time).
3679
+ if ('standInReview' in parsed && parsed.standInReview !== 'ask' && parsed.standInReview !== 'always')
3680
+ delete parsed.standInReview;
3510
3681
  // newWorkSeats (F1/F2): a list of seat keys, or null. An invalid value is left out of the settings served (they
3511
3682
  // keep the API's type) but KEPT for the next write (`kept`): new work reads it strictly (`readNewWorkSeats`) and
3512
3683
  // refuses it, and an unrelated write that erased it would quietly widen the pool to every seat.
@@ -3618,6 +3789,7 @@ export class CoreAdapter {
3618
3789
  if (this.closed)
3619
3790
  return;
3620
3791
  this.closed = true;
3792
+ void this.runFactsFile?.flush();
3621
3793
  if (this.engineBus !== null && this.busDbPath !== undefined)
3622
3794
  detachEngineBus(this.busDbPath, this.engineBus);
3623
3795
  this.listeners.clear();