@paradigma-inc/flywheel 0.2.3 → 0.2.5
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 +5 -2
- package/package.json +1 -1
- package/src/cli.mjs +7 -5
- package/src/setup/command.mjs +6 -0
- package/src/setup/install-scope.mjs +49 -0
- package/src/setup/modes/mcp-command.mjs +1 -1
package/README.md
CHANGED
|
@@ -24,8 +24,9 @@ The script installs `@paradigma-inc/flywheel@latest` into the managed user
|
|
|
24
24
|
prefix `${FLYWHEEL_INSTALL_PREFIX:-$HOME/.local}`, adds a marked PATH block
|
|
25
25
|
when needed, and then runs guided `flywheel setup` through the installed binary.
|
|
26
26
|
In an interactive terminal, setup asks whether you want MCP host setup or
|
|
27
|
-
CLI-only setup.
|
|
28
|
-
|
|
27
|
+
CLI-only setup. Setup then asks where to install: Project (this folder) or
|
|
28
|
+
Global (your machine), with Global preselected. You can read the full source
|
|
29
|
+
at the same URL without piping to `sh`.
|
|
29
30
|
|
|
30
31
|
Prefer the two-step npm recipe? It still works:
|
|
31
32
|
|
|
@@ -186,6 +187,7 @@ Mode behavior:
|
|
|
186
187
|
If mode is omitted:
|
|
187
188
|
|
|
188
189
|
- interactive TTY: prompt for `mcp` or `cli` (default `mcp`)
|
|
190
|
+
- location: Where should Flywheel be installed? (default Global)
|
|
189
191
|
- non-interactive: fails with usage error (`exit 2`)
|
|
190
192
|
|
|
191
193
|
## Public Base URL Rules
|
|
@@ -329,6 +331,7 @@ full details.
|
|
|
329
331
|
|
|
330
332
|
- Default scope (no `--project`) is user-level/global.
|
|
331
333
|
- `--project` is the explicit repo-local override.
|
|
334
|
+
- Interactive setup asks for the install location (Global preselected) when `--project` is omitted.
|
|
332
335
|
|
|
333
336
|
Examples:
|
|
334
337
|
|
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -368,9 +368,9 @@ function validateCliModeFlags(options) {
|
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
async function runCliModeCommand(options, readStdinAuth) {
|
|
371
|
+
async function runCliModeCommand(options, readStdinAuth, contextScope) {
|
|
372
372
|
validateCliModeFlags(options);
|
|
373
|
-
const scope = options.project ? "project" : "global";
|
|
373
|
+
const scope = contextScope ?? (options.project ? "project" : "global");
|
|
374
374
|
const baseUrl = normalizeBaseUrl(
|
|
375
375
|
resolveSetupBaseUrl({ explicitBaseUrl: options.baseUrl }),
|
|
376
376
|
);
|
|
@@ -450,9 +450,10 @@ async function runSetupCommandViaRouter(options) {
|
|
|
450
450
|
isInteractive:
|
|
451
451
|
isatty(0) && process.stdout.isTTY === true,
|
|
452
452
|
promptMode: promptSetupMode,
|
|
453
|
-
runMcpMode: async ({ readStdinAuth }) =>
|
|
453
|
+
runMcpMode: async ({ readStdinAuth, scope }) =>
|
|
454
454
|
await runMcpModeCommand(options, {
|
|
455
455
|
readStdinAuth,
|
|
456
|
+
scope,
|
|
456
457
|
force: options.force === true,
|
|
457
458
|
reconcilePriorMode: async ({
|
|
458
459
|
hostNames,
|
|
@@ -480,7 +481,8 @@ async function runSetupCommandViaRouter(options) {
|
|
|
480
481
|
}
|
|
481
482
|
},
|
|
482
483
|
}),
|
|
483
|
-
runCliMode: async ({ readStdinAuth }) =>
|
|
484
|
+
runCliMode: async ({ readStdinAuth, scope }) =>
|
|
485
|
+
await runCliModeCommand(options, readStdinAuth, scope),
|
|
484
486
|
});
|
|
485
487
|
}
|
|
486
488
|
|
|
@@ -1360,7 +1362,7 @@ Configure the Flywheel CLI, MCP host entries, and bundled skills without changin
|
|
|
1360
1362
|
.optionsGroup("Scope:")
|
|
1361
1363
|
.option(
|
|
1362
1364
|
"-p, --project",
|
|
1363
|
-
"Configure for current project instead of globally",
|
|
1365
|
+
"Configure for current project instead of globally; setup asks interactively when omitted",
|
|
1364
1366
|
)
|
|
1365
1367
|
.option("-y, --yes", "Skip confirmation prompts")
|
|
1366
1368
|
.optionsGroup("Authentication:")
|
package/src/setup/command.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolveSetupMode } from "./mode.mjs";
|
|
2
2
|
import { recordResolvedMode } from "./resolved-selection-record.mjs";
|
|
3
3
|
import { createSetupStdinAuthReader } from "../setup-auth.mjs";
|
|
4
|
+
import { resolveInteractiveSetupScope } from "./install-scope.mjs";
|
|
4
5
|
|
|
5
6
|
export async function runSetupRouter(options = {}, deps = {}) {
|
|
6
7
|
const mode = await resolveSetupMode(options, {
|
|
@@ -11,10 +12,15 @@ export async function runSetupRouter(options = {}, deps = {}) {
|
|
|
11
12
|
? createSetupStdinAuthReader(options, deps.stdin)
|
|
12
13
|
: undefined;
|
|
13
14
|
recordResolvedMode(mode, deps);
|
|
15
|
+
const scope = await resolveInteractiveSetupScope(options, {
|
|
16
|
+
allowPrompt: deps.isInteractive === true && options.yes !== true,
|
|
17
|
+
promptLocation: deps.promptInstallLocation,
|
|
18
|
+
});
|
|
14
19
|
const context = {
|
|
15
20
|
mode,
|
|
16
21
|
options,
|
|
17
22
|
readStdinAuth,
|
|
23
|
+
scope,
|
|
18
24
|
};
|
|
19
25
|
|
|
20
26
|
if (mode === "mcp") {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { select } from "@inquirer/prompts";
|
|
2
|
+
import pc from "picocolors";
|
|
3
|
+
|
|
4
|
+
const INSTALL_LOCATION_THEME = {
|
|
5
|
+
style: {
|
|
6
|
+
highlight: (text) => pc.green(text),
|
|
7
|
+
disabledChoice: (text) => ` ${pc.dim("◯")} ${pc.dim(text)}`,
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function buildInstallLocationPromptConfig() {
|
|
12
|
+
return {
|
|
13
|
+
message: "Where should Flywheel be installed?",
|
|
14
|
+
choices: [
|
|
15
|
+
{
|
|
16
|
+
name: "Project (this folder)",
|
|
17
|
+
value: "project",
|
|
18
|
+
short: "Project",
|
|
19
|
+
description:
|
|
20
|
+
"Files land under the current directory; commit them so teammates get them too.",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "Global (your machine)",
|
|
24
|
+
value: "global",
|
|
25
|
+
short: "Global",
|
|
26
|
+
description: "Available in all your projects on this machine.",
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
default: "global",
|
|
30
|
+
theme: INSTALL_LOCATION_THEME,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export async function promptInstallLocation() {
|
|
35
|
+
return await select(buildInstallLocationPromptConfig());
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export async function resolveInteractiveSetupScope(
|
|
39
|
+
options,
|
|
40
|
+
{ allowPrompt = false, promptLocation = promptInstallLocation } = {},
|
|
41
|
+
) {
|
|
42
|
+
if (options.project) {
|
|
43
|
+
return "project";
|
|
44
|
+
}
|
|
45
|
+
if (allowPrompt) {
|
|
46
|
+
return await promptLocation();
|
|
47
|
+
}
|
|
48
|
+
return "global";
|
|
49
|
+
}
|
|
@@ -605,7 +605,7 @@ export async function runMcpModeCommand(options, deps = {}) {
|
|
|
605
605
|
);
|
|
606
606
|
}
|
|
607
607
|
|
|
608
|
-
const scope = options.project ? "project" : "global";
|
|
608
|
+
const scope = deps.scope ?? (options.project ? "project" : "global");
|
|
609
609
|
const baseUrl = normalizeBaseUrl(
|
|
610
610
|
resolveSetupBaseUrl({ explicitBaseUrl: options.baseUrl }),
|
|
611
611
|
);
|