wicked-crew 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (547) hide show
  1. package/README.md +71 -18
  2. package/adapters/web-source.lock +1314 -0
  3. package/dist/api/audit.d.ts +5 -0
  4. package/dist/api/audit.d.ts.map +1 -1
  5. package/dist/api/audit.js +20 -0
  6. package/dist/api/audit.js.map +1 -1
  7. package/dist/api/auth.d.ts.map +1 -1
  8. package/dist/api/auth.js +3 -0
  9. package/dist/api/auth.js.map +1 -1
  10. package/dist/api/chat-context.js +1 -1
  11. package/dist/api/chat-history.d.ts +3 -0
  12. package/dist/api/chat-history.d.ts.map +1 -1
  13. package/dist/api/chat-history.js +6 -1
  14. package/dist/api/chat-history.js.map +1 -1
  15. package/dist/api/chat-jobs.d.ts +192 -0
  16. package/dist/api/chat-jobs.d.ts.map +1 -0
  17. package/dist/api/chat-jobs.js +929 -0
  18. package/dist/api/chat-jobs.js.map +1 -0
  19. package/dist/api/chat-proposals.d.ts +323 -7
  20. package/dist/api/chat-proposals.d.ts.map +1 -1
  21. package/dist/api/chat-proposals.js +1581 -40
  22. package/dist/api/chat-proposals.js.map +1 -1
  23. package/dist/api/chat-requirements.d.ts +54 -0
  24. package/dist/api/chat-requirements.d.ts.map +1 -0
  25. package/dist/api/chat-requirements.js +282 -0
  26. package/dist/api/chat-requirements.js.map +1 -0
  27. package/dist/api/chat-scope.d.ts +56 -0
  28. package/dist/api/chat-scope.d.ts.map +1 -1
  29. package/dist/api/chat-scope.js +175 -5
  30. package/dist/api/chat-scope.js.map +1 -1
  31. package/dist/api/chat-transcripts.d.ts +7 -0
  32. package/dist/api/chat-transcripts.d.ts.map +1 -1
  33. package/dist/api/chat-transcripts.js +17 -1
  34. package/dist/api/chat-transcripts.js.map +1 -1
  35. package/dist/api/delivery-assurance.d.ts.map +1 -1
  36. package/dist/api/delivery-assurance.js +5 -2
  37. package/dist/api/delivery-assurance.js.map +1 -1
  38. package/dist/api/delivery-index.d.ts +109 -5
  39. package/dist/api/delivery-index.d.ts.map +1 -1
  40. package/dist/api/delivery-index.js +199 -7
  41. package/dist/api/delivery-index.js.map +1 -1
  42. package/dist/api/mcp.d.ts +7 -2
  43. package/dist/api/mcp.d.ts.map +1 -1
  44. package/dist/api/mcp.js +1 -1
  45. package/dist/api/mcp.js.map +1 -1
  46. package/dist/api/needs.d.ts.map +1 -1
  47. package/dist/api/needs.js +19 -1
  48. package/dist/api/needs.js.map +1 -1
  49. package/dist/api/product.d.ts +87 -3
  50. package/dist/api/product.d.ts.map +1 -1
  51. package/dist/api/product.js +155 -68
  52. package/dist/api/product.js.map +1 -1
  53. package/dist/api/proposal-theme.d.ts +23 -0
  54. package/dist/api/proposal-theme.d.ts.map +1 -0
  55. package/dist/api/proposal-theme.js +30 -0
  56. package/dist/api/proposal-theme.js.map +1 -0
  57. package/dist/api/recording.d.ts +127 -10
  58. package/dist/api/recording.d.ts.map +1 -1
  59. package/dist/api/recording.js +320 -68
  60. package/dist/api/recording.js.map +1 -1
  61. package/dist/api/repo-input.d.ts +55 -0
  62. package/dist/api/repo-input.d.ts.map +1 -0
  63. package/dist/api/repo-input.js +113 -0
  64. package/dist/api/repo-input.js.map +1 -0
  65. package/dist/api/requirements.d.ts +75 -0
  66. package/dist/api/requirements.d.ts.map +1 -1
  67. package/dist/api/requirements.js +97 -9
  68. package/dist/api/requirements.js.map +1 -1
  69. package/dist/api/review-change.d.ts +64 -0
  70. package/dist/api/review-change.d.ts.map +1 -0
  71. package/dist/api/review-change.js +214 -0
  72. package/dist/api/review-change.js.map +1 -0
  73. package/dist/api/roster-standing.d.ts +4 -0
  74. package/dist/api/roster-standing.d.ts.map +1 -1
  75. package/dist/api/roster-standing.js +43 -10
  76. package/dist/api/roster-standing.js.map +1 -1
  77. package/dist/api/routes.d.ts +138 -12
  78. package/dist/api/routes.d.ts.map +1 -1
  79. package/dist/api/routes.js +1496 -301
  80. package/dist/api/routes.js.map +1 -1
  81. package/dist/api/run-documents.d.ts +97 -0
  82. package/dist/api/run-documents.d.ts.map +1 -0
  83. package/dist/api/run-documents.js +458 -0
  84. package/dist/api/run-documents.js.map +1 -0
  85. package/dist/api/run-sources.d.ts +51 -0
  86. package/dist/api/run-sources.d.ts.map +1 -0
  87. package/dist/api/run-sources.js +133 -0
  88. package/dist/api/run-sources.js.map +1 -0
  89. package/dist/api/run-timing-index.d.ts +12 -1
  90. package/dist/api/run-timing-index.d.ts.map +1 -1
  91. package/dist/api/run-timing-index.js +35 -0
  92. package/dist/api/run-timing-index.js.map +1 -1
  93. package/dist/api/runtime-state.d.ts +41 -0
  94. package/dist/api/runtime-state.d.ts.map +1 -0
  95. package/dist/api/runtime-state.js +75 -0
  96. package/dist/api/runtime-state.js.map +1 -0
  97. package/dist/api/seat-container-login.d.ts +51 -0
  98. package/dist/api/seat-container-login.d.ts.map +1 -1
  99. package/dist/api/seat-container-login.js +317 -1
  100. package/dist/api/seat-container-login.js.map +1 -1
  101. package/dist/api/seat-images.d.ts.map +1 -1
  102. package/dist/api/seat-images.js +7 -0
  103. package/dist/api/seat-images.js.map +1 -1
  104. package/dist/api/server.d.ts +7 -0
  105. package/dist/api/server.d.ts.map +1 -1
  106. package/dist/api/server.js +207 -26
  107. package/dist/api/server.js.map +1 -1
  108. package/dist/api/skills.d.ts +8 -0
  109. package/dist/api/skills.d.ts.map +1 -1
  110. package/dist/api/skills.js +21 -0
  111. package/dist/api/skills.js.map +1 -1
  112. package/dist/api/system-snapshot.d.ts +3 -2
  113. package/dist/api/system-snapshot.d.ts.map +1 -1
  114. package/dist/api/system-snapshot.js +19 -6
  115. package/dist/api/system-snapshot.js.map +1 -1
  116. package/dist/api/testing.d.ts +3 -3
  117. package/dist/api/ui-text.d.ts +45 -0
  118. package/dist/api/ui-text.d.ts.map +1 -0
  119. package/dist/api/ui-text.js +188 -0
  120. package/dist/api/ui-text.js.map +1 -0
  121. package/dist/apps/actions/card.d.ts +62 -0
  122. package/dist/apps/actions/card.d.ts.map +1 -0
  123. package/dist/apps/actions/card.js +111 -0
  124. package/dist/apps/actions/card.js.map +1 -0
  125. package/dist/apps/actions/write-path.d.ts.map +1 -1
  126. package/dist/apps/actions/write-path.js +26 -77
  127. package/dist/apps/actions/write-path.js.map +1 -1
  128. package/dist/apps/exec/sources.d.ts.map +1 -1
  129. package/dist/apps/exec/sources.js +3 -0
  130. package/dist/apps/exec/sources.js.map +1 -1
  131. package/dist/apps/exec/texts.d.ts +1 -1
  132. package/dist/apps/publish/artifacts.d.ts +18 -0
  133. package/dist/apps/publish/artifacts.d.ts.map +1 -0
  134. package/dist/apps/publish/artifacts.js +87 -0
  135. package/dist/apps/publish/artifacts.js.map +1 -0
  136. package/dist/apps/publish/check.d.ts +103 -0
  137. package/dist/apps/publish/check.d.ts.map +1 -0
  138. package/dist/apps/publish/check.js +235 -0
  139. package/dist/apps/publish/check.js.map +1 -0
  140. package/dist/apps/publish/image.d.ts +2 -0
  141. package/dist/apps/publish/image.d.ts.map +1 -1
  142. package/dist/apps/publish/image.js +2 -1
  143. package/dist/apps/publish/image.js.map +1 -1
  144. package/dist/apps/publish/render.d.ts +71 -0
  145. package/dist/apps/publish/render.d.ts.map +1 -0
  146. package/dist/apps/publish/render.js +122 -0
  147. package/dist/apps/publish/render.js.map +1 -0
  148. package/dist/apps/publish/run.d.ts +35 -0
  149. package/dist/apps/publish/run.d.ts.map +1 -0
  150. package/dist/apps/publish/run.js +127 -0
  151. package/dist/apps/publish/run.js.map +1 -0
  152. package/dist/apps/routes.d.ts +54 -2
  153. package/dist/apps/routes.d.ts.map +1 -1
  154. package/dist/apps/routes.js +124 -7
  155. package/dist/apps/routes.js.map +1 -1
  156. package/dist/apps/spec.d.ts +8 -8
  157. package/dist/apps/store.d.ts +84 -5
  158. package/dist/apps/store.d.ts.map +1 -1
  159. package/dist/apps/store.js +191 -4
  160. package/dist/apps/store.js.map +1 -1
  161. package/dist/apps/turns.d.ts +19 -1
  162. package/dist/apps/turns.d.ts.map +1 -1
  163. package/dist/apps/turns.js +60 -2
  164. package/dist/apps/turns.js.map +1 -1
  165. package/dist/apps/views.d.ts +5 -1
  166. package/dist/apps/views.d.ts.map +1 -1
  167. package/dist/apps/views.js +18 -7
  168. package/dist/apps/views.js.map +1 -1
  169. package/dist/apps-server/Dockerfile +25 -0
  170. package/dist/apps-server/runners/sqlite-runner.mjs +110 -0
  171. package/dist/apps-server/server/lib/bundle/server.mjs +92523 -0
  172. package/dist/apps-server/server/node_modules/@pgsql/types/LICENSE +22 -0
  173. package/dist/apps-server/server/node_modules/@pgsql/types/README.md +106 -0
  174. package/dist/apps-server/server/node_modules/@pgsql/types/enums.d.ts +76 -0
  175. package/dist/apps-server/server/node_modules/@pgsql/types/enums.js +2 -0
  176. package/dist/apps-server/server/node_modules/@pgsql/types/esm/enums.js +1 -0
  177. package/dist/apps-server/server/node_modules/@pgsql/types/esm/index.js +2 -0
  178. package/dist/apps-server/server/node_modules/@pgsql/types/esm/types.js +1 -0
  179. package/dist/apps-server/server/node_modules/@pgsql/types/index.d.ts +2 -0
  180. package/dist/apps-server/server/node_modules/@pgsql/types/index.js +18 -0
  181. package/dist/apps-server/server/node_modules/@pgsql/types/package.json +36 -0
  182. package/dist/apps-server/server/node_modules/@pgsql/types/types.d.ts +2488 -0
  183. package/dist/apps-server/server/node_modules/@pgsql/types/types.js +2 -0
  184. package/dist/apps-server/server/node_modules/libpg-query/LICENSE +22 -0
  185. package/dist/apps-server/server/node_modules/libpg-query/README.md +275 -0
  186. package/dist/apps-server/server/node_modules/libpg-query/package.json +58 -0
  187. package/dist/apps-server/server/node_modules/libpg-query/wasm/index.cjs +369 -0
  188. package/dist/apps-server/server/node_modules/libpg-query/wasm/index.d.ts +48 -0
  189. package/dist/apps-server/server/node_modules/libpg-query/wasm/index.js +344 -0
  190. package/dist/apps-server/server/node_modules/libpg-query/wasm/libpg-query.js +2 -0
  191. package/dist/apps-server/server/node_modules/libpg-query/wasm/libpg-query.wasm +0 -0
  192. package/dist/apps-server/server/shim/host.css +22 -0
  193. package/dist/apps-server/server/shim/host.js +1 -0
  194. package/dist/cli/apps-check.d.ts +18 -0
  195. package/dist/cli/apps-check.d.ts.map +1 -1
  196. package/dist/cli/apps-check.js +179 -5
  197. package/dist/cli/apps-check.js.map +1 -1
  198. package/dist/cli/apps-produce.d.ts +9 -0
  199. package/dist/cli/apps-produce.d.ts.map +1 -0
  200. package/dist/cli/apps-produce.js +27 -0
  201. package/dist/cli/apps-produce.js.map +1 -0
  202. package/dist/cli/index.d.ts.map +1 -1
  203. package/dist/cli/index.js +15 -3
  204. package/dist/cli/index.js.map +1 -1
  205. package/dist/cli/insights-facts.d.ts +17 -0
  206. package/dist/cli/insights-facts.d.ts.map +1 -0
  207. package/dist/cli/insights-facts.js +56 -0
  208. package/dist/cli/insights-facts.js.map +1 -0
  209. package/dist/core/adapter.d.ts +85 -16
  210. package/dist/core/adapter.d.ts.map +1 -1
  211. package/dist/core/adapter.js +274 -54
  212. package/dist/core/adapter.js.map +1 -1
  213. package/dist/core/builtin-catalog.d.ts.map +1 -1
  214. package/dist/core/builtin-catalog.js +2 -0
  215. package/dist/core/builtin-catalog.js.map +1 -1
  216. package/dist/core/deliver-text.d.ts +42 -6
  217. package/dist/core/deliver-text.d.ts.map +1 -1
  218. package/dist/core/deliver-text.js +204 -27
  219. package/dist/core/deliver-text.js.map +1 -1
  220. package/dist/core/deliver.d.ts.map +1 -1
  221. package/dist/core/deliver.js +28 -7
  222. package/dist/core/deliver.js.map +1 -1
  223. package/dist/core/engine-roster.d.ts.map +1 -1
  224. package/dist/core/engine-roster.js +1 -0
  225. package/dist/core/engine-roster.js.map +1 -1
  226. package/dist/core/estate-mcp-client.d.ts +3 -2
  227. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  228. package/dist/core/estate-mcp-client.js +3 -2
  229. package/dist/core/estate-mcp-client.js.map +1 -1
  230. package/dist/core/qe-acceptance-setting.d.ts.map +1 -1
  231. package/dist/core/qe-acceptance-setting.js +6 -0
  232. package/dist/core/qe-acceptance-setting.js.map +1 -1
  233. package/dist/core/run-identity.d.ts.map +1 -1
  234. package/dist/core/run-identity.js +3 -0
  235. package/dist/core/run-identity.js.map +1 -1
  236. package/dist/core/types.d.ts +5 -0
  237. package/dist/core/types.d.ts.map +1 -1
  238. package/dist/core/types.js.map +1 -1
  239. package/dist/editors/conformance-runtime.d.ts +107 -0
  240. package/dist/editors/conformance-runtime.d.ts.map +1 -1
  241. package/dist/editors/conformance-runtime.js +268 -13
  242. package/dist/editors/conformance-runtime.js.map +1 -1
  243. package/dist/editors/csp.d.ts +2 -2
  244. package/dist/editors/csp.d.ts.map +1 -1
  245. package/dist/editors/csp.js +4 -2
  246. package/dist/editors/csp.js.map +1 -1
  247. package/dist/editors/pack-install.d.ts +28 -13
  248. package/dist/editors/pack-install.d.ts.map +1 -1
  249. package/dist/editors/pack-install.js +96 -48
  250. package/dist/editors/pack-install.js.map +1 -1
  251. package/dist/editors/registry.d.ts +111 -8
  252. package/dist/editors/registry.d.ts.map +1 -1
  253. package/dist/editors/registry.js +183 -7
  254. package/dist/editors/registry.js.map +1 -1
  255. package/dist/editors/routes.d.ts +66 -13
  256. package/dist/editors/routes.d.ts.map +1 -1
  257. package/dist/editors/routes.js +277 -44
  258. package/dist/editors/routes.js.map +1 -1
  259. package/dist/evals/replay.d.ts +6 -0
  260. package/dist/evals/replay.d.ts.map +1 -1
  261. package/dist/evals/replay.js +24 -1
  262. package/dist/evals/replay.js.map +1 -1
  263. package/dist/evals/routes.d.ts.map +1 -1
  264. package/dist/evals/routes.js +17 -2
  265. package/dist/evals/routes.js.map +1 -1
  266. package/dist/evals/runner.d.ts.map +1 -1
  267. package/dist/evals/runner.js +5 -0
  268. package/dist/evals/runner.js.map +1 -1
  269. package/dist/evals/shape-corrections.d.ts +146 -0
  270. package/dist/evals/shape-corrections.d.ts.map +1 -0
  271. package/dist/evals/shape-corrections.js +394 -0
  272. package/dist/evals/shape-corrections.js.map +1 -0
  273. package/dist/evals/shape.d.ts +145 -0
  274. package/dist/evals/shape.d.ts.map +1 -0
  275. package/dist/evals/shape.js +376 -0
  276. package/dist/evals/shape.js.map +1 -0
  277. package/dist/evals/types.d.ts +2 -2
  278. package/dist/evals/types.d.ts.map +1 -1
  279. package/dist/evals/types.js +2 -1
  280. package/dist/evals/types.js.map +1 -1
  281. package/dist/insights/analyze.d.ts +14 -1
  282. package/dist/insights/analyze.d.ts.map +1 -1
  283. package/dist/insights/analyze.js +35 -8
  284. package/dist/insights/analyze.js.map +1 -1
  285. package/dist/insights/cost.d.ts +123 -0
  286. package/dist/insights/cost.d.ts.map +1 -0
  287. package/dist/insights/cost.js +221 -0
  288. package/dist/insights/cost.js.map +1 -0
  289. package/dist/insights/review-service.d.ts +20 -1
  290. package/dist/insights/review-service.d.ts.map +1 -1
  291. package/dist/insights/review-service.js +50 -25
  292. package/dist/insights/review-service.js.map +1 -1
  293. package/dist/insights/routes.d.ts +29 -0
  294. package/dist/insights/routes.d.ts.map +1 -1
  295. package/dist/insights/routes.js +62 -0
  296. package/dist/insights/routes.js.map +1 -1
  297. package/dist/insights/run-facts.d.ts +16 -0
  298. package/dist/insights/run-facts.d.ts.map +1 -1
  299. package/dist/insights/run-facts.js +26 -3
  300. package/dist/insights/run-facts.js.map +1 -1
  301. package/dist/interactive/bridge-pool.d.ts +11 -2
  302. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  303. package/dist/interactive/bridge-pool.js +10 -1
  304. package/dist/interactive/bridge-pool.js.map +1 -1
  305. package/dist/interactive/chat-events.d.ts +74 -1
  306. package/dist/interactive/chat-events.d.ts.map +1 -1
  307. package/dist/interactive/chat-events.js +338 -6
  308. package/dist/interactive/chat-events.js.map +1 -1
  309. package/dist/interactive/doc-binding.d.ts +15 -0
  310. package/dist/interactive/doc-binding.d.ts.map +1 -1
  311. package/dist/interactive/doc-binding.js +4 -0
  312. package/dist/interactive/doc-binding.js.map +1 -1
  313. package/dist/interactive/doc-checks-routes.d.ts +34 -1
  314. package/dist/interactive/doc-checks-routes.d.ts.map +1 -1
  315. package/dist/interactive/doc-checks-routes.js +84 -0
  316. package/dist/interactive/doc-checks-routes.js.map +1 -1
  317. package/dist/interactive/draft-events.d.ts +7 -0
  318. package/dist/interactive/draft-events.d.ts.map +1 -1
  319. package/dist/interactive/draft-events.js +38 -6
  320. package/dist/interactive/draft-events.js.map +1 -1
  321. package/dist/interactive/draft-skill.d.ts +76 -6
  322. package/dist/interactive/draft-skill.d.ts.map +1 -1
  323. package/dist/interactive/draft-skill.js +219 -17
  324. package/dist/interactive/draft-skill.js.map +1 -1
  325. package/dist/interactive/edit-events.d.ts.map +1 -1
  326. package/dist/interactive/edit-events.js +4 -2
  327. package/dist/interactive/edit-events.js.map +1 -1
  328. package/dist/interactive/landing-guard.d.ts +47 -0
  329. package/dist/interactive/landing-guard.d.ts.map +1 -0
  330. package/dist/interactive/landing-guard.js +43 -0
  331. package/dist/interactive/landing-guard.js.map +1 -0
  332. package/dist/interactive/landing-record.d.ts +68 -0
  333. package/dist/interactive/landing-record.d.ts.map +1 -0
  334. package/dist/interactive/landing-record.js +154 -0
  335. package/dist/interactive/landing-record.js.map +1 -0
  336. package/dist/interactive/proposal-create.d.ts +3 -1
  337. package/dist/interactive/proposal-create.d.ts.map +1 -1
  338. package/dist/interactive/proposal-create.js +14 -2
  339. package/dist/interactive/proposal-create.js.map +1 -1
  340. package/dist/interactive/proposal-refine.d.ts +48 -0
  341. package/dist/interactive/proposal-refine.d.ts.map +1 -0
  342. package/dist/interactive/proposal-refine.js +99 -0
  343. package/dist/interactive/proposal-refine.js.map +1 -0
  344. package/dist/interactive/protected-edits.d.ts +67 -0
  345. package/dist/interactive/protected-edits.d.ts.map +1 -0
  346. package/dist/interactive/protected-edits.js +160 -0
  347. package/dist/interactive/protected-edits.js.map +1 -0
  348. package/dist/interactive/proxy-routes.js +2 -2
  349. package/dist/interactive/review-events.js +1 -1
  350. package/dist/interactive/run-units.d.ts +1 -1
  351. package/dist/interactive/run-units.d.ts.map +1 -1
  352. package/dist/interactive/run-units.js +8 -2
  353. package/dist/interactive/run-units.js.map +1 -1
  354. package/dist/interactive/source-packet.d.ts +66 -1
  355. package/dist/interactive/source-packet.d.ts.map +1 -1
  356. package/dist/interactive/source-packet.js +309 -60
  357. package/dist/interactive/source-packet.js.map +1 -1
  358. package/dist/interactive/theme-events.js +1 -1
  359. package/dist/knowledge/adapters/web/egress.d.ts +99 -0
  360. package/dist/knowledge/adapters/web/egress.d.ts.map +1 -0
  361. package/dist/knowledge/adapters/web/egress.js +330 -0
  362. package/dist/knowledge/adapters/web/egress.js.map +1 -0
  363. package/dist/knowledge/adapters/web/engine.d.ts +54 -0
  364. package/dist/knowledge/adapters/web/engine.d.ts.map +1 -0
  365. package/dist/knowledge/adapters/web/engine.js +101 -0
  366. package/dist/knowledge/adapters/web/engine.js.map +1 -0
  367. package/dist/knowledge/adapters/web/fetch.d.ts +131 -0
  368. package/dist/knowledge/adapters/web/fetch.d.ts.map +1 -0
  369. package/dist/knowledge/adapters/web/fetch.js +325 -0
  370. package/dist/knowledge/adapters/web/fetch.js.map +1 -0
  371. package/dist/knowledge/adapters/web/gate-web.d.ts +182 -0
  372. package/dist/knowledge/adapters/web/gate-web.d.ts.map +1 -0
  373. package/dist/knowledge/adapters/web/gate-web.js +496 -0
  374. package/dist/knowledge/adapters/web/gate-web.js.map +1 -0
  375. package/dist/knowledge/adapters/web/routes.d.ts +36 -0
  376. package/dist/knowledge/adapters/web/routes.d.ts.map +1 -0
  377. package/dist/knowledge/adapters/web/routes.js +99 -0
  378. package/dist/knowledge/adapters/web/routes.js.map +1 -0
  379. package/dist/knowledge/adapters/web/searxng.d.ts +89 -0
  380. package/dist/knowledge/adapters/web/searxng.d.ts.map +1 -0
  381. package/dist/knowledge/adapters/web/searxng.js +274 -0
  382. package/dist/knowledge/adapters/web/searxng.js.map +1 -0
  383. package/dist/knowledge/adapters/web/source.d.ts +65 -0
  384. package/dist/knowledge/adapters/web/source.d.ts.map +1 -0
  385. package/dist/knowledge/adapters/web/source.js +192 -0
  386. package/dist/knowledge/adapters/web/source.js.map +1 -0
  387. package/dist/knowledge/gate/gate.d.ts +22 -0
  388. package/dist/knowledge/gate/gate.d.ts.map +1 -1
  389. package/dist/knowledge/gate/gate.js +62 -1
  390. package/dist/knowledge/gate/gate.js.map +1 -1
  391. package/dist/knowledge/gate/sources.d.ts +2 -0
  392. package/dist/knowledge/gate/sources.d.ts.map +1 -1
  393. package/dist/knowledge/gate/sources.js +5 -2
  394. package/dist/knowledge/gate/sources.js.map +1 -1
  395. package/dist/knowledge/package.d.ts +7 -0
  396. package/dist/knowledge/package.d.ts.map +1 -1
  397. package/dist/knowledge/package.js +15 -1
  398. package/dist/knowledge/package.js.map +1 -1
  399. package/dist/knowledge/trackers/actions.js +1 -1
  400. package/dist/knowledge/trackers/actions.js.map +1 -1
  401. package/dist/knowledge/trackers/bindings.d.ts +3 -3
  402. package/dist/knowledge/trackers/bindings.d.ts.map +1 -1
  403. package/dist/knowledge/trackers/bindings.js +36 -23
  404. package/dist/knowledge/trackers/bindings.js.map +1 -1
  405. package/dist/knowledge/trackers/routes.js +1 -1
  406. package/dist/knowledge/trackers/routes.js.map +1 -1
  407. package/dist/learnings/service.d.ts.map +1 -1
  408. package/dist/learnings/service.js +2 -0
  409. package/dist/learnings/service.js.map +1 -1
  410. package/dist/mcp/broker.d.ts +8 -0
  411. package/dist/mcp/broker.d.ts.map +1 -1
  412. package/dist/mcp/broker.js +48 -3
  413. package/dist/mcp/broker.js.map +1 -1
  414. package/dist/mcp/estate-relay.d.ts +43 -1
  415. package/dist/mcp/estate-relay.d.ts.map +1 -1
  416. package/dist/mcp/estate-relay.js +38 -2
  417. package/dist/mcp/estate-relay.js.map +1 -1
  418. package/dist/mcp/registry.d.ts +6 -0
  419. package/dist/mcp/registry.d.ts.map +1 -1
  420. package/dist/mcp/registry.js +42 -3
  421. package/dist/mcp/registry.js.map +1 -1
  422. package/dist/mcp/run-fence.d.ts +57 -0
  423. package/dist/mcp/run-fence.d.ts.map +1 -0
  424. package/dist/mcp/run-fence.js +86 -0
  425. package/dist/mcp/run-fence.js.map +1 -0
  426. package/dist/mcp/tool-list.d.ts +5 -0
  427. package/dist/mcp/tool-list.d.ts.map +1 -1
  428. package/dist/mcp/tool-list.js +7 -3
  429. package/dist/mcp/tool-list.js.map +1 -1
  430. package/dist/presets/routes.d.ts.map +1 -1
  431. package/dist/presets/routes.js +6 -0
  432. package/dist/presets/routes.js.map +1 -1
  433. package/dist/projects/routes.d.ts +1 -1
  434. package/dist/projects/state-home-preflight.d.ts.map +1 -1
  435. package/dist/projects/state-home-preflight.js +2 -0
  436. package/dist/projects/state-home-preflight.js.map +1 -1
  437. package/dist/setup/tool-path.d.ts +16 -0
  438. package/dist/setup/tool-path.d.ts.map +1 -0
  439. package/dist/setup/tool-path.js +66 -0
  440. package/dist/setup/tool-path.js.map +1 -0
  441. package/dist/skills/plugin-source.d.ts +42 -88
  442. package/dist/skills/plugin-source.d.ts.map +1 -1
  443. package/dist/skills/plugin-source.js +140 -100
  444. package/dist/skills/plugin-source.js.map +1 -1
  445. package/dist/skills/runtime.d.ts.map +1 -1
  446. package/dist/skills/runtime.js +15 -7
  447. package/dist/skills/runtime.js.map +1 -1
  448. package/dist/skills/store.d.ts.map +1 -1
  449. package/dist/skills/store.js +25 -14
  450. package/dist/skills/store.js.map +1 -1
  451. package/dist/skills/usage.d.ts +238 -0
  452. package/dist/skills/usage.d.ts.map +1 -0
  453. package/dist/skills/usage.js +789 -0
  454. package/dist/skills/usage.js.map +1 -0
  455. package/dist/skills/venv.d.ts +18 -2
  456. package/dist/skills/venv.d.ts.map +1 -1
  457. package/dist/skills/venv.js +2 -2
  458. package/dist/skills/venv.js.map +1 -1
  459. package/dist/sources/routes.d.ts +3 -1
  460. package/dist/sources/routes.d.ts.map +1 -1
  461. package/dist/sources/routes.js +11 -0
  462. package/dist/sources/routes.js.map +1 -1
  463. package/dist/standing-orders/parse.d.ts +19 -0
  464. package/dist/standing-orders/parse.d.ts.map +1 -1
  465. package/dist/standing-orders/parse.js +61 -18
  466. package/dist/standing-orders/parse.js.map +1 -1
  467. package/dist/studio/apps-standalone/fixture.html +12 -0
  468. package/dist/studio/apps-standalone/fixture.js +10 -0
  469. package/dist/studio/apps-standalone/runtime.css +139 -0
  470. package/dist/studio/apps-standalone/runtime.js +1 -0
  471. package/dist/studio/assets/{KnowledgeGraph-Cpm46tEp.js → KnowledgeGraph-AtkRlS3c.js} +1 -1
  472. package/dist/studio/assets/index-CdbCAs7s.css +32 -0
  473. package/dist/studio/assets/index-DU_8o4uq.js +1104 -0
  474. package/dist/studio/editors/wicked-apps/editor.json +1 -1
  475. package/dist/studio/editors/wicked-apps/index.html +2 -2
  476. package/dist/studio/editors/wicked-deck/editor.json +1 -1
  477. package/dist/studio/editors/wicked-deck/index.html +14 -1
  478. package/dist/studio/editors/wicked-doc/editor.json +1 -1
  479. package/dist/studio/editors/wicked-doc/index.html +1 -1
  480. package/dist/studio/editors/wicked-insights/editor.json +1 -1
  481. package/dist/studio/editors/wicked-insights/index.html +1 -1
  482. package/dist/studio/editors/wicked-page/editor.json +10 -1
  483. package/dist/studio/editors/wicked-page/index.html +2 -2
  484. package/dist/studio/editors/wicked-video/editor.json +7 -2
  485. package/dist/studio/editors/wicked-video/index.html +14 -11
  486. package/dist/studio/index.html +2 -2
  487. package/dist/studio/testid-inventory.json +2069 -242
  488. package/dist/team/routes.d.ts +11 -1
  489. package/dist/team/routes.d.ts.map +1 -1
  490. package/dist/team/routes.js +27 -0
  491. package/dist/team/routes.js.map +1 -1
  492. package/dist/workflow-catalog/build-v2.d.ts +94 -0
  493. package/dist/workflow-catalog/build-v2.d.ts.map +1 -0
  494. package/dist/workflow-catalog/build-v2.js +551 -0
  495. package/dist/workflow-catalog/build-v2.js.map +1 -0
  496. package/dist/workflow-catalog/catalog-data-v2.d.ts +12 -0
  497. package/dist/workflow-catalog/catalog-data-v2.d.ts.map +1 -0
  498. package/dist/workflow-catalog/catalog-data-v2.js +2787 -0
  499. package/dist/workflow-catalog/catalog-data-v2.js.map +1 -0
  500. package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
  501. package/dist/workflow-catalog/catalog-data.js +2 -20
  502. package/dist/workflow-catalog/catalog-data.js.map +1 -1
  503. package/dist/workflow-catalog/detect-service.d.ts +95 -0
  504. package/dist/workflow-catalog/detect-service.d.ts.map +1 -0
  505. package/dist/workflow-catalog/detect-service.js +239 -0
  506. package/dist/workflow-catalog/detect-service.js.map +1 -0
  507. package/dist/workflow-catalog/detect.d.ts +213 -0
  508. package/dist/workflow-catalog/detect.d.ts.map +1 -0
  509. package/dist/workflow-catalog/detect.js +653 -0
  510. package/dist/workflow-catalog/detect.js.map +1 -0
  511. package/dist/workflow-catalog/seeds-v2.d.ts +91 -0
  512. package/dist/workflow-catalog/seeds-v2.d.ts.map +1 -0
  513. package/dist/workflow-catalog/seeds-v2.js +2 -0
  514. package/dist/workflow-catalog/seeds-v2.js.map +1 -0
  515. package/dist/workflow-catalog/shape.d.ts +99 -0
  516. package/dist/workflow-catalog/shape.d.ts.map +1 -0
  517. package/dist/workflow-catalog/shape.js +103 -0
  518. package/dist/workflow-catalog/shape.js.map +1 -0
  519. package/dist/working-doc/bridge-backend.js +2 -2
  520. package/dist/working-doc/event-lines.d.ts +67 -2
  521. package/dist/working-doc/event-lines.d.ts.map +1 -1
  522. package/dist/working-doc/event-lines.js +155 -8
  523. package/dist/working-doc/event-lines.js.map +1 -1
  524. package/dist/working-doc/notes-index.d.ts +35 -0
  525. package/dist/working-doc/notes-index.d.ts.map +1 -0
  526. package/dist/working-doc/notes-index.js +82 -0
  527. package/dist/working-doc/notes-index.js.map +1 -0
  528. package/dist/working-doc/routes.js +4 -4
  529. package/dist/working-doc/sections.js +2 -2
  530. package/dist/working-doc/service.d.ts +260 -21
  531. package/dist/working-doc/service.d.ts.map +1 -1
  532. package/dist/working-doc/service.js +791 -90
  533. package/dist/working-doc/service.js.map +1 -1
  534. package/dist/working-doc/store.d.ts +50 -1
  535. package/dist/working-doc/store.d.ts.map +1 -1
  536. package/dist/working-doc/store.js +4 -1
  537. package/dist/working-doc/store.js.map +1 -1
  538. package/endpoint-manifest.json +219 -5
  539. package/evals/corpora/shape-corrections-v1.json +594 -0
  540. package/evals/corpora/shape-corrections-v1.seat-fixture.json +186 -0
  541. package/evals/corpora/shape-v1.json +2113 -0
  542. package/evals/corpora/shape-v1.seat-fixture.json +1800 -0
  543. package/package.json +31 -8
  544. package/scripts/apps-render.py +226 -0
  545. package/workflows/detect-shape.json +29 -0
  546. package/dist/studio/assets/index-BRBwWQMH.css +0 -32
  547. package/dist/studio/assets/index-CVrWDGRP.js +0 -1097
