opensip-cli 0.1.6 → 0.1.7
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/dist/bootstrap/admit-tool-package.d.ts.map +1 -1
- package/dist/bootstrap/admit-tool-package.js +8 -3
- package/dist/bootstrap/admit-tool-package.js.map +1 -1
- package/dist/bootstrap/bind-tool-context.d.ts.map +1 -1
- package/dist/bootstrap/bind-tool-context.js +5 -3
- package/dist/bootstrap/bind-tool-context.js.map +1 -1
- package/dist/bootstrap/build-command-registration-input.d.ts +7 -0
- package/dist/bootstrap/build-command-registration-input.d.ts.map +1 -1
- package/dist/bootstrap/build-command-registration-input.js +11 -4
- package/dist/bootstrap/build-command-registration-input.js.map +1 -1
- package/dist/bootstrap/build-per-run-scope.d.ts +12 -0
- package/dist/bootstrap/build-per-run-scope.d.ts.map +1 -1
- package/dist/bootstrap/build-per-run-scope.js +84 -9
- package/dist/bootstrap/build-per-run-scope.js.map +1 -1
- package/dist/bootstrap/bundled-manifest.d.ts +5 -0
- package/dist/bootstrap/bundled-manifest.d.ts.map +1 -0
- package/dist/bootstrap/bundled-manifest.js +13 -0
- package/dist/bootstrap/bundled-manifest.js.map +1 -0
- package/dist/bootstrap/bundled-tools.manifest.json +19 -1
- package/dist/bootstrap/config-and-capabilities.d.ts.map +1 -1
- package/dist/bootstrap/config-and-capabilities.js +5 -4
- package/dist/bootstrap/config-and-capabilities.js.map +1 -1
- package/dist/bootstrap/constants.d.ts +3 -0
- package/dist/bootstrap/constants.d.ts.map +1 -0
- package/dist/bootstrap/constants.js +3 -0
- package/dist/bootstrap/constants.js.map +1 -0
- package/dist/bootstrap/decorate-tool-primary.d.ts +50 -0
- package/dist/bootstrap/decorate-tool-primary.d.ts.map +1 -0
- package/dist/bootstrap/decorate-tool-primary.js +111 -0
- package/dist/bootstrap/decorate-tool-primary.js.map +1 -0
- package/dist/bootstrap/execute-post-bailout-bootstrap.d.ts.map +1 -1
- package/dist/bootstrap/execute-post-bailout-bootstrap.js +10 -0
- package/dist/bootstrap/execute-post-bailout-bootstrap.js.map +1 -1
- package/dist/bootstrap/index.d.ts +1 -1
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js +1 -4
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/bootstrap/io-plane.d.ts +47 -0
- package/dist/bootstrap/io-plane.d.ts.map +1 -0
- package/dist/bootstrap/io-plane.js +73 -0
- package/dist/bootstrap/io-plane.js.map +1 -0
- package/dist/bootstrap/load-tool-capabilities.d.ts.map +1 -1
- package/dist/bootstrap/load-tool-capabilities.js +18 -2
- package/dist/bootstrap/load-tool-capabilities.js.map +1 -1
- package/dist/bootstrap/owning-tool-init.d.ts.map +1 -1
- package/dist/bootstrap/owning-tool-init.js +7 -4
- package/dist/bootstrap/owning-tool-init.js.map +1 -1
- package/dist/bootstrap/phase-map.d.ts +20 -0
- package/dist/bootstrap/phase-map.d.ts.map +1 -0
- package/dist/bootstrap/phase-map.js +108 -0
- package/dist/bootstrap/phase-map.js.map +1 -0
- package/dist/bootstrap/pre-action-hook.d.ts.map +1 -1
- package/dist/bootstrap/pre-action-hook.js +19 -2
- package/dist/bootstrap/pre-action-hook.js.map +1 -1
- package/dist/bootstrap/register-tools-discovery.d.ts +38 -39
- package/dist/bootstrap/register-tools-discovery.d.ts.map +1 -1
- package/dist/bootstrap/register-tools-discovery.js +132 -83
- package/dist/bootstrap/register-tools-discovery.js.map +1 -1
- package/dist/bootstrap/register-tools-mount.d.ts +18 -1
- package/dist/bootstrap/register-tools-mount.d.ts.map +1 -1
- package/dist/bootstrap/register-tools-mount.js +118 -18
- package/dist/bootstrap/register-tools-mount.js.map +1 -1
- package/dist/bootstrap/register-tools.d.ts +58 -14
- package/dist/bootstrap/register-tools.d.ts.map +1 -1
- package/dist/bootstrap/register-tools.js +185 -14
- package/dist/bootstrap/register-tools.js.map +1 -1
- package/dist/bootstrap/root-version.d.ts +26 -0
- package/dist/bootstrap/root-version.d.ts.map +1 -0
- package/dist/bootstrap/root-version.js +36 -0
- package/dist/bootstrap/root-version.js.map +1 -0
- package/dist/bootstrap/scope-access.d.ts +11 -0
- package/dist/bootstrap/scope-access.d.ts.map +1 -1
- package/dist/bootstrap/scope-access.js +26 -0
- package/dist/bootstrap/scope-access.js.map +1 -1
- package/dist/bootstrap/tool-lifecycle.d.ts +0 -22
- package/dist/bootstrap/tool-lifecycle.d.ts.map +1 -1
- package/dist/bootstrap/tool-lifecycle.js +0 -23
- package/dist/bootstrap/tool-lifecycle.js.map +1 -1
- package/dist/bootstrap/validate-tool.d.ts +10 -4
- package/dist/bootstrap/validate-tool.d.ts.map +1 -1
- package/dist/bootstrap/validate-tool.js +76 -22
- package/dist/bootstrap/validate-tool.js.map +1 -1
- package/dist/cli-context.d.ts +2 -2
- package/dist/cli-context.d.ts.map +1 -1
- package/dist/cli-context.js +20 -35
- package/dist/cli-context.js.map +1 -1
- package/dist/commands/agent-catalog.d.ts +29 -0
- package/dist/commands/agent-catalog.d.ts.map +1 -1
- package/dist/commands/agent-catalog.js +77 -36
- package/dist/commands/agent-catalog.js.map +1 -1
- package/dist/commands/clear.d.ts.map +1 -1
- package/dist/commands/clear.js +0 -1
- package/dist/commands/clear.js.map +1 -1
- package/dist/commands/command-scope-index.d.ts +15 -1
- package/dist/commands/command-scope-index.d.ts.map +1 -1
- package/dist/commands/command-scope-index.js +10 -1
- package/dist/commands/command-scope-index.js.map +1 -1
- package/dist/commands/completion.d.ts +67 -6
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +84 -12
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/configure.d.ts.map +1 -1
- package/dist/commands/configure.js +0 -1
- package/dist/commands/configure.js.map +1 -1
- package/dist/commands/host-command-specs.d.ts +16 -9
- package/dist/commands/host-command-specs.d.ts.map +1 -1
- package/dist/commands/host-command-specs.js +45 -19
- package/dist/commands/host-command-specs.js.map +1 -1
- package/dist/commands/host-config-flag.d.ts +21 -0
- package/dist/commands/host-config-flag.d.ts.map +1 -0
- package/dist/commands/host-config-flag.js +21 -0
- package/dist/commands/host-config-flag.js.map +1 -0
- package/dist/commands/host-subcommand-groups.d.ts +46 -5
- package/dist/commands/host-subcommand-groups.d.ts.map +1 -1
- package/dist/commands/host-subcommand-groups.js +97 -65
- package/dist/commands/host-subcommand-groups.js.map +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.js +1 -1
- package/dist/commands/internal-command-visibility.d.ts +42 -0
- package/dist/commands/internal-command-visibility.d.ts.map +1 -0
- package/dist/commands/internal-command-visibility.js +54 -0
- package/dist/commands/internal-command-visibility.js.map +1 -0
- package/dist/commands/mount-command-action.d.ts +5 -0
- package/dist/commands/mount-command-action.d.ts.map +1 -1
- package/dist/commands/mount-command-action.js +26 -2
- package/dist/commands/mount-command-action.js.map +1 -1
- package/dist/commands/mount-command-spec.d.ts +9 -2
- package/dist/commands/mount-command-spec.d.ts.map +1 -1
- package/dist/commands/mount-command-spec.js +9 -1
- package/dist/commands/mount-command-spec.js.map +1 -1
- package/dist/commands/plugin/domain-resolution.d.ts +12 -13
- package/dist/commands/plugin/domain-resolution.d.ts.map +1 -1
- package/dist/commands/plugin/domain-resolution.js +12 -58
- package/dist/commands/plugin/domain-resolution.js.map +1 -1
- package/dist/commands/plugin/host-dir.d.ts +0 -1
- package/dist/commands/plugin/host-dir.d.ts.map +1 -1
- package/dist/commands/plugin/host-dir.js +1 -1
- package/dist/commands/plugin/host-dir.js.map +1 -1
- package/dist/commands/plugin.d.ts +20 -14
- package/dist/commands/plugin.d.ts.map +1 -1
- package/dist/commands/plugin.js +39 -47
- package/dist/commands/plugin.js.map +1 -1
- package/dist/commands/render-outcome.d.ts.map +1 -1
- package/dist/commands/render-outcome.js.map +1 -1
- package/dist/commands/shared.d.ts +9 -0
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/tools/create.d.ts +11 -0
- package/dist/commands/tools/create.d.ts.map +1 -0
- package/dist/commands/tools/create.js +84 -0
- package/dist/commands/tools/create.js.map +1 -0
- package/dist/commands/tools/index.d.ts.map +1 -1
- package/dist/commands/tools/index.js +31 -0
- package/dist/commands/tools/index.js.map +1 -1
- package/dist/commands/tools/runtime-probe-entry.d.ts.map +1 -1
- package/dist/commands/tools/runtime-probe-entry.js +4 -2
- package/dist/commands/tools/runtime-probe-entry.js.map +1 -1
- package/dist/commands/tools/validate.d.ts.map +1 -1
- package/dist/commands/tools/validate.js +12 -5
- package/dist/commands/tools/validate.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +0 -1
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/env/host-env-specs.d.ts +18 -0
- package/dist/env/host-env-specs.d.ts.map +1 -1
- package/dist/env/host-env-specs.js +36 -2
- package/dist/env/host-env-specs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -6
- package/dist/index.js.map +1 -1
- package/dist/report-compose.d.ts.map +1 -1
- package/dist/report-compose.js +2 -2
- package/dist/report-compose.js.map +1 -1
- package/dist/session-replay-registry.d.ts +1 -1
- package/dist/session-replay-registry.d.ts.map +1 -1
- package/dist/session-replay-registry.js +3 -1
- package/dist/session-replay-registry.js.map +1 -1
- package/dist/ui/result-to-view.d.ts +27 -7
- package/dist/ui/result-to-view.d.ts.map +1 -1
- package/dist/ui/result-to-view.js +68 -75
- package/dist/ui/result-to-view.js.map +1 -1
- package/dist/ui/views/misc-views.d.ts.map +1 -1
- package/dist/ui/views/misc-views.js +3 -1
- package/dist/ui/views/misc-views.js.map +1 -1
- package/dist/ui/views/tools-views.d.ts +2 -1
- package/dist/ui/views/tools-views.d.ts.map +1 -1
- package/dist/ui/views/tools-views.js +21 -0
- package/dist/ui/views/tools-views.js.map +1 -1
- package/package.json +32 -32
- package/dist/bootstrap/authored-tool-admission.d.ts +0 -23
- package/dist/bootstrap/authored-tool-admission.d.ts.map +0 -1
- package/dist/bootstrap/authored-tool-admission.js +0 -54
- package/dist/bootstrap/authored-tool-admission.js.map +0 -1
- package/dist/bootstrap/egress-plane.d.ts +0 -22
- package/dist/bootstrap/egress-plane.d.ts.map +0 -1
- package/dist/bootstrap/egress-plane.js +0 -37
- package/dist/bootstrap/egress-plane.js.map +0 -1
- package/dist/bootstrap/installed-tool-admission.d.ts +0 -20
- package/dist/bootstrap/installed-tool-admission.d.ts.map +0 -1
- package/dist/bootstrap/installed-tool-admission.js +0 -60
- package/dist/bootstrap/installed-tool-admission.js.map +0 -1
- package/dist/bootstrap/live-plane.d.ts +0 -51
- package/dist/bootstrap/live-plane.d.ts.map +0 -1
- package/dist/bootstrap/live-plane.js +0 -72
- package/dist/bootstrap/live-plane.js.map +0 -1
- package/dist/bootstrap/register-tools-bundled.d.ts +0 -28
- package/dist/bootstrap/register-tools-bundled.d.ts.map +0 -1
- package/dist/bootstrap/register-tools-bundled.js +0 -107
- package/dist/bootstrap/register-tools-bundled.js.map +0 -1
- package/dist/bootstrap/register-tools-shared.d.ts +0 -40
- package/dist/bootstrap/register-tools-shared.d.ts.map +0 -1
- package/dist/bootstrap/register-tools-shared.js +0 -98
- package/dist/bootstrap/register-tools-shared.js.map +0 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* commandSpecs. This keeps `CommandSpec.scope` as the source of truth instead
|
|
8
8
|
* of a parallel allowlist.
|
|
9
9
|
*/
|
|
10
|
-
import type { HostSubcommandGroup } from './host-subcommand-groups.js';
|
|
10
|
+
import type { HostSubcommandGroup, ToolPluginGroup } from './host-subcommand-groups.js';
|
|
11
11
|
import type { CommandScopeRequirement } from '@opensip-cli/core';
|
|
12
12
|
import type { Command } from 'commander';
|
|
13
13
|
export type CommandScopeIndex = ReadonlyMap<string, CommandScopeRequirement>;
|
|
@@ -15,11 +15,25 @@ export interface CommandScopeSpec {
|
|
|
15
15
|
readonly name: string;
|
|
16
16
|
readonly aliases?: readonly string[];
|
|
17
17
|
readonly scope: CommandScopeRequirement;
|
|
18
|
+
/**
|
|
19
|
+
* When set, this tool command is nested under the named primary verb (the
|
|
20
|
+
* `<tool> <verb>` grammar — see `CommandSpec.parent`). The index then keys it
|
|
21
|
+
* under `${parent} ${name}` so `commandPath` resolves `graph export` /
|
|
22
|
+
* `fit list` rather than a bare `export` / `list`. Omitted ⇒ flat root key.
|
|
23
|
+
*/
|
|
24
|
+
readonly parent?: string;
|
|
18
25
|
}
|
|
19
26
|
export interface CommandScopeIndexInput {
|
|
20
27
|
readonly hostSpecs: readonly CommandScopeSpec[];
|
|
21
28
|
readonly hostGroups: readonly HostSubcommandGroup[];
|
|
22
29
|
readonly toolSpecs: readonly CommandScopeSpec[];
|
|
30
|
+
/**
|
|
31
|
+
* The DOMAIN-BOUND per-tool `plugin` groups (mounted under each pack-supporting
|
|
32
|
+
* tool primary, e.g. `opensip fit plugin list`). Each leaf keys under
|
|
33
|
+
* `${toolVerb} plugin ${leaf}` so `commandPath` resolves the doubly-nested path.
|
|
34
|
+
* Optional so callers without tools (isolated tests) can omit it.
|
|
35
|
+
*/
|
|
36
|
+
readonly toolPluginGroups?: readonly ToolPluginGroup[];
|
|
23
37
|
}
|
|
24
38
|
export declare function buildCommandScopeIndex(input: CommandScopeIndexInput): CommandScopeIndex;
|
|
25
39
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-scope-index.d.ts","sourceRoot":"","sources":["../../src/commands/command-scope-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"command-scope-index.d.ts","sourceRoot":"","sources":["../../src/commands/command-scope-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;AAE7E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAC;IACxC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAChD,QAAQ,CAAC,UAAU,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACpD,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CACxD;AAaD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,GAAG,iBAAiB,CAmBvF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,OAAO,GAAG,MAAM,CAU1D"}
|
|
@@ -15,11 +15,20 @@ function addSpec(index, pathPrefix, spec) {
|
|
|
15
15
|
}
|
|
16
16
|
export function buildCommandScopeIndex(input) {
|
|
17
17
|
const index = new Map();
|
|
18
|
-
|
|
18
|
+
// Tool specs key flat by `name`, EXCEPT `parent`-nested specs (the
|
|
19
|
+
// `<tool> <verb>` grammar, taxonomy Task 0.4), which key under
|
|
20
|
+
// `${parent} ${name}` so `commandPath` resolves `graph export` / `fit list`.
|
|
21
|
+
input.toolSpecs.forEach((spec) => addSpec(index, spec.parent, spec));
|
|
19
22
|
input.hostSpecs.forEach((spec) => addSpec(index, undefined, spec));
|
|
20
23
|
input.hostGroups.forEach((group) => {
|
|
21
24
|
group.leaves.forEach((leaf) => addSpec(index, group.name, leaf));
|
|
22
25
|
});
|
|
26
|
+
// Per-tool `plugin` group leaves key under the doubly-nested
|
|
27
|
+
// `${toolVerb} plugin ${leaf}` path (e.g. `fit plugin list`), matching what
|
|
28
|
+
// `commandPath` resolves for the mounted `opensip fit plugin list`.
|
|
29
|
+
(input.toolPluginGroups ?? []).forEach((group) => {
|
|
30
|
+
group.leaves.forEach((leaf) => addSpec(index, `${group.toolVerb} plugin`, leaf));
|
|
31
|
+
});
|
|
23
32
|
return index;
|
|
24
33
|
}
|
|
25
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-scope-index.js","sourceRoot":"","sources":["../../src/commands/command-scope-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"command-scope-index.js","sourceRoot":"","sources":["../../src/commands/command-scope-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkCH,SAAS,OAAO,CACd,KAA2C,EAC3C,UAA8B,EAC9B,IAAsB;IAEtB,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;IACnD,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,KAAK,CAAC,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,IAAI,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAA6B;IAClE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmC,CAAC;IAEzD,mEAAmE;IACnE,+DAA+D;IAC/D,6EAA6E;IAC7E,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,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,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -26,8 +26,30 @@ export type Shell = 'bash' | 'zsh' | 'fish';
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal/machine-facing command names never offered in shell completion.
|
|
28
28
|
* These are spawned by the host (sharded build, off-process engine workers,
|
|
29
|
-
* machine exports), never typed by a user.
|
|
30
|
-
*
|
|
29
|
+
* machine exports), never typed by a user.
|
|
30
|
+
*
|
|
31
|
+
* This is the STATIC FALLBACK / default for {@link assembleCompletionInventory}'s
|
|
32
|
+
* `internalCommands` argument. The live path passes a descriptor-driven set
|
|
33
|
+
* (`visibility: 'internal'` + this fallback), keeping the runtime filter in
|
|
34
|
+
* lockstep with the `--help` hide pass. The set still backs the completion-drift
|
|
35
|
+
* test, and matters whenever a caller does not supply the descriptor-derived set.
|
|
36
|
+
*
|
|
37
|
+
* Note: the four `*-run-worker` / `*-shard-worker` names AND
|
|
38
|
+
* `graph-equivalence-check` are the Tier-3 `visibility: 'internal'` commands —
|
|
39
|
+
* they also flow through the descriptor-driven set. They are listed here so the
|
|
40
|
+
* static fallback is correct on its own (the historical gap was the missing
|
|
41
|
+
* `graph-equivalence-check`).
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* Internal/machine-facing command names never offered in shell completion — the
|
|
45
|
+
* `visibility: 'internal'` Tier-3 commands: `*-run-worker` / `*-shard-worker` and
|
|
46
|
+
* `graph-equivalence-check` are machine-only IPC/CI bootstrap entry points
|
|
47
|
+
* (ADR-0028), revealed by `OPENSIP_CLI_SHOW_INTERNAL=1`.
|
|
48
|
+
*
|
|
49
|
+
* The legacy flat-root export aliases (`catalog-export` / `sarif-export` /
|
|
50
|
+
* `graph-baseline-export` / `fit-baseline-export`) were removed entirely, so they
|
|
51
|
+
* no longer appear in the tool registry and need no completion suppression — the
|
|
52
|
+
* canonical nested `<tool> export` forms are the only export surface.
|
|
31
53
|
*/
|
|
32
54
|
export declare const INTERNAL_COMMANDS: ReadonlySet<string>;
|
|
33
55
|
/**
|
|
@@ -41,7 +63,11 @@ export interface CompletionInventory {
|
|
|
41
63
|
readonly subcommands: readonly string[];
|
|
42
64
|
/** Per-command long-flag list, keyed by command name (and alias). */
|
|
43
65
|
readonly commandFlags: Readonly<Record<string, readonly string[]>>;
|
|
44
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Sub-subcommand names for the action-less groups (`sessions`, `tools`), the
|
|
68
|
+
* `<tool> <verb>` grammar (`fit export`…), and the per-tool `plugin` groups
|
|
69
|
+
* (`fit plugin`, keyed under `${toolVerb} plugin`).
|
|
70
|
+
*/
|
|
45
71
|
readonly groupSubcommands: Readonly<Record<string, readonly string[]>>;
|
|
46
72
|
}
|
|
47
73
|
/** Minimal structural view of a `CommandSpec` this module needs to read. */
|
|
@@ -52,14 +78,34 @@ export interface SpecLike {
|
|
|
52
78
|
readonly options?: readonly {
|
|
53
79
|
readonly flag: string;
|
|
54
80
|
}[];
|
|
81
|
+
/**
|
|
82
|
+
* When set, this tool command is a `<parent> <name>` sub-subcommand (the
|
|
83
|
+
* `<tool> <verb>` grammar — see `CommandSpec.parent`, taxonomy Task 0.4). The
|
|
84
|
+
* inventory then offers it as a leaf under `parent` (like a `plugin`/`sessions`
|
|
85
|
+
* group leaf) and keys its flags under `${parent} ${name}`. Omitted ⇒ a flat
|
|
86
|
+
* top-level command.
|
|
87
|
+
*/
|
|
88
|
+
readonly parent?: string;
|
|
55
89
|
}
|
|
56
|
-
/** One action-less group (`
|
|
90
|
+
/** One action-less group (`sessions` / `tools`) and its leaf command names. */
|
|
57
91
|
export interface GroupLike {
|
|
58
92
|
readonly name: string;
|
|
59
93
|
readonly leaves: readonly {
|
|
60
94
|
readonly name: string;
|
|
61
95
|
}[];
|
|
62
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* One pack-supporting tool's `plugin` group, keyed by the tool verb it mounts
|
|
99
|
+
* under (`fit`/`sim`). The `plugin` parent is offered as a leaf under that verb
|
|
100
|
+
* (`opensip fit <TAB>` ⇒ `… plugin`), and the `add|list|remove|sync` leaves are
|
|
101
|
+
* registered under the `${toolVerb} plugin` path for deeper completion.
|
|
102
|
+
*/
|
|
103
|
+
export interface ToolPluginGroupLike {
|
|
104
|
+
readonly toolVerb: string;
|
|
105
|
+
readonly leaves: readonly {
|
|
106
|
+
readonly name: string;
|
|
107
|
+
}[];
|
|
108
|
+
}
|
|
63
109
|
/**
|
|
64
110
|
* Extract the canonical long `--flag` from a Commander flag string —
|
|
65
111
|
* `'-y, --yes'` → `'--yes'`, `'--no-cache'` → `'--no-cache'`,
|
|
@@ -77,13 +123,28 @@ export declare function specLongFlags(spec: SpecLike): readonly string[];
|
|
|
77
123
|
* Assemble the completion inventory from the live specs. Pure: callers pass
|
|
78
124
|
* the tool command specs (from the populated `ToolRegistry`), the top-level
|
|
79
125
|
* host specs, and the action-less groups; this turns them into the flag /
|
|
80
|
-
* subcommand maps the script builders consume.
|
|
81
|
-
*
|
|
126
|
+
* subcommand maps the script builders consume.
|
|
127
|
+
*
|
|
128
|
+
* Internal commands are filtered out by `input.internalCommands` — the
|
|
129
|
+
* descriptor-driven `visibility: 'internal'` set the host computes from the live
|
|
130
|
+
* tool registry (`internalCommandNames`), so completion and the `--help` hide
|
|
131
|
+
* pass key on the SAME source. Defaults to the static {@link INTERNAL_COMMANDS}
|
|
132
|
+
* fallback when omitted (tests / callers without a registry). The
|
|
133
|
+
* `OPENSIP_CLI_SHOW_INTERNAL=1` reveal is applied at the call site: the host
|
|
134
|
+
* passes an EMPTY set to skip filtering when the override is on.
|
|
82
135
|
*/
|
|
83
136
|
export declare function assembleCompletionInventory(input: {
|
|
84
137
|
readonly toolSpecs: readonly SpecLike[];
|
|
85
138
|
readonly hostSpecs: readonly SpecLike[];
|
|
86
139
|
readonly groups: readonly GroupLike[];
|
|
140
|
+
/**
|
|
141
|
+
* The DOMAIN-BOUND per-tool `plugin` groups (mounted under each pack-supporting
|
|
142
|
+
* tool primary). Folded into the group map so completion offers `plugin` under
|
|
143
|
+
* the tool verb and `add|list|remove|sync` under `${toolVerb} plugin`. Optional
|
|
144
|
+
* so callers without tools omit it.
|
|
145
|
+
*/
|
|
146
|
+
readonly toolPluginGroups?: readonly ToolPluginGroupLike[];
|
|
147
|
+
readonly internalCommands?: ReadonlySet<string>;
|
|
87
148
|
}): CompletionInventory;
|
|
88
149
|
export declare function buildCompletionScript(shell: Shell, inventory: CompletionInventory): string;
|
|
89
150
|
export declare function printCompletionScript(shell: Shell, inventory: CompletionInventory, write?: (s: string) => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEzE,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAMhD,CAAC;AAEH;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,qEAAqE;IACrE,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;IACnE;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;CACxE;AAED,4EAA4E;AAC5E,M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C;IAC3D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACjD,GAAG,mBAAmB,CAyDtB;AA4HD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,mBAAmB,GAAG,MAAM,CAY1F;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,mBAAmB,EAC9B,KAAK,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAqC,GAC1D,IAAI,CAEN"}
|
|
@@ -21,18 +21,38 @@
|
|
|
21
21
|
* matching existing check slugs) is ever needed, that's an additive change
|
|
22
22
|
* that can query `opensip fit --list` at completion time.
|
|
23
23
|
*/
|
|
24
|
-
// @fitness-ignore-file only-documented-toolcli-seams -- the `completion <shell>` command's whole purpose is to write a sourceable shell-completion script to stdout for the user to pipe/redirect; that script IS its output, not run findings through a ToolCliContext seam (mirrors the ESLint exemption for this file). See architecture review finding 5 (interactive host commands legitimately need a narrow TTY/script seam outside the run data path).
|
|
25
24
|
import { commonFlags } from '@opensip-cli/contracts';
|
|
26
25
|
/**
|
|
27
26
|
* Internal/machine-facing command names never offered in shell completion.
|
|
28
27
|
* These are spawned by the host (sharded build, off-process engine workers,
|
|
29
|
-
* machine exports), never typed by a user.
|
|
30
|
-
*
|
|
28
|
+
* machine exports), never typed by a user.
|
|
29
|
+
*
|
|
30
|
+
* This is the STATIC FALLBACK / default for {@link assembleCompletionInventory}'s
|
|
31
|
+
* `internalCommands` argument. The live path passes a descriptor-driven set
|
|
32
|
+
* (`visibility: 'internal'` + this fallback), keeping the runtime filter in
|
|
33
|
+
* lockstep with the `--help` hide pass. The set still backs the completion-drift
|
|
34
|
+
* test, and matters whenever a caller does not supply the descriptor-derived set.
|
|
35
|
+
*
|
|
36
|
+
* Note: the four `*-run-worker` / `*-shard-worker` names AND
|
|
37
|
+
* `graph-equivalence-check` are the Tier-3 `visibility: 'internal'` commands —
|
|
38
|
+
* they also flow through the descriptor-driven set. They are listed here so the
|
|
39
|
+
* static fallback is correct on its own (the historical gap was the missing
|
|
40
|
+
* `graph-equivalence-check`).
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Internal/machine-facing command names never offered in shell completion — the
|
|
44
|
+
* `visibility: 'internal'` Tier-3 commands: `*-run-worker` / `*-shard-worker` and
|
|
45
|
+
* `graph-equivalence-check` are machine-only IPC/CI bootstrap entry points
|
|
46
|
+
* (ADR-0028), revealed by `OPENSIP_CLI_SHOW_INTERNAL=1`.
|
|
47
|
+
*
|
|
48
|
+
* The legacy flat-root export aliases (`catalog-export` / `sarif-export` /
|
|
49
|
+
* `graph-baseline-export` / `fit-baseline-export`) were removed entirely, so they
|
|
50
|
+
* no longer appear in the tool registry and need no completion suppression — the
|
|
51
|
+
* canonical nested `<tool> export` forms are the only export surface.
|
|
31
52
|
*/
|
|
32
53
|
export const INTERNAL_COMMANDS = new Set([
|
|
33
54
|
'graph-shard-worker',
|
|
34
|
-
'
|
|
35
|
-
'sarif-export',
|
|
55
|
+
'graph-equivalence-check',
|
|
36
56
|
'fit-run-worker',
|
|
37
57
|
'sim-run-worker',
|
|
38
58
|
'graph-run-worker',
|
|
@@ -85,16 +105,39 @@ export function specLongFlags(spec) {
|
|
|
85
105
|
* Assemble the completion inventory from the live specs. Pure: callers pass
|
|
86
106
|
* the tool command specs (from the populated `ToolRegistry`), the top-level
|
|
87
107
|
* host specs, and the action-less groups; this turns them into the flag /
|
|
88
|
-
* subcommand maps the script builders consume.
|
|
89
|
-
*
|
|
108
|
+
* subcommand maps the script builders consume.
|
|
109
|
+
*
|
|
110
|
+
* Internal commands are filtered out by `input.internalCommands` — the
|
|
111
|
+
* descriptor-driven `visibility: 'internal'` set the host computes from the live
|
|
112
|
+
* tool registry (`internalCommandNames`), so completion and the `--help` hide
|
|
113
|
+
* pass key on the SAME source. Defaults to the static {@link INTERNAL_COMMANDS}
|
|
114
|
+
* fallback when omitted (tests / callers without a registry). The
|
|
115
|
+
* `OPENSIP_CLI_SHOW_INTERNAL=1` reveal is applied at the call site: the host
|
|
116
|
+
* passes an EMPTY set to skip filtering when the override is on.
|
|
90
117
|
*/
|
|
91
118
|
export function assembleCompletionInventory(input) {
|
|
119
|
+
const internalCommands = input.internalCommands ?? INTERNAL_COMMANDS;
|
|
92
120
|
const commandFlags = {};
|
|
93
121
|
const subcommands = [];
|
|
122
|
+
// `parent` → leaf names, accumulated from `parent`-nested tool specs (the
|
|
123
|
+
// `<tool> <verb>` grammar). Merged into `groupSubcommands` below so the
|
|
124
|
+
// emitted script offers `<parent> <leaf>` exactly like a host group.
|
|
125
|
+
const toolGroupLeaves = {};
|
|
94
126
|
for (const spec of [...input.toolSpecs, ...input.hostSpecs]) {
|
|
95
|
-
if (
|
|
127
|
+
if (internalCommands.has(spec.name))
|
|
96
128
|
continue;
|
|
97
129
|
const flags = specLongFlags(spec);
|
|
130
|
+
// A `parent`-nested tool spec is a sub-subcommand, NOT a top-level command:
|
|
131
|
+
// offer it as a leaf under its parent and key its flags under the qualified
|
|
132
|
+
// `${parent} ${name}` path (mirroring the host group leaves).
|
|
133
|
+
if (spec.parent !== undefined) {
|
|
134
|
+
const leaves = (toolGroupLeaves[spec.parent] ??= []);
|
|
135
|
+
for (const name of [spec.name, ...(spec.aliases ?? [])]) {
|
|
136
|
+
leaves.push(name);
|
|
137
|
+
commandFlags[`${spec.parent} ${name}`] = flags;
|
|
138
|
+
}
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
98
141
|
for (const name of [spec.name, ...(spec.aliases ?? [])]) {
|
|
99
142
|
subcommands.push(name);
|
|
100
143
|
commandFlags[name] = flags;
|
|
@@ -105,6 +148,20 @@ export function assembleCompletionInventory(input) {
|
|
|
105
148
|
subcommands.push(group.name);
|
|
106
149
|
groupSubcommands[group.name] = group.leaves.map((l) => l.name);
|
|
107
150
|
}
|
|
151
|
+
// Fold tool-command sub-subcommands into the group map. A primary verb
|
|
152
|
+
// (e.g. `graph`) is already a top-level subcommand with its own flags; adding
|
|
153
|
+
// its nested leaves here lets the script also complete `graph export` etc.
|
|
154
|
+
for (const [parent, leaves] of Object.entries(toolGroupLeaves)) {
|
|
155
|
+
groupSubcommands[parent] = [...(groupSubcommands[parent] ?? []), ...leaves];
|
|
156
|
+
}
|
|
157
|
+
// Fold the per-tool `plugin` groups in: `plugin` becomes a completable leaf
|
|
158
|
+
// under the tool verb (`opensip fit <TAB>` ⇒ `… plugin`), and the bound
|
|
159
|
+
// leaf names register under the doubly-nested `${toolVerb} plugin` key for
|
|
160
|
+
// deeper completion. There is NO top-level `plugin` group anymore.
|
|
161
|
+
for (const group of input.toolPluginGroups ?? []) {
|
|
162
|
+
groupSubcommands[group.toolVerb] = [...(groupSubcommands[group.toolVerb] ?? []), 'plugin'];
|
|
163
|
+
groupSubcommands[`${group.toolVerb} plugin`] = group.leaves.map((l) => l.name);
|
|
164
|
+
}
|
|
108
165
|
// `help` is a Commander built-in the script also surfaces.
|
|
109
166
|
subcommands.push('help');
|
|
110
167
|
return {
|
|
@@ -121,7 +178,14 @@ function bashScript(inv) {
|
|
|
121
178
|
const commonFlagList = COMMON_FLAGS.join(' ');
|
|
122
179
|
const arms = [];
|
|
123
180
|
for (const [name, subsList] of Object.entries(inv.groupSubcommands)) {
|
|
124
|
-
|
|
181
|
+
// A primary tool verb (e.g. `fit`/`graph`) is BOTH a flag-bearing command
|
|
182
|
+
// AND a group with nested `<tool> <verb>` children (taxonomy Task 0.4): at
|
|
183
|
+
// the second-word position the user can type either a nested subcommand or
|
|
184
|
+
// one of the parent's own flags, so offer the union. An action-less host
|
|
185
|
+
// group (`plugin`/`sessions`) has no own flags, so its union is just leaves.
|
|
186
|
+
const ownFlags = inv.commandFlags[name] ?? [];
|
|
187
|
+
const offered = [...new Set([...subsList, ...ownFlags])];
|
|
188
|
+
arms.push(` ${name}) COMPREPLY=($(compgen -W "${offered.join(' ')}" -- "\${cur}")) ;;`);
|
|
125
189
|
}
|
|
126
190
|
for (const [name, flags] of Object.entries(inv.commandFlags)) {
|
|
127
191
|
if (name in inv.groupSubcommands)
|
|
@@ -162,7 +226,10 @@ function zshScript(inv) {
|
|
|
162
226
|
const commonFlagList = COMMON_FLAGS.join(' ');
|
|
163
227
|
const arms = [];
|
|
164
228
|
for (const [name, subsList] of Object.entries(inv.groupSubcommands)) {
|
|
165
|
-
|
|
229
|
+
// Union of nested subcommands + the parent verb's own flags (see bashScript).
|
|
230
|
+
const ownFlags = inv.commandFlags[name] ?? [];
|
|
231
|
+
const offered = [...new Set([...subsList, ...ownFlags])];
|
|
232
|
+
arms.push(` ${name}) _values '${name} subcommand' ${offered.join(' ')} ;;`);
|
|
166
233
|
}
|
|
167
234
|
for (const [name, flags] of Object.entries(inv.commandFlags)) {
|
|
168
235
|
if (name in inv.groupSubcommands)
|
|
@@ -203,8 +270,13 @@ function fishScript(inv) {
|
|
|
203
270
|
`complete -c opensip -f -n "__fish_use_subcommand" -a "${subs}" -d "opensip subcommand"`,
|
|
204
271
|
];
|
|
205
272
|
for (const [name, flags] of Object.entries(inv.commandFlags)) {
|
|
206
|
-
|
|
207
|
-
|
|
273
|
+
// A primary tool verb that also hosts nested `<tool> <verb>` children stays
|
|
274
|
+
// in `groupSubcommands`, but it still owns its own flags — emit them so fish
|
|
275
|
+
// completes `fit --<flag>` (the qualified `${parent} ${name}` keys for the
|
|
276
|
+
// nested leaves are skipped here; they are not top-level commands). An
|
|
277
|
+
// action-less host group has no `commandFlags` entry, so it is unaffected.
|
|
278
|
+
if (name.includes(' '))
|
|
279
|
+
continue; // a nested `${parent} ${name}` key, not a verb
|
|
208
280
|
for (const flag of flags) {
|
|
209
281
|
lines.push(`complete -c opensip -n "__fish_seen_subcommand_from ${name}" -l "${flag.replace(/^--/, '')}"`);
|
|
210
282
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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C,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAC/F,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjC,CAAC;AAED,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E,MAAM,UAAU,qBAAqB,CAAC,KAAY,EAAE,SAA8B;IAChF,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC;QACD,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;QAC9B,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,KAAY,EACZ,SAA8B,EAC9B,QAA6B,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAE3D,KAAK,CAAC,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAIlE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAqBpD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAevE;AAMD;;;;GAIG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CA2BrE"}
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* layer. This file is the prompt+UX wrapper around those primitives.
|
|
13
13
|
* Audit 2026-05-23 M3.
|
|
14
14
|
*/
|
|
15
|
-
// @fitness-ignore-file only-documented-toolcli-seams -- interactive TTY prompts: readline prompt text + masked-key verification UX, not machine run output through a ToolCliContext seam (mirrors the ESLint exemption for this file). Result lines route through the Ink `configure-done` CommandResult. (Architecture review finding 5: host UX commands have a narrow sanctioned exemption.)
|
|
16
15
|
import { join } from 'node:path';
|
|
17
16
|
import { createInterface } from 'node:readline';
|
|
18
17
|
import { GLOBAL_CONFIG_PATH, readGlobalConfig, writeGlobalConfig } from '@opensip-cli/config';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,
|
|
1
|
+
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAI/E,2EAA2E;AAC3E,wEAAwE;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,SAAS,MAAM,CAAC,QAAgB;IAC9B,MAAM,EAA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AC,KAAK,UAAU,gBAAgB;IACpC,MAAM,QAAQ,GAAG,gBAAgB,EAAE,CAAC;IAEpC,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;QACpB,mEAAmE;QACnE,6DAA6D;QAC7D,uDAAuD;QACvD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,oCAAoC,CAAC,CAAC;IAC/D,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACzF,CAAC;IAED,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC;IACtB,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAE5B,2EAA2E;IAC3E,MAAM,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAE/B,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,kBAAkB;QAC9B,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC;KACxB,CAAC;AACJ,CAAC"}
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
* {@link CommandSpec}s, mounted through the SAME `mountCommandSpec` plane the
|
|
4
4
|
* tools use (launch Phase 6).
|
|
5
5
|
*
|
|
6
|
-
* Host commands (`init` / `configure` / `sessions` / `
|
|
7
|
-
* `
|
|
6
|
+
* Host commands (`init` / `configure` / `sessions` / `report` / `completion` /
|
|
7
|
+
* `uninstall` / `tools`) are NOT tool plugins — they don't ride on a
|
|
8
8
|
* `Tool.commandSpecs` and aren't discovered. But making them mount via the same
|
|
9
9
|
* `mountCommandSpec` means the Phase 7 `command-surface-parity` guardrail sees
|
|
10
|
-
* ONE uniform command surface:
|
|
11
|
-
*
|
|
10
|
+
* ONE uniform command surface: no second, more-privileged raw-Commander path for
|
|
11
|
+
* "blessed" CLI-owned commands. The pack-management `plugin {add,list,remove,
|
|
12
|
+
* sync}` ops are host-owned too, but mount UNDER each pack-supporting tool
|
|
13
|
+
* primary (`opensip fit plugin …`) via {@link mountToolPluginGroups} — there is
|
|
14
|
+
* no top-level `opensip plugin`.
|
|
12
15
|
*
|
|
13
16
|
* Each spec's handler closes over the per-invocation {@link CliCommandsContext}
|
|
14
17
|
* (render / setExitCode / datastore thunk / pluginLayouts) — the same data the
|
|
@@ -18,10 +21,11 @@
|
|
|
18
21
|
* `signal-envelope` / `live-view` arms are never exercised by a host command, so
|
|
19
22
|
* `CliCommandsContext` is a valid (leaner) `CommandMountContext`.
|
|
20
23
|
*
|
|
21
|
-
* The
|
|
22
|
-
*
|
|
23
|
-
* `
|
|
24
|
-
*
|
|
24
|
+
* The action-less subcommand GROUPS (`sessions`, `tools`) + the domain-bound
|
|
25
|
+
* per-tool `plugin` group leaves (and their {@link mountToolPluginGroups}) live
|
|
26
|
+
* in `host-subcommand-groups.ts` (a leaf module that lets `completion.ts` source
|
|
27
|
+
* its sub-subcommand names without a module cycle). This module assembles the
|
|
28
|
+
* TOP-LEVEL specs and mounts the whole surface.
|
|
25
29
|
*
|
|
26
30
|
* Specs are built per-invocation (inside the builders below, not at module
|
|
27
31
|
* load) so the `--cwd` defaults that resolve to `process.cwd()` are evaluated
|
|
@@ -43,7 +47,10 @@ export declare function buildTopLevelHostSpecs(ctx: CliCommandsContext): readonl
|
|
|
43
47
|
* Mount every host command onto `program` through the shared `mountCommandSpec`
|
|
44
48
|
* plane. Top-level specs mount directly; each subcommand group becomes a raw
|
|
45
49
|
* action-less parent (the documented exception) onto which its leaf specs mount
|
|
46
|
-
* via the same `mountCommandSpec`.
|
|
50
|
+
* via the same `mountCommandSpec`. Finally, the per-tool `plugin` groups mount
|
|
51
|
+
* UNDER each pack-supporting tool primary via {@link mountToolPluginGroups} —
|
|
52
|
+
* which runs AFTER the tools were mounted (the composition root mounts tools
|
|
53
|
+
* before `registerCliCommands`), so the tool primaries already exist.
|
|
47
54
|
*/
|
|
48
55
|
export declare function mountHostCommands(program: CliProgram, ctx: CliCommandsContext): void;
|
|
49
56
|
//# sourceMappingURL=host-command-specs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-command-specs.d.ts","sourceRoot":"","sources":["../../src/commands/host-command-specs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"host-command-specs.d.ts","sourceRoot":"","sources":["../../src/commands/host-command-specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAkBH,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,6BAA6B,CAAC;AAMrC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,wBAAwB,CAAC;AAmUtE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,kBAAkB,GAAG,SAAS,QAAQ,EAAE,CASnF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,kBAAkB,GAAG,IAAI,CAWpF"}
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
* {@link CommandSpec}s, mounted through the SAME `mountCommandSpec` plane the
|
|
4
4
|
* tools use (launch Phase 6).
|
|
5
5
|
*
|
|
6
|
-
* Host commands (`init` / `configure` / `sessions` / `
|
|
7
|
-
* `
|
|
6
|
+
* Host commands (`init` / `configure` / `sessions` / `report` / `completion` /
|
|
7
|
+
* `uninstall` / `tools`) are NOT tool plugins — they don't ride on a
|
|
8
8
|
* `Tool.commandSpecs` and aren't discovered. But making them mount via the same
|
|
9
9
|
* `mountCommandSpec` means the Phase 7 `command-surface-parity` guardrail sees
|
|
10
|
-
* ONE uniform command surface:
|
|
11
|
-
*
|
|
10
|
+
* ONE uniform command surface: no second, more-privileged raw-Commander path for
|
|
11
|
+
* "blessed" CLI-owned commands. The pack-management `plugin {add,list,remove,
|
|
12
|
+
* sync}` ops are host-owned too, but mount UNDER each pack-supporting tool
|
|
13
|
+
* primary (`opensip fit plugin …`) via {@link mountToolPluginGroups} — there is
|
|
14
|
+
* no top-level `opensip plugin`.
|
|
12
15
|
*
|
|
13
16
|
* Each spec's handler closes over the per-invocation {@link CliCommandsContext}
|
|
14
17
|
* (render / setExitCode / datastore thunk / pluginLayouts) — the same data the
|
|
@@ -18,10 +21,11 @@
|
|
|
18
21
|
* `signal-envelope` / `live-view` arms are never exercised by a host command, so
|
|
19
22
|
* `CliCommandsContext` is a valid (leaner) `CommandMountContext`.
|
|
20
23
|
*
|
|
21
|
-
* The
|
|
22
|
-
*
|
|
23
|
-
* `
|
|
24
|
-
*
|
|
24
|
+
* The action-less subcommand GROUPS (`sessions`, `tools`) + the domain-bound
|
|
25
|
+
* per-tool `plugin` group leaves (and their {@link mountToolPluginGroups}) live
|
|
26
|
+
* in `host-subcommand-groups.ts` (a leaf module that lets `completion.ts` source
|
|
27
|
+
* its sub-subcommand names without a module cycle). This module assembles the
|
|
28
|
+
* TOP-LEVEL specs and mounts the whole surface.
|
|
25
29
|
*
|
|
26
30
|
* Specs are built per-invocation (inside the builders below, not at module
|
|
27
31
|
* load) so the `--cwd` defaults that resolve to `process.cwd()` are evaluated
|
|
@@ -32,10 +36,11 @@ import { EXIT_CODES } from '@opensip-cli/contracts';
|
|
|
32
36
|
import { ConfigurationError, defineCommand } from '@opensip-cli/core';
|
|
33
37
|
import { composeAndWriteReport } from '../report-compose.js';
|
|
34
38
|
import { executeAgentCatalog } from './agent-catalog.js';
|
|
35
|
-
import { assembleCompletionInventory, printCompletionScript, } from './completion.js';
|
|
39
|
+
import { assembleCompletionInventory, printCompletionScript, INTERNAL_COMMANDS, } from './completion.js';
|
|
36
40
|
import { executeConfigure } from './configure.js';
|
|
37
|
-
import { buildHostSubcommandGroups } from './host-subcommand-groups.js';
|
|
41
|
+
import { buildHostSubcommandGroups, buildToolPluginGroups, mountToolPluginGroups, } from './host-subcommand-groups.js';
|
|
38
42
|
import { executeInit } from './init.js';
|
|
43
|
+
import { showInternalCommands } from './internal-command-visibility.js';
|
|
39
44
|
import { mountCommandSpec } from './mount-command-spec.js';
|
|
40
45
|
import { executeUninstall } from './uninstall.js';
|
|
41
46
|
/** Shared `output` mode for the host commands that return a renderable result. */
|
|
@@ -168,10 +173,25 @@ function buildCompletionSpec(ctx) {
|
|
|
168
173
|
// completion spec (it contributes a static, options-free descriptor for
|
|
169
174
|
// itself), keeping the dependency one-directional.
|
|
170
175
|
const host = buildHostCompletionSurface(ctx);
|
|
176
|
+
// tool-command-surface-taxonomy Task 1.3/1.5: filter Tier-3 internal
|
|
177
|
+
// commands from completion using the descriptor-driven set (the SAME source
|
|
178
|
+
// the `--help` hide pass keys on), so help and completion stay in lockstep.
|
|
179
|
+
//
|
|
180
|
+
// The legacy flat-root export aliases were removed entirely, so there is no
|
|
181
|
+
// separate deprecated-export suppression set to union here — the canonical
|
|
182
|
+
// nested `<tool> export` forms flow into completion via the sub-subcommand
|
|
183
|
+
// emission. The descriptor-driven internal set is the ONLY part the
|
|
184
|
+
// OPENSIP_CLI_SHOW_INTERNAL override un-hides — revealing it = passing an
|
|
185
|
+
// empty internal set so no command is filtered.
|
|
186
|
+
const internalCommands = showInternalCommands()
|
|
187
|
+
? new Set()
|
|
188
|
+
: (ctx.toolInternalCommands ?? INTERNAL_COMMANDS);
|
|
171
189
|
const inventory = assembleCompletionInventory({
|
|
172
190
|
toolSpecs: ctx.toolCommandSpecs ?? [],
|
|
173
191
|
hostSpecs: host.specs,
|
|
174
192
|
groups: host.groups,
|
|
193
|
+
toolPluginGroups: host.toolPluginGroups,
|
|
194
|
+
internalCommands,
|
|
175
195
|
});
|
|
176
196
|
printCompletionScript(normalized, inventory);
|
|
177
197
|
},
|
|
@@ -279,19 +299,21 @@ function buildNonCompletionHostSpecs(ctx) {
|
|
|
279
299
|
}
|
|
280
300
|
/**
|
|
281
301
|
* The host portion of the completion inventory: the `SpecLike` views of every
|
|
282
|
-
* top-level host command
|
|
283
|
-
* own surface is the static
|
|
284
|
-
* host command is read from
|
|
285
|
-
*
|
|
286
|
-
* handler never depends back on
|
|
287
|
-
*
|
|
288
|
-
* Order is irrelevant here — the inventory subcommand list is sorted — so the
|
|
289
|
-
* static completion descriptor is simply appended.
|
|
302
|
+
* top-level host command, the action-less groups, and the per-tool `plugin`
|
|
303
|
+
* groups. The completion command's own surface is the static
|
|
304
|
+
* {@link COMPLETION_SELF_SPEC} stand-in; every OTHER host command is read from
|
|
305
|
+
* its live spec (so its flags can't drift). Consumed by the `completion` handler
|
|
306
|
+
* INSTEAD of {@link buildTopLevelHostSpecs}, so the handler never depends back on
|
|
307
|
+
* {@link buildCompletionSpec}.
|
|
290
308
|
*/
|
|
291
309
|
function buildHostCompletionSurface(ctx) {
|
|
292
310
|
return {
|
|
293
311
|
specs: [...buildNonCompletionHostSpecs(ctx), COMPLETION_SELF_SPEC],
|
|
294
312
|
groups: buildHostSubcommandGroups(ctx),
|
|
313
|
+
toolPluginGroups: buildToolPluginGroups(ctx).map((g) => ({
|
|
314
|
+
toolVerb: g.toolVerb,
|
|
315
|
+
leaves: g.leaves.map((l) => ({ name: l.name })),
|
|
316
|
+
})),
|
|
295
317
|
};
|
|
296
318
|
}
|
|
297
319
|
/**
|
|
@@ -315,7 +337,10 @@ export function buildTopLevelHostSpecs(ctx) {
|
|
|
315
337
|
* Mount every host command onto `program` through the shared `mountCommandSpec`
|
|
316
338
|
* plane. Top-level specs mount directly; each subcommand group becomes a raw
|
|
317
339
|
* action-less parent (the documented exception) onto which its leaf specs mount
|
|
318
|
-
* via the same `mountCommandSpec`.
|
|
340
|
+
* via the same `mountCommandSpec`. Finally, the per-tool `plugin` groups mount
|
|
341
|
+
* UNDER each pack-supporting tool primary via {@link mountToolPluginGroups} —
|
|
342
|
+
* which runs AFTER the tools were mounted (the composition root mounts tools
|
|
343
|
+
* before `registerCliCommands`), so the tool primaries already exist.
|
|
319
344
|
*/
|
|
320
345
|
export function mountHostCommands(program, ctx) {
|
|
321
346
|
for (const spec of buildTopLevelHostSpecs(ctx)) {
|
|
@@ -327,5 +352,6 @@ export function mountHostCommands(program, ctx) {
|
|
|
327
352
|
mountCommandSpec(parent, leaf, ctx);
|
|
328
353
|
}
|
|
329
354
|
}
|
|
355
|
+
mountToolPluginGroups(program, ctx);
|
|
330
356
|
}
|
|
331
357
|
//# sourceMappingURL=host-command-specs.js.map
|