wicked-crew 0.16.11 → 0.16.13

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 (341) hide show
  1. package/README.md +28 -8
  2. package/dist/api/artifact-outline.d.ts +64 -0
  3. package/dist/api/artifact-outline.d.ts.map +1 -0
  4. package/dist/api/artifact-outline.js +254 -0
  5. package/dist/api/artifact-outline.js.map +1 -0
  6. package/dist/api/beneath.d.ts +76 -0
  7. package/dist/api/beneath.d.ts.map +1 -0
  8. package/dist/api/beneath.js +214 -0
  9. package/dist/api/beneath.js.map +1 -0
  10. package/dist/api/capture.d.ts +2 -2
  11. package/dist/api/chat-citations.d.ts +25 -1
  12. package/dist/api/chat-citations.d.ts.map +1 -1
  13. package/dist/api/chat-citations.js +186 -61
  14. package/dist/api/chat-citations.js.map +1 -1
  15. package/dist/api/chat-context.d.ts +236 -0
  16. package/dist/api/chat-context.d.ts.map +1 -0
  17. package/dist/api/chat-context.js +808 -0
  18. package/dist/api/chat-context.js.map +1 -0
  19. package/dist/api/chat-history.d.ts +20 -0
  20. package/dist/api/chat-history.d.ts.map +1 -1
  21. package/dist/api/chat-history.js +46 -1
  22. package/dist/api/chat-history.js.map +1 -1
  23. package/dist/api/chat-proposals.d.ts +534 -0
  24. package/dist/api/chat-proposals.d.ts.map +1 -0
  25. package/dist/api/chat-proposals.js +1562 -0
  26. package/dist/api/chat-proposals.js.map +1 -0
  27. package/dist/api/chat-scope.d.ts +41 -0
  28. package/dist/api/chat-scope.d.ts.map +1 -1
  29. package/dist/api/chat-scope.js +87 -15
  30. package/dist/api/chat-scope.js.map +1 -1
  31. package/dist/api/chat-transcripts.d.ts +27 -2
  32. package/dist/api/chat-transcripts.d.ts.map +1 -1
  33. package/dist/api/chat-transcripts.js +105 -4
  34. package/dist/api/chat-transcripts.js.map +1 -1
  35. package/dist/api/diagnostics.d.ts +15 -0
  36. package/dist/api/diagnostics.d.ts.map +1 -1
  37. package/dist/api/diagnostics.js +56 -0
  38. package/dist/api/diagnostics.js.map +1 -1
  39. package/dist/api/elicitation-cache.d.ts +13 -0
  40. package/dist/api/elicitation-cache.d.ts.map +1 -1
  41. package/dist/api/elicitation-cache.js +12 -0
  42. package/dist/api/elicitation-cache.js.map +1 -1
  43. package/dist/api/eval-sample.d.ts +12 -12
  44. package/dist/api/frame-guard.d.ts +62 -0
  45. package/dist/api/frame-guard.d.ts.map +1 -0
  46. package/dist/api/frame-guard.js +97 -0
  47. package/dist/api/frame-guard.js.map +1 -0
  48. package/dist/api/governance-steering.d.ts +4 -4
  49. package/dist/api/multiscope.d.ts +3 -0
  50. package/dist/api/multiscope.d.ts.map +1 -1
  51. package/dist/api/multiscope.js +13 -0
  52. package/dist/api/multiscope.js.map +1 -1
  53. package/dist/api/needs.d.ts +6 -0
  54. package/dist/api/needs.d.ts.map +1 -1
  55. package/dist/api/needs.js +31 -4
  56. package/dist/api/needs.js.map +1 -1
  57. package/dist/api/product.d.ts.map +1 -1
  58. package/dist/api/product.js +13 -2
  59. package/dist/api/product.js.map +1 -1
  60. package/dist/api/project-aggregates.d.ts +6 -6
  61. package/dist/api/project-aggregates.d.ts.map +1 -1
  62. package/dist/api/project-aggregates.js +16 -24
  63. package/dist/api/project-aggregates.js.map +1 -1
  64. package/dist/api/requirements.d.ts +261 -6
  65. package/dist/api/requirements.d.ts.map +1 -1
  66. package/dist/api/requirements.js +344 -64
  67. package/dist/api/requirements.js.map +1 -1
  68. package/dist/api/routes.d.ts +156 -4
  69. package/dist/api/routes.d.ts.map +1 -1
  70. package/dist/api/routes.js +851 -78
  71. package/dist/api/routes.js.map +1 -1
  72. package/dist/api/run-brief.d.ts +78 -0
  73. package/dist/api/run-brief.d.ts.map +1 -0
  74. package/dist/api/run-brief.js +318 -0
  75. package/dist/api/run-brief.js.map +1 -0
  76. package/dist/api/run-files.d.ts.map +1 -1
  77. package/dist/api/run-files.js +5 -1
  78. package/dist/api/run-files.js.map +1 -1
  79. package/dist/api/run-timing-index.d.ts +27 -0
  80. package/dist/api/run-timing-index.d.ts.map +1 -1
  81. package/dist/api/run-timing-index.js +65 -0
  82. package/dist/api/run-timing-index.js.map +1 -1
  83. package/dist/api/seat-images.d.ts +102 -0
  84. package/dist/api/seat-images.d.ts.map +1 -0
  85. package/dist/api/seat-images.js +333 -0
  86. package/dist/api/seat-images.js.map +1 -0
  87. package/dist/api/server.d.ts +3 -0
  88. package/dist/api/server.d.ts.map +1 -1
  89. package/dist/api/server.js +265 -2
  90. package/dist/api/server.js.map +1 -1
  91. package/dist/api/steering-landing.d.ts +48 -1
  92. package/dist/api/steering-landing.d.ts.map +1 -1
  93. package/dist/api/steering-landing.js +116 -42
  94. package/dist/api/steering-landing.js.map +1 -1
  95. package/dist/api/system-snapshot.d.ts +51 -2
  96. package/dist/api/system-snapshot.d.ts.map +1 -1
  97. package/dist/api/system-snapshot.js +151 -15
  98. package/dist/api/system-snapshot.js.map +1 -1
  99. package/dist/api/testing.d.ts +4 -4
  100. package/dist/api/testing.js +2 -2
  101. package/dist/api/testing.js.map +1 -1
  102. package/dist/apps/spec.d.ts +3009 -0
  103. package/dist/apps/spec.d.ts.map +1 -0
  104. package/dist/apps/spec.js +870 -0
  105. package/dist/apps/spec.js.map +1 -0
  106. package/dist/campaigns/routes.js +1 -1
  107. package/dist/campaigns/routes.js.map +1 -1
  108. package/dist/cli/index.js +3 -3
  109. package/dist/cli/index.js.map +1 -1
  110. package/dist/core/adapter.d.ts +12 -0
  111. package/dist/core/adapter.d.ts.map +1 -1
  112. package/dist/core/adapter.js +36 -1
  113. package/dist/core/adapter.js.map +1 -1
  114. package/dist/core/deliver-text.d.ts.map +1 -1
  115. package/dist/core/deliver-text.js +22 -10
  116. package/dist/core/deliver-text.js.map +1 -1
  117. package/dist/core/estate-mcp-client.d.ts +7 -1
  118. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  119. package/dist/core/estate-mcp-client.js +10 -2
  120. package/dist/core/estate-mcp-client.js.map +1 -1
  121. package/dist/core/exec.d.ts +12 -0
  122. package/dist/core/exec.d.ts.map +1 -1
  123. package/dist/core/exec.js +23 -0
  124. package/dist/core/exec.js.map +1 -1
  125. package/dist/core/reassign-refusal.d.ts.map +1 -1
  126. package/dist/core/reassign-refusal.js +23 -3
  127. package/dist/core/reassign-refusal.js.map +1 -1
  128. package/dist/core/repoPaths.d.ts +32 -7
  129. package/dist/core/repoPaths.d.ts.map +1 -1
  130. package/dist/core/repoPaths.js +56 -9
  131. package/dist/core/repoPaths.js.map +1 -1
  132. package/dist/core/requirements-graph-setting.d.ts +32 -0
  133. package/dist/core/requirements-graph-setting.d.ts.map +1 -0
  134. package/dist/core/requirements-graph-setting.js +84 -0
  135. package/dist/core/requirements-graph-setting.js.map +1 -0
  136. package/dist/core/run-boot-resume.d.ts +4 -1
  137. package/dist/core/run-boot-resume.d.ts.map +1 -1
  138. package/dist/core/run-boot-resume.js +6 -1
  139. package/dist/core/run-boot-resume.js.map +1 -1
  140. package/dist/core/run-identity.d.ts.map +1 -1
  141. package/dist/core/run-identity.js +6 -0
  142. package/dist/core/run-identity.js.map +1 -1
  143. package/dist/core/types.d.ts +14 -0
  144. package/dist/core/types.d.ts.map +1 -1
  145. package/dist/core/types.js.map +1 -1
  146. package/dist/decisions/chat-recorder.d.ts +14 -3
  147. package/dist/decisions/chat-recorder.d.ts.map +1 -1
  148. package/dist/decisions/chat-recorder.js +54 -9
  149. package/dist/decisions/chat-recorder.js.map +1 -1
  150. package/dist/editors/csp.d.ts +24 -4
  151. package/dist/editors/csp.d.ts.map +1 -1
  152. package/dist/editors/csp.js +35 -8
  153. package/dist/editors/csp.js.map +1 -1
  154. package/dist/editors/registry.d.ts +46 -21
  155. package/dist/editors/registry.d.ts.map +1 -1
  156. package/dist/editors/registry.js +13 -2
  157. package/dist/editors/registry.js.map +1 -1
  158. package/dist/editors/routes.d.ts +4 -1
  159. package/dist/editors/routes.d.ts.map +1 -1
  160. package/dist/editors/routes.js +30 -3
  161. package/dist/editors/routes.js.map +1 -1
  162. package/dist/editors/visuals.d.ts +51 -0
  163. package/dist/editors/visuals.d.ts.map +1 -0
  164. package/dist/editors/visuals.js +164 -0
  165. package/dist/editors/visuals.js.map +1 -0
  166. package/dist/editors/webrtc-guard.d.ts +94 -0
  167. package/dist/editors/webrtc-guard.d.ts.map +1 -0
  168. package/dist/editors/webrtc-guard.js +506 -0
  169. package/dist/editors/webrtc-guard.js.map +1 -0
  170. package/dist/inspect/reading.d.ts +110 -0
  171. package/dist/inspect/reading.d.ts.map +1 -0
  172. package/dist/inspect/reading.js +325 -0
  173. package/dist/inspect/reading.js.map +1 -0
  174. package/dist/inspect/routes.d.ts +14 -0
  175. package/dist/inspect/routes.d.ts.map +1 -0
  176. package/dist/inspect/routes.js +44 -0
  177. package/dist/inspect/routes.js.map +1 -0
  178. package/dist/inspect/service.d.ts +161 -0
  179. package/dist/inspect/service.d.ts.map +1 -0
  180. package/dist/inspect/service.js +466 -0
  181. package/dist/inspect/service.js.map +1 -0
  182. package/dist/interactive/bridge-pool.d.ts +11 -2
  183. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  184. package/dist/interactive/bridge-pool.js +10 -1
  185. package/dist/interactive/bridge-pool.js.map +1 -1
  186. package/dist/interactive/doc-binding.d.ts +156 -0
  187. package/dist/interactive/doc-binding.d.ts.map +1 -0
  188. package/dist/interactive/doc-binding.js +277 -0
  189. package/dist/interactive/doc-binding.js.map +1 -0
  190. package/dist/interactive/doc-delete-routes.d.ts +3 -0
  191. package/dist/interactive/doc-delete-routes.d.ts.map +1 -1
  192. package/dist/interactive/doc-delete-routes.js +4 -0
  193. package/dist/interactive/doc-delete-routes.js.map +1 -1
  194. package/dist/interactive/draft-events.d.ts +89 -3
  195. package/dist/interactive/draft-events.d.ts.map +1 -1
  196. package/dist/interactive/draft-events.js +441 -30
  197. package/dist/interactive/draft-events.js.map +1 -1
  198. package/dist/interactive/draft-skill.d.ts +7 -0
  199. package/dist/interactive/draft-skill.d.ts.map +1 -1
  200. package/dist/interactive/draft-skill.js +10 -3
  201. package/dist/interactive/draft-skill.js.map +1 -1
  202. package/dist/interactive/edit-events.d.ts +2 -0
  203. package/dist/interactive/edit-events.d.ts.map +1 -1
  204. package/dist/interactive/edit-events.js +11 -0
  205. package/dist/interactive/edit-events.js.map +1 -1
  206. package/dist/interactive/proposal-create.d.ts +143 -0
  207. package/dist/interactive/proposal-create.d.ts.map +1 -0
  208. package/dist/interactive/proposal-create.js +318 -0
  209. package/dist/interactive/proposal-create.js.map +1 -0
  210. package/dist/interactive/proxy-routes.d.ts +60 -3
  211. package/dist/interactive/proxy-routes.d.ts.map +1 -1
  212. package/dist/interactive/proxy-routes.js +217 -3
  213. package/dist/interactive/proxy-routes.js.map +1 -1
  214. package/dist/interactive/source-packet.d.ts +126 -0
  215. package/dist/interactive/source-packet.d.ts.map +1 -0
  216. package/dist/interactive/source-packet.js +482 -0
  217. package/dist/interactive/source-packet.js.map +1 -0
  218. package/dist/learnings/estate.d.ts +16 -0
  219. package/dist/learnings/estate.d.ts.map +1 -0
  220. package/dist/learnings/estate.js +68 -0
  221. package/dist/learnings/estate.js.map +1 -0
  222. package/dist/learnings/extract.d.ts +56 -0
  223. package/dist/learnings/extract.d.ts.map +1 -0
  224. package/dist/learnings/extract.js +252 -0
  225. package/dist/learnings/extract.js.map +1 -0
  226. package/dist/learnings/recall.d.ts +43 -0
  227. package/dist/learnings/recall.d.ts.map +1 -0
  228. package/dist/learnings/recall.js +104 -0
  229. package/dist/learnings/recall.js.map +1 -0
  230. package/dist/learnings/service.d.ts +183 -0
  231. package/dist/learnings/service.d.ts.map +1 -0
  232. package/dist/learnings/service.js +571 -0
  233. package/dist/learnings/service.js.map +1 -0
  234. package/dist/mcp/ask-server.d.ts.map +1 -1
  235. package/dist/mcp/ask-server.js +37 -4
  236. package/dist/mcp/ask-server.js.map +1 -1
  237. package/dist/mcp/broker.d.ts +12 -1
  238. package/dist/mcp/broker.d.ts.map +1 -1
  239. package/dist/mcp/broker.js +24 -5
  240. package/dist/mcp/broker.js.map +1 -1
  241. package/dist/mcp/invoke.d.ts +26 -2
  242. package/dist/mcp/invoke.d.ts.map +1 -1
  243. package/dist/mcp/invoke.js +51 -5
  244. package/dist/mcp/invoke.js.map +1 -1
  245. package/dist/persona/routes.d.ts +92 -0
  246. package/dist/persona/routes.d.ts.map +1 -0
  247. package/dist/persona/routes.js +69 -0
  248. package/dist/persona/routes.js.map +1 -0
  249. package/dist/persona/store.d.ts +104 -0
  250. package/dist/persona/store.d.ts.map +1 -0
  251. package/dist/persona/store.js +176 -0
  252. package/dist/persona/store.js.map +1 -0
  253. package/dist/persona/voice.d.ts +4 -0
  254. package/dist/persona/voice.d.ts.map +1 -0
  255. package/dist/persona/voice.js +58 -0
  256. package/dist/persona/voice.js.map +1 -0
  257. package/dist/projects/routes.d.ts +2 -2
  258. package/dist/setup/known.d.ts +56 -0
  259. package/dist/setup/known.d.ts.map +1 -0
  260. package/dist/setup/known.js +159 -0
  261. package/dist/setup/known.js.map +1 -0
  262. package/dist/setup/routes.d.ts +13 -0
  263. package/dist/setup/routes.d.ts.map +1 -0
  264. package/dist/setup/routes.js +20 -0
  265. package/dist/setup/routes.js.map +1 -0
  266. package/dist/standing-orders/history.d.ts +2 -0
  267. package/dist/standing-orders/history.d.ts.map +1 -1
  268. package/dist/standing-orders/history.js +1 -0
  269. package/dist/standing-orders/history.js.map +1 -1
  270. package/dist/studio/assets/WickedSans-Regular-fb698rcD.woff2 +0 -0
  271. package/dist/studio/assets/WickedSans-SemiBold-CD53n1AC.woff2 +0 -0
  272. package/dist/studio/assets/WickedScript-Regular-CY5juO6I.woff2 +0 -0
  273. package/dist/studio/assets/WickedSerif-Regular-mdPEjaVZ.woff2 +0 -0
  274. package/dist/studio/assets/index-BUZ_-Syk.css +32 -0
  275. package/dist/studio/assets/index-u4O_7N-b.js +986 -0
  276. package/dist/studio/editors/wicked-deck/editor.json +6 -1
  277. package/dist/studio/editors/wicked-deck/icon.svg +1 -0
  278. package/dist/studio/editors/wicked-deck/index.html +1 -1
  279. package/dist/studio/editors/wicked-doc/editor.json +6 -1
  280. package/dist/studio/editors/wicked-doc/icon.svg +1 -0
  281. package/dist/studio/editors/wicked-doc/index.html +1 -1
  282. package/dist/studio/editors/wicked-insights/editor.json +6 -1
  283. package/dist/studio/editors/wicked-insights/icon.svg +1 -0
  284. package/dist/studio/editors/wicked-insights/index.html +1 -1
  285. package/dist/studio/editors/wicked-page/editor.json +6 -1
  286. package/dist/studio/editors/wicked-page/icon.svg +1 -0
  287. package/dist/studio/editors/wicked-page/index.html +1 -1
  288. package/dist/studio/editors/wicked-video/editor.json +6 -1
  289. package/dist/studio/editors/wicked-video/icon.svg +1 -0
  290. package/dist/studio/editors/wicked-video/index.html +1 -1
  291. package/dist/studio/index.html +2 -2
  292. package/dist/studio/testid-inventory.json +5155 -2707
  293. package/dist/voice/dashboard.d.ts +376 -0
  294. package/dist/voice/dashboard.d.ts.map +1 -0
  295. package/dist/voice/dashboard.js +92 -0
  296. package/dist/voice/dashboard.js.map +1 -0
  297. package/dist/voice/inject-input.d.ts +51 -0
  298. package/dist/voice/inject-input.d.ts.map +1 -0
  299. package/dist/voice/inject-input.js +126 -0
  300. package/dist/voice/inject-input.js.map +1 -0
  301. package/dist/voice/routes.d.ts +41 -0
  302. package/dist/voice/routes.d.ts.map +1 -0
  303. package/dist/voice/routes.js +116 -0
  304. package/dist/voice/routes.js.map +1 -0
  305. package/dist/voice/service.d.ts +177 -0
  306. package/dist/voice/service.d.ts.map +1 -0
  307. package/dist/voice/service.js +400 -0
  308. package/dist/voice/service.js.map +1 -0
  309. package/dist/workflow-catalog/build.d.ts +35 -0
  310. package/dist/workflow-catalog/build.d.ts.map +1 -0
  311. package/dist/workflow-catalog/build.js +229 -0
  312. package/dist/workflow-catalog/build.js.map +1 -0
  313. package/dist/workflow-catalog/catalog-data.d.ts +36 -0
  314. package/dist/workflow-catalog/catalog-data.d.ts.map +1 -0
  315. package/dist/workflow-catalog/catalog-data.js +430 -0
  316. package/dist/workflow-catalog/catalog-data.js.map +1 -0
  317. package/dist/working-doc/event-lines.d.ts +76 -0
  318. package/dist/working-doc/event-lines.d.ts.map +1 -0
  319. package/dist/working-doc/event-lines.js +247 -0
  320. package/dist/working-doc/event-lines.js.map +1 -0
  321. package/dist/working-doc/routes.d.ts +1 -1
  322. package/dist/working-doc/routes.d.ts.map +1 -1
  323. package/dist/working-doc/routes.js +2 -1
  324. package/dist/working-doc/routes.js.map +1 -1
  325. package/dist/working-doc/sections.d.ts +3 -1
  326. package/dist/working-doc/sections.d.ts.map +1 -1
  327. package/dist/working-doc/sections.js +4 -2
  328. package/dist/working-doc/sections.js.map +1 -1
  329. package/dist/working-doc/service.d.ts +66 -1
  330. package/dist/working-doc/service.d.ts.map +1 -1
  331. package/dist/working-doc/service.js +298 -22
  332. package/dist/working-doc/service.js.map +1 -1
  333. package/dist/working-doc/store.d.ts +8 -2
  334. package/dist/working-doc/store.d.ts.map +1 -1
  335. package/dist/working-doc/store.js.map +1 -1
  336. package/endpoint-manifest.json +205 -2
  337. package/package.json +5 -4
  338. package/workflows/distill-learnings.json +27 -0
  339. package/workflows/inspect-unit.json +27 -0
  340. package/dist/studio/assets/index-B-f_VEL2.css +0 -32
  341. package/dist/studio/assets/index-DhkxIK-0.js +0 -845
