@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
package/build/lib/astepper.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { TWorld, IStepperCycles, TStepperStep, TOptionValue, TEnvVariables, IStepperWhen } from
|
|
2
|
-
import { TAnyFixme } from
|
|
1
|
+
import { TWorld, IStepperCycles, TStepperStep, TOptionValue, TEnvVariables, IStepperWhen } from "./execution.js";
|
|
2
|
+
import { TAnyFixme } from "./fixme.js";
|
|
3
3
|
export declare const StepperKinds: {
|
|
4
4
|
readonly MONITOR: "MONITOR";
|
|
5
5
|
readonly STORAGE: "STORAGE";
|
|
6
6
|
readonly BROWSER: "BROWSER";
|
|
7
7
|
readonly SERVER: "SERVER";
|
|
8
8
|
readonly TEST: "TEST";
|
|
9
|
+
/** LLM provider — exposes `ask(prompt, opts?): Promise<string>`. */
|
|
10
|
+
readonly LLM: "LLM";
|
|
9
11
|
};
|
|
10
12
|
export type TStepperKind = keyof typeof StepperKinds;
|
|
11
13
|
export declare abstract class AStepper {
|
|
@@ -24,23 +26,98 @@ export declare abstract class AStepper {
|
|
|
24
26
|
export type TStepperSteps = {
|
|
25
27
|
[key: string]: TStepperStep;
|
|
26
28
|
};
|
|
29
|
+
/** One stepper option declaration — the small, non-tunable shape every stepper has used. */
|
|
30
|
+
export type TStepperOption = {
|
|
31
|
+
required?: boolean;
|
|
32
|
+
altSource?: string;
|
|
33
|
+
default?: string;
|
|
34
|
+
desc: string;
|
|
35
|
+
parse: (input: string, existing?: TOptionValue) => {
|
|
36
|
+
parseError?: string;
|
|
37
|
+
env?: TEnvVariables;
|
|
38
|
+
result?: TAnyFixme;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
27
41
|
export interface IHasOptions {
|
|
28
42
|
options?: {
|
|
29
|
-
[name: string]:
|
|
30
|
-
required?: boolean;
|
|
31
|
-
altSource?: string;
|
|
32
|
-
default?: string;
|
|
33
|
-
desc: string;
|
|
34
|
-
parse: (input: string, existing?: TOptionValue) => {
|
|
35
|
-
parseError?: string;
|
|
36
|
-
env?: TEnvVariables;
|
|
37
|
-
result?: TAnyFixme;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
43
|
+
[name: string]: TStepperOption;
|
|
40
44
|
};
|
|
41
45
|
}
|
|
42
46
|
export interface IHasCycles {
|
|
43
47
|
cycles: IStepperCycles;
|
|
44
48
|
cyclesWhen?: IStepperWhen;
|
|
45
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Declarative bound on a tunable option. The four kinds are deliberately
|
|
52
|
+
* narrow — richer validation belongs in the option's own `parse`, not here.
|
|
53
|
+
*/
|
|
54
|
+
export type TTunableRange = {
|
|
55
|
+
kind: "number";
|
|
56
|
+
min?: number;
|
|
57
|
+
max?: number;
|
|
58
|
+
} | {
|
|
59
|
+
kind: "duration";
|
|
60
|
+
minMs?: number;
|
|
61
|
+
maxMs?: number;
|
|
62
|
+
} | {
|
|
63
|
+
kind: "boolean";
|
|
64
|
+
} | {
|
|
65
|
+
kind: "enum";
|
|
66
|
+
values: string[];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* How often a tunable may be changed. Enforced server-side at the
|
|
70
|
+
* Development-write RPC boundary; a misbehaving client cannot bypass it.
|
|
71
|
+
*/
|
|
72
|
+
export type TTunableRateLimit = {
|
|
73
|
+
maxChangesPerDay: number;
|
|
74
|
+
/** Optional minimum relative step size — e.g. 0.1 for "at least 10% change". */
|
|
75
|
+
minStepPct?: number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* One tunable option declaration. A superset of TStepperOption — same
|
|
79
|
+
* desc / parse / etc. plus range bounds, an optional rate limit, and an
|
|
80
|
+
* optional capability gate.
|
|
81
|
+
*
|
|
82
|
+
* When `requiresCapability` is omitted, the default capability name is
|
|
83
|
+
* derived from the owning stepper + key via `requiredCapabilityFor`.
|
|
84
|
+
* Prefer the derived name over a hard-coded literal so the gate is not
|
|
85
|
+
* coupled to any particular consumer.
|
|
86
|
+
*/
|
|
87
|
+
export type TTunableOption = TStepperOption & {
|
|
88
|
+
range: TTunableRange;
|
|
89
|
+
rateLimit?: TTunableRateLimit;
|
|
90
|
+
requiresCapability?: string;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Derive the default capability a caller must hold to change the
|
|
94
|
+
* tunable `<stepperName>.<key>`. Consumers that haven't declared
|
|
95
|
+
* `requiresCapability` explicitly fall back to this structural name.
|
|
96
|
+
* Consumers that grant capabilities should construct matches against
|
|
97
|
+
* this function, never via string literals.
|
|
98
|
+
*/
|
|
99
|
+
export declare function requiredCapabilityFor(stepperName: string, key: string): string;
|
|
100
|
+
/**
|
|
101
|
+
* Discovery contract: steppers that expose tunable options — options a
|
|
102
|
+
* caller may propose changes to within their declared bounds — declare
|
|
103
|
+
* them in a `tunables` map parallel to `options`. Non-tunable steppers
|
|
104
|
+
* simply omit the property.
|
|
105
|
+
*
|
|
106
|
+
* Discovered the same way IHasOptions / IHasCycles are — by introspection
|
|
107
|
+
* for the property, no instanceof check required.
|
|
108
|
+
*/
|
|
109
|
+
export interface IHasTunables {
|
|
110
|
+
tunables?: {
|
|
111
|
+
[name: string]: TTunableOption;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Enumerate every tunable declared by any stepper in the list. Steppers
|
|
116
|
+
* with no `tunables` property are skipped silently.
|
|
117
|
+
*/
|
|
118
|
+
export declare function getTunableOptions(steppers: AStepper[]): Array<{
|
|
119
|
+
stepperName: string;
|
|
120
|
+
key: string;
|
|
121
|
+
meta: TTunableOption;
|
|
122
|
+
}>;
|
|
46
123
|
//# sourceMappingURL=astepper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astepper.d.ts","sourceRoot":"","sources":["../../src/lib/astepper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"astepper.d.ts","sourceRoot":"","sources":["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cAAc,CAAA;CAAE,CAAC,CAWnE"}
|
package/build/lib/astepper.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { constructorName } from
|
|
1
|
+
import { constructorName } from "./util/index.js";
|
|
2
2
|
export const StepperKinds = {
|
|
3
|
-
MONITOR:
|
|
4
|
-
STORAGE:
|
|
5
|
-
BROWSER:
|
|
6
|
-
SERVER:
|
|
7
|
-
TEST:
|
|
3
|
+
MONITOR: "MONITOR",
|
|
4
|
+
STORAGE: "STORAGE",
|
|
5
|
+
BROWSER: "BROWSER",
|
|
6
|
+
SERVER: "SERVER",
|
|
7
|
+
TEST: "TEST",
|
|
8
|
+
/** LLM provider — exposes `ask(prompt, opts?): Promise<string>`. */
|
|
9
|
+
LLM: "LLM",
|
|
8
10
|
};
|
|
9
11
|
export class AStepper {
|
|
10
12
|
description;
|
|
@@ -23,4 +25,31 @@ export class AStepper {
|
|
|
23
25
|
return this.world;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Derive the default capability a caller must hold to change the
|
|
30
|
+
* tunable `<stepperName>.<key>`. Consumers that haven't declared
|
|
31
|
+
* `requiresCapability` explicitly fall back to this structural name.
|
|
32
|
+
* Consumers that grant capabilities should construct matches against
|
|
33
|
+
* this function, never via string literals.
|
|
34
|
+
*/
|
|
35
|
+
export function requiredCapabilityFor(stepperName, key) {
|
|
36
|
+
return `${stepperName}:tune:${key}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Enumerate every tunable declared by any stepper in the list. Steppers
|
|
40
|
+
* with no `tunables` property are skipped silently.
|
|
41
|
+
*/
|
|
42
|
+
export function getTunableOptions(steppers) {
|
|
43
|
+
const out = [];
|
|
44
|
+
for (const stepper of steppers) {
|
|
45
|
+
const withTunables = stepper;
|
|
46
|
+
const tunables = withTunables.tunables;
|
|
47
|
+
if (!tunables)
|
|
48
|
+
continue;
|
|
49
|
+
for (const [key, meta] of Object.entries(tunables)) {
|
|
50
|
+
out.push({ stepperName: constructorName(stepper), key, meta });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
26
55
|
//# sourceMappingURL=astepper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astepper.js","sourceRoot":"","sources":["../../src/lib/astepper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"astepper.js","sourceRoot":"","sources":["../../src/lib/astepper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,oEAAoE;IACpE,GAAG,EAAE,KAAK;CACD,CAAC;AAIX,MAAM,OAAgB,QAAQ;IAC7B,WAAW,CAAU;IACrB,KAAK,CAAU;IACf,IAAI,CAAgB;IAEpB,KAAK,CAAC,QAAQ,CAAC,KAAa,EAAE,SAAqB;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,yDAAyD;QACzD,KAAK,SAAS,CAAC;QACf,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;IAED,QAAQ;QACP,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACjB,MAAM,KAAK,CAAC,yBAAyB,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/D,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;CAOD;AA4DD;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,WAAmB,EAAE,GAAW;IACrE,OAAO,GAAG,WAAW,SAAS,GAAG,EAAE,CAAC;AACrC,CAAC;AAiBD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAChC,QAAoB;IAEpB,MAAM,GAAG,GAAsE,EAAE,CAAC;IAClF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAChC,MAAM,YAAY,GAAG,OAAkC,CAAC;QACxD,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC;QACvC,IAAI,CAAC,QAAQ;YAAE,SAAS;QACxB,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpD,GAAG,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;QAChE,CAAC;IACF,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TPrompt, TPromptResponse, IPrompter } from
|
|
1
|
+
import { TPrompt, TPromptResponse, IPrompter } from "./prompter.js";
|
|
2
2
|
export declare abstract class BasePromptManager implements IPrompter {
|
|
3
3
|
protected outstandingPrompts: Map<string, {
|
|
4
4
|
resolve: (value: TPromptResponse) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-prompt-manager.d.ts","sourceRoot":"","sources":["../../src/lib/base-prompt-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEpE,8BAAsB,iBAAkB,YAAW,SAAS;
|
|
1
|
+
{"version":3,"file":"base-prompt-manager.d.ts","sourceRoot":"","sources":["../../src/lib/base-prompt-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEpE,8BAAsB,iBAAkB,YAAW,SAAS;IAC3D,SAAS,CAAC,kBAAkB;iBAEhB,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI;gBAAU,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI;iBAAW,OAAO;oBAAc,MAAM;OAClH;IAEJ,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IACpD,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAExC,qBAAqB;iBANhB,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI;gBAAU,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI;iBAAW,OAAO;oBAAc,MAAM;;IAUtH,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC;IAUjD,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe;IAM1C,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAKnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-prompt-manager.js","sourceRoot":"","sources":["../../src/lib/base-prompt-manager.ts"],"names":[],"mappings":"AAEA,MAAM,OAAgB,iBAAiB;
|
|
1
|
+
{"version":3,"file":"base-prompt-manager.js","sourceRoot":"","sources":["../../src/lib/base-prompt-manager.ts"],"names":[],"mappings":"AAEA,MAAM,OAAgB,iBAAiB;IAC5B,kBAAkB,GAAG,IAAI,GAAG,EAGnC,CAAC;IAKG,qBAAqB;QAC3B,OAAO,IAAI,CAAC,kBAAkB,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,MAAe;QACrB,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;YAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACnC,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACxB,OAAO,IAAI,OAAO,CAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACvD,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC5F,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,EAAU,EAAE,KAAsB;QACzC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,OAAgB;QAClC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QACpD,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;CACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TBaseOptions } from
|
|
1
|
+
import { TBaseOptions } from "./execution.js";
|
|
2
2
|
import { TTag } from "./ttag.js";
|
|
3
3
|
export declare const captureLocator: (options: TBaseOptions, tag: TTag, ...where: (string | undefined)[]) => string;
|
|
4
4
|
//# sourceMappingURL=capture-locator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-locator.d.ts","sourceRoot":"","sources":["../../src/lib/capture-locator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"capture-locator.d.ts","sourceRoot":"","sources":["../../src/lib/capture-locator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,eAAO,MAAM,cAAc,GAAI,SAAS,YAAY,EAAE,KAAK,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,WAMhG,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { join } from "path";
|
|
2
|
-
import { CAPTURE, DEFAULT_DEST } from
|
|
3
|
-
import { containerHostPath } from "./util/actualURI.js";
|
|
2
|
+
import { CAPTURE, DEFAULT_DEST } from "../schema/protocol.js";
|
|
3
|
+
import { containerHostPath } from "./util/node/actualURI.js";
|
|
4
4
|
import { slugify } from "./util/index.js";
|
|
5
5
|
export const captureLocator = (options, tag, ...where) => {
|
|
6
|
-
const featn = `featn-${tag.featureNum}${tag.featureName ? `-${slugify(tag.featureName)}` :
|
|
6
|
+
const featn = `featn-${tag.featureNum}${tag.featureName ? `-${slugify(tag.featureName)}` : ""}`;
|
|
7
7
|
const location = join(...[CAPTURE, options.DEST || DEFAULT_DEST, tag.key, featn].concat(where.filter((w) => w !== undefined)));
|
|
8
|
-
const base = containerHostPath ||
|
|
9
|
-
const loc = [base, location].join(
|
|
8
|
+
const base = containerHostPath || ".";
|
|
9
|
+
const loc = [base, location].join("/");
|
|
10
10
|
return loc;
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=capture-locator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-locator.js","sourceRoot":"","sources":["../../src/lib/capture-locator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"capture-locator.js","sourceRoot":"","sources":["../../src/lib/capture-locator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAqB,EAAE,GAAS,EAAE,GAAG,KAA6B,EAAE,EAAE;IACpG,MAAM,KAAK,GAAG,SAAS,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAChG,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,IAAI,YAAY,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC;IAC/H,MAAM,IAAI,GAAG,iBAAiB,IAAI,GAAG,CAAC;IACtC,MAAM,GAAG,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { TWorld, TFeatureStep, TStepInput } from
|
|
2
|
-
import { TSeqPath } from
|
|
3
|
-
import { AStepper } from
|
|
4
|
-
import { ExecutionIntent, FlowSignal } from '../../schema/protocol.js';
|
|
1
|
+
import { TWorld, TFeatureStep, TStepInput } from "../execution.js";
|
|
2
|
+
import { TSeqPath, TActionResult, ExecutionIntent } from "../../schema/protocol.js";
|
|
3
|
+
import { AStepper } from "../astepper.js";
|
|
5
4
|
export declare class FlowRunner {
|
|
6
5
|
private world;
|
|
7
6
|
private steppers;
|
|
8
7
|
private resolver;
|
|
9
8
|
constructor(world: TWorld, steppers: AStepper[]);
|
|
9
|
+
private get registry();
|
|
10
10
|
runStatement(statement: string | TStepInput, options?: {
|
|
11
11
|
args?: Record<string, string>;
|
|
12
12
|
intent?: ExecutionIntent;
|
|
13
13
|
parentStep?: TFeatureStep;
|
|
14
14
|
seqPath?: TSeqPath;
|
|
15
|
-
}): Promise<
|
|
15
|
+
}): Promise<TActionResult>;
|
|
16
16
|
runStatements(statements: (string | TStepInput)[], options?: {
|
|
17
17
|
args?: Record<string, string>;
|
|
18
18
|
intent?: ExecutionIntent;
|
|
19
19
|
parentStep?: TFeatureStep;
|
|
20
|
-
}): Promise<
|
|
20
|
+
}): Promise<TActionResult>;
|
|
21
21
|
runSteps(steps: TFeatureStep[], options?: {
|
|
22
22
|
intent?: ExecutionIntent;
|
|
23
23
|
parentStep?: TFeatureStep;
|
|
24
|
-
|
|
24
|
+
targetHostId?: number;
|
|
25
|
+
}): Promise<TActionResult>;
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=flow-runner.d.ts.map
|
|
@@ -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,UAAU,EAAE,MAAM,
|
|
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,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAe,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACjG,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,qBAAa,UAAU;IAIrB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,QAAQ;IAJjB,OAAO,CAAC,QAAQ,CAAW;gBAGlB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,EAAE;IAK7B,OAAO,KAAK,QAAQ,GAKnB;IAEK,YAAY,CACjB,SAAS,EAAE,MAAM,GAAG,UAAU,EAC9B,OAAO,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,UAAU,CAAC,EAAE,YAAY,CAAC;QAAC,OAAO,CAAC,EAAE,QAAQ,CAAA;KAAO,GACtH,OAAO,CAAC,aAAa,CAAC;IA8EnB,aAAa,CAClB,UAAU,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,EACnC,OAAO,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,UAAU,CAAC,EAAE,YAAY,CAAA;KAAO,GAClG,OAAO,CAAC,aAAa,CAAC;IASnB,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,eAAe,CAAC;QAAC,UAAU,CAAC,EAAE,YAAY,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,aAAa,CAAC;CA+B3J"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { actionNotOK } from "../util/index.js";
|
|
2
|
+
import { Resolver } from "../../phases/Resolver.js";
|
|
3
|
+
import { incSeqPath, syntheticSeqPathDirection } from "../../phases/Executor.js";
|
|
4
|
+
import { dispatchStep } from "../step-dispatch.js";
|
|
3
5
|
export class FlowRunner {
|
|
4
6
|
world;
|
|
5
7
|
steppers;
|
|
@@ -9,58 +11,54 @@ export class FlowRunner {
|
|
|
9
11
|
this.steppers = steppers;
|
|
10
12
|
this.resolver = new Resolver(steppers);
|
|
11
13
|
}
|
|
14
|
+
get registry() {
|
|
15
|
+
// Read at dispatch time — Executor assigns this after steppers' setWorld.
|
|
16
|
+
const reg = this.world.runtime?.stepRegistry;
|
|
17
|
+
if (!reg)
|
|
18
|
+
throw new Error("FlowRunner: world.runtime.stepRegistry not set; run inside Executor");
|
|
19
|
+
return reg;
|
|
20
|
+
}
|
|
12
21
|
async runStatement(statement, options = {}) {
|
|
13
|
-
const { intent = { mode:
|
|
14
|
-
const stmtText = typeof statement ===
|
|
15
|
-
// Merge parent runtimeArgs with current args (current takes precedence)
|
|
16
|
-
// This enables nested quantifiers: outer vars are visible to inner statements
|
|
22
|
+
const { intent = { mode: "authoritative" } } = options;
|
|
23
|
+
const stmtText = typeof statement === "string" ? statement : statement.in;
|
|
17
24
|
const allArgs = { ...options.parentStep?.runtimeArgs, ...options.args };
|
|
18
|
-
// Interpolate {varName} patterns using merged args
|
|
19
25
|
let statementWithArgs = stmtText;
|
|
20
26
|
if (Object.keys(allArgs).length > 0) {
|
|
21
27
|
for (const [key, value] of Object.entries(allArgs)) {
|
|
22
|
-
statementWithArgs = statementWithArgs.replace(new RegExp(`\\{${key}\\}`,
|
|
28
|
+
statementWithArgs = statementWithArgs.replace(new RegExp(`\\{${key}\\}`, "g"), value);
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
|
-
// Resolve the action first - this gives us access to step metadata including source
|
|
26
31
|
let action;
|
|
27
32
|
try {
|
|
28
33
|
action = this.resolver.findSingleStepAction(statementWithArgs);
|
|
29
34
|
}
|
|
30
35
|
catch (e) {
|
|
31
|
-
if (intent.mode ===
|
|
32
|
-
return
|
|
36
|
+
if (intent.mode === "speculative") {
|
|
37
|
+
return actionNotOK(e instanceof Error ? e.message : String(e));
|
|
33
38
|
}
|
|
34
39
|
throw e;
|
|
35
40
|
}
|
|
36
|
-
// Derive source path: prefer resolved step's source, then parentStep, then input statement
|
|
37
41
|
const step = action.step;
|
|
38
42
|
let resolvedPath;
|
|
39
43
|
let resolvedLineNumber;
|
|
40
44
|
if (step?.source?.path) {
|
|
41
|
-
// Step definition has its own source (e.g., activity, waypoint)
|
|
42
45
|
resolvedPath = step.source.path;
|
|
43
46
|
resolvedLineNumber = step.source.lineNumber;
|
|
44
47
|
}
|
|
45
48
|
else if (options.parentStep?.source?.path) {
|
|
46
|
-
// Fall back to parent step's source (e.g., quantifier calling nested statement)
|
|
47
49
|
resolvedPath = options.parentStep.source.path;
|
|
48
50
|
resolvedLineNumber = options.parentStep.source.lineNumber;
|
|
49
51
|
}
|
|
50
|
-
else if (typeof statement !==
|
|
51
|
-
// Use input statement's source if provided
|
|
52
|
+
else if (typeof statement !== "string" && statement.source?.path) {
|
|
52
53
|
resolvedPath = statement.source.path;
|
|
53
54
|
resolvedLineNumber = statement.source.lineNumber;
|
|
54
55
|
}
|
|
55
56
|
else if (this.world.runtime.currentFeaturePath) {
|
|
56
|
-
// Fall back to current feature path (e.g., debugger executing ad-hoc statements)
|
|
57
57
|
resolvedPath = this.world.runtime.currentFeaturePath;
|
|
58
58
|
}
|
|
59
59
|
else {
|
|
60
|
-
|
|
61
|
-
resolvedPath = '<dynamic>';
|
|
60
|
+
resolvedPath = "<dynamic>";
|
|
62
61
|
}
|
|
63
|
-
// Compute seqPath for this statement
|
|
64
62
|
let seqPath = options.seqPath;
|
|
65
63
|
if (!seqPath) {
|
|
66
64
|
if (options.parentStep) {
|
|
@@ -70,94 +68,67 @@ export class FlowRunner {
|
|
|
70
68
|
throw new Error(`runStatement requires seqPath or parentStep. Statement: ${stmtText}`);
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
|
-
// Merge parent args with current args (current takes precedence)
|
|
74
71
|
const mergedArgs = { ...options.parentStep?.runtimeArgs, ...options.args };
|
|
75
72
|
const featureStep = {
|
|
76
|
-
source: {
|
|
77
|
-
path: resolvedPath,
|
|
78
|
-
lineNumber: resolvedLineNumber,
|
|
79
|
-
},
|
|
73
|
+
source: { path: resolvedPath, lineNumber: resolvedLineNumber },
|
|
80
74
|
in: statementWithArgs,
|
|
81
75
|
seqPath,
|
|
82
76
|
action,
|
|
83
77
|
intent,
|
|
84
78
|
isSubStep: !!options.parentStep,
|
|
85
|
-
// Propagate isAfterEveryStep from parent to prevent afterEvery recursion
|
|
86
79
|
isAfterEveryStep: options.parentStep?.isAfterEveryStep,
|
|
87
|
-
runtimeArgs: Object.keys(mergedArgs).length > 0 ? mergedArgs : undefined
|
|
80
|
+
runtimeArgs: Object.keys(mergedArgs).length > 0 ? mergedArgs : undefined,
|
|
88
81
|
};
|
|
89
|
-
let result;
|
|
90
82
|
try {
|
|
91
|
-
result = await
|
|
83
|
+
const result = await dispatchStep({ registry: this.registry, world: this.world, steppers: this.steppers }, featureStep);
|
|
84
|
+
return result;
|
|
92
85
|
}
|
|
93
86
|
catch (e) {
|
|
94
|
-
if (intent.mode ===
|
|
95
|
-
return
|
|
87
|
+
if (intent.mode === "speculative") {
|
|
88
|
+
return actionNotOK(e instanceof Error ? e.message : String(e));
|
|
96
89
|
}
|
|
97
90
|
throw e;
|
|
98
91
|
}
|
|
99
|
-
if (result.ok) {
|
|
100
|
-
return { kind: 'ok', products: result.stepActionResult };
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
const msg = result.stepActionResult.message;
|
|
104
|
-
return { kind: 'fail', message: msg, products: result.stepActionResult };
|
|
105
|
-
}
|
|
106
92
|
}
|
|
107
93
|
async runStatements(statements, options = {}) {
|
|
108
|
-
let lastResult;
|
|
94
|
+
let lastResult = { ok: true };
|
|
109
95
|
for (const stmt of statements) {
|
|
110
|
-
|
|
111
|
-
if (
|
|
112
|
-
return
|
|
113
|
-
}
|
|
114
|
-
lastResult = result;
|
|
96
|
+
lastResult = await this.runStatement(stmt, options);
|
|
97
|
+
if (!lastResult.ok)
|
|
98
|
+
return lastResult;
|
|
115
99
|
}
|
|
116
|
-
return
|
|
100
|
+
return lastResult;
|
|
117
101
|
}
|
|
118
102
|
async runSteps(steps, options = {}) {
|
|
119
|
-
const { intent = { mode:
|
|
120
|
-
let lastResult;
|
|
103
|
+
const { intent = { mode: "authoritative" }, parentStep, targetHostId } = options;
|
|
104
|
+
let lastResult = { ok: true };
|
|
121
105
|
for (const step of steps) {
|
|
122
106
|
let mappedStep = {
|
|
123
107
|
...step,
|
|
124
108
|
intent,
|
|
125
|
-
runtimeArgs: { ...parentStep?.runtimeArgs, ...step.runtimeArgs }
|
|
109
|
+
runtimeArgs: { ...parentStep?.runtimeArgs, ...step.runtimeArgs },
|
|
110
|
+
targetHostId: targetHostId ?? step.targetHostId,
|
|
126
111
|
};
|
|
127
112
|
if (parentStep) {
|
|
128
|
-
// For nested steps, we append to the parent's seqPath.
|
|
129
|
-
// We use incSeqPath to ensure we get a unique path based on what has already executed.
|
|
130
|
-
// This handles loops and repeated calls correctly.
|
|
131
113
|
const baseSeqPath = [...parentStep.seqPath, 1];
|
|
132
|
-
const
|
|
114
|
+
const isAfterEvery = parentStep.isAfterEveryStep || mappedStep.isAfterEveryStep;
|
|
115
|
+
const dir = syntheticSeqPathDirection(intent.mode === "speculative" || isAfterEvery);
|
|
133
116
|
const seqPath = incSeqPath(this.world.runtime.stepResults, baseSeqPath, dir);
|
|
134
|
-
mappedStep = { ...mappedStep, seqPath, isSubStep: true, isAfterEveryStep:
|
|
117
|
+
mappedStep = { ...mappedStep, seqPath, isSubStep: true, isAfterEveryStep: isAfterEvery };
|
|
135
118
|
}
|
|
136
|
-
let result;
|
|
137
119
|
try {
|
|
138
|
-
|
|
120
|
+
lastResult = await dispatchStep({ registry: this.registry, world: this.world, steppers: this.steppers }, mappedStep);
|
|
121
|
+
if (!lastResult.ok)
|
|
122
|
+
return lastResult;
|
|
139
123
|
}
|
|
140
124
|
catch (e) {
|
|
141
|
-
if (intent.mode ===
|
|
142
|
-
return
|
|
125
|
+
if (intent.mode === "speculative") {
|
|
126
|
+
return actionNotOK(e instanceof Error ? e.message : String(e));
|
|
143
127
|
}
|
|
144
128
|
throw e;
|
|
145
129
|
}
|
|
146
|
-
if (!result.ok) {
|
|
147
|
-
const msg = result.stepActionResult.message;
|
|
148
|
-
return { kind: 'fail', message: msg, products: result.stepActionResult };
|
|
149
|
-
}
|
|
150
|
-
// If not using cycles (which doFeatureStep defaults to WITH_CYCLES), we might need to push results.
|
|
151
|
-
// But doFeatureStep pushes results if WITH_CYCLES.
|
|
152
|
-
// If we are in speculative mode, doFeatureStep might still push results if we don't change execMode.
|
|
153
|
-
// However, FlowRunner doesn't currently control execMode passed to doFeatureStep directly,
|
|
154
|
-
// it relies on FeatureExecutor defaults.
|
|
155
|
-
// If we want to avoid polluting stepResults in speculative mode, we might need to adjust FeatureExecutor or pass a flag.
|
|
156
|
-
// But for now, to ensure incSeqPath works, we NEED results in stepResults.
|
|
157
|
-
// So we accept that speculative steps might be in stepResults (which is probably fine for debugging).
|
|
158
|
-
lastResult = { kind: 'ok', products: result.stepActionResult };
|
|
159
130
|
}
|
|
160
|
-
return
|
|
131
|
+
return lastResult;
|
|
161
132
|
}
|
|
162
133
|
}
|
|
163
134
|
//# sourceMappingURL=flow-runner.js.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
1
|
+
{"version":3,"file":"flow-runner.js","sourceRoot":"","sources":["../../../src/lib/core/flow-runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC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,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBAC/C,MAAM,YAAY,GAAG,UAAU,CAAC,gBAAgB,IAAI,UAAU,CAAC,gBAAgB,CAAC;gBAChF,MAAM,GAAG,GAAG,yBAAyB,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,YAAY,CAAC,CAAC;gBACrF,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;gBAC7E,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC;YAC1F,CAAC;YAED,IAAI,CAAC;gBACJ,UAAU,GAAG,MAAM,YAAY,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,CAAC;gBACrH,IAAI,CAAC,UAAU,CAAC,EAAE;oBAAE,OAAO,UAAU,CAAC;YACvC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACZ,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;oBACnC,OAAO,WAAW,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChE,CAAC;gBACD,MAAM,CAAC,CAAC;YACT,CAAC;QACF,CAAC;QACD,OAAO,UAAU,CAAC;IACnB,CAAC;CACD"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TWorld } from
|
|
2
|
-
export declare const getCoreDomains: (world: TWorld) => Record<string, import("./
|
|
1
|
+
import { TWorld } from "./execution.js";
|
|
2
|
+
export declare const getCoreDomains: (world: TWorld) => Record<string, import("./resources.js").TRegisteredDomain>;
|
|
3
3
|
//# sourceMappingURL=core-domains.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-domains.d.ts","sourceRoot":"","sources":["../../src/lib/core-domains.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core-domains.d.ts","sourceRoot":"","sources":["../../src/lib/core-domains.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAuEtD,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,+DAA6D,CAAC"}
|
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { DOMAIN_DATE, DOMAIN_JSON, DOMAIN_LINK, DOMAIN_NUMBER, DOMAIN_STATEMENT, DOMAIN_STRING, mapDefinitionsToDomains } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DOMAIN_DATE, DOMAIN_JSON, DOMAIN_LINK, DOMAIN_NUMBER, DOMAIN_STATEMENT, DOMAIN_STRING, mapDefinitionsToDomains, } from "./domains.js";
|
|
3
3
|
import { findFeatureStepsFromStatement } from "../phases/Resolver.js";
|
|
4
|
-
const numberSchema = z.coerce.number({ error:
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const getCoreDomainDefinitions = (world) => ([
|
|
4
|
+
const numberSchema = z.coerce.number({ error: "invalid number" }).refine((value) => Number.isFinite(value), "invalid number");
|
|
5
|
+
const stringSchema = z.coerce.string({ error: "value is required" });
|
|
6
|
+
const jsonStringSchema = z.string({ error: "json value is required" });
|
|
7
|
+
const statementSchema = z.string({ error: "statement label is required" }).min(1, "statement cannot be empty");
|
|
8
|
+
const dateSchema = z.coerce.date({ error: "invalid date" });
|
|
9
|
+
const getCoreDomainDefinitions = (world) => [
|
|
11
10
|
{
|
|
12
11
|
selectors: [DOMAIN_STRING],
|
|
13
12
|
schema: stringSchema,
|
|
14
|
-
description:
|
|
13
|
+
description: "Plain string literal captured from feature text.",
|
|
15
14
|
},
|
|
16
15
|
{
|
|
17
16
|
selectors: [DOMAIN_LINK],
|
|
18
17
|
schema: stringSchema,
|
|
19
|
-
description:
|
|
18
|
+
description: "URI string representing a navigable link.",
|
|
20
19
|
},
|
|
21
20
|
{
|
|
22
21
|
selectors: [DOMAIN_NUMBER],
|
|
23
22
|
schema: numberSchema,
|
|
24
|
-
description:
|
|
23
|
+
description: "Numeric literal coerced with Number().",
|
|
25
24
|
comparator: (value, baseline) => value - baseline,
|
|
26
25
|
},
|
|
27
26
|
{
|
|
28
27
|
selectors: [DOMAIN_DATE],
|
|
29
28
|
schema: dateSchema,
|
|
30
|
-
description:
|
|
29
|
+
description: "Date object derived from ISO timestamp, epoch ms, or Date literal.",
|
|
31
30
|
comparator: (value, baseline) => value.getTime() - baseline.getTime(),
|
|
32
31
|
},
|
|
33
32
|
{
|
|
34
33
|
selectors: [DOMAIN_JSON],
|
|
35
34
|
schema: jsonStringSchema,
|
|
36
|
-
description:
|
|
35
|
+
description: "JSON string parsed into native JavaScript values.",
|
|
37
36
|
coerce: (proto) => {
|
|
38
37
|
const raw = jsonStringSchema.parse(proto.value);
|
|
39
38
|
try {
|
|
@@ -47,17 +46,17 @@ const getCoreDomainDefinitions = (world) => ([
|
|
|
47
46
|
{
|
|
48
47
|
selectors: [DOMAIN_STATEMENT],
|
|
49
48
|
schema: statementSchema,
|
|
50
|
-
description:
|
|
49
|
+
description: "Reference to another Haibun statement.",
|
|
51
50
|
coerce: (proto, featureStep, steppers) => {
|
|
52
51
|
if (!featureStep || !steppers) {
|
|
53
|
-
throw new Error(
|
|
52
|
+
throw new Error("statement domain coercion requires feature context");
|
|
54
53
|
}
|
|
55
54
|
const label = statementSchema.parse(proto.value);
|
|
56
55
|
const seqStart = featureStep.seqPath;
|
|
57
56
|
return findFeatureStepsFromStatement(label, steppers, world, featureStep.source.path, [...seqStart, 0], -1);
|
|
58
|
-
}
|
|
57
|
+
},
|
|
59
58
|
},
|
|
60
|
-
]
|
|
59
|
+
];
|
|
61
60
|
// Core domain registry factory. Returns coercion functions for built-in domains.
|
|
62
61
|
export const getCoreDomains = (world) => mapDefinitionsToDomains(getCoreDomainDefinitions(world));
|
|
63
62
|
//# sourceMappingURL=core-domains.js.map
|