opensip-cli 0.1.5 → 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.
Files changed (229) hide show
  1. package/dist/bootstrap/admit-tool-package.d.ts +15 -1
  2. package/dist/bootstrap/admit-tool-package.d.ts.map +1 -1
  3. package/dist/bootstrap/admit-tool-package.js +30 -5
  4. package/dist/bootstrap/admit-tool-package.js.map +1 -1
  5. package/dist/bootstrap/bind-tool-context.d.ts.map +1 -1
  6. package/dist/bootstrap/bind-tool-context.js +5 -3
  7. package/dist/bootstrap/bind-tool-context.js.map +1 -1
  8. package/dist/bootstrap/build-command-registration-input.d.ts +7 -0
  9. package/dist/bootstrap/build-command-registration-input.d.ts.map +1 -1
  10. package/dist/bootstrap/build-command-registration-input.js +11 -4
  11. package/dist/bootstrap/build-command-registration-input.js.map +1 -1
  12. package/dist/bootstrap/build-per-run-scope.d.ts +12 -0
  13. package/dist/bootstrap/build-per-run-scope.d.ts.map +1 -1
  14. package/dist/bootstrap/build-per-run-scope.js +84 -9
  15. package/dist/bootstrap/build-per-run-scope.js.map +1 -1
  16. package/dist/bootstrap/bundled-manifest.d.ts +5 -0
  17. package/dist/bootstrap/bundled-manifest.d.ts.map +1 -0
  18. package/dist/bootstrap/bundled-manifest.js +13 -0
  19. package/dist/bootstrap/bundled-manifest.js.map +1 -0
  20. package/dist/bootstrap/bundled-tools.manifest.json +19 -1
  21. package/dist/bootstrap/config-and-capabilities.d.ts +5 -3
  22. package/dist/bootstrap/config-and-capabilities.d.ts.map +1 -1
  23. package/dist/bootstrap/config-and-capabilities.js +10 -7
  24. package/dist/bootstrap/config-and-capabilities.js.map +1 -1
  25. package/dist/bootstrap/constants.d.ts +3 -0
  26. package/dist/bootstrap/constants.d.ts.map +1 -0
  27. package/dist/bootstrap/constants.js +3 -0
  28. package/dist/bootstrap/constants.js.map +1 -0
  29. package/dist/bootstrap/decorate-tool-primary.d.ts +50 -0
  30. package/dist/bootstrap/decorate-tool-primary.d.ts.map +1 -0
  31. package/dist/bootstrap/decorate-tool-primary.js +111 -0
  32. package/dist/bootstrap/decorate-tool-primary.js.map +1 -0
  33. package/dist/bootstrap/execute-post-bailout-bootstrap.d.ts +1 -0
  34. package/dist/bootstrap/execute-post-bailout-bootstrap.d.ts.map +1 -1
  35. package/dist/bootstrap/execute-post-bailout-bootstrap.js +12 -1
  36. package/dist/bootstrap/execute-post-bailout-bootstrap.js.map +1 -1
  37. package/dist/bootstrap/index.d.ts +1 -1
  38. package/dist/bootstrap/index.d.ts.map +1 -1
  39. package/dist/bootstrap/index.js +1 -4
  40. package/dist/bootstrap/index.js.map +1 -1
  41. package/dist/bootstrap/io-plane.d.ts +47 -0
  42. package/dist/bootstrap/io-plane.d.ts.map +1 -0
  43. package/dist/bootstrap/io-plane.js +73 -0
  44. package/dist/bootstrap/io-plane.js.map +1 -0
  45. package/dist/bootstrap/load-tool-capabilities.d.ts.map +1 -1
  46. package/dist/bootstrap/load-tool-capabilities.js +18 -2
  47. package/dist/bootstrap/load-tool-capabilities.js.map +1 -1
  48. package/dist/bootstrap/owning-tool-init.d.ts.map +1 -1
  49. package/dist/bootstrap/owning-tool-init.js +7 -4
  50. package/dist/bootstrap/owning-tool-init.js.map +1 -1
  51. package/dist/bootstrap/phase-map.d.ts +20 -0
  52. package/dist/bootstrap/phase-map.d.ts.map +1 -0
  53. package/dist/bootstrap/phase-map.js +108 -0
  54. package/dist/bootstrap/phase-map.js.map +1 -0
  55. package/dist/bootstrap/plan-pre-action-bootstrap.d.ts +5 -5
  56. package/dist/bootstrap/plan-pre-action-bootstrap.d.ts.map +1 -1
  57. package/dist/bootstrap/plan-pre-action-bootstrap.js +3 -19
  58. package/dist/bootstrap/plan-pre-action-bootstrap.js.map +1 -1
  59. package/dist/bootstrap/pre-action-guards.d.ts +2 -1
  60. package/dist/bootstrap/pre-action-guards.d.ts.map +1 -1
  61. package/dist/bootstrap/pre-action-guards.js +3 -27
  62. package/dist/bootstrap/pre-action-guards.js.map +1 -1
  63. package/dist/bootstrap/pre-action-hook.d.ts +2 -1
  64. package/dist/bootstrap/pre-action-hook.d.ts.map +1 -1
  65. package/dist/bootstrap/pre-action-hook.js +23 -4
  66. package/dist/bootstrap/pre-action-hook.js.map +1 -1
  67. package/dist/bootstrap/register-tools-discovery.d.ts +38 -39
  68. package/dist/bootstrap/register-tools-discovery.d.ts.map +1 -1
  69. package/dist/bootstrap/register-tools-discovery.js +134 -85
  70. package/dist/bootstrap/register-tools-discovery.js.map +1 -1
  71. package/dist/bootstrap/register-tools-mount.d.ts +18 -1
  72. package/dist/bootstrap/register-tools-mount.d.ts.map +1 -1
  73. package/dist/bootstrap/register-tools-mount.js +118 -18
  74. package/dist/bootstrap/register-tools-mount.js.map +1 -1
  75. package/dist/bootstrap/register-tools.d.ts +58 -14
  76. package/dist/bootstrap/register-tools.d.ts.map +1 -1
  77. package/dist/bootstrap/register-tools.js +185 -14
  78. package/dist/bootstrap/register-tools.js.map +1 -1
  79. package/dist/bootstrap/root-version.d.ts +26 -0
  80. package/dist/bootstrap/root-version.d.ts.map +1 -0
  81. package/dist/bootstrap/root-version.js +36 -0
  82. package/dist/bootstrap/root-version.js.map +1 -0
  83. package/dist/bootstrap/scope-access.d.ts +11 -0
  84. package/dist/bootstrap/scope-access.d.ts.map +1 -1
  85. package/dist/bootstrap/scope-access.js +26 -0
  86. package/dist/bootstrap/scope-access.js.map +1 -1
  87. package/dist/bootstrap/tool-lifecycle.d.ts +0 -22
  88. package/dist/bootstrap/tool-lifecycle.d.ts.map +1 -1
  89. package/dist/bootstrap/tool-lifecycle.js +0 -23
  90. package/dist/bootstrap/tool-lifecycle.js.map +1 -1
  91. package/dist/bootstrap/validate-tool.d.ts +10 -4
  92. package/dist/bootstrap/validate-tool.d.ts.map +1 -1
  93. package/dist/bootstrap/validate-tool.js +76 -22
  94. package/dist/bootstrap/validate-tool.js.map +1 -1
  95. package/dist/cli-context.d.ts +2 -2
  96. package/dist/cli-context.d.ts.map +1 -1
  97. package/dist/cli-context.js +20 -35
  98. package/dist/cli-context.js.map +1 -1
  99. package/dist/commands/agent-catalog.d.ts +29 -0
  100. package/dist/commands/agent-catalog.d.ts.map +1 -1
  101. package/dist/commands/agent-catalog.js +77 -36
  102. package/dist/commands/agent-catalog.js.map +1 -1
  103. package/dist/commands/clear.d.ts.map +1 -1
  104. package/dist/commands/clear.js +0 -1
  105. package/dist/commands/clear.js.map +1 -1
  106. package/dist/commands/command-scope-index.d.ts +45 -0
  107. package/dist/commands/command-scope-index.d.ts.map +1 -0
  108. package/dist/commands/command-scope-index.js +51 -0
  109. package/dist/commands/command-scope-index.js.map +1 -0
  110. package/dist/commands/completion.d.ts +67 -6
  111. package/dist/commands/completion.d.ts.map +1 -1
  112. package/dist/commands/completion.js +84 -12
  113. package/dist/commands/completion.js.map +1 -1
  114. package/dist/commands/configure.d.ts.map +1 -1
  115. package/dist/commands/configure.js +0 -1
  116. package/dist/commands/configure.js.map +1 -1
  117. package/dist/commands/host-command-specs.d.ts +16 -9
  118. package/dist/commands/host-command-specs.d.ts.map +1 -1
  119. package/dist/commands/host-command-specs.js +47 -21
  120. package/dist/commands/host-command-specs.js.map +1 -1
  121. package/dist/commands/host-config-flag.d.ts +21 -0
  122. package/dist/commands/host-config-flag.d.ts.map +1 -0
  123. package/dist/commands/host-config-flag.js +21 -0
  124. package/dist/commands/host-config-flag.js.map +1 -0
  125. package/dist/commands/host-subcommand-groups.d.ts +46 -5
  126. package/dist/commands/host-subcommand-groups.d.ts.map +1 -1
  127. package/dist/commands/host-subcommand-groups.js +97 -65
  128. package/dist/commands/host-subcommand-groups.js.map +1 -1
  129. package/dist/commands/index.d.ts +1 -1
  130. package/dist/commands/index.js +1 -1
  131. package/dist/commands/internal-command-visibility.d.ts +42 -0
  132. package/dist/commands/internal-command-visibility.d.ts.map +1 -0
  133. package/dist/commands/internal-command-visibility.js +54 -0
  134. package/dist/commands/internal-command-visibility.js.map +1 -0
  135. package/dist/commands/mount-command-action.d.ts +24 -0
  136. package/dist/commands/mount-command-action.d.ts.map +1 -0
  137. package/dist/commands/mount-command-action.js +78 -0
  138. package/dist/commands/mount-command-action.js.map +1 -0
  139. package/dist/commands/mount-command-spec-wiring.d.ts +24 -0
  140. package/dist/commands/mount-command-spec-wiring.d.ts.map +1 -0
  141. package/dist/commands/mount-command-spec-wiring.js +71 -0
  142. package/dist/commands/mount-command-spec-wiring.js.map +1 -0
  143. package/dist/commands/mount-command-spec.d.ts +9 -2
  144. package/dist/commands/mount-command-spec.d.ts.map +1 -1
  145. package/dist/commands/mount-command-spec.js +11 -135
  146. package/dist/commands/mount-command-spec.js.map +1 -1
  147. package/dist/commands/plugin/domain-resolution.d.ts +12 -13
  148. package/dist/commands/plugin/domain-resolution.d.ts.map +1 -1
  149. package/dist/commands/plugin/domain-resolution.js +12 -58
  150. package/dist/commands/plugin/domain-resolution.js.map +1 -1
  151. package/dist/commands/plugin/host-dir.d.ts +0 -1
  152. package/dist/commands/plugin/host-dir.d.ts.map +1 -1
  153. package/dist/commands/plugin/host-dir.js +1 -1
  154. package/dist/commands/plugin/host-dir.js.map +1 -1
  155. package/dist/commands/plugin.d.ts +20 -14
  156. package/dist/commands/plugin.d.ts.map +1 -1
  157. package/dist/commands/plugin.js +39 -47
  158. package/dist/commands/plugin.js.map +1 -1
  159. package/dist/commands/render-outcome.d.ts.map +1 -1
  160. package/dist/commands/render-outcome.js.map +1 -1
  161. package/dist/commands/shared.d.ts +9 -0
  162. package/dist/commands/shared.d.ts.map +1 -1
  163. package/dist/commands/tools/create.d.ts +11 -0
  164. package/dist/commands/tools/create.d.ts.map +1 -0
  165. package/dist/commands/tools/create.js +84 -0
  166. package/dist/commands/tools/create.js.map +1 -0
  167. package/dist/commands/tools/index.d.ts.map +1 -1
  168. package/dist/commands/tools/index.js +31 -0
  169. package/dist/commands/tools/index.js.map +1 -1
  170. package/dist/commands/tools/runtime-probe-entry.d.ts.map +1 -1
  171. package/dist/commands/tools/runtime-probe-entry.js +4 -2
  172. package/dist/commands/tools/runtime-probe-entry.js.map +1 -1
  173. package/dist/commands/tools/validate.d.ts.map +1 -1
  174. package/dist/commands/tools/validate.js +12 -5
  175. package/dist/commands/tools/validate.js.map +1 -1
  176. package/dist/commands/uninstall.d.ts.map +1 -1
  177. package/dist/commands/uninstall.js +0 -1
  178. package/dist/commands/uninstall.js.map +1 -1
  179. package/dist/env/host-env-specs.d.ts +18 -0
  180. package/dist/env/host-env-specs.d.ts.map +1 -1
  181. package/dist/env/host-env-specs.js +36 -2
  182. package/dist/env/host-env-specs.js.map +1 -1
  183. package/dist/index.d.ts +1 -1
  184. package/dist/index.d.ts.map +1 -1
  185. package/dist/index.js +46 -21
  186. package/dist/index.js.map +1 -1
  187. package/dist/report-compose.d.ts.map +1 -1
  188. package/dist/report-compose.js +2 -2
  189. package/dist/report-compose.js.map +1 -1
  190. package/dist/session-replay-registry.d.ts +1 -1
  191. package/dist/session-replay-registry.d.ts.map +1 -1
  192. package/dist/session-replay-registry.js +3 -1
  193. package/dist/session-replay-registry.js.map +1 -1
  194. package/dist/ui/result-to-view.d.ts +27 -7
  195. package/dist/ui/result-to-view.d.ts.map +1 -1
  196. package/dist/ui/result-to-view.js +68 -75
  197. package/dist/ui/result-to-view.js.map +1 -1
  198. package/dist/ui/views/misc-views.d.ts.map +1 -1
  199. package/dist/ui/views/misc-views.js +3 -1
  200. package/dist/ui/views/misc-views.js.map +1 -1
  201. package/dist/ui/views/tools-views.d.ts +2 -1
  202. package/dist/ui/views/tools-views.d.ts.map +1 -1
  203. package/dist/ui/views/tools-views.js +21 -0
  204. package/dist/ui/views/tools-views.js.map +1 -1
  205. package/package.json +32 -32
  206. package/dist/bootstrap/authored-tool-admission.d.ts +0 -23
  207. package/dist/bootstrap/authored-tool-admission.d.ts.map +0 -1
  208. package/dist/bootstrap/authored-tool-admission.js +0 -54
  209. package/dist/bootstrap/authored-tool-admission.js.map +0 -1
  210. package/dist/bootstrap/egress-plane.d.ts +0 -22
  211. package/dist/bootstrap/egress-plane.d.ts.map +0 -1
  212. package/dist/bootstrap/egress-plane.js +0 -37
  213. package/dist/bootstrap/egress-plane.js.map +0 -1
  214. package/dist/bootstrap/installed-tool-admission.d.ts +0 -20
  215. package/dist/bootstrap/installed-tool-admission.d.ts.map +0 -1
  216. package/dist/bootstrap/installed-tool-admission.js +0 -60
  217. package/dist/bootstrap/installed-tool-admission.js.map +0 -1
  218. package/dist/bootstrap/live-plane.d.ts +0 -51
  219. package/dist/bootstrap/live-plane.d.ts.map +0 -1
  220. package/dist/bootstrap/live-plane.js +0 -72
  221. package/dist/bootstrap/live-plane.js.map +0 -1
  222. package/dist/bootstrap/register-tools-bundled.d.ts +0 -28
  223. package/dist/bootstrap/register-tools-bundled.d.ts.map +0 -1
  224. package/dist/bootstrap/register-tools-bundled.js +0 -107
  225. package/dist/bootstrap/register-tools-bundled.js.map +0 -1
  226. package/dist/bootstrap/register-tools-shared.d.ts +0 -40
  227. package/dist/bootstrap/register-tools-shared.d.ts.map +0 -1
  228. package/dist/bootstrap/register-tools-shared.js +0 -98
  229. package/dist/bootstrap/register-tools-shared.js.map +0 -1