@@ -7,6 +7,7 @@ import { join, resolve as resolvePath } from 'node:path';
7
7
  import { fileURLToPath } from 'node:url';
8
8
  import { DecisionLedger } from '../decisions/ledger.js';
9
9
  import { requestOrigin, shellCsp } from '../editors/csp.js';
10
+ import { conformanceRuntimeRoot, exportEngineConformanceEnv, exportManagedChrome, managedChromium } from '../editors/conformance-runtime.js';
10
11
  import { launchRosterNaming, registerRoutes } from './routes.js';
11
12
  import { APPS_ACTIONS_STATE_FILENAME, AppActionStore } from '../apps/actions/store.js';
12
13
  import { AppsSourceStage } from '../apps/exec/source-stage.js';
@@ -21,6 +22,8 @@ import { registerAuthHooks, resolveAuth } from './auth.js';
21
22
  import { corsAllowed, refuseRequest } from './origin-guard.js';
22
23
  import { guardUpgrades, registerFrameGuard } from './frame-guard.js';
23
24
  import { registerServerErrorBody } from './server-error-body.js';
25
+ import { registerUiTextScrub } from './ui-text.js';
26
+ import { API_PREFIX } from './api-prefix.js';
24
27
  import { AuditLog } from './audit.js';
25
28
  import { defaultEvalStoreRoot, EvalRunStore } from './eval-store.js';
