@aligndottech/cli 0.48.0 → 0.50.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 (717) hide show
  1. package/README.md +10 -8
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +35 -26
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/agents.d.ts.map +1 -1
  6. package/dist/commands/agents.js +7 -2
  7. package/dist/commands/agents.js.map +1 -1
  8. package/dist/commands/ai.d.ts +11 -0
  9. package/dist/commands/ai.d.ts.map +1 -0
  10. package/dist/commands/ai.js +121 -0
  11. package/dist/commands/ai.js.map +1 -0
  12. package/dist/commands/check.d.ts.map +1 -1
  13. package/dist/commands/check.js +18 -2
  14. package/dist/commands/check.js.map +1 -1
  15. package/dist/commands/connect.d.ts +5 -0
  16. package/dist/commands/connect.d.ts.map +1 -1
  17. package/dist/commands/connect.js +24 -0
  18. package/dist/commands/connect.js.map +1 -1
  19. package/dist/commands/default-action.js +2 -2
  20. package/dist/commands/default-action.js.map +1 -1
  21. package/dist/commands/import/confluence.d.ts.map +1 -1
  22. package/dist/commands/import/confluence.js +24 -5
  23. package/dist/commands/import/confluence.js.map +1 -1
  24. package/dist/commands/import/docs.js +2 -2
  25. package/dist/commands/import/git.d.ts.map +1 -1
  26. package/dist/commands/import/git.js +15 -5
  27. package/dist/commands/import/git.js.map +1 -1
  28. package/dist/commands/import/github.d.ts.map +1 -1
  29. package/dist/commands/import/github.js +34 -7
  30. package/dist/commands/import/github.js.map +1 -1
  31. package/dist/commands/import/gitlab.d.ts.map +1 -1
  32. package/dist/commands/import/gitlab.js +10 -5
  33. package/dist/commands/import/gitlab.js.map +1 -1
  34. package/dist/commands/import/jira.d.ts.map +1 -1
  35. package/dist/commands/import/jira.js +10 -5
  36. package/dist/commands/import/jira.js.map +1 -1
  37. package/dist/commands/import/linear.d.ts.map +1 -1
  38. package/dist/commands/import/linear.js +10 -5
  39. package/dist/commands/import/linear.js.map +1 -1
  40. package/dist/commands/import/notion.d.ts.map +1 -1
  41. package/dist/commands/import/notion.js +10 -5
  42. package/dist/commands/import/notion.js.map +1 -1
  43. package/dist/commands/import/sessions.js +2 -2
  44. package/dist/commands/import/slack.d.ts.map +1 -1
  45. package/dist/commands/import/slack.js +12 -7
  46. package/dist/commands/import/slack.js.map +1 -1
  47. package/dist/commands/import/teams.d.ts.map +1 -1
  48. package/dist/commands/import/teams.js +10 -5
  49. package/dist/commands/import/teams.js.map +1 -1
  50. package/dist/commands/import/zoom.d.ts.map +1 -1
  51. package/dist/commands/import/zoom.js +10 -5
  52. package/dist/commands/import/zoom.js.map +1 -1
  53. package/dist/commands/import.d.ts.map +1 -1
  54. package/dist/commands/import.js +43 -1
  55. package/dist/commands/import.js.map +1 -1
  56. package/dist/commands/local.d.ts.map +1 -1
  57. package/dist/commands/local.js +76 -4
  58. package/dist/commands/local.js.map +1 -1
  59. package/dist/commands/mark.d.ts +37 -0
  60. package/dist/commands/mark.d.ts.map +1 -0
  61. package/dist/commands/mark.js +105 -0
  62. package/dist/commands/mark.js.map +1 -0
  63. package/dist/commands/mcp.d.ts +141 -2
  64. package/dist/commands/mcp.d.ts.map +1 -1
  65. package/dist/commands/mcp.js +72 -14
  66. package/dist/commands/mcp.js.map +1 -1
  67. package/dist/commands/registry.d.ts.map +1 -1
  68. package/dist/commands/registry.js +12 -2
  69. package/dist/commands/registry.js.map +1 -1
  70. package/dist/commands/setup.d.ts +39 -0
  71. package/dist/commands/setup.d.ts.map +1 -1
  72. package/dist/commands/setup.js +118 -241
  73. package/dist/commands/setup.js.map +1 -1
  74. package/dist/commands/share.d.ts +7 -0
  75. package/dist/commands/share.d.ts.map +1 -0
  76. package/dist/commands/share.js +60 -0
  77. package/dist/commands/share.js.map +1 -0
  78. package/dist/commands/sync.d.ts +55 -0
  79. package/dist/commands/sync.d.ts.map +1 -0
  80. package/dist/commands/sync.js +278 -0
  81. package/dist/commands/sync.js.map +1 -0
  82. package/dist/commands/telemetry.d.ts +3 -3
  83. package/dist/commands/telemetry.js +6 -6
  84. package/dist/commands/telemetry.js.map +1 -1
  85. package/dist/commands/why.d.ts.map +1 -1
  86. package/dist/commands/why.js +27 -1
  87. package/dist/commands/why.js.map +1 -1
  88. package/dist/index.d.ts +3 -1
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.js +3 -0
  91. package/dist/index.js.map +1 -1
  92. package/dist/lib/ask-key-offer.d.ts +38 -0
  93. package/dist/lib/ask-key-offer.d.ts.map +1 -0
  94. package/dist/lib/ask-key-offer.js +130 -0
  95. package/dist/lib/ask-key-offer.js.map +1 -0
  96. package/dist/lib/backfill-state.d.ts +116 -0
  97. package/dist/lib/backfill-state.d.ts.map +1 -0
  98. package/dist/lib/backfill-state.js +342 -0
  99. package/dist/lib/backfill-state.js.map +1 -0
  100. package/dist/lib/backup-copy.d.ts +17 -0
  101. package/dist/lib/backup-copy.d.ts.map +1 -0
  102. package/dist/lib/backup-copy.js +13 -0
  103. package/dist/lib/backup-copy.js.map +1 -0
  104. package/dist/lib/capture-report.d.ts +22 -18
  105. package/dist/lib/capture-report.d.ts.map +1 -1
  106. package/dist/lib/capture-report.js +64 -2
  107. package/dist/lib/capture-report.js.map +1 -1
  108. package/dist/lib/config.d.ts +56 -24
  109. package/dist/lib/config.d.ts.map +1 -1
  110. package/dist/lib/config.js +176 -45
  111. package/dist/lib/config.js.map +1 -1
  112. package/dist/lib/confirm-timeout.d.ts +8 -0
  113. package/dist/lib/confirm-timeout.d.ts.map +1 -0
  114. package/dist/lib/confirm-timeout.js +18 -0
  115. package/dist/lib/confirm-timeout.js.map +1 -0
  116. package/dist/lib/curation/check-marks.d.ts +48 -0
  117. package/dist/lib/curation/check-marks.d.ts.map +1 -0
  118. package/dist/lib/curation/check-marks.js +81 -0
  119. package/dist/lib/curation/check-marks.js.map +1 -0
  120. package/dist/lib/curation/guardrail.d.ts +39 -0
  121. package/dist/lib/curation/guardrail.d.ts.map +1 -0
  122. package/dist/lib/curation/guardrail.js +93 -0
  123. package/dist/lib/curation/guardrail.js.map +1 -0
  124. package/dist/lib/curation/judge.d.ts +3 -0
  125. package/dist/lib/curation/judge.d.ts.map +1 -0
  126. package/dist/lib/curation/judge.js +9 -0
  127. package/dist/lib/curation/judge.js.map +1 -0
  128. package/dist/lib/curation/judgements-db.d.ts +96 -0
  129. package/dist/lib/curation/judgements-db.d.ts.map +1 -0
  130. package/dist/lib/curation/judgements-db.js +200 -0
  131. package/dist/lib/curation/judgements-db.js.map +1 -0
  132. package/dist/lib/curation/last-check.d.ts +32 -0
  133. package/dist/lib/curation/last-check.d.ts.map +1 -0
  134. package/dist/lib/curation/last-check.js +81 -0
  135. package/dist/lib/curation/last-check.js.map +1 -0
  136. package/dist/lib/curation/mark.d.ts +76 -0
  137. package/dist/lib/curation/mark.d.ts.map +1 -0
  138. package/dist/lib/curation/mark.js +359 -0
  139. package/dist/lib/curation/mark.js.map +1 -0
  140. package/dist/lib/curation/text.d.ts +6 -0
  141. package/dist/lib/curation/text.d.ts.map +1 -0
  142. package/dist/lib/curation/text.js +35 -0
  143. package/dist/lib/curation/text.js.map +1 -0
  144. package/dist/lib/fetchers/capture.d.ts +49 -2
  145. package/dist/lib/fetchers/capture.d.ts.map +1 -1
  146. package/dist/lib/fetchers/capture.js +7 -1
  147. package/dist/lib/fetchers/capture.js.map +1 -1
  148. package/dist/lib/fetchers/confluence.d.ts +2 -2
  149. package/dist/lib/fetchers/confluence.d.ts.map +1 -1
  150. package/dist/lib/fetchers/confluence.js.map +1 -1
  151. package/dist/lib/fetchers/git.d.ts +1 -0
  152. package/dist/lib/fetchers/git.d.ts.map +1 -1
  153. package/dist/lib/fetchers/git.js +3 -1
  154. package/dist/lib/fetchers/git.js.map +1 -1
  155. package/dist/lib/fetchers/github.d.ts +44 -5
  156. package/dist/lib/fetchers/github.d.ts.map +1 -1
  157. package/dist/lib/fetchers/github.js +122 -5
  158. package/dist/lib/fetchers/github.js.map +1 -1
  159. package/dist/lib/fetchers/gitlab.d.ts +2 -2
  160. package/dist/lib/fetchers/gitlab.d.ts.map +1 -1
  161. package/dist/lib/fetchers/gitlab.js.map +1 -1
  162. package/dist/lib/fetchers/jira.d.ts +2 -2
  163. package/dist/lib/fetchers/jira.d.ts.map +1 -1
  164. package/dist/lib/fetchers/jira.js.map +1 -1
  165. package/dist/lib/fetchers/linear.d.ts +2 -2
  166. package/dist/lib/fetchers/linear.d.ts.map +1 -1
  167. package/dist/lib/fetchers/linear.js.map +1 -1
  168. package/dist/lib/fetchers/notion.d.ts +2 -2
  169. package/dist/lib/fetchers/notion.d.ts.map +1 -1
  170. package/dist/lib/fetchers/notion.js.map +1 -1
  171. package/dist/lib/fetchers/slack.d.ts +2 -3
  172. package/dist/lib/fetchers/slack.d.ts.map +1 -1
  173. package/dist/lib/fetchers/slack.js.map +1 -1
  174. package/dist/lib/fetchers/teams.d.ts +2 -2
  175. package/dist/lib/fetchers/teams.d.ts.map +1 -1
  176. package/dist/lib/fetchers/teams.js.map +1 -1
  177. package/dist/lib/fetchers/zoom.d.ts +2 -2
  178. package/dist/lib/fetchers/zoom.d.ts.map +1 -1
  179. package/dist/lib/fetchers/zoom.js.map +1 -1
  180. package/dist/lib/gateway-client.d.ts +34 -0
  181. package/dist/lib/gateway-client.d.ts.map +1 -1
  182. package/dist/lib/gateway-client.js +19 -1
  183. package/dist/lib/gateway-client.js.map +1 -1
  184. package/dist/lib/github-text.d.ts +3 -0
  185. package/dist/lib/github-text.d.ts.map +1 -0
  186. package/dist/lib/github-text.js +18 -0
  187. package/dist/lib/github-text.js.map +1 -0
  188. package/dist/lib/hook-context.d.ts +10 -0
  189. package/dist/lib/hook-context.d.ts.map +1 -1
  190. package/dist/lib/hook-context.js +14 -0
  191. package/dist/lib/hook-context.js.map +1 -1
  192. package/dist/lib/import-defaults.d.ts +39 -23
  193. package/dist/lib/import-defaults.d.ts.map +1 -1
  194. package/dist/lib/import-defaults.js +28 -26
  195. package/dist/lib/import-defaults.js.map +1 -1
  196. package/dist/lib/launch/adapters/aider.d.ts +17 -0
  197. package/dist/lib/launch/adapters/aider.d.ts.map +1 -0
  198. package/dist/lib/launch/adapters/aider.js +30 -0
  199. package/dist/lib/launch/adapters/aider.js.map +1 -0
  200. package/dist/lib/launch/adapters/amp.d.ts +18 -0
  201. package/dist/lib/launch/adapters/amp.d.ts.map +1 -0
  202. package/dist/lib/launch/adapters/amp.js +29 -0
  203. package/dist/lib/launch/adapters/amp.js.map +1 -0
  204. package/dist/lib/launch/adapters/auggie.d.ts +18 -0
  205. package/dist/lib/launch/adapters/auggie.d.ts.map +1 -0
  206. package/dist/lib/launch/adapters/auggie.js +34 -0
  207. package/dist/lib/launch/adapters/auggie.js.map +1 -0
  208. package/dist/lib/launch/adapters/cline.d.ts +10 -0
  209. package/dist/lib/launch/adapters/cline.d.ts.map +1 -0
  210. package/dist/lib/launch/adapters/cline.js +41 -0
  211. package/dist/lib/launch/adapters/cline.js.map +1 -0
  212. package/dist/lib/launch/adapters/continue.d.ts +22 -0
  213. package/dist/lib/launch/adapters/continue.d.ts.map +1 -0
  214. package/dist/lib/launch/adapters/continue.js +46 -0
  215. package/dist/lib/launch/adapters/continue.js.map +1 -0
  216. package/dist/lib/launch/adapters/droid.d.ts +19 -0
  217. package/dist/lib/launch/adapters/droid.d.ts.map +1 -0
  218. package/dist/lib/launch/adapters/droid.js +38 -0
  219. package/dist/lib/launch/adapters/droid.js.map +1 -0
  220. package/dist/lib/launch/adapters/gemini-cli.d.ts +13 -14
  221. package/dist/lib/launch/adapters/gemini-cli.d.ts.map +1 -1
  222. package/dist/lib/launch/adapters/gemini-cli.js +38 -53
  223. package/dist/lib/launch/adapters/gemini-cli.js.map +1 -1
  224. package/dist/lib/launch/adapters/goose.d.ts +20 -0
  225. package/dist/lib/launch/adapters/goose.d.ts.map +1 -0
  226. package/dist/lib/launch/adapters/goose.js +47 -0
  227. package/dist/lib/launch/adapters/goose.js.map +1 -0
  228. package/dist/lib/launch/adapters/grok-build.d.ts +16 -0
  229. package/dist/lib/launch/adapters/grok-build.d.ts.map +1 -0
  230. package/dist/lib/launch/adapters/grok-build.js +25 -0
  231. package/dist/lib/launch/adapters/grok-build.js.map +1 -0
  232. package/dist/lib/launch/adapters/kiro.d.ts +17 -0
  233. package/dist/lib/launch/adapters/kiro.d.ts.map +1 -0
  234. package/dist/lib/launch/adapters/kiro.js +25 -0
  235. package/dist/lib/launch/adapters/kiro.js.map +1 -0
  236. package/dist/lib/launch/adapters/notes.d.ts +7 -0
  237. package/dist/lib/launch/adapters/notes.d.ts.map +1 -0
  238. package/dist/lib/launch/adapters/notes.js +5 -0
  239. package/dist/lib/launch/adapters/notes.js.map +1 -0
  240. package/dist/lib/launch/adapters/qwen.d.ts +25 -0
  241. package/dist/lib/launch/adapters/qwen.d.ts.map +1 -0
  242. package/dist/lib/launch/adapters/qwen.js +67 -0
  243. package/dist/lib/launch/adapters/qwen.js.map +1 -0
  244. package/dist/lib/launch/agents.d.ts +6 -1
  245. package/dist/lib/launch/agents.d.ts.map +1 -1
  246. package/dist/lib/launch/agents.js +12 -4
  247. package/dist/lib/launch/agents.js.map +1 -1
  248. package/dist/lib/launch/amp-state.d.ts +21 -0
  249. package/dist/lib/launch/amp-state.d.ts.map +1 -0
  250. package/dist/lib/launch/amp-state.js +61 -0
  251. package/dist/lib/launch/amp-state.js.map +1 -0
  252. package/dist/lib/launch/auggie-state.d.ts +25 -0
  253. package/dist/lib/launch/auggie-state.d.ts.map +1 -0
  254. package/dist/lib/launch/auggie-state.js +74 -0
  255. package/dist/lib/launch/auggie-state.js.map +1 -0
  256. package/dist/lib/launch/cline-state.d.ts +32 -0
  257. package/dist/lib/launch/cline-state.d.ts.map +1 -0
  258. package/dist/lib/launch/cline-state.js +108 -0
  259. package/dist/lib/launch/cline-state.js.map +1 -0
  260. package/dist/lib/launch/config-writes.d.ts +11 -1
  261. package/dist/lib/launch/config-writes.d.ts.map +1 -1
  262. package/dist/lib/launch/config-writes.js +66 -8
  263. package/dist/lib/launch/config-writes.js.map +1 -1
  264. package/dist/lib/launch/continue-state.d.ts +41 -0
  265. package/dist/lib/launch/continue-state.d.ts.map +1 -0
  266. package/dist/lib/launch/continue-state.js +142 -0
  267. package/dist/lib/launch/continue-state.js.map +1 -0
  268. package/dist/lib/launch/detect.d.ts.map +1 -1
  269. package/dist/lib/launch/detect.js +5 -2
  270. package/dist/lib/launch/detect.js.map +1 -1
  271. package/dist/lib/launch/droid-state.d.ts +24 -0
  272. package/dist/lib/launch/droid-state.d.ts.map +1 -0
  273. package/dist/lib/launch/droid-state.js +74 -0
  274. package/dist/lib/launch/droid-state.js.map +1 -0
  275. package/dist/lib/launch/gemini-state.d.ts +26 -20
  276. package/dist/lib/launch/gemini-state.d.ts.map +1 -1
  277. package/dist/lib/launch/gemini-state.js +95 -37
  278. package/dist/lib/launch/gemini-state.js.map +1 -1
  279. package/dist/lib/launch/gemini-system-file.d.ts +17 -0
  280. package/dist/lib/launch/gemini-system-file.d.ts.map +1 -0
  281. package/dist/lib/launch/gemini-system-file.js +55 -0
  282. package/dist/lib/launch/gemini-system-file.js.map +1 -0
  283. package/dist/lib/launch/gemini-trust.d.ts +3 -1
  284. package/dist/lib/launch/gemini-trust.d.ts.map +1 -1
  285. package/dist/lib/launch/gemini-trust.js +10 -3
  286. package/dist/lib/launch/gemini-trust.js.map +1 -1
  287. package/dist/lib/launch/goose-state.d.ts +53 -0
  288. package/dist/lib/launch/goose-state.d.ts.map +1 -0
  289. package/dist/lib/launch/goose-state.js +137 -0
  290. package/dist/lib/launch/goose-state.js.map +1 -0
  291. package/dist/lib/launch/grok-state.d.ts +42 -0
  292. package/dist/lib/launch/grok-state.d.ts.map +1 -0
  293. package/dist/lib/launch/grok-state.js +128 -0
  294. package/dist/lib/launch/grok-state.js.map +1 -0
  295. package/dist/lib/launch/kiro-state.d.ts +22 -0
  296. package/dist/lib/launch/kiro-state.d.ts.map +1 -0
  297. package/dist/lib/launch/kiro-state.js +59 -0
  298. package/dist/lib/launch/kiro-state.js.map +1 -0
  299. package/dist/lib/launch/launch-files.d.ts.map +1 -1
  300. package/dist/lib/launch/launch-files.js +3 -2
  301. package/dist/lib/launch/launch-files.js.map +1 -1
  302. package/dist/lib/launch/launch.d.ts +51 -2
  303. package/dist/lib/launch/launch.d.ts.map +1 -1
  304. package/dist/lib/launch/launch.js +70 -6
  305. package/dist/lib/launch/launch.js.map +1 -1
  306. package/dist/lib/launch/layer-files.d.ts +12 -0
  307. package/dist/lib/launch/layer-files.d.ts.map +1 -0
  308. package/dist/lib/launch/layer-files.js +43 -0
  309. package/dist/lib/launch/layer-files.js.map +1 -0
  310. package/dist/lib/launch/mcp-child-env.d.ts +30 -0
  311. package/dist/lib/launch/mcp-child-env.d.ts.map +1 -0
  312. package/dist/lib/launch/mcp-child-env.js +151 -0
  313. package/dist/lib/launch/mcp-child-env.js.map +1 -0
  314. package/dist/lib/launch/pick-agent.d.ts.map +1 -1
  315. package/dist/lib/launch/pick-agent.js +7 -6
  316. package/dist/lib/launch/pick-agent.js.map +1 -1
  317. package/dist/lib/launch/picker-options.d.ts.map +1 -1
  318. package/dist/lib/launch/picker-options.js +7 -2
  319. package/dist/lib/launch/picker-options.js.map +1 -1
  320. package/dist/lib/launch/qwen-state.d.ts +30 -0
  321. package/dist/lib/launch/qwen-state.d.ts.map +1 -0
  322. package/dist/lib/launch/qwen-state.js +57 -0
  323. package/dist/lib/launch/qwen-state.js.map +1 -0
  324. package/dist/lib/launch/qwen-trust.d.ts +24 -0
  325. package/dist/lib/launch/qwen-trust.d.ts.map +1 -0
  326. package/dist/lib/launch/qwen-trust.js +100 -0
  327. package/dist/lib/launch/qwen-trust.js.map +1 -0
  328. package/dist/lib/launch/registry/agents/aider.d.ts +3 -0
  329. package/dist/lib/launch/registry/agents/aider.d.ts.map +1 -0
  330. package/dist/lib/launch/registry/agents/aider.js +13 -0
  331. package/dist/lib/launch/registry/agents/aider.js.map +1 -0
  332. package/dist/lib/launch/registry/agents/amp.d.ts +3 -0
  333. package/dist/lib/launch/registry/agents/amp.d.ts.map +1 -0
  334. package/dist/lib/launch/registry/agents/amp.js +14 -0
  335. package/dist/lib/launch/registry/agents/amp.js.map +1 -0
  336. package/dist/lib/launch/registry/agents/auggie.d.ts +3 -0
  337. package/dist/lib/launch/registry/agents/auggie.d.ts.map +1 -0
  338. package/dist/lib/launch/registry/agents/auggie.js +11 -0
  339. package/dist/lib/launch/registry/agents/auggie.js.map +1 -0
  340. package/dist/lib/launch/registry/agents/cline.d.ts +3 -0
  341. package/dist/lib/launch/registry/agents/cline.d.ts.map +1 -0
  342. package/dist/lib/launch/registry/agents/cline.js +19 -0
  343. package/dist/lib/launch/registry/agents/cline.js.map +1 -0
  344. package/dist/lib/launch/registry/agents/continue.d.ts +3 -0
  345. package/dist/lib/launch/registry/agents/continue.d.ts.map +1 -0
  346. package/dist/lib/launch/registry/agents/continue.js +20 -0
  347. package/dist/lib/launch/registry/agents/continue.js.map +1 -0
  348. package/dist/lib/launch/registry/agents/droid.d.ts +3 -0
  349. package/dist/lib/launch/registry/agents/droid.d.ts.map +1 -0
  350. package/dist/lib/launch/registry/agents/droid.js +13 -0
  351. package/dist/lib/launch/registry/agents/droid.js.map +1 -0
  352. package/dist/lib/launch/registry/agents/gemini-cli.js +2 -2
  353. package/dist/lib/launch/registry/agents/gemini-cli.js.map +1 -1
  354. package/dist/lib/launch/registry/agents/goose.d.ts +3 -0
  355. package/dist/lib/launch/registry/agents/goose.d.ts.map +1 -0
  356. package/dist/lib/launch/registry/agents/goose.js +20 -0
  357. package/dist/lib/launch/registry/agents/goose.js.map +1 -0
  358. package/dist/lib/launch/registry/agents/grok-build.d.ts +3 -0
  359. package/dist/lib/launch/registry/agents/grok-build.d.ts.map +1 -0
  360. package/dist/lib/launch/registry/agents/grok-build.js +14 -0
  361. package/dist/lib/launch/registry/agents/grok-build.js.map +1 -0
  362. package/dist/lib/launch/registry/agents/kiro.d.ts +3 -0
  363. package/dist/lib/launch/registry/agents/kiro.d.ts.map +1 -0
  364. package/dist/lib/launch/registry/agents/kiro.js +11 -0
  365. package/dist/lib/launch/registry/agents/kiro.js.map +1 -0
  366. package/dist/lib/launch/registry/agents/qwen.d.ts +3 -0
  367. package/dist/lib/launch/registry/agents/qwen.d.ts.map +1 -0
  368. package/dist/lib/launch/registry/agents/qwen.js +11 -0
  369. package/dist/lib/launch/registry/agents/qwen.js.map +1 -0
  370. package/dist/lib/launch/registry/index.d.ts +4 -1
  371. package/dist/lib/launch/registry/index.d.ts.map +1 -1
  372. package/dist/lib/launch/registry/index.js +15 -2
  373. package/dist/lib/launch/registry/index.js.map +1 -1
  374. package/dist/lib/launch/registry/types.d.ts +17 -1
  375. package/dist/lib/launch/registry/types.d.ts.map +1 -1
  376. package/dist/lib/launch/run-agent.d.ts +11 -0
  377. package/dist/lib/launch/run-agent.d.ts.map +1 -1
  378. package/dist/lib/launch/run-agent.js +22 -1
  379. package/dist/lib/launch/run-agent.js.map +1 -1
  380. package/dist/lib/launch/strict-entry.d.ts +22 -2
  381. package/dist/lib/launch/strict-entry.d.ts.map +1 -1
  382. package/dist/lib/launch/strict-entry.js +82 -2
  383. package/dist/lib/launch/strict-entry.js.map +1 -1
  384. package/dist/lib/launch/yaml-scan.d.ts +59 -0
  385. package/dist/lib/launch/yaml-scan.d.ts.map +1 -0
  386. package/dist/lib/launch/yaml-scan.js +275 -0
  387. package/dist/lib/launch/yaml-scan.js.map +1 -0
  388. package/dist/lib/llm-providers.d.ts +66 -0
  389. package/dist/lib/llm-providers.d.ts.map +1 -0
  390. package/dist/lib/llm-providers.js +150 -0
  391. package/dist/lib/llm-providers.js.map +1 -0
  392. package/dist/lib/local-db-epoch.d.ts +4 -0
  393. package/dist/lib/local-db-epoch.d.ts.map +1 -0
  394. package/dist/lib/local-db-epoch.js +19 -0
  395. package/dist/lib/local-db-epoch.js.map +1 -0
  396. package/dist/lib/local-db-migrate.d.ts +85 -0
  397. package/dist/lib/local-db-migrate.d.ts.map +1 -0
  398. package/dist/lib/local-db-migrate.js +484 -0
  399. package/dist/lib/local-db-migrate.js.map +1 -0
  400. package/dist/lib/local-db-v10.d.ts +28 -0
  401. package/dist/lib/local-db-v10.d.ts.map +1 -0
  402. package/dist/lib/local-db-v10.js +49 -0
  403. package/dist/lib/local-db-v10.js.map +1 -0
  404. package/dist/lib/local-db-v11.d.ts +24 -0
  405. package/dist/lib/local-db-v11.d.ts.map +1 -0
  406. package/dist/lib/local-db-v11.js +25 -0
  407. package/dist/lib/local-db-v11.js.map +1 -0
  408. package/dist/lib/local-db-v7.d.ts +30 -0
  409. package/dist/lib/local-db-v7.d.ts.map +1 -0
  410. package/dist/lib/local-db-v7.js +285 -0
  411. package/dist/lib/local-db-v7.js.map +1 -0
  412. package/dist/lib/local-db-v8.d.ts +22 -0
  413. package/dist/lib/local-db-v8.d.ts.map +1 -0
  414. package/dist/lib/local-db-v8.js +33 -0
  415. package/dist/lib/local-db-v8.js.map +1 -0
  416. package/dist/lib/local-db-v9.d.ts +10 -0
  417. package/dist/lib/local-db-v9.d.ts.map +1 -0
  418. package/dist/lib/local-db-v9.js +8 -0
  419. package/dist/lib/local-db-v9.js.map +1 -0
  420. package/dist/lib/local-db.d.ts +61 -11
  421. package/dist/lib/local-db.d.ts.map +1 -1
  422. package/dist/lib/local-db.js +186 -371
  423. package/dist/lib/local-db.js.map +1 -1
  424. package/dist/lib/local-embeddings.d.ts.map +1 -1
  425. package/dist/lib/local-embeddings.js +2 -2
  426. package/dist/lib/local-embeddings.js.map +1 -1
  427. package/dist/lib/local-gateway-client.d.ts +30 -87
  428. package/dist/lib/local-gateway-client.d.ts.map +1 -1
  429. package/dist/lib/local-gateway-client.js +182 -171
  430. package/dist/lib/local-gateway-client.js.map +1 -1
  431. package/dist/lib/local-ingest.d.ts +129 -0
  432. package/dist/lib/local-ingest.d.ts.map +1 -0
  433. package/dist/lib/local-ingest.js +81 -0
  434. package/dist/lib/local-ingest.js.map +1 -0
  435. package/dist/lib/local-link-pass.d.ts +15 -0
  436. package/dist/lib/local-link-pass.d.ts.map +1 -0
  437. package/dist/lib/local-link-pass.js +61 -0
  438. package/dist/lib/local-link-pass.js.map +1 -0
  439. package/dist/lib/local-llm.d.ts +63 -12
  440. package/dist/lib/local-llm.d.ts.map +1 -1
  441. package/dist/lib/local-llm.js +229 -104
  442. package/dist/lib/local-llm.js.map +1 -1
  443. package/dist/lib/local-mode.d.ts +4 -1
  444. package/dist/lib/local-mode.d.ts.map +1 -1
  445. package/dist/lib/local-mode.js +16 -1
  446. package/dist/lib/local-mode.js.map +1 -1
  447. package/dist/lib/local-provenance.d.ts +14 -0
  448. package/dist/lib/local-provenance.d.ts.map +1 -0
  449. package/dist/lib/local-provenance.js +14 -0
  450. package/dist/lib/local-provenance.js.map +1 -0
  451. package/dist/lib/local-thresholds.d.ts +70 -0
  452. package/dist/lib/local-thresholds.d.ts.map +1 -0
  453. package/dist/lib/local-thresholds.js +79 -0
  454. package/dist/lib/local-thresholds.js.map +1 -0
  455. package/dist/lib/mcp/mark-tool.d.ts +27 -0
  456. package/dist/lib/mcp/mark-tool.d.ts.map +1 -0
  457. package/dist/lib/mcp/mark-tool.js +103 -0
  458. package/dist/lib/mcp/mark-tool.js.map +1 -0
  459. package/dist/lib/mcp/share-tool.d.ts +46 -0
  460. package/dist/lib/mcp/share-tool.d.ts.map +1 -0
  461. package/dist/lib/mcp/share-tool.js +68 -0
  462. package/dist/lib/mcp/share-tool.js.map +1 -0
  463. package/dist/lib/mcp/tool-rules.d.ts +30 -0
  464. package/dist/lib/mcp/tool-rules.d.ts.map +1 -0
  465. package/dist/lib/mcp/tool-rules.js +84 -0
  466. package/dist/lib/mcp/tool-rules.js.map +1 -0
  467. package/dist/lib/mcp-backfill.d.ts +89 -0
  468. package/dist/lib/mcp-backfill.d.ts.map +1 -0
  469. package/dist/lib/mcp-backfill.js +194 -0
  470. package/dist/lib/mcp-backfill.js.map +1 -0
  471. package/dist/lib/mcp-scope.d.ts +90 -0
  472. package/dist/lib/mcp-scope.d.ts.map +1 -0
  473. package/dist/lib/mcp-scope.js +125 -0
  474. package/dist/lib/mcp-scope.js.map +1 -0
  475. package/dist/lib/mcp-sync.d.ts +64 -0
  476. package/dist/lib/mcp-sync.d.ts.map +1 -0
  477. package/dist/lib/mcp-sync.js +183 -0
  478. package/dist/lib/mcp-sync.js.map +1 -0
  479. package/dist/lib/personal-import.d.ts +7 -0
  480. package/dist/lib/personal-import.d.ts.map +1 -1
  481. package/dist/lib/personal-import.js +13 -1
  482. package/dist/lib/personal-import.js.map +1 -1
  483. package/dist/lib/safe-config-write.d.ts +12 -1
  484. package/dist/lib/safe-config-write.d.ts.map +1 -1
  485. package/dist/lib/safe-config-write.js +162 -9
  486. package/dist/lib/safe-config-write.js.map +1 -1
  487. package/dist/lib/scope-choices.d.ts +51 -0
  488. package/dist/lib/scope-choices.d.ts.map +1 -0
  489. package/dist/lib/scope-choices.js +193 -0
  490. package/dist/lib/scope-choices.js.map +1 -0
  491. package/dist/lib/scope-connect.d.ts +82 -0
  492. package/dist/lib/scope-connect.d.ts.map +1 -0
  493. package/dist/lib/scope-connect.js +258 -0
  494. package/dist/lib/scope-connect.js.map +1 -0
  495. package/dist/lib/scope-defaults.d.ts +3 -0
  496. package/dist/lib/scope-defaults.d.ts.map +1 -0
  497. package/dist/lib/scope-defaults.js +42 -0
  498. package/dist/lib/scope-defaults.js.map +1 -0
  499. package/dist/lib/scope-real.d.ts +223 -0
  500. package/dist/lib/scope-real.d.ts.map +1 -0
  501. package/dist/lib/scope-real.js +58 -0
  502. package/dist/lib/scope-real.js.map +1 -0
  503. package/dist/lib/scope-values.d.ts +76 -0
  504. package/dist/lib/scope-values.d.ts.map +1 -0
  505. package/dist/lib/scope-values.js +169 -0
  506. package/dist/lib/scope-values.js.map +1 -0
  507. package/dist/lib/scope.d.ts +161 -0
  508. package/dist/lib/scope.d.ts.map +1 -0
  509. package/dist/lib/scope.js +323 -0
  510. package/dist/lib/scope.js.map +1 -0
  511. package/dist/lib/share/command.d.ts +32 -0
  512. package/dist/lib/share/command.d.ts.map +1 -0
  513. package/dist/lib/share/command.js +136 -0
  514. package/dist/lib/share/command.js.map +1 -0
  515. package/dist/lib/share/ledger.d.ts +59 -0
  516. package/dist/lib/share/ledger.d.ts.map +1 -0
  517. package/dist/lib/share/ledger.js +135 -0
  518. package/dist/lib/share/ledger.js.map +1 -0
  519. package/dist/lib/share/payload.d.ts +92 -0
  520. package/dist/lib/share/payload.d.ts.map +1 -0
  521. package/dist/lib/share/payload.js +138 -0
  522. package/dist/lib/share/payload.js.map +1 -0
  523. package/dist/lib/share/pending.d.ts +48 -0
  524. package/dist/lib/share/pending.d.ts.map +1 -0
  525. package/dist/lib/share/pending.js +130 -0
  526. package/dist/lib/share/pending.js.map +1 -0
  527. package/dist/lib/share/preview.d.ts +18 -0
  528. package/dist/lib/share/preview.d.ts.map +1 -0
  529. package/dist/lib/share/preview.js +72 -0
  530. package/dist/lib/share/preview.js.map +1 -0
  531. package/dist/lib/share/run.d.ts +115 -0
  532. package/dist/lib/share/run.d.ts.map +1 -0
  533. package/dist/lib/share/run.js +261 -0
  534. package/dist/lib/share/run.js.map +1 -0
  535. package/dist/lib/share/salt.d.ts +2 -0
  536. package/dist/lib/share/salt.d.ts.map +1 -0
  537. package/dist/lib/share/salt.js +44 -0
  538. package/dist/lib/share/salt.js.map +1 -0
  539. package/dist/lib/share/secret-patterns.json +100 -0
  540. package/dist/lib/share/secret-scan.d.ts +19 -0
  541. package/dist/lib/share/secret-scan.d.ts.map +1 -0
  542. package/dist/lib/share/secret-scan.js +75 -0
  543. package/dist/lib/share/secret-scan.js.map +1 -0
  544. package/dist/lib/share/tty.d.ts +4 -0
  545. package/dist/lib/share/tty.d.ts.map +1 -0
  546. package/dist/lib/share/tty.js +57 -0
  547. package/dist/lib/share/tty.js.map +1 -0
  548. package/dist/lib/share/visible.d.ts +4 -0
  549. package/dist/lib/share/visible.d.ts.map +1 -0
  550. package/dist/lib/share/visible.js +30 -0
  551. package/dist/lib/share/visible.js.map +1 -0
  552. package/dist/lib/share/wire.d.ts +98 -0
  553. package/dist/lib/share/wire.d.ts.map +1 -0
  554. package/dist/lib/share/wire.js +43 -0
  555. package/dist/lib/share/wire.js.map +1 -0
  556. package/dist/lib/similarity/embedding-matrix.d.ts +64 -0
  557. package/dist/lib/similarity/embedding-matrix.d.ts.map +1 -0
  558. package/dist/lib/similarity/embedding-matrix.js +119 -0
  559. package/dist/lib/similarity/embedding-matrix.js.map +1 -0
  560. package/dist/lib/since-flag.d.ts +11 -0
  561. package/dist/lib/since-flag.d.ts.map +1 -0
  562. package/dist/lib/since-flag.js +24 -0
  563. package/dist/lib/since-flag.js.map +1 -0
  564. package/dist/lib/since.d.ts +59 -0
  565. package/dist/lib/since.d.ts.map +1 -0
  566. package/dist/lib/since.js +86 -0
  567. package/dist/lib/since.js.map +1 -0
  568. package/dist/lib/source-key.d.ts +13 -0
  569. package/dist/lib/source-key.d.ts.map +1 -0
  570. package/dist/lib/source-key.js +60 -0
  571. package/dist/lib/source-key.js.map +1 -0
  572. package/dist/lib/source-sync-state.d.ts +12 -0
  573. package/dist/lib/source-sync-state.d.ts.map +1 -0
  574. package/dist/lib/source-sync-state.js +43 -0
  575. package/dist/lib/source-sync-state.js.map +1 -0
  576. package/dist/lib/startup-backfill-track.d.ts +2 -0
  577. package/dist/lib/startup-backfill-track.d.ts.map +1 -0
  578. package/dist/lib/startup-backfill-track.js +6 -0
  579. package/dist/lib/startup-backfill-track.js.map +1 -0
  580. package/dist/lib/startup-env.d.ts +8 -0
  581. package/dist/lib/startup-env.d.ts.map +1 -0
  582. package/dist/lib/startup-env.js +8 -0
  583. package/dist/lib/startup-env.js.map +1 -0
  584. package/dist/lib/startup-xdg.d.ts +2 -0
  585. package/dist/lib/startup-xdg.d.ts.map +1 -0
  586. package/dist/lib/startup-xdg.js +9 -0
  587. package/dist/lib/startup-xdg.js.map +1 -0
  588. package/dist/lib/sync/after-connect.d.ts +2 -0
  589. package/dist/lib/sync/after-connect.d.ts.map +1 -0
  590. package/dist/lib/sync/after-connect.js +18 -0
  591. package/dist/lib/sync/after-connect.js.map +1 -0
  592. package/dist/lib/sync/bg-claim.d.ts +14 -0
  593. package/dist/lib/sync/bg-claim.d.ts.map +1 -0
  594. package/dist/lib/sync/bg-claim.js +97 -0
  595. package/dist/lib/sync/bg-claim.js.map +1 -0
  596. package/dist/lib/sync/blocked.d.ts +8 -0
  597. package/dist/lib/sync/blocked.d.ts.map +1 -0
  598. package/dist/lib/sync/blocked.js +44 -0
  599. package/dist/lib/sync/blocked.js.map +1 -0
  600. package/dist/lib/sync/classify.d.ts +34 -0
  601. package/dist/lib/sync/classify.d.ts.map +1 -0
  602. package/dist/lib/sync/classify.js +91 -0
  603. package/dist/lib/sync/classify.js.map +1 -0
  604. package/dist/lib/sync/drain.d.ts +16 -0
  605. package/dist/lib/sync/drain.d.ts.map +1 -0
  606. package/dist/lib/sync/drain.js +33 -0
  607. package/dist/lib/sync/drain.js.map +1 -0
  608. package/dist/lib/sync/forget.d.ts +12 -0
  609. package/dist/lib/sync/forget.d.ts.map +1 -0
  610. package/dist/lib/sync/forget.js +32 -0
  611. package/dist/lib/sync/forget.js.map +1 -0
  612. package/dist/lib/sync/launch-hook.d.ts +42 -0
  613. package/dist/lib/sync/launch-hook.d.ts.map +1 -0
  614. package/dist/lib/sync/launch-hook.js +117 -0
  615. package/dist/lib/sync/launch-hook.js.map +1 -0
  616. package/dist/lib/sync/lock.d.ts +35 -0
  617. package/dist/lib/sync/lock.d.ts.map +1 -0
  618. package/dist/lib/sync/lock.js +175 -0
  619. package/dist/lib/sync/lock.js.map +1 -0
  620. package/dist/lib/sync/purge.d.ts +38 -0
  621. package/dist/lib/sync/purge.d.ts.map +1 -0
  622. package/dist/lib/sync/purge.js +61 -0
  623. package/dist/lib/sync/purge.js.map +1 -0
  624. package/dist/lib/sync/real-env.d.ts +208 -0
  625. package/dist/lib/sync/real-env.d.ts.map +1 -0
  626. package/dist/lib/sync/real-env.js +47 -0
  627. package/dist/lib/sync/real-env.js.map +1 -0
  628. package/dist/lib/sync/relink.d.ts +14 -0
  629. package/dist/lib/sync/relink.d.ts.map +1 -0
  630. package/dist/lib/sync/relink.js +36 -0
  631. package/dist/lib/sync/relink.js.map +1 -0
  632. package/dist/lib/sync/report.d.ts +3 -0
  633. package/dist/lib/sync/report.d.ts.map +1 -0
  634. package/dist/lib/sync/report.js +54 -0
  635. package/dist/lib/sync/report.js.map +1 -0
  636. package/dist/lib/sync/run-all.d.ts +23 -0
  637. package/dist/lib/sync/run-all.d.ts.map +1 -0
  638. package/dist/lib/sync/run-all.js +30 -0
  639. package/dist/lib/sync/run-all.js.map +1 -0
  640. package/dist/lib/sync/run-source.d.ts +73 -0
  641. package/dist/lib/sync/run-source.d.ts.map +1 -0
  642. package/dist/lib/sync/run-source.js +262 -0
  643. package/dist/lib/sync/run-source.js.map +1 -0
  644. package/dist/lib/sync/safe-read.d.ts +4 -0
  645. package/dist/lib/sync/safe-read.d.ts.map +1 -0
  646. package/dist/lib/sync/safe-read.js +40 -0
  647. package/dist/lib/sync/safe-read.js.map +1 -0
  648. package/dist/lib/sync/should-background-sync.d.ts +31 -0
  649. package/dist/lib/sync/should-background-sync.d.ts.map +1 -0
  650. package/dist/lib/sync/should-background-sync.js +69 -0
  651. package/dist/lib/sync/should-background-sync.js.map +1 -0
  652. package/dist/lib/sync/source-ids.d.ts +10 -0
  653. package/dist/lib/sync/source-ids.d.ts.map +1 -0
  654. package/dist/lib/sync/source-ids.js +9 -0
  655. package/dist/lib/sync/source-ids.js.map +1 -0
  656. package/dist/lib/sync/sources.d.ts +33 -0
  657. package/dist/lib/sync/sources.d.ts.map +1 -0
  658. package/dist/lib/sync/sources.js +37 -0
  659. package/dist/lib/sync/sources.js.map +1 -0
  660. package/dist/lib/sync/spawn-background.d.ts +27 -0
  661. package/dist/lib/sync/spawn-background.d.ts.map +1 -0
  662. package/dist/lib/sync/spawn-background.js +66 -0
  663. package/dist/lib/sync/spawn-background.js.map +1 -0
  664. package/dist/lib/sync/status.d.ts +57 -0
  665. package/dist/lib/sync/status.d.ts.map +1 -0
  666. package/dist/lib/sync/status.js +166 -0
  667. package/dist/lib/sync/status.js.map +1 -0
  668. package/dist/lib/sync/summary-read.d.ts +19 -0
  669. package/dist/lib/sync/summary-read.d.ts.map +1 -0
  670. package/dist/lib/sync/summary-read.js +39 -0
  671. package/dist/lib/sync/summary-read.js.map +1 -0
  672. package/dist/lib/sync/summary.d.ts +10 -0
  673. package/dist/lib/sync/summary.d.ts.map +1 -0
  674. package/dist/lib/sync/summary.js +80 -0
  675. package/dist/lib/sync/summary.js.map +1 -0
  676. package/dist/lib/sync/sync-state.d.ts +128 -0
  677. package/dist/lib/sync/sync-state.d.ts.map +1 -0
  678. package/dist/lib/sync/sync-state.js +253 -0
  679. package/dist/lib/sync/sync-state.js.map +1 -0
  680. package/dist/lib/sync/telemetry.d.ts +20 -0
  681. package/dist/lib/sync/telemetry.d.ts.map +1 -0
  682. package/dist/lib/sync/telemetry.js +31 -0
  683. package/dist/lib/sync/telemetry.js.map +1 -0
  684. package/dist/lib/sync/threads.d.ts +48 -0
  685. package/dist/lib/sync/threads.d.ts.map +1 -0
  686. package/dist/lib/sync/threads.js +82 -0
  687. package/dist/lib/sync/threads.js.map +1 -0
  688. package/dist/lib/sync/window.d.ts +72 -0
  689. package/dist/lib/sync/window.d.ts.map +1 -0
  690. package/dist/lib/sync/window.js +112 -0
  691. package/dist/lib/sync/window.js.map +1 -0
  692. package/dist/lib/team-cta.d.ts +11 -0
  693. package/dist/lib/team-cta.d.ts.map +1 -0
  694. package/dist/lib/team-cta.js +16 -0
  695. package/dist/lib/team-cta.js.map +1 -0
  696. package/dist/lib/telemetry-ci.d.ts +2 -0
  697. package/dist/lib/telemetry-ci.d.ts.map +1 -0
  698. package/dist/lib/telemetry-ci.js +21 -0
  699. package/dist/lib/telemetry-ci.js.map +1 -0
  700. package/dist/lib/telemetry-consent.d.ts +44 -23
  701. package/dist/lib/telemetry-consent.d.ts.map +1 -1
  702. package/dist/lib/telemetry-consent.js +74 -35
  703. package/dist/lib/telemetry-consent.js.map +1 -1
  704. package/dist/lib/telemetry-env.d.ts +1 -1
  705. package/dist/lib/usage-telemetry.d.ts +87 -22
  706. package/dist/lib/usage-telemetry.d.ts.map +1 -1
  707. package/dist/lib/usage-telemetry.js +263 -74
  708. package/dist/lib/usage-telemetry.js.map +1 -1
  709. package/dist/lib/xdg.d.ts +27 -0
  710. package/dist/lib/xdg.d.ts.map +1 -0
  711. package/dist/lib/xdg.js +56 -0
  712. package/dist/lib/xdg.js.map +1 -0
  713. package/package.json +3 -2
  714. package/dist/commands/push.d.ts +0 -25
  715. package/dist/commands/push.d.ts.map +0 -1
  716. package/dist/commands/push.js +0 -98
  717. package/dist/commands/push.js.map +0 -1
