opensip-cli 0.1.13 → 0.1.15
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-retention.d.ts +62 -0
- package/dist/bootstrap/artifact-retention.d.ts.map +1 -0
- package/dist/bootstrap/artifact-retention.js +117 -0
- package/dist/bootstrap/artifact-retention.js.map +1 -0
- package/dist/bootstrap/artifact-seams.d.ts +21 -1
- package/dist/bootstrap/artifact-seams.d.ts.map +1 -1
- package/dist/bootstrap/artifact-seams.js +76 -4
- package/dist/bootstrap/artifact-seams.js.map +1 -1
- package/dist/bootstrap/atomic-artifact-write.d.ts.map +1 -1
- package/dist/bootstrap/atomic-artifact-write.js +7 -2
- package/dist/bootstrap/atomic-artifact-write.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-per-run-scope.d.ts.map +1 -1
- package/dist/bootstrap/build-per-run-scope.js +3 -0
- package/dist/bootstrap/build-per-run-scope.js.map +1 -1
- package/dist/bootstrap/bundled-tools.manifest.json +2 -1
- 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.map +1 -1
- package/dist/bootstrap/deliver-envelope.js +26 -5
- package/dist/bootstrap/deliver-envelope.js.map +1 -1
- package/dist/bootstrap/dispatch-fork-core.d.ts +15 -2
- package/dist/bootstrap/dispatch-fork-core.d.ts.map +1 -1
- package/dist/bootstrap/dispatch-fork-core.js +22 -4
- 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 +10 -0
- package/dist/bootstrap/dispatch-host-rpc-handler.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/run-plane.d.ts +10 -0
- package/dist/bootstrap/run-plane.d.ts.map +1 -1
- package/dist/bootstrap/run-plane.js +20 -0
- package/dist/bootstrap/run-plane.js.map +1 -1
- package/dist/bootstrap/scope-access.d.ts.map +1 -1
- package/dist/bootstrap/scope-access.js +4 -1
- package/dist/bootstrap/scope-access.js.map +1 -1
- package/dist/bootstrap/tool-command-dispatch-types.d.ts +15 -0
- 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 +5 -4
- package/dist/bootstrap/tool-command-worker-context.d.ts.map +1 -1
- package/dist/bootstrap/tool-command-worker-context.js +6 -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 +30 -5
- package/dist/bootstrap/tool-command-worker-entry.js.map +1 -1
- package/dist/bootstrap/tool-command-worker-rpc.d.ts.map +1 -1
- package/dist/bootstrap/tool-command-worker-rpc.js +23 -1
- package/dist/bootstrap/tool-command-worker-rpc.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 +46 -8
- package/dist/cli-context.js.map +1 -1
- package/dist/commands/agent-catalog.d.ts +9 -56
- package/dist/commands/agent-catalog.d.ts.map +1 -1
- package/dist/commands/agent-catalog.js +8 -178
- package/dist/commands/agent-catalog.js.map +1 -1
- package/dist/commands/assemble-opts.d.ts +13 -0
- package/dist/commands/assemble-opts.d.ts.map +1 -0
- package/dist/commands/assemble-opts.js +85 -0
- package/dist/commands/assemble-opts.js.map +1 -0
- 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/configure.d.ts.map +1 -1
- package/dist/commands/configure.js +5 -1
- package/dist/commands/configure.js.map +1 -1
- package/dist/commands/history.d.ts +7 -11
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +7 -39
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/host-command-specs.d.ts.map +1 -1
- package/dist/commands/host-command-specs.js +5 -1
- package/dist/commands/host-command-specs.js.map +1 -1
- package/dist/commands/host-subcommand-groups.d.ts.map +1 -1
- package/dist/commands/host-subcommand-groups.js +12 -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 +5 -1
- 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 +5 -1
- 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.map +1 -1
- package/dist/commands/init.js +5 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mount-command-spec-wiring.d.ts +1 -0
- package/dist/commands/mount-command-spec-wiring.d.ts.map +1 -1
- package/dist/commands/mount-command-spec-wiring.js +5 -5
- package/dist/commands/mount-command-spec-wiring.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.d.ts.map +1 -1
- package/dist/commands/session-show.js +13 -81
- package/dist/commands/session-show.js.map +1 -1
- package/dist/commands/shared.d.ts +3 -1
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/suite/capturing-context.d.ts +19 -0
- package/dist/commands/suite/capturing-context.d.ts.map +1 -0
- package/dist/commands/suite/capturing-context.js +62 -0
- package/dist/commands/suite/capturing-context.js.map +1 -0
- package/dist/commands/suite/orchestrator.d.ts +12 -0
- package/dist/commands/suite/orchestrator.d.ts.map +1 -0
- package/dist/commands/suite/orchestrator.js +216 -0
- package/dist/commands/suite/orchestrator.js.map +1 -0
- package/dist/commands/suite/suite-add.d.ts +18 -0
- package/dist/commands/suite/suite-add.d.ts.map +1 -0
- package/dist/commands/suite/suite-add.js +130 -0
- package/dist/commands/suite/suite-add.js.map +1 -0
- package/dist/commands/suite/suite-command-specs.d.ts +4 -0
- package/dist/commands/suite/suite-command-specs.d.ts.map +1 -0
- package/dist/commands/suite/suite-command-specs.js +150 -0
- package/dist/commands/suite/suite-command-specs.js.map +1 -0
- package/dist/commands/suite/validate-suite.d.ts +21 -0
- package/dist/commands/suite/validate-suite.d.ts.map +1 -0
- package/dist/commands/suite/validate-suite.js +89 -0
- package/dist/commands/suite/validate-suite.js.map +1 -0
- package/dist/commands/tools/install.d.ts.map +1 -1
- package/dist/commands/tools/install.js +7 -1
- package/dist/commands/tools/install.js.map +1 -1
- package/dist/commands/tools/list.d.ts.map +1 -1
- package/dist/commands/tools/list.js +54 -31
- package/dist/commands/tools/list.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 +5 -1
- 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/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/report-compose.js +2 -2
- 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 +33 -0
- 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.map +1 -1
- package/dist/ui/views/misc-views.js +54 -11
- 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/suite-views.d.ts +6 -0
- package/dist/ui/views/suite-views.d.ts.map +1 -0
- package/dist/ui/views/suite-views.js +70 -0
- package/dist/ui/views/suite-views.js.map +1 -0
- package/dist/ui/views/tools-views.d.ts.map +1 -1
- package/dist/ui/views/tools-views.js +2 -0
- package/dist/ui/views/tools-views.js.map +1 -1
- package/package.json +34 -33
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* process survives.
|
|
31
31
|
*/
|
|
32
32
|
import { readFileSync } from 'node:fs';
|
|
33
|
-
import { CapturedOutputTooLargeError, createRunTimer, currentScope, defineCommand, IpcPayloadTooLargeError, resolveToolHooks, sendWorkerIpcMessage, startWorkerHeartbeat, } from '@opensip-cli/core';
|
|
33
|
+
import { canonicalToolErrorCode, CapturedOutputTooLargeError, ConfigurationError, createRunTimer, currentScope, defineCommand, IpcPayloadTooLargeError, resolveToolHooks, sendWorkerIpcMessage, startWorkerHeartbeat, ToolError, } from '@opensip-cli/core';
|
|
34
34
|
import { runDeepConfigPass } from './tool-command-worker-config-pass.js';
|
|
35
35
|
import { buildWorkerContext, UnsupportedSeamError, } from './tool-command-worker-context.js';
|
|
36
36
|
import { assertReturnValuedHandlerResult, toResult, } from './tool-command-worker-result.js';
|
|
@@ -101,13 +101,20 @@ async function runWorkerInitialize(tool) {
|
|
|
101
101
|
return;
|
|
102
102
|
await initialize();
|
|
103
103
|
}
|
|
104
|
-
/**
|
|
105
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Build a structured `error` IPC message with a failure class (+ stack when
|
|
106
|
+
* present). `code` carries the thrown error's canonical exit-class
|
|
107
|
+
* `ToolErrorCode` when it originated as a typed `ToolError`, so the supervisor
|
|
108
|
+
* can rebuild the right subclass on the host side and the frozen exit code
|
|
109
|
+
* survives the worker boundary (the IPC flattens the prototype chain).
|
|
110
|
+
*/
|
|
111
|
+
function errorMessage(message, failureClass, stack, code) {
|
|
106
112
|
return {
|
|
107
113
|
kind: 'error',
|
|
108
114
|
message,
|
|
109
115
|
failureClass,
|
|
110
116
|
...(stack === undefined ? {} : { stack }),
|
|
117
|
+
...(code === undefined ? {} : { code }),
|
|
111
118
|
};
|
|
112
119
|
}
|
|
113
120
|
/** Read + parse the worker spec file, or return a `bad-spec` error message. */
|
|
@@ -119,7 +126,18 @@ function readSpec(specPath) {
|
|
|
119
126
|
return errorMessage(`tool command worker: unreadable spec at '${specPath}': ${error instanceof Error ? error.message : String(error)}`, 'bad-spec');
|
|
120
127
|
}
|
|
121
128
|
}
|
|
122
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* Map a thrown error to its structured failure class for the IPC `error` message.
|
|
131
|
+
*
|
|
132
|
+
* A thrown `ConfigurationError` maps to `'config-invalid'` so the supervisor's
|
|
133
|
+
* `dispatchError` reconstructs a `ConfigurationError` (→ exit 2) — the SAME
|
|
134
|
+
* contract the in-process bundled path and `doctor` honour. Without this, a
|
|
135
|
+
* binary-not-found / no-project / baseline-missing config fault thrown in the
|
|
136
|
+
* worker would flatten to the generic `'tool-handler-throw'` → `SystemError` →
|
|
137
|
+
* exit 1, silently losing the frozen exit-2 contract over the fork boundary. The
|
|
138
|
+
* non-config typed exit classes (NotFound → 3, Network → 4, …) ride the separate
|
|
139
|
+
* `code` carry (`canonicalToolErrorCode`) — see `errorMessage`/`runToolCommandWorker`.
|
|
140
|
+
*/
|
|
123
141
|
function classifyThrow(error) {
|
|
124
142
|
if (error instanceof UnsupportedSeamError)
|
|
125
143
|
return error.failureClass;
|
|
@@ -127,6 +145,8 @@ function classifyThrow(error) {
|
|
|
127
145
|
return error.failureClass;
|
|
128
146
|
if (error instanceof IpcPayloadTooLargeError)
|
|
129
147
|
return error.failureClass;
|
|
148
|
+
if (error instanceof ConfigurationError)
|
|
149
|
+
return 'config-invalid';
|
|
130
150
|
return error.failureClass ?? 'tool-handler-throw';
|
|
131
151
|
}
|
|
132
152
|
/**
|
|
@@ -253,7 +273,12 @@ export async function runToolCommandWorker(specPath) {
|
|
|
253
273
|
return await runLoadedCommand(spec);
|
|
254
274
|
}
|
|
255
275
|
catch (error) {
|
|
256
|
-
return errorMessage(error instanceof Error ? error.message : String(error), classifyThrow(error), error instanceof Error ? error.stack : undefined
|
|
276
|
+
return errorMessage(error instanceof Error ? error.message : String(error), classifyThrow(error), error instanceof Error ? error.stack : undefined,
|
|
277
|
+
// Carry the canonical exit-class code for a typed ToolError so the host
|
|
278
|
+
// rebuilds the right subclass (NotFound → 3, Network → 4, …) instead of the
|
|
279
|
+
// SystemError → exit 1 fallthrough. ConfigurationError ALSO rides
|
|
280
|
+
// `failureClass: 'config-invalid'` above; this carry generalizes the rest.
|
|
281
|
+
error instanceof ToolError ? canonicalToolErrorCode(error) : undefined);
|
|
257
282
|
}
|
|
258
283
|
}
|
|
259
284
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-command-worker-entry.js","sourceRoot":"","sources":["../../src/bootstrap/tool-command-worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EACL,2BAA2B,EAC3B,cAAc,EACd,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"tool-command-worker-entry.js","sourceRoot":"","sources":["../../src/bootstrap/tool-command-worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,SAAS,GAMV,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,+BAA+B,EAC/B,QAAQ,GAET,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAerE,qFAAqF;AACrF,SAAS,IAAI,CAAC,GAA0B;IACtC,IAAI,CAAC;QACH,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,uBAAuB,EAAE,CAAC;YAC7C,OAAO,CAAC,IAAI,EAAE,CAAC;gBACb,IAAI,EAAE,OAAO;gBACb,OAAO,EA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,MAAM,aAAa,GAAG,oBAAoB,EAAE,CAAC;IAC7C,IAAI,CAAC;QACH,IAAI,CAAC,MAAM,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC7C,CAAC;YAAS,CAAC;QACT,aAAa,EAAE,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAA6C,aAAa,CAGjG;IACA,IAAI,EAAE,uBAAuB;IAC7B,UAAU,EAAE,UAAU;IACtB,WAAW,EACT,kJAAkJ;IACpJ,2EAA2E;IAC3E,WAAW,EAAE,CAAC,KAAK,CAAC;IACpB,IAAI,EAAE;QACJ;YACE,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,gDAAgD;SAC9D;KACF;IACD,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,YAAY;IACpB,eAAe,EAAE,YAAY;IAC7B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAiB,EAAE;QACxC,MAAM,QAAQ,GAAI,OAAyC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7E,MAAM,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-command-worker-rpc.d.ts","sourceRoot":"","sources":["../../src/bootstrap/tool-command-worker-rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"tool-command-worker-rpc.d.ts","sourceRoot":"","sources":["../../src/bootstrap/tool-command-worker-rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAY,MAAM,kCAAkC,CAAC;AAC9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,6EAA6E;AAC7E,KAAK,cAAc,GAAG,aAAa,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAkDD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAC7C,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC;IACxC,EAAE,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,KAAK,OAAO,CAAC;IACpE,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,KAAK,OAAO,CAAC;CACvE,GAAG,eAAe,CAuClB"}
|
|
@@ -17,8 +17,30 @@
|
|
|
17
17
|
* listener ignores anything that is not an `rpc-reply` (the channel is otherwise
|
|
18
18
|
* child → parent), so it never races the worker's own outbound posts.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
import { toolErrorFromCanonicalCode } from '@opensip-cli/core';
|
|
21
|
+
/**
|
|
22
|
+
* Reconstruct an Error from a host reply's structured error (preserving stack).
|
|
23
|
+
*
|
|
24
|
+
* When the host carried a canonical exit-class `toolErrorCode` (the fault was a
|
|
25
|
+
* typed `ToolError`, e.g. a `compareBaseline` BASELINE_MISSING rejection), rebuild
|
|
26
|
+
* the matching `ToolError` SUBCLASS — preserving the original subcode as `.code`
|
|
27
|
+
* — so the handler re-throws a TYPED error and the exit class survives the worker
|
|
28
|
+
* boundary (it propagates to the worker entry's catch, which maps a
|
|
29
|
+
* `ConfigurationError` → `config-invalid` → host exit 2). Otherwise (an untyped
|
|
30
|
+
* host fault, or an unrecognized code) fall back to a plain `Error` carrying the
|
|
31
|
+
* subcode, exactly as before.
|
|
32
|
+
*/
|
|
21
33
|
function rpcError(detail) {
|
|
34
|
+
if (detail.toolErrorCode !== undefined) {
|
|
35
|
+
const typed = toolErrorFromCanonicalCode(detail.toolErrorCode, detail.message, {
|
|
36
|
+
...(detail.code === undefined ? {} : { code: detail.code }),
|
|
37
|
+
});
|
|
38
|
+
if (typed !== undefined) {
|
|
39
|
+
if (detail.stack !== undefined)
|
|
40
|
+
typed.stack = detail.stack;
|
|
41
|
+
return typed;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
22
44
|
const err = new Error(detail.message);
|
|
23
45
|
if (detail.code !== undefined)
|
|
24
46
|
err.code = detail.code;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-command-worker-rpc.js","sourceRoot":"","sources":["../../src/bootstrap/tool-command-worker-rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"tool-command-worker-rpc.js","sourceRoot":"","sources":["../../src/bootstrap/tool-command-worker-rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAgC/D;;;;;;;;;;;GAWG;AACH,SAAS,QAAQ,CAAC,MAKjB;IACC,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,0BAA0B,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE;YAC7E,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;SAC5D,CAAC,CAAC;QACH,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS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CAAC,CAAC;IAC1C,CAAC,CAAC;IACF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAEjC,OAAO;QACL,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAChB,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACvC,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC/B,MAAM,CACJ,IAAI,KAAK,CACP,iEAAiE;oBAC/D,KAAK,OAAO,CAAC,IAAI,6DAA6D,CACjF,CACF,CAAC;gBACF,OAAO;YACT,CAAC;YACD,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YACxC,MAAM,KAAK,GAAmB,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC;YACpD,uEAAuE;YACvE,0EAA0E;YAC1E,4CAA4C;YAC5C,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC;QACJ,OAAO,EAAE,GAAG,EAAE;YACZ,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACpC,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-tool.d.ts","sourceRoot":"","sources":["../../src/bootstrap/validate-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAA6C,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"validate-tool.d.ts","sourceRoot":"","sources":["../../src/bootstrap/validate-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAA6C,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AA8HzF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CA6BxE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAEzD"}
|
|
@@ -68,7 +68,10 @@ function aliasesMatchIdentity(commandAliases, identity) {
|
|
|
68
68
|
}
|
|
69
69
|
function commandSpecEntryValidation(spec, identity) {
|
|
70
70
|
if (!validateCommandSpec(spec)) {
|
|
71
|
-
return {
|
|
71
|
+
return {
|
|
72
|
+
failure: 'tool.commandSpecs contains an invalid CommandSpec',
|
|
73
|
+
primary: false,
|
|
74
|
+
};
|
|
72
75
|
}
|
|
73
76
|
const command = spec;
|
|
74
77
|
if (command.parent !== undefined && command.parent !== identity.name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-tool.js","sourceRoot":"","sources":["../../src/bootstrap/validate-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAa,MAAM,mBAAmB,CAAC;AAIzF,wEAAwE;AACxE,MAAM,0BAA0B,GAAG;IACjC,YAAY;IACZ,iBAAiB;IACjB,mBAAmB;IACnB,eAAe;IACf,QAAQ;IACR,sBAAsB;IACtB,qBAAqB;IACrB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;CACb,CAAC;AAEX,SAAS,sBAAsB,CAAC,SAAkC;IAChE,OAAO,0BAA0B,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC;AAClF,CAAC;AAED,SAAS,yBAAyB,CAAC,QAAiB;IAClD,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtD,OA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AAK,CAAC,KAAK,SAAS,CAAC;AACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-context.d.ts","sourceRoot":"","sources":["../src/cli-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAKL,KAAK,MAAM,EACX,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-context.d.ts","sourceRoot":"","sources":["../src/cli-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAKL,KAAK,MAAM,EACX,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAS3B,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAY/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAmB5D,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExF,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE;QAC/B,aAAa,EAAE,OAAO,CAAC;QACvB,UAAU,EAAE,OAAO,CAAC;KACrB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAChD;AAiBD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,oBAAoB,CAuG1F;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAgDpE"}
|
package/dist/cli-context.js
CHANGED
|
@@ -17,8 +17,9 @@
|
|
|
17
17
|
* `.runtime/datastore.sqlite`.
|
|
18
18
|
*/
|
|
19
19
|
import { createRunTimer, currentScope, logger as defaultLogger, } from '@opensip-cli/core';
|
|
20
|
-
import { createWriteArtifactSeam } from './bootstrap/artifact-seams.js';
|
|
20
|
+
import { createEnsureArtifactDirSeam, createWriteArtifactSeam, } from './bootstrap/artifact-seams.js';
|
|
21
21
|
import { buildBaselineSeams } from './bootstrap/baseline-seams.js';
|
|
22
|
+
import { loadCliDefaults } from './bootstrap/cli-defaults.js';
|
|
22
23
|
import { buildHostPlanes } from './bootstrap/host-planes.js';
|
|
23
24
|
import { createIoPlane } from './bootstrap/io-plane.js';
|
|
24
25
|
import { createOutputPlane } from './bootstrap/output-plane.js';
|
|
@@ -44,6 +45,20 @@ import { buildStateSeams } from './bootstrap/state-seams.js';
|
|
|
44
45
|
// stable `cli-context.js` entry point while this module focuses on assembly.
|
|
45
46
|
export { buildDatastoreThunk, getCurrentProjectRoot, getOrOpenDatastore, } from './bootstrap/scope-access.js';
|
|
46
47
|
export { createLiveViewRegistry } from './bootstrap/io-plane.js';
|
|
48
|
+
/**
|
|
49
|
+
* Resolve the configured artifact-retention keep count (`cli.artifacts.keep`)
|
|
50
|
+
* from the project's CLI defaults, to parametrize the host `writeArtifact` seam.
|
|
51
|
+
*
|
|
52
|
+
* Read at context-build time: from the entered scope's project root when one is
|
|
53
|
+
* available (host-command / hook-dispatch contexts are built inside a run), else
|
|
54
|
+
* from the process cwd (the primary path builds its context once at startup,
|
|
55
|
+
* before the per-run scope is entered). `undefined` when unset — the seam then
|
|
56
|
+
* falls back to its own default keep count.
|
|
57
|
+
*/
|
|
58
|
+
function resolveArtifactRetentionKeep() {
|
|
59
|
+
const projectRoot = currentScope()?.projectContext?.projectRoot;
|
|
60
|
+
return loadCliDefaults(projectRoot ?? process.cwd()).artifacts?.keep;
|
|
61
|
+
}
|
|
47
62
|
export function buildToolCliContext(opts) {
|
|
48
63
|
const log = opts.logger ?? defaultLogger;
|
|
49
64
|
// Output plane owns the single `process.exitCode` write path + the four
|
|
@@ -56,10 +71,19 @@ export function buildToolCliContext(opts) {
|
|
|
56
71
|
// - governance / entitlements / audit (H1-H3);
|
|
57
72
|
// - effectful egress (cloud sync + `--report-to` + SARIF file sink).
|
|
58
73
|
const projectDatastore = createDatastoreResolver('project-seam', log);
|
|
59
|
-
const baselineSeams = buildBaselineSeams({
|
|
60
|
-
|
|
74
|
+
const baselineSeams = buildBaselineSeams({
|
|
75
|
+
getDatastore: projectDatastore,
|
|
76
|
+
logger: log,
|
|
77
|
+
});
|
|
78
|
+
const writeArtifact = createWriteArtifactSeam(log, {
|
|
79
|
+
retentionKeep: resolveArtifactRetentionKeep(),
|
|
80
|
+
});
|
|
81
|
+
const ensureArtifactDir = createEnsureArtifactDirSeam(log);
|
|
61
82
|
const stateSeams = buildStateSeams({ getDatastore: projectDatastore });
|
|
62
|
-
const hostPlanes = buildHostPlanes({
|
|
83
|
+
const hostPlanes = buildHostPlanes({
|
|
84
|
+
getDatastore: projectDatastore,
|
|
85
|
+
logger: log,
|
|
86
|
+
});
|
|
63
87
|
// Host run-lifecycle plane (host-owned-run-timing Phase 1). The FACTORY holds
|
|
64
88
|
// stable deps only — it must NOT start a lifecycle here. The lifecycle is
|
|
65
89
|
// created inside the command action (mount-command-spec calls `beginRun()`
|
|
@@ -112,6 +136,7 @@ export function buildToolCliContext(opts) {
|
|
|
112
136
|
deliverSignals: ioPlane.deliverSignals,
|
|
113
137
|
writeSarif: ioPlane.writeSarif,
|
|
114
138
|
writeArtifact,
|
|
139
|
+
ensureArtifactDir,
|
|
115
140
|
// Host baseline/ratchet plane seams (ADR-0036) — persistence + diff + exports.
|
|
116
141
|
saveBaseline: baselineSeams.saveBaseline,
|
|
117
142
|
compareBaseline: baselineSeams.compareBaseline,
|
|
@@ -149,11 +174,23 @@ export function buildToolCliContext(opts) {
|
|
|
149
174
|
export function buildHostDispatchCtx(logger) {
|
|
150
175
|
const log = logger ?? defaultLogger;
|
|
151
176
|
const projectDatastore = createDatastoreResolver('project-seam', log);
|
|
152
|
-
const baselineSeams = buildBaselineSeams({
|
|
153
|
-
|
|
177
|
+
const baselineSeams = buildBaselineSeams({
|
|
178
|
+
getDatastore: projectDatastore,
|
|
179
|
+
logger: log,
|
|
180
|
+
});
|
|
181
|
+
const writeArtifact = createWriteArtifactSeam(log, {
|
|
182
|
+
retentionKeep: resolveArtifactRetentionKeep(),
|
|
183
|
+
});
|
|
184
|
+
const ensureArtifactDir = createEnsureArtifactDirSeam(log);
|
|
154
185
|
const stateSeams = buildStateSeams({ getDatastore: projectDatastore });
|
|
155
|
-
const hostPlanes = buildHostPlanes({
|
|
156
|
-
|
|
186
|
+
const hostPlanes = buildHostPlanes({
|
|
187
|
+
getDatastore: projectDatastore,
|
|
188
|
+
logger: log,
|
|
189
|
+
});
|
|
190
|
+
const outputPlane = createOutputPlane({
|
|
191
|
+
render: deniedHookSeam('render'),
|
|
192
|
+
logger: log,
|
|
193
|
+
});
|
|
157
194
|
const ctx = {
|
|
158
195
|
get scope() {
|
|
159
196
|
return readScope();
|
|
@@ -173,6 +210,7 @@ export function buildHostDispatchCtx(logger) {
|
|
|
173
210
|
deliverSignals: deniedHookSeam('deliverSignals'),
|
|
174
211
|
writeSarif: deniedHookSeam('writeSarif'),
|
|
175
212
|
writeArtifact,
|
|
213
|
+
ensureArtifactDir,
|
|
176
214
|
saveBaseline: baselineSeams.saveBaseline,
|
|
177
215
|
compareBaseline: baselineSeams.compareBaseline,
|
|
178
216
|
exportBaselineSarif: baselineSeams.exportBaselineSarif,
|
package/dist/cli-context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-context.js","sourceRoot":"","sources":["../src/cli-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,cAAc,EACd,YAAY,EAEZ,MAAM,IAAI,aAAa,GAGxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,
|
|
1
|
+
{"version":3,"file":"cli-context.js","sourceRoot":"","sources":["../src/cli-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,cAAc,EACd,YAAY,EAEZ,MAAM,IAAI,aAAa,GAGxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAyB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,GAErB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAI7D,8EAA8E;AAC9E,0CAA0C;AAC1C,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,kFAAkF;AAClF,iFAAiF;AACjF,gFAAgF;AAChF,8EAA8E;AAC9E,qEAAqE;AACrE,wDAAwD;AACxD,8EAA8E;AAE9E,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,OAAO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B,IAAI,oDAAoD,CACrF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,69 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Provides stable entry points, recommended patterns (including the new
|
|
4
|
-
* agent ergonomics like --filter, --raw, --summary-only), and example shapes.
|
|
5
|
-
* This is intentionally a small, self-contained surface so agents can
|
|
6
|
-
* bootstrap their usage without parsing --help text or source.
|
|
2
|
+
* `agent-catalog` command adapter.
|
|
7
3
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - Tier-3 `visibility: 'internal'` commands (`*-run-worker`, `*-shard-worker`,
|
|
14
|
-
* `*-equivalence-check`) are NEVER catalogued here — the agent-catalog
|
|
15
|
-
* primary surface excludes internal workers (the host-owned tiering pass
|
|
16
|
-
* formalized in Phase 1 filters them when this surface becomes spec-derived).
|
|
4
|
+
* The catalog projection (`buildAgentCatalog` + its `AgentCatalog` / `CommandTier`
|
|
5
|
+
* types) was re-homed into `@opensip-cli/contracts` (ADR-0084) so
|
|
6
|
+
* `@opensip-cli/mcp` can serve the same surface without importing the
|
|
7
|
+
* composition root. This module re-exports it for existing call sites/tests and
|
|
8
|
+
* keeps the host rendering wrapper (`executeAgentCatalog`).
|
|
17
9
|
*/
|
|
18
10
|
import type { ToolRegistry } from '@opensip-cli/core';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* (tool-command-surface-taxonomy). `'platform'` = host-owned Tier-1 commands
|
|
22
|
-
* (`init`, `sessions`, `agent-catalog`, …); `'tool'` = a Tier-2 tool verb
|
|
23
|
-
* (`fit`, `graph`, `sim`, and their `<tool> <verb>` sub-verbs). `'internal'`
|
|
24
|
-
* (Tier-3 workers) is part of the union for completeness ONLY — the agent-catalog
|
|
25
|
-
* NEVER emits an `internal` entry point (its primary surface excludes Tier-3).
|
|
26
|
-
*/
|
|
27
|
-
export type CommandTier = 'platform' | 'tool' | 'internal';
|
|
28
|
-
export interface AgentCatalog {
|
|
29
|
-
readonly version: string;
|
|
30
|
-
readonly description: string;
|
|
31
|
-
readonly entryPoints: readonly {
|
|
32
|
-
readonly command: string;
|
|
33
|
-
readonly description: string;
|
|
34
|
-
readonly examples: readonly string[];
|
|
35
|
-
/**
|
|
36
|
-
* Taxonomy tier of this entry point (tool-command-surface-taxonomy). Additive
|
|
37
|
-
* (optional) so existing consumers of the `entryPoints` shape are unaffected;
|
|
38
|
-
* present on every entry the catalog ships so an agent sees the predictable
|
|
39
|
-
* Tier-1/Tier-2 structure. NEVER `'internal'` — Tier-3 is excluded from this
|
|
40
|
-
* surface by construction (see {@link assertNoInternalEntryPoints}).
|
|
41
|
-
*/
|
|
42
|
-
readonly tier?: CommandTier;
|
|
43
|
-
}[];
|
|
44
|
-
readonly commonPatterns: readonly {
|
|
45
|
-
readonly name: string;
|
|
46
|
-
readonly description: string;
|
|
47
|
-
readonly example: string;
|
|
48
|
-
}[];
|
|
49
|
-
readonly outputShapes: {
|
|
50
|
-
readonly signalEnvelope: string;
|
|
51
|
-
readonly sessionReplay: string;
|
|
52
|
-
readonly history: string;
|
|
53
|
-
};
|
|
54
|
-
readonly notes: readonly string[];
|
|
55
|
-
}
|
|
56
|
-
export declare function buildAgentCatalog(input?: {
|
|
57
|
-
readonly tools?: ToolRegistry;
|
|
58
|
-
readonly internalCommands?: ReadonlySet<string>;
|
|
59
|
-
}): AgentCatalog;
|
|
11
|
+
export { buildAgentCatalog } from '@opensip-cli/contracts';
|
|
12
|
+
export type { AgentCatalog, CommandTier } from '@opensip-cli/contracts';
|
|
60
13
|
export declare function executeAgentCatalog(opts?: {
|
|
61
14
|
readonly json?: boolean;
|
|
62
15
|
readonly tools?: ToolRegistry;
|
|
63
16
|
readonly internalCommands?: ReadonlySet<string>;
|
|
64
17
|
}): {
|
|
65
18
|
type: string;
|
|
66
|
-
catalog: AgentCatalog;
|
|
19
|
+
catalog: import("@opensip-cli/contracts").AgentCatalog;
|
|
67
20
|
title?: undefined;
|
|
68
21
|
lines?: undefined;
|
|
69
22
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-catalog.d.ts","sourceRoot":"","sources":["../../src/commands/agent-catalog.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent-catalog.d.ts","sourceRoot":"","sources":["../../src/commands/agent-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAExE,wBAAgB,mBAAmB,CACjC,IAAI,GAAE;IACJ,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5C;;;;;;;;;;EAkCP"}
|
|
@@ -1,184 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Provides stable entry points, recommended patterns (including the new
|
|
4
|
-
* agent ergonomics like --filter, --raw, --summary-only), and example shapes.
|
|
5
|
-
* This is intentionally a small, self-contained surface so agents can
|
|
6
|
-
* bootstrap their usage without parsing --help text or source.
|
|
2
|
+
* `agent-catalog` command adapter.
|
|
7
3
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - Tier-3 `visibility: 'internal'` commands (`*-run-worker`, `*-shard-worker`,
|
|
14
|
-
* `*-equivalence-check`) are NEVER catalogued here — the agent-catalog
|
|
15
|
-
* primary surface excludes internal workers (the host-owned tiering pass
|
|
16
|
-
* formalized in Phase 1 filters them when this surface becomes spec-derived).
|
|
4
|
+
* The catalog projection (`buildAgentCatalog` + its `AgentCatalog` / `CommandTier`
|
|
5
|
+
* types) was re-homed into `@opensip-cli/contracts` (ADR-0084) so
|
|
6
|
+
* `@opensip-cli/mcp` can serve the same surface without importing the
|
|
7
|
+
* composition root. This module re-exports it for existing call sites/tests and
|
|
8
|
+
* keeps the host rendering wrapper (`executeAgentCatalog`).
|
|
17
9
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* the IPC/CI workers and the equivalence gate. The guard checks both the name
|
|
21
|
-
* shape AND an explicit `tier: 'internal'` so a future edit can't slip one in by
|
|
22
|
-
* either route. This is the by-construction complement to the Phase 4 test.
|
|
23
|
-
*/
|
|
24
|
-
const INTERNAL_COMMAND_NAME_RE = /(?:-run-worker|-shard-worker|-equivalence-check)\b/;
|
|
25
|
-
function compareCodePoint(left, right) {
|
|
26
|
-
if (left < right)
|
|
27
|
-
return -1;
|
|
28
|
-
if (left > right)
|
|
29
|
-
return 1;
|
|
30
|
-
return 0;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Throw if any entry point is a Tier-3 internal command (by name shape or by an
|
|
34
|
-
* explicit `tier: 'internal'`). Called at catalog-build time so a regression that
|
|
35
|
-
* pastes an internal command into `entryPoints` fails loudly the first time the
|
|
36
|
-
* catalog is built, not silently at the agent boundary.
|
|
37
|
-
*
|
|
38
|
-
* @throws {Error} When an entry point is a Tier-3 internal command — by an
|
|
39
|
-
* explicit `tier: 'internal'` or by an internal command-name shape
|
|
40
|
-
* (`*-run-worker` / `*-shard-worker` / `*-equivalence-check`).
|
|
41
|
-
*/
|
|
42
|
-
function assertNoInternalEntryPoints(entryPoints) {
|
|
43
|
-
const leaked = entryPoints.find((e) => e.tier === 'internal' || INTERNAL_COMMAND_NAME_RE.test(e.command));
|
|
44
|
-
if (leaked !== undefined) {
|
|
45
|
-
throw new Error(`agent-catalog: Tier-3 internal command '${leaked.command}' must not appear in the ` +
|
|
46
|
-
'agent-catalog primary surface (tool-command-surface-taxonomy). Remove it from entryPoints.');
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const TOOL_ENTRY_OVERLAYS = {
|
|
50
|
-
fitness: {
|
|
51
|
-
description: 'Run fitness checks. Use --json for machine output (SignalEnvelope). Alias: fit.',
|
|
52
|
-
examples: ['opensip fitness --recipe default --json', 'opensip fit --check some-check --json'],
|
|
53
|
-
},
|
|
54
|
-
graph: {
|
|
55
|
-
description: 'Build static call graph + rules. --json yields SignalEnvelope.',
|
|
56
|
-
examples: ['opensip graph --json', 'opensip graph --sarif out.sarif'],
|
|
57
|
-
},
|
|
58
|
-
sim: {
|
|
59
|
-
description: 'Run simulation scenarios. Use --json for machine output (SignalEnvelope).',
|
|
60
|
-
examples: ['opensip sim --json', 'opensip sim --scenario default --json'],
|
|
61
|
-
},
|
|
62
|
-
yagni: {
|
|
63
|
-
description: 'Run YAGNI reduction audit detectors. Advisory findings; --json yields SignalEnvelope.',
|
|
64
|
-
examples: ['opensip yagni --json', 'opensip yagni --json packages/yagni/engine'],
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
const PLATFORM_ENTRY_POINTS = [
|
|
68
|
-
{
|
|
69
|
-
command: 'sessions list',
|
|
70
|
-
description: 'List stored sessions. --summary-only is agent-friendly (omits heavy payloads).',
|
|
71
|
-
examples: [
|
|
72
|
-
'opensip sessions list --json --summary-only',
|
|
73
|
-
'opensip sessions list --json --tool fitness --limit 5',
|
|
74
|
-
],
|
|
75
|
-
tier: 'platform',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
command: 'sessions show',
|
|
79
|
-
description: 'Retrieve a prior run as SessionReplayResult (includes projected SignalEnvelope). ' +
|
|
80
|
-
'Supports latest + --tool and rich filtering.',
|
|
81
|
-
examples: [
|
|
82
|
-
'opensip sessions show latest --tool fitness --json',
|
|
83
|
-
'opensip sessions show latest --tool fit --json --filter errors-only --filter top:20',
|
|
84
|
-
'opensip sessions show GRAPH_01... --json --raw',
|
|
85
|
-
'opensip sessions show previous --tool graph --json',
|
|
86
|
-
],
|
|
87
|
-
tier: 'platform',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
command: 'agent-catalog',
|
|
91
|
-
description: 'This command. Self-describing catalog for agents (JSON preferred).',
|
|
92
|
-
examples: ['opensip agent-catalog --json'],
|
|
93
|
-
tier: 'platform',
|
|
94
|
-
},
|
|
95
|
-
];
|
|
96
|
-
function publicPrimaryCommand(tool, internalCommands) {
|
|
97
|
-
return (tool.commandSpecs ?? []).find((spec) => spec.parent === undefined &&
|
|
98
|
-
spec.visibility !== 'internal' &&
|
|
99
|
-
!internalCommands.has(spec.name) &&
|
|
100
|
-
!INTERNAL_COMMAND_NAME_RE.test(spec.name));
|
|
101
|
-
}
|
|
102
|
-
function entryPointForTool(tool, internalCommands) {
|
|
103
|
-
const primary = publicPrimaryCommand(tool, internalCommands);
|
|
104
|
-
if (primary === undefined)
|
|
105
|
-
return undefined;
|
|
106
|
-
const overlay = TOOL_ENTRY_OVERLAYS[primary.name] ?? TOOL_ENTRY_OVERLAYS[tool.metadata.name];
|
|
107
|
-
return {
|
|
108
|
-
command: primary.name,
|
|
109
|
-
description: overlay?.description ??
|
|
110
|
-
`${primary.description} Use --json when available for machine output.`,
|
|
111
|
-
examples: overlay?.examples ?? [`opensip ${primary.name} --json`],
|
|
112
|
-
tier: 'tool',
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
function deriveToolEntryPoints(tools, internalCommands) {
|
|
116
|
-
return (tools?.list() ?? [])
|
|
117
|
-
.map((tool) => entryPointForTool(tool, internalCommands))
|
|
118
|
-
.filter((entry) => entry !== undefined)
|
|
119
|
-
.sort((a, b) => compareCodePoint(a.command, b.command));
|
|
120
|
-
}
|
|
121
|
-
export function buildAgentCatalog(input = {}) {
|
|
122
|
-
const entryPoints = [
|
|
123
|
-
...deriveToolEntryPoints(input.tools, input.internalCommands ?? new Set()),
|
|
124
|
-
...PLATFORM_ENTRY_POINTS,
|
|
125
|
-
];
|
|
126
|
-
assertNoInternalEntryPoints(entryPoints);
|
|
127
|
-
return {
|
|
128
|
-
version: '1.0.0',
|
|
129
|
-
description: 'Stable, machine-oriented surface for AI agents using OpenSIP CLI. ' +
|
|
130
|
-
'Focus on --json paths, sessions for historical results, and composable filters. ' +
|
|
131
|
-
'Human UX (tables, banners) is preserved unchanged.',
|
|
132
|
-
entryPoints,
|
|
133
|
-
commonPatterns: [
|
|
134
|
-
{
|
|
135
|
-
name: 'Inspect latest fit with focus on errors',
|
|
136
|
-
description: 'After a fit run, pull only actionable errors (high severity) and limit count.',
|
|
137
|
-
example: 'opensip sessions show latest --tool fit --json --filter errors-only --filter top:10',
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: 'Lean session menu for agents',
|
|
141
|
-
description: 'Get pointers to interesting sessions without downloading full historical payloads.',
|
|
142
|
-
example: 'opensip sessions list --json --summary-only --tool fit',
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: 'Minimal raw envelope for token-sensitive agents',
|
|
146
|
-
description: 'Bypass the standard CommandResult wrapper when you only need the core data.',
|
|
147
|
-
example: 'opensip sessions show latest --tool graph --json --raw',
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
name: 'Relative navigation',
|
|
151
|
-
description: 'Walk backwards through recent runs of a specific tool without tracking IDs.',
|
|
152
|
-
example: 'opensip sessions show previous --tool fit --json --filter warnings-only',
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
outputShapes: {
|
|
156
|
-
signalEnvelope: 'The canonical cross-tool currency (schemaVersion, tool, runId, verdict, units, signals). ' +
|
|
157
|
-
'Every fit/graph/sim result (live or replayed) carries one. See contracts for full type.',
|
|
158
|
-
sessionReplay: 'For sessions show: { session: {id,tool,startedAt,completedAt,score,passed,...}, fidelity: "projection", envelope: SignalEnvelope, filtersApplied?, ...counts }',
|
|
159
|
-
history: 'For sessions list: { type: "history", sessions: HistorySession[] } where each has showCommand + optional summary.',
|
|
160
|
-
},
|
|
161
|
-
notes: [
|
|
162
|
-
'All machine output is under --json. Use --raw on show for the smallest possible payload.',
|
|
163
|
-
'filtersApplied, originalSignalCount, returnedSignalCount appear when --filter is used.',
|
|
164
|
-
'The fidelity field on replays is always "projection" (rebuilt from persisted data).',
|
|
165
|
-
'Human-readable output (no --json) uses the same tables/banners as before — unchanged.',
|
|
166
|
-
// Uniform tool-primary surface (host-guaranteed; decorateToolPrimary).
|
|
167
|
-
'Every tool primary (fit/graph/sim/yagni and any third-party tool) accepts `<tool> --version` ' +
|
|
168
|
-
'(prints the TOOL version, e.g. `fit 0.1.6`; distinct from `opensip --version`, the CLI), ' +
|
|
169
|
-
'plus the guaranteed baseline flags --cwd, --json, --config, --quiet, --verbose.',
|
|
170
|
-
'Dogfood gate requires 0 errors + 0 warnings on fit:ci and graph:ci after any change.',
|
|
171
|
-
// Hygiene invariant (host-planes-scope-seams-hygiene Phases 2-4): everything runs inside an
|
|
172
|
-
// entered RunScope; the only sanctioned seams for output, delivery, baselines, toolState,
|
|
173
|
-
// and hostPlanes (governance/audit/entitlements) are the documented methods on ToolCliContext
|
|
174
|
-
// (render, emitJson, emitEnvelope, deliverSignals, writeArtifact, writeSarif, + the
|
|
175
|
-
// baseline/toolState/hostPlanes accessors). Direct stdout, the old pre-scope holder, or
|
|
176
|
-
// raw datastore from handlers is forbidden and caught by ESLint + fitness check + runtime
|
|
177
|
-
// guards. Bootstrap root is exempted.
|
|
178
|
-
'Only the methods on the ToolCliContext you receive are allowed for emission/state/planes.',
|
|
179
|
-
],
|
|
180
|
-
};
|
|
181
|
-
}
|
|
10
|
+
import { buildAgentCatalog } from '@opensip-cli/contracts';
|
|
11
|
+
export { buildAgentCatalog } from '@opensip-cli/contracts';
|
|
182
12
|
export function executeAgentCatalog(opts = {}) {
|
|
183
13
|
const catalog = buildAgentCatalog({
|
|
184
14
|
tools: opts.tools,
|