wicked-crew 0.18.20 → 0.18.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (509) hide show
  1. package/dist/api/capture.d.ts +5 -2
  2. package/dist/api/capture.d.ts.map +1 -1
  3. package/dist/api/capture.js +13 -10
  4. package/dist/api/capture.js.map +1 -1
  5. package/dist/api/chat-context.d.ts +12 -0
  6. package/dist/api/chat-context.d.ts.map +1 -1
  7. package/dist/api/chat-context.js +61 -6
  8. package/dist/api/chat-context.js.map +1 -1
  9. package/dist/api/chat-freshness.js +2 -2
  10. package/dist/api/chat-freshness.js.map +1 -1
  11. package/dist/api/chat-jobs.d.ts +54 -0
  12. package/dist/api/chat-jobs.d.ts.map +1 -1
  13. package/dist/api/chat-jobs.js +199 -7
  14. package/dist/api/chat-jobs.js.map +1 -1
  15. package/dist/api/chat-proposals.d.ts +39 -6
  16. package/dist/api/chat-proposals.d.ts.map +1 -1
  17. package/dist/api/chat-proposals.js +161 -36
  18. package/dist/api/chat-proposals.js.map +1 -1
  19. package/dist/api/chat-requirements.d.ts.map +1 -1
  20. package/dist/api/chat-requirements.js +4 -1
  21. package/dist/api/chat-requirements.js.map +1 -1
  22. package/dist/api/chat-scope.d.ts +8 -0
  23. package/dist/api/chat-scope.d.ts.map +1 -1
  24. package/dist/api/chat-scope.js +26 -2
  25. package/dist/api/chat-scope.js.map +1 -1
  26. package/dist/api/cluster-status.d.ts +24 -12
  27. package/dist/api/cluster-status.d.ts.map +1 -1
  28. package/dist/api/cluster-status.js +81 -3
  29. package/dist/api/cluster-status.js.map +1 -1
  30. package/dist/api/codebase-archive.js +2 -2
  31. package/dist/api/codebase-archive.js.map +1 -1
  32. package/dist/api/delivery-cache.d.ts +2 -0
  33. package/dist/api/delivery-cache.d.ts.map +1 -1
  34. package/dist/api/delivery-cache.js +1 -2
  35. package/dist/api/delivery-cache.js.map +1 -1
  36. package/dist/api/delivery-index.d.ts +2 -2
  37. package/dist/api/delivery-index.d.ts.map +1 -1
  38. package/dist/api/delivery-index.js +1 -2
  39. package/dist/api/delivery-index.js.map +1 -1
  40. package/dist/api/eval-compare.d.ts +1 -1
  41. package/dist/api/eval-compare.js +1 -1
  42. package/dist/api/eval-sample.d.ts +7 -0
  43. package/dist/api/eval-sample.d.ts.map +1 -1
  44. package/dist/api/eval-sample.js +20 -0
  45. package/dist/api/eval-sample.js.map +1 -1
  46. package/dist/api/governance-steering.d.ts +13 -0
  47. package/dist/api/governance-steering.d.ts.map +1 -1
  48. package/dist/api/governance-steering.js +56 -7
  49. package/dist/api/governance-steering.js.map +1 -1
  50. package/dist/api/mcp.d.ts +3 -1
  51. package/dist/api/mcp.d.ts.map +1 -1
  52. package/dist/api/mcp.js +5 -2
  53. package/dist/api/mcp.js.map +1 -1
  54. package/dist/api/needs.d.ts +20 -0
  55. package/dist/api/needs.d.ts.map +1 -1
  56. package/dist/api/needs.js +120 -19
  57. package/dist/api/needs.js.map +1 -1
  58. package/dist/api/onboarding-capture.d.ts +21 -1
  59. package/dist/api/onboarding-capture.d.ts.map +1 -1
  60. package/dist/api/onboarding-capture.js +112 -8
  61. package/dist/api/onboarding-capture.js.map +1 -1
  62. package/dist/api/policy-landing.d.ts +36 -0
  63. package/dist/api/policy-landing.d.ts.map +1 -1
  64. package/dist/api/policy-landing.js +123 -4
  65. package/dist/api/policy-landing.js.map +1 -1
  66. package/dist/api/post-hoc-deliver.d.ts.map +1 -1
  67. package/dist/api/post-hoc-deliver.js +2 -1
  68. package/dist/api/post-hoc-deliver.js.map +1 -1
  69. package/dist/api/proposal-decisions.d.ts +44 -0
  70. package/dist/api/proposal-decisions.d.ts.map +1 -0
  71. package/dist/api/proposal-decisions.js +85 -0
  72. package/dist/api/proposal-decisions.js.map +1 -0
  73. package/dist/api/proposal-onboard.d.ts +29 -0
  74. package/dist/api/proposal-onboard.d.ts.map +1 -1
  75. package/dist/api/proposal-onboard.js +162 -11
  76. package/dist/api/proposal-onboard.js.map +1 -1
  77. package/dist/api/recording.d.ts.map +1 -1
  78. package/dist/api/recording.js +4 -5
  79. package/dist/api/recording.js.map +1 -1
  80. package/dist/api/redeliver.d.ts.map +1 -1
  81. package/dist/api/redeliver.js +11 -7
  82. package/dist/api/redeliver.js.map +1 -1
  83. package/dist/api/repo-input.d.ts.map +1 -1
  84. package/dist/api/repo-input.js +5 -2
  85. package/dist/api/repo-input.js.map +1 -1
  86. package/dist/api/repo-origins.d.ts +24 -0
  87. package/dist/api/repo-origins.d.ts.map +1 -0
  88. package/dist/api/repo-origins.js +71 -0
  89. package/dist/api/repo-origins.js.map +1 -0
  90. package/dist/api/requirements.d.ts +36 -1
  91. package/dist/api/requirements.d.ts.map +1 -1
  92. package/dist/api/requirements.js +73 -2
  93. package/dist/api/requirements.js.map +1 -1
  94. package/dist/api/review-change.d.ts +5 -6
  95. package/dist/api/review-change.d.ts.map +1 -1
  96. package/dist/api/review-change.js +45 -8
  97. package/dist/api/review-change.js.map +1 -1
  98. package/dist/api/routes.d.ts +33 -4
  99. package/dist/api/routes.d.ts.map +1 -1
  100. package/dist/api/routes.js +518 -182
  101. package/dist/api/routes.js.map +1 -1
  102. package/dist/api/run-sources.d.ts +11 -1
  103. package/dist/api/run-sources.d.ts.map +1 -1
  104. package/dist/api/run-sources.js +26 -3
  105. package/dist/api/run-sources.js.map +1 -1
  106. package/dist/api/run-timing-index.d.ts +46 -1
  107. package/dist/api/run-timing-index.d.ts.map +1 -1
  108. package/dist/api/run-timing-index.js +135 -1
  109. package/dist/api/run-timing-index.js.map +1 -1
  110. package/dist/api/runtime-state.d.ts +6 -0
  111. package/dist/api/runtime-state.d.ts.map +1 -1
  112. package/dist/api/runtime-state.js +14 -3
  113. package/dist/api/runtime-state.js.map +1 -1
  114. package/dist/api/seat-agents.d.ts.map +1 -1
  115. package/dist/api/seat-agents.js +3 -3
  116. package/dist/api/seat-agents.js.map +1 -1
  117. package/dist/api/seat-container-login.d.ts +6 -2
  118. package/dist/api/seat-container-login.d.ts.map +1 -1
  119. package/dist/api/seat-container-login.js +15 -7
  120. package/dist/api/seat-container-login.js.map +1 -1
  121. package/dist/api/seat-governance.d.ts +3 -2
  122. package/dist/api/seat-governance.d.ts.map +1 -1
  123. package/dist/api/seat-governance.js +31 -9
  124. package/dist/api/seat-governance.js.map +1 -1
  125. package/dist/api/seat-standing.d.ts +8 -0
  126. package/dist/api/seat-standing.d.ts.map +1 -1
  127. package/dist/api/seat-standing.js +26 -1
  128. package/dist/api/seat-standing.js.map +1 -1
  129. package/dist/api/server.d.ts +7 -0
  130. package/dist/api/server.d.ts.map +1 -1
  131. package/dist/api/server.js +93 -39
  132. package/dist/api/server.js.map +1 -1
  133. package/dist/api/start-on-login.d.ts +4 -0
  134. package/dist/api/start-on-login.d.ts.map +1 -0
  135. package/dist/api/start-on-login.js +35 -0
  136. package/dist/api/start-on-login.js.map +1 -0
  137. package/dist/api/steering-landing.d.ts +33 -8
  138. package/dist/api/steering-landing.d.ts.map +1 -1
  139. package/dist/api/steering-landing.js +235 -51
  140. package/dist/api/steering-landing.js.map +1 -1
  141. package/dist/api/system-snapshot.d.ts.map +1 -1
  142. package/dist/api/system-snapshot.js +5 -3
  143. package/dist/api/system-snapshot.js.map +1 -1
  144. package/dist/api/worktree-sweep.d.ts +7 -3
  145. package/dist/api/worktree-sweep.d.ts.map +1 -1
  146. package/dist/api/worktree-sweep.js +10 -6
  147. package/dist/api/worktree-sweep.js.map +1 -1
  148. package/dist/apps/exec/recall.d.ts.map +1 -1
  149. package/dist/apps/exec/recall.js +4 -4
  150. package/dist/apps/exec/recall.js.map +1 -1
  151. package/dist/apps/git.js +2 -2
  152. package/dist/apps/git.js.map +1 -1
  153. package/dist/apps/publish/manifest.d.ts +2 -0
  154. package/dist/apps/publish/manifest.d.ts.map +1 -1
  155. package/dist/apps/publish/manifest.js +8 -3
  156. package/dist/apps/publish/manifest.js.map +1 -1
  157. package/dist/apps/publish/run.d.ts +11 -1
  158. package/dist/apps/publish/run.d.ts.map +1 -1
  159. package/dist/apps/publish/run.js +97 -17
  160. package/dist/apps/publish/run.js.map +1 -1
  161. package/dist/apps/routes.d.ts +2 -0
  162. package/dist/apps/routes.d.ts.map +1 -1
  163. package/dist/apps/routes.js +45 -2
  164. package/dist/apps/routes.js.map +1 -1
  165. package/dist/apps/store.d.ts +24 -3
  166. package/dist/apps/store.d.ts.map +1 -1
  167. package/dist/apps/store.js +26 -9
  168. package/dist/apps/store.js.map +1 -1
  169. package/dist/apps/turns.d.ts +25 -2
  170. package/dist/apps/turns.d.ts.map +1 -1
  171. package/dist/apps/turns.js +276 -11
  172. package/dist/apps/turns.js.map +1 -1
  173. package/dist/apps-server/runners/sqlite-runner.mjs +39 -1
  174. package/dist/apps-server/server/lib/bundle/server.mjs +113 -13
  175. package/dist/core/adapter.d.ts +23 -8
  176. package/dist/core/adapter.d.ts.map +1 -1
  177. package/dist/core/adapter.js +59 -26
  178. package/dist/core/adapter.js.map +1 -1
  179. package/dist/core/ado-deliver-helper.d.ts +2 -1
  180. package/dist/core/ado-deliver-helper.d.ts.map +1 -1
  181. package/dist/core/ado-deliver-helper.js +26 -1
  182. package/dist/core/ado-deliver-helper.js.map +1 -1
  183. package/dist/core/assurance.d.ts +10 -0
  184. package/dist/core/assurance.d.ts.map +1 -1
  185. package/dist/core/assurance.js +23 -0
  186. package/dist/core/assurance.js.map +1 -1
  187. package/dist/core/deliver-text.d.ts +2 -0
  188. package/dist/core/deliver-text.d.ts.map +1 -1
  189. package/dist/core/deliver-text.js +1 -0
  190. package/dist/core/deliver-text.js.map +1 -1
  191. package/dist/core/deliver.d.ts +43 -1
  192. package/dist/core/deliver.d.ts.map +1 -1
  193. package/dist/core/deliver.js +131 -3
  194. package/dist/core/deliver.js.map +1 -1
  195. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  196. package/dist/core/estate-mcp-client.js +4 -8
  197. package/dist/core/estate-mcp-client.js.map +1 -1
  198. package/dist/core/exec.d.ts +24 -0
  199. package/dist/core/exec.d.ts.map +1 -1
  200. package/dist/core/exec.js +45 -2
  201. package/dist/core/exec.js.map +1 -1
  202. package/dist/core/linked-issues.d.ts +13 -2
  203. package/dist/core/linked-issues.d.ts.map +1 -1
  204. package/dist/core/linked-issues.js +135 -4
  205. package/dist/core/linked-issues.js.map +1 -1
  206. package/dist/core/redeliver.js +2 -2
  207. package/dist/core/redeliver.js.map +1 -1
  208. package/dist/core/repo-clone.d.ts +64 -0
  209. package/dist/core/repo-clone.d.ts.map +1 -0
  210. package/dist/core/repo-clone.js +306 -0
  211. package/dist/core/repo-clone.js.map +1 -0
  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/run-read-lane.d.ts +30 -0
  216. package/dist/core/run-read-lane.d.ts.map +1 -0
  217. package/dist/core/run-read-lane.js +103 -0
  218. package/dist/core/run-read-lane.js.map +1 -0
  219. package/dist/core/types.d.ts +10 -0
  220. package/dist/core/types.d.ts.map +1 -1
  221. package/dist/core/types.js.map +1 -1
  222. package/dist/core/walkthrough-root.d.ts.map +1 -1
  223. package/dist/core/walkthrough-root.js +3 -5
  224. package/dist/core/walkthrough-root.js.map +1 -1
  225. package/dist/core/wicked-home.d.ts +9 -0
  226. package/dist/core/wicked-home.d.ts.map +1 -0
  227. package/dist/core/wicked-home.js +25 -0
  228. package/dist/core/wicked-home.js.map +1 -0
  229. package/dist/decisions/consider.d.ts +2 -1
  230. package/dist/decisions/consider.d.ts.map +1 -1
  231. package/dist/decisions/consider.js +2 -2
  232. package/dist/decisions/consider.js.map +1 -1
  233. package/dist/decisions/land.d.ts +2 -0
  234. package/dist/decisions/land.d.ts.map +1 -1
  235. package/dist/decisions/land.js +16 -3
  236. package/dist/decisions/land.js.map +1 -1
  237. package/dist/decisions/rules-brief.d.ts +2 -1
  238. package/dist/decisions/rules-brief.d.ts.map +1 -1
  239. package/dist/decisions/rules-brief.js +3 -2
  240. package/dist/decisions/rules-brief.js.map +1 -1
  241. package/dist/editors/conformance-runtime.d.ts +0 -2
  242. package/dist/editors/conformance-runtime.d.ts.map +1 -1
  243. package/dist/editors/conformance-runtime.js +0 -4
  244. package/dist/editors/conformance-runtime.js.map +1 -1
  245. package/dist/editors/pack-install.d.ts +11 -15
  246. package/dist/editors/pack-install.d.ts.map +1 -1
  247. package/dist/editors/pack-install.js +51 -65
  248. package/dist/editors/pack-install.js.map +1 -1
  249. package/dist/editors/registry.d.ts +26 -12
  250. package/dist/editors/registry.d.ts.map +1 -1
  251. package/dist/editors/registry.js +35 -15
  252. package/dist/editors/registry.js.map +1 -1
  253. package/dist/editors/visuals.d.ts +4 -3
  254. package/dist/editors/visuals.d.ts.map +1 -1
  255. package/dist/editors/visuals.js +17 -7
  256. package/dist/editors/visuals.js.map +1 -1
  257. package/dist/evals/runner.js +1 -1
  258. package/dist/evals/runner.js.map +1 -1
  259. package/dist/evals/shape.d.ts +7 -1
  260. package/dist/evals/shape.d.ts.map +1 -1
  261. package/dist/evals/shape.js +26 -6
  262. package/dist/evals/shape.js.map +1 -1
  263. package/dist/evals/workflow.d.ts +16 -3
  264. package/dist/evals/workflow.d.ts.map +1 -1
  265. package/dist/evals/workflow.js +31 -6
  266. package/dist/evals/workflow.js.map +1 -1
  267. package/dist/insights/review-service.d.ts +24 -3
  268. package/dist/insights/review-service.d.ts.map +1 -1
  269. package/dist/insights/review-service.js +75 -12
  270. package/dist/insights/review-service.js.map +1 -1
  271. package/dist/insights/routes.d.ts +2 -1
  272. package/dist/insights/routes.d.ts.map +1 -1
  273. package/dist/insights/routes.js +19 -4
  274. package/dist/insights/routes.js.map +1 -1
  275. package/dist/insights/run-facts.d.ts +5 -0
  276. package/dist/insights/run-facts.d.ts.map +1 -1
  277. package/dist/insights/run-facts.js +15 -0
  278. package/dist/insights/run-facts.js.map +1 -1
  279. package/dist/insights/workflow.d.ts +2 -1
  280. package/dist/insights/workflow.d.ts.map +1 -1
  281. package/dist/insights/workflow.js +4 -4
  282. package/dist/insights/workflow.js.map +1 -1
  283. package/dist/inspect/service.d.ts +3 -2
  284. package/dist/inspect/service.d.ts.map +1 -1
  285. package/dist/inspect/service.js +4 -4
  286. package/dist/inspect/service.js.map +1 -1
  287. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  288. package/dist/interactive/bridge-pool.js +6 -4
  289. package/dist/interactive/bridge-pool.js.map +1 -1
  290. package/dist/interactive/chat-events.d.ts.map +1 -1
  291. package/dist/interactive/chat-events.js +7 -1
  292. package/dist/interactive/chat-events.js.map +1 -1
  293. package/dist/interactive/draft-events.d.ts +3 -0
  294. package/dist/interactive/draft-events.d.ts.map +1 -1
  295. package/dist/interactive/draft-events.js +5 -8
  296. package/dist/interactive/draft-events.js.map +1 -1
  297. package/dist/interactive/draft-skill.d.ts +56 -3
  298. package/dist/interactive/draft-skill.d.ts.map +1 -1
  299. package/dist/interactive/draft-skill.js +129 -20
  300. package/dist/interactive/draft-skill.js.map +1 -1
  301. package/dist/interactive/landing-guard.d.ts +30 -5
  302. package/dist/interactive/landing-guard.d.ts.map +1 -1
  303. package/dist/interactive/landing-guard.js +121 -5
  304. package/dist/interactive/landing-guard.js.map +1 -1
  305. package/dist/interactive/proposal-create.d.ts.map +1 -1
  306. package/dist/interactive/proposal-create.js +1 -0
  307. package/dist/interactive/proposal-create.js.map +1 -1
  308. package/dist/interactive/proposal-refine.d.ts.map +1 -1
  309. package/dist/interactive/proposal-refine.js +16 -1
  310. package/dist/interactive/proposal-refine.js.map +1 -1
  311. package/dist/interactive/review-events.js +1 -1
  312. package/dist/interactive/review-events.js.map +1 -1
  313. package/dist/interactive/run-units.d.ts.map +1 -1
  314. package/dist/interactive/run-units.js +3 -2
  315. package/dist/interactive/run-units.js.map +1 -1
  316. package/dist/interactive/source-packet.d.ts +8 -0
  317. package/dist/interactive/source-packet.d.ts.map +1 -1
  318. package/dist/interactive/source-packet.js +47 -6
  319. package/dist/interactive/source-packet.js.map +1 -1
  320. package/dist/knowledge/adapters/toolbox/supervisor.d.ts +21 -1
  321. package/dist/knowledge/adapters/toolbox/supervisor.d.ts.map +1 -1
  322. package/dist/knowledge/adapters/toolbox/supervisor.js +76 -26
  323. package/dist/knowledge/adapters/toolbox/supervisor.js.map +1 -1
  324. package/dist/knowledge/estate-write.d.ts +5 -0
  325. package/dist/knowledge/estate-write.d.ts.map +1 -1
  326. package/dist/knowledge/estate-write.js +7 -0
  327. package/dist/knowledge/estate-write.js.map +1 -1
  328. package/dist/knowledge/projector.d.ts +60 -5
  329. package/dist/knowledge/projector.d.ts.map +1 -1
  330. package/dist/knowledge/projector.js +264 -21
  331. package/dist/knowledge/projector.js.map +1 -1
  332. package/dist/knowledge/shapes/map.d.ts.map +1 -1
  333. package/dist/knowledge/shapes/map.js +12 -2
  334. package/dist/knowledge/shapes/map.js.map +1 -1
  335. package/dist/knowledge/shapes/routes.d.ts +1 -1
  336. package/dist/knowledge/shapes/routes.d.ts.map +1 -1
  337. package/dist/knowledge/shapes/routes.js +42 -16
  338. package/dist/knowledge/shapes/routes.js.map +1 -1
  339. package/dist/knowledge/shapes/shapes.d.ts +60 -13
  340. package/dist/knowledge/shapes/shapes.d.ts.map +1 -1
  341. package/dist/knowledge/shapes/shapes.js +199 -31
  342. package/dist/knowledge/shapes/shapes.js.map +1 -1
  343. package/dist/knowledge/shapes/verified.d.ts.map +1 -1
  344. package/dist/knowledge/shapes/verified.js +3 -2
  345. package/dist/knowledge/shapes/verified.js.map +1 -1
  346. package/dist/knowledge/trackers/addresses.d.ts +27 -3
  347. package/dist/knowledge/trackers/addresses.d.ts.map +1 -1
  348. package/dist/knowledge/trackers/addresses.js +33 -5
  349. package/dist/knowledge/trackers/addresses.js.map +1 -1
  350. package/dist/knowledge/trackers/gate-pm.d.ts.map +1 -1
  351. package/dist/knowledge/trackers/gate-pm.js +4 -2
  352. package/dist/knowledge/trackers/gate-pm.js.map +1 -1
  353. package/dist/knowledge/trackers/projector.d.ts +3 -1
  354. package/dist/knowledge/trackers/projector.d.ts.map +1 -1
  355. package/dist/knowledge/trackers/projector.js +59 -8
  356. package/dist/knowledge/trackers/projector.js.map +1 -1
  357. package/dist/learn/scheduler.d.ts.map +1 -1
  358. package/dist/learn/scheduler.js +11 -2
  359. package/dist/learn/scheduler.js.map +1 -1
  360. package/dist/learnings/extract.d.ts +9 -3
  361. package/dist/learnings/extract.d.ts.map +1 -1
  362. package/dist/learnings/extract.js +62 -4
  363. package/dist/learnings/extract.js.map +1 -1
  364. package/dist/learnings/replacement-lineage.d.ts +3 -2
  365. package/dist/learnings/replacement-lineage.d.ts.map +1 -1
  366. package/dist/learnings/replacement-lineage.js +7 -6
  367. package/dist/learnings/replacement-lineage.js.map +1 -1
  368. package/dist/learnings/service.d.ts +12 -2
  369. package/dist/learnings/service.d.ts.map +1 -1
  370. package/dist/learnings/service.js +30 -5
  371. package/dist/learnings/service.js.map +1 -1
  372. package/dist/mcp/broker.d.ts.map +1 -1
  373. package/dist/mcp/broker.js +18 -4
  374. package/dist/mcp/broker.js.map +1 -1
  375. package/dist/mcp/estate-relay.d.ts +3 -0
  376. package/dist/mcp/estate-relay.d.ts.map +1 -1
  377. package/dist/mcp/estate-relay.js +5 -2
  378. package/dist/mcp/estate-relay.js.map +1 -1
  379. package/dist/mcp/invoke.js +2 -2
  380. package/dist/mcp/invoke.js.map +1 -1
  381. package/dist/mcp/redact.d.ts +1 -1
  382. package/dist/mcp/redact.d.ts.map +1 -1
  383. package/dist/mcp/redact.js +61 -4
  384. package/dist/mcp/redact.js.map +1 -1
  385. package/dist/mcp/registry-store.d.ts +25 -0
  386. package/dist/mcp/registry-store.d.ts.map +1 -1
  387. package/dist/mcp/registry-store.js +33 -0
  388. package/dist/mcp/registry-store.js.map +1 -1
  389. package/dist/mcp/registry.d.ts +25 -1
  390. package/dist/mcp/registry.d.ts.map +1 -1
  391. package/dist/mcp/registry.js +84 -5
  392. package/dist/mcp/registry.js.map +1 -1
  393. package/dist/mcp/rest.js +3 -3
  394. package/dist/mcp/rest.js.map +1 -1
  395. package/dist/mcp/run-fence.d.ts +2 -0
  396. package/dist/mcp/run-fence.d.ts.map +1 -1
  397. package/dist/mcp/run-fence.js +9 -0
  398. package/dist/mcp/run-fence.js.map +1 -1
  399. package/dist/mcp/upstream-error.d.ts +5 -1
  400. package/dist/mcp/upstream-error.d.ts.map +1 -1
  401. package/dist/mcp/upstream-error.js +5 -1
  402. package/dist/mcp/upstream-error.js.map +1 -1
  403. package/dist/projects/graph.d.ts +6 -4
  404. package/dist/projects/graph.d.ts.map +1 -1
  405. package/dist/projects/graph.js +173 -25
  406. package/dist/projects/graph.js.map +1 -1
  407. package/dist/projects/routes.d.ts +7 -1
  408. package/dist/projects/routes.d.ts.map +1 -1
  409. package/dist/projects/routes.js +13 -5
  410. package/dist/projects/routes.js.map +1 -1
  411. package/dist/projects/state-home-preflight.d.ts +5 -0
  412. package/dist/projects/state-home-preflight.d.ts.map +1 -1
  413. package/dist/projects/state-home-preflight.js +48 -8
  414. package/dist/projects/state-home-preflight.js.map +1 -1
  415. package/dist/projects/state-home-registry.d.ts.map +1 -1
  416. package/dist/projects/state-home-registry.js +6 -0
  417. package/dist/projects/state-home-registry.js.map +1 -1
  418. package/dist/projects/state-home.d.ts +6 -2
  419. package/dist/projects/state-home.d.ts.map +1 -1
  420. package/dist/projects/state-home.js +8 -5
  421. package/dist/projects/state-home.js.map +1 -1
  422. package/dist/qe/test-sets.d.ts +1 -1
  423. package/dist/qe/test-sets.d.ts.map +1 -1
  424. package/dist/qe/test-sets.js +2 -2
  425. package/dist/qe/test-sets.js.map +1 -1
  426. package/dist/schedules/routes.d.ts +5 -0
  427. package/dist/schedules/routes.d.ts.map +1 -1
  428. package/dist/schedules/routes.js +32 -5
  429. package/dist/schedules/routes.js.map +1 -1
  430. package/dist/schedules/scheduler.d.ts +8 -1
  431. package/dist/schedules/scheduler.d.ts.map +1 -1
  432. package/dist/schedules/scheduler.js +10 -1
  433. package/dist/schedules/scheduler.js.map +1 -1
  434. package/dist/schedules/store.d.ts +7 -0
  435. package/dist/schedules/store.d.ts.map +1 -1
  436. package/dist/schedules/store.js +19 -4
  437. package/dist/schedules/store.js.map +1 -1
  438. package/dist/skills/plugin-source.js +4 -4
  439. package/dist/skills/plugin-source.js.map +1 -1
  440. package/dist/sources/drivers/sqlite.d.ts +13 -0
  441. package/dist/sources/drivers/sqlite.d.ts.map +1 -1
  442. package/dist/sources/drivers/sqlite.js +11 -0
  443. package/dist/sources/drivers/sqlite.js.map +1 -1
  444. package/dist/sources/routes.d.ts.map +1 -1
  445. package/dist/sources/routes.js +1 -0
  446. package/dist/sources/routes.js.map +1 -1
  447. package/dist/sources/uploads.d.ts +22 -2
  448. package/dist/sources/uploads.d.ts.map +1 -1
  449. package/dist/sources/uploads.js +108 -10
  450. package/dist/sources/uploads.js.map +1 -1
  451. package/dist/standing-orders/parse.d.ts +8 -0
  452. package/dist/standing-orders/parse.d.ts.map +1 -1
  453. package/dist/standing-orders/parse.js +52 -5
  454. package/dist/standing-orders/parse.js.map +1 -1
  455. package/dist/studio/apps-standalone/fixture.js +3 -3
  456. package/dist/studio/assets/{KnowledgeGraph-dfq7Flyj.js → KnowledgeGraph-yP4WsnST.js} +1 -1
  457. package/dist/studio/assets/index-DNaLjJ7M.css +32 -0
  458. package/dist/studio/assets/index-DW53FKuT.js +1114 -0
  459. package/dist/studio/editors/wicked-apps/editor.json +1 -1
  460. package/dist/studio/editors/wicked-apps/index.html +1 -1
  461. package/dist/studio/editors/wicked-deck/editor.json +1 -1
  462. package/dist/studio/editors/wicked-deck/index.html +1 -1
  463. package/dist/studio/editors/wicked-doc/editor.json +1 -1
  464. package/dist/studio/editors/wicked-doc/index.html +1 -1
  465. package/dist/studio/editors/wicked-insights/editor.json +1 -1
  466. package/dist/studio/editors/wicked-insights/index.html +1 -1
  467. package/dist/studio/editors/wicked-page/editor.json +1 -1
  468. package/dist/studio/editors/wicked-page/index.html +1 -1
  469. package/dist/studio/editors/wicked-video/editor.json +1 -1
  470. package/dist/studio/editors/wicked-video/index.html +1 -1
  471. package/dist/studio/index.html +2 -2
  472. package/dist/studio/testid-inventory.json +1125 -208
  473. package/dist/team/routes.d.ts.map +1 -1
  474. package/dist/team/routes.js +2 -1
  475. package/dist/team/routes.js.map +1 -1
  476. package/dist/voice/tts.d.ts +12 -0
  477. package/dist/voice/tts.d.ts.map +1 -1
  478. package/dist/voice/tts.js +118 -28
  479. package/dist/voice/tts.js.map +1 -1
  480. package/dist/workflow-catalog/build-v2.d.ts +34 -0
  481. package/dist/workflow-catalog/build-v2.d.ts.map +1 -1
  482. package/dist/workflow-catalog/build-v2.js +131 -10
  483. package/dist/workflow-catalog/build-v2.js.map +1 -1
  484. package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
  485. package/dist/workflow-catalog/catalog-data.js +0 -2
  486. package/dist/workflow-catalog/catalog-data.js.map +1 -1
  487. package/dist/workflow-catalog/detect.d.ts +18 -3
  488. package/dist/workflow-catalog/detect.d.ts.map +1 -1
  489. package/dist/workflow-catalog/detect.js +43 -8
  490. package/dist/workflow-catalog/detect.js.map +1 -1
  491. package/dist/working-doc/event-lines.d.ts +5 -2
  492. package/dist/working-doc/event-lines.d.ts.map +1 -1
  493. package/dist/working-doc/event-lines.js +38 -7
  494. package/dist/working-doc/event-lines.js.map +1 -1
  495. package/dist/working-doc/sections.d.ts +3 -0
  496. package/dist/working-doc/sections.d.ts.map +1 -1
  497. package/dist/working-doc/sections.js +5 -0
  498. package/dist/working-doc/sections.js.map +1 -1
  499. package/dist/working-doc/service.d.ts +23 -3
  500. package/dist/working-doc/service.d.ts.map +1 -1
  501. package/dist/working-doc/service.js +93 -54
  502. package/dist/working-doc/service.js.map +1 -1
  503. package/endpoint-manifest.json +60 -3
  504. package/evals/corpora/shape-v1.json +25 -1
  505. package/evals/corpora/shape-v1.seat-fixture.json +25 -1
  506. package/package.json +4 -4
  507. package/runners/sqlite-runner.mjs +39 -1
  508. package/dist/studio/assets/index-Bame65hj.js +0 -1108
  509. package/dist/studio/assets/index-CtB1BJRI.css +0 -32