26
29
  import { DefaultEvalStore } from '../evals/store.js';
@@ -29,6 +32,7 @@ import { GroupIndex } from './group-index.js';
29
32
  import { RunTimingIndex, recordRunLaunched } from './run-timing-index.js';
30
33
  import { OnboardingCaptureChain } from './onboarding-capture.js';
31
34
  import { INSPECT_WORKFLOW, InspectService, defaultInspectionsDir, loadInspectWorkflow } from '../inspect/service.js';
35
+ import { DETECT_WORKFLOW, loadDetectWorkflow } from '../workflow-catalog/detect-service.js';
32
36
  import { registerInspectRoutes } from '../inspect/routes.js';
33
37
  import { DISTILL_WORKFLOW, RunLearningsService, defaultLearningsDir, loadDistillWorkflow, runLearningsMode } from '../learnings/service.js';
34
38
  import { memoryContents, proposalRows, submitLearning } from '../learnings/estate.js';
@@ -39,7 +43,7 @@ import { PersonaStore } from '../persona/store.js';
39
43
  import { registerSetupRoutes } from '../setup/routes.js';
40
44
  import { voiceBlock } from '../persona/voice.js';
41
45
  import { VoiceInjectInputs } from '../voice/inject-input.js';
42
- import { registerInsightsRoutes } from '../insights/routes.js';
46
+ import { factsUnitResolver, registerInsightsRoutes } from '../insights/routes.js';
43
47
  import { ReviewService } from '../insights/review-service.js';
