wicked-crew 0.18.19 → 0.18.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (700) hide show
  1. package/README.md +9 -6
  2. package/dist/api/ask-paths.d.ts +2 -0
  3. package/dist/api/ask-paths.d.ts.map +1 -1
  4. package/dist/api/ask-paths.js +6 -0
  5. package/dist/api/ask-paths.js.map +1 -1
  6. package/dist/api/auth.d.ts +7 -5
  7. package/dist/api/auth.d.ts.map +1 -1
  8. package/dist/api/auth.js +23 -9
  9. package/dist/api/auth.js.map +1 -1
  10. package/dist/api/capture.d.ts +5 -2
  11. package/dist/api/capture.d.ts.map +1 -1
  12. package/dist/api/capture.js +13 -10
  13. package/dist/api/capture.js.map +1 -1
  14. package/dist/api/chat-attachments.d.ts.map +1 -1
  15. package/dist/api/chat-attachments.js +69 -19
  16. package/dist/api/chat-attachments.js.map +1 -1
  17. package/dist/api/chat-citations.d.ts.map +1 -1
  18. package/dist/api/chat-citations.js +22 -0
  19. package/dist/api/chat-citations.js.map +1 -1
  20. package/dist/api/chat-context.d.ts +16 -1
  21. package/dist/api/chat-context.d.ts.map +1 -1
  22. package/dist/api/chat-context.js +75 -14
  23. package/dist/api/chat-context.js.map +1 -1
  24. package/dist/api/chat-freshness.js +2 -2
  25. package/dist/api/chat-freshness.js.map +1 -1
  26. package/dist/api/chat-history.d.ts +13 -0
  27. package/dist/api/chat-history.d.ts.map +1 -1
  28. package/dist/api/chat-history.js +25 -0
  29. package/dist/api/chat-history.js.map +1 -1
  30. package/dist/api/chat-jobs.d.ts +67 -6
  31. package/dist/api/chat-jobs.d.ts.map +1 -1
  32. package/dist/api/chat-jobs.js +243 -22
  33. package/dist/api/chat-jobs.js.map +1 -1
  34. package/dist/api/chat-proposals.d.ts +69 -6
  35. package/dist/api/chat-proposals.d.ts.map +1 -1
  36. package/dist/api/chat-proposals.js +310 -49
  37. package/dist/api/chat-proposals.js.map +1 -1
  38. package/dist/api/chat-requirements.d.ts.map +1 -1
  39. package/dist/api/chat-requirements.js +4 -1
  40. package/dist/api/chat-requirements.js.map +1 -1
  41. package/dist/api/chat-scope.d.ts +17 -9
  42. package/dist/api/chat-scope.d.ts.map +1 -1
  43. package/dist/api/chat-scope.js +55 -21
  44. package/dist/api/chat-scope.js.map +1 -1
  45. package/dist/api/cluster-status.d.ts +24 -12
  46. package/dist/api/cluster-status.d.ts.map +1 -1
  47. package/dist/api/cluster-status.js +82 -4
  48. package/dist/api/cluster-status.js.map +1 -1
  49. package/dist/api/codebase-archive.d.ts +4 -3
  50. package/dist/api/codebase-archive.d.ts.map +1 -1
  51. package/dist/api/codebase-archive.js +6 -5
  52. package/dist/api/codebase-archive.js.map +1 -1
  53. package/dist/api/delivery-cache.d.ts +2 -0
  54. package/dist/api/delivery-cache.d.ts.map +1 -1
  55. package/dist/api/delivery-cache.js +1 -2
  56. package/dist/api/delivery-cache.js.map +1 -1
  57. package/dist/api/delivery-index.d.ts +2 -2
  58. package/dist/api/delivery-index.d.ts.map +1 -1
  59. package/dist/api/delivery-index.js +1 -2
  60. package/dist/api/delivery-index.js.map +1 -1
  61. package/dist/api/eval-compare.d.ts +1 -1
  62. package/dist/api/eval-compare.js +1 -1
  63. package/dist/api/eval-sample.d.ts +7 -0
  64. package/dist/api/eval-sample.d.ts.map +1 -1
  65. package/dist/api/eval-sample.js +20 -0
  66. package/dist/api/eval-sample.js.map +1 -1
  67. package/dist/api/gate-cache.d.ts +1 -0
  68. package/dist/api/gate-cache.d.ts.map +1 -1
  69. package/dist/api/gate-cache.js +19 -6
  70. package/dist/api/gate-cache.js.map +1 -1
  71. package/dist/api/governance-steering.d.ts +17 -4
  72. package/dist/api/governance-steering.d.ts.map +1 -1
  73. package/dist/api/governance-steering.js +56 -7
  74. package/dist/api/governance-steering.js.map +1 -1
  75. package/dist/api/mcp.d.ts +12 -2
  76. package/dist/api/mcp.d.ts.map +1 -1
  77. package/dist/api/mcp.js +56 -12
  78. package/dist/api/mcp.js.map +1 -1
  79. package/dist/api/needs.d.ts +20 -0
  80. package/dist/api/needs.d.ts.map +1 -1
  81. package/dist/api/needs.js +120 -19
  82. package/dist/api/needs.js.map +1 -1
  83. package/dist/api/onboarding-capture.d.ts +21 -1
  84. package/dist/api/onboarding-capture.d.ts.map +1 -1
  85. package/dist/api/onboarding-capture.js +112 -8
  86. package/dist/api/onboarding-capture.js.map +1 -1
  87. package/dist/api/policy-landing.d.ts +36 -0
  88. package/dist/api/policy-landing.d.ts.map +1 -1
  89. package/dist/api/policy-landing.js +123 -4
  90. package/dist/api/policy-landing.js.map +1 -1
  91. package/dist/api/post-hoc-deliver.d.ts.map +1 -1
  92. package/dist/api/post-hoc-deliver.js +2 -1
  93. package/dist/api/post-hoc-deliver.js.map +1 -1
  94. package/dist/api/product.d.ts +1 -1
  95. package/dist/api/proposal-decisions.d.ts +44 -0
  96. package/dist/api/proposal-decisions.d.ts.map +1 -0
  97. package/dist/api/proposal-decisions.js +85 -0
  98. package/dist/api/proposal-decisions.js.map +1 -0
  99. package/dist/api/proposal-onboard.d.ts +38 -1
  100. package/dist/api/proposal-onboard.d.ts.map +1 -1
  101. package/dist/api/proposal-onboard.js +203 -14
  102. package/dist/api/proposal-onboard.js.map +1 -1
  103. package/dist/api/recording.d.ts +1 -1
  104. package/dist/api/recording.d.ts.map +1 -1
  105. package/dist/api/recording.js +4 -5
  106. package/dist/api/recording.js.map +1 -1
  107. package/dist/api/redeliver.d.ts.map +1 -1
  108. package/dist/api/redeliver.js +11 -7
  109. package/dist/api/redeliver.js.map +1 -1
  110. package/dist/api/repo-input.d.ts.map +1 -1
  111. package/dist/api/repo-input.js +5 -2
  112. package/dist/api/repo-input.js.map +1 -1
  113. package/dist/api/repo-origins.d.ts +24 -0
  114. package/dist/api/repo-origins.d.ts.map +1 -0
  115. package/dist/api/repo-origins.js +71 -0
  116. package/dist/api/repo-origins.js.map +1 -0
  117. package/dist/api/requirements.d.ts +37 -16
  118. package/dist/api/requirements.d.ts.map +1 -1
  119. package/dist/api/requirements.js +73 -2
  120. package/dist/api/requirements.js.map +1 -1
  121. package/dist/api/retry-index.d.ts +2 -0
  122. package/dist/api/retry-index.d.ts.map +1 -1
  123. package/dist/api/retry-index.js +16 -8
  124. package/dist/api/retry-index.js.map +1 -1
  125. package/dist/api/review-change.d.ts +5 -6
  126. package/dist/api/review-change.d.ts.map +1 -1
  127. package/dist/api/review-change.js +45 -8
  128. package/dist/api/review-change.js.map +1 -1
  129. package/dist/api/roster-standing.d.ts +2 -0
  130. package/dist/api/roster-standing.d.ts.map +1 -1
  131. package/dist/api/roster-standing.js +8 -1
  132. package/dist/api/roster-standing.js.map +1 -1
  133. package/dist/api/routes.d.ts +55 -12
  134. package/dist/api/routes.d.ts.map +1 -1
  135. package/dist/api/routes.js +961 -277
  136. package/dist/api/routes.js.map +1 -1
  137. package/dist/api/run-documents.d.ts +9 -1
  138. package/dist/api/run-documents.d.ts.map +1 -1
  139. package/dist/api/run-documents.js +63 -5
  140. package/dist/api/run-documents.js.map +1 -1
  141. package/dist/api/run-sources.d.ts +11 -1
  142. package/dist/api/run-sources.d.ts.map +1 -1
  143. package/dist/api/run-sources.js +26 -3
  144. package/dist/api/run-sources.js.map +1 -1
  145. package/dist/api/run-timing-index.d.ts +47 -0
  146. package/dist/api/run-timing-index.d.ts.map +1 -1
  147. package/dist/api/run-timing-index.js +196 -86
  148. package/dist/api/run-timing-index.js.map +1 -1
  149. package/dist/api/runtime-state.d.ts +6 -0
  150. package/dist/api/runtime-state.d.ts.map +1 -1
  151. package/dist/api/runtime-state.js +14 -3
  152. package/dist/api/runtime-state.js.map +1 -1
  153. package/dist/api/seat-agents.d.ts.map +1 -1
  154. package/dist/api/seat-agents.js +3 -3
  155. package/dist/api/seat-agents.js.map +1 -1
  156. package/dist/api/seat-container-login.d.ts +6 -2
  157. package/dist/api/seat-container-login.d.ts.map +1 -1
  158. package/dist/api/seat-container-login.js +17 -9
  159. package/dist/api/seat-container-login.js.map +1 -1
  160. package/dist/api/seat-governance.d.ts +3 -2
  161. package/dist/api/seat-governance.d.ts.map +1 -1
  162. package/dist/api/seat-governance.js +31 -9
  163. package/dist/api/seat-governance.js.map +1 -1
  164. package/dist/api/seat-standing.d.ts +8 -0
  165. package/dist/api/seat-standing.d.ts.map +1 -1
  166. package/dist/api/seat-standing.js +26 -1
  167. package/dist/api/seat-standing.js.map +1 -1
  168. package/dist/api/server.d.ts +7 -0
  169. package/dist/api/server.d.ts.map +1 -1
  170. package/dist/api/server.js +172 -59
  171. package/dist/api/server.js.map +1 -1
  172. package/dist/api/stall-watchdog.d.ts +6 -0
  173. package/dist/api/stall-watchdog.d.ts.map +1 -1
  174. package/dist/api/stall-watchdog.js +28 -0
  175. package/dist/api/stall-watchdog.js.map +1 -1
  176. package/dist/api/start-on-login.d.ts +4 -0
  177. package/dist/api/start-on-login.d.ts.map +1 -0
  178. package/dist/api/start-on-login.js +35 -0
  179. package/dist/api/start-on-login.js.map +1 -0
  180. package/dist/api/steering-landing.d.ts +33 -8
  181. package/dist/api/steering-landing.d.ts.map +1 -1
  182. package/dist/api/steering-landing.js +235 -51
  183. package/dist/api/steering-landing.js.map +1 -1
  184. package/dist/api/system-snapshot.d.ts +5 -0
  185. package/dist/api/system-snapshot.d.ts.map +1 -1
  186. package/dist/api/system-snapshot.js +22 -10
  187. package/dist/api/system-snapshot.js.map +1 -1
  188. package/dist/api/testing.d.ts +2 -2
  189. package/dist/api/ui-text.js +2 -2
  190. package/dist/api/ui-text.js.map +1 -1
  191. package/dist/api/worktree-sweep.d.ts +7 -3
  192. package/dist/api/worktree-sweep.d.ts.map +1 -1
  193. package/dist/api/worktree-sweep.js +10 -6
  194. package/dist/api/worktree-sweep.js.map +1 -1
  195. package/dist/apps/actions/api-action.js +5 -2
  196. package/dist/apps/actions/api-action.js.map +1 -1
  197. package/dist/apps/actions/write-path.d.ts +9 -0
  198. package/dist/apps/actions/write-path.d.ts.map +1 -1
  199. package/dist/apps/actions/write-path.js +17 -9
  200. package/dist/apps/actions/write-path.js.map +1 -1
  201. package/dist/apps/exec/executor.d.ts +8 -15
  202. package/dist/apps/exec/executor.d.ts.map +1 -1
  203. package/dist/apps/exec/executor.js +10 -3
  204. package/dist/apps/exec/executor.js.map +1 -1
  205. package/dist/apps/exec/recall.d.ts.map +1 -1
  206. package/dist/apps/exec/recall.js +4 -4
  207. package/dist/apps/exec/recall.js.map +1 -1
  208. package/dist/apps/exec/redescribe.d.ts +37 -0
  209. package/dist/apps/exec/redescribe.d.ts.map +1 -0
  210. package/dist/apps/exec/redescribe.js +86 -0
  211. package/dist/apps/exec/redescribe.js.map +1 -0
  212. package/dist/apps/exec/source-stage.d.ts +3 -1
  213. package/dist/apps/exec/source-stage.d.ts.map +1 -1
  214. package/dist/apps/exec/source-stage.js +13 -3
  215. package/dist/apps/exec/source-stage.js.map +1 -1
  216. package/dist/apps/exec/sources.d.ts +6 -0
  217. package/dist/apps/exec/sources.d.ts.map +1 -1
  218. package/dist/apps/exec/sources.js +8 -0
  219. package/dist/apps/exec/sources.js.map +1 -1
  220. package/dist/apps/git.js +2 -2
  221. package/dist/apps/git.js.map +1 -1
  222. package/dist/apps/publish/manifest.d.ts +8 -1
  223. package/dist/apps/publish/manifest.d.ts.map +1 -1
  224. package/dist/apps/publish/manifest.js +14 -3
  225. package/dist/apps/publish/manifest.js.map +1 -1
  226. package/dist/apps/publish/run.d.ts +15 -2
  227. package/dist/apps/publish/run.d.ts.map +1 -1
  228. package/dist/apps/publish/run.js +100 -17
  229. package/dist/apps/publish/run.js.map +1 -1
  230. package/dist/apps/routes.d.ts +3 -0
  231. package/dist/apps/routes.d.ts.map +1 -1
  232. package/dist/apps/routes.js +58 -2
  233. package/dist/apps/routes.js.map +1 -1
  234. package/dist/apps/store.d.ts +24 -3
  235. package/dist/apps/store.d.ts.map +1 -1
  236. package/dist/apps/store.js +26 -9
  237. package/dist/apps/store.js.map +1 -1
  238. package/dist/apps/turns.d.ts +25 -2
  239. package/dist/apps/turns.d.ts.map +1 -1
  240. package/dist/apps/turns.js +276 -11
  241. package/dist/apps/turns.js.map +1 -1
  242. package/dist/apps-server/Dockerfile +2 -2
  243. package/dist/apps-server/runners/sqlite-runner.mjs +67 -12
  244. package/dist/apps-server/server/lib/bundle/server.mjs +353 -159
  245. package/dist/cli/governance.d.ts +5 -2
  246. package/dist/cli/governance.d.ts.map +1 -1
  247. package/dist/cli/governance.js +8 -5
  248. package/dist/cli/governance.js.map +1 -1
  249. package/dist/cli/index.d.ts.map +1 -1
  250. package/dist/cli/index.js +6 -5
  251. package/dist/cli/index.js.map +1 -1
  252. package/dist/cli/service.d.ts +10 -6
  253. package/dist/cli/service.d.ts.map +1 -1
  254. package/dist/cli/service.js +39 -23
  255. package/dist/cli/service.js.map +1 -1
  256. package/dist/core/adapter.d.ts +61 -29
  257. package/dist/core/adapter.d.ts.map +1 -1
  258. package/dist/core/adapter.js +214 -83
  259. package/dist/core/adapter.js.map +1 -1
  260. package/dist/core/ado-deliver-helper.d.ts +2 -1
  261. package/dist/core/ado-deliver-helper.d.ts.map +1 -1
  262. package/dist/core/ado-deliver-helper.js +26 -1
  263. package/dist/core/ado-deliver-helper.js.map +1 -1
  264. package/dist/core/assurance.d.ts +45 -42
  265. package/dist/core/assurance.d.ts.map +1 -1
  266. package/dist/core/assurance.js +74 -67
  267. package/dist/core/assurance.js.map +1 -1
  268. package/dist/core/deliver-text.d.ts +14 -0
  269. package/dist/core/deliver-text.d.ts.map +1 -1
  270. package/dist/core/deliver-text.js +41 -2
  271. package/dist/core/deliver-text.js.map +1 -1
  272. package/dist/core/deliver.d.ts +66 -1
  273. package/dist/core/deliver.d.ts.map +1 -1
  274. package/dist/core/deliver.js +183 -10
  275. package/dist/core/deliver.js.map +1 -1
  276. package/dist/core/engine-roster.d.ts +2 -0
  277. package/dist/core/engine-roster.d.ts.map +1 -1
  278. package/dist/core/engine-roster.js +13 -0
  279. package/dist/core/engine-roster.js.map +1 -1
  280. package/dist/core/estate-mcp-client.d.ts +13 -14
  281. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  282. package/dist/core/estate-mcp-client.js +49 -68
  283. package/dist/core/estate-mcp-client.js.map +1 -1
  284. package/dist/core/exec.d.ts +24 -0
  285. package/dist/core/exec.d.ts.map +1 -1
  286. package/dist/core/exec.js +45 -2
  287. package/dist/core/exec.js.map +1 -1
  288. package/dist/core/linked-issues.d.ts +13 -2
  289. package/dist/core/linked-issues.d.ts.map +1 -1
  290. package/dist/core/linked-issues.js +135 -4
  291. package/dist/core/linked-issues.js.map +1 -1
  292. package/dist/core/pr-checks-helper.d.ts +8 -4
  293. package/dist/core/pr-checks-helper.d.ts.map +1 -1
  294. package/dist/core/pr-checks-helper.js +39 -17
  295. package/dist/core/pr-checks-helper.js.map +1 -1
  296. package/dist/core/redeliver.js +2 -2
  297. package/dist/core/redeliver.js.map +1 -1
  298. package/dist/core/repo-clone.d.ts +64 -0
  299. package/dist/core/repo-clone.d.ts.map +1 -0
  300. package/dist/core/repo-clone.js +306 -0
  301. package/dist/core/repo-clone.js.map +1 -0
  302. package/dist/core/repoPaths.d.ts +2 -4
  303. package/dist/core/repoPaths.d.ts.map +1 -1
  304. package/dist/core/repoPaths.js +4 -6
  305. package/dist/core/repoPaths.js.map +1 -1
  306. package/dist/core/run-identity.d.ts.map +1 -1
  307. package/dist/core/run-identity.js +3 -0
  308. package/dist/core/run-identity.js.map +1 -1
  309. package/dist/core/run-read-lane.d.ts +30 -0
  310. package/dist/core/run-read-lane.d.ts.map +1 -0
  311. package/dist/core/run-read-lane.js +103 -0
  312. package/dist/core/run-read-lane.js.map +1 -0
  313. package/dist/core/types.d.ts +10 -0
  314. package/dist/core/types.d.ts.map +1 -1
  315. package/dist/core/types.js +2 -0
  316. package/dist/core/types.js.map +1 -1
  317. package/dist/core/walkthrough-root.d.ts.map +1 -1
  318. package/dist/core/walkthrough-root.js +3 -5
  319. package/dist/core/walkthrough-root.js.map +1 -1
  320. package/dist/core/wicked-home.d.ts +9 -0
  321. package/dist/core/wicked-home.d.ts.map +1 -0
  322. package/dist/core/wicked-home.js +25 -0
  323. package/dist/core/wicked-home.js.map +1 -0
  324. package/dist/decisions/consider.d.ts +2 -1
  325. package/dist/decisions/consider.d.ts.map +1 -1
  326. package/dist/decisions/consider.js +2 -2
  327. package/dist/decisions/consider.js.map +1 -1
  328. package/dist/decisions/land.d.ts +2 -0
  329. package/dist/decisions/land.d.ts.map +1 -1
  330. package/dist/decisions/land.js +16 -3
  331. package/dist/decisions/land.js.map +1 -1
  332. package/dist/decisions/rules-brief.d.ts +4 -1
  333. package/dist/decisions/rules-brief.d.ts.map +1 -1
  334. package/dist/decisions/rules-brief.js +3 -2
  335. package/dist/decisions/rules-brief.js.map +1 -1
  336. package/dist/editors/conformance-runtime.d.ts +0 -2
  337. package/dist/editors/conformance-runtime.d.ts.map +1 -1
  338. package/dist/editors/conformance-runtime.js +0 -4
  339. package/dist/editors/conformance-runtime.js.map +1 -1
  340. package/dist/editors/csp.d.ts +6 -0
  341. package/dist/editors/csp.d.ts.map +1 -1
  342. package/dist/editors/csp.js +10 -0
  343. package/dist/editors/csp.js.map +1 -1
  344. package/dist/editors/pack-install.d.ts +11 -15
  345. package/dist/editors/pack-install.d.ts.map +1 -1
  346. package/dist/editors/pack-install.js +52 -65
  347. package/dist/editors/pack-install.js.map +1 -1
  348. package/dist/editors/registry.d.ts +31 -13
  349. package/dist/editors/registry.d.ts.map +1 -1
  350. package/dist/editors/registry.js +51 -18
  351. package/dist/editors/registry.js.map +1 -1
  352. package/dist/editors/routes.d.ts +4 -2
  353. package/dist/editors/routes.d.ts.map +1 -1
  354. package/dist/editors/routes.js +23 -6
  355. package/dist/editors/routes.js.map +1 -1
  356. package/dist/editors/visuals.d.ts +4 -3
  357. package/dist/editors/visuals.d.ts.map +1 -1
  358. package/dist/editors/visuals.js +17 -7
  359. package/dist/editors/visuals.js.map +1 -1
  360. package/dist/evals/runner.js +1 -1
  361. package/dist/evals/runner.js.map +1 -1
  362. package/dist/evals/shape-corrections.js +1 -1
  363. package/dist/evals/shape-corrections.js.map +1 -1
  364. package/dist/evals/shape.d.ts +7 -1
  365. package/dist/evals/shape.d.ts.map +1 -1
  366. package/dist/evals/shape.js +26 -6
  367. package/dist/evals/shape.js.map +1 -1
  368. package/dist/evals/workflow.d.ts +16 -3
  369. package/dist/evals/workflow.d.ts.map +1 -1
  370. package/dist/evals/workflow.js +32 -6
  371. package/dist/evals/workflow.js.map +1 -1
  372. package/dist/governance/rule-revision.d.ts +7 -0
  373. package/dist/governance/rule-revision.d.ts.map +1 -0
  374. package/dist/governance/rule-revision.js +23 -0
  375. package/dist/governance/rule-revision.js.map +1 -0
  376. package/dist/insights/review-service.d.ts +26 -3
  377. package/dist/insights/review-service.d.ts.map +1 -1
  378. package/dist/insights/review-service.js +101 -11
  379. package/dist/insights/review-service.js.map +1 -1
  380. package/dist/insights/routes.d.ts +2 -1
  381. package/dist/insights/routes.d.ts.map +1 -1
  382. package/dist/insights/routes.js +19 -4
  383. package/dist/insights/routes.js.map +1 -1
  384. package/dist/insights/run-facts.d.ts +5 -0
  385. package/dist/insights/run-facts.d.ts.map +1 -1
  386. package/dist/insights/run-facts.js +15 -0
  387. package/dist/insights/run-facts.js.map +1 -1
  388. package/dist/insights/workflow.d.ts +2 -1
  389. package/dist/insights/workflow.d.ts.map +1 -1
  390. package/dist/insights/workflow.js +4 -4
  391. package/dist/insights/workflow.js.map +1 -1
  392. package/dist/inspect/service.d.ts +3 -2
  393. package/dist/inspect/service.d.ts.map +1 -1
  394. package/dist/inspect/service.js +4 -4
  395. package/dist/inspect/service.js.map +1 -1
  396. package/dist/interactive/bridge-pool.d.ts +2 -0
  397. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  398. package/dist/interactive/bridge-pool.js +18 -8
  399. package/dist/interactive/bridge-pool.js.map +1 -1
  400. package/dist/interactive/chat-events.d.ts +3 -0
  401. package/dist/interactive/chat-events.d.ts.map +1 -1
  402. package/dist/interactive/chat-events.js +20 -5
  403. package/dist/interactive/chat-events.js.map +1 -1
  404. package/dist/interactive/doc-delete-routes.d.ts +1 -0
  405. package/dist/interactive/doc-delete-routes.d.ts.map +1 -1
  406. package/dist/interactive/doc-delete-routes.js +126 -123
  407. package/dist/interactive/doc-delete-routes.js.map +1 -1
  408. package/dist/interactive/draft-events.d.ts +11 -7
  409. package/dist/interactive/draft-events.d.ts.map +1 -1
  410. package/dist/interactive/draft-events.js +29 -22
  411. package/dist/interactive/draft-events.js.map +1 -1
  412. package/dist/interactive/draft-skill.d.ts +56 -3
  413. package/dist/interactive/draft-skill.d.ts.map +1 -1
  414. package/dist/interactive/draft-skill.js +129 -20
  415. package/dist/interactive/draft-skill.js.map +1 -1
  416. package/dist/interactive/landing-guard.d.ts +30 -5
  417. package/dist/interactive/landing-guard.d.ts.map +1 -1
  418. package/dist/interactive/landing-guard.js +121 -5
  419. package/dist/interactive/landing-guard.js.map +1 -1
  420. package/dist/interactive/proposal-create.d.ts +9 -11
  421. package/dist/interactive/proposal-create.d.ts.map +1 -1
  422. package/dist/interactive/proposal-create.js +28 -21
  423. package/dist/interactive/proposal-create.js.map +1 -1
  424. package/dist/interactive/proposal-refine.d.ts +4 -4
  425. package/dist/interactive/proposal-refine.d.ts.map +1 -1
  426. package/dist/interactive/proposal-refine.js +40 -7
  427. package/dist/interactive/proposal-refine.js.map +1 -1
  428. package/dist/interactive/proxy-routes.d.ts +10 -5
  429. package/dist/interactive/proxy-routes.d.ts.map +1 -1
  430. package/dist/interactive/proxy-routes.js +108 -11
  431. package/dist/interactive/proxy-routes.js.map +1 -1
  432. package/dist/interactive/review-events.js +1 -1
  433. package/dist/interactive/review-events.js.map +1 -1
  434. package/dist/interactive/run-units.d.ts.map +1 -1
  435. package/dist/interactive/run-units.js +3 -2
  436. package/dist/interactive/run-units.js.map +1 -1
  437. package/dist/interactive/source-packet.d.ts +13 -1
  438. package/dist/interactive/source-packet.d.ts.map +1 -1
  439. package/dist/interactive/source-packet.js +108 -34
  440. package/dist/interactive/source-packet.js.map +1 -1
  441. package/dist/knowledge/adapters/toolbox/memory.d.ts +2 -0
  442. package/dist/knowledge/adapters/toolbox/memory.d.ts.map +1 -0
  443. package/dist/knowledge/adapters/toolbox/memory.js +43 -0
  444. package/dist/knowledge/adapters/toolbox/memory.js.map +1 -0
  445. package/dist/knowledge/adapters/toolbox/supervisor.d.ts +30 -4
  446. package/dist/knowledge/adapters/toolbox/supervisor.d.ts.map +1 -1
  447. package/dist/knowledge/adapters/toolbox/supervisor.js +112 -28
  448. package/dist/knowledge/adapters/toolbox/supervisor.js.map +1 -1
  449. package/dist/knowledge/estate-write.d.ts +5 -0
  450. package/dist/knowledge/estate-write.d.ts.map +1 -1
  451. package/dist/knowledge/estate-write.js +7 -0
  452. package/dist/knowledge/estate-write.js.map +1 -1
  453. package/dist/knowledge/gate/gate.d.ts.map +1 -1
  454. package/dist/knowledge/gate/gate.js +4 -1
  455. package/dist/knowledge/gate/gate.js.map +1 -1
  456. package/dist/knowledge/gate/record.d.ts +15 -2
  457. package/dist/knowledge/gate/record.d.ts.map +1 -1
  458. package/dist/knowledge/gate/record.js +108 -29
  459. package/dist/knowledge/gate/record.js.map +1 -1
  460. package/dist/knowledge/projector.d.ts +60 -5
  461. package/dist/knowledge/projector.d.ts.map +1 -1
  462. package/dist/knowledge/projector.js +264 -21
  463. package/dist/knowledge/projector.js.map +1 -1
  464. package/dist/knowledge/registry/entry.d.ts +7 -0
  465. package/dist/knowledge/registry/entry.d.ts.map +1 -1
  466. package/dist/knowledge/registry/entry.js +4 -0
  467. package/dist/knowledge/registry/entry.js.map +1 -1
  468. package/dist/knowledge/shapes/map.d.ts.map +1 -1
  469. package/dist/knowledge/shapes/map.js +12 -2
  470. package/dist/knowledge/shapes/map.js.map +1 -1
  471. package/dist/knowledge/shapes/routes.d.ts +1 -1
  472. package/dist/knowledge/shapes/routes.d.ts.map +1 -1
  473. package/dist/knowledge/shapes/routes.js +42 -16
  474. package/dist/knowledge/shapes/routes.js.map +1 -1
  475. package/dist/knowledge/shapes/shapes.d.ts +60 -13
  476. package/dist/knowledge/shapes/shapes.d.ts.map +1 -1
  477. package/dist/knowledge/shapes/shapes.js +199 -31
  478. package/dist/knowledge/shapes/shapes.js.map +1 -1
  479. package/dist/knowledge/shapes/verified.d.ts.map +1 -1
  480. package/dist/knowledge/shapes/verified.js +3 -2
  481. package/dist/knowledge/shapes/verified.js.map +1 -1
  482. package/dist/knowledge/trackers/addresses.d.ts +27 -3
  483. package/dist/knowledge/trackers/addresses.d.ts.map +1 -1
  484. package/dist/knowledge/trackers/addresses.js +33 -5
  485. package/dist/knowledge/trackers/addresses.js.map +1 -1
  486. package/dist/knowledge/trackers/gate-pm.d.ts.map +1 -1
  487. package/dist/knowledge/trackers/gate-pm.js +4 -2
  488. package/dist/knowledge/trackers/gate-pm.js.map +1 -1
  489. package/dist/knowledge/trackers/projector.d.ts +3 -1
  490. package/dist/knowledge/trackers/projector.d.ts.map +1 -1
  491. package/dist/knowledge/trackers/projector.js +59 -8
  492. package/dist/knowledge/trackers/projector.js.map +1 -1
  493. package/dist/learn/scheduler.d.ts.map +1 -1
  494. package/dist/learn/scheduler.js +13 -3
  495. package/dist/learn/scheduler.js.map +1 -1
  496. package/dist/learnings/estate.d.ts.map +1 -1
  497. package/dist/learnings/estate.js +3 -14
  498. package/dist/learnings/estate.js.map +1 -1
  499. package/dist/learnings/extract.d.ts +9 -3
  500. package/dist/learnings/extract.d.ts.map +1 -1
  501. package/dist/learnings/extract.js +62 -4
  502. package/dist/learnings/extract.js.map +1 -1
  503. package/dist/learnings/replacement-lineage.d.ts +3 -2
  504. package/dist/learnings/replacement-lineage.d.ts.map +1 -1
  505. package/dist/learnings/replacement-lineage.js +7 -6
  506. package/dist/learnings/replacement-lineage.js.map +1 -1
  507. package/dist/learnings/service.d.ts +12 -2
  508. package/dist/learnings/service.d.ts.map +1 -1
  509. package/dist/learnings/service.js +30 -5
  510. package/dist/learnings/service.js.map +1 -1
  511. package/dist/mcp/broker.d.ts.map +1 -1
  512. package/dist/mcp/broker.js +19 -5
  513. package/dist/mcp/broker.js.map +1 -1
  514. package/dist/mcp/env.d.ts +12 -4
  515. package/dist/mcp/env.d.ts.map +1 -1
  516. package/dist/mcp/env.js +24 -4
  517. package/dist/mcp/env.js.map +1 -1
  518. package/dist/mcp/estate-relay.d.ts +3 -0
  519. package/dist/mcp/estate-relay.d.ts.map +1 -1
  520. package/dist/mcp/estate-relay.js +7 -6
  521. package/dist/mcp/estate-relay.js.map +1 -1
  522. package/dist/mcp/invoke.d.ts.map +1 -1
  523. package/dist/mcp/invoke.js +6 -5
  524. package/dist/mcp/invoke.js.map +1 -1
  525. package/dist/mcp/probe.d.ts +14 -1
  526. package/dist/mcp/probe.d.ts.map +1 -1
  527. package/dist/mcp/probe.js +55 -10
  528. package/dist/mcp/probe.js.map +1 -1
  529. package/dist/mcp/redact.d.ts +1 -1
  530. package/dist/mcp/redact.d.ts.map +1 -1
  531. package/dist/mcp/redact.js +61 -4
  532. package/dist/mcp/redact.js.map +1 -1
  533. package/dist/mcp/registry-store.d.ts +37 -0
  534. package/dist/mcp/registry-store.d.ts.map +1 -1
  535. package/dist/mcp/registry-store.js +43 -0
  536. package/dist/mcp/registry-store.js.map +1 -1
  537. package/dist/mcp/registry.d.ts +38 -6
  538. package/dist/mcp/registry.d.ts.map +1 -1
  539. package/dist/mcp/registry.js +145 -14
  540. package/dist/mcp/registry.js.map +1 -1
  541. package/dist/mcp/rest.js +4 -4
  542. package/dist/mcp/rest.js.map +1 -1
  543. package/dist/mcp/run-fence.d.ts +2 -0
  544. package/dist/mcp/run-fence.d.ts.map +1 -1
  545. package/dist/mcp/run-fence.js +9 -0
  546. package/dist/mcp/run-fence.js.map +1 -1
  547. package/dist/mcp/secrets.d.ts +1 -1
  548. package/dist/mcp/secrets.d.ts.map +1 -1
  549. package/dist/mcp/secrets.js +10 -11
  550. package/dist/mcp/secrets.js.map +1 -1
  551. package/dist/mcp/upstream-error.d.ts +6 -2
  552. package/dist/mcp/upstream-error.d.ts.map +1 -1
  553. package/dist/mcp/upstream-error.js +5 -1
  554. package/dist/mcp/upstream-error.js.map +1 -1
  555. package/dist/projects/graph.d.ts +15 -5
  556. package/dist/projects/graph.d.ts.map +1 -1
  557. package/dist/projects/graph.js +354 -26
  558. package/dist/projects/graph.js.map +1 -1
  559. package/dist/projects/repo-watch.d.ts +2 -2
  560. package/dist/projects/repo-watch.d.ts.map +1 -1
  561. package/dist/projects/repo-watch.js +26 -9
  562. package/dist/projects/repo-watch.js.map +1 -1
  563. package/dist/projects/routes.d.ts +9 -1
  564. package/dist/projects/routes.d.ts.map +1 -1
  565. package/dist/projects/routes.js +63 -6
  566. package/dist/projects/routes.js.map +1 -1
  567. package/dist/projects/state-home-preflight.d.ts +5 -0
  568. package/dist/projects/state-home-preflight.d.ts.map +1 -1
  569. package/dist/projects/state-home-preflight.js +48 -8
  570. package/dist/projects/state-home-preflight.js.map +1 -1
  571. package/dist/projects/state-home-registry.d.ts.map +1 -1
  572. package/dist/projects/state-home-registry.js +9 -0
  573. package/dist/projects/state-home-registry.js.map +1 -1
  574. package/dist/projects/state-home.d.ts +11 -0
  575. package/dist/projects/state-home.d.ts.map +1 -1
  576. package/dist/projects/state-home.js +14 -0
  577. package/dist/projects/state-home.js.map +1 -1
  578. package/dist/qe/author-workflow.d.ts +4 -0
  579. package/dist/qe/author-workflow.d.ts.map +1 -1
  580. package/dist/qe/author-workflow.js +4 -0
  581. package/dist/qe/author-workflow.js.map +1 -1
  582. package/dist/qe/test-sets.d.ts +5 -6
  583. package/dist/qe/test-sets.d.ts.map +1 -1
  584. package/dist/qe/test-sets.js +4 -3
  585. package/dist/qe/test-sets.js.map +1 -1
  586. package/dist/schedules/routes.d.ts +5 -0
  587. package/dist/schedules/routes.d.ts.map +1 -1
  588. package/dist/schedules/routes.js +32 -5
  589. package/dist/schedules/routes.js.map +1 -1
  590. package/dist/schedules/scheduler.d.ts +8 -1
  591. package/dist/schedules/scheduler.d.ts.map +1 -1
  592. package/dist/schedules/scheduler.js +10 -1
  593. package/dist/schedules/scheduler.js.map +1 -1
  594. package/dist/schedules/store.d.ts +7 -0
  595. package/dist/schedules/store.d.ts.map +1 -1
  596. package/dist/schedules/store.js +19 -4
  597. package/dist/schedules/store.js.map +1 -1
  598. package/dist/skills/plugin-source.js +4 -4
  599. package/dist/skills/plugin-source.js.map +1 -1
  600. package/dist/sources/ask.d.ts.map +1 -1
  601. package/dist/sources/ask.js +12 -12
  602. package/dist/sources/ask.js.map +1 -1
  603. package/dist/sources/dialer.d.ts +6 -1
  604. package/dist/sources/dialer.d.ts.map +1 -1
  605. package/dist/sources/dialer.js +53 -31
  606. package/dist/sources/dialer.js.map +1 -1
  607. package/dist/sources/drivers/mysql.d.ts +2 -0
  608. package/dist/sources/drivers/mysql.d.ts.map +1 -1
  609. package/dist/sources/drivers/mysql.js +18 -2
  610. package/dist/sources/drivers/mysql.js.map +1 -1
  611. package/dist/sources/drivers/postgres.d.ts +2 -0
  612. package/dist/sources/drivers/postgres.d.ts.map +1 -1
  613. package/dist/sources/drivers/postgres.js +10 -3
  614. package/dist/sources/drivers/postgres.js.map +1 -1
  615. package/dist/sources/drivers/sqlite.d.ts +33 -3
  616. package/dist/sources/drivers/sqlite.d.ts.map +1 -1
  617. package/dist/sources/drivers/sqlite.js +18 -6
  618. package/dist/sources/drivers/sqlite.js.map +1 -1
  619. package/dist/sources/drivers/types.d.ts +3 -1
  620. package/dist/sources/drivers/types.d.ts.map +1 -1
  621. package/dist/sources/drivers/types.js +3 -1
  622. package/dist/sources/drivers/types.js.map +1 -1
  623. package/dist/sources/routes.d.ts.map +1 -1
  624. package/dist/sources/routes.js +1 -0
  625. package/dist/sources/routes.js.map +1 -1
  626. package/dist/sources/uploads.d.ts +22 -15
  627. package/dist/sources/uploads.d.ts.map +1 -1
  628. package/dist/sources/uploads.js +124 -436
  629. package/dist/sources/uploads.js.map +1 -1
  630. package/dist/standing-orders/history.d.ts +5 -3
  631. package/dist/standing-orders/history.d.ts.map +1 -1
  632. package/dist/standing-orders/history.js +6 -2
  633. package/dist/standing-orders/history.js.map +1 -1
  634. package/dist/standing-orders/parse.d.ts +8 -0
  635. package/dist/standing-orders/parse.d.ts.map +1 -1
  636. package/dist/standing-orders/parse.js +52 -5
  637. package/dist/standing-orders/parse.js.map +1 -1
  638. package/dist/studio/apps-standalone/fixture.js +3 -3
  639. package/dist/studio/apps-standalone/runtime.js +1 -1
  640. package/dist/studio/assets/{KnowledgeGraph-DWw0I8RJ.js → KnowledgeGraph-yP4WsnST.js} +1 -1
  641. package/dist/studio/assets/index-DNaLjJ7M.css +32 -0
  642. package/dist/studio/assets/index-DW53FKuT.js +1114 -0
  643. package/dist/studio/editors/wicked-apps/editor.json +1 -1
  644. package/dist/studio/editors/wicked-apps/index.html +2 -2
  645. package/dist/studio/editors/wicked-deck/editor.json +1 -1
  646. package/dist/studio/editors/wicked-deck/index.html +2 -2
  647. package/dist/studio/editors/wicked-doc/editor.json +1 -1
  648. package/dist/studio/editors/wicked-doc/index.html +1 -1
  649. package/dist/studio/editors/wicked-insights/editor.json +1 -1
  650. package/dist/studio/editors/wicked-insights/index.html +1 -1
  651. package/dist/studio/editors/wicked-page/editor.json +1 -1
  652. package/dist/studio/editors/wicked-page/index.html +1 -1
  653. package/dist/studio/editors/wicked-video/editor.json +1 -1
  654. package/dist/studio/editors/wicked-video/index.html +1 -1
  655. package/dist/studio/index.html +2 -2
  656. package/dist/studio/testid-inventory.json +1589 -281
  657. package/dist/team/routes.d.ts +11 -1
  658. package/dist/team/routes.d.ts.map +1 -1
  659. package/dist/team/routes.js +8 -4
  660. package/dist/team/routes.js.map +1 -1
  661. package/dist/voice/tts.d.ts +12 -0
  662. package/dist/voice/tts.d.ts.map +1 -1
  663. package/dist/voice/tts.js +118 -28
  664. package/dist/voice/tts.js.map +1 -1
  665. package/dist/workflow-catalog/build-v2.d.ts +34 -0
  666. package/dist/workflow-catalog/build-v2.d.ts.map +1 -1
  667. package/dist/workflow-catalog/build-v2.js +131 -10
  668. package/dist/workflow-catalog/build-v2.js.map +1 -1
  669. package/dist/workflow-catalog/catalog-data-v2.d.ts +6 -2
  670. package/dist/workflow-catalog/catalog-data-v2.d.ts.map +1 -1
  671. package/dist/workflow-catalog/catalog-data-v2.js.map +1 -1
  672. package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
  673. package/dist/workflow-catalog/catalog-data.js +0 -2
  674. package/dist/workflow-catalog/catalog-data.js.map +1 -1
  675. package/dist/workflow-catalog/detect.d.ts +18 -3
  676. package/dist/workflow-catalog/detect.d.ts.map +1 -1
  677. package/dist/workflow-catalog/detect.js +43 -8
  678. package/dist/workflow-catalog/detect.js.map +1 -1
  679. package/dist/workflow-catalog/shape.d.ts +1 -1
  680. package/dist/working-doc/event-lines.d.ts +12 -2
  681. package/dist/working-doc/event-lines.d.ts.map +1 -1
  682. package/dist/working-doc/event-lines.js +62 -10
  683. package/dist/working-doc/event-lines.js.map +1 -1
  684. package/dist/working-doc/sections.d.ts +3 -0
  685. package/dist/working-doc/sections.d.ts.map +1 -1
  686. package/dist/working-doc/sections.js +5 -0
  687. package/dist/working-doc/sections.js.map +1 -1
  688. package/dist/working-doc/service.d.ts +23 -3
  689. package/dist/working-doc/service.d.ts.map +1 -1
  690. package/dist/working-doc/service.js +93 -54
  691. package/dist/working-doc/service.js.map +1 -1
  692. package/endpoint-manifest.json +148 -8
  693. package/evals/corpora/shape-v1.json +25 -1
  694. package/evals/corpora/shape-v1.seat-fixture.json +25 -1
  695. package/package.json +4 -4
  696. package/runners/sqlite-runner.mjs +67 -12
  697. package/runners/upload-parse.d.mts +13 -0
  698. package/runners/upload-parse.mjs +364 -0
  699. package/dist/studio/assets/index-C4Xj-zxa.css +0 -32
  700. package/dist/studio/assets/index-CrNY3d06.js +0 -1109
