@haibun/core 4.0.0-alpha.1 → 4.0.0-alpha.3
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/build/currentVersion.d.ts +1 -1
- package/build/currentVersion.js +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/kireji/converter.d.ts +2 -2
- package/build/kireji/converter.d.ts.map +1 -1
- package/build/kireji/converter.js +12 -9
- package/build/kireji/converter.js.map +1 -1
- package/build/kireji/withAction.d.ts +16 -4
- package/build/kireji/withAction.d.ts.map +1 -1
- package/build/kireji/withAction.js +40 -11
- package/build/kireji/withAction.js.map +1 -1
- package/build/lib/EventLogger.d.ts +5 -5
- package/build/lib/EventLogger.d.ts.map +1 -1
- package/build/lib/EventLogger.js +39 -37
- package/build/lib/EventLogger.js.map +1 -1
- package/build/lib/PhaseRunner.d.ts +3 -3
- package/build/lib/PhaseRunner.d.ts.map +1 -1
- package/build/lib/PhaseRunner.js +7 -5
- package/build/lib/PhaseRunner.js.map +1 -1
- package/build/lib/astepper.d.ts +90 -13
- package/build/lib/astepper.d.ts.map +1 -1
- package/build/lib/astepper.js +35 -6
- package/build/lib/astepper.js.map +1 -1
- package/build/lib/base-prompt-manager.d.ts +1 -1
- package/build/lib/base-prompt-manager.d.ts.map +1 -1
- package/build/lib/base-prompt-manager.js.map +1 -1
- package/build/lib/capture-locator.d.ts +1 -1
- package/build/lib/capture-locator.d.ts.map +1 -1
- package/build/lib/capture-locator.js +5 -5
- package/build/lib/capture-locator.js.map +1 -1
- package/build/lib/core/flow-runner.d.ts +8 -7
- package/build/lib/core/flow-runner.d.ts.map +1 -1
- package/build/lib/core/flow-runner.js +42 -71
- package/build/lib/core/flow-runner.js.map +1 -1
- package/build/lib/core-domains.d.ts +2 -2
- package/build/lib/core-domains.d.ts.map +1 -1
- package/build/lib/core-domains.js +17 -18
- package/build/lib/core-domains.js.map +1 -1
- package/build/lib/defs.d.ts +2 -13
- package/build/lib/defs.d.ts.map +1 -1
- package/build/lib/defs.js.map +1 -1
- package/build/lib/document-content.d.ts +18 -0
- package/build/lib/document-content.d.ts.map +1 -0
- package/build/lib/document-content.js +158 -0
- package/build/lib/document-content.js.map +1 -0
- package/build/lib/domains.d.ts +31 -0
- package/build/lib/domains.d.ts.map +1 -0
- package/build/lib/domains.js +105 -0
- package/build/lib/domains.js.map +1 -0
- package/build/lib/execution.d.ts +304 -0
- package/build/lib/execution.d.ts.map +1 -0
- package/build/lib/execution.js +23 -0
- package/build/lib/execution.js.map +1 -0
- package/build/lib/feature-variables.d.ts +22 -49
- package/build/lib/feature-variables.d.ts.map +1 -1
- package/build/lib/feature-variables.js +143 -210
- package/build/lib/feature-variables.js.map +1 -1
- package/build/lib/features.d.ts +2 -2
- package/build/lib/features.d.ts.map +1 -1
- package/build/lib/features.js +13 -17
- package/build/lib/features.js.map +1 -1
- package/build/lib/fixme.d.ts.map +1 -1
- package/build/lib/host-id.d.ts +44 -0
- package/build/lib/host-id.d.ts.map +1 -0
- package/build/lib/host-id.js +51 -0
- package/build/lib/host-id.js.map +1 -0
- package/build/lib/http-observations.d.ts +15 -2
- package/build/lib/http-observations.d.ts.map +1 -1
- package/build/lib/http-observations.js +40 -23
- package/build/lib/http-observations.js.map +1 -1
- package/build/lib/hypermedia.d.ts +62 -0
- package/build/lib/hypermedia.d.ts.map +1 -0
- package/build/lib/hypermedia.js +228 -0
- package/build/lib/hypermedia.js.map +1 -0
- package/build/lib/namedVars.d.ts +2 -2
- package/build/lib/namedVars.d.ts.map +1 -1
- package/build/lib/namedVars.js +25 -30
- package/build/lib/namedVars.js.map +1 -1
- package/build/lib/node-http-events.d.ts +3 -3
- package/build/lib/node-http-events.d.ts.map +1 -1
- package/build/lib/node-http-events.js +26 -26
- package/build/lib/node-http-events.js.map +1 -1
- package/build/lib/populateActionArgs.d.ts +4 -4
- package/build/lib/populateActionArgs.d.ts.map +1 -1
- package/build/lib/populateActionArgs.js +4 -6
- package/build/lib/populateActionArgs.js.map +1 -1
- package/build/lib/prompter.d.ts.map +1 -1
- package/build/lib/prompter.js +10 -7
- package/build/lib/prompter.js.map +1 -1
- package/build/lib/quad-store.d.ts +34 -10
- package/build/lib/quad-store.d.ts.map +1 -1
- package/build/lib/quad-store.js +169 -21
- package/build/lib/quad-store.js.map +1 -1
- package/build/lib/quad-types.d.ts +80 -9
- package/build/lib/quad-types.d.ts.map +1 -1
- package/build/lib/quad-types.js +46 -2
- package/build/lib/quad-types.js.map +1 -1
- package/build/lib/readline-prompter.d.ts +1 -1
- package/build/lib/readline-prompter.js +4 -4
- package/build/lib/remote-stepper-proxy.d.ts +56 -0
- package/build/lib/remote-stepper-proxy.d.ts.map +1 -0
- package/build/lib/remote-stepper-proxy.js +123 -0
- package/build/lib/remote-stepper-proxy.js.map +1 -0
- package/build/lib/resolver-features.d.ts +1 -1
- package/build/lib/resolver-features.d.ts.map +1 -1
- package/build/lib/resolver-features.js +2 -2
- package/build/lib/resolver-features.js.map +1 -1
- package/build/lib/resources.d.ts +461 -0
- package/build/lib/resources.d.ts.map +1 -0
- package/build/lib/resources.js +249 -0
- package/build/lib/resources.js.map +1 -0
- package/build/lib/rpc-client.d.ts +68 -0
- package/build/lib/rpc-client.d.ts.map +1 -0
- package/build/lib/rpc-client.js +186 -0
- package/build/lib/rpc-client.js.map +1 -0
- package/build/lib/sse-subscriber.d.ts +57 -0
- package/build/lib/sse-subscriber.d.ts.map +1 -0
- package/build/lib/sse-subscriber.js +110 -0
- package/build/lib/sse-subscriber.js.map +1 -0
- package/build/lib/step-dispatch.d.ts +92 -28
- package/build/lib/step-dispatch.d.ts.map +1 -1
- package/build/lib/step-dispatch.js +331 -75
- package/build/lib/step-dispatch.js.map +1 -1
- package/build/lib/step-validation.d.ts +3 -3
- package/build/lib/step-validation.d.ts.map +1 -1
- package/build/lib/step-validation.js +2 -2
- package/build/lib/step-validation.js.map +1 -1
- package/build/lib/stepper-cycles.d.ts +5 -0
- package/build/lib/stepper-cycles.d.ts.map +1 -0
- package/build/lib/stepper-cycles.js +31 -0
- package/build/lib/stepper-cycles.js.map +1 -0
- package/build/lib/stepper-registry.d.ts +6 -3
- package/build/lib/stepper-registry.d.ts.map +1 -1
- package/build/lib/stepper-registry.js +9 -8
- package/build/lib/stepper-registry.js.map +1 -1
- package/build/lib/subprocess-runner.d.ts +35 -0
- package/build/lib/subprocess-runner.d.ts.map +1 -0
- package/build/lib/subprocess-runner.js +60 -0
- package/build/lib/subprocess-runner.js.map +1 -0
- package/build/lib/subprocess-transport.d.ts +37 -0
- package/build/lib/subprocess-transport.d.ts.map +1 -0
- package/build/lib/subprocess-transport.js +113 -0
- package/build/lib/subprocess-transport.js.map +1 -0
- package/build/lib/test/EventCollectorStepper.d.ts +3 -3
- package/build/lib/test/EventCollectorStepper.d.ts.map +1 -1
- package/build/lib/test/EventCollectorStepper.js +3 -3
- package/build/lib/test/EventCollectorStepper.js.map +1 -1
- package/build/lib/test/SetTimeStepper.d.ts +3 -3
- package/build/lib/test/SetTimeStepper.d.ts.map +1 -1
- package/build/lib/test/SetTimeStepper.js +7 -7
- package/build/lib/test/SetTimeStepper.js.map +1 -1
- package/build/lib/test/TestSteps.d.ts +7 -7
- package/build/lib/test/TestSteps.d.ts.map +1 -1
- package/build/lib/test/TestSteps.js +7 -7
- package/build/lib/test/TestSteps.js.map +1 -1
- package/build/lib/test/TestStepsWithOptions.d.ts +6 -6
- package/build/lib/test/TestStepsWithOptions.js +7 -7
- package/build/lib/test/lib.d.ts +3 -3
- package/build/lib/test/lib.d.ts.map +1 -1
- package/build/lib/test/lib.js +27 -21
- package/build/lib/test/lib.js.map +1 -1
- package/build/lib/test/resolvedTestFeatures.d.ts +6 -6
- package/build/lib/test/resolvedTestFeatures.d.ts.map +1 -1
- package/build/lib/test/resolvedTestFeatures.js +5 -5
- package/build/lib/test/subprocess-fixture.d.ts +8 -0
- package/build/lib/test/subprocess-fixture.d.ts.map +1 -0
- package/build/lib/test/subprocess-fixture.js +27 -0
- package/build/lib/test/subprocess-fixture.js.map +1 -0
- package/build/lib/ttag.d.ts +7 -1
- package/build/lib/ttag.d.ts.map +1 -1
- package/build/lib/ttag.js +5 -4
- package/build/lib/ttag.js.map +1 -1
- package/build/lib/util/dot-path.d.ts +14 -0
- package/build/lib/util/dot-path.d.ts.map +1 -0
- package/build/lib/util/dot-path.js +51 -0
- package/build/lib/util/dot-path.js.map +1 -0
- package/build/lib/util/index.d.ts +10 -24
- package/build/lib/util/index.d.ts.map +1 -1
- package/build/lib/util/index.js +43 -93
- package/build/lib/util/index.js.map +1 -1
- package/build/lib/util/node/actualURI.d.ts +4 -0
- package/build/lib/util/node/actualURI.d.ts.map +1 -0
- package/build/lib/util/node/actualURI.js +10 -0
- package/build/lib/util/node/actualURI.js.map +1 -0
- package/build/lib/util/node/module-loader.d.ts +14 -0
- package/build/lib/util/node/module-loader.d.ts.map +1 -0
- package/build/lib/util/node/module-loader.js +51 -0
- package/build/lib/util/node/module-loader.js.map +1 -0
- package/build/lib/util/node/workspace-lib.d.ts +15 -0
- package/build/lib/util/node/workspace-lib.d.ts.map +1 -0
- package/build/lib/util/node/workspace-lib.js +119 -0
- package/build/lib/util/node/workspace-lib.js.map +1 -0
- package/build/lib/util/secret-utils.d.ts.map +1 -1
- package/build/lib/util/secret-utils.js +2 -2
- package/build/lib/util/secret-utils.js.map +1 -1
- package/build/lib/vertex-crud.d.ts +22 -0
- package/build/lib/vertex-crud.d.ts.map +1 -0
- package/build/lib/vertex-crud.js +73 -0
- package/build/lib/vertex-crud.js.map +1 -0
- package/build/lib/workspace-discovery.d.ts +1 -1
- package/build/lib/workspace-discovery.d.ts.map +1 -1
- package/build/lib/workspace-discovery.js +10 -10
- package/build/lib/workspace-discovery.js.map +1 -1
- package/build/lib/zcap-like-authority.d.ts +38 -0
- package/build/lib/zcap-like-authority.d.ts.map +1 -0
- package/build/lib/zcap-like-authority.js +56 -0
- package/build/lib/zcap-like-authority.js.map +1 -0
- package/build/monitor/index.d.ts +1 -1
- package/build/monitor/index.d.ts.map +1 -1
- package/build/monitor/index.js +1 -1
- package/build/monitor/index.js.map +1 -1
- package/build/phases/Executor.d.ts +31 -7
- package/build/phases/Executor.d.ts.map +1 -1
- package/build/phases/Executor.js +202 -217
- package/build/phases/Executor.js.map +1 -1
- package/build/phases/Resolver.d.ts +2 -2
- package/build/phases/Resolver.d.ts.map +1 -1
- package/build/phases/Resolver.js +35 -30
- package/build/phases/Resolver.js.map +1 -1
- package/build/phases/collector.d.ts +3 -3
- package/build/phases/collector.d.ts.map +1 -1
- package/build/phases/collector.js +19 -17
- package/build/phases/collector.js.map +1 -1
- package/build/run-policy/run-policy-schema.d.ts +3 -5
- package/build/run-policy/run-policy-schema.d.ts.map +1 -1
- package/build/run-policy/run-policy-schema.js +41 -37
- package/build/run-policy/run-policy-schema.js.map +1 -1
- package/build/run-policy/run-policy-types.d.ts +1 -1
- package/build/run-policy/run-policy-types.d.ts.map +1 -1
- package/build/run-policy/run-policy-types.js +19 -16
- package/build/run-policy/run-policy-types.js.map +1 -1
- package/build/runner.d.ts +4 -4
- package/build/runner.d.ts.map +1 -1
- package/build/runner.js +15 -13
- package/build/runner.js.map +1 -1
- package/build/schema/protocol.d.ts +155 -63
- package/build/schema/protocol.d.ts.map +1 -1
- package/build/schema/protocol.js +177 -148
- package/build/schema/protocol.js.map +1 -1
- package/build/steps/activities-stepper.d.ts +14 -13
- package/build/steps/activities-stepper.d.ts.map +1 -1
- package/build/steps/activities-stepper.js +116 -78
- package/build/steps/activities-stepper.js.map +1 -1
- package/build/steps/conformance.d.ts +5 -5
- package/build/steps/conformance.js +4 -4
- package/build/steps/console-monitor-stepper.d.ts +2 -2
- package/build/steps/console-monitor-stepper.d.ts.map +1 -1
- package/build/steps/console-monitor-stepper.js +22 -22
- package/build/steps/console-monitor-stepper.js.map +1 -1
- package/build/steps/debugger-stepper.d.ts +11 -11
- package/build/steps/debugger-stepper.d.ts.map +1 -1
- package/build/steps/debugger-stepper.js +65 -64
- package/build/steps/debugger-stepper.js.map +1 -1
- package/build/steps/finalizer-stepper.d.ts +3 -4
- package/build/steps/finalizer-stepper.d.ts.map +1 -1
- package/build/steps/finalizer-stepper.js +16 -19
- package/build/steps/finalizer-stepper.js.map +1 -1
- package/build/steps/haibun.d.ts +27 -20
- package/build/steps/haibun.d.ts.map +1 -1
- package/build/steps/haibun.js +76 -67
- package/build/steps/haibun.js.map +1 -1
- package/build/steps/lib/tts.d.ts +1 -1
- package/build/steps/lib/tts.d.ts.map +1 -1
- package/build/steps/lib/tts.js +28 -28
- package/build/steps/lib/tts.js.map +1 -1
- package/build/steps/logic-stepper.d.ts +5 -5
- package/build/steps/logic-stepper.d.ts.map +1 -1
- package/build/steps/logic-stepper.js +76 -76
- package/build/steps/logic-stepper.js.map +1 -1
- package/build/steps/narrator.d.ts +9 -9
- package/build/steps/narrator.d.ts.map +1 -1
- package/build/steps/narrator.js +32 -28
- package/build/steps/narrator.js.map +1 -1
- package/build/steps/resources-stepper.d.ts +47 -0
- package/build/steps/resources-stepper.d.ts.map +1 -0
- package/build/steps/resources-stepper.js +100 -0
- package/build/steps/resources-stepper.js.map +1 -0
- package/build/steps/variables-stepper.d.ts +82 -54
- package/build/steps/variables-stepper.d.ts.map +1 -1
- package/build/steps/variables-stepper.js +264 -216
- package/build/steps/variables-stepper.js.map +1 -1
- package/build/steps/zcap-like-stepper.d.ts +50 -0
- package/build/steps/zcap-like-stepper.d.ts.map +1 -0
- package/build/steps/zcap-like-stepper.js +113 -0
- package/build/steps/zcap-like-stepper.js.map +1 -0
- package/package.json +1 -1
- package/build/lib/consts.d.ts +0 -5
- package/build/lib/consts.d.ts.map +0 -1
- package/build/lib/consts.js +0 -5
- package/build/lib/consts.js.map +0 -1
- package/build/lib/step-helpers.d.ts +0 -10
- package/build/lib/step-helpers.d.ts.map +0 -1
- package/build/lib/step-helpers.js +0 -16
- package/build/lib/step-helpers.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AStepper } from
|
|
1
|
+
import { AStepper } from "./astepper.js";
|
|
2
2
|
/**
|
|
3
3
|
* Metadata for a single step, extracted from a stepper definition.
|
|
4
4
|
* Used by both LSP (for autocomplete/hover) and MCP (for tool registration).
|
|
@@ -8,7 +8,10 @@ export interface StepDescriptor {
|
|
|
8
8
|
stepName: string;
|
|
9
9
|
method: string;
|
|
10
10
|
pattern: string;
|
|
11
|
-
params: Record<string,
|
|
11
|
+
params: Record<string, "string" | "number">;
|
|
12
|
+
/** Domain key for each parameter (e.g., { data: 'haibun-email', id: 'string' }) */
|
|
13
|
+
paramDomains?: Record<string, string>;
|
|
14
|
+
capability?: string;
|
|
12
15
|
inputSchema?: Record<string, unknown>;
|
|
13
16
|
outputSchema?: Record<string, unknown>;
|
|
14
17
|
}
|
|
@@ -19,7 +22,7 @@ export interface StepDescriptor {
|
|
|
19
22
|
export declare class StepperRegistry {
|
|
20
23
|
/**
|
|
21
24
|
* Extract metadata from all steps in the provided steppers.
|
|
22
|
-
* Filters out steps marked with `
|
|
25
|
+
* Filters out steps marked with `exposeMCP: false`.
|
|
23
26
|
*/
|
|
24
27
|
static getMetadata(steppers: AStepper[]): StepDescriptor[];
|
|
25
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper-registry.d.ts","sourceRoot":"","sources":["../../src/lib/stepper-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC;;;GAGG;AACH,MAAM,WAAW,cAAc;
|
|
1
|
+
{"version":3,"file":"stepper-registry.d.ts","sourceRoot":"","sources":["../../src/lib/stepper-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC,CAAC;IAC5C,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED;;;GAGG;AACH,qBAAa,eAAe;IAC3B;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,cAAc,EAAE;IAyB1D;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;CAIhD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { constructorName } from
|
|
2
|
-
import { namedInterpolation } from
|
|
1
|
+
import { constructorName } from "./util/index.js";
|
|
2
|
+
import { namedInterpolation } from "./namedVars.js";
|
|
3
3
|
/**
|
|
4
4
|
* Central registry for extracting step metadata from steppers.
|
|
5
5
|
* Ensures that LSP and MCP share identical step definitions.
|
|
@@ -7,27 +7,28 @@ import { namedInterpolation } from './namedVars.js';
|
|
|
7
7
|
export class StepperRegistry {
|
|
8
8
|
/**
|
|
9
9
|
* Extract metadata from all steps in the provided steppers.
|
|
10
|
-
* Filters out steps marked with `
|
|
10
|
+
* Filters out steps marked with `exposeMCP: false`.
|
|
11
11
|
*/
|
|
12
12
|
static getMetadata(steppers) {
|
|
13
|
-
return steppers.flatMap(stepper => {
|
|
13
|
+
return steppers.flatMap((stepper) => {
|
|
14
14
|
const stepperName = constructorName(stepper);
|
|
15
15
|
return Object.entries(stepper.steps)
|
|
16
|
-
.filter(([, def]) => def.
|
|
16
|
+
.filter(([, def]) => def.exposeMCP !== false)
|
|
17
17
|
.map(([stepName, stepDef]) => {
|
|
18
18
|
const params = {};
|
|
19
19
|
const pattern = stepDef.gwta || stepDef.exact || stepDef.match?.toString() || stepName;
|
|
20
|
+
const paramDomains = {};
|
|
20
21
|
if (stepDef.gwta) {
|
|
21
22
|
const { stepValuesMap } = namedInterpolation(stepDef.gwta);
|
|
22
23
|
if (stepValuesMap) {
|
|
23
24
|
for (const v of Object.values(stepValuesMap)) {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
params[v.term] = v.domain === "number" ? "number" : "string";
|
|
26
|
+
paramDomains[v.term] = v.domain || "string";
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
const method = `${stepperName}-${stepName}`;
|
|
30
|
-
return { stepperName, stepName, method, pattern, params };
|
|
31
|
+
return { stepperName, stepName, method, pattern, params, paramDomains, capability: stepDef.capability };
|
|
31
32
|
});
|
|
32
33
|
});
|
|
33
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper-registry.js","sourceRoot":"","sources":["../../src/lib/stepper-registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"stepper-registry.js","sourceRoot":"","sources":["../../src/lib/stepper-registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAmBpD;;;GAGG;AACH,MAAM,OAAO,eAAe;IAC3B;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,QAAoB;QACtC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACnC,MAAM,WAAW,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;YAC7C,OAAO,MAAM,C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QACtC,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,OAAO,OAAO,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;IACrF,CAAC;CACD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* subprocess-runner.ts
|
|
3
|
+
*
|
|
4
|
+
* Child process entry point for subprocess sandboxing.
|
|
5
|
+
* Forked by SubprocessTransport. Uses Node.js IPC (process.send / process.on('message')).
|
|
6
|
+
*
|
|
7
|
+
* Protocol (structured-clone messages over IPC):
|
|
8
|
+
* Startup: child → { type: "ready", steps: StepDescriptor[] }
|
|
9
|
+
* Request: parent → { type: "call", method, params?, seqPath? }
|
|
10
|
+
* Response: child → { type: "result", ok: true, products } | { type: "result", ok: false, error }
|
|
11
|
+
*/
|
|
12
|
+
import type { CStepper, TWorld } from "./execution.js";
|
|
13
|
+
import { type StepDescriptor } from "./stepper-registry.js";
|
|
14
|
+
export type SubprocessReadyMessage = {
|
|
15
|
+
type: "ready";
|
|
16
|
+
steps: StepDescriptor[];
|
|
17
|
+
};
|
|
18
|
+
export type SubprocessCallMessage = {
|
|
19
|
+
type: "call";
|
|
20
|
+
method: string;
|
|
21
|
+
params?: Record<string, unknown>;
|
|
22
|
+
seqPath?: number[];
|
|
23
|
+
};
|
|
24
|
+
export type SubprocessResultMessage = {
|
|
25
|
+
type: "result";
|
|
26
|
+
ok: true;
|
|
27
|
+
products: Record<string, unknown>;
|
|
28
|
+
} | {
|
|
29
|
+
type: "result";
|
|
30
|
+
ok: false;
|
|
31
|
+
error: string;
|
|
32
|
+
};
|
|
33
|
+
export type SubprocessMessage = SubprocessReadyMessage | SubprocessCallMessage | SubprocessResultMessage;
|
|
34
|
+
export declare function runSubprocess(csteppers: CStepper[], world: TWorld): Promise<void>;
|
|
35
|
+
//# sourceMappingURL=subprocess-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subprocess-runner.d.ts","sourceRoot":"","sources":["../../src/lib/subprocess-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAIvD,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE7E,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC;AAChF,MAAM,MAAM,qBAAqB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAC3H,MAAM,MAAM,uBAAuB,GAChC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GAAG,qBAAqB,GAAG,uBAAuB,CAAC;AAEzG,wBAAsB,aAAa,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8CvF"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* subprocess-runner.ts
|
|
3
|
+
*
|
|
4
|
+
* Child process entry point for subprocess sandboxing.
|
|
5
|
+
* Forked by SubprocessTransport. Uses Node.js IPC (process.send / process.on('message')).
|
|
6
|
+
*
|
|
7
|
+
* Protocol (structured-clone messages over IPC):
|
|
8
|
+
* Startup: child → { type: "ready", steps: StepDescriptor[] }
|
|
9
|
+
* Request: parent → { type: "call", method, params?, seqPath? }
|
|
10
|
+
* Response: child → { type: "result", ok: true, products } | { type: "result", ok: false, error }
|
|
11
|
+
*/
|
|
12
|
+
import { StepRegistry, validateToolInput, buildSyntheticFeatureStep } from "./step-dispatch.js";
|
|
13
|
+
import { createSteppers, setStepperWorldsAndDomains } from "./util/index.js";
|
|
14
|
+
import { addStepperConcerns } from "../phases/Executor.js";
|
|
15
|
+
import { StepperRegistry } from "./stepper-registry.js";
|
|
16
|
+
export async function runSubprocess(csteppers, world) {
|
|
17
|
+
const steppers = await createSteppers(csteppers);
|
|
18
|
+
await setStepperWorldsAndDomains(steppers, world);
|
|
19
|
+
await addStepperConcerns(world, steppers);
|
|
20
|
+
world.runtime.steppers = steppers;
|
|
21
|
+
const registry = new StepRegistry(steppers, world);
|
|
22
|
+
const steps = StepperRegistry.getMetadata(steppers);
|
|
23
|
+
process.send?.({ type: "ready", steps });
|
|
24
|
+
process.on("message", async (msg) => {
|
|
25
|
+
if (msg.type !== "call")
|
|
26
|
+
return;
|
|
27
|
+
const tool = registry.get(msg.method);
|
|
28
|
+
if (!tool) {
|
|
29
|
+
process.send?.({ type: "result", ok: false, error: `Method not found: ${msg.method}` });
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (!msg.seqPath || msg.seqPath.length === 0) {
|
|
33
|
+
process.send?.({
|
|
34
|
+
type: "result",
|
|
35
|
+
ok: false,
|
|
36
|
+
error: `Method ${msg.method}: missing seqPath — subprocess dispatches must thread the caller's seqPath`,
|
|
37
|
+
});
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const validated = validateToolInput(tool, msg.params ?? {}, world);
|
|
42
|
+
const featureStep = buildSyntheticFeatureStep(tool, validated, msg.seqPath);
|
|
43
|
+
const hr = await tool.handler(featureStep, world);
|
|
44
|
+
if (hr.ok) {
|
|
45
|
+
process.send?.({ type: "result", ok: true, products: hr.products ?? {} });
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
process.send?.({ type: "result", ok: false, error: hr.errorMessage ?? "Step failed" });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
process.send?.({
|
|
53
|
+
type: "result",
|
|
54
|
+
ok: false,
|
|
55
|
+
error: err instanceof Error ? err.message : String(err),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=subprocess-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subprocess-runner.js","sourceRoot":"","sources":["../../src/lib/subprocess-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAuB,MAAM,uBAAuB,CAAC;AAU7E,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,SAAqB,EAAE,KAAa;IACvE,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,0BAA0B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAClD,MAAM,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC1C,KAAK,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAElC,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,eAAe,CAAC,WAAW,CAAC,QAAQ,C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,QAAQ,EAAE,EAAE,CAAC,QAAQ,IAAI,EAAE,EAAoC,CAAC,CAAC;YAC7G,CAAC;iBAAM,CAAC;gBACP,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,IAAI,aAAa,EAAoC,CAAC,CAAC;YAC1H,CAAC;QACF,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,EAAE,CAAC;gBACd,IAAI,EAAE,QAAQ;gBACd,EAAE,EAAE,KAAK;gBACT,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACrB,CAAC,CAAC;QACtC,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* subprocess-transport.ts
|
|
3
|
+
*
|
|
4
|
+
* Parent-side subprocess transport. Forks a child process running runSubprocess(),
|
|
5
|
+
* reads its step list via IPC, and injects proxy StepTools into the parent's StepRegistry.
|
|
6
|
+
*
|
|
7
|
+
* Uses Node.js fork() IPC (structured-clone messages) — no framing, no seq IDs, no readline.
|
|
8
|
+
* The child signals readiness with { type: "ready", steps }, then serves
|
|
9
|
+
* { type: "call", method, params, seqPath } → { type: "result", ok, products|error }.
|
|
10
|
+
*
|
|
11
|
+
* seqPath threading: every call includes the caller's seqPath so the child
|
|
12
|
+
* can append its own step numbers, preserving the full [feature.scenario.step...] hierarchy.
|
|
13
|
+
*/
|
|
14
|
+
import type { TWorld } from "./execution.js";
|
|
15
|
+
import type { TActionResult } from "../schema/protocol.js";
|
|
16
|
+
import { type StepRegistry } from "./step-dispatch.js";
|
|
17
|
+
import type { StepDescriptor } from "./stepper-registry.js";
|
|
18
|
+
export declare class SubprocessTransport {
|
|
19
|
+
private child;
|
|
20
|
+
private stepDescriptors;
|
|
21
|
+
private constructor();
|
|
22
|
+
private pending;
|
|
23
|
+
static spawn(entryPath: string, _world: TWorld): Promise<SubprocessTransport>;
|
|
24
|
+
injectInto(registry: StepRegistry): void;
|
|
25
|
+
/**
|
|
26
|
+
* seqPath is required. Every call must thread the caller's seqPath so
|
|
27
|
+
* observations produced in the subprocess link back to the caller's
|
|
28
|
+
* execution context. Synthetic [0, N] roots are no longer produced —
|
|
29
|
+
* a caller with no meaningful seqPath should not be invoking a
|
|
30
|
+
* subprocess transport.
|
|
31
|
+
*/
|
|
32
|
+
call(method: string, params: Record<string, unknown>, seqPath: number[]): Promise<TActionResult>;
|
|
33
|
+
private handleMessage;
|
|
34
|
+
kill(): void;
|
|
35
|
+
get descriptors(): StepDescriptor[];
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=subprocess-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subprocess-transport.d.ts","sourceRoot":"","sources":["../../src/lib/subprocess-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,qBAAa,mBAAmB;IAE9B,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,eAAe;IAFxB,OAAO;IAaP,OAAO,CAAC,OAAO,CAAuD;WAEzD,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA+BnF,UAAU,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IA0BxC;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAmBhG,OAAO,CAAC,aAAa,CAInB;IAEF,IAAI,IAAI,IAAI;IAIZ,IAAI,WAAW,IAAI,cAAc,EAAE,CAElC;CACD"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* subprocess-transport.ts
|
|
3
|
+
*
|
|
4
|
+
* Parent-side subprocess transport. Forks a child process running runSubprocess(),
|
|
5
|
+
* reads its step list via IPC, and injects proxy StepTools into the parent's StepRegistry.
|
|
6
|
+
*
|
|
7
|
+
* Uses Node.js fork() IPC (structured-clone messages) — no framing, no seq IDs, no readline.
|
|
8
|
+
* The child signals readiness with { type: "ready", steps }, then serves
|
|
9
|
+
* { type: "call", method, params, seqPath } → { type: "result", ok, products|error }.
|
|
10
|
+
*
|
|
11
|
+
* seqPath threading: every call includes the caller's seqPath so the child
|
|
12
|
+
* can append its own step numbers, preserving the full [feature.scenario.step...] hierarchy.
|
|
13
|
+
*/
|
|
14
|
+
import { fork } from "child_process";
|
|
15
|
+
import { actionNotOK } from "./util/index.js";
|
|
16
|
+
export class SubprocessTransport {
|
|
17
|
+
child;
|
|
18
|
+
stepDescriptors;
|
|
19
|
+
constructor(child, stepDescriptors) {
|
|
20
|
+
this.child = child;
|
|
21
|
+
this.stepDescriptors = stepDescriptors;
|
|
22
|
+
child.on("exit", (code) => {
|
|
23
|
+
if (this.pending) {
|
|
24
|
+
this.pending({ type: "result", ok: false, error: `subprocess exited with code ${code}` });
|
|
25
|
+
this.pending = null;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
// At most one in-flight call at a time (subprocess steps execute sequentially).
|
|
30
|
+
pending = null;
|
|
31
|
+
static async spawn(entryPath, _world) {
|
|
32
|
+
const child = fork(entryPath, [], { silent: true });
|
|
33
|
+
child.stderr?.on("data", (data) => {
|
|
34
|
+
process.stderr.write(`[subprocess] ${data.toString()}`);
|
|
35
|
+
});
|
|
36
|
+
const stepDescriptors = await new Promise((resolve, reject) => {
|
|
37
|
+
const timeout = setTimeout(() => reject(new Error(`subprocess at ${entryPath} did not send ready message within 10s`)), 10_000);
|
|
38
|
+
child.once("message", (msg) => {
|
|
39
|
+
clearTimeout(timeout);
|
|
40
|
+
if (msg.type !== "ready") {
|
|
41
|
+
reject(new Error(`subprocess first message was not "ready": ${JSON.stringify(msg)}`));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
resolve(msg.steps);
|
|
45
|
+
});
|
|
46
|
+
child.once("exit", (code) => {
|
|
47
|
+
clearTimeout(timeout);
|
|
48
|
+
reject(new Error(`subprocess exited before ready (code ${code})`));
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
return new SubprocessTransport(child, stepDescriptors);
|
|
52
|
+
}
|
|
53
|
+
injectInto(registry) {
|
|
54
|
+
for (const descriptor of this.stepDescriptors) {
|
|
55
|
+
const tool = {
|
|
56
|
+
name: descriptor.method,
|
|
57
|
+
description: descriptor.pattern,
|
|
58
|
+
inputSchema: descriptor.inputSchema ?? { type: "object" },
|
|
59
|
+
paramSchemas: new Map(),
|
|
60
|
+
paramDomainKeys: new Map(),
|
|
61
|
+
stepperName: descriptor.stepperName,
|
|
62
|
+
stepName: descriptor.stepName,
|
|
63
|
+
capability: descriptor.capability,
|
|
64
|
+
isAsync: true,
|
|
65
|
+
transport: "subprocess",
|
|
66
|
+
handler: (featureStep, _world) => this.call(descriptor.method, featureStep.action?.stepValuesMap
|
|
67
|
+
? Object.fromEntries(Object.entries(featureStep.action.stepValuesMap).map(([k, v]) => [k, v.term]))
|
|
68
|
+
: {}, featureStep.seqPath),
|
|
69
|
+
};
|
|
70
|
+
registry.set(tool);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* seqPath is required. Every call must thread the caller's seqPath so
|
|
75
|
+
* observations produced in the subprocess link back to the caller's
|
|
76
|
+
* execution context. Synthetic [0, N] roots are no longer produced —
|
|
77
|
+
* a caller with no meaningful seqPath should not be invoking a
|
|
78
|
+
* subprocess transport.
|
|
79
|
+
*/
|
|
80
|
+
call(method, params, seqPath) {
|
|
81
|
+
return new Promise((resolve, reject) => {
|
|
82
|
+
if (this.pending) {
|
|
83
|
+
reject(new Error("SubprocessTransport: concurrent calls not supported"));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
this.pending = (result) => {
|
|
87
|
+
this.pending = null;
|
|
88
|
+
if (result.ok) {
|
|
89
|
+
resolve({ ok: true, products: result.products });
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
resolve(actionNotOK(result.error));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
this.child.on("message", this.handleMessage);
|
|
96
|
+
this.child.send({ type: "call", method, params, seqPath });
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
handleMessage = (msg) => {
|
|
100
|
+
if (msg.type !== "result")
|
|
101
|
+
return;
|
|
102
|
+
this.child.off("message", this.handleMessage);
|
|
103
|
+
if (this.pending)
|
|
104
|
+
this.pending(msg);
|
|
105
|
+
};
|
|
106
|
+
kill() {
|
|
107
|
+
this.child.kill();
|
|
108
|
+
}
|
|
109
|
+
get descriptors() {
|
|
110
|
+
return this.stepDescriptors;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=subprocess-transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subprocess-transport.js","sourceRoot":"","sources":["../../src/lib/subprocess-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAqB,MAAM,eAAe,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9C,MAAM,OAAO,mBAAmB;IAEtB;IACA;IAFT,YACS,KAAmB,EACnB,e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AC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC9C,IAAI,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,IAAI;QACH,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC;IAED,IAAI,WAAW;QACd,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;CACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AStepper } from
|
|
2
|
-
import { TWorld } from
|
|
3
|
-
import { THaibunEvent } from
|
|
1
|
+
import { AStepper } from "../astepper.js";
|
|
2
|
+
import { TWorld } from "../execution.js";
|
|
3
|
+
import { THaibunEvent } from "../../schema/protocol.js";
|
|
4
4
|
/**
|
|
5
5
|
* EventCollectorStepper - Collects events for test inspection.
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventCollectorStepper.d.ts","sourceRoot":"","sources":["../../../src/lib/test/EventCollectorStepper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EventCollectorStepper.d.ts","sourceRoot":"","sources":["../../../src/lib/test/EventCollectorStepper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD;;;;;;;;;;GAUG;AACH,qBAAa,qBAAsB,SAAQ,QAAQ;IAClD,WAAW,SAAyC;IAEpD,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,kBAAkB,CAAC,CAAgC;IAErD,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQlE,KAAK,KAAM;IAEX,+BAA+B;IAC/B,SAAS,IAAI,YAAY,EAAE;IAI3B,qCAAqC;IACrC,aAAa,IAAI,YAAY,EAAE;IAI/B,sCAAsC;IACtC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,OAAO,GAAG,YAAY,EAAE;IAInE,6BAA6B;IAC7B,KAAK,IAAI,IAAI;IAIb,oCAAoC;IACpC,KAAK,IAAI,IAAI;CAMb;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AStepper } from
|
|
1
|
+
import { AStepper } from "../astepper.js";
|
|
2
2
|
/**
|
|
3
3
|
* EventCollectorStepper - Collects events for test inspection.
|
|
4
4
|
*
|
|
@@ -11,7 +11,7 @@ import { AStepper } from '../astepper.js';
|
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
13
|
export class EventCollectorStepper extends AStepper {
|
|
14
|
-
description =
|
|
14
|
+
description = "Collects events for test inspection";
|
|
15
15
|
events = [];
|
|
16
16
|
subscriberCallback;
|
|
17
17
|
async setWorld(world, steppers) {
|
|
@@ -28,7 +28,7 @@ export class EventCollectorStepper extends AStepper {
|
|
|
28
28
|
}
|
|
29
29
|
/** Get step lifecycle events only */
|
|
30
30
|
getStepEvents() {
|
|
31
|
-
return this.events.filter(e =>
|
|
31
|
+
return this.events.filter((e) => "type" in e && e.type === "step");
|
|
32
32
|
}
|
|
33
33
|
/** Get events matching a predicate */
|
|
34
34
|
findEvents(predicate) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventCollectorStepper.js","sourceRoot":"","sources":["../../../src/lib/test/EventCollectorStepper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C;;;;;;;;;;GAUG;AACH,MAAM,OAAO,qBA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CAAC,KAAK,EAAE,WAAW,EAAE,CAAC;YACxD,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAC5D,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACrC,CAAC;IACF,CAAC;CACD;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TStepArgs } from
|
|
2
|
-
import { AStepper } from
|
|
1
|
+
import { TStepArgs } from "../../schema/protocol.js";
|
|
2
|
+
import { AStepper } from "../astepper.js";
|
|
3
3
|
export default class SetTimeStepper extends AStepper {
|
|
4
4
|
steps: {
|
|
5
5
|
setTime: {
|
|
6
6
|
gwta: string;
|
|
7
|
-
action: ({ y, m, d, h, min, s }: TStepArgs) => Promise<import("../../schema/protocol.js").
|
|
7
|
+
action: ({ y, m, d, h, min, s }: TStepArgs) => Promise<import("../../schema/protocol.js").TActionResult>;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetTimeStepper.d.ts","sourceRoot":"","sources":["../../../src/lib/test/SetTimeStepper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAM,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,QAAQ;
|
|
1
|
+
{"version":3,"file":"SetTimeStepper.d.ts","sourceRoot":"","sources":["../../../src/lib/test/SetTimeStepper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAM,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,QAAQ;IACnD,KAAK;;;6CAG8B,SAAS;;MAsB1C;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { vi } from
|
|
2
|
-
import { OK } from
|
|
3
|
-
import { AStepper } from
|
|
1
|
+
import { vi } from "vitest";
|
|
2
|
+
import { OK } from "../../schema/protocol.js";
|
|
3
|
+
import { AStepper } from "../astepper.js";
|
|
4
4
|
const checkedInt = (p, v) => {
|
|
5
5
|
if (v === undefined)
|
|
6
6
|
throw Error(`undefined value "${v}" for ${p}`);
|
|
@@ -9,17 +9,17 @@ const checkedInt = (p, v) => {
|
|
|
9
9
|
export default class SetTimeStepper extends AStepper {
|
|
10
10
|
steps = {
|
|
11
11
|
setTime: {
|
|
12
|
-
gwta:
|
|
12
|
+
gwta: "change date to {y}-{m}-{d} {h}:{min}:{s}",
|
|
13
13
|
action: ({ y, m, d, h, min, s }) => {
|
|
14
14
|
for (const v of [y, m, d, h, min, s]) {
|
|
15
15
|
if (Array.isArray(v))
|
|
16
|
-
throw new Error(
|
|
16
|
+
throw new Error("date parts must be strings");
|
|
17
17
|
}
|
|
18
18
|
const ys = y, ms = m, ds = d, hs = h, mins = min, ss = s;
|
|
19
|
-
const date = new Date(checkedInt(
|
|
19
|
+
const date = new Date(checkedInt("year", ys), checkedInt("month", ms) - 1, checkedInt("day", ds), checkedInt("hour", hs), checkedInt("minute", mins), checkedInt("second", ss));
|
|
20
20
|
vi.setSystemTime(date);
|
|
21
21
|
return Promise.resolve(OK);
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetTimeStepper.js","sourceRoot":"","sources":["../../../src/lib/test/SetTimeStepper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAa,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,UAAU,GAAG,CAAC,CAAS,E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EAAE,CAAC,GAAG,CAAC,EAC3B,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,EACrB,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,EACtB,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,EAC1B,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CACxB,CAAC;gBACF,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;gBACvB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC5B,CAAC;SACD;KACD,CAAC;CACF"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { AStepper } from
|
|
1
|
+
import { AStepper } from "../astepper.js";
|
|
2
2
|
declare const TestSteps: {
|
|
3
3
|
new (): {
|
|
4
4
|
steps: {
|
|
5
5
|
fails: {
|
|
6
6
|
gwta: string;
|
|
7
|
-
action: () => Promise<import("../../schema/protocol.js").
|
|
7
|
+
action: () => Promise<import("../../schema/protocol.js").TActionResult>;
|
|
8
8
|
};
|
|
9
9
|
test: {
|
|
10
10
|
exact: string;
|
|
11
|
-
action: () => Promise<import("../../schema/protocol.js").
|
|
11
|
+
action: () => Promise<import("../../schema/protocol.js").TActionResult>;
|
|
12
12
|
};
|
|
13
13
|
passes: {
|
|
14
14
|
exact: string;
|
|
15
|
-
action: () => Promise<import("../../schema/protocol.js").
|
|
15
|
+
action: () => Promise<import("../../schema/protocol.js").TActionResult>;
|
|
16
16
|
};
|
|
17
17
|
throws: {
|
|
18
18
|
gwta: string;
|
|
@@ -20,10 +20,10 @@ declare const TestSteps: {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
description?: string;
|
|
23
|
-
world?: import("../
|
|
23
|
+
world?: import("../execution.js").TWorld;
|
|
24
24
|
kind?: import("../astepper.js").TStepperKind;
|
|
25
|
-
setWorld(world: import("../
|
|
26
|
-
getWorld(): import("../
|
|
25
|
+
setWorld(world: import("../execution.js").TWorld, _steppers: AStepper[]): Promise<void>;
|
|
26
|
+
getWorld(): import("../execution.js").TWorld;
|
|
27
27
|
startFeatureResolution?(_path: string): void;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestSteps.d.ts","sourceRoot":"","sources":["../../../src/lib/test/TestSteps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TestSteps.d.ts","sourceRoot":"","sources":["../../../src/lib/test/TestSteps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { AStepper } from
|
|
2
|
-
import { actionNotOK, actionOK } from
|
|
1
|
+
import { AStepper } from "../astepper.js";
|
|
2
|
+
import { actionNotOK, actionOK } from "../util/index.js";
|
|
3
3
|
const TestSteps = class TestSteps extends AStepper {
|
|
4
4
|
steps = {
|
|
5
5
|
fails: {
|
|
6
|
-
gwta:
|
|
7
|
-
action: async () => Promise.resolve(actionNotOK(
|
|
6
|
+
gwta: "fails",
|
|
7
|
+
action: async () => Promise.resolve(actionNotOK("test fail")),
|
|
8
8
|
},
|
|
9
9
|
test: {
|
|
10
|
-
exact:
|
|
10
|
+
exact: "have a test",
|
|
11
11
|
action: async () => Promise.resolve(actionOK()),
|
|
12
12
|
},
|
|
13
13
|
passes: {
|
|
14
|
-
exact:
|
|
14
|
+
exact: "passes",
|
|
15
15
|
action: async () => Promise.resolve(actionOK()),
|
|
16
16
|
},
|
|
17
17
|
throws: {
|
|
18
|
-
gwta:
|
|
18
|
+
gwta: "throw an exception",
|
|
19
19
|
action: () => {
|
|
20
20
|
throw Error(`<Thrown for test case>`);
|
|
21
21
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestSteps.js","sourceRoot":"","sources":["../../../src/lib/test/TestSteps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TestSteps.js","sourceRoot":"","sources":["../../../src/lib/test/TestSteps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,SAAS,GAAG,MAAM,SAAU,SAAQ,QAAQ;IACjD,KAAK,GAAG;QACP,KAAK,EAAE;YACN,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;SAC7D;QACD,IAAI,EAAE;YACL,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;SAC/C;QACD,MAAM,EAAE;YACP,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;SAC/C;QACD,MAAM,EAAE;YACP,IAAI,EAAE,oBAAoB;YAC1B,MAAM,EAAE,GAAG,EAAE;gBACZ,MAAM,KAAK,CAAC,wBAAwB,CAAC,CAAC;YACvC,CAAC;SACD;KACD,CAAC;CACF,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AStepper } from
|
|
2
|
-
import { z } from
|
|
1
|
+
import { AStepper } from "../astepper.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
export declare const TestStepsWithOptions: {
|
|
4
4
|
new (): {
|
|
5
5
|
options: {
|
|
@@ -16,14 +16,14 @@ export declare const TestStepsWithOptions: {
|
|
|
16
16
|
outputSchema: z.ZodObject<{
|
|
17
17
|
summary: z.ZodString;
|
|
18
18
|
}, z.core.$strip>;
|
|
19
|
-
action: () => Promise<import("../../schema/protocol.js").
|
|
19
|
+
action: () => Promise<import("../../schema/protocol.js").TActionResult>;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
description?: string;
|
|
23
|
-
world?: import("../
|
|
23
|
+
world?: import("../execution.js").TWorld;
|
|
24
24
|
kind?: import("../astepper.js").TStepperKind;
|
|
25
|
-
setWorld(world: import("../
|
|
26
|
-
getWorld(): import("../
|
|
25
|
+
setWorld(world: import("../execution.js").TWorld, _steppers: AStepper[]): Promise<void>;
|
|
26
|
+
getWorld(): import("../execution.js").TWorld;
|
|
27
27
|
startFeatureResolution?(_path: string): void;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { AStepper } from
|
|
2
|
-
import { actionOKWithProducts, getStepperOption } from
|
|
3
|
-
import { z } from
|
|
1
|
+
import { AStepper } from "../astepper.js";
|
|
2
|
+
import { actionOKWithProducts, getStepperOption } from "../util/index.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
4
|
export const TestStepsWithOptions = class TestStepsWithOptions extends AStepper {
|
|
5
5
|
options = {
|
|
6
6
|
EXISTS: {
|
|
7
|
-
desc:
|
|
7
|
+
desc: "option exists",
|
|
8
8
|
parse: () => ({ result: 42 }),
|
|
9
9
|
},
|
|
10
10
|
};
|
|
11
11
|
steps = {
|
|
12
12
|
test: {
|
|
13
|
-
exact:
|
|
13
|
+
exact: "have a stepper option",
|
|
14
14
|
outputSchema: z.object({ summary: z.string() }),
|
|
15
15
|
action: () => {
|
|
16
|
-
const _res = getStepperOption(this,
|
|
17
|
-
return Promise.resolve(actionOKWithProducts({ summary:
|
|
16
|
+
const _res = getStepperOption(this, "EXISTS", this.getWorld().moduleOptions);
|
|
17
|
+
return Promise.resolve(actionOKWithProducts({ summary: "options" }));
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
};
|