@@ -16,13 +16,15 @@ import { createLocalDb } from '../lib/local-db.js';
16
16
  import { buildFoundSummary, renderFoundSummary } from '../lib/found-summary.js';
17
17
  import { createCaptureCollector, toCaptureSource } from '../lib/capture-report.js';
18
18
  import { CAPTURE_SOURCES } from '../lib/capture-sources.js';
19
- import { IMPORT_LIMITS, SLACK_DAYS_BACK } from '../lib/import-defaults.js';
19
+ import { GIT_DEFAULT_LIMIT, SYNC_CEILINGS, SYNC_WINDOW_DEFAULT_DAYS } from '../lib/import-defaults.js';
20
+ import { fetchWindow, parseSince, windowExtras, windowLabel } from '../lib/since.js';
20
21
  import { initLocalMode } from '../lib/local-mode.js';
22
+ import { afterSourceConnected } from '../lib/sync/after-connect.js';
23
+ import { connectScopeCtx, fetchUnderScope } from '../lib/scope-connect.js';
21
24
  import { loginInteractive } from '../lib/login-flow.js';
22
25
  import { resolveAppUrl } from '../lib/env-resolver.js';
23
26
  import { collectTokensViaOAuth, oauthFlowLabel } from '../lib/personal-oauth.js';
