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.
- package/dist/bootstrap/admit-tool-package.d.ts +15 -1
- package/dist/bootstrap/admit-tool-package.d.ts.map +1 -1
- package/dist/bootstrap/admit-tool-package.js +30 -5
- package/dist/bootstrap/admit-tool-package.js.map +1 -1
- package/dist/bootstrap/bind-tool-context.d.ts.map +1 -1
- package/dist/bootstrap/bind-tool-context.js +5 -3
- package/dist/bootstrap/bind-tool-context.js.map +1 -1
- package/dist/bootstrap/build-command-registration-input.d.ts +7 -0
- package/dist/bootstrap/build-command-registration-input.d.ts.map +1 -1
- package/dist/bootstrap/build-command-registration-input.js +11 -4
- package/dist/bootstrap/build-command-registration-input.js.map +1 -1
- package/dist/bootstrap/build-per-run-scope.d.ts +12 -0
- package/dist/bootstrap/build-per-run-scope.d.ts.map +1 -1
- package/dist/bootstrap/build-per-run-scope.js +84 -9
- package/dist/bootstrap/build-per-run-scope.js.map +1 -1
- package/dist/bootstrap/bundled-manifest.d.ts +5 -0
- package/dist/bootstrap/bundled-manifest.d.ts.map +1 -0
- package/dist/bootstrap/bundled-manifest.js +13 -0
- package/dist/bootstrap/bundled-manifest.js.map +1 -0
- package/dist/bootstrap/bundled-tools.manifest.json +19 -1
- package/dist/bootstrap/config-and-capabilities.d.ts +5 -3
- package/dist/bootstrap/config-and-capabilities.d.ts.map +1 -1
- package/dist/bootstrap/config-and-capabilities.js +10 -7
- package/dist/bootstrap/config-and-capabilities.js.map +1 -1
- package/dist/bootstrap/constants.d.ts +3 -0
- package/dist/bootstrap/constants.d.ts.map +1 -0
- package/dist/bootstrap/constants.js +3 -0
- package/dist/bootstrap/constants.js.map +1 -0
- package/dist/bootstrap/decorate-tool-primary.d.ts +50 -0
- package/dist/bootstrap/decorate-tool-primary.d.ts.map +1 -0
- package/dist/bootstrap/decorate-tool-primary.js +111 -0
- package/dist/bootstrap/decorate-tool-primary.js.map +1 -0
- package/dist/bootstrap/execute-post-bailout-bootstrap.d.ts +1 -0
- package/dist/bootstrap/execute-post-bailout-bootstrap.d.ts.map +1 -1
- package/dist/bootstrap/execute-post-bailout-bootstrap.js +12 -1
- package/dist/bootstrap/execute-post-bailout-bootstrap.js.map +1 -1
- package/dist/bootstrap/index.d.ts +1 -1
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js +1 -4
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/bootstrap/io-plane.d.ts +47 -0
- package/dist/bootstrap/io-plane.d.ts.map +1 -0
- package/dist/bootstrap/io-plane.js +73 -0
- package/dist/bootstrap/io-plane.js.map +1 -0
- package/dist/bootstrap/load-tool-capabilities.d.ts.map +1 -1
- package/dist/bootstrap/load-tool-capabilities.js +18 -2
- package/dist/bootstrap/load-tool-capabilities.js.map +1 -1
- package/dist/bootstrap/owning-tool-init.d.ts.map +1 -1
- package/dist/bootstrap/owning-tool-init.js +7 -4
- package/dist/bootstrap/owning-tool-init.js.map +1 -1
- package/dist/bootstrap/phase-map.d.ts +20 -0
- package/dist/bootstrap/phase-map.d.ts.map +1 -0
- package/dist/bootstrap/phase-map.js +108 -0
- package/dist/bootstrap/phase-map.js.map +1 -0
- package/dist/bootstrap/plan-pre-action-bootstrap.d.ts +5 -5
- package/dist/bootstrap/plan-pre-action-bootstrap.d.ts.map +1 -1
- package/dist/bootstrap/plan-pre-action-bootstrap.js +3 -19
- package/dist/bootstrap/plan-pre-action-bootstrap.js.map +1 -1
- package/dist/bootstrap/pre-action-guards.d.ts +2 -1
- package/dist/bootstrap/pre-action-guards.d.ts.map +1 -1
- package/dist/bootstrap/pre-action-guards.js +3 -27
- package/dist/bootstrap/pre-action-guards.js.map +1 -1
- package/dist/bootstrap/pre-action-hook.d.ts +2 -1
- package/dist/bootstrap/pre-action-hook.d.ts.map +1 -1
- package/dist/bootstrap/pre-action-hook.js +23 -4
- package/dist/bootstrap/pre-action-hook.js.map +1 -1
- package/dist/bootstrap/register-tools-discovery.d.ts +38 -39
- package/dist/bootstrap/register-tools-discovery.d.ts.map +1 -1
- package/dist/bootstrap/register-tools-discovery.js +134 -85
- package/dist/bootstrap/register-tools-discovery.js.map +1 -1
- package/dist/bootstrap/register-tools-mount.d.ts +18 -1
- package/dist/bootstrap/register-tools-mount.d.ts.map +1 -1
- package/dist/bootstrap/register-tools-mount.js +118 -18
- package/dist/bootstrap/register-tools-mount.js.map +1 -1
- package/dist/bootstrap/register-tools.d.ts +58 -14
- package/dist/bootstrap/register-tools.d.ts.map +1 -1
- package/dist/bootstrap/register-tools.js +185 -14
- package/dist/bootstrap/register-tools.js.map +1 -1
- package/dist/bootstrap/root-version.d.ts +26 -0
- package/dist/bootstrap/root-version.d.ts.map +1 -0
- package/dist/bootstrap/root-version.js +36 -0
- package/dist/bootstrap/root-version.js.map +1 -0
- package/dist/bootstrap/scope-access.d.ts +11 -0
- package/dist/bootstrap/scope-access.d.ts.map +1 -1
- package/dist/bootstrap/scope-access.js +26 -0
- package/dist/bootstrap/scope-access.js.map +1 -1
- package/dist/bootstrap/tool-lifecycle.d.ts +0 -22
- package/dist/bootstrap/tool-lifecycle.d.ts.map +1 -1
- package/dist/bootstrap/tool-lifecycle.js +0 -23
- package/dist/bootstrap/tool-lifecycle.js.map +1 -1
- package/dist/bootstrap/validate-tool.d.ts +10 -4
- package/dist/bootstrap/validate-tool.d.ts.map +1 -1
- package/dist/bootstrap/validate-tool.js +76 -22
- package/dist/bootstrap/validate-tool.js.map +1 -1
- package/dist/cli-context.d.ts +2 -2
- package/dist/cli-context.d.ts.map +1 -1
- package/dist/cli-context.js +20 -35
- package/dist/cli-context.js.map +1 -1
- package/dist/commands/agent-catalog.d.ts +29 -0
- package/dist/commands/agent-catalog.d.ts.map +1 -1
- package/dist/commands/agent-catalog.js +77 -36
- package/dist/commands/agent-catalog.js.map +1 -1
- package/dist/commands/clear.d.ts.map +1 -1
- package/dist/commands/clear.js +0 -1
- package/dist/commands/clear.js.map +1 -1
- package/dist/commands/command-scope-index.d.ts +45 -0
- package/dist/commands/command-scope-index.d.ts.map +1 -0
- package/dist/commands/command-scope-index.js +51 -0
- package/dist/commands/command-scope-index.js.map +1 -0
- package/dist/commands/completion.d.ts +67 -6
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +84 -12
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/configure.d.ts.map +1 -1
- package/dist/commands/configure.js +0 -1
- package/dist/commands/configure.js.map +1 -1
- package/dist/commands/host-command-specs.d.ts +16 -9
- package/dist/commands/host-command-specs.d.ts.map +1 -1
- package/dist/commands/host-command-specs.js +47 -21
- package/dist/commands/host-command-specs.js.map +1 -1
- package/dist/commands/host-config-flag.d.ts +21 -0
- package/dist/commands/host-config-flag.d.ts.map +1 -0
- package/dist/commands/host-config-flag.js +21 -0
- package/dist/commands/host-config-flag.js.map +1 -0
- package/dist/commands/host-subcommand-groups.d.ts +46 -5
- package/dist/commands/host-subcommand-groups.d.ts.map +1 -1
- package/dist/commands/host-subcommand-groups.js +97 -65
- package/dist/commands/host-subcommand-groups.js.map +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.js +1 -1
- package/dist/commands/internal-command-visibility.d.ts +42 -0
- package/dist/commands/internal-command-visibility.d.ts.map +1 -0
- package/dist/commands/internal-command-visibility.js +54 -0
- package/dist/commands/internal-command-visibility.js.map +1 -0
- package/dist/commands/mount-command-action.d.ts +24 -0
- package/dist/commands/mount-command-action.d.ts.map +1 -0
- package/dist/commands/mount-command-action.js +78 -0
- package/dist/commands/mount-command-action.js.map +1 -0
- package/dist/commands/mount-command-spec-wiring.d.ts +24 -0
- package/dist/commands/mount-command-spec-wiring.d.ts.map +1 -0
- package/dist/commands/mount-command-spec-wiring.js +71 -0
- package/dist/commands/mount-command-spec-wiring.js.map +1 -0
- package/dist/commands/mount-command-spec.d.ts +9 -2
- package/dist/commands/mount-command-spec.d.ts.map +1 -1
- package/dist/commands/mount-command-spec.js +11 -135
- package/dist/commands/mount-command-spec.js.map +1 -1
- package/dist/commands/plugin/domain-resolution.d.ts +12 -13
- package/dist/commands/plugin/domain-resolution.d.ts.map +1 -1
- package/dist/commands/plugin/domain-resolution.js +12 -58
- package/dist/commands/plugin/domain-resolution.js.map +1 -1
- package/dist/commands/plugin/host-dir.d.ts +0 -1
- package/dist/commands/plugin/host-dir.d.ts.map +1 -1
- package/dist/commands/plugin/host-dir.js +1 -1
- package/dist/commands/plugin/host-dir.js.map +1 -1
- package/dist/commands/plugin.d.ts +20 -14
- package/dist/commands/plugin.d.ts.map +1 -1
- package/dist/commands/plugin.js +39 -47
- package/dist/commands/plugin.js.map +1 -1
- package/dist/commands/render-outcome.d.ts.map +1 -1
- package/dist/commands/render-outcome.js.map +1 -1
- package/dist/commands/shared.d.ts +9 -0
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/tools/create.d.ts +11 -0
- package/dist/commands/tools/create.d.ts.map +1 -0
- package/dist/commands/tools/create.js +84 -0
- package/dist/commands/tools/create.js.map +1 -0
- package/dist/commands/tools/index.d.ts.map +1 -1
- package/dist/commands/tools/index.js +31 -0
- package/dist/commands/tools/index.js.map +1 -1
- package/dist/commands/tools/runtime-probe-entry.d.ts.map +1 -1
- package/dist/commands/tools/runtime-probe-entry.js +4 -2
- package/dist/commands/tools/runtime-probe-entry.js.map +1 -1
- package/dist/commands/tools/validate.d.ts.map +1 -1
- package/dist/commands/tools/validate.js +12 -5
- package/dist/commands/tools/validate.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +0 -1
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/env/host-env-specs.d.ts +18 -0
- package/dist/env/host-env-specs.d.ts.map +1 -1
- package/dist/env/host-env-specs.js +36 -2
- package/dist/env/host-env-specs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -21
- package/dist/index.js.map +1 -1
- package/dist/report-compose.d.ts.map +1 -1
- package/dist/report-compose.js +2 -2
- package/dist/report-compose.js.map +1 -1
- package/dist/session-replay-registry.d.ts +1 -1
- package/dist/session-replay-registry.d.ts.map +1 -1
- package/dist/session-replay-registry.js +3 -1
- package/dist/session-replay-registry.js.map +1 -1
- package/dist/ui/result-to-view.d.ts +27 -7
- package/dist/ui/result-to-view.d.ts.map +1 -1
- package/dist/ui/result-to-view.js +68 -75
- package/dist/ui/result-to-view.js.map +1 -1
- package/dist/ui/views/misc-views.d.ts.map +1 -1
- package/dist/ui/views/misc-views.js +3 -1
- package/dist/ui/views/misc-views.js.map +1 -1
- package/dist/ui/views/tools-views.d.ts +2 -1
- package/dist/ui/views/tools-views.d.ts.map +1 -1
- package/dist/ui/views/tools-views.js +21 -0
- package/dist/ui/views/tools-views.js.map +1 -1
- package/package.json +32 -32
- package/dist/bootstrap/authored-tool-admission.d.ts +0 -23
- package/dist/bootstrap/authored-tool-admission.d.ts.map +0 -1
- package/dist/bootstrap/authored-tool-admission.js +0 -54
- package/dist/bootstrap/authored-tool-admission.js.map +0 -1
- package/dist/bootstrap/egress-plane.d.ts +0 -22
- package/dist/bootstrap/egress-plane.d.ts.map +0 -1
- package/dist/bootstrap/egress-plane.js +0 -37
- package/dist/bootstrap/egress-plane.js.map +0 -1
- package/dist/bootstrap/installed-tool-admission.d.ts +0 -20
- package/dist/bootstrap/installed-tool-admission.d.ts.map +0 -1
- package/dist/bootstrap/installed-tool-admission.js +0 -60
- package/dist/bootstrap/installed-tool-admission.js.map +0 -1
- package/dist/bootstrap/live-plane.d.ts +0 -51
- package/dist/bootstrap/live-plane.d.ts.map +0 -1
- package/dist/bootstrap/live-plane.js +0 -72
- package/dist/bootstrap/live-plane.js.map +0 -1
- package/dist/bootstrap/register-tools-bundled.d.ts +0 -28
- package/dist/bootstrap/register-tools-bundled.d.ts.map +0 -1
- package/dist/bootstrap/register-tools-bundled.js +0 -107
- package/dist/bootstrap/register-tools-bundled.js.map +0 -1
- package/dist/bootstrap/register-tools-shared.d.ts +0 -40
- package/dist/bootstrap/register-tools-shared.d.ts.map +0 -1
- package/dist/bootstrap/register-tools-shared.js +0 -98
- package/dist/bootstrap/register-tools-shared.js.map +0 -1
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
* module. Callers that need isolation (e.g. `tools validate` probing a
|
|
21
21
|
* not-yet-trusted package) pass `staticOnly: true` here and run the runtime
|
|
22
22
|
* sections in a child-process probe instead.
|
|
23
|
+
*
|
|
24
|
+
* ADR-0054 transition: external runtimes still import in the host process until
|
|
25
|
+
* the manifest/RPC contract can carry executable command specs across a worker
|
|
26
|
+
* boundary. Every host-process import must therefore pass an explicit policy:
|
|
27
|
+
* bundled imports are normal, non-bundled imports are named as temporary
|
|
28
|
+
* `adr0054Transition` exceptions so the fitness check can keep the boundary
|
|
29
|
+
* visible and narrow.
|
|
23
30
|
*/
|
|
24
31
|
import { type RawToolPluginManifest, type Tool, type ToolPluginManifest, type ToolProvenance, type ToolSource } from '@opensip-cli/core';
|
|
25
32
|
/**
|
|
@@ -37,6 +44,13 @@ export type ToolRuntimeLoad = {
|
|
|
37
44
|
readonly reason: 'no-entry' | 'invalid-shape' | 'import-failed';
|
|
38
45
|
readonly detail?: string;
|
|
39
46
|
};
|
|
47
|
+
export type ToolRuntimeImportPolicy = {
|
|
48
|
+
readonly source: 'bundled';
|
|
49
|
+
} | {
|
|
50
|
+
readonly source: Exclude<ToolSource, 'bundled'>;
|
|
51
|
+
readonly adr0054Transition: true;
|
|
52
|
+
};
|
|
53
|
+
export declare function hostRuntimeImportPolicyFor(source: ToolSource): ToolRuntimeImportPolicy;
|
|
40
54
|
/**
|
|
41
55
|
* Resolve a tool package's entry, DYNAMIC-IMPORT it, and validate the exported
|
|
42
56
|
* `tool` shape. This is the ONE runtime-load path every installation source
|
|
@@ -49,7 +63,7 @@ export type ToolRuntimeLoad = {
|
|
|
49
63
|
*
|
|
50
64
|
* Never throws: returns a discriminated result the caller acts on.
|
|
51
65
|
*/
|
|
52
|
-
export declare function importToolRuntime(dir: string): Promise<ToolRuntimeLoad>;
|
|
66
|
+
export declare function importToolRuntime(dir: string, policy: ToolRuntimeImportPolicy): Promise<ToolRuntimeLoad>;
|
|
53
67
|
/** The named conformance sections of the admission pipeline, in run order. */
|
|
54
68
|
export type AdmissionSection = 'manifest' | 'compatibility' | 'runtime-load' | 'tool-shape' | 'manifest-runtime-coherence';
|
|
55
69
|
/** One section's verdict. `diagnostic` is present on failure (and only then). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admit-tool-package.d.ts","sourceRoot":"","sources":["../../src/bootstrap/admit-tool-package.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"admit-tool-package.d.ts","sourceRoot":"","sources":["../../src/bootstrap/admit-tool-package.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,EAKL,KAAK,qBAAqB,EAC1B,KAAK,IAAI,EACT,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAI3B;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAC1C;IACE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,eAAe,GAAG,eAAe,CAAC;IAChE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,MAAM,MAAM,uBAAuB,GAC/B;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAC9B;IACE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAChD,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC;CAClC,CA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AAM,WAAW,uBAAuB;IACtC,+EAA+E;IAC/E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,eAAe,CAAC,CAiH9F"}
|
|
@@ -20,10 +20,22 @@
|
|
|
20
20
|
* module. Callers that need isolation (e.g. `tools validate` probing a
|
|
21
21
|
* not-yet-trusted package) pass `staticOnly: true` here and run the runtime
|
|
22
22
|
* sections in a child-process probe instead.
|
|
23
|
+
*
|
|
24
|
+
* ADR-0054 transition: external runtimes still import in the host process until
|
|
25
|
+
* the manifest/RPC contract can carry executable command specs across a worker
|
|
26
|
+
* boundary. Every host-process import must therefore pass an explicit policy:
|
|
27
|
+
* bundled imports are normal, non-bundled imports are named as temporary
|
|
28
|
+
* `adr0054Transition` exceptions so the fitness check can keep the boundary
|
|
29
|
+
* visible and narrow.
|
|
23
30
|
*/
|
|
24
31
|
import { pathToFileURL } from 'node:url';
|
|
25
32
|
import { admitTool, assertManifestMatchesTool, loadToolManifest, readToolPackageMetadata, } from '@opensip-cli/core';
|
|
26
|
-
import { isValidTool } from './validate-tool.js';
|
|
33
|
+
import { isValidTool, toolValidationFailure } from './validate-tool.js';
|
|
34
|
+
export function hostRuntimeImportPolicyFor(source) {
|
|
35
|
+
if (source === 'bundled')
|
|
36
|
+
return { source };
|
|
37
|
+
return { source, adr0054Transition: true };
|
|
38
|
+
}
|
|
27
39
|
/**
|
|
28
40
|
* Resolve a tool package's entry, DYNAMIC-IMPORT it, and validate the exported
|
|
29
41
|
* `tool` shape. This is the ONE runtime-load path every installation source
|
|
@@ -36,7 +48,15 @@ import { isValidTool } from './validate-tool.js';
|
|
|
36
48
|
*
|
|
37
49
|
* Never throws: returns a discriminated result the caller acts on.
|
|
38
50
|
*/
|
|
39
|
-
export async function importToolRuntime(dir) {
|
|
51
|
+
export async function importToolRuntime(dir, policy) {
|
|
52
|
+
if (policy.source !== 'bundled' && policy.adr0054Transition !== true) {
|
|
53
|
+
return {
|
|
54
|
+
ok: false,
|
|
55
|
+
reason: 'import-failed',
|
|
56
|
+
detail: 'external tool runtime import attempted without ADR-0054 transition policy; ' +
|
|
57
|
+
'load through the worker boundary instead',
|
|
58
|
+
};
|
|
59
|
+
}
|
|
40
60
|
const meta = readToolPackageMetadata(dir);
|
|
41
61
|
if (!meta)
|
|
42
62
|
return { ok: false, reason: 'no-entry' };
|
|
@@ -51,8 +71,13 @@ export async function importToolRuntime(dir) {
|
|
|
51
71
|
detail: error instanceof Error ? error.message : String(error),
|
|
52
72
|
};
|
|
53
73
|
}
|
|
54
|
-
if (!isValidTool(mod.tool))
|
|
55
|
-
return {
|
|
74
|
+
if (!isValidTool(mod.tool)) {
|
|
75
|
+
return {
|
|
76
|
+
ok: false,
|
|
77
|
+
reason: 'invalid-shape',
|
|
78
|
+
detail: toolValidationFailure(mod.tool) ?? 'tool export failed shape validation',
|
|
79
|
+
};
|
|
80
|
+
}
|
|
56
81
|
return { ok: true, tool: mod.tool };
|
|
57
82
|
}
|
|
58
83
|
/**
|
|
@@ -110,7 +135,7 @@ export async function admitToolPackage(opts) {
|
|
|
110
135
|
}
|
|
111
136
|
// Section 3+4 — runtime load + tool shape: dynamic import (UNTRUSTED code
|
|
112
137
|
// executes here) and the exported-symbol gate.
|
|
113
|
-
const load = await importToolRuntime(opts.dir);
|
|
138
|
+
const load = await importToolRuntime(opts.dir, hostRuntimeImportPolicyFor(opts.source));
|
|
114
139
|
if (!load.ok) {
|
|
115
140
|
if (load.reason === 'invalid-shape') {
|
|
116
141
|
sections.push({ section: 'runtime-load', ok: true }, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admit-tool-package.js","sourceRoot":"","sources":["../../src/bootstrap/admit-tool-package.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"admit-tool-package.js","sourceRoot":"","sources":["../../src/bootstrap/admit-tool-package.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EAChB,uBAAuB,GAMxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAwBxE,MAAM,UAAU,0BAA0B,CAAC,MAAkB;IAC3D,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC5C,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAW,EACX,MAA+B;IAE/B,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC;QACrE,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,eAAe;YACvB,MAAM,EACJ,6EAA6E;gBAC7E,0CAA0C;SAC7C,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,uBAAuB,CAAC,GAAG,CAAC,CAAC;IAC1C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IACpD,IAAI,GAAuB,CAAC;IAC5B,IAAI,CAAC;QACH,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC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YACR,UAAU;YACV,qBAAqB,EAAE,OAAO;YAC9B,cAAc,EAAE,KAAK;SACtB,CAAC;IACJ,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAEnE,OAAO;QACL,EAAE,EAAE,IAAI;QACR,QAAQ;QACR,QAAQ;QACR,UAAU;QACV,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,qBAAqB,EAAE,OAAO;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bind-tool-context.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bind-tool-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"bind-tool-context.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bind-tool-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAIL,KAAK,IAAI,EACT,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,KAAK,mBAAmB,GAAG,cAAc,GAAG,cAAc,CAAC;AAO3D,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,CAU7D;AAqGD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,cAAc,GAAG,mBAAmB,CA2DvF"}
|
|
@@ -7,16 +7,18 @@
|
|
|
7
7
|
* ownership into a thin context wrapper and reject accidental or malicious
|
|
8
8
|
* cross-tool keys before they reach persistence.
|
|
9
9
|
*/
|
|
10
|
-
import { PluginIncompatibleError } from '@opensip-cli/core';
|
|
10
|
+
import { PluginIncompatibleError, resolveToolCommands, resolveToolHooks, } from '@opensip-cli/core';
|
|
11
11
|
function primaryCommandName(tool) {
|
|
12
|
-
|
|
12
|
+
const commands = resolveToolCommands(tool);
|
|
13
|
+
return tool.commandSpecs?.[0]?.name ?? commands[0]?.name;
|
|
13
14
|
}
|
|
14
15
|
export function toolOwnedKeys(tool) {
|
|
15
16
|
return new Set([
|
|
16
17
|
tool.metadata.id,
|
|
17
18
|
tool.metadata.name,
|
|
18
19
|
primaryCommandName(tool),
|
|
19
|
-
tool.sessionReplay?.tool,
|
|
20
|
+
resolveToolHooks(tool).sessionReplay?.tool,
|
|
21
|
+
resolveToolHooks(tool).config?.namespace,
|
|
20
22
|
].filter((value) => typeof value === 'string' && value.length > 0));
|
|
21
23
|
}
|
|
22
24
|
function describeTool(tool) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bind-tool-context.js","sourceRoot":"","sources":["../../src/bootstrap/bind-tool-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"bind-tool-context.js","sourceRoot":"","sources":["../../src/bootstrap/bind-tool-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,GAGjB,MAAM,mBAAmB,CAAC;AAM3B,SAAS,kBAAkB,CAAC,IAAU;IACpC,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAU;IACtC,OAAO,IAAI,GAAG,CACZ;QACE,IAAI,CAAC,QAAQ,CAAC,EAAE;QAChB,IAAI,CAAC,QAAQ,CAAC,IAAI;QAClB,kBAAkB,CAAC,IAAI,CAAC;QACxB,gBAAgB,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,IAAI;QAC1C,gBAAgB,CAAC,IAAI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,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC;SACrD;KACF,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -23,6 +23,13 @@ export interface CommandRegistrationInput {
|
|
|
23
23
|
}[];
|
|
24
24
|
readonly sessionReplayRegistry: SessionReplayRegistry;
|
|
25
25
|
readonly toolCommandSpecs: readonly CommandSpec<unknown, ToolCliContext>[];
|
|
26
|
+
/**
|
|
27
|
+
* Descriptor-driven names of the tools' `visibility: 'internal'` (Tier-3)
|
|
28
|
+
* commands. The `completion` command filters these from its inventory — the
|
|
29
|
+
* SAME source the `--help` hide pass keys on (tool-command-surface-taxonomy
|
|
30
|
+
* Task 1.3), so completion and help stay in lockstep.
|
|
31
|
+
*/
|
|
32
|
+
readonly toolInternalCommands: ReadonlySet<string>;
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
35
|
* Collects the registry-derived data needed for CLI command registration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-command-registration-input.d.ts","sourceRoot":"","sources":["../../src/bootstrap/build-command-registration-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"build-command-registration-input.d.ts","sourceRoot":"","sources":["../../src/bootstrap/build-command-registration-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAItE,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,cAAc,EACd,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,8DAA8D;AAC9D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,aAAa,EAAE,SAAS,WAAW,CAAC,YAAY,CAAC,EAAE,CAAC;IAC7D,QAAQ,CAAC,aAAa,EAAE,SAAS;QAC/B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;QAC9B,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC,GAAG,EAAE,eAAe,KAAK,SAAS,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;QAC3F,QAAQ,CAAC,gBAAgB,EAAE,CAAC,MAAM,SAAS,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC;QACjE,QAAQ,CAAC,mBAAmB,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAC;KAC1D,EAAE,CAAC;IACJ,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IACtD,QAAQ,CAAC,gBAAgB,EAAE,SAAS,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE,CAAC;IAC3E;;;;;OAKG;IACH,QAAQ,CAAC,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACpD;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,YAAY,GAAG,wBAAwB,CA6D9F"}
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* "toolCommandSpecs" preparation so the main entry point stays focused on
|
|
11
11
|
* sequencing (registries, bootstrap, mounting, registration, dispatch).
|
|
12
12
|
*/
|
|
13
|
-
import { logger } from '@opensip-cli/core';
|
|
13
|
+
import { logger, resolveToolHooks } from '@opensip-cli/core';
|
|
14
|
+
import { internalCommandNames } from '../commands/internal-command-visibility.js';
|
|
14
15
|
import { SessionReplayRegistry } from '../session-replay-registry.js';
|
|
15
16
|
import { EXPECTED_SCAFFOLDING_TOOL_IDS } from './register-tools.js';
|
|
16
17
|
/**
|
|
@@ -33,12 +34,13 @@ export function buildCommandRegistrationInput(registry) {
|
|
|
33
34
|
const layout = t.pluginLayout;
|
|
34
35
|
if (layout === undefined)
|
|
35
36
|
return [];
|
|
37
|
+
const hooks = resolveToolHooks(t);
|
|
36
38
|
return [
|
|
37
39
|
{
|
|
38
40
|
layout,
|
|
39
|
-
scaffoldExamples:
|
|
40
|
-
stableExampleIds:
|
|
41
|
-
scaffoldConfigBlock:
|
|
41
|
+
scaffoldExamples: hooks.scaffoldExamples,
|
|
42
|
+
stableExampleIds: hooks.stableExampleIds,
|
|
43
|
+
scaffoldConfigBlock: hooks.scaffoldConfigBlock,
|
|
42
44
|
},
|
|
43
45
|
];
|
|
44
46
|
});
|
|
@@ -63,11 +65,16 @@ export function buildCommandRegistrationInput(registry) {
|
|
|
63
65
|
// `completion` command derives its flags from the same specs the runtime
|
|
64
66
|
// mounts (no hand-maintained flag list to drift).
|
|
65
67
|
const toolCommandSpecs = registry.list().flatMap((t) => t.commandSpecs ?? []);
|
|
68
|
+
// Descriptor-driven Tier-3 set (tool-command-surface-taxonomy Task 1.3): the
|
|
69
|
+
// `visibility: 'internal'` command names, derived from the same registry the
|
|
70
|
+
// `--help` hide pass walks so completion and help filter on one source.
|
|
71
|
+
const toolInternalCommands = internalCommandNames(registry);
|
|
66
72
|
return {
|
|
67
73
|
pluginLayouts,
|
|
68
74
|
toolScaffolds,
|
|
69
75
|
sessionReplayRegistry,
|
|
70
76
|
toolCommandSpecs,
|
|
77
|
+
toolInternalCommands,
|
|
71
78
|
};
|
|
72
79
|
}
|
|
73
80
|
//# sourceMappingURL=build-command-registration-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-command-registration-input.js","sourceRoot":"","sources":["../../src/bootstrap/build-command-registration-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"build-command-registration-input.js","sourceRoot":"","sources":["../../src/bootstrap/build-command-registration-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+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EAAE,kCAAkC;gBACvC,MAAM,EAAE,eAAe;gBACvB,IAAI,EAAE,UAAU;gBAChB,GAAG,EAAE,0BAA0B,UAAU,6EAA6E;aACvH,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAExE,4EAA4E;IAC5E,yEAAyE;IACzE,kDAAkD;IAClD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IAE9E,6EAA6E;IAC7E,6EAA6E;IAC7E,wEAAwE;IACxE,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAE5D,OAAO;QACL,aAAa;QACb,aAAa;QACb,qBAAqB;QACrB,gBAAgB;QAChB,oBAAoB;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -24,6 +24,18 @@ export interface BuildPerRunScopeInput {
|
|
|
24
24
|
readonly project: ProjectContext;
|
|
25
25
|
readonly runId: string;
|
|
26
26
|
readonly cwd: string;
|
|
27
|
+
/**
|
|
28
|
+
* Top-level command name the run started under (e.g. `graph`, `fit`) — the
|
|
29
|
+
* FIRST segment of the invoked command path, NOT a child's own
|
|
30
|
+
* `graph-shard-worker`. Stamped into the assembled `RunCorrelation` so a child
|
|
31
|
+
* worker can attribute itself to the parent command (B2 / GAP e).
|
|
32
|
+
*/
|
|
33
|
+
readonly parentCommand: string;
|
|
34
|
+
/**
|
|
35
|
+
* Owning tool id of the dispatched command (e.g. `graph`, `fit`), resolved by
|
|
36
|
+
* the bootstrap. Stamped into the assembled `RunCorrelation.tool`.
|
|
37
|
+
*/
|
|
38
|
+
readonly toolName: string;
|
|
27
39
|
readonly cliDefaults: ReturnType<typeof loadCliDefaults>;
|
|
28
40
|
readonly registries: {
|
|
29
41
|
readonly languages: LanguageRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-per-run-scope.d.ts","sourceRoot":"","sources":["../../src/bootstrap/build-per-run-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"build-per-run-scope.d.ts","sourceRoot":"","sources":["../../src/bootstrap/build-per-run-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,MAAM,EAEX,KAAK,cAAc,EAGnB,QAAQ,EAIR,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAoDzD,4DAA4D;AAC5D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IACzD,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;QACrC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;KAC9B,CAAC;IACF,QAAQ,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAClD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE;QACX,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;KACrC,CAAC;CACH;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,QAAQ,CAiKvE"}
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
* Inputs are explicit so the builder is testable in isolation and the
|
|
18
18
|
* hook stays focused on orchestration.
|
|
19
19
|
*/
|
|
20
|
-
import { join } from 'node:path';
|
|
21
|
-
import { resolveEffectiveCloudConfig } from '@opensip-cli/config';
|
|
22
|
-
import { createCapabilityRegistry, PluginIncompatibleError, resolveUserPaths, RunScope, } from '@opensip-cli/core';
|
|
20
|
+
import { basename, join } from 'node:path';
|
|
21
|
+
import { resolveApiKey, resolveEffectiveCloudConfig } from '@opensip-cli/config';
|
|
22
|
+
import { createCapabilityRegistry, currentTraceparent, isContributionWithDisposer, PluginIncompatibleError, resolveUserPaths, RunScope, resolveToolHooks, } from '@opensip-cli/core';
|
|
23
23
|
import { resolveSignalSink } from '@opensip-cli/output';
|
|
24
24
|
import { buildDatastoreThunk } from '../cli-context.js';
|
|
25
25
|
import { buildTargets } from './build-targets.js';
|
|
@@ -68,13 +68,29 @@ function installScopeContribution(scope, tool, contribution) {
|
|
|
68
68
|
export function buildPerRunScope(input) {
|
|
69
69
|
const { project, runId, cliDefaults, registries, manifests, provenance, apiKey, noCloud, logger, ui, } = input;
|
|
70
70
|
const { languages, tools } = registries;
|
|
71
|
+
// Resolve the effective cloud config ONCE — both the signal sink (ADR-0008)
|
|
72
|
+
// and the correlation cloud-active gate (B2) read it; do not resolve twice.
|
|
73
|
+
const effectiveCloud = resolveEffectiveCloudConfig(cliDefaults.cloud);
|
|
71
74
|
// ADR-0008: select the cloud signal sink for this run.
|
|
72
75
|
const signalSink = resolveSignalSink({
|
|
73
76
|
apiKey,
|
|
74
|
-
cloud:
|
|
77
|
+
cloud: effectiveCloud,
|
|
75
78
|
noCloud,
|
|
76
79
|
cacheDir: join(resolveUserPaths().userHomeDir, 'cache'), // note: resolveUserPaths is from core
|
|
77
80
|
});
|
|
81
|
+
// B2: assemble the cloud-aware RunCorrelation here — the one place the
|
|
82
|
+
// resolved cloud identity is in hand (library code deep in the tree cannot
|
|
83
|
+
// re-resolve it by layering, so it reads `currentScope()?.correlation`).
|
|
84
|
+
const { correlation, cloudActive, traceId } = assembleCorrelation({
|
|
85
|
+
runId,
|
|
86
|
+
tool: input.toolName,
|
|
87
|
+
parentCommand: input.parentCommand,
|
|
88
|
+
apiKey,
|
|
89
|
+
noCloud,
|
|
90
|
+
effectiveCloud,
|
|
91
|
+
project,
|
|
92
|
+
cwd: input.cwd,
|
|
93
|
+
});
|
|
78
94
|
// ADR-0023 Phase 4: compose + STRICT-validate config before building the
|
|
79
95
|
// scope (a typo in any tool namespace → CONFIGURATION_ERROR); resolved
|
|
80
96
|
// config rides the scope (tools read scope.toolConfig.<namespace>).
|
|
@@ -115,13 +131,26 @@ export function buildPerRunScope(input) {
|
|
|
115
131
|
// uninstall`) read them via `currentScope()` — the single source of truth.
|
|
116
132
|
toolManifests: manifests,
|
|
117
133
|
toolProvenance: provenance,
|
|
134
|
+
// B2: the cloud-aware correlation bag, read downstream via
|
|
135
|
+
// `currentScope()?.correlation` and forwarded into spawned/forked children.
|
|
136
|
+
correlation,
|
|
137
|
+
});
|
|
138
|
+
// Observability of the assembly step (consistent with the contributeScope /
|
|
139
|
+
// capabilities diagnostics below). Do NOT log the `repo` VALUE at debug — it
|
|
140
|
+
// can be a filesystem path; log the boolean `hasRepo` instead.
|
|
141
|
+
scope.diagnostics.event('load', 'debug', 'run correlation assembled', {
|
|
142
|
+
tool: correlation.tool,
|
|
143
|
+
parentCommand: correlation.parentCommand,
|
|
144
|
+
cloudActive,
|
|
145
|
+
hasTraceId: traceId !== undefined,
|
|
146
|
+
hasRepo: correlation.repo !== undefined,
|
|
118
147
|
});
|
|
119
148
|
// Lifecycle diagnostics: record wiring steps (contributeScope + capabilities)
|
|
120
149
|
// on the bus *before* enterScope. These ride the eventual CommandOutcome so
|
|
121
150
|
// --json consumers and the uniform diagnostics snapshot see the full
|
|
122
151
|
// per-run construction (addresses architecture review findings on observability
|
|
123
152
|
// of steps 6/7 and blast-radius files).
|
|
124
|
-
const contributing = tools.list().filter((t) => !!t.contributeScope);
|
|
153
|
+
const contributing = tools.list().filter((t) => !!resolveToolHooks(t).contributeScope);
|
|
125
154
|
scope.diagnostics.event('load', 'debug', `${contributing.length} tool(s) contributed subscope`, {
|
|
126
155
|
tools: contributing.map((t) => t.metadata.id ?? t.metadata.name),
|
|
127
156
|
});
|
|
@@ -130,10 +159,24 @@ export function buildPerRunScope(input) {
|
|
|
130
159
|
// `scope.simulation`, `scope.graph`) BEFORE the scope is entered. IoC (M4):
|
|
131
160
|
// the tool RETURNS its slot via `contributeScope()`; the kernel installs it
|
|
132
161
|
// with `Object.assign` (registration order; a tool with no hook is skipped).
|
|
162
|
+
//
|
|
163
|
+
// Disposer seam (parallel-tool-invocations Phase 1): a tool that owns a
|
|
164
|
+
// per-run resource needing teardown returns the wrapper form
|
|
165
|
+
// (`{ contribution, onDispose }`); we install `contribution` and register
|
|
166
|
+
// `onDispose` on `scope.onDispose(...)` so `dispose()` reclaims the resource.
|
|
167
|
+
// The bare-`ScopeContribution` form (graph/simulation) carries no disposer.
|
|
133
168
|
for (const tool of tools.list()) {
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
136
|
-
|
|
169
|
+
const result = resolveToolHooks(tool).contributeScope?.();
|
|
170
|
+
if (!result)
|
|
171
|
+
continue;
|
|
172
|
+
if (isContributionWithDisposer(result)) {
|
|
173
|
+
installScopeContribution(scope, tool, result.contribution);
|
|
174
|
+
if (result.onDispose)
|
|
175
|
+
scope.onDispose(result.onDispose);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
installScopeContribution(scope, tool, result);
|
|
179
|
+
}
|
|
137
180
|
}
|
|
138
181
|
// §5.3 Phase 4: per-run capability registry (manifest domains → real registrars).
|
|
139
182
|
const capabilities = wireCapabilityRegistry({
|
|
@@ -153,10 +196,42 @@ export function buildPerRunScope(input) {
|
|
|
153
196
|
...configDocumentSlot(project, configDocument),
|
|
154
197
|
});
|
|
155
198
|
// Also surface the config validation result for the uniform lifecycle view.
|
|
156
|
-
const toolConfigNamespaces = tools.list().filter((t) => !!t.config).length;
|
|
199
|
+
const toolConfigNamespaces = tools.list().filter((t) => !!resolveToolHooks(t).config).length;
|
|
157
200
|
scope.diagnostics.event('validate', 'debug', `config composed for ${toolConfigNamespaces} tool namespace(s)`);
|
|
158
201
|
return scope;
|
|
159
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Assemble the cloud-aware {@link RunCorrelation} bag (B2). Extracted from
|
|
205
|
+
* {@link buildPerRunScope} so the builder stays under the cognitive-complexity
|
|
206
|
+
* cap and the cloud-active gate + repo derivation read as one cohesive unit.
|
|
207
|
+
*
|
|
208
|
+
* `cloudActive` mirrors `resolveSignalSink`'s gate (a resolved key AND not
|
|
209
|
+
* `--no-cloud` AND `sync !== false`): an API key resolves (flag → env → config),
|
|
210
|
+
* egress is not opted out, and the user/project did not set `sync: false`.
|
|
211
|
+
*
|
|
212
|
+
* The free-form `repo` join key (project-root basename, or cwd basename when
|
|
213
|
+
* there is no project — cwd is the floor, Assumption 2) is attached ONLY when
|
|
214
|
+
* `cloudActive`; never an empty sentinel. `repoId`/`tenantId` are NOT locally
|
|
215
|
+
* resolvable in the OSS CLI today, so they are omitted (the future
|
|
216
|
+
* locally-cached surrogate slot). Returns `cloudActive`/`traceId` alongside the
|
|
217
|
+
* bag for the assembly-step diagnostics.
|
|
218
|
+
*/
|
|
219
|
+
function assembleCorrelation(input) {
|
|
220
|
+
const cloudActive = resolveApiKey(input.apiKey) !== undefined &&
|
|
221
|
+
input.noCloud !== true &&
|
|
222
|
+
input.effectiveCloud?.sync !== false;
|
|
223
|
+
const repoBaseDir = input.project.scope === 'project' ? input.project.projectRoot : input.cwd;
|
|
224
|
+
const repo = cloudActive ? basename(repoBaseDir) || undefined : undefined;
|
|
225
|
+
const traceId = currentTraceparent();
|
|
226
|
+
const correlation = {
|
|
227
|
+
runId: input.runId,
|
|
228
|
+
tool: input.tool,
|
|
229
|
+
parentCommand: input.parentCommand,
|
|
230
|
+
...(traceId ? { traceId } : {}),
|
|
231
|
+
...(repo ? { repo } : {}),
|
|
232
|
+
};
|
|
233
|
+
return { correlation, cloudActive, traceId };
|
|
234
|
+
}
|
|
160
235
|
// Helper duplicated from pre-action-hook for now (small, can be shared later if it grows).
|
|
161
236
|
function configDocumentSlot(project, configDocument) {
|
|
162
237
|
return project.scope === 'project' && project.configPath !== undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-per-run-scope.js","sourceRoot":"","sources":["../../src/bootstrap/build-per-run-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"build-per-run-scope.js","sourceRoot":"","sources":["../../src/bootstrap/build-per-run-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAG1B,uBAAuB,EAGvB,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,GAMjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,mBAAmB,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G,KAAK,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;IAC9F,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAE1E,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,MAAM,WAAW,GAAmB;QAClC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/B,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1B,CAAC;IAEF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AAC/C,CAAC;AAED,2FAA2F;AAC3F,SAAS,kBAAkB,CACzB,OAA4E,EAC5E,cAAuB;IAEvB,OAAO,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;QACpE,CAAC,CAAC,EAAE,cAAc,EAAE,cAAyC,EAAE;QAC/D,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,sFAAsF;AACtF,mFAAmF;AACnF,iFAAiF;AACjF,gFAAgF;AAChF,2BAA2B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const BUNDLED_TOOL_PACKAGES: readonly string[];
|
|
2
|
+
export declare const EXPECTED_SCAFFOLDING_TOOL_IDS: readonly string[];
|
|
3
|
+
/** Bundled capability pack npm names keyed by marker kind / domain id. */
|
|
4
|
+
export declare const BUNDLED_CAPABILITY_PACKS: Readonly<Record<string, readonly string[]>>;
|
|
5
|
+
//# sourceMappingURL=bundled-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundled-manifest.d.ts","sourceRoot":"","sources":["../../src/bootstrap/bundled-manifest.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAAoC,CAAC;AAExF,eAAO,MAAM,6BAA6B,EAAE,SAAS,MAAM,EAAuC,CAAC;AAEnG,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CACnC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
/**
|
|
4
|
+
* Data-driven source for first-party bundled tools and capability packs.
|
|
5
|
+
* Loaded via fs + import.meta.url (works in src dev and dist/ after build copy).
|
|
6
|
+
*/
|
|
7
|
+
const manifestUrl = new URL('bundled-tools.manifest.json', import.meta.url);
|
|
8
|
+
const bundledManifest = JSON.parse(readFileSync(fileURLToPath(manifestUrl), 'utf8'));
|
|
9
|
+
export const BUNDLED_TOOL_PACKAGES = bundledManifest.bundledPackages;
|
|
10
|
+
export const EXPECTED_SCAFFOLDING_TOOL_IDS = bundledManifest.scaffoldingToolIds;
|
|
11
|
+
/** Bundled capability pack npm names keyed by marker kind / domain id. */
|
|
12
|
+
export const BUNDLED_CAPABILITY_PACKS = bundledManifest.bundledCapabilityPacks ?? {};
|
|
13
|
+
//# sourceMappingURL=bundled-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundled-manifest.js","sourceRoot":"","sources":["../../src/bootstrap/bundled-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;GAGG;AACH,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5E,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAIlF,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAsB,eAAe,CAAC,eAAe,CAAC;AAExF,MAAM,CAAC,MAAM,6BAA6B,GAAsB,eAAe,CAAC,kBAAkB,CAAC;AAEnG,0EAA0E;AAC1E,MAAM,CAAC,MAAM,wBAAwB,GACnC,eAAe,CAAC,sBAAsB,IAAI,EAAE,CAAC"}
|
|
@@ -2,5 +2,23 @@
|
|
|
2
2
|
"$schema": "./bundled-tools.manifest.schema.json",
|
|
3
3
|
"comment": "Data-driven source for first-party bundled tools. Edit this when adding a new bundled tool (see contributor docs). The CLI composition root loads it at runtime (via require) so BUNDLED_TOOL_PACKAGES and EXPECTED_SCAFFOLDING_TOOL_IDS are derived, not hand-maintained.",
|
|
4
4
|
"bundledPackages": ["@opensip-cli/fitness", "@opensip-cli/simulation", "@opensip-cli/graph"],
|
|
5
|
-
"scaffoldingToolIds": ["
|
|
5
|
+
"scaffoldingToolIds": ["fit", "sim"],
|
|
6
|
+
"bundledCapabilityPacks": {
|
|
7
|
+
"fit-pack": [
|
|
8
|
+
"@opensip-cli/checks-universal",
|
|
9
|
+
"@opensip-cli/checks-typescript",
|
|
10
|
+
"@opensip-cli/checks-python",
|
|
11
|
+
"@opensip-cli/checks-go",
|
|
12
|
+
"@opensip-cli/checks-java",
|
|
13
|
+
"@opensip-cli/checks-cpp",
|
|
14
|
+
"@opensip-cli/checks-rust"
|
|
15
|
+
],
|
|
16
|
+
"graph-adapter": [
|
|
17
|
+
"@opensip-cli/graph-typescript",
|
|
18
|
+
"@opensip-cli/graph-python",
|
|
19
|
+
"@opensip-cli/graph-rust",
|
|
20
|
+
"@opensip-cli/graph-go",
|
|
21
|
+
"@opensip-cli/graph-java"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
6
24
|
}
|
|
@@ -20,9 +20,11 @@
|
|
|
20
20
|
* (`tool.capabilityRegistrars`). The host routes by domain; the tool owns
|
|
21
21
|
* the registrar.
|
|
22
22
|
*
|
|
23
|
-
* This module is the ONE place the CLI imports `@opensip-cli/config`
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* This module is the ONE place the CLI host imports `@opensip-cli/config` for
|
|
24
|
+
* runtime composition (schema merge, validation, precedence). Tools may import
|
|
25
|
+
* `@opensip-cli/config` for {@link ToolConfigDeclaration} when declaring their
|
|
26
|
+
* config namespace (see `docs/public/10-concepts/03-modular-monolith.md`); at
|
|
27
|
+
* run time they read the validated namespace off `scope.toolConfig`.
|
|
26
28
|
*/
|
|
27
29
|
import { type CapabilityRegistry, type ResolvedToolConfig, type ToolPluginManifest, type ToolRegistry } from '@opensip-cli/core';
|
|
28
30
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-and-capabilities.d.ts","sourceRoot":"","sources":["../../src/bootstrap/config-and-capabilities.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config-and-capabilities.d.ts","sourceRoot":"","sources":["../../src/bootstrap/config-and-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAYH,OAAO,EACL,KAAK,kBAAkB,EAKvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAElB,MAAM,mBAAmB,CAAC;AA4E3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAC5D,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAwDlF;AA2CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAClD,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;CACvC,GAAG,kBAAkB,CAuBrB"}
|
|
@@ -20,12 +20,14 @@
|
|
|
20
20
|
* (`tool.capabilityRegistrars`). The host routes by domain; the tool owns
|
|
21
21
|
* the registrar.
|
|
22
22
|
*
|
|
23
|
-
* This module is the ONE place the CLI imports `@opensip-cli/config`
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* This module is the ONE place the CLI host imports `@opensip-cli/config` for
|
|
24
|
+
* runtime composition (schema merge, validation, precedence). Tools may import
|
|
25
|
+
* `@opensip-cli/config` for {@link ToolConfigDeclaration} when declaring their
|
|
26
|
+
* config namespace (see `docs/public/10-concepts/03-modular-monolith.md`); at
|
|
27
|
+
* run time they read the validated namespace off `scope.toolConfig`.
|
|
26
28
|
*/
|
|
27
29
|
import { analyzeNamespaceClaims, composeConfigSchema, decorateToolConfigDeclarationsWithGateKeys, hostConfigDeclarations, resolveConfig, validateConfigDocument, } from '@opensip-cli/config';
|
|
28
|
-
import { ConfigurationError, logger, readYamlFileOrThrow, registerCapabilityDomainsFromManifest, } from '@opensip-cli/core';
|
|
30
|
+
import { ConfigurationError, logger, readYamlFileOrThrow, resolveToolHooks, registerCapabilityDomainsFromManifest, } from '@opensip-cli/core';
|
|
29
31
|
/** A plain-object guard that treats arrays and null as non-objects. */
|
|
30
32
|
function isPlainObject(value) {
|
|
31
33
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
@@ -40,8 +42,9 @@ function isPlainObject(value) {
|
|
|
40
42
|
function collectDeclarations(tools) {
|
|
41
43
|
const declarations = [];
|
|
42
44
|
for (const tool of tools.list()) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
const config = resolveToolHooks(tool).config;
|
|
46
|
+
if (config !== undefined) {
|
|
47
|
+
declarations.push(config);
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
return declarations;
|
|
@@ -211,7 +214,7 @@ export function wireCapabilityRegistry(args) {
|
|
|
211
214
|
// (hasDomain false) — the host never invents a domain a tool didn't
|
|
212
215
|
// declare.
|
|
213
216
|
for (const tool of tools.list()) {
|
|
214
|
-
const registrars = tool.capabilityRegistrars;
|
|
217
|
+
const registrars = resolveToolHooks(tool).capabilityRegistrars;
|
|
215
218
|
if (registrars === undefined)
|
|
216
219
|
continue;
|
|
217
220
|
for (const [domainId, registrar] of Object.entries(registrars)) {
|