@aligndottech/cli 0.49.0 → 0.51.0

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 (825) hide show
  1. package/README.md +5 -3
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +32 -8
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/agents.d.ts.map +1 -1
  6. package/dist/commands/agents.js +4 -1
  7. package/dist/commands/agents.js.map +1 -1
  8. package/dist/commands/check.d.ts.map +1 -1
  9. package/dist/commands/check.js +18 -2
  10. package/dist/commands/check.js.map +1 -1
  11. package/dist/commands/config.d.ts +8 -0
  12. package/dist/commands/config.d.ts.map +1 -0
  13. package/dist/commands/config.js +33 -0
  14. package/dist/commands/config.js.map +1 -0
  15. package/dist/commands/connect-agents.d.ts.map +1 -1
  16. package/dist/commands/connect-agents.js +3 -1
  17. package/dist/commands/connect-agents.js.map +1 -1
  18. package/dist/commands/connect.d.ts +5 -0
  19. package/dist/commands/connect.d.ts.map +1 -1
  20. package/dist/commands/connect.js +24 -0
  21. package/dist/commands/connect.js.map +1 -1
  22. package/dist/commands/env.d.ts.map +1 -1
  23. package/dist/commands/env.js +11 -0
  24. package/dist/commands/env.js.map +1 -1
  25. package/dist/commands/import/confluence.d.ts.map +1 -1
  26. package/dist/commands/import/confluence.js +24 -5
  27. package/dist/commands/import/confluence.js.map +1 -1
  28. package/dist/commands/import/docs.js +2 -2
  29. package/dist/commands/import/git.d.ts.map +1 -1
  30. package/dist/commands/import/git.js +15 -5
  31. package/dist/commands/import/git.js.map +1 -1
  32. package/dist/commands/import/github.d.ts.map +1 -1
  33. package/dist/commands/import/github.js +34 -7
  34. package/dist/commands/import/github.js.map +1 -1
  35. package/dist/commands/import/gitlab.d.ts.map +1 -1
  36. package/dist/commands/import/gitlab.js +10 -5
  37. package/dist/commands/import/gitlab.js.map +1 -1
  38. package/dist/commands/import/jira.d.ts.map +1 -1
  39. package/dist/commands/import/jira.js +10 -5
  40. package/dist/commands/import/jira.js.map +1 -1
  41. package/dist/commands/import/linear.d.ts.map +1 -1
  42. package/dist/commands/import/linear.js +10 -5
  43. package/dist/commands/import/linear.js.map +1 -1
  44. package/dist/commands/import/notion.d.ts.map +1 -1
  45. package/dist/commands/import/notion.js +10 -5
  46. package/dist/commands/import/notion.js.map +1 -1
  47. package/dist/commands/import/sessions.js +2 -2
  48. package/dist/commands/import/slack.d.ts.map +1 -1
  49. package/dist/commands/import/slack.js +12 -7
  50. package/dist/commands/import/slack.js.map +1 -1
  51. package/dist/commands/import/teams.d.ts.map +1 -1
  52. package/dist/commands/import/teams.js +10 -5
  53. package/dist/commands/import/teams.js.map +1 -1
  54. package/dist/commands/import/zoom.d.ts.map +1 -1
  55. package/dist/commands/import/zoom.js +10 -5
  56. package/dist/commands/import/zoom.js.map +1 -1
  57. package/dist/commands/import.d.ts.map +1 -1
  58. package/dist/commands/import.js +43 -1
  59. package/dist/commands/import.js.map +1 -1
  60. package/dist/commands/invite.d.ts +8 -18
  61. package/dist/commands/invite.d.ts.map +1 -1
  62. package/dist/commands/invite.js +23 -46
  63. package/dist/commands/invite.js.map +1 -1
  64. package/dist/commands/join.d.ts +5 -0
  65. package/dist/commands/join.d.ts.map +1 -0
  66. package/dist/commands/join.js +49 -0
  67. package/dist/commands/join.js.map +1 -0
  68. package/dist/commands/local-relink.d.ts +35 -0
  69. package/dist/commands/local-relink.d.ts.map +1 -0
  70. package/dist/commands/local-relink.js +72 -0
  71. package/dist/commands/local-relink.js.map +1 -0
  72. package/dist/commands/local.d.ts.map +1 -1
  73. package/dist/commands/local.js +113 -4
  74. package/dist/commands/local.js.map +1 -1
  75. package/dist/commands/login.d.ts.map +1 -1
  76. package/dist/commands/login.js +21 -2
  77. package/dist/commands/login.js.map +1 -1
  78. package/dist/commands/mark.d.ts +37 -0
  79. package/dist/commands/mark.d.ts.map +1 -0
  80. package/dist/commands/mark.js +105 -0
  81. package/dist/commands/mark.js.map +1 -0
  82. package/dist/commands/mcp.d.ts +149 -2
  83. package/dist/commands/mcp.d.ts.map +1 -1
  84. package/dist/commands/mcp.js +80 -15
  85. package/dist/commands/mcp.js.map +1 -1
  86. package/dist/commands/registry.d.ts.map +1 -1
  87. package/dist/commands/registry.js +12 -2
  88. package/dist/commands/registry.js.map +1 -1
  89. package/dist/commands/setup.d.ts +39 -0
  90. package/dist/commands/setup.d.ts.map +1 -1
  91. package/dist/commands/setup.js +65 -50
  92. package/dist/commands/setup.js.map +1 -1
  93. package/dist/commands/share.d.ts +7 -0
  94. package/dist/commands/share.d.ts.map +1 -0
  95. package/dist/commands/share.js +129 -0
  96. package/dist/commands/share.js.map +1 -0
  97. package/dist/commands/status.d.ts.map +1 -1
  98. package/dist/commands/status.js +10 -0
  99. package/dist/commands/status.js.map +1 -1
  100. package/dist/commands/sync.d.ts +55 -0
  101. package/dist/commands/sync.d.ts.map +1 -0
  102. package/dist/commands/sync.js +278 -0
  103. package/dist/commands/sync.js.map +1 -0
  104. package/dist/commands/telemetry.d.ts +3 -3
  105. package/dist/commands/telemetry.js +6 -6
  106. package/dist/commands/telemetry.js.map +1 -1
  107. package/dist/commands/why.d.ts.map +1 -1
  108. package/dist/commands/why.js +6 -1
  109. package/dist/commands/why.js.map +1 -1
  110. package/dist/detector/detector-version.d.ts +16 -0
  111. package/dist/detector/detector-version.d.ts.map +1 -0
  112. package/dist/detector/detector-version.js +36 -0
  113. package/dist/detector/detector-version.js.map +1 -0
  114. package/dist/detector/relationship-contract.d.ts +30 -0
  115. package/dist/detector/relationship-contract.d.ts.map +1 -0
  116. package/dist/detector/relationship-contract.js +120 -0
  117. package/dist/detector/relationship-contract.js.map +1 -0
  118. package/dist/detector/relationship-contract.v1.json +53 -0
  119. package/dist/detector/relationship-prompt.d.ts +20 -0
  120. package/dist/detector/relationship-prompt.d.ts.map +1 -0
  121. package/dist/detector/relationship-prompt.js +55 -0
  122. package/dist/detector/relationship-prompt.js.map +1 -0
  123. package/dist/detector/relationship-prompt.v1.json +13 -0
  124. package/dist/detector/resolve-pair.d.ts +39 -0
  125. package/dist/detector/resolve-pair.d.ts.map +1 -0
  126. package/dist/detector/resolve-pair.js +345 -0
  127. package/dist/detector/resolve-pair.js.map +1 -0
  128. package/dist/detector/similar-item.d.ts +20 -0
  129. package/dist/detector/similar-item.d.ts.map +1 -0
  130. package/dist/detector/similar-item.js +16 -0
  131. package/dist/detector/similar-item.js.map +1 -0
  132. package/dist/index.d.ts +2 -0
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +31 -11
  135. package/dist/index.js.map +1 -1
  136. package/dist/lib/advisory-dedup.d.ts.map +1 -1
  137. package/dist/lib/advisory-dedup.js +16 -8
  138. package/dist/lib/advisory-dedup.js.map +1 -1
  139. package/dist/lib/advisory-verdict.d.ts +19 -0
  140. package/dist/lib/advisory-verdict.d.ts.map +1 -1
  141. package/dist/lib/advisory-verdict.js +6 -3
  142. package/dist/lib/advisory-verdict.js.map +1 -1
  143. package/dist/lib/backfill-state.d.ts +116 -0
  144. package/dist/lib/backfill-state.d.ts.map +1 -0
  145. package/dist/lib/backfill-state.js +342 -0
  146. package/dist/lib/backfill-state.js.map +1 -0
  147. package/dist/lib/backup-copy.d.ts +17 -0
  148. package/dist/lib/backup-copy.d.ts.map +1 -0
  149. package/dist/lib/backup-copy.js +13 -0
  150. package/dist/lib/backup-copy.js.map +1 -0
  151. package/dist/lib/backup-exclusion.d.ts +10 -0
  152. package/dist/lib/backup-exclusion.d.ts.map +1 -0
  153. package/dist/lib/backup-exclusion.js +58 -0
  154. package/dist/lib/backup-exclusion.js.map +1 -0
  155. package/dist/lib/capture-report.d.ts +22 -18
  156. package/dist/lib/capture-report.d.ts.map +1 -1
  157. package/dist/lib/capture-report.js +64 -2
  158. package/dist/lib/capture-report.js.map +1 -1
  159. package/dist/lib/cli-oauth.d.ts +2 -0
  160. package/dist/lib/cli-oauth.d.ts.map +1 -1
  161. package/dist/lib/cli-oauth.js +61 -10
  162. package/dist/lib/cli-oauth.js.map +1 -1
  163. package/dist/lib/config.d.ts +72 -1
  164. package/dist/lib/config.d.ts.map +1 -1
  165. package/dist/lib/config.js +245 -1
  166. package/dist/lib/config.js.map +1 -1
  167. package/dist/lib/confirm-timeout.d.ts +8 -0
  168. package/dist/lib/confirm-timeout.d.ts.map +1 -0
  169. package/dist/lib/confirm-timeout.js +18 -0
  170. package/dist/lib/confirm-timeout.js.map +1 -0
  171. package/dist/lib/curation/check-marks.d.ts +48 -0
  172. package/dist/lib/curation/check-marks.d.ts.map +1 -0
  173. package/dist/lib/curation/check-marks.js +81 -0
  174. package/dist/lib/curation/check-marks.js.map +1 -0
  175. package/dist/lib/curation/guardrail.d.ts +39 -0
  176. package/dist/lib/curation/guardrail.d.ts.map +1 -0
  177. package/dist/lib/curation/guardrail.js +95 -0
  178. package/dist/lib/curation/guardrail.js.map +1 -0
  179. package/dist/lib/curation/judge.d.ts +3 -0
  180. package/dist/lib/curation/judge.d.ts.map +1 -0
  181. package/dist/lib/curation/judge.js +9 -0
  182. package/dist/lib/curation/judge.js.map +1 -0
  183. package/dist/lib/curation/judgements-db.d.ts +97 -0
  184. package/dist/lib/curation/judgements-db.d.ts.map +1 -0
  185. package/dist/lib/curation/judgements-db.js +206 -0
  186. package/dist/lib/curation/judgements-db.js.map +1 -0
  187. package/dist/lib/curation/last-check.d.ts +32 -0
  188. package/dist/lib/curation/last-check.d.ts.map +1 -0
  189. package/dist/lib/curation/last-check.js +81 -0
  190. package/dist/lib/curation/last-check.js.map +1 -0
  191. package/dist/lib/curation/mark.d.ts +76 -0
  192. package/dist/lib/curation/mark.d.ts.map +1 -0
  193. package/dist/lib/curation/mark.js +361 -0
  194. package/dist/lib/curation/mark.js.map +1 -0
  195. package/dist/lib/curation/text.d.ts +6 -0
  196. package/dist/lib/curation/text.d.ts.map +1 -0
  197. package/dist/lib/curation/text.js +35 -0
  198. package/dist/lib/curation/text.js.map +1 -0
  199. package/dist/lib/destination-name.d.ts +24 -0
  200. package/dist/lib/destination-name.d.ts.map +1 -0
  201. package/dist/lib/destination-name.js +39 -0
  202. package/dist/lib/destination-name.js.map +1 -0
  203. package/dist/lib/destination-summary.d.ts +6 -0
  204. package/dist/lib/destination-summary.d.ts.map +1 -0
  205. package/dist/lib/destination-summary.js +27 -0
  206. package/dist/lib/destination-summary.js.map +1 -0
  207. package/dist/lib/destination-trust.d.ts +54 -0
  208. package/dist/lib/destination-trust.d.ts.map +1 -0
  209. package/dist/lib/destination-trust.js +107 -0
  210. package/dist/lib/destination-trust.js.map +1 -0
  211. package/dist/lib/env-resolver.d.ts.map +1 -1
  212. package/dist/lib/env-resolver.js +3 -0
  213. package/dist/lib/env-resolver.js.map +1 -1
  214. package/dist/lib/fatal.d.ts +11 -0
  215. package/dist/lib/fatal.d.ts.map +1 -0
  216. package/dist/lib/fatal.js +22 -0
  217. package/dist/lib/fatal.js.map +1 -0
  218. package/dist/lib/fetchers/capture.d.ts +49 -2
  219. package/dist/lib/fetchers/capture.d.ts.map +1 -1
  220. package/dist/lib/fetchers/capture.js +7 -1
  221. package/dist/lib/fetchers/capture.js.map +1 -1
  222. package/dist/lib/fetchers/confluence.d.ts +2 -2
  223. package/dist/lib/fetchers/confluence.d.ts.map +1 -1
  224. package/dist/lib/fetchers/confluence.js.map +1 -1
  225. package/dist/lib/fetchers/git.d.ts +1 -0
  226. package/dist/lib/fetchers/git.d.ts.map +1 -1
  227. package/dist/lib/fetchers/git.js +3 -1
  228. package/dist/lib/fetchers/git.js.map +1 -1
  229. package/dist/lib/fetchers/github.d.ts +44 -5
  230. package/dist/lib/fetchers/github.d.ts.map +1 -1
  231. package/dist/lib/fetchers/github.js +122 -5
  232. package/dist/lib/fetchers/github.js.map +1 -1
  233. package/dist/lib/fetchers/gitlab.d.ts +2 -2
  234. package/dist/lib/fetchers/gitlab.d.ts.map +1 -1
  235. package/dist/lib/fetchers/gitlab.js.map +1 -1
  236. package/dist/lib/fetchers/jira.d.ts +2 -2
  237. package/dist/lib/fetchers/jira.d.ts.map +1 -1
  238. package/dist/lib/fetchers/jira.js.map +1 -1
  239. package/dist/lib/fetchers/linear.d.ts +2 -2
  240. package/dist/lib/fetchers/linear.d.ts.map +1 -1
  241. package/dist/lib/fetchers/linear.js.map +1 -1
  242. package/dist/lib/fetchers/notion.d.ts +2 -2
  243. package/dist/lib/fetchers/notion.d.ts.map +1 -1
  244. package/dist/lib/fetchers/notion.js.map +1 -1
  245. package/dist/lib/fetchers/slack.d.ts +2 -3
  246. package/dist/lib/fetchers/slack.d.ts.map +1 -1
  247. package/dist/lib/fetchers/slack.js.map +1 -1
  248. package/dist/lib/fetchers/teams.d.ts +2 -2
  249. package/dist/lib/fetchers/teams.d.ts.map +1 -1
  250. package/dist/lib/fetchers/teams.js.map +1 -1
  251. package/dist/lib/fetchers/zoom.d.ts +2 -2
  252. package/dist/lib/fetchers/zoom.d.ts.map +1 -1
  253. package/dist/lib/fetchers/zoom.js.map +1 -1
  254. package/dist/lib/gateway-client.d.ts +40 -14
  255. package/dist/lib/gateway-client.d.ts.map +1 -1
  256. package/dist/lib/gateway-client.js +47 -19
  257. package/dist/lib/gateway-client.js.map +1 -1
  258. package/dist/lib/github-text.d.ts +3 -0
  259. package/dist/lib/github-text.d.ts.map +1 -0
  260. package/dist/lib/github-text.js +18 -0
  261. package/dist/lib/github-text.js.map +1 -0
  262. package/dist/lib/hook-context.d.ts +10 -0
  263. package/dist/lib/hook-context.d.ts.map +1 -1
  264. package/dist/lib/hook-context.js +14 -0
  265. package/dist/lib/hook-context.js.map +1 -1
  266. package/dist/lib/import-defaults.d.ts +39 -23
  267. package/dist/lib/import-defaults.d.ts.map +1 -1
  268. package/dist/lib/import-defaults.js +28 -26
  269. package/dist/lib/import-defaults.js.map +1 -1
  270. package/dist/lib/invite-prompt.d.ts +4 -4
  271. package/dist/lib/invite-prompt.d.ts.map +1 -1
  272. package/dist/lib/invite-prompt.js +4 -4
  273. package/dist/lib/invite-prompt.js.map +1 -1
  274. package/dist/lib/invite-settings.d.ts +18 -0
  275. package/dist/lib/invite-settings.d.ts.map +1 -0
  276. package/dist/lib/invite-settings.js +29 -0
  277. package/dist/lib/invite-settings.js.map +1 -0
  278. package/dist/lib/join-flow.d.ts +60 -0
  279. package/dist/lib/join-flow.d.ts.map +1 -0
  280. package/dist/lib/join-flow.js +282 -0
  281. package/dist/lib/join-flow.js.map +1 -0
  282. package/dist/lib/launch/adapters/aider.d.ts +17 -0
  283. package/dist/lib/launch/adapters/aider.d.ts.map +1 -0
  284. package/dist/lib/launch/adapters/aider.js +30 -0
  285. package/dist/lib/launch/adapters/aider.js.map +1 -0
  286. package/dist/lib/launch/adapters/auggie.d.ts +18 -0
  287. package/dist/lib/launch/adapters/auggie.d.ts.map +1 -0
  288. package/dist/lib/launch/adapters/auggie.js +34 -0
  289. package/dist/lib/launch/adapters/auggie.js.map +1 -0
  290. package/dist/lib/launch/adapters/cline.d.ts +10 -0
  291. package/dist/lib/launch/adapters/cline.d.ts.map +1 -0
  292. package/dist/lib/launch/adapters/cline.js +41 -0
  293. package/dist/lib/launch/adapters/cline.js.map +1 -0
  294. package/dist/lib/launch/adapters/continue.d.ts +22 -0
  295. package/dist/lib/launch/adapters/continue.d.ts.map +1 -0
  296. package/dist/lib/launch/adapters/continue.js +46 -0
  297. package/dist/lib/launch/adapters/continue.js.map +1 -0
  298. package/dist/lib/launch/adapters/gemini-cli.d.ts +13 -14
  299. package/dist/lib/launch/adapters/gemini-cli.d.ts.map +1 -1
  300. package/dist/lib/launch/adapters/gemini-cli.js +38 -53
  301. package/dist/lib/launch/adapters/gemini-cli.js.map +1 -1
  302. package/dist/lib/launch/adapters/goose.d.ts +20 -0
  303. package/dist/lib/launch/adapters/goose.d.ts.map +1 -0
  304. package/dist/lib/launch/adapters/goose.js +47 -0
  305. package/dist/lib/launch/adapters/goose.js.map +1 -0
  306. package/dist/lib/launch/adapters/notes.d.ts +7 -0
  307. package/dist/lib/launch/adapters/notes.d.ts.map +1 -0
  308. package/dist/lib/launch/adapters/notes.js +5 -0
  309. package/dist/lib/launch/adapters/notes.js.map +1 -0
  310. package/dist/lib/launch/agents.d.ts +2 -0
  311. package/dist/lib/launch/agents.d.ts.map +1 -1
  312. package/dist/lib/launch/agents.js +3 -1
  313. package/dist/lib/launch/agents.js.map +1 -1
  314. package/dist/lib/launch/auggie-state.d.ts +25 -0
  315. package/dist/lib/launch/auggie-state.d.ts.map +1 -0
  316. package/dist/lib/launch/auggie-state.js +74 -0
  317. package/dist/lib/launch/auggie-state.js.map +1 -0
  318. package/dist/lib/launch/cline-state.d.ts +32 -0
  319. package/dist/lib/launch/cline-state.d.ts.map +1 -0
  320. package/dist/lib/launch/cline-state.js +108 -0
  321. package/dist/lib/launch/cline-state.js.map +1 -0
  322. package/dist/lib/launch/config-writes.d.ts +4 -0
  323. package/dist/lib/launch/config-writes.d.ts.map +1 -1
  324. package/dist/lib/launch/config-writes.js +8 -3
  325. package/dist/lib/launch/config-writes.js.map +1 -1
  326. package/dist/lib/launch/continue-state.d.ts +41 -0
  327. package/dist/lib/launch/continue-state.d.ts.map +1 -0
  328. package/dist/lib/launch/continue-state.js +142 -0
  329. package/dist/lib/launch/continue-state.js.map +1 -0
  330. package/dist/lib/launch/detect.d.ts.map +1 -1
  331. package/dist/lib/launch/detect.js +3 -1
  332. package/dist/lib/launch/detect.js.map +1 -1
  333. package/dist/lib/launch/gemini-state.d.ts +26 -20
  334. package/dist/lib/launch/gemini-state.d.ts.map +1 -1
  335. package/dist/lib/launch/gemini-state.js +95 -37
  336. package/dist/lib/launch/gemini-state.js.map +1 -1
  337. package/dist/lib/launch/gemini-system-file.d.ts +17 -0
  338. package/dist/lib/launch/gemini-system-file.d.ts.map +1 -0
  339. package/dist/lib/launch/gemini-system-file.js +55 -0
  340. package/dist/lib/launch/gemini-system-file.js.map +1 -0
  341. package/dist/lib/launch/gemini-trust.d.ts +3 -1
  342. package/dist/lib/launch/gemini-trust.d.ts.map +1 -1
  343. package/dist/lib/launch/gemini-trust.js +10 -3
  344. package/dist/lib/launch/gemini-trust.js.map +1 -1
  345. package/dist/lib/launch/goose-state.d.ts +53 -0
  346. package/dist/lib/launch/goose-state.d.ts.map +1 -0
  347. package/dist/lib/launch/goose-state.js +137 -0
  348. package/dist/lib/launch/goose-state.js.map +1 -0
  349. package/dist/lib/launch/launch-files.d.ts.map +1 -1
  350. package/dist/lib/launch/launch-files.js +3 -2
  351. package/dist/lib/launch/launch-files.js.map +1 -1
  352. package/dist/lib/launch/launch.d.ts +17 -2
  353. package/dist/lib/launch/launch.d.ts.map +1 -1
  354. package/dist/lib/launch/launch.js +36 -3
  355. package/dist/lib/launch/launch.js.map +1 -1
  356. package/dist/lib/launch/mcp-child-env.d.ts +30 -0
  357. package/dist/lib/launch/mcp-child-env.d.ts.map +1 -0
  358. package/dist/lib/launch/mcp-child-env.js +154 -0
  359. package/dist/lib/launch/mcp-child-env.js.map +1 -0
  360. package/dist/lib/launch/pick-agent.d.ts.map +1 -1
  361. package/dist/lib/launch/pick-agent.js +4 -4
  362. package/dist/lib/launch/pick-agent.js.map +1 -1
  363. package/dist/lib/launch/picker-options.d.ts.map +1 -1
  364. package/dist/lib/launch/picker-options.js +7 -2
  365. package/dist/lib/launch/picker-options.js.map +1 -1
  366. package/dist/lib/launch/registry/agents/aider.d.ts +3 -0
  367. package/dist/lib/launch/registry/agents/aider.d.ts.map +1 -0
  368. package/dist/lib/launch/registry/agents/aider.js +13 -0
  369. package/dist/lib/launch/registry/agents/aider.js.map +1 -0
  370. package/dist/lib/launch/registry/agents/auggie.d.ts +3 -0
  371. package/dist/lib/launch/registry/agents/auggie.d.ts.map +1 -0
  372. package/dist/lib/launch/registry/agents/auggie.js +11 -0
  373. package/dist/lib/launch/registry/agents/auggie.js.map +1 -0
  374. package/dist/lib/launch/registry/agents/cline.d.ts +3 -0
  375. package/dist/lib/launch/registry/agents/cline.d.ts.map +1 -0
  376. package/dist/lib/launch/registry/agents/cline.js +19 -0
  377. package/dist/lib/launch/registry/agents/cline.js.map +1 -0
  378. package/dist/lib/launch/registry/agents/continue.d.ts +3 -0
  379. package/dist/lib/launch/registry/agents/continue.d.ts.map +1 -0
  380. package/dist/lib/launch/registry/agents/continue.js +20 -0
  381. package/dist/lib/launch/registry/agents/continue.js.map +1 -0
  382. package/dist/lib/launch/registry/agents/gemini-cli.js +2 -2
  383. package/dist/lib/launch/registry/agents/gemini-cli.js.map +1 -1
  384. package/dist/lib/launch/registry/agents/goose.d.ts +3 -0
  385. package/dist/lib/launch/registry/agents/goose.d.ts.map +1 -0
  386. package/dist/lib/launch/registry/agents/goose.js +20 -0
  387. package/dist/lib/launch/registry/agents/goose.js.map +1 -0
  388. package/dist/lib/launch/registry/index.d.ts +1 -1
  389. package/dist/lib/launch/registry/index.d.ts.map +1 -1
  390. package/dist/lib/launch/registry/index.js +7 -2
  391. package/dist/lib/launch/registry/index.js.map +1 -1
  392. package/dist/lib/launch/registry/types.d.ts +12 -1
  393. package/dist/lib/launch/registry/types.d.ts.map +1 -1
  394. package/dist/lib/launch/strict-entry.d.ts +22 -2
  395. package/dist/lib/launch/strict-entry.d.ts.map +1 -1
  396. package/dist/lib/launch/strict-entry.js +80 -2
  397. package/dist/lib/launch/strict-entry.js.map +1 -1
  398. package/dist/lib/launch/yaml-scan.d.ts +59 -0
  399. package/dist/lib/launch/yaml-scan.d.ts.map +1 -0
  400. package/dist/lib/launch/yaml-scan.js +275 -0
  401. package/dist/lib/launch/yaml-scan.js.map +1 -0
  402. package/dist/lib/lead-prompt.d.ts +106 -0
  403. package/dist/lib/lead-prompt.d.ts.map +1 -0
  404. package/dist/lib/lead-prompt.js +175 -0
  405. package/dist/lib/lead-prompt.js.map +1 -0
  406. package/dist/lib/local-candidate-classify.d.ts +26 -0
  407. package/dist/lib/local-candidate-classify.d.ts.map +1 -0
  408. package/dist/lib/local-candidate-classify.js +53 -0
  409. package/dist/lib/local-candidate-classify.js.map +1 -0
  410. package/dist/lib/local-db-epoch.d.ts +4 -0
  411. package/dist/lib/local-db-epoch.d.ts.map +1 -0
  412. package/dist/lib/local-db-epoch.js +19 -0
  413. package/dist/lib/local-db-epoch.js.map +1 -0
  414. package/dist/lib/local-db-migrate.d.ts +85 -0
  415. package/dist/lib/local-db-migrate.d.ts.map +1 -0
  416. package/dist/lib/local-db-migrate.js +528 -0
  417. package/dist/lib/local-db-migrate.js.map +1 -0
  418. package/dist/lib/local-db-v10.d.ts +28 -0
  419. package/dist/lib/local-db-v10.d.ts.map +1 -0
  420. package/dist/lib/local-db-v10.js +49 -0
  421. package/dist/lib/local-db-v10.js.map +1 -0
  422. package/dist/lib/local-db-v11.d.ts +24 -0
  423. package/dist/lib/local-db-v11.d.ts.map +1 -0
  424. package/dist/lib/local-db-v11.js +25 -0
  425. package/dist/lib/local-db-v11.js.map +1 -0
  426. package/dist/lib/local-db-v12.d.ts +17 -0
  427. package/dist/lib/local-db-v12.d.ts.map +1 -0
  428. package/dist/lib/local-db-v12.js +8 -0
  429. package/dist/lib/local-db-v12.js.map +1 -0
  430. package/dist/lib/local-db-v7.d.ts +30 -0
  431. package/dist/lib/local-db-v7.d.ts.map +1 -0
  432. package/dist/lib/local-db-v7.js +285 -0
  433. package/dist/lib/local-db-v7.js.map +1 -0
  434. package/dist/lib/local-db-v8.d.ts +22 -0
  435. package/dist/lib/local-db-v8.d.ts.map +1 -0
  436. package/dist/lib/local-db-v8.js +33 -0
  437. package/dist/lib/local-db-v8.js.map +1 -0
  438. package/dist/lib/local-db-v9.d.ts +10 -0
  439. package/dist/lib/local-db-v9.d.ts.map +1 -0
  440. package/dist/lib/local-db-v9.js +8 -0
  441. package/dist/lib/local-db-v9.js.map +1 -0
  442. package/dist/lib/local-db.d.ts +73 -23
  443. package/dist/lib/local-db.d.ts.map +1 -1
  444. package/dist/lib/local-db.js +225 -375
  445. package/dist/lib/local-db.js.map +1 -1
  446. package/dist/lib/local-embeddings.d.ts.map +1 -1
  447. package/dist/lib/local-embeddings.js +2 -2
  448. package/dist/lib/local-embeddings.js.map +1 -1
  449. package/dist/lib/local-gateway-client.d.ts +31 -87
  450. package/dist/lib/local-gateway-client.d.ts.map +1 -1
  451. package/dist/lib/local-gateway-client.js +209 -187
  452. package/dist/lib/local-gateway-client.js.map +1 -1
  453. package/dist/lib/local-ingest.d.ts +131 -0
  454. package/dist/lib/local-ingest.d.ts.map +1 -0
  455. package/dist/lib/local-ingest.js +81 -0
  456. package/dist/lib/local-ingest.js.map +1 -0
  457. package/dist/lib/local-link-pass.d.ts +15 -0
  458. package/dist/lib/local-link-pass.d.ts.map +1 -0
  459. package/dist/lib/local-link-pass.js +57 -0
  460. package/dist/lib/local-link-pass.js.map +1 -0
  461. package/dist/lib/local-llm.d.ts +1 -1
  462. package/dist/lib/local-llm.d.ts.map +1 -1
  463. package/dist/lib/local-llm.js +3 -2
  464. package/dist/lib/local-llm.js.map +1 -1
  465. package/dist/lib/local-mode.d.ts +9 -2
  466. package/dist/lib/local-mode.d.ts.map +1 -1
  467. package/dist/lib/local-mode.js +27 -7
  468. package/dist/lib/local-mode.js.map +1 -1
  469. package/dist/lib/local-provenance.d.ts +14 -0
  470. package/dist/lib/local-provenance.d.ts.map +1 -0
  471. package/dist/lib/local-provenance.js +14 -0
  472. package/dist/lib/local-provenance.js.map +1 -0
  473. package/dist/lib/local-relationship-classifier.d.ts +4 -0
  474. package/dist/lib/local-relationship-classifier.d.ts.map +1 -1
  475. package/dist/lib/local-relationship-classifier.js +9 -4
  476. package/dist/lib/local-relationship-classifier.js.map +1 -1
  477. package/dist/lib/local-relink.d.ts +59 -0
  478. package/dist/lib/local-relink.d.ts.map +1 -0
  479. package/dist/lib/local-relink.js +171 -0
  480. package/dist/lib/local-relink.js.map +1 -0
  481. package/dist/lib/local-set-classifier.d.ts +36 -0
  482. package/dist/lib/local-set-classifier.d.ts.map +1 -0
  483. package/dist/lib/local-set-classifier.js +81 -0
  484. package/dist/lib/local-set-classifier.js.map +1 -0
  485. package/dist/lib/local-snapshot-loader.d.ts +29 -0
  486. package/dist/lib/local-snapshot-loader.d.ts.map +1 -0
  487. package/dist/lib/local-snapshot-loader.js +108 -0
  488. package/dist/lib/local-snapshot-loader.js.map +1 -0
  489. package/dist/lib/local-thresholds.d.ts +70 -0
  490. package/dist/lib/local-thresholds.d.ts.map +1 -0
  491. package/dist/lib/local-thresholds.js +79 -0
  492. package/dist/lib/local-thresholds.js.map +1 -0
  493. package/dist/lib/login-flow.d.ts +15 -0
  494. package/dist/lib/login-flow.d.ts.map +1 -1
  495. package/dist/lib/login-flow.js +80 -4
  496. package/dist/lib/login-flow.js.map +1 -1
  497. package/dist/lib/mcp/mark-tool.d.ts +27 -0
  498. package/dist/lib/mcp/mark-tool.d.ts.map +1 -0
  499. package/dist/lib/mcp/mark-tool.js +103 -0
  500. package/dist/lib/mcp/mark-tool.js.map +1 -0
  501. package/dist/lib/mcp/share-status-tool.d.ts +13 -0
  502. package/dist/lib/mcp/share-status-tool.d.ts.map +1 -0
  503. package/dist/lib/mcp/share-status-tool.js +116 -0
  504. package/dist/lib/mcp/share-status-tool.js.map +1 -0
  505. package/dist/lib/mcp/share-tool.d.ts +50 -0
  506. package/dist/lib/mcp/share-tool.d.ts.map +1 -0
  507. package/dist/lib/mcp/share-tool.js +174 -0
  508. package/dist/lib/mcp/share-tool.js.map +1 -0
  509. package/dist/lib/mcp/tool-rules.d.ts +30 -0
  510. package/dist/lib/mcp/tool-rules.d.ts.map +1 -0
  511. package/dist/lib/mcp/tool-rules.js +84 -0
  512. package/dist/lib/mcp/tool-rules.js.map +1 -0
  513. package/dist/lib/mcp-backfill.d.ts +89 -0
  514. package/dist/lib/mcp-backfill.d.ts.map +1 -0
  515. package/dist/lib/mcp-backfill.js +194 -0
  516. package/dist/lib/mcp-backfill.js.map +1 -0
  517. package/dist/lib/mcp-scope.d.ts +90 -0
  518. package/dist/lib/mcp-scope.d.ts.map +1 -0
  519. package/dist/lib/mcp-scope.js +125 -0
  520. package/dist/lib/mcp-scope.js.map +1 -0
  521. package/dist/lib/mcp-sync.d.ts +64 -0
  522. package/dist/lib/mcp-sync.d.ts.map +1 -0
  523. package/dist/lib/mcp-sync.js +183 -0
  524. package/dist/lib/mcp-sync.js.map +1 -0
  525. package/dist/lib/model-cache.d.ts +10 -0
  526. package/dist/lib/model-cache.d.ts.map +1 -0
  527. package/dist/lib/model-cache.js +35 -0
  528. package/dist/lib/model-cache.js.map +1 -0
  529. package/dist/lib/next-step.d.ts.map +1 -1
  530. package/dist/lib/next-step.js +2 -1
  531. package/dist/lib/next-step.js.map +1 -1
  532. package/dist/lib/personal-import.d.ts +7 -0
  533. package/dist/lib/personal-import.d.ts.map +1 -1
  534. package/dist/lib/personal-import.js +13 -1
  535. package/dist/lib/personal-import.js.map +1 -1
  536. package/dist/lib/private-files.d.ts +33 -0
  537. package/dist/lib/private-files.d.ts.map +1 -0
  538. package/dist/lib/private-files.js +96 -0
  539. package/dist/lib/private-files.js.map +1 -0
  540. package/dist/lib/redaction-notice.d.ts +7 -0
  541. package/dist/lib/redaction-notice.d.ts.map +1 -0
  542. package/dist/lib/redaction-notice.js +32 -0
  543. package/dist/lib/redaction-notice.js.map +1 -0
  544. package/dist/lib/relink-estimate.d.ts +16 -0
  545. package/dist/lib/relink-estimate.d.ts.map +1 -0
  546. package/dist/lib/relink-estimate.js +30 -0
  547. package/dist/lib/relink-estimate.js.map +1 -0
  548. package/dist/lib/resolve-env.d.ts +15 -1
  549. package/dist/lib/resolve-env.d.ts.map +1 -1
  550. package/dist/lib/resolve-env.js +27 -7
  551. package/dist/lib/resolve-env.js.map +1 -1
  552. package/dist/lib/safe-config-write.d.ts.map +1 -1
  553. package/dist/lib/safe-config-write.js +39 -2
  554. package/dist/lib/safe-config-write.js.map +1 -1
  555. package/dist/lib/scope-choices.d.ts +51 -0
  556. package/dist/lib/scope-choices.d.ts.map +1 -0
  557. package/dist/lib/scope-choices.js +193 -0
  558. package/dist/lib/scope-choices.js.map +1 -0
  559. package/dist/lib/scope-connect.d.ts +82 -0
  560. package/dist/lib/scope-connect.d.ts.map +1 -0
  561. package/dist/lib/scope-connect.js +258 -0
  562. package/dist/lib/scope-connect.js.map +1 -0
  563. package/dist/lib/scope-defaults.d.ts +3 -0
  564. package/dist/lib/scope-defaults.d.ts.map +1 -0
  565. package/dist/lib/scope-defaults.js +44 -0
  566. package/dist/lib/scope-defaults.js.map +1 -0
  567. package/dist/lib/scope-real.d.ts +280 -0
  568. package/dist/lib/scope-real.d.ts.map +1 -0
  569. package/dist/lib/scope-real.js +58 -0
  570. package/dist/lib/scope-real.js.map +1 -0
  571. package/dist/lib/scope-values.d.ts +76 -0
  572. package/dist/lib/scope-values.d.ts.map +1 -0
  573. package/dist/lib/scope-values.js +169 -0
  574. package/dist/lib/scope-values.js.map +1 -0
  575. package/dist/lib/scope.d.ts +161 -0
  576. package/dist/lib/scope.d.ts.map +1 -0
  577. package/dist/lib/scope.js +323 -0
  578. package/dist/lib/scope.js.map +1 -0
  579. package/dist/lib/setup-route.d.ts +4 -2
  580. package/dist/lib/setup-route.d.ts.map +1 -1
  581. package/dist/lib/setup-route.js +12 -6
  582. package/dist/lib/setup-route.js.map +1 -1
  583. package/dist/lib/share/approval.d.ts +71 -0
  584. package/dist/lib/share/approval.d.ts.map +1 -0
  585. package/dist/lib/share/approval.js +139 -0
  586. package/dist/lib/share/approval.js.map +1 -0
  587. package/dist/lib/share/approve-link.d.ts +31 -0
  588. package/dist/lib/share/approve-link.d.ts.map +1 -0
  589. package/dist/lib/share/approve-link.js +46 -0
  590. package/dist/lib/share/approve-link.js.map +1 -0
  591. package/dist/lib/share/browser-flow.d.ts +85 -0
  592. package/dist/lib/share/browser-flow.d.ts.map +1 -0
  593. package/dist/lib/share/browser-flow.js +168 -0
  594. package/dist/lib/share/browser-flow.js.map +1 -0
  595. package/dist/lib/share/command.d.ts +65 -0
  596. package/dist/lib/share/command.d.ts.map +1 -0
  597. package/dist/lib/share/command.js +278 -0
  598. package/dist/lib/share/command.js.map +1 -0
  599. package/dist/lib/share/delivery-options.d.ts +15 -0
  600. package/dist/lib/share/delivery-options.d.ts.map +1 -0
  601. package/dist/lib/share/delivery-options.js +16 -0
  602. package/dist/lib/share/delivery-options.js.map +1 -0
  603. package/dist/lib/share/delivery.d.ts +83 -0
  604. package/dist/lib/share/delivery.d.ts.map +1 -0
  605. package/dist/lib/share/delivery.js +134 -0
  606. package/dist/lib/share/delivery.js.map +1 -0
  607. package/dist/lib/share/envelope.d.ts +61 -0
  608. package/dist/lib/share/envelope.d.ts.map +1 -0
  609. package/dist/lib/share/envelope.js +99 -0
  610. package/dist/lib/share/envelope.js.map +1 -0
  611. package/dist/lib/share/ledger.d.ts +59 -0
  612. package/dist/lib/share/ledger.d.ts.map +1 -0
  613. package/dist/lib/share/ledger.js +137 -0
  614. package/dist/lib/share/ledger.js.map +1 -0
  615. package/dist/lib/share/payload.d.ts +101 -0
  616. package/dist/lib/share/payload.d.ts.map +1 -0
  617. package/dist/lib/share/payload.js +147 -0
  618. package/dist/lib/share/payload.js.map +1 -0
  619. package/dist/lib/share/pending.d.ts +94 -0
  620. package/dist/lib/share/pending.d.ts.map +1 -0
  621. package/dist/lib/share/pending.js +256 -0
  622. package/dist/lib/share/pending.js.map +1 -0
  623. package/dist/lib/share/preview.d.ts +22 -0
  624. package/dist/lib/share/preview.d.ts.map +1 -0
  625. package/dist/lib/share/preview.js +74 -0
  626. package/dist/lib/share/preview.js.map +1 -0
  627. package/dist/lib/share/qr.d.ts +13 -0
  628. package/dist/lib/share/qr.d.ts.map +1 -0
  629. package/dist/lib/share/qr.js +77 -0
  630. package/dist/lib/share/qr.js.map +1 -0
  631. package/dist/lib/share/requests-client.d.ts +63 -0
  632. package/dist/lib/share/requests-client.d.ts.map +1 -0
  633. package/dist/lib/share/requests-client.js +69 -0
  634. package/dist/lib/share/requests-client.js.map +1 -0
  635. package/dist/lib/share/run.d.ts +134 -0
  636. package/dist/lib/share/run.d.ts.map +1 -0
  637. package/dist/lib/share/run.js +278 -0
  638. package/dist/lib/share/run.js.map +1 -0
  639. package/dist/lib/share/salt.d.ts +2 -0
  640. package/dist/lib/share/salt.d.ts.map +1 -0
  641. package/dist/lib/share/salt.js +44 -0
  642. package/dist/lib/share/salt.js.map +1 -0
  643. package/dist/lib/share/secret-patterns.json +100 -0
  644. package/dist/lib/share/secret-scan.d.ts +24 -0
  645. package/dist/lib/share/secret-scan.d.ts.map +1 -0
  646. package/dist/lib/share/secret-scan.js +116 -0
  647. package/dist/lib/share/secret-scan.js.map +1 -0
  648. package/dist/lib/share/target.d.ts +38 -0
  649. package/dist/lib/share/target.d.ts.map +1 -0
  650. package/dist/lib/share/target.js +80 -0
  651. package/dist/lib/share/target.js.map +1 -0
  652. package/dist/lib/share/tty.d.ts +12 -0
  653. package/dist/lib/share/tty.d.ts.map +1 -0
  654. package/dist/lib/share/tty.js +102 -0
  655. package/dist/lib/share/tty.js.map +1 -0
  656. package/dist/lib/share/visible.d.ts +4 -0
  657. package/dist/lib/share/visible.d.ts.map +1 -0
  658. package/dist/lib/share/visible.js +30 -0
  659. package/dist/lib/share/visible.js.map +1 -0
  660. package/dist/lib/share/wire.d.ts +98 -0
  661. package/dist/lib/share/wire.d.ts.map +1 -0
  662. package/dist/lib/share/wire.js +43 -0
  663. package/dist/lib/share/wire.js.map +1 -0
  664. package/dist/lib/similarity/embedding-matrix.d.ts +64 -0
  665. package/dist/lib/similarity/embedding-matrix.d.ts.map +1 -0
  666. package/dist/lib/similarity/embedding-matrix.js +119 -0
  667. package/dist/lib/similarity/embedding-matrix.js.map +1 -0
  668. package/dist/lib/since-flag.d.ts +11 -0
  669. package/dist/lib/since-flag.d.ts.map +1 -0
  670. package/dist/lib/since-flag.js +24 -0
  671. package/dist/lib/since-flag.js.map +1 -0
  672. package/dist/lib/since.d.ts +59 -0
  673. package/dist/lib/since.d.ts.map +1 -0
  674. package/dist/lib/since.js +86 -0
  675. package/dist/lib/since.js.map +1 -0
  676. package/dist/lib/source-key.d.ts +13 -0
  677. package/dist/lib/source-key.d.ts.map +1 -0
  678. package/dist/lib/source-key.js +60 -0
  679. package/dist/lib/source-key.js.map +1 -0
  680. package/dist/lib/source-sync-state.d.ts +12 -0
  681. package/dist/lib/source-sync-state.d.ts.map +1 -0
  682. package/dist/lib/source-sync-state.js +45 -0
  683. package/dist/lib/source-sync-state.js.map +1 -0
  684. package/dist/lib/startup-backfill-track.d.ts +2 -0
  685. package/dist/lib/startup-backfill-track.d.ts.map +1 -0
  686. package/dist/lib/startup-backfill-track.js +6 -0
  687. package/dist/lib/startup-backfill-track.js.map +1 -0
  688. package/dist/lib/startup-xdg.d.ts +2 -0
  689. package/dist/lib/startup-xdg.d.ts.map +1 -0
  690. package/dist/lib/startup-xdg.js +9 -0
  691. package/dist/lib/startup-xdg.js.map +1 -0
  692. package/dist/lib/sync/after-connect.d.ts +2 -0
  693. package/dist/lib/sync/after-connect.d.ts.map +1 -0
  694. package/dist/lib/sync/after-connect.js +18 -0
  695. package/dist/lib/sync/after-connect.js.map +1 -0
  696. package/dist/lib/sync/bg-claim.d.ts +14 -0
  697. package/dist/lib/sync/bg-claim.d.ts.map +1 -0
  698. package/dist/lib/sync/bg-claim.js +97 -0
  699. package/dist/lib/sync/bg-claim.js.map +1 -0
  700. package/dist/lib/sync/blocked.d.ts +8 -0
  701. package/dist/lib/sync/blocked.d.ts.map +1 -0
  702. package/dist/lib/sync/blocked.js +45 -0
  703. package/dist/lib/sync/blocked.js.map +1 -0
  704. package/dist/lib/sync/classify.d.ts +34 -0
  705. package/dist/lib/sync/classify.d.ts.map +1 -0
  706. package/dist/lib/sync/classify.js +93 -0
  707. package/dist/lib/sync/classify.js.map +1 -0
  708. package/dist/lib/sync/drain.d.ts +16 -0
  709. package/dist/lib/sync/drain.d.ts.map +1 -0
  710. package/dist/lib/sync/drain.js +33 -0
  711. package/dist/lib/sync/drain.js.map +1 -0
  712. package/dist/lib/sync/forget.d.ts +12 -0
  713. package/dist/lib/sync/forget.d.ts.map +1 -0
  714. package/dist/lib/sync/forget.js +32 -0
  715. package/dist/lib/sync/forget.js.map +1 -0
  716. package/dist/lib/sync/launch-hook.d.ts +42 -0
  717. package/dist/lib/sync/launch-hook.d.ts.map +1 -0
  718. package/dist/lib/sync/launch-hook.js +117 -0
  719. package/dist/lib/sync/launch-hook.js.map +1 -0
  720. package/dist/lib/sync/lock.d.ts +35 -0
  721. package/dist/lib/sync/lock.d.ts.map +1 -0
  722. package/dist/lib/sync/lock.js +175 -0
  723. package/dist/lib/sync/lock.js.map +1 -0
  724. package/dist/lib/sync/purge.d.ts +38 -0
  725. package/dist/lib/sync/purge.d.ts.map +1 -0
  726. package/dist/lib/sync/purge.js +61 -0
  727. package/dist/lib/sync/purge.js.map +1 -0
  728. package/dist/lib/sync/real-env.d.ts +265 -0
  729. package/dist/lib/sync/real-env.d.ts.map +1 -0
  730. package/dist/lib/sync/real-env.js +47 -0
  731. package/dist/lib/sync/real-env.js.map +1 -0
  732. package/dist/lib/sync/relink.d.ts +14 -0
  733. package/dist/lib/sync/relink.d.ts.map +1 -0
  734. package/dist/lib/sync/relink.js +36 -0
  735. package/dist/lib/sync/relink.js.map +1 -0
  736. package/dist/lib/sync/report.d.ts +3 -0
  737. package/dist/lib/sync/report.d.ts.map +1 -0
  738. package/dist/lib/sync/report.js +54 -0
  739. package/dist/lib/sync/report.js.map +1 -0
  740. package/dist/lib/sync/run-all.d.ts +23 -0
  741. package/dist/lib/sync/run-all.d.ts.map +1 -0
  742. package/dist/lib/sync/run-all.js +30 -0
  743. package/dist/lib/sync/run-all.js.map +1 -0
  744. package/dist/lib/sync/run-source.d.ts +73 -0
  745. package/dist/lib/sync/run-source.d.ts.map +1 -0
  746. package/dist/lib/sync/run-source.js +262 -0
  747. package/dist/lib/sync/run-source.js.map +1 -0
  748. package/dist/lib/sync/safe-read.d.ts +4 -0
  749. package/dist/lib/sync/safe-read.d.ts.map +1 -0
  750. package/dist/lib/sync/safe-read.js +40 -0
  751. package/dist/lib/sync/safe-read.js.map +1 -0
  752. package/dist/lib/sync/should-background-sync.d.ts +31 -0
  753. package/dist/lib/sync/should-background-sync.d.ts.map +1 -0
  754. package/dist/lib/sync/should-background-sync.js +69 -0
  755. package/dist/lib/sync/should-background-sync.js.map +1 -0
  756. package/dist/lib/sync/source-ids.d.ts +10 -0
  757. package/dist/lib/sync/source-ids.d.ts.map +1 -0
  758. package/dist/lib/sync/source-ids.js +9 -0
  759. package/dist/lib/sync/source-ids.js.map +1 -0
  760. package/dist/lib/sync/sources.d.ts +33 -0
  761. package/dist/lib/sync/sources.d.ts.map +1 -0
  762. package/dist/lib/sync/sources.js +37 -0
  763. package/dist/lib/sync/sources.js.map +1 -0
  764. package/dist/lib/sync/spawn-background.d.ts +27 -0
  765. package/dist/lib/sync/spawn-background.d.ts.map +1 -0
  766. package/dist/lib/sync/spawn-background.js +66 -0
  767. package/dist/lib/sync/spawn-background.js.map +1 -0
  768. package/dist/lib/sync/status.d.ts +57 -0
  769. package/dist/lib/sync/status.d.ts.map +1 -0
  770. package/dist/lib/sync/status.js +166 -0
  771. package/dist/lib/sync/status.js.map +1 -0
  772. package/dist/lib/sync/summary-read.d.ts +19 -0
  773. package/dist/lib/sync/summary-read.d.ts.map +1 -0
  774. package/dist/lib/sync/summary-read.js +39 -0
  775. package/dist/lib/sync/summary-read.js.map +1 -0
  776. package/dist/lib/sync/summary.d.ts +10 -0
  777. package/dist/lib/sync/summary.d.ts.map +1 -0
  778. package/dist/lib/sync/summary.js +80 -0
  779. package/dist/lib/sync/summary.js.map +1 -0
  780. package/dist/lib/sync/sync-state.d.ts +128 -0
  781. package/dist/lib/sync/sync-state.d.ts.map +1 -0
  782. package/dist/lib/sync/sync-state.js +255 -0
  783. package/dist/lib/sync/sync-state.js.map +1 -0
  784. package/dist/lib/sync/telemetry.d.ts +20 -0
  785. package/dist/lib/sync/telemetry.d.ts.map +1 -0
  786. package/dist/lib/sync/telemetry.js +31 -0
  787. package/dist/lib/sync/telemetry.js.map +1 -0
  788. package/dist/lib/sync/threads.d.ts +48 -0
  789. package/dist/lib/sync/threads.d.ts.map +1 -0
  790. package/dist/lib/sync/threads.js +82 -0
  791. package/dist/lib/sync/threads.js.map +1 -0
  792. package/dist/lib/sync/window.d.ts +72 -0
  793. package/dist/lib/sync/window.d.ts.map +1 -0
  794. package/dist/lib/sync/window.js +112 -0
  795. package/dist/lib/sync/window.js.map +1 -0
  796. package/dist/lib/team-cta.d.ts +11 -0
  797. package/dist/lib/team-cta.d.ts.map +1 -0
  798. package/dist/lib/team-cta.js +16 -0
  799. package/dist/lib/team-cta.js.map +1 -0
  800. package/dist/lib/telemetry-ci.d.ts +2 -0
  801. package/dist/lib/telemetry-ci.d.ts.map +1 -0
  802. package/dist/lib/telemetry-ci.js +21 -0
  803. package/dist/lib/telemetry-ci.js.map +1 -0
  804. package/dist/lib/telemetry-consent.d.ts +44 -23
  805. package/dist/lib/telemetry-consent.d.ts.map +1 -1
  806. package/dist/lib/telemetry-consent.js +74 -35
  807. package/dist/lib/telemetry-consent.js.map +1 -1
  808. package/dist/lib/telemetry-env.d.ts +1 -1
  809. package/dist/lib/usage-telemetry.d.ts +89 -24
  810. package/dist/lib/usage-telemetry.d.ts.map +1 -1
  811. package/dist/lib/usage-telemetry.js +283 -76
  812. package/dist/lib/usage-telemetry.js.map +1 -1
  813. package/dist/lib/xdg.d.ts +27 -0
  814. package/dist/lib/xdg.d.ts.map +1 -0
  815. package/dist/lib/xdg.js +56 -0
  816. package/dist/lib/xdg.js.map +1 -0
  817. package/package.json +6 -3
  818. package/dist/commands/push.d.ts +0 -25
  819. package/dist/commands/push.d.ts.map +0 -1
  820. package/dist/commands/push.js +0 -98
  821. package/dist/commands/push.js.map +0 -1
  822. package/dist/lib/personal-email-domains.d.ts +0 -8
  823. package/dist/lib/personal-email-domains.d.ts.map +0 -1
  824. package/dist/lib/personal-email-domains.js +0 -39
  825. package/dist/lib/personal-email-domains.js.map +0 -1
