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
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Single orchestration vocabulary: maps lifecycle steps, pre-action phases, and
3
+ * the implementing modules. Replaces parallel taxonomies in tool-lifecycle.ts
4
+ * and pre-action-bootstrap-phases.ts as the one source of truth.
5
+ */
6
+ import { PRE_ACTION_PHASES } from './pre-action-bootstrap-phases.js';
7
+ import { TOOL_LIFECYCLE_STEPS } from './tool-lifecycle.js';
8
+ /** One row in the orchestration map. */
9
+ export interface PhaseMapEntry {
10
+ readonly lifecycleStep?: (typeof TOOL_LIFECYCLE_STEPS)[keyof typeof TOOL_LIFECYCLE_STEPS];
11
+ readonly preActionPhase?: (typeof PRE_ACTION_PHASES)[keyof typeof PRE_ACTION_PHASES];
12
+ readonly module: string;
13
+ readonly symbol: string;
14
+ }
15
+ /**
16
+ * Canonical phase map. Startup steps 1–4 live in `bootstrapCli`; step 8 in
17
+ * `mountAllToolCommands`; steps 5–7 and 9 in the pre-action executor.
18
+ */
19
+ export declare const BOOTSTRAP_PHASE_MAP: readonly PhaseMapEntry[];
20
+ //# sourceMappingURL=phase-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase-map.d.ts","sourceRoot":"","sources":["../../src/bootstrap/phase-map.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;IAC1F,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,aAAa,EA+F9C,CAAC"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Single orchestration vocabulary: maps lifecycle steps, pre-action phases, and
3
+ * the implementing modules. Replaces parallel taxonomies in tool-lifecycle.ts
4
+ * and pre-action-bootstrap-phases.ts as the one source of truth.
5
+ */
6
+ import { PRE_ACTION_PHASES } from './pre-action-bootstrap-phases.js';
7
+ import { TOOL_LIFECYCLE_STEPS } from './tool-lifecycle.js';
8
+ /**
9
+ * Canonical phase map. Startup steps 1–4 live in `bootstrapCli`; step 8 in
10
+ * `mountAllToolCommands`; steps 5–7 and 9 in the pre-action executor.
11
+ */
12
+ export const BOOTSTRAP_PHASE_MAP = [
13
+ {
14
+ lifecycleStep: TOOL_LIFECYCLE_STEPS.discover,
15
+ module: 'bootstrap/index.ts',
16
+ symbol: 'bootstrapCli → registerFirstPartyTools / discoverAndRegisterToolPackages',
17
+ },
18
+ {
19
+ lifecycleStep: TOOL_LIFECYCLE_STEPS.compat,
20
+ module: 'bootstrap/admit-tool-package.ts',
21
+ symbol: 'admitToolPackage',
22
+ },
23
+ {
24
+ lifecycleStep: TOOL_LIFECYCLE_STEPS.trust,
25
+ module: 'bootstrap/register-tools-discovery.ts',
26
+ symbol: 'admitProjectLocalTool',
27
+ },
28
+ {
29
+ lifecycleStep: TOOL_LIFECYCLE_STEPS.import,
30
+ module: 'bootstrap/validate-tool.ts',
31
+ symbol: 'isValidTool + ToolRegistry.register',
32
+ },
33
+ {
34
+ lifecycleStep: TOOL_LIFECYCLE_STEPS.config,
35
+ preActionPhase: PRE_ACTION_PHASES.buildScope,
36
+ module: 'bootstrap/config-and-capabilities.ts',
37
+ symbol: 'composeAndValidateToolConfig',
38
+ },
39
+ {
40
+ lifecycleStep: TOOL_LIFECYCLE_STEPS.scope,
41
+ preActionPhase: PRE_ACTION_PHASES.buildScope,
42
+ module: 'bootstrap/build-per-run-scope.ts',
43
+ symbol: 'buildPerRunScope → resolveToolHooks().contributeScope',
44
+ },
45
+ {
46
+ lifecycleStep: TOOL_LIFECYCLE_STEPS.capabilities,
47
+ preActionPhase: PRE_ACTION_PHASES.toolPreflight,
48
+ module: 'bootstrap/config-and-capabilities.ts',
49
+ symbol: 'wireCapabilityRegistry + loadOwningToolCapabilities',
50
+ },
51
+ {
52
+ lifecycleStep: TOOL_LIFECYCLE_STEPS.mount,
53
+ module: 'bootstrap/register-tools-mount.ts',
54
+ symbol: 'mountAllToolCommands (composition root)',
55
+ },
56
+ {
57
+ lifecycleStep: TOOL_LIFECYCLE_STEPS.initialize,
58
+ preActionPhase: PRE_ACTION_PHASES.toolPreflight,
59
+ module: 'bootstrap/owning-tool-init.ts',
60
+ symbol: 'maybeInitializeOwningTool',
61
+ },
62
+ {
63
+ lifecycleStep: TOOL_LIFECYCLE_STEPS.dispatch,
64
+ module: 'commands/mount-command-spec.ts',
65
+ symbol: 'mountCommandSpec action',
66
+ },
67
+ {
68
+ preActionPhase: PRE_ACTION_PHASES.readCommandOptions,
69
+ module: 'bootstrap/plan-pre-action-bootstrap.ts',
70
+ symbol: 'planPreActionBootstrap',
71
+ },
72
+ {
73
+ preActionPhase: PRE_ACTION_PHASES.mergeCliDefaults,
74
+ module: 'bootstrap/plan-pre-action-bootstrap.ts',
75
+ symbol: 'planPreActionBootstrap → mergeCliDefaults',
76
+ },
77
+ {
78
+ preActionPhase: PRE_ACTION_PHASES.resolveProject,
79
+ module: 'bootstrap/plan-pre-action-bootstrap.ts',
80
+ symbol: 'planPreActionBootstrap → resolveProjectContext',
81
+ },
82
+ {
83
+ preActionPhase: PRE_ACTION_PHASES.bailoutWindow,
84
+ module: 'bootstrap/pre-action-guards.ts',
85
+ symbol: 'pre-action guards',
86
+ },
87
+ {
88
+ preActionPhase: PRE_ACTION_PHASES.projectSideEffects,
89
+ module: 'bootstrap/execute-post-bailout-bootstrap.ts',
90
+ symbol: 'executePostBailoutBootstrap → projectSideEffects',
91
+ },
92
+ {
93
+ preActionPhase: PRE_ACTION_PHASES.enterScope,
94
+ module: 'bootstrap/execute-post-bailout-bootstrap.ts',
95
+ symbol: 'enterScope',
96
+ },
97
+ {
98
+ preActionPhase: PRE_ACTION_PHASES.hostStartEffects,
99
+ module: 'bootstrap/execute-post-bailout-bootstrap.ts',
100
+ symbol: 'executePostBailoutBootstrap → hostStartEffects',
101
+ },
102
+ {
103
+ preActionPhase: PRE_ACTION_PHASES.dispose,
104
+ module: 'bootstrap/pre-action-hook.ts',
105
+ symbol: 'disposeCurrentScope',
106
+ },
107
+ ];
108
+ //# sourceMappingURL=phase-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase-map.js","sourceRoot":"","sources":["../../src/bootstrap/phase-map.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,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oBAAoB,CAAC,QAAQ;QAC5C,MAAM,EAAE,gCAAgC;QACxC,MAAM,EAAE,yBAAyB;KAClC;IACD;QACE,cAAc,EAAE,iBAAiB,CAAC,kBAAkB;QACpD,MAAM,EAAE,wCAAwC;QAChD,MAAM,EAAE,wBAAwB;KACjC;IACD;QACE,cAAc,EAAE,iBAAiB,CAAC,gBAAgB;QAClD,MAAM,EAAE,wCAAwC;QAChD,MAAM,EAAE,2CAA2C;KACpD;IACD;QACE,cAAc,EAAE,iBAAiB,CAAC,cAAc;QAChD,MAAM,EAAE,wCAAwC;QAChD,MAAM,EAAE,gDAAgD;KACzD;IACD;QACE,cAAc,EAAE,iBAAiB,CAAC,aAAa;QAC/C,MAAM,EAAE,gCAAgC;QACxC,MAAM,EAAE,mBAAmB;KAC5B;IACD;QACE,cAAc,EAAE,iBAAiB,CAAC,kBAAkB;QACpD,MAAM,EAAE,6CAA6C;QACrD,MAAM,EAAE,kDAAkD;KAC3D;IACD;QACE,cAAc,EAAE,iBAAiB,CAAC,UAAU;QAC5C,MAAM,EAAE,6CAA6C;QACrD,MAAM,EAAE,YAAY;KACrB;IACD;QACE,cAAc,EAAE,iBAAiB,CAAC,gBAAgB;QAClD,MAAM,EAAE,6CAA6C;QACrD,MAAM,EAAE,gDAAgD;KACzD;IACD;QACE,cAAc,EAAE,iBAAiB,CAAC,OAAO;QACzC,MAAM,EAAE,8BAA8B;QACtC,MAAM,EAAE,qBAAqB;KAC9B;CACO,CAAC"}
@@ -6,17 +6,19 @@
6
6
  * datastore. Returns a {@link PreActionBootstrapPlan} the hook (or tests)