@@ -0,0 +1,534 @@
1
+ /**
2
+ * CHAT PROPOSES; NOTHING LAUNCHES YET (DES-CHAT-ARTIFACTS-001 §4, slice A2).
3
+ *
4
+ * A chat seat that is asked to make or change an artifact ends its reply with a fenced `wicked-make` block
5
+ * (`chat-scope.ts` tells it how, for the operations crew advertises). The block never reaches a reader: the transcript
6
+ * store cuts it out of the reply and the stream (`chat-transcripts.ts`, on the `wicked-decisions` mechanism). This
7
+ * module is everything after that:
8
+ *
9
+ * 1. **Resolve** ({@link ChatProposals.onReply}): the last block that parses becomes an {@link ArtifactProposal}
10
+ * whose every line is crew's — the catalog entry and its outcome, each source authorized (a run or document must
11
+ * have been named by the person in this chat or be the artifact they had open, and be in the chat's scope; a
12
+ * struck chip says why), the repositories (the chat's scope, else Go is blocked), two distinct helpers (the
13
+ * chat's lead seat, then another of its seats, else the next eligible seat on the roster: studio's `docSeats`
14
+ * rule, moved here so the card and the launch agree), time and cost from the catalog and from completed runs on
15
+ * this daemon (a dollar figure only from at least 3 runs whose every agent step reported a cost), the stops and
16
+ * where it is filed. It is appended as a `proposal` transcript record and sent as a `chatProposal` frame. A newer
17
+ * proposal supersedes the chat's open one; an answer-only turn leaves it open.
18
+ * 2. **Answer** ({@link ChatProposals.decide}, `POST /chats/:id/proposals/:pid`): the route has already checked the
19
+ * capability, that the caller is a person, and that the chat is theirs — on every call. Then, under one
20
+ * in-process lock per proposal, crew looks for what already happened first (a decided proposal returns its
21
+ * result; an `accepting` one whose run exists is adopted and decided), and only a fresh Go runs the state checks
22
+ * (edits, that every source and the target still exist, that the chat and the document are not busy, that a
23
+ * refine's document is still on the head it was proposed on) BEFORE anything is recorded. Then `proposal_accepting`
24
+ * (the effective proposal and the identity derived from the pid), then the one launcher per run id
25
+ * ({@link LaunchOnceRegistry}), then `proposal_decided`. Not now runs no other check.
26
+ *
27
+ * Each operation's launcher is registered by its own slice: A3's real `create` (`interactive/proposal-create.ts`)
28
+ * whenever the draft seam is armed, so production advertises `proposals` and `create`; refine (A5), theme (A7) and demo
29
+ * (A8) stay off there until their slices land. The TEST configuration (`WICKED_CHAT_ARTIFACTS_STUB=1`, DES §13 A2)
30
+ * turns every operation's resolution on and registers a {@link RecordingStubDispatcher} for the kinds that have no real
31
+ * launcher yet (`capabilities.chatArtifacts.stubOps`): those record a dispatch and start nothing.
32
+ *
33
+ * Records go to the chat's live transcript, or to its kept history copy once the chat has ended, so an open proposal
34
+ * stays answerable after a restart (§4.3).
35
+ */
36
+ import { z } from 'zod';
37
+ import type { Actor, ArtifactProposal, ArtifactProposalKind, ChatArtifactsCapabilities, ChatProposalView, ChatTranscriptRecord, CoreEvent, ProposalAccepting, ProposalEdits, ProposalHelpers, ProposalIdentity, ProposalResult, SessionView } from '../core/types.js';
38
+ import type { CatalogSeed } from '../workflow-catalog/catalog-data.js';
39
+ import type { MakeDigest } from './chat-scope.js';
40
+ /** Sources a block may name. */
41
+ export declare const PROPOSAL_SOURCES_MAX = 12;
42
+ /** studio's appearance scalars (`theming/appearance.ts`), as a partial patch: only the keys that change. */
43
+ export declare const ThemePatchSchema: z.ZodEffects<z.ZodObject<{
44
+ theme: z.ZodOptional<z.ZodEnum<["wicked-dark", "wicked-light"]>>;
45
+ accent_h: z.ZodOptional<z.ZodNumber>;
46
+ accent_s: z.ZodOptional<z.ZodNumber>;
47
+ accent_l: z.ZodOptional<z.ZodNumber>;
48
+ ambient: z.ZodOptional<z.ZodBoolean>;
49
+ ambient_still: z.ZodOptional<z.ZodBoolean>;
50
+ }, "strict", z.ZodTypeAny, {
51
+ theme?: "wicked-dark" | "wicked-light" | undefined;
52
+ accent_h?: number | undefined;
53
+ accent_s?: number | undefined;
54
+ accent_l?: number | undefined;
55
+ ambient?: boolean | undefined;
56
+ ambient_still?: boolean | undefined;
57
+ }, {
58
+ theme?: "wicked-dark" | "wicked-light" | undefined;
59
+ accent_h?: number | undefined;
60
+ accent_s?: number | undefined;
61
+ accent_l?: number | undefined;
62
+ ambient?: boolean | undefined;
63
+ ambient_still?: boolean | undefined;
64
+ }>, {
65
+ theme?: "wicked-dark" | "wicked-light" | undefined;
66
+ accent_h?: number | undefined;
67
+ accent_s?: number | undefined;
68
+ accent_l?: number | undefined;
69
+ ambient?: boolean | undefined;
70
+ ambient_still?: boolean | undefined;
71
+ }, {
72
+ theme?: "wicked-dark" | "wicked-light" | undefined;
73
+ accent_h?: number | undefined;
74
+ accent_s?: number | undefined;
75
+ accent_l?: number | undefined;
76
+ ambient?: boolean | undefined;
77
+ ambient_still?: boolean | undefined;
78
+ }>;
79
+ declare const EntryBlock: z.ZodObject<{
80
+ entry: z.ZodString;
81
+ title: z.ZodOptional<z.ZodString>;
82
+ brief: z.ZodOptional<z.ZodString>;
83
+ url: z.ZodOptional<z.ZodString>;
84
+ audience: z.ZodOptional<z.ZodString>;
85
+ show: z.ZodOptional<z.ZodString>;
86
+ sources: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
87
+ repos: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
88
+ reason: z.ZodOptional<z.ZodString>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ repos: string[];
91
+ entry: string;
92
+ sources: string[];
93
+ title?: string | undefined;
94
+ url?: string | undefined;
95
+ reason?: string | undefined;
96
+ audience?: string | undefined;
97
+ show?: string | undefined;
98
+ brief?: string | undefined;
99
+ }, {
100
+ entry: string;
101
+ title?: string | undefined;
102
+ url?: string | undefined;
103
+ reason?: string | undefined;
104
+ repos?: string[] | undefined;
105
+ sources?: string[] | undefined;
106
+ audience?: string | undefined;
107
+ show?: string | undefined;
108
+ brief?: string | undefined;
109
+ }>;
110
+ declare const RefineBlock: z.ZodObject<{
111
+ refine: z.ZodString;
112
+ ask: z.ZodString;
113
+ touches: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
114
+ sources: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
115
+ reason: z.ZodOptional<z.ZodString>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ ask: string;
118
+ refine: string;
119
+ sources: string[];
120
+ touches: string[];
121
+ reason?: string | undefined;
122
+ }, {
123
+ ask: string;
124
+ refine: string;
125
+ reason?: string | undefined;
126
+ sources?: string[] | undefined;
127
+ touches?: string[] | undefined;
128
+ }>;
129
+ declare const ThemeBlock: z.ZodObject<{
130
+ theme: z.ZodObject<{
131
+ name: z.ZodString;
132
+ patch: z.ZodEffects<z.ZodObject<{
133
+ theme: z.ZodOptional<z.ZodEnum<["wicked-dark", "wicked-light"]>>;
134
+ accent_h: z.ZodOptional<z.ZodNumber>;
135
+ accent_s: z.ZodOptional<z.ZodNumber>;
136
+ accent_l: z.ZodOptional<z.ZodNumber>;
137
+ ambient: z.ZodOptional<z.ZodBoolean>;
138
+ ambient_still: z.ZodOptional<z.ZodBoolean>;
139
+ }, "strict", z.ZodTypeAny, {
140
+ theme?: "wicked-dark" | "wicked-light" | undefined;
141
+ accent_h?: number | undefined;
142
+ accent_s?: number | undefined;
143
+ accent_l?: number | undefined;
144
+ ambient?: boolean | undefined;
145
+ ambient_still?: boolean | undefined;
146
+ }, {
147
+ theme?: "wicked-dark" | "wicked-light" | undefined;
148
+ accent_h?: number | undefined;
149
+ accent_s?: number | undefined;
150
+ accent_l?: number | undefined;
151
+ ambient?: boolean | undefined;
152
+ ambient_still?: boolean | undefined;
153
+ }>, {
154
+ theme?: "wicked-dark" | "wicked-light" | undefined;
155
+ accent_h?: number | undefined;
156
+ accent_s?: number | undefined;
157
+ accent_l?: number | undefined;
158
+ ambient?: boolean | undefined;
159
+ ambient_still?: boolean | undefined;
160
+ }, {
161
+ theme?: "wicked-dark" | "wicked-light" | undefined;
162
+ accent_h?: number | undefined;
163
+ accent_s?: number | undefined;
164
+ accent_l?: number | undefined;
165
+ ambient?: boolean | undefined;
166
+ ambient_still?: boolean | undefined;
167
+ }>;
168
+ }, "strip", z.ZodTypeAny, {
169
+ name: string;
170
+ patch: {
171
+ theme?: "wicked-dark" | "wicked-light" | undefined;
172
+ accent_h?: number | undefined;
173
+ accent_s?: number | undefined;
174
+ accent_l?: number | undefined;
175
+ ambient?: boolean | undefined;
176
+ ambient_still?: boolean | undefined;
177
+ };
178
+ }, {
179
+ name: string;
180
+ patch: {
181
+ theme?: "wicked-dark" | "wicked-light" | undefined;
182
+ accent_h?: number | undefined;
183
+ accent_s?: number | undefined;
184
+ accent_l?: number | undefined;
185
+ ambient?: boolean | undefined;
186
+ ambient_still?: boolean | undefined;
187
+ };
188
+ }>;
189
+ reason: z.ZodOptional<z.ZodString>;
190
+ }, "strip", z.ZodTypeAny, {
191
+ theme: {
192
+ name: string;
193
+ patch: {
194
+ theme?: "wicked-dark" | "wicked-light" | undefined;
195
+ accent_h?: number | undefined;
196
+ accent_s?: number | undefined;
197
+ accent_l?: number | undefined;
198
+ ambient?: boolean | undefined;
199
+ ambient_still?: boolean | undefined;
200
+ };
201
+ };
202
+ reason?: string | undefined;
203
+ }, {
204
+ theme: {
205
+ name: string;
206
+ patch: {
207
+ theme?: "wicked-dark" | "wicked-light" | undefined;
208
+ accent_h?: number | undefined;
209
+ accent_s?: number | undefined;
210
+ accent_l?: number | undefined;
211
+ ambient?: boolean | undefined;
212
+ ambient_still?: boolean | undefined;
213
+ };
214
+ };
215
+ reason?: string | undefined;
216
+ }>;
217
+ export type ParsedMake = ({
218
+ op: 'entry';
219
+ } & z.infer<typeof EntryBlock>) | ({
220
+ op: 'refine';
221
+ } & z.infer<typeof RefineBlock>) | ({
222
+ op: 'theme';
223
+ } & z.infer<typeof ThemeBlock>);
224
+ /** One block body → its operation, or `null` (not JSON, not exactly one of `entry` / `refine` / `theme`, or a bad shape). */
225
+ export declare function parseMakeBlock(body: string): ParsedMake | null;
226
+ /** The last block of a reply that parses (DES §4.1: the last valid block wins), or `null`. */
227
+ export declare function lastValidBlock(bodies: readonly string[]): ParsedMake | null;
228
+ /** RFC 4122 version-5 UUID of `name` under {@link PROPOSAL_NAMESPACE}: the run id a proposal's Go launches with. */
229
+ export declare function proposalRunId(pid: string): string;
230
+ /** A create's document name, derived from the pid (stable across retries) with the title as a readable prefix. */
231
+ export declare function proposalDocName(pid: string, title: string): string;
232
+ type ProposalRecord = Extract<ChatTranscriptRecord, {
233
+ kind: 'proposal' | 'proposal_accepting' | 'proposal_decided';
234
+ }>;
235
+ /** A folded proposal plus what the accept path needs that the wire view does not carry. */
236
+ export interface FoldedProposal extends ChatProposalView {
237
+ turnId: string;
238
+ /** The `proposal_accepting` record, kept after the decision: what was actually accepted (edits applied). */
239
+ accepting?: ProposalAccepting;
240
+ }
241
+ /**
242
+ * Fold a chat's records into its proposals, by pid. A `proposal` record opens one (a newer pid supersedes the chat's
243
+ * open one; the same pid again replaces it, re-opening an interrupted `accepting` one whose run never launched); a
244
+ * `proposal_accepting` record marks it accepting; a `proposal_decided` record decides it.
245
+ */
246
+ export declare function foldProposals(records: readonly ChatTranscriptRecord[]): Map<string, FoldedProposal>;
247
+ /** The wire view of a folded proposal (no internal fields): once accepted, the card shows what was accepted. */
248
+ export declare function viewOf(f: FoldedProposal): ChatProposalView;
249
+ /** What one Go hands its operation's launcher. */
250
+ export interface ProposalDispatch {
251
+ kind: ArtifactProposalKind;
252
+ pid: string;
253
+ chatId: string;
254
+ actor: Actor;
255
+ identity: ProposalIdentity;
256
+ resolution: ArtifactProposal;
257
+ }
258
+ /** One operation's launcher (A3 create, A5 refine, A7 theme, A8 demo register theirs). */
259
+ export interface ProposalDispatcher {
260
+ /** Whether the run this identity names already exists (it is then adopted, never started again). */
261
+ find(identity: ProposalIdentity): Promise<boolean>;
262
+ /** Start it, with `identity.runId` as the launch's `sessionId`. Called only when {@link find} said no, under the
263
+ * run id's lock. */
264
+ launch(dispatch: ProposalDispatch): Promise<void>;
265
+ /** Whether a run it started is still live (the one-live-job-per-chat rule). */
266
+ live?(runId: string): Promise<boolean>;
267
+ /** Whether a document has an attempt of this launcher still without an outcome (A3: one live job per document). */
268
+ docBusy?(artifactRef: string): Promise<boolean>;
269
+ /** The test configuration's recording stub: nothing is started. */
270
+ readonly stub?: boolean;
271
+ }
272
+ /**
273
+ * DES §4.3 step 3: ONE launcher per run id. `launchOnce` takes the run id's lock, asks the operation's launcher whether
274
+ * that run exists (adopt), and starts it only if not — so a retry, a second tab and a late bus trigger (A3 calls this
275
+ * from the `doc.created` path too) can never both launch.
276
+ */
277
+ export declare class LaunchOnceRegistry {
278
+ private readonly dispatchers;
279
+ private readonly lock;
280
+ /** Runs this daemon started per artifact (`<mount>/<doc>`): a document is busy while one is live, whichever chat
281
+ * started it, even before the engine's run list names its document. */
282
+ private readonly byArtifact;
283
+ register(kind: ArtifactProposalKind, dispatcher: ProposalDispatcher): void;
284
+ has(kind: ArtifactProposalKind): boolean;
285
+ /** The run this identity names, when it exists (adopted, never started again), with whether a stub took it. */
286
+ find(kind: ArtifactProposalKind, identity: ProposalIdentity): Promise<{
287
+ stub: boolean;
288
+ } | null>;
289
+ live(kind: ArtifactProposalKind, runId: string): Promise<boolean>;
290
+ /** Whether a run this daemon started for the artifact is still live, or a launcher's durable record says an attempt at
291
+ * it has no outcome yet (A3: across a restart too). */
292
+ liveForArtifact(artifactRef: string): Promise<boolean>;
293
+ launchOnce(dispatch: ProposalDispatch): Promise<ProposalResult>;
294
+ }
295
+ /**
296
+ * The TEST configuration's launcher (DES §13 A2): records each dispatch as one JSON line and starts nothing. Its own
297
+ * record is what `find` reads, so a retry adopts the recorded dispatch exactly as a real launcher adopts an engine run.
298
+ */
299
+ export declare class RecordingStubDispatcher implements ProposalDispatcher {
300
+ private readonly file;
301
+ private readonly now;
302
+ readonly stub = true;
303
+ constructor(file: string, now?: () => number);
304
+ /** Every recorded dispatch, in order. */
305
+ rows(): Array<{
306
+ at: number;
307
+ kind: string;
308
+ pid: string;
309
+ chatId: string;
310
+ runId: string;
311
+ artifactRef: string | null;
312
+ actor: string;
313
+ title: string;
314
+ }>;
315
+ find(identity: ProposalIdentity): Promise<boolean>;
316
+ launch(d: ProposalDispatch): Promise<void>;
317
+ live(): Promise<boolean>;
318
+ }
319
+ /**
320
+ * A completed run's cost in dollars when it is wholly known, else `null` (DES §4.2: "a dollar figure only counts runs
321
+ * whose every step reported a cost"). Every attempt the engine dispatched for an agent step (a tool step is no agent's)
322
+ * must have reported a finite, priced usage frame; an unpriced frame, or a dispatched attempt with none (a retry on a
323
+ * seat that reports nothing), makes the run's cost unknown.
324
+ */
325
+ export declare function runCostFromEvents(view: SessionView, events: ReadonlyArray<Record<string, unknown>>): number | null;
326
+ /** The workflow each operation's run is. */
327
+ export declare const PROPOSAL_WORKFLOWS: Readonly<Record<Exclude<ArtifactProposalKind, 'theme'>, string>>;
328
+ /** The chat as the resolver sees it. */
329
+ export interface ProposalChat {
330
+ /** The project the chat is filed in; `null` = none. */
331
+ projectId: string | null;
332
+ /** Its repositories (names and ids). */
333
+ repos: ReadonlyArray<{
334
+ id: string;
335
+ name: string;
336
+ }>;
337
+ /** The lead seat (the path's PA, once known) and the chat's eligible seats. */
338
+ lead: string | null;
339
+ seats: readonly string[];
340
+ /** An analysis chat (`POST /chats {workflow}`) proposes nothing (DES §3), whatever its seat writes. */
341
+ analysis: boolean;
342
+ }
343
+ export interface ChatProposalDeps {
344
+ /** The operations crew advertises (and `proposals`). */
345
+ flags(): ChatArtifactsCapabilities;
346
+ /** The catalog entries (`workflow-catalog/catalog-data.ts`). */
347
+ catalog: readonly CatalogSeed[];
348
+ /** The chat's records: the live transcript, or the kept history copy once it has ended. */
349
+ records(chatId: string): ChatTranscriptRecord[];
350
+ /** Append one proposal record to the live transcript, or the kept copy once ended; `false` when neither exists. */
351
+ append(chatId: string, record: ProposalRecord): boolean;
352
+ /** The chat's instance (its history entry's own nonce): a reused id is a different chat. `null` = unknown. */
353
+ instanceOf(chatId: string): string | null;
354
+ /** The chat's project (live, or as its history recorded it once it has ended); `null` = none. */
355
+ projectOf(chatId: string): string | null;
356
+ /** The live chat, or `null` once it has ended. */
357
+ chat(chatId: string): ProposalChat | null;
358
+ /** Seats that can work now, in roster order (enabled, work-eligible, not signed out, not opt-in). */
359
+ rosterEligible(): ReadonlyArray<{
360
+ key: string;
361
+ name: string;
362
+ }>;
363
+ /** Every run, decorated as `GET /runs` serves it (`project_id`, `document_id`, `run_identity`, times). */
364
+ runs(): Promise<SessionView[]>;
365
+ /** The chat a run was filed under, and whether it is a chat's own ask path. */
366
+ chatOfRun(runId: string): string | undefined;
367
+ isAskPath(runId: string): boolean;
368
+ /** The docs root of a project (`default` = Unfiled); `null` = no such project. */
369
+ docsRoot(projectId: string): Promise<string | null>;
370
+ projectName(projectId: string): Promise<string | null>;
371
+ /** A3: a project's repository members (registry ids and names); `null` = no such project. Absent = unknown (a
372
+ * project edit keeps no repository). */
373
+ projectRepos?(projectId: string): Promise<Array<{
374
+ id: string;
375
+ name: string;
376
+ }> | null>;
377
+ /** This chat's attachments. */
378
+ attachments(chatId: string): ReadonlyArray<{
379
+ id: string;
380
+ name: string;
381
+ bytes?: number;
382
+ mediaType?: string;
383
+ }>;
384
+ /** A3: the registry ids of the repositories registered now (a selected one unregistered since refuses Go). Absent =
385
+ * not checked. */
386
+ repoIds?(): Promise<ReadonlySet<string>>;
387
+ /** Steps of a workflow as a launch in this project resolves it, when known. */
388
+ workflowSteps(name: string, projectId: string | null): Promise<number | null>;
389
+ /** A completed run's cost when every agent step reported one, else `null`. */
390
+ runCostUsd(view: SessionView): Promise<number | null>;
391
+ registry: LaunchOnceRegistry;
392
+ broadcast(frame: CoreEvent): void;
393
+ audit(event: string, actor: Actor, detail: Record<string, unknown>): void;
394
+ now?: () => number;
395
+ log?: (msg: string) => void;
396
+ }
397
+ /** Hosts the demo recorder can reach (DES §10: a loopback-only jail). The seat's instructions name the same three
398
+ * (`chat-scope.ts`; a test keeps them equal). */
399
+ export declare const LOCAL_HOSTS: ReadonlySet<string>;
400
+ export interface DecideResult {
401
+ code: number;
402
+ body: Record<string, unknown>;
403
+ }
404
+ export declare class ChatProposals {
405
+ private readonly deps;
406
+ private readonly lock;
407
+ /** Per chat: resolutions publish in the order their replies were folded (a slow one never lands after a newer one). */
408
+ private readonly order;
409
+ private readonly pending;
410
+ private readonly costs;
411
+ private readonly now;
412
+ private readonly log;
413
+ constructor(deps: ChatProposalDeps);
414
+ /** What a seat may be told it can make now (`chat-scope.ts`'s per-message digest). */
415
+ digest(): MakeDigest;
416
+ /** Resolutions still in flight (tests wait on them). */
417
+ settled(): Promise<void>;
418
+ /**
419
+ * A seat's reply was folded with the `wicked-make` bodies cut from it. Resolution reads crew's records (it awaits),
420
+ * so it runs off the fold; the record is appended only if the chat is still the same instance.
421
+ */
422
+ onReply(frame: {
423
+ chat: string;
424
+ cliKey: string;
425
+ turnId?: string;
426
+ ok: boolean;
427
+ blocks: readonly string[];
428
+ }): void;
429
+ /** Append a record and send it on `/ws` — only while the chat is still the instance the caller acted on. */
430
+ private write;
431
+ /**
432
+ * The block → a card's facts. `null` when the operation is not advertised (the seat was never told about it) or the
433
+ * chat has ended: no card. Everything else resolves, with what cannot be resolved struck or blocking Go.
434
+ */
435
+ resolve(input: {
436
+ chatId: string;
437
+ turnId: string;
438
+ seat: string;
439
+ block: ParsedMake;
440
+ records: readonly ChatTranscriptRecord[];
441
+ }): Promise<ArtifactProposal | null>;
442
+ private refused;
443
+ /** The two helpers (DES §4.2): the lead seat, then another of the chat's seats, else the roster's next. */
444
+ helpers(chat: ProposalChat, chosen?: readonly string[]): ProposalHelpers | null;
445
+ /** Time and cost: the catalog's band, the workflow's steps, and medians over completed runs here. */
446
+ private timeOf;
447
+ /**
448
+ * Each source token, authorized (DES §4.2 "From"). A run or document must be named by the person in this chat (A1's
449
+ * `named`, or the artifact open on this turn) — or, for an edit, added by the person now (`personNamed`) — and be in
450
+ * the chat's scope and exist. What fails is struck with the reason; the draft never sees it.
451
+ */
452
+ private resolveSources;
453
+ /**
454
+ * `POST /chats/:id/proposals/:pid` after the route's capability, person and owner checks. `instance` is the chat
455
+ * instance those checks passed against: nothing is read for, or written to, a chat that reused the id since. One
456
+ * lock per proposal: a second tab or a double click waits for the first and gets its result.
457
+ */
458
+ decide(chatId: string, pid: string, body: {
459
+ decision: 'go' | 'not_now';
460
+ edits?: ProposalEdits | undefined;
461
+ }, actor: Actor, instance: string | null): Promise<DecideResult>;
462
+ private gone;
463
+ private decideLocked;
464
+ /**
465
+ * The state checks, then `accepting`, the launch, and `decided` — under the chat's lock and the document's, so two
466
+ * proposals of one chat (or two chats changing one document) can never both pass the busy check.
467
+ */
468
+ private go;
469
+ private goLocked;
470
+ /** Record the answer (and audit exactly what was answered); `false` when the chat is no longer this instance. */
471
+ private decided;
472
+ /** The identity a Go is named by (DES §4.3 step 2). */
473
+ identityOf(p: ArtifactProposal): ProposalIdentity;
474
+ /**
475
+ * The first source (or the target) that no longer exists, or is no longer where it was authorized, as words; `null`
476
+ * = all there. The stored authorization (named in this chat) is never re-derived; where it lives is re-checked.
477
+ */
478
+ private firstGone;
479
+ /**
480
+ * One live job per chat (work and artifact runs together) and one per document, whoever started it (DES §4.3).
481
+ * `null` = free.
482
+ */
483
+ private busy;
484
+ /**
485
+ * The person's edits, re-checked with §4.2's rules (no edit can lower assurance: helpers stay two distinct eligible
486
+ * seats). This slice takes the fields its own card can change; a project, repositories, a demo address and a
487
+ * refine's `allow` are refused here until the slice whose form edits them (A3, A5, A8). `chatId` is the chat the
488
+ * route answered (the history entry: after an id reuse, the archived one), never re-derived from the proposal.
489
+ */
490
+ private applyEdits;
491
+ /**
492
+ * A3 (§4.2): re-check a create against the project it is now filed in. A run or document source from elsewhere is
493
+ * struck; a `message:` source is struck whole when any record its answer was given is elsewhere (the conversation
494
+ * keeps only what is in the project, at packet time); repositories outside the project's members are cut (or, when
495
+ * the person chose them, refused).
496
+ */
497
+ private recheckProject;
498
+ /**
499
+ * The accepted proposal a create's `chat_id` + `proposal_id` names, for this actor (§5.2): accepting (or decided go),
500
+ * accepted by them, a create. `null` otherwise — and then the create is refused.
501
+ */
502
+ grantFor(chatId: string, pid: string, actorId: string): {
503
+ doc: string;
504
+ projectId: string;
505
+ repos: Array<{
506
+ id: string;
507
+ name: string;
508
+ }>;
509
+ } | null;
510
+ /** The accepted resolution and identity of a proposal (the launcher's bus trigger rebuilds its dispatch from it). */
511
+ acceptedOf(chatId: string, pid: string): {
512
+ actor: string;
513
+ resolution: ArtifactProposal;
514
+ identity: ProposalIdentity;
515
+ turnId: string;
516
+ state: ChatProposalView['state'];
517
+ } | null;
518
+ /**
519
+ * §6.2: a proposal-bound attempt ended without landing. Crew appends `<chatId>:retry:<runId>` — the same artifact, the
520
+ * failed attempt's effective resolution (edits, helpers, sources; the conversation cutoff stays the binding's), a new
521
+ * run id derived from its own pid — to the live chat or its kept history. Once per failed run.
522
+ */
523
+ appendRetry(chatId: string, failedPid: string, runId: string, artifactRef: string, reason: string, bound?: string | null): Promise<string | null>;
524
+ /**
525
+ * The artifact job a chat's proposal started that is still live (busy until its outcome is recorded), as the card
526
+ * names it, or `null`. A work launch filed under the chat (`POST /runs {chatId}`) is refused while one is: one live
527
+ * job per chat, work and artifact runs together (DES §4.3).
528
+ */
529
+ liveJobOf(chatId: string): Promise<string | null>;
530
+ /** At daemon start (§6.2): an `accepting` proposal whose run exists is decided (adopted). `true` when it recorded. */
531
+ settleAccepting(chatId: string, pid: string): Promise<boolean>;
532
+ }
533
+ export {};
534
+ //# sourceMappingURL=chat-proposals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-proposals.d.ts","sourceRoot":"","sources":["../../src/api/chat-proposals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EACV,KAAK,EACL,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EAGzB,gBAAgB,EAChB,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,cAAc,EAGd,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAGvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,gCAAgC;AAChC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAOvC,4GAA4G;AAC5G,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUwD,CAAC;AAEtF,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUd,CAAC;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;EAMf,CAAC;AACH,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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