wicked-crew 0.17.1 → 0.18.1

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 (520) hide show
  1. package/README.md +49 -14
  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 +30 -1
  16. package/dist/api/chat-jobs.d.ts.map +1 -1
  17. package/dist/api/chat-jobs.js +172 -10
  18. package/dist/api/chat-jobs.js.map +1 -1
  19. package/dist/api/chat-proposals.d.ts +178 -8
  20. package/dist/api/chat-proposals.d.ts.map +1 -1
  21. package/dist/api/chat-proposals.js +775 -54
  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-index.d.ts +109 -5
  36. package/dist/api/delivery-index.d.ts.map +1 -1
  37. package/dist/api/delivery-index.js +199 -7
  38. package/dist/api/delivery-index.js.map +1 -1
  39. package/dist/api/mcp.d.ts +7 -2
  40. package/dist/api/mcp.d.ts.map +1 -1
  41. package/dist/api/mcp.js +1 -1
  42. package/dist/api/mcp.js.map +1 -1
  43. package/dist/api/needs.d.ts.map +1 -1
  44. package/dist/api/needs.js +19 -1
  45. package/dist/api/needs.js.map +1 -1
  46. package/dist/api/product.d.ts +9 -2
  47. package/dist/api/product.d.ts.map +1 -1
  48. package/dist/api/product.js +10 -2
  49. package/dist/api/product.js.map +1 -1
  50. package/dist/api/proposal-theme.d.ts +23 -0
  51. package/dist/api/proposal-theme.d.ts.map +1 -0
  52. package/dist/api/proposal-theme.js +30 -0
  53. package/dist/api/proposal-theme.js.map +1 -0
  54. package/dist/api/recording.d.ts +70 -10
  55. package/dist/api/recording.d.ts.map +1 -1
  56. package/dist/api/recording.js +278 -39
  57. package/dist/api/recording.js.map +1 -1
  58. package/dist/api/repo-input.d.ts +55 -0
  59. package/dist/api/repo-input.d.ts.map +1 -0
  60. package/dist/api/repo-input.js +113 -0
  61. package/dist/api/repo-input.js.map +1 -0
  62. package/dist/api/requirements.d.ts +75 -0
  63. package/dist/api/requirements.d.ts.map +1 -1
  64. package/dist/api/requirements.js +97 -9
  65. package/dist/api/requirements.js.map +1 -1
  66. package/dist/api/review-change.d.ts +64 -0
  67. package/dist/api/review-change.d.ts.map +1 -0
  68. package/dist/api/review-change.js +214 -0
  69. package/dist/api/review-change.js.map +1 -0
  70. package/dist/api/roster-standing.d.ts +4 -0
  71. package/dist/api/roster-standing.d.ts.map +1 -1
  72. package/dist/api/roster-standing.js +43 -10
  73. package/dist/api/roster-standing.js.map +1 -1
  74. package/dist/api/routes.d.ts +63 -6
  75. package/dist/api/routes.d.ts.map +1 -1
  76. package/dist/api/routes.js +818 -269
  77. package/dist/api/routes.js.map +1 -1
  78. package/dist/api/run-documents.d.ts +97 -0
  79. package/dist/api/run-documents.d.ts.map +1 -0
  80. package/dist/api/run-documents.js +458 -0
  81. package/dist/api/run-documents.js.map +1 -0
  82. package/dist/api/run-sources.d.ts +51 -0
  83. package/dist/api/run-sources.d.ts.map +1 -0
  84. package/dist/api/run-sources.js +133 -0
  85. package/dist/api/run-sources.js.map +1 -0
  86. package/dist/api/runtime-state.d.ts +41 -0
  87. package/dist/api/runtime-state.d.ts.map +1 -0
  88. package/dist/api/runtime-state.js +75 -0
  89. package/dist/api/runtime-state.js.map +1 -0
  90. package/dist/api/seat-container-login.d.ts +51 -0
  91. package/dist/api/seat-container-login.d.ts.map +1 -1
  92. package/dist/api/seat-container-login.js +317 -1
  93. package/dist/api/seat-container-login.js.map +1 -1
  94. package/dist/api/seat-images.d.ts.map +1 -1
  95. package/dist/api/seat-images.js +7 -0
  96. package/dist/api/seat-images.js.map +1 -1
  97. package/dist/api/server.d.ts +7 -0
  98. package/dist/api/server.d.ts.map +1 -1
  99. package/dist/api/server.js +206 -25
  100. package/dist/api/server.js.map +1 -1
  101. package/dist/api/skills.d.ts +8 -0
  102. package/dist/api/skills.d.ts.map +1 -1
  103. package/dist/api/skills.js +21 -0
  104. package/dist/api/skills.js.map +1 -1
  105. package/dist/api/system-snapshot.d.ts +7 -2
  106. package/dist/api/system-snapshot.d.ts.map +1 -1
  107. package/dist/api/system-snapshot.js +31 -7
  108. package/dist/api/system-snapshot.js.map +1 -1
  109. package/dist/api/testing.d.ts +3 -3
  110. package/dist/api/ui-text.d.ts +45 -0
  111. package/dist/api/ui-text.d.ts.map +1 -0
  112. package/dist/api/ui-text.js +188 -0
  113. package/dist/api/ui-text.js.map +1 -0
  114. package/dist/apps/actions/card.d.ts +62 -0
  115. package/dist/apps/actions/card.d.ts.map +1 -0
  116. package/dist/apps/actions/card.js +111 -0
  117. package/dist/apps/actions/card.js.map +1 -0
  118. package/dist/apps/actions/write-path.d.ts.map +1 -1
  119. package/dist/apps/actions/write-path.js +26 -77
  120. package/dist/apps/actions/write-path.js.map +1 -1
  121. package/dist/apps/exec/sources.d.ts.map +1 -1
  122. package/dist/apps/exec/sources.js +3 -0
  123. package/dist/apps/exec/sources.js.map +1 -1
  124. package/dist/apps/publish/artifacts.d.ts +18 -0
  125. package/dist/apps/publish/artifacts.d.ts.map +1 -0
  126. package/dist/apps/publish/artifacts.js +87 -0
  127. package/dist/apps/publish/artifacts.js.map +1 -0
  128. package/dist/apps/publish/check.d.ts +103 -0
  129. package/dist/apps/publish/check.d.ts.map +1 -0
  130. package/dist/apps/publish/check.js +235 -0
  131. package/dist/apps/publish/check.js.map +1 -0
  132. package/dist/apps/publish/image.d.ts +2 -0
  133. package/dist/apps/publish/image.d.ts.map +1 -1
  134. package/dist/apps/publish/image.js +2 -1
  135. package/dist/apps/publish/image.js.map +1 -1
  136. package/dist/apps/publish/render.d.ts +71 -0
  137. package/dist/apps/publish/render.d.ts.map +1 -0
  138. package/dist/apps/publish/render.js +122 -0
  139. package/dist/apps/publish/render.js.map +1 -0
  140. package/dist/apps/publish/run.d.ts +35 -0
  141. package/dist/apps/publish/run.d.ts.map +1 -0
  142. package/dist/apps/publish/run.js +127 -0
  143. package/dist/apps/publish/run.js.map +1 -0
  144. package/dist/apps/routes.d.ts +54 -2
  145. package/dist/apps/routes.d.ts.map +1 -1
  146. package/dist/apps/routes.js +124 -7
  147. package/dist/apps/routes.js.map +1 -1
  148. package/dist/apps/spec.d.ts +8 -8
  149. package/dist/apps/store.d.ts +84 -5
  150. package/dist/apps/store.d.ts.map +1 -1
  151. package/dist/apps/store.js +191 -4
  152. package/dist/apps/store.js.map +1 -1
  153. package/dist/apps/turns.d.ts +19 -1
  154. package/dist/apps/turns.d.ts.map +1 -1
  155. package/dist/apps/turns.js +60 -2
  156. package/dist/apps/turns.js.map +1 -1
  157. package/dist/apps/views.d.ts +5 -1
  158. package/dist/apps/views.d.ts.map +1 -1
  159. package/dist/apps/views.js +18 -7
  160. package/dist/apps/views.js.map +1 -1
  161. package/dist/apps-server/Dockerfile +25 -0
  162. package/dist/apps-server/runners/sqlite-runner.mjs +110 -0
  163. package/dist/apps-server/server/lib/bundle/server.mjs +92523 -0
  164. package/dist/apps-server/server/node_modules/@pgsql/types/LICENSE +22 -0
  165. package/dist/apps-server/server/node_modules/@pgsql/types/README.md +106 -0
  166. package/dist/apps-server/server/node_modules/@pgsql/types/enums.d.ts +76 -0
  167. package/dist/apps-server/server/node_modules/@pgsql/types/enums.js +2 -0
  168. package/dist/apps-server/server/node_modules/@pgsql/types/esm/enums.js +1 -0
  169. package/dist/apps-server/server/node_modules/@pgsql/types/esm/index.js +2 -0
  170. package/dist/apps-server/server/node_modules/@pgsql/types/esm/types.js +1 -0
  171. package/dist/apps-server/server/node_modules/@pgsql/types/index.d.ts +2 -0
  172. package/dist/apps-server/server/node_modules/@pgsql/types/index.js +18 -0
  173. package/dist/apps-server/server/node_modules/@pgsql/types/package.json +36 -0
  174. package/dist/apps-server/server/node_modules/@pgsql/types/types.d.ts +2488 -0
  175. package/dist/apps-server/server/node_modules/@pgsql/types/types.js +2 -0
  176. package/dist/apps-server/server/node_modules/libpg-query/LICENSE +22 -0
  177. package/dist/apps-server/server/node_modules/libpg-query/README.md +275 -0
  178. package/dist/apps-server/server/node_modules/libpg-query/package.json +58 -0
  179. package/dist/apps-server/server/node_modules/libpg-query/wasm/index.cjs +369 -0
  180. package/dist/apps-server/server/node_modules/libpg-query/wasm/index.d.ts +48 -0
  181. package/dist/apps-server/server/node_modules/libpg-query/wasm/index.js +344 -0
  182. package/dist/apps-server/server/node_modules/libpg-query/wasm/libpg-query.js +2 -0
  183. package/dist/apps-server/server/node_modules/libpg-query/wasm/libpg-query.wasm +0 -0
  184. package/dist/apps-server/server/shim/host.css +22 -0
  185. package/dist/apps-server/server/shim/host.js +1 -0
  186. package/dist/cli/apps-check.d.ts +18 -0
  187. package/dist/cli/apps-check.d.ts.map +1 -1
  188. package/dist/cli/apps-check.js +179 -5
  189. package/dist/cli/apps-check.js.map +1 -1
  190. package/dist/cli/apps-produce.d.ts +9 -0
  191. package/dist/cli/apps-produce.d.ts.map +1 -0
  192. package/dist/cli/apps-produce.js +27 -0
  193. package/dist/cli/apps-produce.js.map +1 -0
  194. package/dist/cli/index.d.ts.map +1 -1
  195. package/dist/cli/index.js +15 -3
  196. package/dist/cli/index.js.map +1 -1
  197. package/dist/cli/insights-facts.d.ts +17 -0
  198. package/dist/cli/insights-facts.d.ts.map +1 -0
  199. package/dist/cli/insights-facts.js +56 -0
  200. package/dist/cli/insights-facts.js.map +1 -0
  201. package/dist/core/adapter.d.ts +74 -15
  202. package/dist/core/adapter.d.ts.map +1 -1
  203. package/dist/core/adapter.js +245 -53
  204. package/dist/core/adapter.js.map +1 -1
  205. package/dist/core/engine-roster.d.ts.map +1 -1
  206. package/dist/core/engine-roster.js +1 -0
  207. package/dist/core/engine-roster.js.map +1 -1
  208. package/dist/core/estate-mcp-client.d.ts +3 -2
  209. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  210. package/dist/core/estate-mcp-client.js +3 -2
  211. package/dist/core/estate-mcp-client.js.map +1 -1
  212. package/dist/core/run-identity.d.ts.map +1 -1
  213. package/dist/core/run-identity.js +3 -0
  214. package/dist/core/run-identity.js.map +1 -1
  215. package/dist/core/types.d.ts +5 -0
  216. package/dist/core/types.d.ts.map +1 -1
  217. package/dist/core/types.js.map +1 -1
  218. package/dist/editors/conformance-runtime.d.ts +107 -0
  219. package/dist/editors/conformance-runtime.d.ts.map +1 -1
  220. package/dist/editors/conformance-runtime.js +268 -13
  221. package/dist/editors/conformance-runtime.js.map +1 -1
  222. package/dist/editors/csp.d.ts +2 -2
  223. package/dist/editors/csp.d.ts.map +1 -1
  224. package/dist/editors/csp.js +4 -2
  225. package/dist/editors/csp.js.map +1 -1
  226. package/dist/editors/pack-install.d.ts +28 -13
  227. package/dist/editors/pack-install.d.ts.map +1 -1
  228. package/dist/editors/pack-install.js +96 -48
  229. package/dist/editors/pack-install.js.map +1 -1
  230. package/dist/editors/registry.d.ts +111 -8
  231. package/dist/editors/registry.d.ts.map +1 -1
  232. package/dist/editors/registry.js +183 -7
  233. package/dist/editors/registry.js.map +1 -1
  234. package/dist/editors/routes.d.ts +66 -13
  235. package/dist/editors/routes.d.ts.map +1 -1
  236. package/dist/editors/routes.js +277 -44
  237. package/dist/editors/routes.js.map +1 -1
  238. package/dist/evals/replay.d.ts +6 -0
  239. package/dist/evals/replay.d.ts.map +1 -1
  240. package/dist/evals/replay.js +24 -1
  241. package/dist/evals/replay.js.map +1 -1
  242. package/dist/evals/routes.d.ts.map +1 -1
  243. package/dist/evals/routes.js +17 -2
  244. package/dist/evals/routes.js.map +1 -1
  245. package/dist/evals/runner.d.ts.map +1 -1
  246. package/dist/evals/runner.js +5 -0
  247. package/dist/evals/runner.js.map +1 -1
  248. package/dist/evals/shape-corrections.d.ts +146 -0
  249. package/dist/evals/shape-corrections.d.ts.map +1 -0
  250. package/dist/evals/shape-corrections.js +394 -0
  251. package/dist/evals/shape-corrections.js.map +1 -0
  252. package/dist/evals/shape.d.ts +145 -0
  253. package/dist/evals/shape.d.ts.map +1 -0
  254. package/dist/evals/shape.js +376 -0
  255. package/dist/evals/shape.js.map +1 -0
  256. package/dist/evals/types.d.ts +2 -2
  257. package/dist/evals/types.d.ts.map +1 -1
  258. package/dist/evals/types.js +2 -1
  259. package/dist/evals/types.js.map +1 -1
  260. package/dist/insights/analyze.d.ts +14 -1
  261. package/dist/insights/analyze.d.ts.map +1 -1
  262. package/dist/insights/analyze.js +35 -8
  263. package/dist/insights/analyze.js.map +1 -1
  264. package/dist/insights/cost.d.ts +123 -0
  265. package/dist/insights/cost.d.ts.map +1 -0
  266. package/dist/insights/cost.js +221 -0
  267. package/dist/insights/cost.js.map +1 -0
  268. package/dist/insights/review-service.d.ts +20 -1
  269. package/dist/insights/review-service.d.ts.map +1 -1
  270. package/dist/insights/review-service.js +50 -25
  271. package/dist/insights/review-service.js.map +1 -1
  272. package/dist/insights/routes.d.ts +29 -0
  273. package/dist/insights/routes.d.ts.map +1 -1
  274. package/dist/insights/routes.js +62 -0
  275. package/dist/insights/routes.js.map +1 -1
  276. package/dist/insights/run-facts.d.ts +16 -0
  277. package/dist/insights/run-facts.d.ts.map +1 -1
  278. package/dist/insights/run-facts.js +26 -3
  279. package/dist/insights/run-facts.js.map +1 -1
  280. package/dist/interactive/bridge-pool.d.ts +11 -2
  281. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  282. package/dist/interactive/bridge-pool.js +10 -1
  283. package/dist/interactive/bridge-pool.js.map +1 -1
  284. package/dist/interactive/chat-events.d.ts +74 -1
  285. package/dist/interactive/chat-events.d.ts.map +1 -1
  286. package/dist/interactive/chat-events.js +338 -6
  287. package/dist/interactive/chat-events.js.map +1 -1
  288. package/dist/interactive/doc-binding.d.ts +15 -0
  289. package/dist/interactive/doc-binding.d.ts.map +1 -1
  290. package/dist/interactive/doc-binding.js +4 -0
  291. package/dist/interactive/doc-binding.js.map +1 -1
  292. package/dist/interactive/doc-checks-routes.d.ts +34 -1
  293. package/dist/interactive/doc-checks-routes.d.ts.map +1 -1
  294. package/dist/interactive/doc-checks-routes.js +84 -0
  295. package/dist/interactive/doc-checks-routes.js.map +1 -1
  296. package/dist/interactive/draft-events.d.ts +7 -0
  297. package/dist/interactive/draft-events.d.ts.map +1 -1
  298. package/dist/interactive/draft-events.js +38 -6
  299. package/dist/interactive/draft-events.js.map +1 -1
  300. package/dist/interactive/draft-skill.d.ts +76 -6
  301. package/dist/interactive/draft-skill.d.ts.map +1 -1
  302. package/dist/interactive/draft-skill.js +219 -17
  303. package/dist/interactive/draft-skill.js.map +1 -1
  304. package/dist/interactive/edit-events.d.ts.map +1 -1
  305. package/dist/interactive/edit-events.js +4 -2
  306. package/dist/interactive/edit-events.js.map +1 -1
  307. package/dist/interactive/landing-guard.d.ts +47 -0
  308. package/dist/interactive/landing-guard.d.ts.map +1 -0
  309. package/dist/interactive/landing-guard.js +43 -0
  310. package/dist/interactive/landing-guard.js.map +1 -0
  311. package/dist/interactive/landing-record.d.ts +68 -0
  312. package/dist/interactive/landing-record.d.ts.map +1 -0
  313. package/dist/interactive/landing-record.js +154 -0
  314. package/dist/interactive/landing-record.js.map +1 -0
  315. package/dist/interactive/proposal-create.d.ts +3 -1
  316. package/dist/interactive/proposal-create.d.ts.map +1 -1
  317. package/dist/interactive/proposal-create.js +14 -2
  318. package/dist/interactive/proposal-create.js.map +1 -1
  319. package/dist/interactive/proposal-refine.d.ts +48 -0
  320. package/dist/interactive/proposal-refine.d.ts.map +1 -0
  321. package/dist/interactive/proposal-refine.js +99 -0
  322. package/dist/interactive/proposal-refine.js.map +1 -0
  323. package/dist/interactive/protected-edits.d.ts +67 -0
  324. package/dist/interactive/protected-edits.d.ts.map +1 -0
  325. package/dist/interactive/protected-edits.js +160 -0
  326. package/dist/interactive/protected-edits.js.map +1 -0
  327. package/dist/interactive/proxy-routes.js +2 -2
  328. package/dist/interactive/review-events.js +1 -1
  329. package/dist/interactive/run-units.d.ts +1 -1
  330. package/dist/interactive/run-units.d.ts.map +1 -1
  331. package/dist/interactive/run-units.js +8 -2
  332. package/dist/interactive/run-units.js.map +1 -1
  333. package/dist/interactive/source-packet.d.ts +66 -1
  334. package/dist/interactive/source-packet.d.ts.map +1 -1
  335. package/dist/interactive/source-packet.js +309 -60
  336. package/dist/interactive/source-packet.js.map +1 -1
  337. package/dist/interactive/theme-events.js +1 -1
  338. package/dist/knowledge/adapters/web/egress.d.ts +99 -0
  339. package/dist/knowledge/adapters/web/egress.d.ts.map +1 -0
  340. package/dist/knowledge/adapters/web/egress.js +330 -0
  341. package/dist/knowledge/adapters/web/egress.js.map +1 -0
  342. package/dist/knowledge/adapters/web/engine.d.ts +54 -0
  343. package/dist/knowledge/adapters/web/engine.d.ts.map +1 -0
  344. package/dist/knowledge/adapters/web/engine.js +101 -0
  345. package/dist/knowledge/adapters/web/engine.js.map +1 -0
  346. package/dist/knowledge/adapters/web/fetch.d.ts +131 -0
  347. package/dist/knowledge/adapters/web/fetch.d.ts.map +1 -0
  348. package/dist/knowledge/adapters/web/fetch.js +325 -0
  349. package/dist/knowledge/adapters/web/fetch.js.map +1 -0
  350. package/dist/knowledge/adapters/web/gate-web.d.ts +182 -0
  351. package/dist/knowledge/adapters/web/gate-web.d.ts.map +1 -0
  352. package/dist/knowledge/adapters/web/gate-web.js +496 -0
  353. package/dist/knowledge/adapters/web/gate-web.js.map +1 -0
  354. package/dist/knowledge/adapters/web/routes.d.ts +36 -0
  355. package/dist/knowledge/adapters/web/routes.d.ts.map +1 -0
  356. package/dist/knowledge/adapters/web/routes.js +99 -0
  357. package/dist/knowledge/adapters/web/routes.js.map +1 -0
  358. package/dist/knowledge/adapters/web/searxng.d.ts +89 -0
  359. package/dist/knowledge/adapters/web/searxng.d.ts.map +1 -0
  360. package/dist/knowledge/adapters/web/searxng.js +274 -0
  361. package/dist/knowledge/adapters/web/searxng.js.map +1 -0
  362. package/dist/knowledge/adapters/web/source.d.ts +65 -0
  363. package/dist/knowledge/adapters/web/source.d.ts.map +1 -0
  364. package/dist/knowledge/adapters/web/source.js +192 -0
  365. package/dist/knowledge/adapters/web/source.js.map +1 -0
  366. package/dist/knowledge/gate/gate.d.ts +22 -0
  367. package/dist/knowledge/gate/gate.d.ts.map +1 -1
  368. package/dist/knowledge/gate/gate.js +62 -1
  369. package/dist/knowledge/gate/gate.js.map +1 -1
  370. package/dist/knowledge/gate/sources.d.ts +2 -0
  371. package/dist/knowledge/gate/sources.d.ts.map +1 -1
  372. package/dist/knowledge/gate/sources.js +5 -2
  373. package/dist/knowledge/gate/sources.js.map +1 -1
  374. package/dist/knowledge/package.d.ts +7 -0
  375. package/dist/knowledge/package.d.ts.map +1 -1
  376. package/dist/knowledge/package.js +15 -1
  377. package/dist/knowledge/package.js.map +1 -1
  378. package/dist/knowledge/trackers/actions.js +1 -1
  379. package/dist/knowledge/trackers/actions.js.map +1 -1
  380. package/dist/knowledge/trackers/bindings.d.ts +3 -3
  381. package/dist/knowledge/trackers/bindings.d.ts.map +1 -1
  382. package/dist/knowledge/trackers/bindings.js +36 -23
  383. package/dist/knowledge/trackers/bindings.js.map +1 -1
  384. package/dist/knowledge/trackers/routes.js +1 -1
  385. package/dist/knowledge/trackers/routes.js.map +1 -1
  386. package/dist/learnings/service.d.ts.map +1 -1
  387. package/dist/learnings/service.js +2 -0
  388. package/dist/learnings/service.js.map +1 -1
  389. package/dist/mcp/broker.d.ts +8 -0
  390. package/dist/mcp/broker.d.ts.map +1 -1
  391. package/dist/mcp/broker.js +48 -3
  392. package/dist/mcp/broker.js.map +1 -1
  393. package/dist/mcp/estate-relay.d.ts +43 -1
  394. package/dist/mcp/estate-relay.d.ts.map +1 -1
  395. package/dist/mcp/estate-relay.js +38 -2
  396. package/dist/mcp/estate-relay.js.map +1 -1
  397. package/dist/mcp/registry.d.ts +6 -0
  398. package/dist/mcp/registry.d.ts.map +1 -1
  399. package/dist/mcp/registry.js +42 -3
  400. package/dist/mcp/registry.js.map +1 -1
  401. package/dist/mcp/run-fence.d.ts +57 -0
  402. package/dist/mcp/run-fence.d.ts.map +1 -0
  403. package/dist/mcp/run-fence.js +86 -0
  404. package/dist/mcp/run-fence.js.map +1 -0
  405. package/dist/mcp/tool-list.d.ts +5 -0
  406. package/dist/mcp/tool-list.d.ts.map +1 -1
  407. package/dist/mcp/tool-list.js +7 -3
  408. package/dist/mcp/tool-list.js.map +1 -1
  409. package/dist/presets/routes.d.ts.map +1 -1
  410. package/dist/presets/routes.js +6 -0
  411. package/dist/presets/routes.js.map +1 -1
  412. package/dist/projects/routes.d.ts +1 -1
  413. package/dist/projects/state-home-preflight.d.ts.map +1 -1
  414. package/dist/projects/state-home-preflight.js +2 -0
  415. package/dist/projects/state-home-preflight.js.map +1 -1
  416. package/dist/setup/tool-path.d.ts +16 -0
  417. package/dist/setup/tool-path.d.ts.map +1 -0
  418. package/dist/setup/tool-path.js +66 -0
  419. package/dist/setup/tool-path.js.map +1 -0
  420. package/dist/skills/plugin-source.d.ts +46 -88
  421. package/dist/skills/plugin-source.d.ts.map +1 -1
  422. package/dist/skills/plugin-source.js +144 -100
  423. package/dist/skills/plugin-source.js.map +1 -1
  424. package/dist/skills/runtime.d.ts +47 -0
  425. package/dist/skills/runtime.d.ts.map +1 -1
  426. package/dist/skills/runtime.js +110 -14
  427. package/dist/skills/runtime.js.map +1 -1
  428. package/dist/skills/store.d.ts +2 -0
  429. package/dist/skills/store.d.ts.map +1 -1
  430. package/dist/skills/store.js +29 -14
  431. package/dist/skills/store.js.map +1 -1
  432. package/dist/skills/usage.d.ts +238 -0
  433. package/dist/skills/usage.d.ts.map +1 -0
  434. package/dist/skills/usage.js +789 -0
  435. package/dist/skills/usage.js.map +1 -0
  436. package/dist/skills/venv.d.ts +18 -2
  437. package/dist/skills/venv.d.ts.map +1 -1
  438. package/dist/skills/venv.js +2 -2
  439. package/dist/skills/venv.js.map +1 -1
  440. package/dist/sources/routes.d.ts +3 -1
  441. package/dist/sources/routes.d.ts.map +1 -1
  442. package/dist/sources/routes.js +11 -0
  443. package/dist/sources/routes.js.map +1 -1
  444. package/dist/standing-orders/parse.d.ts +19 -0
  445. package/dist/standing-orders/parse.d.ts.map +1 -1
  446. package/dist/standing-orders/parse.js +61 -18
  447. package/dist/standing-orders/parse.js.map +1 -1
  448. package/dist/studio/apps-standalone/fixture.html +12 -0
  449. package/dist/studio/apps-standalone/fixture.js +10 -0
  450. package/dist/studio/apps-standalone/runtime.css +139 -0
  451. package/dist/studio/apps-standalone/runtime.js +1 -0
  452. package/dist/studio/assets/{KnowledgeGraph-Cpm46tEp.js → KnowledgeGraph-BT5Y-B8b.js} +1 -1
  453. package/dist/studio/assets/index-B_JwrHVF.css +32 -0
  454. package/dist/studio/assets/index-Bl9m8ldl.js +1104 -0
  455. package/dist/studio/editors/wicked-apps/editor.json +1 -1
  456. package/dist/studio/editors/wicked-apps/index.html +2 -2
  457. package/dist/studio/editors/wicked-deck/editor.json +1 -1
  458. package/dist/studio/editors/wicked-deck/index.html +14 -1
  459. package/dist/studio/editors/wicked-doc/editor.json +1 -1
  460. package/dist/studio/editors/wicked-doc/index.html +1 -1
  461. package/dist/studio/editors/wicked-insights/editor.json +1 -1
  462. package/dist/studio/editors/wicked-insights/index.html +1 -1
  463. package/dist/studio/editors/wicked-page/editor.json +10 -1
  464. package/dist/studio/editors/wicked-page/index.html +2 -2
  465. package/dist/studio/editors/wicked-video/editor.json +7 -2
  466. package/dist/studio/editors/wicked-video/index.html +14 -11
  467. package/dist/studio/index.html +2 -2
  468. package/dist/studio/testid-inventory.json +2073 -240
  469. package/dist/team/routes.d.ts +1 -1
  470. package/dist/workflow-catalog/build-v2.d.ts +6 -2
  471. package/dist/workflow-catalog/build-v2.d.ts.map +1 -1
  472. package/dist/workflow-catalog/build-v2.js +37 -13
  473. package/dist/workflow-catalog/build-v2.js.map +1 -1
  474. package/dist/workflow-catalog/catalog-data-v2.d.ts.map +1 -1
  475. package/dist/workflow-catalog/catalog-data-v2.js +310 -105
  476. package/dist/workflow-catalog/catalog-data-v2.js.map +1 -1
  477. package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
  478. package/dist/workflow-catalog/catalog-data.js +2 -20
  479. package/dist/workflow-catalog/catalog-data.js.map +1 -1
  480. package/dist/workflow-catalog/detect-service.d.ts +95 -0
  481. package/dist/workflow-catalog/detect-service.d.ts.map +1 -0
  482. package/dist/workflow-catalog/detect-service.js +239 -0
  483. package/dist/workflow-catalog/detect-service.js.map +1 -0
  484. package/dist/workflow-catalog/detect.d.ts +213 -0
  485. package/dist/workflow-catalog/detect.d.ts.map +1 -0
  486. package/dist/workflow-catalog/detect.js +653 -0
  487. package/dist/workflow-catalog/detect.js.map +1 -0
  488. package/dist/workflow-catalog/shape.d.ts +3 -1
  489. package/dist/workflow-catalog/shape.d.ts.map +1 -1
  490. package/dist/workflow-catalog/shape.js +7 -1
  491. package/dist/workflow-catalog/shape.js.map +1 -1
  492. package/dist/working-doc/bridge-backend.js +2 -2
  493. package/dist/working-doc/event-lines.d.ts +67 -2
  494. package/dist/working-doc/event-lines.d.ts.map +1 -1
  495. package/dist/working-doc/event-lines.js +155 -8
  496. package/dist/working-doc/event-lines.js.map +1 -1
  497. package/dist/working-doc/notes-index.d.ts +35 -0
  498. package/dist/working-doc/notes-index.d.ts.map +1 -0
  499. package/dist/working-doc/notes-index.js +82 -0
  500. package/dist/working-doc/notes-index.js.map +1 -0
  501. package/dist/working-doc/routes.js +4 -4
  502. package/dist/working-doc/sections.js +2 -2
  503. package/dist/working-doc/service.d.ts +260 -21
  504. package/dist/working-doc/service.d.ts.map +1 -1
  505. package/dist/working-doc/service.js +791 -90
  506. package/dist/working-doc/service.js.map +1 -1
  507. package/dist/working-doc/store.d.ts +50 -1
  508. package/dist/working-doc/store.d.ts.map +1 -1
  509. package/dist/working-doc/store.js +4 -1
  510. package/dist/working-doc/store.js.map +1 -1
  511. package/endpoint-manifest.json +187 -3
  512. package/evals/corpora/shape-corrections-v1.json +594 -0
  513. package/evals/corpora/shape-corrections-v1.seat-fixture.json +186 -0
  514. package/evals/corpora/shape-v1.json +2113 -0
  515. package/evals/corpora/shape-v1.seat-fixture.json +1800 -0
  516. package/package.json +11 -7
  517. package/scripts/apps-render.py +226 -0
  518. package/workflows/detect-shape.json +29 -0
  519. package/dist/studio/assets/index-BRBwWQMH.css +0 -32
  520. 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') {
