wicked-crew 0.18.20 → 0.18.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (640) hide show
  1. package/dist/api/audit.d.ts +28 -1
  2. package/dist/api/audit.d.ts.map +1 -1
  3. package/dist/api/audit.js +90 -9
  4. package/dist/api/audit.js.map +1 -1
  5. package/dist/api/auth.d.ts +7 -0
  6. package/dist/api/auth.d.ts.map +1 -1
  7. package/dist/api/auth.js +53 -10
  8. package/dist/api/auth.js.map +1 -1
  9. package/dist/api/capture.d.ts +16 -4
  10. package/dist/api/capture.d.ts.map +1 -1
  11. package/dist/api/capture.js +20 -12
  12. package/dist/api/capture.js.map +1 -1
  13. package/dist/api/chat-context.d.ts +17 -0
  14. package/dist/api/chat-context.d.ts.map +1 -1
  15. package/dist/api/chat-context.js +94 -5
  16. package/dist/api/chat-context.js.map +1 -1
  17. package/dist/api/chat-freshness.js +2 -2
  18. package/dist/api/chat-freshness.js.map +1 -1
  19. package/dist/api/chat-jobs.d.ts +54 -0
  20. package/dist/api/chat-jobs.d.ts.map +1 -1
  21. package/dist/api/chat-jobs.js +199 -7
  22. package/dist/api/chat-jobs.js.map +1 -1
  23. package/dist/api/chat-proposals.d.ts +62 -12
  24. package/dist/api/chat-proposals.d.ts.map +1 -1
  25. package/dist/api/chat-proposals.js +257 -52
  26. package/dist/api/chat-proposals.js.map +1 -1
  27. package/dist/api/chat-requirements.d.ts.map +1 -1
  28. package/dist/api/chat-requirements.js +4 -1
  29. package/dist/api/chat-requirements.js.map +1 -1
  30. package/dist/api/chat-scope.d.ts +12 -0
  31. package/dist/api/chat-scope.d.ts.map +1 -1
  32. package/dist/api/chat-scope.js +35 -5
  33. package/dist/api/chat-scope.js.map +1 -1
  34. package/dist/api/cluster-status.d.ts +41 -12
  35. package/dist/api/cluster-status.d.ts.map +1 -1
  36. package/dist/api/cluster-status.js +148 -3
  37. package/dist/api/cluster-status.js.map +1 -1
  38. package/dist/api/codebase-archive.js +2 -2
  39. package/dist/api/codebase-archive.js.map +1 -1
  40. package/dist/api/compose-facts.d.ts +35 -0
  41. package/dist/api/compose-facts.d.ts.map +1 -0
  42. package/dist/api/compose-facts.js +46 -0
  43. package/dist/api/compose-facts.js.map +1 -0
  44. package/dist/api/cut-read.d.ts +62 -0
  45. package/dist/api/cut-read.d.ts.map +1 -0
  46. package/dist/api/cut-read.js +101 -0
  47. package/dist/api/cut-read.js.map +1 -0
  48. package/dist/api/delivery-cache.d.ts +2 -0
  49. package/dist/api/delivery-cache.d.ts.map +1 -1
  50. package/dist/api/delivery-cache.js +1 -2
  51. package/dist/api/delivery-cache.js.map +1 -1
  52. package/dist/api/delivery-index.d.ts +2 -2
  53. package/dist/api/delivery-index.d.ts.map +1 -1
  54. package/dist/api/delivery-index.js +1 -2
  55. package/dist/api/delivery-index.js.map +1 -1
  56. package/dist/api/desk-snoozes.d.ts +54 -0
  57. package/dist/api/desk-snoozes.d.ts.map +1 -0
  58. package/dist/api/desk-snoozes.js +174 -0
  59. package/dist/api/desk-snoozes.js.map +1 -0
  60. package/dist/api/diagnostics.d.ts +4 -0
  61. package/dist/api/diagnostics.d.ts.map +1 -1
  62. package/dist/api/diagnostics.js +15 -7
  63. package/dist/api/diagnostics.js.map +1 -1
  64. package/dist/api/disk-stores.d.ts +66 -0
  65. package/dist/api/disk-stores.d.ts.map +1 -0
  66. package/dist/api/disk-stores.js +206 -0
  67. package/dist/api/disk-stores.js.map +1 -0
  68. package/dist/api/eval-compare.d.ts +1 -1
  69. package/dist/api/eval-compare.js +1 -1
  70. package/dist/api/eval-sample.d.ts +7 -0
  71. package/dist/api/eval-sample.d.ts.map +1 -1
  72. package/dist/api/eval-sample.js +20 -0
  73. package/dist/api/eval-sample.js.map +1 -1
  74. package/dist/api/gate-cache.d.ts +8 -0
  75. package/dist/api/gate-cache.d.ts.map +1 -1
  76. package/dist/api/gate-cache.js +8 -1
  77. package/dist/api/gate-cache.js.map +1 -1
  78. package/dist/api/governance-steering.d.ts +13 -0
  79. package/dist/api/governance-steering.d.ts.map +1 -1
  80. package/dist/api/governance-steering.js +56 -7
  81. package/dist/api/governance-steering.js.map +1 -1
  82. package/dist/api/mcp.d.ts +19 -1
  83. package/dist/api/mcp.d.ts.map +1 -1
  84. package/dist/api/mcp.js +123 -3
  85. package/dist/api/mcp.js.map +1 -1
  86. package/dist/api/needs.d.ts +23 -0
  87. package/dist/api/needs.d.ts.map +1 -1
  88. package/dist/api/needs.js +124 -19
  89. package/dist/api/needs.js.map +1 -1
  90. package/dist/api/onboarding-capture.d.ts +21 -1
  91. package/dist/api/onboarding-capture.d.ts.map +1 -1
  92. package/dist/api/onboarding-capture.js +112 -8
  93. package/dist/api/onboarding-capture.js.map +1 -1
  94. package/dist/api/policy-landing.d.ts +36 -0
  95. package/dist/api/policy-landing.d.ts.map +1 -1
  96. package/dist/api/policy-landing.js +123 -4
  97. package/dist/api/policy-landing.js.map +1 -1
  98. package/dist/api/post-hoc-deliver.d.ts +7 -0
  99. package/dist/api/post-hoc-deliver.d.ts.map +1 -1
  100. package/dist/api/post-hoc-deliver.js +17 -5
  101. package/dist/api/post-hoc-deliver.js.map +1 -1
  102. package/dist/api/product-publish.d.ts +242 -0
  103. package/dist/api/product-publish.d.ts.map +1 -0
  104. package/dist/api/product-publish.js +902 -0
  105. package/dist/api/product-publish.js.map +1 -0
  106. package/dist/api/product.d.ts +5 -6
  107. package/dist/api/product.d.ts.map +1 -1
  108. package/dist/api/product.js +4 -4
  109. package/dist/api/product.js.map +1 -1
  110. package/dist/api/proposal-cut.d.ts +95 -0
  111. package/dist/api/proposal-cut.d.ts.map +1 -0
  112. package/dist/api/proposal-cut.js +231 -0
  113. package/dist/api/proposal-cut.js.map +1 -0
  114. package/dist/api/proposal-decisions.d.ts +44 -0
  115. package/dist/api/proposal-decisions.d.ts.map +1 -0
  116. package/dist/api/proposal-decisions.js +85 -0
  117. package/dist/api/proposal-decisions.js.map +1 -0
  118. package/dist/api/proposal-onboard.d.ts +29 -0
  119. package/dist/api/proposal-onboard.d.ts.map +1 -1
  120. package/dist/api/proposal-onboard.js +162 -11
  121. package/dist/api/proposal-onboard.js.map +1 -1
  122. package/dist/api/recording.d.ts.map +1 -1
  123. package/dist/api/recording.js +4 -5
  124. package/dist/api/recording.js.map +1 -1
  125. package/dist/api/redeliver.d.ts.map +1 -1
  126. package/dist/api/redeliver.js +11 -7
  127. package/dist/api/redeliver.js.map +1 -1
  128. package/dist/api/repo-input.d.ts.map +1 -1
  129. package/dist/api/repo-input.js +5 -2
  130. package/dist/api/repo-input.js.map +1 -1
  131. package/dist/api/repo-origins.d.ts +24 -0
  132. package/dist/api/repo-origins.d.ts.map +1 -0
  133. package/dist/api/repo-origins.js +71 -0
  134. package/dist/api/repo-origins.js.map +1 -0
  135. package/dist/api/requirements.d.ts +39 -4
  136. package/dist/api/requirements.d.ts.map +1 -1
  137. package/dist/api/requirements.js +76 -5
  138. package/dist/api/requirements.js.map +1 -1
  139. package/dist/api/review-change.d.ts +5 -6
  140. package/dist/api/review-change.d.ts.map +1 -1
  141. package/dist/api/review-change.js +45 -8
  142. package/dist/api/review-change.js.map +1 -1
  143. package/dist/api/routes.d.ts +48 -4
  144. package/dist/api/routes.d.ts.map +1 -1
  145. package/dist/api/routes.js +926 -268
  146. package/dist/api/routes.js.map +1 -1
  147. package/dist/api/run-liveness.d.ts.map +1 -1
  148. package/dist/api/run-liveness.js +3 -1
  149. package/dist/api/run-liveness.js.map +1 -1
  150. package/dist/api/run-sources.d.ts +11 -1
  151. package/dist/api/run-sources.d.ts.map +1 -1
  152. package/dist/api/run-sources.js +26 -3
  153. package/dist/api/run-sources.js.map +1 -1
  154. package/dist/api/run-timing-index.d.ts +56 -1
  155. package/dist/api/run-timing-index.d.ts.map +1 -1
  156. package/dist/api/run-timing-index.js +164 -10
  157. package/dist/api/run-timing-index.js.map +1 -1
  158. package/dist/api/runtime-state.d.ts +6 -0
  159. package/dist/api/runtime-state.d.ts.map +1 -1
  160. package/dist/api/runtime-state.js +14 -3
  161. package/dist/api/runtime-state.js.map +1 -1
  162. package/dist/api/seat-agents.d.ts.map +1 -1
  163. package/dist/api/seat-agents.js +3 -3
  164. package/dist/api/seat-agents.js.map +1 -1
  165. package/dist/api/seat-container-login.d.ts +17 -19
  166. package/dist/api/seat-container-login.d.ts.map +1 -1
  167. package/dist/api/seat-container-login.js +51 -76
  168. package/dist/api/seat-container-login.js.map +1 -1
  169. package/dist/api/seat-governance.d.ts +3 -2
  170. package/dist/api/seat-governance.d.ts.map +1 -1
  171. package/dist/api/seat-governance.js +31 -9
  172. package/dist/api/seat-governance.js.map +1 -1
  173. package/dist/api/seat-standing.d.ts +8 -0
  174. package/dist/api/seat-standing.d.ts.map +1 -1
  175. package/dist/api/seat-standing.js +26 -1
  176. package/dist/api/seat-standing.js.map +1 -1
  177. package/dist/api/server.d.ts +7 -0
  178. package/dist/api/server.d.ts.map +1 -1
  179. package/dist/api/server.js +93 -39
  180. package/dist/api/server.js.map +1 -1
  181. package/dist/api/start-on-login.d.ts +4 -0
  182. package/dist/api/start-on-login.d.ts.map +1 -0
  183. package/dist/api/start-on-login.js +35 -0
  184. package/dist/api/start-on-login.js.map +1 -0
  185. package/dist/api/steering-landing.d.ts +33 -8
  186. package/dist/api/steering-landing.d.ts.map +1 -1
  187. package/dist/api/steering-landing.js +235 -51
  188. package/dist/api/steering-landing.js.map +1 -1
  189. package/dist/api/system-snapshot.d.ts +2 -1
  190. package/dist/api/system-snapshot.d.ts.map +1 -1
  191. package/dist/api/system-snapshot.js +22 -9
  192. package/dist/api/system-snapshot.js.map +1 -1
  193. package/dist/api/ui-text.d.ts.map +1 -1
  194. package/dist/api/ui-text.js +3 -1
  195. package/dist/api/ui-text.js.map +1 -1
  196. package/dist/api/worktree-sweep.d.ts +7 -3
  197. package/dist/api/worktree-sweep.d.ts.map +1 -1
  198. package/dist/api/worktree-sweep.js +10 -6
  199. package/dist/api/worktree-sweep.js.map +1 -1
  200. package/dist/apps/exec/recall.d.ts.map +1 -1
  201. package/dist/apps/exec/recall.js +4 -4
  202. package/dist/apps/exec/recall.js.map +1 -1
  203. package/dist/apps/git.js +2 -2
  204. package/dist/apps/git.js.map +1 -1
  205. package/dist/apps/publish/manifest.d.ts +2 -0
  206. package/dist/apps/publish/manifest.d.ts.map +1 -1
  207. package/dist/apps/publish/manifest.js +8 -3
  208. package/dist/apps/publish/manifest.js.map +1 -1
  209. package/dist/apps/publish/run.d.ts +11 -1
  210. package/dist/apps/publish/run.d.ts.map +1 -1
  211. package/dist/apps/publish/run.js +97 -17
  212. package/dist/apps/publish/run.js.map +1 -1
  213. package/dist/apps/routes.d.ts +2 -0
  214. package/dist/apps/routes.d.ts.map +1 -1
  215. package/dist/apps/routes.js +45 -2
  216. package/dist/apps/routes.js.map +1 -1
  217. package/dist/apps/store.d.ts +35 -3
  218. package/dist/apps/store.d.ts.map +1 -1
  219. package/dist/apps/store.js +73 -9
  220. package/dist/apps/store.js.map +1 -1
  221. package/dist/apps/turns.d.ts +25 -2
  222. package/dist/apps/turns.d.ts.map +1 -1
  223. package/dist/apps/turns.js +276 -11
  224. package/dist/apps/turns.js.map +1 -1
  225. package/dist/apps-server/runners/sqlite-runner.mjs +39 -1
  226. package/dist/apps-server/server/lib/bundle/server.mjs +124 -14
  227. package/dist/cli/index.d.ts.map +1 -1
  228. package/dist/cli/index.js +27 -52
  229. package/dist/cli/index.js.map +1 -1
  230. package/dist/cli/start-stand-ins.d.ts +13 -0
  231. package/dist/cli/start-stand-ins.d.ts.map +1 -0
  232. package/dist/cli/start-stand-ins.js +30 -0
  233. package/dist/cli/start-stand-ins.js.map +1 -0
  234. package/dist/core/adapter.d.ts +66 -14
  235. package/dist/core/adapter.d.ts.map +1 -1
  236. package/dist/core/adapter.js +228 -56
  237. package/dist/core/adapter.js.map +1 -1
  238. package/dist/core/ado-deliver-helper.d.ts +2 -1
  239. package/dist/core/ado-deliver-helper.d.ts.map +1 -1
  240. package/dist/core/ado-deliver-helper.js +26 -1
  241. package/dist/core/ado-deliver-helper.js.map +1 -1
  242. package/dist/core/ado-env.d.ts +17 -0
  243. package/dist/core/ado-env.d.ts.map +1 -0
  244. package/dist/core/ado-env.js +34 -0
  245. package/dist/core/ado-env.js.map +1 -0
  246. package/dist/core/assurance.d.ts +10 -0
  247. package/dist/core/assurance.d.ts.map +1 -1
  248. package/dist/core/assurance.js +23 -0
  249. package/dist/core/assurance.js.map +1 -1
  250. package/dist/core/deliver-text.d.ts +19 -0
  251. package/dist/core/deliver-text.d.ts.map +1 -1
  252. package/dist/core/deliver-text.js +77 -1
  253. package/dist/core/deliver-text.js.map +1 -1
  254. package/dist/core/deliver.d.ts +49 -1
  255. package/dist/core/deliver.d.ts.map +1 -1
  256. package/dist/core/deliver.js +142 -6
  257. package/dist/core/deliver.js.map +1 -1
  258. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  259. package/dist/core/estate-mcp-client.js +4 -8
  260. package/dist/core/estate-mcp-client.js.map +1 -1
  261. package/dist/core/exec.d.ts +16 -1
  262. package/dist/core/exec.d.ts.map +1 -1
  263. package/dist/core/exec.js +32 -2
  264. package/dist/core/exec.js.map +1 -1
  265. package/dist/core/governance-store.d.ts +3 -1
  266. package/dist/core/governance-store.d.ts.map +1 -1
  267. package/dist/core/governance-store.js +7 -2
  268. package/dist/core/governance-store.js.map +1 -1
  269. package/dist/core/linked-issues.d.ts +13 -2
  270. package/dist/core/linked-issues.d.ts.map +1 -1
  271. package/dist/core/linked-issues.js +135 -4
  272. package/dist/core/linked-issues.js.map +1 -1
  273. package/dist/core/redeliver.js +2 -2
  274. package/dist/core/redeliver.js.map +1 -1
  275. package/dist/core/repo-clone.d.ts +64 -0
  276. package/dist/core/repo-clone.d.ts.map +1 -0
  277. package/dist/core/repo-clone.js +307 -0
  278. package/dist/core/repo-clone.js.map +1 -0
  279. package/dist/core/run-identity.d.ts.map +1 -1
  280. package/dist/core/run-identity.js +3 -0
  281. package/dist/core/run-identity.js.map +1 -1
  282. package/dist/core/run-log-facts.d.ts +56 -0
  283. package/dist/core/run-log-facts.d.ts.map +1 -0
  284. package/dist/core/run-log-facts.js +230 -0
  285. package/dist/core/run-log-facts.js.map +1 -0
  286. package/dist/core/run-read-lane.d.ts +30 -0
  287. package/dist/core/run-read-lane.d.ts.map +1 -0
  288. package/dist/core/run-read-lane.js +103 -0
  289. package/dist/core/run-read-lane.js.map +1 -0
  290. package/dist/core/shutdown.d.ts +27 -0
  291. package/dist/core/shutdown.d.ts.map +1 -1
  292. package/dist/core/shutdown.js +72 -0
  293. package/dist/core/shutdown.js.map +1 -1
  294. package/dist/core/stand-in.d.ts +40 -0
  295. package/dist/core/stand-in.d.ts.map +1 -0
  296. package/dist/core/stand-in.js +118 -0
  297. package/dist/core/stand-in.js.map +1 -0
  298. package/dist/core/types.d.ts +27 -0
  299. package/dist/core/types.d.ts.map +1 -1
  300. package/dist/core/types.js.map +1 -1
  301. package/dist/core/walkthrough-root.d.ts.map +1 -1
  302. package/dist/core/walkthrough-root.js +3 -5
  303. package/dist/core/walkthrough-root.js.map +1 -1
  304. package/dist/core/wicked-home.d.ts +9 -0
  305. package/dist/core/wicked-home.d.ts.map +1 -0
  306. package/dist/core/wicked-home.js +25 -0
  307. package/dist/core/wicked-home.js.map +1 -0
  308. package/dist/decisions/consider.d.ts +2 -1
  309. package/dist/decisions/consider.d.ts.map +1 -1
  310. package/dist/decisions/consider.js +2 -2
  311. package/dist/decisions/consider.js.map +1 -1
  312. package/dist/decisions/land.d.ts +2 -0
  313. package/dist/decisions/land.d.ts.map +1 -1
  314. package/dist/decisions/land.js +16 -3
  315. package/dist/decisions/land.js.map +1 -1
  316. package/dist/decisions/rules-brief.d.ts +2 -1
  317. package/dist/decisions/rules-brief.d.ts.map +1 -1
  318. package/dist/decisions/rules-brief.js +3 -2
  319. package/dist/decisions/rules-brief.js.map +1 -1
  320. package/dist/editors/conformance-runtime.d.ts +0 -2
  321. package/dist/editors/conformance-runtime.d.ts.map +1 -1
  322. package/dist/editors/conformance-runtime.js +0 -4
  323. package/dist/editors/conformance-runtime.js.map +1 -1
  324. package/dist/editors/pack-extras.d.ts +162 -0
  325. package/dist/editors/pack-extras.d.ts.map +1 -0
  326. package/dist/editors/pack-extras.js +596 -0
  327. package/dist/editors/pack-extras.js.map +1 -0
  328. package/dist/editors/pack-install.d.ts +26 -22
  329. package/dist/editors/pack-install.d.ts.map +1 -1
  330. package/dist/editors/pack-install.js +187 -80
  331. package/dist/editors/pack-install.js.map +1 -1
  332. package/dist/editors/registry.d.ts +66 -13
  333. package/dist/editors/registry.d.ts.map +1 -1
  334. package/dist/editors/registry.js +147 -24
  335. package/dist/editors/registry.js.map +1 -1
  336. package/dist/editors/routes.d.ts +10 -5
  337. package/dist/editors/routes.d.ts.map +1 -1
  338. package/dist/editors/routes.js +45 -11
  339. package/dist/editors/routes.js.map +1 -1
  340. package/dist/editors/visuals.d.ts +4 -3
  341. package/dist/editors/visuals.d.ts.map +1 -1
  342. package/dist/editors/visuals.js +17 -7
  343. package/dist/editors/visuals.js.map +1 -1
  344. package/dist/evals/runner.js +1 -1
  345. package/dist/evals/runner.js.map +1 -1
  346. package/dist/evals/shape.d.ts +7 -1
  347. package/dist/evals/shape.d.ts.map +1 -1
  348. package/dist/evals/shape.js +26 -6
  349. package/dist/evals/shape.js.map +1 -1
  350. package/dist/evals/workflow.d.ts +16 -3
  351. package/dist/evals/workflow.d.ts.map +1 -1
  352. package/dist/evals/workflow.js +31 -6
  353. package/dist/evals/workflow.js.map +1 -1
  354. package/dist/insights/review-service.d.ts +24 -3
  355. package/dist/insights/review-service.d.ts.map +1 -1
  356. package/dist/insights/review-service.js +75 -12
  357. package/dist/insights/review-service.js.map +1 -1
  358. package/dist/insights/routes.d.ts +2 -1
  359. package/dist/insights/routes.d.ts.map +1 -1
  360. package/dist/insights/routes.js +19 -4
  361. package/dist/insights/routes.js.map +1 -1
  362. package/dist/insights/run-facts.d.ts +5 -0
  363. package/dist/insights/run-facts.d.ts.map +1 -1
  364. package/dist/insights/run-facts.js +15 -0
  365. package/dist/insights/run-facts.js.map +1 -1
  366. package/dist/insights/workflow.d.ts +2 -1
  367. package/dist/insights/workflow.d.ts.map +1 -1
  368. package/dist/insights/workflow.js +4 -4
  369. package/dist/insights/workflow.js.map +1 -1
  370. package/dist/inspect/service.d.ts +3 -2
  371. package/dist/inspect/service.d.ts.map +1 -1
  372. package/dist/inspect/service.js +4 -4
  373. package/dist/inspect/service.js.map +1 -1
  374. package/dist/interactive/bridge-pool.d.ts +5 -2
  375. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  376. package/dist/interactive/bridge-pool.js +10 -5
  377. package/dist/interactive/bridge-pool.js.map +1 -1
  378. package/dist/interactive/chat-events.d.ts.map +1 -1
  379. package/dist/interactive/chat-events.js +7 -1
  380. package/dist/interactive/chat-events.js.map +1 -1
  381. package/dist/interactive/draft-events.d.ts +3 -0
  382. package/dist/interactive/draft-events.d.ts.map +1 -1
  383. package/dist/interactive/draft-events.js +5 -8
  384. package/dist/interactive/draft-events.js.map +1 -1
  385. package/dist/interactive/draft-skill.d.ts +56 -3
  386. package/dist/interactive/draft-skill.d.ts.map +1 -1
  387. package/dist/interactive/draft-skill.js +129 -20
  388. package/dist/interactive/draft-skill.js.map +1 -1
  389. package/dist/interactive/landing-guard.d.ts +30 -5
  390. package/dist/interactive/landing-guard.d.ts.map +1 -1
  391. package/dist/interactive/landing-guard.js +196 -6
  392. package/dist/interactive/landing-guard.js.map +1 -1
  393. package/dist/interactive/proposal-create.d.ts.map +1 -1
  394. package/dist/interactive/proposal-create.js +1 -0
  395. package/dist/interactive/proposal-create.js.map +1 -1
  396. package/dist/interactive/proposal-refine.d.ts.map +1 -1
  397. package/dist/interactive/proposal-refine.js +16 -1
  398. package/dist/interactive/proposal-refine.js.map +1 -1
  399. package/dist/interactive/review-events.js +1 -1
  400. package/dist/interactive/review-events.js.map +1 -1
  401. package/dist/interactive/run-units.d.ts.map +1 -1
  402. package/dist/interactive/run-units.js +3 -2
  403. package/dist/interactive/run-units.js.map +1 -1
  404. package/dist/interactive/source-packet.d.ts +8 -0
  405. package/dist/interactive/source-packet.d.ts.map +1 -1
  406. package/dist/interactive/source-packet.js +47 -6
  407. package/dist/interactive/source-packet.js.map +1 -1
  408. package/dist/knowledge/adapters/toolbox/memory.d.ts.map +1 -1
  409. package/dist/knowledge/adapters/toolbox/memory.js +3 -2
  410. package/dist/knowledge/adapters/toolbox/memory.js.map +1 -1
  411. package/dist/knowledge/adapters/toolbox/supervisor.d.ts +21 -1
  412. package/dist/knowledge/adapters/toolbox/supervisor.d.ts.map +1 -1
  413. package/dist/knowledge/adapters/toolbox/supervisor.js +76 -26
  414. package/dist/knowledge/adapters/toolbox/supervisor.js.map +1 -1
  415. package/dist/knowledge/estate-write.d.ts +5 -0
  416. package/dist/knowledge/estate-write.d.ts.map +1 -1
  417. package/dist/knowledge/estate-write.js +7 -0
  418. package/dist/knowledge/estate-write.js.map +1 -1
  419. package/dist/knowledge/projector.d.ts +60 -5
  420. package/dist/knowledge/projector.d.ts.map +1 -1
  421. package/dist/knowledge/projector.js +264 -21
  422. package/dist/knowledge/projector.js.map +1 -1
  423. package/dist/knowledge/shapes/map.d.ts.map +1 -1
  424. package/dist/knowledge/shapes/map.js +12 -2
  425. package/dist/knowledge/shapes/map.js.map +1 -1
  426. package/dist/knowledge/shapes/routes.d.ts +1 -1
  427. package/dist/knowledge/shapes/routes.d.ts.map +1 -1
  428. package/dist/knowledge/shapes/routes.js +42 -16
  429. package/dist/knowledge/shapes/routes.js.map +1 -1
  430. package/dist/knowledge/shapes/shapes.d.ts +60 -13
  431. package/dist/knowledge/shapes/shapes.d.ts.map +1 -1
  432. package/dist/knowledge/shapes/shapes.js +199 -31
  433. package/dist/knowledge/shapes/shapes.js.map +1 -1
  434. package/dist/knowledge/shapes/verified.d.ts.map +1 -1
  435. package/dist/knowledge/shapes/verified.js +3 -2
  436. package/dist/knowledge/shapes/verified.js.map +1 -1
  437. package/dist/knowledge/trackers/addresses.d.ts +27 -3
  438. package/dist/knowledge/trackers/addresses.d.ts.map +1 -1
  439. package/dist/knowledge/trackers/addresses.js +33 -5
  440. package/dist/knowledge/trackers/addresses.js.map +1 -1
  441. package/dist/knowledge/trackers/gate-pm.d.ts.map +1 -1
  442. package/dist/knowledge/trackers/gate-pm.js +4 -2
  443. package/dist/knowledge/trackers/gate-pm.js.map +1 -1
  444. package/dist/knowledge/trackers/projector.d.ts +3 -1
  445. package/dist/knowledge/trackers/projector.d.ts.map +1 -1
  446. package/dist/knowledge/trackers/projector.js +59 -8
  447. package/dist/knowledge/trackers/projector.js.map +1 -1
  448. package/dist/knowledge/trackers/set.d.ts +28 -0
  449. package/dist/knowledge/trackers/set.d.ts.map +1 -1
  450. package/dist/knowledge/trackers/set.js +26 -0
  451. package/dist/knowledge/trackers/set.js.map +1 -1
  452. package/dist/learn/scheduler.d.ts.map +1 -1
  453. package/dist/learn/scheduler.js +11 -2
  454. package/dist/learn/scheduler.js.map +1 -1
  455. package/dist/learnings/extract.d.ts +9 -3
  456. package/dist/learnings/extract.d.ts.map +1 -1
  457. package/dist/learnings/extract.js +62 -4
  458. package/dist/learnings/extract.js.map +1 -1
  459. package/dist/learnings/replacement-lineage.d.ts +3 -2
  460. package/dist/learnings/replacement-lineage.d.ts.map +1 -1
  461. package/dist/learnings/replacement-lineage.js +7 -6
  462. package/dist/learnings/replacement-lineage.js.map +1 -1
  463. package/dist/learnings/service.d.ts +12 -2
  464. package/dist/learnings/service.d.ts.map +1 -1
  465. package/dist/learnings/service.js +30 -5
  466. package/dist/learnings/service.js.map +1 -1
  467. package/dist/mcp/broker.d.ts.map +1 -1
  468. package/dist/mcp/broker.js +18 -4
  469. package/dist/mcp/broker.js.map +1 -1
  470. package/dist/mcp/estate-relay.d.ts +3 -0
  471. package/dist/mcp/estate-relay.d.ts.map +1 -1
  472. package/dist/mcp/estate-relay.js +5 -2
  473. package/dist/mcp/estate-relay.js.map +1 -1
  474. package/dist/mcp/invoke.js +2 -2
  475. package/dist/mcp/invoke.js.map +1 -1
  476. package/dist/mcp/policies.d.ts +35 -0
  477. package/dist/mcp/policies.d.ts.map +1 -1
  478. package/dist/mcp/policies.js +138 -1
  479. package/dist/mcp/policies.js.map +1 -1
  480. package/dist/mcp/redact.d.ts +1 -1
  481. package/dist/mcp/redact.d.ts.map +1 -1
  482. package/dist/mcp/redact.js +61 -4
  483. package/dist/mcp/redact.js.map +1 -1
  484. package/dist/mcp/registry-store.d.ts +35 -0
  485. package/dist/mcp/registry-store.d.ts.map +1 -1
  486. package/dist/mcp/registry-store.js +33 -0
  487. package/dist/mcp/registry-store.js.map +1 -1
  488. package/dist/mcp/registry.d.ts +65 -4
  489. package/dist/mcp/registry.d.ts.map +1 -1
  490. package/dist/mcp/registry.js +295 -21
  491. package/dist/mcp/registry.js.map +1 -1
  492. package/dist/mcp/rest.js +3 -3
  493. package/dist/mcp/rest.js.map +1 -1
  494. package/dist/mcp/run-fence.d.ts +2 -0
  495. package/dist/mcp/run-fence.d.ts.map +1 -1
  496. package/dist/mcp/run-fence.js +9 -0
  497. package/dist/mcp/run-fence.js.map +1 -1
  498. package/dist/mcp/trigger-names.d.ts +32 -0
  499. package/dist/mcp/trigger-names.d.ts.map +1 -0
  500. package/dist/mcp/trigger-names.js +529 -0
  501. package/dist/mcp/trigger-names.js.map +1 -0
  502. package/dist/mcp/upstream-error.d.ts +5 -1
  503. package/dist/mcp/upstream-error.d.ts.map +1 -1
  504. package/dist/mcp/upstream-error.js +5 -1
  505. package/dist/mcp/upstream-error.js.map +1 -1
  506. package/dist/projects/graph.d.ts +6 -4
  507. package/dist/projects/graph.d.ts.map +1 -1
  508. package/dist/projects/graph.js +173 -25
  509. package/dist/projects/graph.js.map +1 -1
  510. package/dist/projects/routes.d.ts +7 -1
  511. package/dist/projects/routes.d.ts.map +1 -1
  512. package/dist/projects/routes.js +13 -5
  513. package/dist/projects/routes.js.map +1 -1
  514. package/dist/projects/state-home-preflight.d.ts +5 -0
  515. package/dist/projects/state-home-preflight.d.ts.map +1 -1
  516. package/dist/projects/state-home-preflight.js +48 -8
  517. package/dist/projects/state-home-preflight.js.map +1 -1
  518. package/dist/projects/state-home-registry.d.ts.map +1 -1
  519. package/dist/projects/state-home-registry.js +6 -0
  520. package/dist/projects/state-home-registry.js.map +1 -1
  521. package/dist/projects/state-home.d.ts +6 -2
  522. package/dist/projects/state-home.d.ts.map +1 -1
  523. package/dist/projects/state-home.js +8 -5
  524. package/dist/projects/state-home.js.map +1 -1
  525. package/dist/qe/test-sets.d.ts +1 -1
  526. package/dist/qe/test-sets.d.ts.map +1 -1
  527. package/dist/qe/test-sets.js +2 -2
  528. package/dist/qe/test-sets.js.map +1 -1
  529. package/dist/schedules/routes.d.ts +5 -0
  530. package/dist/schedules/routes.d.ts.map +1 -1
  531. package/dist/schedules/routes.js +32 -5
  532. package/dist/schedules/routes.js.map +1 -1
  533. package/dist/schedules/scheduler.d.ts +8 -1
  534. package/dist/schedules/scheduler.d.ts.map +1 -1
  535. package/dist/schedules/scheduler.js +10 -1
  536. package/dist/schedules/scheduler.js.map +1 -1
  537. package/dist/schedules/store.d.ts +7 -0
  538. package/dist/schedules/store.d.ts.map +1 -1
  539. package/dist/schedules/store.js +19 -4
  540. package/dist/schedules/store.js.map +1 -1
  541. package/dist/skills/plugin-source.js +4 -4
  542. package/dist/skills/plugin-source.js.map +1 -1
  543. package/dist/skills/store.d.ts +11 -1
  544. package/dist/skills/store.d.ts.map +1 -1
  545. package/dist/skills/store.js +37 -3
  546. package/dist/skills/store.js.map +1 -1
  547. package/dist/sources/drivers/sqlite.d.ts +13 -0
  548. package/dist/sources/drivers/sqlite.d.ts.map +1 -1
  549. package/dist/sources/drivers/sqlite.js +11 -0
  550. package/dist/sources/drivers/sqlite.js.map +1 -1
  551. package/dist/sources/routes.d.ts.map +1 -1
  552. package/dist/sources/routes.js +1 -0
  553. package/dist/sources/routes.js.map +1 -1
  554. package/dist/sources/uploads.d.ts +22 -2
  555. package/dist/sources/uploads.d.ts.map +1 -1
  556. package/dist/sources/uploads.js +108 -10
  557. package/dist/sources/uploads.js.map +1 -1
  558. package/dist/standing-orders/parse.d.ts +8 -0
  559. package/dist/standing-orders/parse.d.ts.map +1 -1
  560. package/dist/standing-orders/parse.js +52 -5
  561. package/dist/standing-orders/parse.js.map +1 -1
  562. package/dist/studio/apps-standalone/fixture.js +3 -3
  563. package/dist/studio/assets/{KnowledgeGraph-dfq7Flyj.js → KnowledgeGraph-D6RRLDnV.js} +1 -1
  564. package/dist/studio/assets/index-BLo9vFQI.js +1128 -0
  565. package/dist/studio/assets/index-xW21Gkam.css +32 -0
  566. package/dist/studio/editors/wicked-apps/editor.json +1 -1
  567. package/dist/studio/editors/wicked-apps/index.html +1 -1
  568. package/dist/studio/editors/wicked-deck/editor.json +1 -1
  569. package/dist/studio/editors/wicked-deck/index.html +1 -1
  570. package/dist/studio/editors/wicked-doc/editor.json +1 -1
  571. package/dist/studio/editors/wicked-doc/index.html +1 -1
  572. package/dist/studio/editors/wicked-insights/editor.json +1 -1
  573. package/dist/studio/editors/wicked-insights/index.html +1 -1
  574. package/dist/studio/editors/wicked-page/editor.json +1 -1
  575. package/dist/studio/editors/wicked-page/index.html +1 -1
  576. package/dist/studio/editors/wicked-video/editor.json +1 -1
  577. package/dist/studio/editors/wicked-video/index.html +1 -1
  578. package/dist/studio/index.html +2 -2
  579. package/dist/studio/testid-inventory.json +1687 -236
  580. package/dist/team/routes.d.ts +4 -1
  581. package/dist/team/routes.d.ts.map +1 -1
  582. package/dist/team/routes.js +3 -2
  583. package/dist/team/routes.js.map +1 -1
  584. package/dist/voice/tts.d.ts +18 -0
  585. package/dist/voice/tts.d.ts.map +1 -1
  586. package/dist/voice/tts.js +134 -29
  587. package/dist/voice/tts.js.map +1 -1
  588. package/dist/workflow-catalog/build-v2.d.ts +34 -0
  589. package/dist/workflow-catalog/build-v2.d.ts.map +1 -1
  590. package/dist/workflow-catalog/build-v2.js +131 -10
  591. package/dist/workflow-catalog/build-v2.js.map +1 -1
  592. package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
  593. package/dist/workflow-catalog/catalog-data.js +0 -2
  594. package/dist/workflow-catalog/catalog-data.js.map +1 -1
  595. package/dist/workflow-catalog/detect.d.ts +18 -3
  596. package/dist/workflow-catalog/detect.d.ts.map +1 -1
  597. package/dist/workflow-catalog/detect.js +43 -8
  598. package/dist/workflow-catalog/detect.js.map +1 -1
  599. package/dist/working-doc/event-lines.d.ts +5 -2
  600. package/dist/working-doc/event-lines.d.ts.map +1 -1
  601. package/dist/working-doc/event-lines.js +38 -7
  602. package/dist/working-doc/event-lines.js.map +1 -1
  603. package/dist/working-doc/sections.d.ts +3 -0
  604. package/dist/working-doc/sections.d.ts.map +1 -1
  605. package/dist/working-doc/sections.js +5 -0
  606. package/dist/working-doc/sections.js.map +1 -1
  607. package/dist/working-doc/service.d.ts +23 -3
  608. package/dist/working-doc/service.d.ts.map +1 -1
  609. package/dist/working-doc/service.js +93 -54
  610. package/dist/working-doc/service.js.map +1 -1
  611. package/endpoint-manifest.json +144 -8
  612. package/evals/corpora/shape-v1.json +25 -1
  613. package/evals/corpora/shape-v1.seat-fixture.json +25 -1
  614. package/package.json +4 -4
  615. package/runners/sqlite-runner.mjs +39 -1
  616. package/voice-locks/darwin-arm64-cp310.txt +12 -0
  617. package/voice-locks/darwin-arm64-cp311.txt +8 -0
  618. package/voice-locks/darwin-arm64-cp312.txt +8 -0
  619. package/voice-locks/darwin-arm64-cp313.txt +8 -0
  620. package/voice-locks/darwin-arm64-cp314.txt +8 -0
  621. package/voice-locks/darwin-arm64-cp39.txt +12 -0
  622. package/voice-locks/darwin-x64-cp310.txt +12 -0
  623. package/voice-locks/darwin-x64-cp311.txt +12 -0
  624. package/voice-locks/darwin-x64-cp312.txt +12 -0
  625. package/voice-locks/darwin-x64-cp313.txt +12 -0
  626. package/voice-locks/darwin-x64-cp39.txt +12 -0
  627. package/voice-locks/linux-arm64-cp310.txt +12 -0
  628. package/voice-locks/linux-arm64-cp311.txt +8 -0
  629. package/voice-locks/linux-arm64-cp312.txt +8 -0
  630. package/voice-locks/linux-arm64-cp313.txt +8 -0
  631. package/voice-locks/linux-arm64-cp314.txt +8 -0
  632. package/voice-locks/linux-arm64-cp39.txt +12 -0
  633. package/voice-locks/linux-x64-cp310.txt +12 -0
  634. package/voice-locks/linux-x64-cp311.txt +8 -0
  635. package/voice-locks/linux-x64-cp312.txt +8 -0
  636. package/voice-locks/linux-x64-cp313.txt +8 -0
  637. package/voice-locks/linux-x64-cp314.txt +8 -0
  638. package/voice-locks/linux-x64-cp39.txt +12 -0
  639. package/dist/studio/assets/index-Bame65hj.js +0 -1108
  640. package/dist/studio/assets/index-CtB1BJRI.css +0 -32