@@ -40,9 +40,9 @@ import { NEW_WORK_SEATS_FIX, NewWorkSeatsRefusal, jobSeatPool } from '../core/jo
40
40
  import { z } from '../zod.js';
41
41
  import { parseCommand, resolveOption } from '../workflow-catalog/build-v2.js';
42
42
  import { CATALOG_V2_CARDS } from '../workflow-catalog/catalog-data-v2.js';
43
- import { REVIEW_CHANGE_WORKFLOW } from './review-change.js';
44
- import { checksLabel, ownWords, factsOf, JobRefusal, mergeRevision, nounOf, optionFor, personAskedSkip, personPid, proposalKindOf, qeSkipBound, requestDigest, repoOf, resolveJob, SEAT_WORDS, seatProtections, seatRemovalNote, seatsNeeded, seatsShortLine, briefOf, inputLines, SELF_SEATED, } from './chat-jobs.js';
45
- import { artifactExists, artifactHead, chatMount, parseArtifactRef, UNFILED_MOUNT } from './chat-context.js';
43
+ import { REVIEW_CHANGE_WORKFLOW, REVIEW_PROVENANCE_WINDOW_DAYS } from './review-change.js';
44
+ import { checksLabel, ownWords, factsOf, JobRefusal, mergeRevision, nounOf, optionFor, personAskedSkip, personPid, proposalKindOf, qeSkipBound, requestDigest, repoOf, resolveJob, SEAT_WORDS, seatProtections, seatRemovalNote, seatsNeeded, seatsShortLine, briefOf, inputLines, repoNamedIn, SELF_SEATED, mentionsPullRequest, prNumberOfUrl, } from './chat-jobs.js';
45
+ import { artifactExists, artifactHead, artifactIsCut, chatMount, parseArtifactRef, UNFILED_MOUNT } from './chat-context.js';
46
46
  import { ATTACHMENT_MAX_FILE_BYTES } from './chat-attachments.js';
