@aligndottech/cli 0.25.0 → 0.26.1
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/dist/commands/default-action.d.ts.map +1 -1
- package/dist/commands/default-action.js +5 -0
- package/dist/commands/default-action.js.map +1 -1
- package/dist/commands/dev/index.d.ts.map +1 -1
- package/dist/commands/dev/index.js +2 -1
- package/dist/commands/dev/index.js.map +1 -1
- package/dist/commands/import/confluence.d.ts.map +1 -1
- package/dist/commands/import/confluence.js +2 -1
- package/dist/commands/import/confluence.js.map +1 -1
- package/dist/commands/import/git.d.ts.map +1 -1
- package/dist/commands/import/git.js +2 -1
- 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 +2 -1
- 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 +2 -1
- 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 +2 -1
- 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 +2 -1
- 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 +2 -1
- package/dist/commands/import/notion.js.map +1 -1
- package/dist/commands/import/slack.d.ts.map +1 -1
- package/dist/commands/import/slack.js +2 -1
- 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 +2 -1
- 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 +2 -1
- package/dist/commands/import/zoom.js.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +2 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +3 -2
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +159 -109
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/why.js +3 -2
- package/dist/commands/why.js.map +1 -1
- package/dist/lib/brand.d.ts +59 -0
- package/dist/lib/brand.d.ts.map +1 -0
- package/dist/lib/brand.js +197 -0
- package/dist/lib/brand.js.map +1 -0
- package/dist/lib/local-gateway-client.js +2 -2
- package/dist/lib/local-gateway-client.js.map +1 -1
- package/dist/lib/local-llm.d.ts +29 -0
- package/dist/lib/local-llm.d.ts.map +1 -1
- package/dist/lib/local-llm.js +39 -0
- package/dist/lib/local-llm.js.map +1 -1
- package/dist/lib/setup-ux.d.ts +38 -0
- package/dist/lib/setup-ux.d.ts.map +1 -0
- package/dist/lib/setup-ux.js +73 -0
- package/dist/lib/setup-ux.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-ux.d.ts","sourceRoot":"","sources":["../../src/lib/setup-ux.ts"],"names":[],"mappings":"AAsBA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAIpF;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWxF;AAED,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAE5F,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAKtG"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { execa } from 'execa';
|
|
2
|
+
/**
|
|
3
|
+
* Sizing and credential-discovery helpers for `align setup`.
|
|
4
|
+
*
|
|
5
|
+
* Lives outside setup.ts deliberately: that file is 833 lines and the 900-line
|
|
6
|
+
* ratchet is real, but more importantly these two are pure enough to test
|
|
7
|
+
* directly, which the flow around them is not.
|
|
8
|
+
*/
|
|
9
|
+
// Lines the prompt needs beyond the option rows themselves: the message, clack's
|
|
10
|
+
// top and bottom rules, the submit hint, and enough slack that the previous
|
|
11
|
+
// command's last line is not overwritten.
|
|
12
|
+
const RESERVED_ROWS = 8;
|
|
13
|
+
// Below this a paginated list is unusable, so we overflow slightly rather than
|
|
14
|
+
// render one option at a time. clack scrolls within maxItems, so a floor is safe.
|
|
15
|
+
const MIN_VISIBLE = 3;
|
|
16
|
+
// Used when stdout is not a TTY and reports no size. 24 is the classic default.
|
|
17
|
+
const ASSUMED_ROWS = 24;
|
|
18
|
+
/**
|
|
19
|
+
* How many options `@clack/prompts` may render at once.
|
|
20
|
+
*
|
|
21
|
+
* Without this, clack draws every option and its in-place redraw miscounts once
|
|
22
|
+
* the list is taller than the viewport, duplicating rows on screen. An outside
|
|
23
|
+
* tester hit exactly that on 2026-08-30: seven connectors, a screenful of git
|
|
24
|
+
* import output above them, and "Notion" painted three times.
|
|
25
|
+
*/
|
|
26
|
+
export function pickerMaxItems(rows, optionCount) {
|
|
27
|
+
const height = typeof rows === 'number' && Number.isFinite(rows) && rows > 0 ? rows : ASSUMED_ROWS;
|
|
28
|
+
const usable = Math.max(MIN_VISIBLE, height - RESERVED_ROWS);
|
|
29
|
+
return Math.min(optionCount, usable);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Read an already-authenticated token out of a local CLI, so a user who has
|
|
33
|
+
* `gh` set up is not sent to a browser to mint a PAT by hand.
|
|
34
|
+
*
|
|
35
|
+
* Returns null for every failure - not installed, not logged in, or authenticated
|
|
36
|
+
* but printing nothing. Null means "ask the user normally", so a broken or absent
|
|
37
|
+
* CLI degrades to the flow that existed before rather than to an error.
|
|
38
|
+
*/
|
|
39
|
+
export async function detectCliToken(bin, args) {
|
|
40
|
+
try {
|
|
41
|
+
// execa rejects on a non-zero exit, so the catch covers "not logged in"; the
|
|
42
|
+
// explicit check covers a runner configured with reject:false upstream.
|
|
43
|
+
const result = await execa(bin, args, { timeout: 5_000 });
|
|
44
|
+
if (typeof result?.exitCode === 'number' && result.exitCode !== 0)
|
|
45
|
+
return null;
|
|
46
|
+
const token = String(result?.stdout ?? '').trim();
|
|
47
|
+
return token.length > 0 ? token : null;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Connectors whose token can be read from an already-authenticated local CLI. */
|
|
54
|
+
export const CLI_TOKEN_SOURCES = {
|
|
55
|
+
github: { bin: 'gh', args: ['auth', 'token'], label: 'GitHub CLI (gh)' },
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Whether to use a token found in a local CLI, ask first, or ignore it.
|
|
59
|
+
*
|
|
60
|
+
* Separate from the prompt chain on purpose. `--approve` is documented as "Skip
|
|
61
|
+
* confirmation prompts (for scripted use)", and this repo has already shipped one
|
|
62
|
+
* prompt that ignored it - setup.ts still carries the comment about `align setup
|
|
63
|
+
* --approve` hanging when two agents were installed. A rule buried in an async
|
|
64
|
+
* prompt chain is not testable; this is.
|
|
65
|
+
*/
|
|
66
|
+
export function cliTokenDecision(o) {
|
|
67
|
+
if (!o.token)
|
|
68
|
+
return 'skip';
|
|
69
|
+
// --approve means the affirmative, not the absence of the step: skipping the
|
|
70
|
+
// connector would silently drop a source the user could have had.
|
|
71
|
+
return o.approve ? 'use' : 'ask';
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=set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