@@ -45,7 +45,6 @@ export const PREVIEW_TTL_MS = 15 * 60 * 1000;
45
45
  const PREVIEW_CACHE_MAX = 64;
46
46
  /** Consecutive failed probes before a server's health reads `failing`. */
47
47
  export const HEALTH_FAILING_AFTER = 3;
48
- /** A refusal the routes map to a status code. */
49
48
  export class McpRegistryError extends Error {
50
49
  status;
51
50
  code;
@@ -82,6 +81,11 @@ export class McpRegistry {
82
81
  trackerProjection = PROJECTION_UNKNOWN;
83
82
  /** (DES-PM-001 §3.4) Called once a restore has landed (the daemon points it at the tracker projector). */
84
83
  onRestored;
84
+ /**
85
+ * (crew#1328, crew#1354) Called once a removal or a restore that dropped records has landed, with the estate source
86
+ * ids it tombstoned ({@link estateSourceIds}); the daemon has their writers erase them. Never throws in.
87
+ */
88
+ onTombstoned;
85
89
  constructor(deps) {
86
90
  this.deps = deps;
87
91
  this.now = deps.now ?? Date.now;
@@ -134,6 +138,11 @@ export class McpRegistry {
134
138
  if ((config.kind === 'sql' || config.kind === 'graphql' || config.kind === 'toolbox-source') && config.name === CREW_SOURCE) {
135
139
  throw new McpRegistryError(400, 'reserved_name', `"${CREW_SOURCE}" is the built-in crew source; choose another name`);
136
140
  }
141
+ // (crew#1514) A name a live entry was renamed away from is retired: refused here, and again inside the save.
142
+ const registered = (await this.readFile()).servers;
143
+ const retiring = retiredBy(registered, config.name);
144
+ if (retiring !== undefined)
145
+ throw retiredName(config.name, retiring);
137
146
  // (DES-KNOWLEDGE-DATA-001 §5.1) A database source is saved as its Toolbox document, checked against the
138
147
  // deployment policy here (the preview) and again when the write lands.
139
148
  config = this.forSave(config);
@@ -144,8 +153,11 @@ export class McpRegistry {
144
153
  if (!this.deps.secrets.available) {
145
154
  throw new McpRegistryError(501, 'secret_store_unavailable', 'this platform has no OS secret store; reference a daemon env variable instead (auth.ref "env:<NAME>")');
146
155
  }
147
- if (config.auth === null || config.auth.ref !== keychainRef(config.name)) {
148
- throw new McpRegistryError(400, 'secret_not_staged_here', `a staged secret is stored as this server's own keychain entry, so auth.ref must be ${keychainRef(config.name)}`);
156
+ // (crew#1514) A renamed entry's own entry keeps the account it was saved under (`keychainAccount`).
157
+ const own = registered.find((x) => x.name === config.name);
158
+ const account = own !== undefined ? ownAccount(own) : config.name;
159
+ if (config.auth === null || config.auth.ref !== keychainRef(account)) {
160
+ throw new McpRegistryError(400, 'secret_not_staged_here', `a staged secret is stored as this server's own keychain entry, so auth.ref must be ${keychainRef(account)}`);
149
161
  }
150
162
  // The reference is answered back and audited, so a value it contains would be echoed there.
151
163
  if (config.auth.ref.includes(stagedSecret)) {
@@ -263,16 +275,29 @@ export class McpRegistry {
263
275
  // orphan this was written to prevent. `null` = no prior value, and then the rollback deletes.
264
276
  // (DES-PM-001 §3) A save that would drop or change a PM source's marker is refused BEFORE any credential is
265
277
  // written (the mutation refuses it again, under the store's chain, for a marker set meanwhile).
266
- const existing = (await this.readFile()).servers.find((s) => s.name === held.config.name);
278
+ const current = (await this.readFile()).servers;
279
+ const existing = current.find((s) => s.name === held.config.name);
280
+ // (crew#1514) Judged BEFORE any credential is written: a preview held across a rename can't save over the retired
281
+ // name, nor write the keychain account the renamed entry still uses.
282
+ const retiring = retiredBy(current, held.config.name);
283
+ if (retiring !== undefined)
284
+ throw retiredName(held.config.name, retiring);
285
+ const account = held.secret === null ? held.config.name : stagedAccount(held.config, existing);
267
286
  const existingPm = existing === undefined ? null : pmOf(existing);
268
287
  if (existingPm !== null && (held.config.pm == null || held.config.pm.system !== existingPm.system)) {
269
288
  throw new McpRegistryError(409, 'pm_marker_fixed', `${held.config.name} is registered as a ${existingPm.system} project-management source; save it with pm.system "${existingPm.system}", or remove it and register it again`);
270
289
  }
271
- const prior = held.secret === null ? null : await this.deps.secrets.get(held.config.name);
290
+ const prior = held.secret === null ? null : await this.deps.secrets.get(account);
272
291
  if (held.secret !== null)
273
- await this.deps.secrets.set(held.config.name, held.secret);
274
- const saved = await this.restoreSecretOnFailure(held.config.name, held.secret !== null, prior, () => this.mutate(async (file) => {
292
+ await this.deps.secrets.set(account, held.secret);
293
+ // (crew#1328 item 3) A save that changes a source's allowed views with no new description changes its projection key
294
+ // with no catalog written: it is named once the write lands, so its structure is projected again now.
295
+ let viewsChanged = false;
296
+ const saved = await this.restoreSecretOnFailure(account, held.secret !== null, prior, () => this.mutate(async (file) => {
275
297
  const prior = file.servers.find((s) => s.name === held.config.name);
298
+ const retiredNow = retiredBy(file.servers, held.config.name);
299
+ if (retiredNow !== undefined)
300
+ throw retiredName(held.config.name, retiredNow);
276
301
  // (DES-PM-001 §3) A PM entry stays the PM system it was registered as: a re-save that drops the marker, or
277
302
  // names another system, would hand its tools to the plain path (or its links to another vendor).
278
303
  const priorPm = prior === undefined ? null : pmOf(prior);
@@ -335,6 +360,10 @@ export class McpRegistry {
335
360
  registeredAt: prior?.registeredAt ?? stamp,
336
361
  updatedAt: stamp,
337
362
  tools,
363
+ // (crew#1514) A re-save keeps the names it retired and its keychain account (its own account for as long as it
364
+ // lives, whatever its reference names now: a re-save back to keychain:wicked-mcp/<account> owns it again).
365
+ ...(prior?.formerNames !== undefined && prior.formerNames.length > 0 ? { formerNames: [...prior.formerNames] } : {}),
366
+ ...(prior?.keychainAccount !== undefined ? { keychainAccount: prior.keychainAccount } : {}),
338
367
  };
339
368
  // (DES-APPS-001 §7.4, DES-KNOWLEDGE-DATA-001 §5.4) Allow writes is off on every new Postgres source, and
340
369
  // "query" on every new source. A re-save keeps each only while the descriptor is unchanged, and a K1
@@ -364,10 +393,24 @@ export class McpRegistry {
364
393
  // record and its description can never be paired with another save's.
365
394
  if (held.source !== null)
366
395
  await this.catalogs.write(record.name, { ...held.source, descriptorHash: sourceDescriptorHash(configOf(record)) });
396
+ const viewsOf = (r) => JSON.stringify([...new Set(r?.viewsAllowed ?? [])].sort());
397
+ viewsChanged = held.source === null && prior !== undefined && isSourceRecord(record) && viewsOf(prior) !== viewsOf(record);
367
398
  return record;
368
399
  }));
400
+ if (viewsChanged)
401
+ this.sourceChanged(saved.name);
369
402
  return this.view(saved);
370
403
  }
404
+ tombstoned(targets) {
405
+ if (targets.length === 0)
406
+ return;
407
+ try {
408
+ this.onTombstoned?.(targets);
409
+ }
410
+ catch {
411
+ // the listener's own failure; the tombstones are in the registry and the next reconcile sends them
412
+ }
413
+ }
371
414
  sourceChanged(name) {
372
415
  try {
373
416
  this.onSourceChanged?.(name);
@@ -521,26 +564,113 @@ export class McpRegistry {
521
564
  });
522
565
  return this.view(rec);
523
566
  }
524
- /** Remove a server, and the keychain secret it owns (`keychain:wicked-mcp/<name>`). */
567
+ /**
568
+ * (crew#1514) What {@link rename} would refuse now (the names, the entry, the new name taken or retired by another
569
+ * entry), checked before the caller moves any rule: a refused rename never lends another entry's rules to a live
570
+ * destination, even for a moment. {@link rename} checks again inside its write.
571
+ */
572
+ async checkRename(from, to) {
573
+ renameNameRefusal(from, to);
574
+ this.renameRefusal((await this.readFile()).servers, from, to);
575
+ }
576
+ /** The entry `from` names, or the refusal: crew's web source, `to` taken, or `to` retired by another entry. */
577
+ renameRefusal(servers, from, to) {
578
+ const s = this.find(servers, from);
579
+ if (s.kind === 'web')
580
+ throw new McpRegistryError(409, 'not_renamable', `${from} is crew's built-in web source: its name is fixed`);
581
+ const taken = servers.find((x) => x.name === to);
582
+ if (taken !== undefined)
583
+ throw new McpRegistryError(409, 'name_taken', `${to} is already a registered ${taken.kind} server; choose another name`);
584
+ const retiring = retiredBy(servers, to);
585
+ if (retiring !== undefined && retiring !== s)
586
+ throw retiredName(to, retiring);
587
+ return s;
588
+ }
589
+ /**
590
+ * (crew#1514) Rename an entry, keeping everything bound to it: its id, its secret reference (an owned keychain entry
591
+ * stays under the account it was saved as: `keychainAccount`), its tools, switches, grants, agents and links. `from`
592
+ * becomes one of its RETIRED names (`formerNames`): no other entry may take it while this one lives. Its stored
593
+ * description moves with it: copied inside the write, the old file removed once the write has landed (a failed write
594
+ * leaves no copy behind). Held previews of either name are dropped, so none saves over the renamed entry or under
595
+ * the retired name. The caller holds both names' policy locks and moves the rules (`McpPolicies`).
596
+ */
597
+ async rename(from, to) {
598
+ renameNameRefusal(from, to);
599
+ const stamp = new Date(this.now()).toISOString();
600
+ let copied = false;
601
+ let renamed;
602
+ try {
603
+ renamed = await this.mutate(async (file) => {
604
+ const s = this.renameRefusal(file.servers, from, to);
605
+ // The secret is never moved: `auth.ref` is part of the descriptor every grant and lock binds to. The entry's own
606
+ // account stays the name it had (retired with it), so no other entry can ever write it.
607
+ if (s.keychainAccount === undefined)
608
+ s.keychainAccount = s.name;
609
+ if (s.keychainAccount === to)
610
+ delete s.keychainAccount;
611
+ const former = [...new Set([...(s.formerNames ?? []).filter((n) => n !== to), from])];
612
+ s.formerNames = former;
613
+ s.name = to;
614
+ s.updatedAt = stamp;
615
+ if (isSourceRecord(s)) {
616
+ const d = await this.catalogs.read(from);
617
+ if (d !== null) {
618
+ await this.catalogs.write(to, d);
619
+ copied = true;
620
+ }
621
+ }
622
+ return s;
623
+ });
624
+ }
625
+ catch (err) {
626
+ if (copied)
627
+ await this.catalogs.remove(to).catch(() => undefined);
628
+ throw err;
629
+ }
630
+ if (copied)
631
+ await this.catalogs.remove(from).catch(() => undefined);
632
+ for (const [hash, held] of this.previews)
633
+ if (held.config.name === from || held.config.name === to)
634
+ this.previews.delete(hash);
635
+ if (isSourceRecord(renamed))
636
+ this.sourceChanged(to);
637
+ try {
638
+ return await this.view(renamed);
639
+ }
640
+ catch (err) {
641
+ // The rename has landed: the caller must not undo anything bound to it because its answer could not be built.
642
+ throw new McpRenameCommitted(from, to, err);
643
+ }
644
+ }
645
+ /** Remove a server, and the keychain secret it owns (`keychain:wicked-mcp/<name>`, or its `keychainAccount`). */
525
646
  async remove(name) {
526
- const removed = await this.mutate(async (file) => {
647
+ const { removed, tombstoned } = await this.mutate(async (file) => {
527
648
  const s = this.find(file.servers, name);
528
649
  file.servers = file.servers.filter((x) => x.name !== name);
529
650
  // Inside the mutation, serialized with every save and upload: a source saved under this name
530
651
  // next writes its catalog after this deletion, never before it.
531
652
  if (isSourceRecord(s))
532
653
  await this.catalogs.remove(name);
533
- return s;
654
+ // (crew#1328, crew#1354) What estate holds of it is erased, in this same write, so a restart never forgets it.
655
+ const ids = estateSourceIds(s);
656
+ addEstateTombstones(file, ids, new Date(this.now()).toISOString());
657
+ return { removed: s, tombstoned: ids };
534
658
  });
535
- if (removed.auth?.ref === keychainRef(name) && this.deps.secrets.available) {
659
+ this.tombstoned(tombstoned);
660
+ const account = ownAccount(removed);
661
+ // (crew#1514) A renamed entry owns its account for its whole life, whatever its reference names now (re-saved with
662
+ // an env secret, say): the secret under that account goes with it, when there is one.
663
+ const owned = removed.auth?.ref === keychainRef(account)
664
+ || (removed.keychainAccount !== undefined && this.deps.secrets.available && (await this.deps.secrets.has(account).catch(() => false)));
665
+ if (owned && this.deps.secrets.available) {
536
666
  try {
537
- await this.deps.secrets.delete(name);
667
+ await this.deps.secrets.delete(account);
538
668
  }
539
669
  catch (err) {
540
670
  // (crew#719) The row is already gone, so the secret is now unreachable by any route. Say
541
671
  // so — the alternative is a silent orphan in the operator's keychain.
542
672
  const why = err instanceof Error ? err.message : String(err);
543
- throw new McpRegistryError(500, 'secret_orphaned', `${name} was removed but its secret could not be deleted (${why}); remove the "${KEYCHAIN_SERVICE}" keychain entry for account "${name}" by hand`);
673
+ throw new McpRegistryError(500, 'secret_orphaned', `${name} was removed but its secret could not be deleted (${why}); remove the "${KEYCHAIN_SERVICE}" keychain entry for account "${account}" by hand`);
544
674
  }
545
675
  }
546
676
  }
@@ -562,6 +692,10 @@ export class McpRegistry {
562
692
  const t = s.tools.find((x) => x.name === parts.tool);
563
693
  if (t === undefined)
564
694
  throw new McpRegistryError(404, 'unknown_tool', `no tool ${subject}`);
695
+ // crew#1788: the patch was made against the schema the person saw; another save in between changed it.
696
+ if (patch.expectedSchemaHash !== undefined && t.schemaHash !== patch.expectedSchemaHash) {
697
+ throw new McpRegistryError(409, 'schema_changed', `${subject}'s saved schema changed since it was shown: read the tool again and review the new schema`);
698
+ }
565
699
  // (DES-KNOWLEDGE-DATA-001 §5.1) A disclosure class is reviewed by a human operator, against the schema the
566
700
  // operator saved; clearing one (the tool is offered to no agent) needs no review.
567
701
  if (patch.disclosure != null) {
@@ -657,20 +791,27 @@ export class McpRegistry {
657
791
  if (!this.deps.secrets.available) {
658
792
  throw new McpRegistryError(501, 'secret_store_unavailable', 'this platform has no OS secret store; reference a daemon env variable instead (auth.ref "env:<NAME>")');
659
793
  }
660
- const ref = keychainRef(name);
661
- // The route answers and audits the reference, so a value it contains would be echoed there.
662
- if (ref.includes(value))
663
- throw new McpRegistryError(400, 'secret_in_ref', 'the secret must not appear in its own reference; choose a different value');
664
794
  // (crew#719) RE-KEY ONLY. A secret written for a name no registered server references is an
665
795
  // orphan nothing can find again — a keychain service's entries cannot be enumerated — and it
666
796
  // was the first half of the non-atomic add: secret, then save, with a window between them.
667
797
  // A NEW server's secret is staged with its preview and committed by `save`.
798
+ // The route answers and audits the reference, so a value it contains would be echoed there (checked before the
799
+ // lookup, as ever, and again for a renamed entry's own account below).
800
+ const inRef = (r) => {
801
+ if (r.includes(value))
802
+ throw new McpRegistryError(400, 'secret_in_ref', 'the secret must not appear in its own reference; choose a different value');
803
+ };
804
+ inRef(keychainRef(name));
668
805
  const server = this.find((await this.readFile()).servers, name);
806
+ // (crew#1514) A renamed entry keeps the account it was saved under.
807
+ const account = ownAccount(server);
808
+ const ref = keychainRef(account);
809
+ inRef(ref);
669
810
  if (server.auth?.ref !== ref) {
670
811
  // The stored reference is a connection field: it is not echoed (an agent-kind caller reads errors too).
671
812
  throw new McpRegistryError(400, 'secret_not_referenced', `${name} does not reference ${ref}, so a secret stored there would be unreachable; stage it with the preview instead`);
672
813
  }
673
- await this.deps.secrets.set(name, value);
814
+ await this.deps.secrets.set(account, value);
674
815
  return ref;
675
816
  }
676
817
  /**
@@ -827,6 +968,9 @@ export class McpRegistry {
827
968
  const stamp = new Date(this.now()).toISOString();
828
969
  const rec = await this.mutate(async (file) => {
829
970
  const prior = file.servers.find((s) => s.name === name);
971
+ const retiring = retiredBy(file.servers, name);
972
+ if (retiring !== undefined)
973
+ throw retiredName(name, retiring);
830
974
  if (prior !== undefined && !(prior.kind === 'sql' && prior.sql?.driver === 'sqlite')) {
831
975
  throw new McpRegistryError(409, 'name_taken', `${name} is already a registered ${prior.kind} server; choose another name`);
832
976
  }
@@ -845,6 +989,9 @@ export class McpRegistry {
845
989
  registeredAt: prior?.registeredAt ?? stamp,
846
990
  updatedAt: stamp,
847
991
  tools: [],
992
+ // (crew#1514) A new upload of a renamed source keeps the names it retired.
993
+ ...(prior?.formerNames !== undefined && prior.formerNames.length > 0 ? { formerNames: [...prior.formerNames] } : {}),
994
+ ...(prior?.keychainAccount !== undefined ? { keychainAccount: prior.keychainAccount } : {}),
848
995
  // (DES-KNOWLEDGE-DATA-001 §7.1) A new upload of the same name keeps the person's agent switches; "query"
849
996
  // only when it is the same snapshot (a new digest is a new descriptor).
850
997
  ...(prior?.agents !== undefined ? { agents: { ...agentAccessOf(prior), query: agentAccessOf(prior).query && prior.sql?.snapshot === digest } } : {}),
@@ -864,6 +1011,9 @@ export class McpRegistry {
864
1011
  const stamp = new Date(this.now()).toISOString();
865
1012
  const rec = await this.mutate(async (file) => {
866
1013
  const prior = file.servers.find((s) => s.name === name);
1014
+ const retiring = retiredBy(file.servers, name);
1015
+ if (retiring !== undefined)
1016
+ throw retiredName(name, retiring);
867
1017
  if (prior !== undefined && prior.kind !== 'web')
868
1018
  throw new McpRegistryError(409, 'name_taken', `${name} is already a registered ${prior.kind} server; rename or remove it first`);
869
1019
  const other = file.servers.find((s) => s.kind === 'web' && s.name !== name);
@@ -927,6 +1077,9 @@ export class McpRegistry {
927
1077
  const why = err instanceof Error ? err.message : String(err);
928
1078
  throw new McpRegistryError(409, 'generation_unreadable', `generation ${generation} is not a registry crew can read: ${why}`);
929
1079
  }
1080
+ // (crew#1514) An entry the generation holds under another name than the live one was renamed since: the rules,
1081
+ // picks and keychain account follow the live name, so the restore is refused until it is renamed back.
1082
+ crossesRename(generation, servers, (await this.readFile()).servers);
930
1083
  for (const s of servers) {
931
1084
  if (s.kind !== 'toolbox-source')
932
1085
  continue;
@@ -977,15 +1130,25 @@ export class McpRegistry {
977
1130
  s.health = { ...s.health, checkedAt: stamp, lastError: `secret_missing: ${s.auth.ref} resolves to no secret; set it, then switch ${s.name} on` };
978
1131
  s.updatedAt = stamp;
979
1132
  }
980
- const current = await this.mutate((file) => {
1133
+ const { current, tombstoned } = await this.mutate((file) => {
1134
+ // (crew#1514) Again inside the write: a rename that landed after the plan was made is not undone by it.
1135
+ crossesRename(plan.generation, servers, file.servers);
981
1136
  if (expected !== undefined) {
982
1137
  const late = file.servers.map((s) => s.name).filter((n) => !expected.includes(n));
983
1138
  if (late.length > 0)
984
1139
  throw new McpRegistryError(409, 'registry_busy', `${late.join(', ')} was registered while the restore ran; nothing was restored: try again`);
985
1140
  }
1141
+ // (crew#1328, crew#1354) A source or tracker the restored generation does not hold is erased from estate too; one
1142
+ // it brings back is not (its own projection replaces what estate holds).
1143
+ const kept = servers.flatMap(estateSourceIds);
1144
+ const dropped = file.servers.flatMap(estateSourceIds).filter((t) => !kept.some((k) => k.id === t.id && k.kind === t.kind));
1145
+ for (const kind of ['source', 'tracker'])
1146
+ dropEstateTombstones(file, kind, new Set(kept.filter((k) => k.kind === kind).map((k) => k.id)));
1147
+ addEstateTombstones(file, dropped, stamp);
986
1148
  file.servers = servers;
987
- return file.generation ?? 0;
1149
+ return { current: file.generation ?? 0, tombstoned: dropped };
988
1150
  });
1151
+ this.tombstoned(tombstoned);
989
1152
  for (const s of servers)
990
1153
  if (isSourceRecord(s))
991
1154
  this.sourceChanged(s.name);
@@ -1142,6 +1305,8 @@ export class McpRegistry {
1142
1305
  ...(isPostgresRecord(s) ? { allowWrites: s.allowWrites === true } : {}),
1143
1306
  ...(isSource ? { descriptorHash: sourceDescriptorHash(configOf(s)), agents: agentAccessOf(s) } : {}),
1144
1307
  ...(pm !== null ? { agents: agentAccessOf(s), trackers: this.trackerLinksOf(s) } : {}),
1308
+ ...(s.formerNames !== undefined && s.formerNames.length > 0 ? { formerNames: [...s.formerNames] } : {}),
1309
+ ...(s.keychainAccount !== undefined ? { keychainAccount: s.keychainAccount } : {}),
1145
1310
  authState: await this.authState(s.auth),
1146
1311
  enabled: s.enabled,
1147
1312
  health: s.health,
@@ -1346,7 +1511,48 @@ export function diffTools(registered, probed) {
1346
1511
  diff.removed.push(t.name);
1347
1512
  return diff;
1348
1513
  }
1349
- // ── The one registry's entry (DES-KNOWLEDGE-DATA-001 §5) ─────────────────────────────────────────
1514
+ /**
1515
+ * (crew#1328, crew#1354) The estate source ids a record's structure lives under: a data source's entry id (its
1516
+ * projected catalog), and a PM entry's trackers, retired ones included.
1517
+ */
1518
+ export function estateSourceIds(s) {
1519
+ const out = [];
1520
+ if (isSourceRecord(s))
1521
+ out.push({ id: entryId(s), kind: 'source' });
1522
+ if (pmOf(s) !== null) {
1523
+ for (const t of trackersOf(s))
1524
+ out.push({ id: t.id, kind: 'tracker' });
1525
+ for (const r of s.retired ?? [])
1526
+ out.push({ id: r.id, kind: 'tracker' });
1527
+ }
1528
+ return out;
1529
+ }
1530
+ /**
1531
+ * Add `targets` to the registry's tombstones. An id already waiting keeps its tombstone (its writer erases by id, after
1532
+ * reading the registry, so one is enough); nothing is ever evicted (codex on #1735: a dropped one is never erased).
1533
+ */
1534
+ export function addEstateTombstones(file, targets, at) {
1535
+ const list = file.estateTombstones ?? [];
1536
+ for (const t of targets)
1537
+ if (!list.some((x) => x.id === t.id && x.kind === t.kind))
1538
+ list.push({ id: t.id, kind: t.kind, at });
1539
+ if (list.length > 0)
1540
+ file.estateTombstones = list;
1541
+ }
1542
+ /**
1543
+ * Drop the tombstones of `kind` whose id `settled` names (their writer erased them, or the id is live again). Answers
1544
+ * whether any was dropped (crew#1740: a writer that drops none writes nothing).
1545
+ */
1546
+ export function dropEstateTombstones(file, kind, settled) {
1547
+ if (file.estateTombstones === undefined)
1548
+ return false;
1549
+ const before = file.estateTombstones.length;
1550
+ file.estateTombstones = file.estateTombstones.filter((t) => t.kind !== kind || !settled.has(t.id));
1551
+ const changed = file.estateTombstones.length !== before;
1552
+ if (file.estateTombstones.length === 0)
1553
+ delete file.estateTombstones;
1554
+ return changed;
1555
+ }
1350
1556
  /** A data source of any form: K1 `sql`/`graphql`, or a Toolbox-form database source. */
1351
1557
  export function isSourceRecord(s) {
1352
1558
  return s.kind === 'sql' || s.kind === 'graphql' || s.kind === 'toolbox-source';
@@ -1373,6 +1579,74 @@ export function isPostgresRecord(s) {
1373
1579
  return s.toolbox?.type === 'postgres';
1374
1580
  return s.kind === 'sql' && s.sql?.driver === 'postgres';
1375
1581
  }
1582
+ /** (crew#1514) A rename committed, but its answer could not be built (the record is read again by the caller). */
1583
+ export class McpRenameCommitted extends Error {
1584
+ from;
1585
+ to;
1586
+ cause;
1587
+ constructor(from, to, cause) {
1588
+ super(`${from} was renamed to ${to}, but its record could not be read back: ${cause instanceof Error ? cause.message : String(cause)}`);
1589
+ this.from = from;
1590
+ this.to = to;
1591
+ this.cause = cause;
1592
+ }
1593
+ }
1594
+ /**
1595
+ * (crew#1514) Refuse a restore that would undo a rename (409 `restore_crosses_rename`): an entry the generation holds
1596
+ * under another name, or with other retired names or another keychain account, than the live one; or an entry whose
1597
+ * name a live entry has retired. The rules, picks and keychain account follow the live names.
1598
+ */
1599
+ function crossesRename(generation, kept, live) {
1600
+ const names = (l) => [...new Set(l ?? [])].sort().join(',');
1601
+ const crossed = [];
1602
+ for (const s of kept) {
1603
+ const l = live.find((x) => entryId(x) === entryId(s));
1604
+ if (l !== undefined && (l.name !== s.name || names(l.formerNames) !== names(s.formerNames) || l.keychainAccount !== s.keychainAccount)) {
1605
+ crossed.push(l.name !== s.name ? `${l.name} (was ${s.name})` : `${l.name} (renamed since)`);
1606
+ continue;
1607
+ }
1608
+ const by = live.find((x) => entryId(x) !== entryId(s) && (x.formerNames ?? []).includes(s.name));
1609
+ if (by !== undefined)
1610
+ crossed.push(`${s.name} (a name ${by.name} retired)`);
1611
+ }
1612
+ if (crossed.length > 0) {
1613
+ throw new McpRegistryError(409, 'restore_crosses_rename', `generation ${generation} would undo a rename: ${crossed.join(', ')}. A restore keeps every entry's current name, retired names and keychain account, so pick a generation saved since the rename`);
1614
+ }
1615
+ }
1616
+ /** (crew#1514) The new name's own refusals: its form, crew's reserved names, and no change. */
1617
+ function renameNameRefusal(from, to) {
1618
+ if (!MCP_SERVER_NAME_RE.test(to))
1619
+ throw new McpRegistryError(400, 'bad_name', 'a name is 1-63 of a-z 0-9 _ -, starting with a letter or digit');
1620
+ if (to === APPS_SERVER || to === ESTATE_SERVER || to === CREW_SOURCE || to === 'web') {
1621
+ throw new McpRegistryError(409, 'reserved_name', `"${to}" is reserved for crew's own ${to === 'web' ? 'web source' : to === CREW_SOURCE ? 'crew source' : `${to} server`}; choose another name`);
1622
+ }
1623
+ if (from === to)
1624
+ throw new McpRegistryError(409, 'name_unchanged', `${from} already has that name`);
1625
+ }
1626
+ /** (crew#1514) The keychain account a record's own secret lives under: the name it was saved as. */
1627
+ export function ownAccount(s) {
1628
+ return s.keychainAccount ?? s.name;
1629
+ }
1630
+ /** (crew#1514) The live entry that retired `name` (was renamed away from it), or `undefined`. */
1631
+ export function retiredBy(servers, name) {
1632
+ return servers.find((s) => s.name !== name && (s.formerNames ?? []).includes(name));
1633
+ }
1634
+ function retiredName(name, by) {
1635
+ return new McpRegistryError(409, 'name_retired', `${name} was renamed to ${by.name}, so the name stays retired while ${by.name} exists; choose another name, or rename ${by.name} back to ${name}`);
1636
+ }
1637
+ /**
1638
+ * (crew#1514) The keychain account a held preview's staged secret goes to: the one its reference names, which the
1639
+ * preview checked was the server's own. Re-judged at the save against the entry as it is now.
1640
+ */
1641
+ function stagedAccount(config, existing) {
1642
+ const parsed = config.auth === null ? null : parseSecretRef(config.auth.ref);
1643
+ const account = parsed?.kind === 'keychain' ? parsed.account : null;
1644
+ const own = existing !== undefined ? ownAccount(existing) : config.name;
1645
+ if (account === null || account !== own) {
1646
+ throw new McpRegistryError(409, 'server_changed', `${config.name} changed since it was previewed (its keychain entry is now "${own}"): preview it again, then save`);
1647
+ }
1648
+ return account;
1649
+ }
1376
1650
  /** A record's id; one read through {@link normalizeRegistryFile} always has it. */
1377
1651
  export function entryId(s) {
1378
1652
  return s.id ?? legacyEntryId(s.name, s.registeredAt);