@paradigma-inc/flywheel 0.1.143 → 0.1.147

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 (74) hide show
  1. package/package.json +1 -1
  2. package/skills/flywheel/references/INTERFACES.md +2 -4
  3. package/skills/flywheel/references/flywheel-cli-tool-map.md +2 -13
  4. package/skills/flywheel/references/flywheel-mcp-tool-map.md +1 -10
  5. package/skills/flywheel-auto/references/INTERFACES.md +2 -4
  6. package/skills/flywheel-auto/references/flywheel-cli-tool-map.md +2 -5
  7. package/skills/flywheel-auto/references/flywheel-mcp-tool-map.md +1 -2
  8. package/skills/flywheel-lookahead/references/INTERFACES.md +2 -4
  9. package/skills/flywheel-lookahead/references/flywheel-cli-tool-map.md +2 -5
  10. package/skills/flywheel-lookahead/references/flywheel-mcp-tool-map.md +1 -2
  11. package/skills/flywheel-reproduce/references/INTERFACES.md +2 -4
  12. package/skills/flywheel-reproduce/references/flywheel-cli-tool-map.md +2 -5
  13. package/skills/flywheel-reproduce/references/flywheel-mcp-tool-map.md +1 -2
  14. package/skills/flywheel-to-graph/references/INTERFACES.md +2 -4
  15. package/skills/flywheel-to-graph/references/flywheel-cli-tool-map.md +2 -5
  16. package/skills/flywheel-to-graph/references/flywheel-mcp-tool-map.md +1 -2
  17. package/src/runtime/required-runtime-commands.json +1 -0
  18. package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-resources.js +4 -0
  19. package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-resources.js.map +1 -1
  20. package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.js +14 -13
  21. package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.js.map +1 -1
  22. package/src/runtime/vendor/flywheel-cli-dist/commands/help.js +19 -12
  23. package/src/runtime/vendor/flywheel-cli-dist/commands/help.js.map +1 -1
  24. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/repository.js +27 -9
  25. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/repository.js.map +1 -1
  26. package/src/runtime/vendor/flywheel-cli-dist/commands/repository-operation.js +16 -0
  27. package/src/runtime/vendor/flywheel-cli-dist/commands/repository-operation.js.map +1 -1
  28. package/src/runtime/vendor/flywheel-cli-dist/commands/repository-projection.js +3 -2
  29. package/src/runtime/vendor/flywheel-cli-dist/commands/repository-projection.js.map +1 -1
  30. package/src/runtime/vendor/flywheel-cli-dist/http/client.js +1 -0
  31. package/src/runtime/vendor/flywheel-cli-dist/http/client.js.map +1 -1
  32. package/src/runtime/vendor/flywheel-cli-dist/local/adapter.js +1 -0
  33. package/src/runtime/vendor/flywheel-cli-dist/local/adapter.js.map +1 -1
  34. package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/replay.js +25 -53
  35. package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/replay.js.map +1 -1
  36. package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/staging.js +34 -0
  37. package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/staging.js.map +1 -1
  38. package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/writes.js +175 -92
  39. package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/writes.js.map +1 -1
  40. package/src/runtime/vendor/flywheel-cli-dist/local/runtime/dispatch.js +1 -0
  41. package/src/runtime/vendor/flywheel-cli-dist/local/runtime/dispatch.js.map +1 -1
  42. package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/core.js +14 -1
  43. package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/core.js.map +1 -1
  44. package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/index.js +2 -1
  45. package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/index.js.map +1 -1
  46. package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/projections.js +26 -14
  47. package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/projections.js.map +1 -1
  48. package/src/runtime/vendor/flywheel-cli-dist/local/runtime/projection.js +48 -15
  49. package/src/runtime/vendor/flywheel-cli-dist/local/runtime/projection.js.map +1 -1
  50. package/src/runtime/vendor/flywheel-cli-dist/local/store/apply.js +2 -2
  51. package/src/runtime/vendor/flywheel-cli-dist/local/store/apply.js.map +1 -1
  52. package/src/runtime/vendor/flywheel-cli-dist/local/store/contract.js.map +1 -1
  53. package/src/runtime/vendor/flywheel-cli-dist/local/store/history-validation.js +7 -5
  54. package/src/runtime/vendor/flywheel-cli-dist/local/store/history-validation.js.map +1 -1
  55. package/src/runtime/vendor/flywheel-cli-dist/local/store/latest-values.js +6 -107
  56. package/src/runtime/vendor/flywheel-cli-dist/local/store/latest-values.js.map +1 -1
  57. package/src/runtime/vendor/flywheel-cli-dist/local/store/pending.js +112 -0
  58. package/src/runtime/vendor/flywheel-cli-dist/local/store/pending.js.map +1 -0
  59. package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/apply.js.map +1 -1
  60. package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/artifacts.js +2 -0
  61. package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/artifacts.js.map +1 -1
  62. package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/nodes.js.map +1 -1
  63. package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/relations.js.map +1 -1
  64. package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/tags.js.map +1 -1
  65. package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/store.js +36 -1
  66. package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/store.js.map +1 -1
  67. package/src/runtime/vendor/flywheel-cli-dist/local/store/sync.js +2 -2
  68. package/src/runtime/vendor/flywheel-cli-dist/local/store/sync.js.map +1 -1
  69. package/src/runtime/vendor/flywheel-cli-dist/main.js +99 -180
  70. package/src/runtime/vendor/flywheel-cli-dist/main.js.map +1 -1
  71. package/src/runtime/vendor/flywheel-cli-dist/runtime-auth.js +112 -0
  72. package/src/runtime/vendor/flywheel-cli-dist/runtime-auth.js.map +1 -0
  73. package/src/runtime/vendor/manifest.json +5 -1
  74. package/src/unified-cli.mjs +189 -193