@@ -1,111 +1,27 @@
1
- import { createLocalDb, normaliseDecidedAt } from './local-db.js';
1
+ import { createLocalDb, identifyingSourceUrl, normaliseDecidedAt } from './local-db.js';
2
2
  import { deriveDeciderKind } from './decider-kind.js';
3
+ import { provenanceOf } from './local-provenance.js';
3
4
  import { currentRepoIdentity, repoFromSourceUrl } from './repo-identity.js';
4
5
  import { cosineSimilarity, EMBEDDING_MODEL_ID, getEmbedding } from './local-embeddings.js';
5
- import { classifyRelationship } from './local-relationship-classifier.js';
6
- import { hasConfiguredProvider, noProviderHintInline, RECOMMENDED_OLLAMA_PULL } from './local-llm.js';
6
+ import { classifyCandidates } from './local-candidate-classify.js';
7
+ import { noProviderHintInline, RECOMMENDED_OLLAMA_PULL } from './local-llm.js';
7
8
  import { repositoryOf } from './decision-links.js';
8
9
  import { localCitationFor } from './commit-cite.js';
9
10
  import { extractRefs, refIdentityFor } from './decision-refs.js';
10
11
  import { contentWordQuery } from './search-query.js';
11
- /**
12
- * Cosine floor for linking two decisions as related on ingest.
13
- *
14
- * Named CONFLICT_THRESHOLD until ALI-503, which was the same category error as the code
15
- * it governed: the value decides similarity, and similarity is not opposition. The
16
- * classifier prompt in local-relationship-classifier.ts says so directly - "high textual
17
- * similarity alone is NOT a conflict" - and the link written here is `relates` because an
18
- * embedding cannot tell agreement from opposition. Only a classifier reading both can, and
19
- * its verdict is never persisted as a link.
20
- */
21
- export const SIMILARITY_THRESHOLD = 0.65;
22
- /**
23
- * Relevance floor for align_ask / align_search.
24
- *
25
- * Was an inline 0.1, the only unnamed threshold in this file and less than a quarter of
26
- * its neighbours. It let align_ask answer "what happens when the brain service is down"
27
- * with two unrelated decisions at 0.18 and 0.14 - noise the agent had to recognise by
28
- * reading the decimals itself, and an audience cannot.
29
- *
30
- * 0.25 matches the gateway's own /decisions/smart-search floor, so the same question gets
31
- * the same relevance bar in local and cloud mode. Lower than the 0.45 used for relatedness
32
- * on purpose: search is a human asking a natural-language question, where a looser match is
33
- * still worth showing, while relatedness is machinery acting on its own.
34
- *
35
- * An honest empty result is the point. "The graph has nothing on this" is a better answer
36
- * than two wrong decisions, because the caller can act on it.
37
- */
38
- export const SEARCH_THRESHOLD = 0.25;
39
- /**
40
- * Candidate floor for ADJUDICATION - the path that then pays an LLM per candidate.
41
- *
42
- * Deliberately higher than the retrieval floor below, because this surface is expensive in
43
- * three ways the hook is not: up to 5 sequential calls to the user's own provider, ~11s of
44
- * latency, and an exit code. A keyless CI runner that gets `no-context` today exits 0; the
45
- * moment retrieval finds anything it gets `unknown` and exits 2. And the classifier cannot
46
- * reject a candidate - its vocabulary is ten positive relations with no "unrelated" - so a
47
- * loose candidate that reaches it is reported rather than filtered.
48
- *
49
- * Deliberately NOT recalibrated with the retrieval floor. Measured on the corpus, 0.30 would
50
- * recover four more related pairs here too, and that trade is a separate decision with a
51
- * separate blast radius (see relatedness-calibration.test.ts).
52
- */
53
- export const RELATES_THRESHOLD = 0.45;
54
- /**
55
- * Candidate floor for RETRIEVAL ONLY (`depth: 'related'`, the agent editor hook).
56
- *
57
- * Measured, not chosen. Against fixtures/relatedness-corpus.json: 0.45 recovered 3 of 8 related
58
- * pairs, 0.30 recovers 7 of 8, and neither admits a single unrelated pair. 0.25 scores the same
59
- * 7 of 8, so the tie-break is margin over the worst false positive (0.2051): 0.30 clears it by
60
- * 0.095 against 0.25's 0.045.
61
- *
62
- * 0.30 is also where this constant sat until commit 0cbef08 raised it to 0.45 inside a rename,
63
- * unmentioned and unmeasured. So this is a revert with evidence attached rather than a new
64
- * guess, and the evidence is a test that fails if the corpus stops supporting it.
65
- *
66
- * Safe to be looser here precisely because this path is cheap and honest: it returns above
67
- * Stage 2, so it makes no provider call, and what the hook prints declines to assert anything
68
- * ("related by content search and have NOT been adjudicated"). That is the same posture as
69
- * `align search`, which has run at 0.25 all along - as has MCP `align_get_related_decisions`.
70
- */
71
- export const RETRIEVAL_RELATES_THRESHOLD = 0.3;
72
- // ALI-785: the ABSOLUTE floor above is unreachable for cross-register pairs on
73
- // MiniLM-L6 - measured on a 403-decision six-source corpus, near-duplicates score
74
- // ~0.95, genuine cross-tool paraphrases 0.45-0.62, background noise 0.28-0.40, and
75
- // 0 of 1,729 links crossed a platform. So linking also takes each item's top few
76
- // neighbours RELATIVE to its own ranking, floored where the noise band ends. 0.45 is
77
- // the adjudication floor the product already uses elsewhere; text-cleaning schemes
78
- // were lab-tested first and moved nothing (title+cleaned scored 0.274 vs 0.286 raw).
79
- export const RELATED_TOP_K = 3;
80
- export const RELATED_FLOOR = RELATES_THRESHOLD;
81
- /**
82
- * ALI-1065: the capture-time classification budget. Only the high-confidence tier
83
- * (score >= SIMILARITY_THRESHOLD) is ever classified - the lower related-only tier stays
84
- * a plain cosine `relates` edge, because typing a merely-related pair is exactly the
85
- * manufactured-detection failure ALI-503 removed from the conflict counters.
86
- *
87
- * Capped at 3 regardless of how many candidates clear the high-confidence bar, and skipped
88
- * entirely (0 calls) with no provider configured - see ingestOne. Worst case: 3 classifier
89
- * calls per capture, each a single LLM round trip. Typical capture (0-1 near-duplicates)
90
- * costs 0-1 calls.
91
- */
92
- export const CAPTURE_CLASSIFY_TOP_K = 3;
93
- // Below this similarity between a decision and new content, the content is
94
- // considered to have drifted from the decision.
95
- export const DRIFT_THRESHOLD = 0.5;
96
- /**
97
- * ALI-831: the provenance every decision payload carries, in wire spelling, so an agent
98
- * reading this server can tell a claim from a rule. `ratified` is a boolean beside the
99
- * stamp rather than instead of it: a consumer branches on the boolean and cites the stamp.
100
- * A NULL column (a row from before the column existed) reads 'unknown', never a guess.
101
- */
102
- function provenanceOf(row) {
103
- return {
104
- decider_kind: row.deciderKind ?? 'unknown',
105
- ratified: row.ratifiedAt !== null,
106
- ...(row.ratifiedAt ? { ratified_at: row.ratifiedAt, ratified_by: row.ratifiedBy } : {}),
107
- };
108
- }
12
+ import { linkPass } from './local-link-pass.js';
13
+ import { redactSecrets } from './share/secret-scan.js';
14
+ import { noteRedacted } from './redaction-notice.js';
15
+ import { EmbeddingMatrix, MATRIX_MAX_ROWS } from './similarity/embedding-matrix.js';
16
+ import { captureFieldsForUrl, ingestStep } from './local-ingest.js';
17
+ import { annotatePairs, anyJudgements, reviewConflicts } from './curation/guardrail.js';
18
+ import { defaultJudge } from './curation/judge.js';
19
+ import { bannerFor, checkNotes, emptyCheck, offeredFiles, splitRetrieved } from './curation/check-marks.js';
20
+ import { notADecisionMarks } from './curation/judgements-db.js';
21
+ import { contextKeyFor, filesFromDiff } from './curation/mark.js';
22
+ import { DRIFT_THRESHOLD, RELATED_FLOOR, RELATED_TOP_K, RELATES_THRESHOLD, RETRIEVAL_RELATES_THRESHOLD, SEARCH_THRESHOLD, SIMILARITY_THRESHOLD, } from './local-thresholds.js';
23
+ export { DRIFT_THRESHOLD, RELATED_FLOOR, RELATED_TOP_K, RELATES_THRESHOLD, RETRIEVAL_RELATES_THRESHOLD, SEARCH_THRESHOLD, SIMILARITY_THRESHOLD, };
24
+ export { CAPTURE_CLASSIFY_TOP_K } from './local-ingest.js';
109
25
  export function createLocalGatewayClient(dbPath, clientOpts = {}) {
110
26
  const db = createLocalDb(dbPath);
111
27
  // Memoized: every retrieval call in one command invocation (a single `align ask`, one
@@ -120,6 +36,14 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
120
36
  }