24
27
  import { isAuthExpiry } from '../lib/errors.js';
25
- import { maybeRequestTelemetryConsent } from '../lib/telemetry-consent.js';
26
28
  import { commandIntro } from '../lib/brand.js';
27
29
  import pkg from '../../package.json' with { type: 'json' };
28
30
  const { version } = pkg;
@@ -30,18 +32,19 @@ import { printBanner } from '../lib/brand.js';
30
32
  import { guardedPrompt } from '../lib/prompt-guard.js';
31
33
  import { setupSummaryLine, unresolvedGaps } from '../lib/connect-prompt.js';
32
34
  import { createSetupFunnel } from '../lib/setup-funnel.js';
33
- import { agentAskLine, agentConnectedLine, orderAgents, projectAgentsFromWritten } from '../lib/next-step.js';
35
+ import { agentAskLine, agentConnectedLine, firstQuestion, orderAgents, projectAgentsFromWritten } from '../lib/next-step.js';
34
36
  import { projectForeignNotice } from '../lib/foreign-env.js';
35
37
  import { PICK_CANCELLED, pickAgent } from '../lib/launch/pick-agent.js';
36
38
  import { InvalidEnvError, routeSetup } from '../lib/setup-route.js';
37
39
  import { agentByName } from '../lib/launch/agents.js';