@@ -1 +1 @@
1
- {"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../src/local/store/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,6BAA6B,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEpF,KAAK,UAAU,qBAAqB,CAAC,MAAsB,EAAE,OAAuC;IAClG,MAAM,OAAO,GAAG,6BAA6B,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,OAAO,CAAC,MAAM,GAA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AAE,aAAa,CAAC,EAAE,sDAAsD,CAAC;iBAC1G,CAAC,CAAC;YACL,CAAC;YACD,IAAI,KAAK,YAAY,oBAAoB;gBAAE,MAAM,KAAK,CAAC;YACvD,MAAM,IAAI,oBAAoB,CAAC,oCAAoC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACzF,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -5,12 +5,11 @@ import os from "node:os";
5
5
  import { resolve } from "node:path";
6
6
  import { pathToFileURL } from "node:url";
7
7
  import { processStdoutIsPipe, writeCredentialStream } from "./credential-output.js";
8
- import { loadFlywheelConfig, saveFlywheelConfig, FlywheelConfigError, resolveFlywheelConfigPath, } from "./config/index.js";
9
- import { baseUrlsEqual } from "./auth/baseurl.js";
8
+ import { loadFlywheelConfig, saveFlywheelConfig, FlywheelConfigError, resolveFlywheelConfigPath, inspectFlywheelConfig, } from "./config/index.js";
10
9
  import { CredentialStoreError, readCredential, resolveCredentialFilePath, } from "./auth/credentials.js";
11
- import { RUNTIME_ALIASES } from "./commands/aliases.js";
12
- import { BUILTIN_PROFILE_NAMES, isBuiltinProfileName, resolveBuiltinBaseUrl, } from "./auth/profiles.js";
13
- import { renderCommandHelp, renderCommandHelpAsJson, renderHelp, renderHelpAsJson, } from "./commands/help.js";
10
+ import { ADMIN_DISCOVERY_VERIFICATION_ERROR, renderCommandHelp, renderCommandHelpAsJson, renderHelp, renderHelpAsJson, } from "./commands/help.js";
11
+ import { adminAuthRequestOptions, adminKeyFromEnv, } from "./commands/_admin-auth.js";
12
+ import { activeCredentialIsApiKey } from "./commands/auth-mode.js";
14
13
  import { renderUsageSpec } from "./commands/usage-spec.js";
15
14
  import { getCommandByName } from "./commands/registry.js";
16
15
  import { MVP_COMMAND_HANDLERS } from "./commands/index.js";
@@ -31,7 +30,8 @@ import { maskSensitiveForOutput } from "./http/debug.js";
31
30
  import { renderOutput } from "./output/format.js";
32
31
  import { CLI_VERSION } from "./version.js";
33
32
  import { LocalRepositoryAdapter } from "./local/adapter.js";
34
- const DEFAULT_BASE_URL = "http://localhost:8000";
33
+ import { DEFAULT_BASE_URL, resolveRuntimeAuthConfig, resolveRuntimeProfile, selectedRuntimeProfileName, } from "./runtime-auth.js";
34
+ import { RUNTIME_ALIASES } from "./commands/aliases.js";
35
35
  function defaultStdout(chunk) {
36
36
  process.stdout.write(chunk);
37
37
  }
@@ -69,80 +69,6 @@ function emitRetiredCommandName(command, argv, stderr) {
69
69
  }
70
70
  return 1;
71
71
  }
