@haibun/core 3.1.3 → 3.4.0
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/applyEffectFeatures.d.ts +4 -0
- package/build/applyEffectFeatures.d.ts.map +1 -0
- package/build/applyEffectFeatures.js +34 -0
- package/build/applyEffectFeatures.js.map +1 -0
- package/build/currentVersion.d.ts +1 -1
- package/build/currentVersion.js +1 -1
- package/build/kireji/converter.d.ts +16 -1
- package/build/kireji/converter.d.ts.map +1 -1
- package/build/kireji/converter.js +19 -2
- package/build/kireji/converter.js.map +1 -1
- package/build/lib/EventLogger.d.ts +16 -10
- package/build/lib/EventLogger.d.ts.map +1 -1
- package/build/lib/EventLogger.js +54 -21
- package/build/lib/EventLogger.js.map +1 -1
- package/build/lib/Logger.d.ts +0 -2
- package/build/lib/Logger.d.ts.map +1 -1
- package/build/lib/Logger.js +5 -10
- package/build/lib/Logger.js.map +1 -1
- package/build/lib/TestLogger.d.ts +0 -1
- package/build/lib/TestLogger.d.ts.map +1 -1
- package/build/lib/TestLogger.js +0 -1
- package/build/lib/TestLogger.js.map +1 -1
- package/build/lib/astepper.d.ts +6 -0
- package/build/lib/astepper.d.ts.map +1 -1
- package/build/lib/astepper.js +1 -0
- package/build/lib/astepper.js.map +1 -1
- package/build/lib/base-prompt-manager.d.ts.map +1 -1
- package/build/lib/base-prompt-manager.js +2 -2
- 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 +4 -2
- package/build/lib/capture-locator.js.map +1 -1
- package/build/lib/core/flow-runner.d.ts +5 -4
- package/build/lib/core/flow-runner.d.ts.map +1 -1
- package/build/lib/core/flow-runner.js +51 -16
- package/build/lib/core/flow-runner.js.map +1 -1
- package/build/lib/core-domains.d.ts +1 -1
- package/build/lib/core-domains.d.ts.map +1 -1
- package/build/lib/core-domains.js +7 -2
- package/build/lib/core-domains.js.map +1 -1
- package/build/lib/defs.d.ts +105 -200
- package/build/lib/defs.d.ts.map +1 -1
- package/build/lib/defs.js +4 -46
- package/build/lib/defs.js.map +1 -1
- package/build/lib/domain-types.d.ts +1 -0
- package/build/lib/domain-types.d.ts.map +1 -1
- package/build/lib/domain-types.js +2 -1
- package/build/lib/domain-types.js.map +1 -1
- package/build/lib/feature-variables.d.ts +56 -4
- package/build/lib/feature-variables.d.ts.map +1 -1
- package/build/lib/feature-variables.js +140 -9
- package/build/lib/feature-variables.js.map +1 -1
- package/build/lib/features.d.ts +5 -4
- package/build/lib/features.d.ts.map +1 -1
- package/build/lib/features.js +26 -16
- package/build/lib/features.js.map +1 -1
- package/build/lib/fixme.d.ts +1 -1
- package/build/lib/fixme.d.ts.map +1 -1
- package/build/lib/http-observations.d.ts +25 -0
- package/build/lib/http-observations.d.ts.map +1 -0
- package/build/lib/http-observations.js +59 -0
- package/build/lib/http-observations.js.map +1 -0
- package/build/lib/interfaces/logger.d.ts +3 -21
- package/build/lib/interfaces/logger.d.ts.map +1 -1
- package/build/lib/interfaces/logger.js +0 -11
- package/build/lib/interfaces/logger.js.map +1 -1
- package/build/lib/namedVars.d.ts +5 -1
- package/build/lib/namedVars.d.ts.map +1 -1
- package/build/lib/namedVars.js +11 -1
- package/build/lib/namedVars.js.map +1 -1
- package/build/lib/node-http-events.d.ts +16 -0
- package/build/lib/node-http-events.d.ts.map +1 -0
- package/build/lib/node-http-events.js +125 -0
- package/build/lib/node-http-events.js.map +1 -0
- package/build/lib/populateActionArgs.d.ts +2 -1
- package/build/lib/populateActionArgs.d.ts.map +1 -1
- package/build/lib/populateActionArgs.js.map +1 -1
- package/build/lib/prompter.d.ts.map +1 -1
- package/build/lib/prompter.js +4 -0
- package/build/lib/prompter.js.map +1 -1
- package/build/lib/quad-store.d.ts +17 -0
- package/build/lib/quad-store.d.ts.map +1 -0
- package/build/lib/quad-store.js +60 -0
- package/build/lib/quad-store.js.map +1 -0
- package/build/lib/quad-types.d.ts +33 -0
- package/build/lib/quad-types.d.ts.map +1 -0
- package/build/lib/quad-types.js +7 -0
- package/build/lib/quad-types.js.map +1 -0
- package/build/lib/resolver-features.d.ts +2 -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/stepper-registry.d.ts +28 -0
- package/build/lib/stepper-registry.d.ts.map +1 -0
- package/build/lib/stepper-registry.js +42 -0
- package/build/lib/stepper-registry.js.map +1 -0
- package/build/lib/test/SetTimeStepper.d.ts +2 -2
- package/build/lib/test/SetTimeStepper.d.ts.map +1 -1
- package/build/lib/test/SetTimeStepper.js +1 -1
- package/build/lib/test/SetTimeStepper.js.map +1 -1
- package/build/lib/test/TestSteps.d.ts +5 -3
- package/build/lib/test/TestSteps.d.ts.map +1 -1
- package/build/lib/test/TestStepsWithOptions.d.ts +3 -1
- package/build/lib/test/TestStepsWithOptions.d.ts.map +1 -1
- package/build/lib/test/TestStepsWithOptions.js +3 -5
- package/build/lib/test/TestStepsWithOptions.js.map +1 -1
- package/build/lib/test/lib.d.ts +4 -3
- package/build/lib/test/lib.d.ts.map +1 -1
- package/build/lib/test/lib.js +12 -12
- package/build/lib/test/lib.js.map +1 -1
- package/build/lib/test/resolvedTestFeatures.d.ts +5 -5
- package/build/lib/test/resolvedTestFeatures.js +1 -1
- package/build/lib/test/resolvedTestFeatures.js.map +1 -1
- package/build/lib/ttag.d.ts +2 -2
- package/build/lib/ttag.d.ts.map +1 -1
- package/build/lib/ttag.js +5 -5
- package/build/lib/ttag.js.map +1 -1
- package/build/lib/util/featureStep-executor.d.ts +6 -0
- package/build/lib/util/featureStep-executor.d.ts.map +1 -0
- package/build/lib/util/featureStep-executor.js +39 -0
- package/build/lib/util/featureStep-executor.js.map +1 -0
- package/build/lib/util/index.d.ts +20 -12
- package/build/lib/util/index.d.ts.map +1 -1
- package/build/lib/util/index.js +53 -17
- package/build/lib/util/index.js.map +1 -1
- package/build/lib/workspace-discovery.d.ts +37 -0
- package/build/lib/workspace-discovery.d.ts.map +1 -0
- package/build/lib/workspace-discovery.js +96 -0
- package/build/lib/workspace-discovery.js.map +1 -0
- package/build/monitor/index.d.ts +1 -10
- package/build/monitor/index.d.ts.map +1 -1
- package/build/monitor/index.js +1 -14
- package/build/monitor/index.js.map +1 -1
- package/build/phases/Executor.d.ts +10 -11
- package/build/phases/Executor.d.ts.map +1 -1
- package/build/phases/Executor.js +96 -178
- package/build/phases/Executor.js.map +1 -1
- package/build/phases/Resolver.d.ts +25 -1
- package/build/phases/Resolver.d.ts.map +1 -1
- package/build/phases/Resolver.js +88 -22
- package/build/phases/Resolver.js.map +1 -1
- package/build/phases/collector.d.ts +1 -0
- package/build/phases/collector.d.ts.map +1 -1
- package/build/phases/collector.js +7 -3
- package/build/phases/collector.js.map +1 -1
- package/build/runner.d.ts +3 -2
- package/build/runner.d.ts.map +1 -1
- package/build/runner.js +0 -1
- package/build/runner.js.map +1 -1
- package/build/schema/protocol.d.ts +1443 -0
- package/build/schema/protocol.d.ts.map +1 -0
- package/build/schema/protocol.js +434 -0
- package/build/schema/protocol.js.map +1 -0
- package/build/steps/activities-stepper.d.ts +24 -28
- package/build/steps/activities-stepper.d.ts.map +1 -1
- package/build/steps/activities-stepper.js +150 -162
- package/build/steps/activities-stepper.js.map +1 -1
- package/build/steps/conformance.d.ts +3 -1
- package/build/steps/conformance.d.ts.map +1 -1
- package/build/steps/conformance.js +1 -0
- package/build/steps/conformance.js.map +1 -1
- package/build/steps/console-monitor-stepper.d.ts +3 -6
- package/build/steps/console-monitor-stepper.d.ts.map +1 -1
- package/build/steps/console-monitor-stepper.js +23 -64
- package/build/steps/console-monitor-stepper.js.map +1 -1
- package/build/steps/debugger-stepper.d.ts +7 -4
- package/build/steps/debugger-stepper.d.ts.map +1 -1
- package/build/steps/debugger-stepper.js +36 -43
- package/build/steps/debugger-stepper.js.map +1 -1
- package/build/steps/haibun.d.ts +29 -17
- package/build/steps/haibun.d.ts.map +1 -1
- package/build/steps/haibun.js +90 -38
- package/build/steps/haibun.js.map +1 -1
- package/build/steps/lib/tts.d.ts +2 -3
- package/build/steps/lib/tts.d.ts.map +1 -1
- package/build/steps/lib/tts.js +4 -5
- package/build/steps/lib/tts.js.map +1 -1
- package/build/steps/logic-stepper.d.ts +27 -3
- package/build/steps/logic-stepper.d.ts.map +1 -1
- package/build/steps/logic-stepper.js +132 -19
- package/build/steps/logic-stepper.js.map +1 -1
- package/build/steps/narrator.d.ts +7 -5
- package/build/steps/narrator.d.ts.map +1 -1
- package/build/steps/narrator.js +30 -18
- package/build/steps/narrator.js.map +1 -1
- package/build/steps/parse.d.ts +2 -2
- package/build/steps/variables-stepper.d.ts +285 -4
- package/build/steps/variables-stepper.d.ts.map +1 -1
- package/build/steps/variables-stepper.js +45 -59
- package/build/steps/variables-stepper.js.map +1 -1
- package/package.json +9 -16
- package/build/lib/core/protocol.d.ts +0 -58
- package/build/lib/core/protocol.d.ts.map +0 -1
- package/build/lib/core/protocol.js +0 -18
- package/build/lib/core/protocol.js.map +0 -1
- package/build/lib/event-bridge.d.ts +0 -42
- package/build/lib/event-bridge.d.ts.map +0 -1
- package/build/lib/event-bridge.js +0 -214
- package/build/lib/event-bridge.js.map +0 -1
- package/build/lib/util/variables.d.ts +0 -9
- package/build/lib/util/variables.d.ts.map +0 -1
- package/build/lib/util/variables.js +0 -40
- package/build/lib/util/variables.js.map +0 -1
- package/build/monitor/browser-stubs.d.ts +0 -12
- package/build/monitor/browser-stubs.d.ts.map +0 -1
- package/build/monitor/browser-stubs.js +0 -20
- package/build/monitor/browser-stubs.js.map +0 -1
- package/build/monitor/constants.d.ts +0 -9
- package/build/monitor/constants.d.ts.map +0 -1
- package/build/monitor/constants.js +0 -9
- package/build/monitor/constants.js.map +0 -1
- package/build/monitor/event-view.d.ts +0 -40
- package/build/monitor/event-view.d.ts.map +0 -1
- package/build/monitor/event-view.js +0 -104
- package/build/monitor/event-view.js.map +0 -1
- package/build/monitor/filters.d.ts +0 -17
- package/build/monitor/filters.d.ts.map +0 -1
- package/build/monitor/filters.js +0 -32
- package/build/monitor/filters.js.map +0 -1
- package/build/monitor/formatters.d.ts +0 -27
- package/build/monitor/formatters.d.ts.map +0 -1
- package/build/monitor/formatters.js +0 -89
- package/build/monitor/formatters.js.map +0 -1
- package/build/monitor/jit-serialization.d.ts +0 -9
- package/build/monitor/jit-serialization.d.ts.map +0 -1
- package/build/monitor/jit-serialization.js +0 -73
- package/build/monitor/jit-serialization.js.map +0 -1
- package/build/monitor/monitor-types.d.ts +0 -119
- package/build/monitor/monitor-types.d.ts.map +0 -1
- package/build/monitor/monitor-types.js +0 -43
- package/build/monitor/monitor-types.js.map +0 -1
- package/build/monitor/speculative-tracker.d.ts +0 -20
- package/build/monitor/speculative-tracker.d.ts.map +0 -1
- package/build/monitor/speculative-tracker.js +0 -38
- package/build/monitor/speculative-tracker.js.map +0 -1
- package/build/monitor/state.d.ts +0 -31
- package/build/monitor/state.d.ts.map +0 -1
- package/build/monitor/state.js +0 -110
- package/build/monitor/state.js.map +0 -1
- package/build/monitor/timer.d.ts +0 -11
- package/build/monitor/timer.d.ts.map +0 -1
- package/build/monitor/timer.js +0 -13
- package/build/monitor/timer.js.map +0 -1
- package/build/monitor/tree-builder.d.ts +0 -25
- package/build/monitor/tree-builder.d.ts.map +0 -1
- package/build/monitor/tree-builder.js +0 -36
- package/build/monitor/tree-builder.js.map +0 -1
- package/build/schema/events.d.ts +0 -426
- package/build/schema/events.d.ts.map +0 -1
- package/build/schema/events.js +0 -123
- package/build/schema/events.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/core/flow-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAsB,MAAM,
|
|
1
|
+
{"version":3,"file":"flow-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/core/flow-run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
13
13
|
const { intent = { mode: 'authoritative' } } = options;
|
|
14
|
+
const stmtText = typeof statement === 'string' ? statement : statement.in;
|
|
14
15
|
// Merge parent runtimeArgs with current args (current takes precedence)
|
|
15
16
|
// This enables nested quantifiers: outer vars are visible to inner statements
|
|
16
17
|
const allArgs = { ...options.parentStep?.runtimeArgs, ...options.args };
|
|
17
18
|
// Interpolate {varName} patterns using merged args
|
|
18
|
-
let statementWithArgs =
|
|
19
|
+
let statementWithArgs = stmtText;
|
|
19
20
|
if (Object.keys(allArgs).length > 0) {
|
|
20
21
|
for (const [key, value] of Object.entries(allArgs)) {
|
|
21
22
|
statementWithArgs = statementWithArgs.replace(new RegExp(`\\{${key}\\}`, 'g'), value);
|
|
22
23
|
}
|
|
23
24
|
}
|
|
25
|
+
// Resolve the action first - this gives us access to step metadata including source
|
|
24
26
|
let action;
|
|
25
27
|
try {
|
|
26
28
|
action = this.resolver.findSingleStepAction(statementWithArgs);
|
|
27
29
|
}
|
|
28
30
|
catch (e) {
|
|
29
31
|
if (intent.mode === 'speculative') {
|
|
30
|
-
return { kind: 'fail', message: e.message };
|
|
32
|
+
return { kind: 'fail', message: e instanceof Error ? e.message : String(e) };
|
|
31
33
|
}
|
|
32
34
|
throw e;
|
|
33
35
|
}
|
|
36
|
+
// Derive source path: prefer resolved step's source, then parentStep, then input statement
|
|
37
|
+
const step = action.step;
|
|
38
|
+
let resolvedPath;
|
|
39
|
+
let resolvedLineNumber;
|
|
40
|
+
if (step?.source?.path) {
|
|
41
|
+
// Step definition has its own source (e.g., activity, waypoint)
|
|
42
|
+
resolvedPath = step.source.path;
|
|
43
|
+
resolvedLineNumber = step.source.lineNumber;
|
|
44
|
+
}
|
|
45
|
+
else if (options.parentStep?.source?.path) {
|
|
46
|
+
// Fall back to parent step's source (e.g., quantifier calling nested statement)
|
|
47
|
+
resolvedPath = options.parentStep.source.path;
|
|
48
|
+
resolvedLineNumber = options.parentStep.source.lineNumber;
|
|
49
|
+
}
|
|
50
|
+
else if (typeof statement !== 'string' && statement.source?.path) {
|
|
51
|
+
// Use input statement's source if provided
|
|
52
|
+
resolvedPath = statement.source.path;
|
|
53
|
+
resolvedLineNumber = statement.source.lineNumber;
|
|
54
|
+
}
|
|
55
|
+
else if (this.world.runtime.currentFeaturePath) {
|
|
56
|
+
// Fall back to current feature path (e.g., debugger executing ad-hoc statements)
|
|
57
|
+
resolvedPath = this.world.runtime.currentFeaturePath;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
// No source available - use placeholder for dynamic/ad-hoc statements (debugger, REPL, etc.)
|
|
61
|
+
resolvedPath = '<dynamic>';
|
|
62
|
+
}
|
|
63
|
+
// Compute seqPath for this statement
|
|
34
64
|
let seqPath = options.seqPath;
|
|
35
65
|
if (!seqPath) {
|
|
36
66
|
if (options.parentStep) {
|
|
37
67
|
seqPath = incSeqPath(this.world.runtime.stepResults, [...options.parentStep.seqPath, 1], 1);
|
|
38
68
|
}
|
|
39
69
|
else {
|
|
40
|
-
throw new Error(`runStatement requires seqPath or parentStep. Statement: ${
|
|
70
|
+
throw new Error(`runStatement requires seqPath or parentStep. Statement: ${stmtText}`);
|
|
41
71
|
}
|
|
42
72
|
}
|
|
43
73
|
// Merge parent args with current args (current takes precedence)
|
|
44
74
|
const mergedArgs = { ...options.parentStep?.runtimeArgs, ...options.args };
|
|
45
75
|
const featureStep = {
|
|
46
|
-
|
|
76
|
+
source: {
|
|
77
|
+
path: resolvedPath,
|
|
78
|
+
lineNumber: resolvedLineNumber,
|
|
79
|
+
},
|
|
47
80
|
in: statementWithArgs,
|
|
48
81
|
seqPath,
|
|
49
82
|
action,
|
|
50
83
|
intent,
|
|
51
84
|
isSubStep: !!options.parentStep,
|
|
85
|
+
// Propagate isAfterEveryStep from parent to prevent afterEvery recursion
|
|
86
|
+
isAfterEveryStep: options.parentStep?.isAfterEveryStep,
|
|
52
87
|
runtimeArgs: Object.keys(mergedArgs).length > 0 ? mergedArgs : undefined
|
|
53
88
|
};
|
|
54
89
|
let result;
|
|
@@ -57,16 +92,16 @@ export class FlowRunner {
|
|
|
57
92
|
}
|
|
58
93
|
catch (e) {
|
|
59
94
|
if (intent.mode === 'speculative') {
|
|
60
|
-
return { kind: 'fail', message: e.message };
|
|
95
|
+
return { kind: 'fail', message: e instanceof Error ? e.message : String(e) };
|
|
61
96
|
}
|
|
62
97
|
throw e;
|
|
63
98
|
}
|
|
64
99
|
if (result.ok) {
|
|
65
|
-
return { kind: 'ok',
|
|
100
|
+
return { kind: 'ok', topics: result.stepActionResult };
|
|
66
101
|
}
|
|
67
102
|
else {
|
|
68
103
|
const msg = result.stepActionResult.message;
|
|
69
|
-
return { kind: 'fail', message: msg,
|
|
104
|
+
return { kind: 'fail', message: msg, topics: result.stepActionResult };
|
|
70
105
|
}
|
|
71
106
|
}
|
|
72
107
|
async runStatements(statements, options = {}) {
|
|
@@ -78,7 +113,7 @@ export class FlowRunner {
|
|
|
78
113
|
}
|
|
79
114
|
lastResult = result;
|
|
80
115
|
}
|
|
81
|
-
return { kind: 'ok',
|
|
116
|
+
return { kind: 'ok', topics: lastResult?.topics };
|
|
82
117
|
}
|
|
83
118
|
async runSteps(steps, options = {}) {
|
|
84
119
|
const { intent = { mode: 'authoritative' }, parentStep } = options;
|
|
@@ -96,7 +131,7 @@ export class FlowRunner {
|
|
|
96
131
|
const baseSeqPath = [...parentStep.seqPath, 1];
|
|
97
132
|
const dir = intent.mode === 'speculative' ? -1 : 1;
|
|
98
133
|
const seqPath = incSeqPath(this.world.runtime.stepResults, baseSeqPath, dir);
|
|
99
|
-
mappedStep = { ...mappedStep, seqPath, isSubStep: true };
|
|
134
|
+
mappedStep = { ...mappedStep, seqPath, isSubStep: true, isAfterEveryStep: parentStep.isAfterEveryStep || mappedStep.isAfterEveryStep };
|
|
100
135
|
}
|
|
101
136
|
let result;
|
|
102
137
|
try {
|
|
@@ -104,10 +139,14 @@ export class FlowRunner {
|
|
|
104
139
|
}
|
|
105
140
|
catch (e) {
|
|
106
141
|
if (intent.mode === 'speculative') {
|
|
107
|
-
return { kind: 'fail', message: e.message };
|
|
142
|
+
return { kind: 'fail', message: e instanceof Error ? e.message : String(e) };
|
|
108
143
|
}
|
|
109
144
|
throw e;
|
|
110
145
|
}
|
|
146
|
+
if (!result.ok) {
|
|
147
|
+
const msg = result.stepActionResult.message;
|
|
148
|
+
return { kind: 'fail', message: msg, topics: result.stepActionResult };
|
|
149
|
+
}
|
|
111
150
|
// If not using cycles (which doFeatureStep defaults to WITH_CYCLES), we might need to push results.
|
|
112
151
|
// But doFeatureStep pushes results if WITH_CYCLES.
|
|
113
152
|
// If we are in speculative mode, doFeatureStep might still push results if we don't change execMode.
|
|
@@ -116,13 +155,9 @@ export class FlowRunner {
|
|
|
116
155
|
// If we want to avoid polluting stepResults in speculative mode, we might need to adjust FeatureExecutor or pass a flag.
|
|
117
156
|
// But for now, to ensure incSeqPath works, we NEED results in stepResults.
|
|
118
157
|
// So we accept that speculative steps might be in stepResults (which is probably fine for debugging).
|
|
119
|
-
|
|
120
|
-
const msg = result.stepActionResult.message;
|
|
121
|
-
return { kind: 'fail', message: msg, payload: result.stepActionResult };
|
|
122
|
-
}
|
|
123
|
-
lastResult = { kind: 'ok', payload: result.stepActionResult };
|
|
158
|
+
lastResult = { kind: 'ok', topics: result.stepActionResult };
|
|
124
159
|
}
|
|
125
|
-
return { kind: 'ok',
|
|
160
|
+
return { kind: 'ok', topics: lastResult?.topics };
|
|
126
161
|
}
|
|
127
162
|
}
|
|
128
163
|
//# sourceMappingURL=flow-runner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-runner.js","sourceRoot":"","sources":["../../../src/lib/core/flow-runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-runner.js","sourceRoot":"","sources":["../../../src/lib/core/flow-runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,UAAU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M,GAAG,GAAI,MAAM,CAAC,gBAAuC,CAAC,OAAO,CAAC;gBACpE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC;YACxE,CAAC;YAED,oGAAoG;YACpG,mDAAmD;YACnD,qGAAqG;YACrG,2FAA2F;YAC3F,yCAAyC;YACzC,yHAAyH;YACzH,2EAA2E;YAC3E,sGAAsG;YAEtG,UAAU,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC9D,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IACnD,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-domains.d.ts","sourceRoot":"","sources":["../../src/lib/core-domains.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"core-domains.d.ts","sourceRoot":"","sources":["../../src/lib/core-domains.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmC,MAAM,EAAE,MAAM,WAAW,CAAC;AAgEpE,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,0DAA6D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DOMAIN_DATE, DOMAIN_JSON, DOMAIN_NUMBER, DOMAIN_STATEMENT, DOMAIN_STRING, mapDefinitionsToDomains } from './domain-types.js';
|
|
2
|
+
import { DOMAIN_DATE, DOMAIN_JSON, DOMAIN_LINK, DOMAIN_NUMBER, DOMAIN_STATEMENT, DOMAIN_STRING, mapDefinitionsToDomains } from './domain-types.js';
|
|
3
3
|
import { findFeatureStepsFromStatement } from "../phases/Resolver.js";
|
|
4
4
|
const numberSchema = z.coerce.number({ error: 'invalid number' })
|
|
5
5
|
.refine((value) => Number.isFinite(value), 'invalid number');
|
|
@@ -13,6 +13,11 @@ const getCoreDomainDefinitions = (world) => ([
|
|
|
13
13
|
schema: stringSchema,
|
|
14
14
|
description: 'Plain string literal captured from feature text.'
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
selectors: [DOMAIN_LINK],
|
|
18
|
+
schema: stringSchema,
|
|
19
|
+
description: 'URI string representing a navigable link.'
|
|
20
|
+
},
|
|
16
21
|
{
|
|
17
22
|
selectors: [DOMAIN_NUMBER],
|
|
18
23
|
schema: numberSchema,
|
|
@@ -49,7 +54,7 @@ const getCoreDomainDefinitions = (world) => ([
|
|
|
49
54
|
}
|
|
50
55
|
const label = statementSchema.parse(proto.value);
|
|
51
56
|
const seqStart = featureStep.seqPath;
|
|
52
|
-
return findFeatureStepsFromStatement(label, steppers, world, featureStep.path, [...seqStart, 0], -1);
|
|
57
|
+
return findFeatureStepsFromStatement(label, steppers, world, featureStep.source.path, [...seqStart, 0], -1);
|
|
53
58
|
}
|
|
54
59
|
},
|
|
55
60
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-domains.js","sourceRoot":"","sources":["../../src/lib/core-domains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"core-domains.js","sourceRoot":"","sources":["../../src/lib/core-domains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACnJ,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAEtE,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;KAC/D,MAAM,CAAC,CAAC,KAAK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aces/logger.js';
|
|
3
2
|
import { TAnyFixme } from './fixme.js';
|
|
4
|
-
import { Timer } from './Timer.js';
|
|
5
3
|
import { TTag } from './ttag.js';
|
|
6
4
|
import { FeatureVariables } from './feature-variables.js';
|
|
7
5
|
import { Prompter } from './prompter.js';
|
|
6
|
+
import { IEventLogger } from './EventLogger.js';
|
|
8
7
|
import type { ZodTypeAny } from 'zod';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
import { ExecutionIntent, TSeqPath, TStepResult, TFeatureResult, TExecutorResult, TStepActionResult, TStepArgs, TStepValueValue, TStepValue, Timer, THaibunEvent, TActionResult, CONTINUE_AFTER_ERROR } from '../schema/protocol.js';
|
|
9
|
+
export type TWorld = {
|
|
10
|
+
tag: TTag;
|
|
11
|
+
shared: FeatureVariables;
|
|
12
|
+
runtime: TRuntime;
|
|
13
|
+
prompter: Prompter;
|
|
14
|
+
options: TBaseOptions;
|
|
15
|
+
moduleOptions: TModuleOptions;
|
|
16
|
+
timer: Timer;
|
|
17
|
+
bases: TBase;
|
|
18
|
+
domains: Record<string, TRegisteredDomain>;
|
|
19
|
+
eventLogger: IEventLogger;
|
|
20
|
+
};
|
|
21
|
+
export type TRuntime = {
|
|
22
|
+
backgrounds?: TFeature[];
|
|
23
|
+
scenario?: string;
|
|
24
|
+
feature?: string;
|
|
25
|
+
/** Current feature file path (for dynamic statement execution) */
|
|
26
|
+
currentFeaturePath?: string;
|
|
27
|
+
stepResults: TStepResult[];
|
|
28
|
+
/** Generic storage for observation data, cleared between features */
|
|
29
|
+
observations: Map<string, TAnyFixme>;
|
|
30
|
+
/** If non-empty, execution was aborted due to exhaustion (description explains why). */
|
|
31
|
+
exhaustionError?: string;
|
|
32
|
+
[name: string]: TAnyFixme;
|
|
20
33
|
};
|
|
21
34
|
export type TBaseOptions = {
|
|
22
35
|
DEST: string;
|
|
@@ -33,7 +46,6 @@ export type TBaseOptions = {
|
|
|
33
46
|
export type TEnvVariables = {
|
|
34
47
|
[name: string]: string;
|
|
35
48
|
};
|
|
36
|
-
export type TOptionValue = TAnyFixme;
|
|
37
49
|
export type TModuleOptions = {
|
|
38
50
|
[name: string]: string;
|
|
39
51
|
};
|
|
@@ -42,18 +54,15 @@ export type TProtoOptions = {
|
|
|
42
54
|
moduleOptions: TModuleOptions;
|
|
43
55
|
};
|
|
44
56
|
export type TBase = string[];
|
|
45
|
-
export type
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
bases: TBase;
|
|
55
|
-
domains: Record<string, TRegisteredDomain>;
|
|
56
|
-
eventLogger: IEventLogger;
|
|
57
|
+
export type TSpecl = {
|
|
58
|
+
steppers: string[];
|
|
59
|
+
refs?: {
|
|
60
|
+
docs: {
|
|
61
|
+
[name: string]: {
|
|
62
|
+
src: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
57
66
|
};
|
|
58
67
|
export type TFeatureMeta = {
|
|
59
68
|
base: string;
|
|
@@ -61,37 +70,56 @@ export type TFeatureMeta = {
|
|
|
61
70
|
path: string;
|
|
62
71
|
};
|
|
63
72
|
export type TFeature = TFeatureMeta & {
|
|
64
|
-
name: string;
|
|
65
73
|
content: string;
|
|
74
|
+
/** For kireji files: maps BDD line number (1-indexed) to TypeScript step index (0-indexed) */
|
|
75
|
+
kirejiLineMap?: Map<number, number>;
|
|
66
76
|
};
|
|
77
|
+
export type TFeatures = TFeature[];
|
|
67
78
|
export type TExpandedFeature = TFeatureMeta & {
|
|
68
|
-
name: string;
|
|
69
79
|
expanded: TExpandedLine[];
|
|
70
80
|
};
|
|
71
81
|
export type TExpandedLine = {
|
|
72
82
|
line: string;
|
|
83
|
+
rawLine?: string;
|
|
84
|
+
lineNumber?: number;
|
|
73
85
|
feature: TFeature;
|
|
74
86
|
};
|
|
75
|
-
export
|
|
87
|
+
export interface TSourceLocation {
|
|
88
|
+
source: {
|
|
89
|
+
/** Absolute path to the source file */
|
|
90
|
+
path: string;
|
|
91
|
+
/** 1-indexed line number in the source file */
|
|
92
|
+
lineNumber?: number;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** A statement with its source location */
|
|
96
|
+
export type TStepInput = TSourceLocation & {
|
|
97
|
+
in: string;
|
|
98
|
+
};
|
|
76
99
|
export type TResolvedFeature = {
|
|
77
100
|
path: string;
|
|
78
101
|
base: string;
|
|
79
102
|
name: string;
|
|
80
103
|
featureSteps: TFeatureStep[];
|
|
81
104
|
};
|
|
82
|
-
export type TFeatureStep = {
|
|
83
|
-
path: string;
|
|
105
|
+
export type TFeatureStep = TSourceLocation & {
|
|
84
106
|
in: string;
|
|
85
107
|
seqPath: TSeqPath;
|
|
86
108
|
action: TStepAction;
|
|
87
109
|
isSubStep?: boolean;
|
|
110
|
+
/** True if this step was triggered by an afterEvery hook (prevents recursive afterEvery) */
|
|
111
|
+
isAfterEveryStep?: boolean;
|
|
88
112
|
intent?: ExecutionIntent;
|
|
89
113
|
/** Runtime args for variable binding in nested quantifier calls */
|
|
90
114
|
runtimeArgs?: Record<string, string>;
|
|
91
115
|
};
|
|
92
|
-
export type
|
|
93
|
-
|
|
94
|
-
|
|
116
|
+
export type TStepAction = {
|
|
117
|
+
actionName: string;
|
|
118
|
+
stepperName: string;
|
|
119
|
+
step: TStepperStep;
|
|
120
|
+
stepValuesMap?: TStepValuesMap;
|
|
121
|
+
};
|
|
122
|
+
export type TStepValuesMap = Record<string, TStepValue>;
|
|
95
123
|
export type TStepperStep = {
|
|
96
124
|
handlesUndefined?: true | string[];
|
|
97
125
|
description?: string;
|
|
@@ -100,18 +128,53 @@ export type TStepperStep = {
|
|
|
100
128
|
fallback?: boolean;
|
|
101
129
|
expose?: boolean;
|
|
102
130
|
virtual?: boolean;
|
|
131
|
+
/** For dynamically generated steps (like waypoints): source location metadata */
|
|
132
|
+
source?: {
|
|
133
|
+
path: string;
|
|
134
|
+
lineNumber?: number;
|
|
135
|
+
};
|
|
103
136
|
match?: RegExp;
|
|
104
137
|
gwta?: string;
|
|
105
138
|
exact?: string;
|
|
106
|
-
resolveFeatureLine?(line: string, path: string, stepper: AStepper, backgrounds: TFeatures, allLines?: string[], lineIndex?: number): boolean | void;
|
|
139
|
+
resolveFeatureLine?(line: string, path: string, stepper: AStepper, backgrounds: TFeatures, allLines?: string[], lineIndex?: number, actualSourcePath?: string): boolean | void;
|
|
107
140
|
action(args: TStepArgs, featureStep?: TFeatureStep): Promise<TActionResult> | TActionResult;
|
|
108
141
|
};
|
|
109
142
|
export interface CStepper {
|
|
110
143
|
new (): AStepper;
|
|
111
144
|
}
|
|
112
|
-
export
|
|
113
|
-
|
|
114
|
-
|
|
145
|
+
export interface IStepperWhen {
|
|
146
|
+
startExecution?: number;
|
|
147
|
+
startFeature?: number;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Observation source for the 'observed in' quantifier pattern.
|
|
151
|
+
* Provides ephemeral iteration over runtime metrics.
|
|
152
|
+
*/
|
|
153
|
+
export interface IObservationSource {
|
|
154
|
+
name: string;
|
|
155
|
+
observe(world: TWorld): {
|
|
156
|
+
items: string[];
|
|
157
|
+
metrics: Record<string, Record<string, unknown>>;
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
export interface IStepperConcerns {
|
|
161
|
+
domains?: TDomainDefinition[];
|
|
162
|
+
sources?: IObservationSource[];
|
|
163
|
+
}
|
|
164
|
+
export interface IStepperCycles {
|
|
165
|
+
getConcerns?(): IStepperConcerns;
|
|
166
|
+
startExecution?(features: TStartExecution): Promise<void> | void;
|
|
167
|
+
startFeature?(startFeature: TStartFeature): Promise<void> | void;
|
|
168
|
+
startScenario?(startScenario: TStartScenario): Promise<void>;
|
|
169
|
+
beforeStep?(beforeStep: TBeforeStep): Promise<void>;
|
|
170
|
+
afterStep?(afterStep: TAfterStep): Promise<TAfterStepResult>;
|
|
171
|
+
endScenario?(): Promise<void>;
|
|
172
|
+
endFeature?(endedWith?: TEndFeature): Promise<void>;
|
|
173
|
+
onFailure?(result: TFailureArgs): Promise<void>;
|
|
174
|
+
endExecution?(results: TExecutorResult): Promise<void>;
|
|
175
|
+
onEvent?(event: THaibunEvent): Promise<void> | void;
|
|
176
|
+
}
|
|
177
|
+
export type TStartExecution = TResolvedFeature[];
|
|
115
178
|
export type TEndFeature = {
|
|
116
179
|
shouldClose: boolean;
|
|
117
180
|
isLast: boolean;
|
|
@@ -124,7 +187,6 @@ export type TStartFeature = {
|
|
|
124
187
|
resolvedFeature: TResolvedFeature;
|
|
125
188
|
index: number;
|
|
126
189
|
};
|
|
127
|
-
export type TStartExecution = TResolvedFeature[];
|
|
128
190
|
export type TStartScenario = {
|
|
129
191
|
scopedVars: FeatureVariables;
|
|
130
192
|
};
|
|
@@ -144,23 +206,6 @@ export type TAfterStepResult = {
|
|
|
144
206
|
nextStep?: boolean;
|
|
145
207
|
failed: boolean;
|
|
146
208
|
};
|
|
147
|
-
export interface IStepperCycles {
|
|
148
|
-
getDomains?(): TDomainDefinition[];
|
|
149
|
-
startExecution?(features: TStartExecution): Promise<void> | void;
|
|
150
|
-
startFeature?(startFeature: TStartFeature): Promise<void> | void;
|
|
151
|
-
startScenario?(startScenario: TStartScenario): Promise<void>;
|
|
152
|
-
beforeStep?(beforeStep: TBeforeStep): Promise<void>;
|
|
153
|
-
afterStep?(afterStep: TAfterStep): Promise<TAfterStepResult>;
|
|
154
|
-
endScenario?(): Promise<void>;
|
|
155
|
-
endFeature?(endedWith?: TEndFeature): Promise<void>;
|
|
156
|
-
onFailure?(result: TFailureArgs): Promise<void | TMessageContext>;
|
|
157
|
-
endExecution?(results: TExecutorResult): Promise<void>;
|
|
158
|
-
onEvent?(event: THaibunEvent): Promise<void> | void;
|
|
159
|
-
}
|
|
160
|
-
export interface IStepperWhen {
|
|
161
|
-
startExecution?: number;
|
|
162
|
-
startFeature?: number;
|
|
163
|
-
}
|
|
164
209
|
export declare const CycleWhen: {
|
|
165
210
|
FIRST: number;
|
|
166
211
|
LAST: number;
|
|
@@ -183,153 +228,13 @@ export type TRegisteredDomain = {
|
|
|
183
228
|
values?: string[];
|
|
184
229
|
description?: string;
|
|
185
230
|
};
|
|
186
|
-
export type StepperMethodArgs = {
|
|
187
|
-
[K in keyof IStepperCycles]: Parameters<NonNullable<IStepperCycles[K]>>[0];
|
|
188
|
-
};
|
|
189
|
-
export type TStepValuesMap = Record<string, TStepValue>;
|
|
190
|
-
export type TStepAction = {
|
|
191
|
-
actionName: string;
|
|
192
|
-
stepperName: string;
|
|
193
|
-
step: TStepperStep;
|
|
194
|
-
stepValuesMap?: TStepValuesMap;
|
|
195
|
-
};
|
|
196
|
-
export declare enum Origin {
|
|
197
|
-
defined = "defined",
|
|
198
|
-
var = "var",
|
|
199
|
-
env = "env",
|
|
200
|
-
quoted = "quoted",
|
|
201
|
-
statement = "statement"
|
|
202
|
-
}
|
|
203
|
-
export type TOrigin = keyof typeof Origin;
|
|
204
|
-
export type TProvenanceIdentifier = {
|
|
205
|
-
in?: string;
|
|
206
|
-
seq: number[];
|
|
207
|
-
when: string;
|
|
208
|
-
};
|
|
209
|
-
export type TStepValueValue = unknown;
|
|
210
|
-
export type TStepValue = {
|
|
211
|
-
term: string;
|
|
212
|
-
domain: string;
|
|
213
|
-
value?: TStepValueValue;
|
|
214
|
-
origin: TOrigin;
|
|
215
|
-
provenance?: TProvenanceIdentifier[];
|
|
216
|
-
readonly?: boolean;
|
|
217
|
-
};
|
|
218
|
-
export declare const OK: TOKActionResult;
|
|
219
|
-
export type TExecutorResultError = {
|
|
220
|
-
details: {
|
|
221
|
-
[name: string]: TAnyFixme;
|
|
222
|
-
};
|
|
223
|
-
message: string;
|
|
224
|
-
};
|
|
225
|
-
export type TExecutorResult = {
|
|
226
|
-
ok: boolean;
|
|
227
|
-
tag: TTag;
|
|
228
|
-
shared: FeatureVariables;
|
|
229
|
-
featureResults?: TFeatureResult[];
|
|
230
|
-
failure?: {
|
|
231
|
-
stage: string;
|
|
232
|
-
error: TExecutorResultError;
|
|
233
|
-
};
|
|
234
|
-
steppers: AStepper[];
|
|
235
|
-
};
|
|
236
|
-
export type TOKActionResult = {
|
|
237
|
-
ok: true;
|
|
238
|
-
messageContext?: TMessageContext;
|
|
239
|
-
artifact?: TArtifact;
|
|
240
|
-
protocol?: SystemMessage;
|
|
241
|
-
};
|
|
242
|
-
export type TNotOKActionResult = {
|
|
243
|
-
ok: false;
|
|
244
|
-
message: string;
|
|
245
|
-
messageContext?: TMessageContext;
|
|
246
|
-
artifact?: TArtifact;
|
|
247
|
-
protocol?: SystemMessage;
|
|
248
|
-
};
|
|
249
|
-
export type TTrace = {
|
|
250
|
-
[name: string]: {
|
|
251
|
-
url: string;
|
|
252
|
-
since: number;
|
|
253
|
-
trace: TAnyFixme;
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
|
-
export type TTraces = {
|
|
257
|
-
start?: number;
|
|
258
|
-
end?: number;
|
|
259
|
-
traces?: TTrace[];
|
|
260
|
-
};
|
|
261
|
-
export type TTraceOptions = {
|
|
262
|
-
[event: string]: {
|
|
263
|
-
listener: TAnyFixme;
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
export type TActionResult = TOKActionResult | TNotOKActionResult;
|
|
267
|
-
export type TStepActionResult = (TNotOkStepActionResult | TOKStepActionResult) & TTraces;
|
|
268
|
-
type TNamedStepActionResult = {
|
|
269
|
-
name: string;
|
|
270
|
-
};
|
|
271
|
-
export type TNotOkStepActionResult = TNotOKActionResult & TNamedStepActionResult;
|
|
272
|
-
export type TOKStepActionResult = TOKActionResult & TNamedStepActionResult;
|
|
273
|
-
export type TFeatureResult = {
|
|
274
|
-
skip?: boolean;
|
|
275
|
-
path: string;
|
|
276
|
-
ok: boolean;
|
|
277
|
-
stepResults: TStepResult[];
|
|
278
|
-
failure?: TFeatureResultFailure;
|
|
279
|
-
};
|
|
280
|
-
export type TFeatureResultFailure = {
|
|
281
|
-
message: string;
|
|
282
|
-
error: TAnyFixme;
|
|
283
|
-
expected?: TAnyFixme;
|
|
284
|
-
};
|
|
285
|
-
export type TStepResult = {
|
|
286
|
-
ok: boolean;
|
|
287
|
-
stepActionResult: TStepActionResult;
|
|
288
|
-
in: string;
|
|
289
|
-
path: string;
|
|
290
|
-
seqPath: TSeqPath;
|
|
291
|
-
intent?: ExecutionIntent;
|
|
292
|
-
};
|
|
293
|
-
export type TProvenOutcome = {
|
|
294
|
-
proofResult: TStepResult;
|
|
295
|
-
proofSteps: TFeatureStep[];
|
|
296
|
-
pattern: string;
|
|
297
|
-
};
|
|
298
|
-
export type TRuntime = {
|
|
299
|
-
backgrounds?: TFeature[];
|
|
300
|
-
scenario?: string;
|
|
301
|
-
feature?: string;
|
|
302
|
-
stepResults: TStepResult[];
|
|
303
|
-
/** If non-empty, execution was aborted due to exhaustion (description explains why). */
|
|
304
|
-
exhaustionError?: string;
|
|
305
|
-
[name: string]: TAnyFixme;
|
|
306
|
-
};
|
|
307
|
-
export declare const HAIBUN = "HAIBUN";
|
|
308
|
-
export declare const BASE_PREFIX = "HAIBUN_";
|
|
309
|
-
export declare const CAPTURE = "capture";
|
|
310
|
-
export declare const BASE_DOMAINS: {
|
|
311
|
-
name: string;
|
|
312
|
-
resolve: (inp: string) => string;
|
|
313
|
-
}[];
|
|
314
|
-
export declare const STAY_ALWAYS = "always";
|
|
315
|
-
export declare const STAY_FAILURE = "failure";
|
|
316
|
-
export declare const STAY = "STAY";
|
|
317
|
-
export declare const CHECK_YES = "\u2705";
|
|
318
|
-
export declare const CHECK_NO = "\u274C";
|
|
319
|
-
export declare const CHECK_YIELD = "\uD83D\uDD00";
|
|
320
|
-
export declare const MAYBE_CHECK_YES = "\u2713";
|
|
321
|
-
export declare const MAYBE_CHECK_NO = "\u2717";
|
|
322
|
-
export declare const STEP_DELAY = "STEP_DELAY";
|
|
323
|
-
export declare const DEFAULT_DEST = "default";
|
|
324
|
-
export declare const TEST_BASE = "test_base";
|
|
325
|
-
export declare const CONTINUE_AFTER_ERROR = "CONTINUE_AFTER_ERROR";
|
|
326
|
-
export declare const SCENARIO_START = "scenario";
|
|
327
|
-
export declare const FEATURE_START = "feature";
|
|
328
|
-
export declare const HAPPENING_START = "happening";
|
|
329
231
|
export declare enum ExecMode {
|
|
330
232
|
WITH_CYCLES = "WITH_CYCLES",
|
|
331
233
|
NO_CYCLES = "NO_CYCLES",
|
|
332
234
|
PROMPT = "PROMPT"
|
|
333
235
|
}
|
|
334
|
-
export
|
|
236
|
+
export type TOptionValue = TAnyFixme;
|
|
237
|
+
export type StepperMethodArgs = {
|
|
238
|
+
[K in keyof IStepperCycles]: Parameters<NonNullable<IStepperCycles[K]>>[0];
|
|
239
|
+
};
|
|
335
240
|
//# sourceMappingURL=defs.d.ts.map
|