@@ -1,12 +1,13 @@
1
- // @fitness-ignore-file file-length-limit -- deliberate single cycle-free leaf module: it houses BOTH host subcommand groups' leaf specs (sessions + plugin) AND the completion inventory together specifically because it must import neither completion.ts nor host-command-specs.ts (see header — splitting would reintroduce the module cycle this file exists to break). Cohesive by design; grew past the 400-line soft limit with the per-leaf CommandSpec builders.
1
+ // @fitness-ignore-file file-length-limit -- deliberate single cycle-free leaf module: it houses BOTH host subcommand groups' leaf specs (sessions + tools) AND the per-tool `plugin` group leaves + the completion inventory together specifically because it must import neither completion.ts nor host-command-specs.ts (see header — splitting would reintroduce the module cycle this file exists to break). Cohesive by design; grew past the 400-line soft limit with the per-leaf CommandSpec builders.
2
2
  /**
3
3
  * host-subcommand-groups — the action-less Commander subcommand GROUPS
4
- * (`sessions`, `plugin`) and their leaf {@link CommandSpec}s (launch
5
- * Phase 6).
4
+ * (`sessions`, `tools`) and their leaf {@link CommandSpec}s, PLUS the
5
+ * DOMAIN-BOUND per-tool `plugin` group leaves (launch Phase 6 + the
6
+ * command-surface-taxonomy "packs under the tool" refinement).
6
7
  *
7
8
  * Split out of `host-command-specs.ts` for ONE reason: to break a module cycle.
8
- * The completion-script generator (`completion.ts`) sources its `plugin` /
9
- * `sessions` sub-subcommand NAME lists from the live leaf specs (single source —
9
+ * The completion-script generator (`completion.ts`) sources its `sessions` /
10
+ * `tools` sub-subcommand NAME lists from the live leaf specs (single source —
10
11
  * Phase 6 Task 6.2), so it must import the group inventory. The
11
12
  * `host-command-specs.ts` module, in turn, imports `printCompletionScript` from
12
13
  * `completion.ts` for the `completion` command's handler. Housing the GROUP
@@ -17,11 +18,18 @@
17
18
  * a single mountable `CommandSpec`, so it stays a raw `program.command(name)`
18
19
  * shell (the FINITE, NAMED documented exceptions for the Phase 7
19
20
  * `command-surface-parity` guardrail's allow-list, see {@link HOST_SUBCOMMAND_GROUPS}).
20
- * Their LEAVES (`sessions list|purge`, `plugin list|add|remove|sync`) ARE specs.
21
+ * Their LEAVES (`sessions list|purge`, `tools list|install|…`) ARE specs.
22
+ *
23
+ * The PACK-management `plugin {add,list,remove,sync}` ops are NO LONGER a
24
+ * top-level group: they mount as a `plugin` group UNDER each pack-supporting
25
+ * tool primary (`opensip fit plugin …`, `opensip sim plugin …`) via
26
+ * `mountToolPluginGroups`, with the domain pre-bound from the tool (no
27
+ * `--domain` flag). Whole Tool plugins remain `opensip tools …`.
21
28
  */
