opensip-cli 0.1.6 → 0.1.8

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.map +1 -1
  2. package/dist/bootstrap/admit-tool-package.js +8 -3
  3. package/dist/bootstrap/admit-tool-package.js.map +1 -1
  4. package/dist/bootstrap/bind-tool-context.d.ts.map +1 -1
  5. package/dist/bootstrap/bind-tool-context.js +5 -3
  6. package/dist/bootstrap/bind-tool-context.js.map +1 -1
  7. package/dist/bootstrap/build-command-registration-input.d.ts +7 -0
  8. package/dist/bootstrap/build-command-registration-input.d.ts.map +1 -1
  9. package/dist/bootstrap/build-command-registration-input.js +11 -4
  10. package/dist/bootstrap/build-command-registration-input.js.map +1 -1
  11. package/dist/bootstrap/build-per-run-scope.d.ts +12 -0
  12. package/dist/bootstrap/build-per-run-scope.d.ts.map +1 -1
  13. package/dist/bootstrap/build-per-run-scope.js +92 -10
  14. package/dist/bootstrap/build-per-run-scope.js.map +1 -1
  15. package/dist/bootstrap/bundled-manifest.d.ts +5 -0
  16. package/dist/bootstrap/bundled-manifest.d.ts.map +1 -0
  17. package/dist/bootstrap/bundled-manifest.js +13 -0
  18. package/dist/bootstrap/bundled-manifest.js.map +1 -0
  19. package/dist/bootstrap/bundled-tools.manifest.json +19 -1
  20. package/dist/bootstrap/config-and-capabilities.d.ts.map +1 -1
  21. package/dist/bootstrap/config-and-capabilities.js +5 -4
  22. package/dist/bootstrap/config-and-capabilities.js.map +1 -1
  23. package/dist/bootstrap/constants.d.ts +3 -0
  24. package/dist/bootstrap/constants.d.ts.map +1 -0
  25. package/dist/bootstrap/constants.js +3 -0
  26. package/dist/bootstrap/constants.js.map +1 -0
  27. package/dist/bootstrap/decorate-tool-primary.d.ts +50 -0
  28. package/dist/bootstrap/decorate-tool-primary.d.ts.map +1 -0
  29. package/dist/bootstrap/decorate-tool-primary.js +111 -0
  30. package/dist/bootstrap/decorate-tool-primary.js.map +1 -0
  31. package/dist/bootstrap/execute-post-bailout-bootstrap.d.ts.map +1 -1
  32. package/dist/bootstrap/execute-post-bailout-bootstrap.js +10 -0
  33. package/dist/bootstrap/execute-post-bailout-bootstrap.js.map +1 -1
  34. package/dist/bootstrap/index.d.ts +7 -1
  35. package/dist/bootstrap/index.d.ts.map +1 -1
  36. package/dist/bootstrap/index.js +15 -6
  37. package/dist/bootstrap/index.js.map +1 -1
  38. package/dist/bootstrap/io-plane.d.ts +47 -0
  39. package/dist/bootstrap/io-plane.d.ts.map +1 -0
  40. package/dist/bootstrap/io-plane.js +73 -0
  41. package/dist/bootstrap/io-plane.js.map +1 -0
  42. package/dist/bootstrap/load-tool-capabilities.d.ts.map +1 -1
  43. package/dist/bootstrap/load-tool-capabilities.js +18 -2
  44. package/dist/bootstrap/load-tool-capabilities.js.map +1 -1
  45. package/dist/bootstrap/owning-tool-init.d.ts.map +1 -1
  46. package/dist/bootstrap/owning-tool-init.js +7 -4
  47. package/dist/bootstrap/owning-tool-init.js.map +1 -1
  48. package/dist/bootstrap/phase-map.d.ts +20 -0
  49. package/dist/bootstrap/phase-map.d.ts.map +1 -0
  50. package/dist/bootstrap/phase-map.js +108 -0
  51. package/dist/bootstrap/phase-map.js.map +1 -0
  52. package/dist/bootstrap/pre-action-hook.d.ts.map +1 -1
  53. package/dist/bootstrap/pre-action-hook.js +24 -2
  54. package/dist/bootstrap/pre-action-hook.js.map +1 -1
  55. package/dist/bootstrap/register-tools-discovery.d.ts +42 -59
  56. package/dist/bootstrap/register-tools-discovery.d.ts.map +1 -1
  57. package/dist/bootstrap/register-tools-discovery.js +175 -97
  58. package/dist/bootstrap/register-tools-discovery.js.map +1 -1
  59. package/dist/bootstrap/register-tools-mount.d.ts +18 -1
  60. package/dist/bootstrap/register-tools-mount.d.ts.map +1 -1
  61. package/dist/bootstrap/register-tools-mount.js +118 -18
  62. package/dist/bootstrap/register-tools-mount.js.map +1 -1
  63. package/dist/bootstrap/register-tools.d.ts +58 -14
  64. package/dist/bootstrap/register-tools.d.ts.map +1 -1
  65. package/dist/bootstrap/register-tools.js +185 -14
  66. package/dist/bootstrap/register-tools.js.map +1 -1
  67. package/dist/bootstrap/root-version.d.ts +26 -0
  68. package/dist/bootstrap/root-version.d.ts.map +1 -0
  69. package/dist/bootstrap/root-version.js +36 -0
  70. package/dist/bootstrap/root-version.js.map +1 -0
  71. package/dist/bootstrap/scope-access.d.ts +26 -1
  72. package/dist/bootstrap/scope-access.d.ts.map +1 -1
  73. package/dist/bootstrap/scope-access.js +38 -1
  74. package/dist/bootstrap/scope-access.js.map +1 -1
  75. package/dist/bootstrap/skip-installed-plugins.d.ts +23 -0
  76. package/dist/bootstrap/skip-installed-plugins.d.ts.map +1 -0
  77. package/dist/bootstrap/skip-installed-plugins.js +30 -0
  78. package/dist/bootstrap/skip-installed-plugins.js.map +1 -0
  79. package/dist/bootstrap/tool-lifecycle.d.ts +0 -22
  80. package/dist/bootstrap/tool-lifecycle.d.ts.map +1 -1
  81. package/dist/bootstrap/tool-lifecycle.js +0 -23
  82. package/dist/bootstrap/tool-lifecycle.js.map +1 -1
  83. package/dist/bootstrap/tool-trust.d.ts +22 -2
  84. package/dist/bootstrap/tool-trust.d.ts.map +1 -1
  85. package/dist/bootstrap/tool-trust.js +25 -2
  86. package/dist/bootstrap/tool-trust.js.map +1 -1
  87. package/dist/bootstrap/validate-tool.d.ts +10 -4
  88. package/dist/bootstrap/validate-tool.d.ts.map +1 -1
  89. package/dist/bootstrap/validate-tool.js +76 -22
  90. package/dist/bootstrap/validate-tool.js.map +1 -1
  91. package/dist/cli-context.d.ts +2 -2
  92. package/dist/cli-context.d.ts.map +1 -1
  93. package/dist/cli-context.js +20 -35
  94. package/dist/cli-context.js.map +1 -1
  95. package/dist/commands/agent-catalog.d.ts +29 -0
  96. package/dist/commands/agent-catalog.d.ts.map +1 -1
  97. package/dist/commands/agent-catalog.js +77 -36
  98. package/dist/commands/agent-catalog.js.map +1 -1
  99. package/dist/commands/clear.d.ts.map +1 -1
  100. package/dist/commands/clear.js +0 -1
  101. package/dist/commands/clear.js.map +1 -1
  102. package/dist/commands/command-scope-index.d.ts +15 -1
  103. package/dist/commands/command-scope-index.d.ts.map +1 -1
  104. package/dist/commands/command-scope-index.js +10 -1
  105. package/dist/commands/command-scope-index.js.map +1 -1
  106. package/dist/commands/completion.d.ts +67 -6
  107. package/dist/commands/completion.d.ts.map +1 -1
  108. package/dist/commands/completion.js +84 -12
  109. package/dist/commands/completion.js.map +1 -1
  110. package/dist/commands/configure.d.ts.map +1 -1
  111. package/dist/commands/configure.js +0 -1
  112. package/dist/commands/configure.js.map +1 -1
  113. package/dist/commands/host-command-specs.d.ts +16 -9
  114. package/dist/commands/host-command-specs.d.ts.map +1 -1
  115. package/dist/commands/host-command-specs.js +45 -19
  116. package/dist/commands/host-command-specs.js.map +1 -1
  117. package/dist/commands/host-config-flag.d.ts +21 -0
  118. package/dist/commands/host-config-flag.d.ts.map +1 -0
  119. package/dist/commands/host-config-flag.js +21 -0
  120. package/dist/commands/host-config-flag.js.map +1 -0
  121. package/dist/commands/host-subcommand-groups.d.ts +46 -5
  122. package/dist/commands/host-subcommand-groups.d.ts.map +1 -1
  123. package/dist/commands/host-subcommand-groups.js +97 -65
  124. package/dist/commands/host-subcommand-groups.js.map +1 -1
  125. package/dist/commands/index.d.ts +1 -1
  126. package/dist/commands/index.js +1 -1
  127. package/dist/commands/internal-command-visibility.d.ts +42 -0
  128. package/dist/commands/internal-command-visibility.d.ts.map +1 -0
  129. package/dist/commands/internal-command-visibility.js +54 -0
  130. package/dist/commands/internal-command-visibility.js.map +1 -0
  131. package/dist/commands/mount-command-action.d.ts +5 -0
  132. package/dist/commands/mount-command-action.d.ts.map +1 -1
  133. package/dist/commands/mount-command-action.js +26 -2
  134. package/dist/commands/mount-command-action.js.map +1 -1
  135. package/dist/commands/mount-command-spec.d.ts +9 -2
  136. package/dist/commands/mount-command-spec.d.ts.map +1 -1
  137. package/dist/commands/mount-command-spec.js +9 -1
  138. package/dist/commands/mount-command-spec.js.map +1 -1
  139. package/dist/commands/plugin/domain-resolution.d.ts +12 -13
  140. package/dist/commands/plugin/domain-resolution.d.ts.map +1 -1
  141. package/dist/commands/plugin/domain-resolution.js +12 -58
  142. package/dist/commands/plugin/domain-resolution.js.map +1 -1
  143. package/dist/commands/plugin/host-dir.d.ts +0 -1
  144. package/dist/commands/plugin/host-dir.d.ts.map +1 -1
  145. package/dist/commands/plugin/host-dir.js +1 -1
  146. package/dist/commands/plugin/host-dir.js.map +1 -1
  147. package/dist/commands/plugin.d.ts +20 -14
  148. package/dist/commands/plugin.d.ts.map +1 -1
  149. package/dist/commands/plugin.js +39 -47
  150. package/dist/commands/plugin.js.map +1 -1
  151. package/dist/commands/render-outcome.d.ts.map +1 -1
  152. package/dist/commands/render-outcome.js.map +1 -1
  153. package/dist/commands/shared.d.ts +9 -0
  154. package/dist/commands/shared.d.ts.map +1 -1
  155. package/dist/commands/tools/create.d.ts +11 -0
  156. package/dist/commands/tools/create.d.ts.map +1 -0
  157. package/dist/commands/tools/create.js +84 -0
  158. package/dist/commands/tools/create.js.map +1 -0
  159. package/dist/commands/tools/index.d.ts.map +1 -1
  160. package/dist/commands/tools/index.js +31 -0
  161. package/dist/commands/tools/index.js.map +1 -1
  162. package/dist/commands/tools/runtime-probe-entry.d.ts.map +1 -1
  163. package/dist/commands/tools/runtime-probe-entry.js +4 -2
  164. package/dist/commands/tools/runtime-probe-entry.js.map +1 -1
  165. package/dist/commands/tools/validate.d.ts.map +1 -1
  166. package/dist/commands/tools/validate.js +12 -5
  167. package/dist/commands/tools/validate.js.map +1 -1
  168. package/dist/commands/uninstall.d.ts.map +1 -1
  169. package/dist/commands/uninstall.js +0 -1
  170. package/dist/commands/uninstall.js.map +1 -1
  171. package/dist/env/host-env-specs.d.ts +18 -0
  172. package/dist/env/host-env-specs.d.ts.map +1 -1
  173. package/dist/env/host-env-specs.js +58 -2
  174. package/dist/env/host-env-specs.js.map +1 -1
  175. package/dist/index.d.ts +1 -1
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.js +33 -11
  178. package/dist/index.js.map +1 -1
  179. package/dist/report-compose.d.ts.map +1 -1
  180. package/dist/report-compose.js +2 -2
  181. package/dist/report-compose.js.map +1 -1
  182. package/dist/session-replay-registry.d.ts +1 -1
  183. package/dist/session-replay-registry.d.ts.map +1 -1
  184. package/dist/session-replay-registry.js +3 -1
  185. package/dist/session-replay-registry.js.map +1 -1
  186. package/dist/telemetry/command-label.d.ts +19 -0
  187. package/dist/telemetry/command-label.d.ts.map +1 -0
  188. package/dist/telemetry/command-label.js +26 -0
  189. package/dist/telemetry/command-label.js.map +1 -0
  190. package/dist/telemetry/sdk-init.d.ts +9 -0
  191. package/dist/telemetry/sdk-init.d.ts.map +1 -1
  192. package/dist/telemetry/sdk-init.js +32 -0
  193. package/dist/telemetry/sdk-init.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 +29 -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 +1 @@
