@autometa/runner 0.6.4 → 1.0.0-rc.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/dsl/create-runner.ts","../src/core/runner-context.ts","../src/core/parameter-registry.ts","../src/builder/create-runner-builder.ts","../src/dsl/create-global-runner.ts","../src/dsl/create-decorator-runner.ts","../src/decorators/create-runner-decorators.ts","../src/bindings/create-bindings-ts.ts","../src/tokens.ts","../src/runtime/coordinate-runner-feature.ts","../src/current.ts","../src/index.ts","../src/global.ts","../src/cucumber-runner.ts"],"names":["createContainer","Scope","createStepRuntime","options"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4BA;AAAA,EACC;AAAA,OAEM;;;AC/BP;AAAA,EACC;AAAA,EACA;AAAA,OAIM;AACP,SAAS,oBAAoB;;;ACN7B,SAAS,6BAA6B;AADtC;AAQO,IAAM,2BAAN,MAAgE;AAAA,EAGtE,YAAY,UAA2C,CAAC,GAAG;AAF3D,uBAAS,WAAT;AAGC,uBAAK,WAAY,QAAQ,YAAY,IAAI,sBAAsB;AAAA,EAChE;AAAA,EAEA,IAAI,WAAkC;AACrC,WAAO,mBAAK;AAAA,EACb;AAAA,EAEA,IAAI,iBAAmD;AACtD,WAAO,mBAAK,WAAU;AAAA,EACvB;AAAA,EAEA,iBAAiB,MAAkD;AAClE,WAAO,mBAAK,WAAU,iBAAiB,IAAI;AAAA,EAC5C;AAAA,EAEA,eACC,qBACA,kBACA,MACqC;AACrC,WAAO,mBAAK,WAAU,eAAe,qBAAqB,kBAAkB,IAAI;AAAA,EACjF;AAAA,EAEA,oBAAoB,YAA6C;AAChE,UAAM,YAAY;AAClB,uBAAK,WAAU,oBAAoB,SAAS;AAC5C,WAAO;AAAA,EACR;AACD;AA/BU;AAiCH,SAAS,+BACf,SAC2B;AAC3B,SAAO,IAAI,yBAAyB,OAAO;AAC5C;;;ADPO,IAAM,gBAAN,MAAM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EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;;;ACtEP,IAAI;AAEJ,SAAS,kBAAkB,SAA+B;AACzD,SAAO,mBAAgC,OAAO;AAC/C;AAEA,SAAS,kBAAkB,QAA2C;AACrE,MAAI,CAAC,gBAAgB;AACpB,UAAM,IAAI;AAAA,MACT,0CAA0C,MAAM;AAAA,IACjD;AAAA,EACD;AACA,SAAO;AACR;AACO,SAAS,gBAAgB,SAA+B;AAC9D,MAAI,CAAC,gBAAgB;AACpB,qBAAiB,kBAAkB,OAAO;AAAA,EAC3C;AACA,SAAO;AACR;AAEO,SAAS,sBAAsB,SAA+B;AACpE,mBAAiB,kBAAkB,OAAO;AAC1C,SAAO;AACR;AAEO,SAAS,kBAAkB,SAA+B;AAChE,mBAAiB,kBAAkB,OAAO;AAC1C,SAAO;AACR;AAEO,SAAS,sBAAsB;AACrC,mBAAiB;AAClB;AAEO,SAAS,2BACf,aACC;AACD,QAAM,SAAS;AAAA,IACd;AAAA,EACD;AACA,SAAO,OAAO,eAAe,WAAW;AACzC;AAEO,SAAS,6BAA6B;AAC5C,QAAM,SAAS;AAAA,IACd;AAAA,EACD;AACA,SAAO,OAAO,eAAe;AAC9B;AAEO,SAAS,4BAA4B;AAC3C,SAAO;AAAA,IACN;AAAA,EACD;AACD;;;ACnDO,IAAM,iBAAN,MAAqB;AAAA,EAC3B,OAAO,QAIN,SACwC;AACxC,WAAO,oBAA4C,OAAO;AAAA,EAC3D;AAAA,EAEA,OAAO,SAGL,OAAyD;AAC1D,0BAAsB,KAAK;AAAA,EAC5B;AAAA,EAEA,OAAO,QAGyC;AAC/C,WAAO,sBAA8C;AAAA,EACtD;AAAA,EAEA,OAAO,aAAmB;AACzB,4BAAwB;AAAA,EACzB;AACD","sourcesContent":["import type {\n\tHookDsl,\n\tHookHandler,\n\tHookRegistration,\n\tScopePlan,\n\tScopesDsl,\n\tStepArgumentsForExpression,\n\tStepDefinition,\n\tStepDsl,\n\tStepExpression,\n\tStepHandler,\n\tStepOptions,\n\tStepTagInput,\n\tHookDefinition,\n\tHookOptions,\n\tCucumberExpressionTypeMap,\n\tDefaultCucumberExpressionTypes,\n\tWithDefaultCucumberExpressionTypes,\n} from \"@autometa/scopes\";\nimport type {\n\tParameterTypeDefinition,\n\tParameterTypeDefinitions,\n} from \"@autometa/cucumber-expressions\";\nimport type {\n\tParameterType,\n\tParameterTypeRegistry,\n} from \"@cucumber/cucumber-expressions\";\n\nimport {\n\tcreateStepRuntime,\n\ttype StepRuntimeHelpers,\n} from \"@autometa/executor\";\n\nimport {\n\tRunnerContext,\n\ttype RunnerContextOptions,\n} from \"../core/runner-context\";\n\ntype StepHandlerWithOptionalThis<\n\tWorld,\n\tTArgs extends unknown[]\n> =\n\t| ((this: World, ...args: TArgs) => unknown | Promise<unknown>)\n\t| ((...args: TArgs) => unknown | Promise<unknown>);\n\nexport type RuntimeAwareStepHandler<\n\tWorld,\n\tTArgs extends unknown[] = unknown[]\n> = StepHandlerWithOptionalThis<\n\tWorld,\n\t[...TArgs, StepRuntimeHelpers, World]\n>;\n\nexport type RunnerStepHandler<\n\tWorld,\n\tTArgs extends unknown[] = unknown[]\n> =\n\t| StepHandlerWithOptionalThis<World, [...TArgs, World]>\n\t| RuntimeAwareStepHandler<World, TArgs>;\n\ntype StepExpressionArguments<\n\tExpression extends StepExpression,\n\tExpressionTypes extends CucumberExpressionTypeMap\n> = StepArgumentsForExpression<\n\tExpression,\n\tWithDefaultCucumberExpressionTypes<ExpressionTypes>\n>;\n\nexport interface RunnerStepDsl<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap\n> {\n\t<Expression extends StepExpression>(\n\t\texpression: Expression,\n\t\thandler: StepHandlerWithOptionalThis<\n\t\t\tWorld,\n\t\t\t[\n\t\t\t\t...StepExpressionArguments<Expression, ExpressionTypes>,\n\t\t\t\tWorld\n\t\t\t]\n\t\t>,\n\t\toptions?: StepOptions\n\t): StepDefinition<World>;\n\t<Expression extends StepExpression>(\n\t\texpression: Expression,\n\t\thandler: StepHandlerWithOptionalThis<\n\t\t\tWorld,\n\t\t\t[\n\t\t\t\t...StepExpressionArguments<Expression, ExpressionTypes>,\n\t\t\t\tStepRuntimeHelpers,\n\t\t\t\tWorld\n\t\t\t]\n\t\t>,\n\t\toptions?: StepOptions\n\t): StepDefinition<World>;\n\tskip: RunnerStepDsl<World, ExpressionTypes>;\n\tonly: RunnerStepDsl<World, ExpressionTypes>;\n\tfailing: RunnerStepDsl<World, ExpressionTypes>;\n\tconcurrent: RunnerStepDsl<World, ExpressionTypes>;\n\ttags: (\n\t\t...tags: readonly StepTagInput[]\n\t) => RunnerStepDsl<World, ExpressionTypes>;\n}\n\nexport interface RunnerHookDsl<World> {\n\t(handler: HookHandler<World>, options?: HookOptions): HookRegistration<World>;\n\t(\n\t\tdescription: string,\n\t\thandler: HookHandler<World>,\n\t\toptions?: HookOptions\n\t): HookRegistration<World>;\n\tskip: RunnerHookDsl<World>;\n\tonly: RunnerHookDsl<World>;\n\tfailing: RunnerHookDsl<World>;\n\tconcurrent: RunnerHookDsl<World>;\n}\n\nconst hookWrapperCache = new WeakMap<HookDsl<unknown>, RunnerHookDsl<unknown>>();\n\nfunction wrapHook<World>(hook: HookDsl<World>): RunnerHookDsl<World> {\n\tif (typeof hook !== \"function\") {\n\t\tthrow new TypeError(\"Hook DSL must be a function\");\n\t}\n\tconst cached = hookWrapperCache.get(hook as HookDsl<unknown>);\n\tif (cached) {\n\t\treturn cached as RunnerHookDsl<World>;\n\t}\n\n\tconst callable = ((\n\t\tfirst: string | HookHandler<World>,\n\t\tsecond?: HookHandler<World> | HookOptions,\n\t\tthird?: HookOptions\n\t) => {\n\t\tif (typeof first === \"string\") {\n\t\t\treturn (hook as unknown as (\n\t\t\t\tdescription: string,\n\t\t\t\thandler: HookHandler<World>,\n\t\t\t\toptions?: HookOptions\n\t\t\t) => HookDefinition<World>)(first, second as HookHandler<World>, third);\n\t\t}\n\t\treturn (hook as unknown as (\n\t\t\thandler: HookHandler<World>,\n\t\t\toptions?: HookOptions\n\t\t) => HookDefinition<World>)(first as HookHandler<World>, second as HookOptions | undefined);\n\t}) as RunnerHookDsl<World>;\n\n\thookWrapperCache.set(hook as HookDsl<unknown>, callable as RunnerHookDsl<unknown>);\n\n\tconst assignVariant = (\n\t\tvariant: keyof RunnerHookDsl<World>,\n\t\tsource: unknown\n\t) => {\n\t\tif (typeof source === \"function\") {\n\t\t\t(callable as RunnerHookDsl<World>)[variant] = wrapHook(\n\t\t\t\tsource as HookDsl<World>\n\t\t\t);\n\t\t}\n\t};\n\n\tassignVariant(\"skip\", hook.skip);\n\tassignVariant(\"only\", hook.only);\n\tassignVariant(\"failing\", hook.failing);\n\tassignVariant(\"concurrent\", hook.concurrent);\n\n\treturn callable;\n}\n\nfunction wrapStepHandler<World, TArgs extends unknown[]>(\n\thandler: RunnerStepHandler<World, TArgs>\n): StepHandler<World, TArgs> {\n\treturn ((world: World, ...args: TArgs) => {\n\t\tconst runtime = createStepRuntime(world);\n\t\tconst withRuntime = handler as StepHandlerWithOptionalThis<\n\t\t\tWorld,\n\t\t\t[...TArgs, StepRuntimeHelpers, World]\n\t\t>;\n\t\tconst withoutRuntime = handler as StepHandlerWithOptionalThis<\n\t\t\tWorld,\n\t\t\t[...TArgs, World]\n\t\t>;\n\t\tconst paramLength = typeof handler === \"function\" ? handler.length : 0;\n\t\tconst expectsRuntime = paramLength > args.length + 1;\n\t\tconst invocationArgs = expectsRuntime\n\t\t\t? [...args, runtime, world]\n\t\t\t: [...args, world];\n\t\tconst callable = expectsRuntime ? withRuntime : withoutRuntime;\n\t\treturn Reflect.apply(callable, world, invocationArgs);\n\t}) as StepHandler<World, TArgs>;\n}\n\n\nfunction enhanceStepDsl<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap\n>(dsl: StepDsl<World, ExpressionTypes>): RunnerStepDsl<World, ExpressionTypes> {\n\tconst cache = new Map<\n\t\tStepDsl<World, ExpressionTypes>,\n\t\tRunnerStepDsl<World, ExpressionTypes>\n\t>();\n\n\tconst convert = (\n\t\tsource: StepDsl<World, ExpressionTypes>\n\t): RunnerStepDsl<World, ExpressionTypes> => {\n\t\tconst existing = cache.get(source);\n\t\tif (existing) {\n\t\t\treturn existing;\n\t\t}\n\n\t\tconst invoke = (<Expression extends StepExpression>(\n\t\t\texpression: Expression,\n\t\t\thandler: RunnerStepHandler<\n\t\t\t\tWorld,\n\t\t\t\tStepArgumentsForExpression<\n\t\t\t\t\tExpression,\n\t\t\t\t\tWithDefaultCucumberExpressionTypes<ExpressionTypes>\n\t\t\t\t>\n\t\t\t>,\n\t\t\toptions?: StepOptions\n\t\t) =>\n\t\t\tsource(\n\t\t\t\texpression,\n\t\t\t\twrapStepHandler<\n\t\t\t\t\tWorld,\n\t\t\t\t\tStepArgumentsForExpression<\n\t\t\t\t\t\tExpression,\n\t\t\t\t\t\tWithDefaultCucumberExpressionTypes<ExpressionTypes>\n\t\t\t\t\t>\n\t\t\t\t>(handler),\n\t\t\t\toptions\n\t\t\t)) as RunnerStepDsl<World, ExpressionTypes>;\n\n\t\tcache.set(source, invoke);\n\n\t\tinvoke.skip = convert(source.skip);\n\t\tinvoke.only = convert(source.only);\n\t\tinvoke.failing = convert(source.failing);\n\t\tinvoke.concurrent = convert(source.concurrent);\n\t\tinvoke.tags = (\n\t\t\t...inputs: readonly StepTagInput[]\n\t\t) => convert(source.tags(...inputs));\n\n\t\treturn invoke;\n\t};\n\n\treturn convert(dsl);\n}\n\ntype BaseScopesDsl<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap\n> = Omit<\n\tScopesDsl<World, ExpressionTypes>,\n\t| \"given\"\n\t| \"when\"\n\t| \"then\"\n\t| \"and\"\n\t| \"but\"\n\t| \"Given\"\n\t| \"When\"\n\t| \"Then\"\n\t| \"And\"\n\t| \"But\"\n\t| \"beforeFeature\"\n\t| \"afterFeature\"\n\t| \"beforeRule\"\n\t| \"afterRule\"\n\t| \"beforeScenario\"\n\t| \"afterScenario\"\n\t| \"beforeScenarioOutline\"\n\t| \"afterScenarioOutline\"\n\t| \"beforeStep\"\n\t| \"afterStep\"\n>;\n\nexport interface RunnerDsl<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n> extends BaseScopesDsl<World, WithDefaultCucumberExpressionTypes<ExpressionTypes>> {\n\treadonly given: RunnerStepDsl<World, ExpressionTypes>;\n\treadonly when: RunnerStepDsl<World, ExpressionTypes>;\n\treadonly then: RunnerStepDsl<World, ExpressionTypes>;\n\treadonly and: RunnerStepDsl<World, ExpressionTypes>;\n\treadonly but: RunnerStepDsl<World, ExpressionTypes>;\n\treadonly Given: RunnerStepDsl<World, ExpressionTypes>;\n\treadonly When: RunnerStepDsl<World, ExpressionTypes>;\n\treadonly Then: RunnerStepDsl<World, ExpressionTypes>;\n\treadonly And: RunnerStepDsl<World, ExpressionTypes>;\n\treadonly But: RunnerStepDsl<World, ExpressionTypes>;\n\treadonly beforeFeature: RunnerHookDsl<World>;\n\treadonly afterFeature: RunnerHookDsl<World>;\n\treadonly beforeRule: RunnerHookDsl<World>;\n\treadonly afterRule: RunnerHookDsl<World>;\n\treadonly beforeScenario: RunnerHookDsl<World>;\n\treadonly afterScenario: RunnerHookDsl<World>;\n\treadonly beforeScenarioOutline: RunnerHookDsl<World>;\n\treadonly afterScenarioOutline: RunnerHookDsl<World>;\n\treadonly beforeStep: RunnerHookDsl<World>;\n\treadonly afterStep: RunnerHookDsl<World>;\n\treadonly BeforeFeature: RunnerHookDsl<World>;\n\treadonly AfterFeature: RunnerHookDsl<World>;\n\treadonly BeforeRule: RunnerHookDsl<World>;\n\treadonly AfterRule: RunnerHookDsl<World>;\n\treadonly BeforeScenario: RunnerHookDsl<World>;\n\treadonly AfterScenario: RunnerHookDsl<World>;\n\treadonly BeforeScenarioOutline: RunnerHookDsl<World>;\n\treadonly AfterScenarioOutline: RunnerHookDsl<World>;\n\treadonly BeforeStep: RunnerHookDsl<World>;\n\treadonly AfterStep: RunnerHookDsl<World>;\n}\n\nexport interface RunnerEnvironment<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n> extends RunnerDsl<World, ExpressionTypes> {\n\treadonly context: RunnerContext<World, ExpressionTypes>;\n\treadonly parameterRegistry: ParameterTypeRegistry;\n\treadonly getPlan: () => ScopePlan<World>;\n\treadonly defineParameterType: (\n\t\tdefinition: ParameterTypeDefinition<World>\n\t) => ParameterType<unknown>;\n\treadonly defineParameterTypes: (\n\t\t...definitions: ParameterTypeDefinition<World>[]\n\t) => ParameterTypeRegistry;\n\treadonly defineParameterTypesFromList: (\n\t\tdefinitions: ParameterTypeDefinitions<World>\n\t) => ParameterTypeRegistry;\n\treadonly registerDefaultParameterTypes: () => ParameterTypeRegistry;\n\treadonly lookupParameterType: (\n\t\tname: string\n\t) => ParameterType<unknown> | undefined;\n}\n\nexport function createRunner<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n>(\n\toptions: RunnerContextOptions<World> = {}\n): RunnerEnvironment<World, ExpressionTypes> {\n\tconst context = new RunnerContext<World, ExpressionTypes>(options);\n\tconst scopes = context.scopes;\n\n\tconst given = enhanceStepDsl<World, ExpressionTypes>(scopes.given);\n\tconst when = enhanceStepDsl<World, ExpressionTypes>(scopes.when);\n\tconst then = enhanceStepDsl<World, ExpressionTypes>(scopes.then);\n\tconst and = enhanceStepDsl<World, ExpressionTypes>(scopes.and);\n\tconst but = enhanceStepDsl<World, ExpressionTypes>(scopes.but);\n\n\tconst defineParameterTypesFromList = (\n\t\tdefinitions: ParameterTypeDefinitions<World>\n\t) => context.defineParameterTypes(...definitions);\n\n\tconst beforeFeatureHook = wrapHook(scopes.beforeFeature);\n\tconst afterFeatureHook = wrapHook(scopes.afterFeature);\n\tconst beforeRuleHook = wrapHook(scopes.beforeRule);\n\tconst afterRuleHook = wrapHook(scopes.afterRule);\n\tconst beforeScenarioHook = wrapHook(scopes.beforeScenario);\n\tconst afterScenarioHook = wrapHook(scopes.afterScenario);\n\tconst beforeScenarioOutlineHook = wrapHook(scopes.beforeScenarioOutline);\n\tconst afterScenarioOutlineHook = wrapHook(scopes.afterScenarioOutline);\n\tconst beforeStepHook = wrapHook(scopes.beforeStep);\n\tconst afterStepHook = wrapHook(scopes.afterStep);\n\n\tconst environment: RunnerEnvironment<World, ExpressionTypes> = {\n\t\tcontext,\n\t\tparameterRegistry: context.parameterRegistry,\n\t\tgetPlan: () => context.plan,\n\t\tdefineParameterType: (definition) => context.defineParameterType(definition),\n\t\tdefineParameterTypes: (...definitions) =>\n\t\t\tcontext.defineParameterTypes(...definitions),\n\t\tdefineParameterTypesFromList,\n\t\tregisterDefaultParameterTypes: () =>\n\t\t\tcontext.registerDefaultParameterTypes(),\n\t\tlookupParameterType: (name) => context.lookupParameterType(name),\n\t\tfeature: scopes.feature,\n\t\trule: scopes.rule,\n\t\tscenario: scopes.scenario,\n\t\tscenarioOutline: scopes.scenarioOutline,\n\t\tgiven,\n\t\twhen,\n\t\tthen,\n\t\tand,\n\t\tbut,\n\t\tbeforeFeature: beforeFeatureHook,\n\t\tafterFeature: afterFeatureHook,\n\t\tbeforeRule: beforeRuleHook,\n\t\tafterRule: afterRuleHook,\n\t\tbeforeScenario: beforeScenarioHook,\n\t\tafterScenario: afterScenarioHook,\n\t\tbeforeScenarioOutline: beforeScenarioOutlineHook,\n\t\tafterScenarioOutline: afterScenarioOutlineHook,\n\t\tbeforeStep: beforeStepHook,\n\t\tafterStep: afterStepHook,\n\t\tGiven: given,\n\t\tWhen: when,\n\t\tThen: then,\n\t\tAnd: and,\n\t\tBut: but,\n\t\tplan: scopes.plan,\n\t\tBeforeFeature: beforeFeatureHook,\n\t\tAfterFeature: afterFeatureHook,\n\t\tBeforeRule: beforeRuleHook,\n\t\tAfterRule: afterRuleHook,\n\t\tBeforeScenario: beforeScenarioHook,\n\t\tAfterScenario: afterScenarioHook,\n\t\tBeforeScenarioOutline: beforeScenarioOutlineHook,\n\t\tAfterScenarioOutline: afterScenarioOutlineHook,\n\t\tBeforeStep: beforeStepHook,\n\t\tAfterStep: afterStepHook,\n\t};\n\n\treturn environment;\n}\n","import {\n\tcreateDefaultParameterTypes,\n\tcreateParameterTypes,\n\ttype CreateParameterTypesOptions,\n\ttype ParameterTypeDefinition,\n\ttype ParameterTypeDefinitions,\n} from \"@autometa/cucumber-expressions\";\nimport { createScopes } from \"@autometa/scopes\";\nimport type {\n\tCreateScopesOptions,\n CucumberExpressionTypeMap,\n\tScopePlan,\n\tScopesDsl,\n WithDefaultCucumberExpressionTypes,\n DefaultCucumberExpressionTypes,\n} from \"@autometa/scopes\";\nimport type {\n\tParameterType,\n\tParameterTypeRegistry,\n} from \"@cucumber/cucumber-expressions\";\n\nimport {\n\tParameterRegistryAdapter,\n\tcreateParameterRegistryAdapter,\n} from \"./parameter-registry\";\n\nexport type RunnerScopeOptions<World> = Omit<\n\tCreateScopesOptions<World>,\n\t\"parameterRegistry\"\n>;\n\nexport interface RunnerContextOptions<World>\n\textends RunnerScopeOptions<World> {\n\treadonly parameterRegistry?: ParameterTypeRegistry;\n\treadonly parameterTypes?: ParameterTypeDefinitions<World>;\n\treadonly parameterTypesOptions?: CreateParameterTypesOptions;\n\treadonly registerDefaultParameterTypes?: boolean;\n}\n\nexport class RunnerContext<World, ExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes> {\n\tprivate readonly scopesInternal: ScopesDsl<\n\t\tWorld,\n\t\tWithDefaultCucumberExpressionTypes<ExpressionTypes>\n\t>;\n\tprivate readonly registryAdapter: ParameterRegistryAdapter;\n\tprivate readonly defineParameterTypeFn: ReturnType<\n\t\ttypeof createParameterTypes<World>\n\t>;\n\tprivate readonly registerDefaultParameterTypesFn: ReturnType<\n\t\ttypeof createDefaultParameterTypes<World>\n\t>;\n\n\tconstructor(options: RunnerContextOptions<World> = {}) {\n\t\tthis.registryAdapter = options.parameterRegistry\n\t\t\t? createParameterRegistryAdapter({ registry: options.parameterRegistry })\n\t\t\t: createParameterRegistryAdapter();\n\t\tthis.defineParameterTypeFn = createParameterTypes<World>(\n\t\t\toptions.parameterTypesOptions\n\t\t);\n\t\tthis.registerDefaultParameterTypesFn = createDefaultParameterTypes<World>(\n\t\t\toptions.parameterTypesOptions\n\t\t);\n\n\t\tconst scopeOptions = RunnerContext.extractScopeOptions(options);\n\t\tthis.scopesInternal = createScopes<World, ExpressionTypes>({\n\t\t\t...scopeOptions,\n\t\t\tparameterRegistry: this.registryAdapter,\n\t\t});\n\n\t\tif (options.registerDefaultParameterTypes !== false) {\n\t\t\tthis.registerDefaultParameterTypes();\n\t\t}\n\n\t\tif (options.parameterTypes && options.parameterTypes.length > 0) {\n\t\t\tthis.defineParameterTypes(...options.parameterTypes);\n\t\t}\n\t}\n\n\tget scopes(): ScopesDsl<World, WithDefaultCucumberExpressionTypes<ExpressionTypes>> {\n\t\treturn this.scopesInternal;\n\t}\n\n\tget parameterRegistry(): ParameterTypeRegistry {\n\t\treturn this.registryAdapter.registry;\n\t}\n\n\tget parameterRegistryAdapter(): ParameterRegistryAdapter {\n\t\treturn this.registryAdapter;\n\t}\n\n\tget plan(): ScopePlan<World> {\n\t\treturn this.scopesInternal.plan();\n\t}\n\n\tdefineParameterType(\n\t\tdefinition: ParameterTypeDefinition<World>\n\t): ParameterType<unknown> {\n\t\treturn this.defineParameterTypeFn(this.parameterRegistry, definition);\n\t}\n\n\tdefineParameterTypes(\n\t\t...definitions: ParameterTypeDefinition<World>[]\n\t): ParameterTypeRegistry {\n\t\tthis.defineParameterTypeFn.many(this.parameterRegistry, ...definitions);\n\t\treturn this.parameterRegistry;\n\t}\n\n\tregisterDefaultParameterTypes(): ParameterTypeRegistry {\n\t\treturn this.registerDefaultParameterTypesFn(this.parameterRegistry);\n\t}\n\n\tlookupParameterType(name: string): ParameterType<unknown> | undefined {\n\t\treturn this.parameterRegistry.lookupByTypeName(name);\n\t}\n\n\tstatic extractScopeOptions<World>(\n\t\toptions: RunnerContextOptions<World>\n\t): RunnerScopeOptions<World> {\n\t\tconst {\n\t\t\tparameterRegistry: _parameterRegistry,\n\t\t\tparameterTypes: _parameterTypes,\n\t\t\tparameterTypesOptions: _parameterTypesOptions,\n\t\t\tregisterDefaultParameterTypes: _registerDefaultParameterTypes,\n\t\t\t...scopeOptions\n\t\t} = options;\n\t\treturn scopeOptions;\n\t}\n}\n","import type { ParameterType } from \"@cucumber/cucumber-expressions\";\nimport { ParameterTypeRegistry } from \"@cucumber/cucumber-expressions\";\nimport type { ParameterRegistryLike } from \"@autometa/scopes\";\n\nexport interface ParameterRegistryAdapterOptions {\n\treadonly registry?: ParameterTypeRegistry;\n}\n\nexport class ParameterRegistryAdapter implements ParameterRegistryLike {\n\treadonly #registry: ParameterTypeRegistry;\n\n\tconstructor(options: ParameterRegistryAdapterOptions = {}) {\n\t\tthis.#registry = options.registry ?? new ParameterTypeRegistry();\n\t}\n\n\tget registry(): ParameterTypeRegistry {\n\t\treturn this.#registry;\n\t}\n\n\tget parameterTypes(): Iterable<ParameterType<unknown>> {\n\t\treturn this.#registry.parameterTypes;\n\t}\n\n\tlookupByTypeName(name: string): ParameterType<unknown> | undefined {\n\t\treturn this.#registry.lookupByTypeName(name);\n\t}\n\n\tlookupByRegexp(\n\t\tparameterTypeRegexp: string,\n\t\texpressionRegexp: RegExp,\n\t\ttext: string\n\t): ParameterType<unknown> | undefined {\n\t\treturn this.#registry.lookupByRegexp(parameterTypeRegexp, expressionRegexp, text);\n\t}\n\n\tdefineParameterType(definition: unknown): ParameterType<unknown> {\n\t\tconst parameter = definition as ParameterType<unknown>;\n\t\tthis.#registry.defineParameterType(parameter);\n\t\treturn parameter;\n\t}\n}\n\nexport function createParameterRegistryAdapter(\n\toptions?: ParameterRegistryAdapterOptions\n): ParameterRegistryAdapter {\n\treturn new ParameterRegistryAdapter(options);\n}\n","import {\n\tcreateDefaultEnsureFactory,\n\tcreateEnsureFactory,\n\tensure as baseEnsure,\n\ttype AssertionPlugin,\n\ttype EnsureFacade,\n\ttype EnsureInvoke,\n\ttype EnsurePluginFacets,\n\ttype EnsureFactory,\n\ttype EnsureOptions,\n\ttype EnsureChain,\n} from \"@autometa/assertions\";\nimport type { CoordinateFeatureResult } from \"@autometa/coordinator\";\nimport type { SimpleFeature } from \"@autometa/gherkin\";\nimport {\n\tcreateContainer,\n\tScope,\n\ttype Constructor,\n\ttype IContainer,\n\ttype Identifier,\n\ttype RegistrationOptions,\n\ttype Token,\n} from \"@autometa/injection\";\nimport { createStepRuntime, tryGetWorld } from \"@autometa/executor\";\nimport type {\n\tCucumberExpressionTypeMap,\n\tDefaultCucumberExpressionTypes,\n\tWorldFactory,\n\tWorldFactoryContext,\n} from \"@autometa/scopes\";\nimport type { ParameterTypeDefinitions } from \"@autometa/cucumber-expressions\";\nimport type { RunnerContextOptions } from \"../core/runner-context\";\nimport {\n\tcreateRunner,\n\ttype RunnerEnvironment,\n} from \"../dsl/create-runner\";\nimport {\n\tcreateGlobalRunner,\n\ttype GlobalRunner,\n} from \"../dsl/create-global-runner\";\nimport {\n\tcreateDecoratorRunner,\n\ttype DecoratorRunnerEnvironment,\n} from \"../dsl/create-decorator-runner\";\nimport {\n\tcreateRunnerDecorators,\n\ttype RunnerDecorators,\n} from \"../decorators/create-runner-decorators\";\nimport {\n\tcreateBindingsTS,\n\ttype RunnerBindingsSurface,\n} from \"../bindings/create-bindings-ts\";\nimport {\n\tcoordinateRunnerFeature,\n\ttype CoordinateRunnerFeatureOptions,\n} from \"../runtime/coordinate-runner-feature\";\nimport { WORLD_TOKEN } from \"../tokens\";\n\ntype Mutable<T> = {\n\t-readonly [K in keyof T]: T[K];\n};\n\nfunction normalizeWorldFactory<World>(\n\tfactory: WorldFactory<World> | (() => World | Promise<World>)\n): WorldFactory<World> {\n\tconst callable = factory as (...args: readonly unknown[]) =>\n\t\tWorld | Promise<World>;\n\tif (callable.length >= 1) {\n\t\treturn factory as WorldFactory<World>;\n\t}\n\treturn async (_context: WorldFactoryContext<World>) =>\n\t\tawait callable();\n}\n\ntype MutableRunnerContextOptions<World> = Mutable<RunnerContextOptions<World>>;\n\nexport type DefaultEnsureFacets = Record<string, never>;\n\nexport type RunnerEnsureFactory<\n\tWorld,\n\tFacets extends Record<string, unknown>\n> = Facets & {\n\t(world: World): EnsureFacade<World, Facets>;\n\t<T>(value: T, options?: EnsureOptions): EnsureChain<T>;\n\treadonly world: World;\n\treadonly not: Facets;\n};\n\nexport type AssertionSetup<\n\tWorld,\n\tFacets extends Record<string, unknown>\n> = (ensure: EnsureInvoke) => RunnerEnsureFactory<World, Facets>;\n\nexport const WORLD_INHERIT_KEYS: unique symbol = Symbol(\"autometa.runner.world.inherit\");\n\nexport type StepsEnvironmentMeta =\n\t| { readonly kind: \"root\" }\n\t| { readonly kind: \"group\"; readonly group: string };\n\nexport const STEPS_ENVIRONMENT_META: symbol = Symbol.for(\n\t\"autometa.runner.steps.environment.meta\"\n);\n\ntype WorldInheritanceMetadata = ReadonlySet<PropertyKey>;\n\ntype WorldFactoryWithInheritance<World> = WorldFactory<World> & {\n\treadonly [WORLD_INHERIT_KEYS]?: WorldInheritanceMetadata;\n};\n\ntype AppPropertyInjection =\n\t| Identifier\n\t| {\n\t\treadonly token: Identifier;\n\t\treadonly lazy?: boolean;\n\t};\n\nexport interface AppClassRegistrationOptions {\n\treadonly scope?: Scope;\n\treadonly tags?: readonly string[];\n\treadonly deps?: readonly Identifier[];\n\treadonly inject?: Record<PropertyKey, AppPropertyInjection>;\n}\n\nexport interface AppRegistrationOptions<App, World> extends AppClassRegistrationOptions {\n\treadonly configure?: (\n\t\tinstance: App,\n\t\tcontext: AppFactoryContext<World>\n\t) => void | Promise<void>;\n}\n\nexport interface AppCompositionOptions<App, World> extends AppRegistrationOptions<App, World> {\n\treadonly setup?: (context: AppFactoryContext<World>) => void | Promise<void>;\n}\n\nexport interface AppFactoryContext<World> {\n\treadonly container: IContainer;\n\treadonly world: World;\n\tregisterClass<T>(\n\t\ttarget: Constructor<T>,\n\t\toptions?: AppClassRegistrationOptions\n\t): AppFactoryContext<World>;\n\tregisterValue<T>(\n\t\tidentifier: Identifier<T>,\n\t\tvalue: T,\n\t\toptions?: RegistrationOptions\n\t): AppFactoryContext<World>;\n\tregisterFactory<T>(\n\t\tidentifier: Identifier<T>,\n\t\tfactory: (container: IContainer) => T,\n\t\toptions?: RegistrationOptions\n\t): AppFactoryContext<World>;\n\tregisterToken<T>(\n\t\ttoken: Token<T>,\n\t\ttarget: Constructor<T> | ((container: IContainer) => T),\n\t\toptions?: RegistrationOptions\n\t): AppFactoryContext<World>;\n\tregisterApp<T>(\n\t\ttarget: Constructor<T>,\n\t\toptions?: AppRegistrationOptions<T, World>\n\t): Promise<T>;\n\tgetRegisteredApp(): unknown;\n\tresolve<T>(identifier: Identifier<T>): T;\n}\n\nexport const App = {\n\tcompositionRoot<Ctor extends Constructor<unknown>, World = unknown>(\n\t\tctor: Ctor,\n\t\toptions?: AppCompositionOptions<InstanceType<Ctor>, World>\n\t): AppFactoryInput<World, InstanceType<Ctor>> {\n\t\treturn async (context) => {\n\t\t\tconst { setup, ...registration } = options ?? {};\n\t\t\tif (setup) {\n\t\t\t\tawait setup(context);\n\t\t\t}\n\t\t\tconst registered =\n\t\t\t\t(context as unknown as { getRegisteredApp?: () => unknown }).getRegisteredApp?.();\n\t\t\tif (registered !== undefined) {\n\t\t\t\treturn registered as InstanceType<Ctor>;\n\t\t\t}\n\n\t\t\t// If setup registered the app class directly, don't overwrite the binding.\n\t\t\t// Resolve it (and allow resolution errors to surface) instead of falling back.\n\t\t\tconst container = context.container as unknown as {\n\t\t\t\tisRegistered?: (id: unknown) => boolean;\n\t\t\t};\n\t\t\tif (typeof container.isRegistered === \"function\" && container.isRegistered(ctor)) {\n\t\t\t\treturn context.resolve(ctor as unknown as Identifier<InstanceType<Ctor>>);\n\t\t\t}\n\n\t\t\treturn context.registerApp(\n\t\t\t\tctor as unknown as Constructor<InstanceType<Ctor>>,\n\t\t\t\tregistration as AppRegistrationOptions<InstanceType<Ctor>, World>\n\t\t\t);\n\t\t};\n\t},\n};\n\ntype AppFactory<World, App> = (context: AppFactoryContext<World>) => App | Promise<App>;\n\ntype AppFactoryInput<World, App> =\n\t| App\n\t| (() => App | Promise<App>)\n\t| ((context: AppFactoryContext<World>) => App | Promise<App>);\n\nexport type WorldWithApp<World, App> = World extends { app: infer _Existing }\n\t? Omit<World, \"app\"> & { readonly app: App }\n\t: World & { readonly app: App };\n\nexport interface RunnerStepsSurface<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes,\n\tFacets extends Record<string, unknown> = DefaultEnsureFacets\n> extends RunnerEnvironment<World, ExpressionTypes> {\n\treadonly globals: GlobalRunner<World, ExpressionTypes>;\n\tcoordinateFeature(\n\t\toptions: RunnerCoordinateFeatureOptions<World>\n\t): CoordinateFeatureResult<World>;\n\treadonly ensure: RunnerEnsureFactory<World, Facets>;\n}\n\nexport interface RunnerDecoratorsSurface<World>\n\textends RunnerDecorators<World> {\n\treadonly environment: DecoratorRunnerEnvironment<World>;\n}\n\nexport interface RunnerBuilder<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes,\n\tFacets extends Record<string, unknown> = DefaultEnsureFacets\n> {\n\t/**\n\t * Creates an isolated copy of this builder.\n\t *\n\t * This is the foundation for per-group/per-domain runner environments.\n\t *\n\t * Notes:\n\t * - Caches are cleared on the fork.\n\t * - Factories (world/app) are copied by reference.\n\t */\n\tfork(): DerivableRunnerBuilder<World, ExpressionTypes, Facets>;\n\n\t/**\n\t * Enables group-based derivation on this builder.\n\t *\n\t * This is primarily a typing affordance; it does not change runtime behavior.\n\t */\n\tderivable(): DerivableRunnerBuilder<World, ExpressionTypes, Facets>;\n\n\t/**\n\t * Returns (and caches) a derived builder for a given group/domain key.\n\t *\n\t * The derived builder is a fork taken at first access.\n\t */\n\tgroup(key: string): DerivableRunnerBuilder<World, ExpressionTypes, Facets>;\n\n\t/**\n\t * Composes a world factory on top of the current world.\n\t *\n\t * The resulting world is a shallow merge of (baseWorld, extensionWorld), with\n\t * extension keys taking precedence.\n\t */\n\textendWorld<ExtensionWorld = Record<string, unknown>>(\n\t\tvalue?: Partial<ExtensionWorld> | WorldFactory<ExtensionWorld>\n\t): RunnerBuilder<World & ExtensionWorld, ExpressionTypes, DefaultEnsureFacets>;\n\n\t/**\n\t * Extends application configuration while preserving the existing app factory.\n\t *\n\t * App factories are executed in sequence; later factories may override the\n\t * application instance by returning/registering a different app.\n\t */\n\textendApp<App>(\n\t\tapp: AppFactoryInput<World, App>\n\t): RunnerBuilder<WorldWithApp<World, App>, ExpressionTypes, DefaultEnsureFacets>;\n\n\tconfigure(\n\t\tupdate:\n\t\t\t| Partial<RunnerContextOptions<World>>\n\t\t\t| ((\n\t\t\t\tcurrent: RunnerContextOptions<World>\n\t\t\t) => RunnerContextOptions<World>)\n\t): RunnerBuilder<World, ExpressionTypes, Facets>;\n\texpressionMap<NextExpressionTypes extends CucumberExpressionTypeMap>(): RunnerBuilder<\n\t\tWorld,\n\t\tNextExpressionTypes,\n\t\tFacets\n\t>;\n\twithWorld<NextWorld = World>(\n\t\tvalue?: Partial<NextWorld> | WorldFactory<NextWorld>\n\t): RunnerBuilder<NextWorld, ExpressionTypes, DefaultEnsureFacets>;\n\tapp<App>(\n\t\tapp: AppFactoryInput<World, App>\n\t): RunnerBuilder<\n\t\tWorldWithApp<World, App>,\n\t\tExpressionTypes,\n\t\tDefaultEnsureFacets\n\t>;\n\tassertions<\n\t\tNextFacets extends Record<string, unknown>\n\t>(\n\t\tsetup: AssertionSetup<World, NextFacets>\n\t): RunnerBuilder<World, ExpressionTypes, NextFacets>;\n\tassertionPlugins<\n\t\tNextPlugins extends Record<string, AssertionPlugin<World, unknown>>\n\t>(\n\t\tplugins: NextPlugins\n\t): RunnerBuilder<\n\t\tWorld,\n\t\tExpressionTypes,\n\t\tEnsurePluginFacets<World, NextPlugins>\n\t>;\n\tparameterTypes(\n\t\tdefinitions: ParameterTypeDefinitions<World>\n\t): RunnerBuilder<World, ExpressionTypes, Facets>;\n\tsteps(): RunnerStepsSurface<World, ExpressionTypes, Facets>;\n\tdecorators(): RunnerDecoratorsSurface<World>;\n\t/**\n\t * Returns binding decorators for TypeScript experimental decorators.\n\t * Use this for class-based step definitions with dependency injection.\n\t * \n\t * @example\n\t * ```typescript\n\t * const { Binding, Given, When, Then, Injectable, Inject } = runner.bindingsTS();\n\t * \n\t * @Injectable()\n\t * class MyService { ... }\n\t * \n\t * @Binding()\n\t * class MySteps {\n\t * constructor(\n\t * @Inject(WORLD_TOKEN) private world: MyWorld,\n\t * @Inject(MyService) private service: MyService\n\t * ) {}\n\t * \n\t * @Given(\"some step\")\n\t * myStep() { ... }\n\t * }\n\t * ```\n\t */\n\tbindingsTS(): RunnerBindingsSurface<World>;\n}\n\nexport type DerivableRunnerBuilder<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes,\n\tFacets extends Record<string, unknown> = DefaultEnsureFacets\n> = RunnerBuilder<World, ExpressionTypes, Facets>;\n\nexport type RunnerCoordinateFeatureOptions<World> = Omit<\n\tCoordinateRunnerFeatureOptions<World>,\n\t\"environment\"\n>;\n\ninterface BuilderState {\n\toptions: MutableRunnerContextOptions<unknown>;\n\tworldFactory?: WorldFactory<unknown>;\n\tappFactory?: AppFactory<unknown, unknown>;\n\tensureFactory?: RunnerEnsureFactory<unknown, Record<string, unknown>>;\n\tstepsEnvironmentMeta?: StepsEnvironmentMeta;\n\tstepsCache?: StepsCache;\n\tdecoratorsCache?: DecoratorsCache;\n\tbindingsTSCache?: BindingsTSCache;\n\tfeatureRegistry?: FeatureRegistry;\n\tderivedBuilders?: Map<string, BuilderState>;\n}\n\ninterface StepsCache {\n\tenvironment: RunnerEnvironment<unknown, CucumberExpressionTypeMap>;\n\tglobals: GlobalRunner<unknown, CucumberExpressionTypeMap>;\n\tsurface: RunnerStepsSurface<\n\t\tunknown,\n\t\tCucumberExpressionTypeMap,\n\t\tRecord<string, unknown>\n\t>;\n\tensureFactory: RunnerEnsureFactory<unknown, Record<string, unknown>>;\n}\n\ninterface DecoratorsCache {\n\tenvironment: DecoratorRunnerEnvironment<unknown>;\n\tsurface: RunnerDecoratorsSurface<unknown>;\n}\n\ninterface BindingsTSCache {\n\tsurface: RunnerBindingsSurface<unknown>;\n}\n\n\nexport function createRunnerBuilder<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n>(\n\tinitial?: Partial<RunnerContextOptions<World>>\n): RunnerBuilder<World, ExpressionTypes, DefaultEnsureFacets> {\n\tconst state = initializeState(initial);\n\treturn new RunnerBuilderImpl<\n\t\tWorld,\n\t\tExpressionTypes,\n\t\tDefaultEnsureFacets\n\t>(state);\n}\n\nclass RunnerBuilderImpl<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap,\n\tFacets extends Record<string, unknown>\n> implements RunnerBuilder<World, ExpressionTypes, Facets> {\n\tconstructor(private readonly state: BuilderState) {}\n\n\tfork(): DerivableRunnerBuilder<World, ExpressionTypes, Facets> {\n\t\tconst next = cloneBuilderState(this.state);\n\t\treturn new RunnerBuilderImpl<World, ExpressionTypes, Facets>(next);\n\t}\n\n\tderivable(): DerivableRunnerBuilder<World, ExpressionTypes, Facets> {\n\t\tif (!this.state.derivedBuilders) {\n\t\t\tthis.state.derivedBuilders = new Map();\n\t\t}\n\t\treturn this as unknown as DerivableRunnerBuilder<World, ExpressionTypes, Facets>;\n\t}\n\n\tgroup(key: string): DerivableRunnerBuilder<World, ExpressionTypes, Facets> {\n\t\tconst trimmed = key.trim();\n\t\tif (!trimmed) {\n\t\t\tthrow new Error(\"group key must be a non-empty string\");\n\t\t}\n\t\tif (!this.state.derivedBuilders) {\n\t\t\tthis.state.derivedBuilders = new Map();\n\t\t}\n\t\tconst existing = this.state.derivedBuilders.get(trimmed);\n\t\tif (existing) {\n\t\t\treturn new RunnerBuilderImpl<World, ExpressionTypes, Facets>(existing);\n\t\t}\n\t\tconst derived = cloneBuilderState(this.state);\n\t\tderived.stepsEnvironmentMeta = { kind: \"group\", group: trimmed };\n\t\tthis.state.derivedBuilders.set(trimmed, derived);\n\t\treturn new RunnerBuilderImpl<World, ExpressionTypes, Facets>(derived);\n\t}\n\n\textendWorld<ExtensionWorld = Record<string, unknown>>(\n\t\tvalue?: Partial<ExtensionWorld> | WorldFactory<ExtensionWorld>\n\t): RunnerBuilder<World & ExtensionWorld, ExpressionTypes, DefaultEnsureFacets> {\n\t\tconst baseFactory = this.state.worldFactory as WorldFactory<World> | undefined;\n\t\tconst extensionFactory: WorldFactory<ExtensionWorld> =\n\t\t\ttypeof value === \"function\"\n\t\t\t\t? (normalizeWorldFactory<ExtensionWorld>(\n\t\t\t\t\tvalue as\n\t\t\t\t\t\t| WorldFactory<ExtensionWorld>\n\t\t\t\t\t\t| (() => ExtensionWorld | Promise<ExtensionWorld>)\n\t\t\t\t) as WorldFactory<ExtensionWorld>)\n\t\t\t\t: value\n\t\t\t\t\t? (createDefaultsWorldFactory(ensureWorldDefaults(value)) as unknown as WorldFactory<ExtensionWorld>)\n\t\t\t\t\t: (async () => ({} as ExtensionWorld));\n\n\t\tconst baseInheritance = getWorldInheritance(baseFactory as WorldFactory<unknown> | undefined);\n\t\tconst extensionInheritance = getWorldInheritance(extensionFactory as WorldFactory<unknown> | undefined);\n\t\tconst inheritance =\n\t\t\tbaseInheritance || extensionInheritance\n\t\t\t\t? new Set<PropertyKey>([\n\t\t\t\t\t...(baseInheritance ? Array.from(baseInheritance) : []),\n\t\t\t\t\t...(extensionInheritance ? Array.from(extensionInheritance) : []),\n\t\t\t\t])\n\t\t\t\t: undefined;\n\n\t\tconst merged: WorldFactoryWithInheritance<World & ExtensionWorld> = async (\n\t\t\tcontext: WorldFactoryContext<World & ExtensionWorld>\n\t\t) => {\n\t\t\tconst base = baseFactory\n\t\t\t\t? await (baseFactory as WorldFactory<unknown>)(context as unknown as WorldFactoryContext<unknown>)\n\t\t\t\t: ({} as unknown);\n\t\t\tconst extension = await (extensionFactory as WorldFactory<unknown>)(\n\t\t\t\tcontext as unknown as WorldFactoryContext<unknown>\n\t\t\t);\n\t\t\tconst baseObj = ensureWorldObject(base);\n\t\t\tconst extObj = ensureWorldObject(extension);\n\t\t\treturn { ...baseObj, ...extObj } as World & ExtensionWorld;\n\t\t};\n\t\tif (inheritance && inheritance.size > 0) {\n\t\t\tObject.defineProperty(merged, WORLD_INHERIT_KEYS, {\n\t\t\t\tvalue: inheritance,\n\t\t\t\twritable: false,\n\t\t\t\tenumerable: false,\n\t\t\t\tconfigurable: false,\n\t\t\t});\n\t\t}\n\n\t\tthis.state.worldFactory = merged as unknown as WorldFactory<unknown>;\n\t\tdelete this.state.ensureFactory;\n\t\tinvalidateCaches(this.state);\n\t\treturn new RunnerBuilderImpl<\n\t\t\tWorld & ExtensionWorld,\n\t\t\tExpressionTypes,\n\t\t\tDefaultEnsureFacets\n\t\t>(this.state) as unknown as RunnerBuilder<\n\t\t\tWorld & ExtensionWorld,\n\t\t\tExpressionTypes,\n\t\t\tDefaultEnsureFacets\n\t\t>;\n\t}\n\n\textendApp<App>(\n\t\tapp: AppFactoryInput<World, App>\n\t): RunnerBuilder<WorldWithApp<World, App>, ExpressionTypes, DefaultEnsureFacets> {\n\t\tconst next = normalizeAppFactory<World, App>(app) as AppFactory<unknown, unknown>;\n\t\tconst previous = this.state.appFactory;\n\n\t\tconst chained: AppFactory<unknown, unknown> = async (context) => {\n\t\t\tlet currentApp: unknown;\n\n\t\t\tconst readRegisteredApp = (): unknown => {\n\t\t\t\tconst anyContext = context as unknown as { getRegisteredApp?: () => unknown };\n\t\t\t\treturn typeof anyContext.getRegisteredApp === \"function\"\n\t\t\t\t\t? anyContext.getRegisteredApp()\n\t\t\t\t\t: undefined;\n\t\t\t};\n\n\t\t\tconst updateWorldApp = (value: unknown): void => {\n\t\t\t\tif (!value) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst world = (context as unknown as { world?: unknown }).world;\n\t\t\t\tif (world && typeof world === \"object\") {\n\t\t\t\t\t(world as Record<string, unknown>).app = value;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (previous) {\n\t\t\t\tconst result = await previous(context as unknown as AppFactoryContext<unknown>);\n\t\t\t\tcurrentApp = result ?? readRegisteredApp();\n\t\t\t\tupdateWorldApp(currentApp);\n\t\t\t}\n\n\t\t\tconst nextResult = await next(context as unknown as AppFactoryContext<unknown>);\n\t\t\tconst nextApp = nextResult ?? readRegisteredApp();\n\t\t\tif (nextApp !== undefined) {\n\t\t\t\tcurrentApp = nextApp;\n\t\t\t\tupdateWorldApp(currentApp);\n\t\t\t}\n\n\t\t\treturn currentApp as unknown;\n\t\t};\n\n\t\tthis.state.appFactory = chained;\n\t\tdelete this.state.ensureFactory;\n\t\tinvalidateCaches(this.state);\n\t\treturn new RunnerBuilderImpl<\n\t\t\tWorldWithApp<World, App>,\n\t\t\tExpressionTypes,\n\t\t\tDefaultEnsureFacets\n\t\t>(this.state) as unknown as RunnerBuilder<\n\t\t\tWorldWithApp<World, App>,\n\t\t\tExpressionTypes,\n\t\t\tDefaultEnsureFacets\n\t\t>;\n\t}\n\n\tconfigure(\n\t\tupdate:\n\t\t\t| Partial<RunnerContextOptions<World>>\n\t\t\t| ((\n\t\t\t\tcurrent: RunnerContextOptions<World>\n\t\t\t) => RunnerContextOptions<World>)\n\t): RunnerBuilder<World, ExpressionTypes, Facets> {\n\t\tif (typeof update === \"function\") {\n\t\t\tconst current = collectCurrentOptions<World>(this.state);\n\t\t\tconst merged = update(current);\n\t\t\tapplyOptions(this.state, merged);\n\t\t\treturn new RunnerBuilderImpl<World, ExpressionTypes, Facets>(\n\t\t\t\tthis.state\n\t\t\t);\n\t\t}\n\n\t\tapplyOptions(this.state, update);\n\t\treturn new RunnerBuilderImpl<World, ExpressionTypes, Facets>(\n\t\t\tthis.state\n\t\t);\n\t}\n\n\texpressionMap<\n\t\tNextExpressionTypes extends CucumberExpressionTypeMap\n\t>(): RunnerBuilder<World, NextExpressionTypes, Facets> {\n\t\treturn new RunnerBuilderImpl<World, NextExpressionTypes, Facets>(\n\t\t\tthis.state\n\t\t);\n\t}\n\n\twithWorld<NextWorld = World>(\n\t\tvalue?: Partial<NextWorld> | WorldFactory<NextWorld>\n\t): RunnerBuilder<NextWorld, ExpressionTypes, DefaultEnsureFacets> {\n\t\tif (typeof value === \"function\") {\n\t\t\tthis.state.worldFactory = normalizeWorldFactory<NextWorld>(\n\t\t\t\tvalue as\n\t\t\t\t\t| WorldFactory<NextWorld>\n\t\t\t\t\t| (() => NextWorld | Promise<NextWorld>)\n\t\t\t) as WorldFactory<unknown>;\n\t\t} else if (value) {\n\t\t\tconst validated = ensureWorldDefaults(value);\n\t\t\tthis.state.worldFactory = createDefaultsWorldFactory(validated) as WorldFactory<unknown>;\n\t\t} else {\n\t\t\tthis.state.worldFactory = async (_context) => ({} as NextWorld);\n\t\t}\n\t\tdelete this.state.ensureFactory;\n\t\tinvalidateCaches(this.state);\n\t\treturn new RunnerBuilderImpl<\n\t\t\tNextWorld,\n\t\t\tExpressionTypes,\n\t\t\tDefaultEnsureFacets\n\t\t>(this.state) as RunnerBuilder<\n\t\t\tNextWorld,\n\t\t\tExpressionTypes,\n\t\t\tDefaultEnsureFacets\n\t\t>;\n\t}\n\n\tapp<App>(\n\t\tapp: AppFactoryInput<World, App>\n\t): RunnerBuilder<\n\t\tWorldWithApp<World, App>,\n\t\tExpressionTypes,\n\t\tDefaultEnsureFacets\n\t> {\n\t\tthis.state.appFactory =\n\t\t\tnormalizeAppFactory<World, App>(app) as AppFactory<unknown, unknown>;\n\t\tdelete this.state.ensureFactory;\n\t\tinvalidateCaches(this.state);\n\t\treturn new RunnerBuilderImpl<\n\t\t\tWorldWithApp<World, App>,\n\t\t\tExpressionTypes,\n\t\t\tDefaultEnsureFacets\n\t\t>(this.state) as RunnerBuilder<\n\t\t\tWorldWithApp<World, App>,\n\t\t\tExpressionTypes,\n\t\t\tDefaultEnsureFacets\n\t\t>;\n\t}\n\n\tassertions<\n\t\tNextFacets extends Record<string, unknown>\n\t>(\n\t\tsetup: AssertionSetup<World, NextFacets>\n\t): RunnerBuilder<World, ExpressionTypes, NextFacets> {\n\t\tthis.state.ensureFactory = setup(baseEnsure) as RunnerEnsureFactory<\n\t\t\tunknown,\n\t\t\tRecord<string, unknown>\n\t\t>;\n\t\tinvalidateCaches(this.state);\n\t\treturn new RunnerBuilderImpl<World, ExpressionTypes, NextFacets>(\n\t\t\tthis.state\n\t\t);\n\t}\n\n\tassertionPlugins<\n\t\tNextPlugins extends Record<string, AssertionPlugin<World, unknown>>\n\t>(\n\t\tplugins: NextPlugins\n\t): RunnerBuilder<\n\t\tWorld,\n\t\tExpressionTypes,\n\t\tEnsurePluginFacets<World, NextPlugins>\n\t> {\n\t\treturn this.assertions<EnsurePluginFacets<World, NextPlugins>>(\n\t\t\t(ensureInvoke) => {\n\t\t\t\tconst factory = createEnsureFactory<World, NextPlugins>(\n\t\t\t\t\tensureInvoke,\n\t\t\t\t\tplugins\n\t\t\t\t);\n\t\t\t\treturn createImplicitEnsureProxy(factory);\n\t\t\t}\n\t\t);\n\t}\n\n\tparameterTypes(\n\t\tdefinitions: ParameterTypeDefinitions<World>\n\t): RunnerBuilder<World, ExpressionTypes, Facets> {\n\t\tconst current = this.state.options.parameterTypes ?? [];\n\t\tthis.state.options.parameterTypes = [\n\t\t\t...current,\n\t\t\t...(definitions as ParameterTypeDefinitions<unknown>),\n\t\t] as ParameterTypeDefinitions<unknown>;\n\t\tinvalidateCaches(this.state);\n\t\treturn new RunnerBuilderImpl<World, ExpressionTypes, Facets>(this.state);\n\t}\n\n\tsteps(): RunnerStepsSurface<World, ExpressionTypes, Facets> {\n\t\treturn ensureSteps<World, ExpressionTypes, Facets>(this.state);\n\t}\n\n\tdecorators(): RunnerDecoratorsSurface<World> {\n\t\treturn ensureDecorators<World, ExpressionTypes>(this.state);\n\t}\n\n\tbindingsTS(): RunnerBindingsSurface<World> {\n\t\treturn ensureBindingsTS<World, ExpressionTypes, Facets>(this.state);\n\t}\n}\n\nfunction initializeState<World>(\n\tinitial?: Partial<RunnerContextOptions<World>>\n): BuilderState {\n\tif (!initial) {\n\t\treturn {\n\t\t\toptions: {} as MutableRunnerContextOptions<unknown>,\n\t\t\tstepsEnvironmentMeta: { kind: \"root\" },\n\t\t};\n\t}\n\n\tconst { worldFactory, ...rest } = initial;\n\tconst state: BuilderState = {\n\t\toptions: { ...rest } as MutableRunnerContextOptions<unknown>,\n\t\tstepsEnvironmentMeta: { kind: \"root\" },\n\t};\n\n\tif (worldFactory) {\n\t\tstate.worldFactory = normalizeWorldFactory<unknown>(\n\t\t\tworldFactory as\n\t\t\t\t| WorldFactory<unknown>\n\t\t\t\t| (() => unknown | Promise<unknown>)\n\t\t);\n\t}\n\treturn state;\n}\n\nfunction cloneBuilderState(source: BuilderState): BuilderState {\n\tconst next: BuilderState = {\n\t\toptions: cloneWithFallback(source.options),\n\t};\n\tif (source.stepsEnvironmentMeta) {\n\t\tnext.stepsEnvironmentMeta = source.stepsEnvironmentMeta;\n\t}\n\tif (source.worldFactory) {\n\t\tnext.worldFactory = source.worldFactory;\n\t}\n\tif (source.appFactory) {\n\t\tnext.appFactory = source.appFactory;\n\t}\n\tif (source.ensureFactory) {\n\t\tnext.ensureFactory = source.ensureFactory;\n\t}\n\t// caches intentionally dropped\n\t// derived builders are intentionally not shared across forks\n\treturn next;\n}\n\nfunction collectCurrentOptions<World>(\n\tstate: BuilderState\n): RunnerContextOptions<World> {\n\tconst options = {\n\t\t...(state.options as MutableRunnerContextOptions<World>),\n\t} as MutableRunnerContextOptions<World>;\n\tif (state.worldFactory) {\n\t\toptions.worldFactory = state.worldFactory as WorldFactory<World>;\n\t}\n\treturn options as RunnerContextOptions<World>;\n}\n\nfunction applyOptions<World>(\n\tstate: BuilderState,\n\toptions: Partial<RunnerContextOptions<World>>\n): void {\n\tconst { worldFactory, ...rest } = options;\n\tstate.options = {\n\t\t...state.options,\n\t\t...rest,\n\t} as MutableRunnerContextOptions<unknown>;\n\tif (\"worldFactory\" in options) {\n\t\tif (worldFactory) {\n\t\t\tstate.worldFactory = normalizeWorldFactory<unknown>(\n\t\t\t\tworldFactory as\n\t\t\t\t\t| WorldFactory<unknown>\n\t\t\t\t\t| (() => unknown | Promise<unknown>)\n\t\t\t);\n\t\t} else {\n\t\t\tdelete state.worldFactory;\n\t\t}\n\t\tdelete state.ensureFactory;\n\t}\n\tinvalidateCaches(state);\n}\n\nfunction normalizeAppFactory<World, App>(\n\tapp: AppFactoryInput<World, App>\n): AppFactory<World, App> {\n\tif (typeof app === \"function\") {\n\t\tif (app.length > 0) {\n\t\t\treturn async (context) =>\n\t\t\t\tawait (app as (context: AppFactoryContext<World>) => App | Promise<App>)(\n\t\t\t\t\tcontext\n\t\t\t\t);\n\t\t}\n\t\treturn async () => await (app as () => App | Promise<App>)();\n\t}\n\treturn async () => app;\n}\n\ntype WorldDefaults = Record<string, unknown>;\n\ntype WorldDefaultsWithMetadata = WorldDefaults & {\n\treadonly [WORLD_INHERIT_KEYS]?: readonly PropertyKey[];\n};\n\nfunction createDefaultsWorldFactory<Defaults extends WorldDefaults>(\n\tdefaults: Defaults\n): WorldFactory<Defaults> {\n\tconst inheritance = extractWorldInheritance(defaults as WorldDefaultsWithMetadata);\n\tconst snapshot = cloneDefaults(defaults);\n\tconst factory: WorldFactoryWithInheritance<Defaults> = async () => cloneDefaults(snapshot);\n\tif (inheritance.size > 0) {\n\t\tObject.defineProperty(factory, WORLD_INHERIT_KEYS, {\n\t\t\tvalue: inheritance,\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false,\n\t\t});\n\t}\n\treturn factory;\n}\n\nfunction ensureWorldDefaults(value: unknown): WorldDefaults {\n\tif (!value || typeof value !== \"object\") {\n\t\tthrow new TypeError(\n\t\t\t\"withWorld defaults must be a non-null object\"\n\t\t);\n\t}\n\treturn value as WorldDefaults;\n}\n\nfunction cloneDefaults<Defaults extends WorldDefaults>(defaults: Defaults): Defaults {\n\tconst structuredCloneFn = (globalThis as {\n\t\tstructuredClone?: <T>(value: T) => T;\n\t}).structuredClone;\n\tif (structuredCloneFn) {\n\t\ttry {\n\t\t\treturn structuredCloneFn(defaults);\n\t\t} catch {\n\t\t\t// Fall through to manual clone strategy when structured cloning fails.\n\t\t}\n\t}\n\treturn cloneWithFallback(defaults);\n}\n\nfunction extractWorldInheritance(\n\tdefaults: WorldDefaultsWithMetadata\n): WorldInheritanceMetadata {\n\tconst inherit = defaults[WORLD_INHERIT_KEYS];\n\tif (!inherit || inherit.length === 0) {\n\t\treturn new Set();\n\t}\n\tconst inheritance = new Set<PropertyKey>(inherit);\n\treturn inheritance;\n}\n\nfunction getWorldInheritance(\n\tfactory: WorldFactory<unknown> | undefined\n): WorldInheritanceMetadata | undefined {\n\tif (!factory) {\n\t\treturn undefined;\n\t}\n\tconst withMetadata = factory as WorldFactoryWithInheritance<unknown>;\n\treturn withMetadata[WORLD_INHERIT_KEYS];\n}\n\nfunction cloneWithFallback<T>(value: T): T {\n\tif (Array.isArray(value)) {\n\t\treturn value.map((item) => cloneWithFallback(item)) as unknown as T;\n\t}\n\tif (value instanceof Map) {\n\t\treturn new Map(\n\t\t\tArray.from(value.entries(), ([key, entry]) => [key, cloneWithFallback(entry)])\n\t\t) as unknown as T;\n\t}\n\tif (value instanceof Set) {\n\t\treturn new Set(Array.from(value.values(), (entry) => cloneWithFallback(entry))) as unknown as T;\n\t}\n\tif (value && typeof value === \"object\") {\n\t\tconst prototype = Object.getPrototypeOf(value as object);\n\t\tif (prototype === Object.prototype || prototype === null) {\n\t\t\tconst result: Record<string, unknown> = {};\n\t\t\tfor (const [key, entry] of Object.entries(value as Record<string, unknown>)) {\n\t\t\t\tresult[key] = cloneWithFallback(entry);\n\t\t\t}\n\t\t\treturn result as T;\n\t\t}\n\t}\n\treturn value;\n}\n\nfunction invalidateCaches(state: BuilderState): void {\n\tdelete state.stepsCache;\n\tdelete state.decoratorsCache;\n\tdelete state.bindingsTSCache;\n}\n\nfunction ensureSteps<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap,\n\tFacets extends Record<string, unknown>\n>(state: BuilderState): RunnerStepsSurface<World, ExpressionTypes, Facets> {\n\tlet cache = state.stepsCache;\n\tif (!cache) {\n\t\tconst options = buildRunnerOptions<World>(state, { includeParameterTypes: true });\n\t\tconst environment = createRunner<World, ExpressionTypes>(options);\n\t\tconst globals = createGlobalRunner<World, ExpressionTypes>();\n\t\tglobals.useEnvironment(environment);\n\t\tconst ensureFactory = resolveEnsureFactory<World, Facets>(state);\n\t\tconst surface = attachStepsHelpers(\n\t\t\tstate,\n\t\t\tenvironment,\n\t\t\tglobals,\n\t\t\tensureFactory\n\t\t);\n\t\ttry {\n\t\t\tObject.defineProperty(surface as object, STEPS_ENVIRONMENT_META, {\n\t\t\t\tvalue: state.stepsEnvironmentMeta ?? { kind: \"root\" },\n\t\t\t\twritable: false,\n\t\t\t\tenumerable: false,\n\t\t\t\tconfigurable: false,\n\t\t\t});\n\t\t} catch {\n\t\t\t// Best-effort only. This metadata is purely for environment selection.\n\t\t}\n\t\tcache = {\n\t\t\tenvironment: environment as RunnerEnvironment<\n\t\t\t\tunknown,\n\t\t\t\tCucumberExpressionTypeMap\n\t\t\t>,\n\t\t\tglobals: globals as GlobalRunner<unknown, CucumberExpressionTypeMap>,\n\t\t\tsurface: surface as RunnerStepsSurface<\n\t\t\t\tunknown,\n\t\t\t\tCucumberExpressionTypeMap,\n\t\t\t\tRecord<string, unknown>\n\t\t\t>,\n\t\t\tensureFactory: ensureFactory as RunnerEnsureFactory<\n\t\t\t\tunknown,\n\t\t\t\tRecord<string, unknown>\n\t\t\t>,\n\t\t};\n\t\tstate.stepsCache = cache;\n\t}\n\treturn cache.surface as RunnerStepsSurface<World, ExpressionTypes, Facets>;\n}\n\nfunction ensureDecorators<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap\n>(\n\tstate: BuilderState\n): RunnerDecoratorsSurface<World> {\n\tlet cache = state.decoratorsCache;\n\tif (!cache) {\n\t\tconst steps = ensureSteps<\n\t\t\tWorld,\n\t\t\tExpressionTypes,\n\t\t\tDefaultEnsureFacets\n\t\t>(state);\n\t\tconst options = buildRunnerOptions<World>(state, {\n\t\t\tincludeParameterTypes: false,\n\t\t});\n\t\tconst decoratorOptions = {\n\t\t\t...options,\n\t\t\tparameterRegistry: steps.parameterRegistry,\n\t\t\tregisterDefaultParameterTypes: false,\n\t\t} as RunnerContextOptions<World>;\n\t\tconst environment = createDecoratorRunner<World>(decoratorOptions);\n\t\tconst decorators = createRunnerDecorators<World>(environment);\n\t\tconst surface = attachDecoratorEnvironment(decorators, environment);\n\t\tcache = {\n\t\t\tenvironment: environment as DecoratorRunnerEnvironment<unknown>,\n\t\t\tsurface: surface as RunnerDecoratorsSurface<unknown>,\n\t\t};\n\t\tstate.decoratorsCache = cache;\n\t}\n\treturn cache.surface as RunnerDecoratorsSurface<World>;\n}\n\nfunction ensureBindingsTS<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap,\n\tFacets extends Record<string, unknown>\n>(\n\tstate: BuilderState\n): RunnerBindingsSurface<World> {\n\tlet cache = state.bindingsTSCache;\n\tif (!cache) {\n\t\t// Get the steps environment to bridge decorator steps to\n\t\tconst stepsEnv = ensureSteps<World, ExpressionTypes, Facets>(state);\n\t\tconst surface = createBindingsTS<World>(stepsEnv);\n\t\tcache = {\n\t\t\tsurface: surface as RunnerBindingsSurface<unknown>,\n\t\t};\n\t\tstate.bindingsTSCache = cache;\n\t}\n\treturn cache.surface as RunnerBindingsSurface<World>;\n}\n\nfunction buildRunnerOptions<World>(\n\tstate: BuilderState,\n\toptions?: { includeParameterTypes?: boolean }\n): RunnerContextOptions<World> {\n\tconst includeParameterTypes = options?.includeParameterTypes ?? true;\n\tconst base = {\n\t\t...(state.options as MutableRunnerContextOptions<World>),\n\t} as MutableRunnerContextOptions<World>;\n\n\tif (!includeParameterTypes && \"parameterTypes\" in base) {\n\t\tdelete base.parameterTypes;\n\t}\n\n\tconst featureRegistry = ensureFeatureRegistry(state);\n\tconst worldFactory = composeWorldFactory<World>(\n\t\tstate.worldFactory as WorldFactory<World> | undefined,\n\t\tstate.appFactory as AppFactory<World, unknown> | undefined,\n\t\tfeatureRegistry\n\t);\n\n\tif (worldFactory) {\n\t\tbase.worldFactory = worldFactory;\n\t} else if (\"worldFactory\" in base) {\n\t\tdelete base.worldFactory;\n\t}\n\n\treturn base as RunnerContextOptions<World>;\n}\n\nfunction composeWorldFactory<World>(\n\tbaseFactory: WorldFactory<World> | undefined,\n\tappFactory: AppFactory<World, unknown> | undefined,\n\tfeatureRegistry: FeatureRegistry | undefined\n): WorldFactory<World> | undefined {\n\tif (!baseFactory && !appFactory && !featureRegistry) {\n\t\treturn undefined;\n\t}\n\n\tconst factory =\n\t\tbaseFactory ?? (async (_context: WorldFactoryContext<World>) => ({} as World));\n\tconst inheritance = getWorldInheritance(baseFactory as WorldFactory<unknown> | undefined);\n\treturn async (context: WorldFactoryContext<World>) => {\n\t\tconst container = createContainer();\n\t\tconst world = await factory(context);\n\t\tconst asObject = ensureWorldObject(world);\n\t\tconst parentObject =\n\t\t\tcontext.parent !== undefined\n\t\t\t\t? ensureWorldObject(context.parent)\n\t\t\t\t: undefined;\n\t\tconst mergedWorld =\n\t\t\tparentObject !== undefined\n\t\t\t\t? mergeWorldWithParent(asObject, parentObject, inheritance)\n\t\t\t\t: asObject;\n\t\tattachWorldAncestors(mergedWorld, parentObject);\n\t\tattachFeatureRegistry(mergedWorld, featureRegistry);\n\t\tattachContainer(mergedWorld, container);\n\t\tattachRuntime(mergedWorld);\n\t\tattachWorldToJson(mergedWorld);\n\t\tcontainer.registerValue(WORLD_TOKEN, mergedWorld, {\n\t\t\tscope: Scope.SCENARIO,\n\t\t});\n\n\t\tif (appFactory) {\n\t\t\tconst resolvedAppFactory = appFactory as AppFactory<World, unknown>;\n\t\t\tconst composer = createAppFactoryContext(container, mergedWorld as World);\n\t\t\tconst appResult = await resolvedAppFactory(composer);\n\t\t\tconst app = appResult ?? composer.getRegisteredApp();\n\t\t\tif (app === undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"App factory did not return an application instance. Use return or registerApp to provide one.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t(mergedWorld as Record<string, unknown>).app = app as unknown;\n\t\t}\n\n\t\treturn mergedWorld as World;\n\t};\n}\n\nfunction attachStepsHelpers<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap,\n\tFacets extends Record<string, unknown>\n>(\n\tstate: BuilderState,\n\tenvironment: RunnerEnvironment<World, ExpressionTypes>,\n\tglobals: GlobalRunner<World, ExpressionTypes>,\n\tensureFactory: RunnerEnsureFactory<World, Facets>\n): RunnerStepsSurface<World, ExpressionTypes, Facets> {\n\tif (!(\"globals\" in environment)) {\n\t\tObject.defineProperty(environment, \"globals\", {\n\t\t\tvalue: globals,\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n\tif (!(\"coordinateFeature\" in environment)) {\n\t\tObject.defineProperty(environment, \"coordinateFeature\", {\n\t\t\tvalue: (options: RunnerCoordinateFeatureOptions<World>) => {\n\t\t\t\tconst registry = ensureFeatureRegistry(state);\n\t\t\t\tif (options.feature) {\n\t\t\t\t\tregistry.remember(options.feature);\n\t\t\t\t}\n\t\t\t\treturn coordinateRunnerFeature<World>({\n\t\t\t\t\tenvironment,\n\t\t\t\t\t...options,\n\t\t\t\t});\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n\tif (!(\"ensure\" in environment)) {\n\t\tObject.defineProperty(environment, \"ensure\", {\n\t\t\tvalue: ensureFactory,\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n\treturn environment as RunnerStepsSurface<World, ExpressionTypes, Facets>;\n}\n\nfunction resolveEnsureFactory<\n\tWorld,\n\tFacets extends Record<string, unknown>\n>(state: BuilderState): RunnerEnsureFactory<World, Facets> {\n\tif (state.ensureFactory) {\n\t\treturn state.ensureFactory as RunnerEnsureFactory<World, Facets>;\n\t}\n\tconst factory = createDefaultEnsureFactory<World>();\n\tconst proxy = createImplicitEnsureProxy(factory);\n\tstate.ensureFactory = proxy as RunnerEnsureFactory<\n\t\tunknown,\n\t\tRecord<string, unknown>\n\t>;\n\treturn proxy as RunnerEnsureFactory<World, Facets>;\n}\n\nfunction attachDecoratorEnvironment<World>(\n\tdecorators: RunnerDecorators<World>,\n\tenvironment: DecoratorRunnerEnvironment<World>\n): RunnerDecoratorsSurface<World> {\n\tif (!(\"environment\" in decorators)) {\n\t\tObject.defineProperty(decorators, \"environment\", {\n\t\t\tvalue: environment,\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n\treturn decorators as RunnerDecoratorsSurface<World>;\n}\n\nfunction ensureWorldObject<World>(world: World): Record<string, unknown> {\n\tif (world && typeof world === \"object\") {\n\t\treturn world as Record<string, unknown>;\n\t}\n\treturn {} as Record<string, unknown>;\n}\n\nfunction attachContainer(world: Record<string, unknown>, container: IContainer): void {\n\tconst descriptor: PropertyDescriptor = {\n\t\tvalue: container,\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\twritable: false,\n\t};\n\n\tif (!Reflect.has(world, \"di\")) {\n\t\tObject.defineProperty(world, \"di\", descriptor);\n\t}\n\n\tif (!Reflect.has(world, \"container\")) {\n\t\tObject.defineProperty(world, \"container\", descriptor);\n\t}\n}\n\nfunction createAppFactoryContext<World>(\n\tcontainer: IContainer,\n\tworld: World\n): AppFactoryContext<World> & { getRegisteredApp(): unknown } {\n\tlet registeredApp: unknown;\n\n\tfunction withScenarioScope(\n\t\toptions: RegistrationOptions | undefined\n\t): RegistrationOptions {\n\t\treturn {\n\t\t\tscope: options?.scope ?? Scope.SCENARIO,\n\t\t\t...(options?.tags ? { tags: [...options.tags] } : {}),\n\t\t\t...(options?.deps ? { deps: [...options.deps] } : {}),\n\t\t\t...(options?.props ? { props: options.props } : {}),\n\t\t};\n\t}\n\n\tconst context: AppFactoryContext<World> = {\n\t\tcontainer,\n\t\tworld,\n\t\tgetRegisteredApp() {\n\t\t\treturn registeredApp;\n\t\t},\n\t\tregisterClass(target, options) {\n\t\t\tconst { scope, tags, deps, inject } = options ?? {};\n\t\t\tlet propsMap: RegistrationOptions[\"props\"] | undefined;\n\n\t\t\tif (inject) {\n\t\t\t\tconst keys = Reflect.ownKeys(inject);\n\t\t\t\tif (keys.length > 0) {\n\t\t\t\t\tconst entries: Array<readonly [PropertyKey, AppPropertyInjection]> = [];\n\t\t\t\t\tfor (const key of keys) {\n\t\t\t\t\tconst descriptor = inject[key as PropertyKey];\n\t\t\t\t\tif (!descriptor) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tentries.push([key, descriptor]);\n\t\t\t\t}\n\t\t\t\t\tif (entries.length > 0) {\n\t\t\t\t\t\tpropsMap = Object.fromEntries(entries.map(([key, descriptor]) => {\n\t\t\t\t\t\tif (typeof descriptor === \"object\" && \"token\" in descriptor) {\n\t\t\t\t\t\t\treturn [key, {\n\t\t\t\t\t\t\t\ttoken: descriptor.token,\n\t\t\t\t\t\t\t\t...(descriptor.lazy ? { lazy: descriptor.lazy } : {}),\n\t\t\t\t\t\t\t}];\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn [key, descriptor as Identifier];\n\t\t\t\t\t\t})) as RegistrationOptions[\"props\"];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst registration: RegistrationOptions = {\n\t\t\t\tscope: scope ?? Scope.SCENARIO,\n\t\t\t\t...(tags ? { tags: [...tags] } : {}),\n\t\t\t\t...(deps ? { deps: [...deps] } : {}),\n\t\t\t\t...(propsMap ? { props: propsMap } : {}),\n\t\t\t};\n\n\t\t\tcontainer.registerClass(target, registration);\n\t\t\treturn context;\n\t\t},\n\t\tregisterValue(identifier, value, options) {\n\t\t\tcontainer.registerValue(identifier, value, withScenarioScope(options));\n\t\t\treturn context;\n\t\t},\n\t\tregisterFactory(identifier, factory, options) {\n\t\t\tcontainer.registerFactory(identifier, factory, withScenarioScope(options));\n\t\t\treturn context;\n\t\t},\n\t\tregisterToken(token, target, options) {\n\t\t\tcontainer.registerToken(token, target, withScenarioScope(options));\n\t\t\treturn context;\n\t\t},\n\t\tasync registerApp(target, options) {\n\t\t\tcontext.registerClass(target, options);\n\t\t\tconst instance = container.resolve(target);\n\t\t\tregisteredApp = instance;\n\t\t\tif (options?.configure) {\n\t\t\t\tawait options.configure(instance, context);\n\t\t\t}\n\t\t\treturn instance;\n\t\t},\n\t\tresolve(identifier) {\n\t\t\treturn container.resolve(identifier);\n\t\t},\n\t};\n\n\treturn context;\n}\n\nfunction attachRuntime(world: Record<string, unknown>): void {\n\tif (Reflect.has(world, \"runtime\")) {\n\t\treturn;\n\t}\n\tObject.defineProperty(world, \"runtime\", {\n\t\tget() {\n\t\t\treturn createStepRuntime(this);\n\t\t},\n\t\tenumerable: false,\n\t\tconfigurable: true,\n\t});\n}\n\ntype JsonSafeValue =\n\t| null\n\t| boolean\n\t| number\n\t| string\n\t| JsonSafeValue[]\n\t| { [key: string]: JsonSafeValue };\n\nconst WORLD_JSON_EXCLUDE_KEYS: ReadonlySet<string> = new Set([\n\t\"app\",\n\t\"di\",\n\t\"container\",\n\t\"runtime\",\n\t\"ancestors\",\n]);\n\nfunction attachWorldToJson(world: Record<string, unknown>): void {\n\tif (Reflect.has(world, \"toJSON\")) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(world, \"toJSON\", {\n\t\tvalue: () => {\n\t\t\tconst stack = new WeakSet<object>();\n\t\t\treturn toJsonSafeValue(world, 8, stack);\n\t\t},\n\t\tenumerable: false,\n\t\tconfigurable: true,\n\t\twritable: true,\n\t});\n}\n\nfunction toJsonSafeValue(value: unknown, depth: number, stack: WeakSet<object>): JsonSafeValue {\n\tif (value === null) {\n\t\treturn null;\n\t}\n\n\tswitch (typeof value) {\n\t\tcase \"boolean\":\n\t\tcase \"number\":\n\t\tcase \"string\":\n\t\t\treturn value;\n\t\tcase \"bigint\":\n\t\t\treturn value.toString();\n\t\tcase \"undefined\":\n\t\t\treturn \"[undefined]\";\n\t\tcase \"symbol\":\n\t\t\treturn value.toString();\n\t\tcase \"function\":\n\t\t\treturn \"[Function]\";\n\t\tcase \"object\":\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn String(value);\n\t}\n\n\tif (depth <= 0) {\n\t\treturn \"[MaxDepth]\";\n\t}\n\n\tconst obj = value as object;\n\tif (stack.has(obj)) {\n\t\treturn \"[Circular]\";\n\t}\n\n\tif (Array.isArray(obj)) {\n\t\tstack.add(obj);\n\t\ttry {\n\t\t\treturn obj.map((entry) => toJsonSafeValue(entry, depth - 1, stack));\n\t\t} finally {\n\t\t\tstack.delete(obj);\n\t\t}\n\t}\n\n\tif (obj instanceof Date) {\n\t\treturn obj.toISOString();\n\t}\n\n\tif (obj instanceof Error) {\n\t\treturn {\n\t\t\tname: obj.name,\n\t\t\tmessage: obj.message,\n\t\t\tstack: obj.stack ?? \"\",\n\t\t};\n\t}\n\n\tif (obj instanceof Map) {\n\t\tstack.add(obj);\n\t\ttry {\n\t\t\treturn {\n\t\t\t\t\"[Map]\": Array.from(obj.entries()).map(([key, entry]) => ({\n\t\t\t\t\tkey: toJsonSafeValue(key, depth - 1, stack),\n\t\t\t\t\tvalue: toJsonSafeValue(entry, depth - 1, stack),\n\t\t\t\t})),\n\t\t\t};\n\t\t} finally {\n\t\t\tstack.delete(obj);\n\t\t}\n\t}\n\n\tif (obj instanceof Set) {\n\t\tstack.add(obj);\n\t\ttry {\n\t\t\treturn { \"[Set]\": Array.from(obj.values()).map((entry) => toJsonSafeValue(entry, depth - 1, stack)) };\n\t\t} finally {\n\t\t\tstack.delete(obj);\n\t\t}\n\t}\n\n\tstack.add(obj);\n\ttry {\n\t\tconst record = obj as Record<string, unknown>;\n\t\tconst result: Record<string, JsonSafeValue> = {};\n\n\t\tfor (const [key, entry] of Object.entries(record)) {\n\t\t\tif (WORLD_JSON_EXCLUDE_KEYS.has(key)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresult[key] = toJsonSafeValue(entry, depth - 1, stack);\n\t\t}\n\n\t\treturn result;\n\t} finally {\n\t\tstack.delete(obj);\n\t}\n}\n\nfunction attachFeatureRegistry(\n\tworld: Record<string, unknown>,\n\tfeatureRegistry: FeatureRegistry | undefined\n): void {\n\tif (!featureRegistry) {\n\t\treturn;\n\t}\n\tworld.features = featureRegistry.snapshot();\n}\n\nconst PARENT_WORLD_EXCLUDE_KEYS: ReadonlySet<PropertyKey> = new Set([\n\t\"di\",\n\t\"container\",\n\t\"runtime\",\n\t\"app\",\n\t\"ancestors\",\n]);\n\nfunction mergeWorldWithParent(\n\tchild: Record<string, unknown>,\n\tparent: Record<string, unknown> | undefined,\n\tinheritance: WorldInheritanceMetadata | undefined\n): Record<string, unknown> {\n\tif (!parent || !inheritance || inheritance.size === 0) {\n\t\treturn child;\n\t}\n\n\tfor (const key of inheritance) {\n\t\tif (PARENT_WORLD_EXCLUDE_KEYS.has(key)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!Reflect.has(parent, key)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(parent, key);\n\t\tif (descriptor) {\n\t\t\tObject.defineProperty(child, key, descriptor);\n\t\t}\n\t}\n\n\treturn child;\n}\n\nfunction attachWorldAncestors(\n\tworld: Record<string, unknown>,\n\tparent: Record<string, unknown> | undefined\n): void {\n\tconst parentAncestors =\n\t\tparent && Reflect.has(parent, \"ancestors\")\n\t\t\t? (parent as Record<string, unknown> & {\n\t\t\t\t\tancestors?: readonly unknown[];\n\t\t\t\t}).ancestors\n\t\t\t: undefined;\n\tconst lineage = parent\n\t\t? [\n\t\t\tparent,\n\t\t\t...(Array.isArray(parentAncestors) ? parentAncestors : []),\n\t\t]\n\t\t: [];\n\n\tObject.defineProperty(world, \"ancestors\", {\n\t\tvalue: lineage,\n\t\twritable: false,\n\t\tenumerable: false,\n\t\tconfigurable: true,\n\t});\n}\n\ninterface FeatureRegistry {\n\treadonly remember: (feature: SimpleFeature) => void;\n\treadonly snapshot: () => SimpleFeature[];\n}\n\nfunction ensureFeatureRegistry(state: BuilderState): FeatureRegistry {\n\tif (!state.featureRegistry) {\n\t\tstate.featureRegistry = createFeatureRegistry();\n\t}\n\treturn state.featureRegistry;\n}\n\nfunction createFeatureRegistry(): FeatureRegistry {\n\tconst byId = new Map<string, SimpleFeature>();\n\treturn {\n\t\tremember(feature) {\n\t\t\tconst id = feature.uri ?? feature.name;\n\t\t\tif (!id || byId.has(id)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbyId.set(id, feature);\n\t\t},\n\t\tsnapshot() {\n\t\t\treturn Array.from(byId.values());\n\t\t},\n\t};\n}\n\nfunction createImplicitEnsureProxy<World, Facets extends Record<string, unknown>>(\n\tfactory: EnsureFactory<World, Facets>\n): RunnerEnsureFactory<World, Facets> {\n\treturn new Proxy(factory, {\n\t\tget(target, prop, receiver) {\n\t\t\tif (prop === \"world\") {\n\t\t\t\treturn tryGetWorld<World>();\n\t\t\t}\n\t\t\tconst world = tryGetWorld<World>();\n\t\t\tif (world) {\n\t\t\t\tconst facade = factory(world);\n\t\t\t\treturn Reflect.get(facade, prop, receiver);\n\t\t\t}\n\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t},\n\t\tapply(target, _thisArg, args) {\n\t\t\tconst [arg, options] = args;\n\t\t\tconst world = tryGetWorld<World>();\n\t\t\tif (world) {\n\t\t\t\tif (arg === world) {\n\t\t\t\t\treturn factory(world);\n\t\t\t\t}\n\t\t\t\tconst facade = factory(world);\n\t\t\t\treturn facade(arg, options as EnsureOptions);\n\t\t\t}\n\t\t\treturn factory(arg as World);\n\t\t},\n\t}) as unknown as RunnerEnsureFactory<World, Facets>;\n}\n","import { createRunner, type RunnerEnvironment } from \"./create-runner\";\nimport type { RunnerContextOptions } from \"../core/runner-context\";\nimport type {\n\tCucumberExpressionTypeMap,\n\tDefaultCucumberExpressionTypes,\n} from \"@autometa/scopes\";\n\nexport interface GlobalRunner<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n> extends RunnerEnvironment<World, ExpressionTypes> {\n\treset(\n\t\toptions?: RunnerContextOptions<World>\n\t): RunnerEnvironment<World, ExpressionTypes>;\n\tuseEnvironment(\n\t\tenvironment: RunnerEnvironment<World, ExpressionTypes>\n\t): RunnerEnvironment<World, ExpressionTypes>;\n\tgetEnvironment(): RunnerEnvironment<World, ExpressionTypes>;\n}\n\nexport function createGlobalRunner<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n>(\n\tinitialOptions?: RunnerContextOptions<World>\n): GlobalRunner<World, ExpressionTypes> {\n\tlet lastOptions = initialOptions;\n\n\tfunction instantiate(\n\t\toptions?: RunnerContextOptions<World>\n\t): RunnerEnvironment<World, ExpressionTypes> {\n\t\tif (options) {\n\t\t\tlastOptions = options;\n\t\t\treturn createRunner<World, ExpressionTypes>(options);\n\t\t}\n\n\t\tif (lastOptions) {\n\t\t\treturn createRunner<World, ExpressionTypes>(lastOptions);\n\t\t}\n\n\t\treturn createRunner<World, ExpressionTypes>();\n\t}\n\n\tlet current = instantiate(initialOptions);\n\n\tconst target = {\n\t\treset(options?: RunnerContextOptions<World>) {\n\t\t\tcurrent = instantiate(options);\n\t\t\treturn current;\n\t\t},\n\t\tuseEnvironment(environment: RunnerEnvironment<World, ExpressionTypes>) {\n\t\t\tcurrent = environment;\n\t\t\treturn current;\n\t\t},\n\t\tgetEnvironment() {\n\t\t\treturn current;\n\t\t},\n\t};\n\n\tconst forwardedKeys = new Set<PropertyKey>([\n\t\t\"reset\",\n\t\t\"useEnvironment\",\n\t\t\"getEnvironment\",\n\t]);\n\n\treturn new Proxy(target as GlobalRunner<World, ExpressionTypes>, {\n\t\tget(obj, prop, receiver) {\n\t\t\tif (forwardedKeys.has(prop)) {\n\t\t\t\treturn Reflect.get(obj, prop, receiver);\n\t\t\t}\n\n\t\t\tconst value = current[\n\t\t\t\tprop as keyof RunnerEnvironment<World, ExpressionTypes>\n\t\t\t];\n\t\t\tif (typeof value === \"function\") {\n\t\t\t\treturn (value as (...args: unknown[]) => unknown).bind(current);\n\t\t\t}\n\t\t\treturn value;\n\t\t},\n\t\thas(_, prop) {\n\t\t\tif (forwardedKeys.has(prop)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn prop in current;\n\t\t},\n\t\townKeys() {\n\t\t\tconst forwardable = Array.from(forwardedKeys).filter(\n\t\t\t\t(key): key is string | symbol =>\n\t\t\t\t\ttypeof key === \"string\" || typeof key === \"symbol\"\n\t\t\t);\n\t\t\tconst keys = new Set<string | symbol>([\n\t\t\t\t...Reflect.ownKeys(current),\n\t\t\t\t...forwardable,\n\t\t\t]);\n\t\t\treturn Array.from(keys);\n\t\t},\n\t\tgetOwnPropertyDescriptor(obj, prop) {\n\t\t\tif (forwardedKeys.has(prop)) {\n\t\t\t\treturn {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: Reflect.get(obj, prop),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn Object.getOwnPropertyDescriptor(current, prop);\n\t\t},\n\t}) as GlobalRunner<World, ExpressionTypes>;\n}\n","import {\n\tDecoratorScopeRegistry,\n\ttype DecoratorFeatureDescriptor,\n\ttype DecoratorRuleDescriptor,\n\ttype DecoratorScenarioDescriptor,\n\ttype HookHandler,\n\ttype HookOptions,\n\ttype HookType,\n\ttype ScopePlan,\n\ttype StepExpression,\n\ttype StepHandler,\n\ttype StepKeyword,\n\ttype StepOptions,\n} from \"@autometa/scopes\";\n\nimport {\n\tRunnerContext,\n\ttype RunnerContextOptions,\n\ttype RunnerScopeOptions,\n} from \"../core/runner-context\";\n\ninterface ScenarioContext {\n\treadonly feature: unknown;\n\treadonly rule?: unknown;\n}\n\nexport interface DecoratorRegistrationApi<World> {\n\tfeature(token: unknown, descriptor: DecoratorFeatureDescriptor): void;\n\trule(\n\t\tfeatureToken: unknown,\n\t\ttoken: unknown,\n\t\tdescriptor: DecoratorRuleDescriptor\n\t): void;\n\tscenario(\n\t\ttoken: unknown,\n\t\tdescriptor: DecoratorScenarioDescriptor,\n\t\tcontext: ScenarioContext\n\t): void;\n\tstep(\n\t\tscenarioToken: unknown,\n\t\tkeyword: StepKeyword,\n\t\texpression: StepExpression,\n\t\thandler: StepHandler<World>,\n\t\toptions?: StepOptions\n\t): void;\n\thook(\n\t\tscopeToken: unknown,\n\t\ttype: HookType,\n\t\thandler: HookHandler<World>,\n\t\tdescription?: string,\n\t\toptions?: HookOptions\n\t): void;\n}\n\nexport interface DecoratorRunnerEnvironment<World>\n\textends DecoratorRegistrationApi<World> {\n\treadonly context: RunnerContext<World>;\n\tbuildPlan(): ScopePlan<World>;\n}\n\nexport function createDecoratorRunner<World>(\n\toptions: RunnerContextOptions<World> = {}\n): DecoratorRunnerEnvironment<World> {\n\tconst context = new RunnerContext<World>(options);\n\tconst registry = new DecoratorScopeRegistry<World>();\n\tconst scopeOptions = RunnerContext.extractScopeOptions(options);\n\n\treturn {\n\t\tfeature(token, descriptor) {\n\t\t\tregistry.registerFeature(token, descriptor);\n\t\t},\n\t\trule(featureToken, token, descriptor) {\n\t\t\tregistry.registerRule(featureToken, token, descriptor);\n\t\t},\n\t\tscenario(token, descriptor, scenarioContext) {\n\t\t\tregistry.registerScenario(token, descriptor, scenarioContext);\n\t\t},\n\t\tstep(scenarioToken, keyword, expression, handler, options) {\n\t\t\tregistry.registerStep(scenarioToken, {\n\t\t\t\tkeyword,\n\t\t\t\texpression,\n\t\t\t\thandler,\n\t\t\t\t...(options ? { options } : {}),\n\t\t\t});\n\t\t},\n\t\thook(scopeToken, type, handler, description, options) {\n\t\t\tregistry.registerHook(scopeToken, {\n\t\t\t\ttype,\n\t\t\t\thandler,\n\t\t\t\t...(description ? { description } : {}),\n\t\t\t\t...(options ? { options } : {}),\n\t\t\t});\n\t\t},\n\t\tcontext,\n\t\tbuildPlan() {\n\t\t\treturn registry.build(\n\t\t\t\tcreateScopeOptions(scopeOptions, context.parameterRegistryAdapter)\n\t\t\t);\n\t\t},\n\t};\n}\n\nfunction createScopeOptions<World>(\n\topts: RunnerScopeOptions<World>,\n\tparameterRegistry: RunnerContext<World>[\"parameterRegistryAdapter\"]\n) {\n\treturn {\n\t\t...opts,\n\t\tparameterRegistry,\n\t};\n}\n","import type {\n\tDecoratorFeatureDescriptor,\n\tDecoratorRuleDescriptor,\n\tDecoratorScenarioDescriptor,\n\tExecutionMode,\n\tHookHandler,\n\tHookOptions,\n\tHookType,\n\tScopeRegistrationOptions,\n\tStepExpression,\n\tStepHandler,\n\tStepKeyword,\n\tStepOptions,\n\tStepTagInput,\n} from \"@autometa/scopes\";\n\nimport type { DecoratorRegistrationApi } from \"../dsl/decorator-shared\";\n\ninterface FeatureDecoratorOptions\n\textends Partial<Omit<DecoratorFeatureDescriptor, \"name\">> {\n\treadonly name?: string;\n}\n\ninterface RuleDecoratorOptions\n\textends Partial<Omit<DecoratorRuleDescriptor, \"name\">> {\n\treadonly name: string;\n}\n\ninterface ScenarioDecoratorOptions\n\textends Partial<Omit<DecoratorScenarioDescriptor, \"name\">> {\n\treadonly name: string;\n\treadonly steps?: readonly PropertyKey[];\n\treadonly rule?: PropertyKey;\n}\n\ninterface StepDecoratorOptions extends StepOptions {\n\treadonly scenario: PropertyKey | readonly PropertyKey[];\n}\n\ninterface ScenarioHookDecoratorOptions extends HookOptions {\n\treadonly scenario: PropertyKey | readonly PropertyKey[];\n\treadonly description?: string;\n}\n\ninterface FeatureHookDecoratorOptions extends HookOptions {\n\treadonly description?: string;\n}\n\ninterface RuleHookDecoratorOptions extends HookOptions {\n\treadonly rule: PropertyKey | readonly PropertyKey[];\n\treadonly description?: string;\n}\n\ninterface StepMetadata<World> {\n\treadonly keyword: StepKeyword;\n\treadonly expression: StepExpression;\n\treadonly handler: StepHandler<World>;\n\treadonly options?: StepOptions;\n}\n\ninterface HookMetadata<World> {\n\treadonly handler: HookHandler<World>;\n\treadonly options?: HookOptions;\n}\n\ninterface HookRef {\n\treadonly propertyKey: PropertyKey;\n\treadonly type: HookType;\n\treadonly description?: string;\n\treadonly options?: HookOptions;\n}\n\n\ninterface ScenarioRecord {\n\treadonly token: unknown;\n\treadonly descriptor: DecoratorScenarioDescriptor;\n\treadonly steps: Set<PropertyKey>;\n\treadonly hooks: HookRef[];\n\treadonly ruleKey?: PropertyKey;\n\t\truleToken?: unknown;\n}\n\ninterface PendingScenarioData {\n\treadonly steps: Set<PropertyKey>;\n\treadonly hooks: HookRef[];\n}\n\ninterface RuleRecord {\n\treadonly token: unknown;\n\treadonly descriptor: DecoratorRuleDescriptor;\n\treadonly hooks: HookRef[];\n\treadonly scenarios: Set<PropertyKey>;\n}\n\ninterface PendingRuleData {\n\treadonly scenarios: Set<PropertyKey>;\n\treadonly hooks: HookRef[];\n}\n\ntype FeatureConstructor = abstract new (...args: never[]) => unknown;\ntype Mutable<T> = { -readonly [P in keyof T]: T[P] };\n\ntype StepDecoratorFactory<World> = {\n\t(\n\t\texpression: StepExpression,\n\t\toptions: StepDecoratorOptions\n\t): MethodDecorator;\n\tskip: StepDecoratorFactory<World>;\n\tonly: StepDecoratorFactory<World>;\n\tfailing: StepDecoratorFactory<World>;\n\tconcurrent: StepDecoratorFactory<World>;\n\ttags: (\n\t\t...tags: readonly StepTagInput[]\n\t) => StepDecoratorFactory<World>;\n};\n\nexport interface RunnerDecorators<_World> {\n\tFeature(options?: FeatureDecoratorOptions): ClassDecorator;\n\tRule(options: RuleDecoratorOptions): MethodDecorator;\n\tScenario(options: ScenarioDecoratorOptions): MethodDecorator;\n\tGiven: StepDecoratorFactory<_World>;\n\tWhen: StepDecoratorFactory<_World>;\n\tThen: StepDecoratorFactory<_World>;\n\tAnd: StepDecoratorFactory<_World>;\n\tBut: StepDecoratorFactory<_World>;\n\tBeforeFeature(options?: FeatureHookDecoratorOptions): MethodDecorator;\n\tAfterFeature(options?: FeatureHookDecoratorOptions): MethodDecorator;\n\tBeforeRule(options: RuleHookDecoratorOptions): MethodDecorator;\n\tAfterRule(options: RuleHookDecoratorOptions): MethodDecorator;\n\tBeforeScenario(options: ScenarioHookDecoratorOptions): MethodDecorator;\n\tAfterScenario(options: ScenarioHookDecoratorOptions): MethodDecorator;\n\tBeforeScenarioOutline(options: ScenarioHookDecoratorOptions): MethodDecorator;\n\tAfterScenarioOutline(options: ScenarioHookDecoratorOptions): MethodDecorator;\n}\n\nexport function createRunnerDecorators<World>(\n\tenvironment: DecoratorRegistrationApi<World>\n): RunnerDecorators<World> {\n\tconst stepMetadata = new WeakMap<object, Map<PropertyKey, StepMetadata<World>>>();\n\tconst hookMetadata = new WeakMap<object, Map<PropertyKey, HookMetadata<World>>>();\n\tconst scenarioRecords = new WeakMap<FeatureConstructor, Map<PropertyKey, ScenarioRecord>>();\n\tconst pendingScenarioData = new WeakMap<FeatureConstructor, Map<PropertyKey, PendingScenarioData>>();\n\tconst ruleRecords = new WeakMap<FeatureConstructor, Map<PropertyKey, RuleRecord>>();\n\tconst pendingRuleData = new WeakMap<FeatureConstructor, Map<PropertyKey, PendingRuleData>>();\n\tconst featureHooks = new WeakMap<FeatureConstructor, HookRef[]>();\n\n\tfunction getOrCreateRecordMap(constructor: FeatureConstructor) {\n\t\tlet records = scenarioRecords.get(constructor);\n\t\tif (!records) {\n\t\t\trecords = new Map();\n\t\t\tscenarioRecords.set(constructor, records);\n\t\t}\n\t\treturn records;\n\t}\n\n\tfunction getOrCreatePending(constructor: FeatureConstructor) {\n\t\tlet pending = pendingScenarioData.get(constructor);\n\t\tif (!pending) {\n\t\t\tpending = new Map();\n\t\t\tpendingScenarioData.set(constructor, pending);\n\t\t}\n\t\treturn pending;\n\t}\n\n\tfunction getOrCreateRuleRecordMap(constructor: FeatureConstructor) {\n\t\tlet records = ruleRecords.get(constructor);\n\t\tif (!records) {\n\t\t\trecords = new Map();\n\t\t\truleRecords.set(constructor, records);\n\t\t}\n\t\treturn records;\n\t}\n\n\tfunction getOrCreateRulePending(constructor: FeatureConstructor) {\n\t\tlet pending = pendingRuleData.get(constructor);\n\t\tif (!pending) {\n\t\t\tpending = new Map();\n\t\t\tpendingRuleData.set(constructor, pending);\n\t\t}\n\t\treturn pending;\n\t}\n\n\tfunction addStepAssociation(\n\t\tconstructor: FeatureConstructor,\n\t\tscenarioKey: PropertyKey,\n\t\tstepKey: PropertyKey\n\t) {\n\t\tconst records = scenarioRecords.get(constructor);\n\t\tconst record = records?.get(scenarioKey);\n\t\tif (record) {\n\t\t\trecord.steps.add(stepKey);\n\t\t\treturn;\n\t\t}\n\n\t\tconst pending = getOrCreatePending(constructor);\n\t\tlet entry = pending.get(scenarioKey);\n\t\tif (!entry) {\n\t\t\tentry = { steps: new Set(), hooks: [] };\n\t\t\tpending.set(scenarioKey, entry);\n\t\t}\n\t\tentry.steps.add(stepKey);\n\t}\n\n\tfunction addHookAssociation(\n\t\tconstructor: FeatureConstructor,\n\t\tscenarioKey: PropertyKey,\n\t\thook: HookRef\n\t) {\n\t\tconst records = scenarioRecords.get(constructor);\n\t\tconst record = records?.get(scenarioKey);\n\t\tif (record) {\n\t\t\trecord.hooks.push(hook);\n\t\t\treturn;\n\t\t}\n\n\t\tconst pending = getOrCreatePending(constructor);\n\t\tlet entry = pending.get(scenarioKey);\n\t\tif (!entry) {\n\t\t\tentry = { steps: new Set(), hooks: [] };\n\t\t\tpending.set(scenarioKey, entry);\n\t\t}\n\t\tentry.hooks.push(hook);\n\t}\n\n\tfunction addRuleScenarioAssociation(\n\t\tconstructor: FeatureConstructor,\n\t\truleKey: PropertyKey,\n\t\tscenarioKey: PropertyKey\n\t) {\n\t\tconst records = ruleRecords.get(constructor);\n\t\tconst record = records?.get(ruleKey);\n\t\tif (record) {\n\t\t\trecord.scenarios.add(scenarioKey);\n\t\t\treturn record.token;\n\t\t}\n\n\t\tconst pending = getOrCreateRulePending(constructor);\n\t\tlet entry = pending.get(ruleKey);\n\t\tif (!entry) {\n\t\t\tentry = { scenarios: new Set(), hooks: [] };\n\t\t\tpending.set(ruleKey, entry);\n\t\t}\n\t\tentry.scenarios.add(scenarioKey);\n\t\treturn undefined;\n\t}\n\n\tfunction addRuleHookAssociation(\n\t\tconstructor: FeatureConstructor,\n\t\truleKey: PropertyKey,\n\t\thook: HookRef\n\t) {\n\t\tconst records = ruleRecords.get(constructor);\n\t\tconst record = records?.get(ruleKey);\n\t\tif (record) {\n\t\t\trecord.hooks.push(hook);\n\t\t\treturn;\n\t\t}\n\n\t\tconst pending = getOrCreateRulePending(constructor);\n\t\tlet entry = pending.get(ruleKey);\n\t\tif (!entry) {\n\t\t\tentry = { scenarios: new Set(), hooks: [] };\n\t\t\tpending.set(ruleKey, entry);\n\t\t}\n\t\tentry.hooks.push(hook);\n\t}\n\n\tfunction recordFeatureHook(constructor: FeatureConstructor, hook: HookRef) {\n\t\tconst hooks = featureHooks.get(constructor);\n\t\tif (hooks) {\n\t\t\thooks.push(hook);\n\t\t\treturn;\n\t\t}\n\t\tfeatureHooks.set(constructor, [hook]);\n\t}\n\n\tfunction recordStepMetadata(\n\t\ttarget: object,\n\t\tpropertyKey: PropertyKey,\n\t\tmetadata: StepMetadata<World>\n\t) {\n\t\tlet map = stepMetadata.get(target);\n\t\tif (!map) {\n\t\t\tmap = new Map();\n\t\t\tstepMetadata.set(target, map);\n\t\t}\n\t\tmap.set(propertyKey, metadata);\n\t}\n\n\tfunction recordHookMetadata(\n\t\ttarget: object,\n\t\tpropertyKey: PropertyKey,\n\t\tmetadata: HookMetadata<World>\n\t) {\n\t\tlet map = hookMetadata.get(target);\n\t\tif (!map) {\n\t\t\tmap = new Map();\n\t\t\thookMetadata.set(target, map);\n\t\t}\n\t\tmap.set(propertyKey, metadata);\n\t}\n\n\tfunction getStepMetadata(\n\t\ttarget: object,\n\t\tpropertyKey: PropertyKey\n\t): StepMetadata<World> | undefined {\n\t\treturn stepMetadata.get(target)?.get(propertyKey);\n\t}\n\n\tfunction getHookMetadata(\n\t\ttarget: object,\n\t\tpropertyKey: PropertyKey\n\t): HookMetadata<World> | undefined {\n\t\treturn hookMetadata.get(target)?.get(propertyKey);\n\t}\n\n\tfunction normalizeSteps(value: readonly PropertyKey[] | undefined) {\n\t\treturn value ? new Set(value) : new Set<PropertyKey>();\n\t}\n\n\tfunction isReadonlyArray<T>(value: T | readonly T[]): value is readonly T[] {\n\t\treturn Array.isArray(value);\n\t}\n\n\tfunction toArray<T>(input: T | readonly T[]): readonly T[] {\n\t\treturn isReadonlyArray(input) ? input : ([input] as const);\n\t}\n\n\tfunction buildStepOptions(options: StepDecoratorOptions): StepOptions | undefined {\n\t\tconst candidate: Partial<Mutable<StepOptions>> = {};\n\t\tif (options.tags) {\n\t\t\tcandidate.tags = [...options.tags] as readonly string[];\n\t\t}\n\t\tif (options.timeout !== undefined) {\n\t\t\tcandidate.timeout = options.timeout;\n\t\t}\n\t\tif (options.mode) {\n\t\t\tcandidate.mode = options.mode;\n\t\t}\n\t\tif (options.data) {\n\t\t\tcandidate.data = { ...options.data };\n\t\t}\n\t\treturn Object.keys(candidate).length > 0\n\t\t\t? (candidate as StepOptions)\n\t\t\t: undefined;\n\t}\n\n\tfunction buildHookOptions<T extends HookOptions>(options: T): HookOptions | undefined {\n\t\tconst candidate: Partial<Mutable<HookOptions>> = {};\n\t\tif (options.tags) {\n\t\t\tcandidate.tags = [...options.tags] as readonly string[];\n\t\t}\n\t\tif (options.timeout !== undefined) {\n\t\t\tcandidate.timeout = options.timeout;\n\t\t}\n\t\tif (options.order !== undefined) {\n\t\t\tcandidate.order = options.order;\n\t\t}\n\t\tif (options.mode) {\n\t\t\tcandidate.mode = options.mode;\n\t\t}\n\t\tif (options.data) {\n\t\t\tcandidate.data = { ...options.data };\n\t\t}\n\t\treturn Object.keys(candidate).length > 0\n\t\t\t? (candidate as HookOptions)\n\t\t\t: undefined;\n\t}\n\n\tfunction normalizeTagInputs(inputs: readonly StepTagInput[]): readonly string[] {\n\t\tif (inputs.length === 0) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst tags: string[] = [];\n\n\t\tfor (const input of inputs) {\n\t\t\tif (typeof input === \"string\") {\n\t\t\t\tif (input.length > 0) {\n\t\t\t\t\ttags.push(input);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (Array.isArray(input)) {\n\t\t\t\tfor (const tag of input) {\n\t\t\t\t\tif (typeof tag === \"string\" && tag.length > 0) {\n\t\t\t\t\t\ttags.push(tag);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn tags.length > 0 ? Array.from(new Set(tags)) : [];\n\t}\n\n\tfunction mergeStepOptions(\n\t\tbase: StepOptions | undefined,\n\t\textras: StepOptions | undefined\n\t): StepOptions | undefined {\n\t\tif (!base && !extras) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst mergedTags = [\n\t\t\t...(base?.tags ?? []),\n\t\t\t...(extras?.tags ?? []),\n\t\t];\n\n\t\tconst timeout = extras?.timeout ?? base?.timeout;\n\t\tconst mode = extras?.mode ?? base?.mode;\n\t\tconst data = {\n\t\t\t...(base?.data ?? {}),\n\t\t\t...(extras?.data ?? {}),\n\t\t} satisfies Record<string, unknown>;\n\n\t\tconst tagsResult =\n\t\t\tmergedTags.length > 0\n\t\t\t\t? (Array.from(new Set(mergedTags)) as readonly string[])\n\t\t\t\t: undefined;\n\n\t\tconst hasData = Object.keys(data).length > 0;\n\n\t\tif (!tagsResult && timeout === undefined && mode === undefined && !hasData) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\t...(tagsResult ? { tags: tagsResult } : {}),\n\t\t\t...(timeout !== undefined ? { timeout } : {}),\n\t\t\t...(mode !== undefined ? { mode } : {}),\n\t\t\t...(hasData ? { data } : {}),\n\t\t};\n\t}\n\n\tfunction applyExecutionModeToStepOptions(\n\t\tmode: ExecutionMode,\n\t\toptions?: StepOptions\n\t): StepOptions | undefined {\n\t\tif (!options) {\n\t\t\treturn mode === \"default\" ? undefined : { mode };\n\t\t}\n\t\treturn mode !== \"default\" ? { ...options, mode } : { ...options };\n\t}\n\n\tfunction clonePendingOption(\n\t\tpending: Exclude<ScopeRegistrationOptions[\"pending\"], undefined>\n\t): ScopeRegistrationOptions[\"pending\"] {\n\t\tif (typeof pending === \"boolean\" || typeof pending === \"string\") {\n\t\t\treturn pending;\n\t\t}\n\t\tconst reason = pending.reason;\n\t\treturn reason !== undefined ? { reason } : {};\n\t}\n\n\tfunction cloneScopeOptions(options: ScopeRegistrationOptions) {\n\t\tconst {\n\t\t\ttags,\n\t\t\tdescription,\n\t\t\ttimeout,\n\t\t\tmode,\n\t\t\tsource,\n\t\t\tdata,\n\t\t\texamples,\n\t\t\tpending,\n\t\t} = options;\n\n\t\tconst cloned: ScopeRegistrationOptions = {\n\t\t\t...(tags ? { tags: [...tags] } : {}),\n\t\t\t...(description !== undefined ? { description } : {}),\n\t\t\t...(timeout !== undefined\n\t\t\t\t? {\n\t\t\t\t\ttimeout:\n\t\t\t\t\t\ttypeof timeout === \"number\"\n\t\t\t\t\t\t\t? timeout\n\t\t\t\t\t\t\t: { ...timeout },\n\t\t\t\t}\n\t\t\t: {}),\n\t\t\t...(mode !== undefined ? { mode } : {}),\n\t\t\t...(source ? { source: { ...source } } : {}),\n\t\t\t...(data ? { data: { ...data } } : {}),\n\t\t\t...(examples\n\t\t\t\t? {\n\t\t\t\t\texamples: examples.map((example) => ({\n\t\t\t\t\t\t...example,\n\t\t\t\t\t\t...(example.tags ? { tags: [...example.tags] } : {}),\n\t\t\t\t\t\ttable: example.table.map((row) => [...row]),\n\t\t\t\t\t})),\n\t\t\t\t}\n\t\t\t\t: {}),\n\t\t};\n\n\t\tif (pending !== undefined) {\n\t\t\t(cloned as { pending: ScopeRegistrationOptions[\"pending\"] }).pending = clonePendingOption(pending);\n\t\t}\n\n\t\treturn cloned;\n\t}\n\n\tfunction Feature(options: FeatureDecoratorOptions = {}): ClassDecorator {\n\t\treturn (target) => {\n\t\t\tconst constructor = target as unknown as FeatureConstructor;\n\t\t\tconst descriptor: DecoratorFeatureDescriptor = {\n\t\t\t\tname: options.name ?? constructor.name ?? \"Feature\",\n\t\t\t\t...cloneScopeOptions(options),\n\t\t\t};\n\n\t\t\tenvironment.feature(constructor, descriptor);\n\n\t\t\tconst featureHookRefs = featureHooks.get(constructor);\n\t\t\tif (featureHookRefs) {\n\t\t\t\tfor (const hook of featureHookRefs) {\n\t\t\t\t\tconst metadata =\n\t\t\t\t\t\tgetHookMetadata(constructor.prototype, hook.propertyKey) ??\n\t\t\t\t\t\tgetHookMetadata(constructor, hook.propertyKey);\n\t\t\t\t\tif (!metadata) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Hook metadata missing for ${String(hook.propertyKey)} on feature ${descriptor.name}`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tenvironment.hook(\n\t\t\t\t\t\tconstructor,\n\t\t\t\t\t\thook.type,\n\t\t\t\t\t\tmetadata.handler,\n\t\t\t\t\t\thook.description,\n\t\t\t\t\t\thook.options ?? metadata.options\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tfeatureHooks.delete(constructor);\n\t\t\t}\n\n\t\t\tconst rules = ruleRecords.get(constructor);\n\t\t\tif (rules) {\n\t\t\t\tfor (const [ruleKey, ruleRecord] of rules.entries()) {\n\t\t\t\t\tenvironment.rule(constructor, ruleRecord.token, ruleRecord.descriptor);\n\n\t\t\t\t\tconst hooks = ruleRecord.hooks;\n\t\t\t\t\tfor (const hook of hooks) {\n\t\t\t\t\t\tconst metadata =\n\t\t\t\t\t\t\tgetHookMetadata(constructor.prototype, hook.propertyKey) ??\n\t\t\t\t\t\t\tgetHookMetadata(constructor, hook.propertyKey);\n\t\t\t\t\t\tif (!metadata) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Hook metadata missing for ${String(hook.propertyKey)} on rule ${String(ruleKey)} of feature ${descriptor.name}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenvironment.hook(\n\t\t\t\t\t\t\truleRecord.token,\n\t\t\t\t\t\t\thook.type,\n\t\t\t\t\t\t\tmetadata.handler,\n\t\t\t\t\t\t\thook.description,\n\t\t\t\t\t\t\thook.options ?? metadata.options\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst records = scenarioRecords.get(constructor);\n\t\t\tif (records) {\n\t\t\t\tfor (const [scenarioKey, record] of records.entries()) {\n\t\t\t\t\tif (record.ruleKey) {\n\t\t\t\t\t\tconst ruleRecord = rules?.get(record.ruleKey);\n\t\t\t\t\t\tif (!ruleRecord) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Scenario ${record.descriptor.name} references unknown rule ${String(record.ruleKey)}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trecord.ruleToken = record.ruleToken ?? ruleRecord.token;\n\t\t\t\t\t\truleRecord.scenarios.add(scenarioKey);\n\t\t\t\t\t}\n\t\t\t\t\tenvironment.scenario(record.token, record.descriptor, {\n\t\t\t\t\t\tfeature: constructor,\n\t\t\t\t\t\t...(record.ruleToken ? { rule: record.ruleToken } : {}),\n\t\t\t\t\t});\n\n\t\t\t\t\tfor (const stepKey of record.steps) {\n\t\t\t\t\t\tconst metadata =\n\t\t\t\t\t\t\tgetStepMetadata(constructor.prototype, stepKey) ??\n\t\t\t\t\t\t\tgetStepMetadata(constructor, stepKey);\n\t\t\t\t\t\tif (!metadata) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Step metadata missing for ${String(stepKey)} on feature ${descriptor.name}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenvironment.step(\n\t\t\t\t\t\t\trecord.token,\n\t\t\t\t\t\t\tmetadata.keyword,\n\t\t\t\t\t\t\tmetadata.expression,\n\t\t\t\t\t\t\tmetadata.handler,\n\t\t\t\t\t\t\tmetadata.options\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (const hook of record.hooks) {\n\t\t\t\t\t\tconst metadata =\n\t\t\t\t\t\t\tgetHookMetadata(constructor.prototype, hook.propertyKey) ??\n\t\t\t\t\t\t\tgetHookMetadata(constructor, hook.propertyKey);\n\t\t\t\t\t\tif (!metadata) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Hook metadata missing for ${String(hook.propertyKey)} on feature ${descriptor.name}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tenvironment.hook(\n\t\t\t\t\t\t\trecord.token,\n\t\t\t\t\t\t\thook.type,\n\t\t\t\t\t\t\tmetadata.handler,\n\t\t\t\t\t\t\thook.description,\n\t\t\t\t\t\t\thook.options ?? metadata.options\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tscenarioRecords.delete(constructor);\n\t\t\t}\n\n\t\t\truleRecords.delete(constructor);\n\t\t\tpendingRuleData.delete(constructor);\n\t\t\tpendingScenarioData.delete(constructor);\n\t\t};\n\t}\n\n\tfunction Rule(options: RuleDecoratorOptions): MethodDecorator {\n\t\treturn (target, propertyKey) => {\n\t\t\tconst constructor = resolveConstructor(target);\n\t\t\tconst descriptor: DecoratorRuleDescriptor = {\n\t\t\t\tname: options.name,\n\t\t\t\t...cloneScopeOptions(options),\n\t\t\t};\n\n\t\t\tconst records = getOrCreateRuleRecordMap(constructor);\n\t\t\tif (records.has(propertyKey)) {\n\t\t\t\tthrow new Error(`Rule ${String(propertyKey)} already registered on feature ${constructor.name}`);\n\t\t\t}\n\n\t\t\tconst token = Symbol(`rule:${String(propertyKey)}`);\n\t\t\tconst record: RuleRecord = {\n\t\t\t\ttoken,\n\t\t\t\tdescriptor,\n\t\t\t\thooks: [],\n\t\t\t\tscenarios: new Set(),\n\t\t\t};\n\n\t\t\tconst pending = pendingRuleData.get(constructor)?.get(propertyKey);\n\t\t\tif (pending) {\n\t\t\t\tfor (const scenarioKey of pending.scenarios) {\n\t\t\t\t\trecord.scenarios.add(scenarioKey);\n\t\t\t\t}\n\t\t\t\trecord.hooks.push(...pending.hooks);\n\t\t\t\tpendingRuleData.get(constructor)?.delete(propertyKey);\n\t\t\t}\n\n\t\t\trecords.set(propertyKey, record);\n\n\t\t\tconst scenarios = scenarioRecords.get(constructor);\n\t\t\tif (scenarios) {\n\t\t\t\tfor (const scenarioKey of record.scenarios) {\n\t\t\t\t\tconst scenarioRecord = scenarios.get(scenarioKey);\n\t\t\t\t\tif (scenarioRecord) {\n\t\t\t\t\t\tscenarioRecord.ruleToken = token;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction Scenario(options: ScenarioDecoratorOptions): MethodDecorator {\n\t\treturn (target, propertyKey) => {\n\t\t\tconst constructor = resolveConstructor(target);\n\t\t\tconst records = getOrCreateRecordMap(constructor);\n\n\t\t\tconst descriptor: DecoratorScenarioDescriptor = {\n\t\t\t\tname: options.name,\n\t\t\t\tkind: options.kind ?? \"scenario\",\n\t\t\t\t...cloneScopeOptions(options),\n\t\t\t};\n\n\t\t\tconst token = Symbol(`scenario:${String(propertyKey)}`);\n\t\t\tconst steps = normalizeSteps(options.steps);\n\t\t\tconst hooks: HookRef[] = [];\n\t\t\tconst ruleKey = options.rule;\n\t\t\tlet ruleToken: unknown | undefined;\n\t\t\tif (ruleKey !== undefined) {\n\t\t\t\truleToken = addRuleScenarioAssociation(constructor, ruleKey, propertyKey);\n\t\t\t}\n\n\t\t\tconst pending = pendingScenarioData.get(constructor)?.get(propertyKey);\n\t\t\tif (pending) {\n\t\t\t\tfor (const stepKey of pending.steps) {\n\t\t\t\t\tsteps.add(stepKey);\n\t\t\t\t}\n\t\t\t\thooks.push(...pending.hooks);\n\t\t\t\tpendingScenarioData.get(constructor)?.delete(propertyKey);\n\t\t\t}\n\n\t\t\tconst record: ScenarioRecord = {\n\t\t\t\ttoken,\n\t\t\t\tdescriptor,\n\t\t\t\tsteps,\n\t\t\t\thooks,\n\t\t\t\t...(ruleKey !== undefined ? { ruleKey } : {}),\n\t\t\t\t...(ruleToken ? { ruleToken } : {}),\n\t\t\t};\n\n\t\t\trecords.set(propertyKey, record);\n\t\t};\n\t}\n\n\tfunction createStepDecorator(keyword: StepKeyword): StepDecoratorFactory<World> {\n\t\tconst factoryCache = new Map<\n\t\t\tStepOptions | undefined,\n\t\t\tMap<ExecutionMode, StepDecoratorFactory<World>>\n\t\t>();\n\n\t\tconst getCachedFactory = (\n\t\t\tmode: ExecutionMode,\n\t\t\tinheritedOptions?: StepOptions\n\t\t): StepDecoratorFactory<World> | undefined => {\n\t\t\tconst cacheForOptions = factoryCache.get(inheritedOptions);\n\t\t\treturn cacheForOptions?.get(mode);\n\t\t};\n\n\t\tconst storeFactory = (\n\t\t\tmode: ExecutionMode,\n\t\t\tinheritedOptions: StepOptions | undefined,\n\t\t\tfactory: StepDecoratorFactory<World>\n\t\t) => {\n\t\t\tlet cacheForOptions = factoryCache.get(inheritedOptions);\n\t\t\tif (!cacheForOptions) {\n\t\t\t\tcacheForOptions = new Map();\n\t\t\t\tfactoryCache.set(inheritedOptions, cacheForOptions);\n\t\t\t}\n\t\t\tcacheForOptions.set(mode, factory);\n\t\t};\n\n\t\tconst buildFactory = (\n\t\t\tmode: ExecutionMode,\n\t\t\tinheritedOptions?: StepOptions\n\t\t): StepDecoratorFactory<World> => {\n\t\t\tconst cached = getCachedFactory(mode, inheritedOptions);\n\t\t\tif (cached) {\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tconst decorator = ((\n\t\t\t\texpression: StepExpression,\n\t\t\t\toptions: StepDecoratorOptions\n\t\t\t): MethodDecorator => {\n\t\t\t\tif (!options || !options.scenario) {\n\t\t\t\t\tthrow new Error(\"Step decorator requires a scenario property key\");\n\t\t\t\t}\n\n\t\t\t\tconst scenarioRefs = toArray(options.scenario);\n\t\t\t\tconst explicitOptions = buildStepOptions(options);\n\t\t\t\tconst baseWithMode = mergeStepOptions(\n\t\t\t\t\tinheritedOptions,\n\t\t\t\t\tapplyExecutionModeToStepOptions(mode)\n\t\t\t\t);\n\t\t\t\tconst mergedOptions = mergeStepOptions(baseWithMode, explicitOptions);\n\t\t\t\tconst finalOptions = applyExecutionModeToStepOptions(mode, mergedOptions);\n\n\t\t\t\treturn (target, propertyKey, descriptor) => {\n\t\t\t\t\tconst handler = descriptor?.value as StepHandler<World> | undefined;\n\t\t\t\t\tif (typeof handler !== \"function\") {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Step decorator can only be applied to methods. ${String(propertyKey)} is not a function.`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\trecordStepMetadata(target, propertyKey, {\n\t\t\t\t\t\tkeyword,\n\t\t\t\t\t\texpression,\n\t\t\t\t\t\thandler,\n\t\t\t\t\t\t...(finalOptions ? { options: finalOptions } : {}),\n\t\t\t\t\t});\n\n\t\t\t\t\tconst constructor = resolveConstructor(target);\n\t\t\t\t\tfor (const scenarioKey of scenarioRefs) {\n\t\t\t\t\t\taddStepAssociation(constructor, scenarioKey, propertyKey);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}) as StepDecoratorFactory<World>;\n\n\t\t\tstoreFactory(mode, inheritedOptions, decorator);\n\n\t\t\tdecorator.tags = (\n\t\t\t\t...inputs: readonly StepTagInput[]\n\t\t\t) => {\n\t\t\t\tconst normalizedTags = normalizeTagInputs(inputs);\n\t\t\t\tif (normalizedTags.length === 0) {\n\t\t\t\t\treturn decorator;\n\t\t\t\t}\n\t\t\t\tconst tagOptions: StepOptions = {\n\t\t\t\t\ttags: normalizedTags,\n\t\t\t\t};\n\t\t\t\tconst merged = mergeStepOptions(inheritedOptions, tagOptions);\n\t\t\t\treturn buildFactory(mode, merged);\n\t\t\t};\n\n\t\t\tdecorator.skip = mode === \"skip\" ? decorator : buildFactory(\"skip\", inheritedOptions);\n\t\t\tdecorator.only = mode === \"only\" ? decorator : buildFactory(\"only\", inheritedOptions);\n\t\t\tdecorator.failing = mode === \"failing\" ? decorator : buildFactory(\"failing\", inheritedOptions);\n\t\t\tdecorator.concurrent =\n\t\t\t\tmode === \"concurrent\"\n\t\t\t\t\t? decorator\n\t\t\t\t\t: buildFactory(\"concurrent\", inheritedOptions);\n\t\t\treturn decorator;\n\t\t};\n\n\t\treturn buildFactory(\"default\");\n\t}\n\n\tfunction createScenarioHookDecorator(type: HookType) {\n\t\treturn (options: ScenarioHookDecoratorOptions): MethodDecorator => {\n\t\t\tif (!options || !options.scenario) {\n\t\t\t\tthrow new Error(\"Hook decorator requires a scenario property key\");\n\t\t\t}\n\t\t\tconst scenarioRefs = toArray(options.scenario);\n\t\t\tconst hookOptions = buildHookOptions(options);\n\t\t\tconst description = options.description;\n\n\t\t\treturn (target, propertyKey, descriptor) => {\n\t\t\t\tconst handler = descriptor?.value as HookHandler<World> | undefined;\n\t\t\t\tif (typeof handler !== \"function\") {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Hook decorator can only be applied to methods. ${String(propertyKey)} is not a function.`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\trecordHookMetadata(target, propertyKey, {\n\t\t\t\t\thandler,\n\t\t\t\t\t...(hookOptions ? { options: hookOptions } : {}),\n\t\t\t\t});\n\n\t\t\t\tconst constructor = resolveConstructor(target);\n\t\t\t\tconst hookRef: HookRef = {\n\t\t\t\t\tpropertyKey,\n\t\t\t\t\ttype,\n\t\t\t\t\t...(description ? { description } : {}),\n\t\t\t\t\t...(hookOptions ? { options: hookOptions } : {}),\n\t\t\t\t};\n\n\t\t\t\tfor (const scenarioKey of scenarioRefs) {\n\t\t\t\t\taddHookAssociation(constructor, scenarioKey, hookRef);\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t}\n\n\tfunction createRuleHookDecorator(type: HookType) {\n\t\treturn (options: RuleHookDecoratorOptions): MethodDecorator => {\n\t\t\tif (!options || !options.rule) {\n\t\t\t\tthrow new Error(\"Rule hook decorator requires a rule property key\");\n\t\t\t}\n\n\t\t\tconst ruleRefs = toArray(options.rule);\n\t\t\tconst hookOptions = buildHookOptions(options);\n\t\t\tconst description = options.description;\n\n\t\t\treturn (target, propertyKey, descriptor) => {\n\t\t\t\tconst handler = descriptor?.value as HookHandler<World> | undefined;\n\t\t\t\tif (typeof handler !== \"function\") {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Hook decorator can only be applied to methods. ${String(propertyKey)} is not a function.`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\trecordHookMetadata(target, propertyKey, {\n\t\t\t\t\thandler,\n\t\t\t\t\t...(hookOptions ? { options: hookOptions } : {}),\n\t\t\t\t});\n\n\t\t\t\tconst constructor = resolveConstructor(target);\n\t\t\t\tconst hookRef: HookRef = {\n\t\t\t\t\tpropertyKey,\n\t\t\t\t\ttype,\n\t\t\t\t\t...(description ? { description } : {}),\n\t\t\t\t\t...(hookOptions ? { options: hookOptions } : {}),\n\t\t\t\t};\n\n\t\t\t\tfor (const ruleKey of ruleRefs) {\n\t\t\t\t\taddRuleHookAssociation(constructor, ruleKey, hookRef);\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t}\n\n\tfunction createFeatureHookDecorator(type: HookType) {\n\t\treturn (\n\t\t\toptions: FeatureHookDecoratorOptions = {}\n\t\t): MethodDecorator => {\n\t\t\tconst hookOptions = buildHookOptions(options);\n\t\t\tconst description = options.description;\n\n\t\t\treturn (target, propertyKey, descriptor) => {\n\t\t\t\tconst handler = descriptor?.value as HookHandler<World> | undefined;\n\t\t\t\tif (typeof handler !== \"function\") {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Hook decorator can only be applied to methods. ${String(propertyKey)} is not a function.`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\trecordHookMetadata(target, propertyKey, {\n\t\t\t\t\thandler,\n\t\t\t\t\t...(hookOptions ? { options: hookOptions } : {}),\n\t\t\t\t});\n\n\t\t\t\tconst constructor = resolveConstructor(target);\n\t\t\t\tconst hookRef: HookRef = {\n\t\t\t\t\tpropertyKey,\n\t\t\t\t\ttype,\n\t\t\t\t\t...(description ? { description } : {}),\n\t\t\t\t\t...(hookOptions ? { options: hookOptions } : {}),\n\t\t\t\t};\n\n\t\t\t\trecordFeatureHook(constructor, hookRef);\n\t\t\t};\n\t\t};\n\t}\n\n\tfunction resolveConstructor(target: object): FeatureConstructor {\n\t\tconst ctor = (target as { constructor?: unknown }).constructor;\n\t\tif (typeof ctor !== \"function\") {\n\t\t\tthrow new Error(\"Decorated target does not expose a constructor\");\n\t\t}\n\t\treturn ctor as unknown as FeatureConstructor;\n\t}\n\n\treturn {\n\t\tFeature,\n\t\tRule,\n\t\tScenario,\n\t\tGiven: createStepDecorator(\"Given\"),\n\t\tWhen: createStepDecorator(\"When\"),\n\t\tThen: createStepDecorator(\"Then\"),\n\t\tAnd: createStepDecorator(\"And\"),\n\t\tBut: createStepDecorator(\"But\"),\n\t\tBeforeFeature: createFeatureHookDecorator(\"beforeFeature\"),\n\t\tAfterFeature: createFeatureHookDecorator(\"afterFeature\"),\n\t\tBeforeRule: createRuleHookDecorator(\"beforeRule\"),\n\t\tAfterRule: createRuleHookDecorator(\"afterRule\"),\n\t\tBeforeScenario: createScenarioHookDecorator(\"beforeScenario\"),\n\t\tAfterScenario: createScenarioHookDecorator(\"afterScenario\"),\n\t\tBeforeScenarioOutline: createScenarioHookDecorator(\"beforeScenarioOutline\"),\n\t\tAfterScenarioOutline: createScenarioHookDecorator(\"afterScenarioOutline\"),\n\t};\n}\n","import type { StepExpression } from \"@autometa/scopes\";\nimport {\n createContainer,\n createDecorators,\n Scope,\n type Constructor,\n type IContainer,\n type Identifier,\n} from \"@autometa/injection\";\nimport type { RunnerEnvironment } from \"../dsl/create-runner\";\nimport { WORLD_TOKEN } from \"../tokens\";\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\ntype StepKeyword = \"Given\" | \"When\" | \"Then\" | \"And\" | \"But\";\n\ninterface StepMethodMetadata {\n readonly propertyKey: string | symbol;\n readonly keyword: StepKeyword;\n readonly expression: StepExpression;\n}\n\ninterface BindingMetadata {\n readonly steps: StepMethodMetadata[];\n}\n\ntype StepDecorator = (expression: StepExpression) => MethodDecorator;\n\n/**\n * Surface returned by `runner.bindingsTS()` for TypeScript experimental decorators.\n * Provides class-based step definitions with dependency injection support.\n */\nexport interface RunnerBindingsSurface<_World> {\n /**\n * Class decorator that marks a class as containing step definitions.\n * The class will be registered with the DI container and its step methods\n * will be automatically registered with the runner.\n */\n readonly Binding: () => ClassDecorator;\n\n /**\n * Step method decorators - use on methods within a @Binding class.\n */\n readonly Given: StepDecorator;\n readonly When: StepDecorator;\n readonly Then: StepDecorator;\n readonly And: StepDecorator;\n readonly But: StepDecorator;\n\n /**\n * DI decorators for registering and injecting dependencies.\n */\n readonly Injectable: (options?: { scope?: Scope }) => ClassDecorator;\n readonly Inject: (token: Identifier) => ParameterDecorator & PropertyDecorator;\n readonly LazyInject: (token: Identifier) => PropertyDecorator;\n\n /**\n * The global container used for registrations.\n * Can be used for advanced scenarios like manual registration.\n */\n readonly container: IContainer;\n}\n\n// ============================================================================\n// METADATA KEYS\n// ============================================================================\n\nconst BINDING_METADATA_KEY = Symbol(\"autometa:binding\");\nconst INJECT_PARAM_KEY = \"autometa:inject_param\"; // Same key used by createDecorators\n\n// ============================================================================\n// IMPLEMENTATION\n// ============================================================================\n\n/**\n * Creates the bindings surface for TypeScript experimental decorators.\n * This provides class-based step definitions with full DI support.\n * \n * Note: This function requires reflect-metadata to be imported by the user.\n * The import is done lazily to avoid breaking projects that don't use bindings.\n */\nexport function createBindingsTS<World>(\n stepsEnvironment: RunnerEnvironment<World, Record<string, unknown>>\n): RunnerBindingsSurface<World> {\n // Ensure reflect-metadata is available (user must import it)\n if (typeof Reflect === \"undefined\" || typeof Reflect.getMetadata !== \"function\") {\n throw new Error(\n \"bindingsTS() requires reflect-metadata. \" +\n \"Add `import 'reflect-metadata'` at the top of your step-definitions file.\"\n );\n }\n\n // Create global container for service registrations\n const globalContainer = createContainer();\n\n // Create DI decorators bound to global container\n const { Inject, LazyInject } = createDecorators(globalContainer);\n\n // Extract step registration functions from the environment\n const { Given: GivenFn, When: WhenFn, Then: ThenFn, And: AndFn, But: BothFn } = stepsEnvironment;\n\n // Cache for step class instances per scenario\n const instanceCache = new WeakMap<object, Map<unknown, unknown>>();\n // Cache for scenario containers\n const containerCache = new WeakMap<object, IContainer>();\n\n /**\n * Get or create a scenario-scoped container.\n */\n function getScenarioContainer(world: World): IContainer {\n const worldObj = world as object;\n let container = containerCache.get(worldObj);\n if (!container) {\n container = globalContainer.createChild();\n container.registerValue(WORLD_TOKEN, world as unknown as Record<string, unknown>);\n containerCache.set(worldObj, container);\n }\n return container;\n }\n\n /**\n * Get or create a step class instance for the current scenario.\n */\n function getStepInstance<T>(BindingClass: Constructor<T>, world: World): T {\n const worldObj = world as object;\n let cache = instanceCache.get(worldObj);\n if (!cache) {\n cache = new Map();\n instanceCache.set(worldObj, cache);\n }\n\n let instance = cache.get(BindingClass) as T | undefined;\n if (instance) {\n return instance;\n }\n\n const container = getScenarioContainer(world);\n instance = container.resolve(BindingClass) as T;\n cache.set(BindingClass, instance);\n return instance;\n }\n\n /**\n * Get or initialize binding metadata for a class\n */\n function getBindingMetadata(target: object): BindingMetadata {\n let metadata = Reflect.getMetadata(BINDING_METADATA_KEY, target) as BindingMetadata | undefined;\n if (!metadata) {\n metadata = { steps: [] };\n Reflect.defineMetadata(BINDING_METADATA_KEY, metadata, target);\n }\n return metadata;\n }\n\n /**\n * Get binding metadata from a class\n */\n function getBindingSteps(target: Constructor<unknown>): BindingMetadata | undefined {\n const proto = (target as unknown as { prototype: object }).prototype;\n return Reflect.getMetadata(BINDING_METADATA_KEY, target) ??\n (proto ? Reflect.getMetadata(BINDING_METADATA_KEY, proto) : undefined);\n }\n\n /**\n * Register a binding class's steps with the runner.\n */\n function registerBindingClass<T>(BindingClass: Constructor<T>): void {\n const metadata = getBindingSteps(BindingClass);\n if (!metadata) {\n return;\n }\n\n for (const step of metadata.steps) {\n const handler = (...args: unknown[]) => {\n // World is always the last argument from the runner\n const world = args[args.length - 1] as World;\n const stepArgs = args.slice(0, -1);\n\n const instance = getStepInstance(BindingClass, world) as Record<string | symbol, unknown>;\n const method = instance[step.propertyKey];\n\n if (typeof method !== \"function\") {\n throw new Error(`Step method ${String(step.propertyKey)} is not a function`);\n }\n\n return (method as (...args: unknown[]) => unknown).apply(instance, stepArgs);\n };\n\n // Register with the appropriate step function\n switch (step.keyword) {\n case \"Given\":\n GivenFn(step.expression, handler);\n break;\n case \"When\":\n WhenFn(step.expression, handler);\n break;\n case \"Then\":\n ThenFn(step.expression, handler);\n break;\n case \"And\":\n AndFn(step.expression, handler);\n break;\n case \"But\":\n BothFn(step.expression, handler);\n break;\n }\n }\n }\n\n // ============================================================================\n // DECORATORS\n // ============================================================================\n\n /**\n * @Binding class decorator\n */\n function Binding(): ClassDecorator {\n return (target) => {\n // Copy step metadata from prototype to the class itself\n const existing = Reflect.getMetadata(BINDING_METADATA_KEY, target.prototype);\n if (existing) {\n Reflect.defineMetadata(BINDING_METADATA_KEY, existing, target);\n }\n\n // Read @Inject parameter metadata to build deps array\n const paramTokens = Reflect.getMetadata(INJECT_PARAM_KEY, target) as Map<number, Identifier> | undefined;\n const deps: Identifier[] = [];\n\n if (paramTokens) {\n const maxIndex = Math.max(...paramTokens.keys());\n for (let i = 0; i <= maxIndex; i++) {\n const token = paramTokens.get(i);\n if (token) {\n deps[i] = token;\n }\n }\n }\n\n // Register with global container\n globalContainer.registerClass(target as unknown as Constructor<unknown>, {\n scope: Scope.TRANSIENT,\n deps,\n });\n\n // Register steps with the runner\n registerBindingClass(target as unknown as Constructor<unknown>);\n };\n }\n\n /**\n * Creates a step method decorator\n */\n function createStepDecorator(keyword: StepKeyword): StepDecorator {\n return (expression: StepExpression): MethodDecorator => {\n return (target, propertyKey, _descriptor) => {\n const metadata = getBindingMetadata(target);\n metadata.steps.push({\n propertyKey,\n keyword,\n expression,\n });\n };\n };\n }\n\n /**\n * Wrapped @Injectable that allows scope option\n */\n function Injectable(options?: { scope?: Scope }): ClassDecorator {\n return (target) => {\n globalContainer.registerClass(target as unknown as Constructor<unknown>, {\n scope: options?.scope ?? Scope.TRANSIENT,\n });\n };\n }\n\n return {\n Binding,\n Given: createStepDecorator(\"Given\"),\n When: createStepDecorator(\"When\"),\n Then: createStepDecorator(\"Then\"),\n And: createStepDecorator(\"And\"),\n But: createStepDecorator(\"But\"),\n Injectable,\n Inject,\n LazyInject,\n container: globalContainer,\n };\n}\n","import { createToken } from \"@autometa/injection\";\n\nexport const WORLD_TOKEN = createToken<Record<string, unknown>>(\n\"@autometa/runner/world\"\n);\n","import type { ExecutorConfig } from \"@autometa/config\";\nimport type {\n\tCoordinateFeatureOptions,\n\tCoordinateFeatureResult,\n} from \"@autometa/coordinator\";\nimport { coordinateFeature } from \"@autometa/coordinator\";\nimport type { ExecutorRuntime } from \"@autometa/executor\";\nimport type { BuildTestPlanOptions } from \"@autometa/test-builder\";\nimport type { SimpleFeature } from \"@autometa/gherkin\";\nimport type { ScopePlan } from \"@autometa/scopes\";\n\nimport type { RunnerEnvironment } from \"../dsl/create-runner\";\n\nexport interface CoordinateRunnerFeatureOptions<World> {\n\treadonly environment: RunnerEnvironment<World>;\n\treadonly plan?: ScopePlan<World>;\n\treadonly feature: SimpleFeature;\n\treadonly config: ExecutorConfig;\n\treadonly runtime?: ExecutorRuntime;\n\treadonly adapterFactory?:\n\t\t| CoordinateFeatureOptions<World>[\"adapterFactory\"]\n\t\t| undefined;\n\treadonly planBuilder?:\n\t\t| CoordinateFeatureOptions<World>[\"planBuilder\"]\n\t\t| undefined;\n\treadonly registerPlan?:\n\t\t| CoordinateFeatureOptions<World>[\"registerPlan\"]\n\t\t| undefined;\n\treadonly featureScope?:\n\t\t| BuildTestPlanOptions<World>[\"featureScope\"]\n\t\t| undefined;\n\treadonly hookLogger?: CoordinateFeatureOptions<World>[\"hookLogger\"];\n}\n\nexport function coordinateRunnerFeature<World>(\n\toptions: CoordinateRunnerFeatureOptions<World>\n): CoordinateFeatureResult<World> {\n\tconst {\n\t\tenvironment,\n\t\tfeature,\n\t\tconfig,\n\t\truntime,\n\t\tplan,\n\t\tadapterFactory,\n\t\tplanBuilder,\n\t\tregisterPlan,\n\t\tfeatureScope,\n\t\thookLogger,\n\t} = options;\n\n\tconst scopePlan = plan ?? environment.getPlan();\n\n\treturn coordinateFeature<World>({\n\t\tfeature,\n\t\tscopePlan,\n\t\tconfig,\n\t\t...(runtime ? { runtime } : {}),\n\t\t...(adapterFactory ? { adapterFactory } : {}),\n\t\t...(planBuilder ? { planBuilder } : {}),\n\t\t...(registerPlan ? { registerPlan } : {}),\n\t\t...(featureScope ? { featureScope } : {}),\n\t\t...(hookLogger ? { hookLogger } : {}),\n\t});\n}\n","import type {\n\tRunnerStepsSurface,\n} from \"./builder/create-runner-builder\";\nimport type {\n\tCucumberExpressionTypeMap,\n\tDefaultCucumberExpressionTypes,\n} from \"@autometa/scopes\";\n\nconst stepsErrorMessage =\n\t\"Runner steps surface has not been configured. Call setCurrentRunnerSteps() before accessing the shared runner surface.\";\n\nlet currentSteps:\n\t| RunnerStepsSurface<unknown, CucumberExpressionTypeMap>\n\t| undefined;\n\nexport function setCurrentRunnerSteps<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n>(steps: RunnerStepsSurface<World, ExpressionTypes>): void {\n\tcurrentSteps =\n\t\tsteps as RunnerStepsSurface<unknown, CucumberExpressionTypeMap>;\n}\n\nexport function getCurrentRunnerSteps<\n\tWorld,\n\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n>(): RunnerStepsSurface<World, ExpressionTypes> {\n\tif (!currentSteps) {\n\t\tthrow new Error(stepsErrorMessage);\n\t}\n\treturn currentSteps as RunnerStepsSurface<World, ExpressionTypes>;\n}\n\nexport function clearCurrentRunnerSteps(): void {\n\tcurrentSteps = undefined;\n}\n","export { createRunner } from \"./dsl/create-runner\";\nexport type {\n\tRunnerEnvironment,\n\tRunnerDsl,\n\tRunnerStepDsl,\n\tRunnerStepHandler,\n} from \"./dsl/create-runner\";\n\nexport type {\n\tRunnerBuilder,\n\tDerivableRunnerBuilder,\n\tRunnerDecoratorsSurface,\n\tRunnerStepsSurface,\n\tWorldWithApp,\n\tDefaultEnsureFacets,\n\t\tRunnerEnsureFactory,\n\t\tAssertionSetup,\n\t\tStepsEnvironmentMeta,\n\t\tAppFactoryContext,\n\t\tAppClassRegistrationOptions,\n\t\tAppRegistrationOptions,\n\t\tAppCompositionOptions,\n\t} from \"./builder/create-runner-builder\";\n\nexport { App, WORLD_INHERIT_KEYS, STEPS_ENVIRONMENT_META } from \"./builder/create-runner-builder\";\n\nexport type { RunnerBindingsSurface } from \"./bindings/create-bindings-ts\";\n\nexport { createDecoratorRunner } from \"./dsl/create-decorator-runner\";\nexport type {\n\tDecoratorRunnerEnvironment,\n\tDecoratorRegistrationApi,\n} from \"./dsl/create-decorator-runner\";\n\nexport { createGlobalRunner } from \"./dsl/create-global-runner\";\nexport type { GlobalRunner } from \"./dsl/create-global-runner\";\n\nexport { RunnerContext } from \"./core/runner-context\";\nexport type {\n\tRunnerContextOptions,\n\tRunnerScopeOptions,\n} from \"./core/runner-context\";\n\nexport {\n\tParameterRegistryAdapter,\n\tcreateParameterRegistryAdapter,\n} from \"./core/parameter-registry\";\n\nexport {\n\tcoordinateRunnerFeature,\n} from \"./runtime/coordinate-runner-feature\";\nexport type {\n\tCoordinateRunnerFeatureOptions,\n} from \"./runtime/coordinate-runner-feature\";\n\nexport {\n\tgetCurrentRunnerSteps,\n\tsetCurrentRunnerSteps,\n\tclearCurrentRunnerSteps,\n} from \"./current\";\n\nexport {\n\tconfigureStepTables,\n\tresetStepTableConfig,\n\tconfigureStepDocstrings,\n\tresetStepDocstringConfig,\n\tsetStepTable,\n\tclearStepTable,\n\tgetTable,\n\tconsumeTable,\n\tgetRawTable,\n\tsetStepDocstring,\n\tsetStepDocstringInfo,\n\tclearStepDocstring,\n\tgetDocstring,\n\tgetDocstringMediaType,\n\tgetDocstringInfo,\n\tconsumeDocstring,\n\tScenarioPendingError,\n\tisScenarioPendingError,\n\tPending,\n\tToDo,\n\tmarkScenarioPending,\n} from \"@autometa/executor\";\n\nexport type {\n\tHookLifecycleMetadata,\n\tHookLifecycleScenarioMetadata,\n\tHookLifecycleStepMetadata,\n\tHookLifecycleTargetScopeMetadata,\n} from \"@autometa/executor\";\n\nexport {\n\tgetGlobalRunner,\n\tconfigureGlobalRunner,\n\tresetGlobalRunner,\n\tdisposeGlobalRunner,\n\tuseGlobalRunnerEnvironment,\n\tgetGlobalRunnerEnvironment,\n\tgetConfiguredGlobalRunner,\n} from \"./global\";\nexport type { GlobalWorld, GlobalRunnerOptions } from \"./global\";\n\nexport { CucumberRunner } from \"./cucumber-runner\";\n\nexport { WORLD_TOKEN } from \"./tokens\";\n\nexport { createRunner as default } from \"./dsl/create-runner\";\n","import type { RunnerEnvironment } from \"./dsl/create-runner\";\nimport type { RunnerContextOptions } from \"./core/runner-context\";\nimport {\n\tcreateGlobalRunner,\n\ttype GlobalRunner,\n} from \"./dsl/create-global-runner\";\n\nexport interface GlobalWorld {\n\t[key: string]: unknown;\n}\n\nexport type GlobalRunnerOptions = RunnerContextOptions<GlobalWorld>;\n\nlet runnerInstance: GlobalRunner<GlobalWorld> | undefined;\n\nfunction instantiateRunner(options?: GlobalRunnerOptions) {\n\treturn createGlobalRunner<GlobalWorld>(options);\n}\n\nfunction requireConfigured(action: string): GlobalRunner<GlobalWorld> {\n\tif (!runnerInstance) {\n\t\tthrow new Error(\n\t\t\t`Global runner has not been configured. ${action}`\n\t\t);\n\t}\n\treturn runnerInstance;\n}\nexport function getGlobalRunner(options?: GlobalRunnerOptions) {\n\tif (!runnerInstance) {\n\t\trunnerInstance = instantiateRunner(options);\n\t}\n\treturn runnerInstance;\n}\n\nexport function configureGlobalRunner(options?: GlobalRunnerOptions) {\n\trunnerInstance = instantiateRunner(options);\n\treturn runnerInstance;\n}\n\nexport function resetGlobalRunner(options?: GlobalRunnerOptions) {\n\trunnerInstance = instantiateRunner(options);\n\treturn runnerInstance;\n}\n\nexport function disposeGlobalRunner() {\n\trunnerInstance = undefined;\n}\n\nexport function useGlobalRunnerEnvironment(\n\tenvironment: RunnerEnvironment<GlobalWorld>\n) {\n\tconst runner = requireConfigured(\n\t\t\"Call configureGlobalRunner() before injecting environments.\"\n\t);\n\treturn runner.useEnvironment(environment);\n}\n\nexport function getGlobalRunnerEnvironment() {\n\tconst runner = requireConfigured(\n\t\t\"Call configureGlobalRunner() before reading environments.\"\n\t);\n\treturn runner.getEnvironment();\n}\n\nexport function getConfiguredGlobalRunner() {\n\treturn requireConfigured(\n\t\t\"Call configureGlobalRunner() before accessing runner APIs.\"\n\t);\n}\n","import type {\n\tCucumberExpressionTypeMap,\n\tDefaultCucumberExpressionTypes,\n} from \"@autometa/scopes\";\n\nimport {\n\tcreateRunnerBuilder,\n\ttype RunnerBuilder,\n\ttype RunnerStepsSurface,\n} from \"./builder/create-runner-builder\";\nimport type { RunnerContextOptions } from \"./core/runner-context\";\nimport {\n\tclearCurrentRunnerSteps,\n\tgetCurrentRunnerSteps,\n\tsetCurrentRunnerSteps,\n} from \"./current\";\n\nexport class CucumberRunner {\n\tstatic builder<\n\t\tWorld,\n\t\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n\t>(\n\t\tinitial?: Partial<RunnerContextOptions<World>>\n\t): RunnerBuilder<World, ExpressionTypes> {\n\t\treturn createRunnerBuilder<World, ExpressionTypes>(initial);\n\t}\n\n\tstatic setSteps<\n\t\tWorld,\n\t\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n\t>(steps: RunnerStepsSurface<World, ExpressionTypes>): void {\n\t\tsetCurrentRunnerSteps(steps);\n\t}\n\n\tstatic steps<\n\t\tWorld,\n\t\tExpressionTypes extends CucumberExpressionTypeMap = DefaultCucumberExpressionTypes\n\t>(): RunnerStepsSurface<World, ExpressionTypes> {\n\t\treturn getCurrentRunnerSteps<World, ExpressionTypes>();\n\t}\n\n\tstatic clearSteps(): void {\n\t\tclearCurrentRunnerSteps();\n\t}\n}\n"]}