@haibun/core 3.5.0 → 3.6.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.
Files changed (36) hide show
  1. package/build/currentVersion.d.ts +1 -1
  2. package/build/currentVersion.js +1 -1
  3. package/build/schema/protocol.d.ts +2 -2
  4. package/package.json +2 -2
  5. package/build/applyEffectFeatures.d.ts +0 -4
  6. package/build/applyEffectFeatures.d.ts.map +0 -1
  7. package/build/applyEffectFeatures.js +0 -34
  8. package/build/applyEffectFeatures.js.map +0 -1
  9. package/build/lib/Logger.d.ts +0 -46
  10. package/build/lib/Logger.d.ts.map +0 -1
  11. package/build/lib/Logger.js +0 -80
  12. package/build/lib/Logger.js.map +0 -1
  13. package/build/lib/TestLogger.d.ts +0 -11
  14. package/build/lib/TestLogger.d.ts.map +0 -1
  15. package/build/lib/TestLogger.js +0 -11
  16. package/build/lib/TestLogger.js.map +0 -1
  17. package/build/lib/Timer.d.ts +0 -7
  18. package/build/lib/Timer.d.ts.map +0 -1
  19. package/build/lib/Timer.js +0 -9
  20. package/build/lib/Timer.js.map +0 -1
  21. package/build/lib/interfaces/logger.d.ts +0 -105
  22. package/build/lib/interfaces/logger.d.ts.map +0 -1
  23. package/build/lib/interfaces/logger.js +0 -18
  24. package/build/lib/interfaces/logger.js.map +0 -1
  25. package/build/lib/util/featureStep-executor.d.ts +0 -6
  26. package/build/lib/util/featureStep-executor.d.ts.map +0 -1
  27. package/build/lib/util/featureStep-executor.js +0 -39
  28. package/build/lib/util/featureStep-executor.js.map +0 -1
  29. package/build/steps/lib/parse.d.ts +0 -4
  30. package/build/steps/lib/parse.d.ts.map +0 -1
  31. package/build/steps/lib/parse.js +0 -42
  32. package/build/steps/lib/parse.js.map +0 -1
  33. package/build/steps/parse.d.ts +0 -25
  34. package/build/steps/parse.d.ts.map +0 -1
  35. package/build/steps/parse.js +0 -31
  36. package/build/steps/parse.js.map +0 -1
@@ -1,2 +1,2 @@
1
- export declare const currentVersion = "3.5.0";
1
+ export declare const currentVersion = "3.6.0";
2
2
  //# sourceMappingURL=currentVersion.d.ts.map
@@ -1,2 +1,2 @@
1
- export const currentVersion = '3.5.0';
1
+ export const currentVersion = '3.6.0';
2
2
  //# sourceMappingURL=currentVersion.js.map
@@ -1023,8 +1023,8 @@ export declare const ControlEvent: z.ZodObject<{
1023
1023
  }>>;
1024
1024
  kind: z.ZodLiteral<"control">;