1
- {"version":3,"file":"register-tools-discovery.js","sourceRoot":"","sources":["../../src/bootstrap/register-tools-discovery.ts"],"names":[],"mappings":"AAAA,2LAA2L;AAC3L,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,+BAA+B,EAC/B,MAAM,EACN,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,GAKjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GAEpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAY9D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,yBAAyB,CACvC,GAAW,EACX,aAAqB;IAErB,MAAM,OA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CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACnF,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACb,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,uBAAuB,CAC/B,GAAG,IAAI,CAAC,MAAM,UAAU,IAAI,CAAC,EAAE,yCAAyC,IAAI,CAAC,MAAM,GAAG,YAAY,GAAG,EACrG,EAAE,UAAU,EAAE,sCAAsC,IAAI,CAAC,MAAM,EAAE,EAAE,CACpE,CAAC;IACJ,CAAC;IAED,yBAAyB,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAE/C,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type CliProgram } from '@opensip-cli/contracts';
2
- import { type ToolCliContext, type ToolRegistry } from '@opensip-cli/core';
2
+ import { type Tool, type ToolCliContext, type ToolRegistry } from '@opensip-cli/core';
3
3
  /**
4
4
  * Walk the registry and mount each tool's commands onto `program`. This is
5
5
  * **step 8** of the tool lifecycle (launch, §5.4) — see
@@ -22,4 +22,21 @@ import { type ToolCliContext, type ToolRegistry } from '@opensip-cli/core';
22
22
  * @param ctx The per-invocation handler context (render/emit/scope — no program).
23
23
  */
24
24
  export declare function mountAllToolCommands(registry: ToolRegistry, program: CliProgram, ctx: ToolCliContext): void;
25
+ /**
26
+ * Mount ONE tool's commands from its declared `commandSpecs` — the only command
27
+ * surface (public launch). Extracted so {@link mountAllToolCommands} keeps its
28
+ * per-tool failure isolation around a single call. A tool with no `commandSpecs`
29
+ * contributes nothing and is surfaced via `cli.tool.no_command_surface`.
30
+ *
31
+ * Nesting (`CommandSpec.parent`, tool-command-surface-taxonomy Task 0.4): a spec
32
+ * declaring `parent` is mounted as a SUBCOMMAND of the same-tool spec whose name
33
+ * matches `parent` (the tool's primary verb) — enabling the `<tool> <verb>`
34
+ * grammar (`graph export`, `fit list`). This is the SAME generic parent+leaf
35
+ * pattern the host already uses for `sessions`/`plugin`/`tools`
36
+ * (`host-command-specs.ts:mountHostCommands`): the parent's mounted Commander
37
+ * command (which also carries its own action) hosts the child via
38
+ * `mountCommandSpec(primaryCmd, child, ctx)`. No per-tool special case. Specs
39
+ * with no `parent` mount flat onto the root program exactly as before.
40
+ */
41
+ export declare function mountOneTool(program: CliProgram, tool: Tool, ctx: ToolCliContext): void;
25
42
  //# sourceMappingURL=register-tools-mount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-tools-mount.d.ts","sourceRoot":"","sources":["../../src/bootstrap/register-tools-mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAqB,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAO9F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,UAAU,EACnB,GAAG,EAAE,cAAc,GAClB,IAAI,CAqBN"}
1
+ {"version":3,"file":"register-tools-mount.d.ts","sourceRoot":"","sources":["../../src/bootstrap/register-tools-mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAU,KAAK,IAAI,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAY9F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,UAAU,EACnB,GAAG,EAAE,cAAc,GAClB,IAAI,CA2BN;AAqCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CA4BvF"}
@@ -1,7 +1,9 @@
1
1
  import { logger } from '@opensip-cli/core';
2
+ import { internalCommandNames, showInternalCommands, } from '../commands/internal-command-visibility.js';
2
3
  import { mountCommandSpec } from '../commands/mount-command-spec.js';
3
4
  import { bindToolCliContext } from './bind-tool-context.js';
4
- import { BOOTSTRAP_MODULE } from './register-tools-shared.js';
5
+ import { BOOTSTRAP_MODULE } from './constants.js';
6
+ import { decorateToolPrimary } from './decorate-tool-primary.js';
5
7
  /**
6
8
  * Walk the registry and mount each tool's commands onto `program`. This is
7
9
  * **step 8** of the tool lifecycle (launch, §5.4) — see
@@ -41,37 +43,135 @@ export function mountAllToolCommands(registry, program, ctx) {
41
43
  });
42
44
  }
43
45
  }
46
+ // tool-command-surface-taxonomy Task 1.2: hide Tier-3 internal commands from
47
+ // `--help`. This is the single place that has walked EVERY tool's commands, so
48
+ // the descriptor-driven hide policy lives here (the host owns it; tools never
49
+ // pass a hidden flag). The commands stay mounted + invocable — only their
50
+ // `--help` listing is suppressed. `OPENSIP_CLI_SHOW_INTERNAL=1` reveals them.
51
+ hideInternalCommands(registry, program);
44
52
  // ADR-0021: one shared help shape across every mounted command — uniform
45
53
  // option/subcommand ordering and a docs footer — applied here (the single
46
54
  // place that has walked every tool's commands) rather than per tool.
47
55
  applySharedHelpConfiguration(program);
48
56
  }
57
+ /**
58
+ * Hide every mounted command the tools declared `visibility: 'internal'`
59
+ * (Tier-3) from `--help`, unless `OPENSIP_CLI_SHOW_INTERNAL=1`
60
+ * ({@link showInternalCommands}).
61
+ *
62
+ * Mechanism: Commander omits a command from help when its `_hidden` property is
63
+ * `true`; the command stays fully invocable (`opensip graph-shard-worker <spec>`
64
+ * still runs). That is the documented, minimal "keep the subcommand but hide it"
65
+ * mechanism — there is no post-hoc public `.command(name, desc, { hidden })`
66
+ * path, so we set the property Commander itself reads for help filtering.
67
+ *
68
+ * The internal-name set is descriptor-driven ({@link internalCommandNames}) — the
69
+ * SAME source the completion inventory filters on — so help and completion stay
70
+ * in lockstep. Walks the full command tree (including nested `<tool> <verb>`
71
+ * children) so a future internal nested command is hidden too.
72
+ */
73
+ function hideInternalCommands(registry, program) {
74
+ if (showInternalCommands())
75
+ return; // reveal override — leave everything visible
76
+ const internal = internalCommandNames(registry);
77
+ if (internal.size === 0)
78
+ return;
79
+ const hide = (cmd) => {
80
+ for (const sub of cmd.commands) {
81
+ if (internal.has(sub.name())) {
82
+ // Commander 15 reads `_hidden` when filtering help; setting it true hides
83
+ // the command from `--help` while leaving it invocable. Typed via a
84
+ // narrow structural cast — `_hidden` is Commander-internal, not on the
85
+ // public `Command` type, but it is the property the help renderer reads.
86
+ sub._hidden = true;
87
+ }
88
+ hide(sub);
89
+ }
90
+ };
91
+ hide(program);
92
+ }
49
93
  /**
50
94
  * Mount ONE tool's commands from its declared `commandSpecs` — the only command
51
95
  * surface (public launch). Extracted so {@link mountAllToolCommands} keeps its
52
96
  * per-tool failure isolation around a single call. A tool with no `commandSpecs`
53
97
  * contributes nothing and is surfaced via `cli.tool.no_command_surface`.
98
+ *
99
+ * Nesting (`CommandSpec.parent`, tool-command-surface-taxonomy Task 0.4): a spec
100
+ * declaring `parent` is mounted as a SUBCOMMAND of the same-tool spec whose name
101
+ * matches `parent` (the tool's primary verb) — enabling the `<tool> <verb>`
102
+ * grammar (`graph export`, `fit list`). This is the SAME generic parent+leaf
103
+ * pattern the host already uses for `sessions`/`plugin`/`tools`
104
+ * (`host-command-specs.ts:mountHostCommands`): the parent's mounted Commander
105
+ * command (which also carries its own action) hosts the child via
106
+ * `mountCommandSpec(primaryCmd, child, ctx)`. No per-tool special case. Specs
107
+ * with no `parent` mount flat onto the root program exactly as before.
108
+ */
109
+ export function mountOneTool(program, tool, ctx) {
110
+ if (tool.commandSpecs === undefined || tool.commandSpecs.length === 0) {
111
+ // No declarative command surface — a mis-declared tool contributes no
112
+ // commands. Surface it rather than silently mounting nothing.
113
+ logger.warn({
114
+ evt: 'cli.tool.no_command_surface',
115
+ module: BOOTSTRAP_MODULE,
116
+ toolId: tool.metadata.id, // stable
117
+ toolName: tool.metadata.name ?? tool.metadata.id,
118
+ detail: 'tool declares no commandSpecs; no commands mounted',
119
+ });
120
+ return;
121
+ }
122
+ const toolCtx = bindToolCliContext(tool, ctx);
123
+ const mountedByName = mountFlatSpecs(program, tool, toolCtx);
124
+ // Host-owned uniform decoration of the tool PRIMARY (the flat run command
125
+ // whose name === metadata.name): per-tool `--version`, guaranteed
126
+ // `--cwd`/`--json`/`--config`, and `--quiet`/`--verbose`. Applied ONCE here
127
+ // in the mount layer (not re-declared per tool) and ONLY to the primary —
128
+ // never the nested `<tool> <verb>` children or Tier-3 workers. A tool that
129
+ // declares no primary (its name doesn't match a flat spec) gets no
130
+ // decoration, exactly as before.
131
+ const primaryCmd = mountedByName.get(tool.metadata.name);
132
+ if (primaryCmd !== undefined)
133
+ decorateToolPrimary(primaryCmd, tool);
134
+ mountNestedSpecs(program, tool, toolCtx, mountedByName);
135
+ }
136
+ /**
137
+ * First pass: mount every flat (no-`parent`) spec onto the root program,
138
+ * recording each mounted command by name so nested children can resolve their
139
+ * declared parent. `Tool.commandSpecs` is `CommandSpec<unknown, ToolCliContext>[]`,
140
+ * which is assignable to the mounter's `HostCommandSpec` (handler contravariance).
54
141
  */
55
- function mountOneTool(program, tool, ctx) {
56
- if (tool.commandSpecs !== undefined && tool.commandSpecs.length > 0) {
57
- const toolCtx = bindToolCliContext(tool, ctx);
58
- for (const spec of tool.commandSpecs) {
59
- // `Tool.commandSpecs` is `CommandSpec<unknown, ToolCliContext>[]`, which
60
- // is assignable to the mounter's `HostCommandSpec` (handler contravariance
61
- // — an `unknown`-opts handler accepts a `Record`-opts call). No cast.
142
+ function mountFlatSpecs(program, tool, toolCtx) {
143
+ const mountedByName = new Map();
144
+ for (const spec of tool.commandSpecs ?? []) {
145
+ if (spec.parent !== undefined)
146
+ continue;
147
+ mountedByName.set(spec.name, mountCommandSpec(program, spec, toolCtx));
148
+ }
149
+ return mountedByName;
150
+ }
151
+ /**
152
+ * Second pass: mount each `parent`-nested spec onto its parent's mounted command
153
+ * (the `<tool> <verb>` grammar). A spec whose declared parent was not mounted in
154
+ * this tool is surfaced loudly (and mounted flat at root) rather than silently
155
+ * dropped.
156
+ */
157
+ function mountNestedSpecs(program, tool, toolCtx, mountedByName) {
158
+ for (const spec of tool.commandSpecs ?? []) {
159
+ if (spec.parent === undefined)
160
+ continue;
161
+ const parentCmd = mountedByName.get(spec.parent);
162
+ if (parentCmd === undefined) {
163
+ logger.warn({
164
+ evt: 'cli.tool.unknown_command_parent',
165
+ module: BOOTSTRAP_MODULE,
166
+ toolId: tool.metadata.id, // stable
167
+ toolName: tool.metadata.name ?? tool.metadata.id,
168
+ detail: `command '${spec.name}' declares parent '${spec.parent}', which is not a flat command on this tool; mounting flat at root instead`,
169
+ });
62
170
  mountCommandSpec(program, spec, toolCtx);
171
+ continue;
63
172
  }
64
- return;
173
+ mountCommandSpec(parentCmd, spec, toolCtx);
65
174
  }
66
- // No declarative command surface — a mis-declared tool contributes no commands.
67
- // Surface it rather than silently mounting nothing.
68
- logger.warn({
69
- evt: 'cli.tool.no_command_surface',
70
- module: BOOTSTRAP_MODULE,
71
- toolId: tool.metadata.id, // stable
72
- toolName: tool.metadata.name ?? tool.metadata.id,
73
- detail: 'tool declares no commandSpecs; no commands mounted',
74
- });
75
175
  }
76
176
  const DOCS_HELP_FOOTER = '\nDocs: https://opensip.ai/docs/opensip-cli';
77
177
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"register-tools-mount.js","sourceRoot":"","sources":["../../src/bootstrap/register-tools-mount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAqD,MAAM,mBAAmB,CAAC;AAE9F,O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AC,MAAM,CAAC,CAAC;QACjD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC;gBACV,GAAG,EAAE,iCAAiC;gBACtC,MAAM,EAAE,gBAAgB;gBACxB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS;gBACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE;gBAChD,MAAM,EAAE,YAAY,IAAI,CAAC,IAAI,sBAAsB,IAAI,CAAC,MAAM,4EAA4E;aAC3I,CAAC,CAAC;YACH,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACzC,SAAS;QACX,CAAC;QACD,gBAAgB,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,MAAM,gBAAgB,GAAG,6CAA6C,CAAC;AAEvE;;;;GAIG;AACH,SAAS,4BAA4B,CAAC,OAAmB;IACvD,MAAM,SAAS,GAAG,CAAC,GAAe,EAAQ,EAAE;QAC1C,GAAG,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;QAChE,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ;YAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC,CAAC;IACF,SAAS,CAAC,OAAO,CAAC,CAAC;IACnB,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACjD,CAAC"}
@@ -1,18 +1,62 @@
1
1
  /**
2
- * register-tools — populate the kernel `ToolRegistry` with first-party
3
- * tools (fitness / simulation / graph) plus any third-party tool
4
- * packages discovered on disk.
2
+ * register-tools — populate the kernel ToolRegistry with bundled, installed,
3
+ * and authored tools (ADR-0027 / ADR-0041).
5
4
  *
6
- * Extracted from `index.ts`. The bundled-id skip below is defense in
7
- * depth: as of Layer 1 Phase 1 the registry itself enforces
8
- * first-writer-wins on duplicate ids and logs a structured
9
- * `tool.registry.duplicate` warning. Keeping the explicit guard avoids
10
- * a noisy warning when a third-party package happens to ship under a
11
- * built-in id.
5
+ * Merged registration cluster: manifest constants, bundled admission,
6
+ * installed/authored admission, and discovery walkers. Command mounting lives
7
+ * in register-tools-mount.ts.
12
8
  */
13
- export { BUNDLED_TOOL_PACKAGES, EXPECTED_SCAFFOLDING_TOOL_IDS } from './register-tools-shared.js';
14
- export { registerFirstPartyTools } from './register-tools-bundled.js';
15
- export { type DiscoveryOptions, buildToolDiscoverySources, discoverAndRegisterToolPackages, discoverAndRegisterAuthoredTools, } from './register-tools-discovery.js';
16
- export { type AuthoredAdmission, admitProjectLocalTool, admitUserGlobalTool, } from './authored-tool-admission.js';
17
- export { mountAllToolCommands } from './register-tools-mount.js';
9
+ import { type ToolPluginManifest, type ToolProvenance, type ToolRegistry } from '@opensip-cli/core';
10
+ export { BUNDLED_CAPABILITY_PACKS, BUNDLED_TOOL_PACKAGES, EXPECTED_SCAFFOLDING_TOOL_IDS, } from './bundled-manifest.js';
11
+ /**
12
+ * Resolve a bundled tool's PACKAGE DIR — the directory whose `package.json`
13
+ * carries the `opensipTools` manifest.
14
+ *
15
+ * The `./package.json` subpath is not declared in each engine's `exports`,
16
+ * so `require.resolve('<pkg>/package.json')` throws. Instead we resolve the
17
+ * package's MAIN entry (a bare-name resolve, always permitted by `exports`)
18
+ * and walk up to the nearest ancestor directory that has a `package.json`
19
+ * whose `name` matches `packageName`. That ancestor IS the tool's own
20
+ * package dir under both the source layout and pnpm's workspace-injected
21
+ * `node_modules` layout (verified against fitness/simulation/graph here).
22
+ *
23
+ * @returns the resolved package directory, or `undefined` when the package
24
+ * cannot be resolved (should never happen for a bundled direct dep).
25
+ */
26
+ export declare function resolveBundledPackageDir(packageName: string): string | undefined;
27
+ /**
28
+ * Resolve a bundled tool package's on-disk directory, requiring success.
29
+ *
30
+ * @throws {PluginIncompatibleError} when the package directory cannot be
31
+ * resolved on disk (its manifest is unreadable).
32
+ */
33
+ export declare function resolveRequiredBundledPackageDir(packageName: string): string;
34
+ /**
35
+ * Register the bundled first-party tools into the supplied registry, each one
36
+ * flowing through the SAME admit → dynamic-import → register path the external
37
+ * path uses (launch cutover — replaces the static-import + gate path).
38
+ *
39
+ * Per package name: `resolveBundledPackageDir` → `loadToolManifest('bundled')`
40
+ * → `admitTool({ source: 'bundled', explicitlyRequested: true })` →
41
+ * `importToolRuntime` (dynamic import + shape validation) → drift guard →
42
+ * `registry.register`. A bundled tool ships with the CLI, so it is always
43
+ * explicitly present: a missing/incompatible manifest or a runtime that fails
44
+ * to load is FAIL-CLOSED (never a silent skip). The recorded `ToolProvenance`
45
+ * (source `'bundled'`, trusted-by-shipping) and manifest are pushed onto the
46
+ * optional collectors so the composition root can surface provenance
47
+ * (`plugin list`) and seed the per-run capability registry (§5.3).
48
+ *
49
+ * @param registry The per-invocation tool registry to populate.
50
+ * @param provenance Optional sink for the admitted tools' provenance records.
51
+ * @param manifests Optional sink for the admitted tools' manifests (§5.3).
52
+ * @param packages The bundled package names to load (defaults to
53
+ * {@link BUNDLED_TOOL_PACKAGES}; injectable so the fail-closed paths are
54
+ * testable with fixture packages).
55
+ * @throws {PluginIncompatibleError} when a bundled tool cannot be resolved,
56
+ * has no conformant manifest, is out of range, or its runtime fails to load
57
+ * — mapped to `EXIT_CODES.PLUGIN_INCOMPATIBLE` (exit 5) by the CLI boundary.
58
+ */
59
+ export declare function registerFirstPartyTools(registry: ToolRegistry, provenance?: ToolProvenance[], manifests?: ToolPluginManifest[], packages?: readonly string[]): Promise<void>;
60
+ export { admitProjectLocalTool, admitUserGlobalTool, buildToolDiscoverySources, discoverAndRegisterAuthoredTools, discoverAndRegisterToolPackages, emitInstalledLoadFailure, type AuthoredAdmission, type DiscoveryOptions, } from './register-tools-discovery.js';
61
+ export { mountAllToolCommands, mountOneTool } from './register-tools-mount.js';
18
62
  //# sourceMappingURL=register-tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-tools.d.ts","sourceRoot":"","sources":["../../src/bootstrap/register-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAElG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EACL,KAAK,gBAAgB,EACrB,yBAAyB,EACzB,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,KAAK,iBAAiB,EACtB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"register-tools.d.ts","sourceRoot":"","sources":["../../src/bootstrap/register-tools.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAMH,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAK/B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAkChF;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAO5E;AAQD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,YAAY,EACtB,UAAU,GAAE,cAAc,EAAO,EACjC,SAAS,GAAE,kBAAkB,EAAO,EACpC,QAAQ,GAAE,SAAS,MAAM,EAA0B,GAClD,OAAO,CAAC,IAAI,CAAC,CAwCf;AA8DD,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,gCAAgC,EAChC,+BAA+B,EAC/B,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,18 +1,189 @@
1
+ // @fitness-ignore-file performance-anti-patterns -- sequential await across discovered tool packages preserves load order for plugin-conflict detection; bounded by installed plugin count
1
2
  /**
2
- * register-tools — populate the kernel `ToolRegistry` with first-party
3
- * tools (fitness / simulation / graph) plus any third-party tool
4
- * packages discovered on disk.
3
+ * register-tools — populate the kernel ToolRegistry with bundled, installed,
4
+ * and authored tools (ADR-0027 / ADR-0041).
5
5
  *
6
- * Extracted from `index.ts`. The bundled-id skip below is defense in
7
- * depth: as of Layer 1 Phase 1 the registry itself enforces
8
- * first-writer-wins on duplicate ids and logs a structured
9
- * `tool.registry.duplicate` warning. Keeping the explicit guard avoids
10
- * a noisy warning when a third-party package happens to ship under a
11
- * built-in id.
6
+ * Merged registration cluster: manifest constants, bundled admission,
7
+ * installed/authored admission, and discovery walkers. Command mounting lives
8
+ * in register-tools-mount.ts.
12
9
  */
13
- export { BUNDLED_TOOL_PACKAGES, EXPECTED_SCAFFOLDING_TOOL_IDS } from './register-tools-shared.js';
14
- export { registerFirstPartyTools } from './register-tools-bundled.js';
15
- export { buildToolDiscoverySources, discoverAndRegisterToolPackages, discoverAndRegisterAuthoredTools, } from './register-tools-discovery.js';
16
- export { admitProjectLocalTool, admitUserGlobalTool, } from './authored-tool-admission.js';
17
- export { mountAllToolCommands } from './register-tools-mount.js';
10
+ import { existsSync, readFileSync } from 'node:fs';
11
+ import { createRequire } from 'node:module';
12
+ import { dirname, join } from 'node:path';
13
+ import { logger, PluginIncompatibleError, } from '@opensip-cli/core';
14
+ import { admitToolPackage } from './admit-tool-package.js';
15
+ import { BUNDLED_TOOL_PACKAGES } from './bundled-manifest.js';
16
+ import { BOOTSTRAP_MODULE } from './constants.js';
17
+ export { BUNDLED_CAPABILITY_PACKS, BUNDLED_TOOL_PACKAGES, EXPECTED_SCAFFOLDING_TOOL_IDS, } from './bundled-manifest.js';
18
+ /** Used to resolve the bundled engine package dirs from the CLI's own module graph. */
19
+ const requireFromHere = createRequire(import.meta.url);
20
+ /**
21
+ * Resolve a bundled tool's PACKAGE DIR — the directory whose `package.json`
22
+ * carries the `opensipTools` manifest.
23
+ *
24
+ * The `./package.json` subpath is not declared in each engine's `exports`,
25
+ * so `require.resolve('<pkg>/package.json')` throws. Instead we resolve the
26
+ * package's MAIN entry (a bare-name resolve, always permitted by `exports`)
27
+ * and walk up to the nearest ancestor directory that has a `package.json`
28
+ * whose `name` matches `packageName`. That ancestor IS the tool's own
29
+ * package dir under both the source layout and pnpm's workspace-injected
30
+ * `node_modules` layout (verified against fitness/simulation/graph here).
31
+ *
32
+ * @returns the resolved package directory, or `undefined` when the package
33
+ * cannot be resolved (should never happen for a bundled direct dep).
34
+ */
35
+ export function resolveBundledPackageDir(packageName) {
36
+ let resolvedEntry;
37
+ try {
38
+ resolvedEntry = requireFromHere.resolve(packageName);
39
+ }
40
+ catch (error) {
41
+ // A bundled direct dep failing to resolve is a packaging fault — log it
42
+ // so the subsequent fail-closed throw is diagnosable, then signal the
43
+ // unresolved state to the caller (which raises PluginIncompatibleError).
44
+ logger.debug({
45
+ evt: 'cli.tool.bundled_unresolved',
46
+ module: BOOTSTRAP_MODULE,
47
+ packageName,
48
+ error: error instanceof Error ? error.message : String(error),
49
+ });
50
+ return undefined;
51
+ }
52
+ let dir = dirname(resolvedEntry);
53
+ for (let i = 0; i < 50; i++) {
54
+ const pkgPath = join(dir, 'package.json');
55
+ if (existsSync(pkgPath)) {
56
+ try {
57
+ const json = JSON.parse(readFileSync(pkgPath, 'utf8'));
58
+ if (json.name === packageName)
59
+ return dir;
60
+ }
61
+ catch {
62
+ // @swallow-ok unreadable package.json on the walk-up — keep climbing.
63
+ }
64
+ }
65
+ const parent = dirname(dir);
66
+ if (parent === dir)
67
+ break;
68
+ dir = parent;
69
+ }
70
+ return undefined;
71
+ }
72
+ /**
73
+ * Resolve a bundled tool package's on-disk directory, requiring success.
74
+ *
75
+ * @throws {PluginIncompatibleError} when the package directory cannot be
76
+ * resolved on disk (its manifest is unreadable).
77
+ */
78
+ export function resolveRequiredBundledPackageDir(packageName) {
79
+ const dir = resolveBundledPackageDir(packageName);
80
+ if (dir !== undefined)
81
+ return dir;
82
+ throw new PluginIncompatibleError(`bundled tool '${packageName}' could not be resolved on disk; its manifest is unreadable`, { diagnostic: 'package directory not resolvable' });
83
+ }
84
+ // The runtime-load primitive (`importToolRuntime` + `ToolRuntimeLoad`) and the
85
+ // full admission SEQUENCE (`admitToolPackage`) live in `admit-tool-package.ts`
86
+ // (ADR-0041: one validator, four consumers). This file keeps the per-source
87
+ // POLICY: bundled fails closed below; the installed/authored legs skip with
88
+ // diagnostics.
89
+ /**
90
+ * Register the bundled first-party tools into the supplied registry, each one
91
+ * flowing through the SAME admit → dynamic-import → register path the external
92
+ * path uses (launch cutover — replaces the static-import + gate path).
93
+ *
94
+ * Per package name: `resolveBundledPackageDir` → `loadToolManifest('bundled')`
95
+ * → `admitTool({ source: 'bundled', explicitlyRequested: true })` →
96
+ * `importToolRuntime` (dynamic import + shape validation) → drift guard →
97
+ * `registry.register`. A bundled tool ships with the CLI, so it is always
98
+ * explicitly present: a missing/incompatible manifest or a runtime that fails
99
+ * to load is FAIL-CLOSED (never a silent skip). The recorded `ToolProvenance`
100
+ * (source `'bundled'`, trusted-by-shipping) and manifest are pushed onto the
101
+ * optional collectors so the composition root can surface provenance
102
+ * (`plugin list`) and seed the per-run capability registry (§5.3).
103
+ *
104
+ * @param registry The per-invocation tool registry to populate.
105
+ * @param provenance Optional sink for the admitted tools' provenance records.
106
+ * @param manifests Optional sink for the admitted tools' manifests (§5.3).
107
+ * @param packages The bundled package names to load (defaults to
108
+ * {@link BUNDLED_TOOL_PACKAGES}; injectable so the fail-closed paths are
109
+ * testable with fixture packages).
110
+ * @throws {PluginIncompatibleError} when a bundled tool cannot be resolved,
111
+ * has no conformant manifest, is out of range, or its runtime fails to load
112
+ * — mapped to `EXIT_CODES.PLUGIN_INCOMPATIBLE` (exit 5) by the CLI boundary.
113
+ */
114
+ export async function registerFirstPartyTools(registry, provenance = [], manifests = [], packages = BUNDLED_TOOL_PACKAGES) {
115
+ for (const packageName of packages) {
116
+ const dir = resolveRequiredBundledPackageDir(packageName);
117
+ // The shared admission SEQUENCE (ADR-0041). The bundled POLICY below maps
118
+ // each failed section to the exact fail-closed error this path always
119
+ // threw — a bundled tool ships with the CLI, so every failure is a
120
+ // packaging fault, never a silent skip.
121
+ const report = await admitToolPackage({
122
+ dir,
123
+ source: 'bundled',
124
+ packageName,
125
+ // A bundled tool ships with the CLI; it is always explicitly present,
126
+ // so an incompatible manifest fails the run rather than skipping.
127
+ explicitlyRequested: true,
128
+ });
129
+ if (!report.ok) {
130
+ // @fitness-ignore-next-line detached-promises -- synchronous never-returning thrower; the heuristic mistakes the bare call for an unawaited promise
131
+ throwBundledAdmissionFailure(packageName, report);
132
+ }
133
+ /* v8 ignore next 3 -- throwBundledAdmissionFailure never returns on a failed report; this guard narrows types */
134
+ if (report.tool === undefined ||
135
+ report.provenance === undefined ||
136
+ report.manifest === undefined) {
137
+ throw new PluginIncompatibleError(`bundled tool '${packageName}' produced an incomplete admission report`, { diagnostic: 'incomplete admission report' });
138
+ }
139
+ registry.register(report.tool);
140
+ provenance.push(report.provenance);
141
+ // Record the manifest so the pre-action-hook can register this tool's
142
+ // declared capability domains into the per-run capability registry
143
+ // (launch, §5.3).
144
+ manifests.push(report.manifest);
145
+ }
146
+ }
147
+ /**
148
+ * The bundled FAIL-CLOSED policy: convert a failed {@link AdmissionReport}
149
+ * into the same `PluginIncompatibleError` (message + diagnostic) the inline
150
+ * pipeline threw before the ADR-0041 factoring. Never returns.
151
+ *
152
+ * @throws {PluginIncompatibleError} always (or rethrows the original
153
+ * coherence error from `assertManifestMatchesTool`, preserving its type).
154
+ */
155
+ function throwBundledAdmissionFailure(packageName, report) {
156
+ const failed = report.sections.find((s) => !s.ok);
157
+ const failedSection = failed?.section;
158
+ if (failedSection === 'manifest') {
159
+ throw new PluginIncompatibleError(`bundled tool '${packageName}' has no conformant package.json#opensipTools manifest`, { diagnostic: 'manifest missing or malformed' });
160
+ }
161
+ const id = report.manifest?.id ?? packageName;
162
+ if (failedSection === 'compatibility') {
163
+ if (report.compatibilityDecision === 'fail-closed') {
164
+ throw new PluginIncompatibleError(`bundled tool '${id}' is incompatible: ${failed?.diagnostic ?? 'compatibility gate rejected it'}`, { diagnostic: failed?.diagnostic });
165
+ }
166
+ if (report.compatibilityDecision === 'skip') {
167
+ // Should not happen for an in-range bundled tool, but never silently
168
+ // drop a bundled tool — surface it loudly.
169
+ throw new PluginIncompatibleError(`bundled tool '${id}' was skipped by the compatibility gate: ${failed?.diagnostic ?? 'unknown reason'}`, { diagnostic: failed?.diagnostic });
170
+ }
171
+ throw new PluginIncompatibleError(`bundled tool '${id}' reached an unknown admission decision`, { diagnostic: 'unknown admission decision' });
172
+ }
173
+ if (failedSection === 'runtime-load' || failedSection === 'tool-shape') {
174
+ const reason = report.runtimeLoadReason ?? 'import-failed';
175
+ const detailSuffix = report.runtimeLoadDetail ? `: ${report.runtimeLoadDetail}` : '';
176
+ throw new PluginIncompatibleError(`bundled tool '${id}' failed to load via the plugin path (${reason}${detailSuffix})`, { diagnostic: `bundled tool runtime load failed: ${reason}` });
177
+ }
178
+ if (failedSection === 'manifest-runtime-coherence' && report.coherenceError instanceof Error) {
179
+ // Preserve the original drift-guard error type + message untouched.
180
+ // (assertManifestMatchesTool always throws Error subclasses; the
181
+ // instanceof narrowing satisfies only-throw-error without a cast.)
182
+ throw report.coherenceError;
183
+ }
184
+ /* v8 ignore next 4 -- defensive: a failed report always carries a failed section */
185
+ throw new PluginIncompatibleError(`bundled tool '${packageName}' failed admission for an unknown reason`, { diagnostic: 'unknown admission failure' });
186
+ }
187
+ export { admitProjectLocalTool, admitUserGlobalTool, buildToolDiscoverySources, discoverAndRegisterAuthoredTools, discoverAndRegisterToolPackages, emitInstalledLoadFailure, } from './register-tools-discovery.js';
188
+ export { mountAllToolCommands, mountOneTool } from './register-tools-mount.js';
18
189
  //# sourceMappingURL=register-tools.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-tools.js","sourceRoot":"","sources":["../../src/bootstrap/register-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAElG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAEL,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"register-tools.js","sourceRoot":"","sources":["../../src/bootstrap/register-tools.ts"],"names":[],"mappings":"AAAA,2LAA2L;AAC3L;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EACL,MAAM,EACN,uBAAuB,GAIxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAwB,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,6BAA6B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AAE,UAAU,IAAI,gBAAgB,EAAE,EACvG,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,CACnC,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,uBAAuB,CAC/B,iBAAiB,EAAE,yCAAyC,EAC5D,EAAE,UAAU,EAAE,4BAA4B,EAAE,CAC7C,CAAC;IACJ,CAAC;IACD,IAAI,aAAa,KAAK,cAAc,IAAI,aAAa,KAAK,YAAY,EAAE,CAAC;QACvE,MAAM,MAAM,GAAG,MAAM,CAAC,iBAAiB,IAAI,eAAe,CAAC;QAC3D,MAAM,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrF,MAAM,IAAI,uBAAuB,CAC/B,iBAAiB,EAAE,yCAAyC,MAAM,GAAG,YAAY,GAAG,EACpF,EAAE,UAAU,EAAE,qCAAqC,MAAM,EAAE,EAAE,CAC9D,CAAC;IACJ,CAAC;IACD,IAAI,aAAa,KAAK,4BAA4B,IAAI,MAAM,CAAC,cAAc,YAAY,KAAK,EAAE,CAAC;QAC7F,oEAAoE;QACpE,iEAAiE;QACjE,mEAAmE;QACnE,MAAM,MAAM,CAAC,cAAc,CAAC;IAC9B,CAAC;IACD,oFAAoF;IACpF,MAAM,IAAI,uBAAuB,CAC/B,iBAAiB,WAAW,0CAA0C,EACtE,EAAE,UAAU,EAAE,2BAA2B,EAAE,CAC5C,CAAC;AACJ,CAAC;AAED,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,gCAAgC,EAChC,+BAA+B,EAC/B,wBAAwB,GAGzB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * root-version — host-owned detection of the bare `opensip --version` request.
3
+ *
4
+ * The root program deliberately carries NO Commander `.version()` option: a root
5
+ * version option is GLOBAL and would intercept `--version` even after a known
6
+ * subcommand, so `opensip fit --version` would print the CLI version instead of
7
+ * the tool's. The per-tool `--version` is a subcommand-local Commander version
8
+ * option (`decorateToolPrimary`); the bare CLI form is detected here, before
9
+ * Commander parses, so the two never collide.
10
+ *
11
+ * Kept in its own module (rather than inline in the composition root) so it is
12
+ * unit-testable without importing `index.ts` — whose top-level `await main()`
13
+ * side-effect would run the whole CLI on import.
14
+ */
15
+ /**
16
+ * Is this argv a BARE `opensip --version` / `-V` (the CLI version), as opposed to
17
+ * a tool primary's own `opensip <tool> --version`?
18
+ *
19
+ * The bare form has `--version` / `-V` with NO subcommand (positional) token
20
+ * before it. A `--version` that follows a subcommand belongs to that subcommand
21
+ * and is left for Commander (and `decorateToolPrimary`).
22
+ *
23
+ * @param argv `process.argv.slice(2)` — the user-supplied args after the binary.
24
+ */
25
+ export declare function isRootVersionRequest(argv: readonly string[]): boolean;
26
+ //# sourceMappingURL=root-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-version.d.ts","sourceRoot":"","sources":["../../src/bootstrap/root-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAQrE"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * root-version — host-owned detection of the bare `opensip --version` request.
3
+ *
4
+ * The root program deliberately carries NO Commander `.version()` option: a root
5
+ * version option is GLOBAL and would intercept `--version` even after a known
6
+ * subcommand, so `opensip fit --version` would print the CLI version instead of
7
+ * the tool's. The per-tool `--version` is a subcommand-local Commander version
8
+ * option (`decorateToolPrimary`); the bare CLI form is detected here, before
9
+ * Commander parses, so the two never collide.
10
+ *
11
+ * Kept in its own module (rather than inline in the composition root) so it is
12
+ * unit-testable without importing `index.ts` — whose top-level `await main()`
13
+ * side-effect would run the whole CLI on import.
14
+ */
15
+ /**
16
+ * Is this argv a BARE `opensip --version` / `-V` (the CLI version), as opposed to
17
+ * a tool primary's own `opensip <tool> --version`?
18
+ *
19
+ * The bare form has `--version` / `-V` with NO subcommand (positional) token
20
+ * before it. A `--version` that follows a subcommand belongs to that subcommand
21
+ * and is left for Commander (and `decorateToolPrimary`).
22
+ *
23
+ * @param argv `process.argv.slice(2)` — the user-supplied args after the binary.
24
+ */
25
+ export function isRootVersionRequest(argv) {
26
+ for (const token of argv) {
27
+ if (token === '--version' || token === '-V')
28
+ return true;
29
+ // The first non-flag token is the subcommand verb — any `--version` after it
30
+ // is the subcommand's, not the root's.
31
+ if (!token.startsWith('-'))
32
+ return false;
33
+ }
34
+ return false;
35
+ }
36
+ //# sourceMappingURL=root-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-version.js","sourceRoot":"","sources":["../../src/bootstrap/root-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAuB;IAC1D,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QACzB,IAAI,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QACzD,6EAA6E;QAC7E,uCAAuC;QACvC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;IAC3C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}