47
47
  import { documentPathPlan } from '../interactive/source-packet.js';
48
48
  import { tornTailPrefix } from './chat-transcripts.js';
@@ -73,6 +73,10 @@ const EntryBlock = z.object({
73
73
  depth: z.enum(['quick', 'standard', 'deep']).nullable().optional(),
74
74
  confidence: z.number().optional(),
75
75
  title: z.string().trim().max(200).optional(),
76
+ // crew#1737: who the person named in this message to do the job (`lead` builds or writes, `seats` the others, in
77
+ // their order). crew keeps only the ones the person's own turn names (`seatNamedIn`).
78
+ lead: z.string().trim().min(1).max(64).optional(),
79
+ seats: z.array(z.string().trim().min(1).max(64)).max(8).optional(),
76
80
  brief: z.string().max(8000).optional(),
77
81
  url: z.string().trim().max(2048).optional(),
78
82
  audience: z.string().max(400).optional(),
@@ -299,6 +303,11 @@ export function viewOf(f) {
299
303
  ...(f.decidedAt !== undefined ? { decidedAt: f.decidedAt } : {}),
300
304
  };
301
305
  }
306
+ /** A job's run is live while the check's run list has it and it has not ended (crew#1779: no engine read per job). */
307
+ export async function liveInRuns(runId, runs) {
308
+ const v = (await runs()).find((r) => r.session.id === runId);
309
+ return v !== undefined && !['completed', 'cancelled', 'failed'].includes(String(v.session.status));
310
+ }
302
311
  /** Serialize work per key: a second caller waits for the first, then runs. */
303
312
  class KeyedLock {
304
313
  tails = new Map();
@@ -352,15 +361,15 @@ export class LaunchOnceRegistry {
352
361
  return null;
353
362
  return { stub: d.stub === true };
354
363
  }
355
- async live(kind, runId) {
364
+ async live(kind, runId, runs) {
356
365
  const d = this.dispatchers.get(kind);
357
- return d?.live === undefined ? false : d.live(runId);
366
+ return d?.live === undefined ? false : d.live(runId, runs);
358
367
  }
359
368
  /** Whether a run this daemon started for the artifact is still live, or a launcher's durable record says an attempt at
360
369
  * it has no outcome yet (A3: across a restart too). */
361
- async liveForArtifact(artifactRef) {
370
+ async liveForArtifact(artifactRef, runs) {
362
371
  for (const r of this.byArtifact.get(artifactRef) ?? [])
363
- if (await this.live(r.kind, r.runId))
372
+ if (await this.live(r.kind, r.runId, runs))
364
373
  return true;
365
374
  for (const d of new Set(this.dispatchers.values()))
366
375
  if (d.docBusy !== undefined && (await d.docBusy(artifactRef)))
@@ -480,6 +489,8 @@ export const PROPOSAL_WORKFLOWS = {
480
489
  refine: 'interactive-chat',
481
490
  demo: 'demo',
482
491
  };
492
+ /** studio#1140: why a refine of a demo cut is blocked (the card says it after the document's title). */
493
+ export const CUT_BLOCKED = "a demo video: this chat can't change it. Change it by hand in the video editor (chapters, trims, captions, theme)";
483
494
  const STOPS = {
484
495
  create: 'Stops for you if the check fails. The plan or an escalation may also ask.',
485
496
  refine: 'Stops for you if the check fails. The plan or an escalation may also ask.',
@@ -621,6 +632,60 @@ function ownTitle(title, words) {
621
632
  const named = plain(title);
622
633
  return named !== '' && plain(words).includes(named);
623
634
  }
635
+ /**
636
+ * (crew#1728) A seat's entry block keeps its `title` only when the person named it in their own words, as a job card's
637
+ * does (`ownTitle`); else the title is dropped and the catalog's title is used.
638
+ */
639
+ function ownWordsTitle(block, records, turnId) {
640
+ if (block.op !== 'entry' || block.title === undefined || ownTitle(block.title, personWords(records, turnId)))
641
+ return block;
642
+ const rest = { ...block };
643
+ delete rest.title;
644
+ return rest;
645
+ }
646
+ /**
647
+ * (crew#1737) The person's own request with what they only quoted taken out: fenced and inline code, `>` quote lines
648
+ * and text in quotation marks. A seat named only there was pasted or reported, not chosen.
649
+ */
650
+ export function ownRequestWords(words) {
651
+ return words
652
+ .replace(/(`{3,}|~{3,})[\s\S]*?(?:\1|$)/gu, ' ')
653
+ .replace(/(`+)[\s\S]*?\1/gu, ' ')
654
+ .split(/\r?\n/u)
655
+ .filter((line) => !/^\s*>/u.test(line))
656
+ .join('\n')
657
+ .replace(/"[^"]*"|“[^”]*”|‘[^’]*’/gu, ' ');
658
+ }
659
+ /** (crew#1737) Whether the person's words name a seat, by its key or its roster name, as a whole word, outside what
660
+ * they quoted ({@link ownRequestWords}). */
661
+ export function seatNamedIn(key, name, words) {
662
+ const plain = ownRequestWords(words).toLowerCase();
663
+ return [key, name].some((n) => {
664
+ const w = (n ?? '').trim().toLowerCase();
665
+ if (w === '')
666
+ return false;
667
+ const esc = w.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
668
+ return new RegExp(`(^|[^\\p{L}\\p{N}])${esc}(?![\\p{L}\\p{N}])`, 'u').test(plain);
669
+ });
670
+ }
671
+ /**
672
+ * (crew#1737) The seats a routing block names that the person's own turn names too and that can work now: the lead
673
+ * first, then the others in the person's order. Nothing named (or nothing that passes) leaves both `null`, so the card
674
+ * draws its own seats.
675
+ */
676
+ function namedSeats(block, words, roster) {
677
+ const ok = (k) => roster.some((s) => s.key === k) && seatNamedIn(k, roster.find((s) => s.key === k)?.name, words);
678
+ const lead = block.lead !== undefined && ok(block.lead) ? block.lead : null;
679
+ const others = [...new Set(block.seats ?? [])].filter((k) => k !== lead && ok(k));
680
+ // Seats ride only beside a named lead: a list without one would read as the whole roster (its first seat building),
681
+ // so a seat named only to check is left to the card's own draw, which the person can swap (xreview r2).
682
+ return { lead, seats: lead !== null && others.length > 0 ? [lead, ...others] : null };
683
+ }
684
+ /**
685
+ * (crew#1745) A chat that ended (closed, its id reused, or the daemon restarted) can't take a proposal any more. Said
686
+ * without its id: the person reads this under the card, and the way forward is a new chat.
687
+ */
688
+ export const CHAT_ENDED = 'this chat has ended (it was closed, or the daemon restarted), so it can’t start this again. Start it again in a new chat.';
624
689
  /** The person's own words of ONE turn (the message the seat's block answers). */
625
690
  function turnWords(records, turnId) {
626
691
  const r = records.find((x) => x.kind === 'user' && x.turnId === turnId && x.owner === true);
@@ -787,7 +852,7 @@ export class ChatProposals {
787
852
  const jobBlock = jobs && block.op === 'entry' && isJobCardEntry(block);
788
853
  const proposal = jobBlock
789
854
  ? await this.resolveDetected({ chatId: frame.chat, turnId, seat: frame.cliKey, block: block, records: this.deps.records(frame.chat) })
790
- : await this.resolve({ chatId: frame.chat, turnId, seat: frame.cliKey, block, records: this.deps.records(frame.chat) });
855
+ : await this.resolve({ chatId: frame.chat, turnId, seat: frame.cliKey, block: ownWordsTitle(block, this.deps.records(frame.chat), turnId), records: this.deps.records(frame.chat) });
791
856
  if (proposal === null)
792
857
  return;
793
858
  // A job card never appears after the person has written again (codex r4): a newer message ("never mind") supersedes a
@@ -864,7 +929,7 @@ export class ChatProposals {
864
929
  // Only for a client that draws the card (its seat was told the block exists only then).
865
930
  if (flags.onboard !== true || this.deps.onboard === undefined || this.deps.acceptsOnboard?.(chatId) !== true)
866
931
  return this.refused(chatId, 'onboard');
867
- return resolveOnboard(block, { pid, chatId, turnId, seat, chatProjectId: chat.projectId === null || chat.projectId === 'default' ? null : chat.projectId }, this.deps.onboard);
932
+ return resolveOnboard(block, { pid, chatId, turnId, seat, chatProjectId: chat.projectId === null || chat.projectId === 'default' ? null : chat.projectId, words }, this.deps.onboard);
868
933
  }
869
934
  if (block.op === 'theme') {
870
935
  if (!flags.theme)
@@ -910,6 +975,9 @@ export class ChatProposals {
910
975
  const head = root === null ? null : artifactHead(root, ref.doc);
911
976
  if (head === null)
912
977
  blocked.push(`${title} · no such document`);
978
+ // studio#1140: a demo video changes in its editor; a page refine would write a page version over a cut.
979
+ else if (artifactIsCut(root, ref.doc))
980
+ blocked.push(`${title} · ${CUT_BLOCKED}`);
913
981
  else {
914
982
  target = { ref: ref.ref, title, base: head };
915
983
  projectId = projectOfMount(ref.mount);
@@ -998,7 +1066,7 @@ export class ChatProposals {
998
1066
  demo = { url, audience: block.audience ?? null, show: block.show ?? null };
999
1067
  }
1000
1068
  const sources = kind === 'create' ? await this.resolveSources(block.sources, { chatId, turnId, records, binding, turnHas, chat, words, personNamed: false }) : [];
1001
- const { helpers, block: helperBlock, seatsUnread } = await this.docHelpers(chat, input.helperSeats);
1069
+ const { helpers, block: helperBlock, seatsUnread } = await this.docHelpers(chat, input.helperSeats, input.helperWriterNamed ?? true);
1002
1070
  if (helperBlock !== null)
1003
1071
  blocked.push(helperBlock);
1004
1072
  return {
@@ -1289,8 +1357,8 @@ export class ChatProposals {
1289
1357
  // archived alias still waits for an in-flight answer through its first name.
1290
1358
  return this.lock.run(`pid\u0000${pid}`, () => this.decideLocked(chatId, pid, body, actor, instance)).then((r) => this.served(r));
1291
1359
  }
1292
- gone(chatId) {
1293
- return { code: 409, body: { code: 'chat_gone', error: `chat ${chatId} ended and its id was reused; this proposal can no longer be answered here` } };
1360
+ gone(chatId, acceptingAt) {
1361
+ return { code: 409, body: { code: 'chat_gone', error: CHAT_ENDED, ...(acceptingAt !== undefined ? { acceptingAt } : {}) } };
1294
1362
  }
1295
1363
  async decideLocked(chatId, pid, body, actor, instance) {
1296
1364
  if (this.deps.instanceOf(chatId) !== instance)
@@ -1519,6 +1587,9 @@ export class ChatProposals {
1519
1587
  const head = root === null ? null : artifactHead(root, ref.doc);
1520
1588
  if (head === null)
1521
1589
  return { code: 409, body: { code: 'source_gone', error: `${resolution.target.title} is gone`, view: viewOf(folded) } };
1590
+ // studio#1140: a refine recorded before crew blocked cuts (or a document that became one) never launches on a cut.
1591
+ if (artifactIsCut(root, ref.doc))
1592
+ return { code: 409, body: { code: 'proposal_blocked', error: `${resolution.target.title} · ${CUT_BLOCKED}`, view: viewOf(folded) } };
1522
1593
  if (head !== resolution.target.base) {
1523
1594
  // A newer proposal exists: this one is not re-opened over it (the chat moved on). The re-resolution is still
1524
1595
  // recorded, so the fold settles it as superseded for every reader (and its frame says so).
@@ -1570,7 +1641,9 @@ export class ChatProposals {
1570
1641
  return this.gone(chatId);
1571
1642
  }
1572
1643
  // Recorded before anything starts.
1573
- const accepting = { at: this.now(), turnId: folded.turnId, kind: 'proposal_accepting', pid, actor: actor.id, edits, resolution, identity };
1644
+ // crew#1695: `at` names this Go (its refusals carry it), so it is never the same as an earlier accepting record's.
1645
+ const lastAt = Math.max(-1, ...this.deps.records(chatId).flatMap((r) => (r.kind === 'proposal_accepting' && r.pid === pid ? [r.at] : [])));
1646
+ const accepting = { at: Math.max(this.now(), lastAt + 1), turnId: folded.turnId, kind: 'proposal_accepting', pid, actor: actor.id, edits, resolution, identity };
1574
1647
  if (!this.write(chatId, accepting, instance))
1575
1648
  return this.gone(chatId);
1576
1649
  let result;
@@ -1578,13 +1651,15 @@ export class ChatProposals {
1578
1651
  result = await this.deps.registry.launchOnce({ kind, pid, chatId, actor, identity, resolution, ...(power !== undefined ? { power } : {}) });
1579
1652
  }
1580
1653
  catch (err) {
1654
+ // crew#1695: every refusal after this Go's accepting write names that record (`acceptingAt`), so a client marks
1655
+ // only it stopped, never another tab's newer Go.
1581
1656
  if (err instanceof LaunchRefusal) {
1582
1657
  const reopened = this.reopenLaunch(chatId, folded, resolution, instance);
1583
1658
  if (reopened === null)
1584
- return this.gone(chatId);
1659
+ return this.gone(chatId, accepting.at);
1585
1660
  this.deps.audit('chat.proposal.launch_refused', actor, { chatId, pid, code: err.body['code'], error: err.message });
1586
1661
  return { code: err.status, body: {
1587
- code: err.body['code'], error: err.message,
1662
+ code: err.body['code'], error: err.message, acceptingAt: accepting.at,
1588
1663
  ...(err.body['excluded'] !== undefined ? { excluded: err.body['excluded'] } : {}),
1589
1664
  ...(err.body['retryWith'] !== undefined ? { retryWith: err.body['retryWith'] } : {}),
1590
1665
  view: viewOf(reopened),
@@ -1594,10 +1669,10 @@ export class ChatProposals {
1594
1669
  const msg = err instanceof Error ? err.message : String(err);
1595
1670
  this.deps.audit('chat.proposal.launch_failed', actor, { chatId, pid, error: msg, ...(power !== undefined ? { power } : {}) });
1596
1671
  const after = foldProposals(this.deps.records(chatId)).get(pid);
1597
- return { code: 502, body: { code: 'launch_failed', error: `could not start it: ${msg}. Go again resumes the same job.`, ...(after !== undefined ? { view: viewOf(after) } : {}) } };
1672
+ return { code: 502, body: { code: 'launch_failed', error: `could not start it: ${msg}. Go again resumes the same job.`, acceptingAt: accepting.at, ...(after !== undefined ? { view: viewOf(after) } : {}) } };
1598
1673
  }
1599
1674
  if (!this.decided(chatId, folded.turnId, pid, actor, 'go', result, resolution, edits, instance, power))
1600
- return this.gone(chatId);
1675
+ return this.gone(chatId, accepting.at);
1601
1676
  const after = foldProposals(this.deps.records(chatId)).get(pid) ?? folded;
1602
1677
  return { code: 200, body: { view: viewOf(after) } };
1603
1678
  }
@@ -1705,6 +1780,7 @@ export class ChatProposals {
1705
1780
  */
1706
1781
  async busy(chatId, artifactRef, p) {
1707
1782
  const runs = await this.deps.runs();
1783
+ const runsOnce = async () => runs;
1708
1784
  // A reshape's held run is the one it replaces: answered Reject inside this Go, so it does not make the chat busy.
1709
1785
  const held = p.reshapes !== undefined && p.heldRejected !== true ? p.reshapes : null;
1710
1786
  for (const f of foldProposals(this.deps.records(chatId)).values()) {
@@ -1713,7 +1789,7 @@ export class ChatProposals {
1713
1789
  // Another proposal of this chat started a job (decided go, or accepting with its run launched) still live.
1714
1790
  const runId = f.state === 'decided' && f.decision === 'go' ? f.result?.runId ?? null
1715
1791
  : f.state === 'accepting' ? f.accepting?.identity.runId ?? null : null;
1716
- if (runId !== null && runId !== held && (await this.deps.registry.live(f.proposal.kind, runId))) {
1792
+ if (runId !== null && runId !== held && (await this.deps.registry.live(f.proposal.kind, runId, runsOnce))) {
1717
1793
  return { code: 'chat_busy', reason: `This chat already has a job running (${f.proposal.what.label}). Wait, or stop that run.` };
1718
1794
  }
1719
1795
  }
@@ -1723,7 +1799,7 @@ export class ChatProposals {
1723
1799
  return { code: 'chat_busy', reason: `This chat already has a job running (run ${v.session.id.slice(0, 8)}). Wait, or stop that run.` };
1724
1800
  }
1725
1801
  if (artifactRef !== null && (p.kind === 'refine' || (p.kind === 'create' && p.artifactRef !== undefined))) {
1726
- if (await this.deps.registry.liveForArtifact(artifactRef)) {
1802
+ if (await this.deps.registry.liveForArtifact(artifactRef, runsOnce)) {
1727
1803
  return { code: 'document_busy', reason: `“${p.target?.title ?? p.what.title}” is being ${p.kind === 'create' ? 'drafted' : 'revised'}. Wait, or stop that run.` };
1728
1804
  }
1729
1805
  const ref = parseArtifactRef(artifactRef);
@@ -2010,7 +2086,9 @@ export class ChatProposals {
2010
2086
  });
2011
2087
  const g = d.guess;
2012
2088
  // The repository the block names, when it is one of this chat's (else the chat's own rule picks it).
2013
- const named = block.repos.map((want) => jc.repos.filter((r) => r.name === want || r.id === want)).find((hits) => hits.length === 1)?.[0];
2089
+ // crew#1791: else the one the person's words clearly name ("In tiny-math-rd, fix …").
2090
+ const named = block.repos.map((want) => jc.repos.filter((r) => r.name === want || r.id === want)).find((hits) => hits.length === 1)?.[0]
2091
+ ?? repoNamedIn(words, jc.repos) ?? undefined;
2014
2092
  // A demo's address only from the person's own words (DES-CHAT-ARTIFACTS-001 §4.3), never the model's.
2015
2093
  const inputs = {};
2016
2094
  if (block.url !== undefined && block.url !== '' && personUrls(words).has(block.url))
@@ -2024,8 +2102,7 @@ export class ChatProposals {
2024
2102
  details: [],
2025
2103
  repoRef: named?.id ?? null,
2026
2104
  projectId: jc.projectId,
2027
- lead: null,
2028
- seats: null,
2105
+ ...namedSeats(block, words, ctx.roster),
2029
2106
  inputs,
2030
2107
  skipQe: null,
2031
2108
  by: 'detected',
@@ -2374,10 +2451,18 @@ export class ChatProposals {
2374
2451
  return records.map((r) => this.seatsBlocked(r, refusal, open));
2375
2452
  }
2376
2453
  /** A document's two default helpers from the pool, and the line that blocks it when there are none. */
2377
- async docHelpers(chat, chosen) {
2454
+ async docHelpers(chat, chosen, writerNamed = true) {
2378
2455
  const { pool, refusal } = await this.seatPool();
2379
2456
  const eligible = new Set(this.deps.rosterEligible().map((s) => s.key));
2380
- const seats = chosen === undefined ? undefined : [...new Set(chosen)].filter((k) => eligible.has(k)).slice(0, 2);
2457
+ let seats = chosen === undefined ? undefined : [...new Set(chosen)].filter((k) => eligible.has(k)).slice(0, 2);
2458
+ // crew#1737: one helper named: the other is the one the card would draw, never the same seat again. A named writer
2459
+ // writes; a seat named only to check (no writer named, or the one named can't work now) checks.
2460
+ if (seats !== undefined && seats.length === 1) {
2461
+ const drawn = [...(this.helpers(chat, undefined, pool)?.seats ?? []), ...pool.map((s) => s.key)];
2462
+ const other = drawn.find((k) => k !== seats[0] && eligible.has(k));
2463
+ if (other !== undefined)
2464
+ seats = writerNamed && chosen?.[0] === seats[0] ? [seats[0], other] : [other, seats[0]];
2465
+ }
2381
2466
  const helpers = this.helpers(chat, seats, pool);
2382
2467
  return { helpers, block: helpers === null ? NEEDS_HELPER : null, ...(refusal !== undefined ? { seatsUnread: true } : {}) };
2383
2468
  }
@@ -2397,6 +2482,28 @@ export class ChatProposals {
2397
2482
  const { eligible: roster, pool, refusal } = await this.seatPool();
2398
2483
  return { chatId, pid, turnId, seat, chat, served, roster, pool, projectLabel, qeOff, powerPresets, ...(this.deps.coverage !== undefined ? { coverage: (keys, bound) => this.deps.coverage(keys, bound) } : {}), ...extra, ...(refusal !== undefined ? { seatsUnread: true } : {}) };
2399
2484
  }
2485
+ /** (crew#1840) The pull requests this chat's runs delivered (a run record's `deliverUrl`), newest run last. A failed
2486
+ * read is none: the job then opens its own pull request, and its card says so when the words asked otherwise. */
2487
+ async deliveredPrs(chatId) {
2488
+ try {
2489
+ const out = [];
2490
+ for (const v of await this.deps.runs()) {
2491
+ if (this.deps.chatOfRun(v.session.id) !== chatId)
2492
+ continue;
2493
+ const url = v.session.deliverUrl;
2494
+ const number = typeof url === 'string' ? prNumberOfUrl(url) : null;
2495
+ if (number === null)
2496
+ continue;
2497
+ const repo = v.session.repo_ref;
2498
+ out.push({ number, url: url, runId: v.session.id, repoRef: typeof repo === 'string' ? repo : null });
2499
+ }
2500
+ return out;
2501
+ }
2502
+ catch (err) {
2503
+ this.log(`[proposals] chat ${chatId}: its runs could not be read for a delivered pull request: ${err instanceof Error ? err.message : String(err)}`);
2504
+ return [];
2505
+ }
2506
+ }
2400
2507
  /** Source availability matters only to a card that shows this input. Keep a failed read a named refusal. */
2401
2508
  async loadJobSources(facts, ctx) {
2402
2509
  const card = CATALOG_V2_CARDS.find((c) => c.id === facts.card);
@@ -2448,10 +2555,16 @@ export class ChatProposals {
2448
2555
  this.reviewAuthorsSeen.delete(k);
2449
2556
  this.reviewAuthorsSeen.set(key, authors);
2450
2557
  }
2451
- const roster = ctx.roster.filter((s) => !authors.authors.includes(s.key));
2558
+ const { seats, unknown } = authors.authors;
2559
+ const roster = ctx.roster.filter((s) => !seats.includes(s.key));
2452
2560
  if (roster.length === 0 || roster.length === ctx.roster.length)
2453
2561
  return ctx;
2454
- return { ...ctx, roster, ...(ctx.pool !== undefined ? { pool: ctx.pool.filter((s) => !authors.authors.includes(s.key)) } : {}) };
2562
+ // crew#1803: the card names the seats it left off and why, in a note of its own (`notes` refuses a seat edit).
2563
+ const off = ctx.roster.filter((s) => seats.includes(s.key)).map((s) => s.name).join(', ');
2564
+ const reviewNote = unknown === undefined
2565
+ ? `${off} left off: authors of this change don't review it`
2566
+ : `${off} left off: crew could not read who made this change (${unknown}), so seats that worked in this repository in the last ${REVIEW_PROVENANCE_WINDOW_DAYS} days don't review it`;
2567
+ return { ...ctx, roster, reviewNote, ...(ctx.pool !== undefined ? { pool: ctx.pool.filter((s) => !seats.includes(s.key)) } : {}) };
2455
2568
  }
2456
2569
  /** Resolve the revision's shape first, then load only the choices that its input checks need. */
2457
2570
  async mergeJobRevision(parent, edits, ctx) {
@@ -2499,7 +2612,7 @@ export class ChatProposals {
2499
2612
  const words = [r.resolved.brief ?? '', briefOf(facts)].filter((x) => x !== '').join('\n\n');
2500
2613
  const chosen = facts.lead === null && facts.seats === null ? undefined
2501
2614
  : [...new Set([facts.lead, ...(facts.seats ?? [])].filter((k) => k !== null))];
2502
- const made = await this.resolve({ chatId, turnId, seat: ctx.seat, ...(chosen !== undefined ? { helperSeats: chosen } : {}), block: { op: 'entry', entry: seed.id, ...(facts.title !== null ? { title: facts.title } : {}), brief: words, sources: ['chat'], repos: facts.repoRef !== null ? [facts.repoRef] : [] }, records });
2615
+ const made = await this.resolve({ chatId, turnId, seat: ctx.seat, ...(chosen !== undefined ? { helperSeats: chosen, helperWriterNamed: facts.lead !== null } : {}), block: { op: 'entry', entry: seed.id, ...(facts.title !== null ? { title: facts.title } : {}), brief: words, sources: ['chat'], repos: facts.repoRef !== null ? [facts.repoRef] : [] }, records });
2503
2616
  if (made === null)
2504
2617
  throw new JobRefusal('operation_unavailable', 'studio cannot start a document from a chat on this daemon yet', 409);
2505
2618
  const shape = { card: card.id, option: r.option?.id ?? null, depth: null, by: facts.by, source: facts.source, ...(facts.guess !== undefined ? { guess: facts.guess } : {}) };
@@ -2563,6 +2676,10 @@ export class ChatProposals {
2563
2676
  ctx = { ...ctx, coverage: (keys, bound) => this.deps.coverage(keys, bound, relaunch) };
2564
2677
  }
2565
2678
  ctx = await this.reviewRoster(facts, ctx);
2679
+ // (crew#1840) Words that name a pull request: the ones this chat's runs delivered, so a job asked to change one
2680
+ // updates it (the resolution decides; it is pure).
2681
+ if (ctx.deliveredPrs === undefined && mentionsPullRequest(facts.words))
2682
+ ctx = { ...ctx, deliveredPrs: await this.deliveredPrs(chatId) };
2566
2683
  if (r?.resolved.inputs.some((i) => i.id === 'documents')) {
2567
2684
  if (facts.inputs['documents'] === undefined) {
2568
2685
  const { binding } = bindingOf(records, ctx.turnId ?? '\u0000');
@@ -2634,7 +2751,7 @@ export class ChatProposals {
2634
2751
  }
2635
2752
  const chat = this.jobChat(chatId);
2636
2753
  if (chat === null)
2637
- return { code: 409, body: { code: 'chat_gone', error: `chat ${chatId} has ended; start a new one` } };
2754
+ return { code: 409, body: { code: 'chat_gone', error: CHAT_ENDED } };
2638
2755
  // A command names its card (and maybe its option); an alias is the only way to a hidden card.
2639
2756
  let card = body.card;
2640
2757
  let option = body.option;
@@ -2655,7 +2772,8 @@ export class ChatProposals {
2655
2772
  depth: body.depth ?? null,
2656
2773
  words: (body.words ?? '').slice(0, 8000),
2657
2774
  details: [],
2658
- repoRef: null,
2775
+ // crew#1791: the repository the person's words clearly name, else the question asks.
2776
+ repoRef: repoNamedIn(body.words ?? '', chat.repos)?.id ?? null,
2659
2777
  projectId: chat.projectId,
2660
2778
  lead: null,
2661
2779
  seats: null,
@@ -2705,7 +2823,7 @@ export class ChatProposals {
2705
2823
  return { code: 400, body: { code: 'edits_invalid', error: 'only a job proposal is revised this way' } };
2706
2824
  const chat = this.jobChat(chatId);
2707
2825
  if (chat === null)
2708
- return { code: 409, body: { code: 'chat_gone', error: `chat ${chatId} has ended; start a new one` } };
2826
+ return { code: 409, body: { code: 'chat_gone', error: CHAT_ENDED } };
2709
2827
  const fromPerson = src.person !== null;
2710
2828
  // Only the person's own press can give up a check.
2711
2829
  const edits = { ...rev.edits };
@@ -2739,7 +2857,7 @@ export class ChatProposals {
2739
2857
  return { code: picked.status, body: { code: 'chat_scope_refused', error: picked.error } };
2740
2858
  const scoped = this.jobChat(chatId);
2741
2859
  if (scoped === null)
2742
- return { code: 409, body: { code: 'chat_gone', error: `chat ${chatId} has ended; start a new one` } };
2860
+ return { code: 409, body: { code: 'chat_gone', error: CHAT_ENDED } };
2743
2861
  ctx0 = { ...ctx0, chat: scoped };
2744
2862
  extraNotes.push(`This chat now reads ${picked.name}: you picked it for this job.`);
2745
2863
  }
@@ -3220,7 +3338,7 @@ export class ChatProposals {
3220
3338
  if (folded === undefined) {
3221
3339
  const chat = this.jobChat(chatId);
3222
3340
  if (chat === null)
3223
- return { code: 409, body: { code: 'chat_gone', error: `chat ${chatId} has ended; start a new one` } };
3341
+ return { code: 409, body: { code: 'chat_gone', error: CHAT_ENDED } };
3224
3342
  const parent = x.parentPid === null ? undefined : foldProposals(this.deps.records(chatId)).get(x.parentPid);
3225
3343
  let proposal;
3226
3344
  try {
@@ -3386,6 +3504,10 @@ export class ChatProposals {
3386
3504
  return pid;
3387
3505
  // A retry keeps the accepted choices only for edit ids still present on the new head.
3388
3506
  const fresh = base.kind === 'refine' && base.target !== undefined ? await this.refreshTarget(base) : base;
3507
+ // crew#1745: a chat that has ended (closed, or the daemon restarted under the attempt) can't take Try again: its
3508
+ // Go would only answer chat_gone. The card says so and where to go, with no Try again to press.
3509
+ const ended = this.deps.chat(chatId) === null;
3510
+ const again = ended ? '' : base.kind === 'refine' ? ' Try again revises the latest version, and keeps your edits.' : ' Try again fills the same document.';
3389
3511
  const retry = {
3390
3512
  ...fresh,
3391
3513
  ...(base.kind === 'refine' ? { allow: (failed.accepting?.edits?.allow ?? []).filter((id) => fresh.protected?.some((e) => e.id === id)) } : {}),
@@ -3394,10 +3516,10 @@ export class ChatProposals {
3394
3516
  sourceRunId: runId,
3395
3517
  artifactRef,
3396
3518
  reason: base.kind === 'refine'
3397
- ? `The last change was not applied: ${reason}. Try again revises the latest version, and keeps your edits.`
3398
- : `The last attempt ended without a draft: ${reason}. Try again fills the same document.`,
3519
+ ? `The last change was not applied: ${reason}.${again}`
3520
+ : `The last attempt ended without a draft: ${reason}.${again}`,
3399
3521
  // A refine whose edits cannot be read on the new head stays blocked with why (codex A5 r2).
3400
- blocked: fresh !== base ? fresh.blocked : null,
3522
+ blocked: ended ? CHAT_ENDED : fresh !== base ? fresh.blocked : null,
3401
3523
  };
3402
3524
  return this.write(chatId, { at: this.now(), turnId: failed.turnId, kind: 'proposal', proposal: retry }, instance) ? pid : null;
3403
3525
  });
@@ -3408,9 +3530,12 @@ export class ChatProposals {
3408
3530
  * job per chat, work and artifact runs together (DES §4.3).
3409
3531
  */
3410
3532
  async liveJobOf(chatId) {
3533
+ // crew#1779: the run list is read once, and only when a job's check needs it.
3534
+ let read = null;
3535
+ const runsOnce = () => (read ??= this.deps.runs());
3411
3536
  for (const f of foldProposals(this.deps.records(chatId)).values()) {
3412
3537
  const runId = f.state === 'decided' && f.decision === 'go' ? f.result?.runId ?? null : f.state === 'accepting' ? f.accepting?.identity.runId ?? null : null;
3413
- if (runId !== null && (await this.deps.registry.live(f.proposal.kind, runId)))
3538
+ if (runId !== null && (await this.deps.registry.live(f.proposal.kind, runId, runsOnce)))
3414
3539
  return f.proposal.what.label;
3415
3540
  }
3416
3541
  return null;