bdy 1.25.2-stage → 1.25.3-dev
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/distTs/package.json +20 -19
- package/distTs/src/cliCommand.js +28 -0
- package/distTs/src/cliIndex.js +3 -1
- package/distTs/src/command/agent/tunnel/http.js +4 -3
- package/distTs/src/command/agent/tunnel/list.js +1 -2
- package/distTs/src/command/agent/tunnel/remove.js +1 -2
- package/distTs/src/command/agent/tunnel/start.js +1 -2
- package/distTs/src/command/agent/tunnel/status.js +1 -2
- package/distTs/src/command/agent/tunnel/tcp.js +4 -3
- package/distTs/src/command/agent/tunnel/tls.js +4 -3
- package/distTs/src/command/agent/tunnel.js +11 -8
- package/distTs/src/command/artifact/composer/publish.js +4 -2
- package/distTs/src/command/artifact/create.js +4 -2
- package/distTs/src/command/artifact/delete.js +4 -2
- package/distTs/src/command/artifact/docker.js +1 -1
- package/distTs/src/command/artifact/download.js +4 -2
- package/distTs/src/command/artifact/get.js +3 -1
- package/distTs/src/command/artifact/list.js +3 -1
- package/distTs/src/command/artifact/publish.js +4 -2
- package/distTs/src/command/artifact/version/create.js +4 -2
- package/distTs/src/command/artifact/version/delete.js +4 -2
- package/distTs/src/command/artifact/version/get.js +4 -2
- package/distTs/src/command/artifact/version/list.js +4 -2
- package/distTs/src/command/crawl/link.js +3 -2
- package/distTs/src/command/crawl/run.js +3 -2
- package/distTs/src/command/crawl.js +3 -4
- package/distTs/src/command/discover.js +34 -0
- package/distTs/src/command/distro/create.js +4 -2
- package/distTs/src/command/distro/delete.js +4 -2
- package/distTs/src/command/distro/get.js +4 -2
- package/distTs/src/command/distro/list.js +4 -2
- package/distTs/src/command/distro/route/create.js +4 -2
- package/distTs/src/command/distro/route/delete.js +4 -2
- package/distTs/src/command/distro/route/get.js +4 -2
- package/distTs/src/command/distro/route/list.js +4 -2
- package/distTs/src/command/distro/route/update.js +4 -2
- package/distTs/src/command/distro/route.js +9 -6
- package/distTs/src/command/distro/update.js +4 -2
- package/distTs/src/command/distro.js +14 -11
- package/distTs/src/command/environment/create.js +1 -2
- package/distTs/src/command/environment/delete.js +1 -2
- package/distTs/src/command/environment/get.js +3 -2
- package/distTs/src/command/environment/list.js +1 -2
- package/distTs/src/command/environment/update.js +1 -2
- package/distTs/src/command/mcp.js +3 -2
- package/distTs/src/command/pipeline/create.js +4 -2
- package/distTs/src/command/pipeline/delete.js +4 -2
- package/distTs/src/command/pipeline/get.js +4 -2
- package/distTs/src/command/pipeline/list.js +4 -2
- package/distTs/src/command/pipeline/run/approve.js +5 -3
- package/distTs/src/command/pipeline/run/cancel.js +5 -3
- package/distTs/src/command/pipeline/run/list.js +4 -2
- package/distTs/src/command/pipeline/run/logs.js +5 -3
- package/distTs/src/command/pipeline/run/retry.js +5 -3
- package/distTs/src/command/pipeline/run/start.js +5 -3
- package/distTs/src/command/pipeline/run/status.js +5 -3
- package/distTs/src/command/pipeline/run.js +11 -9
- package/distTs/src/command/pipeline/update.js +4 -2
- package/distTs/src/command/pipeline/yaml.js +4 -2
- package/distTs/src/command/pipeline.js +17 -15
- package/distTs/src/command/pre.js +2 -1
- package/distTs/src/command/sandbox/app/add.js +3 -2
- package/distTs/src/command/sandbox/app/list.js +1 -2
- package/distTs/src/command/sandbox/app/logs.js +1 -2
- package/distTs/src/command/sandbox/app/remove.js +1 -2
- package/distTs/src/command/sandbox/app/start.js +1 -2
- package/distTs/src/command/sandbox/app/status.js +1 -2
- package/distTs/src/command/sandbox/app/stop.js +1 -2
- package/distTs/src/command/sandbox/app.js +11 -9
- package/distTs/src/command/sandbox/cp.js +3 -2
- package/distTs/src/command/sandbox/create.js +3 -2
- package/distTs/src/command/sandbox/endpoint/add.js +1 -2
- package/distTs/src/command/sandbox/endpoint/delete.js +1 -2
- package/distTs/src/command/sandbox/endpoint/get.js +1 -2
- package/distTs/src/command/sandbox/endpoint/list.js +1 -2
- package/distTs/src/command/sandbox/endpoint.js +8 -5
- package/distTs/src/command/sandbox/exec/command.js +1 -2
- package/distTs/src/command/sandbox/exec/kill.js +1 -2
- package/distTs/src/command/sandbox/exec/list.js +1 -2
- package/distTs/src/command/sandbox/exec/logs.js +1 -2
- package/distTs/src/command/sandbox/exec/status.js +1 -2
- package/distTs/src/command/sandbox/exec.js +9 -6
- package/distTs/src/command/sandbox/snapshot/create.js +1 -2
- package/distTs/src/command/sandbox/snapshot/delete.js +1 -2
- package/distTs/src/command/sandbox/snapshot/get.js +1 -2
- package/distTs/src/command/sandbox/snapshot/list.js +1 -2
- package/distTs/src/command/sandbox/snapshot.js +8 -5
- package/distTs/src/command/sandbox/ssh.js +3 -2
- package/distTs/src/command/target/create.js +3 -2
- package/distTs/src/command/target/delete.js +3 -2
- package/distTs/src/command/target/exec/command.js +1 -2
- package/distTs/src/command/target/exec/kill.js +1 -2
- package/distTs/src/command/target/exec/list.js +1 -2
- package/distTs/src/command/target/exec/logs.js +1 -2
- package/distTs/src/command/target/exec/status.js +1 -2
- package/distTs/src/command/target/exec.js +9 -6
- package/distTs/src/command/target/get.js +3 -2
- package/distTs/src/command/target/list.js +3 -2
- package/distTs/src/command/target/update.js +3 -2
- package/distTs/src/command/tests/capture.js +3 -2
- package/distTs/src/command/tests/unit/link.js +3 -2
- package/distTs/src/command/tests/unit/upload.js +3 -2
- package/distTs/src/command/tests/unit.js +3 -4
- package/distTs/src/command/tests/visual/link.js +3 -2
- package/distTs/src/command/tests/visual/session/close.js +3 -2
- package/distTs/src/command/tests/visual/session/create.js +3 -2
- package/distTs/src/command/tests/visual/session.js +6 -4
- package/distTs/src/command/tests/visual/setup.js +3 -2
- package/distTs/src/command/tests/visual/upload.js +3 -2
- package/distTs/src/command/tests/visual.js +9 -7
- package/distTs/src/command/tests.js +12 -10
- package/distTs/src/command/tunnel/http.js +3 -2
- package/distTs/src/command/tunnel/start.js +3 -2
- package/distTs/src/command/tunnel/tcp.js +1 -2
- package/distTs/src/command/tunnel/tls.js +1 -2
- package/distTs/src/command/tunnel.js +8 -5
- package/distTs/src/command/version.js +2 -1
- package/distTs/src/command/yaml/actions/info.js +1 -2
- package/distTs/src/command/yaml/actions/list.js +1 -2
- package/distTs/src/command/yaml/actions.js +3 -4
- package/distTs/src/command/yaml/pipeline.js +3 -2
- package/distTs/src/command/yaml/validate.js +3 -2
- package/distTs/src/command/yaml.js +8 -6
- package/distTs/src/discovery.js +119 -0
- package/distTs/src/texts.js +1365 -736
- package/distTs/src/utils.js +46 -17
- package/package.json +20 -19
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.discoverCommands = exports.describeCommand = void 0;
|
|
7
|
+
const cliCommand_1 = __importDefault(require("./cliCommand"));
|
|
8
|
+
const texts_1 = require("./texts");
|
|
9
|
+
const sortedChildren = (command) => command
|
|
10
|
+
.createHelp()
|
|
11
|
+
.visibleCommands(command)
|
|
12
|
+
// Commander may append a synthetic help command. Only expose registered commands.
|
|
13
|
+
.filter((child) => command.commands.includes(child))
|
|
14
|
+
.sort((a, b) => (a.name() < b.name() ? -1 : a.name() > b.name() ? 1 : 0));
|
|
15
|
+
const commandPath = (command) => command.parent
|
|
16
|
+
? `${commandPath(command.parent)} ${command.name()}`
|
|
17
|
+
: command.name() || 'bdy';
|
|
18
|
+
const optionInfo = (option) => {
|
|
19
|
+
const value = option.flags.match(/[<[]([^>\]]+)[>\]]/)?.[1] ?? null;
|
|
20
|
+
// These are static documentation, never resolved values from opts(), env or config.
|
|
21
|
+
const env = option.envVar ??
|
|
22
|
+
option.description.match(/Can be set via variable:\s*([A-Z][A-Z0-9_]*)/)?.[1] ??
|
|
23
|
+
null;
|
|
24
|
+
const documentedDefault = option.description.match(/Default:\s*(.+)$/)?.[1] ?? null;
|
|
25
|
+
const choices = option.argChoices ??
|
|
26
|
+
(value &&
|
|
27
|
+
/^[A-Za-z][A-Za-z0-9_-]*(?:\|[A-Za-z][A-Za-z0-9_-]*)+$/.test(value)
|
|
28
|
+
? value.split('|')
|
|
29
|
+
: null);
|
|
30
|
+
return {
|
|
31
|
+
flags: option.flags,
|
|
32
|
+
short: option.short ?? null,
|
|
33
|
+
long: option.long ?? null,
|
|
34
|
+
description: option.description,
|
|
35
|
+
required: option.mandatory,
|
|
36
|
+
value: value
|
|
37
|
+
? {
|
|
38
|
+
name: value,
|
|
39
|
+
required: option.required,
|
|
40
|
+
variadic: !!option.variadic,
|
|
41
|
+
}
|
|
42
|
+
: null,
|
|
43
|
+
negated: option.negate,
|
|
44
|
+
choices,
|
|
45
|
+
default: option.defaultValue ?? null,
|
|
46
|
+
documented_default: documentedDefault,
|
|
47
|
+
env,
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const describeCommand = (command) => ({
|
|
51
|
+
command: commandPath(command),
|
|
52
|
+
aliases: command.aliases(),
|
|
53
|
+
description: command.description(),
|
|
54
|
+
usage: `${commandPath(command)} ${command.usage()}`.trim(),
|
|
55
|
+
arguments: command.registeredArguments.map((argument) => ({
|
|
56
|
+
name: argument.name(),
|
|
57
|
+
description: argument.description,
|
|
58
|
+
required: argument.required,
|
|
59
|
+
variadic: argument.variadic,
|
|
60
|
+
choices: argument.argChoices ?? null,
|
|
61
|
+
default: argument.defaultValue ?? null,
|
|
62
|
+
})),
|
|
63
|
+
options: command
|
|
64
|
+
.createHelp()
|
|
65
|
+
.visibleOptions(command)
|
|
66
|
+
.filter((option) => option.long !== '--help')
|
|
67
|
+
.map(optionInfo),
|
|
68
|
+
required_scopes: command instanceof cliCommand_1.default ? command.requiredScopes : null,
|
|
69
|
+
examples: command instanceof cliCommand_1.default ? command.examples : [],
|
|
70
|
+
});
|
|
71
|
+
exports.describeCommand = describeCommand;
|
|
72
|
+
const describeTree = (command) => ({
|
|
73
|
+
...(0, exports.describeCommand)(command),
|
|
74
|
+
subcommands: sortedChildren(command).map(describeTree),
|
|
75
|
+
});
|
|
76
|
+
const summarizeTree = (command) => [
|
|
77
|
+
{
|
|
78
|
+
command: commandPath(command),
|
|
79
|
+
description: command.description(),
|
|
80
|
+
},
|
|
81
|
+
...sortedChildren(command).flatMap(summarizeTree),
|
|
82
|
+
];
|
|
83
|
+
const discoverCommands = (program, path, version, full = false) => {
|
|
84
|
+
let selected = program;
|
|
85
|
+
const selectedPath = [];
|
|
86
|
+
for (const part of path) {
|
|
87
|
+
const child = sortedChildren(selected).find((command) => command.name() === part || command.aliases().includes(part));
|
|
88
|
+
if (!child)
|
|
89
|
+
return {
|
|
90
|
+
error: {
|
|
91
|
+
code: 'unknown_command',
|
|
92
|
+
message: (0, texts_1.ERR_DISCOVER_UNKNOWN_COMMAND)(part, commandPath(selected)),
|
|
93
|
+
hint: (0, texts_1.TXT_DISCOVER_COMMAND_HINT)(selectedPath),
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
selected = child;
|
|
97
|
+
selectedPath.push(child.name());
|
|
98
|
+
}
|
|
99
|
+
const commands = selected === program ? sortedChildren(program) : [selected];
|
|
100
|
+
const includeDetails = full || (selected !== program && sortedChildren(selected).length === 0);
|
|
101
|
+
return {
|
|
102
|
+
schema_version: 1,
|
|
103
|
+
cli_version: version,
|
|
104
|
+
// Root flags must precede the subcommand; keep them separate from local options.
|
|
105
|
+
...(includeDetails
|
|
106
|
+
? {
|
|
107
|
+
global_options: program
|
|
108
|
+
.createHelp()
|
|
109
|
+
.visibleOptions(program)
|
|
110
|
+
.map(optionInfo),
|
|
111
|
+
}
|
|
112
|
+
: {}),
|
|
113
|
+
commands: includeDetails
|
|
114
|
+
? commands.map(describeTree)
|
|
115
|
+
: commands.flatMap(summarizeTree),
|
|
116
|
+
tips: texts_1.DISCOVERY_TIPS,
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
exports.discoverCommands = discoverCommands;
|