@@ -56,7 +56,7 @@ export const LINKED_NOTE = 'Linked: this answer crossed from one repo into anoth
56
56
  'wicked-estate proved from package identity (listed in `crossings`; each dependent reached ' +
57
57
  'through one names it in `via_crossing`). Other hits are per-repo results, and a dependency the ' +
58
58
  'linker could not prove is not followed.';
59
- /** Added to {@link LINKED_NOTE} when the project's link generation predates the current indexes. */
59
+ /** Added to the answer's note when the project's link generation predates the current indexes. */
60
60
  export const LINK_STALE_NOTE = 'The links are from an earlier refresh and some repos changed since (`link_stale_labels`): ' +
61
61
  'refresh the code graph to relink.';
62
62
  /**
@@ -810,9 +810,10 @@ async function refreshOnce(adapter, projectId, env, force, st, log) {
810
810
  const skipped = [];
811
811
  const failed = [];
812
812
  const repoRows = [];
813
- if (members.repos.length === 0) {
813
+ // No members and no graph: nothing to build and nothing to prune (crew#1476 prunes an existing one below).
814
+ if (members.repos.length === 0 && !existsSync(dbPath)) {
814
815
  return {
815
- status: buildStatus({ projectId, members, manifest: null, dbExists: existsSync(dbPath), env }),
816
+ status: buildStatus({ projectId, members, manifest: null, dbExists: false, env }),
816
817
  indexed,
817
818
  skipped,
818
819
  failed,
@@ -820,7 +821,7 @@ async function refreshOnce(adapter, projectId, env, force, st, log) {
820
821
  };
821
822
  }
822
823
  assertLabelsUnique(members.repos);
823
- if (!(await estateSupportsMultiRepo(env))) {
824
+ if (members.repos.length > 0 && !(await estateSupportsMultiRepo(env))) {
824
825
  // Refusing is the ONLY safe answer. An estate without `--repo` accepts the flag, drops it, and
825
826
  // exits 0, so proceeding would co-locate three repos into a database holding one of them, with
826
827
  // nothing in any output to say so.
@@ -837,8 +838,27 @@ async function refreshOnce(adapter, projectId, env, force, st, log) {
837
838
  budgets.set(m.label, await adapter.indexBudget(m.repo.root_path));
838
839
  st.budgetMs = [...budgets.values()].reduce((sum, b) => sum + b.budgetMs, 0);
839
840
  await mkdir(dirname(dbPath), { recursive: true });
840
- const dbExisted = existsSync(dbPath);
841
+ let dbExisted = existsSync(dbPath);
841
842
  const prior = dbExisted ? await readManifest(projectId, env) : null;
843
+ const currentLabels = new Set(members.repos.map((m) => m.label));
844
+ const pruned = (prior?.repos ?? []).map((r) => r.label).filter((label) => !currentLabels.has(label));
845
+ if (dbExisted && pruned.length > 0) {
846
+ // crew#1476: estate has no per-label delete; rebuild only on refresh, including journal siblings.
847
+ for (const suffix of ['', '-wal', '-shm', '-journal']) {
848
+ try {
849
+ await unlink(`${dbPath}${suffix}`);
850
+ }
851
+ catch (err) {
852
+ if (err.code !== 'ENOENT')
853
+ throw err;
854
+ }
855
+ }
856
+ dbExisted = false;
857
+ // The old manifest describes the database just deleted. Left in place, the first member to re-index
858
+ // recreates the db and status reads every not-yet-rebuilt member as indexed (`ready` mid-rebuild).
859
+ await writeManifest(projectId, { version: 1, projectId, repos: [] }, env);
860
+ log?.(`project graph ${projectId}: rebuild to prune removed labels ${pruned.join(', ')}`);
861
+ }
842
862
  const priorByLabel = new Map((prior?.repos ?? []).map((r) => [r.label, r]));
843
863
  // Prior rows survive a refresh only if the database they describe does. When it does not, every
844
864
  // repo is re-indexed and the manifest is rebuilt from this run alone.
@@ -994,6 +1014,7 @@ async function refreshOnce(adapter, projectId, env, force, st, log) {
994
1014
  failed,
995
1015
  repos: repoRows,
996
1016
  ...(link === undefined ? {} : { link }),
1017
+ ...(pruned.length === 0 ? {} : { pruned }),
997
1018
  };
998
1019
  }
999
1020
  /**
@@ -1160,7 +1181,7 @@ export async function queryable(adapter, projectId, env = process.env) {
1160
1181
  * `null` when the prefix is not a CURRENT member's label: rows of a repo that has since been
1161
1182
  * detached are still in the database (estate has no per-label delete), and returning them under a
1162
1183
  * project-scoped query would answer about a repo the project no longer contains. They are excluded
1163
- * here and named in `status.staleRepos`, which is a different thing from being dropped silently.
1184
+ * here and named in `status.staleRepos` until refresh rebuilds without them (crew#1476).
1164
1185
  */