1025
1025
  signal: z.ZodEnum<{
1026
- step: "step";
1027
1026
  fail: "fail";
1027
+ step: "step";
1028
1028
  continue: "continue";
1029
1029
  retry: "retry";
1030
1030
  next: "next";
@@ -1408,8 +1408,8 @@ export declare const HaibunEvent: z.ZodUnion<readonly [z.ZodUnion<readonly [z.Zo
1408
1408
  }>>;
1409
1409
  kind: z.ZodLiteral<"control">;
1410
1410
  signal: z.ZodEnum<{
1411
- step: "step";
1412
1411
  fail: "fail";
1412
+ step: "step";
1413
1413
  continue: "continue";
1414
1414
  retry: "retry";
1415
1415
  next: "next";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@haibun/core",
3
3
  "type": "module",
4
- "version": "3.5.0",
4
+ "version": "3.6.0",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "exports": {
@@ -23,6 +23,6 @@
23
23
  },
24
24
  "gitHead": "7cf9680bd922fb622fb59f1e6bf5b65284cb8fd5",
25
25
  "dependencies": {
26
- "zod": "^4.3.5"
26
+ "zod": "^4.3.6"
27
27
  }
28
28
  }
@@ -1,4 +0,0 @@
1
- import { TWorld, TResolvedFeature } from './lib/defs.js';
2
- import { AStepper } from './lib/astepper.js';
3
- export declare function applyEffectFeatures(world: TWorld, resolvedFeatures: TResolvedFeature[], steppers: AStepper[]): Promise<TResolvedFeature[]>;
4
- //# sourceMappingURL=applyEffectFeatures.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"applyEffectFeatures.d.ts","sourceRoot":"","sources":["../src/applyEffectFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAA8B,MAAM,eAAe,CAAC;AAErF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA8BhJ"}
@@ -1,34 +0,0 @@
1
- import { populateActionArgs } from './lib/populateActionArgs.js';
2
- import { constructorName } from './lib/util/index.js';
3
- export async function applyEffectFeatures(world, resolvedFeatures, steppers) {
4
- const appliedFeatures = [];
5
- for (const feature of resolvedFeatures) {
6
- const featureSteps = [];
7
- const newFeature = { ...feature, featureSteps: [] };
8
- const appliers = [];
9
- for (const featureStep of feature.featureSteps) {
10
- let newSteps = [featureStep];
11
- const action = featureStep.action;
12
- const stepper = steppers.find((s) => constructorName(s) === action.stepperName);
13
- if (stepper?.steps[action.actionName].applyEffect) {
14
- const applier = stepper?.steps[action.actionName];
15
- // simplifyStepArgs is async (may await domain coercers) so await it here
16
- const namedWithVars = await populateActionArgs(featureStep, world, steppers);
17
- appliers.push({ applier, namedWithVars });
18
- }
19
- else if (appliers.length > 0) {
20
- newSteps = [];
21
- for (const a of appliers) {
22
- const applied = await a.applier.applyEffect(a.namedWithVars, featureStep, steppers);
23
- if (applied.length < 1)
24
- throw Error('wtw');
25
- newSteps.push(...applied);
26
- }
27
- }
28
- featureSteps.push(...newSteps);
29
- }
30
- appliedFeatures.push({ ...newFeature, featureSteps });
31
- }
32
- return appliedFeatures;
33
- }
34
- //# sourceMappingURL=applyEffectFeatures.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"applyEffectFeatures.js","sourceRoot":"","sources":["../src/applyEffectFeatures.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAA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,EAAE,QAAQ,CAAC,CAAC;oBACpF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;wBAAE,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC;oBAC3C,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;gBAC3B,CAAC;YACF,CAAC;YACD,YAAY,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QAChC,CAAC;QACD,eAAe,CAAC,IAAI,CAAC,EAAE,GAAG,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,eAAe,CAAC;AACxB,CAAC"}
@@ -1,46 +0,0 @@
1
- import { TWorld } from './defs.js';
2
- import { TAnyFixme } from './fixme.js';
3
- import { ILogger, ILogOutput, TLogArgs, TLogLevel, TOutputEnv, EExecutionMessageType, TMessageContext, TArtifact } from './interfaces/logger.js';
4
- export declare const LOGGER_LOG: {
5
- level: string;
6
- };
7
- export declare const LOGGER_NOTHING: {
8
- level: string;
9
- };
10
- export declare const LOGGER_LEVELS: {
11
- debug: number;
12
- log: number;
13
- info: number;
14
- warn: number;
15
- error: number;
16
- none: number;
17
- };
18
- type TLevel = {
19
- level: string;
20
- follow?: string;
21
- };
22
- type TConf = TLevel | TOutputEnv;
23
- export default class Logger implements ILogger, ILogOutput {
24
- level: number | undefined;
25
- env: TOutputEnv | undefined;
26
- subscribers: ILogOutput[];
27
- follow: string | undefined;
28
- static lastLevel: any;
29
- constructor(conf: TConf);
30
- addSubscriber(subscriber: ILogOutput): void;
31
- removeSubscriber(subscriber: ILogOutput): void;
32
- static shouldLogLevel(level: number, name: TLogLevel): boolean;
33
- out(level: TLogLevel, args: TLogArgs, messageContext?: TMessageContext): void;
34
- debug: (args: TLogArgs, mctx?: TMessageContext) => void;
35
- log: (args: TLogArgs, mctx?: TMessageContext) => void;
36
- info: (args: TLogArgs, mctx?: TMessageContext) => void;
37
- warn: (args: TLogArgs, mctx?: TMessageContext) => void;
38
- error: (args: TLogArgs, mctx?: TMessageContext) => void;
39
- }
40
- export declare const topicArtifactLogger: (world: TWorld) => <T extends TArtifact>(message: TLogArgs, data: {
41
- incident: EExecutionMessageType;
42
- artifact?: T;
43
- incidentDetails?: TAnyFixme;
44
- }, level?: TLogLevel) => void;
45
- export {};
46
- //# sourceMappingURL=Logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/lib/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,qBAAqB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIjJ,eAAO,MAAM,UAAU;;CAAmB,CAAC;AAC3C,eAAO,MAAM,cAAc;;CAAoB,CAAC;AAChD,eAAO,MAAM,aAAa;;;;;;;CAOzB,CAAC;AAEF,KAAK,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACjD,KAAK,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;AAEjC,MAAM,CAAC,OAAO,OAAO,MAAO,YAAW,OAAO,EAAE,UAAU;IACzD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAK;IAC9B,GAAG,EAAE,UAAU,GAAG,SAAS,CAAC;IAC5B,WAAW,EAAE,UAAU,EAAE,CAAM;IAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,SAAS,MAAa;gBAEjB,IAAI,EAAE,KAAK;IAYvB,aAAa,CAAC,UAAU,EAAE,UAAU;IAGpC,gBAAgB,CAAC,UAAU,EAAE,UAAU;IAGvC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS;IAGpD,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,CAAC,EAAE,eAAe;IAwBtE,KAAK,GAAI,MAAM,QAAQ,EAAE,OAAO,eAAe,UAAmC;IAClF,GAAG,GAAI,MAAM,QAAQ,EAAE,OAAO,eAAe,UAAiC;IAC9E,IAAI,GAAI,MAAM,QAAQ,EAAE,OAAO,eAAe,UAAkC;IAChF,IAAI,GAAI,MAAM,QAAQ,EAAE,OAAO,eAAe,UAAkC;IAChF,KAAK,GAAI,MAAM,QAAQ,EAAE,OAAO,eAAe,UAAmC;CAClF;AAGD,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,MAAM,CAAC,SAAS,SAAS,EACzE,SAAS,QAAQ,EACjB,MAAM;IAAE,QAAQ,EAAE,qBAAqB,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAAC,eAAe,CAAC,EAAE,SAAS,CAAA;CAAE,EACpF,QAAO,SAAiB,KACtB,IAOF,CAAA"}
@@ -1,80 +0,0 @@
1
- import { Timer } from './Timer.js';
2
- import { descTag, isFirstTag } from './util/index.js';
3
- export const LOGGER_LOG = { level: 'log' };
4
- export const LOGGER_NOTHING = { level: 'none' };
5
- export const LOGGER_LEVELS = {
6
- debug: 1,
7
- log: 2,
8
- info: 3,
9
- warn: 4,
10
- error: 5,
11
- none: 9,
12
- };
13
- export default class Logger {
14
- level = 1;
15
- env;
16
- subscribers = [];
17
- follow;
18
- static lastLevel = undefined;
19
- constructor(conf) {
20
- // passed a log level and possibly a follow
21
- if (conf.level) {
22
- this.level = LOGGER_LEVELS[conf.level];
23
- this.follow = conf.follow;
24
- }
25
- else if (conf.output) {
26
- this.env = conf;
27
- }
28
- else {
29
- throw Error(`invalid logger config ${conf}`);
30
- }
31
- }
32
- addSubscriber(subscriber) {
33
- this.subscribers.push(subscriber);
34
- }
35
- removeSubscriber(subscriber) {
36
- this.subscribers = this.subscribers.filter((sub) => JSON.stringify(sub) !== JSON.stringify(subscriber));
37
- }
38
- static shouldLogLevel(level, name) {
39
- return LOGGER_LEVELS[name] >= level;
40
- }
41
- out(level, args, messageContext) {
42
- for (const subscriber of this.subscribers) {
43
- subscriber.out(level, args, messageContext);
44
- }
45
- if (this.env?.output) {
46
- this.env.output.out(level, args, { ...messageContext, tag: this.env.tag });
47
- return;
48
- }
49
- const stack = Error().stack?.split('\n');
50
- const caller = stack[Math.min((stack?.length || 1) - 1, 4)]
51
- ?.replace(/.*\(/, '')
52
- ?.replace(process.cwd(), '')
53
- .replace(')', '')
54
- .replace(/.*\//, '')
55
- .replace(/\.ts:/, ':');
56
- if (!Logger.shouldLogLevel(this.level, level)) {
57
- return;
58
- }
59
- const showLevel = Logger.lastLevel === level ? level.substring(0, 1).padStart(1 + level.length / 2) : level;
60
- Logger.lastLevel = level;
61
- const tag = messageContext?.tag ? (isFirstTag(messageContext.tag) ? '' : descTag(messageContext.tag)) : '';
62
- const [proggy, line /*, col*/] = caller.split(':');
63
- console[level]((showLevel.padStart(6) + ` █ ${Timer.since() / 1000}:${proggy}:${line}${tag}`).padEnd(30) + ` | `, args);
64
- }
65
- debug = (args, mctx) => this.out('debug', args, mctx);
66
- log = (args, mctx) => this.out('log', args, mctx);
67
- info = (args, mctx) => this.out('info', args, mctx);
68
- warn = (args, mctx) => this.out('warn', args, mctx);
69
- error = (args, mctx) => this.out('error', args, mctx);
70
- }
71
- // Convenience function to create a log with message context and artifact
72
- export const topicArtifactLogger = (world) => (message, data, level = 'log') => {
73
- const context = {
74
- incident: data.incident,
75
- artifacts: data.artifact ? [data.artifact] : undefined,
76
- incidentDetails: data.incidentDetails,
77
- };
78
- world.logger[level](message, context);
79
- };
80
- //# sourceMappingURL=Logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/lib/Logger.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAA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AE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAChF,KAAK,GAAG,CAAC,IAAc,EAAE,IAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;;AAGnF,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CACrD,OAAiB,EACjB,IAAoF,EACpF,QAAmB,KAAK,EACjB,EAAE;IACT,MAAM,OAAO,GAAoB;QAChC,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QACtD,eAAe,EAAE,IAAI,CAAC,eAAe;KACrC,CAAC;IACF,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC,CAAA"}
@@ -1,11 +0,0 @@
1
- import { ILogger } from './interfaces/logger.js';
2
- export default class TestLogger implements ILogger {
3
- debug: () => any;
4
- log: () => any;
5
- info: () => any;
6
- warn: () => any;
7
- error: () => any;
8
- addSubscriber: () => any;
9
- removeSubscriber: () => any;
10
- }
11
- //# sourceMappingURL=TestLogger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TestLogger.d.ts","sourceRoot":"","sources":["../../src/lib/TestLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,UAAW,YAAW,OAAO;IACjD,KAAK,YAAU;IACf,GAAG,YAAU;IACb,IAAI,YAAU;IACd,IAAI,YAAU;IACd,KAAK,YAAU;IACf,aAAa,YAAU;IACvB,gBAAgB,YAAU;CAC1B"}
@@ -1,11 +0,0 @@
1
- const nothin = () => undefined;
2
- export default class TestLogger {
3
- debug = nothin;
4
- log = nothin;
5
- info = nothin;
6
- warn = nothin;
7
- error = nothin;
8
- addSubscriber = nothin;
9
- removeSubscriber = nothin;
10
- }
11
- //# sourceMappingURL=TestLogger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TestLogger.js","sourceRoot":"","sources":["../../src/lib/TestLogger.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC;AAC/B,MAAM,CAAC,OAAO,OAAO,UAAU;IAC9B,KAAK,GAAG,MAAM,CAAC;IACf,GAAG,GAAG,MAAM,CAAC;IACb,IAAI,GAAG,MAAM,CAAC;IACd,IAAI,GAAG,MAAM,CAAC;IACd,KAAK,GAAG,MAAM,CAAC;IACf,aAAa,GAAG,MAAM,CAAC;IACvB,gBAAgB,GAAG,MAAM,CAAC;CAC1B"}
@@ -1,7 +0,0 @@
1
- export declare class Timer {
2
- static startTime: Date;
3
- static key: string;
4
- static START_TIME: number;
5
- static since(): number;
6
- }
7
- //# sourceMappingURL=Timer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Timer.d.ts","sourceRoot":"","sources":["../../src/lib/Timer.ts"],"names":[],"mappings":"AAAA,qBAAa,KAAK;IACjB,MAAM,CAAC,SAAS,OAAc;IAC9B,MAAM,CAAC,GAAG,SAAkC;IAC5C,MAAM,CAAC,UAAU,SAAc;IAE/B,MAAM,CAAC,KAAK;CAGZ"}
@@ -1,9 +0,0 @@
1
- export class Timer {
2
- static startTime = new Date();
3
- static key = `${Timer.startTime.getTime()}`;
4
- static START_TIME = Date.now();
5
- static since() {
6
- return Date.now() - Timer.START_TIME;
7
- }
8
- }
9
- //# sourceMappingURL=Timer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Timer.js","sourceRoot":"","sources":["../../src/lib/Timer.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,KAAK;IACjB,MAAM,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC9B,MAAM,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;IAC5C,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE/B,MAAM,CAAC,KAAK;QACX,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC;IACtC,CAAC"}
@@ -1,105 +0,0 @@
1
- import { TResolvedFeature } from '../defs.js';
2
- import { TAnyFixme } from '../fixme.js';
3
- import { TTag } from '../ttag.js';
4
- export type TLogLevel = 'none' | 'debug' | 'log' | 'info' | 'warn' | 'error';
5
- export type TLogArgs = string;
6
- export type TMessageContext = {
7
- incident: EExecutionMessageType;
8
- artifacts?: TArtifact[];
9
- incidentDetails?: TAnyFixme;
10
- tag?: TTag;
11
- };
12
- export type TLogHistory = {
13
- message: TLogArgs;
14
- level: TLogLevel;
15
- caller: string;
16
- messageContext: TMessageContext;
17
- };
18
- export declare enum EExecutionMessageType {
19
- INIT = "INIT",
20
- EXECUTION_START = "EXECUTION_START",
21
- FEATURE_START = "FEATURE_START",
22
- SCENARIO_START = "SCENARIO_START",
23
- STEP_START = "STEP_START",
24
- STEP_NEXT = "STEP_NEXT",
25
- ACTION = "ACTION",
26
- TRACE = "TRACE",
27
- STEP_END = "STEP_END",
28
- SCENARIO_END = "SCENARIO_END",
29
- FEATURE_END = "FEATURE_END",
30
- EXECUTION_END = "EXECUTION_END",
31
- ON_FAILURE = "ON_FAILURE",
32
- DEBUG = "DEBUG"
33
- }
34
- export interface ILogger {
35
- debug: (what: TLogArgs, ctx?: TMessageContext) => void;
36
- log: (what: TLogArgs, ctx?: TMessageContext) => void;
37
- info: (what: TLogArgs, ctx?: TMessageContext) => void;
38
- warn: (what: TLogArgs, ctx?: TMessageContext) => void;
39
- error: (what: TLogArgs, ctx?: TMessageContext) => void;
40
- addSubscriber: (subscriber: ILogOutput) => void;
41
- removeSubscriber: (subscriber: ILogOutput) => void;
42
- }
43
- export interface ILogOutput {
44
- out: (level: TLogLevel, args: TLogArgs, ctx?: TMessageContext) => void;
45
- }
46
- export type TOutputEnv = {
47
- output: ILogOutput;
48
- tag: TTag;
49
- };
50
- export type TArtifact = (TArtifactSpeech | TArtifactVideo | TArtifactResolvedFeatures | TArtifactVideoStart | TArtifactImage | TArtifactHTML | TArtifactJSON | TArtifactHTTPTrace);
51
- export type TArtifactSpeech = {
52
- artifactType: 'speech';
53
- transcript: string;
54
- durationS: number;
55
- path: string;
56
- };
57
- export type TArtifactResolvedFeatures = {
58
- artifactType: 'resolvedFeatures';
59
- resolvedFeatures: TResolvedFeature[];
60
- index?: number;
61
- path: string;
62
- };
63
- export type TArtifactVideo = {
64
- artifactType: 'video';
65
- path: string;
66
- };
67
- export type TArtifactVideoStart = {
68
- artifactType: 'video/start';
69
- start: number;
70
- };
71
- export type TArtifactImage = {
72
- artifactType: 'image';
73
- path: string;
74
- };
75
- export type TArtifactHTML = TArtifactHTMLWithHtml | TArtifactHTMLWithPath;
76
- type TArtifactHTMLWithHtml = {
77
- artifactType: 'html';
78
- html: string;
79
- };
80
- type TArtifactHTMLWithPath = {
81
- artifactType: 'html';
82
- path: string;
83
- };
84
- export type TArtifactJSON = {
85
- artifactType: 'json';
86
- json: object;
87
- };
88
- export type TArtifactHTTPTrace = {
89
- artifactType: 'json/http/trace';
90
- httpEvent: 'response' | 'request' | 'route';
91
- trace: THTTPTraceContent;
92
- };
93
- export type TArtifactType = TArtifact['artifactType'];
94
- export type THTTPTraceContent = {
95
- frameURL?: string;
96
- requestingPage?: string;
97
- requestingURL?: string;
98
- method?: string;
99
- headers?: Record<string, string>;
100
- postData?: unknown;
101
- status?: number;
102
- statusText?: string;
103
- };
104
- export {};
105
- //# sourceMappingURL=logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/logger.ts"],"names":[],"mappings":"AAA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EAAE,MAAM,CAAC;CACd,CAAC;AACF,MAAM,MAAM,cAAc,GAAG;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,qBAAqB,GAAG,qBAAqB,CAAC;AAE1E,KAAK,qBAAqB,GAAG;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACb,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACb,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG;IAChC,YAAY,EAAE,iBAAiB,CAAC;IAChC,SAAS,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;IAC5C,KAAK,EAAE,iBAAiB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,cAAc,CAAC,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAA"}
@@ -1,18 +0,0 @@
1
- export var EExecutionMessageType;
2
- (function (EExecutionMessageType) {
3
- EExecutionMessageType["INIT"] = "INIT";
4
- EExecutionMessageType["EXECUTION_START"] = "EXECUTION_START";
5
- EExecutionMessageType["FEATURE_START"] = "FEATURE_START";
6
- EExecutionMessageType["SCENARIO_START"] = "SCENARIO_START";
7
- EExecutionMessageType["STEP_START"] = "STEP_START";
8
- EExecutionMessageType["STEP_NEXT"] = "STEP_NEXT";
9
- EExecutionMessageType["ACTION"] = "ACTION";
10
- EExecutionMessageType["TRACE"] = "TRACE";
11
- EExecutionMessageType["STEP_END"] = "STEP_END";
12
- EExecutionMessageType["SCENARIO_END"] = "SCENARIO_END";
13
- EExecutionMessageType["FEATURE_END"] = "FEATURE_END";
14
- EExecutionMessageType["EXECUTION_END"] = "EXECUTION_END";
15
- EExecutionMessageType["ON_FAILURE"] = "ON_FAILURE";
16
- EExecutionMessageType["DEBUG"] = "DEBUG";
17
- })(EExecutionMessageType || (EExecutionMessageType = {}));
18
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/lib/interfaces/logger.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAN,IAAY,qBAeX;AAfD,WAAY,qBAAqB;IAChC,sCAAa,CAAA;IACb,4DAAmC,CAAA;IACnC,wDAA+B,CAAA;IAC/B,0DAAiC,CAAA;IACjC,kDAAyB,CAAA;IACzB,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;IACjB,wCAAe,CAAA;IACf,8CAAqB,CAAA;IACrB,sDAA6B,CAAA;IAC7B,oDAA2B,CAAA;IAC3B,wDAA+B,CAAA;IAC/B,kDAAyB,CAAA;IACzB,wCAAe,CAAA;AAChB,CAAC,EAfW,qBAAqB,KAArB,qBAAqB,QAehC"}
@@ -1,6 +0,0 @@
1
- import { AStepper } from '../astepper.js';
2
- import { TWorld, TStepResult, TFeatureStep, ExecMode } from '../defs.js';
3
- export declare function resolveAndExecuteStatement(statement: string, base: string, steppers: AStepper[], world: TWorld, execMode: ExecMode, seqStart: number[]): Promise<TStepResult>;
4
- export declare function doExecuteFeatureSteps(featureSteps: TFeatureStep[], steppers: AStepper[], world: TWorld, execMode?: ExecMode): Promise<TStepResult>;
5
- export declare function findFeatureStepsFromStatement(statement: string, steppers: AStepper[], world: TWorld, base: string, seqStart: number[], inc?: number): TFeatureStep[];
6
- //# sourceMappingURL=featureStep-executor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"featureStep-executor.d.ts","sourceRoot":"","sources":["../../../src/lib/util/featureStep-executor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAY,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGnF,wBAAsB,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAGnL;AAED,wBAAsB,qBAAqB,CAAC,YAAY,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,QAA0B,GAAG,OAAO,CAAC,WAAW,CAAC,CAUzK;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,SAAI,GAAG,YAAY,EAAE,CAiB/J"}
@@ -1,39 +0,0 @@
1
- import { getActionableStatement } from '../../phases/Resolver.js';
2
- import { FeatureExecutor } from '../../phases/Executor.js';
3
- import { ExecMode } from '../defs.js';
4
- import { expandLine } from '../features.js';
5
- export async function resolveAndExecuteStatement(statement, base, steppers, world, execMode, seqStart) {
6
- const featureSteps = findFeatureStepsFromStatement(statement, steppers, world, base, seqStart);
7
- return await doExecuteFeatureSteps(featureSteps, steppers, world, execMode);
8
- }
9
- export async function doExecuteFeatureSteps(featureSteps, steppers, world, execMode = ExecMode.CYCLES) {
10
- let lastResult;
11
- for (const x of featureSteps) {
12
- lastResult = await FeatureExecutor.doFeatureStep(steppers, x, world, execMode);
13
- if (execMode === ExecMode.CYCLES || execMode === ExecMode.PROMPT) {
14
- world.runtime.stepResults.push(lastResult);
15
- }
16
- if (!lastResult.ok)
17
- return lastResult;
18
- }
19
- return lastResult;
20
- }
21
- export function findFeatureStepsFromStatement(statement, steppers, world, base, seqStart, inc = 1) {
22
- const featureSteps = [];
23
- if (!world.runtime.backgrounds) {
24
- throw new Error('runtime.backgrounds is undefined; cannot expand inline Backgrounds');
25
- }
26
- const backgroundFeature = { path: `from ${statement}`, base, name: 'inline-backgrounds', content: `Backgrounds: ${statement}` };
27
- const expanded = expandLine(statement, world.runtime.backgrounds, backgroundFeature);
28
- // Increment the last segment of seqStart by inc for each expanded step
29
- const prefix = seqStart.slice(0, -1);
30
- let latest = seqStart[seqStart.length - 1];
31
- for (const x of expanded) {
32
- const seqPath = [...prefix, latest];
33
- const { featureStep } = getActionableStatement(steppers, x.line, x.feature.path, seqPath);
34
- latest += inc;
35
- featureSteps.push(featureStep);
36
- }
37
- return featureSteps;
38
- }
39
- //# sourceMappingURL=featureStep-executor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"featureStep-executor.js","sourceRoot":"","sources":["../../../src/lib/util/featureStep-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAA+C,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,SAAiB,EAAE,IAAY,EAAE,QAAoB,EAAE,KAAa,EAAE,QAAkB,EA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AM,QAAQ,GAAG,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IACrF,uEAAuE;IACvE,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrC,IAAI,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC3C,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAG,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,MAAM,EAAE,WAAW,EAAE,GAAG,sBAAsB,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1F,MAAM,IAAI,GAAG,CAAC;QACd,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare function parseMatches(docs: {
2
- [name: string]: string | undefined;
3
- }, base: string, matches: RegExp[]): Promise<void>;
4
- //# sourceMappingURL=parse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/steps/lib/parse.ts"],"names":[],"mappings":"AAGA,wBAAsB,YAAY,CAAC,IAAI,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,iBAgC/G"}
@@ -1,42 +0,0 @@
1
- import { readFileSync, writeFileSync } from 'fs';
2
- import TurndownService from 'turndown';
3
- export async function parseMatches(docs, base, matches) {
4
- const conditions = [];
5
- for (const doc of Object.keys(docs)) {
6
- let markdown = docs[doc];
7
- const loc = `${base}/refs/${doc}.md`;
8
- if (!markdown) {
9
- try {
10
- markdown = readFileSync(loc, 'utf-8');
11
- }
12
- catch (e) {
13
- const content = await fetchFileOrUri(doc);
14
- const turndownService = new TurndownService();
15
- markdown = turndownService.turndown(content);
16
- writeFileSync(loc, markdown);
17
- }
18
- }
19
- for (const match of matches) {
20
- const matches = markdown.matchAll(match);
21
- for (const match of matches) {
22
- const [m] = match;
23
- conditions.push({
24
- doc,
25
- condition: m,
26
- index: match.index,
27
- });
28
- }
29
- writeFileSync(`${base}/features/${doc}.md`, conditions.map((c) => c.condition).join('\n'));
30
- }
31
- console.info('wrote', Object.keys(docs));
32
- }
33
- }
34
- async function fetchFileOrUri(doc) {
35
- console.info(`fetching ${doc}`);
36
- if (doc.includes('://')) {
37
- const response = await fetch(doc);
38
- return await response.text();
39
- }
40
- return readFileSync(doc, 'utf-8');
41
- }
42
- //# sourceMappingURL=parse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/steps/lib/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACjD,OAAO,eAAe,MAAM,UAAU,CAAC;AAEvC,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAA4C,EAAE,IAAY,EAAE,OAAiB;IAE9G,MAAM,UAAU,GAAG,EAAE,CAAC;IAEtB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACzB,MAAM,GAAG,GAAG,GAAG,IAAI,SAAS,GAAG,KAAK,CAAC;QACrC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,IAAI,CAAC;gBACH,QAAQ,GAAG,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YACxC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,OAAO,GAAG,MAAM,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0 @@
1
- import { AStepper } from '../lib/astepper.js';
2
- declare const Parse: {
3
- new (): {
4
- steps: {
5
- must: {
6
- match: RegExp;
7
- action: () => Promise<import("../lib/defs.js").TNotOKActionResult>;
8
- };
9
- fulfills: {
10
- gwta: string;
11
- action: () => Promise<import("../lib/defs.js").TOKActionResult>;
12
- };
13
- conformance: {
14
- gwta: string;
15
- action: () => Promise<import("../lib/defs.js").TNotOKActionResult | import("../lib/defs.js").TOKActionResult>;
16
- };
17
- };
18
- world?: import("../lib/defs.js").TWorld;
19
- cycles?: import("../lib/defs.js").IStepperCycles;
20
- setWorld(world: import("../lib/defs.js").TWorld, steppers: AStepper[]): Promise<void>;
21
- getWorld(): import("../lib/defs.js").TWorld;
22
- };
23
- };
24
- export default Parse;
25
- //# sourceMappingURL=parse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/steps/parse.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;CAwBV,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,31 +0,0 @@
1
- import { actionNotOK, actionOK } from '../lib/util/index.js';
2
- import { OK } from '../lib/defs.js';
3
- import { AStepper } from '../lib/astepper.js';
4
- const Parse = class Parse extends AStepper {
5
- steps = {
6
- must: {
7
- match: /(?!\n|. )\b([A-Z].*? must .*?\.)/,
8
- action: async () => Promise.resolve(actionNotOK('not implemented')),
9
- },
10
- fulfills: {
11
- gwta: 'fulfills: {what}',
12
- action: async () => {
13
- return Promise.resolve(actionOK());
14
- },
15
- },
16
- conformance: {
17
- gwta: `has annotated conformance doc from {where: string}`,
18
- action: async () => {
19
- try {
20
- // await parseMatches({ where: undefined }, this.getWorld().options.base as string, [conformance]);
21
- }
22
- catch (e) {
23
- return Promise.resolve(actionNotOK(e.message));
24
- }
25
- return Promise.resolve(OK);
26
- },
27
- },
28
- };
29
- };
30
- export default Parse;
31
- //# sourceMappingURL=parse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/steps/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,KAAK,GAAG,MAAM,KAAM,SAAQ,QAAQ;IACzC,KAAK,GAAG;QACP,IAAI,EAAE;YACL,KAAK,EAAE,kCAAkC;YACzC,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;SACnE;QACD,QAAQ,EAAE;YACT,IAAI,EAAE,kBAAkB;YACxB,MAAM,EAAE,KAAK,IAAI,EAAE;gBAClB,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YACpC,CAAC;SACD;QACD,WAAW,EAAE;YACZ,IAAI,EAAE,oDAAoD;YAC1D,MAAM,EAAE,KAAK,IAAI,EAAE;gBAClB,IAAI,CAAC;oBACJ,mGAAmG;gBACpG,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACZ,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChD,CAAC;gBACD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC5B,CAAC;SACD;KACD,CAAC;CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}