@paradigma-inc/flywheel 0.1.53 → 0.1.60

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 (121) hide show
  1. package/README.md +121 -10
  2. package/package.json +1 -1
  3. package/skills/flywheel/references/flywheel-cli-tool-map.md +8 -0
  4. package/skills/flywheel/references/flywheel-mcp-tool-map.md +8 -0
  5. package/src/agents.mjs +114 -48
  6. package/src/cli.mjs +267 -35
  7. package/src/mcp-writer.mjs +190 -17
  8. package/src/runtime/required-runtime-commands.json +17 -4
  9. package/src/runtime/vendor/flywheel-cli-dist/auth/login.d.ts +1 -0
  10. package/src/runtime/vendor/flywheel-cli-dist/auth/login.js +3 -6
  11. package/src/runtime/vendor/flywheel-cli-dist/auth/login.js.map +1 -1
  12. package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.d.ts +1 -0
  13. package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js +1 -1
  14. package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js.map +1 -1
  15. package/src/runtime/vendor/flywheel-cli-dist/commands/_admin-auth.d.ts +25 -0
  16. package/src/runtime/vendor/flywheel-cli-dist/commands/_admin-auth.js +35 -0
  17. package/src/runtime/vendor/flywheel-cli-dist/commands/_admin-auth.js.map +1 -0
  18. package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-file-out.d.ts +39 -0
  19. package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-file-out.js +72 -0
  20. package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-file-out.js.map +1 -0
  21. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-get.d.ts +2 -0
  22. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-get.js +10 -0
  23. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-get.js.map +1 -0
  24. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-set.d.ts +2 -0
  25. package/src/runtime/vendor/flywheel-cli-dist/commands/{compute-policy-set.js → admin-compute-policy-set.js} +8 -3
  26. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-set.js.map +1 -0
  27. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.d.ts +2 -0
  28. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.js +114 -0
  29. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.js.map +1 -0
  30. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export.d.ts +2 -0
  31. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export.js +11 -0
  32. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export.js.map +1 -0
  33. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.d.ts +4 -0
  34. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.js +38 -0
  35. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.js.map +1 -0
  36. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-nodes-audit-list.d.ts +2 -0
  37. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-nodes-audit-list.js +14 -0
  38. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-nodes-audit-list.js.map +1 -0
  39. package/src/runtime/vendor/flywheel-cli-dist/commands/enums.d.ts +6 -0
  40. package/src/runtime/vendor/flywheel-cli-dist/commands/enums.js +3 -0
  41. package/src/runtime/vendor/flywheel-cli-dist/commands/enums.js.map +1 -1
  42. package/src/runtime/vendor/flywheel-cli-dist/commands/env.d.ts +0 -4
  43. package/src/runtime/vendor/flywheel-cli-dist/commands/env.js +7 -12
  44. package/src/runtime/vendor/flywheel-cli-dist/commands/env.js.map +1 -1
  45. package/src/runtime/vendor/flywheel-cli-dist/commands/export-history.js +40 -30
  46. package/src/runtime/vendor/flywheel-cli-dist/commands/export-history.js.map +1 -1
  47. package/src/runtime/vendor/flywheel-cli-dist/commands/help.d.ts +2 -0
  48. package/src/runtime/vendor/flywheel-cli-dist/commands/help.js +60 -10
  49. package/src/runtime/vendor/flywheel-cli-dist/commands/help.js.map +1 -1
  50. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-create.d.ts +2 -0
  51. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-create.js +25 -0
  52. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-create.js.map +1 -0
  53. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-delete.d.ts +1 -0
  54. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-delete.js +6 -0
  55. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-delete.js.map +1 -0
  56. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-list.d.ts +2 -0
  57. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-list.js +10 -0
  58. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-list.js.map +1 -0
  59. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-runs-list.d.ts +2 -0
  60. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-runs-list.js +15 -0
  61. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-runs-list.js.map +1 -0
  62. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-create.d.ts +2 -0
  63. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-create.js +8 -0
  64. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-create.js.map +1 -0
  65. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-delete.d.ts +1 -0
  66. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-delete.js +6 -0
  67. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-delete.js.map +1 -0
  68. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-list.d.ts +1 -0
  69. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-list.js +6 -0
  70. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-list.js.map +1 -0
  71. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-update.d.ts +2 -0
  72. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-update.js +8 -0
  73. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-update.js.map +1 -0
  74. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-set-enabled.d.ts +2 -0
  75. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-set-enabled.js +8 -0
  76. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-set-enabled.js.map +1 -0
  77. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-update.d.ts +2 -0
  78. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-update.js +29 -0
  79. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-update.js.map +1 -0
  80. package/src/runtime/vendor/flywheel-cli-dist/commands/index.js +32 -6
  81. package/src/runtime/vendor/flywheel-cli-dist/commands/index.js.map +1 -1
  82. package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js +4 -2
  83. package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js.map +1 -1
  84. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.d.ts +8 -0
  85. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js +118 -0
  86. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js.map +1 -0
  87. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js +2 -2
  88. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js.map +1 -1
  89. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/env.js +7 -5
  90. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/env.js.map +1 -1
  91. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hooks.d.ts +2 -0
  92. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hooks.js +244 -0
  93. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hooks.js.map +1 -0
  94. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js +1 -16
  95. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js.map +1 -1
  96. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js +2 -2
  97. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js.map +1 -1
  98. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.js +1 -31
  99. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.js.map +1 -1
  100. package/src/runtime/vendor/flywheel-cli-dist/commands/registry.d.ts +2 -1
  101. package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js +4 -0
  102. package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js.map +1 -1
  103. package/src/runtime/vendor/flywheel-cli-dist/main.js +1 -1
  104. package/src/runtime/vendor/flywheel-cli-dist/main.js.map +1 -1
  105. package/src/runtime/vendor/manifest.json +61 -10
  106. package/src/setup/io/patchers/json.mjs +2 -0
  107. package/src/setup/io/patchers/toml.mjs +7 -1
  108. package/src/setup/io/patchers/yaml.mjs +2 -0
  109. package/src/setup/modes/cli.mjs +41 -16
  110. package/src/setup/modes/mcp-command.mjs +98 -19
  111. package/src/setup/modes/mcp.mjs +26 -1
  112. package/src/setup/shared/prior-mode-detect.mjs +133 -14
  113. package/src/skill-installer.mjs +179 -1
  114. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-get.d.ts +0 -1
  115. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-get.js +0 -6
  116. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-get.js.map +0 -1
  117. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-set.d.ts +0 -2
  118. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-set.js.map +0 -1
  119. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-audit-list.d.ts +0 -2
  120. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-audit-list.js +0 -7
  121. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-audit-list.js.map +0 -1