72
- function activeBuiltinFromConfig(config) {
73
- const rawName = config.activeProfile;
74
- if (typeof rawName !== "string" ||
75
- !rawName.trim() ||
76
- !isBuiltinProfileName(rawName.trim())) {
77
- return { name: undefined, baseUrl: undefined };
78
- }
79
- const name = rawName.trim();
80
- return { name, baseUrl: resolveBuiltinBaseUrl(name) };
81
- }
82
- function assertRepositoryTransportOrigin(baseUrl) {
83
- let parsed;
84
- try {
85
- parsed = new URL(baseUrl);
86
- }
87
- catch {
88
- throw new CliHttpError("repository remotes require HTTPS or loopback HTTP", EXIT_TRANSPORT);
89
- }
90
- const loopbackHttp = parsed.protocol === "http:" &&
91
- ["localhost", "127.0.0.1", "[::1]", "::1"].includes(parsed.hostname.toLowerCase());
92
- if (parsed.protocol === "https:" || loopbackHttp)
93
- return;
94
- throw new CliHttpError("repository remotes require HTTPS or loopback HTTP", EXIT_TRANSPORT);
95
- }
96
- async function resolveRuntimeAuthConfig(config, profile, resolveEnvApiKey, resolveCredentialFile, credentialLookupEnabled, readStoredCredential, repositoryRemote = false) {
97
- const envBaseUrl = process.env.FLYWHEEL_BASE_URL?.trim();
98
- const activeBuiltin = activeBuiltinFromConfig(config);
99
- const activeProfile = typeof config.activeProfile === "string" && config.activeProfile.trim()
100
- ? config.activeProfile.trim()
101
- : undefined;
102
- const baseUrl = envBaseUrl || profile?.baseUrl || activeBuiltin.baseUrl || DEFAULT_BASE_URL;
103
- if (repositoryRemote)
104
- assertRepositoryTransportOrigin(baseUrl);
105
- const credentialProfile = profile?.name ?? activeBuiltin.name ?? activeProfile ?? "default";
106
- const credentialBaseUrl = profile?.baseUrl ?? activeBuiltin.baseUrl ??
107
- (credentialProfile === "default" ? baseUrl : DEFAULT_BASE_URL);
108
- const environmentApiKey = process.env.FLYWHEEL_API_KEY?.trim() || undefined;
109
- if (repositoryRemote &&
110
- environmentApiKey &&
111
- (!envBaseUrl || !baseUrlsEqual(baseUrl, envBaseUrl))) {
112
- throw new CliHttpError("credential_store_unavailable", EXIT_TRANSPORT);
113
- }
114
- let apiKey = environmentApiKey;
115
- if (!apiKey &&
116
- profile?.apiKeyEnv &&
117
- profile.baseUrl &&
118
- baseUrlsEqual(baseUrl, profile.baseUrl)) {
119
- apiKey = resolveEnvApiKey(profile.apiKeyEnv);
120
- }
121
- let credentialReadiness;
122
- if (apiKey || !credentialLookupEnabled) {
123
- credentialReadiness = "not_checked";
124
- }
125
- else if (baseUrlsEqual(baseUrl, credentialBaseUrl)) {
126
- const storedCredential = await readStoredCredential(credentialProfile, credentialBaseUrl, resolveCredentialFile());
127
- credentialReadiness = storedCredential ? "ready" : "missing";
128
- apiKey = storedCredential ?? undefined;
129
- }
130
- else {
131
- credentialReadiness = "not_checked";
132
- }
133
- if (repositoryRemote && !apiKey) {
134
- throw new CliHttpError("credential_store_unavailable", EXIT_TRANSPORT);
135
- }
136
- return {
137
- baseUrl,
138
- credentialBaseUrl: environmentApiKey
139
- ? baseUrl
140
- : credentialBaseUrl,
141
- apiKey,
142
- credentialReadiness,
143
- defaultFormat: profile?.defaultFormat,
144
- };
145
- }
146
72
  const HELP_TOKENS = new Set(["--help", "-h"]);
