@haibun/core 4.0.0-alpha.2 → 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 +21 -50
- package/build/lib/feature-variables.d.ts.map +1 -1
- package/build/lib/feature-variables.js +122 -232
- 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 +2 -2
- package/build/lib/util/dot-path.d.ts.map +1 -1
- package/build/lib/util/dot-path.js +8 -7
- package/build/lib/util/dot-path.js.map +1 -1
- 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 +201 -219
- 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 +153 -61
- 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 +13 -13
- package/build/steps/activities-stepper.d.ts.map +1 -1
- package/build/steps/activities-stepper.js +105 -79
- 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 +57 -57
- package/build/steps/variables-stepper.d.ts.map +1 -1
- package/build/steps/variables-stepper.js +252 -224
- 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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generate CRUD steps from domain declarations.
|
|
3
|
+
* Any domain with meta.vertexLabel gets create/get/delete/list steps.
|
|
4
|
+
* Steps operate against IQuadStore — the same store used for all shared state.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { actionOK, actionNotOK, actionOKWithProducts } from "./util/index.js";
|
|
8
|
+
export const VERTEX_STORE_KEY = "vertexStore";
|
|
9
|
+
/**
|
|
10
|
+
* Generate CRUD step definitions for a vertex type.
|
|
11
|
+
*/
|
|
12
|
+
export function vertexCrudSteps(label, domainKey, getStore) {
|
|
13
|
+
const lc = label.toLowerCase();
|
|
14
|
+
return {
|
|
15
|
+
[`create${label}`]: {
|
|
16
|
+
gwta: `create ${lc} {data: ${domainKey}}`,
|
|
17
|
+
action: async ({ data }) => {
|
|
18
|
+
await getStore().upsertVertex(label, data);
|
|
19
|
+
return actionOK();
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
[`get${label}`]: {
|
|
23
|
+
gwta: `get ${lc} {id: string}`,
|
|
24
|
+
outputSchema: z.object({ vertex: z.unknown() }),
|
|
25
|
+
action: async ({ id }) => {
|
|
26
|
+
const vertex = await getStore().getVertex(label, id);
|
|
27
|
+
if (!vertex)
|
|
28
|
+
return actionNotOK(`${label} not found: ${id}`);
|
|
29
|
+
return actionOKWithProducts({ vertex });
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
[`delete${label}`]: {
|
|
33
|
+
gwta: `delete ${lc} {id: string}`,
|
|
34
|
+
action: async ({ id }) => {
|
|
35
|
+
await getStore().deleteVertex(label, id);
|
|
36
|
+
return actionOK();
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
[`list${label}s`]: {
|
|
40
|
+
gwta: `list ${lc}s`,
|
|
41
|
+
outputSchema: z.object({ vertices: z.array(z.unknown()), total: z.number() }),
|
|
42
|
+
action: async (args) => {
|
|
43
|
+
const filters = {};
|
|
44
|
+
for (const [k, v] of Object.entries(args)) {
|
|
45
|
+
if (v !== undefined && k !== "limit" && k !== "offset")
|
|
46
|
+
filters[k] = v;
|
|
47
|
+
}
|
|
48
|
+
const limit = args.limit ?? 50;
|
|
49
|
+
const offset = args.offset ?? 0;
|
|
50
|
+
const vertices = await getStore().queryVertices(label, Object.keys(filters).length > 0 ? filters : undefined, {
|
|
51
|
+
limit,
|
|
52
|
+
offset,
|
|
53
|
+
});
|
|
54
|
+
return actionOKWithProducts({ vertices, total: vertices.length });
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Generate CRUD steps for ALL vertex domains.
|
|
61
|
+
* Call after getConcerns has populated world.domains.
|
|
62
|
+
*/
|
|
63
|
+
export function generateVertexCrudFromDomains(domains, getStore) {
|
|
64
|
+
const steps = {};
|
|
65
|
+
for (const [key, domain] of Object.entries(domains)) {
|
|
66
|
+
const topology = domain.topology;
|
|
67
|
+
if (!topology?.vertexLabel)
|
|
68
|
+
continue;
|
|
69
|
+
Object.assign(steps, vertexCrudSteps(topology.vertexLabel, key, getStore));
|
|
70
|
+
}
|
|
71
|
+
return steps;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=vertex-crud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertex-crud.js","sourceRoot":"","sources":["../../src/lib/vertex-crud.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,SAAiB,EAAE,QAA0B;IAC3F,MAAM,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE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,MAAM,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-discovery.d.ts","sourceRoot":"","sources":["../../src/lib/workspace-discovery.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"workspace-discovery.d.ts","sourceRoot":"","sources":["../../src/lib/workspace-discovery.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC/B,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,GAAE,WAAoB,GAAG,eAAe,GAAG,IAAI,CAmCzG;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,GAAE,WAAoB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmB/F;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAE,WAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAI3F;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC5C,eAAe,EAAE,MAAM,EACvB,EAAE,GAAE,WAAoB,GACtB,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAuB/E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import nodeFS from
|
|
2
|
-
import path from
|
|
1
|
+
import nodeFS from "fs";
|
|
2
|
+
import path from "path";
|
|
3
3
|
/**
|
|
4
4
|
* Find the haibun workspace root from a feature file path.
|
|
5
5
|
* Walks up from the file until finding a 'features/' parent directory.
|
|
@@ -16,7 +16,7 @@ export function findHaibunWorkspace(featurePath, fs = nodeFS) {
|
|
|
16
16
|
// Find the 'features' or 'backgrounds' segment in the path
|
|
17
17
|
let featuresIndex = -1;
|
|
18
18
|
for (let i = parts.length - 1; i >= 0; i--) {
|
|
19
|
-
if (parts[i] ===
|
|
19
|
+
if (parts[i] === "features" || parts[i] === "backgrounds") {
|
|
20
20
|
featuresIndex = i;
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
@@ -28,10 +28,10 @@ export function findHaibunWorkspace(featurePath, fs = nodeFS) {
|
|
|
28
28
|
const baseParts = parts.slice(0, featuresIndex);
|
|
29
29
|
const base = baseParts.join(path.sep) || path.sep;
|
|
30
30
|
// Check for config.json at base level
|
|
31
|
-
const configPath = path.join(base,
|
|
31
|
+
const configPath = path.join(base, "config.json");
|
|
32
32
|
const hasConfig = fs.existsSync(configPath);
|
|
33
33
|
// Check for backgrounds/ at base level
|
|
34
|
-
const backgroundsPath = path.join(base,
|
|
34
|
+
const backgroundsPath = path.join(base, "backgrounds");
|
|
35
35
|
const hasBackgrounds = fs.existsSync(backgroundsPath);
|
|
36
36
|
return {
|
|
37
37
|
base,
|
|
@@ -54,7 +54,7 @@ export async function findFeatureFiles(dir, fs = nodeFS) {
|
|
|
54
54
|
if (stat.isDirectory()) {
|
|
55
55
|
await recurse(fullPath);
|
|
56
56
|
}
|
|
57
|
-
else if (entry.endsWith(
|
|
57
|
+
else if (entry.endsWith(".feature")) {
|
|
58
58
|
results.push(fullPath);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -66,7 +66,7 @@ export async function findFeatureFiles(dir, fs = nodeFS) {
|
|
|
66
66
|
* Count features in the workspace (base/features)
|
|
67
67
|
*/
|
|
68
68
|
export async function countFeatures(base, fs = nodeFS) {
|
|
69
|
-
const featuresPath = path.join(base,
|
|
69
|
+
const featuresPath = path.join(base, "features");
|
|
70
70
|
const files = await findFeatureFiles(featuresPath, fs);
|
|
71
71
|
return files.length;
|
|
72
72
|
}
|
|
@@ -81,9 +81,9 @@ export async function loadBackgroundsFromPath(backgroundsPath, fs = nodeFS) {
|
|
|
81
81
|
const base = path.dirname(backgroundsPath);
|
|
82
82
|
const files = await findFeatureFiles(backgroundsPath, fs);
|
|
83
83
|
for (const fullPath of files) {
|
|
84
|
-
const content = fs.readFileSync(fullPath,
|
|
85
|
-
const relativePath = fullPath.replace(base,
|
|
86
|
-
const name = path.basename(fullPath,
|
|
84
|
+
const content = fs.readFileSync(fullPath, "utf-8");
|
|
85
|
+
const relativePath = fullPath.replace(base, "");
|
|
86
|
+
const name = path.basename(fullPath, ".feature");
|
|
87
87
|
backgrounds.push({
|
|
88
88
|
path: relativePath,
|
|
89
89
|
content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-discovery.js","sourceRoot":"","sources":["../../src/lib/workspace-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,IAAI,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAYxB;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,
|
|
1
|
+
{"version":3,"file":"workspace-discovery.js","sourceRoot":"","sources":["../../src/lib/workspace-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,IAAI,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAYxB;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAAmB,EAAE,KAAkB,MAAM;IAChF,iBAAiB;IACjB,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAA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AAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACrC,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IAE1D,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACjD,WAAW,CAAC,IAAI,CAAC;YAChB,IAAI,EAAE,YAAY;YAClB,OAAO;YACP,IAAI;YACJ,IAAI;SACJ,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,WAAW,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TRuntime } from "./execution.js";
|
|
2
|
+
export declare const ZCAP_LIKE_AUTHORITY = "zcapLikeAuthority";
|
|
3
|
+
export type TZcapLikeGrant = {
|
|
4
|
+
token: string;
|
|
5
|
+
capability: string;
|
|
6
|
+
revoked: boolean;
|
|
7
|
+
issuedAt: number;
|
|
8
|
+
revokedAt?: number;
|
|
9
|
+
note?: string;
|
|
10
|
+
issuer?: string;
|
|
11
|
+
};
|
|
12
|
+
export interface IZcapLikeAuthority {
|
|
13
|
+
issueBearerGrant(grant: {
|
|
14
|
+
token: string;
|
|
15
|
+
capability: string;
|
|
16
|
+
note?: string;
|
|
17
|
+
issuer?: string;
|
|
18
|
+
}): TZcapLikeGrant;
|
|
19
|
+
revokeBearerGrant(token: string, capability?: string): number;
|
|
20
|
+
resolveBearerToken(token: string): string[];
|
|
21
|
+
listBearerGrants(): TZcapLikeGrant[];
|
|
22
|
+
clear(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare class ZcapLikeAuthority implements IZcapLikeAuthority {
|
|
25
|
+
private grants;
|
|
26
|
+
issueBearerGrant(grant: {
|
|
27
|
+
token: string;
|
|
28
|
+
capability: string;
|
|
29
|
+
note?: string;
|
|
30
|
+
issuer?: string;
|
|
31
|
+
}): TZcapLikeGrant;
|
|
32
|
+
revokeBearerGrant(token: string, capability?: string): number;
|
|
33
|
+
resolveBearerToken(token: string): string[];
|
|
34
|
+
listBearerGrants(): TZcapLikeGrant[];
|
|
35
|
+
clear(): void;
|
|
36
|
+
}
|
|
37
|
+
export declare function getZcapLikeAuthority(runtime: TRuntime): IZcapLikeAuthority | undefined;
|
|
38
|
+
//# sourceMappingURL=zcap-like-authority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zcap-like-authority.d.ts","sourceRoot":"","sources":["../../src/lib/zcap-like-authority.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,kBAAkB;IAClC,gBAAgB,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,cAAc,CAAC;IAC/G,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9D,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5C,gBAAgB,IAAI,cAAc,EAAE,CAAC;IACrC,KAAK,IAAI,IAAI,CAAC;CACd;AAED,qBAAa,iBAAkB,YAAW,kBAAkB;IAC3D,OAAO,CAAC,MAAM,CAAuC;IAErD,gBAAgB,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,cAAc;IAyB9G,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM;IAc7D,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAI3C,gBAAgB,IAAI,cAAc,EAAE;IAIpC,KAAK,IAAI,IAAI;CAGb;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,QAAQ,GAAG,kBAAkB,GAAG,SAAS,CAEtF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export const ZCAP_LIKE_AUTHORITY = "zcapLikeAuthority";
|
|
2
|
+
export class ZcapLikeAuthority {
|
|
3
|
+
grants = new Map();
|
|
4
|
+
issueBearerGrant(grant) {
|
|
5
|
+
const now = Date.now();
|
|
6
|
+
const current = this.grants.get(grant.token) ?? [];
|
|
7
|
+
const existing = current.find((entry) => entry.capability === grant.capability);
|
|
8
|
+
if (existing) {
|
|
9
|
+
existing.revoked = false;
|
|
10
|
+
existing.issuedAt = now;
|
|
11
|
+
existing.revokedAt = undefined;
|
|
12
|
+
existing.note = grant.note;
|
|
13
|
+
existing.issuer = grant.issuer;
|
|
14
|
+
return existing;
|
|
15
|
+
}
|
|
16
|
+
const issued = {
|
|
17
|
+
token: grant.token,
|
|
18
|
+
capability: grant.capability,
|
|
19
|
+
revoked: false,
|
|
20
|
+
issuedAt: now,
|
|
21
|
+
note: grant.note,
|
|
22
|
+
issuer: grant.issuer,
|
|
23
|
+
};
|
|
24
|
+
current.push(issued);
|
|
25
|
+
this.grants.set(grant.token, current);
|
|
26
|
+
return issued;
|
|
27
|
+
}
|
|
28
|
+
revokeBearerGrant(token, capability) {
|
|
29
|
+
const entries = this.grants.get(token) ?? [];
|
|
30
|
+
const now = Date.now();
|
|
31
|
+
let revoked = 0;
|
|
32
|
+
for (const entry of entries) {
|
|
33
|
+
if (entry.revoked)
|
|
34
|
+
continue;
|
|
35
|
+
if (capability && entry.capability !== capability)
|
|
36
|
+
continue;
|
|
37
|
+
entry.revoked = true;
|
|
38
|
+
entry.revokedAt = now;
|
|
39
|
+
revoked += 1;
|
|
40
|
+
}
|
|
41
|
+
return revoked;
|
|
42
|
+
}
|
|
43
|
+
resolveBearerToken(token) {
|
|
44
|
+
return (this.grants.get(token) ?? []).filter((entry) => !entry.revoked).map((entry) => entry.capability);
|
|
45
|
+
}
|
|
46
|
+
listBearerGrants() {
|
|
47
|
+
return Array.from(this.grants.values()).flatMap((entries) => entries.map((entry) => ({ ...entry })));
|
|
48
|
+
}
|
|
49
|
+
clear() {
|
|
50
|
+
this.grants.clear();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export function getZcapLikeAuthority(runtime) {
|
|
54
|
+
return runtime[ZCAP_LIKE_AUTHORITY];
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=zcap-like-authority.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zcap-like-authority.js","sourceRoot":"","sources":["../../src/lib/zcap-like-authority.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAoBvD,MAAM,OAAO,iBAAiB;IACrB,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAC;IAErD,gBAAgB,CAA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ChB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,KAAK,CAAC,OAAO;gBAAE,SAAS;YAC5B,IAAI,UAAU,IAAI,KAAK,CAAC,UAAU,KAAK,UAAU;gBAAE,SAAS;YAC5D,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;YACrB,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC;YACtB,OAAO,IAAI,CAAC,CAAC;QACd,CAAC;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,kBAAkB,CAAC,KAAa;QAC/B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC1G,CAAC;IAED,gBAAgB;QACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACD;AAED,MAAM,UAAU,oBAAoB,CAAC,OAAiB;IACrD,OAAO,OAAO,CAAC,mBAAmB,CAAmC,CAAC;AACvE,CAAC"}
|
package/build/monitor/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type THaibunEvent, type TArtifactEvent, type TImageArtifact, type TVideoArtifact, type THtmlArtifact, type TSpeechArtifact, type TJsonArtifact, type TMermaidArtifact, type THttpTraceArtifact, type TResolvedFeaturesArtifact, type TFileArtifact, type TRegisteredOutcomeEntry, type TPrompt, type THaibunLogLevel, type TIndication, HAIBUN_LOG_LEVELS, CHECK_YES, CHECK_NO, CHECK_YIELD, MAYBE_CHECK_YES, MAYBE_CHECK_NO, Timer, JITSerializer, EventFormatter, shortenURI, } from
|
|
1
|
+
export { type THaibunEvent, type TArtifactEvent, type TImageArtifact, type TVideoArtifact, type THtmlArtifact, type TSpeechArtifact, type TJsonArtifact, type TMermaidArtifact, type THttpTraceArtifact, type TResolvedFeaturesArtifact, type TFileArtifact, type TRegisteredOutcomeEntry, type TPrompt, type THaibunLogLevel, type TIndication, HAIBUN_LOG_LEVELS, CHECK_YES, CHECK_NO, CHECK_YIELD, MAYBE_CHECK_YES, MAYBE_CHECK_NO, Timer, JITSerializer, EventFormatter, shortenURI, } from "../schema/protocol.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/monitor/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/monitor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,EACf,cAAc,EACd,KAAK,EACL,aAAa,EACb,cAAc,EACd,UAAU,GACV,MAAM,uBAAuB,CAAC"}
|
package/build/monitor/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { HAIBUN_LOG_LEVELS, CHECK_YES, CHECK_NO, CHECK_YIELD, MAYBE_CHECK_YES, MAYBE_CHECK_NO, Timer, JITSerializer, EventFormatter, shortenURI, } from
|
|
1
|
+
export { HAIBUN_LOG_LEVELS, CHECK_YES, CHECK_NO, CHECK_YIELD, MAYBE_CHECK_YES, MAYBE_CHECK_NO, Timer, JITSerializer, EventFormatter, shortenURI, } from "../schema/protocol.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/monitor/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/monitor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAgBN,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,EACf,cAAc,EACd,KAAK,EACL,aAAa,EACb,cAAc,EACd,UAAU,GACV,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,26 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TExecutorResult,
|
|
3
|
-
import { AStepper } from
|
|
4
|
-
|
|
1
|
+
import { TResolvedFeature, TWorld } from "../lib/execution.js";
|
|
2
|
+
import { TExecutorResult, TFeatureResult, TSeqPath } from "../schema/protocol.js";
|
|
3
|
+
import { AStepper } from "../lib/astepper.js";
|
|
4
|
+
import { StepRegistry } from "../lib/step-dispatch.js";
|
|
5
|
+
export declare function calculateShouldClose({ thisFeatureOK, isLast, stayOnFailure, continueAfterError, stayAlways, }: {
|
|
5
6
|
thisFeatureOK: boolean;
|
|
6
7
|
isLast: boolean;
|
|
7
8
|
stayOnFailure: boolean;
|
|
8
9
|
continueAfterError: boolean;
|
|
9
10
|
stayAlways: boolean;
|
|
10
11
|
}): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Duck-typed attach() on every stepper that implements a transport
|
|
14
|
+
* (has `attach` and `detach` methods). Called from two places:
|
|
15
|
+
*
|
|
16
|
+
* - Executor, right after it creates world.runtime.stepRegistry,
|
|
17
|
+
* so any stepper transport is live before the first feature runs.
|
|
18
|
+
* This covers pure-client configs (e.g. agent with `{remote}`
|
|
19
|
+
* entry, no webserver).
|
|
20
|
+
*
|
|
21
|
+
* - WebServerStepper's `enable rpc` / `refresh steppers` steps,
|
|
22
|
+
* which create their own registry and must re-attach transports
|
|
23
|
+
* into it. Delegating here keeps both call sites consistent.
|
|
24
|
+
*
|
|
25
|
+
* The webserver argument is whatever the caller has. Core's Executor
|
|
26
|
+
* invocation passes undefined; transports that truly need a webserver
|
|
27
|
+
* (e.g. SSE adding routes) check and no-op when absent. Remote-proxy
|
|
28
|
+
* transports don't use it.
|
|
29
|
+
*/
|
|
30
|
+
export declare function attachTransportsToRegistry(steppers: AStepper[], registry: StepRegistry, webserver?: any): void;
|
|
11
31
|
export declare class Executor {
|
|
12
32
|
private static createExecutionFailure;
|
|
13
|
-
static action(steppers: AStepper[], featureStep: TFeatureStep, found: TStepAction, args: TStepArgs, world: TWorld): Promise<TActionResult>;
|
|
14
33
|
static executeFeatures(steppers: AStepper[], world: TWorld, features: TResolvedFeature[]): Promise<TExecutorResult>;
|
|
15
34
|
}
|
|
16
35
|
export declare class FeatureExecutor {
|
|
17
36
|
private steppers;
|
|
37
|
+
private registry;
|
|
18
38
|
private world;
|
|
19
39
|
private startOffset;
|
|
20
|
-
constructor(steppers: AStepper[], world: TWorld, startOffset?: number);
|
|
40
|
+
constructor(steppers: AStepper[], registry: StepRegistry, world: TWorld, startOffset?: number);
|
|
21
41
|
doFeature(feature: TResolvedFeature): Promise<TFeatureResult>;
|
|
22
|
-
static doFeatureStep(steppers: AStepper[], featureStep: TFeatureStep, world: TWorld, execMode?: ExecMode): Promise<TStepResult>;
|
|
23
42
|
}
|
|
43
|
+
export declare const addStepperConcerns: (world: TWorld, steppers: AStepper[]) => void;
|
|
44
|
+
export declare function syntheticSeqPathDirection(speculative?: boolean): 1 | -1;
|
|
45
|
+
export declare function featureSyntheticSeqPath(featureNum: number, ordinal: number, branch?: number, hostId?: number): TSeqPath;
|
|
46
|
+
export declare function syntheticBranchSeqPath(parentSeqPath: TSeqPath, dir?: 1 | -1): TSeqPath;
|
|
47
|
+
export declare function advanceSyntheticSeqPath(seqPath: TSeqPath, dir?: 1 | -1): TSeqPath;
|
|
24
48
|
export declare function incSeqPath(withSeqPath: {
|
|
25
49
|
seqPath: TSeqPath;
|
|
26
50
|
}[], seqPath: TSeqPath, dir?: number): TSeqPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Executor.d.ts","sourceRoot":"","sources":["../../src/phases/Executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Executor.d.ts","sourceRoot":"","sources":["../../src/phases/Executor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAsE,QAAQ,EAAsC,MAAM,uBAAuB,CAAC;AAC1L,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAgB,MAAM,yBAAyB,CAAC;AAOrE,wBAAgB,oBAAoB,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,UAAU,GAAG,EAAE;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAC;IAAC,kBAAkB,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;CAAE,WAMrO;AAcD;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,IAAI,CAO9G;AAED,qBAAa,QAAQ;IACpB,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