@paradigma-inc/flywheel 0.1.73 → 0.1.77
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 +29 -0
- package/package.json +1 -1
- package/skills/flywheel/compute/managed-compute.md +1 -1
- package/skills/flywheel/references/INTERFACES.md +2 -1
- package/skills/flywheel/references/experiment-design-protocol.md +5 -5
- package/skills/flywheel/references/flywheel-cli-tool-map.md +1 -3
- package/skills/flywheel/references/flywheel-mcp-tool-map.md +5 -7
- package/skills/flywheel/usage-and-workflows/what-to-do-with-flywheel.md +2 -2
- package/skills/flywheel/web-ui/flywheel-webui-map.md +2 -3
- package/skills/flywheel/web-ui/the-flywheel-web-ui.md +1 -1
- package/skills/flywheel-auto/SKILL.md +9 -13
- package/skills/flywheel-auto/references/INTERFACES.md +2 -1
- package/skills/flywheel-auto/references/experiment-design-protocol.md +5 -5
- package/skills/flywheel-auto/references/flywheel-cli-tool-map.md +0 -2
- package/skills/flywheel-auto/references/flywheel-mcp-tool-map.md +4 -6
- package/skills/flywheel-lookahead/SKILL.md +7 -9
- package/skills/flywheel-lookahead/references/INTERFACES.md +2 -1
- package/skills/flywheel-lookahead/references/flywheel-cli-tool-map.md +0 -2
- package/skills/flywheel-lookahead/references/flywheel-mcp-tool-map.md +4 -6
- package/skills/flywheel-reproduce/SKILL.md +7 -8
- package/skills/flywheel-reproduce/references/INTERFACES.md +2 -1
- package/skills/flywheel-reproduce/references/experiment-design-protocol.md +5 -5
- package/skills/flywheel-reproduce/references/flywheel-cli-tool-map.md +0 -2
- package/skills/flywheel-reproduce/references/flywheel-mcp-tool-map.md +4 -6
- package/skills/flywheel-to-graph/SKILL.md +3 -4
- package/skills/flywheel-to-graph/references/INTERFACES.md +2 -1
- package/skills/flywheel-to-graph/references/flywheel-cli-tool-map.md +0 -2
- package/skills/flywheel-to-graph/references/flywheel-mcp-tool-map.md +4 -6
- package/skills/flywheel-tree/SKILL.md +1 -2
- package/skills/flywheel-tree/references/workflow.md +1 -5
- package/skills/flywheel-tree/scripts/render_tree.py +2 -23
- package/src/cli.mjs +55 -0
- package/src/completion.mjs +326 -0
- package/src/public-command-metadata.mjs +240 -0
- package/src/runtime/delegate.mjs +2 -2
- package/src/runtime/required-runtime-commands.json +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.js +0 -3
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.js +0 -3
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.d.ts +32 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.js +112 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.d.ts +2 -13
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.js +6 -128
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.js +0 -4
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-resolve-slug.js +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-resolve-slug.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js +1 -3
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js +0 -36
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.d.ts +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.js +342 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/main.js +129 -2
- package/src/runtime/vendor/flywheel-cli-dist/main.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/output/format.js +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/output/format.js.map +1 -1
- package/src/runtime/vendor/manifest.json +7 -7
- package/src/unified-cli.mjs +23 -46
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-hypothesis.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-hypothesis.js +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-hypothesis.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-insights.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-insights.js +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-insights.js.map +0 -1
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const PACKAGE_JSON_PATH = path.resolve(__dirname, "..", "package.json");
|
|
7
|
+
|
|
8
|
+
export const COMPLETION_SHELL_CHOICES = [
|
|
9
|
+
"bash",
|
|
10
|
+
"zsh",
|
|
11
|
+
"fish",
|
|
12
|
+
"powershell",
|
|
13
|
+
"nu",
|
|
14
|
+
"nushell",
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export const HELP_EXTRAS = [
|
|
18
|
+
{
|
|
19
|
+
group: "setup-admin",
|
|
20
|
+
name: "completion",
|
|
21
|
+
summary: "Generate shell completion scripts.",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
group: "setup-admin",
|
|
25
|
+
name: "setup",
|
|
26
|
+
summary: "Install Flywheel CLI + MCP + skills.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
group: "setup-admin",
|
|
30
|
+
name: "uninstall",
|
|
31
|
+
summary: "Uninstall Flywheel artifacts.",
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export const USAGE_EXTRAS = [
|
|
36
|
+
{
|
|
37
|
+
group: "setup-admin",
|
|
38
|
+
name: "completion",
|
|
39
|
+
summary: "Generate a shell completion script from the public Flywheel Usage spec",
|
|
40
|
+
endpoints: [],
|
|
41
|
+
args: [
|
|
42
|
+
{
|
|
43
|
+
name: "shell",
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Shell to generate completions for",
|
|
46
|
+
choices: COMPLETION_SHELL_CHOICES,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
required: [],
|
|
50
|
+
optional: [
|
|
51
|
+
{
|
|
52
|
+
name: "include-bash-completion-lib",
|
|
53
|
+
type: "boolean",
|
|
54
|
+
description: "Include Usage's bash completion library in bash output",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
examples: [
|
|
58
|
+
{
|
|
59
|
+
description: "Generate bash completions",
|
|
60
|
+
invocation: "flywheel completion bash",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
description: "Generate zsh completions",
|
|
64
|
+
invocation: "flywheel completion zsh",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
description: "Generate Nushell completions with the alias",
|
|
68
|
+
invocation: "flywheel completion nushell",
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
related: ["setup", "uninstall"],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
group: "setup-admin",
|
|
75
|
+
name: "setup",
|
|
76
|
+
summary: "Set up Flywheel for your AI coding host",
|
|
77
|
+
endpoints: [],
|
|
78
|
+
required: [],
|
|
79
|
+
optional: [
|
|
80
|
+
{ name: "claude", type: "boolean", description: "Set up for Claude Code" },
|
|
81
|
+
{ name: "cursor", type: "boolean", description: "Set up for Cursor" },
|
|
82
|
+
{ name: "universal", type: "boolean", description: "Set up for Universal (.agents/skills)" },
|
|
83
|
+
{ name: "antigravity", type: "boolean", description: "Set up for Antigravity (.agent/skills)" },
|
|
84
|
+
{ name: "opencode", type: "boolean", description: "Set up for OpenCode" },
|
|
85
|
+
{ name: "codex", type: "boolean", description: "Set up for Codex" },
|
|
86
|
+
{ name: "gemini", type: "boolean", description: "Set up for Gemini CLI" },
|
|
87
|
+
{ name: "pi-mono", type: "boolean", description: "Set up for Pi (pi-mono)" },
|
|
88
|
+
{ name: "hermes-agent", type: "boolean", description: "Set up for Hermes Agent" },
|
|
89
|
+
{ name: "openclaw", type: "boolean", description: "Set up for OpenClaw" },
|
|
90
|
+
{
|
|
91
|
+
name: "mode",
|
|
92
|
+
type: "string",
|
|
93
|
+
usage: "--mode <MODE>",
|
|
94
|
+
description: "Install mode: mcp | cli",
|
|
95
|
+
choices: ["mcp", "cli"],
|
|
96
|
+
},
|
|
97
|
+
{ name: "mcp", type: "boolean", description: "Alias for --mode mcp" },
|
|
98
|
+
{ name: "cli", type: "boolean", description: "Alias for --mode cli" },
|
|
99
|
+
{
|
|
100
|
+
name: "project",
|
|
101
|
+
type: "boolean",
|
|
102
|
+
usage: "-p --project",
|
|
103
|
+
description: "Configure for current project instead of globally",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "yes",
|
|
107
|
+
type: "boolean",
|
|
108
|
+
usage: "-y --yes",
|
|
109
|
+
description: "Skip confirmation prompts",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "api-key",
|
|
113
|
+
type: "string",
|
|
114
|
+
usage: "--api-key <KEY>",
|
|
115
|
+
description: "Use API key authentication",
|
|
116
|
+
},
|
|
117
|
+
{ name: "oauth", type: "boolean", description: "Use OAuth endpoint (IDE handles auth flow)" },
|
|
118
|
+
{ name: "install-skill", type: "boolean", description: "Install or refresh the bundled Flywheel skills" },
|
|
119
|
+
{ name: "skip-skill", type: "boolean", description: "Skip bundled skill installation (MCP-only setup)" },
|
|
120
|
+
{
|
|
121
|
+
name: "auth-mode",
|
|
122
|
+
type: "string",
|
|
123
|
+
usage: "--auth-mode <MODE>",
|
|
124
|
+
description: "API-key mint flow: auto | loopback | device",
|
|
125
|
+
default: "auto",
|
|
126
|
+
choices: ["auto", "loopback", "device"],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "base-url",
|
|
130
|
+
type: "string",
|
|
131
|
+
usage: "--base-url <URL>",
|
|
132
|
+
description: "Public Flywheel origin used for setup and MCP config",
|
|
133
|
+
},
|
|
134
|
+
{ name: "name", type: "string", usage: "--name <NAME>", description: "MCP server name" },
|
|
135
|
+
{ name: "force", type: "boolean", description: "Reconcile prior install mode automatically via uninstall" },
|
|
136
|
+
],
|
|
137
|
+
examples: [
|
|
138
|
+
{
|
|
139
|
+
description: "Install MCP wiring and bundled skills",
|
|
140
|
+
invocation: "npx --yes @paradigma-inc/flywheel setup --mode mcp --install-skill",
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
description: "Configure Codex MCP wiring without bundled skills",
|
|
144
|
+
invocation: "npx --yes @paradigma-inc/flywheel setup --mode mcp --skip-skill --codex --project",
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
description: "Install CLI-mode bundled skills for Codex",
|
|
148
|
+
invocation: "npx --yes @paradigma-inc/flywheel setup --mode cli --codex --project",
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
related: ["uninstall"],
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
group: "setup-admin",
|
|
155
|
+
name: "uninstall",
|
|
156
|
+
summary: "Remove Flywheel MCP entries and bundled skills from selected hosts",
|
|
157
|
+
endpoints: [],
|
|
158
|
+
required: [],
|
|
159
|
+
optional: [
|
|
160
|
+
{ name: "claude", type: "boolean", description: "Uninstall for Claude Code" },
|
|
161
|
+
{ name: "cursor", type: "boolean", description: "Uninstall for Cursor" },
|
|
162
|
+
{ name: "universal", type: "boolean", description: "Uninstall bundled skills from .agents/skills" },
|
|
163
|
+
{ name: "antigravity", type: "boolean", description: "Uninstall bundled skills from .agent/skills" },
|
|
164
|
+
{ name: "opencode", type: "boolean", description: "Uninstall for OpenCode" },
|
|
165
|
+
{ name: "codex", type: "boolean", description: "Uninstall for Codex" },
|
|
166
|
+
{ name: "gemini", type: "boolean", description: "Uninstall for Gemini CLI" },
|
|
167
|
+
{ name: "pi-mono", type: "boolean", description: "Uninstall for Pi (pi-mono)" },
|
|
168
|
+
{ name: "hermes-agent", type: "boolean", description: "Uninstall for Hermes Agent" },
|
|
169
|
+
{ name: "openclaw", type: "boolean", description: "Uninstall for OpenClaw" },
|
|
170
|
+
{
|
|
171
|
+
name: "hosts",
|
|
172
|
+
type: "string",
|
|
173
|
+
usage: "--hosts <LIST>",
|
|
174
|
+
description: "Comma-separated host list",
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "scope",
|
|
178
|
+
type: "string",
|
|
179
|
+
usage: "--scope <SCOPE>",
|
|
180
|
+
description: "all | global | project",
|
|
181
|
+
choices: ["all", "global", "project"],
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "name",
|
|
185
|
+
type: "string",
|
|
186
|
+
usage: "--name <NAME>",
|
|
187
|
+
description: "MCP server name to remove",
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: "yes",
|
|
191
|
+
type: "boolean",
|
|
192
|
+
usage: "-y --yes",
|
|
193
|
+
description: "Skip uninstall selection prompts",
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
examples: [
|
|
197
|
+
{
|
|
198
|
+
description: "Uninstall Codex project-scope artifacts",
|
|
199
|
+
invocation: "npx --yes @paradigma-inc/flywheel uninstall --codex --scope project",
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
description: "Uninstall selected hosts across all scopes",
|
|
203
|
+
invocation: "npx --yes @paradigma-inc/flywheel uninstall --hosts claude,codex --scope all --yes",
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
related: ["setup"],
|
|
207
|
+
},
|
|
208
|
+
];
|
|
209
|
+
|
|
210
|
+
export function helpExtrasArg() {
|
|
211
|
+
return `--_help_extras=${JSON.stringify(HELP_EXTRAS)}`;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function usageExtrasArg() {
|
|
215
|
+
return `--_usage_extras=${JSON.stringify(USAGE_EXTRAS)}`;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export function usageVersionArg(version) {
|
|
219
|
+
return `--_usage_version=${version}`;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
let cachedPackageVersion = null;
|
|
223
|
+
|
|
224
|
+
export async function loadPackageVersion() {
|
|
225
|
+
if (cachedPackageVersion !== null) {
|
|
226
|
+
return cachedPackageVersion;
|
|
227
|
+
}
|
|
228
|
+
try {
|
|
229
|
+
const raw = await readFile(PACKAGE_JSON_PATH, "utf8");
|
|
230
|
+
const parsed = JSON.parse(raw);
|
|
231
|
+
if (typeof parsed.version === "string" && parsed.version.trim()) {
|
|
232
|
+
cachedPackageVersion = parsed.version.trim();
|
|
233
|
+
return cachedPackageVersion;
|
|
234
|
+
}
|
|
235
|
+
} catch {
|
|
236
|
+
// Fall through to deterministic fallback.
|
|
237
|
+
}
|
|
238
|
+
cachedPackageVersion = "0.0.0";
|
|
239
|
+
return cachedPackageVersion;
|
|
240
|
+
}
|
package/src/runtime/delegate.mjs
CHANGED
|
@@ -12,10 +12,10 @@ const RUNTIME_ENTRY_PATH = path.join(
|
|
|
12
12
|
"runtime-entry.js",
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
export async function runRuntimeCli(argv) {
|
|
15
|
+
export async function runRuntimeCli(argv, dependencies = {}) {
|
|
16
16
|
const runtimeModule = await import(pathToFileURL(RUNTIME_ENTRY_PATH).href);
|
|
17
17
|
if (typeof runtimeModule.runCli !== "function") {
|
|
18
18
|
throw new Error("Runtime CLI entrypoint does not export runCli.");
|
|
19
19
|
}
|
|
20
|
-
return await runtimeModule.runCli(argv,
|
|
20
|
+
return await runtimeModule.runCli(argv, dependencies);
|
|
21
21
|
}
|
|
@@ -12,9 +12,6 @@ export const adminGraphsExportStreamCommand = async (context) => {
|
|
|
12
12
|
const tagId = optionalString(context.params, 'tag-id');
|
|
13
13
|
if (tagId !== undefined)
|
|
14
14
|
query['tag_id'] = tagId;
|
|
15
|
-
const kind = optionalString(context.params, 'kind');
|
|
16
|
-
if (kind !== undefined)
|
|
17
|
-
query['kind'] = kind;
|
|
18
15
|
const ownerUserId = optionalString(context.params, 'owner-user-id');
|
|
19
16
|
if (ownerUserId !== undefined)
|
|
20
17
|
query['owner_user_id'] = ownerUserId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-graphs-export-stream.js","sourceRoot":"","sources":["../../src/commands/admin-graphs-export-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAyB,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAyB,MAAM,qBAAqB,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,CAAC,MAAM,8BAA8B,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAC9E,sBAAsB,CAAC,OAAO,EAAE,4BAA4B,CAAC,CAAC;IAC9D,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,aAAa,CAAC,8CAA8C,CAAC,CAAC;IAC1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GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YACrD,IAAI,IAAI;gBAAE,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QAC9B,IAAI,IAAI;YAAE,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5B,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,WAAW,EAAE,CAAC;QACrB,IAAI,UAAU;YAAE,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;QACzC,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC9B,CAAC;iBAAM,CAAC;gBACN,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -12,9 +12,6 @@ export const adminGraphsListCommand = async (context) => {
|
|
|
12
12
|
const tagId = optionalString(context.params, 'tag-id');
|
|
13
13
|
if (tagId !== undefined)
|
|
14
14
|
query['tag_id'] = tagId;
|
|
15
|
-
const kind = optionalString(context.params, 'kind');
|
|
16
|
-
if (kind !== undefined)
|
|
17
|
-
query['kind'] = kind;
|
|
18
15
|
const ownerUserId = optionalString(context.params, 'owner-user-id');
|
|
19
16
|
if (ownerUserId !== undefined)
|
|
20
17
|
query['owner_user_id'] = ownerUserId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-graphs-list.js","sourceRoot":"","sources":["../../src/commands/admin-graphs-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE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,CAAC,eAAe,CAAC,GAAG,WAAW,CAAC;IACpE,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACrE,IAAI,YAAY,KAAK,SAAS;QAAE,KAAK,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC;IACtE,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACvE,IAAI,aAAa,KAAK,SAAS;QAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,aAAa,CAAC;IACzE,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACxD,IAAI,MAAM,KAAK,SAAS;QAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;IACnD,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1D,IAAI,QAAQ,KAAK,SAAS;QAAE,KAAK,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC;IAE1D,MAAM,OAAO,GAAmB;QAC9B,KAAK;QACL,GAAG,uBAAuB,CAAC,OAAO,CAAC,MAAM,CAAC;KAC3C,CAAC;IACF,OAAO,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type CommandExample, type CommandParam, type CommandTopicId } from './registry.js';
|
|
2
|
+
export interface PublicCommandMetadata {
|
|
3
|
+
name: string;
|
|
4
|
+
group: CommandTopicId;
|
|
5
|
+
summary: string;
|
|
6
|
+
endpoints?: ReadonlyArray<string>;
|
|
7
|
+
args?: ReadonlyArray<CommandParam>;
|
|
8
|
+
required?: ReadonlyArray<CommandParam>;
|
|
9
|
+
optional?: ReadonlyArray<CommandParam>;
|
|
10
|
+
examples?: ReadonlyArray<CommandExample>;
|
|
11
|
+
related?: ReadonlyArray<string>;
|
|
12
|
+
schema?: string;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface MetadataDiscoveryOptions {
|
|
16
|
+
internal: boolean;
|
|
17
|
+
adminDiscovery: boolean;
|
|
18
|
+
extras?: ReadonlyArray<PublicCommandMetadata>;
|
|
19
|
+
}
|
|
20
|
+
export type HelpExtra = PublicCommandMetadata;
|
|
21
|
+
export declare const TOPIC_ORDER: ReadonlyArray<{
|
|
22
|
+
id: CommandTopicId;
|
|
23
|
+
label: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare function isInternalMode(): boolean;
|
|
26
|
+
export declare function hasAdminDiscoveryCredential(): boolean;
|
|
27
|
+
export declare function normalizeCommandMetadata(metadata: PublicCommandMetadata): Required<Omit<PublicCommandMetadata, 'schema' | 'hidden'>> & Pick<PublicCommandMetadata, 'schema' | 'hidden'>;
|
|
28
|
+
export declare function isCommandDiscoverable(command: PublicCommandMetadata, internal: boolean, adminDiscovery: boolean): boolean;
|
|
29
|
+
export declare function collectHiddenCommandNames(internal: boolean, adminDiscovery: boolean): Set<string>;
|
|
30
|
+
export declare function filterRelated(related: ReadonlyArray<string>, hiddenNames: ReadonlySet<string>, internal: boolean, containingCommandIsHidden: boolean): string[];
|
|
31
|
+
export declare function commandMetadataShape(command: PublicCommandMetadata, hiddenNames: ReadonlySet<string>, internal: boolean): Record<string, unknown>;
|
|
32
|
+
export declare function collectCommandMetadata({ internal, adminDiscovery, extras, }: MetadataDiscoveryOptions): PublicCommandMetadata[];
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { MVP_COMMANDS, } from './registry.js';
|
|
2
|
+
export const TOPIC_ORDER = [
|
|
3
|
+
{ id: 'setup-admin', label: 'Setup/Admin Commands' },
|
|
4
|
+
{ id: 'auth', label: 'Auth Commands' },
|
|
5
|
+
{ id: 'profile', label: 'Profile Commands' },
|
|
6
|
+
{ id: 'nodes-graph', label: 'Nodes & Graph Commands' },
|
|
7
|
+
{ id: 'artifacts-files', label: 'Artifacts & Files Commands' },
|
|
8
|
+
{ id: 'hooks', label: 'Hooks Commands' },
|
|
9
|
+
{ id: 'compute-executions', label: 'Compute & Executions Commands' },
|
|
10
|
+
{ id: 'approvals-budgets', label: 'Approvals & Budgets Commands' },
|
|
11
|
+
{ id: 'export-import', label: 'Export/Import Commands' },
|
|
12
|
+
{ id: 'updates-resources', label: 'Updates & Resources Commands' },
|
|
13
|
+
{ id: 'account-credits', label: 'Account & Credits Commands' },
|
|
14
|
+
{ id: 'integrations', label: 'Integrations Commands' },
|
|
15
|
+
{ id: 'api-keys', label: 'API Keys Commands' },
|
|
16
|
+
{ id: 'admin', label: 'Admin Commands' },
|
|
17
|
+
];
|
|
18
|
+
export function isInternalMode() {
|
|
19
|
+
return process.env.FLYWHEEL_CLI_INTERNAL === '1';
|
|
20
|
+
}
|
|
21
|
+
export function hasAdminDiscoveryCredential() {
|
|
22
|
+
return Boolean(process.env.FLYWHEEL_ADMIN_KEY?.trim());
|
|
23
|
+
}
|
|
24
|
+
export function normalizeCommandMetadata(metadata) {
|
|
25
|
+
return {
|
|
26
|
+
name: metadata.name,
|
|
27
|
+
group: metadata.group,
|
|
28
|
+
summary: metadata.summary,
|
|
29
|
+
endpoints: [...(metadata.endpoints ?? [])],
|
|
30
|
+
args: [...(metadata.args ?? [])],
|
|
31
|
+
required: [...(metadata.required ?? [])],
|
|
32
|
+
optional: [...(metadata.optional ?? [])],
|
|
33
|
+
examples: [...(metadata.examples ?? [])],
|
|
34
|
+
related: [...(metadata.related ?? [])],
|
|
35
|
+
schema: metadata.schema,
|
|
36
|
+
hidden: metadata.hidden,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function paramMetadataShape(param) {
|
|
40
|
+
return {
|
|
41
|
+
name: param.name,
|
|
42
|
+
type: param.type,
|
|
43
|
+
description: param.description,
|
|
44
|
+
default: param.default ?? null,
|
|
45
|
+
choices: param.choices ? [...param.choices] : undefined,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function isCommandDiscoverable(command, internal, adminDiscovery) {
|
|
49
|
+
if (internal)
|
|
50
|
+
return true;
|
|
51
|
+
if (command.group === 'admin')
|
|
52
|
+
return adminDiscovery;
|
|
53
|
+
return !command.hidden;
|
|
54
|
+
}
|
|
55
|
+
export function collectHiddenCommandNames(internal, adminDiscovery) {
|
|
56
|
+
const names = new Set();
|
|
57
|
+
for (const command of MVP_COMMANDS) {
|
|
58
|
+
if (!isCommandDiscoverable(command, internal, adminDiscovery)) {
|
|
59
|
+
names.add(command.name);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return names;
|
|
63
|
+
}
|
|
64
|
+
export function filterRelated(related, hiddenNames, internal, containingCommandIsHidden) {
|
|
65
|
+
if (internal || containingCommandIsHidden)
|
|
66
|
+
return [...related];
|
|
67
|
+
return related.filter((name) => !hiddenNames.has(name));
|
|
68
|
+
}
|
|
69
|
+
export function commandMetadataShape(command, hiddenNames, internal) {
|
|
70
|
+
const normalized = normalizeCommandMetadata(command);
|
|
71
|
+
return {
|
|
72
|
+
name: normalized.name,
|
|
73
|
+
group: normalized.group,
|
|
74
|
+
summary: normalized.summary,
|
|
75
|
+
endpoints: normalized.endpoints,
|
|
76
|
+
args: normalized.args.map(paramMetadataShape),
|
|
77
|
+
required: normalized.required.map(paramMetadataShape),
|
|
78
|
+
optional: normalized.optional.map(paramMetadataShape),
|
|
79
|
+
examples: normalized.examples.map((e) => ({
|
|
80
|
+
description: e.description,
|
|
81
|
+
invocation: e.invocation,
|
|
82
|
+
})),
|
|
83
|
+
related: filterRelated(normalized.related, hiddenNames, internal, Boolean(normalized.hidden)),
|
|
84
|
+
schema: normalized.schema ?? null,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function commandToMetadata(command) {
|
|
88
|
+
return {
|
|
89
|
+
name: command.name,
|
|
90
|
+
group: command.group,
|
|
91
|
+
summary: command.summary,
|
|
92
|
+
endpoints: command.endpoints,
|
|
93
|
+
args: [],
|
|
94
|
+
required: command.required,
|
|
95
|
+
optional: command.optional,
|
|
96
|
+
examples: command.examples,
|
|
97
|
+
related: command.related,
|
|
98
|
+
schema: command.schema,
|
|
99
|
+
hidden: command.hidden,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export function collectCommandMetadata({ internal, adminDiscovery, extras = [], }) {
|
|
103
|
+
return [
|
|
104
|
+
...extras
|
|
105
|
+
.map(normalizeCommandMetadata)
|
|
106
|
+
.filter((extra) => isCommandDiscoverable(extra, internal, adminDiscovery)),
|
|
107
|
+
...MVP_COMMANDS
|
|
108
|
+
.filter((command) => isCommandDiscoverable(command, internal, adminDiscovery))
|
|
109
|
+
.map(commandToMetadata),
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=help-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-metadata.js","sourceRoot":"","sources":["../../src/commands/help-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAKb,MAAM,eAAe,CAAC;AAwBvB,MAAM,CAAC,MAAM,WAAW,GAAyD;IAC/E,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,sBAAsB,EAAE;IACpD,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE;IACtC,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE;IAC5C,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,wBAAwB,EAAE;IACtD,EAAE,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE,4BAA4B,EAAE;IAC9D,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACxC,EAAE,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,+BAA+B,EAAE;IACpE,EAAE,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE,8BAA8B,EAAE;I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AC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EACrC,QAAQ,EACR,cAAc,EACd,MAAM,GAAG,EAAE,GACc;IACzB,OAAO;QACL,GAAG,MAAM;aACN,GAAG,CAAC,wBAAwB,CAAC;aAC7B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;QAC5E,GAAG,YAAY;aACZ,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;aAC7E,GAAG,CAAC,iBAAiB,CAAC;KAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import { type HelpRenderOptions } from './help-format.js';
|
|
2
|
-
import { type
|
|
2
|
+
import { type HelpExtra } from './help-metadata.js';
|
|
3
|
+
export { hasAdminDiscoveryCredential, isInternalMode, TOPIC_ORDER, type HelpExtra, } from './help-metadata.js';
|
|
3
4
|
export interface RenderCommandHelpOptions {
|
|
4
5
|
schema?: boolean;
|
|
5
6
|
width?: number;
|
|
6
7
|
}
|
|
7
|
-
export interface HelpExtra {
|
|
8
|
-
group: CommandTopicId;
|
|
9
|
-
name: string;
|
|
10
|
-
summary: string;
|
|
11
|
-
hidden?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare function isInternalMode(): boolean;
|
|
14
|
-
export declare function hasAdminDiscoveryCredential(): boolean;
|
|
15
|
-
export declare const TOPIC_ORDER: ReadonlyArray<{
|
|
16
|
-
id: CommandTopicId;
|
|
17
|
-
label: string;
|
|
18
|
-
}>;
|
|
19
8
|
/**
|
|
20
9
|
* Serialise the full command surface as JSON for agent introspection
|
|
21
10
|
* (`flywheel help --format=json`). Shape is stable and additive: every
|
|
@@ -1,33 +1,9 @@
|
|
|
1
1
|
import { BUILTIN_PROFILES, BUILTIN_PROFILE_NAMES } from '../auth/profiles.js';
|
|
2
2
|
import { RUNTIME_ALIASES } from './aliases.js';
|
|
3
3
|
import { FLYWHEEL_MARK, renderDefinitionList, renderIndentedBlock, section, styles, normalizeTerminalWidth, } from './help-format.js';
|
|
4
|
-
import { getCommandByName,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// self-service discovery without rebuilding the CLI. Mirrors the Vercel
|
|
8
|
-
// `CUSTOM_ENVIRONMENTS=1` / Docker `DOCKER_HIDE_LEGACY_COMMANDS` pattern.
|
|
9
|
-
export function isInternalMode() {
|
|
10
|
-
return process.env.FLYWHEEL_CLI_INTERNAL === '1';
|
|
11
|
-
}
|
|
12
|
-
export function hasAdminDiscoveryCredential() {
|
|
13
|
-
return Boolean(process.env.FLYWHEEL_ADMIN_KEY?.trim());
|
|
14
|
-
}
|
|
15
|
-
export const TOPIC_ORDER = [
|
|
16
|
-
{ id: 'setup-admin', label: 'Setup/Admin Commands' },
|
|
17
|
-
{ id: 'auth', label: 'Auth Commands' },
|
|
18
|
-
{ id: 'profile', label: 'Profile Commands' },
|
|
19
|
-
{ id: 'nodes-graph', label: 'Nodes & Graph Commands' },
|
|
20
|
-
{ id: 'artifacts-files', label: 'Artifacts & Files Commands' },
|
|
21
|
-
{ id: 'hooks', label: 'Hooks Commands' },
|
|
22
|
-
{ id: 'compute-executions', label: 'Compute & Executions Commands' },
|
|
23
|
-
{ id: 'approvals-budgets', label: 'Approvals & Budgets Commands' },
|
|
24
|
-
{ id: 'export-import', label: 'Export/Import Commands' },
|
|
25
|
-
{ id: 'updates-resources', label: 'Updates & Resources Commands' },
|
|
26
|
-
{ id: 'account-credits', label: 'Account & Credits Commands' },
|
|
27
|
-
{ id: 'integrations', label: 'Integrations Commands' },
|
|
28
|
-
{ id: 'api-keys', label: 'API Keys Commands' },
|
|
29
|
-
{ id: 'admin', label: 'Admin Commands' },
|
|
30
|
-
];
|
|
4
|
+
import { getCommandByName, } from './registry.js';
|
|
5
|
+
import { collectCommandMetadata, collectHiddenCommandNames, commandMetadataShape, filterRelated, hasAdminDiscoveryCredential, isCommandDiscoverable, isInternalMode, TOPIC_ORDER, } from './help-metadata.js';
|
|
6
|
+
export { hasAdminDiscoveryCredential, isInternalMode, TOPIC_ORDER, } from './help-metadata.js';
|
|
31
7
|
function paramTypeToken(param) {
|
|
32
8
|
if (param.type === 'boolean')
|
|
33
9
|
return '';
|
|
@@ -51,91 +27,6 @@ function definitionTermWidth(width) {
|
|
|
51
27
|
function commandTermWidth(width) {
|
|
52
28
|
return Math.min(34, Math.max(24, Math.floor(width * 0.4)));
|
|
53
29
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Set of hidden command names derived from `MVP_COMMANDS`. Used to scrub
|
|
56
|
-
* hidden names from `related` arrays and rendered "SEE ALSO" blocks so a
|
|
57
|
-
* visible command cannot advertise a hidden sibling when the CLI is in
|
|
58
|
-
* default (non-internal) mode. Hiding is about discovery across the
|
|
59
|
-
* entire help surface, not just the top-level command list.
|
|
60
|
-
*/
|
|
61
|
-
function isCommandDiscoverable(command, internal, adminDiscovery) {
|
|
62
|
-
if (internal)
|
|
63
|
-
return true;
|
|
64
|
-
if (command.group === 'admin')
|
|
65
|
-
return adminDiscovery;
|
|
66
|
-
return !command.hidden;
|
|
67
|
-
}
|
|
68
|
-
function isExtraDiscoverable(extra, internal, adminDiscovery) {
|
|
69
|
-
if (internal)
|
|
70
|
-
return true;
|
|
71
|
-
if (extra.hidden)
|
|
72
|
-
return false;
|
|
73
|
-
if (extra.group === 'admin')
|
|
74
|
-
return adminDiscovery;
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
function collectHiddenCommandNames(internal, adminDiscovery) {
|
|
78
|
-
const names = new Set();
|
|
79
|
-
for (const command of MVP_COMMANDS) {
|
|
80
|
-
if (!isCommandDiscoverable(command, internal, adminDiscovery)) {
|
|
81
|
-
names.add(command.name);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return names;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* `related` filtering preserves the "hide discovery, not invocation"
|
|
88
|
-
* contract: when the containing command is visible, hidden names must
|
|
89
|
-
* not appear in its `related` list (they would leak hidden commands to
|
|
90
|
-
* anyone browsing the visible surface). When the containing command is
|
|
91
|
-
* itself hidden, the caller has already typed its name explicitly, so
|
|
92
|
-
* the full related list is returned — there is no incremental leak.
|
|
93
|
-
* Internal mode always returns the full list.
|
|
94
|
-
*/
|
|
95
|
-
function filterRelated(related, hiddenNames, internal, containingCommandIsHidden) {
|
|
96
|
-
if (internal || containingCommandIsHidden)
|
|
97
|
-
return [...related];
|
|
98
|
-
return related.filter((name) => !hiddenNames.has(name));
|
|
99
|
-
}
|
|
100
|
-
function commandMetadataShape(command, hiddenNames, internal) {
|
|
101
|
-
return {
|
|
102
|
-
name: command.name,
|
|
103
|
-
group: command.group,
|
|
104
|
-
summary: command.summary,
|
|
105
|
-
endpoints: command.endpoints,
|
|
106
|
-
required: command.required.map((p) => ({
|
|
107
|
-
name: p.name,
|
|
108
|
-
type: p.type,
|
|
109
|
-
description: p.description,
|
|
110
|
-
default: p.default ?? null,
|
|
111
|
-
})),
|
|
112
|
-
optional: command.optional.map((p) => ({
|
|
113
|
-
name: p.name,
|
|
114
|
-
type: p.type,
|
|
115
|
-
description: p.description,
|
|
116
|
-
default: p.default ?? null,
|
|
117
|
-
})),
|
|
118
|
-
examples: command.examples.map((e) => ({
|
|
119
|
-
description: e.description,
|
|
120
|
-
invocation: e.invocation,
|
|
121
|
-
})),
|
|
122
|
-
related: filterRelated(command.related, hiddenNames, internal, Boolean(command.hidden)),
|
|
123
|
-
schema: command.schema ?? null,
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function extraShape(extra) {
|
|
127
|
-
return {
|
|
128
|
-
name: extra.name,
|
|
129
|
-
group: extra.group,
|
|
130
|
-
summary: extra.summary,
|
|
131
|
-
endpoints: [],
|
|
132
|
-
required: [],
|
|
133
|
-
optional: [],
|
|
134
|
-
examples: [],
|
|
135
|
-
related: [],
|
|
136
|
-
schema: null,
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
30
|
/**
|
|
140
31
|
* Serialise the full command surface as JSON for agent introspection
|
|
141
32
|
* (`flywheel help --format=json`). Shape is stable and additive: every
|
|
@@ -146,14 +37,7 @@ export function renderHelpAsJson(extras = []) {
|
|
|
146
37
|
const internal = isInternalMode();
|
|
147
38
|
const adminDiscovery = hasAdminDiscoveryCredential();
|
|
148
39
|
const hiddenNames = collectHiddenCommandNames(internal, adminDiscovery);
|
|
149
|
-
const commands =
|
|
150
|
-
...extras
|
|
151
|
-
.filter((e) => isExtraDiscoverable(e, internal, adminDiscovery))
|
|
152
|
-
.map(extraShape),
|
|
153
|
-
...MVP_COMMANDS
|
|
154
|
-
.filter((c) => isCommandDiscoverable(c, internal, adminDiscovery))
|
|
155
|
-
.map((c) => commandMetadataShape(c, hiddenNames, internal)),
|
|
156
|
-
];
|
|
40
|
+
const commands = collectCommandMetadata({ internal, adminDiscovery, extras }).map((command) => commandMetadataShape(command, hiddenNames, internal));
|
|
157
41
|
return `${JSON.stringify({ commands })}\n`;
|
|
158
42
|
}
|
|
159
43
|
export function renderCommandHelpAsJson(commandName) {
|
|
@@ -171,14 +55,8 @@ function bucketByTopic(extras, internal, adminDiscovery) {
|
|
|
171
55
|
for (const { id } of TOPIC_ORDER) {
|
|
172
56
|
buckets.set(id, []);
|
|
173
57
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
continue;
|
|
177
|
-
buckets.get(extra.group)?.push({ name: extra.name, summary: extra.summary });
|
|
178
|
-
}
|
|
179
|
-
for (const command of MVP_COMMANDS) {
|
|
180
|
-
if (!isCommandDiscoverable(command, internal, adminDiscovery))
|
|
181
|
-
continue;
|
|
58
|
+
const commands = collectCommandMetadata({ internal, adminDiscovery, extras });
|
|
59
|
+
for (const command of commands) {
|
|
182
60
|
buckets.get(command.group)?.push({ name: command.name, summary: command.summary });
|
|
183
61
|
}
|
|
184
62
|
for (const entries of buckets.values()) {
|