@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.
- package/README.md +10 -8
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +35 -26
- package/dist/cli.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +7 -2
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/ai.d.ts +11 -0
- package/dist/commands/ai.d.ts.map +1 -0
- package/dist/commands/ai.js +121 -0
- package/dist/commands/ai.js.map +1 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +18 -2
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/connect.d.ts +5 -0
- package/dist/commands/connect.d.ts.map +1 -1
- package/dist/commands/connect.js +24 -0
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/default-action.js +2 -2
- package/dist/commands/default-action.js.map +1 -1
- package/dist/commands/import/confluence.d.ts.map +1 -1
- package/dist/commands/import/confluence.js +24 -5
- package/dist/commands/import/confluence.js.map +1 -1
- package/dist/commands/import/docs.js +2 -2
- package/dist/commands/import/git.d.ts.map +1 -1
- package/dist/commands/import/git.js +15 -5
- package/dist/commands/import/git.js.map +1 -1
- package/dist/commands/import/github.d.ts.map +1 -1
- package/dist/commands/import/github.js +34 -7
- package/dist/commands/import/github.js.map +1 -1
- package/dist/commands/import/gitlab.d.ts.map +1 -1
- package/dist/commands/import/gitlab.js +10 -5
- package/dist/commands/import/gitlab.js.map +1 -1
- package/dist/commands/import/jira.d.ts.map +1 -1
- package/dist/commands/import/jira.js +10 -5
- package/dist/commands/import/jira.js.map +1 -1
- package/dist/commands/import/linear.d.ts.map +1 -1
- package/dist/commands/import/linear.js +10 -5
- package/dist/commands/import/linear.js.map +1 -1
- package/dist/commands/import/notion.d.ts.map +1 -1
- package/dist/commands/import/notion.js +10 -5
- package/dist/commands/import/notion.js.map +1 -1
- package/dist/commands/import/sessions.js +2 -2
- package/dist/commands/import/slack.d.ts.map +1 -1
- package/dist/commands/import/slack.js +12 -7
- package/dist/commands/import/slack.js.map +1 -1
- package/dist/commands/import/teams.d.ts.map +1 -1
- package/dist/commands/import/teams.js +10 -5
- package/dist/commands/import/teams.js.map +1 -1
- package/dist/commands/import/zoom.d.ts.map +1 -1
- package/dist/commands/import/zoom.js +10 -5
- package/dist/commands/import/zoom.js.map +1 -1
- package/dist/commands/import.d.ts.map +1 -1
- package/dist/commands/import.js +43 -1
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/local.d.ts.map +1 -1
- package/dist/commands/local.js +76 -4
- package/dist/commands/local.js.map +1 -1
- package/dist/commands/mark.d.ts +37 -0
- package/dist/commands/mark.d.ts.map +1 -0
- package/dist/commands/mark.js +105 -0
- package/dist/commands/mark.js.map +1 -0
- package/dist/commands/mcp.d.ts +141 -2
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +72 -14
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +12 -2
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/setup.d.ts +39 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +118 -241
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/share.d.ts +7 -0
- package/dist/commands/share.d.ts.map +1 -0
- package/dist/commands/share.js +60 -0
- package/dist/commands/share.js.map +1 -0
- package/dist/commands/sync.d.ts +55 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +278 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/telemetry.d.ts +3 -3
- package/dist/commands/telemetry.js +6 -6
- package/dist/commands/telemetry.js.map +1 -1
- package/dist/commands/why.d.ts.map +1 -1
- package/dist/commands/why.js +27 -1
- package/dist/commands/why.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/ask-key-offer.d.ts +38 -0
- package/dist/lib/ask-key-offer.d.ts.map +1 -0
- package/dist/lib/ask-key-offer.js +130 -0
- package/dist/lib/ask-key-offer.js.map +1 -0
- package/dist/lib/backfill-state.d.ts +116 -0
- package/dist/lib/backfill-state.d.ts.map +1 -0
- package/dist/lib/backfill-state.js +342 -0
- package/dist/lib/backfill-state.js.map +1 -0
- package/dist/lib/backup-copy.d.ts +17 -0
- package/dist/lib/backup-copy.d.ts.map +1 -0
- package/dist/lib/backup-copy.js +13 -0
- package/dist/lib/backup-copy.js.map +1 -0
- package/dist/lib/capture-report.d.ts +22 -18
- package/dist/lib/capture-report.d.ts.map +1 -1
- package/dist/lib/capture-report.js +64 -2
- package/dist/lib/capture-report.js.map +1 -1
- package/dist/lib/config.d.ts +56 -24
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +176 -45
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/confirm-timeout.d.ts +8 -0
- package/dist/lib/confirm-timeout.d.ts.map +1 -0
- package/dist/lib/confirm-timeout.js +18 -0
- package/dist/lib/confirm-timeout.js.map +1 -0
- package/dist/lib/curation/check-marks.d.ts +48 -0
- package/dist/lib/curation/check-marks.d.ts.map +1 -0
- package/dist/lib/curation/check-marks.js +81 -0
- package/dist/lib/curation/check-marks.js.map +1 -0
- package/dist/lib/curation/guardrail.d.ts +39 -0
- package/dist/lib/curation/guardrail.d.ts.map +1 -0
- package/dist/lib/curation/guardrail.js +93 -0
- package/dist/lib/curation/guardrail.js.map +1 -0
- package/dist/lib/curation/judge.d.ts +3 -0
- package/dist/lib/curation/judge.d.ts.map +1 -0
- package/dist/lib/curation/judge.js +9 -0
- package/dist/lib/curation/judge.js.map +1 -0
- package/dist/lib/curation/judgements-db.d.ts +96 -0
- package/dist/lib/curation/judgements-db.d.ts.map +1 -0
- package/dist/lib/curation/judgements-db.js +200 -0
- package/dist/lib/curation/judgements-db.js.map +1 -0
- package/dist/lib/curation/last-check.d.ts +32 -0
- package/dist/lib/curation/last-check.d.ts.map +1 -0
- package/dist/lib/curation/last-check.js +81 -0
- package/dist/lib/curation/last-check.js.map +1 -0
- package/dist/lib/curation/mark.d.ts +76 -0
- package/dist/lib/curation/mark.d.ts.map +1 -0
- package/dist/lib/curation/mark.js +359 -0
- package/dist/lib/curation/mark.js.map +1 -0
- package/dist/lib/curation/text.d.ts +6 -0
- package/dist/lib/curation/text.d.ts.map +1 -0
- package/dist/lib/curation/text.js +35 -0
- package/dist/lib/curation/text.js.map +1 -0
- package/dist/lib/fetchers/capture.d.ts +49 -2
- package/dist/lib/fetchers/capture.d.ts.map +1 -1
- package/dist/lib/fetchers/capture.js +7 -1
- package/dist/lib/fetchers/capture.js.map +1 -1
- package/dist/lib/fetchers/confluence.d.ts +2 -2
- package/dist/lib/fetchers/confluence.d.ts.map +1 -1
- package/dist/lib/fetchers/confluence.js.map +1 -1
- package/dist/lib/fetchers/git.d.ts +1 -0
- package/dist/lib/fetchers/git.d.ts.map +1 -1
- package/dist/lib/fetchers/git.js +3 -1
- package/dist/lib/fetchers/git.js.map +1 -1
- package/dist/lib/fetchers/github.d.ts +44 -5
- package/dist/lib/fetchers/github.d.ts.map +1 -1
- package/dist/lib/fetchers/github.js +122 -5
- package/dist/lib/fetchers/github.js.map +1 -1
- package/dist/lib/fetchers/gitlab.d.ts +2 -2
- package/dist/lib/fetchers/gitlab.d.ts.map +1 -1
- package/dist/lib/fetchers/gitlab.js.map +1 -1
- package/dist/lib/fetchers/jira.d.ts +2 -2
- package/dist/lib/fetchers/jira.d.ts.map +1 -1
- package/dist/lib/fetchers/jira.js.map +1 -1
- package/dist/lib/fetchers/linear.d.ts +2 -2
- package/dist/lib/fetchers/linear.d.ts.map +1 -1
- package/dist/lib/fetchers/linear.js.map +1 -1
- package/dist/lib/fetchers/notion.d.ts +2 -2
- package/dist/lib/fetchers/notion.d.ts.map +1 -1
- package/dist/lib/fetchers/notion.js.map +1 -1
- package/dist/lib/fetchers/slack.d.ts +2 -3
- package/dist/lib/fetchers/slack.d.ts.map +1 -1
- package/dist/lib/fetchers/slack.js.map +1 -1
- package/dist/lib/fetchers/teams.d.ts +2 -2
- package/dist/lib/fetchers/teams.d.ts.map +1 -1
- package/dist/lib/fetchers/teams.js.map +1 -1
- package/dist/lib/fetchers/zoom.d.ts +2 -2
- package/dist/lib/fetchers/zoom.d.ts.map +1 -1
- package/dist/lib/fetchers/zoom.js.map +1 -1
- package/dist/lib/gateway-client.d.ts +34 -0
- package/dist/lib/gateway-client.d.ts.map +1 -1
- package/dist/lib/gateway-client.js +19 -1
- package/dist/lib/gateway-client.js.map +1 -1
- package/dist/lib/github-text.d.ts +3 -0
- package/dist/lib/github-text.d.ts.map +1 -0
- package/dist/lib/github-text.js +18 -0
- package/dist/lib/github-text.js.map +1 -0
- package/dist/lib/hook-context.d.ts +10 -0
- package/dist/lib/hook-context.d.ts.map +1 -1
- package/dist/lib/hook-context.js +14 -0
- package/dist/lib/hook-context.js.map +1 -1
- package/dist/lib/import-defaults.d.ts +39 -23
- package/dist/lib/import-defaults.d.ts.map +1 -1
- package/dist/lib/import-defaults.js +28 -26
- package/dist/lib/import-defaults.js.map +1 -1
- package/dist/lib/launch/adapters/aider.d.ts +17 -0
- package/dist/lib/launch/adapters/aider.d.ts.map +1 -0
- package/dist/lib/launch/adapters/aider.js +30 -0
- package/dist/lib/launch/adapters/aider.js.map +1 -0
- package/dist/lib/launch/adapters/amp.d.ts +18 -0
- package/dist/lib/launch/adapters/amp.d.ts.map +1 -0
- package/dist/lib/launch/adapters/amp.js +29 -0
- package/dist/lib/launch/adapters/amp.js.map +1 -0
- package/dist/lib/launch/adapters/auggie.d.ts +18 -0
- package/dist/lib/launch/adapters/auggie.d.ts.map +1 -0
- package/dist/lib/launch/adapters/auggie.js +34 -0
- package/dist/lib/launch/adapters/auggie.js.map +1 -0
- package/dist/lib/launch/adapters/cline.d.ts +10 -0
- package/dist/lib/launch/adapters/cline.d.ts.map +1 -0
- package/dist/lib/launch/adapters/cline.js +41 -0
- package/dist/lib/launch/adapters/cline.js.map +1 -0
- package/dist/lib/launch/adapters/continue.d.ts +22 -0
- package/dist/lib/launch/adapters/continue.d.ts.map +1 -0
- package/dist/lib/launch/adapters/continue.js +46 -0
- package/dist/lib/launch/adapters/continue.js.map +1 -0
- package/dist/lib/launch/adapters/droid.d.ts +19 -0
- package/dist/lib/launch/adapters/droid.d.ts.map +1 -0
- package/dist/lib/launch/adapters/droid.js +38 -0
- package/dist/lib/launch/adapters/droid.js.map +1 -0
- package/dist/lib/launch/adapters/gemini-cli.d.ts +13 -14
- package/dist/lib/launch/adapters/gemini-cli.d.ts.map +1 -1
- package/dist/lib/launch/adapters/gemini-cli.js +38 -53
- package/dist/lib/launch/adapters/gemini-cli.js.map +1 -1
- package/dist/lib/launch/adapters/goose.d.ts +20 -0
- package/dist/lib/launch/adapters/goose.d.ts.map +1 -0
- package/dist/lib/launch/adapters/goose.js +47 -0
- package/dist/lib/launch/adapters/goose.js.map +1 -0
- package/dist/lib/launch/adapters/grok-build.d.ts +16 -0
- package/dist/lib/launch/adapters/grok-build.d.ts.map +1 -0
- package/dist/lib/launch/adapters/grok-build.js +25 -0
- package/dist/lib/launch/adapters/grok-build.js.map +1 -0
- package/dist/lib/launch/adapters/kiro.d.ts +17 -0
- package/dist/lib/launch/adapters/kiro.d.ts.map +1 -0
- package/dist/lib/launch/adapters/kiro.js +25 -0
- package/dist/lib/launch/adapters/kiro.js.map +1 -0
- package/dist/lib/launch/adapters/notes.d.ts +7 -0
- package/dist/lib/launch/adapters/notes.d.ts.map +1 -0
- package/dist/lib/launch/adapters/notes.js +5 -0
- package/dist/lib/launch/adapters/notes.js.map +1 -0
- package/dist/lib/launch/adapters/qwen.d.ts +25 -0
- package/dist/lib/launch/adapters/qwen.d.ts.map +1 -0
- package/dist/lib/launch/adapters/qwen.js +67 -0
- package/dist/lib/launch/adapters/qwen.js.map +1 -0
- package/dist/lib/launch/agents.d.ts +6 -1
- package/dist/lib/launch/agents.d.ts.map +1 -1
- package/dist/lib/launch/agents.js +12 -4
- package/dist/lib/launch/agents.js.map +1 -1
- package/dist/lib/launch/amp-state.d.ts +21 -0
- package/dist/lib/launch/amp-state.d.ts.map +1 -0
- package/dist/lib/launch/amp-state.js +61 -0
- package/dist/lib/launch/amp-state.js.map +1 -0
- package/dist/lib/launch/auggie-state.d.ts +25 -0
- package/dist/lib/launch/auggie-state.d.ts.map +1 -0
- package/dist/lib/launch/auggie-state.js +74 -0
- package/dist/lib/launch/auggie-state.js.map +1 -0
- package/dist/lib/launch/cline-state.d.ts +32 -0
- package/dist/lib/launch/cline-state.d.ts.map +1 -0
- package/dist/lib/launch/cline-state.js +108 -0
- package/dist/lib/launch/cline-state.js.map +1 -0
- package/dist/lib/launch/config-writes.d.ts +11 -1
- package/dist/lib/launch/config-writes.d.ts.map +1 -1
- package/dist/lib/launch/config-writes.js +66 -8
- package/dist/lib/launch/config-writes.js.map +1 -1
- package/dist/lib/launch/continue-state.d.ts +41 -0
- package/dist/lib/launch/continue-state.d.ts.map +1 -0
- package/dist/lib/launch/continue-state.js +142 -0
- package/dist/lib/launch/continue-state.js.map +1 -0
- package/dist/lib/launch/detect.d.ts.map +1 -1
- package/dist/lib/launch/detect.js +5 -2
- package/dist/lib/launch/detect.js.map +1 -1
- package/dist/lib/launch/droid-state.d.ts +24 -0
- package/dist/lib/launch/droid-state.d.ts.map +1 -0
- package/dist/lib/launch/droid-state.js +74 -0
- package/dist/lib/launch/droid-state.js.map +1 -0
- package/dist/lib/launch/gemini-state.d.ts +26 -20
- package/dist/lib/launch/gemini-state.d.ts.map +1 -1
- package/dist/lib/launch/gemini-state.js +95 -37
- package/dist/lib/launch/gemini-state.js.map +1 -1
- package/dist/lib/launch/gemini-system-file.d.ts +17 -0
- package/dist/lib/launch/gemini-system-file.d.ts.map +1 -0
- package/dist/lib/launch/gemini-system-file.js +55 -0
- package/dist/lib/launch/gemini-system-file.js.map +1 -0
- package/dist/lib/launch/gemini-trust.d.ts +3 -1
- package/dist/lib/launch/gemini-trust.d.ts.map +1 -1
- package/dist/lib/launch/gemini-trust.js +10 -3
- package/dist/lib/launch/gemini-trust.js.map +1 -1
- package/dist/lib/launch/goose-state.d.ts +53 -0
- package/dist/lib/launch/goose-state.d.ts.map +1 -0
- package/dist/lib/launch/goose-state.js +137 -0
- package/dist/lib/launch/goose-state.js.map +1 -0
- package/dist/lib/launch/grok-state.d.ts +42 -0
- package/dist/lib/launch/grok-state.d.ts.map +1 -0
- package/dist/lib/launch/grok-state.js +128 -0
- package/dist/lib/launch/grok-state.js.map +1 -0
- package/dist/lib/launch/kiro-state.d.ts +22 -0
- package/dist/lib/launch/kiro-state.d.ts.map +1 -0
- package/dist/lib/launch/kiro-state.js +59 -0
- package/dist/lib/launch/kiro-state.js.map +1 -0
- package/dist/lib/launch/launch-files.d.ts.map +1 -1
- package/dist/lib/launch/launch-files.js +3 -2
- package/dist/lib/launch/launch-files.js.map +1 -1
- package/dist/lib/launch/launch.d.ts +51 -2
- package/dist/lib/launch/launch.d.ts.map +1 -1
- package/dist/lib/launch/launch.js +70 -6
- package/dist/lib/launch/launch.js.map +1 -1
- package/dist/lib/launch/layer-files.d.ts +12 -0
- package/dist/lib/launch/layer-files.d.ts.map +1 -0
- package/dist/lib/launch/layer-files.js +43 -0
- package/dist/lib/launch/layer-files.js.map +1 -0
- package/dist/lib/launch/mcp-child-env.d.ts +30 -0
- package/dist/lib/launch/mcp-child-env.d.ts.map +1 -0
- package/dist/lib/launch/mcp-child-env.js +151 -0
- package/dist/lib/launch/mcp-child-env.js.map +1 -0
- package/dist/lib/launch/pick-agent.d.ts.map +1 -1
- package/dist/lib/launch/pick-agent.js +7 -6
- package/dist/lib/launch/pick-agent.js.map +1 -1
- package/dist/lib/launch/picker-options.d.ts.map +1 -1
- package/dist/lib/launch/picker-options.js +7 -2
- package/dist/lib/launch/picker-options.js.map +1 -1
- package/dist/lib/launch/qwen-state.d.ts +30 -0
- package/dist/lib/launch/qwen-state.d.ts.map +1 -0
- package/dist/lib/launch/qwen-state.js +57 -0
- package/dist/lib/launch/qwen-state.js.map +1 -0
- package/dist/lib/launch/qwen-trust.d.ts +24 -0
- package/dist/lib/launch/qwen-trust.d.ts.map +1 -0
- package/dist/lib/launch/qwen-trust.js +100 -0
- package/dist/lib/launch/qwen-trust.js.map +1 -0
- package/dist/lib/launch/registry/agents/aider.d.ts +3 -0
- package/dist/lib/launch/registry/agents/aider.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/aider.js +13 -0
- package/dist/lib/launch/registry/agents/aider.js.map +1 -0
- package/dist/lib/launch/registry/agents/amp.d.ts +3 -0
- package/dist/lib/launch/registry/agents/amp.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/amp.js +14 -0
- package/dist/lib/launch/registry/agents/amp.js.map +1 -0
- package/dist/lib/launch/registry/agents/auggie.d.ts +3 -0
- package/dist/lib/launch/registry/agents/auggie.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/auggie.js +11 -0
- package/dist/lib/launch/registry/agents/auggie.js.map +1 -0
- package/dist/lib/launch/registry/agents/cline.d.ts +3 -0
- package/dist/lib/launch/registry/agents/cline.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/cline.js +19 -0
- package/dist/lib/launch/registry/agents/cline.js.map +1 -0
- package/dist/lib/launch/registry/agents/continue.d.ts +3 -0
- package/dist/lib/launch/registry/agents/continue.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/continue.js +20 -0
- package/dist/lib/launch/registry/agents/continue.js.map +1 -0
- package/dist/lib/launch/registry/agents/droid.d.ts +3 -0
- package/dist/lib/launch/registry/agents/droid.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/droid.js +13 -0
- package/dist/lib/launch/registry/agents/droid.js.map +1 -0
- package/dist/lib/launch/registry/agents/gemini-cli.js +2 -2
- package/dist/lib/launch/registry/agents/gemini-cli.js.map +1 -1
- package/dist/lib/launch/registry/agents/goose.d.ts +3 -0
- package/dist/lib/launch/registry/agents/goose.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/goose.js +20 -0
- package/dist/lib/launch/registry/agents/goose.js.map +1 -0
- package/dist/lib/launch/registry/agents/grok-build.d.ts +3 -0
- package/dist/lib/launch/registry/agents/grok-build.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/grok-build.js +14 -0
- package/dist/lib/launch/registry/agents/grok-build.js.map +1 -0
- package/dist/lib/launch/registry/agents/kiro.d.ts +3 -0
- package/dist/lib/launch/registry/agents/kiro.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/kiro.js +11 -0
- package/dist/lib/launch/registry/agents/kiro.js.map +1 -0
- package/dist/lib/launch/registry/agents/qwen.d.ts +3 -0
- package/dist/lib/launch/registry/agents/qwen.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/qwen.js +11 -0
- package/dist/lib/launch/registry/agents/qwen.js.map +1 -0
- package/dist/lib/launch/registry/index.d.ts +4 -1
- package/dist/lib/launch/registry/index.d.ts.map +1 -1
- package/dist/lib/launch/registry/index.js +15 -2
- package/dist/lib/launch/registry/index.js.map +1 -1
- package/dist/lib/launch/registry/types.d.ts +17 -1
- package/dist/lib/launch/registry/types.d.ts.map +1 -1
- package/dist/lib/launch/run-agent.d.ts +11 -0
- package/dist/lib/launch/run-agent.d.ts.map +1 -1
- package/dist/lib/launch/run-agent.js +22 -1
- package/dist/lib/launch/run-agent.js.map +1 -1
- package/dist/lib/launch/strict-entry.d.ts +22 -2
- package/dist/lib/launch/strict-entry.d.ts.map +1 -1
- package/dist/lib/launch/strict-entry.js +82 -2
- package/dist/lib/launch/strict-entry.js.map +1 -1
- package/dist/lib/launch/yaml-scan.d.ts +59 -0
- package/dist/lib/launch/yaml-scan.d.ts.map +1 -0
- package/dist/lib/launch/yaml-scan.js +275 -0
- package/dist/lib/launch/yaml-scan.js.map +1 -0
- package/dist/lib/llm-providers.d.ts +66 -0
- package/dist/lib/llm-providers.d.ts.map +1 -0
- package/dist/lib/llm-providers.js +150 -0
- package/dist/lib/llm-providers.js.map +1 -0
- package/dist/lib/local-db-epoch.d.ts +4 -0
- package/dist/lib/local-db-epoch.d.ts.map +1 -0
- package/dist/lib/local-db-epoch.js +19 -0
- package/dist/lib/local-db-epoch.js.map +1 -0
- package/dist/lib/local-db-migrate.d.ts +85 -0
- package/dist/lib/local-db-migrate.d.ts.map +1 -0
- package/dist/lib/local-db-migrate.js +484 -0
- package/dist/lib/local-db-migrate.js.map +1 -0
- package/dist/lib/local-db-v10.d.ts +28 -0
- package/dist/lib/local-db-v10.d.ts.map +1 -0
- package/dist/lib/local-db-v10.js +49 -0
- package/dist/lib/local-db-v10.js.map +1 -0
- package/dist/lib/local-db-v11.d.ts +24 -0
- package/dist/lib/local-db-v11.d.ts.map +1 -0
- package/dist/lib/local-db-v11.js +25 -0
- package/dist/lib/local-db-v11.js.map +1 -0
- package/dist/lib/local-db-v7.d.ts +30 -0
- package/dist/lib/local-db-v7.d.ts.map +1 -0
- package/dist/lib/local-db-v7.js +285 -0
- package/dist/lib/local-db-v7.js.map +1 -0
- package/dist/lib/local-db-v8.d.ts +22 -0
- package/dist/lib/local-db-v8.d.ts.map +1 -0
- package/dist/lib/local-db-v8.js +33 -0
- package/dist/lib/local-db-v8.js.map +1 -0
- package/dist/lib/local-db-v9.d.ts +10 -0
- package/dist/lib/local-db-v9.d.ts.map +1 -0
- package/dist/lib/local-db-v9.js +8 -0
- package/dist/lib/local-db-v9.js.map +1 -0
- package/dist/lib/local-db.d.ts +61 -11
- package/dist/lib/local-db.d.ts.map +1 -1
- package/dist/lib/local-db.js +186 -371
- package/dist/lib/local-db.js.map +1 -1
- package/dist/lib/local-embeddings.d.ts.map +1 -1
- package/dist/lib/local-embeddings.js +2 -2
- package/dist/lib/local-embeddings.js.map +1 -1
- package/dist/lib/local-gateway-client.d.ts +30 -87
- package/dist/lib/local-gateway-client.d.ts.map +1 -1
- package/dist/lib/local-gateway-client.js +182 -171
- package/dist/lib/local-gateway-client.js.map +1 -1
- package/dist/lib/local-ingest.d.ts +129 -0
- package/dist/lib/local-ingest.d.ts.map +1 -0
- package/dist/lib/local-ingest.js +81 -0
- package/dist/lib/local-ingest.js.map +1 -0
- package/dist/lib/local-link-pass.d.ts +15 -0
- package/dist/lib/local-link-pass.d.ts.map +1 -0
- package/dist/lib/local-link-pass.js +61 -0
- package/dist/lib/local-link-pass.js.map +1 -0
- package/dist/lib/local-llm.d.ts +63 -12
- package/dist/lib/local-llm.d.ts.map +1 -1
- package/dist/lib/local-llm.js +229 -104
- package/dist/lib/local-llm.js.map +1 -1
- package/dist/lib/local-mode.d.ts +4 -1
- package/dist/lib/local-mode.d.ts.map +1 -1
- package/dist/lib/local-mode.js +16 -1
- package/dist/lib/local-mode.js.map +1 -1
- package/dist/lib/local-provenance.d.ts +14 -0
- package/dist/lib/local-provenance.d.ts.map +1 -0
- package/dist/lib/local-provenance.js +14 -0
- package/dist/lib/local-provenance.js.map +1 -0
- package/dist/lib/local-thresholds.d.ts +70 -0
- package/dist/lib/local-thresholds.d.ts.map +1 -0
- package/dist/lib/local-thresholds.js +79 -0
- package/dist/lib/local-thresholds.js.map +1 -0
- package/dist/lib/mcp/mark-tool.d.ts +27 -0
- package/dist/lib/mcp/mark-tool.d.ts.map +1 -0
- package/dist/lib/mcp/mark-tool.js +103 -0
- package/dist/lib/mcp/mark-tool.js.map +1 -0
- package/dist/lib/mcp/share-tool.d.ts +46 -0
- package/dist/lib/mcp/share-tool.d.ts.map +1 -0
- package/dist/lib/mcp/share-tool.js +68 -0
- package/dist/lib/mcp/share-tool.js.map +1 -0
- package/dist/lib/mcp/tool-rules.d.ts +30 -0
- package/dist/lib/mcp/tool-rules.d.ts.map +1 -0
- package/dist/lib/mcp/tool-rules.js +84 -0
- package/dist/lib/mcp/tool-rules.js.map +1 -0
- package/dist/lib/mcp-backfill.d.ts +89 -0
- package/dist/lib/mcp-backfill.d.ts.map +1 -0
- package/dist/lib/mcp-backfill.js +194 -0
- package/dist/lib/mcp-backfill.js.map +1 -0
- package/dist/lib/mcp-scope.d.ts +90 -0
- package/dist/lib/mcp-scope.d.ts.map +1 -0
- package/dist/lib/mcp-scope.js +125 -0
- package/dist/lib/mcp-scope.js.map +1 -0
- package/dist/lib/mcp-sync.d.ts +64 -0
- package/dist/lib/mcp-sync.d.ts.map +1 -0
- package/dist/lib/mcp-sync.js +183 -0
- package/dist/lib/mcp-sync.js.map +1 -0
- package/dist/lib/personal-import.d.ts +7 -0
- package/dist/lib/personal-import.d.ts.map +1 -1
- package/dist/lib/personal-import.js +13 -1
- package/dist/lib/personal-import.js.map +1 -1
- package/dist/lib/safe-config-write.d.ts +12 -1
- package/dist/lib/safe-config-write.d.ts.map +1 -1
- package/dist/lib/safe-config-write.js +162 -9
- package/dist/lib/safe-config-write.js.map +1 -1
- package/dist/lib/scope-choices.d.ts +51 -0
- package/dist/lib/scope-choices.d.ts.map +1 -0
- package/dist/lib/scope-choices.js +193 -0
- package/dist/lib/scope-choices.js.map +1 -0
- package/dist/lib/scope-connect.d.ts +82 -0
- package/dist/lib/scope-connect.d.ts.map +1 -0
- package/dist/lib/scope-connect.js +258 -0
- package/dist/lib/scope-connect.js.map +1 -0
- package/dist/lib/scope-defaults.d.ts +3 -0
- package/dist/lib/scope-defaults.d.ts.map +1 -0
- package/dist/lib/scope-defaults.js +42 -0
- package/dist/lib/scope-defaults.js.map +1 -0
- package/dist/lib/scope-real.d.ts +223 -0
- package/dist/lib/scope-real.d.ts.map +1 -0
- package/dist/lib/scope-real.js +58 -0
- package/dist/lib/scope-real.js.map +1 -0
- package/dist/lib/scope-values.d.ts +76 -0
- package/dist/lib/scope-values.d.ts.map +1 -0
- package/dist/lib/scope-values.js +169 -0
- package/dist/lib/scope-values.js.map +1 -0
- package/dist/lib/scope.d.ts +161 -0
- package/dist/lib/scope.d.ts.map +1 -0
- package/dist/lib/scope.js +323 -0
- package/dist/lib/scope.js.map +1 -0
- package/dist/lib/share/command.d.ts +32 -0
- package/dist/lib/share/command.d.ts.map +1 -0
- package/dist/lib/share/command.js +136 -0
- package/dist/lib/share/command.js.map +1 -0
- package/dist/lib/share/ledger.d.ts +59 -0
- package/dist/lib/share/ledger.d.ts.map +1 -0
- package/dist/lib/share/ledger.js +135 -0
- package/dist/lib/share/ledger.js.map +1 -0
- package/dist/lib/share/payload.d.ts +92 -0
- package/dist/lib/share/payload.d.ts.map +1 -0
- package/dist/lib/share/payload.js +138 -0
- package/dist/lib/share/payload.js.map +1 -0
- package/dist/lib/share/pending.d.ts +48 -0
- package/dist/lib/share/pending.d.ts.map +1 -0
- package/dist/lib/share/pending.js +130 -0
- package/dist/lib/share/pending.js.map +1 -0
- package/dist/lib/share/preview.d.ts +18 -0
- package/dist/lib/share/preview.d.ts.map +1 -0
- package/dist/lib/share/preview.js +72 -0
- package/dist/lib/share/preview.js.map +1 -0
- package/dist/lib/share/run.d.ts +115 -0
- package/dist/lib/share/run.d.ts.map +1 -0
- package/dist/lib/share/run.js +261 -0
- package/dist/lib/share/run.js.map +1 -0
- package/dist/lib/share/salt.d.ts +2 -0
- package/dist/lib/share/salt.d.ts.map +1 -0
- package/dist/lib/share/salt.js +44 -0
- package/dist/lib/share/salt.js.map +1 -0
- package/dist/lib/share/secret-patterns.json +100 -0
- package/dist/lib/share/secret-scan.d.ts +19 -0
- package/dist/lib/share/secret-scan.d.ts.map +1 -0
- package/dist/lib/share/secret-scan.js +75 -0
- package/dist/lib/share/secret-scan.js.map +1 -0
- package/dist/lib/share/tty.d.ts +4 -0
- package/dist/lib/share/tty.d.ts.map +1 -0
- package/dist/lib/share/tty.js +57 -0
- package/dist/lib/share/tty.js.map +1 -0
- package/dist/lib/share/visible.d.ts +4 -0
- package/dist/lib/share/visible.d.ts.map +1 -0
- package/dist/lib/share/visible.js +30 -0
- package/dist/lib/share/visible.js.map +1 -0
- package/dist/lib/share/wire.d.ts +98 -0
- package/dist/lib/share/wire.d.ts.map +1 -0
- package/dist/lib/share/wire.js +43 -0
- package/dist/lib/share/wire.js.map +1 -0
- package/dist/lib/similarity/embedding-matrix.d.ts +64 -0
- package/dist/lib/similarity/embedding-matrix.d.ts.map +1 -0
- package/dist/lib/similarity/embedding-matrix.js +119 -0
- package/dist/lib/similarity/embedding-matrix.js.map +1 -0
- package/dist/lib/since-flag.d.ts +11 -0
- package/dist/lib/since-flag.d.ts.map +1 -0
- package/dist/lib/since-flag.js +24 -0
- package/dist/lib/since-flag.js.map +1 -0
- package/dist/lib/since.d.ts +59 -0
- package/dist/lib/since.d.ts.map +1 -0
- package/dist/lib/since.js +86 -0
- package/dist/lib/since.js.map +1 -0
- package/dist/lib/source-key.d.ts +13 -0
- package/dist/lib/source-key.d.ts.map +1 -0
- package/dist/lib/source-key.js +60 -0
- package/dist/lib/source-key.js.map +1 -0
- package/dist/lib/source-sync-state.d.ts +12 -0
- package/dist/lib/source-sync-state.d.ts.map +1 -0
- package/dist/lib/source-sync-state.js +43 -0
- package/dist/lib/source-sync-state.js.map +1 -0
- package/dist/lib/startup-backfill-track.d.ts +2 -0
- package/dist/lib/startup-backfill-track.d.ts.map +1 -0
- package/dist/lib/startup-backfill-track.js +6 -0
- package/dist/lib/startup-backfill-track.js.map +1 -0
- package/dist/lib/startup-env.d.ts +8 -0
- package/dist/lib/startup-env.d.ts.map +1 -0
- package/dist/lib/startup-env.js +8 -0
- package/dist/lib/startup-env.js.map +1 -0
- package/dist/lib/startup-xdg.d.ts +2 -0
- package/dist/lib/startup-xdg.d.ts.map +1 -0
- package/dist/lib/startup-xdg.js +9 -0
- package/dist/lib/startup-xdg.js.map +1 -0
- package/dist/lib/sync/after-connect.d.ts +2 -0
- package/dist/lib/sync/after-connect.d.ts.map +1 -0
- package/dist/lib/sync/after-connect.js +18 -0
- package/dist/lib/sync/after-connect.js.map +1 -0
- package/dist/lib/sync/bg-claim.d.ts +14 -0
- package/dist/lib/sync/bg-claim.d.ts.map +1 -0
- package/dist/lib/sync/bg-claim.js +97 -0
- package/dist/lib/sync/bg-claim.js.map +1 -0
- package/dist/lib/sync/blocked.d.ts +8 -0
- package/dist/lib/sync/blocked.d.ts.map +1 -0
- package/dist/lib/sync/blocked.js +44 -0
- package/dist/lib/sync/blocked.js.map +1 -0
- package/dist/lib/sync/classify.d.ts +34 -0
- package/dist/lib/sync/classify.d.ts.map +1 -0
- package/dist/lib/sync/classify.js +91 -0
- package/dist/lib/sync/classify.js.map +1 -0
- package/dist/lib/sync/drain.d.ts +16 -0
- package/dist/lib/sync/drain.d.ts.map +1 -0
- package/dist/lib/sync/drain.js +33 -0
- package/dist/lib/sync/drain.js.map +1 -0
- package/dist/lib/sync/forget.d.ts +12 -0
- package/dist/lib/sync/forget.d.ts.map +1 -0
- package/dist/lib/sync/forget.js +32 -0
- package/dist/lib/sync/forget.js.map +1 -0
- package/dist/lib/sync/launch-hook.d.ts +42 -0
- package/dist/lib/sync/launch-hook.d.ts.map +1 -0
- package/dist/lib/sync/launch-hook.js +117 -0
- package/dist/lib/sync/launch-hook.js.map +1 -0
- package/dist/lib/sync/lock.d.ts +35 -0
- package/dist/lib/sync/lock.d.ts.map +1 -0
- package/dist/lib/sync/lock.js +175 -0
- package/dist/lib/sync/lock.js.map +1 -0
- package/dist/lib/sync/purge.d.ts +38 -0
- package/dist/lib/sync/purge.d.ts.map +1 -0
- package/dist/lib/sync/purge.js +61 -0
- package/dist/lib/sync/purge.js.map +1 -0
- package/dist/lib/sync/real-env.d.ts +208 -0
- package/dist/lib/sync/real-env.d.ts.map +1 -0
- package/dist/lib/sync/real-env.js +47 -0
- package/dist/lib/sync/real-env.js.map +1 -0
- package/dist/lib/sync/relink.d.ts +14 -0
- package/dist/lib/sync/relink.d.ts.map +1 -0
- package/dist/lib/sync/relink.js +36 -0
- package/dist/lib/sync/relink.js.map +1 -0
- package/dist/lib/sync/report.d.ts +3 -0
- package/dist/lib/sync/report.d.ts.map +1 -0
- package/dist/lib/sync/report.js +54 -0
- package/dist/lib/sync/report.js.map +1 -0
- package/dist/lib/sync/run-all.d.ts +23 -0
- package/dist/lib/sync/run-all.d.ts.map +1 -0
- package/dist/lib/sync/run-all.js +30 -0
- package/dist/lib/sync/run-all.js.map +1 -0
- package/dist/lib/sync/run-source.d.ts +73 -0
- package/dist/lib/sync/run-source.d.ts.map +1 -0
- package/dist/lib/sync/run-source.js +262 -0
- package/dist/lib/sync/run-source.js.map +1 -0
- package/dist/lib/sync/safe-read.d.ts +4 -0
- package/dist/lib/sync/safe-read.d.ts.map +1 -0
- package/dist/lib/sync/safe-read.js +40 -0
- package/dist/lib/sync/safe-read.js.map +1 -0
- package/dist/lib/sync/should-background-sync.d.ts +31 -0
- package/dist/lib/sync/should-background-sync.d.ts.map +1 -0
- package/dist/lib/sync/should-background-sync.js +69 -0
- package/dist/lib/sync/should-background-sync.js.map +1 -0
- package/dist/lib/sync/source-ids.d.ts +10 -0
- package/dist/lib/sync/source-ids.d.ts.map +1 -0
- package/dist/lib/sync/source-ids.js +9 -0
- package/dist/lib/sync/source-ids.js.map +1 -0
- package/dist/lib/sync/sources.d.ts +33 -0
- package/dist/lib/sync/sources.d.ts.map +1 -0
- package/dist/lib/sync/sources.js +37 -0
- package/dist/lib/sync/sources.js.map +1 -0
- package/dist/lib/sync/spawn-background.d.ts +27 -0
- package/dist/lib/sync/spawn-background.d.ts.map +1 -0
- package/dist/lib/sync/spawn-background.js +66 -0
- package/dist/lib/sync/spawn-background.js.map +1 -0
- package/dist/lib/sync/status.d.ts +57 -0
- package/dist/lib/sync/status.d.ts.map +1 -0
- package/dist/lib/sync/status.js +166 -0
- package/dist/lib/sync/status.js.map +1 -0
- package/dist/lib/sync/summary-read.d.ts +19 -0
- package/dist/lib/sync/summary-read.d.ts.map +1 -0
- package/dist/lib/sync/summary-read.js +39 -0
- package/dist/lib/sync/summary-read.js.map +1 -0
- package/dist/lib/sync/summary.d.ts +10 -0
- package/dist/lib/sync/summary.d.ts.map +1 -0
- package/dist/lib/sync/summary.js +80 -0
- package/dist/lib/sync/summary.js.map +1 -0
- package/dist/lib/sync/sync-state.d.ts +128 -0
- package/dist/lib/sync/sync-state.d.ts.map +1 -0
- package/dist/lib/sync/sync-state.js +253 -0
- package/dist/lib/sync/sync-state.js.map +1 -0
- package/dist/lib/sync/telemetry.d.ts +20 -0
- package/dist/lib/sync/telemetry.d.ts.map +1 -0
- package/dist/lib/sync/telemetry.js +31 -0
- package/dist/lib/sync/telemetry.js.map +1 -0
- package/dist/lib/sync/threads.d.ts +48 -0
- package/dist/lib/sync/threads.d.ts.map +1 -0
- package/dist/lib/sync/threads.js +82 -0
- package/dist/lib/sync/threads.js.map +1 -0
- package/dist/lib/sync/window.d.ts +72 -0
- package/dist/lib/sync/window.d.ts.map +1 -0
- package/dist/lib/sync/window.js +112 -0
- package/dist/lib/sync/window.js.map +1 -0
- package/dist/lib/team-cta.d.ts +11 -0
- package/dist/lib/team-cta.d.ts.map +1 -0
- package/dist/lib/team-cta.js +16 -0
- package/dist/lib/team-cta.js.map +1 -0
- package/dist/lib/telemetry-ci.d.ts +2 -0
- package/dist/lib/telemetry-ci.d.ts.map +1 -0
- package/dist/lib/telemetry-ci.js +21 -0
- package/dist/lib/telemetry-ci.js.map +1 -0
- package/dist/lib/telemetry-consent.d.ts +44 -23
- package/dist/lib/telemetry-consent.d.ts.map +1 -1
- package/dist/lib/telemetry-consent.js +74 -35
- package/dist/lib/telemetry-consent.js.map +1 -1
- package/dist/lib/telemetry-env.d.ts +1 -1
- package/dist/lib/usage-telemetry.d.ts +87 -22
- package/dist/lib/usage-telemetry.d.ts.map +1 -1
- package/dist/lib/usage-telemetry.js +263 -74
- package/dist/lib/usage-telemetry.js.map +1 -1
- package/dist/lib/xdg.d.ts +27 -0
- package/dist/lib/xdg.d.ts.map +1 -0
- package/dist/lib/xdg.js +56 -0
- package/dist/lib/xdg.js.map +1 -0
- package/package.json +3 -2
- package/dist/commands/push.d.ts +0 -25
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -98
- package/dist/commands/push.js.map +0 -1
package/dist/commands/setup.js
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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
|
-
//
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
|
|
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'],
|
|
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'],
|
|
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'],
|
|
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'],
|
|
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'],
|
|
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,
|
|
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'],
|
|
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'],
|
|
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
|
-
//
|
|
372
|
+
// Saved AI provider keys
|
|
371
373
|
// ---------------------------------------------------------------------------
|
|
372
374
|
/**
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
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
|
-
*
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
*
|
|
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"
|
|
416
|
-
//
|
|
417
|
-
//
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
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
|
-
|
|
540
|
-
|
|
541
|
-
|
|
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.
|
|
544
|
-
|
|
545
|
-
|
|
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,
|
|
421
|
+
function nextStepLine(agent, launching) {
|
|
554
422
|
const label = agent ? agentByName(agent)?.label : undefined;
|
|
555
423
|
if (label)
|
|
556
|
-
return
|
|
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:
|
|
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-
|
|
749
|
-
// is
|
|
750
|
-
//
|
|
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
|
-
|
|
816
|
+
let sourceCs;
|
|
949
817
|
try {
|
|
950
|
-
const fetched = await source.
|
|
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
|
-
|
|
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(
|
|
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
|
|
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
|
|
1101
|
-
// (Copilot review, PR #323).
|
|
1102
|
-
//
|
|
1103
|
-
|
|
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:
|
|
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`
|