44
48
  import { InsightsStore } from '../insights/store.js';
45
49
  import { ANALYZE_CLI, REVIEW_WORKFLOW, defaultReviewsDir, loadReviewWorkflow } from '../insights/workflow.js';
@@ -52,7 +56,7 @@ import { LearnScheduleStore } from '../learn/schedule-store.js';
52
56
  import { GuidanceIndex } from './guidance-index.js';
53
57
  import { ChatScopeIndex, reapStaleChatNamespaces } from './chat-scope.js';
54
58
  import { chatCitationDeps, citationsFrame, verifyCitations, } from './chat-citations.js';
55
- import { DeliveryIndex, DeliveryResolver, gitRunBranchIsEmpty, gitWorktreeIsClean, canDeliverResolver, deliverUnitOf, } from './delivery-index.js';
59
+ import { DeliveryIndex, DeliveryResolver, gitRunBranchIsEmpty, gitWorktreeIsClean, canDeliverResolver, deliverUnitOf, deliveredCommitFor, recordDelivery, } from './delivery-index.js';
56
60
  import { CodebaseArchiveStore, archiveKey, deliverDispatchKey } from './codebase-archive.js';
57
61
  import { DeliveryFreeze } from './delivery-freeze.js';
58
62
  import { DeliveryDerivationCache } from './delivery-cache.js';