40
+ import { launchesAfterWizard } from '../lib/launch/launch.js';
41
+ import { PROVIDER_LABEL, STORABLE_PROVIDERS } from '../lib/llm-providers.js';
38
42
  import { firstDecision } from '../lib/first-decision.js';
39
- import { hasConfiguredProvider } from '../lib/local-llm.js';
40
43
  const TIER_ORDER = { personal: 0, site: 1, workspace: 2 };
41
44
  // How many connectors import concurrently after auth. Each import is itself
42
45
  // batch-parallel (runPersonalImport), so this bounds total gateway load.
43
46
  const IMPORT_CONCURRENCY = 4;
44
- function buildSources(gitAvailable) {
47
+ export function buildSources(gitAvailable) {
45
48
  const sources = [];
46
49
  if (gitAvailable) {
47
50
  sources.push({
@@ -50,7 +53,8 @@ function buildSources(gitAvailable) {
50
53
  description: 'Commit history from this repo - no token needed',
51
54
  fetch: async () => {
52
55
  const { fetchGitItems } = await import('../lib/fetchers/git.js');
53
- return fetchGitItems({ limit: IMPORT_LIMITS.git });
56
+ // The newest commits however old, as before the window (GIT_DEFAULT_LIMIT); only --since changes it.
57
+ return fetchGitItems({ limit: GIT_DEFAULT_LIMIT });
54
58
  },
55
59
  });
56
60
  }
@@ -72,14 +76,12 @@ function buildSources(gitAvailable) {
72
76
  '&description=Read-only+import+of+your+PRs+and+issues+into+your+local+Align+graph' +
73
77
  '&expires_in=90' +
74
78
  '&contents=read&issues=read&pull_requests=read',
75
- fetch: async (t) => {
79
+ fetch: async (t, w = parseSince(undefined), o = {}) => {
76
80
  const { fetchGitHubItems, resolveGitHubRepoScope } = await import('../lib/fetchers/github.js');
77
- // ALI-917: this interactive source has no --repo/--all of its own, so it takes
78
- // resolveGitHubRepoScope's auto-detect-only path (an empty opts object) - the
79
- // same default `align connect github` uses. Without it, a token spanning several
80
- // unrelated repos returns everything across all of them, undifferentiated.
81
- const repo = await resolveGitHubRepoScope({});
82
- return fetchGitHubItems({ token: t['token'], limit: IMPORT_LIMITS.github, ...(repo ? { repo } : {}) });
81
+ // L4: when the caller has resolved the scope (`resolved`), its `repo` is the whole answer and the folder is not consulted.
82
+ // Without it (cloud setup) this is ALI-917's auto-detect: the repo narrows the search, and team scope only when asked.
83
+ const repo = o.resolved ? o.repo : await resolveGitHubRepoScope({});
84
+ return fetchGitHubItems({ token: t['token'], ...fetchWindow('github', w), ...(repo ? { repo, ...(o.team || o.resolved ? { scope: 'team' } : {}) } : {}) });
83
85
  },
84
86
  }, {
85
87
  id: 'jira',
@@ -97,9 +99,9 @@ function buildSources(gitAvailable) {
97
99
  { key: 'email', label: 'Atlassian account email' },
98
100
  { key: 'domain', label: 'Atlassian domain (yourorg.atlassian.net)' },
99
101
  ],
100
- fetch: async (t) => {
102
+ fetch: async (t, w = parseSince(undefined), o) => {
101
103
  const { fetchJiraItems } = await import('../lib/fetchers/jira.js');
102
- return fetchJiraItems({ token: t['token'], cloudId: t['cloudId'], email: t['email'], domain: t['domain'], limit: IMPORT_LIMITS.jira });
104
+ return fetchJiraItems({ token: t['token'], cloudId: t['cloudId'], email: t['email'], domain: t['domain'], ...fetchWindow('jira', w), ...windowExtras(o) });
103
105
  },
104
106
  }, {
105
107
  id: 'confluence',
@@ -116,9 +118,9 @@ function buildSources(gitAvailable) {
116
118
  { key: 'email', label: 'Atlassian account email' },
117
119
  { key: 'domain', label: 'Atlassian domain (yourorg.atlassian.net)' },
118
120
  ],
119
- fetch: async (t) => {
121
+ fetch: async (t, w = parseSince(undefined), o) => {
120
122
  const { fetchConfluenceItems } = await import('../lib/fetchers/confluence.js');
121
- return fetchConfluenceItems({ token: t['token'], cloudId: t['cloudId'], email: t['email'], domain: t['domain'], limit: IMPORT_LIMITS.confluence });
123
+ return fetchConfluenceItems({ token: t['token'], cloudId: t['cloudId'], email: t['email'], domain: t['domain'], ...fetchWindow('confluence', w), ...windowExtras(o) });
122
124
  },
123
125
  }, {
124
126
  id: 'slack',
@@ -132,9 +134,9 @@ function buildSources(gitAvailable) {
132
134
  tokenLabel: 'User token (xoxp-...)',
133
135
  tokenHint: 'User token with read scopes only: channels:read, channels:history, groups:read, groups:history',
134
136
  tokenUrl: 'https://api.slack.com/apps',
135
- fetch: async (t) => {
137
+ fetch: async (t, w = parseSince(undefined), o) => {
136
138
  const { fetchSlackItems } = await import('../lib/fetchers/slack.js');
137
- return fetchSlackItems({ token: t['token'], limit: IMPORT_LIMITS.slack, daysBack: SLACK_DAYS_BACK });
139
+ return fetchSlackItems({ token: t['token'], ...fetchWindow('slack', w), ...windowExtras(o) });
138
140
  },
139
141
  }, {
140
142
  id: 'teams',
@@ -152,9 +154,9 @@ function buildSources(gitAvailable) {
152
154
  'The token expires after about an hour; re-run setup to paste a fresh one.',
153
155
  tokenUrl: 'https://developer.microsoft.com/en-us/graph/graph-explorer',
154
156
  tokenShortLived: true,
155
- fetch: async (t) => {
157
+ fetch: async (t, w = parseSince(undefined), o) => {
156
158
  const { fetchTeamsItems } = await import('../lib/fetchers/teams.js');
157
- return fetchTeamsItems({ token: t['token'], limit: IMPORT_LIMITS.teams });
159
+ return fetchTeamsItems({ token: t['token'], ...fetchWindow('teams', w), ...windowExtras(o) });
158
160
  },
159
161
  }, {
160
162
  id: 'zoom',
@@ -162,9 +164,9 @@ function buildSources(gitAvailable) {
162
164
  description: 'Cloud recording transcripts from your meetings',
163
165
  tier: 'personal',
164
166
  oauthKey: 'zoom',
165
- fetch: async (t) => {
167
+ fetch: async (t, w = parseSince(undefined), o) => {
166
168
  const { fetchZoomItems } = await import('../lib/fetchers/zoom.js');
167
- return fetchZoomItems({ token: t['token'], limit: IMPORT_LIMITS.zoom });
169
+ return fetchZoomItems({ token: t['token'], ...fetchWindow('zoom', w), ...windowExtras(o) });
168
170
  },
169
171
  }, {
170
172
  id: 'gitlab',
@@ -189,9 +191,9 @@ function buildSources(gitAvailable) {
189
191
  extraFields: [
190
192
  { key: 'domain', label: 'GitLab domain (leave blank for gitlab.com)' },
191
193
  ],
192
- fetch: async (t) => {
194
+ fetch: async (t, w = parseSince(undefined), o) => {
193
195
  const { fetchGitLabItems } = await import('../lib/fetchers/gitlab.js');
194
- return fetchGitLabItems({ token: t['token'], domain: t['domain'] || undefined, limit: IMPORT_LIMITS.gitlab });
196
+ return fetchGitLabItems({ token: t['token'], domain: t['domain'] || undefined, ...fetchWindow('gitlab', w), ...windowExtras(o) });
195
197
  },
196
198
  }, {
197
199
  id: 'linear',
@@ -209,9 +211,9 @@ function buildSources(gitAvailable) {
209
211
  // a workspace slug here, it 404s for everyone outside that workspace.
210
212
  tokenHint: 'Click Create key, then copy it here',
211
213
  tokenUrl: 'https://linear.app/settings/account/security/api-keys/new',
212
- fetch: async (t) => {
214
+ fetch: async (t, w = parseSince(undefined), o) => {
213
215
  const { fetchLinearItems } = await import('../lib/fetchers/linear.js');
214
- return fetchLinearItems({ token: t['token'], limit: IMPORT_LIMITS.linear });
216
+ return fetchLinearItems({ token: t['token'], ...fetchWindow('linear', w), ...windowExtras(o) });
215
217
  },
216
218
  }, {
217
219
  id: 'notion',
@@ -232,9 +234,9 @@ function buildSources(gitAvailable) {
232
234
  // landing (both resolve; this one is where the secret actually lives - Tom,
233
235
  // from a live run, 2026-08-31).
234
236
  tokenUrl: 'https://app.notion.com/developers/tokens',
235
- fetch: async (t) => {
237
+ fetch: async (t, w = parseSince(undefined), o) => {
236
238
  const { fetchNotionItems } = await import('../lib/fetchers/notion.js');
237
- return fetchNotionItems({ token: t['token'], limit: IMPORT_LIMITS.notion });
239
+ return fetchNotionItems({ token: t['token'], ...fetchWindow('notion', w), ...windowExtras(o) });
238
240
  },
239
241
  });
240
242
  return sources;
@@ -367,182 +369,48 @@ function writeAgentAlignment(envName) {
367
369
  }
368
370
  }
369
371
  // ---------------------------------------------------------------------------
370
- // Guided free-tier AI provider key (ALI-1284)
372
+ // Saved AI provider keys
371
373
  // ---------------------------------------------------------------------------
372
374
  /**
373
- * ALI-1283 made BYOK mandatory for every tenant, including free/solo, retiring the
374
- * Align-managed LLM fallback. Before this, `align ask` without a provider key just
375
- * returned a ranked list with no guidance toward getting one - "bring any key" with
376
- * nothing pointing at where to get one fast. That is a cliff against this project's own
377
- * target (a useful first answer within an hour), so the guided default is Groq (no card,
378
- * ever; fastest free-tier inference) with Gemini Flash-Lite offered as a second key for
379
- * when Groq's daily request cap is hit. Both DECIDED 2026-09-24 - see the ALI-1284 ticket
380
- * for the free-tier limits that were checked before picking Groq+Gemini over Cerebras
381
- * (now needs a card for its trial) and OpenRouter's `:free` tier (tighter, weaker models).
375
+ * The wizard asks for no AI-provider key. It used to end on ALI-1284's guided Groq + Gemini
376
+ * offer, immediately before bare `align` opened the coding agent - and read in that position
377
+ * the keys looked like something the agent needed (a founder's own 0.48.0 run). They only
378
+ * serve align's own terminal `align ask` prose; inside a wrapped agent the agent writes the
379
+ * prose from the MCP results. `align ask` now offers a key itself, lazily, the first time it
380
+ * has nothing to write prose with (lib/ask-key-offer.ts), and `align ai` chooses or adds one.
382
381
  *
383
- * Skipped entirely, in order:
384
- * - under --approve: a scripted run has no terminal to paste a key into.
385
- * - when a DIFFERENT provider is already configured via env: nothing to fix, with or
386
- * without --reset - this wizard only ever owns Groq and Gemini, so it must never
387
- * re-open itself over someone's genuinely separate ANTHROPIC_API_KEY (Copilot review,
388
- * PR #322: hasConfiguredProvider(['groq', 'gemini']) is what makes this true under
389
- * --reset too, since the plain no-argument form would also count a --reset'd Groq/
390
- * Gemini key hydrateProviderKeyEnv already wrote into process.env before this ran).
391
- * - when a key from a PREVIOUS run of this offer is already stored, UNLESS --reset: do not
392
- * re-ask every time, but give `--reset` the same "clear and redo" meaning here it already
393
- * has for OAuth connectors - without this there was no way to act on the Gemini-backup
394
- * documentation once Groq was stored: hydration restores the stored Groq key on every
395
- * later invocation regardless of what the user unsets in their shell, so
396
- * `align setup --reset` is the real (and now the documented) remedy. Declining either
397
- * re-offered key under --reset CLEARS it (clearProviderKey), not just skips re-asking -
398
- * otherwise a stale stored Gemini key could never actually be removed.
399
- *
400
- * Declining costs nothing - `align ask` still returns a ranked list - so every question
401
- * here defaults to a plain confirm the user can say no to without losing anything.
402
- */
403
- /**
404
- * The non-interactive half of --reset for the Groq/Gemini pair: drop whichever of them is
405
- * stored, so hydrateProviderKeyEnv has nothing left to re-apply on the next invocation.
406
- * Called unconditionally and EARLY in runSetup (Copilot review, PR #323) - not from inside
407
- * offerFreeProviderKey, which is reached too late and too conditionally to guarantee this:
408
- * runLocalConnectorPhase only calls that function when `interactive` (always false under
409
- * --approve, by construction - no TTY), so `align setup --local --reset --approve` never
410
- * reached it at all; a cloud --approve run that is not yet logged in exits even earlier.
411
- * Calling this before mode selection means neither path matters.
382
+ * What --reset keeps doing: clear every saved key and the saved provider choice, so local-llm
383
+ * has nothing saved to use on the next invocation, and re-arm the first-ask offer a "Not now" turned off,
384
+ * so the next `align ask` on a terminal offers again ("redo their setup", lazily). Called
385
+ * early in runSetup, before any auth/TTY-gated exit can skip it (Copilot review, PR #323).
412
386
  */
413
387
  function clearStoredProviderKeys(config) {
414
388
  // Clears the STORED (on-disk) value only, and never touches process.env (Copilot review,
415
- // PR #323, "previously missed" - deeper than an earlier fix here). The earlier version
416
- // deleted the env var when it equalled the stored value, reasoning that equality meant
417
- // hydration had put it there. It does not: hydrateProviderKeyEnv never overwrites a real
418
- // shell-exported value, so a shell that happens to export the SAME string the stored
419
- // value holds (set up once, then also added to a shell profile, say) is indistinguishable
420
- // from "hydration injected it" by equality alone - there is no way to tell the two apart
421
- // from process.env state. Clearing the stored value is what actually matters: it is what
422
- // future invocations hydrate from, so this is enough to make the backup take over on the
423
- // NEXT run. The cost is that THIS run may still see the old value in its own process.env
424
- // for its own remaining work - a stale-for-one-run concession, not a destroyed credential.
425
- config.clearProviderKey('groq');
426
- config.clearProviderKey('gemini');
427
- }
428
- async function offerFreeProviderKey(config, opts) {
429
- // --approve never prompts, full stop. The non-prompting --reset clear it still needs
430
- // (Copilot review, PR #323) runs unconditionally in runSetup, BEFORE mode selection -
431
- // not here, because this function is reached late and conditionally: runLocalConnectorPhase
432
- // only calls it when `interactive` (false under --approve by construction, so --local
433
- // --reset --approve never reached it at all), and an unauthenticated cloud --approve run
434
- // exits earlier still. clearStoredProviderKeys running up front means neither path matters.
435
- if (opts.approve)
436
- return;
437
- if (!opts.reset) {
438
- if (hasConfiguredProvider())
439
- return;
440
- if (config.getProviderKey('groq') || config.getProviderKey('gemini'))
441
- return;
442
- }
443
- else if (hasConfiguredProvider(['groq', 'gemini'])) {
444
- // --reset only concerns the Groq/Gemini pair THIS wizard manages, so skip only the
445
- // stored-key guard, not the real-env one (Copilot review, PR #322): --reset must not
446
- // re-open the wizard for someone who genuinely configured a DIFFERENT provider
447
- // (ANTHROPIC_API_KEY, say) - that still means "nothing to fix" regardless of the flag.
448
- // hydrateProviderKeyEnv (cli.ts's preAction) already wrote any stored Groq/Gemini key
449
- // into process.env before this command's action started, so the plain
450
- // hasConfiguredProvider() the non-reset branch uses would read a --reset'd stored
451
- // value as "already configured" and never reach the re-offer at all - hence the
452
- // exclusion rather than reusing that call directly.
453
- return;
454
- }
455
- console.log('');
456
- const wantGroq = await p.confirm({
457
- message: `${chalk.bold('align ask')} needs an AI provider key to write prose answers ` +
458
- `(without one it still returns a ranked list of matching decisions). ` +
459
- `Set up a free Groq key now? No card, ever - and it's the fastest free tier.`,
460
- initialValue: true,
461
- });
462
- // Cancel (Ctrl-C) and an explicit "no" are NOT the same thing (Copilot review, PR #322):
463
- // cancelling means "stop asking me", and must never have the side effect of deleting a
464
- // saved credential - unaffected by round-4's fix moving the --reset clear to the top of
465
- // runSetup, which runs unconditionally before this prompt is ever reached. Round 4
466
- // (Copilot review): a bare `return` here let the wizard fall through to the normal
467
- // outro and report `setup_completed`, silently swallowing the cancel - inconsistent with
468
- // every other top-level prompt in this file (`p.cancel(...)` + `process.exit(0)`, lines
469
- // ~1208/1260). Matched here too, so Ctrl-C at this LAST step aborts the wizard rather than
470
- // reporting success for a run the user explicitly cut short.
471
- if (p.isCancel(wantGroq)) {
472
- p.cancel('Cancelled.');
473
- process.exit(0);
474
- }
475
- if (!wantGroq) {
476
- // --reset declining Groq is the one way to make a previously stored Gemini key (or no
477
- // key at all) actually take over: hydration re-applies whatever is stored on every
478
- // invocation regardless of what the shell does, so "decline" has to mean "forget it",
479
- // not merely "don't re-ask".
480
- if (opts.reset && config.getProviderKey('groq')) {
481
- // Clears only the STORED value, deliberately never process.env - see
482
- // clearStoredProviderKeys's comment: equality with the stored value does not prove
483
- // the current env value came from hydration rather than the user's own shell.
484
- config.clearProviderKey('groq');
485
- p.log.info('Cleared the saved Groq key.');
486
- }
487
- return;
488
- }
489
- p.log.info(`Get one free: ${chalk.bold('https://console.groq.com/keys')}`);
490
- const groqKey = await guardedPrompt('Groq API key', () => p.password({ message: ' Groq API key:' }));
491
- // Cancel here needs the same abort as the confirm above it (Copilot review, PR #323,
492
- // "previously missed" - the confirm fix alone left this prompt's own Ctrl-C still
493
- // falling through to the outro). `null` (guardedPrompt already warned about a crashed
494
- // prompt) and an empty paste are not cancellation and keep the softer skip-and-continue.
495
- if (p.isCancel(groqKey)) {
496
- p.cancel('Cancelled.');
497
- process.exit(0);
498
- }
499
- if (groqKey === null || !groqKey) {
500
- // Under --reset, a plain re-run would hydrate the still-stored key and skip this offer
501
- // entirely (Copilot review, PR #323, "previously missed") - pointing back at plain
502
- // `align setup` here repeats the exact documentation bug this PR exists to fix.
503
- const retryHint = opts.reset ? 'align setup --reset' : 'align setup';
504
- p.log.warn(`No key entered - skipping. Set ${chalk.bold('GROQ_API_KEY')} yourself any time, or run ${chalk.bold(retryHint)} again.`);
505
- return;
506
- }
507
- config.setProviderKey('groq', groqKey);
508
- process.env['GROQ_API_KEY'] = groqKey; // usable immediately, this run
509
- p.log.success(`Saved - ${chalk.bold('align ask')} will use it on this machine from now on.`);
510
- const wantGemini = await p.confirm({
511
- message: `Also add a Gemini key as backup for when Groq's daily limit is hit? (also free, no card)`,
512
- initialValue: true,
513
- });
514
- // Same cancel/decline split as Groq above, including round 4's fix: terminate rather
515
- // than fall through to the outro.
516
- if (p.isCancel(wantGemini)) {
517
- p.cancel('Cancelled.');
518
- process.exit(0);
519
- }
520
- if (!wantGemini) {
521
- // Symmetric with the Groq decline above: without this, clearProviderKey('gemini') had
522
- // no caller anywhere, and `--reset` could remove a stored Groq key but never a stored
523
- // Gemini one - so "clears saved AI provider keys" (the option's own help text) was not
524
- // actually true for Gemini.
525
- if (opts.reset && config.getProviderKey('gemini')) {
526
- // Same reasoning as the Groq decline above: clears only the stored value.
527
- config.clearProviderKey('gemini');
528
- p.log.info('Cleared the saved Gemini key.');
529
- }
530
- return;
531
- }
532
- p.log.info(`Get one free: ${chalk.bold('https://aistudio.google.com/apikey')}`);
533
- const geminiKey = await guardedPrompt('Gemini API key', () => p.password({ message: ' Gemini API key:' }));
534
- // Same split as the Groq password prompt above.
535
- if (p.isCancel(geminiKey)) {
536
- p.cancel('Cancelled.');
537
- process.exit(0);
389
+ // PR #323, "previously missed"): a key the shell exported is the user's, whatever its value.
390
+ // One line per key actually cleared (M3) - deleting a credential silently is the wrong
391
+ // default for a command people run to fix something else.
392
+ for (const provider of STORABLE_PROVIDERS) {
393
+ if (!config.getProviderKey(provider))
394
+ continue;
395
+ config.clearProviderKey(provider);
396
+ p.log.info(`Cleared the saved ${PROVIDER_LABEL[provider]} key.`);
538
397
  }
539
- if (geminiKey === null || !geminiKey) {
540
- p.log.warn('No key entered - skipping the backup.');
541
- return;
398
+ const pref = config.getLlmPreference().provider;
399
+ if (pref) {
400
+ config.clearLlmPreference();
401
+ p.log.info(`Cleared your saved AI provider choice (${pref}).`);
542
402
  }
543
- config.setProviderKey('gemini', geminiKey);
544
- process.env['GEMINI_API_KEY'] = geminiKey;
545
- p.log.success('Saved as backup.');
403
+ config.setAskKeyOfferDismissed(false);
404
+ }
405
+ /**
406
+ * Whether bare `align` opens the agent the moment this wizard ends. default-action.ts launches
407
+ * after a launchNext setup when an agent was chosen, and launchIfChosen then declines under
408
+ * ALIGN_WRAPPED / ALIGN_NO_LAUNCH or without a terminal - the same conditions, read here so the
409
+ * outro never says "Opening" for a run where nothing opens.
410
+ */
411
+ function willLaunchAgent(agent, launchNext) {
412
+ // localGraph: true - the outro runs only once the local phase has built it.
413
+ return launchNext && launchesAfterWizard({ localGraph: true, agent, isTTY: Boolean(process.stdin.isTTY && process.stdout.isTTY) });
546
414
  }
547
415
  /**
548
416
  * The local outro's one next step, or nothing. No link: the only place to go from here is the
@@ -550,10 +418,10 @@ async function offerFreeProviderKey(config, opts) {
550
418
  * second and then be false, so it is dropped. With no agent the install hints were already
551
419
  * printed once by the pick, and are not repeated here.
552
420
  */
553
- function nextStepLine(agent, launchNext) {
421
+ function nextStepLine(agent, launching) {
554
422
  const label = agent ? agentByName(agent)?.label : undefined;
555
423
  if (label)
556
- return launchNext ? null : `Run ${chalk.bold('align')} to open ${label} with your graph.`;
424
+ return launching ? null : `Run ${chalk.bold('align')} to open ${label} with your graph.`;
557
425
  return `Run ${chalk.bold('align')} once a coding agent is installed.`;
558
426
  }
559
427
  /** Thrown inside the docs block to leave it without starting a read; never surfaces. */
@@ -628,7 +496,7 @@ async function runLocalValuePhase(opts) {
628
496
  try {
629
497
  const gitSource = buildSources(true).find(s => s.id === 'git');
630
498
  const fetched = await gitSource.fetch({});
631
- capture.add(toCaptureSource(gitSource, fetched));
499
+ const gitCs = capture.add(toCaptureSource(gitSource, fetched));
632
500
  const { items } = fetched;
633
501
  if (items.length) {
634
502
  gitSpinner.stop(`Found ${items.length} commits worth importing`);
@@ -636,6 +504,7 @@ async function runLocalValuePhase(opts) {
636
504
  // runPersonalImport prints by default (component 2's whole point) - the one compact
637
505
  // line quiet mode DOES print is a fine progress marker while the summary is built.
638
506
  await runPersonalImport(items, localClient, {
507
+ result: gitCs,
639
508
  label: 'Git',
640
509
  approve: true,
641
510
  appUrl: resolveAppUrl(localEnv),
@@ -696,12 +565,13 @@ async function runLocalValuePhase(opts) {
696
565
  try {
697
566
  if (docsKnown)
698
567
  throw new SkipDocs();
699
- const docs = await fetchDocsItems({ limit: IMPORT_LIMITS.docs });
700
- capture.add(toCaptureSource(CAPTURE_SOURCES.docs, docs));
568
+ const docs = await fetchDocsItems({ limit: SYNC_CEILINGS.docs });
569
+ const docsCs = capture.add(toCaptureSource(CAPTURE_SOURCES.docs, docs));
701
570
  const docsItems = docs.items;
702
571
  if (docsItems.length) {
703
572
  localDocsSpinner.stop(`Found ${docsItems.length} item(s) worth importing`);
704
573
  await runPersonalImport(docsItems, localClient, {
574
+ result: docsCs,
705
575
  label: 'repo docs',
706
576
  approve: true,
707
577
  appUrl: resolveAppUrl(localEnv),
@@ -745,13 +615,9 @@ async function runLocalValuePhase(opts) {
745
615
  console.log('');
746
616
  p.log.info(chalk.dim(connectedLine));
747
617
  }
748
- // ALI-618: one-time, never asked again once answered. Local mode has no account, so consent
749
- // is the only thing that can ever turn this on - see usage-telemetry.ts's local-embedded
750
- // branch, which reads this same stored decision.
751
- await maybeRequestTelemetryConsent(config, Boolean(interactive));
752
- // ALI-949: the first checkpoint at which a local-mode setup_started CAN send - consent is
753
- // only now on disk (or was already, on a re-run). The wizard-start offer in runSetup could
754
- // not send for a fresh install, so the funnel object is offered the local env again here.
618
+ // ALI-949: the first checkpoint at which the local env is initialised, so a local-mode
619
+ // setup_started is offered against it here. (C6: there is no consent question any more - the
620
+ // one-time notice in cli.ts's preAction is the disclosure local sends wait on.)
755
621
  void opts.funnel.started(localEnv);
756
622
  return { interactive, config, localEnv, localClient, dbPath, opts, capture, funnel: opts.funnel, agents, firstFoundTitle, agent };
757
623
  }
@@ -773,7 +639,9 @@ export function localConnectorIds() {
773
639
  export async function connectLocalSources(o) {
774
640
  const { interactive, config, localEnv, localClient, capture, approve } = o;
775
641
  const quiet = o.json === true;
642
+ const window = o.window ?? parseSince(undefined);
776
643
  const results = [];
644
+ const scopeCtx = connectScopeCtx({ config, dbPath: localEnv.localDbPath, interactive, quiet, flags: o.scopeFlags });
777
645
  // Connectors: local mode connects by a read-only token the user mints themselves,
778
646
  // for every connector - their personal graph, their credential. OAuth belongs to
779
647
  // the personal-cloud path, where the hosted broker holds the client secrets. (This
@@ -945,20 +813,22 @@ export async function connectLocalSources(o) {
945
813
  // is only the automatic import for the paste-token connectors just collected.
946
814
  for (const { source, tokens, reused } of localReady) {
947
815
  const spinner = quiet ? { start() { }, stop() { } } : p.spinner();
948
- spinner.start(`Fetching from ${source.label}...`);
816
+ let sourceCs;
949
817
  try {
950
- const fetched = await source.fetch(tokens);
951
- capture.add(toCaptureSource(source, fetched));
818
+ const fetched = await fetchUnderScope(source, tokens, window, scopeCtx, () => spinner.start(`Fetching from ${source.label}...`));
819
+ sourceCs = capture.add(toCaptureSource(source, fetched, windowLabel(window.days)));
952
820
  const { items } = fetched;
953
821
  // Saved only once the fetch it unlocked has succeeded. A token that never worked is not
954
822
  // worth remembering, and storing one would turn the next run's honest "paste a token"
955
823
  // into a silent empty import. Re-saving an already-saved token is a harmless no-op, so
956
824
  // there is one rule here rather than a branch that has to stay in step with the reuse.
957
825
  config.saveConnectorFields('local', source.id, tokens);
826
+ afterSourceConnected(localEnv.localDbPath, source.id, (id) => Boolean(config.getConnectorFields('local', id)?.['token']));
958
827
  spinner.stop(`Found ${items.length} items`);
959
828
  let imported = 0;
960
829
  if (items.length) {
961
830
  imported = await runPersonalImport(items, localClient, {
831
+ result: sourceCs,
962
832
  label: source.label,
963
833
  approve: true,
964
834
  appUrl: resolveAppUrl(localEnv),
@@ -968,10 +838,15 @@ export async function connectLocalSources(o) {
968
838
  funnel: { env: localEnv, source: source.id },
969
839
  });
970
840
  }
971
- results.push({ id: source.id, label: source.label, found: items.length, imported });
841
+ results.push({ id: source.id, label: source.label, found: items.length, imported, ...(fetched.report.scopeNote ? { reads: fetched.report.scopeNote } : {}), ...(fetched.report.disclosurePending ? { disclosure_pending: true } : {}) });
972
842
  }
973
843
  catch (e) {
974
844
  const msg = e.message;
845
+ // An import that threw stored an unknown amount: never leave the report saying all of it.
846
+ if (sourceCs) {
847
+ sourceCs.stored ??= 0;
848
+ sourceCs.failedBatches = Math.max(sourceCs.failedBatches ?? 0, 1);
849
+ }
975
850
  if (reused && isAuthExpiry(e)) {
976
851
  // The provider said the SAVED token is dead. Left saved it would keep the connector
977
852
  // "connected" on every later run and hide the gap line the graph would otherwise
@@ -1033,22 +908,23 @@ async function runLocalConnectorPhase(ctx) {
1033
908
  const gaps = unresolvedGaps(refsDb.getAllRefs(), isConnected);
1034
909
  refsDb.close();
1035
910
  const gapLine = setupSummaryLine(gaps);
1036
- // ALI-1284: the same guided free-tier key as the cloud path - local mode needs one too,
1037
- // `align ask` resolves providers identically either way. Gated on `interactive` like
1038
- // every other prompt in this phase, rather than only on `opts.approve`, since local mode
1039
- // (unlike cloud) is routinely run non-interactively with no terminal to paste a key into.
1040
- if (interactive)
1041
- await offerFreeProviderKey(config, opts);
1042
911
  // ALI-950: the last line is the next step, and it happens in the agent - named, with a
1043
912
  // question about a decision the wizard just found, and no CLI verb. This used to end on
1044
913
  // `align ask "why <a thing you decided>"`, a prompt verb on the one screen whose job is to
1045
914
  // send the user into their agent. The gap line, when there is one, sits above it.
1046
- const nextStep = nextStepLine(agent, Boolean(opts.launchNext));
915
+ // The 0.48.0 outro said "Open Claude Code in this repo and ask: ..." and align then opened
916
+ // Claude Code itself. When it is about to, the last line says so instead.
917
+ const launching = willLaunchAgent(agent, Boolean(opts.launchNext));
918
+ const launchLabel = launching && agent ? agentByName(agent)?.label : undefined;
919
+ const nextStep = nextStepLine(agent, launching);
920
+ const askLine = launchLabel
921
+ ? `Opening ${launchLabel}. Ask it: ${firstQuestion(firstFoundTitle)}`
922
+ : agentAskLine({ agents, firstTitle: firstFoundTitle, inRepo: true, envName: 'local' });
1047
923
  p.outro(`${chalk.green('You are set up in local mode.')}\n` +
1048
924
  ` Graph: ${chalk.dim(dbPath)}\n` +
1049
925
  `${nextStep ? ` ${nextStep}\n` : ''}` +
1050
926
  `${gapLine ? `\n ${chalk.dim(gapLine)}\n` : ''}\n` +
1051
- ` ${chalk.bold(agentAskLine({ agents, firstTitle: firstFoundTitle, inRepo: true, envName: 'local' }))}`);
927
+ ` ${chalk.bold(askLine)}`);
1052
928
  // ALI-949: after the outro, never before it - telemetry must not delay what the user is
1053
929
  // waiting for. Awaited (unlike the other emitters) because this is the wizard's last act
1054
930
  // and the one row the funnel was blind to; there is nothing left for a 2s worst case to hold up.
@@ -1068,7 +944,7 @@ export function registerSetupCommand(program) {
1068
944
  .option('--env <env>', 'local, preview or prod. Logged in to a team? Setup uses it; --env local builds the local graph instead')
1069
945
  .option('--approve', 'Skip confirmation prompts (for scripted use)')
1070
946
  .option('--local', 'Same as --env local: build the local graph even if you are logged in to a team')
1071
- .option('--reset', 'Clear cached OAuth tokens and saved AI provider keys, and redo their setup')
947
+ .option('--reset', 'Clear cached OAuth tokens, saved AI provider keys and the saved AI provider choice, and redo their setup')
1072
948
  .option('--verbose', 'List every agent config file setup left as is, with the command to switch it')
1073
949
  .action(runSetup);
1074
950
  }
@@ -1097,14 +973,10 @@ export async function runSetup(opts = {}) {
1097
973
  console.error(err.message);
1098
974
  process.exit(1);
1099
975
  }
1100
- // --reset --approve: clear unconditionally, before any auth/TTY-gated exit can skip it
1101
- // (Copilot review, PR #323). Gated on BOTH flags, deliberately: a plain interactive
1102
- // `--reset` (no --approve) must NOT wipe the stored key here, or offerFreeProviderKey's
1103
- // re-offer below would find nothing to re-offer and the user would never get the chance
1104
- // to choose - only the non-prompting --approve case needs this early, unconditional
1105
- // clear. See clearStoredProviderKeys's own comment for why this cannot live inside
1106
- // offerFreeProviderKey instead.
1107
- if (opts.approve && opts.reset)
976
+ // --reset: clear saved AI provider keys before any auth/TTY-gated exit can skip it
977
+ // (Copilot review, PR #323). Interactive or not - the wizard no longer re-offers keys, so
978
+ // there is nothing for an interactive --reset to wait for; `align ask` offers lazily.
979
+ if (opts.reset)
1108
980
  clearStoredProviderKeys(config);
1109
981
  const interactive = Boolean(process.stdin.isTTY && process.stdout.isTTY);
1110
982
  if (route.kind === 'team') {
@@ -1306,13 +1178,14 @@ async function runCloudSetup(ctx) {
1306
1178
  try {
1307
1179
  const gitSource = buildSources(true).find(s => s.id === 'git');
1308
1180
  const fetched = await gitSource.fetch({});
1309
- capture.add(toCaptureSource(gitSource, fetched));
1181
+ const gitCs = capture.add(toCaptureSource(gitSource, fetched));
1310
1182
  const { items } = fetched;
1311
1183
  // Stop the scan spinner before runPersonalImport - it starts its own
1312
1184
  // progress spinner, and two animated spinners on one line flicker.
1313
1185
  if (items.length) {
1314
1186
  gitSpinner.stop(`Found ${items.length} commits worth importing`);
1315
1187
  const ingested = await runPersonalImport(items, client, {
1188
+ result: gitCs,
1316
1189
  label: 'Git',
1317
1190
  approve: true,
1318
1191
  appUrl: resolveAppUrl(env),
@@ -1336,12 +1209,13 @@ async function runCloudSetup(ctx) {
1336
1209
  const docsSpinner = p.spinner();
1337
1210
  docsSpinner.start('Reading ADRs and CLAUDE.md/AGENTS.md...');
1338
1211
  try {
1339
- const docs = await fetchDocsItems({ limit: IMPORT_LIMITS.docs });
1340
- capture.add(toCaptureSource(CAPTURE_SOURCES.docs, docs));
1212
+ const docs = await fetchDocsItems({ limit: SYNC_CEILINGS.docs });
1213
+ const docsCs = capture.add(toCaptureSource(CAPTURE_SOURCES.docs, docs));
1341
1214
  const docsItems = docs.items;
1342
1215
  if (docsItems.length) {
1343
1216
  docsSpinner.stop(`Found ${docsItems.length} item(s) worth importing`);
1344
1217
  const ingested = await runPersonalImport(docsItems, client, {
1218
+ result: docsCs,
1345
1219
  label: 'repo docs',
1346
1220
  approve: true,
1347
1221
  appUrl: resolveAppUrl(env),
@@ -1383,10 +1257,10 @@ async function runCloudSetup(ctx) {
1383
1257
  for (const result of fetched) {
1384
1258
  const source = result.source;
1385
1259
  if ('fetched' in result) {
1386
- capture.add(toCaptureSource(source, result.fetched));
1260
+ const cs = capture.add(toCaptureSource(source, result.fetched, windowLabel(SYNC_WINDOW_DEFAULT_DAYS)));
1387
1261
  const { items } = result.fetched;
1388
1262
  if (items.length)
1389
- ready.push({ source, items });
1263
+ ready.push({ source, items, cs });
1390
1264
  else
1391
1265
  p.log.warn(`No items found in ${source.label}.`);
1392
1266
  }
@@ -1414,11 +1288,11 @@ async function runCloudSetup(ctx) {
1414
1288
  retrySpinner.start(`Retrying ${source.label}...`);
1415
1289
  try {
1416
1290
  const fetched = await source.fetch(fresh);
1417
- capture.add(toCaptureSource(source, fetched));
1291
+ const cs = capture.add(toCaptureSource(source, fetched, windowLabel(SYNC_WINDOW_DEFAULT_DAYS)));
1418
1292
  const { items } = fetched;
1419
1293
  retrySpinner.stop(`Found ${items.length} items`);
1420
1294
  if (items.length)
1421
- ready.push({ source, items });
1295
+ ready.push({ source, items, cs });
1422
1296
  else
1423
1297
  p.log.warn(`No items found in ${source.label}.`);
1424
1298
  }
@@ -1437,8 +1311,9 @@ async function runCloudSetup(ctx) {
1437
1311
  if (ready.length) {
1438
1312
  console.log('');
1439
1313
  p.log.step(`Importing from ${ready.length} source${ready.length === 1 ? '' : 's'} in parallel...`);
1440
- const importResults = await runWithConcurrency(ready.map(({ source, items }) => async () => {
1314
+ const importResults = await runWithConcurrency(ready.map(({ source, items, cs }) => async () => {
1441
1315
  const total = await runPersonalImport(items, client, {
1316
+ result: cs,
1442
1317
  label: source.label,
1443
1318
  approve: true,
1444
1319
  appUrl: resolveAppUrl(env),
@@ -1450,13 +1325,17 @@ async function runCloudSetup(ctx) {
1450
1325
  });
1451
1326
  return { label: source.label, total };
1452
1327
  }), IMPORT_CONCURRENCY);
1453
- for (const r of importResults) {
1328
+ for (const [i, r] of importResults.entries()) {
1454
1329
  if (r.status === 'fulfilled') {
1455
1330
  totalDecisions += r.value.total;
1456
1331
  if (r.value.total > 0)
1457
1332
  sourcesImported.push(r.value.label);
1458
1333
  }
1459
1334
  else {
1335
+ // The import threw before reporting: the capture line must not say all of it was imported.
1336
+ const cs = ready[i].cs;
1337
+ cs.stored ??= 0;
1338
+ cs.failedBatches = Math.max(cs.failedBatches ?? 0, 1);
1460
1339
  p.log.warn(`Import failed: ${r.reason.message}`);
1461
1340
  }
1462
1341
  }
@@ -1471,8 +1350,6 @@ async function runCloudSetup(ctx) {
1471
1350
  console.log(captureText);
1472
1351
  console.log('');
1473
1352
  }
1474
- // ---- Step 7b: guided free-tier AI provider key (ALI-1284) ----
1475
- await offerFreeProviderKey(config, opts);
1476
1353
  // ---- Outro ----
1477
1354
  const decisionsLine = totalDecisions > 0
1478
1355
  ? ` ${totalDecisions} decisions in your graph`