1165
1186
  function attribute(path, labels) {
1166
1187
  const slash = path.indexOf('/');
@@ -1177,10 +1198,24 @@ function attribute(path, labels) {
1177
1198
  * only place a result acquires its provenance — exported so the attribution rules are testable
1178
1199
  * without a graph on disk, which is what makes the stale-label exclusion below coverable at all.
1179
1200
  */
1180
- export function attributeHits(raw, labels) {
1181
- const hits = (Array.isArray(raw) ? raw : [])
1182
- .map((r) => toHit(r, labels))
1183
- .filter((h) => h !== null);
1201
+ export function attributeHits(raw, labels, detached = new Set()) {
1202
+ const hits = [];
1203
+ // crew#1714: the rows left out (a removed member's) are not in the answer, so a `via` edge to one
1204
+ // points at nothing a client can place: it goes with them, as does one to a `detached` symbol
1205
+ // (a removed member's end of a crossing, which may be a start rather than a row).
1206
+ const dropped = new Set(detached);
1207
+ for (const r of Array.isArray(raw) ? raw : []) {
1208
+ const h = toHit(r, labels);
1209
+ if (h !== null)
1210
+ hits.push(h);
1211
+ else if (typeof r?.id === 'string')
1212
+ dropped.add(r.id);
1213
+ }
1214
+ if (dropped.size > 0) {
1215
+ for (const h of hits)
1216
+ if (h.via !== undefined)
1217
+ h.via = h.via.filter((v) => !dropped.has(v.id));
1218
+ }
1184
1219
  return { hits, byRepo: countByRepo(hits) };
1185
1220
  }
1186
1221
  function countByRepo(hits) {
@@ -1194,12 +1229,28 @@ function countByRepo(hits) {
1194
1229
  }
1195
1230
  return [...counts.values()].sort((a, b) => b.count - a.count || a.repo.localeCompare(b.repo));
1196
1231
  }
1232
+ /** crew#1714: estate's `via` (wicked-estate#557): `{id, kind}` edges to the inner ring; `kind` is the
1233
+ * edge-kind wire form, a string or `{other: <tag>}`. A malformed entry is left out, never guessed. */
1234
+ function viaOf(raw) {
1235
+ if (!Array.isArray(raw))
1236
+ return undefined;
1237
+ return raw.flatMap((v) => {
1238
+ const { id, kind } = (v ?? {});
1239
+ if (typeof id !== 'string')
1240
+ return [];
1241
+ if (typeof kind === 'string')
1242
+ return [{ id, kind }];
1243
+ const other = kind?.other;
1244
+ return typeof other === 'string' ? [{ id, kind: { other } }] : [];
1245
+ });
1246
+ }
1197
1247
  function toHit(raw, labels) {
1198
1248
  const file = typeof raw.file === 'string' ? raw.file : '';
1199
1249
  const where = attribute(file, labels);
1200
1250
  if (where === null)
1201
1251
  return null;
1202
1252
  const id = typeof raw.id === 'string' ? raw.id : typeof raw.symbol_id === 'string' ? raw.symbol_id : '';
1253
+ const via = viaOf(raw.via);
1203
1254
  return {
1204
1255
  repoId: where.repoId,
1205
1256
  repo: where.repo,
@@ -1208,25 +1259,176 @@ function toHit(raw, labels) {
1208
1259
  kind: typeof raw.kind === 'string' ? raw.kind : '',
1209
1260
  file: where.file,
1210
1261
  line: typeof raw.line === 'number' ? raw.line : 0,
1262
+ ...(typeof raw.depth === 'number' ? { depth: raw.depth } : {}),
1263
+ ...(raw.stale === 'modified' || raw.stale === 'deleted' ? { stale: raw.stale } : {}),
1211
1264
  ...(typeof raw.via_crossing === 'string' ? { via_crossing: raw.via_crossing } : {}),
1212
1265
  ...(raw.via_crossing_omitted === true ? { via_crossing_omitted: true } : {}),
1266
+ ...(via === undefined ? {} : { via }),
1267
+ ...(typeof raw.via_omitted === 'number' ? { via_omitted: raw.via_omitted } : {}),
1213
1268
  };
1214
1269
  }
1215
1270
  /** Safety stop for following estate's blast-radius cursor: a server that kept issuing cursors would
1216
1271
  * loop forever. 200 pages of ~235 rows is far past any real answer. */
1217
1272
  const MAX_BLAST_PAGES = 200;
1273
+ /** crew#1556: estate's cap on the stale-file sample, retained across reply pages. */
1274
+ const STALE_FILES_CAP = 20;
1275
+ function mergeFreshness(pages) {
1276
+ const staleFiles = new Map();
1277
+ const indexing = new Set();
1278
+ let commitsBehind;
1279
+ let unindexedFiles = null;
1280
+ let staleFilesTotal = 0;
1281
+ let checkedFiles = 0;
1282
+ let notFileBacked = 0;
1283
+ let totalPartial = false;
1284
+ for (const page of pages) {
1285
+ if (page.stale_files_total_partial === true)
1286
+ totalPartial = true;
1287
+ for (const row of page.stale_files ?? []) {
1288
+ if (!staleFiles.has(row.file) && staleFiles.size < STALE_FILES_CAP)
1289
+ staleFiles.set(row.file, row);
1290
+ }
1291
+ for (const label of page.indexing ?? [])
1292
+ indexing.add(label);
1293
+ if (page.commits_behind === null)
1294
+ commitsBehind = null;
1295
+ else if (commitsBehind !== null && typeof page.commits_behind === 'number') {
1296
+ commitsBehind = Math.max(commitsBehind ?? 0, page.commits_behind);
1297
+ }
1298
+ if (typeof page.unindexed_files === 'number')
1299
+ unindexedFiles = Math.max(unindexedFiles ?? 0, page.unindexed_files);
1300
+ // crew#1556: per-page counts; a file spanning pages counts once on each page.
1301
+ if (typeof page.stale_files_total === 'number')
1302
+ staleFilesTotal += page.stale_files_total;
1303
+ if (typeof page.checked_files === 'number')
1304
+ checkedFiles += page.checked_files;
1305
+ if (typeof page.not_file_backed === 'number')
1306
+ notFileBacked += page.not_file_backed;
1307
+ }
1308
+ const roots = pages.at(-1)?.roots;
1309
+ return {
1310
+ stale_files: [...staleFiles.values()], stale_files_total: staleFilesTotal,
1311
+ ...(totalPartial ? { stale_files_total_partial: true } : {}),
1312
+ checked_files: checkedFiles, not_file_backed: notFileBacked,
1313
+ ...(commitsBehind === undefined ? {} : { commits_behind: commitsBehind }),
1314
+ unindexed_files: unindexedFiles, indexing: [...indexing],
1315
+ ...(roots === undefined ? {} : { roots }),
1316
+ };
1317
+ }
1318
+ /**
1319
+ * crew#1713: ONE reply page's freshness, current members only. A removed member's rows stay in the
1320
+ * database until the next refresh, and estate counts their files too, so its stale files leave the
1321
+ * page's total (the sample's and every stale-marked row's: estate marks every drifted row unless its
1322
+ * budget dropped the marks, and then the sample still names them up to its cap) and its label leaves
1323
+ * `indexing`. Per page, before the pages are summed (crew#1556 counts a file once per page). Paths
1324
+ * stay estate's; {@link attributeFreshness} attributes them.
1325
+ */
1326
+ function memberFreshness(raw, page, labels) {
1327
+ const dependents = page['dependents'];
1328
+ const member = (file) => attribute(file, labels) !== null;
1329
+ const removed = new Set();
1330
+ const kept = raw.stale_files?.filter((row) => {
1331
+ if (typeof row?.file === 'string' && member(row.file))
1332
+ return true;
1333
+ if (typeof row?.file === 'string')
1334
+ removed.add(row.file);
1335
+ return false;
1336
+ });
1337
+ const rows = Array.isArray(dependents) ? dependents : [];
1338
+ let anyMarked = false;
1339
+ const rowFiles = new Set();
1340
+ for (const row of rows) {
1341
+ const marked = row?.stale === 'modified' || row?.stale === 'deleted';
1342
+ if (marked)
1343
+ anyMarked = true;
1344
+ if (typeof row?.file === 'string')
1345
+ rowFiles.add(row.file);
1346
+ if (marked && typeof row.file === 'string' && !member(row.file))
1347
+ removed.add(row.file);
1348
+ }
1349
+ // crew#1797: estate's budget can drop the row marks and empty the sample while it keeps the count. A counted file
1350
+ // that no sample entry or mark names may then be a removed member's, and crew cannot take it out: the total is
1351
+ // marked partial (an upper bound). Only when the count is not explained by the named member files AND the page
1352
+ // carries a file outside the members that is not accounted for: removed already, or a dependents row whose missing
1353
+ // mark (with marks present on the page) says it is not stale. Every file the probe counted is looked at, the name
1354
+ // miss's `suggestions` included.
1355
+ const unexplained = typeof raw.stale_files_total === 'number' && raw.stale_files_total - removed.size > (kept?.length ?? 0);
1356
+ const probed = new Set();
1357
+ probedFiles(page, probed);
1358
+ const unknown = [...probed].some((file) => !member(file) && !removed.has(file) && !(anyMarked && rowFiles.has(file)));
1359
+ const partial = unexplained && unknown;
1360
+ const { indexing, ...rest } = raw;
1361
+ delete rest.stale_files;
1362
+ return {
1363
+ ...rest,
1364
+ ...(typeof raw.stale_files_total === 'number'
1365
+ ? { stale_files_total: Math.max(kept?.length ?? 0, raw.stale_files_total - removed.size) }
1366
+ : {}),
1367
+ ...(partial ? { stale_files_total_partial: true } : {}),
1368
+ ...(Array.isArray(indexing) ? { indexing: indexing.filter((label) => labels.has(label)) } : {}),
1369
+ ...(kept === undefined ? {} : { stale_files: kept }),
1370
+ };
1371
+ }
1372
+ /**
1373
+ * The files estate's freshness probe checks on a reply page: every non-empty `file` string, and every `files` /
1374
+ * `*_files` path list, anywhere in it but the `freshness` block (wicked-estate `freshness.rs` `collect_files`).
1375
+ */
1376
+ function probedFiles(v, out) {
1377
+ if (Array.isArray(v)) {
1378
+ for (const item of v)
1379
+ probedFiles(item, out);
1380
+ return;
1381
+ }
1382
+ if (v === null || typeof v !== 'object')
1383
+ return;
1384
+ for (const [k, child] of Object.entries(v)) {
1385
+ if (k === 'freshness')
1386
+ continue;
1387
+ if (k === 'file' && typeof child === 'string') {
1388
+ if (child !== '')
1389
+ out.add(child);
1390
+ }
1391
+ else if ((k === 'files' || k.endsWith('_files')) && Array.isArray(child)) {
1392
+ for (const item of child) {
1393
+ if (typeof item === 'string') {
1394
+ if (item !== '')
1395
+ out.add(item);
1396
+ }
1397
+ else
1398
+ probedFiles(item, out);
1399
+ }
1400
+ }
1401
+ else
1402
+ probedFiles(child, out);
1403
+ }
1404
+ }
1405
+ /** crew#1555: attribute the (member-scoped, {@link memberFreshness}) sample and remove host paths. */
1406
+ function attributeFreshness(raw, labels) {
1407
+ const { stale_files, ...rest } = raw;
1408
+ delete rest.roots;
1409
+ return {
1410
+ ...rest,
1411
+ ...(stale_files === undefined ? {} : { stale_files: stale_files.flatMap((row) => {
1412
+ const where = attribute(row.file, labels);
1413
+ return where === null ? [] : [{ ...where, status: row.status }];
1414
+ }) }),
1415
+ };
1416
+ }
1218
1417
  /**
1219
1418
  * `wicked-estate blast-radius --json`, EVERY page of it (operator ruling "full graph"; estate#279,
1220
1419
  * wicked-estate 0.28.0+). estate pages a wide answer: a page names the rest with `next_cursor`
1221
1420
  * (null on the last page), and `--cursor` returns the next rows of the SAME answer. The pages'
1222
- * `dependents` are joined; every other field is the LAST page's, so once every page is in,
1421
+ * `dependents` are joined and freshness is merged (crew#1556); other fields are the LAST page's, so once every page is in,
1223
1422
  * `truncated_dependents` says only what the walk itself cut (and `next_cursor` is null). A cursor
1224
1423
  * still unread at the page cap is left on the answer with that page's `truncated_dependents`, so
1225
1424
  * the unread rows read as cut, never as absent. An estate that does not page sends no
1226
1425
  * `next_cursor`: one call, its JSON unchanged. Shared by the repo route and the project route.
1227
1426
  */
1228
- export async function readBlastRadiusPages(exe, name, dbPath, opts) {
1427
+ export async function readBlastRadiusPages(exe, name, dbPath, opts,
1428
+ /** Applied to each page's freshness before the pages merge (the project route scopes it to members). */
1429
+ pageFreshness) {
1229
1430
  const dependents = [];
1431
+ const freshnessPages = [];
1230
1432
  let first = null;
1231
1433
  let last = {};
1232
1434
  let cursor = null;
@@ -1235,6 +1437,11 @@ export async function readBlastRadiusPages(exe, name, dbPath, opts) {
1235
1437
  const { stdout } = await execCapped(exe, args, opts);
1236
1438
  last = JSON.parse(stdout);
1237
1439
  first ??= last;
1440
+ if (last['freshness'] !== null && typeof last['freshness'] === 'object') {
1441
+ if (pageFreshness !== undefined)
1442
+ last['freshness'] = pageFreshness(last['freshness'], last);
1443
+ freshnessPages.push(last['freshness']);
1444
+ }
1238
1445
  if (Array.isArray(last['dependents']))
1239
1446
  dependents.push(...last['dependents']);
1240
1447
  cursor = typeof last['next_cursor'] === 'string' && last['next_cursor'] !== '' ? last['next_cursor'] : null;
@@ -1244,6 +1451,8 @@ export async function readBlastRadiusPages(exe, name, dbPath, opts) {
1244
1451
  if (first === last)
1245
1452
  return last;
1246
1453
  const merged = { ...last, dependents };
1454
+ if (freshnessPages.length > 0)
1455
+ merged['freshness'] = mergeFreshness(freshnessPages);
1247
1456
  // The joined rows' window: from the first page's start, over the last page's total.
1248
1457
  const p0 = first?.['page'];
1249
1458
  const pn = last['page'];
@@ -1254,15 +1463,12 @@ export async function readBlastRadiusPages(exe, name, dbPath, opts) {
1254
1463
  }
1255
1464
  /** Dependents of a symbol across every member repo, each hit attributed to the repo it is in. */
1256
1465
  export async function projectBlastRadius(q, name, env = process.env) {
1257
- const raw = (await readProjectGraph(q.dbPath, () => readBlastRadiusPages(estateExe(env), name, q.dbPath, { timeout: QUERY_TIMEOUT_MS }), env));
1258
- const { hits: allHits, byRepo } = attributeHits(raw.dependents, q.labels);
1466
+ const raw = (await readProjectGraph(q.dbPath, () => readBlastRadiusPages(estateExe(env), name, q.dbPath, { timeout: QUERY_TIMEOUT_MS }, (freshness, page) => memberFreshness(freshness, page, q.labels)), env));
1259
1467
  // X1: estate lists the same (shallowest, capped) crossings on every page; the last page's list.
1260
1468
  // Only crossings between CURRENT members count: a removed member's links stay in the database
1261
1469
  // until the next refresh relinks without it, and must not make an answer read `linked`.
1262
- const members = new Set(q.labels.keys());
1263
- const listed = Array.isArray(raw.crossings) ? raw.crossings : [];
1264
- const crossings = listed.filter((c) => members.has(c.from?.repo) && members.has(c.to?.repo));
1265
- const dropped = new Set(listed.filter((c) => !crossings.includes(c)).map((c) => c.id));
1470
+ const { crossings, dropped, detached } = memberCrossings(raw.crossings, q.labels);
1471
+ const { hits: allHits, byRepo } = attributeHits(raw.dependents, q.labels, detached);
1266
1472
  // A hit reached through a dropped crossing loses its provenance claim along with the crossing.
1267
1473
  const hits = allHits.map((h) => {
1268
1474
  if (h.via_crossing === undefined || !dropped.has(h.via_crossing))
@@ -1273,12 +1479,7 @@ export async function projectBlastRadius(q, name, env = process.env) {
1273
1479
  return kept;
1274
1480
  });
1275
1481
  const linked = crossings.length > 0;
1276
- // estate's per-project link state: stale when a member moved since the link was validated.
1277
- const state = (Array.isArray(raw.link) ? raw.link : []);
1278
- const stale = state.some((s) => s.stale === true);
1279
- const staleLabels = state
1280
- .flatMap((s) => (Array.isArray(s.stale_labels) ? s.stale_labels : []))
1281
- .filter((l) => typeof l === 'string');
1482
+ const link = linkState(raw.link, q.status.projectId, q.labels);
1282
1483
  // crew#751: estate's completeness causes (wicked-estate#222), carried through verbatim when the
1283
1484
  // installed estate reports them, and ABSENT when it does not — never a fabricated `false`, which
1284
1485
  // would read as "the walk was complete" on an estate that cannot say.
@@ -1290,6 +1491,9 @@ export async function projectBlastRadius(q, name, env = process.env) {
1290
1491
  };
1291
1492
  return {
1292
1493
  ...causes,
1494
+ ...(typeof raw.resolved === 'boolean' ? { resolved: raw.resolved } : {}),
1495
+ ...(raw.freshness === undefined ? {} : { freshness: attributeFreshness(raw.freshness, q.labels) }),
1496
+ ...link.coverage,
1293
1497
  projectId: q.status.projectId,
1294
1498
  target: typeof raw.target === 'string' ? raw.target : name,
1295
1499
  dependents: hits,
@@ -1301,13 +1505,137 @@ export async function projectBlastRadius(q, name, env = process.env) {
1301
1505
  reposSearched: [...q.labels.keys()].sort(),
1302
1506
  missingRepos: q.status.missingRepos,
1303
1507
  linkage: linked ? 'linked' : 'co-located',
1304
- note: linked ? (stale ? `${LINKED_NOTE} ${LINK_STALE_NOTE}` : LINKED_NOTE) : CO_LOCATION_NOTE,
1508
+ note: `${linked ? LINKED_NOTE : CO_LOCATION_NOTE}${link.note}`,
1305
1509
  ...(Array.isArray(raw.crossings) ? { crossings } : {}),
1306
1510
  ...(typeof raw.crossings_total === 'number'
1307
1511
  ? { crossings_total: Math.max(crossings.length, raw.crossings_total - dropped.size) }
1308
1512
  : {}),
1309
1513
  ...(raw.crossings_truncated === true ? { crossings_truncated: true } : {}),
1310
- ...(linked && stale ? { link_stale: true, link_stale_labels: [...new Set(staleLabels)].sort() } : {}),
1514
+ ...link.stale,
1515
+ };
1516
+ }
1517
+ /** crew#1476: only crossings between current members can substantiate a project answer. */
1518
+ function memberCrossings(raw, labels) {
1519
+ const listed = Array.isArray(raw) ? raw : [];
1520
+ const crossings = listed.filter((c) => labels.has(c.from?.repo) && labels.has(c.to?.repo));
1521
+ const gone = listed.filter((c) => !crossings.includes(c));
1522
+ const detached = new Set(gone.flatMap((c) => [c.from, c.to])
1523
+ .filter((end) => !labels.has(end?.repo) && typeof end?.symbol === 'string')
1524
+ .map((end) => end.symbol));
1525
+ return { crossings, dropped: new Set(gone.map((c) => c.id)), detached };
1526
+ }
1527
+ /** crew#1476, crew#1477: shared coverage attribution; omitted metrics stay unknown. */
1528
+ function memberCoverage(state, labels) {
1529
+ // Untrusted shape: a coverage that is not a list, or an entry that is not an object, is no coverage.
1530
+ const rows = (Array.isArray(state.coverage) ? state.coverage : [])
1531
+ .filter((c) => c !== null && typeof c === 'object');
1532
+ return [...labels].sort(([a], [b]) => a.localeCompare(b)).map(([repo, repoId]) => {
1533
+ const row = rows.find((c) => c.label === repo);
1534
+ return {
1535
+ repoId, repo,
1536
+ ...(typeof row?.links_in === 'number' ? { links_in: row.links_in } : {}),
1537
+ ...(typeof row?.links_out === 'number' ? { links_out: row.links_out } : {}),
1538
+ ...(typeof row?.incomplete === 'boolean' ? { incomplete: row.incomplete } : {}),
1539
+ ...(typeof row?.package_imports === 'number' ? { package_imports: row.package_imports } : {}),
1540
+ ...(typeof row?.manifests === 'number' ? { manifests: row.manifests } : {}),
1541
+ ...(row?.boundary_counts === undefined ? {} : { boundary_counts: row.boundary_counts }),
1542
+ };
1543
+ });
1544
+ }
1545
+ /**
1546
+ * THIS project's link state from estate's `link` array (blast-radius and, wicked-estate#557, path: one
1547
+ * entry per project in the store): its members' coverage, and (crew#1714) whether its links predate the
1548
+ * current indexes. Another project's stale link says nothing about this one. Stale is stated on a
1549
+ * co-located answer too: a crossing the stale links miss is why it found none (estate's LINK-STALE:
1550
+ * "cross-repo dependents may be missing").
1551
+ */
1552
+ function linkState(raw, projectId, labels) {
1553
+ const state = (Array.isArray(raw) ? raw : []).find((s) => s !== null && typeof s === 'object' && s.project === projectId);
1554
+ if (state === undefined)
1555
+ return { coverage: {}, stale: {}, note: '' };
1556
+ const coverage = { coverage: memberCoverage(state, labels) };
1557
+ if (state.stale !== true)
1558
+ return { coverage, stale: {}, note: '' };
1559
+ // A removed member can be why the link is stale; the answer still names current members only (crew#1713).
1560
+ const staleLabels = (Array.isArray(state.stale_labels) ? state.stale_labels : [])
1561
+ .filter((l) => typeof l === 'string' && labels.has(l));
1562
+ return { coverage, stale: { link_stale: true, link_stale_labels: [...new Set(staleLabels)].sort() }, note: ` ${LINK_STALE_NOTE}` };
1563
+ }
1564
+ function pathEnd(raw, labels) {
1565
+ // estate emits a bare `{symbol}` only if an endpoint is missing from its own result: not attributable.
1566
+ if (typeof raw.file !== 'string')
1567
+ return null;
1568
+ const where = attribute(raw.file, labels);
1569
+ return where === null ? null : { ...where, symbol: raw.symbol, name: raw.name, kind: raw.kind, line: raw.line_1based };
1570
+ }
1571
+ /** crew#1476: an estate route is a project answer only when every endpoint is a current member. */
1572
+ export async function projectGraphPath(q, from, to, maxDepth, env = process.env) {
1573
+ const { stdout } = await readProjectGraph(q.dbPath, () => execCapped(estateExe(env), [
1574
+ 'path', from, to, '--db', q.dbPath, '--json', ...(maxDepth === undefined ? [] : ['--max-depth', String(maxDepth)]),
1575
+ ], { timeout: QUERY_TIMEOUT_MS }), env);
1576
+ const raw = JSON.parse(stdout);
1577
+ const hops = [];
1578
+ let excluded = false;
1579
+ for (const hop of raw.hops) {
1580
+ const source = pathEnd(hop.source, q.labels);
1581
+ const target = pathEnd(hop.target, q.labels);
1582
+ if (source === null || target === null) {
1583
+ excluded = true;
1584
+ break;
1585
+ }
1586
+ hops.push({ source, target, kind: hop.kind, ...(typeof hop.confidence === 'number' ? { confidence: hop.confidence } : {}) });
1587
+ }
1588
+ const { crossings } = memberCrossings(raw.crossings, q.labels);
1589
+ const linked = crossings.length > 0;
1590
+ // crew#1714: `path --json` carries the project link state too (wicked-estate#557), read as blast-radius reads it.
1591
+ const link = linkState(raw.link, q.status.projectId, q.labels);
1592
+ return {
1593
+ projectId: q.status.projectId, from: raw.from, to: raw.to, found: excluded ? false : raw.found,
1594
+ ...(typeof raw.resolved === 'boolean' ? { resolved: raw.resolved } : {}),
1595
+ unresolved: raw.unresolved, hops: excluded ? [] : hops,
1596
+ depth_bounded: raw.depth_bounded, node_bounded: raw.node_bounded,
1597
+ ...(Array.isArray(raw.crossings) ? { crossings } : {}),
1598
+ ...(excluded ? { excluded: 'the route found runs through a repository that is no longer in this project; refresh the project graph' } : {}),
1599
+ reposSearched: [...q.labels.keys()].sort(), missingRepos: q.status.missingRepos,
1600
+ ...link.coverage,
1601
+ ...link.stale,
1602
+ linkage: linked ? 'linked' : 'co-located',
1603
+ note: `${linked ? LINKED_NOTE : CO_LOCATION_NOTE}${link.note}${raw.depth_bounded || raw.node_bounded ? ' The search stopped at its depth or node bound, so a route it did not find may still exist.' : ''}`,
1604
+ };
1605
+ }
1606
+ /** crew#1477: possible boundaries are imports the linker could not prove, never graph edges. */
1607
+ export async function projectGraphBoundaries(q, env = process.env) {
1608
+ const base = { projectId: q.status.projectId, linked: false, possible: [], members: [] };
1609
+ if (!(await estateSupportsLink(env)))
1610
+ return {
1611
+ ...base, note: 'this wicked-estate cannot link repositories (X1, wicked-estate 0.34.0+); upgrade it to see boundaries',
1612
+ };
1613
+ const { stdout } = await readProjectGraph(q.dbPath, () => execCapped(estateExe(env), [
1614
+ 'link', '--project', q.status.projectId, '--status', '--json', '--db', q.dbPath,
1615
+ ], { timeout: QUERY_TIMEOUT_MS }), env);
1616
+ const raw = JSON.parse(stdout);
1617
+ if (raw === null)
1618
+ return { ...base, note: 'this project has not been linked yet; refresh its code graph' };
1619
+ const possible = [];
1620
+ for (const row of raw.coverage ?? []) {
1621
+ const repoId = q.labels.get(row.label);
1622
+ if (repoId === undefined)
1623
+ continue;
1624
+ for (const [reason, packages] of Object.entries(row.boundaries ?? {})) {
1625
+ for (const pkg of packages)
1626
+ possible.push({ repoId, repo: row.label, reason, package: pkg });
1627
+ }
1628
+ }
1629
+ possible.sort((a, b) => a.repo.localeCompare(b.repo) || a.reason.localeCompare(b.reason) || a.package.localeCompare(b.package));
1630
+ return {
1631
+ projectId: q.status.projectId, linked: true,
1632
+ ...(raw.generation === undefined ? {} : { generation: raw.generation }),
1633
+ ...(raw.stale === undefined ? {} : { stale: raw.stale }),
1634
+ stale_labels: (raw.stale_labels ?? []).filter((label) => q.labels.has(label)),
1635
+ ...(raw.last_error === undefined ? {} : { last_error: raw.last_error }),
1636
+ members: memberCoverage(raw, q.labels), possible: possible.slice(0, 500),
1637
+ ...(possible.length > 500 ? { possible_total: possible.length, possible_truncated: true } : {}),
1638
+ note: 'possible = imports estate could not prove are links to another member, by reason; never edges',
1311
1639
  };
1312
1640
  }
1313
1641
  /**