@codemation/core 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{EngineRuntimeRegistration.types-_M7KFD3D.d.ts → EngineRuntimeRegistration.types-BP6tsaNP.d.ts} +4 -2
  3. package/dist/{EngineWorkflowRunnerService-D0Cwngv7.d.cts → EngineWorkflowRunnerService-DzOCa1BW.d.cts} +4 -2
  4. package/dist/{InMemoryRunDataFactory-BIWx6e02.d.cts → InMemoryRunDataFactory-1iz7_SnO.d.cts} +24 -4
  5. package/dist/{workflowActivationPolicy-6V3OJD3N.cjs → InMemoryRunEventBusRegistry-B0_C4OnP.cjs} +1 -16
  6. package/dist/InMemoryRunEventBusRegistry-B0_C4OnP.cjs.map +1 -0
  7. package/dist/{workflowActivationPolicy-Td9HTOuD.js → InMemoryRunEventBusRegistry-C2U83Hmv.js} +2 -11
  8. package/dist/InMemoryRunEventBusRegistry-C2U83Hmv.js.map +1 -0
  9. package/dist/{RunIntentService-CuXAIO6_.d.ts → RunIntentService-BqhmdoA1.d.ts} +231 -3
  10. package/dist/{RunIntentService-5k0p-J67.d.cts → RunIntentService-S-1lW-gS.d.cts} +203 -3
  11. package/dist/bootstrap/index.cjs +4 -2
  12. package/dist/bootstrap/index.d.cts +24 -5
  13. package/dist/bootstrap/index.d.ts +4 -4
  14. package/dist/bootstrap/index.js +3 -3
  15. package/dist/{bootstrap-D-TDU9Lu.cjs → bootstrap-BaN6hZ5I.cjs} +6 -3
  16. package/dist/bootstrap-BaN6hZ5I.cjs.map +1 -0
  17. package/dist/{bootstrap-BhYxSivA.js → bootstrap-d_BMaDT4.js} +6 -3
  18. package/dist/bootstrap-d_BMaDT4.js.map +1 -0
  19. package/dist/{index-BnJ7_IrO.d.ts → index-CVs9rVhl.d.ts} +36 -6
  20. package/dist/index.cjs +48 -83
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +23 -4
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.js +27 -74
  25. package/dist/index.js.map +1 -1
  26. package/dist/{runtime-CJnObwsU.js → runtime-DUW6tIJ1.js} +423 -33
  27. package/dist/runtime-DUW6tIJ1.js.map +1 -0
  28. package/dist/{runtime-3YVDd2vY.cjs → runtime-Dvo2ru5A.cjs} +548 -32
  29. package/dist/runtime-Dvo2ru5A.cjs.map +1 -0
  30. package/dist/testing.cjs +6 -6
  31. package/dist/testing.cjs.map +1 -1
  32. package/dist/testing.d.cts +2 -2
  33. package/dist/testing.d.ts +2 -2
  34. package/dist/testing.js +3 -3
  35. package/package.json +1 -1
  36. package/src/ai/AiHost.ts +2 -0
  37. package/src/ai/CallableToolConfig.ts +28 -3
  38. package/src/bootstrap/index.ts +6 -1
  39. package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +1 -0
  40. package/src/bootstrap/runtime/EngineRuntimeRegistration.types.ts +3 -0
  41. package/src/contracts/CodemationTelemetryAttributeNames.ts +12 -0
  42. package/src/contracts/CodemationTelemetryMetricNames.ts +7 -0
  43. package/src/contracts/CostCatalogContract.ts +16 -0
  44. package/src/contracts/CostTrackingTelemetryContract.ts +47 -0
  45. package/src/contracts/GenAiTelemetryAttributeNames.ts +10 -0
  46. package/src/contracts/NoOpCostTrackingTelemetry.ts +16 -0
  47. package/src/contracts/NoOpCostTrackingTelemetryFactory.ts +9 -0
  48. package/src/contracts/NoOpExecutionTelemetry.ts +26 -0
  49. package/src/contracts/NoOpExecutionTelemetryFactory.ts +16 -0
  50. package/src/contracts/NoOpNodeExecutionTelemetry.ts +15 -0
  51. package/src/contracts/NoOpTelemetryArtifactReference.ts +9 -0
  52. package/src/contracts/NoOpTelemetrySpanScope.ts +22 -0
  53. package/src/contracts/index.ts +1 -0
  54. package/src/contracts/runTypes.ts +4 -1
  55. package/src/contracts/runtimeTypes.ts +7 -0
  56. package/src/contracts/telemetryTypes.ts +105 -0
  57. package/src/contracts/workflowTypes.ts +9 -0
  58. package/src/events/EventPublishingWorkflowExecutionRepository.ts +1 -1
  59. package/src/execution/CatalogBackedCostTrackingTelemetry.ts +81 -0
  60. package/src/execution/CatalogBackedCostTrackingTelemetryFactory.ts +12 -0
  61. package/src/execution/DefaultExecutionContextFactory.ts +23 -0
  62. package/src/execution/ExecutionTelemetryCostTrackingDecoratorFactory.ts +84 -0
  63. package/src/execution/NodeActivationRequestComposer.ts +1 -0
  64. package/src/execution/NodeExecutionSnapshotFactory.ts +2 -0
  65. package/src/execution/StaticCostCatalog.ts +22 -0
  66. package/src/execution/WorkflowRunExecutionContextFactory.ts +2 -0
  67. package/src/execution/index.ts +4 -0
  68. package/src/orchestration/NodeExecutionRequestHandlerService.ts +1 -0
  69. package/src/orchestration/RunContinuationService.ts +4 -0
  70. package/src/orchestration/RunStartService.ts +2 -0
  71. package/src/policies/storage/RunPolicySnapshotFactory.ts +9 -0
  72. package/src/runStorage/InMemoryWorkflowExecutionRepository.ts +4 -2
  73. package/src/types/index.ts +5 -0
  74. package/dist/bootstrap-BhYxSivA.js.map +0 -1
  75. package/dist/bootstrap-D-TDU9Lu.cjs.map +0 -1
  76. package/dist/runtime-3YVDd2vY.cjs.map +0 -1
  77. package/dist/runtime-CJnObwsU.js.map +0 -1
  78. package/dist/workflowActivationPolicy-6V3OJD3N.cjs.map +0 -1
  79. package/dist/workflowActivationPolicy-Td9HTOuD.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @codemation/core
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`782e934`](https://github.com/MadeRelevant/codemation/commit/782e93469ea6eee701d976b8f1dc18649d045c79) Thanks [@cblokland90](https://github.com/cblokland90)! - Add catalog-backed cost tracking contracts and wire AI/OCR usage into telemetry so hosts can aggregate provider-native execution costs.
8
+
9
+ Improve the telemetry dashboard and workflow detail experience with cost breakdowns, richer inspector data, workflow run cost totals, and credential rebinding fixes.
10
+
11
+ ### Patch Changes
12
+
13
+ - [#85](https://github.com/MadeRelevant/codemation/pull/85) [`a250ab8`](https://github.com/MadeRelevant/codemation/commit/a250ab8b973429cdfe708526a205e2565b004868) Thanks [@cblokland90](https://github.com/cblokland90)! - Decouple telemetry retention from run deletion and move node-specific measurements onto metric points.
14
+ - allow telemetry spans, artifacts, and metrics to outlive raw run state through explicit retention timestamps
15
+ - narrow telemetry spans to canonical span fields and persist extensible node-specific measurements as metric points
16
+ - update telemetry queries, docs, and regression coverage around real workflow execution plus agent/tool observability
17
+
18
+ - [#88](https://github.com/MadeRelevant/codemation/pull/88) [`052aba1`](https://github.com/MadeRelevant/codemation/commit/052aba17c9a4faf557bdfaa1a9644a1987ecc25e) Thanks [@cblokland90](https://github.com/cblokland90)! - Add a telemetry-backed node inspector slice for workflow detail and expose run-trace telemetry needed to power it.
19
+
20
+ - [`1a356af`](https://github.com/MadeRelevant/codemation/commit/1a356afae50bd3f982e92c3e9f931e3adbcd131f) - Repair malformed AI tool calls inside the agent loop instead of replaying the whole agent node, and surface clearer debugging details when recovery succeeds or is exhausted.
21
+ - classify repairable validation failures separately from non-repairable tool errors and preserve stable invocation correlation for failed calls
22
+ - persist structured validation details and expose them in next-host inspector fallbacks, timelines, and error views
23
+ - add regression coverage for repaired tool calls, exhaustion behavior, and mixed parallel tool rounds
24
+
3
25
  ## 0.7.0
4
26
 
5
27
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { Er as WebhookTriggerRoutingDiagnostics, Li as DependencyContainer, lr as TriggerRuntimeDiagnostics, na as EngineExecutionLimitsPolicyConfig, wr as WebhookTriggerMatcher } from "./RunIntentService-CuXAIO6_.js";
1
+ import { Ar as WebhookTriggerRoutingDiagnostics, Or as WebhookTriggerMatcher, Pa as EngineExecutionLimitsPolicyConfig, ha as DependencyContainer, hn as WorkflowPolicyRuntimeDefaults, pr as TriggerRuntimeDiagnostics } from "./RunIntentService-BqhmdoA1.js";
2
2
 
3
3
  //#region src/bootstrap/runtime/EngineRuntimeRegistration.types.d.ts
4
4
 
@@ -36,7 +36,9 @@ interface EngineRuntimeRegistrationOptions {
36
36
  webhookTriggerMatcherProvider?: WebhookTriggerMatcherProvider;
37
37
  /** Overrides default trigger diagnostics (undefined when omitted). */
38
38
  triggerRuntimeDiagnosticsProvider?: TriggerRuntimeDiagnosticsProvider;
39
+ /** Runtime retention/storage defaults used when workflows omit prune/storage policy fields. */
40
+ workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;
39
41
  }
40
42
  //#endregion
41
43
  export { TriggerRuntimeDiagnosticsProvider as n, WebhookTriggerMatcherProvider as r, EngineRuntimeRegistrationOptions as t };
42
- //# sourceMappingURL=EngineRuntimeRegistration.types-_M7KFD3D.d.ts.map
44
+ //# sourceMappingURL=EngineRuntimeRegistration.types-BP6tsaNP.d.ts.map
@@ -1,4 +1,4 @@
1
- import { E as NodeId, F as ParentExecutionRef, Jr as EngineExecutionLimitsPolicyConfig, Ln as PersistedWorkflowSnapshot, Rn as PersistedWorkflowSnapshotNode, Y as WorkflowDefinition, b as NodeConfigBase, f as Items, gn as WebhookTriggerMatcher, kr as DependencyContainer, qn as RunResult, r as Engine, sn as WorkflowRepository, tn as TriggerRuntimeDiagnostics, tt as WorkflowId, vn as WebhookTriggerRoutingDiagnostics, zn as PersistedWorkflowTokenRegistryLike } from "./RunIntentService-5k0p-J67.cjs";
1
+ import { E as NodeId, F as ParentExecutionRef, Ln as PersistedWorkflowSnapshot, Rn as PersistedWorkflowSnapshotNode, Si as EngineExecutionLimitsPolicyConfig, Y as WorkflowDefinition, b as NodeConfigBase, f as Items, gn as WebhookTriggerMatcher, qn as RunResult, r as Engine, ri as DependencyContainer, rt as WorkflowPolicyRuntimeDefaults, sn as WorkflowRepository, tn as TriggerRuntimeDiagnostics, tt as WorkflowId, vn as WebhookTriggerRoutingDiagnostics, zn as PersistedWorkflowTokenRegistryLike } from "./RunIntentService-S-1lW-gS.cjs";
2
2
 
3
3
  //#region src/workflowSnapshots/WorkflowSnapshotCodec.d.ts
4
4
  declare class WorkflowSnapshotCodec {
@@ -53,6 +53,8 @@ interface EngineRuntimeRegistrationOptions {
53
53
  webhookTriggerMatcherProvider?: WebhookTriggerMatcherProvider;
54
54
  /** Overrides default trigger diagnostics (undefined when omitted). */
55
55
  triggerRuntimeDiagnosticsProvider?: TriggerRuntimeDiagnosticsProvider;
56
+ /** Runtime retention/storage defaults used when workflows omit prune/storage policy fields. */
57
+ workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;
56
58
  }
57
59
  //#endregion
58
60
  //#region src/runtime/EngineWorkflowRunnerService.d.ts
@@ -70,4 +72,4 @@ declare class EngineWorkflowRunnerService {
70
72
  }
71
73
  //#endregion
72
74
  export { WorkflowSnapshotCodec as a, WebhookTriggerMatcherProvider as i, EngineRuntimeRegistrationOptions as n, TriggerRuntimeDiagnosticsProvider as r, EngineWorkflowRunnerService as t };
73
- //# sourceMappingURL=EngineWorkflowRunnerService-D0Cwngv7.d.cts.map
75
+ //# sourceMappingURL=EngineWorkflowRunnerService-DzOCa1BW.d.cts.map
@@ -1,5 +1,20 @@
1
- import { A as NodeOutputs, At as ExecutionContext, B as RunId, Bt as NodeBinaryAttachmentService, Ct as BinaryStorageStatResult, E as NodeId, F as ParentExecutionRef, Gt as NodeExecutionStatePublisher, H as RunnableNodeConfig, R as RunDataFactory, St as BinaryStorageReadResult, Tt as BinaryStorageWriteResult, Vt as NodeExecutionContext, a as BinaryAttachment, br as CredentialSessionService, bt as BinaryBody, jt as ExecutionContextFactory, kt as ExecutionBinaryService, tt as WorkflowId, u as Item, v as MutableRunData, vt as RetryPolicySpec, xt as BinaryStorage, y as NodeActivationId, z as RunDataSnapshot } from "./RunIntentService-5k0p-J67.cjs";
1
+ import { A as NodeOutputs, At as ExecutionContext, B as RunId, Bt as NodeBinaryAttachmentService, Ct as BinaryStorageStatResult, Dr as CostTrackingTelemetryFactory, E as NodeId, F as ParentExecutionRef, Gt as NodeExecutionStatePublisher, H as RunnableNodeConfig, I as PersistedRunPolicySnapshot, Jr as CredentialSessionService, R as RunDataFactory, St as BinaryStorageReadResult, Tt as BinaryStorageWriteResult, Vt as NodeExecutionContext, a as BinaryAttachment, bt as BinaryBody, jt as ExecutionContextFactory, kr as CostTrackingUsageRecord, kt as ExecutionBinaryService, rr as ExecutionTelemetryFactory, tt as WorkflowId, u as Item, v as MutableRunData, vt as RetryPolicySpec, xt as BinaryStorage, y as NodeActivationId, z as RunDataSnapshot } from "./RunIntentService-S-1lW-gS.cjs";
2
2
 
3
+ //#region src/contracts/CostCatalogContract.d.ts
4
+ interface CostCatalogEntry {
5
+ readonly component: CostTrackingUsageRecord["component"];
6
+ readonly provider: string;
7
+ readonly operation: string;
8
+ readonly pricingKey: string;
9
+ readonly usageUnit: string;
10
+ readonly currency: string;
11
+ readonly currencyScale: number;
12
+ readonly pricePerUnitMinor: number;
13
+ }
14
+ interface CostCatalog {
15
+ findEntry(args: CostTrackingUsageRecord): CostCatalogEntry | undefined;
16
+ }
17
+ //#endregion
3
18
  //#region src/execution/CredentialResolverFactory.d.ts
4
19
  declare class CredentialResolverFactory {
5
20
  private readonly credentialSessions;
@@ -20,17 +35,22 @@ declare class DefaultAsyncSleeper implements AsyncSleeper {
20
35
  //#region src/execution/DefaultExecutionContextFactory.d.ts
21
36
  declare class DefaultExecutionContextFactory implements ExecutionContextFactory {
22
37
  private readonly binaryStorage;
38
+ private readonly telemetryFactory;
39
+ private readonly costTrackingFactory;
23
40
  private readonly currentDate;
24
- constructor(binaryStorage?: BinaryStorage, currentDate?: () => Date);
41
+ private readonly telemetryDecoratorFactory;
42
+ constructor(binaryStorage?: BinaryStorage, telemetryFactory?: ExecutionTelemetryFactory, costTrackingFactory?: CostTrackingTelemetryFactory, currentDate?: () => Date);
25
43
  create(args: {
26
44
  runId: RunId;
27
45
  workflowId: WorkflowId;
28
46
  parent?: ParentExecutionRef;
47
+ policySnapshot?: PersistedRunPolicySnapshot;
29
48
  subworkflowDepth: number;
30
49
  engineMaxNodeActivations: number;
31
50
  engineMaxSubworkflowDepth: number;
32
51
  data: RunDataSnapshot;
33
52
  nodeState?: NodeExecutionStatePublisher;
53
+ telemetry?: ExecutionContext["telemetry"];
34
54
  getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
35
55
  }): ExecutionContext;
36
56
  }
@@ -107,5 +127,5 @@ declare class InMemoryRunDataFactory implements RunDataFactory {
107
127
  create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
108
128
  }
109
129
  //#endregion
110
- export { RunnableOutputBehavior as a, InProcessRetryRunner as c, AsyncSleeper as d, CredentialResolverFactory as f, UnavailableBinaryStorage as i, DefaultExecutionContextFactory as l, InMemoryBinaryStorage as n, RunnableOutputBehaviorResolver as o, DefaultExecutionBinaryService as r, ItemExprResolver as s, InMemoryRunDataFactory as t, DefaultAsyncSleeper as u };
111
- //# sourceMappingURL=InMemoryRunDataFactory-BIWx6e02.d.cts.map
130
+ export { RunnableOutputBehavior as a, InProcessRetryRunner as c, AsyncSleeper as d, CredentialResolverFactory as f, UnavailableBinaryStorage as i, DefaultExecutionContextFactory as l, CostCatalogEntry as m, InMemoryBinaryStorage as n, RunnableOutputBehaviorResolver as o, CostCatalog as p, DefaultExecutionBinaryService as r, ItemExprResolver as s, InMemoryRunDataFactory as t, DefaultAsyncSleeper as u };
131
+ //# sourceMappingURL=InMemoryRunDataFactory-1iz7_SnO.d.cts.map
@@ -235,21 +235,6 @@ var InMemoryRunEventBus = class {
235
235
  };
236
236
 
237
237
  //#endregion
238
- //#region src/contracts/workflowActivationPolicy.ts
239
- /** Default for tests and harnesses: every workflow is treated as active (legacy behavior). */
240
- var AllWorkflowsActiveWorkflowActivationPolicy = class {
241
- isActive(_workflowId) {
242
- return true;
243
- }
244
- };
245
-
246
- //#endregion
247
- Object.defineProperty(exports, 'AllWorkflowsActiveWorkflowActivationPolicy', {
248
- enumerable: true,
249
- get: function () {
250
- return AllWorkflowsActiveWorkflowActivationPolicy;
251
- }
252
- });
253
238
  Object.defineProperty(exports, 'ChainCursor', {
254
239
  enumerable: true,
255
240
  get: function () {
@@ -274,4 +259,4 @@ Object.defineProperty(exports, 'WorkflowBuilder', {
274
259
  return WorkflowBuilder;
275
260
  }
276
261
  });
277
- //# sourceMappingURL=workflowActivationPolicy-6V3OJD3N.cjs.map
262
+ //# sourceMappingURL=InMemoryRunEventBusRegistry-B0_C4OnP.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InMemoryRunEventBusRegistry-B0_C4OnP.cjs","names":["wf: WorkflowBuilder","from: NodeRef","branchPort: OutputPortKey","created: NodeRef[]","prev: NodeRef | null","port: OutputPortKey","wf: WorkflowBuilder","endpoints: ReadonlyArray<ChainCursorEndpoint>","port: OutputPortKey","prev: NodeRef | null","nextEndpoints: ChainCursorEndpoint[]","meta: { id: WorkflowId; name: string }","options?: Readonly<Record<string, never>>","onClose: () => void"],"sources":["../src/workflow/dsl/WhenBuilder.ts","../src/workflow/dsl/ChainCursorResolver.ts","../src/workflow/dsl/WorkflowBuilder.ts","../src/events/InMemoryRunEventSubscription.ts","../src/events/InMemoryRunEventBusRegistry.ts"],"sourcesContent":["import type { NodeId, NodeRef, OutputPortKey, UpstreamRefPlaceholder, WorkflowDefinition } from \"../../types\";\n\nimport { WorkflowBuilder } from \"./WorkflowBuilder\";\nimport type { AnyRunnableNodeConfig, BooleanWhenOverloads, ValidStepSequence } from \"./workflowBuilderTypes\";\n\nexport class WhenBuilder<TCurrentJson> {\n constructor(\n private readonly wf: WorkflowBuilder,\n private readonly from: NodeRef,\n private readonly branchPort: OutputPortKey,\n ) {}\n\n addBranch<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(\n steps: TSteps & ValidStepSequence<TCurrentJson, TSteps>,\n ): this {\n const created: NodeRef[] = [];\n\n let prev: NodeRef | null = null;\n for (const cfg of steps) {\n const ref = (this.wf as any).add(cfg) as NodeRef;\n created.push(ref);\n if (!prev) (this.wf as any).connect(this.from, ref, this.branchPort, \"in\");\n else (this.wf as any).connect(prev, ref, \"main\", \"in\");\n prev = ref;\n }\n\n for (const cfg of steps) {\n const maybe = cfg as unknown as { upstreamRefs?: Array<{ nodeId: NodeId } | UpstreamRefPlaceholder> };\n if (!Array.isArray(maybe.upstreamRefs) || maybe.upstreamRefs.length === 0) continue;\n\n maybe.upstreamRefs = maybe.upstreamRefs.map((r) => {\n if (typeof r !== \"string\") return r;\n const idx = parseInt(r.slice(1), 10);\n const nodeId = created[idx]?.id;\n return nodeId ? { nodeId } : { nodeId: r };\n });\n }\n\n return this;\n }\n\n readonly when: BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> = (\n branch: boolean,\n steps: ReadonlyArray<AnyRunnableNodeConfig> | AnyRunnableNodeConfig,\n ...more: AnyRunnableNodeConfig[]\n ): WhenBuilder<TCurrentJson> => {\n const list = Array.isArray(steps) ? steps : [steps, ...more];\n const port: OutputPortKey = branch ? \"true\" : \"false\";\n const b = new WhenBuilder<TCurrentJson>(this.wf, this.from, port);\n b.addBranch(list);\n return b;\n };\n\n build(): WorkflowDefinition {\n return this.wf.build();\n }\n}\n","import type {\n InputPortKey,\n NodeRef,\n OutputPortKey,\n RunnableNodeConfig,\n RunnableNodeOutputJson,\n WorkflowDefinition,\n} from \"../../types\";\n\nimport { WorkflowBuilder } from \"./WorkflowBuilder\";\nimport { WhenBuilder } from \"./WhenBuilder\";\nimport type {\n AnyRunnableNodeConfig,\n BooleanWhenOverloads,\n BranchOutputGuard,\n BranchStepsArg,\n StepSequenceOutput,\n} from \"./workflowBuilderTypes\";\n\ntype ChainCursorEndpoint = Readonly<{ node: NodeRef; output: OutputPortKey; inputPortHint?: InputPortKey }>;\n\ntype ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> & {\n <\n TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined,\n TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined,\n >(\n branches: Readonly<{\n true?: TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TTrueSteps> : never;\n false?: TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig>\n ? BranchStepsArg<TCurrentJson, TFalseSteps>\n : never;\n }> &\n BranchOutputGuard<TCurrentJson, TTrueSteps, TFalseSteps>,\n ): ChainCursor<StepSequenceOutput<TCurrentJson, TTrueSteps>>;\n};\n\nexport class ChainCursor<TCurrentJson> {\n constructor(\n private readonly wf: WorkflowBuilder,\n private readonly endpoints: ReadonlyArray<ChainCursorEndpoint>,\n ) {}\n\n then<TOutputJson, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson>>(\n config: TConfig,\n ): ChainCursor<RunnableNodeOutputJson<TConfig>> {\n const next = (this.wf as any).add(config) as NodeRef;\n const inputPortHint = this.resolveSharedInputPortHint();\n for (const e of this.endpoints) {\n (this.wf as any).connect(e.node, next, e.output);\n }\n return new ChainCursor<RunnableNodeOutputJson<TConfig>>(this.wf, [\n { node: next, output: \"main\", ...(inputPortHint ? { inputPortHint } : {}) },\n ]);\n }\n\n thenIntoInputHints<TOutputJson, TConfig extends RunnableNodeConfig<any, TOutputJson>>(\n config: TConfig,\n ): ChainCursor<RunnableNodeOutputJson<TConfig>> {\n const next = (this.wf as any).add(config) as NodeRef;\n for (const e of this.endpoints) {\n (this.wf as any).connect(e.node, next, e.output, e.inputPortHint ?? \"in\");\n }\n return new ChainCursor<RunnableNodeOutputJson<TConfig>>(this.wf, [{ node: next, output: \"main\" }]);\n }\n\n readonly when: ChainCursorWhenOverloads<TCurrentJson> = ((\n arg1:\n | boolean\n | Readonly<{ true?: ReadonlyArray<AnyRunnableNodeConfig>; false?: ReadonlyArray<AnyRunnableNodeConfig> }>,\n steps?: ReadonlyArray<AnyRunnableNodeConfig> | AnyRunnableNodeConfig,\n ...more: AnyRunnableNodeConfig[]\n ): WhenBuilder<TCurrentJson> | ChainCursor<TCurrentJson> => {\n if (this.endpoints.length !== 1) {\n throw new Error(\"ChainCursor.when(...) is only supported from a single cursor endpoint\");\n }\n const cursor = this.endpoints[0]!.node;\n\n if (typeof arg1 === \"boolean\") {\n const list = Array.isArray(steps) ? steps : steps ? [steps, ...more] : more;\n const port: OutputPortKey = arg1 ? \"true\" : \"false\";\n const b = new WhenBuilder<TCurrentJson>(this.wf, cursor, port);\n b.addBranch(list);\n return b;\n }\n\n const branches = arg1;\n const wfAny = this.wf as any;\n\n const buildBranch = (\n port: OutputPortKey,\n branchSteps: ReadonlyArray<AnyRunnableNodeConfig> | undefined,\n ): Readonly<{ end: NodeRef; endOutput: OutputPortKey; inputPortHint: InputPortKey }> => {\n const list = branchSteps ?? [];\n let prev: NodeRef | null = null;\n for (const cfg of list) {\n const ref = wfAny.add(cfg) as NodeRef;\n if (!prev) wfAny.connect(cursor, ref, port, \"in\");\n else wfAny.connect(prev, ref, \"main\", \"in\");\n prev = ref;\n }\n if (!prev) return { end: cursor, endOutput: port, inputPortHint: port };\n return { end: prev, endOutput: \"main\", inputPortHint: port };\n };\n\n const t = buildBranch(\"true\", branches.true);\n const f = buildBranch(\"false\", branches.false);\n return new ChainCursor<TCurrentJson>(this.wf, [\n { node: t.end, output: t.endOutput, inputPortHint: t.inputPortHint },\n { node: f.end, output: f.endOutput, inputPortHint: f.inputPortHint },\n ]);\n }) as ChainCursorWhenOverloads<TCurrentJson>;\n\n route<TNextJson>(\n branches: Readonly<\n Record<OutputPortKey, (branch: ChainCursor<TCurrentJson>) => ChainCursor<TNextJson> | undefined>\n >,\n ): ChainCursor<TNextJson> {\n if (this.endpoints.length !== 1) {\n throw new Error(\"ChainCursor.route(...) is only supported from a single cursor endpoint\");\n }\n const cursor = this.endpoints[0]!;\n const nextEndpoints: ChainCursorEndpoint[] = [];\n for (const [port, branchFactory] of Object.entries(branches)) {\n if (!branchFactory) {\n continue;\n }\n const branch = new ChainCursor<TCurrentJson>(this.wf, [{ node: cursor.node, output: port, inputPortHint: port }]);\n const builtBranch = branchFactory(branch);\n if (!builtBranch) {\n continue;\n }\n nextEndpoints.push(...builtBranch.endpoints);\n }\n return new ChainCursor<TNextJson>(this.wf, nextEndpoints);\n }\n\n build(): WorkflowDefinition {\n return this.wf.build();\n }\n\n private resolveSharedInputPortHint(): InputPortKey | undefined {\n const first = this.endpoints[0]?.inputPortHint;\n if (!first) {\n return undefined;\n }\n return this.endpoints.every((endpoint) => endpoint.inputPortHint === first) ? first : undefined;\n }\n}\n","import type {\n InputPortKey,\n NodeConfigBase,\n NodeDefinition,\n NodeRef,\n OutputPortKey,\n RunnableNodeOutputJson,\n TriggerNodeOutputJson,\n WorkflowDefinition,\n WorkflowId,\n} from \"../../types\";\n\nimport { ChainCursor } from \"./ChainCursorResolver\";\nimport type { AnyRunnableNodeConfig, AnyTriggerNodeConfig } from \"./workflowBuilderTypes\";\n\nexport class WorkflowBuilder {\n private readonly nodes: NodeDefinition[] = [];\n private readonly edges: WorkflowDefinition[\"edges\"] = [];\n private seq = 0;\n\n constructor(\n private readonly meta: { id: WorkflowId; name: string },\n private readonly options?: Readonly<Record<string, never>>,\n ) {}\n\n private add(config: NodeConfigBase): NodeRef {\n const tokenName = typeof config.type === \"function\" ? config.type.name : String(config.type);\n const id = config.id ?? `${tokenName}:${++this.seq}`;\n this.nodes.push({ id, kind: config.kind, type: config.type, name: config.name, config });\n return { id, kind: config.kind, name: config.name };\n }\n\n private connect(from: NodeRef, to: NodeRef, fromOutput: OutputPortKey = \"main\", toInput: InputPortKey = \"in\"): void {\n this.edges.push({ from: { nodeId: from.id, output: fromOutput }, to: { nodeId: to.id, input: toInput } });\n }\n\n trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>> {\n const ref = this.add(config);\n return new ChainCursor<TriggerNodeOutputJson<TConfig>>(this, [{ node: ref, output: \"main\" }]);\n }\n\n start<TConfig extends AnyRunnableNodeConfig>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>> {\n const ref = this.add(config);\n return new ChainCursor<RunnableNodeOutputJson<TConfig>>(this, [{ node: ref, output: \"main\" }]);\n }\n\n build(): WorkflowDefinition {\n return { ...this.meta, nodes: this.nodes, edges: this.edges };\n }\n}\n\nexport { ChainCursor } from \"./ChainCursorResolver\";\nexport { WhenBuilder } from \"./WhenBuilder\";\n","import type { RunEventSubscription } from \"./runEvents\";\n\nexport class InMemoryRunEventSubscription implements RunEventSubscription {\n constructor(private readonly onClose: () => void) {}\n\n async close(): Promise<void> {\n this.onClose();\n }\n}\n","import type { WorkflowId } from \"../types\";\n\nimport type { RunEvent, RunEventBus, RunEventSubscription } from \"./runEvents\";\n\nimport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n\nexport class InMemoryRunEventBus implements RunEventBus {\n private readonly globalListeners = new Set<(event: RunEvent) => void>();\n private readonly listenersByWorkflowId = new Map<WorkflowId, Set<(event: RunEvent) => void>>();\n\n async publish(event: RunEvent): Promise<void> {\n for (const listener of this.globalListeners) listener(event);\n for (const listener of this.listenersByWorkflowId.get(event.workflowId) ?? []) listener(event);\n }\n\n async subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n this.globalListeners.add(onEvent);\n return new InMemoryRunEventSubscription(() => {\n this.globalListeners.delete(onEvent);\n });\n }\n\n async subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n const existing = this.listenersByWorkflowId.get(workflowId) ?? new Set<(event: RunEvent) => void>();\n existing.add(onEvent);\n this.listenersByWorkflowId.set(workflowId, existing);\n\n return new InMemoryRunEventSubscription(() => {\n const listeners = this.listenersByWorkflowId.get(workflowId);\n if (!listeners) return;\n listeners.delete(onEvent);\n if (listeners.size === 0) this.listenersByWorkflowId.delete(workflowId);\n });\n }\n}\n\nexport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n"],"mappings":";;AAKA,IAAa,cAAb,MAAa,YAA0B;CACrC,YACE,AAAiBA,IACjB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UAAU,SAAmE;AACjF,OAAK,gBAAgB,IAAI,QAAQ;AACjC,SAAO,IAAI,mCAAmC;AAC5C,QAAK,gBAAgB,OAAO,QAAQ;IACpC;;CAGJ,MAAM,oBAAoB,YAAwB,SAAmE;EACnH,MAAM,WAAW,KAAK,sBAAsB,IAAI,WAAW,oBAAI,IAAI,KAAgC;AACnG,WAAS,IAAI,QAAQ;AACrB,OAAK,sBAAsB,IAAI,YAAY,SAAS;AAEpD,SAAO,IAAI,mCAAmC;GAC5C,MAAM,YAAY,KAAK,sBAAsB,IAAI,WAAW;AAC5D,OAAI,CAAC,UAAW;AAChB,aAAU,OAAO,QAAQ;AACzB,OAAI,UAAU,SAAS,EAAG,MAAK,sBAAsB,OAAO,WAAW;IACvE"}
@@ -234,14 +234,5 @@ var InMemoryRunEventBus = class {
234
234
  };
235
235
 
236
236
  //#endregion
237
- //#region src/contracts/workflowActivationPolicy.ts
238
- /** Default for tests and harnesses: every workflow is treated as active (legacy behavior). */
239
- var AllWorkflowsActiveWorkflowActivationPolicy = class {
240
- isActive(_workflowId) {
241
- return true;
242
- }
243
- };
244
-
245
- //#endregion
246
- export { WhenBuilder as a, ChainCursor as i, InMemoryRunEventBus as n, WorkflowBuilder as r, AllWorkflowsActiveWorkflowActivationPolicy as t };
247
- //# sourceMappingURL=workflowActivationPolicy-Td9HTOuD.js.map
237
+ export { WhenBuilder as i, WorkflowBuilder as n, ChainCursor as r, InMemoryRunEventBus as t };
238
+ //# sourceMappingURL=InMemoryRunEventBusRegistry-C2U83Hmv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InMemoryRunEventBusRegistry-C2U83Hmv.js","names":["wf: WorkflowBuilder","from: NodeRef","branchPort: OutputPortKey","created: NodeRef[]","prev: NodeRef | null","port: OutputPortKey","wf: WorkflowBuilder","endpoints: ReadonlyArray<ChainCursorEndpoint>","port: OutputPortKey","prev: NodeRef | null","nextEndpoints: ChainCursorEndpoint[]","meta: { id: WorkflowId; name: string }","options?: Readonly<Record<string, never>>","onClose: () => void"],"sources":["../src/workflow/dsl/WhenBuilder.ts","../src/workflow/dsl/ChainCursorResolver.ts","../src/workflow/dsl/WorkflowBuilder.ts","../src/events/InMemoryRunEventSubscription.ts","../src/events/InMemoryRunEventBusRegistry.ts"],"sourcesContent":["import type { NodeId, NodeRef, OutputPortKey, UpstreamRefPlaceholder, WorkflowDefinition } from \"../../types\";\n\nimport { WorkflowBuilder } from \"./WorkflowBuilder\";\nimport type { AnyRunnableNodeConfig, BooleanWhenOverloads, ValidStepSequence } from \"./workflowBuilderTypes\";\n\nexport class WhenBuilder<TCurrentJson> {\n constructor(\n private readonly wf: WorkflowBuilder,\n private readonly from: NodeRef,\n private readonly branchPort: OutputPortKey,\n ) {}\n\n addBranch<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(\n steps: TSteps & ValidStepSequence<TCurrentJson, TSteps>,\n ): this {\n const created: NodeRef[] = [];\n\n let prev: NodeRef | null = null;\n for (const cfg of steps) {\n const ref = (this.wf as any).add(cfg) as NodeRef;\n created.push(ref);\n if (!prev) (this.wf as any).connect(this.from, ref, this.branchPort, \"in\");\n else (this.wf as any).connect(prev, ref, \"main\", \"in\");\n prev = ref;\n }\n\n for (const cfg of steps) {\n const maybe = cfg as unknown as { upstreamRefs?: Array<{ nodeId: NodeId } | UpstreamRefPlaceholder> };\n if (!Array.isArray(maybe.upstreamRefs) || maybe.upstreamRefs.length === 0) continue;\n\n maybe.upstreamRefs = maybe.upstreamRefs.map((r) => {\n if (typeof r !== \"string\") return r;\n const idx = parseInt(r.slice(1), 10);\n const nodeId = created[idx]?.id;\n return nodeId ? { nodeId } : { nodeId: r };\n });\n }\n\n return this;\n }\n\n readonly when: BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> = (\n branch: boolean,\n steps: ReadonlyArray<AnyRunnableNodeConfig> | AnyRunnableNodeConfig,\n ...more: AnyRunnableNodeConfig[]\n ): WhenBuilder<TCurrentJson> => {\n const list = Array.isArray(steps) ? steps : [steps, ...more];\n const port: OutputPortKey = branch ? \"true\" : \"false\";\n const b = new WhenBuilder<TCurrentJson>(this.wf, this.from, port);\n b.addBranch(list);\n return b;\n };\n\n build(): WorkflowDefinition {\n return this.wf.build();\n }\n}\n","import type {\n InputPortKey,\n NodeRef,\n OutputPortKey,\n RunnableNodeConfig,\n RunnableNodeOutputJson,\n WorkflowDefinition,\n} from \"../../types\";\n\nimport { WorkflowBuilder } from \"./WorkflowBuilder\";\nimport { WhenBuilder } from \"./WhenBuilder\";\nimport type {\n AnyRunnableNodeConfig,\n BooleanWhenOverloads,\n BranchOutputGuard,\n BranchStepsArg,\n StepSequenceOutput,\n} from \"./workflowBuilderTypes\";\n\ntype ChainCursorEndpoint = Readonly<{ node: NodeRef; output: OutputPortKey; inputPortHint?: InputPortKey }>;\n\ntype ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> & {\n <\n TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined,\n TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined,\n >(\n branches: Readonly<{\n true?: TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TTrueSteps> : never;\n false?: TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig>\n ? BranchStepsArg<TCurrentJson, TFalseSteps>\n : never;\n }> &\n BranchOutputGuard<TCurrentJson, TTrueSteps, TFalseSteps>,\n ): ChainCursor<StepSequenceOutput<TCurrentJson, TTrueSteps>>;\n};\n\nexport class ChainCursor<TCurrentJson> {\n constructor(\n private readonly wf: WorkflowBuilder,\n private readonly endpoints: ReadonlyArray<ChainCursorEndpoint>,\n ) {}\n\n then<TOutputJson, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson>>(\n config: TConfig,\n ): ChainCursor<RunnableNodeOutputJson<TConfig>> {\n const next = (this.wf as any).add(config) as NodeRef;\n const inputPortHint = this.resolveSharedInputPortHint();\n for (const e of this.endpoints) {\n (this.wf as any).connect(e.node, next, e.output);\n }\n return new ChainCursor<RunnableNodeOutputJson<TConfig>>(this.wf, [\n { node: next, output: \"main\", ...(inputPortHint ? { inputPortHint } : {}) },\n ]);\n }\n\n thenIntoInputHints<TOutputJson, TConfig extends RunnableNodeConfig<any, TOutputJson>>(\n config: TConfig,\n ): ChainCursor<RunnableNodeOutputJson<TConfig>> {\n const next = (this.wf as any).add(config) as NodeRef;\n for (const e of this.endpoints) {\n (this.wf as any).connect(e.node, next, e.output, e.inputPortHint ?? \"in\");\n }\n return new ChainCursor<RunnableNodeOutputJson<TConfig>>(this.wf, [{ node: next, output: \"main\" }]);\n }\n\n readonly when: ChainCursorWhenOverloads<TCurrentJson> = ((\n arg1:\n | boolean\n | Readonly<{ true?: ReadonlyArray<AnyRunnableNodeConfig>; false?: ReadonlyArray<AnyRunnableNodeConfig> }>,\n steps?: ReadonlyArray<AnyRunnableNodeConfig> | AnyRunnableNodeConfig,\n ...more: AnyRunnableNodeConfig[]\n ): WhenBuilder<TCurrentJson> | ChainCursor<TCurrentJson> => {\n if (this.endpoints.length !== 1) {\n throw new Error(\"ChainCursor.when(...) is only supported from a single cursor endpoint\");\n }\n const cursor = this.endpoints[0]!.node;\n\n if (typeof arg1 === \"boolean\") {\n const list = Array.isArray(steps) ? steps : steps ? [steps, ...more] : more;\n const port: OutputPortKey = arg1 ? \"true\" : \"false\";\n const b = new WhenBuilder<TCurrentJson>(this.wf, cursor, port);\n b.addBranch(list);\n return b;\n }\n\n const branches = arg1;\n const wfAny = this.wf as any;\n\n const buildBranch = (\n port: OutputPortKey,\n branchSteps: ReadonlyArray<AnyRunnableNodeConfig> | undefined,\n ): Readonly<{ end: NodeRef; endOutput: OutputPortKey; inputPortHint: InputPortKey }> => {\n const list = branchSteps ?? [];\n let prev: NodeRef | null = null;\n for (const cfg of list) {\n const ref = wfAny.add(cfg) as NodeRef;\n if (!prev) wfAny.connect(cursor, ref, port, \"in\");\n else wfAny.connect(prev, ref, \"main\", \"in\");\n prev = ref;\n }\n if (!prev) return { end: cursor, endOutput: port, inputPortHint: port };\n return { end: prev, endOutput: \"main\", inputPortHint: port };\n };\n\n const t = buildBranch(\"true\", branches.true);\n const f = buildBranch(\"false\", branches.false);\n return new ChainCursor<TCurrentJson>(this.wf, [\n { node: t.end, output: t.endOutput, inputPortHint: t.inputPortHint },\n { node: f.end, output: f.endOutput, inputPortHint: f.inputPortHint },\n ]);\n }) as ChainCursorWhenOverloads<TCurrentJson>;\n\n route<TNextJson>(\n branches: Readonly<\n Record<OutputPortKey, (branch: ChainCursor<TCurrentJson>) => ChainCursor<TNextJson> | undefined>\n >,\n ): ChainCursor<TNextJson> {\n if (this.endpoints.length !== 1) {\n throw new Error(\"ChainCursor.route(...) is only supported from a single cursor endpoint\");\n }\n const cursor = this.endpoints[0]!;\n const nextEndpoints: ChainCursorEndpoint[] = [];\n for (const [port, branchFactory] of Object.entries(branches)) {\n if (!branchFactory) {\n continue;\n }\n const branch = new ChainCursor<TCurrentJson>(this.wf, [{ node: cursor.node, output: port, inputPortHint: port }]);\n const builtBranch = branchFactory(branch);\n if (!builtBranch) {\n continue;\n }\n nextEndpoints.push(...builtBranch.endpoints);\n }\n return new ChainCursor<TNextJson>(this.wf, nextEndpoints);\n }\n\n build(): WorkflowDefinition {\n return this.wf.build();\n }\n\n private resolveSharedInputPortHint(): InputPortKey | undefined {\n const first = this.endpoints[0]?.inputPortHint;\n if (!first) {\n return undefined;\n }\n return this.endpoints.every((endpoint) => endpoint.inputPortHint === first) ? first : undefined;\n }\n}\n","import type {\n InputPortKey,\n NodeConfigBase,\n NodeDefinition,\n NodeRef,\n OutputPortKey,\n RunnableNodeOutputJson,\n TriggerNodeOutputJson,\n WorkflowDefinition,\n WorkflowId,\n} from \"../../types\";\n\nimport { ChainCursor } from \"./ChainCursorResolver\";\nimport type { AnyRunnableNodeConfig, AnyTriggerNodeConfig } from \"./workflowBuilderTypes\";\n\nexport class WorkflowBuilder {\n private readonly nodes: NodeDefinition[] = [];\n private readonly edges: WorkflowDefinition[\"edges\"] = [];\n private seq = 0;\n\n constructor(\n private readonly meta: { id: WorkflowId; name: string },\n private readonly options?: Readonly<Record<string, never>>,\n ) {}\n\n private add(config: NodeConfigBase): NodeRef {\n const tokenName = typeof config.type === \"function\" ? config.type.name : String(config.type);\n const id = config.id ?? `${tokenName}:${++this.seq}`;\n this.nodes.push({ id, kind: config.kind, type: config.type, name: config.name, config });\n return { id, kind: config.kind, name: config.name };\n }\n\n private connect(from: NodeRef, to: NodeRef, fromOutput: OutputPortKey = \"main\", toInput: InputPortKey = \"in\"): void {\n this.edges.push({ from: { nodeId: from.id, output: fromOutput }, to: { nodeId: to.id, input: toInput } });\n }\n\n trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>> {\n const ref = this.add(config);\n return new ChainCursor<TriggerNodeOutputJson<TConfig>>(this, [{ node: ref, output: \"main\" }]);\n }\n\n start<TConfig extends AnyRunnableNodeConfig>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>> {\n const ref = this.add(config);\n return new ChainCursor<RunnableNodeOutputJson<TConfig>>(this, [{ node: ref, output: \"main\" }]);\n }\n\n build(): WorkflowDefinition {\n return { ...this.meta, nodes: this.nodes, edges: this.edges };\n }\n}\n\nexport { ChainCursor } from \"./ChainCursorResolver\";\nexport { WhenBuilder } from \"./WhenBuilder\";\n","import type { RunEventSubscription } from \"./runEvents\";\n\nexport class InMemoryRunEventSubscription implements RunEventSubscription {\n constructor(private readonly onClose: () => void) {}\n\n async close(): Promise<void> {\n this.onClose();\n }\n}\n","import type { WorkflowId } from \"../types\";\n\nimport type { RunEvent, RunEventBus, RunEventSubscription } from \"./runEvents\";\n\nimport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n\nexport class InMemoryRunEventBus implements RunEventBus {\n private readonly globalListeners = new Set<(event: RunEvent) => void>();\n private readonly listenersByWorkflowId = new Map<WorkflowId, Set<(event: RunEvent) => void>>();\n\n async publish(event: RunEvent): Promise<void> {\n for (const listener of this.globalListeners) listener(event);\n for (const listener of this.listenersByWorkflowId.get(event.workflowId) ?? []) listener(event);\n }\n\n async subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n this.globalListeners.add(onEvent);\n return new InMemoryRunEventSubscription(() => {\n this.globalListeners.delete(onEvent);\n });\n }\n\n async subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n const existing = this.listenersByWorkflowId.get(workflowId) ?? new Set<(event: RunEvent) => void>();\n existing.add(onEvent);\n this.listenersByWorkflowId.set(workflowId, existing);\n\n return new InMemoryRunEventSubscription(() => {\n const listeners = this.listenersByWorkflowId.get(workflowId);\n if (!listeners) return;\n listeners.delete(onEvent);\n if (listeners.size === 0) this.listenersByWorkflowId.delete(workflowId);\n });\n }\n}\n\nexport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n"],"mappings":";AAKA,IAAa,cAAb,MAAa,YAA0B;CACrC,YACE,AAAiBA,IACjB,AAAiBC,MACjB,AAAiBC,YACjB;EAHiB;EACA;EACA;;CAGnB,UACE,OACM;EACN,MAAMC,UAAqB,EAAE;EAE7B,IAAIC,OAAuB;AAC3B,OAAK,MAAM,OAAO,OAAO;GACvB,MAAM,MAAO,KAAK,GAAW,IAAI,IAAI;AACrC,WAAQ,KAAK,IAAI;AACjB,OAAI,CAAC,KAAM,CAAC,KAAK,GAAW,QAAQ,KAAK,MAAM,KAAK,KAAK,YAAY,KAAK;OACrE,CAAC,KAAK,GAAW,QAAQ,MAAM,KAAK,QAAQ,KAAK;AACtD,UAAO;;AAGT,OAAK,MAAM,OAAO,OAAO;GACvB,MAAM,QAAQ;AACd,OAAI,CAAC,MAAM,QAAQ,MAAM,aAAa,IAAI,MAAM,aAAa,WAAW,EAAG;AAE3E,SAAM,eAAe,MAAM,aAAa,KAAK,MAAM;AACjD,QAAI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#endregion
277
+ //#region src/contracts/CostTrackingTelemetryContract.d.ts
278
+ type CostTrackingComponent = "chat" | "ocr" | "rag";
279
+ declare const CostTrackingTelemetryMetricNames: {
280
+ readonly usage: "codemation.cost.usage";
281
+ readonly estimatedCost: "codemation.cost.estimated";
282
+ };
283
+ declare const CostTrackingTelemetryAttributeNames: {
284
+ readonly component: "cost.component";
285
+ readonly provider: "cost.provider";
286
+ readonly operation: "cost.operation";
287
+ readonly pricingKey: "cost.pricing_key";
288
+ readonly usageUnit: "cost.usage_unit";
289
+ readonly currency: "cost.currency";
290
+ readonly currencyScale: "cost.currency_scale";
291
+ readonly estimateKind: "cost.estimate_kind";
292
+ };
293
+ interface CostTrackingUsageRecord {
294
+ readonly component: CostTrackingComponent;
295
+ readonly provider: string;
296
+ readonly operation: string;
297
+ readonly pricingKey: string;
298
+ readonly usageUnit: string;
299
+ readonly quantity: number;
300
+ readonly modelName?: string;
301
+ readonly attributes?: TelemetryAttributes;
302
+ }
303
+ interface CostTrackingPriceQuote {
304
+ readonly currency: string;
305
+ readonly currencyScale: number;
306
+ readonly estimatedAmountMinor: number;
307
+ readonly estimateKind: "catalog";
308
+ }
309
+ interface CostTrackingTelemetry {
310
+ captureUsage(args: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
311
+ forScope(scope: TelemetryScope): CostTrackingTelemetry;
312
+ }
313
+ interface CostTrackingTelemetryFactory {
314
+ create(args: Readonly<{
315
+ telemetry: ExecutionTelemetry;
316
+ }>): CostTrackingTelemetry;
317
+ }
318
+ //#endregion
319
+ //#region src/contracts/NoOpTelemetryArtifactReference.d.ts
320
+ declare class NoOpTelemetryArtifactReference {
321
+ static readonly value: TelemetryArtifactReference;
322
+ }
323
+ //#endregion
324
+ //#region src/contracts/NoOpTelemetrySpanScope.d.ts
325
+ declare class NoOpTelemetrySpanScope {
326
+ static readonly value: TelemetrySpanScope;
327
+ }
328
+ //#endregion
329
+ //#region src/contracts/NoOpNodeExecutionTelemetry.d.ts
330
+ declare class NoOpNodeExecutionTelemetry {
331
+ static readonly value: NodeExecutionTelemetry;
332
+ }
333
+ //#endregion
334
+ //#region src/contracts/NoOpExecutionTelemetry.d.ts
335
+ declare class NoOpExecutionTelemetry {
336
+ static readonly value: ExecutionTelemetry;
337
+ }
338
+ //#endregion
339
+ //#region src/contracts/NoOpExecutionTelemetryFactory.d.ts
340
+ declare class NoOpExecutionTelemetryFactory implements ExecutionTelemetryFactory {
341
+ create(_: Readonly<{
342
+ runId: RunId;
343
+ workflowId: WorkflowId;
344
+ parent?: ParentExecutionRef;
345
+ policySnapshot?: PersistedRunPolicySnapshot;
346
+ }>): ExecutionTelemetry;
347
+ }
348
+ //#endregion
349
+ //#region src/contracts/CodemationTelemetryAttributeNames.d.ts
350
+ declare class CodemationTelemetryAttributeNames {
351
+ static readonly workflowId = "codemation.workflow.id";
352
+ static readonly runId = "codemation.run.id";
353
+ static readonly nodeId = "codemation.node.id";
354
+ static readonly activationId = "codemation.activation.id";
355
+ static readonly nodeType = "codemation.node.type";
356
+ static readonly nodeRole = "codemation.node.role";
357
+ static readonly workflowFolder = "codemation.workflow.folder";
358
+ static readonly connectionInvocationId = "codemation.connection.invocation_id";
359
+ static readonly toolName = "codemation.tool.name";
360
+ static readonly traceParentRunId = "codemation.parent.run.id";
361
+ }
362
+ //#endregion
363
+ //#region src/contracts/GenAiTelemetryAttributeNames.d.ts
364
+ declare class GenAiTelemetryAttributeNames {
365
+ static readonly operationName = "gen_ai.operation.name";
366
+ static readonly requestModel = "gen_ai.request.model";
367
+ static readonly usageInputTokens = "gen_ai.usage.input_tokens";
368
+ static readonly usageOutputTokens = "gen_ai.usage.output_tokens";
369
+ static readonly usageTotalTokens = "gen_ai.usage.total_tokens";
370
+ static readonly usageCacheReadInputTokens = "gen_ai.usage.cache_read.input_tokens";
371
+ static readonly usageCacheCreationInputTokens = "gen_ai.usage.cache_creation.input_tokens";
372
+ static readonly usageReasoningTokens = "codemation.gen_ai.usage.reasoning_tokens";
373
+ }
374
+ //#endregion
375
+ //#region src/contracts/CodemationTelemetryMetricNames.d.ts
376
+ declare class CodemationTelemetryMetricNames {
377
+ static readonly agentTurns = "codemation.ai.turns";
378
+ static readonly agentToolCalls = "codemation.ai.tool_calls";
379
+ static readonly gmailMessagesEmitted = "codemation.gmail.messages_emitted";
380
+ static readonly gmailAttachments = "codemation.gmail.attachments";
381
+ static readonly gmailAttachmentBytes = "codemation.gmail.attachment_bytes";
382
+ }
383
+ //#endregion
384
+ //#region src/contracts/telemetryTypes.d.ts
385
+ type TelemetryAttributePrimitive = string | number | boolean | null;
386
+ interface TelemetryAttributes {
387
+ readonly [key: string]: TelemetryAttributePrimitive | undefined;
388
+ }
389
+ interface TelemetryMetricRecord {
390
+ readonly name: string;
391
+ readonly value: number;
392
+ readonly unit?: string;
393
+ readonly attributes?: TelemetryAttributes;
394
+ }
395
+ interface TelemetrySpanEventRecord {
396
+ readonly name: string;
397
+ readonly occurredAt?: Date;
398
+ readonly attributes?: TelemetryAttributes;
399
+ }
400
+ interface TelemetryArtifactAttachment {
401
+ readonly kind: string;
402
+ readonly contentType: string;
403
+ readonly previewText?: string;
404
+ readonly previewJson?: JsonValue;
405
+ readonly payloadText?: string;
406
+ readonly payloadJson?: JsonValue;
407
+ readonly bytes?: number;
408
+ readonly truncated?: boolean;
409
+ readonly expiresAt?: Date;
410
+ }
411
+ interface TelemetryArtifactReference {
412
+ readonly artifactId: string;
413
+ readonly traceId?: string;
414
+ readonly spanId?: string;
415
+ }
416
+ interface TelemetrySpanEnd {
417
+ readonly status?: "ok" | "error";
418
+ readonly statusMessage?: string;
419
+ readonly endedAt?: Date;
420
+ readonly attributes?: TelemetryAttributes;
421
+ }
422
+ interface TelemetryChildSpanStart {
423
+ readonly name: string;
424
+ readonly kind?: "internal" | "client";
425
+ readonly startedAt?: Date;
426
+ readonly attributes?: TelemetryAttributes;
427
+ }
428
+ interface TelemetryScope {
429
+ readonly traceId?: string;
430
+ readonly spanId?: string;
431
+ readonly costTracking?: CostTrackingTelemetry;
432
+ addSpanEvent(args: TelemetrySpanEventRecord): Promise<void> | void;
433
+ recordMetric(args: TelemetryMetricRecord): Promise<void> | void;
434
+ attachArtifact(args: TelemetryArtifactAttachment): Promise<TelemetryArtifactReference> | TelemetryArtifactReference;
435
+ }
436
+ interface TelemetrySpanScope extends TelemetryScope {
437
+ readonly traceId: string;
438
+ readonly spanId: string;
439
+ end(args?: TelemetrySpanEnd): Promise<void> | void;
440
+ }
441
+ interface NodeExecutionTelemetry extends ExecutionTelemetry, TelemetrySpanScope {
442
+ startChildSpan(args: TelemetryChildSpanStart): TelemetrySpanScope;
443
+ }
444
+ interface ExecutionTelemetry extends TelemetryScope {
445
+ readonly traceId: string;
446
+ readonly spanId: string;
447
+ forNode(args: Readonly<{
448
+ nodeId: NodeId;
449
+ activationId: NodeActivationId;
450
+ }>): NodeExecutionTelemetry;
451
+ }
452
+ interface ExecutionTelemetryFactory {
453
+ create(args: Readonly<{
454
+ runId: RunId;
455
+ workflowId: WorkflowId;
456
+ parent?: ParentExecutionRef;
457
+ policySnapshot?: PersistedRunPolicySnapshot;
458
+ }>): ExecutionTelemetry;
459
+ }
460
+ //#endregion
277
461
  //#region src/contracts/runTypes.d.ts
278
462
  interface RunExecutionOptions {
279
463
  /** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
@@ -356,6 +540,7 @@ interface NodeExecutionError {
356
540
  message: string;
357
541
  name?: string;
358
542
  stack?: string;
543
+ details?: JsonValue;
359
544
  }
360
545
  interface NodeExecutionSnapshot {
361
546
  runId: RunId;
@@ -523,7 +708,8 @@ interface RunPruneCandidate {
523
708
  }
524
709
  interface WorkflowExecutionPruneRepository {
525
710
  listRunsOlderThan(args: Readonly<{
526
- beforeIso: string;
711
+ nowIso: string;
712
+ defaultRetentionSeconds: number;
527
713
  limit?: number;
528
714
  }>): Promise<ReadonlyArray<RunPruneCandidate>>;
529
715
  }
@@ -736,6 +922,7 @@ interface ExecutionContext {
736
922
  now: () => Date;
737
923
  data: RunDataSnapshot;
738
924
  nodeState?: NodeExecutionStatePublisher;
925
+ telemetry: ExecutionTelemetry;
739
926
  binary: ExecutionBinaryService;
740
927
  getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
741
928
  }
@@ -744,11 +931,13 @@ interface ExecutionContextFactory {
744
931
  runId: RunId;
745
932
  workflowId: WorkflowId;
746
933
  parent?: ParentExecutionRef;
934
+ policySnapshot?: PersistedRunPolicySnapshot;
747
935
  subworkflowDepth: number;
748
936
  engineMaxNodeActivations: number;
749
937
  engineMaxSubworkflowDepth: number;
750
938
  data: RunDataSnapshot;
751
939
  nodeState?: NodeExecutionStatePublisher;
940
+ telemetry?: ExecutionTelemetry;
752
941
  getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
753
942
  }): ExecutionContext;
754
943
  }
@@ -756,6 +945,7 @@ interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase>
756
945
  nodeId: NodeId;
757
946
  activationId: NodeActivationId;
758
947
  config: TConfig;
948
+ telemetry: NodeExecutionTelemetry;
759
949
  binary: NodeBinaryAttachmentService;
760
950
  }
761
951
  interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
@@ -949,6 +1139,7 @@ interface EngineDeps {
949
1139
  activationScheduler: NodeActivationScheduler;
950
1140
  runDataFactory: RunDataFactory;
951
1141
  executionContextFactory: ExecutionContextFactory;
1142
+ executionTelemetryFactory?: ExecutionTelemetryFactory;
952
1143
  nodeExecutor: NodeExecutor;
953
1144
  eventBus?: RunEventBus;
954
1145
  tokenRegistry: PersistedWorkflowTokenRegistryLike;
@@ -1220,10 +1411,16 @@ interface WorkflowStoragePolicyDecisionArgs {
1220
1411
  interface WorkflowPrunePolicySpec {
1221
1412
  readonly runDataRetentionSeconds?: number;
1222
1413
  readonly binaryRetentionSeconds?: number;
1414
+ readonly telemetrySpanRetentionSeconds?: number;
1415
+ readonly telemetryArtifactRetentionSeconds?: number;
1416
+ readonly telemetryMetricRetentionSeconds?: number;
1223
1417
  }
1224
1418
  interface PersistedRunPolicySnapshot {
1225
1419
  readonly retentionSeconds?: number;
1226
1420
  readonly binaryRetentionSeconds?: number;
1421
+ readonly telemetrySpanRetentionSeconds?: number;
1422
+ readonly telemetryArtifactRetentionSeconds?: number;
1423
+ readonly telemetryMetricRetentionSeconds?: number;
1227
1424
  readonly storagePolicy: WorkflowStoragePolicyMode;
1228
1425
  }
1229
1426
  interface WorkflowErrorHandler {
@@ -1254,6 +1451,9 @@ type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
1254
1451
  interface WorkflowPolicyRuntimeDefaults {
1255
1452
  readonly retentionSeconds?: number;
1256
1453
  readonly binaryRetentionSeconds?: number;
1454
+ readonly telemetrySpanRetentionSeconds?: number;
1455
+ readonly telemetryArtifactRetentionSeconds?: number;
1456
+ readonly telemetryMetricRetentionSeconds?: number;
1257
1457
  readonly storagePolicy?: WorkflowStoragePolicyMode;
1258
1458
  }
1259
1459
  //#endregion
@@ -1343,6 +1543,34 @@ declare class ExpRetryPolicy implements ExponentialRetryPolicySpec {
1343
1543
  constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined);
1344
1544
  }
1345
1545
  //#endregion
1546
+ //#region src/contracts/CostCatalogContract.d.ts
1547
+ interface CostCatalogEntry {
1548
+ readonly component: CostTrackingUsageRecord["component"];
1549
+ readonly provider: string;
1550
+ readonly operation: string;
1551
+ readonly pricingKey: string;
1552
+ readonly usageUnit: string;
1553
+ readonly currency: string;
1554
+ readonly currencyScale: number;
1555
+ readonly pricePerUnitMinor: number;
1556
+ }
1557
+ interface CostCatalog {
1558
+ findEntry(args: CostTrackingUsageRecord): CostCatalogEntry | undefined;
1559
+ }
1560
+ //#endregion
1561
+ //#region src/contracts/NoOpCostTrackingTelemetry.d.ts
1562
+ declare class NoOpCostTrackingTelemetry implements CostTrackingTelemetry {
1563
+ captureUsage(_: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
1564
+ forScope(_: TelemetryScope): CostTrackingTelemetry;
1565
+ }
1566
+ //#endregion
1567
+ //#region src/contracts/NoOpCostTrackingTelemetryFactory.d.ts
1568
+ declare class NoOpCostTrackingTelemetryFactory implements CostTrackingTelemetryFactory {
1569
+ create(_: Readonly<{
1570
+ telemetry: ExecutionTelemetry;
1571
+ }>): CostTrackingTelemetry;
1572
+ }
1573
+ //#endregion
1346
1574
  //#region src/contracts/executionPersistenceContracts.d.ts
1347
1575
  /** Canonical id for persisted execution rows (activation or connection invocation). */
1348
1576
  type ExecutionInstanceId = string;
@@ -1915,5 +2143,5 @@ declare class RunIntentService {
1915
2143
  private createWebhookExecutionOptions;
1916
2144
  }
1917
2145
  //#endregion
1918
- export { ItemExprArgs as $, CoreTokens as $i, NodeExecutionStatePublisher as $n, RunPruneCandidate as $r, TriggerNodeConfig as $t, ExecutionInstanceDto as A, CredentialType as Ai, BinaryStorageReadResult as An, ConnectionInvocationId as Ar, NodeDefinition as At, RunSlotProjectionState as B, Lifecycle as Bi, ItemNode as Bn, PersistedMutableNodeState as Br, NodeSchedulerDecision as Bt, BranchOutputGuard as C, CredentialOAuth2AuthDefinition as Ci, ExponentialRetryPolicySpec as Cn, WebhookInvocationMatch as Cr, JsonObject as Ct, RunFinishedAtFactory as D, CredentialSessionFactoryArgs as Di, BinaryAttachmentCreateRequest as Dn, AllWorkflowsActiveWorkflowActivationPolicy as Dr, NodeActivationId as Dt, ValidStepSequence as E, CredentialSessionFactory as Ei, RetryPolicySpec as En, WebhookTriggerRoutingDiagnostics as Er, MutableRunData as Et, PersistedExecutionInstanceRecord as F, OAuth2ProviderFromPublicConfig as Fi, EngineHost as Fn, NodeExecutionError as Fr, NodeIdRef as Ft, WorkflowRunDetailDto as G, inject as Gi, NodeActivationRequest as Gn, PersistedWorkflowSnapshot as Gr, PersistedTokenId as Gt, WorkItemId as H, TypeToken as Hi, MultiInputNode as Hn, PersistedRunControlState as Hr, PairedItemRef as Ht, PersistedRunSlotProjectionRecord as I, Container as Ii, ExecutableTriggerNode as In, NodeExecutionSnapshot as Ir, NodeKind as It, NoRetryPolicy as J, instanceCachingFactory as Ji, NodeBinaryAttachmentService as Jn, PinnedNodeOutputsByPort as Jr, RunId as Jt, ExpRetryPolicy as K, injectAll as Ki, NodeActivationRequestBase as Kn, PersistedWorkflowSnapshotNode as Kr, RunDataFactory as Kt, PersistedRunWorkItemKind as L, DependencyContainer$1 as Li, ExecutionBinaryService as Ln, NodeExecutionStatus as Lr, NodeOffloadPolicy as Lt, ExecutionPayloadPolicyFields as M, CredentialTypeId as Mi, BinaryStorageWriteRequest as Mn, CurrentStateExecutionRequest as Mr, NodeErrorHandlerArgs as Mt, PayloadStorageKind as N, CredentialTypeRegistry as Ni, BinaryStorageWriteResult as Nn, EngineRunCounters as Nr, NodeErrorHandlerSpec as Nt, BatchId as O, CredentialSessionService as Oi, BinaryBody as On, WorkflowActivationPolicy as Or, NodeConfigBase as Ot, PersistedExecutionInstanceKind as P, CredentialUnboundError as Pi, EngineDeps as Pn, ExecutionFrontierPlan as Pr, NodeId as Pt, ItemExpr as Q, singleton as Qi, NodeExecutionScheduler as Qn, RunExecutionOptions as Qr, RunnableNodeOutputJson as Qt, PersistedRunWorkItemRecord as R, Disposable as Ri, ExecutionContext as Rn, NodeInputsByPort as Rr, NodeOutputs as Rt, BranchMoreArgs as S, CredentialMaterialSourceKind as Si, triggerNodeSetupStateType as Sn, WebhookControlSignal as Sr, JsonNonArray as St, StepSequenceOutput as T, CredentialRequirement as Ti, NoneRetryPolicySpec as Tn, WebhookTriggerResolution as Tr, JsonValue as Tt, WorkItemStatus as U, container$1 as Ui, NodeActivationContinuation as Un, PersistedRunSchedulingState as Ur, ParentExecutionRef as Ut, SlotExecutionStateDto as V, RegistrationOptions as Vi, LiveWorkflowRepository as Vn, PersistedMutableRunState as Vr, OutputPortKey as Vt, WorkflowDetailSelectionState as W, delay as Wi, NodeActivationReceipt as Wn, PersistedRunState as Wr, PersistedRunPolicySnapshot as Wt, Param as X, predicateAwareClassFactory as Xi, NodeExecutionRequest as Xn, RunCurrentState as Xr, RunnableNodeConfig as Xt, Expr as Y, instancePerContainerCachingFactory as Yi, NodeExecutionContext as Yn, RunCompletionNotifier as Yr, RunIdFactory as Yt, ParamDeep as Z, registry as Zi, NodeExecutionRequestHandler as Zn, RunEventPublisherDeps as Zr, RunnableNodeInputJson as Zt, ChainCursor as _, CredentialHealthStatus as _i, branchRef as _n, WorkflowRunnerService as _r, InputPortKey as _t, RunTerminalPersistenceCoordinator as a, RunEventSubscription as aa, RunSummary as ai, WorkflowErrorHandler as an, RunnableNodeExecuteArgs as ar, resolveItemExprsForExecution as at, AnyTriggerNodeConfig as b, CredentialInstanceRecord as bi, runnableNodeOutputType as bn, HttpMethod as br, Items as bt, EngineExecutionLimitsPolicyFactory as c, WorkflowExecutionPruneRepository as ci, WorkflowGraphFactory as cn, TriggerNode as cr, PortsEmission as ct, DefaultWorkflowGraphFactory as d, CredentialAdvancedSectionPresentation as di, WorkflowPolicyRuntimeDefaults as dn, TriggerSetupStateFor as dr, isUnbrandedPortsEmissionShape as dt, ENGINE_EXECUTION_LIMITS_DEFAULTS as ea, RunQueueEntry as ei, TriggerNodeOutputJson as en, NodeExecutor as er, ItemExprCallback as et, WorkflowExecutableNodeClassifierFactory as f, CredentialAuthDefinition as fi, WorkflowPrunePolicySpec as fn, TriggerSetupStateRepository as fr, ActivationIdFactory as ft, WorkflowBuilder as g, CredentialHealth as gi, WorkflowStoragePolicySpec as gn, WorkflowRunnerResolver as gr, ExecutionMode as gt, ConnectionInvocationIdFactory as h, CredentialFieldSchema as hi, WorkflowStoragePolicyResolver as hn, WorkflowRepository as hr, Edge as ht, WorkflowPolicyErrorServices as i, RunEventBus as ia, RunStopCondition as ii, WorkflowErrorContext as in, RunnableNode as ir, itemExpr as it, ExecutionInstanceId as j, CredentialTypeDefinition as ji, BinaryStorageStatResult as jn, ConnectionInvocationRecord as jr, NodeErrorHandler as jt, ConnectionInvocationKind as k, CredentialSetupStatus as ki, BinaryStorage as kn, ConnectionInvocationAppendArgs as kr, NodeConnectionName as kt, WorkflowSnapshotCodec as l, WorkflowExecutionRepository as li, WorkflowId as ln, TriggerRuntimeDiagnostics as lr, emitPorts as lt, ConnectionNodeIdFactory as m, CredentialBindingKey as mi, WorkflowStoragePolicyMode as mn, WorkflowNodeInstanceFactory as mr, BinaryPreviewKind as mt, InMemoryLiveWorkflowRepository as n, EngineExecutionLimitsPolicyConfig as na, RunStateResetRequest as ni, UpstreamRefPlaceholder as nn, PersistedTriggerSetupState as nr, ItemExprResolvedContext as nt, WorkflowStoragePolicyEvaluator as o, WebhookRunResult as oi, WorkflowErrorHandlerSpec as on, TestableTriggerNode as or, resolveItemExprsInUnknown as ot, WorkflowExecutableNodeClassifier as p, CredentialBinding as pi, WorkflowStoragePolicyDecisionArgs as pn, TriggerTestItemsContext as pr, BinaryAttachment as pt, RetryPolicy as q, injectable as qi, NodeActivationScheduler as qn, PersistedWorkflowTokenRegistryLike as qr, RunDataSnapshot as qt, EngineWorkflowRunnerService as r, RunEvent as ra, RunStatus as ri, WorkflowDefinition as rn, PreparedNodeActivationDispatch as rr, isItemExpr as rt, RunPolicySnapshotFactory as s, WorkflowExecutionListingRepository as si, WorkflowGraph as sn, TriggerCleanupHandle as sr, getOriginIndexFromItem as st, RunIntentService as t, EngineExecutionLimitsPolicy as ta, RunResult as ti, TriggerNodeSetupState as tn, NodeResolver as tr, ItemExprContext as tt, Engine as u, AnyCredentialType as ui, WorkflowNodeConnection as un, TriggerSetupContext as ur, isPortsEmission as ut, WhenBuilder as v, CredentialHealthTester as vi, nodeRef as vn, WorkflowSnapshotFactory as vr, Item as vt, BranchStepsArg as w, CredentialOAuth2ScopesFromPublicConfig as wi, FixedRetryPolicySpec as wn, WebhookTriggerMatcher as wr, JsonPrimitive as wt, BooleanWhenOverloads as x, CredentialJsonRecord as xi, triggerNodeOutputType as xn, TriggerInstanceId as xr, JsonArray as xt, AnyRunnableNodeConfig as y, CredentialInstanceId as yi, runnableNodeInputType as yn, WorkflowSnapshotResolver as yr, ItemBinary as yt, RunRevision as z, InjectionToken$1 as zi, ExecutionContextFactory as zn, PendingNodeExecution as zr, NodeRef as zt };
1919
- //# sourceMappingURL=RunIntentService-CuXAIO6_.d.ts.map
2146
+ export { Expr as $, CredentialJsonRecord as $i, NodeExecutionContext as $n, RunCompletionNotifier as $r, RunIdFactory as $t, ExecutionInstanceDto as A, singleton as Aa, NoOpExecutionTelemetryFactory as Ai, RetryPolicySpec as An, WebhookTriggerRoutingDiagnostics as Ar, MutableRunData as At, RunSlotProjectionState as B, CostTrackingTelemetryMetricNames as Bi, ExecutableTriggerNode as Bn, NodeExecutionSnapshot as Br, NodeKind as Bt, BranchOutputGuard as C, inject as Ca, TelemetryScope as Ci, runnableNodeInputType as Cn, WorkflowSnapshotResolver as Cr, ItemBinary as Ct, RunFinishedAtFactory as D, instancePerContainerCachingFactory as Da, CodemationTelemetryMetricNames as Di, ExponentialRetryPolicySpec as Dn, WebhookInvocationMatch as Dr, JsonObject as Dt, ValidStepSequence as E, instanceCachingFactory as Ea, TelemetrySpanScope as Ei, triggerNodeSetupStateType as En, WebhookControlSignal as Er, JsonNonArray as Et, PersistedExecutionInstanceRecord as F, RunEvent as Fa, CostTrackingComponent as Fi, BinaryStorageStatResult as Fn, ConnectionInvocationRecord as Fr, NodeErrorHandler as Ft, WorkflowRunDetailDto as G, CredentialBinding as Gi, LiveWorkflowRepository as Gn, PersistedMutableRunState as Gr, OutputPortKey as Gt, WorkItemId as H, AnyCredentialType as Hi, ExecutionContext as Hn, NodeInputsByPort as Hr, NodeOutputs as Ht, PersistedRunSlotProjectionRecord as I, RunEventBus as Ia, CostTrackingPriceQuote as Ii, BinaryStorageWriteRequest as In, CurrentStateExecutionRequest as Ir, NodeErrorHandlerArgs as It, CostCatalog as J, CredentialHealth as Ji, NodeActivationReceipt as Jn, PersistedRunState as Jr, PersistedRunPolicySnapshot as Jt, NoOpCostTrackingTelemetryFactory as K, CredentialBindingKey as Ki, MultiInputNode as Kn, PersistedRunControlState as Kr, PairedItemRef as Kt, PersistedRunWorkItemKind as L, RunEventSubscription as La, CostTrackingTelemetry as Li, BinaryStorageWriteResult as Ln, EngineRunCounters as Lr, NodeErrorHandlerSpec as Lt, ExecutionPayloadPolicyFields as M, ENGINE_EXECUTION_LIMITS_DEFAULTS as Ma, NoOpNodeExecutionTelemetry as Mi, BinaryBody as Mn, WorkflowActivationPolicy as Mr, NodeConfigBase as Mt, PayloadStorageKind as N, EngineExecutionLimitsPolicy as Na, NoOpTelemetrySpanScope as Ni, BinaryStorage as Nn, ConnectionInvocationAppendArgs as Nr, NodeConnectionName as Nt, BatchId as O, predicateAwareClassFactory as Oa, GenAiTelemetryAttributeNames as Oi, FixedRetryPolicySpec as On, WebhookTriggerMatcher as Or, JsonPrimitive as Ot, PersistedExecutionInstanceKind as P, EngineExecutionLimitsPolicyConfig as Pa, NoOpTelemetryArtifactReference as Pi, BinaryStorageReadResult as Pn, ConnectionInvocationId as Pr, NodeDefinition as Pt, NoRetryPolicy as Q, CredentialInstanceRecord as Qi, NodeBinaryAttachmentService as Qn, PinnedNodeOutputsByPort as Qr, RunId as Qt, PersistedRunWorkItemRecord as R, CostTrackingTelemetryAttributeNames as Ri, EngineDeps as Rn, ExecutionFrontierPlan as Rr, NodeId as Rt, BranchMoreArgs as S, delay as Sa, TelemetryMetricRecord as Si, nodeRef as Sn, WorkflowSnapshotFactory as Sr, Item as St, StepSequenceOutput as T, injectable as Ta, TelemetrySpanEventRecord as Ti, triggerNodeOutputType as Tn, TriggerInstanceId as Tr, JsonArray as Tt, WorkItemStatus as U, CredentialAdvancedSectionPresentation as Ui, ExecutionContextFactory as Un, PendingNodeExecution as Ur, NodeRef as Ut, SlotExecutionStateDto as V, CostTrackingUsageRecord as Vi, ExecutionBinaryService as Vn, NodeExecutionStatus as Vr, NodeOffloadPolicy as Vt, WorkflowDetailSelectionState as W, CredentialAuthDefinition as Wi, ItemNode as Wn, PersistedMutableNodeState as Wr, NodeSchedulerDecision as Wt, ExpRetryPolicy as X, CredentialHealthTester as Xi, NodeActivationRequestBase as Xn, PersistedWorkflowSnapshotNode as Xr, RunDataFactory as Xt, CostCatalogEntry as Y, CredentialHealthStatus as Yi, NodeActivationRequest as Yn, PersistedWorkflowSnapshot as Yr, PersistedTokenId as Yt, RetryPolicy as Z, CredentialInstanceId as Zi, NodeActivationScheduler as Zn, PersistedWorkflowTokenRegistryLike as Zr, RunDataSnapshot as Zt, ChainCursor as _, InjectionToken$1 as _a, TelemetryArtifactAttachment as _i, WorkflowStoragePolicyDecisionArgs as _n, TriggerTestItemsContext as _r, BinaryAttachment as _t, RunTerminalPersistenceCoordinator as a, CredentialSessionFactoryArgs as aa, RunResult as ai, TriggerNodeSetupState as an, NodeResolver as ar, ItemExprContext as at, AnyTriggerNodeConfig as b, TypeToken as ba, TelemetryAttributes as bi, WorkflowStoragePolicySpec as bn, WorkflowRunnerResolver as br, ExecutionMode as bt, EngineExecutionLimitsPolicyFactory as c, CredentialType as ca, RunStopCondition as ci, WorkflowErrorContext as cn, RunnableNode as cr, itemExpr as ct, DefaultWorkflowGraphFactory as d, CredentialTypeRegistry as da, WorkflowExecutionListingRepository as di, WorkflowGraph as dn, TriggerCleanupHandle as dr, getOriginIndexFromItem as dt, CredentialMaterialSourceKind as ea, RunCurrentState as ei, RunnableNodeConfig as en, NodeExecutionRequest as er, Param as et, WorkflowExecutableNodeClassifierFactory as f, CredentialUnboundError as fa, WorkflowExecutionPruneRepository as fi, WorkflowGraphFactory as fn, TriggerNode as fr, PortsEmission as ft, WorkflowBuilder as g, Disposable as ga, NodeExecutionTelemetry as gi, WorkflowPrunePolicySpec as gn, TriggerSetupStateRepository as gr, ActivationIdFactory as gt, ConnectionInvocationIdFactory as h, DependencyContainer$1 as ha, ExecutionTelemetryFactory as hi, WorkflowPolicyRuntimeDefaults as hn, TriggerSetupStateFor as hr, isUnbrandedPortsEmissionShape as ht, WorkflowPolicyErrorServices as i, CredentialSessionFactory as ia, RunQueueEntry as ii, TriggerNodeOutputJson as in, NodeExecutor as ir, ItemExprCallback as it, ExecutionInstanceId as j, CoreTokens as ja, NoOpExecutionTelemetry as ji, BinaryAttachmentCreateRequest as jn, AllWorkflowsActiveWorkflowActivationPolicy as jr, NodeActivationId as jt, ConnectionInvocationKind as k, registry as ka, CodemationTelemetryAttributeNames as ki, NoneRetryPolicySpec as kn, WebhookTriggerResolution as kr, JsonValue as kt, WorkflowSnapshotCodec as l, CredentialTypeDefinition as la, RunSummary as li, WorkflowErrorHandler as ln, RunnableNodeExecuteArgs as lr, resolveItemExprsForExecution as lt, ConnectionNodeIdFactory as m, Container as ma, ExecutionTelemetry as mi, WorkflowNodeConnection as mn, TriggerSetupContext as mr, isPortsEmission as mt, InMemoryLiveWorkflowRepository as n, CredentialOAuth2ScopesFromPublicConfig as na, RunExecutionOptions as ni, RunnableNodeOutputJson as nn, NodeExecutionScheduler as nr, ItemExpr as nt, WorkflowStoragePolicyEvaluator as o, CredentialSessionService as oa, RunStateResetRequest as oi, UpstreamRefPlaceholder as on, PersistedTriggerSetupState as or, ItemExprResolvedContext as ot, WorkflowExecutableNodeClassifier as p, OAuth2ProviderFromPublicConfig as pa, WorkflowExecutionRepository as pi, WorkflowId as pn, TriggerRuntimeDiagnostics as pr, emitPorts as pt, NoOpCostTrackingTelemetry as q, CredentialFieldSchema as qi, NodeActivationContinuation as qn, PersistedRunSchedulingState as qr, ParentExecutionRef as qt, EngineWorkflowRunnerService as r, CredentialRequirement as ra, RunPruneCandidate as ri, TriggerNodeConfig as rn, NodeExecutionStatePublisher as rr, ItemExprArgs as rt, RunPolicySnapshotFactory as s, CredentialSetupStatus as sa, RunStatus as si, WorkflowDefinition as sn, PreparedNodeActivationDispatch as sr, isItemExpr as st, RunIntentService as t, CredentialOAuth2AuthDefinition as ta, RunEventPublisherDeps as ti, RunnableNodeInputJson as tn, NodeExecutionRequestHandler as tr, ParamDeep as tt, Engine as u, CredentialTypeId as ua, WebhookRunResult as ui, WorkflowErrorHandlerSpec as un, TestableTriggerNode as ur, resolveItemExprsInUnknown as ut, WhenBuilder as v, Lifecycle as va, TelemetryArtifactReference as vi, WorkflowStoragePolicyMode as vn, WorkflowNodeInstanceFactory as vr, BinaryPreviewKind as vt, BranchStepsArg as w, injectAll as wa, TelemetrySpanEnd as wi, runnableNodeOutputType as wn, HttpMethod as wr, Items as wt, BooleanWhenOverloads as x, container$1 as xa, TelemetryChildSpanStart as xi, branchRef as xn, WorkflowRunnerService as xr, InputPortKey as xt, AnyRunnableNodeConfig as y, RegistrationOptions as ya, TelemetryAttributePrimitive as yi, WorkflowStoragePolicyResolver as yn, WorkflowRepository as yr, Edge as yt, RunRevision as z, CostTrackingTelemetryFactory as zi, EngineHost as zn, NodeExecutionError as zr, NodeIdRef as zt };
2147
+ //# sourceMappingURL=RunIntentService-BqhmdoA1.d.ts.map