opensip-cli 0.1.4 → 0.1.6

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 (83) 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 +22 -2
  4. package/dist/bootstrap/admit-tool-package.js.map +1 -1
  5. package/dist/bootstrap/authored-tool-admission.d.ts +23 -0
  6. package/dist/bootstrap/authored-tool-admission.d.ts.map +1 -0
  7. package/dist/bootstrap/authored-tool-admission.js +54 -0
  8. package/dist/bootstrap/authored-tool-admission.js.map +1 -0
  9. package/dist/bootstrap/build-per-run-scope.d.ts.map +1 -1
  10. package/dist/bootstrap/build-per-run-scope.js +0 -14
  11. package/dist/bootstrap/build-per-run-scope.js.map +1 -1
  12. package/dist/bootstrap/config-and-capabilities.d.ts +5 -3
  13. package/dist/bootstrap/config-and-capabilities.d.ts.map +1 -1
  14. package/dist/bootstrap/config-and-capabilities.js +11 -8
  15. package/dist/bootstrap/config-and-capabilities.js.map +1 -1
  16. package/dist/bootstrap/execute-post-bailout-bootstrap.d.ts +1 -0
  17. package/dist/bootstrap/execute-post-bailout-bootstrap.d.ts.map +1 -1
  18. package/dist/bootstrap/execute-post-bailout-bootstrap.js +3 -2
  19. package/dist/bootstrap/execute-post-bailout-bootstrap.js.map +1 -1
  20. package/dist/bootstrap/installed-tool-admission.d.ts +20 -0
  21. package/dist/bootstrap/installed-tool-admission.d.ts.map +1 -0
  22. package/dist/bootstrap/installed-tool-admission.js +60 -0
  23. package/dist/bootstrap/installed-tool-admission.js.map +1 -0
  24. package/dist/bootstrap/load-tool-capabilities.d.ts +2 -2
  25. package/dist/bootstrap/load-tool-capabilities.d.ts.map +1 -1
  26. package/dist/bootstrap/load-tool-capabilities.js +2 -12
  27. package/dist/bootstrap/load-tool-capabilities.js.map +1 -1
  28. package/dist/bootstrap/plan-pre-action-bootstrap.d.ts +5 -5
  29. package/dist/bootstrap/plan-pre-action-bootstrap.d.ts.map +1 -1
  30. package/dist/bootstrap/plan-pre-action-bootstrap.js +3 -19
  31. package/dist/bootstrap/plan-pre-action-bootstrap.js.map +1 -1
  32. package/dist/bootstrap/pre-action-guards.d.ts +2 -1
  33. package/dist/bootstrap/pre-action-guards.d.ts.map +1 -1
  34. package/dist/bootstrap/pre-action-guards.js +3 -27
  35. package/dist/bootstrap/pre-action-guards.js.map +1 -1
  36. package/dist/bootstrap/pre-action-hook.d.ts +2 -1
  37. package/dist/bootstrap/pre-action-hook.d.ts.map +1 -1
  38. package/dist/bootstrap/pre-action-hook.js +4 -2
  39. package/dist/bootstrap/pre-action-hook.js.map +1 -1
  40. package/dist/bootstrap/register-tools-discovery.d.ts +0 -59
  41. package/dist/bootstrap/register-tools-discovery.d.ts.map +1 -1
  42. package/dist/bootstrap/register-tools-discovery.js +6 -179
  43. package/dist/bootstrap/register-tools-discovery.js.map +1 -1
  44. package/dist/bootstrap/register-tools.d.ts +2 -1
  45. package/dist/bootstrap/register-tools.d.ts.map +1 -1
  46. package/dist/bootstrap/register-tools.js +2 -1
  47. package/dist/bootstrap/register-tools.js.map +1 -1
  48. package/dist/bootstrap/tool-admission-types.d.ts +12 -0
  49. package/dist/bootstrap/tool-admission-types.d.ts.map +1 -0
  50. package/dist/bootstrap/tool-admission-types.js +2 -0
  51. package/dist/bootstrap/tool-admission-types.js.map +1 -0
  52. package/dist/bootstrap/validate-tool.d.ts +1 -1
  53. package/dist/bootstrap/validate-tool.d.ts.map +1 -1
  54. package/dist/bootstrap/validate-tool.js +6 -2
  55. package/dist/bootstrap/validate-tool.js.map +1 -1
  56. package/dist/commands/command-scope-index.d.ts +31 -0
  57. package/dist/commands/command-scope-index.d.ts.map +1 -0
  58. package/dist/commands/command-scope-index.js +42 -0
  59. package/dist/commands/command-scope-index.js.map +1 -0
  60. package/dist/commands/host-command-specs.js +2 -2
  61. package/dist/commands/host-command-specs.js.map +1 -1
  62. package/dist/commands/mount-command-action.d.ts +19 -0
  63. package/dist/commands/mount-command-action.d.ts.map +1 -0
  64. package/dist/commands/mount-command-action.js +54 -0
  65. package/dist/commands/mount-command-action.js.map +1 -0
  66. package/dist/commands/mount-command-spec-wiring.d.ts +24 -0
  67. package/dist/commands/mount-command-spec-wiring.d.ts.map +1 -0
  68. package/dist/commands/mount-command-spec-wiring.js +71 -0
  69. package/dist/commands/mount-command-spec-wiring.js.map +1 -0
  70. package/dist/commands/mount-command-spec.d.ts.map +1 -1
  71. package/dist/commands/mount-command-spec.js +2 -134
  72. package/dist/commands/mount-command-spec.js.map +1 -1
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +24 -17
  75. package/dist/index.js.map +1 -1
  76. package/dist/telemetry/profiling.d.ts +1 -1
  77. package/dist/telemetry/profiling.d.ts.map +1 -1
  78. package/dist/telemetry/profiling.js +93 -35
  79. package/dist/telemetry/profiling.js.map +1 -1
  80. package/dist/ui/result-to-view.d.ts.map +1 -1
  81. package/dist/ui/result-to-view.js +4 -12
  82. package/dist/ui/result-to-view.js.map +1 -1
  83. package/package.json +32 -32