@@ -72,7 +76,8 @@ import { DocRunIndex } from '../interactive/doc-run-index.js';
72
76
  import { TestSetIndex, registerTestSetForRun } from '../qe/test-sets.js';
73
77
  import { DocGroundingStore } from '../interactive/doc-grounding.js';
74
78
  import { ProjectSettingsStore } from '../projects/settings.js';
75
- import { crewStateHome } from '../projects/state-home.js';
79
+ import { crewStateHome, isDefaultStateHome } from '../projects/state-home.js';
80
+ import { RunSourcePicks } from './run-sources.js';
76
81
  import { coreUnitId } from './evidence.js';
77
82
  import { homedir } from 'node:os';
78
83
  import { discoverMcpServers } from '../mcp/discovery.js';
@@ -87,6 +92,7 @@ import { unitTrackerIds } from '../knowledge/trackers/visible.js';
87
92
  import { McpCallRecordFile } from '../mcp/call-records.js';
88
93
  import { emitOnBus } from '../core/bus.js';
89
94
  import { McpRegistry } from '../mcp/registry.js';
95
+ import { daemonRunFence } from '../mcp/run-fence.js';
90
96
  import { McpRegistryStore } from '../mcp/registry-store.js';
91
97
  import { resolveSecret } from '../mcp/secrets.js';
92
98
  import { DataGate } from '../knowledge/gate/gate.js';
@@ -107,7 +113,7 @@ import { STALL_DETECTED_ACTION, STALL_ESCALATED_ACTION, StallFrameIndex, stallFr
107
113
  import { SeatHealthTracker } from './seat-health.js';
108
114
  import { auditSeatBenchStore, readSeatBenchEntries } from './seat-bench-trail.js';
109
115
  import { rosterWithStandingFactory } from './roster-standing.js';
110
- import { SeatContainerStatus, seatLoginDepsFor } from './seat-container-login.js';
116
+ import { registerLoginCleanup, SeatContainerStatus, seatLoginDepsFor } from './seat-container-login.js';
111
117
  import { ChatTurnIndex } from './chat-turns.js';
112
118
  import { ChatTranscriptStore } from './chat-transcripts.js';
113
119
  import { sweepDeliveredWorktree } from './worktree-sweep.js';
@@ -127,10 +133,12 @@ import { registerWatchRoutes } from './watch-routes.js';
127
133
  import { callEstateTool } from '../core/estate-mcp-client.js';
128
134
  import { seatParser } from '../standing-orders/parse.js';
129
135
  import { registerGateHistoryRoute, runBand, runPreset, runProject } from '../standing-orders/history.js';
130
- import { WorkingDocService } from '../working-doc/service.js';
136
+ import { WorkingDocService, workingDocStep } from '../working-doc/service.js';
137
+ import { PersonNotesIndex } from '../working-doc/notes-index.js';
131
138
  import { WorkingDocStore } from '../working-doc/store.js';
132
139
  import { isWorkingDoc as isWorkingDocAt } from '../interactive/chat-events.js';
133
140
  import { DocBindingStore } from '../interactive/doc-binding.js';
141
+ import { LandingRecordStore } from '../interactive/landing-record.js';
134
142
  import { docVersionsOf, reconcileBoundAttempts, recoveredLaunchDetail } from '../interactive/proposal-create.js';
135
143
  import { bridgeBackend } from '../working-doc/bridge-backend.js';
136
144
  import { registerWorkingDocRoutes } from '../working-doc/routes.js';
@@ -145,12 +153,14 @@ import { applyRequirementsGraphSettings } from '../core/requirements-graph-setti
145
153
  import { builtinPresetSkillRefs, coreSkillRefs, registeredSkillRefs } from '../skills/core-closure.js';
146
154
  import { assertSkillsRootFenced } from '../skills/root-fence.js';
147
155
  import { SkillsRuntime, isPublishingPlaceholder } from '../skills/runtime.js';
156
+ import { SkillUsageRecorder } from '../skills/usage.js';
148
157
  import { SKILLS_SNAPSHOT_ENGINE_ENV } from '../skills/engine-env.js';
149
158
  import { assertWickedRootsOutsideStateHome, StateHomeWatch } from '../projects/state-home-preflight.js';
150
159
  import { resolveSkillsRoot, SkillsStore } from '../skills/store.js';
151
160
  import { uvSyncBaseline } from '../skills/venv.js';
152
161
  import { DEFAULT_WORKER_STALL_ESCALATE_MINUTES, DEFAULT_WORKER_SILENT_TURN_MINUTES, DEFAULT_WORKER_STALL_MINUTES, } from '../core/types.js';
153
162
  import { daemonSignalLog } from '../core/daemon-signal-log.js';
163
+ import { latestDraftRender } from '../interactive/draft-skill.js';
154
164
  import { refreshProjectGraphsAfterOnboarding } from '../projects/auto-refresh.js';
155
165
  /** The daemon's own actor on the audit trail (`run.delivered`, `run.ended`, the onboarding `run.launched`). */
156
166
  const DAEMON_ACTOR = { id: 'daemon', kind: 'system', trust: 'admin' };
@@ -212,14 +222,19 @@ export async function createServer(adapter, options) {
212
222
  stream: teeStreamWithErrorRing(errorRing),
213
223
  },
214
224
  // DES-CHAT-ARTIFACTS-001 A2: a proposal id is `<chat id>:<turn uuid>` and a chat id may be 128 characters, so a
215
- // path parameter may be up to 165 (Fastify's default limit is 100). Generous, still bounded.
216
- maxParamLength: 256,
225
+ // path parameter may be up to 165 (Fastify's default limit is 100). Generous, still bounded. Under
226
+ // `routerOptions`: the top-level key printed Fastify's FSTDEP022 deprecation on every boot (first-run P9).
227
+ routerOptions: { maxParamLength: 256 },
217
228
  });
218
229
  // TH-11: accumulate the route table as it registers — the endpoint manifest's one source of
219
230
  // truth. Installed FIRST because fastify only fires onRoute for routes added after the hook
220
231
  // exists. Read via `app.endpointManifest` (scripts/generate-endpoint-manifest.ts + the drift
221
232
  // test); costs one array push per route at boot, nothing per request.
222
233
  app.decorate('endpointManifest', installEndpointManifestHook(app));
