opensip-cli 0.1.14 → 0.1.16
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/bundled-tools.manifest.json +2 -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/load-tool-capabilities.js +11 -4
- package/dist/bootstrap/load-tool-capabilities.js.map +1 -1
- package/dist/bootstrap/pre-action-messages.js +1 -1
- package/dist/bootstrap/pre-action-messages.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/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-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/cli-context.d.ts.map +1 -1
- package/dist/cli-context.js +26 -3
- 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 -199
- 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/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-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/init/agents-md.d.ts.map +1 -1
- package/dist/commands/init/agents-md.js +6 -0
- package/dist/commands/init/agents-md.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/session-show.d.ts.map +1 -1
- package/dist/commands/session-show.js +14 -41
- 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/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/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/ui/result-to-view.d.ts.map +1 -1
- package/dist/ui/result-to-view.js +22 -0
- 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 +30 -7
- package/dist/ui/views/misc-views.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
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* independently from the host-owned command lifecycle.
|
|
6
6
|
*/
|
|
7
7
|
import { Option } from 'commander';
|
|
8
|
+
import { optionDefaultValue } from './assemble-opts.js';
|
|
9
|
+
export { optionKey } from './assemble-opts.js';
|
|
8
10
|
/**
|
|
9
11
|
* Build a Commander {@link Option} from an {@link OptionSpec}, covering every
|
|
10
12
|
* shape in the first-party flag corpus: boolean / value, negatable `--no-`,
|
|
@@ -29,11 +31,9 @@ export function buildOption(spec, commandName) {
|
|
|
29
31
|
}
|
|
30
32
|
// `arrayDefault` (repeatable accumulators) wins over a scalar `default`;
|
|
31
33
|
// Commander uses it as the seed the `parse` reducer accumulates onto.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
else if (spec.default !== undefined) {
|
|
36
|
-
option.default(spec.default);
|
|
34
|
+
const defaultValue = optionDefaultValue(spec);
|
|
35
|
+
if (defaultValue !== undefined) {
|
|
36
|
+
option.default(defaultValue);
|
|
37
37
|
}
|
|
38
38
|
if (spec.required === true) {
|
|
39
39
|
if (valuePlaceholder === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount-command-spec-wiring.js","sourceRoot":"","sources":["../../src/commands/mount-command-spec-wiring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"mount-command-spec-wiring.js","sourceRoot":"","sources":["../../src/commands/mount-command-spec-wiring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAIxD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,IAAgB,EAAE,WAAmB;IAC/D,MAAM,gBAAgB,G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AQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,kGAAkG;IAClG,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC9C,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACpD,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CACzD;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgEvF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EXIT_CODES } from '@opensip-cli/contracts';
|
|
2
2
|
import { buildToolIdentityIndex, currentScope, SystemError } from '@opensip-cli/core';
|
|
3
|
-
import {
|
|
3
|
+
import { resolveAndReplaySession } from '@opensip-cli/session-store';
|
|
4
4
|
import { SessionReplayRegistry } from '../session-replay-registry.js';
|
|
5
5
|
export async function executeSessionShow(opts) {
|
|
6
6
|
const scope = currentScope();
|
|
@@ -15,42 +15,23 @@ export async function executeSessionShow(opts) {
|
|
|
15
15
|
}
|
|
16
16
|
const registry = opts.registry ?? currentScope()?.tools;
|
|
17
17
|
const identityIndex = registry === undefined ? undefined : buildToolIdentityIndex(registry);
|
|
18
|
-
const
|
|
18
|
+
const replayRegistry = opts.replayRegistry ?? SessionReplayRegistry.empty();
|
|
19
|
+
// Resolve + replay + filter via the session-store read core (ADR-0084). The
|
|
20
|
+
// per-tool replay closure is injected from the host's replay registry (which
|
|
21
|
+
// carries the external-isolation gate); identity display + emission stay here.
|
|
22
|
+
const outcome = await resolveAndReplaySession(datastore, {
|
|
19
23
|
ref: opts.ref,
|
|
20
24
|
tool: opts.tool,
|
|
25
|
+
replayFor: (tool) => replayRegistry.get(tool)?.replaySession,
|
|
26
|
+
...(opts.filters === undefined ? {} : { filters: opts.filters }),
|
|
21
27
|
});
|
|
22
|
-
if (!
|
|
23
|
-
await emitSessionShowError(opts,
|
|
28
|
+
if (!outcome.ok) {
|
|
29
|
+
await emitSessionShowError(opts, outcome.reason, outcome.detail);
|
|
24
30
|
return;
|
|
25
31
|
}
|
|
26
|
-
const
|
|
27
|
-
if (contribution === undefined) {
|
|
28
|
-
await emitSessionShowError(opts, 'replay-unavailable', `session replay is not available for ${resolved.session.tool}`);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
let replay;
|
|
32
|
-
try {
|
|
33
|
-
// ADR-0054 M4-F: replaySession may be ASYNC — a BUNDLED tool resolves
|
|
34
|
-
// synchronously (in-host closure); an EXTERNAL tool forks a hook worker (its
|
|
35
|
-
// runtime never runs in-host). Await covers both.
|
|
36
|
-
replay = await contribution.replaySession(resolved.session);
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
// @handles — a corrupt/legacy stored payload is surfaced to the caller as a
|
|
40
|
-
// structured `decode-error` outcome (not swallowed); see emitSessionShowError.
|
|
41
|
-
await emitSessionShowError(opts, 'decode-error', error instanceof Error ? error.message : String(error));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
// Apply agent filters (Phase 1) *after* tool replay but before host emission.
|
|
45
|
-
// This keeps per-tool replays pure while enabling token-efficient, focused
|
|
46
|
-
// historical results for agents. The resulting envelope remains a valid
|
|
47
|
-
// (possibly filtered) SignalEnvelope.
|
|
48
|
-
const originalSignalCount = replay.envelope.signals.length;
|
|
49
|
-
const filteredReplay = opts.filters?.length
|
|
50
|
-
? applyFiltersToReplay(resolved.session, replay, opts.filters)
|
|
51
|
-
: replay;
|
|
32
|
+
const { session, replay: filteredReplay, originalSignalCount } = outcome;
|
|
52
33
|
if (opts.json === true) {
|
|
53
|
-
const jsonPayload = sessionShowJson(
|
|
34
|
+
const jsonPayload = sessionShowJson(session, filteredReplay, opts.filters, originalSignalCount, identityIndex);
|
|
54
35
|
if (opts.raw) {
|
|
55
36
|
// Raw mode for agents: emit the core payload directly (bypassing the
|
|
56
37
|
// standard CommandOutcome {kind, status, data, ...} wrapper). This gives
|
|
@@ -66,19 +47,11 @@ export async function executeSessionShow(opts) {
|
|
|
66
47
|
opts.emitJson(jsonPayload);
|
|
67
48
|
return;
|
|
68
49
|
}
|
|
69
|
-
await opts.render(sessionReplayResult(
|
|
50
|
+
await opts.render(sessionReplayResult(session, filteredReplay, opts.filters, originalSignalCount, identityIndex));
|
|
70
51
|
}
|
|
71
52
|
function canonicalToolForDisplay(tool, identityIndex) {
|
|
72
53
|
return identityIndex === undefined ? tool : identityIndex.canonicalForStoredTool(tool);
|
|
73
54
|
}
|
|
74
|
-
/** Apply shared agent filters to a replay envelope (ADR-0085). */
|
|
75
|
-
function applyFiltersToReplay(_session, replay, filters) {
|
|
76
|
-
const filtered = applyAgentFilters(replay.envelope, filters);
|
|
77
|
-
return {
|
|
78
|
-
...replay,
|
|
79
|
-
envelope: filtered.envelope,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
55
|
function agentFilterMeta(returnedSignalCount, filters, originalSignalCount) {
|
|
83
56
|
if (!filters?.length || originalSignalCount == null)
|
|
84
57
|
return {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-show.js","sourceRoot":"","sources":["../../src/commands/session-show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"session-show.js","sourceRoot":"","sources":["../../src/commands/session-show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,WAAW,EAAE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type { SessionReplayRegistry } from '../session-replay-registry.js';
|
|
14
14
|
import type { CommandResult } from '@opensip-cli/contracts';
|
|
15
|
-
import type { PluginLayout, ScaffoldContext, ScaffoldFile, ToolPluginManifest, ToolProvenance, ToolRegistry } from '@opensip-cli/core';
|
|
15
|
+
import type { PluginLayout, ScaffoldContext, ScaffoldFile, ToolPluginManifest, ToolProvenance, ToolRegistry, ToolCliContext } from '@opensip-cli/core';
|
|
16
16
|
/**
|
|
17
17
|
* One registered tool's `init`-scaffold contribution (ADR-0038): its structural
|
|
18
18
|
* `pluginLayout` (domain + userSubdirs the host `mkdir`s) plus the optional
|
|
@@ -101,6 +101,8 @@ export interface CliCommandsContext {
|
|
|
101
101
|
readonly toolInternalCommands?: ReadonlySet<string>;
|
|
102
102
|
/** Live tool registry for identity-aware host commands (optional in tests). */
|
|
103
103
|
readonly tools?: ToolRegistry;
|
|
104
|
+
/** Full tool context for host commands that re-dispatch tool specs (suite run). */
|
|
105
|
+
readonly toolContext?: ToolCliContext;
|
|
104
106
|
/** Admitted tool manifests for config declaration composition (optional in tests). */
|
|
105
107
|
readonly manifests?: readonly ToolPluginManifest[];
|
|
106
108
|
/** Per-run tool provenance for config declaration composition (optional in tests). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/commands/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,YAAY,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/commands/shared.ts"],"names":[],"mappings":"AAAA;;;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AC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;KACxB,KAAK,IAAI,CAAC;IACX;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,YAAY,EAAE,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,YAAY,EAAE,CAAC;IAChD,QAAQ,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IACvD;;;;;;;;;OASG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IAChD;;;;;;;OAOG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpD,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC;IACtC,sFAAsF;IACtF,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACnD,sFAAsF;IACtF,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAChD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC;CACnC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SignalDeliveryResult, ToolCliContext } from '@opensip-cli/core';
|
|
2
|
+
export interface StepCapture {
|
|
3
|
+
/**
|
|
4
|
+
* The step's captured exit code — a SINGLE last-write-wins slot that mirrors the
|
|
5
|
+
* host's one exit holder (`bootstrap/output-plane.ts`: `let exitCode;
|
|
6
|
+
* setExitCode overwrites`), NOT an append-only log reduced by `Math.max`. The
|
|
7
|
+
* former array+max model diverged from the host holder in two ways (a
|
|
8
|
+
* `--report-to` failure exit 4 was never captured; an advisory lower-to-SUCCESS
|
|
9
|
+
* could not undo an earlier raise) — both are one defect: append+max ≠
|
|
10
|
+
* last-write-wins. `undefined` when the step neither called `setExitCode` nor
|
|
11
|
+
* delivered a failing / report-failed envelope (the orchestrator then defaults
|
|
12
|
+
* to `EXIT_CODES.SUCCESS`).
|
|
13
|
+
*/
|
|
14
|
+
readonly getExitCode: () => number | undefined;
|
|
15
|
+
readonly signalDeliveries: readonly SignalDeliveryResult[];
|
|
16
|
+
readonly context: ToolCliContext;
|
|
17
|
+
}
|
|
18
|
+
export declare function createCapturingContext(base: ToolCliContext): StepCapture;
|
|
19
|
+
//# sourceMappingURL=capturing-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capturing-context.d.ts","sourceRoot":"","sources":["../../../src/commands/suite/capturing-context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,gBAAgB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC3D,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,cAAc,GAAG,WAAW,CAmExE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { EXIT_CODES } from '@opensip-cli/contracts';
|
|
2
|
+
export function createCapturingContext(base) {
|
|
3
|
+
// Single mutable last-write-wins exit slot — the per-step mirror of the host's
|
|
4
|
+
// `outputPlane` holder. ALL exit sources for the step (the tool's `setExitCode`,
|
|
5
|
+
// the `deliverSignals` findings/report mirror below, and a direct `process.exit`
|
|
6
|
+
// routed in by `withProcessExitGuard`) write THIS slot, so `getExitCode()` is the
|
|
7
|
+
// single source of truth for the step's verdict.
|
|
8
|
+
let exitCode;
|
|
9
|
+
const signalDeliveries = [];
|
|
10
|
+
const context = Object.defineProperties({}, Object.getOwnPropertyDescriptors(base));
|
|
11
|
+
Object.defineProperties(context, {
|
|
12
|
+
setExitCode: {
|
|
13
|
+
value: (code) => {
|
|
14
|
+
// OVERWRITE (last-write-wins): a later `setExitCode(SUCCESS)` — e.g. yagni's
|
|
15
|
+
// `applyAdvisoryExitCode` re-affirming exit 0 after nested graph evidence
|
|
16
|
+
// raised the code — must be able to LOWER the step exit, exactly as the host
|
|
17
|
+
// holder does. The old append-then-`Math.max` could never lower.
|
|
18
|
+
exitCode = code;
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
getExitCode: {
|
|
22
|
+
// Read the slot (NOT the inherited host holder). The override above isolates
|
|
23
|
+
// the step's writes into the slot, so reads must come from the slot too —
|
|
24
|
+
// otherwise a tool that reads its own exit mid-run (yagni's advisory check
|
|
25
|
+
// inspects `cli.getExitCode()` for a prior REPORT_FAILED, or a nested
|
|
26
|
+
// `setExitCode` from graph evidence) would see a stale cross-step host value
|
|
27
|
+
// and split-brain against where its own writes landed.
|
|
28
|
+
value: () => exitCode,
|
|
29
|
+
},
|
|
30
|
+
deliverSignals: {
|
|
31
|
+
value: async (envelope, opts) => {
|
|
32
|
+
const result = await base.deliverSignals(envelope, opts);
|
|
33
|
+
signalDeliveries.push(result);
|
|
34
|
+
// Mirror the host's `deliverEnvelope` exit precedence
|
|
35
|
+
// (`bootstrap/deliver-envelope.ts` → `deriveReportExitDecision`). The host
|
|
36
|
+
// applies the findings/report exit through ITS OWN `outputPlane.setExitCode`,
|
|
37
|
+
// bypassing this wrapper's override — so without this mirror the step's
|
|
38
|
+
// verdict / report-upload exit would be invisible to the capture. Replicate
|
|
39
|
+
// the SAME precedence here, last-write-wins (SET, not push), and like
|
|
40
|
+
// `deliverEnvelope` only ever SET a failure code — never reset to 0 on a pass
|
|
41
|
+
// (a passing, no-`--report-to` run leaves the slot untouched):
|
|
42
|
+
// - runFailed (verdict failed, or an explicit gate-compare override)
|
|
43
|
+
// DOMINATES → RUNTIME_ERROR (1);
|
|
44
|
+
// - else a `--report-to` upload failure (`reportSuccess === false`)
|
|
45
|
+
// → REPORT_FAILED (4).
|
|
46
|
+
// `reportSuccess` is `undefined` on the no-`--report-to` path, so the strict
|
|
47
|
+
// `=== false` is exact and never fires there.
|
|
48
|
+
const runFailed = opts.runFailed ??
|
|
49
|
+
envelope?.verdict?.passed === false;
|
|
50
|
+
if (runFailed) {
|
|
51
|
+
exitCode = EXIT_CODES.RUNTIME_ERROR;
|
|
52
|
+
}
|
|
53
|
+
else if (result.reportSuccess === false) {
|
|
54
|
+
exitCode = EXIT_CODES.REPORT_FAILED;
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
return { getExitCode: () => exitCode, signalDeliveries, context };
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=capturing-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capturing-context.js","sourceRoot":"","sources":["../../../src/commands/suite/capturing-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAsBpD,MAAM,UAAU,sBAAsB,CAAC,IAAoB;IACzD,+EAA+E;IAC/E,iFAAiF;IACjF,iFAAiF;IACjF,kFAAkF;IAClF,iDAAiD;IACjD,IAAI,QAA4B,CAAC;IACjC,MAAM,gBAAgB,GAA2B,EAAE,CAAC;IACpD,MAAM,OAAO,GAAG,MAAM,CAAC,gBAAgB,CACrC,EAAE,EACF,MAAM,CAAC,yBAAyB,CAAC,IAAc,CAAC,CAC/B,CAAC;IAEpB,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE;QAC/B,WAAW,EAAE;YACX,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE;gBACtB,6EAA6E;gBAC7E,0EAA0E;gBAC1E,6EAA6E;gBAC7E,iEAAiE;gBACjE,QAAQ,GAAG,IAAI,CAAC;YAClB,CAAC;SACF;QACD,WAAW,EAAE;YACX,6EAA6E;YAC7E,0EAA0E;YAC1E,2EAA2E;YAC3E,sEAAsE;YACtE,6EAA6E;YAC7E,uDAAuD;YACvD,KAAK,EAAE,GAAG,EAAE,CAAC,QAAQ;SACtB;QACD,cAAc,EAAE;YACd,KAAK,EAAE,KAAK,EACV,QAAyD,EACzD,IAAqD,EACrD,EAAE;gBACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;gBACzD,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC9B,sDAAsD;gBACtD,2EAA2E;gBAC3E,8EAA8E;gBAC9E,wEAAwE;gBACxE,4EAA4E;gBAC5E,sEAAsE;gBACtE,8EAA8E;gBAC9E,+DAA+D;gBAC/D,uEAAuE;gBACvE,qCAAqC;gBACrC,sEAAsE;gBACtE,2BAA2B;gBAC3B,6EAA6E;gBAC7E,8CAA8C;gBAC9C,MAAM,SAAS,GACb,IAAI,CAAC,SAAS;oBACb,QAAgD,EAAE,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC;gBAC/E,IAAI,SAAS,EAAE,CAAC;oBACd,QAAQ,GAAG,UAAU,CAAC,aAAa,CAAC;gBACtC,CAAC;qBAAM,IAAI,MAAM,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;oBAC1C,QAAQ,GAAG,UAAU,CAAC,aAAa,CAAC;gBACtC,CAAC;gBACD,OAAO,MAAM,CAAC;YAChB,CAAC;SACF;KACF,CAAC,CAAC;IAEH,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Tool, type ToolCliContext } from '@opensip-cli/core';
|
|
2
|
+
import type { SuiteDefinition } from '@opensip-cli/config';
|
|
3
|
+
import type { SuiteRunResult } from '@opensip-cli/contracts';
|
|
4
|
+
export interface RunSuiteInput {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly suite: SuiteDefinition;
|
|
7
|
+
readonly tools: readonly Tool[];
|
|
8
|
+
readonly ctx: ToolCliContext;
|
|
9
|
+
readonly suiteOpts: Readonly<Record<string, unknown>>;
|
|
10
|
+
}
|
|
11
|
+
export declare function runSuite(input: RunSuiteInput): Promise<SuiteRunResult>;
|
|
12
|
+
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/commands/suite/orchestrator.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,IAAI,EACT,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAW3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AAQ/E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD;AAED,wBAAsB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CA4C5E"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { performance } from 'node:perf_hooks';
|
|
2
|
+
import { EXIT_CODES } from '@opensip-cli/contracts';
|
|
3
|
+
import { currentLogger, currentScope, generatePrefixedId, } from '@opensip-cli/core';
|
|
4
|
+
import { buildMaybeDispatchExternal } from '../../bootstrap/bind-external-dispatch.js';
|
|
5
|
+
import { bindToolCliContext } from '../../bootstrap/bind-tool-context.js';
|
|
6
|
+
import { runWithSuiteRunContext } from '../../bootstrap/run-plane.js';
|
|
7
|
+
import { assembleOptsFromSpec } from '../assemble-opts.js';
|
|
8
|
+
import { dispatchOutput } from '../mount-command-spec.js';
|
|
9
|
+
import { createCapturingContext } from './capturing-context.js';
|
|
10
|
+
import { validateSuite } from './validate-suite.js';
|
|
11
|
+
class DirectProcessExit extends Error {
|
|
12
|
+
code;
|
|
13
|
+
constructor(code) {
|
|
14
|
+
super(`process.exit(${code})`);
|
|
15
|
+
this.code = code;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export async function runSuite(input) {
|
|
19
|
+
const suite = validateSuite({
|
|
20
|
+
name: input.name,
|
|
21
|
+
suite: input.suite,
|
|
22
|
+
tools: input.tools,
|
|
23
|
+
});
|
|
24
|
+
const suiteRunId = generatePrefixedId('suite');
|
|
25
|
+
const started = performance.now();
|
|
26
|
+
const log = currentLogger();
|
|
27
|
+
log.info?.({
|
|
28
|
+
evt: 'cli.suite.run.start',
|
|
29
|
+
suite: suite.name,
|
|
30
|
+
suiteRunId,
|
|
31
|
+
stepCount: suite.steps.length,
|
|
32
|
+
});
|
|
33
|
+
const steps = await runWithSuiteRunContext({ suiteRunId, suiteName: suite.name }, () => runStepsSerially({
|
|
34
|
+
suite,
|
|
35
|
+
suiteRunId,
|
|
36
|
+
ctx: input.ctx,
|
|
37
|
+
suiteOpts: input.suiteOpts,
|
|
38
|
+
}));
|
|
39
|
+
const exitCode = Math.max(0, ...steps.map((step) => step.exitCode));
|
|
40
|
+
const durationMs = Math.max(0, performance.now() - started);
|
|
41
|
+
log.info?.({
|
|
42
|
+
evt: 'cli.suite.run.complete',
|
|
43
|
+
suite: suite.name,
|
|
44
|
+
suiteRunId,
|
|
45
|
+
exitCode,
|
|
46
|
+
durationMs,
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
type: 'suite-run',
|
|
50
|
+
suite: suite.name,
|
|
51
|
+
suiteRunId,
|
|
52
|
+
exitCode,
|
|
53
|
+
durationMs,
|
|
54
|
+
steps,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async function runStepsSerially(args) {
|
|
58
|
+
const summaries = [];
|
|
59
|
+
let chain = Promise.resolve();
|
|
60
|
+
for (const step of args.suite.steps) {
|
|
61
|
+
chain = chain.then(async () => {
|
|
62
|
+
summaries.push(await runStep({
|
|
63
|
+
suite: args.suite,
|
|
64
|
+
suiteRunId: args.suiteRunId,
|
|
65
|
+
step,
|
|
66
|
+
ctx: args.ctx,
|
|
67
|
+
suiteOpts: args.suiteOpts,
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
await chain;
|
|
72
|
+
return summaries;
|
|
73
|
+
}
|
|
74
|
+
async function runStep(args) {
|
|
75
|
+
const started = performance.now();
|
|
76
|
+
const bound = bindToolCliContext(args.step.tool, args.ctx);
|
|
77
|
+
const capture = createCapturingContext(bound);
|
|
78
|
+
// ADR-0054 out-of-process dispatch must run through the CAPTURING context, not
|
|
79
|
+
// the raw bound ctx. For an external-provenance step the worker replay
|
|
80
|
+
// (`replayResult`) calls `ctx.setExitCode` with the tool's verdict exit code;
|
|
81
|
+
// binding the hook to `capture.context` routes that into the capture's exit slot
|
|
82
|
+
// (`capture.getExitCode()`) so the external step participates in the suite
|
|
83
|
+
// worst-of aggregation exactly like the in-process handler (which already runs
|
|
84
|
+
// against `capture.context`). Binding to `bound` instead dropped the external
|
|
85
|
+
// step's exit code (it never reached the slot, so a findings/regression verdict
|
|
86
|
+
// silently aggregated to 0) AND leaked the code into the outer host context — the
|
|
87
|
+
// same isolation the bundled path preserves. (04↔05 regression: external adapter
|
|
88
|
+
// as a suite step.)
|
|
89
|
+
Object.assign(capture.context, {
|
|
90
|
+
maybeDispatchExternal: buildMaybeDispatchExternal(args.step.tool, capture.context),
|
|
91
|
+
});
|
|
92
|
+
const opts = stepOpts(args.step, args.suiteOpts);
|
|
93
|
+
const hooks = capture.context;
|
|
94
|
+
const diagnostics = currentScope()?.diagnostics;
|
|
95
|
+
const log = currentLogger();
|
|
96
|
+
let errorMessage;
|
|
97
|
+
let exitCode = EXIT_CODES.SUCCESS;
|
|
98
|
+
try {
|
|
99
|
+
diagnostics?.event('execute', 'debug', `suite step '${args.step.spec.name}' started`, {
|
|
100
|
+
suite: args.suite.name,
|
|
101
|
+
suiteRunId: args.suiteRunId,
|
|
102
|
+
tool: args.step.tool.metadata.id,
|
|
103
|
+
command: args.step.spec.name,
|
|
104
|
+
});
|
|
105
|
+
exitCode = await withProcessExitGuard(async () => {
|
|
106
|
+
hooks.resetRun?.();
|
|
107
|
+
hooks.beginRun?.();
|
|
108
|
+
const dispatched = await hooks.maybeDispatchExternal?.(args.step.spec.name, opts, args.step.positionals);
|
|
109
|
+
if (dispatched === true)
|
|
110
|
+
return capture.getExitCode() ?? EXIT_CODES.SUCCESS;
|
|
111
|
+
const result = await args.step.spec.handler(opts, capture.context);
|
|
112
|
+
hooks.completeRun?.(result);
|
|
113
|
+
await dispatchOutput(result, args.step.spec, opts, args.step.positionals, capture.context);
|
|
114
|
+
return capture.getExitCode() ?? EXIT_CODES.SUCCESS;
|
|
115
|
+
}, (code) => {
|
|
116
|
+
// A bundled step called `process.exit(code)` directly: route the code into
|
|
117
|
+
// the capture's last-write-wins slot (the single per-step exit source of
|
|
118
|
+
// truth) just as `setExitCode` would, then record it.
|
|
119
|
+
capture.context.setExitCode(code);
|
|
120
|
+
log.warn?.({
|
|
121
|
+
evt: 'cli.suite.run.step',
|
|
122
|
+
suite: args.suite.name,
|
|
123
|
+
suiteRunId: args.suiteRunId,
|
|
124
|
+
tool: args.step.tool.metadata.id,
|
|
125
|
+
command: args.step.spec.name,
|
|
126
|
+
exitCode: code,
|
|
127
|
+
msg: 'Bundled step called process.exit directly; captured as step verdict.',
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
diagnostics?.event('execute', 'debug', `suite step '${args.step.spec.name}' completed`, {
|
|
131
|
+
suite: args.suite.name,
|
|
132
|
+
suiteRunId: args.suiteRunId,
|
|
133
|
+
tool: args.step.tool.metadata.id,
|
|
134
|
+
command: args.step.spec.name,
|
|
135
|
+
exitCode,
|
|
136
|
+
});
|
|
137
|
+
diagnostics?.counter('suite.steps.completed', 1);
|
|
138
|
+
// @fitness-ignore-next-line exit-code-correctness -- suite steps convert thrown step failures into a non-zero step summary; runSuite later returns the max step exit code.
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
exitCode = EXIT_CODES.RUNTIME_ERROR;
|
|
142
|
+
errorMessage = error instanceof Error ? error.message : String(error);
|
|
143
|
+
diagnostics?.event('execute', 'error', `suite step '${args.step.spec.name}' failed`, {
|
|
144
|
+
suite: args.suite.name,
|
|
145
|
+
suiteRunId: args.suiteRunId,
|
|
146
|
+
tool: args.step.tool.metadata.id,
|
|
147
|
+
command: args.step.spec.name,
|
|
148
|
+
exitCode,
|
|
149
|
+
error: errorMessage,
|
|
150
|
+
});
|
|
151
|
+
log.error?.({
|
|
152
|
+
evt: 'cli.suite.run.step.error',
|
|
153
|
+
suite: args.suite.name,
|
|
154
|
+
suiteRunId: args.suiteRunId,
|
|
155
|
+
tool: args.step.tool.metadata.id,
|
|
156
|
+
command: args.step.spec.name,
|
|
157
|
+
error: errorMessage,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
const durationMs = Math.max(0, performance.now() - started);
|
|
161
|
+
log.info?.({
|
|
162
|
+
evt: 'cli.suite.run.step',
|
|
163
|
+
suite: args.suite.name,
|
|
164
|
+
suiteRunId: args.suiteRunId,
|
|
165
|
+
tool: args.step.tool.metadata.id,
|
|
166
|
+
command: args.step.spec.name,
|
|
167
|
+
exitCode,
|
|
168
|
+
durationMs,
|
|
169
|
+
});
|
|
170
|
+
return {
|
|
171
|
+
tool: args.step.tool.metadata.name,
|
|
172
|
+
stableId: args.step.tool.metadata.id,
|
|
173
|
+
command: args.step.spec.name,
|
|
174
|
+
exitCode,
|
|
175
|
+
durationMs,
|
|
176
|
+
...(errorMessage === undefined ? {} : { error: errorMessage }),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function stepOpts(step, suiteOpts) {
|
|
180
|
+
const assembled = assembleOptsFromSpec({
|
|
181
|
+
options: step.spec.options,
|
|
182
|
+
suppliedValues: step.args,
|
|
183
|
+
}).opts;
|
|
184
|
+
const common = {};
|
|
185
|
+
for (const key of step.spec.commonFlags) {
|
|
186
|
+
const value = suiteOpts[key];
|
|
187
|
+
if (value !== undefined)
|
|
188
|
+
common[key] = value;
|
|
189
|
+
}
|
|
190
|
+
if (step.spec.commonFlags.includes('cwd') && common.cwd === undefined) {
|
|
191
|
+
common.cwd = process.cwd();
|
|
192
|
+
}
|
|
193
|
+
return { ...common, ...assembled, _args: step.positionals };
|
|
194
|
+
}
|
|
195
|
+
async function withProcessExitGuard(fn, onDirectExit) {
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method -- process.exit has no `this` contract; identity must be restored after the guard.
|
|
197
|
+
const original = process.exit;
|
|
198
|
+
// @fitness-ignore-next-line throws-documentation -- this private guard intentionally throws a sentinel so direct process.exit calls become suite step exit codes.
|
|
199
|
+
process.exit = (code) => {
|
|
200
|
+
throw new DirectProcessExit(typeof code === 'number' ? code : 0);
|
|
201
|
+
};
|
|
202
|
+
try {
|
|
203
|
+
return await fn();
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
if (error instanceof DirectProcessExit) {
|
|
207
|
+
onDirectExit(error.code);
|
|
208
|
+
return error.code;
|
|
209
|
+
}
|
|
210
|
+
throw error;
|
|
211
|
+
}
|
|
212
|
+
finally {
|
|
213
|
+
process.exit = original;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=orchestrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/commands/suite/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WA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AE,CAAC;YACvC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACzB,OAAO,KAAK,CAAC,IAAI,CAAC;QACpB,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACR,OAAoD,CAAC,IAAI,GAAG,QAAQ,CAAC;IACxE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Tool } from '@opensip-cli/core';
|
|
2
|
+
export interface SuiteAddInput {
|
|
3
|
+
readonly suite: string;
|
|
4
|
+
readonly tool: string;
|
|
5
|
+
readonly command: string;
|
|
6
|
+
readonly argPairs: readonly string[];
|
|
7
|
+
readonly tools: readonly Tool[];
|
|
8
|
+
readonly projectRoot: string;
|
|
9
|
+
readonly configPath?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SuiteAddOutput {
|
|
12
|
+
readonly configPath: string;
|
|
13
|
+
readonly changed: boolean;
|
|
14
|
+
readonly tool: Tool;
|
|
15
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
16
|
+
}
|
|
17
|
+
export declare function addSuiteStep(input: SuiteAddInput): SuiteAddOutput;
|
|
18
|
+
//# sourceMappingURL=suite-add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suite-add.d.ts","sourceRoot":"","sources":["../../../src/commands/suite/suite-add.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqC,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAKjF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAClD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,cAAc,CAkBjE"}
|