@@ -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,EAAE,OAAO,CAAC,CAAC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ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
  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,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAkC;IACvE,MAAM,EAAE,IAAI,EAAE,GA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C,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,kBAAkB,GACnB,GAAG,KAAK,CAAC;IAEV,MAAM,WAAW,GAAG,eAAe,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;IAC7D,mBAAmB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAEvC,IAAI,OAAuB,CAAC;IAC5B,IAAI,CAAC;QACH,OAAO,GAAG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E,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,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAE/F,MAAM,UAAU,GAAG,eAAe,CAAC;AAEnC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,yBAAyB,GAAwB,IAAI,GAAG,CAAC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AAE,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;AASH,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,CAkCN;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAS1C"}
@@ -7,10 +7,11 @@
7
7
  * to Commander's preAction/postAction hooks.
8
8
  */
9
9
  import { currentScope, generatePrefixedId } from '@opensip-cli/core';
10
+ import { commandPath } from '../commands/command-scope-index.js';
10
11
  import { executePostBailoutBootstrap } from './execute-post-bailout-bootstrap.js';
11
12
  import { planPreActionBootstrap } from './plan-pre-action-bootstrap.js';
12
13
  export { resolveOwningTool } from './owning-tool-init.js';
13
- export function installPreActionHook(program, version, runtime) {
14
+ export function installPreActionHook(program, version, runtime, commandScopes) {
14
15
  program.hook('preAction', async (_thisCommand, actionCommand) => {
15
16
  const runId = generatePrefixedId('run');
16
17
  const opts = actionCommand.opts();
@@ -22,8 +23,9 @@ export function installPreActionHook(program, version, runtime) {
22
23
  cwdExplicit,
23
24
  runId,
24
25
  commandName: actionCommand.name(),
26
+ commandPath: commandPath(actionCommand),
27
+ commandScopes,
25
28
  explicitConfigPath: opts.config,
26
- tools: runtime.tools,
27
29
  });
28
30
  const { scope } = await executePostBailoutBootstrap({
29
31
  plan,
@@ -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,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;YACL,WAAW,EAAE,aAAa,CAAC,IAAI,EAAE;YACjC,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC;YACvC,aAAa;YACb,kBAAkB,EAAE,IAAI,CAAC,MAA4B;SACtD,CAAC,CAAC;QAEH,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,2BAA2B,CAAC;YAClD,IAAI;YACJ,OAAO;YACP,OAAO;YACP,iIAAiI;YACjI,OAAO,EAAE,aAAa,CAAC,eAAe,EAAE,CAAC,KAAK,KAAK,KAAK;YACxD,MAAM,EAAE,IAAI,CAAC,MAA4B;SAC1C,CAAC,CAAC;QACH,KAAK,CAAC,WAAW,CAAC,KAAK,CACrB,MAAM,EACN,OAAO,EACP,sCAAsC,aAAa,CAAC,IAAI,EAAE,GAAG,CAC9D,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,YAAY,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YACzC,CAAC,CAAC,OAAO,EAAE,CAAC;QACd,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,oFAAoF;IACtF,CAAC;AACH,CAAC"}
@@ -44,65 +44,6 @@ export declare function buildToolDiscoverySources(cwd: string, cliInstallDir: st
44
44
  * @param provenance Optional sink for admitted tools' provenance records.
45
45
  */
46
46
  export declare function discoverAndRegisterToolPackages(registry: ToolRegistry, opts: DiscoveryOptions, builtInIds: ReadonlySet<string>, provenance?: ToolProvenance[], manifests?: ToolPluginManifest[]): Promise<void>;
47
- /**
48
- * The outcome of admitting a tool — the recorded `ToolProvenance` plus the
49
- * loaded `ToolPluginManifest`. Returned by the authored legs
50
- * ({@link admitUserGlobalTool} / {@link admitProjectLocalTool}) and the
51
- * installed leg ({@link admitInstalledTool}) alike. The manifest is returned
52
- * (not re-read) so the register step can run the drift guard
53
- * (`assertManifestMatchesTool`) against the imported runtime and seed the
54
- * per-run capability registry, without a second filesystem read.
55
- */
56
- export interface AuthoredAdmission {
57
- readonly provenance: ToolProvenance;
58
- readonly manifest: ToolPluginManifest;
59
- }
60
- /**
61
- * Admit (or reject) a single PROJECT-LOCAL authored tool under the
62
- * deny-by-default trust policy (launch, Phase 3 Task 3.2; wired into
63
- * production discovery in the launch contract).
64
- *
65
- * A project-local tool is authored code under
66
- * `<project>/opensip-cli/tools/<name>/` declaring its identity via a JSON
67
- * sidecar (`opensip-tool.manifest.json`). It is read + gated WITHOUT importing
68
- * its module:
69
- *
70
- * 1. `loadToolManifest('project-local', dir)` — identity only, no code run.
71
- * 2. Trust check — {@link isProjectLocalToolTrusted}. Not allowlisted ⇒
72
- * throw {@link PluginIncompatibleError} (fail-closed, exit 5) before any
73
- * import. Allowlisted ⇒ run the shared compatibility tail; an incompatible
74
- * explicitly-trusted tool is likewise fail-closed.
75
- *
76
- * Returns the admitted tool's `{ provenance, manifest }` on success. The trust
77
- * decision always precedes import (it is the FIRST statement here, ahead of the
78
- * shared {@link admitAuthoredTool} tail).
79
- *
80
- * @throws {PluginIncompatibleError} when the tool has no conformant sidecar
81
- * manifest, is not allowlisted, or is compatibility-incompatible.
82
- */
83
- export declare function admitProjectLocalTool(args: {
84
- readonly dir: string;
85
- readonly env?: NodeJS.ProcessEnv;
86
- }): AuthoredAdmission;
87
- /**
88
- * Admit a single USER-GLOBAL authored tool — the trusted-by-default sibling of
89
- * {@link admitProjectLocalTool}.
90
- *
91
- * A user-global tool is an authored sidecar under
92
- * `~/.opensip-cli/tools/<name>/`. The user deliberately placed it in their
93
- * own home dir (the `npm i -g` analogue for authored code), so there is **no
94
- * allowlist gate** — it is trusted-by-default. It still reads the static
95
- * sidecar and runs `admitTool` BEFORE the module could be imported (the shared
96
- * {@link admitAuthoredTool} tail), so trust-before-import holds for this leg
97
- * too: a global tool the user explicitly authored is fail-closed on a
98
- * missing/incompatible manifest, never a silent skip.
99
- *
100
- * @throws {PluginIncompatibleError} when the tool has no conformant sidecar
101
- * manifest or is compatibility-incompatible.
102
- */
103
- export declare function admitUserGlobalTool(args: {
104
- readonly dir: string;
105
- }): AuthoredAdmission;
106
47
  /**
107
48
  * Discover + admit + register AUTHORED Tool sidecars from the two authored
108
49
  * roots, then dynamic-import each admitted runtime through the shared
@@ -1 +1 @@
1
- {"version":3,"file":"register-tools-discovery.d.ts","sourceRoot":"","sources":["../../src/bootstrap/register-tools-discovery.ts"],"names":[],"mappings":"AAEA,OAAO,EAYL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAM3B,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;AA6FD;;;;;;;;;;;;;;;;;;;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;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;CACvC;AAgDD;;;;;;;;;;;;;;;;;;;;;;GAsBG;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,CAuBpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAGrF;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,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,9 +1,9 @@
1
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
2
- // @fitness-ignore-file file-length-limit -- discovery admission remains one policy unit after the register-tools split; below the hard limit and slated for a later source-boundary split.
3
- import { admitTool, assertManifestMatchesTool, discoverAuthoredToolSidecars, discoverToolPackagesFromAnchors, loadToolManifest, logger, PluginIncompatibleError, PROJECT_LOCAL_MANIFEST_FILE, resolveProjectContext, resolveProjectPaths, resolveUserPaths, } from '@opensip-cli/core';
4
- import { importToolRuntime } from './admit-tool-package.js';
2
+ import { assertManifestMatchesTool, discoverAuthoredToolSidecars, discoverToolPackagesFromAnchors, logger, PluginIncompatibleError, resolveProjectContext, resolveProjectPaths, resolveUserPaths, } from '@opensip-cli/core';
3
+ import { hostRuntimeImportPolicyFor, importToolRuntime } from './admit-tool-package.js';
4
+ import { admitProjectLocalTool, admitUserGlobalTool, } from './authored-tool-admission.js';
5
+ import { admitInstalledTool, emitInstalledLoadFailure } from './installed-tool-admission.js';
5
6
  import { BOOTSTRAP_MODULE } from './register-tools-shared.js';
6
- import { isProjectLocalToolTrusted } from './tool-trust.js';
7
7
  /**
8
8
  * Build the ordered tool-discovery sources. Order is precedence
9
9
  * (first-occurrence-wins on duplicate name):
@@ -37,84 +37,6 @@ export function buildToolDiscoverySources(cwd, cliInstallDir) {
37
37
  sources.push({ dir: cwd, mode: 'walkUp' }, { dir: resolveUserPaths().pluginsDir('tool'), mode: 'scanDir' }, { dir: cliInstallDir, mode: 'walkUp' });
38
38
  return sources;
39
39
  }
40
- /**
41
- * Run the admission gate over a discovered INSTALLED tool package
42
- * before its module is imported. Reads the static
43
- * `package.json#opensipTools` manifest and runs the shared `admitTool` gate
44
- * (source `'installed'`, best-effort `explicitlyRequested: false` so an
45
- * incompatible installed tool skips rather than failing the whole CLI).
46
- *
47
- * Returns:
48
- * - `undefined` — skip this package (no conformant manifest, gate skipped
49
- * it, or its id collides with a built-in). The reason is logged.
50
- * - the admission `{ provenance, manifest }` — the manifest is conformant +
51
- * compatible; the caller continues to import + register, and records the
52
- * provenance/manifest only AFTER the runtime actually registered (so
53
- * `plugin list` and the capability registry never see a tool whose import
54
- * subsequently failed — matching the bundled/authored legs).
55
- *
56
- * Public launch: the grace window ended. A discovered `kind:'tool'` package whose
57
- * manifest is missing/malformed (`loadToolManifest` → undefined) or declares no
58
- * `apiVersion` (`admitTool` → skip via {@link checkCompatibility}) is no longer
59
- * admitted off the marker alone — it is rejected with a diagnostic.
60
- */
61
- function admitInstalledTool(pkg, builtInIds) {
62
- const manifest = loadToolManifest('installed', pkg.packageDir);
63
- if (manifest === undefined) {
64
- // Launch: a discovered tool with no conformant manifest is no longer admitted
65
- // off the `kind:'tool'` marker alone (the grace window ended) — skip it.
66
- process.stderr.write(`opensip: tool package ${pkg.name} has no conformant package.json#opensipTools manifest — skipping\n`);
67
- logger.warn({
68
- evt: 'cli.tool.manifest_invalid',
69
- module: BOOTSTRAP_MODULE,
70
- name: pkg.name,
71
- });
72
- return undefined;
73
- }
74
- if (builtInIds.has(manifest.id))
75
- return undefined; // builtInIds are human ids from manifests (compat)
76
- const result = admitTool({
77
- manifest,
78
- source: 'installed',
79
- dir: pkg.packageDir,
80
- packageName: pkg.name,
81
- // Best-effort: discovery alone can't tell whether THIS run targets this
82
- // tool's command, so default false → incompatible installed tools skip.
83
- explicitlyRequested: false,
84
- });
85
- if (result.decision !== 'admit')
86
- return undefined;
87
- return { provenance: result.provenance, manifest: result.manifest };
88
- }
89
- /**
90
- * Emit the best-effort stderr line + structured warning for a discovered
91
- * INSTALLED tool whose runtime failed to load. Each `ToolRuntimeLoad` failure
92
- * reason maps to its own message + event (preserving the admission diagnostics) —
93
- * an installed tool's load failure skips it, never crashing the CLI.
94
- */
95
- function emitInstalledLoadFailure(name, load) {
96
- if (load.reason === 'no-entry') {
97
- process.stderr.write(`opensip: tool package ${name} has no resolvable entry point — skipping\n`);
98
- logger.warn({ evt: 'cli.tool.no_entry', module: BOOTSTRAP_MODULE, name });
99
- return;
100
- }
101
- if (load.reason === 'invalid-shape') {
102
- process.stderr.write(`opensip: tool package ${name} does not export a valid \`tool\` — skipping\n`);
103
- logger.warn({
104
- evt: 'cli.tool.invalid_shape',
105
- module: BOOTSTRAP_MODULE,
106
- name,
107
- });
108
- return;
109
- }
110
- process.stderr.write(`opensip: failed to load tool ${name}: ${load.detail ?? 'import failed'}\n`);
111
- logger.warn({
112
- evt: 'cli.tool.load_failed',
113
- module: BOOTSTRAP_MODULE,
114
- name,
115
- error: load.detail,
116
- });
117
- }
118
40
  /**
119
41
  * Discover and register third-party tool packages from npm — any
120
42
  * `package.json` declaring `opensipTools.kind === 'tool'`. Built-in
@@ -155,7 +77,7 @@ export async function discoverAndRegisterToolPackages(registry, opts, builtInIds
155
77
  // module-resolution path still loads. An installed tool is best-effort:
156
78
  // any load failure skips-with-diagnostic (it must not take fit/graph/sim
157
79
  // down), in contrast to the bundled path's fail-closed.
158
- const load = await importToolRuntime(pkg.packageDir);
80
+ const load = await importToolRuntime(pkg.packageDir, hostRuntimeImportPolicyFor('installed'));
159
81
  if (!load.ok) {
160
82
  emitInstalledLoadFailure(pkg.name, load);
161
83
  continue;
@@ -187,101 +109,6 @@ export async function discoverAndRegisterToolPackages(registry, opts, builtInIds
187
109
  }
188
110
  }
189
111
  }
190
- /**
191
- * The shared admission TAIL for both authored sources.
192
- * When `preloadedManifest` is supplied we use that snapshot (no re-read) so a
193
- * prior trust decision (project-local) and the compat gate see the identical
194
- * declaration. This removes the TOCTOU between the trust-bearing read and the
195
- * gate read for the deny-by-default authored path.
196
- *
197
- * @throws {PluginIncompatibleError} when the sidecar is missing/malformed or
198
- * the tool is compatibility-incompatible.
199
- */
200
- function admitAuthoredTool(source, dir, preloadedManifest) {
201
- // When a preloaded manifest is supplied (project-local trust path), we use
202
- // that exact snapshot for the compat gate. This eliminates a TOCTOU between
203
- // the read that decided "this id is allowlisted" and the read that feeds the
204
- // compatibility check. The later dynamic import of the .mjs still sees
205
- // whatever is on disk at execution time (inherent for authored code).
206
- const rawManifest = preloadedManifest ?? loadToolManifest(source, dir);
207
- if (rawManifest === undefined) {
208
- throw new PluginIncompatibleError(`${source} tool at '${dir}' has no conformant ${PROJECT_LOCAL_MANIFEST_FILE} sidecar`, { diagnostic: 'manifest missing or malformed' });
209
- }
210
- const result = admitTool({
211
- manifest: rawManifest,
212
- source,
213
- dir,
214
- // An authored tool (placed in the project tree or the user's home dir) was
215
- // explicitly authored by the user, so an incompatible one fails the run
216
- // rather than skipping silently.
217
- explicitlyRequested: true,
218
- });
219
- if (result.decision !== 'admit') {
220
- throw new PluginIncompatibleError(`${source} tool '${rawManifest.id}' is incompatible: ${result.diagnostic ?? 'compatibility gate rejected it'}`, { diagnostic: result.diagnostic });
221
- }
222
- return { provenance: result.provenance, manifest: result.manifest };
223
- }
224
- /**
225
- * Admit (or reject) a single PROJECT-LOCAL authored tool under the
226
- * deny-by-default trust policy (launch, Phase 3 Task 3.2; wired into
227
- * production discovery in the launch contract).
228
- *
229
- * A project-local tool is authored code under
230
- * `<project>/opensip-cli/tools/<name>/` declaring its identity via a JSON
231
- * sidecar (`opensip-tool.manifest.json`). It is read + gated WITHOUT importing
232
- * its module:
233
- *
234
- * 1. `loadToolManifest('project-local', dir)` — identity only, no code run.
235
- * 2. Trust check — {@link isProjectLocalToolTrusted}. Not allowlisted ⇒
236
- * throw {@link PluginIncompatibleError} (fail-closed, exit 5) before any
237
- * import. Allowlisted ⇒ run the shared compatibility tail; an incompatible
238
- * explicitly-trusted tool is likewise fail-closed.
239
- *
240
- * Returns the admitted tool's `{ provenance, manifest }` on success. The trust
241
- * decision always precedes import (it is the FIRST statement here, ahead of the
242
- * shared {@link admitAuthoredTool} tail).
243
- *
244
- * @throws {PluginIncompatibleError} when the tool has no conformant sidecar
245
- * manifest, is not allowlisted, or is compatibility-incompatible.
246
- */
247
- export function admitProjectLocalTool(args) {
248
- // Trust decision FIRST — deny-by-default, before any compatibility maths
249
- // and (critically) before the tool's module could ever be imported. The id
250
- // is read from the sidecar identity, so load the manifest once here for the
251
- // trust check, then hand the same dir to the shared tail.
252
- const manifest = loadToolManifest('project-local', args.dir);
253
- if (manifest === undefined) {
254
- throw new PluginIncompatibleError(`project-local tool at '${args.dir}' has no conformant ${PROJECT_LOCAL_MANIFEST_FILE} sidecar`, { diagnostic: 'manifest missing or malformed' });
255
- }
256
- if (!isProjectLocalToolTrusted(manifest.id, args.env)) {
257
- throw new PluginIncompatibleError(`project-local tool '${manifest.id}' is not trusted to load (deny-by-default). ` +
258
- `Allowlist it via OPENSIP_CLI_ALLOW_PROJECT_TOOLS='${manifest.id}' to admit it.`, { diagnostic: 'project-local tool not allowlisted (deny-by-default)' });
259
- }
260
- // Pass the manifest we just loaded (and whose id we just trusted) so the
261
- // compat gate in the tail sees the identical declaration. Closes the
262
- // read-re-read TOCTOU for the deny-by-default path.
263
- return admitAuthoredTool('project-local', args.dir, manifest);
264
- }
265
- /**
266
- * Admit a single USER-GLOBAL authored tool — the trusted-by-default sibling of
267
- * {@link admitProjectLocalTool}.
268
- *
269
- * A user-global tool is an authored sidecar under
270
- * `~/.opensip-cli/tools/<name>/`. The user deliberately placed it in their
271
- * own home dir (the `npm i -g` analogue for authored code), so there is **no
272
- * allowlist gate** — it is trusted-by-default. It still reads the static
273
- * sidecar and runs `admitTool` BEFORE the module could be imported (the shared
274
- * {@link admitAuthoredTool} tail), so trust-before-import holds for this leg
275
- * too: a global tool the user explicitly authored is fail-closed on a
276
- * missing/incompatible manifest, never a silent skip.
277
- *
278
- * @throws {PluginIncompatibleError} when the tool has no conformant sidecar
279
- * manifest or is compatibility-incompatible.
280
- */
281
- export function admitUserGlobalTool(args) {
282
- // No trust gate — `user-global` is trusted-by-shipping-into-$HOME.
283
- return admitAuthoredTool('user-global', args.dir);
284
- }
285
112
  /**
286
113
  * Discover + admit + register AUTHORED Tool sidecars from the two authored
287
114
  * roots, then dynamic-import each admitted runtime through the shared
@@ -370,7 +197,7 @@ async function admitAndRegisterAuthored(args) {
370
197
  // Never shadow a bundled tool (defense in depth; the registry also dedupes).
371
198
  if (builtInIds.has(prov.id))
372
199
  return;
373
- const load = await importToolRuntime(dir);
200
+ const load = await importToolRuntime(dir, hostRuntimeImportPolicyFor(prov.source));
374
201
  if (!load.ok) {
375
202
  const detailSuffix = load.detail ? `: ${load.detail}` : '';
376
203
  throw new PluginIncompatibleError(`${prov.source} tool '${prov.id}' failed to load via the plugin path (${load.reason}${detailSuffix})`, { diagnostic: `authored tool runtime load failed: ${load.reason}` });
@@ -1 +1 @@
1
- {"version":3,"file":"register-tools-discovery.js","sourceRoot":"","sources":["../../src/bootstrap/register-tools-discovery.ts"],"names":[],"mappings":"AAAA,2LAA2L;AAC3L,2LAA2L;AAC3L,OAAO,EACL,SAAS,EACT,yBAAyB,EACzB,4BAA4B,EAC5B,+BAA+B,EAC/B,gBAAgB,EAChB,MAAM,EACN,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,GAMjB,MAAM,mBAAmB,CA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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,OAAO,GAA0B,EAAE,CAAC;IAC1C,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,qBAAqB,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;QACnE,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC;gBACX,GAAG,EAAE,mBAAmB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;gBAChE,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,sEAAsE;QACtE,qEAAqE;QACrE,mEAAmE;IACrE,CAAC;IACD,OAAO,CAAC,IAAI,CACV,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,EAC5B,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAC/D,EAAE,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,MAAM,EAAE,EAAE,CACpE,CAAC;IACJ,CAAC;IAED,4EAA4E;IAC5E,gEAAgE;IAChE,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"}
@@ -12,6 +12,7 @@
12
12
  */
13
13
  export { BUNDLED_TOOL_PACKAGES, EXPECTED_SCAFFOLDING_TOOL_IDS } from './register-tools-shared.js';
14
14
  export { registerFirstPartyTools } from './register-tools-bundled.js';
15
- export { type DiscoveryOptions, buildToolDiscoverySources, discoverAndRegisterToolPackages, type AuthoredAdmission, admitProjectLocalTool, admitUserGlobalTool, discoverAndRegisterAuthoredTools, } from './register-tools-discovery.js';
15
+ export { type DiscoveryOptions, buildToolDiscoverySources, discoverAndRegisterToolPackages, discoverAndRegisterAuthoredTools, } from './register-tools-discovery.js';
16
+ export { type AuthoredAdmission, admitProjectLocalTool, admitUserGlobalTool, } from './authored-tool-admission.js';
16
17
  export { mountAllToolCommands } from './register-tools-mount.js';
17
18
  //# 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,KAAK,iBAAiB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,gCAAgC,GACjC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
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"}
@@ -12,6 +12,7 @@
12
12
  */
13
13
  export { BUNDLED_TOOL_PACKAGES, EXPECTED_SCAFFOLDING_TOOL_IDS } from './register-tools-shared.js';
14
14
  export { registerFirstPartyTools } from './register-tools-bundled.js';
15
- export { buildToolDiscoverySources, discoverAndRegisterToolPackages, admitProjectLocalTool, admitUserGlobalTool, discoverAndRegisterAuthoredTools, } from './register-tools-discovery.js';
15
+ export { buildToolDiscoverySources, discoverAndRegisterToolPackages, discoverAndRegisterAuthoredTools, } from './register-tools-discovery.js';
16
+ export { admitProjectLocalTool, admitUserGlobalTool, } from './authored-tool-admission.js';
16
17
  export { mountAllToolCommands } from './register-tools-mount.js';
17
18
  //# 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,EAE/B,qBAAqB,EACrB,mBAAmB,EACnB,gCAAgC,GACjC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
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"}