@@ -166,6 +166,86 @@ export async function resolveMcpPath(candidates) {
166
166
  return candidates[0];
167
167
  }
168
168
 
169
+ /**
170
+ * Extract the remote endpoint URL from an MCP server entry, regardless of
171
+ * which transport key the host uses.
172
+ *
173
+ * MCP host config schemas diverge on the JSON key: most (Claude Code, Cursor,
174
+ * OpenCode, Pi, OpenClaw, Codex TOML, Hermes YAML) use `url`, while Gemini
175
+ * CLI's `settings.json` uses `httpUrl` for HTTP streaming endpoints and
176
+ * reserves `url` for SSE. Idempotent setup, uninstall enumeration, and
177
+ * prior-mode detection all need to recognize an existing Flywheel entry no
178
+ * matter which key the host writes — without this, writing `httpUrl` on one
179
+ * run and reading only `url` on the next reclassifies the live entry as
180
+ * missing/drifted and breaks reruns.
181
+ *
182
+ * Precedence is `httpUrl` before `url`: Flywheel's canonical Gemini writer
183
+ * (see `src/agents.mjs` gemini.buildEntry) emits `httpUrl` for the
184
+ * Streamable-HTTP transport, and a config that carries both keys is most
185
+ * plausibly one where `url` is a legacy-SSE leftover alongside the managed
186
+ * HTTP endpoint. Reading `url` first in that case would surface the stale
187
+ * secondary endpoint and misreport drift. For hosts that only ever set `url`,
188
+ * the `httpUrl`-first check is a no-op.
189
+ *
190
+ * Returns null when no recognizable URL key is present.
191
+ */
192
+ export function readEntryServerUrl(entry) {
193
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
194
+ return null;
195
+ }
196
+ // Empty / whitespace-only strings are placeholder shapes (half-populated
197
+ // host writers, hand-edited configs). Returning "" from here would satisfy
198
+ // downstream `typeof === "string"` checks but break equality comparisons in
199
+ // idempotent setup, drift detection, and uninstall enumeration — the live
200
+ // entry would be misclassified as missing. Only non-blank strings count.
201
+ //
202
+ // Trim-and-return-trimmed: callers compare the result against a canonical
203
+ // target via strict equality. Returning the raw field would re-introduce
204
+ // the false mismatch on hand-edited configs that carry leading/trailing
205
+ // whitespace or a trailing newline around the value.
206
+ const httpUrl = typeof entry.httpUrl === "string" ? entry.httpUrl.trim() : "";
207
+ if (httpUrl.length > 0) {
208
+ return httpUrl;
209
+ }
210
+ const url = typeof entry.url === "string" ? entry.url.trim() : "";
211
+ if (url.length > 0) {
212
+ return url;
213
+ }
214
+ return null;
215
+ }
216
+
217
+ /**
218
+ * Canonical auth mode of an MCP server entry.
219
+ *
220
+ * Every host's `buildEntry` in `src/agents.mjs` places a single signal on the
221
+ * entry when an API key was minted: a `headers.Authorization` string (Bearer
222
+ * token). OAuth-mode entries omit the header entirely and expect the IDE to
223
+ * run the MCP 2.0 OAuth discovery flow. So the presence/absence of that
224
+ * header is the authoritative auth-mode marker across JSON/YAML hosts.
225
+ *
226
+ * Returns `"api-key"` when the Bearer header is present, `"oauth"` otherwise
227
+ * (including for null / non-object entries). The writer uses this to decide
228
+ * whether an in-place entry must be rewritten when a rerun toggles auth
229
+ * mode (e.g. `flywheel setup --oauth` on a host previously bootstrapped with
230
+ * `--api-key`) — without this check the name-only "already exists" short
231
+ * circuit would leave the stale Authorization header behind.
232
+ */
233
+ export function readEntryAuthMode(entry) {
234
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
235
+ return "oauth";
236
+ }
237
+ const headers = entry.headers;
238
+ if (
239
+ headers &&
240
+ typeof headers === "object" &&
241
+ !Array.isArray(headers) &&
242
+ typeof headers.Authorization === "string"
243
+ ) {
244
+ return "api-key";
245
+ }
246
+ return "oauth";
247
+ }
248
+
169
249
  function keyPath(configKey) {
170
250
  return Array.isArray(configKey) ? configKey : [configKey];
171
251
  }