234
+ // FINDINGS B1/B2/C3a backstop: no home path leaves the read-only diagnostic routes, even one a new row forgets to scrub.
235
+ // NOT `/roster`: its rows are launch inputs (studio sends them back verbatim as `POST /runs` `clisJson`), so a seat's
236
+ // binary under the home dir must keep its real path there (macOS CI caught `~/…/node` failing to spawn).
237
+ registerUiTextScrub(app, [`${API_PREFIX}/health`, `${API_PREFIX}/diagnostics`, `${API_PREFIX}/system`]);
223
238
  const gateCache = new GateCache(app.log);
224
239
  // Standing orders (behaviour 10): armed once the routes (and so THE gate decision path) exist;
225
240
  // the event relays above it read it late-bound.
@@ -257,6 +272,7 @@ export async function createServer(adapter, options) {
257
272
  // the same dir the sign-in routes pass (agy crew-r1).
258
273
  containerStatus: new SeatContainerStatus(seatLoginDepsFor(adapter.dbPath)),
259
274
  });
275
+ registerLoginCleanup(app, seatLoginDepsFor(adapter.dbPath));
260
276
  // Runtime-guarded, not typed away: the integration suites drive `createServer` over PARTIAL fake
261
277
  // adapters (cast to `CoreAdapter`) that never grew this method — the real adapter always has it.