7
7
  * pass to the post-bailout executor.
8
8
  */
9
- import { type LoggerOptions, type ProjectContext, type ToolRegistry } from '@opensip-cli/core';
9
+ import { type LoggerOptions, type ProjectContext } from '@opensip-cli/core';
10
10
  import { PRE_ACTION_PHASES } from './pre-action-bootstrap-phases.js';
11
11
  import type { loadCliDefaults as loadCliDefaultsFn } from './cli-defaults.js';
12
+ import type { CommandScopeIndex } from '../commands/command-scope-index.js';
12
13
  export interface PlanPreActionBootstrapInput {
13
14
  readonly opts: Record<string, unknown>;
14
15
  readonly cwd: string;
15
16
  readonly cwdExplicit: boolean;
16
17
  readonly runId: string;
17
18
  readonly commandName: string;
19
+ readonly commandPath: string;
20
+ readonly commandScopes: CommandScopeIndex;
18
21
  readonly explicitConfigPath?: string;
19
- readonly tools: ToolRegistry;
20
22
  }
21
23
  export interface PreActionBootstrapPlan {
22
24
  readonly runId: string;
@@ -26,14 +28,12 @@ export interface PreActionBootstrapPlan {
26
28
  readonly cliDefaults: ReturnType<typeof loadCliDefaultsFn>;
27
29
  readonly project: ProjectContext;
28
30
  readonly commandName: string;
29
- readonly extraAgnostic: ReadonlySet<string>;
31
+ readonly commandPath: string;
30
32
  readonly jsonOutput: boolean;
31
33
  /** Per-run logger options computed after bailouts (ADR-0053). */
32
34
  readonly runLoggerOptions: LoggerOptions;
33
35
  readonly completedThrough: typeof PRE_ACTION_PHASES.bailoutWindow;
34
36
  }
35
- /** Collect tool CommandSpecs that declare `scope: 'none'` for no-project guard. */
36
- export declare function collectExtraAgnosticCommands(tools: ToolRegistry): ReadonlySet<string>;
37
37
  /**
38
38
  * Plan phases 1–4 (read options through bailout window). Throws
39
39
  * {@link BootstrapError} on config-resolve or bailout failures.
@@ -1 +1 @@
1
- {"version":3,"file":"plan-pre-action-bootstrap.d.ts","sourceRoot":"","sources":["../../src/bootstrap/plan-pre-action-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAOrE,OAAO,KAAK,EAAE,eAAe,IAAI,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EA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zC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,iBAAiB,CAAC,aAAa,CAAC;CACnE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,sBAAsB,CA6DjG"}
@@ -12,21 +12,6 @@ import { BootstrapError } from './bootstrap-error.js';
12
12
  import { loadCliDefaults, mergeConfigDefaults } from './cli-defaults.js';
13
13
  import { PRE_ACTION_PHASES } from './pre-action-bootstrap-phases.js';
14
14
  import { checkNoProjectAndBailout, checkSchemaVersionAndBailout, warnAboutPhantomRuntimes, } from './pre-action-guards.js';
15
- /** Collect tool CommandSpecs that declare `scope: 'none'` for no-project guard. */
16
- export function collectExtraAgnosticCommands(tools) {
17
- const extra = new Set();
18
- for (const tool of tools.list()) {
19
- for (const c of tool.commands || []) {
20
- if (c.scope === 'none') {
21
- extra.add(c.name);
22
- for (const alias of c.aliases ?? []) {
23
- extra.add(alias);
24
- }
25
- }
26
- }
27
- }
28
- return extra;
29
- }
30
15
  /**
31
16
  * Plan phases 1–4 (read options through bailout window). Throws
32
17
  * {@link BootstrapError} on config-resolve or bailout failures.
@@ -35,7 +20,7 @@ export function collectExtraAgnosticCommands(tools) {
35
20
  * guard bails out before project side effects are allowed.
36
21
  */
37
22
  export function planPreActionBootstrap(input) {
38
- const { opts, cwd, cwdExplicit, runId, commandName, tools, explicitConfigPath } = input;
23
+ const { opts, cwd, cwdExplicit, runId, commandName, commandPath, commandScopes, explicitConfigPath, } = input;
39
24
  const cliDefaults = loadCliDefaults(cwd, explicitConfigPath);
40
25
  mergeConfigDefaults(opts, cliDefaults);
41
26
  let project;
@@ -57,9 +42,8 @@ export function planPreActionBootstrap(input) {
57
42
  }
58
43
  opts.projectContext = project;
59
44
  opts.cwdExplicit = cwdExplicit;
60
- const extraAgnostic = collectExtraAgnosticCommands(tools);
61
45
  checkSchemaVersionAndBailout(project, runId);
62
- checkNoProjectAndBailout(project, cwd, commandName, runId, extraAgnostic);
46
+ checkNoProjectAndBailout(project, cwd, commandPath, runId, commandScopes);
63
47
  warnAboutPhantomRuntimes(project, opts.json === true);
64
48
  const runLoggerOptions = {
65
49
  silent: true,
@@ -77,7 +61,7 @@ export function planPreActionBootstrap(input) {
77
61
  cliDefaults,
78
62
  project,
79
63
  commandName,
80
- extraAgnostic,
64
+ commandPath,
81
65
  jsonOutput: opts.json === true,
82
66
  runLoggerOptions,
83
67
  completedThrough: PRE_ACTION_PHASES.bailoutWindow,
@@ -1 +1 @@
1
- {"version":3,"file":"plan-pre-action-bootstrap.js","sourceRoot":"","sources":["../../src/bootstrap/plan-pre-action-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GAIpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AA6BhC,mFAAmF;AACnF,MAAM,UAAU,4BAA4B,CAAC,KAAmB;IAC9D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAChC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;YACpC,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;gBACvB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBAClB,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;oBACpC,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I,CAAC,CAAC;IAEtD,MAAM,gBAAgB,GAAkB;QACtC,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAC9B,KAAK;QACL,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC;YAChE,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE;YAC9D,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;IAEF,OAAO;QACL,KAAK;QACL,GAAG;QACH,WAAW;QACX,IAAI;QACJ,WAAW;QACX,OAAO;QACP,WAAW;QACX,aAAa;QACb,UAAU,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI;QAC9B,gBAAgB;QAChB,gBAAgB,EAAE,iBAAiB,CAAC,aAAa;KAClD,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"plan-pre-action-bootstrap.js","sourceRoot":"","sources":["../../src/bootstrap/plan-pre-action-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GAGpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AA+BhC;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAkC;IACvE,MAAM,EACJ,IAAI,EACJ,GAAG,EACH,WAAW,EACX,KAAK,EACL,WAAW,EACX,WAAW,EACX,aAAa,EACb,kBAA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CAAC,EAAE,CAAC;KACR,CAAC;IAEF,OAAO;QACL,KAAK;QACL,GAAG;QACH,WAAW;QACX,IAAI;QACJ,WAAW;QACX,OAAO;QACP,WAAW;QACX,WAAW;QACX,UAAU,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI;QAC9B,gBAAgB;QAChB,gBAAgB,EAAE,iBAAiB,CAAC,aAAa;KAClD,CAAC;AACJ,CAAC"}
@@ -10,6 +10,7 @@
10
10
  * orchestration sequence and the per-tool `initialize()` lifecycle.
11
11
  */
12
12
  import { type ProjectContext } from '@opensip-cli/core';
13
+ import type { CommandScopeIndex } from '../commands/command-scope-index.js';
13
14
  /**
14
15
  * Schema-version bailout. THROWS a {@link BootstrapError} (exit 2) with the
15
16
  * "upgrade your CLI" message when the project config declares a schema newer than
@@ -32,7 +33,7 @@ export declare function checkSchemaVersionAndBailout(project: ProjectContext, ru
32
33
  * @throws {BootstrapError} (exit 2) when a project-scoped command runs with no
33
34
  * discoverable opensip-cli project (scope === 'none').
34
35
  */
35
- export declare function checkNoProjectAndBailout(project: ProjectContext, cwd: string, cmdName: string, runId: string, extraAgnostic?: ReadonlySet<string>): void;
36
+ export declare function checkNoProjectAndBailout(project: ProjectContext, cwd: string, commandPath: string, runId: string, commandScopes: CommandScopeIndex): void;
36
37
  /**
37
38
  * Phantom-runtime warning. Detects orphaned opensip-cli/.runtime/
38
39
  * subtrees between cwd and the discovered project root — fossils from
@@ -1 +1 @@
1
- {"version":3,"file":"pre-action-guards.d.ts","sourceRoot":"","sources":["../../src/bootstrap/pre-action-guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AA+B3B;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAmCzF;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,cAAc,EACvB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,aAAa,GAAE,WAAW,CAAC,MAAM,CAAa,GAC7C,IAAI,CAgBN;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAa3F"}
1
+ {"version":3,"file":"pre-action-guards.d.ts","sourceRoot":"","sources":["../../src/bootstrap/pre-action-guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAI5E;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAmCzF;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,cAAc,EACvB,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,iBAAiB,GAC/B,IAAI,CAeN;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAa3F"}
@@ -13,29 +13,6 @@ import { checkSchemaCompat, detectPhantomRuntimes, logger, readConfigSchemaVersi
13
13
  import { BootstrapError } from './bootstrap-error.js';
14
14
  import { formatCliTooOldMessage, formatNoProjectFoundMessage } from './pre-action-messages.js';
15
15
  const MODULE_TAG = 'cli:bootstrap';
16
- /**
17
- * Commands that operate WITHOUT requiring a project context. These don't
18
- * read project files or the datastore; running them from a directory
19
- * with no opensip-cli project is legitimate.
20
- *
21
- * Everything else is project-scoped: when `project.scope === 'none'`,
22
- * the hook emits the "No OpenSIP CLI project found" error and exits 2.
23
- *
24
- * Note: `uninstall --user` is project-agnostic, but `uninstall --project`
25
- * requires one. The check is per-command name here; uninstall's own
26
- * mode-specific guarding lives in its action body.
27
- *
28
- * The base list covers pure host commands. Tool CommandSpecs that declare
29
- * `scope: 'none'` are added dynamically at runtime (see pre-action-hook)
30
- * so the declared `CommandSpec.scope` actually controls behavior (previously
31
- * this list was the only source of truth, making the field dead for tools).
32
- */
33
- const PROJECT_AGNOSTIC_COMMANDS = new Set([
34
- 'init',
35
- 'configure',
36
- 'completion',
37
- 'uninstall',
38
- ]);
39
16
  /**
40
17
  * Schema-version bailout. THROWS a {@link BootstrapError} (exit 2) with the
41
18
  * "upgrade your CLI" message when the project config declares a schema newer than
@@ -94,16 +71,15 @@ export function checkSchemaVersionAndBailout(project, runId) {
94
71
  * @throws {BootstrapError} (exit 2) when a project-scoped command runs with no
95
72
  * discoverable opensip-cli project (scope === 'none').
96
73
  */
97
- export function checkNoProjectAndBailout(project, cwd, cmdName, runId, extraAgnostic = new Set()) {
98
- const effective = new Set([...PROJECT_AGNOSTIC_COMMANDS, ...extraAgnostic]);
99
- if (project.scope !== 'none' || effective.has(cmdName))
74
+ export function checkNoProjectAndBailout(project, cwd, commandPath, runId, commandScopes) {
75
+ if (project.scope !== 'none' || commandScopes.get(commandPath) === 'none')
100
76
  return;
101
77
  logger.warn({
102
78
  evt: 'cli.project.not-found',
103
79
  module: MODULE_TAG,
104
80
  runId,
105
81
  cwd,
106
- command: cmdName,
82
+ command: commandPath,
107
83
  });
108
84
  throw new BootstrapError({
109
85
  message: `No opensip-cli.config.yml found. Searched from ${cwd} upward.`,
@@ -1 +1 @@
1
- {"version":3,"file":"pre-action-guards.js","sourceRoot":"","sources":["../../src/bootstrap/pre-action-guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,MAAM,EACN,uBAAuB,GAExB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAA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AO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO;IAClE,MAAM,QAAQ,GAAG,qBAAqB,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACzE,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,2CAA2C;YACzC,OAAO,OAAO,IAAI;YAClB,2DAA2D;YAC3D,mEAAmE;YACnE,cAAc,OAAO,MAAM,CAC9B,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -6,9 +6,10 @@
6
6
  * to Commander's preAction/postAction hooks.
7
7
  */
8
8
  import type { PreActionRuntime } from './pre-action-runtime.js';
9
+ import type { CommandScopeIndex } from '../commands/command-scope-index.js';
9
10
  import type { Command } from 'commander';
10
11
  export { resolveOwningTool } from './owning-tool-init.js';
11
12
  export type { PreActionRuntime } from './pre-action-runtime.js';
12
- export declare function installPreActionHook(program: Command, version: string, runtime: PreActionRuntime): void;
13
+ export declare function installPreActionHook(program: Command, version: string, runtime: PreActionRuntime, commandScopes: CommandScopeIndex): void;
13
14
  export declare function disposeCurrentScope(): void;
14
15
  //# sourceMappingURL=pre-action-hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pre-action-hook.d.ts","sourceRoot":"","sources":["../../src/bootstrap/pre-action-hook.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAOH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gBAAgB,GACxB,IAAI,CAiCN;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAS1C"}
1
+ {"version":3,"file":"pre-action-hook.d.ts","sourceRoot":"","sources":["../../src/bootstrap/pre-action-hook.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAUH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAAE,iBAAiB,GAC/B,IAAI,CAyCN;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAiB1C"}
@@ -6,13 +6,22 @@
6
6
  * {@link executePostBailoutBootstrap} (phases 5–9). This module wires those
7
7
  * to Commander's preAction/postAction hooks.
8
8
  */
9
- import { currentScope, generatePrefixedId } from '@opensip-cli/core';
9
+ import { currentScope, exitScope, generatePrefixedId } from '@opensip-cli/core';
10
+ import { commandPath } from '../commands/command-scope-index.js';
11
+ import { hostEnv } from '../env/host-env-specs.js';
10
12
  import { executePostBailoutBootstrap } from './execute-post-bailout-bootstrap.js';
11
13
  import { planPreActionBootstrap } from './plan-pre-action-bootstrap.js';
12
14
  export { resolveOwningTool } from './owning-tool-init.js';
13
- export function installPreActionHook(program, version, runtime) {
15
+ export function installPreActionHook(program, version, runtime, commandScopes) {
14
16
  program.hook('preAction', async (_thisCommand, actionCommand) => {
15
- const runId = generatePrefixedId('run');
17
+ // B1 ("Child runId behavior"): resolve `runId` env-FIRST. A forked/spawned
18
+ // child re-enters this hook and inherits its parent's run via `OPENSIP_RUN_ID`
19
+ // (set in the child env by `correlationToEnv`); a top-level invocation, with
20
+ // no `OPENSIP_RUN_ID` set, mints a fresh id. This is the single inheritance
21
+ // seam — the spec JSON deliberately never carries `runId`, because the logger
22
+ // that stamps every worker line is already live before the spec is parsed.
23
+ const inherited = hostEnv.get('OPENSIP_RUN_ID');
24
+ const runId = inherited && inherited.length > 0 ? inherited : generatePrefixedId('run');
16
25
  const opts = actionCommand.opts();
17
26
  const cwd = opts.cwd ?? process.cwd();
18
27
  const cwdExplicit = actionCommand.getOptionValueSource('cwd') === 'cli';
@@ -22,8 +31,9 @@ export function installPreActionHook(program, version, runtime) {
22
31
  cwdExplicit,
23
32
  runId,
24
33
  commandName: actionCommand.name(),
34
+ commandPath: commandPath(actionCommand),
35
+ commandScopes,
25
36
  explicitConfigPath: opts.config,
26
- tools: runtime.tools,
27
37
  });
28
38
  const { scope } = await executePostBailoutBootstrap({
29
39
  plan,
@@ -47,5 +57,14 @@ export function disposeCurrentScope() {
47
57
  catch {
48
58
  // @swallow-ok dispose errors on shutdown; the run has already produced its outcome.
49
59
  }
60
+ finally {
61
+ // Complete the per-command lifecycle: clear the ambient ALS slot so a
62
+ // subsequent command in the same process (a long-lived host driving
63
+ // Commander sequentially) starts with a clean slot and its `enterScope`
64
+ // does not trip the always-on re-entrancy guard against this finished run.
65
+ // Production runs one command per process, so this is normally the final
66
+ // teardown; it is a no-op when no scope is current.
67
+ exitScope();
68
+ }
50
69
  }
51
70
  //# sourceMappingURL=pre-action-hook.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pre-action-hook.js","sourceRoot":"","sources":["../../src/bootstrap/pre-action-hook.ts"],"names":[],"mappings":"AAAA,qOAAqO;AACrO;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;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tool admission and discovery.
3
+ *
4
+ * Extracted from register-tools.ts so the bundled registration path stays a
5
+ * focused module under the file-length soft limit.
6
+ */
1
7
  import { type ToolPluginManifest, type ToolProvenance, type ToolRegistry, type ToolDiscoverySource } from '@opensip-cli/core';
8
+ import { type ToolRuntimeLoad } from './admit-tool-package.js';
9
+ import type { ToolAdmission } from './tool-admission-types.js';
10
+ export type AuthoredAdmission = ToolAdmission;
11
+ /**
12
+ * Admit or reject a PROJECT-LOCAL authored tool under the deny-by-default trust
13
+ * policy. The trust decision always precedes module import; a non-allowlisted
14
+ * tool fails closed before any authored code can run.
15
+ *
16
+ * @throws {PluginIncompatibleError} When the sidecar manifest is missing,
17
+ * malformed, incompatible, or not trusted by the project-tool allowlist.
18
+ */
19
+ export declare function admitProjectLocalTool(args: {
20
+ readonly dir: string;
21
+ readonly env?: NodeJS.ProcessEnv;
22
+ }): AuthoredAdmission;
23
+ /**
24
+ * Admit a USER-GLOBAL authored tool — trusted-by-default because the user placed
25
+ * it in their own home-dir tool host, but still fail-closed on a missing or
26
+ * incompatible manifest.
27
+ */
28
+ export declare function admitUserGlobalTool(args: {
29
+ readonly dir: string;
30
+ }): AuthoredAdmission;
31
+ /**
32
+ * Emit the best-effort stderr line + structured warning for a discovered
33
+ * INSTALLED tool whose runtime failed to load. Each failure reason maps to its
34
+ * own diagnostic while preserving the installed leg's skip-not-crash posture.
35
+ */
36
+ export declare function emitInstalledLoadFailure(name: string, load: Extract<ToolRuntimeLoad, {
37
+ ok: false;
38
+ }>): void;
2
39
  export interface DiscoveryOptions {
3
40
  /**
4
41
  * Ordered tool-discovery sources (precedence: first wins on duplicate
@@ -47,45 +84,7 @@ export declare function discoverAndRegisterToolPackages(registry: ToolRegistry,
47
84
  /**
48
85
  * Discover + admit + register AUTHORED Tool sidecars from the two authored
49
86
  * roots, then dynamic-import each admitted runtime through the shared
50
- * `importToolRuntime` seam — the same admit → import → register path the
51
- * bundled and installed legs travel (ADR-0027; this is the leg that makes the
52
- * dormant {@link admitProjectLocalTool} live).
53
- *
54
- * Two roots, two trust postures:
55
- * - **global** (`~/.opensip-cli/tools/`) → {@link admitUserGlobalTool},
56
- * trusted-by-default.
57
- * - **project** (`<project>/opensip-cli/tools/`) → {@link admitProjectLocalTool},
58
- * deny-by-default (allowlist via `OPENSIP_CLI_ALLOW_PROJECT_TOOLS`).
59
- *
60
- * Global is processed FIRST so a project-authored tool cannot shadow a same-id
61
- * global one — matching the `~/.opensip-cli/plugins` precedence note in
62
- * {@link buildToolDiscoverySources} (first-writer-wins via the registry).
63
- * `builtInIds` are skipped so an authored tool never shadows a bundled one.
64
- *
65
- * **Trust-before-import.** For each candidate, the admit step (which EMBEDS the
66
- * trust decision — deny-by-default inside `admitProjectLocalTool`) runs to
67
- * completion BEFORE `importToolRuntime`. A non-allowlisted project tool THROWS
68
- * `PluginIncompatibleError` (exit 5) here, propagated out of the walk: it must
69
- * fail the run loudly — that is the clone-protection contract.
70
- *
71
- * **Error-posture asymmetry (deliberate).** An un-allowlisted *project* tool is
72
- * fail-closed by policy (clone-risk; the user must opt in). A *global* tool that
73
- * fails to load is also fail-closed (the user explicitly authored it into
74
- * `$HOME`). This differs from the *installed* npm leg, where a stray bad plugin
75
- * skips-with-diagnostic so it can't take fit/graph/sim down — authored tools are
76
- * first-party-intent, installed tools are ambient.
77
- *
78
- * @param registry The per-invocation tool registry to populate.
79
- * @param opts.projectAuthoredDir `resolveProjectPaths(root).authoredToolsDir`,
80
- * or `undefined` when there is no resolvable project context.
81
- * @param opts.globalAuthoredDir `resolveUserPaths().authoredToolsDir`.
82
- * @param opts.env Environment carrying the project allowlist (default
83
- * `process.env`); injectable for tests.
84
- * @param builtInIds Bundled-tool ids to skip on a name collision.
85
- * @param provenance Sink for admitted authored tools' provenance records.
86
- * @param manifests Sink for admitted authored tools' manifests (§5.3).
87
- * @throws {PluginIncompatibleError} for an un-allowlisted project tool, or any
88
- * authored tool whose sidecar/runtime is missing/incompatible (fail-closed).
87
+ * `importToolRuntime` seam.
89
88
  */
90
89
  export declare function discoverAndRegisterAuthoredTools(registry: ToolRegistry, opts: {
91
90
  readonly projectAuthoredDir?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"register-tools-discovery.d.ts","sourceRoot":"","sources":["../../src/bootstrap/register-tools-discovery.ts"],"names":[],"mappings":"AACA,OAAO,EASL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAW3B,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAClD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,GACpB,mBAAmB,EAAE,CAqBvB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,+BAA+B,CACnD,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,EAC/B,UAAU,GAAE,cAAc,EAAO,EACjC,SAAS,GAAE,kBAAkB,EAAO,GACnC,OAAO,CAAC,IAAI,CAAC,CAoDf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAsB,gCAAgC,CACpD,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE;IACJ,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAClC,EACD,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,EAC/B,UAAU,GAAE,cAAc,EAAO,EACjC,SAAS,GAAE,kBAAkB,EAAO,GACnC,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
1
+ {"version":3,"file":"register-tools-discovery.d.ts","sourceRoot":"","sources":["../../src/bootstrap/register-tools-discovery.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,EAYL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAsC9C;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAClC,GAAG,iBAAiB,CAgBpB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAErF;AAoCD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,CAAC,eAAe,EAAE;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,CAAC,GAC5C,IAAI,CA0BN;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAClD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,GACpB,mBAAmB,EAAE,CAqBvB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,+BAA+B,CACnD,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,WAAW,CAAC,MA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