@@ -223,11 +303,31 @@ function writeConfigSection(config, configKey, section) {
223
303
  return root;
224
304
  }
225
305
 
226
- export function mergeServerEntry(existing, configKey, serverName, entry) {
306
+ export function mergeServerEntry(
307
+ existing,
308
+ configKey,
309
+ serverName,
310
+ entry,
311
+ { enforceAuthMode = false } = {},
312
+ ) {
227
313
  const section = readConfigSection(existing, configKey);
228
314
 
229
315
  if (serverName in section) {
230
- return { config: existing, alreadyExists: true };
316
+ // `enforceAuthMode` is opt-in and signals that the caller holds explicit
317
+ // auth intent (`--oauth` or `--api-key ...` on the command line). Only
318
+ // then do we reclassify on auth-mode mismatch and rewrite: the caller
319
+ // explicitly wants the Authorization header added or removed. Without
320
+ // that signal, setup is in the idempotent "re-run with no auth flags"
321
+ // mode and must preserve the existing entry byte-for-byte — otherwise
322
+ // a benign rerun would wipe the minted bearer key, because the ambient
323
+ // rebuild path constructs a headerless entry (apiKey omitted when the
324
+ // CLI did not resolve a new key).
325
+ if (
326
+ !enforceAuthMode ||
327
+ readEntryAuthMode(section[serverName]) === readEntryAuthMode(entry)
328
+ ) {
329
+ return { config: existing, alreadyExists: true };
330
+ }
231
331
  }
232
332
 
233
333
  return {
@@ -267,15 +367,18 @@ export async function readTomlServerEntry(filePath, serverName) {
267
367
  try {
268
368
  raw = await readFile(filePath, "utf8");
269
369
  } catch {
270
- return { exists: false, url: null };
370
+ return { exists: false, url: null, authMode: "oauth" };
271
371
  }
272
372
 
273
373
  const normalized = normalizeLineEndings(raw);
274
374
  const lines = normalized.split("\n");
275
375
  const targetSection = `mcp_servers.${serverName}`;
376
+ const headersSection = `${targetSection}.http_headers`;
276
377
  let inTargetSection = false;
378
+ let inHeadersSection = false;
277
379
  let exists = false;
278
380
  let url = null;
381
+ let hasAuthorizationHeader = false;
279
382
 
280
383
  for (const line of lines) {
281
384
  const trimmed = line.trim();
@@ -285,27 +388,57 @@ export async function readTomlServerEntry(filePath, serverName) {
285
388
  if (sectionName === targetSection) {
286
389
  exists = true;
287
390
  inTargetSection = true;
391
+ inHeadersSection = false;
288
392
  continue;
289
393
  }
290
394
 
291
- if (exists && !sectionName.startsWith(`${targetSection}.`)) {
292
- break;
395
+ if (sectionName === headersSection) {
396
+ // The http_headers block is a nested child of the parent
397
+ // `[mcp_servers.<name>]` section. Its presence alone does NOT imply a
398
+ // usable entry exists — a partially-edited config can leave the
399
+ // child behind after the parent is deleted, and treating the orphan
400
+ // as "exists" would make appendTomlServer short-circuit and refuse
401
+ // to recreate the missing parent block on the next setup rerun. Only
402
+ // the parent header toggles `exists`; here we just capture the
403
+ // headers subsection for auth-mode detection.
404
+ inTargetSection = false;
405
+ inHeadersSection = true;
406
+ continue;
293
407
  }
294
408
 
409
+ // Never break out of the scan loop: TOML permits declaring tables in
410
+ // any order, so `[mcp_servers.<name>.http_headers]` is free to appear
411
+ // after an unrelated intermediate table. Breaking at the first
412
+ // non-target sibling would miss the headers subsection in that
413
+ // layout, causing auth-mode misclassification (oauth when the entry
414
+ // actually carries a Bearer header) and silently defeating the
415
+ // enforceAuthMode contract on `--oauth` reruns.
295
416
  inTargetSection = false;
417
+ inHeadersSection = false;
296
418
  continue;
297
419
  }
298
420
 
299
- if (!inTargetSection) continue;
300
-
301
- const withoutComment = stripTomlInlineComment(trimmed);
302
- const urlMatch = withoutComment.match(/^url\s*=\s*(.+)$/);
303
- if (!urlMatch) continue;
421
+ if (inTargetSection) {
422
+ const withoutComment = stripTomlInlineComment(trimmed);
423
+ const urlMatch = withoutComment.match(/^url\s*=\s*(.+)$/);
424
+ if (urlMatch) {
425
+ url = parseTomlStringValue(urlMatch[1]);
426
+ }
427
+ }
304
428
 
305
- url = parseTomlStringValue(urlMatch[1]);
429
+ if (inHeadersSection) {
430
+ const withoutComment = stripTomlInlineComment(trimmed);
431
+ if (/^Authorization\s*=\s*/.test(withoutComment)) {
432
+ hasAuthorizationHeader = true;
433
+ }
434
+ }
306
435
  }
307
436
 
308
- return { exists, url };
437
+ return {
438
+ exists,
439
+ url,
440
+ authMode: hasAuthorizationHeader ? "api-key" : "oauth",
441
+ };
309
442
  }
310
443
 
311
444
  export function buildTomlServerBlock(serverName, entry) {
@@ -331,13 +464,25 @@ export function buildTomlServerBlock(serverName, entry) {
331
464
  return `${lines.join("\n")}\n`;
332
465
  }
333
466
 
334
- export async function appendTomlServer(filePath, serverName, entry) {
335
- if (await readTomlServerExists(filePath, serverName)) {
336
- return { alreadyExists: true };
467
+ export async function appendTomlServer(
468
+ filePath,
469
+ serverName,
470
+ entry,
471
+ { enforceAuthMode = false } = {},
472
+ ) {
473
+ const existingEntry = await readTomlServerEntry(filePath, serverName);
474
+ const newAuthMode = readEntryAuthMode(entry);
475
+
476
+ if (existingEntry.exists) {
477
+ // Mirror `mergeServerEntry`'s `enforceAuthMode` contract: preserve the
478
+ // existing block on passive reruns, and only reconcile the Authorization
479
+ // header when the caller explicitly toggled auth mode via `--oauth` or
480
+ // `--api-key`.
481
+ if (!enforceAuthMode || existingEntry.authMode === newAuthMode) {
482
+ return { alreadyExists: true };
483
+ }
337
484
  }
338
485
 
339
- const block = buildTomlServerBlock(serverName, entry);
340
-
341
486
  let existing = "";
342
487
  try {
343
488
  existing = await readFile(filePath, "utf8");
@@ -345,6 +490,25 @@ export async function appendTomlServer(filePath, serverName, entry) {
345
490
  existing = "";
346
491
  }
347
492
 
493
+ // Always strip before appending on the write path. Two cases motivate an
494
+ // unconditional strip:
495
+ // 1. Auth-mode toggle (api-key ↔ oauth) with the parent section present:
496
+ // without this, the prior block stays and we'd produce duplicate
497
+ // `[mcp_servers.<name>]` sections.
498
+ // 2. Partially-edited config with an orphan
499
+ // `[mcp_servers.<name>.http_headers]` subsection but no parent: the
500
+ // orphan would otherwise coexist with the freshly-appended parent,
501
+ // carrying stale Authorization headers into the rewritten entry.
502
+ // `stripCodexTomlServerBlock` is a no-op when neither the parent nor any
503
+ // child is present (returns `removed: false`), so it is safe to call
504
+ // unconditionally on the append path.
505
+ const { stripped } = stripCodexTomlServerBlock({
506
+ tomlText: existing,
507
+ serverName,
508
+ });
509
+ existing = stripped;
510
+
511
+ const block = buildTomlServerBlock(serverName, entry);
348
512
  const separator =
349
513
  existing.length > 0 && !existing.endsWith("\n")
350
514
  ? "\n\n"
@@ -389,6 +553,15 @@ function stripCodexTomlServerBlock({ tomlText, serverName }) {
389
553
  }
390
554
  }
391
555
 
556
+ // Lossless when nothing matched: callers invoke this on the append path
557
+ // unconditionally, and the compaction below (blank-line collapsing +
558
+ // trimEnd + trailing newline) would otherwise mutate unrelated TOML —
559
+ // most notably the blank lines inside multiline `"""..."""` values and
560
+ // any trailing whitespace a user deliberately kept.
561
+ if (!removed) {
562
+ return { stripped: tomlText || "", removed: false };
563
+ }
564
+
392
565
  let stripped = output.join("\n");
393
566
  stripped = stripped.replace(/\n{3,}/g, "\n\n").trimEnd();
394
567
  if (stripped.length > 0) stripped += "\n";
@@ -25,7 +25,6 @@
25
25
  "nodes:sharing:set-bulk",
26
26
  "nodes:sharing:summaries",
27
27
  "nodes:resolve-slug",
28
- "nodes:audit:list",
29
28
  "nodes:render:ancestry",
30
29
  "nodes:render:summary",
31
30
  "nodes:add-parent",
@@ -45,6 +44,16 @@
45
44
  "artifacts:upload",
46
45
  "artifacts:delete",
47
46
  "artifacts:note:set",
47
+ "hooks:list",
48
+ "hooks:create",
49
+ "hooks:update",
50
+ "hooks:delete",
51
+ "hooks:set-enabled",
52
+ "hooks:runs:list",
53
+ "hooks:secrets:list",
54
+ "hooks:secrets:create",
55
+ "hooks:secrets:update",
56
+ "hooks:secrets:delete",
48
57
  "compute:options",
49
58
  "compute:funding",
50
59
  "compute:connection",
@@ -68,6 +77,12 @@
68
77
  "export:summary:stream",
69
78
  "export:summary:pdf",
70
79
  "export:summary:render-pdf",
80
+ "admin:graphs:list",
81
+ "admin:graphs:export",
82
+ "admin:graphs:export:stream",
83
+ "admin:compute:policy:get",
84
+ "admin:compute:policy:set",
85
+ "admin:nodes:audit:list",
71
86
  "updates:list",
72
87
  "updates:hide",
73
88
  "updates:hide-all-active",
@@ -106,12 +121,10 @@
106
121
  "blobs:get",
107
122
  "files:list",
108
123
  "export:history",
109
- "compute:policy:get",
110
- "compute:policy:set",
111
124
  "compute:budgets",
112
125
  "machines:list",
113
126
  "auth:keychain:set",
114
127
  "auth:keychain:clear",
115
128
  "env:list",
116
129
  "env:switch"
117
- ]
130
+ ]
@@ -19,5 +19,6 @@ export interface AuthLoginResult {
19
19
  key_id: string | null;
20
20
  exit_code: 0 | 1 | 3;
21
21
  }
22
+ export declare function formatDenyStdout(): string;
22
23
  export declare function runAuthLogin(args: AuthLoginArgs): Promise<AuthLoginResult>;
23
24
  export {};
@@ -158,16 +158,13 @@ function readFlag(params, key) {
158
158
  const value = params[key];
159
159
  return value === true || value === 'true';
160
160
  }
161
- function formatDenyStdout() {
161
+ export function formatDenyStdout() {
162
162
  return [
163
163
  '',
164
164
  ' ✖ Authorization denied.',
165
165
  '',
166
- ' Your identity is not authorized for staging access.',
167
- ' Staging is limited to Paradigma engineers and approved beta users.',
168
- '',
169
- ' To request access, see docs/flywheel/CLI_STAGING_ACCESS.md',
170
- ' (internal) or contact the staging-access owner listed there.',
166
+ ' Your identity is not on the Flywheel access allowlist.',
167
+ ' If you believe this is an error, contact Paradigma support.',
171
168
  '',
172
169
  ].join('\n');
173
170
  }
@@ -1 +1 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GAEtB,MAAM,eAAe,CAAC;AA6CvB,SAAS,kBAAkB,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7D,MAAM,SAAS,GAAG,KAAsB,CAAC;IACzC,IAAI,OAAO,SAAS,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,gBAAgB,CACvB,WAA0B;IAE1B,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,SAAS,CAAC;IACtD,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,CAAC;YACL,CAAC;YACD,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACvC,KAAK,CAAC,wBAAwB,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;YACnD,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;QAC/C,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -15,6 +15,7 @@
15
15
  */
16
16
  export interface BuiltinProfile {
17
17
  baseUrl: string;
18
+ hidden?: boolean;
18
19
  }
19
20
  export declare const BUILTIN_PROFILES: {
20
21
  readonly prod: BuiltinProfile;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  export const BUILTIN_PROFILES = {
17
17
  prod: { baseUrl: 'https://flywheel.paradigma.inc/api' },
18
- staging: { baseUrl: 'https://flywheel-staging.paradigma.inc/api' },
18
+ staging: { baseUrl: 'https://flywheel-staging.paradigma.inc/api', hidden: true },
19
19
  };
20
20
  export const BUILTIN_PROFILE_NAMES = Object.freeze(Object.keys(BUILTIN_PROFILES));
21
21
  export function isBuiltinProfileName(name) {
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/auth/profiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,MAAM,CAAC,MAAM,gBAAgB,GAGzB;IACF,IAAI,EAAE,EAAE,OAAO,EAAE,oCAAoC,EAAE;IACvD,OAAO,EAAE,EAAE,OAAO,EAAE,4CAA4C,EAAE;CACnE,CAAC;AAIF,MAAM,CAAC,MAAM,qBAAqB,GAAkC,MAAM,CAAC,MAAM,CAC/E,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAyB,CACtD,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC"}
1
+ {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/auth/profiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,MAAM,CAAC,MAAM,gBAAgB,GAGzB;IACF,IAAI,EAAE,EAAE,OAAO,EAAE,oCAAoC,EAAE;IACvD,OAAO,EAAE,EAAE,OAAO,EAAE,4CAA4C,EAAE,MAAM,EAAE,IAAI,EAAE;CACjF,CAAC;AAIF,MAAM,CAAC,MAAM,qBAAqB,GAAkC,MAAM,CAAC,MAAM,CAC/E,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAyB,CACtD,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { RequestOptions } from './types.js';
2
+ /**
3
+ * Build the admin-only auth overlay for `RequestOptions` from the
4
+ * ``FLYWHEEL_ADMIN_KEY`` env var and the caller's configured bearer.
5
+ *
6
+ * Shared by every CLI command that targets an ``/admin/*`` HTTP route.
7
+ * The overlay:
8
+ *
9
+ * 1. Sends the env value as the ``X-Admin-Key`` header (consumed by
10
+ * ``require_paradigma_admin`` on the server).
11
+ * 2. Sets ``skipAuth: true`` ONLY when the caller's configured bearer
12
+ * looks like a Flywheel API key (``fwk_*``). The server's
13
+ * ``get_current_user`` runs before ``require_paradigma_admin`` and
14
+ * rejects API-key bearers for routes not in the API-key allowlist;
15
+ * ``/admin/*`` is intentionally excluded from that allowlist, so
16
+ * that 403 would fire before the admin-key header could be seen.
17
+ * Suppressing the bearer ONLY for API-key bearers keeps JWT bearers
18
+ * (``@paradigma.inc`` browser-login sessions) intact — user-bound
19
+ * admin routes (e.g. ``/admin/dev/*``) still require the
20
+ * authenticated user identity those JWTs carry.
21
+ *
22
+ * When the env var is unset, returns an empty overlay so the bearer
23
+ * chain (JWT or API key) flows through untouched.
24
+ */
25
+ export declare function adminAuthRequestOptions(apiKey?: string): Pick<RequestOptions, 'extraHeaders' | 'skipAuth'>;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Build the admin-only auth overlay for `RequestOptions` from the
3
+ * ``FLYWHEEL_ADMIN_KEY`` env var and the caller's configured bearer.
4
+ *
5
+ * Shared by every CLI command that targets an ``/admin/*`` HTTP route.
6
+ * The overlay:
7
+ *
8
+ * 1. Sends the env value as the ``X-Admin-Key`` header (consumed by
9
+ * ``require_paradigma_admin`` on the server).
10
+ * 2. Sets ``skipAuth: true`` ONLY when the caller's configured bearer
11
+ * looks like a Flywheel API key (``fwk_*``). The server's
12
+ * ``get_current_user`` runs before ``require_paradigma_admin`` and
13
+ * rejects API-key bearers for routes not in the API-key allowlist;
14
+ * ``/admin/*`` is intentionally excluded from that allowlist, so
15
+ * that 403 would fire before the admin-key header could be seen.
16
+ * Suppressing the bearer ONLY for API-key bearers keeps JWT bearers
17
+ * (``@paradigma.inc`` browser-login sessions) intact — user-bound
18
+ * admin routes (e.g. ``/admin/dev/*``) still require the
19
+ * authenticated user identity those JWTs carry.
20
+ *
21
+ * When the env var is unset, returns an empty overlay so the bearer
22
+ * chain (JWT or API key) flows through untouched.
23
+ */
24
+ export function adminAuthRequestOptions(apiKey) {
25
+ const key = process.env.FLYWHEEL_ADMIN_KEY;
26
+ if (typeof key === 'string' && key.trim()) {
27
+ const bearerIsApiKey = typeof apiKey === 'string' && apiKey.startsWith('fwk_');
28
+ return {
29
+ extraHeaders: { 'X-Admin-Key': key.trim() },
30
+ ...(bearerIsApiKey ? { skipAuth: true } : {}),
31
+ };
32
+ }
33
+ return { extraHeaders: {} };
34
+ }
35
+ //# sourceMappingURL=_admin-auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_admin-auth.js","sourceRoot":"","sources":["../../src/commands/_admin-auth.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAe;IAEf,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IAC3C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;QAC1C,MAAM,cAAc,GAAG,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC/E,OAAO;YACL,YAAY,EAAE,EAAE,aAAa,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE;YAC3C,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9C,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { type WriteStream } from 'node:fs';
2
+ /**
3
+ * Lifecycle handle for an ``--out`` destination.
4
+ *
5
+ * ``stream`` is the open writable stream the caller feeds bytes into.
6
+ * The stream writes to a sibling ``.partial`` temp file, NOT the final
7
+ * destination, so an aborted run cannot clobber a previously-good file
8
+ * at ``outPath``.
9
+ *
10
+ * Callers MUST invoke exactly one of:
11
+ *
12
+ * * :func:`finalize` after the last successful write + stream close —
13
+ * atomically renames the temp over ``outPath`` on filesystems that
14
+ * support ``rename(2)`` semantics (all POSIX targets + Windows).
15
+ * * :func:`abort` on any failure path — best-effort removes the temp so
16
+ * a retry starts clean.
17
+ */
18
+ export interface OutputFileHandle {
19
+ readonly stream: WriteStream;
20
+ finalize(): Promise<void>;
21
+ abort(): Promise<void>;
22
+ }
23
+ /**
24
+ * Validate and open a writable destination for an ``--out`` path.
25
+ *
26
+ * Returns an :class:`OutputFileHandle` when ``outPath`` is a concrete
27
+ * filesystem path, or ``null`` when the caller is streaming to stdout
28
+ * (``outPath`` is absent or the literal ``"-"``).
29
+ *
30
+ * The handle is backed by a ``<outPath>.partial`` temp file opened in
31
+ * the same directory so the final ``rename`` is atomic (same
32
+ * filesystem). The temp file is fully opened (``"open"`` event
33
+ * resolved) before this function returns, so callers can still order
34
+ * this BEFORE dispatching an expensive server-side request — a bad
35
+ * destination raises a typed :class:`CliUsageError` without any
36
+ * network traffic, but the caller's previous ``outPath`` contents are
37
+ * never overwritten until ``finalize`` succeeds.
38
+ */
39
+ export declare function openWriteStreamOrFail(outPath: string | undefined): Promise<OutputFileHandle | null>;
@@ -0,0 +1,72 @@
1
+ import { createWriteStream } from 'node:fs';
2
+ import { rename, unlink } from 'node:fs/promises';
3
+ import { CliUsageError } from '../errors.js';
4
+ /**
5
+ * Validate and open a writable destination for an ``--out`` path.
6
+ *
7
+ * Returns an :class:`OutputFileHandle` when ``outPath`` is a concrete
8
+ * filesystem path, or ``null`` when the caller is streaming to stdout
9
+ * (``outPath`` is absent or the literal ``"-"``).
10
+ *
11
+ * The handle is backed by a ``<outPath>.partial`` temp file opened in
12
+ * the same directory so the final ``rename`` is atomic (same
13
+ * filesystem). The temp file is fully opened (``"open"`` event
14
+ * resolved) before this function returns, so callers can still order
15
+ * this BEFORE dispatching an expensive server-side request — a bad
16
+ * destination raises a typed :class:`CliUsageError` without any
17
+ * network traffic, but the caller's previous ``outPath`` contents are
18
+ * never overwritten until ``finalize`` succeeds.
19
+ */
20
+ export async function openWriteStreamOrFail(outPath) {
21
+ if (!outPath || outPath === '-') {
22
+ return null;
23
+ }
24
+ // Same-directory temp so the final ``rename`` stays on one filesystem
25
+ // and is therefore atomic. ``.partial`` is the conventional suffix
26
+ // used by curl / wget / aria2 / pip for in-flight downloads; it makes
27
+ // the intent obvious to anyone inspecting the directory mid-run.
28
+ const tmpPath = `${outPath}.partial`;
29
+ const candidate = createWriteStream(tmpPath);
30
+ try {
31
+ await new Promise((resolve, reject) => {
32
+ const onOpen = () => {
33
+ candidate.off('error', onError);
34
+ resolve();
35
+ };
36
+ const onError = (err) => {
37
+ candidate.off('open', onOpen);
38
+ reject(err);
39
+ };
40
+ candidate.once('open', onOpen);
41
+ candidate.once('error', onError);
42
+ });
43
+ }
44
+ catch (err) {
45
+ candidate.destroy();
46
+ // Best-effort cleanup in case ``createWriteStream`` managed to
47
+ // create the temp before failing (e.g. parent dir writable but then
48
+ // a later error). Swallow because the original open error is the
49
+ // message the caller actually needs.
50
+ await unlink(tmpPath).catch(() => undefined);
51
+ throw new CliUsageError(`cannot open --out=${outPath}: ${err.message}`);
52
+ }
53
+ let settled = false;
54
+ return {
55
+ stream: candidate,
56
+ async finalize() {
57
+ if (settled) {
58
+ return;
59
+ }
60
+ settled = true;
61
+ await rename(tmpPath, outPath);
62
+ },
63
+ async abort() {
64
+ if (settled) {
65
+ return;
66
+ }
67
+ settled = true;
68
+ await unlink(tmpPath).catch(() => undefined);
69
+ },
70
+ };
71
+ }
72
+ //# sourceMappingURL=_stream-file-out.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_stream-file-out.js","sourceRoot":"","sources":["../../src/commands/_stream-file-out.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAwB7C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAA2B;IAE3B,IAAI,CAAC,OA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AO;YACT,CAAC;YACD,OAAO,GAAG,IAAI,CAAC;YACf,MAAM,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC;QACD,KAAK,CAAC,KAAK;YACT,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO;YACT,CAAC;YACD,OAAO,GAAG,IAAI,CAAC;YACf,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { CommandHandler } from './types.js';
2
+ export declare const adminComputePolicyGetCommand: CommandHandler;
@@ -0,0 +1,10 @@
1
+ import { adminAuthRequestOptions } from './_admin-auth.js';
2
+ import { requiredString } from './utils.js';
3
+ export const adminComputePolicyGetCommand = async (context) => {
4
+ const nodeId = requiredString(context.params, 'node_id');
5
+ const options = {
6
+ ...adminAuthRequestOptions(context.apiKey),
7
+ };
8
+ return context.requestJson('GET', `/admin/nodes/${encodeURIComponent(nodeId)}/compute/policy`, options);
9
+ };
10
+ //# sourceMappingURL=admin-compute-policy-get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-compute-policy-get.js","sourceRoot":"","sources":["../../src/commands/admin-compute-policy-get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,4BAA4B,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAC5E,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACzD,MAAM,OAAO,GAAmB;QAC9B,GAAG,uBAAuB,CAAC,OAAO,CAAC,MAAM,CAAC;KAC3C,CAAC;IACF,OAAO,OAAO,CAAC,WAAW,CACxB,KAAK,EACL,gBAAgB,kBAAkB,CAAC,MAAM,CAAC,iBAAiB,EAC3D,OAAO,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { CommandHandler } from './types.js';
2
+ export declare const adminComputePolicySetCommand: CommandHandler;