147
73
  const USAGE_TOKENS = new Set(["--usage", "--usage-spec"]);
148
74
  const SCHEMA_TOKEN = "--schema";
@@ -379,19 +305,16 @@ function parseHelpFormat(argv) {
379
305
  return result;
380
306
  }
381
307
  /**
382
- * Strip `--format=...` / `--format <value>` tokens from argv so the help
383
- * dispatcher can pick out the positional <command> without tripping over the
384
- * format global. Callers must validate the format value via parseHelpFormat
385
- * before calling this — unsupported values should surface as usage errors,
386
- * not be silently dropped.
308
+ * Strip format and environment options so their values cannot become command
309
+ * names. Callers must validate options via resolveHelpOptions first.
387
310
  */
388
- function stripFormatTokens(argv) {
311
+ function stripHelpOptionTokens(argv) {
389
312
  const out = [];
390
313
  for (let i = 0; i < argv.length; i += 1) {
391
314
  const token = argv[i];
392
- if (token.startsWith("--format="))
315
+ if (token.startsWith("--format=") || token.startsWith("--env="))
393
316
  continue;
394
- if (token === "--format") {
317
+ if (token === "--format" || token === "--env") {
395
318
  i += 1; // skip the value
396
319
  continue;
397
320
  }
@@ -421,9 +344,9 @@ function renderAliasesHelp() {
421
344
  .map(([aliasCommand, canonicalCommand]) => ` ${aliasCommand} → ${canonicalCommand}`)
422
345
  .join("\n")}\n`;
423
346
  }
424
- function emitCommandHelp(stdout, stderr, commandName, schema, asJson) {
347
+ function emitCommandHelp(stdout, stderr, commandName, schema, asJson, adminDiscovery) {
425
348
  if (asJson) {
426
- const payload = renderCommandHelpAsJson(commandName);
349
+ const payload = renderCommandHelpAsJson(commandName, { adminDiscovery });
427
350
  const parsed = JSON.parse(payload);
428
351
  if (parsed.error) {
429
352
  writeLine(stderr, parsed.error);
@@ -432,8 +355,9 @@ function emitCommandHelp(stdout, stderr, commandName, schema, asJson) {
432
355
  stdout(payload);
433
356
  return 0;
434
357
  }
435
- const helpText = renderCommandHelp(commandName, { schema });
436
- if (helpText.startsWith("unknown command:")) {
358
+ const helpText = renderCommandHelp(commandName, { schema, adminDiscovery });
359
+ if (helpText.startsWith("unknown command:") ||
360
+ helpText.trim() === ADMIN_DISCOVERY_VERIFICATION_ERROR) {
437
361
  writeLine(stderr, helpText.trim());
438
362
  return 1;
439
363
  }
@@ -644,6 +568,47 @@ export async function runCli(argv, dependencies = {}) {
644
568
  }));
645
569
  return 0;
646
570
  }
571
+ const resolveConfigPath = () => dependencies.configPath ??
572
+ (dependencies.resolveConfigPath ?? resolveFlywheelConfigPath)();
573
+ const loadConfig = dependencies.loadConfig ??
574
+ (dependencies.configPath
575
+ ? (filePath) => loadFlywheelConfig({
576
+ env: { ...process.env, FLYWHEEL_CLI_CONFIG_PATH: filePath },
577
+ })
578
+ : async () => loadFlywheelConfig());
579
+ const configExists = dependencies.configExists ?? defaultConfigExists;
580
+ const saveConfig = dependencies.saveConfig ??
581
+ (async (filePath, config) => saveFlywheelConfig(config, filePath));
582
+ const resolveEnvApiKey = dependencies.resolveEnvApiKey ??
583
+ ((envVar) => process.env[envVar]?.trim() || undefined);
584
+ let credentialFile = dependencies.credentialFile;
585
+ const resolveCredentialFile = () => credentialFile ??= resolveCredentialFilePath();
586
+ async function resolveHelpAdminDiscovery(environment) {
587
+ try {
588
+ const config = await (dependencies.loadConfig ?? inspectFlywheelConfig)(resolveConfigPath()) ?? { schemaVersion: 1 };
589
+ const profile = resolveRuntimeProfile(config, environment);
590
+ const runtimeConfig = await resolveRuntimeAuthConfig(config, profile, resolveEnvApiKey, resolveCredentialFile, true, dependencies.readCredential ?? readCredential);
591
+ if (!adminKeyFromEnv() &&
592
+ (!runtimeConfig.apiKey || activeCredentialIsApiKey(runtimeConfig.apiKey))) {
593
+ return false;
594
+ }
595
+ const client = (dependencies.createHttpClient ?? createHttpClient)({
596
+ baseUrl: runtimeConfig.baseUrl,
597
+ apiKey: runtimeConfig.apiKey,
598
+ cliVersion: CLI_VERSION,
599
+ commandName: "help",
600
+ retryEnabled: false,
601
+ timeoutMs: 10_000,
602
+ });
603
+ const response = await client.requestJson("GET", "/auth/admin-status", adminAuthRequestOptions(runtimeConfig.apiKey));
604
+ return (response !== null &&
605
+ typeof response === "object" &&
606
+ response.is_admin === true);
607
+ }
608
+ catch {
609
+ return false;
610
+ }
611
+ }
647
612
  const usagePrivateFlag = argv.find((token) => token.startsWith(USAGE_EXTRAS_PREFIX) ||
648
613
  token.startsWith(USAGE_VERSION_PREFIX));
649
614
  if (usagePrivateFlag !== undefined) {
@@ -656,23 +621,40 @@ export async function runCli(argv, dependencies = {}) {
656
621
  // below. Non-help commands let `parseCliArgs` validate --format against the
657
622
  // full json|tsv|csv|table set; validating here would reject legitimate
658
623
  // runtime formats like `flywheel hosted:node:list --format=csv`.
659
- function resolveHelpFormat() {
624
+ function resolveHelpOptions(params) {
660
625
  const fmt = parseHelpFormat(argv);
661
626
  if (fmt.kind === "invalid") {
662
627
  writeLine(stderr, `invalid --format=${fmt.value}: help supports --format=json or no --format (text)`);
663
628
  return EXIT_USAGE;
664
629
  }
665
- return { json: fmt.kind === "json" };
630
+ if (!params) {
631
+ const parsed = parseCliArgs(["help", ...stripHelpExtras(argv.slice(1))], argv.length, GLOBAL_BOOLEAN_FLAG_NAMES);
632
+ if (!parsed.ok) {
633
+ writeLine(stderr, parsed.message);
634
+ return parsed.exitCode;
635
+ }
636
+ params = parsed.params;
637
+ }
638
+ try {
639
+ const environment = params.env === undefined
640
+ ? undefined
641
+ : extractGlobals({ env: params.env }).globals.env;
642
+ return { json: fmt.kind === "json", environment };
643
+ }
644
+ catch (error) {
645
+ if (!(error instanceof CliUsageError))
646
+ throw error;
647
+ writeLine(stderr, error.message);
648
+ return error.exitCode;
649
+ }
666
650
  }
667
- // Top-level help / `help ...` dispatcher runs BEFORE parseCliArgs because
668
- // `flywheel --help` and `flywheel help ...` aren't valid command tokens —
669
- // they'd fail COMMAND_TOKEN_PATTERN and return "unknown command" if we
670
- // let the parser run first. Per-command help (`flywheel <cmd> --help`,
651
+ // Normalize top-level help aliases to the canonical help command for option
652
+ // parsing. Per-command help (`flywheel <cmd> --help`,
671
653
  // `flywheel <cmd> --schema --help`) is detected AFTER parseCliArgs binds
672
654
  // values to flags, so a call like `profile:set --name -h --base_url ...`
673
655
  // does not incorrectly drop into help mode on the `-h` value token.
674
656
  if (isHelpToken(first)) {
675
- const resolved = resolveHelpFormat();
657
+ const resolved = resolveHelpOptions();
676
658
  if (typeof resolved === "number")
677
659
  return resolved;
678
660
  const extrasParsed = parseHelpExtras(argv);
@@ -681,16 +663,18 @@ export async function runCli(argv, dependencies = {}) {
681
663
  return EXIT_USAGE;
682
664
  }
683
665
  const extras = extrasParsed.kind === "ok" ? extrasParsed.extras : [];
684
- stdout(resolved.json ? renderHelpAsJson(extras) : renderHelp(extras));
666
+ const adminDiscovery = await resolveHelpAdminDiscovery(resolved.environment);
667
+ stdout(resolved.json
668
+ ? renderHelpAsJson(extras, { adminDiscovery })
669
+ : renderHelp(extras, { adminDiscovery }));
685
670
  return 0;
686
671
  }
687
672
  if (first === "help") {
688
- const resolved = resolveHelpFormat();
673
+ const resolved = resolveHelpOptions();
689
674
  if (typeof resolved === "number")
690
675
  return resolved;
691
- // Strip --format and --_help_extras tokens so the positional <command>
692
- // lookup isn't fooled by them occupying rest[0].
693
- const { commandArgs: helpArgs, schema, aliases, } = normalizeCommandHelpArgs(stripHelpExtras(stripFormatTokens(rest)));
676
+ // Strip help globals so their values cannot become a command name.
677
+ const { commandArgs: helpArgs, schema, aliases, } = normalizeCommandHelpArgs(stripHelpExtras(stripHelpOptionTokens(rest)));
694
678
  const extrasParsed = parseHelpExtras(argv);
695
679
  if (extrasParsed.kind === "invalid") {
696
680
  writeLine(stderr, "invalid --_help_extras payload");
@@ -706,17 +690,16 @@ export async function runCli(argv, dependencies = {}) {
706
690
  }
707
691
  if (helpArgs.length === 0) {
708
692
  const extras = extrasParsed.kind === "ok" ? extrasParsed.extras : [];
709
- stdout(resolved.json ? renderHelpAsJson(extras) : renderHelp(extras));
693
+ const adminDiscovery = await resolveHelpAdminDiscovery(resolved.environment);
694
+ stdout(resolved.json
695
+ ? renderHelpAsJson(extras, { adminDiscovery })
696
+ : renderHelp(extras, { adminDiscovery }));
710
697
  return 0;
711
698
  }
712
- // --_help_extras is only valid on top-level help. Surface mis-use
713
- // as a usage error rather than silently ignoring it.
714
699
  if (extrasParsed.kind === "ok") {
715
700
  writeLine(stderr, "unknown flag: --_help_extras");
716
701
  return EXIT_USAGE;
717
702
  }
718
- // `help <alias>` must resolve the same alias map used by the SHORTCUTS
719
- // section so advertised shortcuts get executable help pages.
720
703
  const rawCommandName = helpArgs[0];
721
704
  const commandName = Object.prototype.hasOwnProperty.call(RUNTIME_ALIASES, rawCommandName)
722
705
  ? RUNTIME_ALIASES[rawCommandName]
@@ -724,7 +707,7 @@ export async function runCli(argv, dependencies = {}) {
724
707
  const retiredExitCode = emitRetiredCommandName(commandName, argv, stderr);
725
708
  if (retiredExitCode !== undefined)
726
709
  return retiredExitCode;
727
- return emitCommandHelp(stdout, stderr, commandName, schema, resolved.json);
710
+ return emitCommandHelp(stdout, stderr, commandName, schema, resolved.json, await resolveHelpAdminDiscovery(resolved.environment));
728
711
  }
729
712
  // --_help_extras is reserved for top-level help dispatch only. Reject it
730
713
  // when seen on any other command path so it cannot leak into runtime
@@ -761,10 +744,10 @@ export async function runCli(argv, dependencies = {}) {
761
744
  const helpRequested = parsed.params.help === true || parsed.params.h === true;
762
745
  const schemaRequested = parsed.params.schema === true;
763
746
  if (helpRequested) {
764
- const resolved = resolveHelpFormat();
747
+ const resolved = resolveHelpOptions(parsed.params);
765
748
  if (typeof resolved === "number")
766
749
  return resolved;
767
- return emitCommandHelp(stdout, stderr, parsed.command, schemaRequested, resolved.json);
750
+ return emitCommandHelp(stdout, stderr, parsed.command, schemaRequested, resolved.json, await resolveHelpAdminDiscovery(resolved.environment));
768
751
  }
769
752
  if (schemaRequested && parsed.command !== "repo:node:create") {
770
753
  writeLine(stderr, "--schema is only valid with --help");
@@ -818,70 +801,12 @@ export async function runCli(argv, dependencies = {}) {
818
801
  }
819
802
  return 0;
820
803
  }
821
- const configPath = dependencies.configPath ??
822
- (dependencies.resolveConfigPath ?? resolveFlywheelConfigPath)();
823
- const loadConfig = dependencies.loadConfig ??
824
- (dependencies.configPath
825
- ? (filePath) => loadFlywheelConfig({
826
- env: { ...process.env, FLYWHEEL_CLI_CONFIG_PATH: filePath },
827
- })
828
- : async () => loadFlywheelConfig());
829
- const configExists = dependencies.configExists ?? defaultConfigExists;
830
- const saveConfig = dependencies.saveConfig ??
831
- (async (filePath, config) => saveFlywheelConfig(config, filePath));
832
- const resolveEnvApiKey = dependencies.resolveEnvApiKey ??
833
- ((envVar) => process.env[envVar]?.trim() || undefined);
804
+ const configPath = resolveConfigPath();
834
805
  const config = await loadConfig(configPath);
835
806
  const runtimeConfigExists = dependencies.loadConfig === undefined
836
807
  ? await configExists(configPath)
837
808
  : true;
838
- // `--env=<name>` accepts a unified TOML profile or a built-in profile name
839
- // (prod / staging). Built-ins synthesise a minimal Profile so the rest of
840
- // the pipeline (base URL resolution and per-profile keychain lookups) treats
841
- // them uniformly. The built-in base URL is the runtime source of truth
842
- // (never written to config.toml); `--env=<builtin>` selects it for one call
843
- // without mutating disk state.
844
- let profile = null;
845
- if (globals.env) {
846
- // Built-in names (`prod` / `staging`) are reserved and must always
847
- // resolve to `BUILTIN_PROFILES`. Checking built-ins BEFORE the
848
- // TOML loader prevents a stray `profiles/staging.toml` (e.g. left
849
- // over from manual setup before built-ins existed) from silently
850
- // shadowing the built-in and routing requests — and, via the
851
- // per-profile key lookup in `resolveRuntimeAuthConfig`, stored
852
- // credentials — to an unintended origin. `env:switch` enforces
853
- // the same reservation; resolving built-ins first keeps
854
- // `--env=<name>` and `env:switch --name <name>` in lockstep.
855
- if (isBuiltinProfileName(globals.env)) {
856
- const builtinBaseUrl = resolveBuiltinBaseUrl(globals.env);
857
- if (builtinBaseUrl) {
858
- profile = { name: globals.env, baseUrl: builtinBaseUrl };
859
- }
860
- }
861
- else {
862
- const fromToml = config.profiles && Object.hasOwn(config.profiles, globals.env)
863
- ? { name: globals.env, ...config.profiles[globals.env] }
864
- : null;
865
- if (fromToml) {
866
- profile = fromToml;
867
- }
868
- if (!profile) {
869
- const available = BUILTIN_PROFILE_NAMES.join(", ");
870
- throw new CliUsageError(`unknown profile: ${globals.env}. Built-in profiles: ${available}`);
871
- }
872
- }
873
- }
874
- if (!profile &&
875
- config.activeProfile &&
876
- !isBuiltinProfileName(config.activeProfile)) {
877
- const active = config.profiles && Object.hasOwn(config.profiles, config.activeProfile)
878
- ? config.profiles[config.activeProfile]
879
- : undefined;
880
- if (active)
881
- profile = { name: config.activeProfile, ...active };
882
- }
883
- let credentialFile = dependencies.credentialFile;
884
- const resolveCredentialFile = () => credentialFile ??= resolveCredentialFilePath();
809
+ const profile = resolveRuntimeProfile(config, globals.env);
885
810
  if (dependencies.loadConfig === undefined &&
886
811
  !RUNTIME_CONFIG_OPTIONAL_COMMANDS.includes(commandName)) {
887
812
  // Env-only execution (CI/containers, scripted health checks) and
@@ -910,10 +835,7 @@ export async function runCli(argv, dependencies = {}) {
910
835
  profile !== null ||
911
836
  Boolean(process.env.FLYWHEEL_BASE_URL?.trim());
912
837
  const runtimeConfig = await resolveRuntimeAuthConfig(config, profile, resolveEnvApiKey, resolveCredentialFile, !CREDENTIAL_LOOKUP_SKIPPED_COMMANDS.includes(commandName), dependencies.readCredential ?? readCredential, localRepositoryRemoteCommand);
913
- const selectedProfileName = profile?.name ??
914
- (typeof config.activeProfile === "string" && config.activeProfile.trim()
915
- ? config.activeProfile.trim()
916
- : "default");
838
+ const selectedProfileName = selectedRuntimeProfileName(config, profile);
917
839
  missingCredentialRemediation = runtimeConfig.apiKey
918
840
  ? undefined
919
841
  : selectedProfileName === "default"
@@ -981,10 +903,7 @@ export async function runCli(argv, dependencies = {}) {
981
903
  ? {
982
904
  client,
983
905
  baseUrl: runtimeConfig.baseUrl,
984
- profile: profile?.name ??
985
- (typeof config.activeProfile === "string" && config.activeProfile.trim()
986
- ? config.activeProfile.trim()
987
- : "default"),
906
+ profile: selectedProfileName,
988
907
  }
989
908
  : undefined;
990
909
  const localAdapter = localRepositoryCommand