262
278
  if (typeof adapter.setRosterProvider === 'function') {
@@ -410,6 +426,20 @@ export async function createServer(adapter, options) {
410
426
  app.decorate('skillsBootSettled', () => skillsBoot ?? Promise.resolve());
411
427
  // Exclusive peers (codex on #846): `venv` is the provisioner path's time, `skills` the rest of
412
428
  // the seam (seed, validate, hash, stage, flip) — the stages sum, never double-count.
429
+ // Skill usage (operator 2026-11-08): the engine's `skillUsed` / `skillsSnapshotHanded` frames rolled up per skill
430
+ // and CLI beside the catalog (`daemon-skill-usage.json`), read by `GET /skills/usage`. Only with a skills seam:
431
+ // its snapshots are where a script is credited to the skills whose files name it.
432
+ const skillUsage = skillsStore !== undefined
433
+ ? new SkillUsageRecorder({
434
+ snapshotsDir: () => (skillsStore === undefined ? null : join(skillsStore.root, 'snapshots')),
435
+ chatOf: (session) => askPaths.chatOf(session),
436
+ })
437
+ : undefined;
438
+ if (skillUsage !== undefined) {
439
+ app.addHook('onClose', async () => {
440
+ skillUsage.flush();
441
+ });
442
+ }
413
443
  const skillsMs = bootClock.lap('skills');
414
444
  const venvMs = skillsStore?.venvStage().ms ?? 0;
415
445
  bootClock.set('skills', skillsMs - venvMs);
@@ -620,13 +650,15 @@ export async function createServer(adapter, options) {
620
650
  // The durable record first, then the read-side index — the same write order as
621
651
  // `guidance.set`, so the index can only LAG a crash (rehydrated at next boot), never
622
652
  // hold a record the trail does not.
623
- record: (runId, record) => {
624
- audit.record('run.delivered', DAEMON_ACTOR, { runId, detail: record });
625
- if ('url' in record)
626
- deliveryIndex.set(runId, record.url);
627
- else
628
- deliveryIndex.setPushed(runId, record.pushed);
629
- },
653
+ // CS11: the trail and the index get the same `commit` ({@link recordDelivery}, tested as is).
654
+ record: (runId, record) => recordDelivery(audit, deliveryIndex, DAEMON_ACTOR, runId, record),
655
+ // CS11 (DES-CATALOG-002 rev 8): record the delivered HEAD SHA from now on, over the registered
656
+ // repo root (the same `listRepos()` resolver this file uses for repo roots) + the engine's
657
+ // `run_branch` (else `wicked/<id>`). The body lives in `delivery-index.ts` ({@link
658
+ // deliveredCommitFor}) so tests exercise the production code, not a copy (cs11-b review
659
+ // P1/P2): it records NO commit when a later phase ran after the deliver unit (the pushed tip
660
+ // may have moved) and when the SHA cannot be read — the join then keeps the run (fail-closed).
661
+ deliveredCommit: (view) => deliveredCommitFor(view, async (repoRef) => (await adapter.listRepos()).find((r) => r.id === repoRef)?.root_path),
630
662
  log: (m) => app.log.warn(m),
631
663
  });
632
664
  const resolveRunDelivery = (runId) => deliveryResolver.resolve(runId);
@@ -705,6 +737,15 @@ export async function createServer(adapter, options) {
705
737
  // DES-CHAT-ARTIFACTS-001 §5.2 (A3): the durable binding of every chat-made document, under the registered `chats`
706
738
  // state-home entry (core's fence refuses a new top-level entry, and no worker reads the state home).
707
739
  const docBindings = new DocBindingStore(join(crewStateDir, 'chats', 'doc-bindings'));
740
+ // A6 / PLAN G12: per run, what crew checked on the file it announced (floor, page count, the writer's notes), under the
741
+ // same registered `chats` entry; the checks read serves it by the version interactive records each run on.
742
+ const docLandings = new LandingRecordStore(join(crewStateDir, 'chats', 'doc-landings'));
743
+ // G12: the floor prints the document with the operator's own renderer, else crew's provisioned Chromium when made.
744
+ const floorChrome = () => (process.env['WICKED_CHROME'] ?? '').trim() || managedChromium(conformanceRuntimeRoot());
745
+ // G12: the run's own engine `draft_render` record (its latest unit of that step, read fresh: the floor runs as the run
746
+ // ends), which the floor reuses when it measured these exact bytes with the floor's own print profile.
747
+ const floorEngineRender = async (runId) => latestDraftRender((await adapter.runView(runId, { fresh: true }))?.units);
748
+ const draftFloorIo = { chrome: floorChrome, engineRender: floorEngineRender };
708
749
  /**
709
750
  * A3 (§6.2): a proposal-bound attempt's outcome was recorded. A failure is said on the run (`run.landing_failed`, the
710
751
  * DTO's `landing_failed` and a `landingFailed` frame), releases the chat and the document (their busy checks read the
@@ -724,14 +765,16 @@ export async function createServer(adapter, options) {
724
765
  broadcast({ type: 'landingFailed', session: runId, artifact_ref: ref, reason: outcome.reason });
725
766
  if (hit === null || chatProposals === null)
726
767
  return;
727
- const chatNow = chatHistory.idOfInstance(hit.binding.chatId, hit.binding.chatInstance);
768
+ // A5: a refine's retry card goes to the chat the refine was accepted in.
769
+ const chatOf = hit.attempt.chatId !== undefined ? { chatId: hit.attempt.chatId, chatInstance: hit.attempt.chatInstance ?? null } : hit.binding;
770
+ const chatNow = chatHistory.idOfInstance(chatOf.chatId, chatOf.chatInstance);
728
771
  if (chatNow === null) {
729
772
  app.log.warn(`[proposals] run ${runId} failed, and the chat it was made from is gone — no retry card`);
730
773
  docBindings.markPublished(ref, runId);
731
774
  return;
732
775
  }
733
776
  void chatProposals
734
- .appendRetry(chatNow, hit.attempt.pid, runId, ref, outcome.reason, hit.binding.chatInstance)
777
+ .appendRetry(chatNow, hit.attempt.pid, runId, ref, outcome.reason, chatOf.chatInstance)
735
778
  .then((pid) => {
736
779
  if (pid !== null)
737
780
  docBindings.setRetry(ref, runId, pid);
@@ -1119,6 +1162,16 @@ export async function createServer(adapter, options) {
1119
1162
  app.log.warn(`[inspect] could not register the '${INSPECT_WORKFLOW}' workflow — checks answer with crew's own reading: ${err instanceof Error ? err.message : String(err)}`);
1120
1163
  }
1121
1164
  }
1165
+ // DES-CATALOG-002 §2.3: the hidden detect-shape turn (POST /workflows/catalog/detect). Without it, detection answers
1166
+ // from the words layer alone, never sure.
1167
+ if (typeof adapter.registerWorkflow === 'function') {
1168
+ try {
1169
+ await adapter.registerWorkflow(loadDetectWorkflow());
1170
+ }
1171
+ catch (err) {
1172
+ app.log.warn(`[detect] could not register the '${DETECT_WORKFLOW}' workflow — detection answers from the words alone: ${err instanceof Error ? err.message : String(err)}`);
1173
+ }
1174
+ }
1122
1175
  // A check a restart interrupted is stopped and answered now, so it never runs on unwatched past its bound.
1123
1176
  void unitInspect.recover();
1124
1177
  registerInspectRoutes(app, { service: unitInspect, audit });
@@ -1194,7 +1247,25 @@ export async function createServer(adapter, options) {
1194
1247
  },
1195
1248
  audit,
1196
1249
  });
1197
- registerInsightsRoutes(app, { store: insightsStore, service: reviewService, audit });
1250
+ registerInsightsRoutes(app, {
1251
+ store: insightsStore,
1252
+ service: reviewService,
1253
+ audit,
1254
+ // (DES-CATALOG-002 CS6) `POST /insights/facts`: the engine resolves the unit's token; crew reads which step it is.
1255
+ ...(CoreAdapter.estateScopeResolver() !== null
1256
+ ? {
1257
+ facts: {
1258
+ unitOf: factsUnitResolver((req) => {
1259
+ const resolve = CoreAdapter.estateScopeResolver();
1260
+ if (resolve === null)
1261
+ return Promise.reject(new Error('no resolver'));
1262
+ return resolve(req);
1263
+ }, () => adapter.sessionsDetail()),
1264
+ collect: (opts, nowMs) => reviewService.collect(opts, nowMs),
1265
+ },
1266
+ }
1267
+ : {}),
1268
+ });
1198
1269
  if (options?.workflowSchedules?.enabled ?? !(process.env['VITEST'] !== undefined || process.env['NODE_ENV'] === 'test')) {
1199
1270
  // Seeded (and so written to the state home) only by a daemon that runs the tick: a headless boot (the
1200
1271
  // endpoint-manifest collector, a test) never plants a schedule file in whatever state home it resolves.
@@ -1283,6 +1354,8 @@ export async function createServer(adapter, options) {
1283
1354
  bindings: docBindings,
1284
1355
  onBoundDocCreated: (ref) => onBoundDocCreated(ref),
1285
1356
  onBoundOutcome,
1357
+ landings: docLandings,
1358
+ draftFloorIo,
1286
1359
  resolveDocsRoot: o.resolveDocsRoot ?? interactiveDocsRoot,
1287
1360
  log: (m) => app.log.warn(m),
1288
1361
  logError: (m) => app.log.error(m),
@@ -1424,6 +1497,12 @@ export async function createServer(adapter, options) {
1424
1497
  isDocBusy: (documentId) => (draftSub?.inFlightDocs().includes(documentId) ?? false) ||
1425
1498
  (editSub?.inFlightDocs().includes(documentId) ?? false),
1426
1499
  onRunFiled: fileRun,
1500
+ // DES-CHAT-ARTIFACTS-001 §6 (A5): a proposal-bound refine's attempt, launch record, landing record and outcome.
1501
+ bindings: docBindings,
1502
+ onBoundOutcome,
1503
+ onRunLaunched: (runId, detail) => { recordRunLaunched(audit, runTimingIndex, DAEMON_ACTOR, runId, detail); },
1504
+ landings: docLandings,
1505
+ draftFloorIo,
1427
1506
  log: (m) => app.log.warn(m),
1428
1507
  logError: (m) => app.log.error(m),
1429
1508
  });
@@ -1693,6 +1772,7 @@ export async function createServer(adapter, options) {
1693
1772
  elicitationCache.ingest(event);
1694
1773
  askServer.ingest(event);
1695
1774
  seatHealth.ingest(event);
1775
+ skillUsage?.ingest(event);
1696
1776
  // ASK-C2: a path run's unit + terminal frames become the chat's frames (re-entering this fold
1697
1777
  // as chatDelta / chatReply, which the relay ignores — no recursion).
1698
1778
  if (typeof event.session === 'string')
@@ -1737,7 +1817,9 @@ export async function createServer(adapter, options) {
1737
1817
  const block = rewritten.type === 'chatReply' ? chatTranscripts.takeDecisionsBlock(chat, cliKey) : null;
1738
1818
  // A2: the reply's `wicked-make` blocks (cut above, never shown) become a proposal card, resolved off this path.
1739
1819
  const makeBlocks = rewritten.type === 'chatReply' ? chatTranscripts.takeMakeBlocks(chat, cliKey) : [];
1740
- if (makeBlocks.length > 0) {
1820
+ // DES-CATALOG-002 §4.6: every settled seat part of a turn (a reply with or without blocks, or a failed seat) also
1821
+ // settles the turn's hold on a job proposal, so a correction that wrote no revision releases it at once.
1822
+ if (makeBlocks.length > 0 || typeof f['turn_id'] === 'string') {
1741
1823
  chatProposals?.onReply({
1742
1824
  chat,
1743
1825
  cliKey,
@@ -2045,6 +2127,12 @@ export async function createServer(adapter, options) {
2045
2127
  // diagnostics reads the bundle's shipped version manifest from the same root the static
2046
2128
  // handler serves. One resolution, two consumers.
2047
2129
  const studioRoot = options?.studioRoot ?? defaultStudioRoot();
2130
+ // (DES-EDITOR-CONFORMANCE-HOST, e2e F18) The engine runs an editor-plugin run's conformance cases on this host: it
2131
+ // reads crew's conformance runtime and this studio dist from the daemon's environment.
2132
+ exportEngineConformanceEnv(studioRoot);
2133
+ // (PLAN G12) And the managed headless shell as the daemon's `WICKED_CHROME`, for the engine's `draft_render` step (an
2134
+ // operator's own value wins); the provisioner exports it again whenever it makes or finds the runtime.
2135
+ exportManagedChrome(conformanceRuntimeRoot());
2048
2136
  // DES-MCP-TOOLS-001 S2: the registry over `<state home>/mcp` (created on the first save).
2049
2137
  const mcpRegistryStore = new McpRegistryStore();
2050
2138
  const mcpSecrets = platformSecretStore();
@@ -2131,8 +2219,24 @@ export async function createServer(adapter, options) {
2131
2219
  const unitVisible = (scope) => projectVisible(scope.projectId, scope.repoId);
2132
2220
  // DES-KNOWLEDGE-DATA-001 §9.1: an app's knowledge query sees what a unit in the APP'S project sees (the same set).
2133
2221
  const appsKnowledgeVisible = (projectId) => projectVisible(projectId);
2222
+ // (DES-CATALOG-002 CS4/CS10) Each run's source pick: recorded at launch (POST /runs), read by the broker, the unit's
2223
+ // tool list and the estate relay, so a unit never reaches a registered source its job did not pick.
2224
+ const runSourcePicks = new RunSourcePicks(join(crewStateHome(), 'mcp', 'run-source-picks.json'));
2225
+ /** Every registered source and PM tracker id with its owning source's name: how the relay maps `source:<id>` to a pick. */
2226
+ const sourceOwnerNames = async () => {
2227
+ const out = (await dataGate.sources()).map((s) => ({ id: s.id, name: s.name }));
2228
+ for (const e of await dataGate.pm.entries()) {
2229
+ out.push({ id: e.id, name: e.name });
2230
+ for (const t of e.trackers)
2231
+ out.push({ id: t.id, name: e.name });
2232
+ }
2233
+ return out;
2234
+ };
2134
2235
  const mcpBroker = new McpBroker({
2236
+ picks: runSourcePicks,
2135
2237
  registry: mcpRegistry,
2238
+ // DES-CATALOG-002 §2.3: a `detect-shape` run reaches nothing (its fence is its identity).
2239
+ fence: daemonRunFence((runId) => adapter.launchedWorkflowOfRun(runId)),
2136
2240
  engine: options?.mcpEngineGate ?? (() => CoreAdapter.mcpEngineGate()),
2137
2241
  records: mcpCallRecords,
2138
2242
  budgetPerUnit: budgetFromEnv(),
@@ -2143,6 +2247,8 @@ export async function createServer(adapter, options) {
2143
2247
  estate: new EstateRelay({
2144
2248
  resolver: () => CoreAdapter.estateScopeResolver(),
2145
2249
  visible: unitVisible,
2250
+ picks: runSourcePicks,
2251
+ sourceNames: sourceOwnerNames,
2146
2252
  onProposal: (p) => audit.record('estate.proposal.submitted', { id: `seat:${p.seat}`, kind: 'agent', trust: 'observer' }, {
2147
2253
  runId: p.runId,
2148
2254
  detail: { unit: p.ord, attempt: p.attempt, seat: p.seat, proposalId: p.proposalId, kindType: p.kindType, callId: p.callId },
@@ -2279,10 +2385,15 @@ export async function createServer(adapter, options) {
2279
2385
  docGrounding,
2280
2386
  // DES-CHAT-ARTIFACTS-001 §5.2 (A3): chat-made documents; `create` is real only when the draft seam is armed.
2281
2387
  docBindings,
2388
+ docLandings,
2282
2389
  ...(draftSub !== null ? { launchBoundDraft: draftSub.launchBound, fenceBoundDraft: draftSub.fenceBound } : {}),
2390
+ // A5: a refine is real only when the chat seam is armed AND the draft seam is (its landing watch settles every
2391
+ // proposal-bound attempt on `version.created` / `draft.conflict`; codex A5 r1).
2392
+ ...(chatSub !== null && draftSub !== null ? { launchBoundRefine: chatSub.launchBound } : {}),
2283
2393
  // crew#899: a chat's checkouts are brought to their upstream (when clean) before it reads them.
2284
2394
  freshenCheckout: (root) => freshenCheckout(root),
2285
2395
  ...(skillsRuntime !== undefined ? { skills: skillsRuntime } : {}),
2396
+ ...(skillUsage !== undefined ? { skillUsage } : {}),
2286
2397
  // DES-MCP-TOOLS-001 S2: the registry over `<state home>/mcp` (created on the first save).
2287
2398
  // Route tests drive `registerMcpRoutes` over their own registry (tests/mcp-registry.test.ts).
2288
2399
  mcp: mcpRegistry,
@@ -2304,6 +2415,10 @@ export async function createServer(adapter, options) {
2304
2415
  mcpBroker,
2305
2416
  // DES-KNOWLEDGE-DATA-001 §7: the data gate, its registry store and its read record.
2306
2417
  dataGate,
2418
+ // (DES-CATALOG-002 CS4) Each run's source pick, in the registered `mcp` entry (CS10's fence reads it), and the
2419
+ // folder a run's documents are staged in, outside the state home.
2420
+ runSourcePicks,
2421
+ runDocumentsRoot: runDocumentsRootDir(),
2307
2422
  mcpRegistryStore,
2308
2423
  sourceReads,
2309
2424
  trackerProjector,
@@ -2431,12 +2546,38 @@ export async function createServer(adapter, options) {
2431
2546
  // Program DES-POWER-MODE §8.3/§9 (spike 3): the run's working document — a wicked-interactive document of kind
2432
2547
  // `phase-report` — and the steering notes a person's edits of it become. Steering rides the engine's operator
2433
2548
  // inject only; nothing here answers a gate.
2549
+ const workingDocNotes = new PersonNotesIndex();
2550
+ // The working documents read the run views (the engine's whole-store fold) at most once per 2 s between them: the
2551
+ // catch-up and a burst of syncs share one read instead of one each (crew#944: run reads must stay fast).
2552
+ let workingDocViewsRead = null;
2553
+ const workingDocViews = () => {
2554
+ if (workingDocViewsRead === null || Date.now() - workingDocViewsRead.at > 2_000) {
2555
+ const views = adapter.sessionsDetail();
2556
+ workingDocViewsRead = { at: Date.now(), views };
2557
+ views.catch(() => { if (workingDocViewsRead?.views === views)
2558
+ workingDocViewsRead = null; });
2559
+ }
2560
+ return workingDocViewsRead.views;
2561
+ };
2562
+ /** How long after start the working documents' catch-up begins (`WICKED_WORKING_DOC_CATCHUP_MS`, default 10 s). */
2563
+ const catchUpEnv = Number(process.env['WICKED_WORKING_DOC_CATCHUP_MS']);
2564
+ const WORKING_DOC_CATCH_UP_DELAY_MS = process.env['WICKED_WORKING_DOC_CATCHUP_MS'] !== undefined && Number.isFinite(catchUpEnv) && catchUpEnv >= 0 ? catchUpEnv : 10_000;
2565
+ // The start-up read of the trail for the person's answers; every document sync waits for it (never rejects).
2566
+ const workingDocNotesRead = audit.readAll().then((entries) => workingDocNotes.hydrate(entries), (err) => {
2567
+ app.log.warn(`[working-doc] the trail could not be read for the person's answers: ${String(err)}`);
2568
+ return workingDocNotes.hydrate([]);
2569
+ });
2434
2570
  const workingDocs = new WorkingDocService({
2435
2571
  store: new WorkingDocStore({ log: (m) => app.log.warn(m) }),
2436
2572
  backend: bridgeBackend(interactiveBridges, (projectId) => workingDocRoot(adapter, projectSettings, projectId)),
2437
- engine: { injectWorkerMessage: (runId, message, target) => adapter.injectWorkerMessage(runId, message, target) },
2573
+ engine: {
2574
+ injectWorkerMessage: (runId, message, target) => adapter.injectWorkerMessage(runId, message, target),
2575
+ supportsRunContext: () => typeof adapter.supportsRunContext === 'function' && adapter.supportsRunContext(),
2576
+ // (context-doc-switch) The person's Goal, Approach and Constraints as the engine's context block.
2577
+ setRunContext: (runId, ctx) => adapter.setRunContext(runId, ctx),
2578
+ },
2438
2579
  run: async (runId) => {
2439
- const v = (await adapter.sessionsDetail()).find((x) => x.session.id === runId);
2580
+ const v = (await workingDocViews()).find((x) => x.session.id === runId);
2440
2581
  if (v === undefined)
2441
2582
  return null;
2442
2583
  return {
@@ -2444,12 +2585,19 @@ export async function createServer(adapter, options) {
2444
2585
  problem: v.session.problem ?? '',
2445
2586
  projectId: runProject(v, runId, (id) => membershipIndex.projectOf(id)) ?? WORKING_DOC_DEFAULT_PROJECT,
2446
2587
  terminal: ['completed', 'cancelled', 'failed'].includes(v.session.status),
2447
- stepOf: (ord) => {
2448
- const u = v.units.find((x) => x.ord === ord);
2449
- return u?.phase_ref ?? (typeof u?.description === 'string' ? (u.description.split(/\s+[—-]\s+/u)[0] ?? null) : null);
2450
- },
2588
+ stepOf: (ord) => workingDocStep(v.units.find((x) => x.ord === ord)),
2589
+ power: v.session.power != null,
2590
+ // The run's current plan (the engine's unit list): what a phased run's Approach says once its plan settles.
2591
+ steps: v.units.map((u) => ({ ord: u.ord, name: workingDocStep(u), seat: u.assigned_cli ?? null })),
2451
2592
  };
2452
2593
  },
2594
+ // A person's answers with their words (crew's own trail: the engine's log does not say who, or why), from memory,
2595
+ // once the start-up read of the trail is in (so a line never lands ahead of an older one).
2596
+ notes: async (runId) => { await workingDocNotesRead; return workingDocNotes.of(runId); },
2597
+ // The launch time is crew's (the run-timing index, from `run.launched`); a run with none sorts oldest.
2598
+ liveRuns: async () => (await workingDocViews())
2599
+ .filter((v) => !['completed', 'cancelled', 'failed'].includes(v.session.status) && v.session.archived_at == null)
2600
+ .map((v) => ({ runId: v.session.id, createdAt: runTimingIndex.createdAtFor(v.session.id) ?? 0 })),
2453
2601
  changed: (runId, head) => broadcast({ type: 'workingDocChanged', session: runId, head }),
2454
2602
  audit: (action, actor, runId, detail) => audit.record(action, actor, { runId, detail }),
2455
2603
  // The run's own log: crew writes the event-derived lines (Decisions, Open questions, Next) whether or not a tab
@@ -2458,8 +2606,28 @@ export async function createServer(adapter, options) {
2458
2606
  log: (m) => app.log.warn(m),
2459
2607
  });
2460
2608
  workingDocTap = (e) => workingDocs.onEvent(e);
2461
- // After a restart no further event may come for a run: bring every held document's lines up to date once.
2462
- workingDocs.catchUp();
2609
+ // (context-doc-switch) The engine's context blocks are set at once (one cheap call per live document, serial), not
2610
+ // after the slower line catch-up below: a seat spawned meanwhile would miss a block the engine does not hold yet.
2611
+ void workingDocs.contextCatchUp();
2612
+ // A person's answer recorded in the trail (a gate note, a skip reason, guidance) brings the run's document up to date:
2613
+ // some come with no engine event at all (guidance), and a gate's is recorded after the engine's answer.
2614
+ audit.onRecord((entry) => { const runId = workingDocNotes.add(entry); if (runId !== null)
2615
+ workingDocs.nudge(runId); });
2616
+ // After a restart no further event may come for a run: once the person's answers are read from the trail, bring every
2617
+ // held document up to date and make the newest live runs' documents (bounded, one at a time; never rejects). Answers
2618
+ // recorded while the trail was read bring their run's document up to date too.
2619
+ // It starts a little after the daemon is up (a boot is busy enough), and never after it has closed.
2620
+ let workingDocCatchUp = setTimeout(() => {
2621
+ workingDocCatchUp = null;
2622
+ void workingDocNotesRead.then(async (touched) => {
2623
+ for (const runId of touched)
2624
+ workingDocs.nudge(runId);
2625
+ await workingDocs.catchUp();
2626
+ });
2627
+ }, WORKING_DOC_CATCH_UP_DELAY_MS);
2628
+ workingDocCatchUp.unref?.();
2629
+ app.addHook('onClose', async () => { if (workingDocCatchUp !== null)
2630
+ clearTimeout(workingDocCatchUp); });
2463
2631
  registerWorkingDocRoutes(app, { service: workingDocs, exists: async (id) => (await adapter.sessions()).includes(id) });
2464
2632
  registerStandingOrderRoutes(app, {
2465
2633
  store: standingOrders,
@@ -2605,4 +2773,17 @@ export async function startServer(adapter, port = 7701, host = '127.0.0.1', opti
2605
2773
  process.env['WICKED_CREW_URL'] = brokerUrlFor(boundHost, boundPort);
2606
2774
  return { app, port: boundPort, host: boundHost, stages: clock.snapshot() };
2607
2775
  }
2776
+ /**
2777
+ * (DES-CATALOG-002 CS4) Where a run's documents are staged: `WICKED_RUN_DOCS_DIR` when set; for the default state home
2778
+ * `~/.wicked/run-documents`; for any other `<state home>-run-documents`. Never inside the state home: core's Read fence
2779
+ * denies every state-home entry to workers, and an unregistered entry there refuses every launch (the demo-root rule,
2780
+ * `api/recording.ts` `demoRootDir`).
2781
+ */
2782
+ export function runDocumentsRootDir() {
2783
+ if (process.env.WICKED_RUN_DOCS_DIR)
2784
+ return process.env.WICKED_RUN_DOCS_DIR;
2785
+ if (isDefaultStateHome())
2786
+ return join(process.env.HOME ?? process.env.USERPROFILE ?? '/tmp', '.wicked', 'run-documents');
2787
+ return `${crewStateHome()}-run-documents`;
2788
+ }
2608
2789
  //# sourceMappingURL=server.js.map