@@ -395,6 +411,8 @@ export async function createServer(adapter, options) {
395
411
  else {
396
412
  await skillsRuntime.apply();
397
413
  await skillsRuntime.autoRefreshOnBoot();
414
+ // crew#1447: a published generation below the garden floor holds launches at the engine input.
415
+ skillsRuntime.holdBelowGardenFloor();
398
416
  }
399
417
  }
400
418
  if (skillsBoot !== null) {
@@ -410,6 +428,20 @@ export async function createServer(adapter, options) {
410
428
  app.decorate('skillsBootSettled', () => skillsBoot ?? Promise.resolve());
411
429
  // Exclusive peers (codex on #846): `venv` is the provisioner path's time, `skills` the rest of
412
430
  // the seam (seed, validate, hash, stage, flip) — the stages sum, never double-count.
431
+ // Skill usage (operator 2026-11-08): the engine's `skillUsed` / `skillsSnapshotHanded` frames rolled up per skill
432
+ // and CLI beside the catalog (`daemon-skill-usage.json`), read by `GET /skills/usage`. Only with a skills seam:
433
+ // its snapshots are where a script is credited to the skills whose files name it.
434
+ const skillUsage = skillsStore !== undefined
435
+ ? new SkillUsageRecorder({
436
+ snapshotsDir: () => (skillsStore === undefined ? null : join(skillsStore.root, 'snapshots')),
437
+ chatOf: (session) => askPaths.chatOf(session),
438
+ })
439
+ : undefined;
440
+ if (skillUsage !== undefined) {
441
+ app.addHook('onClose', async () => {
442
+ skillUsage.flush();
443
+ });
444
+ }
413
445
  const skillsMs = bootClock.lap('skills');
414
446
  const venvMs = skillsStore?.venvStage().ms ?? 0;
415
447
  bootClock.set('skills', skillsMs - venvMs);
@@ -620,13 +652,15 @@ export async function createServer(adapter, options) {
620
652
  // The durable record first, then the read-side index — the same write order as
621
653
  // `guidance.set`, so the index can only LAG a crash (rehydrated at next boot), never
622
654
  // 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
- },
655
+ // CS11: the trail and the index get the same `commit` ({@link recordDelivery}, tested as is).
656
+ record: (runId, record) => recordDelivery(audit, deliveryIndex, DAEMON_ACTOR, runId, record),
657
+ // CS11 (DES-CATALOG-002 rev 8): record the delivered HEAD SHA from now on, over the registered
658
+ // repo root (the same `listRepos()` resolver this file uses for repo roots) + the engine's
659
+ // `run_branch` (else `wicked/<id>`). The body lives in `delivery-index.ts` ({@link
660
+ // deliveredCommitFor}) so tests exercise the production code, not a copy (cs11-b review
661
+ // P1/P2): it records NO commit when a later phase ran after the deliver unit (the pushed tip
662
+ // may have moved) and when the SHA cannot be read — the join then keeps the run (fail-closed).
663
+ deliveredCommit: (view) => deliveredCommitFor(view, async (repoRef) => (await adapter.listRepos()).find((r) => r.id === repoRef)?.root_path),
630
664
  log: (m) => app.log.warn(m),
631
665
  });