121
37
  return cachedCurrentRepo;
122
38
  }
39
+ /** LM: whose marks apply. Resolved only when the file holds any judgement, so a graph nobody marked never touches config. */
40
+ let cachedJudgeId;
41
+ async function activeJudge() {
42
+ if (!anyJudgements(dbPath))
43
+ return undefined;
44
+ cachedJudgeId ??= clientOpts.judgeId ?? (await defaultJudge()).judgeId;
45
+ return cachedJudgeId;
46
+ }
123
47
  /**
124
48
  * Resolves a `--repo <name>` argument against what actually exists, so a user can type
125
49
  * the short repo name ("align-cli") or "owner/repo" instead of memorising the full
@@ -266,23 +190,57 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
266
190
  }
267
191
  return {};
268
192
  }
269
- async function ingestOne(input, platform, opts = {}) {
193
+ /** What ranks a new item against the graph. Normally the in-memory matrix of every stored
194
+ * embedding, read from SQLite on first use and kept for the run (`session`) so N items read
195
+ * the table once. A kept matrix is trusted only while nothing under it moved: rowSetEpoch
196
+ * (this connection deleted or replaced rows, whichever code path did it) and dataVersion
197
+ * (ANOTHER connection committed) must both match what it was built at, else it is rebuilt.
198
+ * Above the row cap there is no matrix and each item streams the table, as before.
199
+ * Model-filtered exactly as findSimilar is: a stale-model vector must not be scored. */
200
+ function rankerFor(session) {
201
+ const epoch = db.rowSetEpoch();
202
+ const dataVersion = db.dataVersion();
203
+ if (session.matrix === undefined || session.epoch !== epoch || session.dataVersion !== dataVersion) {
204
+ session.matrix = undefined;
205
+ if (db.countEmbeddings() > (clientOpts.matrixMaxRows ?? MATRIX_MAX_ROWS)) {
206
+ return { topK: (q, k, o) => findSimilar(q, k, o?.threshold ?? 0, o?.excludeId) };
207
+ }
208
+ session.matrix = EmbeddingMatrix.fromRows(db.getAllEmbeddings({ model: EMBEDDING_MODEL_ID }));
209
+ session.epoch = epoch;
210
+ session.dataVersion = dataVersion;
211
+ }
212
+ return session.matrix;
213
+ }
214
+ async function ingestOne(rawInput, platform, opts = {}, session = {}) {
215
+ // Secrets go first, before anything reads the text: the title is cut from it, refs are
216
+ // extracted from it and the embedding is built from it. Each match becomes the pattern's
217
+ // placeholder (<GITHUB_TOKEN>, <PRIVATE_KEY>); the raw value never reaches the graph. Redacted
218
+ // before the 80-character cut, so a secret straddling the cut cannot leave half of itself behind.
219
+ const body = redactSecrets(rawInput);
220
+ const input = body.text;
221
+ const titleOverride = opts.titleOverride === undefined ? undefined : redactSecrets(opts.titleOverride);
222
+ const urlOverride = opts.sourceUrlOverride == null ? undefined : redactSecrets(opts.sourceUrlOverride);
223
+ const redacted = body.count + (titleOverride?.count ?? 0) + (urlOverride?.count ?? 0);
224
+ noteRedacted(redacted);
270
225
  let title = input.slice(0, 80);
271
226
  let summary = input;
272
- let sourceUrl = opts.sourceUrlOverride ?? null;
227
+ let sourceUrl = urlOverride?.text ?? null;
273
228
  let capturedAsUrl = false;
274
229
  if (opts.sourceUrlOverride === undefined) {
275
230
  try {
276
231
  const url = new URL(input);
277
232
  sourceUrl = url.href;
278
- title = url.pathname.split('/').filter(Boolean).pop() ?? url.hostname;
279
- summary = `Captured from ${url.hostname}`;
233
+ ({ title, summary } = captureFieldsForUrl(url));
280
234
  capturedAsUrl = true;
281
235
  }
282
236
  catch { /* plain text - use as-is */ }
283
237
  }
284
- if (opts.titleOverride)
285
- title = opts.titleOverride.slice(0, 80);
238
+ if (titleOverride?.text)
239
+ title = titleOverride.text.slice(0, 80);
240
+ // L2: a capture of a URL whose item a connector already imported adds nothing to it.
241
+ const heldRow = capturedAsUrl ? db.noteCaptureOfHeldItem(sourceUrl) : null;
242
+ if (heldRow)
243
+ return { id: heldRow.id, title: heldRow.title, summary: heldRow.summary, sourceUrl: heldRow.sourceUrl, platform: heldRow.platform, related: [], created: false, changed: false, redacted };
286
244
  // ALI-792: what the text points at, stored beside the decision. When the whole
287
245
  // input IS the URL being captured, there is nothing to point at - and comparing
288
246
  // the extracted ref against the WHATWG-normalized href leaks on every
@@ -302,80 +260,78 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
302
260
  // refreshed, so this is the only moment the difference is visible. Without it a
303
261
  // re-import reports every decision as imported while the graph does not move, which
304
262
  // reads as having imported twice (ALI-770).
305
- const created = db.findIdBySource(sourceUrl, title) === null;
263
+ //
306
264
  // ALI-829: a Slack thread arriving under a real title replaces the tombstone-titled row
307
- // an older fetcher may have written for the same source_url (see local-db.ts).
265
+ // an older fetcher may have written for the same source_url (see local-db.ts). Removed
266
+ // BEFORE the lookup: L2 finds a Slack thread by its source_key, which the tombstone shares.
267
+ //
268
+ // One normalisation, used by both folds: the tombstone delete and insertDecision's own fold
269
+ // already trim, and a raw url here made the two disagree about which twin they were looking at.
270
+ const identity = identifyingSourceUrl(sourceUrl);
308
271
  if (platform === 'slack')
309
- db.deleteSlackTombstoneTwin(sourceUrl);
272
+ db.deleteSlackTombstoneTwin(identity);
273
+ if (opts.keyed)
274
+ db.foldPendingTwin(identity, title, platform, true);
275
+ const existingId = db.findIdBySource(sourceUrl, title, platform, opts.keyed);
276
+ // L3: an items-first arrival over a complete row merges onto the stored discussion; the row stays complete.
277
+ let pending = opts.detailPending;
278
+ if (opts.keyed && existingId !== null) {
279
+ const kept = db.keepProtectedText(existingId, title, summary, opts.detailPending);
280
+ ({ title, summary } = kept);
281
+ if (kept.keptDiscussion)
282
+ pending = false;
283
+ }
284
+ const created = existingId === null;
310
285
  // ALI-829: the source's own date, normalised once. An unparseable date drops the FIELD,
311
286
  // never the item: the summary is the thing the user came for.
312
287
  const decidedAt = normaliseDecidedAt(opts.createdAt);
288
+ // L1/L2: connector imports (classify:false) only - capture re-ranks every time. Only the
289
+ // missing steps run (Decision 30): nothing for a finished row, the link pass alone for a
290
+ // row whose ingest died after storing its embedding. Refs stay current and citations INTO
291
+ // the row resolve either way: both are local and cheap.
292
+ if (opts.classify === false && existingId !== null) {
293
+ const step = ingestStep(db.getDecisionById(existingId), { title, summary, platform, repo, decidedAt }, db.getEmbeddingModel(existingId), EMBEDDING_MODEL_ID, db.getEnrichedAt(existingId));
294
+ const stored = step === 'full' ? null : db.getEmbedding(existingId);
295
+ if (stored !== null) {
296
+ db.replaceRefs(existingId, refs);
297
+ db.resolveRefs(existingId, refIdentityFor(platform, sourceUrl));
298
+ const related = step === 'relink' ? await linkPass(db, rankerFor(session), existingId, stored, title, summary, opts.classify) : [];
299
+ if (step === 'relink')
300
+ db.markEnriched(existingId);
301
+ return { id: existingId, title, summary, sourceUrl, platform, related, created: false, changed: false, redacted };
302
+ }
303
+ }
304
+ // Embed title + summary so URL captures (whose summary is just "Captured
305
+ // from <host>") still carry the path-derived title's semantic content. Embedded BEFORE the
306
+ // row is rewritten: a failed embed then leaves the row (and its enriched_at) as it was,
307
+ // rather than new text beside the old text's vector.
308
+ const embedText = title === summary ? summary : `${title}. ${summary}`;
309
+ const embedding = await getEmbedding(embedText);
313
310
  // ALI-831: origin, from the platform - the same rule the cloud applies on insert.
314
311
  const deciderKind = deriveDeciderKind(platform);
315
- const id = db.insertDecision({ title, summary, sourceUrl, platform, repo, decidedAt, deciderKind });
312
+ const id = db.insertDecision({ title, summary, sourceUrl, platform, repo, decidedAt, deciderKind, keyed: opts.keyed, detailPending: pending });
316
313
  db.replaceRefs(id, refs);
317
314
  // ALI-796's payoff: if some earlier decision already cited THIS one (a git commit
318
315
  // citing a Jira key before Jira was ever connected), resolve that gap into a real
319
316
  // link now that the cited item has arrived. Harmless no-op for platforms with no
320
317
  // citable identity (refIdentityFor returns [] for a plain git/slack/cli capture).
321
318
  db.resolveRefs(id, refIdentityFor(platform, sourceUrl));
322
- // Embed title + summary so URL captures (whose summary is just "Captured
323
- // from <host>") still carry the path-derived title's semantic content.
324
- const embedText = title === summary ? summary : `${title}. ${summary}`;
325
- const embedding = await getEmbedding(embedText);
319
+ const epochBefore = db.rowSetEpoch();
326
320
  db.setEmbedding(id, embedding, EMBEDDING_MODEL_ID);
327
- // One ranked pass, two rules united. Absolute (>= SIMILARITY_THRESHOLD, cap 10)
328
- // as before, PLUS the top RELATED_TOP_K overall when they clear RELATED_FLOOR -
329
- // the cross-tool edges live between those two lines (see RELATED_FLOOR's note).
330
- // If the top-K are all absolute matches the relative rule adds nothing, which is
331
- // the correct degenerate case rather than a special one.
332
- const ranked = await findSimilar(embedding, 10, 0, id);
333
- const candidates = ranked.filter((c, i) => c.score >= SIMILARITY_THRESHOLD || (i < RELATED_TOP_K && c.score >= RELATED_FLOOR));
334
- // ALI-1065: classify only the high-confidence tier, capped, and only with a provider
335
- // configured - hasConfiguredProvider is an env-only check, so this costs nothing when
336
- // no key exists (the common case for a fresh clone). chainStopped mirrors
337
- // checkAlignment's own short-circuit: once one candidate's classification fails with a
338
- // stopped provider, further calls in THIS capture are skipped rather than repeated.
339
- const toClassify = hasConfiguredProvider()
340
- ? candidates.filter(c => c.score >= SIMILARITY_THRESHOLD).slice(0, CAPTURE_CLASSIFY_TOP_K)
341
- : [];
342
- const classifyIds = new Set(toClassify.map(c => c.decisionId));
343
- const newDecision = { title, summary };
344
- let chainStopped = false;
345
- for (const c of candidates) {
346
- if (classifyIds.has(c.decisionId) && !chainStopped) {
347
- // The EXISTING decision is the subject (A); the new capture is the candidate (B) -
348
- // "how does B relate to A" reads naturally as "does this new thing supersede/conflict
349
- // with what's already there", which is the direction a capture-time check asks in.
350
- const existingRow = db.getDecisionById(c.decisionId);
351
- const outcome = existingRow
352
- ? await classifyRelationship({ title: existingRow.title, summary: existingRow.summary }, newDecision)
353
- : { ok: false, reason: 'classifier_error' };
354
- if (!outcome.ok && outcome.failure?.kind === 'provider_stopped')
355
- chainStopped = true;
356
- if (outcome.ok) {
357
- // replaceLink, not insertLink: this upgrades the cosine `relates` edge findSimilar
358
- // would otherwise also write below into a typed one, rather than leaving both on
359
- // the pair (local-db.ts's unique index is per-relation, so both would coexist).
360
- db.replaceLink({
361
- sourceId: id,
362
- targetId: c.decisionId,
363
- relation: outcome.relationship.type,
364
- confidence: outcome.relationship.confidence,
365
- });
366
- continue;
367
- }
368
- // Falls through to the untyped write below on any classifier failure - a candidate
369
- // still worth surfacing as related even when nothing could type it.
370
- }
371
- // ALI-503: `relates`, not `conflicts_with`. This is a cosine score with no judgement
372
- // behind it, and labelling it a conflict made `align local status` and the
373
- // align_get_conflicts MCP tool report manufactured findings as detections.
374
- db.insertLink({ sourceId: id, targetId: c.decisionId, relation: 'relates', confidence: c.score });
321
+ // This run's own write: the matrix learns it by append, so the bump setEmbedding makes when
322
+ // it REPLACES a vector is not a graph that moved under the copy. But only a matrix that was
323
+ // current before the write may absorb it; one the insert's own fold already outdated is
324
+ // left alone and rebuilt by rankerFor.
325
+ if (session.matrix !== undefined && session.epoch === epochBefore) {
326
+ session.matrix.add(id, embedding);
327
+ session.epoch = db.rowSetEpoch();
375
328
  }
376
- return { id, title, summary, sourceUrl, platform, related: candidates, created };
329
+ const candidates = await linkPass(db, rankerFor(session), id, embedding, title, summary, opts.classify);
330
+ // L2, Decision 30: the LAST write. Only now is the ingest done.
331
+ db.markEnriched(id);
332
+ return { id, title, summary, sourceUrl, platform, related: candidates, created, changed: true, redacted };
377
333
  }
378
- return {
334
+ const client = {
379
335
  /** Release the underlying SQLite handle (required on Windows before deleting the file). */
380
336
  close() {
381
337
  db.close();
@@ -393,19 +349,25 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
393
349
  id: r.id, title: r.title, summary: r.summary, sourceUrl: r.sourceUrl, platform: r.platform,
394
350
  related: r.related.map(c => c.decisionId),
395
351
  ...(row ? provenanceOf(row) : {}),
352
+ // How many secrets were replaced with placeholders before the write (absent when none):
353
+ // MCP align_capture hands this to the agent, which is the only place its person sees it.
354
+ ...(r.redacted > 0 ? { secretsRedacted: r.redacted } : {}),
396
355
  };
397
356
  },
398
- async ingestBatch(items) {
357
+ async ingestBatch(items, opts = {}) {
399
358
  const snapshots = [];
359
+ const session = {};
400
360
  for (const item of items) {
401
361
  const r = await ingestOne(item.raw_text, item.platform ?? 'cli', {
402
362
  titleOverride: item.title,
403
363
  sourceUrlOverride: item.source_url ?? null,
404
364
  createdAt: item.created_at,
405
- });
365
+ classify: opts.classify, keyed: opts.keyed, detailPending: item.detail_pending,
366
+ }, session);
406
367
  snapshots.push({
407
368
  id: r.id,
408
369
  created: r.created,
370
+ changed: r.changed,
409
371
  title: r.title,
410
372
  summary: r.summary,
411
373
  analysis: {
@@ -422,6 +384,39 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
422
384
  }
423
385
  return { snapshots };
424
386
  },
387
+ /**
388
+ * L5, Decision 30: finish ingests that never finished (`enriched_at` NULL: every row after the
389
+ * v7 upgrade, or one that died between its embedding and its link pass). Runs only the
390
+ * missing step, the way ingestOne does for a connector re-ingest: a row that already holds a
391
+ * current-model embedding gets the link pass alone (no embed call); one that does not is
392
+ * re-ingested from its own stored text. A row with no URL and no embedding cannot be
393
+ * re-ingested without inserting a twin, so it is counted and left. Never classifies.
394
+ */
395
+ async relinkUnfinished(rows) {
396
+ const session = {};
397
+ const out = { linked: 0, embedded: 0, skipped: 0 };
398
+ for (const { id, keyed, pending } of rows) {
399
+ const row = db.getDecisionById(id);
400
+ if (!row)
401
+ continue;
402
+ const stored = db.getEmbeddingModel(id) === EMBEDDING_MODEL_ID ? db.getEmbedding(id) : null;
403
+ if (stored !== null) {
404
+ await linkPass(db, rankerFor(session), id, stored, row.title, row.summary, false);
405
+ db.markEnriched(id);
406
+ out.linked += 1;
407
+ }
408
+ else if (row.sourceUrl === null) {
409
+ out.skipped += 1;
410
+ }
411
+ else {
412
+ await ingestOne(row.summary, row.platform, { titleOverride: row.title, sourceUrlOverride: row.sourceUrl, createdAt: row.decidedAt ?? undefined, classify: false, keyed,
413
+ // The stored flag, passed through: a re-ingest that says nothing resets a row still waiting for its discussion.
414
+ detailPending: pending === true }, session);
415
+ out.embedded += 1;
416
+ }
417
+ }
418
+ return out;
419
+ },
425
420
  /**
426
421
  * ALI-808: the confirm-each session importer's one write path. Ingests exactly like
427
422
  * ingestBatch does above (same ingestOne, so platform 'agent-session' derives
@@ -560,7 +555,16 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
560
555
  const { dbFilter, effectiveRepo } = await resolveScope(scope);
561
556
  const boundedFilter = { ...dbFilter, createdBefore };
562
557
  const embedding = await getEmbedding(query);
563
- let similar = await findSimilar(embedding, limit, SEARCH_THRESHOLD, undefined, boundedFilter);
558
+ // LM: decisions this person marked not-a-decision are skipped, so ask for that many extra.
559
+ const judge = await activeJudge();
560
+ const hidden = judge ? notADecisionMarks(dbPath, judge) : new Map();
561
+ const dropNotes = [];
562
+ const visible = (rows) => {
563
+ const split = splitRetrieved(rows, hidden, limit, (id) => db.getDecisionById(id)?.title, 'answer');
564
+ dropNotes.splice(0, dropNotes.length, ...split.notes);
565
+ return split.kept;
566
+ };
567
+ let similar = visible(await findSimilar(embedding, limit + hidden.size, SEARCH_THRESHOLD, undefined, boundedFilter));
564
568
  // A natural-language question embeds less densely than its subject does, so on a
565
569
  // small graph it can miss a decision that its own content words hit. Retry once,
566
570
  // only on an empty result, mirroring the gateway's own keyword-to-semantic
@@ -569,7 +573,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
569
573
  if (!similar.length) {
570
574
  const reduced = contentWordQuery(query);
571
575
  if (reduced) {
572
- similar = await findSimilar(await getEmbedding(reduced), limit, SEARCH_THRESHOLD, undefined, boundedFilter);
576
+ similar = visible(await findSimilar(await getEmbedding(reduced), limit + hidden.size, SEARCH_THRESHOLD, undefined, boundedFilter));
573
577
  }
574
578
  }
575
579
  const results = similar
@@ -603,7 +607,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
603
607
  };
604
608
  })
605
609
  .filter((d) => d !== null);
606
- return { results, count: results.length, strategy: 'semantic', scope: effectiveRepo };
610
+ return { results, count: results.length, strategy: 'semantic', scope: effectiveRepo, ...(dropNotes.length ? { notes: dropNotes } : {}) };
607
611
  },
608
612
  async checkAlignment(diff, _context,
609
613
  // 'exhaustive' deliberately collapses into 'full' here: local mode has no gateway
@@ -620,7 +624,10 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
620
624
  // the stricter bar. One constant could not serve both.
621
625
  const threshold = opts.depth === 'related' ? RETRIEVAL_RELATES_THRESHOLD : RELATES_THRESHOLD;
622
626
  const embedding = await getEmbedding(diff);
623
- const similar = await findSimilar(embedding, 5, threshold);
627
+ const judge = await activeJudge();
628
+ const hidden = judge ? notADecisionMarks(dbPath, judge) : new Map();
629
+ const retrieved = splitRetrieved(await findSimilar(embedding, 5 + hidden.size, threshold), hidden, 5, (id) => db.getDecisionById(id)?.title);
630
+ const similar = retrieved.kept;
624
631
  const candidates = similar
625
632
  .map(s => {
626
633
  const row = db.getDecisionById(s.decisionId);
@@ -628,7 +635,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
628
635
  })
629
636
  .filter((d) => d !== null);
630
637
  if (!candidates.length) {
631
- return { status: 'no-context', confidence: 0, relevant_decisions: [], conflicts: [], message: 'No related decisions found in your local graph.' };
638
+ return emptyCheck(retrieved);
632
639
  }
633
640
  // `depth:'related'` means retrieval only, and honouring it matters more here than in the
634
641
  // cloud client. The editor hook asks for it to fit a <=10s budget (check.ts), but in
@@ -656,6 +663,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
656
663
  ...provenanceOf(c),
657
664
  })),
658
665
  conflicts: [],
666
+ ...(retrieved.notes.length ? { notes: [...bannerFor(retrieved.agentApplied), ...retrieved.notes] } : {}),
659
667
  message: `Found ${candidates.length} related decision(s) - retrieval only, not adjudicated.`,
660
668
  };
661
669
  }
@@ -668,19 +676,15 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
668
676
  // ALI-845: the classifier's own buildUserPrompt is now budget-derived (local-relationship-
669
677
  // classifier.ts), so capping the subject at a literal here would be a second writer of the
670
678
  // same fact, at a number unrelated to any window. Send the diff uncut.
671
- const subject = { title: opts.title ?? 'Proposed change', summary: diff };
679
+ const subject = { title: opts.title ?? 'Proposed change', summary: diff, decidedAt: null, platform: 'cli' };
680
+ // ALIGN_DETECTOR (local-candidate-classify.ts): v0 types each candidate in turn, v1 types the set in one call.
681
+ const { outcomes } = await classifyCandidates(subject, candidates.map(c => ({
682
+ id: c.id, title: c.title, summary: c.summary, similarity: c.score, platform: c.platform, decidedAt: c.decidedAt,
683
+ status: db.isSuperseded(c.id) ? 'superseded' : null,
684
+ })), 'subject-first');
672
685
  const typed = [];
673
- let chainStopped = false;
674
- for (const c of candidates) {
675
- // ALI-692: a recorded chain stop is a property of the PROVIDER, not of this
676
- // candidate, so asking again per candidate repeats one doomed call N times -
677
- // on a 429 that burns the retry budget while `--advisory` races its deadline.
678
- // The remaining candidates still report, untyped, which is what `unknown` means.
679
- const outcome = chainStopped
680
- ? { ok: false, reason: 'classifier_error' }
681
- : await classifyRelationship(subject, { title: c.title, summary: c.summary });
682
- if (!outcome.ok && outcome.failure?.kind === 'provider_stopped')
683
- chainStopped = true;
686
+ for (const [i, c] of candidates.entries()) {
687
+ const outcome = outcomes[i];
684
688
  const rel = outcome.ok ? outcome.relationship : null;
685
689
  typed.push({
686
690
  id: c.id,
@@ -700,8 +704,13 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
700
704
  similarity: c.score,
701
705
  });
702
706
  }
703
- const relevant_decisions = typed.map(t => ({ id: t.id, title: t.title, summary: t.summary, similarity: t.similarity, url: t.url, ...t.provenance }));
704
- const conflicts = typed
707
+ // LM: a decision a person said was replaced is named as replaced, with its successor.
708
+ const replacedBy = (id) => {
709
+ const r = relationFieldsFor(id);
710
+ return r.status === 'superseded' ? { status: r.status, successor: r.successor } : {};
711
+ };
712
+ const relevant_decisions = typed.map(t => ({ id: t.id, title: t.title, summary: t.summary, similarity: t.similarity, url: t.url, ...t.provenance, ...replacedBy(t.id) }));
713
+ const rawConflicts = typed
705
714
  .filter(t => t.relationship === 'conflicts_with' || t.relationship === 'contradicts')
706
715
  .map(t => ({
707
716
  decision_id: t.id,
@@ -712,6 +721,13 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
712
721
  reason: t.reason ?? 'Conflicts with an existing decision in your local graph',
713
722
  severity: (t.confidence >= 0.8 ? 'critical' : 'warning'),
714
723
  }));
724
+ // LM: this person's false-alarm marks hide a hit for exactly this set of files, or annotate it.
725
+ const files = filesFromDiff(diff);
726
+ const reviewed = judge ? reviewConflicts(dbPath, judge, rawConflicts, contextKeyFor(files), files) : { conflicts: rawConflicts, notes: [], agentApplied: [] };
727
+ const conflicts = reviewed.conflicts;
728
+ // LM: say what a mark changed - a decision left out, a decision a person declared replaced.
729
+ const allNotes = checkNotes(dbPath, judge, retrieved, relevant_decisions, reviewed, files);
730
+ const notes = allNotes.length ? { notes: allNotes } : {};
715
731
  // ALI-414: a candidate we retrieved but could not classify is exactly the case
716
732
  // where we do not know - it could be the conflict. Reporting `aligned` there is
717
733
  // a fail-open, and an agent reads `aligned` as permission to proceed. A conflict
@@ -724,6 +740,8 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
724
740
  confidence,
725
741
  relevant_decisions,
726
742
  conflicts,
743
+ ...notes,
744
+ ...(offeredFiles(files) ? { checked_files: files } : {}),
727
745
  message: `This change conflicts with ${conflicts.length} existing decision(s) in your local graph - review before proceeding.`,
728
746
  };
729
747
  }
@@ -747,6 +765,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
747
765
  confidence: 0,
748
766
  relevant_decisions,
749
767
  conflicts: [],
768
+ ...notes,
750
769
  message: `Could not check ${relevant_decisions.length} related decision(s) - the relationship classifier did not run. ` +
751
770
  `This is NOT a pass: treat it as unchecked and review these decisions before proceeding.${hint}`,
752
771
  };
@@ -756,6 +775,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
756
775
  confidence,
757
776
  relevant_decisions,
758
777
  conflicts,
778
+ ...notes,
759
779
  message: `Found ${relevant_decisions.length} related decision(s) to review.`,
760
780
  };
761
781
  },
@@ -800,8 +820,10 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
800
820
  ...db.listLinks({ relation: 'conflicts_with' }),
801
821
  ...db.listLinks({ relation: 'contradicts' }),
802
822
  ];
803
- return { links, conflict_count: links.length };
823
+ const judge = await activeJudge();
824
+ return { links: judge ? annotatePairs(dbPath, judge, links) : links, conflict_count: links.length };
804
825
  },
805
826
  };
827
+ return client;
806
828
  }
807
829
  //# sourceMappingURL=local-gateway-client.js.map