opensip-cli 0.1.12 → 0.1.14
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/artifact-seams.d.ts +7 -0
- package/dist/bootstrap/artifact-seams.d.ts.map +1 -0
- package/dist/bootstrap/artifact-seams.js +53 -0
- package/dist/bootstrap/artifact-seams.js.map +1 -0
- package/dist/bootstrap/atomic-artifact-write.d.ts +19 -0
- package/dist/bootstrap/atomic-artifact-write.d.ts.map +1 -0
- package/dist/bootstrap/atomic-artifact-write.js +68 -0
- package/dist/bootstrap/atomic-artifact-write.js.map +1 -0
- package/dist/bootstrap/baseline-seams.d.ts.map +1 -1
- package/dist/bootstrap/baseline-seams.js +79 -27
- package/dist/bootstrap/baseline-seams.js.map +1 -1
- package/dist/bootstrap/build-command-registration-input.d.ts.map +1 -1
- package/dist/bootstrap/build-command-registration-input.js.map +1 -1
- package/dist/bootstrap/build-external-worker-child-env.d.ts +25 -0
- package/dist/bootstrap/build-external-worker-child-env.d.ts.map +1 -0
- package/dist/bootstrap/build-external-worker-child-env.js +71 -0
- package/dist/bootstrap/build-external-worker-child-env.js.map +1 -0
- package/dist/bootstrap/build-per-run-scope.d.ts.map +1 -1
- package/dist/bootstrap/build-per-run-scope.js +4 -1
- package/dist/bootstrap/build-per-run-scope.js.map +1 -1
- package/dist/bootstrap/config-and-capabilities.d.ts.map +1 -1
- package/dist/bootstrap/config-and-capabilities.js +12 -94
- package/dist/bootstrap/config-and-capabilities.js.map +1 -1
- package/dist/bootstrap/config-declarations.d.ts +23 -0
- package/dist/bootstrap/config-declarations.d.ts.map +1 -0
- package/dist/bootstrap/config-declarations.js +73 -0
- package/dist/bootstrap/config-declarations.js.map +1 -0
- package/dist/bootstrap/decorate-tool-primary.d.ts.map +1 -1
- package/dist/bootstrap/decorate-tool-primary.js.map +1 -1
- package/dist/bootstrap/deliver-envelope.d.ts +4 -1
- package/dist/bootstrap/deliver-envelope.d.ts.map +1 -1
- package/dist/bootstrap/deliver-envelope.js +38 -10
- package/dist/bootstrap/deliver-envelope.js.map +1 -1
- package/dist/bootstrap/dispatch-fork-core.d.ts +1 -1
- package/dist/bootstrap/dispatch-fork-core.d.ts.map +1 -1
- package/dist/bootstrap/dispatch-fork-core.js +73 -75
- package/dist/bootstrap/dispatch-fork-core.js.map +1 -1
- package/dist/bootstrap/dispatch-host-rpc-handler.d.ts.map +1 -1
- package/dist/bootstrap/dispatch-host-rpc-handler.js +4 -0
- package/dist/bootstrap/dispatch-host-rpc-handler.js.map +1 -1
- package/dist/bootstrap/dispatch-replay-result.d.ts.map +1 -1
- package/dist/bootstrap/dispatch-replay-result.js +3 -0
- package/dist/bootstrap/dispatch-replay-result.js.map +1 -1
- package/dist/bootstrap/io-plane.d.ts.map +1 -1
- package/dist/bootstrap/io-plane.js +4 -1
- package/dist/bootstrap/io-plane.js.map +1 -1
- package/dist/bootstrap/load-tool-capabilities.d.ts.map +1 -1
- package/dist/bootstrap/load-tool-capabilities.js +34 -3
- package/dist/bootstrap/load-tool-capabilities.js.map +1 -1
- package/dist/bootstrap/register-tools-discovery.d.ts.map +1 -1
- package/dist/bootstrap/register-tools-discovery.js +2 -0
- package/dist/bootstrap/register-tools-discovery.js.map +1 -1
- package/dist/bootstrap/report-failure.d.ts +28 -0
- package/dist/bootstrap/report-failure.d.ts.map +1 -0
- package/dist/bootstrap/report-failure.js +135 -0
- package/dist/bootstrap/report-failure.js.map +1 -0
- package/dist/bootstrap/scope-access.d.ts +1 -1
- package/dist/bootstrap/scope-access.d.ts.map +1 -1
- package/dist/bootstrap/scope-access.js +10 -2
- package/dist/bootstrap/scope-access.js.map +1 -1
- package/dist/bootstrap/state-lock-policy.d.ts +19 -0
- package/dist/bootstrap/state-lock-policy.d.ts.map +1 -0
- package/dist/bootstrap/state-lock-policy.js +86 -0
- package/dist/bootstrap/state-lock-policy.js.map +1 -0
- package/dist/bootstrap/synthesize-external-tool.d.ts.map +1 -1
- package/dist/bootstrap/synthesize-external-tool.js +11 -1
- package/dist/bootstrap/synthesize-external-tool.js.map +1 -1
- package/dist/bootstrap/tool-command-dispatch-types.d.ts +23 -2
- package/dist/bootstrap/tool-command-dispatch-types.d.ts.map +1 -1
- package/dist/bootstrap/tool-command-worker-config-pass.d.ts.map +1 -1
- package/dist/bootstrap/tool-command-worker-config-pass.js.map +1 -1
- package/dist/bootstrap/tool-command-worker-context.d.ts +4 -3
- package/dist/bootstrap/tool-command-worker-context.d.ts.map +1 -1
- package/dist/bootstrap/tool-command-worker-context.js +28 -4
- package/dist/bootstrap/tool-command-worker-context.js.map +1 -1
- package/dist/bootstrap/tool-command-worker-entry.d.ts.map +1 -1
- package/dist/bootstrap/tool-command-worker-entry.js +38 -31
- package/dist/bootstrap/tool-command-worker-entry.js.map +1 -1
- package/dist/bootstrap/tool-command-worker-result.d.ts +25 -0
- package/dist/bootstrap/tool-command-worker-result.d.ts.map +1 -0
- package/dist/bootstrap/tool-command-worker-result.js +60 -0
- package/dist/bootstrap/tool-command-worker-result.js.map +1 -0
- package/dist/bootstrap/tool-trust.d.ts +12 -0
- package/dist/bootstrap/tool-trust.d.ts.map +1 -1
- package/dist/bootstrap/tool-trust.js +29 -5
- package/dist/bootstrap/tool-trust.js.map +1 -1
- package/dist/bootstrap/validate-tool.d.ts.map +1 -1
- package/dist/bootstrap/validate-tool.js +4 -1
- package/dist/bootstrap/validate-tool.js.map +1 -1
- package/dist/cli-context.d.ts.map +1 -1
- package/dist/cli-context.js +42 -8
- package/dist/cli-context.js.map +1 -1
- package/dist/commands/agent-catalog.d.ts +8 -7
- package/dist/commands/agent-catalog.d.ts.map +1 -1
- package/dist/commands/agent-catalog.js +129 -60
- package/dist/commands/agent-catalog.js.map +1 -1
- package/dist/commands/clear.d.ts.map +1 -1
- package/dist/commands/clear.js +12 -2
- package/dist/commands/clear.js.map +1 -1
- package/dist/commands/config.d.ts +22 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +135 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/configure.d.ts.map +1 -1
- package/dist/commands/configure.js +5 -1
- package/dist/commands/configure.js.map +1 -1
- package/dist/commands/host-command-specs.d.ts.map +1 -1
- package/dist/commands/host-command-specs.js +13 -5
- package/dist/commands/host-command-specs.js.map +1 -1
- package/dist/commands/host-subcommand-config.d.ts +7 -0
- package/dist/commands/host-subcommand-config.d.ts.map +1 -0
- package/dist/commands/host-subcommand-config.js +75 -0
- package/dist/commands/host-subcommand-config.js.map +1 -0
- package/dist/commands/host-subcommand-groups.d.ts.map +1 -1
- package/dist/commands/host-subcommand-groups.js +7 -1
- package/dist/commands/host-subcommand-groups.js.map +1 -1
- package/dist/commands/host-subcommand-sessions.d.ts.map +1 -1
- package/dist/commands/host-subcommand-sessions.js +8 -4
- package/dist/commands/host-subcommand-sessions.js.map +1 -1
- package/dist/commands/init/agents-md.d.ts +6 -0
- package/dist/commands/init/agents-md.d.ts.map +1 -0
- package/dist/commands/init/agents-md.js +52 -0
- package/dist/commands/init/agents-md.js.map +1 -0
- package/dist/commands/init/language-detection.d.ts.map +1 -1
- package/dist/commands/init/language-detection.js +8 -3
- package/dist/commands/init/language-detection.js.map +1 -1
- package/dist/commands/init/scaffold-writer.d.ts.map +1 -1
- package/dist/commands/init/scaffold-writer.js +6 -1
- package/dist/commands/init/scaffold-writer.js.map +1 -1
- package/dist/commands/init.d.ts +5 -4
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +10 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mount-command-spec.d.ts +3 -1
- package/dist/commands/mount-command-spec.d.ts.map +1 -1
- package/dist/commands/mount-command-spec.js +27 -4
- package/dist/commands/mount-command-spec.js.map +1 -1
- package/dist/commands/plugin-host-ops.d.ts.map +1 -1
- package/dist/commands/plugin-host-ops.js +11 -2
- package/dist/commands/plugin-host-ops.js.map +1 -1
- package/dist/commands/plugin.d.ts.map +1 -1
- package/dist/commands/plugin.js +11 -2
- package/dist/commands/plugin.js.map +1 -1
- package/dist/commands/session-show.js +5 -46
- package/dist/commands/session-show.js.map +1 -1
- package/dist/commands/shared.d.ts +5 -1
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/tools/create-template-writer.d.ts +16 -0
- package/dist/commands/tools/create-template-writer.d.ts.map +1 -0
- package/dist/commands/tools/create-template-writer.js +39 -0
- package/dist/commands/tools/create-template-writer.js.map +1 -0
- package/dist/commands/tools/create-templates.d.ts +19 -0
- package/dist/commands/tools/create-templates.d.ts.map +1 -0
- package/dist/commands/tools/create-templates.js +228 -0
- package/dist/commands/tools/create-templates.js.map +1 -0
- package/dist/commands/tools/create.d.ts +4 -1
- package/dist/commands/tools/create.d.ts.map +1 -1
- package/dist/commands/tools/create.js +35 -50
- package/dist/commands/tools/create.js.map +1 -1
- package/dist/commands/tools/index.d.ts.map +1 -1
- package/dist/commands/tools/index.js +8 -0
- package/dist/commands/tools/index.js.map +1 -1
- package/dist/commands/tools/install.d.ts.map +1 -1
- package/dist/commands/tools/install.js +21 -2
- package/dist/commands/tools/install.js.map +1 -1
- package/dist/commands/tools/storage-contract-checks.d.ts.map +1 -1
- package/dist/commands/tools/storage-contract-checks.js.map +1 -1
- package/dist/commands/tools/uninstall.d.ts.map +1 -1
- package/dist/commands/tools/uninstall.js +14 -3
- package/dist/commands/tools/uninstall.js.map +1 -1
- package/dist/commands/tools/validate.d.ts.map +1 -1
- package/dist/commands/tools/validate.js +51 -6
- package/dist/commands/tools/validate.js.map +1 -1
- package/dist/commands/uninstall/targets.d.ts.map +1 -1
- package/dist/commands/uninstall/targets.js +8 -1
- package/dist/commands/uninstall/targets.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +12 -2
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/env/host-env-specs.d.ts.map +1 -1
- package/dist/env/host-env-specs.js +57 -4
- package/dist/env/host-env-specs.js.map +1 -1
- package/dist/error-handler.d.ts.map +1 -1
- package/dist/error-handler.js +28 -6
- package/dist/error-handler.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/report-compose.d.ts.map +1 -1
- package/dist/report-compose.js +21 -3
- package/dist/report-compose.js.map +1 -1
- package/dist/telemetry/sdk-init.d.ts.map +1 -1
- package/dist/telemetry/sdk-init.js +3 -1
- package/dist/telemetry/sdk-init.js.map +1 -1
- package/dist/ui/result-to-view.d.ts.map +1 -1
- package/dist/ui/result-to-view.js +21 -1
- package/dist/ui/result-to-view.js.map +1 -1
- package/dist/ui/views/init-view.d.ts.map +1 -1
- package/dist/ui/views/init-view.js +14 -2
- package/dist/ui/views/init-view.js.map +1 -1
- package/dist/ui/views/misc-views.d.ts +13 -0
- package/dist/ui/views/misc-views.d.ts.map +1 -1
- package/dist/ui/views/misc-views.js +77 -5
- package/dist/ui/views/misc-views.js.map +1 -1
- package/dist/ui/views/plugin-view.d.ts.map +1 -1
- package/dist/ui/views/plugin-view.js +4 -1
- package/dist/ui/views/plugin-view.js.map +1 -1
- package/dist/ui/views/tools-views.d.ts.map +1 -1
- package/dist/ui/views/tools-views.js +8 -7
- package/dist/ui/views/tools-views.js.map +1 -1
- package/dist/update-notifier.d.ts +3 -0
- package/dist/update-notifier.d.ts.map +1 -1
- package/dist/update-notifier.js +3 -0
- package/dist/update-notifier.js.map +1 -1
- package/package.json +33 -33
|
@@ -26,84 +26,10 @@
|
|
|
26
26
|
* config namespace (see `docs/public/10-concepts/03-modular-monolith.md`); at
|
|
27
27
|
* run time they read the validated namespace off `scope.toolConfig`.
|
|
28
28
|
*/
|
|
29
|
-
import { analyzeNamespaceClaims, composeConfigSchema,
|
|
29
|
+
import { analyzeNamespaceClaims, composeConfigSchema, partitionUnclaimedNamespaces, resolveConfig, validateConfigDocument, } from '@opensip-cli/config';
|
|
30
30
|
import { ConfigurationError, isPlainRecord, logger, readYamlFileOrThrow, resolveToolHooks, registerCapabilityDomainsFromManifest, } from '@opensip-cli/core';
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
* Find the manifest config descriptor for a tool, matching by stable id then by
|
|
34
|
-
* the manifest's human id. Returns `undefined` when no admitted manifest for the
|
|
35
|
-
* tool declares a `config` descriptor.
|
|
36
|
-
*/
|
|
37
|
-
function manifestDescriptorFor(tool, manifests) {
|
|
38
|
-
const manifest = manifests.find((m) => m.stableId !== undefined && m.stableId === tool.metadata.id) ??
|
|
39
|
-
manifests.find((m) => m.id === tool.metadata.name);
|
|
40
|
-
return manifest?.config;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Collect the contributed config declarations from the registered tools —
|
|
44
|
-
* provenance-aware (ADR-0054 M4-E Config two-pass).
|
|
45
|
-
*
|
|
46
|
-
* - **Bundled** (trusted computing base) → fold the tool's runtime Zod
|
|
47
|
-
* `config` declaration host-side, exactly as before. A bundled tool's
|
|
48
|
-
* `config` slot is the kernel-side `ToolConfigContribution` carrier,
|
|
49
|
-
* structurally a `ToolConfigDeclaration` (schema `unknown` at the kernel
|
|
50
|
-
* boundary, a Zod schema at the config layer), so narrowing it here — the
|
|
51
|
-
* composition root, which DOES import `@opensip-cli/config` — is sound.
|
|
52
|
-
* - **External** (installed / project-local / user-global) → NEVER import the
|
|
53
|
-
* tool's Zod (executable code — the ADR-0054 load-time hole). Instead derive
|
|
54
|
-
* a COARSE declaration from the tool's serializable manifest descriptor
|
|
55
|
-
* ({@link ToolConfigManifestDescriptor}); the host validates the namespace's
|
|
56
|
-
* top-level shape as pure data. An external tool that ships NO descriptor
|
|
57
|
-
* contributes no declaration — its namespace (if present) passes through the
|
|
58
|
-
* document catchall (rule-2) and ALL of its validation defers to the worker
|
|
59
|
-
* deep pass.
|
|
60
|
-
*/
|
|
61
|
-
function collectDeclarations(tools, provenance, manifests) {
|
|
62
|
-
const declarations = [];
|
|
63
|
-
for (const tool of tools.list()) {
|
|
64
|
-
if (provenanceSourceFor(tool, provenance) === 'bundled') {
|
|
65
|
-
const config = resolveToolHooks(tool).config;
|
|
66
|
-
if (config !== undefined) {
|
|
67
|
-
declarations.push(config);
|
|
68
|
-
}
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
// External: coarse, manifest-descriptor-derived schema only — no Zod import.
|
|
72
|
-
const descriptor = manifestDescriptorFor(tool, manifests);
|
|
73
|
-
if (descriptor !== undefined) {
|
|
74
|
-
declarations.push({
|
|
75
|
-
namespace: descriptor.namespace,
|
|
76
|
-
schema: jsonSchemaObjectToZod(descriptor.schema),
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
// No descriptor → defer entirely to the worker deep pass (catchall passes
|
|
80
|
-
// any present namespace block through; do NOT host-import its Zod to "help").
|
|
81
|
-
}
|
|
82
|
-
return declarations;
|
|
83
|
-
}
|
|
84
|
-
function addPluginConfigKey(keys, key, kind) {
|
|
85
|
-
if (key === undefined)
|
|
86
|
-
return;
|
|
87
|
-
const existing = keys.get(key);
|
|
88
|
-
if (existing !== undefined && existing !== kind) {
|
|
89
|
-
throw new ConfigurationError(`Plugin config key '${key}' is declared with conflicting value kinds (${existing}, ${kind}).`, { code: 'CONFIGURATION_ERROR', namespace: 'plugins' });
|
|
90
|
-
}
|
|
91
|
-
keys.set(key, kind);
|
|
92
|
-
}
|
|
93
|
-
function collectPluginConfigKeys(manifests) {
|
|
94
|
-
const keys = new Map();
|
|
95
|
-
for (const manifest of manifests) {
|
|
96
|
-
for (const capability of manifest.capabilities ?? []) {
|
|
97
|
-
const configKeys = capability.discovery?.configKeys;
|
|
98
|
-
if (configKeys === undefined)
|
|
99
|
-
continue;
|
|
100
|
-
addPluginConfigKey(keys, configKeys.packages, 'packages');
|
|
101
|
-
addPluginConfigKey(keys, configKeys.autoDiscover, 'autoDiscover');
|
|
102
|
-
addPluginConfigKey(keys, configKeys.scopes, 'scopes');
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return [...keys.entries()].map(([key, kind]) => ({ key, kind }));
|
|
106
|
-
}
|
|
31
|
+
import { buildConfigDeclarations } from './config-declarations.js';
|
|
32
|
+
import { shouldRunHookInHost } from './tool-provenance.js';
|
|
107
33
|
/**
|
|
108
34
|
* Project the validated document's per-namespace blocks into the `file`
|
|
109
35
|
* precedence source (`namespace -> { key -> value }`). Only the declared
|
|
@@ -146,25 +72,18 @@ export function composeAndValidateToolConfig(args) {
|
|
|
146
72
|
// host-side (trusted), external tools validate from their serializable
|
|
147
73
|
// manifest descriptor (coarse, NO Zod import); the deep Zod pass runs in the
|
|
148
74
|
// worker.
|
|
149
|
-
const
|
|
75
|
+
const { declarations, hasToolNamespaces } = buildConfigDeclarations({
|
|
76
|
+
tools,
|
|
77
|
+
manifests,
|
|
78
|
+
provenance,
|
|
79
|
+
});
|
|
150
80
|
// A run with no tools that declare config (e.g. a project-agnostic context)
|
|
151
81
|
// carries no toolConfig — tools fall back to their in-tool defaults. The host
|
|
152
82
|
// document-level blocks (cli/dashboard/schemaVersion) only need composing when
|
|
153
83
|
// there is a tool dispatch to validate the document for; the real CLI always
|
|
154
84
|
// registers fit/graph/sim, so they are always composed in practice.
|
|
155
|
-
if (
|
|
85
|
+
if (!hasToolNamespaces)
|
|
156
86
|
return { config: undefined, document: {} };
|
|
157
|
-
// Compose the host document-level declarations (cli/dashboard/schemaVersion,
|
|
158
|
-
// and from Phase 1 the targeting blocks) BESIDE the decorated tool
|
|
159
|
-
// declarations, so the whole document — not just the tool namespaces —
|
|
160
|
-
// validates STRICT through the one composed schema (ADR-0023, the launch seam).
|
|
161
|
-
// Gate keys are added only to tool namespaces; host blocks stay strict.
|
|
162
|
-
const declarations = [
|
|
163
|
-
...hostConfigDeclarations({
|
|
164
|
-
pluginConfigKeys: collectPluginConfigKeys(manifests),
|
|
165
|
-
}),
|
|
166
|
-
...toolDeclarations,
|
|
167
|
-
];
|
|
168
87
|
// When a configPath was resolved by the project context (i.e. a real
|
|
169
88
|
// opensip-cli.config.yml or a package.json pointer), read it *strictly*.
|
|
170
89
|
// Malformed YAML or unreadable file must fail before any dispatch (a
|
|
@@ -172,11 +91,10 @@ export function composeAndValidateToolConfig(args) {
|
|
|
172
91
|
// When no configPath, fall back to defaults only (permissive discovery
|
|
173
92
|
// paths elsewhere still use the non-throwing reader).
|
|
174
93
|
const raw = configPath === undefined ? {} : readYamlFileOrThrow(configPath, { loader: 'project-config' });
|
|
175
|
-
const document = isPlainRecord(raw) ? raw : {};
|
|
176
94
|
const schema = composeConfigSchema(declarations);
|
|
177
95
|
// STRICT gate: a typo in any tool namespace throws ConfigurationError here,
|
|
178
96
|
// before dispatch. The CLI error boundary maps it to CONFIGURATION_ERROR.
|
|
179
|
-
const validated = validateConfigDocument(schema,
|
|
97
|
+
const validated = validateConfigDocument(schema, raw);
|
|
180
98
|
// ADR-0043: the composer TOLERATES unclaimed top-level namespaces (the
|
|
181
99
|
// uninstalled-tool forward-compat contract) — but never silently. Two cases:
|
|
182
100
|
// - the namespace equals a LOADED tool's id → that tool declares no
|
|
@@ -215,13 +133,13 @@ function reportUnclaimedNamespaces(args) {
|
|
|
215
133
|
if (report.unclaimed.length === 0)
|
|
216
134
|
return;
|
|
217
135
|
const loadedToolNames = new Set(args.tools.list().map((t) => t.metadata.name ?? t.metadata.id));
|
|
218
|
-
const toolBugs = report
|
|
136
|
+
const { toolBugs, benign } = partitionUnclaimedNamespaces(report, loadedToolNames);
|
|
219
137
|
if (toolBugs.length > 0) {
|
|
220
138
|
const names = toolBugs.map((u) => `'${u.namespace}'`).join(', ');
|
|
221
139
|
throw new ConfigurationError(`Config declares ${names} but the loaded tool(s) of the same id contribute no Tool.config — ` +
|
|
222
140
|
`the block can never apply. Remove the block or fix the tool's config contribution. (ADR-0043)`, { code: 'CONFIGURATION_ERROR' });
|
|
223
141
|
}
|
|
224
|
-
for (const u of
|
|
142
|
+
for (const u of benign) {
|
|
225
143
|
const didYouMean = u.suggestion === undefined ? '' : ` — did you mean '${u.suggestion}:'?`;
|
|
226
144
|
logger.warn({
|
|
227
145
|
evt: 'cli.config.unclaimed_namespace',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-and-capabilities.js","sourceRoot":"","sources":["../../src/bootstrap/config-and-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"config-and-capabilities.js","sourceRoot":"","sources":["../../src/bootstrap/config-and-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,4BAA4B,EAC5B,aAAa,EACb,sBAAsB,GAEvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,kBAAkB,EAClB,aAAa,EACb,MAAM,EACN,mBAAmB,EACnB,gBAAgB,EAKhB,qCAAqC,GACtC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;GAKG;AACH,SAAS,aAAa,CACpB,YAA8C,EAC9C,SAAkB;IAElB,MAAM,IAAI,GAA4C,EAAE,CAAC;IACzD,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxC,IAAI,aAAa,CAAC,KAAK,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IACzD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,4BAA4B,CAAC,IAO5C;IAIC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,GAAG,EAAE,EA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
|
|
1
|
+
/**
|
|
2
|
+
* config-declarations — shared config declaration assembly for the dispatcher
|
|
3
|
+
* and `opensip config validate|schema` operator commands.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from `config-and-capabilities.ts` so schema composition uses the
|
|
6
|
+
* same declaration set without duplicating provenance/manifest folding logic.
|
|
7
|
+
*/
|
|
8
|
+
import { type ToolConfigDeclaration } from '@opensip-cli/config';
|
|
9
|
+
import { type ToolPluginManifest, type ToolProvenance, type ToolRegistry } from '@opensip-cli/core';
|
|
10
|
+
export interface ConfigDeclarationBundle {
|
|
11
|
+
readonly declarations: readonly ToolConfigDeclaration[];
|
|
12
|
+
/** True when at least one registered tool contributed a config namespace. */
|
|
13
|
+
readonly hasToolNamespaces: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Build the ordered declaration array the dispatcher and config commands use.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildConfigDeclarations(args: {
|
|
19
|
+
readonly tools: ToolRegistry;
|
|
20
|
+
readonly manifests?: readonly ToolPluginManifest[];
|
|
21
|
+
readonly provenance?: readonly ToolProvenance[];
|
|
22
|
+
}): ConfigDeclarationBundle;
|
|
23
|
+
//# sourceMappingURL=config-declarations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-declarations.d.ts","sourceRoot":"","sources":["../../src/bootstrap/config-declarations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAuE3B,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxD,6EAA6E;IAC7E,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;CACrC;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACnD,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;CACjD,GAAG,uBAAuB,CAY1B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config-declarations — shared config declaration assembly for the dispatcher
|
|
3
|
+
* and `opensip config validate|schema` operator commands.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from `config-and-capabilities.ts` so schema composition uses the
|
|
6
|
+
* same declaration set without duplicating provenance/manifest folding logic.
|
|
7
|
+
*/
|
|
8
|
+
import { decorateToolConfigDeclarationsWithGateKeys, hostConfigDeclarations, jsonSchemaObjectToZod, } from '@opensip-cli/config';
|
|
9
|
+
import { ConfigurationError, resolveToolHooks, } from '@opensip-cli/core';
|
|
10
|
+
import { provenanceSourceFor } from './tool-provenance.js';
|
|
11
|
+
function manifestDescriptorFor(tool, manifests) {
|
|
12
|
+
const manifest = manifests.find((m) => m.stableId !== undefined && m.stableId === tool.metadata.id) ??
|
|
13
|
+
manifests.find((m) => m.id === tool.metadata.name);
|
|
14
|
+
return manifest?.config;
|
|
15
|
+
}
|
|
16
|
+
function collectDeclarations(tools, provenance, manifests) {
|
|
17
|
+
const declarations = [];
|
|
18
|
+
for (const tool of tools.list()) {
|
|
19
|
+
if (provenanceSourceFor(tool, provenance) === 'bundled') {
|
|
20
|
+
const config = resolveToolHooks(tool).config;
|
|
21
|
+
if (config !== undefined) {
|
|
22
|
+
declarations.push(config);
|
|
23
|
+
}
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const descriptor = manifestDescriptorFor(tool, manifests);
|
|
27
|
+
if (descriptor !== undefined) {
|
|
28
|
+
declarations.push({
|
|
29
|
+
namespace: descriptor.namespace,
|
|
30
|
+
schema: jsonSchemaObjectToZod(descriptor.schema),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return declarations;
|
|
35
|
+
}
|
|
36
|
+
function addPluginConfigKey(keys, key, kind) {
|
|
37
|
+
if (key === undefined)
|
|
38
|
+
return;
|
|
39
|
+
const existing = keys.get(key);
|
|
40
|
+
if (existing !== undefined && existing !== kind) {
|
|
41
|
+
throw new ConfigurationError(`Plugin config key '${key}' is declared with conflicting value kinds (${existing}, ${kind}).`, { code: 'CONFIGURATION_ERROR', namespace: 'plugins' });
|
|
42
|
+
}
|
|
43
|
+
keys.set(key, kind);
|
|
44
|
+
}
|
|
45
|
+
function collectPluginConfigKeys(manifests) {
|
|
46
|
+
const keys = new Map();
|
|
47
|
+
for (const manifest of manifests) {
|
|
48
|
+
for (const capability of manifest.capabilities ?? []) {
|
|
49
|
+
const configKeys = capability.discovery?.configKeys;
|
|
50
|
+
if (configKeys === undefined)
|
|
51
|
+
continue;
|
|
52
|
+
addPluginConfigKey(keys, configKeys.packages, 'packages');
|
|
53
|
+
addPluginConfigKey(keys, configKeys.autoDiscover, 'autoDiscover');
|
|
54
|
+
addPluginConfigKey(keys, configKeys.scopes, 'scopes');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return [...keys.entries()].map(([key, kind]) => ({ key, kind }));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Build the ordered declaration array the dispatcher and config commands use.
|
|
61
|
+
*/
|
|
62
|
+
export function buildConfigDeclarations(args) {
|
|
63
|
+
const { tools, manifests = [], provenance = [] } = args;
|
|
64
|
+
const toolDeclarations = decorateToolConfigDeclarationsWithGateKeys(collectDeclarations(tools, provenance, manifests));
|
|
65
|
+
const declarations = [
|
|
66
|
+
...hostConfigDeclarations({
|
|
67
|
+
pluginConfigKeys: collectPluginConfigKeys(manifests),
|
|
68
|
+
}),
|
|
69
|
+
...toolDeclarations,
|
|
70
|
+
];
|
|
71
|
+
return { declarations, hasToolNamespaces: toolDeclarations.length > 0 };
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=config-declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-declarations.js","sourceRoot":"","sources":["../../src/bootstrap/config-declarations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,0CAA0C,EAC1C,sBAAsB,EACtB,qBAAqB,GAGtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GAKjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,SAAS,qBAAqB,CAC5B,IAAU,EACV,SAAwC;IAExC,MAAM,QAAQ,GACZ,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClF,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrD,OAAO,QAAQ,EAAE,MAAM,CAAC;AAC1B,CAAC;AAED,SAAS,mBAAmB,CAC1B,KAAmB,EACnB,UAAqC,EACrC,SAAwC;IAExC,MAAM,YAAY,GAA4B,EAAE,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAChC,IAAI,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,SAAS,EAAE,CAAC;YACxD,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;YAC7C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,YAAY,CAAC,IAAI,CAAC,MAA+B,CAAC,CAAC;YACrD,CAAC;YACD,SAAS;QACX,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AY,EAAE,cAAc,CAAC,CAAC;YAClE,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACnE,CAAC;AAQD;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAIvC;IACC,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;IACxD,MAAM,gBAAgB,GAAG,0CAA0C,CACjE,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,CAClD,CAAC;IACF,MAAM,YAAY,GAAG;QACnB,GAAG,sBAAsB,CAAC;YACxB,gBAAgB,EAAE,uBAAuB,CAAC,SAAS,CAAC;SACrD,CAAC;QACF,GAAG,gBAAgB;KACpB,CAAC;IACF,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorate-tool-primary.d.ts","sourceRoot":"","sources":["../../src/bootstrap/decorate-tool-primary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"decorate-tool-primary.d.ts","sourceRoot":"","sources":["../../src/bootstrap/decorate-tool-primary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAuC9C;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAKpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CA0B5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorate-tool-primary.js","sourceRoot":"","sources":["../../src/bootstrap/decorate-tool-primary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EACL,gBAAgB,EAChB,WAAW,GAGZ,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AAEjF;;;;GAIG;AACH,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"decorate-tool-primary.js","sourceRoot":"","sources":["../../src/bootstrap/decorate-tool-primary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EACL,gBAAgB,EAChB,WAAW,GAGZ,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AAEjF;;;;GAIG;AACH,MAAM,uBAAuB,GAGvB,2BAA2B,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;IAC5C,4EAA4E;IAC5E,4EAA4E;I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AG,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CACnF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CACb,CAAC;IACF,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/C,gBAAgB,CAAC,UAAU,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7F,CAAC;IAED,oEAAoE;IACpE,qEAAqE;IACrE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7B,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED,0FAA0F;AAC1F,SAAS,UAAU,CAAC,KAAa;IAC/B,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAClC,CAAC"}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* engines return envelopes, and the composition root owns formatting,
|
|
25
25
|
* delivery, and report-upload exit-code policy.
|
|
26
26
|
*/
|
|
27
|
+
import type { ArtifactWriteContext } from './atomic-artifact-write.js';
|
|
27
28
|
import type { SignalEnvelope } from '@opensip-cli/contracts';
|
|
28
29
|
import type { Logger, RepoIdentity, SignalBatch, SignalDeliveryResult } from '@opensip-cli/core';
|
|
29
30
|
/** Options the root supplies when delivering a tool's envelope. */
|
|
@@ -83,5 +84,7 @@ export declare function deliverEnvelope(envelope: SignalEnvelope, opts: DeliverE
|
|
|
83
84
|
* `@opensip-cli/output` itself. The formatter is pure; this function owns
|
|
84
85
|
* the effect (fs write).
|
|
85
86
|
*/
|
|
86
|
-
export declare function writeEnvelopeSarif(envelope: SignalEnvelope, path: string
|
|
87
|
+
export declare function writeEnvelopeSarif(envelope: SignalEnvelope, path: string, artifactCtx?: Partial<ArtifactWriteContext> & {
|
|
88
|
+
readonly logger?: ArtifactWriteContext['logger'];
|
|
89
|
+
}): Promise<void>;
|
|
87
90
|
//# sourceMappingURL=deliver-envelope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deliver-envelope.d.ts","sourceRoot":"","sources":["../../src/bootstrap/deliver-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;
|
|
1
|
+
{"version":3,"file":"deliver-envelope.d.ts","sourceRoot":"","sources":["../../src/bootstrap/deliver-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAeH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAIjG,mEAAmE;AACnE,MAAM,WAAW,sBAAsB;IACrC,uEAAuE;IACvE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,oEAAoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,GAAG,WAAW,CAS/F;AAmED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,aAAa,EAAE,OAAO,EACtB,SAAS,EAAE,OAAO,GACjB,MAAM,GAAG,SAAS,CAMpB;AAmCD;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,qBAAqB,CAAC,CAsFhC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;CAClD,GACA,OAAO,CAAC,IAAI,CAAC,CAWf"}
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
* engines return envelopes, and the composition root owns formatting,
|
|
25
25
|
* delivery, and report-upload exit-code policy.
|
|
26
26
|
*/
|
|
27
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
|
28
|
-
import { dirname } from 'node:path';
|
|
29
27
|
import { EXIT_CODES } from '@opensip-cli/contracts';
|
|
30
28
|
import { buildSignalBatch, currentScope, logger as defaultLogger } from '@opensip-cli/core';
|
|
31
|
-
import { formatSignalSarif, postChunked, resolveRepoIdentity, } from '@opensip-cli/output';
|
|
29
|
+
import { formatSignalSarif, postChunked, repoSlugFromIdentity, resolveRepoIdentity, } from '@opensip-cli/output';
|
|
30
|
+
import { writeArtifactAtomically } from './atomic-artifact-write.js';
|
|
31
|
+
import { resolveStateLockPolicy } from './state-lock-policy.js';
|
|
32
32
|
const MODULE_TAG = 'cli:bootstrap';
|
|
33
33
|
/**
|
|
34
34
|
* Map a {@link SignalEnvelope} to the cloud {@link SignalBatch} wire shape:
|
|
@@ -114,19 +114,28 @@ export function deriveReportExitDecision(reportTo, reportSuccess, runFailed) {
|
|
|
114
114
|
return undefined;
|
|
115
115
|
}
|
|
116
116
|
/** POST the envelope's SARIF to a `--report-to` receiver via the chunked transport. */
|
|
117
|
-
async function reportSarif(envelope, url, apiKey, fetchImpl) {
|
|
117
|
+
async function reportSarif(envelope, url, apiKey, fetchImpl, repoSlug) {
|
|
118
118
|
const sarif = formatSignalSarif(envelope);
|
|
119
119
|
// The receiver accepts a SARIF body at `<url>/sarif`; one chunk (the whole
|
|
120
120
|
// SARIF log) — the envelope is already capped upstream.
|
|
121
121
|
const target = url.endsWith('/sarif') ? url : `${url}/sarif`;
|
|
122
|
+
// Attach `x-opensip-repo` when an <org>/<repo> slug was derivable. The cloud
|
|
123
|
+
// scopes ingested signals to this repo within the caller's tenant (DEC-587);
|
|
124
|
+
// an absent slug is a soft accept (repo-less, DEC-588), so we simply omit it.
|
|
125
|
+
const extraHeaders = repoSlug === undefined ? undefined : { 'x-opensip-repo': repoSlug };
|
|
122
126
|
return postChunked({
|
|
123
127
|
url: target,
|
|
124
128
|
apiKey,
|
|
125
129
|
chunks: [JSON.parse(sarif)],
|
|
126
130
|
idempotencyKeyFor: (i) => `${envelope.runId}:report:${i}`,
|
|
127
131
|
timeoutFor: () => Math.min(300_000, 60_000 + envelope.signals.length * 100),
|
|
128
|
-
policy: {
|
|
132
|
+
policy: {
|
|
133
|
+
maxAttempts: 3,
|
|
134
|
+
overallDeadlineMs: 300_000,
|
|
135
|
+
honorRetryAfter: true,
|
|
136
|
+
},
|
|
129
137
|
evtPrefix: 'cli.report',
|
|
138
|
+
...(extraHeaders ? { extraHeaders } : {}),
|
|
130
139
|
fetchImpl,
|
|
131
140
|
});
|
|
132
141
|
}
|
|
@@ -173,10 +182,22 @@ export async function deliverEnvelope(envelope, opts) {
|
|
|
173
182
|
if (opts.reportTo === undefined || opts.reportTo.length === 0) {
|
|
174
183
|
return cloudLeg;
|
|
175
184
|
}
|
|
176
|
-
const
|
|
185
|
+
const repoSlug = repoSlugFromIdentity(repo);
|
|
186
|
+
const result = await reportSarif(envelope, opts.reportTo, opts.apiKey, opts.fetchImpl, repoSlug);
|
|
177
187
|
const reportSuccess = result.outcome === 'ok';
|
|
178
188
|
if (!reportSuccess) {
|
|
179
|
-
|
|
189
|
+
// Branch on the typed auth-status discriminator (never string-sniff
|
|
190
|
+
// `errors[]`): 401 = the key was rejected; 403 = authenticated but missing
|
|
191
|
+
// the `ingest:write` permission. The hint tells the user whether to fix the
|
|
192
|
+
// key or upgrade its role — the funnel's incentive to grant ingest:write.
|
|
193
|
+
let hint = '';
|
|
194
|
+
if (result.authStatus === 401) {
|
|
195
|
+
hint = ` — the API key was rejected; check --api-key / your config`;
|
|
196
|
+
}
|
|
197
|
+
else if (result.authStatus === 403) {
|
|
198
|
+
hint = ` — the API key lacks the \`ingest:write\` permission; use an operator/admin key`;
|
|
199
|
+
}
|
|
200
|
+
process.stderr.write(`opensip: --report-to failed (${opts.reportTo})${hint}: ` +
|
|
180
201
|
`${result.errors.length > 0 ? result.errors.join('; ') : 'unknown error'}\n`);
|
|
181
202
|
}
|
|
182
203
|
// Exit-code contract (ADR-0008): a report-upload failure exits 4 — but only
|
|
@@ -201,9 +222,16 @@ export async function deliverEnvelope(envelope, opts) {
|
|
|
201
222
|
* `@opensip-cli/output` itself. The formatter is pure; this function owns
|
|
202
223
|
* the effect (fs write).
|
|
203
224
|
*/
|
|
204
|
-
export
|
|
225
|
+
export function writeEnvelopeSarif(envelope, path, artifactCtx) {
|
|
205
226
|
const sarif = formatSignalSarif(envelope);
|
|
206
|
-
|
|
207
|
-
|
|
227
|
+
const ctx = {
|
|
228
|
+
policy: artifactCtx?.policy ?? resolveStateLockPolicy(),
|
|
229
|
+
logger: artifactCtx?.logger ?? defaultLogger,
|
|
230
|
+
runId: artifactCtx?.runId,
|
|
231
|
+
command: artifactCtx?.command,
|
|
232
|
+
cwdBasename: artifactCtx?.cwdBasename,
|
|
233
|
+
};
|
|
234
|
+
writeArtifactAtomically(path, sarif, ctx);
|
|
235
|
+
return Promise.resolve();
|
|
208
236
|
}
|
|
209
237
|
//# sourceMappingURL=deliver-envelope.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deliver-envelope.js","sourceRoot":"","sources":["../../src/bootstrap/deliver-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"deliver-envelope.js","sourceRoot":"","sources":["../../src/bootstrap/deliver-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,mBAAmB,GAEpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAMhE,MAAM,UAAU,GAAG,eAAe,CAAC;AAkCnC;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAwB,EAAE,IAAkB;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U,GAAG,wBAAwB,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;IACrF,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,KAAK,EAAE,WAAW,CAAC,KAAK,CAC3B,SAAS,EACT,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAC/B,aAAa,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,EACrD;QACE,GAAG,EAAE,IAAI,CAAC,QAAQ;QAClB,OAAO,EAAE,aAAa;KACvB,CACF,CAAC;IAEF,OAAO,EAAE,GAAG,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAAwB,EACxB,IAAY,EACZ,WAEC;IAED,MAAM,KAAK,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,GAAG,GAAyB;QAChC,MAAM,EAAE,WAAW,EAAE,MAAM,IAAI,sBAAsB,EAAE;QACvD,MAAM,EAAE,WAAW,EAAE,MAAM,IAAI,aAAa;QAC5C,KAAK,EAAE,WAAW,EAAE,KAAK;QACzB,OAAO,EAAE,WAAW,EAAE,OAAO;QAC7B,WAAW,EAAE,WAAW,EAAE,WAAW;KACtC,CAAC;IACF,uBAAuB,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1C,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -44,5 +44,5 @@ export declare function runWorkerSpec(args: {
|
|
|
44
44
|
readonly timeoutMs?: number;
|
|
45
45
|
}): Promise<ToolCommandResult>;
|
|
46
46
|
/** Build a structured supervisor-side dispatch error, logged with its failure class. */
|
|
47
|
-
export declare function dispatchError(spec: ToolCommandWorkerSpec, message: string, failureClass: string): ToolError;
|
|
47
|
+
export declare function dispatchError(spec: ToolCommandWorkerSpec, message: string, failureClass: string, stderrTail?: string): ToolError;
|
|
48
48
|
//# sourceMappingURL=dispatch-fork-core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-fork-core.d.ts","sourceRoot":"","sources":["../../src/bootstrap/dispatch-fork-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,
|
|
1
|
+
{"version":3,"file":"dispatch-fork-core.d.ts","sourceRoot":"","sources":["../../src/bootstrap/dispatch-fork-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,cAAc,EAEpB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,KAAK,EAGV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAE1C,4EAA4E;AAC5E,eAAO,MAAM,2BAA2B,SAAU,CAAC;AAEnD,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAQzD,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM,CASpE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAoB7B;AAqKD,wFAAwF;AACxF,wBAAgB,aAAa,CAC3B,IAAI,EAAE,qBAAqB,EAC3B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,MAAM,GAClB,SAAS,CAqBX"}
|