22
29
  import { currentScope, defineCommand, } from '@opensip-cli/core';
23
30
  import { executeClear } from './clear.js';
24
31
  import { showHistory } from './history.js';
32
+ import { mountCommandSpec } from './mount-command-spec.js';
25
33
  import { pluginAdd, pluginList, pluginRemove, pluginSync } from './plugin.js';
26
34
  import { executeSessionShow } from './session-show.js';
27
35
  import { buildToolsGroupLeaves } from './tools/index.js';
@@ -190,8 +198,15 @@ function buildSessionsPurgeSpec(ctx) {
190
198
  });
191
199
  }
192
200
  // ---------------------------------------------------------------------------
193
- // plugin list / add / remove / sync
201
+ // <tool> plugin {list,add,remove,sync} DOMAIN-BOUND extension-pack ops
194
202
  // ---------------------------------------------------------------------------
203
+ //
204
+ // The pack ops are mounted UNDER each pack-supporting tool primary
205
+ // (`opensip fit plugin …`, `opensip sim plugin …`) by `mountToolPluginGroups`,
206
+ // with the `domain` PRE-BOUND from that tool. There is no top-level
207
+ // `opensip plugin` command and no `--domain`/`--type` flag: the tool the
208
+ // subcommand hangs off of IS the domain. Whole Tool plugins are managed by
209
+ // `opensip tools …`, never here.
195
210
  /** The shared `--cwd <path>` option for the plugin leaves. Its description is
196
211
  * "Project root" (NOT the registry's "Target directory"), so it is declared as
197
212
  * a per-command OptionSpec rather than the `cwd` common flag — preserving the
@@ -205,10 +220,19 @@ function pluginCwdOption() {
205
220
  default: process.cwd(),
206
221
  };
207
222
  }
208
- function buildPluginListSpec(ctx) {
223
+ /** The single-domain layout view passed to the pure plugin commands so a
224
+ * bound `<tool> plugin …` op only ever touches its own domain. Resolved from
225
+ * the host's contributed `pluginLayouts` (so the domain is a real layout, not
226
+ * an arbitrary string); falls back to a minimal layout if the tool's full
227
+ * layout is somehow absent. */
228
+ function boundLayouts(ctx, domain) {
229
+ const match = ctx.pluginLayouts.find((l) => l.domain === domain);
230
+ return match ? [match] : [{ domain, userSubdirs: [] }];
231
+ }
232
+ function buildPluginListSpec(ctx, domain) {
209
233
  return defineCommand({
210
234
  name: 'list',
211
- description: 'List installed plugins',
235
+ description: `List installed ${domain} packs`,
212
236
  commonFlags: ['json'],
213
237
  options: [pluginCwdOption()],
214
238
  scope: PROJECT_SCOPE,
@@ -216,29 +240,18 @@ function buildPluginListSpec(ctx) {
216
240
  handler: (rawOpts) => {
217
241
  const opts = rawOpts;
218
242
  // Per-run admitted-tool provenance is on the entered RunScope (stamped by
219
- // the bootstrap); read it here and pass it into the pure `pluginList`.
220
- return pluginList(effectiveCwd(opts), ctx.pluginLayouts, currentScope()?.toolProvenance ?? []);
243
+ // the bootstrap); read it here and pass it into the pure `pluginList`,
244
+ // scoped to this tool's own domain.
245
+ return pluginList(effectiveCwd(opts), boundLayouts(ctx, domain), currentScope()?.toolProvenance ?? []);
221
246
  },
222
247
  });
223
248
  }
224
- function buildPluginAddSpec(ctx) {
249
+ function buildPluginAddSpec(ctx, domain) {
225
250
  return defineCommand({
226
251
  name: 'add',
227
- description: 'Install a plugin (fit/sim pack project config; tool → user-global by default)',
252
+ description: `Install a ${domain} pack and record it in opensip-cli.config.yml`,
228
253
  commonFlags: ['json'],
229
- options: [
230
- {
231
- flag: '--domain',
232
- value: '<fit|sim|tool>',
233
- description: 'Target domain (default: inferred; tool plugins auto-detected by marker)',
234
- },
235
- {
236
- flag: '--project',
237
- description: 'For a tool plugin, install project-local (.runtime/) instead of user-global',
238
- default: false,
239
- },
240
- pluginCwdOption(),
241
- ],
254
+ options: [pluginCwdOption()],
242
255
  // Empty description: the former `.command('add <package>')` declared the
243
256
  // positional inline with no help text, so Commander rendered no "Arguments:"
244
257
  // block. Keeping it empty preserves the byte-identical --help.
@@ -248,30 +261,17 @@ function buildPluginAddSpec(ctx) {
248
261
  handler: (rawOpts) => {
249
262
  const opts = rawOpts;
250
263
  const packageName = opts._args[0];
251
- return pluginAdd(packageName, effectiveCwd(opts), opts.domain, ctx.pluginLayouts, {
252
- project: opts.project,
253
- });
264
+ // Domain is bound from the tool primary — no `--domain` flag.
265
+ return pluginAdd(packageName, effectiveCwd(opts), domain, boundLayouts(ctx, domain));
254
266
  },
255
267
  });
256
268
  }
257
- function buildPluginRemoveSpec(ctx) {
269
+ function buildPluginRemoveSpec(ctx, domain) {
258
270
  return defineCommand({
259
271
  name: 'remove',
260
- description: 'Uninstall a plugin (and remove from opensip-cli.config.yml for fit/sim packs)',
272
+ description: `Uninstall a ${domain} pack and remove it from opensip-cli.config.yml`,
261
273
  commonFlags: ['json'],
262
- options: [
263
- {
264
- flag: '--domain',
265
- value: '<fit|sim|tool>',
266
- description: 'Target domain (default: inferred from package name)',
267
- },
268
- {
269
- flag: '--project',
270
- description: 'For a tool plugin, target the project-local install instead of user-global',
271
- default: false,
272
- },
273
- pluginCwdOption(),
274
- ],
274
+ options: [pluginCwdOption()],
275
275
  // Empty description — see the plugin-add note above (byte-identical --help).
276
276
  args: [{ name: 'package', description: '' }],
277
277
  scope: PROJECT_SCOPE,
@@ -279,36 +279,78 @@ function buildPluginRemoveSpec(ctx) {
279
279
  handler: (rawOpts) => {
280
280
  const opts = rawOpts;
281
281
  const packageName = opts._args[0];
282
- return pluginRemove(packageName, effectiveCwd(opts), opts.domain, ctx.pluginLayouts, {
283
- project: opts.project,
284
- });
282
+ return pluginRemove(packageName, effectiveCwd(opts), domain, boundLayouts(ctx, domain));
285
283
  },
286
284
  });
287
285
  }
288
- function buildPluginSyncSpec(ctx) {
286
+ function buildPluginSyncSpec(ctx, domain) {
289
287
  return defineCommand({
290
288
  name: 'sync',
291
- description: 'Install every plugin declared in opensip-cli.config.yml (post-clone bootstrap)',
289
+ description: `Install every ${domain} pack declared in opensip-cli.config.yml (post-clone bootstrap)`,
292
290
  commonFlags: ['json'],
293
- options: [
294
- { flag: '--domain', value: '<fit|sim>', description: 'Sync only one domain' },
295
- pluginCwdOption(),
296
- ],
291
+ options: [pluginCwdOption()],
297
292
  scope: PROJECT_SCOPE,
298
293
  output: COMMAND_RESULT,
299
294
  handler: (rawOpts) => {
300
295
  const opts = rawOpts;
301
- return pluginSync(effectiveCwd(opts), opts.domain, ctx.pluginLayouts);
296
+ return pluginSync(effectiveCwd(opts), domain, boundLayouts(ctx, domain));
302
297
  },
303
298
  });
304
299
  }
300
+ /**
301
+ * Build the four domain-bound `plugin` leaf specs for ONE pack-supporting tool
302
+ * (`add`/`list`/`remove`/`sync`, all scoped to `domain`). Shared by the mount
303
+ * path (`mountToolPluginGroups`), the command-scope index, and the completion
304
+ * inventory so the three derive the SAME leaves.
305
+ */
306
+ export function buildToolPluginLeaves(ctx, domain) {
307
+ return [
308
+ buildPluginListSpec(ctx, domain),
309
+ buildPluginAddSpec(ctx, domain),
310
+ buildPluginRemoveSpec(ctx, domain),
311
+ buildPluginSyncSpec(ctx, domain),
312
+ ];
313
+ }
314
+ /**
315
+ * Derive the per-tool `plugin` groups from the host's contributed
316
+ * `pluginLayouts` — one group per pack-supporting domain (fit/sim). A tool with
317
+ * no `pluginLayout` (e.g. `graph`) contributes none, so it gets no `plugin`
318
+ * group. The single source the mount path + scope index + completion all read.
319
+ */
320
+ export function buildToolPluginGroups(ctx) {
321
+ return ctx.pluginLayouts.map((layout) => ({
322
+ toolVerb: layout.domain,
323
+ domain: layout.domain,
324
+ description: `Manage ${layout.domain} extension packs (add, list, remove, sync)`,
325
+ leaves: buildToolPluginLeaves(ctx, layout.domain),
326
+ }));
327
+ }
328
+ /**
329
+ * Mount each per-tool `plugin` group UNDER its pack-supporting tool primary
330
+ * (`opensip fit plugin …`), domain pre-bound from the tool. The host derives the
331
+ * groups from the contributed `pluginLayouts` (fit/sim; graph has none, so no
332
+ * group). The tool primary must already be mounted — it is, because the
333
+ * composition root mounts tools before the host commands; a domain whose primary
334
+ * is absent (isolated host-only tests) is skipped (nowhere to hang it).
335
+ */
336
+ export function mountToolPluginGroups(program, ctx) {
337
+ for (const group of buildToolPluginGroups(ctx)) {
338
+ const primary = program.commands.find((c) => c.name() === group.toolVerb);
339
+ if (primary === undefined)
340
+ continue; // no tool primary mounted (host-only tests)
341
+ const parent = primary.command('plugin').description(group.description);
342
+ for (const leaf of group.leaves) {
343
+ mountCommandSpec(parent, leaf, ctx);
344
+ }
345
+ }
346
+ }
305
347
  /**
306
348
  * The action-less Commander subcommand GROUPS that legitimately cannot be a
307
349
  * single {@link CommandSpec} — they have no action body, only sub-subcommands.
308
350
  * This is the FINITE, NAMED set the Phase 7 `command-surface-parity` guardrail
309
351
  * allow-lists as documented host exceptions. Every other host command IS a spec.
310
352
  */
311
- export const HOST_SUBCOMMAND_GROUPS = ['sessions', 'plugin', 'tools'];
353
+ export const HOST_SUBCOMMAND_GROUPS = ['sessions', 'tools'];
312
354
  /**
313
355
  * Build the subcommand-group parents with their leaf specs. The mounter turns
314
356
  * each into a raw parent `program.command(name)` plus `mountCommandSpec(parent,
@@ -321,16 +363,6 @@ export function buildHostSubcommandGroups(ctx) {
321
363
  description: 'Manage session data',
322
364
  leaves: [buildSessionsListSpec(ctx), buildSessionsShowSpec(ctx), buildSessionsPurgeSpec(ctx)],
323
365
  },
324
- {
325
- name: 'plugin',
326
- description: 'Manage project-local plugins (add, list, remove, sync)',
327
- leaves: [
328
- buildPluginListSpec(ctx),
329
- buildPluginAddSpec(ctx),
330
- buildPluginRemoveSpec(ctx),
331
- buildPluginSyncSpec(ctx),
332
- ],
333
- },
334
366
  {
335
367
  name: 'tools',
336
368
  description: 'Manage whole Tool plugins (list, validate, install, uninstall)',
@@ -1 +1 @@
1
- {"version":3,"file":"host-subcommand-groups.js","sourceRoot":"","sources":["../../src/commands/host-subcommand-groups.ts"],"names":[],"mappings":"AAAA,2cAA2c;AAC3c;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,YAAY,EACZ,aAAa,GAKd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAQzD;wEACwE;AACxE,MAAM,aAAa,GAA4B,SAAS,CAAC;AAEzD,8EAA8E;AAC9E,MAAM,cAAc,GAA0B,gBAAgB,CAAC;AAE/D,MAAM,UAAU,GAA0B,YAAY,CAAC;AAEvD,2FAA2F;AAC3F,MAAM,UAAU,YAAY,CAAC,IAAuD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OAAO,EAAE,GAAG,EAAE;QACZ,uDAAuD;IACzD,CAAC;IACD,SAAS,EAAE,GAAG,EAAE;QACd,uDAAuD;IACzD,CAAC;IACD,aAAa,EAAE,EAAE;IACjB,aAAa,EAAE,EAAE;IACjB,8LAA8L;IAC9L,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS;CAC3B,CAAC;AAoBF,qFAAqF;AACrF,MAAM,UAAU,yBAAyB;IACvC,MAAM,gBAAgB,GAAsC,EAAE,CAAC;IAC/D,KAAK,MAAM,KAAK,IAAI,yBAAyB,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7D,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC9B,CAAC"}
@@ -20,7 +20,7 @@
20
20
  * two-tier privilege.
21
21
  *
22
22
  * Tool-owned subcommands (`fit`, `sim`, `graph`, …) are mounted separately by
23
- * walking the CLI-managed tool registry (`mountToolCommands`), which mounts
23
+ * walking the CLI-managed tool registry (`mountAllToolCommands`), which mounts
24
24
  * each tool's `commandSpecs` via the same `mountCommandSpec`.
25
25
  */
26
26
  import type { CliCommandsContext } from './shared.js';
@@ -20,7 +20,7 @@
20
20
  * two-tier privilege.
21
21
  *
22
22
  * Tool-owned subcommands (`fit`, `sim`, `graph`, …) are mounted separately by
23
- * walking the CLI-managed tool registry (`mountToolCommands`), which mounts
23
+ * walking the CLI-managed tool registry (`mountAllToolCommands`), which mounts
24
24
  * each tool's `commandSpecs` via the same `mountCommandSpec`.
25
25
  */
26
26
  import { mountHostCommands } from './host-command-specs.js';
@@ -0,0 +1,42 @@
1
+ /**
2
+ * internal-command-visibility — the single host source of truth for the
3
+ * tool-command-surface-taxonomy Tier-3 hide policy.
4
+ *
5
+ * Two host-owned primitives, used in lockstep so `--help` and shell completion
6
+ * agree on exactly which commands are internal and when they are revealed:
7
+ *
8
+ * - {@link internalCommandNames} walks the populated per-invocation
9
+ * `ToolRegistry` and collects every command whose `ToolCommandDescriptor`
10
+ * declares `visibility: 'internal'`. This is the descriptor-driven set the
11
+ * help hide pass (`register-tools-mount.ts`) and the completion inventory
12
+ * (`host-command-specs.ts` → `assembleCompletionInventory`) both consume —
13
+ * so adding a new internal worker is a one-line descriptor change, not a
14
+ * hand-maintained list edit in two places.
15
+ *
16
+ * - {@link showInternalCommands} is the single env predicate
17
+ * (`OPENSIP_CLI_SHOW_INTERNAL=1`) that un-hides internal commands across
18
+ * help + completion. Routed through the host {@link hostEnv} registry (the
19
+ * `env-via-registry` guardrail), so the value is documented in the env
20
+ * surface and read in exactly one place.
21
+ *
22
+ * Asymmetry (deliberate): the agent-catalog is a CURATED machine surface, not a
23
+ * debug dump, so it NEVER surfaces internal commands and the env reveal does NOT
24
+ * apply to it. Only `--help` and shell completion honour the override.
25
+ */
26
+ import { type ToolRegistry } from '@opensip-cli/core';
27
+ /**
28
+ * Collect the names of every command a tool declares as
29
+ * `visibility: 'internal'` (Tier-3), across all tools in `registry`. The single
30
+ * host source for "which mounted commands are internal", read by the help hide
31
+ * pass and the completion inventory so the two never drift.
32
+ */
33
+ export declare function internalCommandNames(registry: ToolRegistry): ReadonlySet<string>;
34
+ /**
35
+ * Whether internal (Tier-3) commands should be REVEALED on the public surfaces
36
+ * that honour the override (`--help`, shell completion). True iff
37
+ * `OPENSIP_CLI_SHOW_INTERNAL` is exactly `'1'` (the env spec's strict coerce).
38
+ *
39
+ * The agent-catalog deliberately does NOT consult this — see the module JSDoc.
40
+ */
41
+ export declare function showInternalCommands(): boolean;
42
+ //# sourceMappingURL=internal-command-visibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-command-visibility.d.ts","sourceRoot":"","sources":["../../src/commands/internal-command-visibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAI3E;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,CAQhF;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * internal-command-visibility — the single host source of truth for the
3
+ * tool-command-surface-taxonomy Tier-3 hide policy.
4
+ *
5
+ * Two host-owned primitives, used in lockstep so `--help` and shell completion
6
+ * agree on exactly which commands are internal and when they are revealed:
7
+ *
8
+ * - {@link internalCommandNames} walks the populated per-invocation
9
+ * `ToolRegistry` and collects every command whose `ToolCommandDescriptor`
10
+ * declares `visibility: 'internal'`. This is the descriptor-driven set the
11
+ * help hide pass (`register-tools-mount.ts`) and the completion inventory
12
+ * (`host-command-specs.ts` → `assembleCompletionInventory`) both consume —
13
+ * so adding a new internal worker is a one-line descriptor change, not a
14
+ * hand-maintained list edit in two places.
15
+ *
16
+ * - {@link showInternalCommands} is the single env predicate
17
+ * (`OPENSIP_CLI_SHOW_INTERNAL=1`) that un-hides internal commands across
18
+ * help + completion. Routed through the host {@link hostEnv} registry (the
19
+ * `env-via-registry` guardrail), so the value is documented in the env
20
+ * surface and read in exactly one place.
21
+ *
22
+ * Asymmetry (deliberate): the agent-catalog is a CURATED machine surface, not a
23
+ * debug dump, so it NEVER surfaces internal commands and the env reveal does NOT
24
+ * apply to it. Only `--help` and shell completion honour the override.
25
+ */
26
+ import { resolveToolCommands } from '@opensip-cli/core';
27
+ import { hostEnv } from '../env/host-env-specs.js';
28
+ /**
29
+ * Collect the names of every command a tool declares as
30
+ * `visibility: 'internal'` (Tier-3), across all tools in `registry`. The single
31
+ * host source for "which mounted commands are internal", read by the help hide
32
+ * pass and the completion inventory so the two never drift.
33
+ */
34
+ export function internalCommandNames(registry) {
35
+ const names = new Set();
36
+ for (const tool of registry.list()) {
37
+ for (const descriptor of resolveToolCommands(tool)) {
38
+ if (descriptor.visibility === 'internal')
39
+ names.add(descriptor.name);
40
+ }
41
+ }
42
+ return names;
43
+ }
44
+ /**
45
+ * Whether internal (Tier-3) commands should be REVEALED on the public surfaces
46
+ * that honour the override (`--help`, shell completion). True iff
47
+ * `OPENSIP_CLI_SHOW_INTERNAL` is exactly `'1'` (the env spec's strict coerce).
48
+ *
49
+ * The agent-catalog deliberately does NOT consult this — see the module JSDoc.
50
+ */
51
+ export function showInternalCommands() {
52
+ return hostEnv.get('OPENSIP_CLI_SHOW_INTERNAL') === true;
53
+ }
54
+ //# sourceMappingURL=internal-command-visibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-command-visibility.js","sourceRoot":"","sources":["../../src/commands/internal-command-visibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,mBAAmB,EAAqB,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAsB;IACzD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACnC,KAAK,MAAM,UAAU,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;YACnD,IAAI,UAAU,CAAC,UAAU,KAAK,UAAU;gBAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,OAAO,CAAC,GAAG,CAAU,2BAA2B,CAAC,KAAK,IAAI,CAAC;AACpE,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Commander action callback helpers for the CommandSpec mount layer.
3
+ */
4
+ /**
5
+ * Split a Commander action callback's variadic arguments into the parsed-opts
6
+ * object and the trailing positional args.
7
+ *
8
+ * Commander calls `action((...positionalArgs, optsObject, command))`: the
9
+ * declared positionals come first, then the parsed-options object, then the
10
+ * `Command` instance.
11
+ *
12
+ * The returned `opts` are sourced from the final `Command`'s `optsWithGlobals()`
13
+ * when available (so a nested `<tool> <verb>` child inherits common flags its
14
+ * parent primary resolved — see {@link optsWithGlobals}), falling back to the
15
+ * options object Commander passed positionally (identical for a flat command).
16
+ *
17
+ * @throws {Error} When Commander does not provide a final Command argument, or
18
+ * when argument splitting would select the Command object as parsed options.
19
+ */
20
+ export declare function splitActionArgs(actionArgs: readonly unknown[]): {
21
+ opts: Record<string, unknown>;
22
+ positionals: readonly unknown[];
23
+ };
24
+ //# sourceMappingURL=mount-command-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount-command-action.d.ts","sourceRoot":"","sources":["../../src/commands/mount-command-action.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkCH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,SAAS,OAAO,EAAE,GAAG;IAC/D,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,WAAW,EAAE,SAAS,OAAO,EAAE,CAAC;CACjC,CAqCA"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Commander action callback helpers for the CommandSpec mount layer.
3
+ */
4
+ /**
5
+ * Best-effort guard: does `x` look like a Commander `Command` instance?
6
+ * Used defensively in splitActionArgs so we never treat the Command object
7
+ * as the parsed opts.
8
+ */
9
+ function isLikelyCommanderCommand(x) {
10
+ if (!x || typeof x !== 'object')
11
+ return false;
12
+ const c = x;
13
+ return (typeof c.name === 'function' ||
14
+ typeof c.opts === 'function' ||
15
+ typeof c.command === 'function' ||
16
+ (typeof c.constructor === 'function' && /Command/i.test(c.constructor.name || '')));
17
+ }
18
+ /**
19
+ * Read a command's options INCLUDING inherited globals from its parent chain.
20
+ *
21
+ * For a `<tool> <verb>` nested child (taxonomy Task 0.4), a common flag the
22
+ * child shares with its parent primary (e.g. `--json` on both `fit` and
23
+ * `fit list`) is resolved by Commander onto the PARENT scope, so the child's
24
+ * local `cmd.opts()` is `{}` for that flag. `cmd.optsWithGlobals()` merges the
25
+ * parent chain's options under the child's locals (locals win), which is the
26
+ * value the dispatch + handler must see so `fit list --json` actually emits JSON.
27
+ * For a flat (un-nested) command this is identical to `cmd.opts()`.
28
+ */
29
+ function optsWithGlobals(command) {
30
+ const c = command;
31
+ return typeof c.optsWithGlobals === 'function' ? c.optsWithGlobals() : undefined;
32
+ }
33
+ /**
34
+ * Split a Commander action callback's variadic arguments into the parsed-opts
35
+ * object and the trailing positional args.
36
+ *
37
+ * Commander calls `action((...positionalArgs, optsObject, command))`: the
38
+ * declared positionals come first, then the parsed-options object, then the
39
+ * `Command` instance.
40
+ *
41
+ * The returned `opts` are sourced from the final `Command`'s `optsWithGlobals()`
42
+ * when available (so a nested `<tool> <verb>` child inherits common flags its
43
+ * parent primary resolved — see {@link optsWithGlobals}), falling back to the
44
+ * options object Commander passed positionally (identical for a flat command).
45
+ *
46
+ * @throws {Error} When Commander does not provide a final Command argument, or
47
+ * when argument splitting would select the Command object as parsed options.
48
+ */
49
+ export function splitActionArgs(actionArgs) {
50
+ if (actionArgs.length === 0) {
51
+ return { opts: {}, positionals: [] };
52
+ }
53
+ const lastIdx = actionArgs.length - 1;
54
+ if (!isLikelyCommanderCommand(actionArgs[lastIdx])) {
55
+ throw new Error('mountCommandSpec: splitActionArgs could not locate Commander Command as the final action argument. ' +
56
+ 'This indicates an incompatible Commander version or a wrapped dispatch. ' +
57
+ 'Please report this with your Commander version.');
58
+ }
59
+ // Prefer the globally-resolved options off the Command so nested children see
60
+ // common flags (e.g. `--json`) their parent primary resolved. Falls back to
61
+ // the positional opts object below for any Commander shape lacking the method.
62
+ const globalsResolved = optsWithGlobals(actionArgs[lastIdx]);
63
+ for (let i = lastIdx - 1; i >= 0; i--) {
64
+ const v = actionArgs[i];
65
+ if (v && typeof v === 'object' && !Array.isArray(v) && !isLikelyCommanderCommand(v)) {
66
+ const opts = globalsResolved ?? v;
67
+ const positionals = actionArgs.slice(0, i);
68
+ if (isLikelyCommanderCommand(opts)) {
69
+ throw new Error('mountCommandSpec: splitActionArgs selected a Commander Command as the parsed opts. ' +
70
+ 'Refusing to dispatch — this is a bug in argument splitting.');
71
+ }
72
+ return { opts, positionals };
73
+ }
74
+ }
75
+ const positionals = actionArgs.slice(0, lastIdx);
76
+ return { opts: globalsResolved ?? {}, positionals };
77
+ }
78
+ //# sourceMappingURL=mount-command-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount-command-action.js","sourceRoot":"","sources":["../../src/commands/mount-command-action.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,SAAS,wBAAwB,CAAC,CAAU;IAC1C,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9C,MAAM,CAAC,GAAG,CAA4B,CAAC;IACvC,OAAO,CACL,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU;QAC5B,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU;QAC5B,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU;QAC/B,CAAC,OAAO,CAAC,CAAC,WAAW,KAAK,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CACnF,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,eAAe,CAAC,OAAgB;IACvC,MAAM,CAAC,GAAG,OAA8D,CAAC;IACzE,OAAO,OAAO,CAAC,CAAC,eAAe,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC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AAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACjD,OAAO,EAAE,IAAI,EAAE,eAAe,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC;AACtD,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Commander wiring helpers for declarative CommandSpec inputs.
3
+ *
4
+ * Kept out of mount-command-spec.ts so option/argument translation can evolve
5
+ * independently from the host-owned command lifecycle.
6
+ */
7
+ import { Option } from 'commander';
8
+ import type { ArgSpec, OptionSpec } from '@opensip-cli/core';
9
+ /**
10
+ * Build a Commander {@link Option} from an {@link OptionSpec}, covering every
11
+ * shape in the first-party flag corpus: boolean / value, negatable `--no-`,
12
+ * literal `default` and repeatable `arrayDefault`, `choices`, the pure `parse`
13
+ * argParser, variadic, and `required` (mandatory).
14
+ *
15
+ * @throws {Error} When the spec marks a boolean (valueless) option `required`
16
+ * — only value options can be made mandatory.
17
+ */
18
+ export declare function buildOption(spec: OptionSpec, commandName: string): Option;
19
+ /**
20
+ * Format an {@link ArgSpec} into Commander argument-usage syntax: `<name>`
21
+ * (required), `[name]` (optional), with `...` appended for variadic.
22
+ */
23
+ export declare function formatArgUsage(spec: ArgSpec): string;
24
+ //# sourceMappingURL=mount-command-spec-wiring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount-command-spec-wiring.d.ts","sourceRoot":"","sources":["../../src/commands/mount-command-spec-wiring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CA+BzE;AAiBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAGpD"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Commander wiring helpers for declarative CommandSpec inputs.
3
+ *
4
+ * Kept out of mount-command-spec.ts so option/argument translation can evolve
5
+ * independently from the host-owned command lifecycle.
6
+ */
7
+ import { Option } from 'commander';
8
+ /**
9
+ * Build a Commander {@link Option} from an {@link OptionSpec}, covering every
10
+ * shape in the first-party flag corpus: boolean / value, negatable `--no-`,
11
+ * literal `default` and repeatable `arrayDefault`, `choices`, the pure `parse`
12
+ * argParser, variadic, and `required` (mandatory).
13
+ *
14
+ * @throws {Error} When the spec marks a boolean (valueless) option `required`
15
+ * — only value options can be made mandatory.
16
+ */
17
+ export function buildOption(spec, commandName) {
18
+ const valuePlaceholder = resolveValuePlaceholder(spec);
19
+ const flags = valuePlaceholder === undefined ? spec.flag : `${spec.flag} ${valuePlaceholder}`;
20
+ const option = new Option(flags, spec.description);
21
+ if (spec.choices !== undefined && spec.choices.length > 0) {
22
+ option.choices([...spec.choices]);
23
+ }
24
+ if (spec.parse !== undefined) {
25
+ // Commander's argParser is `(value, previous) => next` — exactly the
26
+ // declared `OptionSpec.parse` reducer shape (Number coercion, repeatable
27
+ // accumulation, validated ints).
28
+ option.argParser(spec.parse);
29
+ }
30
+ // `arrayDefault` (repeatable accumulators) wins over a scalar `default`;
31
+ // Commander uses it as the seed the `parse` reducer accumulates onto.
32
+ if (spec.arrayDefault !== undefined) {
33
+ option.default([...spec.arrayDefault]);
34
+ }
35
+ else if (spec.default !== undefined) {
36
+ option.default(spec.default);
37
+ }
38
+ if (spec.required === true) {
39
+ if (valuePlaceholder === undefined) {
40
+ throw new Error(`mountCommandSpec: command '${commandName}' option '${spec.flag}' is required but takes no value; ` +
41
+ 'only value options can be required.');
42
+ }
43
+ option.makeOptionMandatory(true);
44
+ }
45
+ return option;
46
+ }
47
+ /**
48
+ * Resolve the value placeholder for an option, applying variadic `...` when
49
+ * declared. Returns `undefined` for a boolean / negatable flag (no value).
50
+ */
51
+ function resolveValuePlaceholder(spec) {
52
+ if (spec.negatable === true)
53
+ return undefined;
54
+ if (spec.value === undefined)
55
+ return undefined;
56
+ if (spec.variadic === true && !spec.value.includes('...')) {
57
+ // Inject the variadic ellipsis inside the existing bracket pair, e.g.
58
+ // `<slug>` -> `<slug...>`, `[path]` -> `[path...]`.
59
+ return spec.value.replace(/([>\]])$/, '...$1');
60
+ }
61
+ return spec.value;
62
+ }
63
+ /**
64
+ * Format an {@link ArgSpec} into Commander argument-usage syntax: `<name>`
65
+ * (required), `[name]` (optional), with `...` appended for variadic.
66
+ */
67
+ export function formatArgUsage(spec) {
68
+ const inner = spec.variadic === true ? `${spec.name}...` : spec.name;
69
+ return spec.optional === true ? `[${inner}]` : `<${inner}>`;
70
+ }
71
+ //# sourceMappingURL=mount-command-spec-wiring.js.map