632
666
  const resolveRunDelivery = (runId) => deliveryResolver.resolve(runId);
@@ -705,6 +739,15 @@ export async function createServer(adapter, options) {
705
739
  // DES-CHAT-ARTIFACTS-001 §5.2 (A3): the durable binding of every chat-made document, under the registered `chats`
706
740
  // state-home entry (core's fence refuses a new top-level entry, and no worker reads the state home).
707
741
  const docBindings = new DocBindingStore(join(crewStateDir, 'chats', 'doc-bindings'));
742
+ // A6 / PLAN G12: per run, what crew checked on the file it announced (floor, page count, the writer's notes), under the
743
+ // same registered `chats` entry; the checks read serves it by the version interactive records each run on.
744
+ const docLandings = new LandingRecordStore(join(crewStateDir, 'chats', 'doc-landings'));
745
+ // G12: the floor prints the document with the operator's own renderer, else crew's provisioned Chromium when made.
746
+ const floorChrome = () => (process.env['WICKED_CHROME'] ?? '').trim() || managedChromium(conformanceRuntimeRoot());
747
+ // G12: the run's own engine `draft_render` record (its latest unit of that step, read fresh: the floor runs as the run
748
+ // ends), which the floor reuses when it measured these exact bytes with the floor's own print profile.
749
+ const floorEngineRender = async (runId) => latestDraftRender((await adapter.runView(runId, { fresh: true }))?.units);
750
+ const draftFloorIo = { chrome: floorChrome, engineRender: floorEngineRender };
708
751
  /**
709
752
  * A3 (§6.2): a proposal-bound attempt's outcome was recorded. A failure is said on the run (`run.landing_failed`, the
710
753
  * DTO's `landing_failed` and a `landingFailed` frame), releases the chat and the document (their busy checks read the
@@ -724,14 +767,16 @@ export async function createServer(adapter, options) {
724
767
  broadcast({ type: 'landingFailed', session: runId, artifact_ref: ref, reason: outcome.reason });
725
768
  if (hit === null || chatProposals === null)
726
769
  return;
727
- const chatNow = chatHistory.idOfInstance(hit.binding.chatId, hit.binding.chatInstance);
770
+ // A5: a refine's retry card goes to the chat the refine was accepted in.
771
+ const chatOf = hit.attempt.chatId !== undefined ? { chatId: hit.attempt.chatId, chatInstance: hit.attempt.chatInstance ?? null } : hit.binding;
772
+ const chatNow = chatHistory.idOfInstance(chatOf.chatId, chatOf.chatInstance);
728
773
  if (chatNow === null) {
729
774
  app.log.warn(`[proposals] run ${runId} failed, and the chat it was made from is gone — no retry card`);
730
775
  docBindings.markPublished(ref, runId);
731
776
  return;
732
777
  }
733
778
  void chatProposals
734
- .appendRetry(chatNow, hit.attempt.pid, runId, ref, outcome.reason, hit.binding.chatInstance)
779
+ .appendRetry(chatNow, hit.attempt.pid, runId, ref, outcome.reason, chatOf.chatInstance)
735
780
  .then((pid) => {
736
781
  if (pid !== null)
737
782
  docBindings.setRetry(ref, runId, pid);
@@ -1119,6 +1164,16 @@ export async function createServer(adapter, options) {
1119
1164
  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
1165
  }
1121
1166
  }
1167
+ // DES-CATALOG-002 §2.3: the hidden detect-shape turn (POST /workflows/catalog/detect). Without it, detection answers
1168
+ // from the words layer alone, never sure.
1169
+ if (typeof adapter.registerWorkflow === 'function') {
1170
+ try {
1171
+ await adapter.registerWorkflow(loadDetectWorkflow());
1172
+ }
1173
+ catch (err) {
1174
+ app.log.warn(`[detect] could not register the '${DETECT_WORKFLOW}' workflow — detection answers from the words alone: ${err instanceof Error ? err.message : String(err)}`);
1175
+ }
1176
+ }
1122
1177
  // A check a restart interrupted is stopped and answered now, so it never runs on unwatched past its bound.
1123
1178
  void unitInspect.recover();
1124
1179
  registerInspectRoutes(app, { service: unitInspect, audit });
@@ -1194,7 +1249,25 @@ export async function createServer(adapter, options) {
1194
1249
  },
1195
1250
  audit,
1196
1251
  });
1197
- registerInsightsRoutes(app, { store: insightsStore, service: reviewService, audit });
1252
+ registerInsightsRoutes(app, {
1253
+ store: insightsStore,
1254
+ service: reviewService,
1255
+ audit,
1256
+ // (DES-CATALOG-002 CS6) `POST /insights/facts`: the engine resolves the unit's token; crew reads which step it is.
1257
+ ...(CoreAdapter.estateScopeResolver() !== null
1258
+ ? {
1259
+ facts: {
1260
+ unitOf: factsUnitResolver((req) => {
1261
+ const resolve = CoreAdapter.estateScopeResolver();
1262
+ if (resolve === null)
1263
+ return Promise.reject(new Error('no resolver'));
1264
+ return resolve(req);
1265
+ }, () => adapter.sessionsDetail()),
1266
+ collect: (opts, nowMs) => reviewService.collect(opts, nowMs),
1267
+ },
1268
+ }
1269
+ : {}),
1270
+ });
1198
1271
  if (options?.workflowSchedules?.enabled ?? !(process.env['VITEST'] !== undefined || process.env['NODE_ENV'] === 'test')) {
1199
1272
  // Seeded (and so written to the state home) only by a daemon that runs the tick: a headless boot (the
1200
1273
  // endpoint-manifest collector, a test) never plants a schedule file in whatever state home it resolves.
@@ -1283,6 +1356,8 @@ export async function createServer(adapter, options) {
1283
1356
  bindings: docBindings,
1284
1357
  onBoundDocCreated: (ref) => onBoundDocCreated(ref),
1285
1358
  onBoundOutcome,
1359
+ landings: docLandings,
1360
+ draftFloorIo,
1286
1361
  resolveDocsRoot: o.resolveDocsRoot ?? interactiveDocsRoot,
1287
1362
  log: (m) => app.log.warn(m),
1288
1363
  logError: (m) => app.log.error(m),
@@ -1424,6 +1499,12 @@ export async function createServer(adapter, options) {
1424
1499
  isDocBusy: (documentId) => (draftSub?.inFlightDocs().includes(documentId) ?? false) ||
1425
1500
  (editSub?.inFlightDocs().includes(documentId) ?? false),
1426
1501
  onRunFiled: fileRun,
1502
+ // DES-CHAT-ARTIFACTS-001 §6 (A5): a proposal-bound refine's attempt, launch record, landing record and outcome.
1503
+ bindings: docBindings,
1504
+ onBoundOutcome,
1505
+ onRunLaunched: (runId, detail) => { recordRunLaunched(audit, runTimingIndex, DAEMON_ACTOR, runId, detail); },
1506
+ landings: docLandings,
1507
+ draftFloorIo,
1427
1508
  log: (m) => app.log.warn(m),
1428
1509
  logError: (m) => app.log.error(m),
1429
1510
  });
@@ -1693,6 +1774,7 @@ export async function createServer(adapter, options) {
1693
1774
  elicitationCache.ingest(event);
1694
1775
  askServer.ingest(event);
1695
1776
  seatHealth.ingest(event);
1777
+ skillUsage?.ingest(event);
1696
1778
  // ASK-C2: a path run's unit + terminal frames become the chat's frames (re-entering this fold
1697
1779
  // as chatDelta / chatReply, which the relay ignores — no recursion).
1698
1780
  if (typeof event.session === 'string')
@@ -2047,6 +2129,12 @@ export async function createServer(adapter, options) {
2047
2129
  // diagnostics reads the bundle's shipped version manifest from the same root the static
2048
2130
  // handler serves. One resolution, two consumers.
2049
2131
  const studioRoot = options?.studioRoot ?? defaultStudioRoot();
2132
+ // (DES-EDITOR-CONFORMANCE-HOST, e2e F18) The engine runs an editor-plugin run's conformance cases on this host: it
2133
+ // reads crew's conformance runtime and this studio dist from the daemon's environment.
2134
+ exportEngineConformanceEnv(studioRoot);
2135
+ // (PLAN G12) And the managed headless shell as the daemon's `WICKED_CHROME`, for the engine's `draft_render` step (an
2136
+ // operator's own value wins); the provisioner exports it again whenever it makes or finds the runtime.
2137
+ exportManagedChrome(conformanceRuntimeRoot());
2050
2138
  // DES-MCP-TOOLS-001 S2: the registry over `<state home>/mcp` (created on the first save).
2051
2139
  const mcpRegistryStore = new McpRegistryStore();
2052
2140
  const mcpSecrets = platformSecretStore();
@@ -2133,8 +2221,24 @@ export async function createServer(adapter, options) {
2133
2221
  const unitVisible = (scope) => projectVisible(scope.projectId, scope.repoId);
2134
2222
  // DES-KNOWLEDGE-DATA-001 §9.1: an app's knowledge query sees what a unit in the APP'S project sees (the same set).
2135
2223
  const appsKnowledgeVisible = (projectId) => projectVisible(projectId);
2224
+ // (DES-CATALOG-002 CS4/CS10) Each run's source pick: recorded at launch (POST /runs), read by the broker, the unit's
2225
+ // tool list and the estate relay, so a unit never reaches a registered source its job did not pick.
2226
+ const runSourcePicks = new RunSourcePicks(join(crewStateHome(), 'mcp', 'run-source-picks.json'));
2227
+ /** Every registered source and PM tracker id with its owning source's name: how the relay maps `source:<id>` to a pick. */
2228
+ const sourceOwnerNames = async () => {
2229
+ const out = (await dataGate.sources()).map((s) => ({ id: s.id, name: s.name }));
2230
+ for (const e of await dataGate.pm.entries()) {
2231
+ out.push({ id: e.id, name: e.name });
2232
+ for (const t of e.trackers)
2233
+ out.push({ id: t.id, name: e.name });
2234
+ }
2235
+ return out;
2236
+ };
2136
2237
  const mcpBroker = new McpBroker({
2238
+ picks: runSourcePicks,
2137
2239
  registry: mcpRegistry,
2240
+ // DES-CATALOG-002 §2.3: a `detect-shape` run reaches nothing (its fence is its identity).
2241
+ fence: daemonRunFence((runId) => adapter.launchedWorkflowOfRun(runId)),
2138
2242
  engine: options?.mcpEngineGate ?? (() => CoreAdapter.mcpEngineGate()),
2139
2243
  records: mcpCallRecords,
2140
2244
  budgetPerUnit: budgetFromEnv(),
@@ -2145,6 +2249,8 @@ export async function createServer(adapter, options) {
2145
2249
  estate: new EstateRelay({
2146
2250
  resolver: () => CoreAdapter.estateScopeResolver(),
2147
2251
  visible: unitVisible,
2252
+ picks: runSourcePicks,
2253
+ sourceNames: sourceOwnerNames,
2148
2254
  onProposal: (p) => audit.record('estate.proposal.submitted', { id: `seat:${p.seat}`, kind: 'agent', trust: 'observer' }, {
2149
2255
  runId: p.runId,
2150
2256
  detail: { unit: p.ord, attempt: p.attempt, seat: p.seat, proposalId: p.proposalId, kindType: p.kindType, callId: p.callId },
@@ -2281,10 +2387,15 @@ export async function createServer(adapter, options) {
2281
2387
  docGrounding,
2282
2388
  // DES-CHAT-ARTIFACTS-001 §5.2 (A3): chat-made documents; `create` is real only when the draft seam is armed.
2283
2389
  docBindings,
2390
+ docLandings,
2284
2391
  ...(draftSub !== null ? { launchBoundDraft: draftSub.launchBound, fenceBoundDraft: draftSub.fenceBound } : {}),
2392
+ // A5: a refine is real only when the chat seam is armed AND the draft seam is (its landing watch settles every
2393
+ // proposal-bound attempt on `version.created` / `draft.conflict`; codex A5 r1).
2394
+ ...(chatSub !== null && draftSub !== null ? { launchBoundRefine: chatSub.launchBound } : {}),
2285
2395
  // crew#899: a chat's checkouts are brought to their upstream (when clean) before it reads them.
2286
2396
  freshenCheckout: (root) => freshenCheckout(root),
2287
2397
  ...(skillsRuntime !== undefined ? { skills: skillsRuntime } : {}),
2398
+ ...(skillUsage !== undefined ? { skillUsage } : {}),
2288
2399
  // DES-MCP-TOOLS-001 S2: the registry over `<state home>/mcp` (created on the first save).
2289
2400
  // Route tests drive `registerMcpRoutes` over their own registry (tests/mcp-registry.test.ts).
2290
2401
  mcp: mcpRegistry,
@@ -2306,6 +2417,10 @@ export async function createServer(adapter, options) {
2306
2417
  mcpBroker,
2307
2418
  // DES-KNOWLEDGE-DATA-001 §7: the data gate, its registry store and its read record.
2308
2419
  dataGate,
2420
+ // (DES-CATALOG-002 CS4) Each run's source pick, in the registered `mcp` entry (CS10's fence reads it), and the
2421
+ // folder a run's documents are staged in, outside the state home.
2422
+ runSourcePicks,
2423
+ runDocumentsRoot: runDocumentsRootDir(),
2309
2424
  mcpRegistryStore,
2310
2425
  sourceReads,
2311
2426
  trackerProjector,
@@ -2433,12 +2548,38 @@ export async function createServer(adapter, options) {
2433
2548
  // Program DES-POWER-MODE §8.3/§9 (spike 3): the run's working document — a wicked-interactive document of kind
2434
2549
  // `phase-report` — and the steering notes a person's edits of it become. Steering rides the engine's operator
2435
2550
  // inject only; nothing here answers a gate.
2551
+ const workingDocNotes = new PersonNotesIndex();
2552
+ // The working documents read the run views (the engine's whole-store fold) at most once per 2 s between them: the
2553
+ // catch-up and a burst of syncs share one read instead of one each (crew#944: run reads must stay fast).
2554
+ let workingDocViewsRead = null;
2555
+ const workingDocViews = () => {
2556
+ if (workingDocViewsRead === null || Date.now() - workingDocViewsRead.at > 2_000) {
2557
+ const views = adapter.sessionsDetail();
2558
+ workingDocViewsRead = { at: Date.now(), views };
2559
+ views.catch(() => { if (workingDocViewsRead?.views === views)
2560
+ workingDocViewsRead = null; });
2561
+ }
2562
+ return workingDocViewsRead.views;
2563
+ };
2564
+ /** How long after start the working documents' catch-up begins (`WICKED_WORKING_DOC_CATCHUP_MS`, default 10 s). */
2565
+ const catchUpEnv = Number(process.env['WICKED_WORKING_DOC_CATCHUP_MS']);
2566
+ const WORKING_DOC_CATCH_UP_DELAY_MS = process.env['WICKED_WORKING_DOC_CATCHUP_MS'] !== undefined && Number.isFinite(catchUpEnv) && catchUpEnv >= 0 ? catchUpEnv : 10_000;
2567
+ // The start-up read of the trail for the person's answers; every document sync waits for it (never rejects).
2568
+ const workingDocNotesRead = audit.readAll().then((entries) => workingDocNotes.hydrate(entries), (err) => {
2569
+ app.log.warn(`[working-doc] the trail could not be read for the person's answers: ${String(err)}`);
2570
+ return workingDocNotes.hydrate([]);
2571
+ });
2436
2572
  const workingDocs = new WorkingDocService({
2437
2573
  store: new WorkingDocStore({ log: (m) => app.log.warn(m) }),
2438
2574
  backend: bridgeBackend(interactiveBridges, (projectId) => workingDocRoot(adapter, projectSettings, projectId)),
2439
- engine: { injectWorkerMessage: (runId, message, target) => adapter.injectWorkerMessage(runId, message, target) },
2575
+ engine: {
2576
+ injectWorkerMessage: (runId, message, target) => adapter.injectWorkerMessage(runId, message, target),
2577
+ supportsRunContext: () => typeof adapter.supportsRunContext === 'function' && adapter.supportsRunContext(),
2578
+ // (context-doc-switch) The person's Goal, Approach and Constraints as the engine's context block.
2579
+ setRunContext: (runId, ctx) => adapter.setRunContext(runId, ctx),
2580
+ },
2440
2581
  run: async (runId) => {
2441
- const v = (await adapter.sessionsDetail()).find((x) => x.session.id === runId);
2582
+ const v = (await workingDocViews()).find((x) => x.session.id === runId);
2442
2583
  if (v === undefined)
2443
2584
  return null;
2444
2585
  return {
@@ -2446,12 +2587,19 @@ export async function createServer(adapter, options) {
2446
2587
  problem: v.session.problem ?? '',
2447
2588
  projectId: runProject(v, runId, (id) => membershipIndex.projectOf(id)) ?? WORKING_DOC_DEFAULT_PROJECT,
2448
2589
  terminal: ['completed', 'cancelled', 'failed'].includes(v.session.status),
2449
- stepOf: (ord) => {
2450
- const u = v.units.find((x) => x.ord === ord);
2451
- return u?.phase_ref ?? (typeof u?.description === 'string' ? (u.description.split(/\s+[—-]\s+/u)[0] ?? null) : null);
2452
- },
2590
+ stepOf: (ord) => workingDocStep(v.units.find((x) => x.ord === ord)),
2591
+ power: v.session.power != null,
2592
+ // The run's current plan (the engine's unit list): what a phased run's Approach says once its plan settles.
2593
+ steps: v.units.map((u) => ({ ord: u.ord, name: workingDocStep(u), seat: u.assigned_cli ?? null })),
2453
2594
  };
2454
2595
  },
2596
+ // A person's answers with their words (crew's own trail: the engine's log does not say who, or why), from memory,
2597
+ // once the start-up read of the trail is in (so a line never lands ahead of an older one).
2598
+ notes: async (runId) => { await workingDocNotesRead; return workingDocNotes.of(runId); },
2599
+ // The launch time is crew's (the run-timing index, from `run.launched`); a run with none sorts oldest.
2600
+ liveRuns: async () => (await workingDocViews())
2601
+ .filter((v) => !['completed', 'cancelled', 'failed'].includes(v.session.status) && v.session.archived_at == null)
2602
+ .map((v) => ({ runId: v.session.id, createdAt: runTimingIndex.createdAtFor(v.session.id) ?? 0 })),
2455
2603
  changed: (runId, head) => broadcast({ type: 'workingDocChanged', session: runId, head }),
2456
2604
  audit: (action, actor, runId, detail) => audit.record(action, actor, { runId, detail }),
2457
2605
  // The run's own log: crew writes the event-derived lines (Decisions, Open questions, Next) whether or not a tab
@@ -2460,8 +2608,28 @@ export async function createServer(adapter, options) {
2460
2608
  log: (m) => app.log.warn(m),
2461
2609
  });
2462
2610
  workingDocTap = (e) => workingDocs.onEvent(e);
2463
- // After a restart no further event may come for a run: bring every held document's lines up to date once.
2464
- workingDocs.catchUp();
2611
+ // (context-doc-switch) The engine's context blocks are set at once (one cheap call per live document, serial), not
2612
+ // after the slower line catch-up below: a seat spawned meanwhile would miss a block the engine does not hold yet.
2613
+ void workingDocs.contextCatchUp();
2614
+ // A person's answer recorded in the trail (a gate note, a skip reason, guidance) brings the run's document up to date:
2615
+ // some come with no engine event at all (guidance), and a gate's is recorded after the engine's answer.
2616
+ audit.onRecord((entry) => { const runId = workingDocNotes.add(entry); if (runId !== null)
2617
+ workingDocs.nudge(runId); });
2618
+ // After a restart no further event may come for a run: once the person's answers are read from the trail, bring every
2619
+ // held document up to date and make the newest live runs' documents (bounded, one at a time; never rejects). Answers
2620
+ // recorded while the trail was read bring their run's document up to date too.
2621
+ // It starts a little after the daemon is up (a boot is busy enough), and never after it has closed.
2622
+ let workingDocCatchUp = setTimeout(() => {
2623
+ workingDocCatchUp = null;
2624
+ void workingDocNotesRead.then(async (touched) => {
2625
+ for (const runId of touched)
2626
+ workingDocs.nudge(runId);
2627
+ await workingDocs.catchUp();
2628
+ });
2629
+ }, WORKING_DOC_CATCH_UP_DELAY_MS);
2630
+ workingDocCatchUp.unref?.();
2631
+ app.addHook('onClose', async () => { if (workingDocCatchUp !== null)
2632
+ clearTimeout(workingDocCatchUp); });
2465
2633
  registerWorkingDocRoutes(app, { service: workingDocs, exists: async (id) => (await adapter.sessions()).includes(id) });
2466
2634
  registerStandingOrderRoutes(app, {
2467
2635
  store: standingOrders,
@@ -2607,4 +2775,17 @@ export async function startServer(adapter, port = 7701, host = '127.0.0.1', opti
2607
2775
  process.env['WICKED_CREW_URL'] = brokerUrlFor(boundHost, boundPort);
2608
2776
  return { app, port: boundPort, host: boundHost, stages: clock.snapshot() };
2609
2777
  }
2778
+ /**
2779
+ * (DES-CATALOG-002 CS4) Where a run's documents are staged: `WICKED_RUN_DOCS_DIR` when set; for the default state home
2780
+ * `~/.wicked/run-documents`; for any other `<state home>-run-documents`. Never inside the state home: core's Read fence
2781
+ * denies every state-home entry to workers, and an unregistered entry there refuses every launch (the demo-root rule,
2782
+ * `api/recording.ts` `demoRootDir`).
2783
+ */
2784
+ export function runDocumentsRootDir() {
2785
+ if (process.env.WICKED_RUN_DOCS_DIR)
2786
+ return process.env.WICKED_RUN_DOCS_DIR;
2787
+ if (isDefaultStateHome())
2788
+ return join(process.env.HOME ?? process.env.USERPROFILE ?? '/tmp', '.wicked', 'run-documents');
2789
+ return `${crewStateHome()}-run-documents`;
2790
+ }
2610
2791
  //# sourceMappingURL=server.js.map