@codemation/core 0.8.1 → 0.10.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.
Files changed (100) hide show
  1. package/CHANGELOG.md +386 -0
  2. package/dist/{EngineRuntimeRegistration.types-BP6tsaNP.d.ts → EngineRuntimeRegistration.types-D1fyApMI.d.ts} +2 -2
  3. package/dist/{EngineWorkflowRunnerService-DzOCa1BW.d.cts → EngineRuntimeRegistration.types-pB3FnzqR.d.cts} +17 -17
  4. package/dist/{InMemoryRunDataFactory-1iz7_SnO.d.cts → InMemoryRunDataFactory-Xw7v4-sj.d.cts} +31 -29
  5. package/dist/InMemoryRunEventBusRegistry-VM3OWnHo.cjs +47 -0
  6. package/dist/InMemoryRunEventBusRegistry-VM3OWnHo.cjs.map +1 -0
  7. package/dist/InMemoryRunEventBusRegistry-sM4z4n_i.js +41 -0
  8. package/dist/InMemoryRunEventBusRegistry-sM4z4n_i.js.map +1 -0
  9. package/dist/{RunIntentService-BqhmdoA1.d.ts → RunIntentService-BE9CAkbf.d.ts} +966 -471
  10. package/dist/{RunIntentService-S-1lW-gS.d.cts → RunIntentService-siBSjaaY.d.cts} +859 -493
  11. package/dist/bootstrap/index.cjs +5 -2
  12. package/dist/bootstrap/index.d.cts +212 -135
  13. package/dist/bootstrap/index.d.ts +4 -4
  14. package/dist/bootstrap/index.js +3 -3
  15. package/dist/{bootstrap-Bx1u4cbS.cjs → bootstrap-Cm5ruQxx.cjs} +253 -2
  16. package/dist/bootstrap-Cm5ruQxx.cjs.map +1 -0
  17. package/dist/{bootstrap-BoknFKnw.js → bootstrap-D3r505ko.js} +236 -3
  18. package/dist/bootstrap-D3r505ko.js.map +1 -0
  19. package/dist/{index-CVs9rVhl.d.ts → index-DeLl1Tne.d.ts} +632 -230
  20. package/dist/index.cjs +323 -176
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +544 -91
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.js +299 -166
  25. package/dist/index.js.map +1 -1
  26. package/dist/{runtime-DUW6tIJ1.js → runtime-BGNbRnqs.js} +934 -75
  27. package/dist/runtime-BGNbRnqs.js.map +1 -0
  28. package/dist/{runtime-Dvo2ru5A.cjs → runtime-DKXJwTNv.cjs} +1028 -73
  29. package/dist/runtime-DKXJwTNv.cjs.map +1 -0
  30. package/dist/testing.cjs +4 -4
  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 +7 -2
  36. package/src/ai/AiHost.ts +42 -14
  37. package/src/authoring/DefinedCollectionRegistry.ts +17 -0
  38. package/src/authoring/defineCollection.types.ts +181 -0
  39. package/src/authoring/definePollingTrigger.types.ts +396 -0
  40. package/src/authoring/definePollingTriggerInternals.ts +74 -0
  41. package/src/authoring/index.ts +19 -0
  42. package/src/bootstrap/index.ts +9 -0
  43. package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +8 -0
  44. package/src/browser.ts +1 -0
  45. package/src/contracts/CodemationTelemetryAttributeNames.ts +6 -0
  46. package/src/contracts/NoOpNodeExecutionTelemetry.ts +2 -11
  47. package/src/contracts/NoOpTelemetrySpanScope.ts +46 -10
  48. package/src/contracts/assertionTypes.ts +63 -0
  49. package/src/contracts/baseTypes.ts +12 -0
  50. package/src/contracts/collectionTypes.ts +44 -0
  51. package/src/contracts/credentialTypes.ts +23 -1
  52. package/src/contracts/executionPersistenceContracts.ts +30 -0
  53. package/src/contracts/index.ts +4 -0
  54. package/src/contracts/runTypes.ts +37 -1
  55. package/src/contracts/runtimeTypes.ts +42 -0
  56. package/src/contracts/telemetryTypes.ts +8 -0
  57. package/src/contracts/testTriggerTypes.ts +66 -0
  58. package/src/contracts/workflowTypes.ts +36 -7
  59. package/src/contracts.ts +59 -0
  60. package/src/events/ConnectionInvocationEventPublisher.ts +46 -0
  61. package/src/events/index.ts +1 -0
  62. package/src/events/runEvents.ts +74 -0
  63. package/src/execution/ChildExecutionScopeFactory.ts +55 -0
  64. package/src/execution/DefaultExecutionContextFactory.ts +6 -0
  65. package/src/execution/ExecutionTelemetryCostTrackingDecoratorFactory.ts +18 -0
  66. package/src/execution/NodeExecutor.ts +10 -2
  67. package/src/execution/NodeInstanceFactory.ts +13 -1
  68. package/src/execution/NodeInstantiationError.ts +16 -0
  69. package/src/execution/NodeRunStateWriter.ts +7 -0
  70. package/src/execution/NodeRunStateWriterFactory.ts +7 -0
  71. package/src/execution/WorkflowRunExecutionContextFactory.ts +3 -0
  72. package/src/execution/index.ts +2 -0
  73. package/src/index.ts +8 -0
  74. package/src/orchestration/AbortControllerFactory.ts +9 -0
  75. package/src/orchestration/NodeExecutionRequestHandlerService.ts +1 -0
  76. package/src/orchestration/RunContinuationService.ts +3 -0
  77. package/src/orchestration/RunStartService.ts +122 -3
  78. package/src/orchestration/TestSuiteOrchestrator.ts +350 -0
  79. package/src/orchestration/TestSuiteRunIdFactory.ts +11 -0
  80. package/src/orchestration/TriggerRuntimeService.ts +34 -7
  81. package/src/orchestration/index.ts +9 -0
  82. package/src/runtime/EngineFactory.ts +12 -0
  83. package/src/triggers/polling/PollingTriggerDedupWindow.ts +23 -0
  84. package/src/triggers/polling/PollingTriggerLogger.ts +18 -0
  85. package/src/triggers/polling/PollingTriggerRuntime.ts +122 -0
  86. package/src/triggers/polling/index.ts +5 -0
  87. package/src/types/index.ts +12 -9
  88. package/src/workflow/definition/NodeIterationIdFactory.ts +26 -0
  89. package/src/workflow/dsl/NodeIdSlugifier.ts +18 -0
  90. package/src/workflow/dsl/WorkflowBuilder.ts +71 -3
  91. package/src/workflow/dsl/WorkflowDefinitionError.ts +15 -0
  92. package/src/workflow/index.ts +3 -0
  93. package/dist/InMemoryRunEventBusRegistry-B0_C4OnP.cjs +0 -262
  94. package/dist/InMemoryRunEventBusRegistry-B0_C4OnP.cjs.map +0 -1
  95. package/dist/InMemoryRunEventBusRegistry-C2U83Hmv.js +0 -238
  96. package/dist/InMemoryRunEventBusRegistry-C2U83Hmv.js.map +0 -1
  97. package/dist/bootstrap-BoknFKnw.js.map +0 -1
  98. package/dist/bootstrap-Bx1u4cbS.cjs.map +0 -1
  99. package/dist/runtime-DUW6tIJ1.js.map +0 -1
  100. package/dist/runtime-Dvo2ru5A.cjs.map +0 -1
@@ -3,7 +3,91 @@ import { DependencyContainer as Container, DependencyContainer as DependencyCont
3
3
  import { ZodType } from "zod";
4
4
  import { ReadableStream } from "node:stream/web";
5
5
 
6
+ //#region src/contracts/baseTypes.d.ts
7
+ /**
8
+ * Minimal base types that have no dependencies on other contracts.
9
+ * Used by credentialTypes, workflowTypes, and other contract layers
10
+ * to avoid circular dependencies.
11
+ */
12
+ type WorkflowId = string;
13
+ type NodeId = string;
14
+ type OutputPortKey = string;
15
+ type InputPortKey = string;
16
+ type PersistedTokenId = string;
17
+ type NodeConnectionName = string;
18
+ //#endregion
19
+ //#region src/contracts/testTriggerTypes.d.ts
20
+ /**
21
+ * Identifier minted by the host (or in-memory test runner) for one execution of a test suite.
22
+ * One TestSuiteRun produces N child workflow runs, one per item yielded by `generateItems`.
23
+ */
24
+ type TestSuiteRunId = string;
25
+ /**
26
+ * Setup context passed to a {@link TestTriggerNodeConfig.generateItems} callback. Distinct from
27
+ * {@link import("./runtimeTypes").TriggerSetupContext} on purpose: test triggers are not
28
+ * activated by the live trigger lifecycle (webhooks, cron, polling) and never call `emit` —
29
+ * the orchestrator pulls from the iterable they return and dispatches one run per item.
30
+ */
31
+ interface TestTriggerSetupContext<TConfig extends TestTriggerNodeConfig<unknown> = TestTriggerNodeConfig<unknown>> {
32
+ readonly workflowId: WorkflowId;
33
+ readonly nodeId: NodeId;
34
+ readonly config: TConfig;
35
+ readonly testSuiteRunId: TestSuiteRunId;
36
+ /**
37
+ * Resolves a credential session for a slot declared on this trigger's
38
+ * {@link import("./workflowTypes").NodeConfigBase.getCredentialRequirements}. Same contract as
39
+ * {@link import("./runtimeTypes").ExecutionContext.getCredential}.
40
+ */
41
+ getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
42
+ /** AbortSignal raised when the suite is cancelled — long-running pulls should bail out. */
43
+ readonly signal: AbortSignal;
44
+ }
45
+ /**
46
+ * A trigger config that emits **test cases**. Each item yielded by {@link generateItems}
47
+ * becomes one workflow run (with `executionOptions.testContext` set), so 10 yielded items
48
+ * → 10 runs marked under the same TestSuiteRun.
49
+ *
50
+ * The trigger is otherwise a normal {@link TriggerNodeConfig} (so the canvas treats it like
51
+ * any other trigger), but its `triggerKind` is `"test"` so the live activation policy skips it.
52
+ */
53
+ interface TestTriggerNodeConfig<TOutputJson$1 = unknown> extends TriggerNodeConfig<TOutputJson$1, undefined> {
54
+ readonly triggerKind: "test";
55
+ /**
56
+ * Author-supplied async iterable of items, evaluated lazily. Implementations may fetch from
57
+ * credentialed APIs, read fixture files, or yield hard-coded items. The orchestrator iterates
58
+ * and dispatches one run per item, with concurrency capped by {@link concurrency} (default 4).
59
+ */
60
+ generateItems(ctx: TestTriggerSetupContext<TestTriggerNodeConfig<TOutputJson$1>>): AsyncIterable<Item<TOutputJson$1>>;
61
+ /** Per-suite-run cap on simultaneously-executing test cases. Default: 4. */
62
+ readonly concurrency?: number;
63
+ /**
64
+ * Free-form description of where the test cases come from — surfaced in the node properties
65
+ * panel and the suite-detail header so authors revisiting the workflow six months later
66
+ * remember which mailbox / folder / fixture file the cases originate from.
67
+ *
68
+ * Example: `"All emails in the Gmail label \"test/triage-fixtures\" — 14 messages as of 2026-05-03."`
69
+ */
70
+ readonly description?: string;
71
+ /**
72
+ * Resolves a human-readable label for one yielded test case (e.g. email subject). The
73
+ * orchestrator calls this once per yielded item, persists the result on the run, and the
74
+ * Tests-tab UI uses it to render the case row instead of the opaque runId. Return
75
+ * `undefined` to fall back to "Case #N".
76
+ */
77
+ caseLabel?(item: Item<TOutputJson$1>): string | undefined;
78
+ }
79
+ //#endregion
6
80
  //#region src/events/runEvents.d.ts
81
+ /**
82
+ * Outcome of a single test case (one workflow run dispatched by the test-suite orchestrator).
83
+ * - `running`: workflow still in flight
84
+ * - `succeeded`: workflow completed AND all assertions passed (or no assertions)
85
+ * - `failed`: workflow failed OR (workflow completed but ≥1 assertion failed)
86
+ * - `errored` / `cancelled`: workflow itself errored or was cancelled
87
+ */
88
+ type TestCaseRunStatus = "running" | "succeeded" | "failed" | "errored" | "cancelled";
89
+ /** Aggregate outcome of a TestSuiteRun. */
90
+ type TestSuiteRunStatus = "succeeded" | "failed" | "partial" | "errored" | "cancelled";
7
91
  type RunEvent = Readonly<{
8
92
  kind: "runCreated";
9
93
  runId: RunId;
@@ -45,6 +129,60 @@ type RunEvent = Readonly<{
45
129
  parent?: ParentExecutionRef;
46
130
  at: string;
47
131
  snapshot: NodeExecutionSnapshot;
132
+ }> | Readonly<{
133
+ kind: "connectionInvocationStarted";
134
+ runId: RunId;
135
+ workflowId: WorkflowId;
136
+ parent?: ParentExecutionRef;
137
+ at: string;
138
+ record: ConnectionInvocationRecord;
139
+ }> | Readonly<{
140
+ kind: "connectionInvocationCompleted";
141
+ runId: RunId;
142
+ workflowId: WorkflowId;
143
+ parent?: ParentExecutionRef;
144
+ at: string;
145
+ record: ConnectionInvocationRecord;
146
+ }> | Readonly<{
147
+ kind: "connectionInvocationFailed";
148
+ runId: RunId;
149
+ workflowId: WorkflowId;
150
+ parent?: ParentExecutionRef;
151
+ at: string;
152
+ record: ConnectionInvocationRecord;
153
+ }> | Readonly<{
154
+ kind: "testSuiteStarted";
155
+ testSuiteRunId: TestSuiteRunId;
156
+ workflowId: WorkflowId;
157
+ triggerNodeId: string;
158
+ triggerNodeName?: string;
159
+ concurrency: number;
160
+ at: string;
161
+ }> | Readonly<{
162
+ kind: "testSuiteFinished";
163
+ testSuiteRunId: TestSuiteRunId;
164
+ workflowId: WorkflowId;
165
+ status: TestSuiteRunStatus;
166
+ totalCases: number;
167
+ passedCases: number;
168
+ failedCases: number;
169
+ at: string;
170
+ }> | Readonly<{
171
+ kind: "testCaseStarted";
172
+ testSuiteRunId: TestSuiteRunId;
173
+ testCaseIndex: number;
174
+ runId: RunId;
175
+ workflowId: WorkflowId;
176
+ testCaseLabel?: string;
177
+ at: string;
178
+ }> | Readonly<{
179
+ kind: "testCaseCompleted";
180
+ testSuiteRunId: TestSuiteRunId;
181
+ testCaseIndex: number;
182
+ runId: RunId;
183
+ workflowId: WorkflowId;
184
+ status: TestCaseRunStatus;
185
+ at: string;
48
186
  }>;
49
187
  interface RunEventSubscription {
50
188
  close(): Promise<void>;
@@ -104,74 +242,434 @@ declare const CoreTokens: {
104
242
  readonly WorkflowActivationPolicy: TypeToken<WorkflowActivationPolicy>;
105
243
  };
106
244
  //#endregion
107
- //#region src/contracts/credentialTypes.d.ts
108
- type CredentialTypeId = string;
109
- type CredentialInstanceId = string;
110
- type CredentialMaterialSourceKind = "db" | "env" | "code";
111
- type CredentialSetupStatus = "draft" | "ready";
112
- type CredentialHealthStatus = "unknown" | "healthy" | "failing";
113
- type CredentialFieldSchema = Readonly<{
114
- key: string;
115
- label: string;
116
- type: "string" | "password" | "textarea" | "json" | "boolean";
117
- required?: true;
118
- order?: number;
119
- /**
120
- * Where this field appears in the credential dialog. Use `"advanced"` for optional or
121
- * power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).
122
- * Defaults to `"default"` when omitted.
123
- */
124
- visibility?: "default" | "advanced";
125
- placeholder?: string;
126
- helpText?: string;
127
- /** When set, host resolves this field from process.env at runtime; env wins over stored values. */
128
- envVarName?: string;
245
+ //#region src/contracts/runTypes.d.ts
246
+ /**
247
+ * Test-suite linkage for a run. When set, this run was started by a TestSuiteOrchestrator
248
+ * as one test case inside a TestSuiteRun. The `IsTestRun` node and host-side persisters key
249
+ * off the presence of this field. Subworkflow runs inherit it from their parent run.
250
+ */
251
+ interface RunTestContext {
252
+ readonly testSuiteRunId: string;
253
+ readonly testCaseIndex: number;
129
254
  /**
130
- * When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
131
- * pattern or documentation URL). Do not use for secret values.
255
+ * Optional human-friendly label for this test case (e.g. an email subject when fixtures
256
+ * are loaded from a mailbox). Resolved per item by `TestTrigger.caseLabel(item)` if set,
257
+ * persisted on `Run.test_case_label` so the Tests-tab tree-table can show "RFQ for batch 14"
258
+ * instead of "run_1777755971399_bbb86beac1396".
132
259
  */
133
- copyValue?: string;
134
- /** Accessible label for the copy control (default: Copy). */
135
- copyButtonLabel?: string;
136
- }>;
137
- type CredentialRequirement = Readonly<{
138
- slotKey: string;
139
- label: string;
140
- acceptedTypes: ReadonlyArray<CredentialTypeId>;
141
- optional?: true;
142
- helpText?: string;
143
- helpUrl?: string;
260
+ readonly testCaseLabel?: string;
261
+ }
262
+ interface RunExecutionOptions {
263
+ /** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
264
+ localOnly?: boolean;
265
+ /** Marks runs started from webhook handling so orchestration can apply webhook-specific continuation rules. */
266
+ webhook?: boolean;
267
+ mode?: "manual" | "debug";
268
+ sourceWorkflowId?: WorkflowId;
269
+ sourceRunId?: RunId;
270
+ derivedFromRunId?: RunId;
271
+ isMutable?: boolean;
272
+ /** Set by the engine for this run: 0 = root, 1 = first child subworkflow, … */
273
+ subworkflowDepth?: number;
274
+ /** Effective cap after engine policy merge (successful node completions per run). */
275
+ maxNodeActivations?: number;
276
+ /** Effective cap after engine policy merge (subworkflow nesting). */
277
+ maxSubworkflowDepth?: number;
278
+ /** Present iff started by a TestSuiteOrchestrator; propagates to subworkflow runs via {@link ParentExecutionRef.testContext}. */
279
+ testContext?: RunTestContext;
280
+ }
281
+ /** Engine-owned counters persisted with the run (worker-safe). */
282
+ interface EngineRunCounters {
283
+ completedNodeActivations: number;
284
+ }
285
+ type RunStopCondition = Readonly<{
286
+ kind: "workflowCompleted";
287
+ }> | Readonly<{
288
+ kind: "nodeCompleted";
289
+ nodeId: NodeId;
144
290
  }>;
145
- type CredentialBindingKey = Readonly<{
291
+ interface RunStateResetRequest {
292
+ clearFromNodeId: NodeId;
293
+ }
294
+ interface PersistedRunControlState {
295
+ stopCondition?: RunStopCondition;
296
+ }
297
+ interface PersistedWorkflowSnapshotNode {
298
+ id: NodeId;
299
+ kind: NodeKind;
300
+ name?: string;
301
+ nodeTokenId: PersistedTokenId;
302
+ configTokenId: PersistedTokenId;
303
+ tokenName?: string;
304
+ configTokenName?: string;
305
+ config: unknown;
306
+ }
307
+ interface PersistedWorkflowSnapshot {
308
+ id: WorkflowId;
309
+ name: string;
310
+ nodes: ReadonlyArray<PersistedWorkflowSnapshotNode>;
311
+ edges: ReadonlyArray<Edge>;
312
+ /** When the snapshot was built from a live workflow definition that configured a workflow error handler. */
313
+ workflowErrorHandlerConfigured?: boolean;
314
+ /** Connection metadata for child nodes not in the execution graph (e.g. AI agent attachments). */
315
+ connections?: ReadonlyArray<WorkflowNodeConnection>;
316
+ }
317
+ type PinnedNodeOutputsByPort = Readonly<Record<OutputPortKey, Items>>;
318
+ interface PersistedMutableNodeState {
319
+ pinnedOutputsByPort?: PinnedNodeOutputsByPort;
320
+ lastDebugInput?: Items;
321
+ }
322
+ interface PersistedMutableRunState {
323
+ nodesById: Readonly<Record<NodeId, PersistedMutableNodeState>>;
324
+ }
325
+ type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
326
+ interface RunQueueEntry {
327
+ nodeId: NodeId;
328
+ input: Items;
329
+ toInput?: InputPortKey;
330
+ batchId?: string;
331
+ from?: Readonly<{
332
+ nodeId: NodeId;
333
+ output: OutputPortKey;
334
+ }>;
335
+ collect?: Readonly<{
336
+ expectedInputs: ReadonlyArray<InputPortKey>;
337
+ received: Readonly<Record<InputPortKey, Items>>;
338
+ }>;
339
+ }
340
+ type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
341
+ interface NodeExecutionError {
342
+ message: string;
343
+ name?: string;
344
+ stack?: string;
345
+ details?: JsonValue;
346
+ }
347
+ interface NodeExecutionSnapshot {
348
+ runId: RunId;
146
349
  workflowId: WorkflowId;
147
350
  nodeId: NodeId;
148
- slotKey: string;
149
- }>;
150
- type CredentialBinding = Readonly<{
151
- key: CredentialBindingKey;
152
- instanceId: CredentialInstanceId;
351
+ activationId?: NodeActivationId;
352
+ parent?: ParentExecutionRef;
353
+ status: NodeExecutionStatus;
354
+ usedPinnedOutput?: boolean;
355
+ queuedAt?: string;
356
+ startedAt?: string;
357
+ finishedAt?: string;
153
358
  updatedAt: string;
359
+ inputsByPort?: NodeInputsByPort;
360
+ outputs?: NodeOutputs;
361
+ error?: NodeExecutionError;
362
+ }
363
+ /** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
364
+ type ConnectionInvocationId = string;
365
+ /**
366
+ * One logical LLM or tool call under an owning workflow node (e.g. AI agent).
367
+ * The owning node defines what {@link managedInput} and {@link managedOutput} contain.
368
+ */
369
+ interface ConnectionInvocationRecord {
370
+ readonly invocationId: ConnectionInvocationId;
371
+ readonly runId: RunId;
372
+ readonly workflowId: WorkflowId;
373
+ readonly connectionNodeId: NodeId;
374
+ readonly parentAgentNodeId: NodeId;
375
+ readonly parentAgentActivationId: NodeActivationId;
376
+ readonly status: NodeExecutionStatus;
377
+ readonly managedInput?: JsonValue;
378
+ readonly managedOutput?: JsonValue;
379
+ readonly error?: NodeExecutionError;
380
+ readonly queuedAt?: string;
381
+ readonly startedAt?: string;
382
+ readonly finishedAt?: string;
383
+ readonly updatedAt: string;
384
+ /** Per-item iteration id minted by the engine when this invocation occurred inside a runnable node's per-item loop. */
385
+ readonly iterationId?: NodeIterationId;
386
+ /** Item index (0-based) of the iteration that produced this invocation. */
387
+ readonly itemIndex?: number;
388
+ /** When set, this invocation was produced inside a sub-agent triggered by the named parent invocation. */
389
+ readonly parentInvocationId?: ConnectionInvocationId;
390
+ }
391
+ /** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
392
+ type ConnectionInvocationAppendArgs = Readonly<{
393
+ invocationId: ConnectionInvocationId;
394
+ connectionNodeId: NodeId;
395
+ parentAgentNodeId: NodeId;
396
+ parentAgentActivationId: NodeActivationId;
397
+ status: NodeExecutionStatus;
398
+ managedInput?: JsonValue;
399
+ managedOutput?: JsonValue;
400
+ error?: NodeExecutionError;
401
+ queuedAt?: string;
402
+ startedAt?: string;
403
+ finishedAt?: string;
404
+ iterationId?: NodeIterationId;
405
+ itemIndex?: number;
406
+ parentInvocationId?: ConnectionInvocationId;
154
407
  }>;
155
- type CredentialHealth = Readonly<{
156
- status: CredentialHealthStatus;
157
- message?: string;
158
- testedAt?: string;
159
- expiresAt?: string;
160
- details?: Readonly<Record<string, unknown>>;
161
- }>;
162
- type OAuth2ProviderFromPublicConfig = Readonly<{
163
- authorizeUrlFieldKey: string;
164
- tokenUrlFieldKey: string;
165
- userInfoUrlFieldKey?: string;
166
- }>;
167
- type CredentialOAuth2ScopesFromPublicConfig = Readonly<{
168
- presetFieldKey: string;
169
- presetScopes: Readonly<Record<string, ReadonlyArray<string>>>;
170
- customPresetKey?: string;
171
- customScopesFieldKey?: string;
172
- }>;
173
- type CredentialOAuth2AuthDefinition = Readonly<{
174
- kind: "oauth2";
408
+ interface RunCurrentState {
409
+ outputsByNode: Record<NodeId, NodeOutputs>;
410
+ nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
411
+ /** Append-only history of connection-scoped invocations (LLM/tool) for inspector and canvas. */
412
+ connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
413
+ mutableState?: PersistedMutableRunState;
414
+ }
415
+ interface CurrentStateExecutionRequest {
416
+ workflow: WorkflowDefinition;
417
+ items?: Items;
418
+ parent?: ParentExecutionRef;
419
+ executionOptions?: RunExecutionOptions;
420
+ workflowSnapshot?: PersistedWorkflowSnapshot;
421
+ mutableState?: PersistedMutableRunState;
422
+ currentState?: RunCurrentState;
423
+ stopCondition?: RunStopCondition;
424
+ reset?: RunStateResetRequest;
425
+ }
426
+ interface ExecutionFrontierPlan {
427
+ rootNodeId?: NodeId;
428
+ rootNodeInput?: Items;
429
+ queue: RunQueueEntry[];
430
+ currentState: RunCurrentState;
431
+ stopCondition: RunStopCondition;
432
+ satisfiedNodeIds: ReadonlyArray<NodeId>;
433
+ skippedNodeIds: ReadonlyArray<NodeId>;
434
+ clearedNodeIds: ReadonlyArray<NodeId>;
435
+ preservedPinnedNodeIds: ReadonlyArray<NodeId>;
436
+ }
437
+ type RunStatus = "running" | "pending" | "completed" | "failed";
438
+ interface RunSummary {
439
+ runId: RunId;
440
+ workflowId: WorkflowId;
441
+ startedAt: string;
442
+ status: RunStatus;
443
+ /**
444
+ * Test-case status for runs dispatched as part of a TestSuiteRun. Carries the
445
+ * assertion-rollup-corrected outcome the test orchestrator persists onto the row, so the
446
+ * executions list can show "failed" for a run whose workflow completed cleanly but whose
447
+ * assertions caught regressions. Absent for non-test runs and legacy rows.
448
+ */
449
+ testCaseStatus?: TestCaseRunStatus;
450
+ /** ISO timestamp when the run finished (derived from node snapshots or store `updatedAt`); omit while running/pending. */
451
+ finishedAt?: string;
452
+ parent?: ParentExecutionRef;
453
+ executionOptions?: RunExecutionOptions;
454
+ }
455
+ interface PendingNodeExecution {
456
+ runId: RunId;
457
+ activationId: NodeActivationId;
458
+ workflowId: WorkflowId;
459
+ nodeId: NodeId;
460
+ itemsIn: number;
461
+ inputsByPort: NodeInputsByPort;
462
+ receiptId: string;
463
+ queue?: string;
464
+ batchId?: string;
465
+ enqueuedAt: string;
466
+ }
467
+ interface PersistedRunSchedulingState {
468
+ pending?: PendingNodeExecution;
469
+ queue: RunQueueEntry[];
470
+ }
471
+ interface PersistedRunState {
472
+ runId: RunId;
473
+ workflowId: WorkflowId;
474
+ startedAt: string;
475
+ /** Canonical terminal time for listings and retention when persisted on the run root. */
476
+ finishedAt?: string;
477
+ /** Optimistic concurrency / CAS on the run aggregate (repository may increment on save). */
478
+ revision?: number;
479
+ parent?: ParentExecutionRef;
480
+ executionOptions?: RunExecutionOptions;
481
+ control?: PersistedRunControlState;
482
+ workflowSnapshot?: PersistedWorkflowSnapshot;
483
+ mutableState?: PersistedMutableRunState;
484
+ /** Frozen at createRun from workflow + runtime defaults for prune/storage decisions. */
485
+ policySnapshot?: PersistedRunPolicySnapshot;
486
+ /** Successful node completions so far (for activation budget). */
487
+ engineCounters?: EngineRunCounters;
488
+ status: RunStatus;
489
+ pending?: PendingNodeExecution;
490
+ queue: RunQueueEntry[];
491
+ outputsByNode: Record<NodeId, NodeOutputs>;
492
+ nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
493
+ /** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
494
+ connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
495
+ }
496
+ interface WorkflowExecutionRepository {
497
+ createRun(args: {
498
+ runId: RunId;
499
+ workflowId: WorkflowId;
500
+ startedAt: string;
501
+ parent?: ParentExecutionRef;
502
+ executionOptions?: RunExecutionOptions;
503
+ control?: PersistedRunControlState;
504
+ workflowSnapshot?: PersistedWorkflowSnapshot;
505
+ mutableState?: PersistedMutableRunState;
506
+ policySnapshot?: PersistedRunPolicySnapshot;
507
+ engineCounters?: EngineRunCounters;
508
+ }): Promise<void>;
509
+ load(runId: RunId): Promise<PersistedRunState | undefined>;
510
+ loadSchedulingState(runId: RunId): Promise<PersistedRunSchedulingState | undefined>;
511
+ save(state: PersistedRunState): Promise<void>;
512
+ deleteRun?(runId: RunId): Promise<void>;
513
+ }
514
+ interface WorkflowExecutionListingRepository {
515
+ listRuns(args?: Readonly<{
516
+ workflowId?: WorkflowId;
517
+ limit?: number;
518
+ }>): Promise<ReadonlyArray<RunSummary>>;
519
+ }
520
+ /** Runs eligible for retention-based pruning (completed or failed, older than cutoff). */
521
+ interface RunPruneCandidate {
522
+ readonly runId: RunId;
523
+ readonly workflowId: WorkflowId;
524
+ readonly startedAt: string;
525
+ readonly finishedAt: string;
526
+ }
527
+ interface WorkflowExecutionPruneRepository {
528
+ listRunsOlderThan(args: Readonly<{
529
+ nowIso: string;
530
+ defaultRetentionSeconds: number;
531
+ limit?: number;
532
+ }>): Promise<ReadonlyArray<RunPruneCandidate>>;
533
+ }
534
+ type RunResult = {
535
+ runId: RunId;
536
+ workflowId: WorkflowId;
537
+ startedAt: string;
538
+ status: "completed";
539
+ outputs: Items;
540
+ } | {
541
+ runId: RunId;
542
+ workflowId: WorkflowId;
543
+ startedAt: string;
544
+ status: "pending";
545
+ pending: PendingNodeExecution;
546
+ } | {
547
+ runId: RunId;
548
+ workflowId: WorkflowId;
549
+ startedAt: string;
550
+ status: "failed";
551
+ error: {
552
+ message: string;
553
+ };
554
+ };
555
+ type WebhookRunResult = Readonly<{
556
+ runId: RunId;
557
+ workflowId: WorkflowId;
558
+ startedAt: string;
559
+ runStatus: "pending" | "completed";
560
+ response: Items;
561
+ }>;
562
+ interface PersistedWorkflowTokenRegistryLike {
563
+ register(type: TypeToken<unknown>, packageId: string, persistedNameOverride?: string): string;
564
+ getTokenId(type: TypeToken<unknown>): string | undefined;
565
+ resolve(tokenId: string): TypeToken<unknown> | undefined;
566
+ registerFromWorkflows?(workflows: ReadonlyArray<WorkflowDefinition>): void;
567
+ }
568
+ interface RunCompletionNotifier {
569
+ resolveRunCompletion(result: RunResult): void;
570
+ resolveWebhookResponse(result: WebhookRunResult): void;
571
+ }
572
+ interface RunEventPublisherDeps {
573
+ eventBus?: RunEventBus;
574
+ }
575
+ //#endregion
576
+ //#region src/triggers/polling/PollingTriggerDedupWindow.d.ts
577
+ /**
578
+ * Merges processed-ID windows for polling triggers, capping the total to avoid unbounded growth.
579
+ * Plugin code receives an instance of this class via {@link PollingTriggerHandle.dedup}.
580
+ */
581
+ declare class PollingTriggerDedupWindow {
582
+ static readonly defaultCapN = 2000;
583
+ merge(previous: ReadonlyArray<string>, incoming: ReadonlyArray<string>, capN?: number): ReadonlyArray<string>;
584
+ }
585
+ //#endregion
586
+ //#region src/triggers/polling/PollingTriggerLogger.d.ts
587
+ /**
588
+ * Minimal logger surface for the polling-trigger runtime.
589
+ * Hosts supply this via {@link EngineDeps.pollingTriggerLogger};
590
+ * when absent the runtime is silent.
591
+ */
592
+ interface PollingTriggerLogger {
593
+ info(message: string): void;
594
+ warn(message: string): void;
595
+ error(message: string, exception?: Error): void;
596
+ debug(message: string): void;
597
+ }
598
+ declare class NoOpPollingTriggerLogger implements PollingTriggerLogger {
599
+ info(): void;
600
+ warn(): void;
601
+ error(): void;
602
+ debug(): void;
603
+ }
604
+ //#endregion
605
+ //#region src/contracts/credentialTypes.d.ts
606
+ type CredentialTypeId = string;
607
+ type CredentialInstanceId = string;
608
+ type CredentialMaterialSourceKind = "db" | "env" | "code";
609
+ type CredentialSetupStatus = "draft" | "ready";
610
+ type CredentialHealthStatus = "unknown" | "healthy" | "failing";
611
+ type CredentialFieldSchema = Readonly<{
612
+ key: string;
613
+ label: string;
614
+ type: "string" | "password" | "textarea" | "json" | "boolean";
615
+ required?: true;
616
+ order?: number;
617
+ /**
618
+ * Where this field appears in the credential dialog. Use `"advanced"` for optional or
619
+ * power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).
620
+ * Defaults to `"default"` when omitted.
621
+ */
622
+ visibility?: "default" | "advanced";
623
+ placeholder?: string;
624
+ helpText?: string;
625
+ /** When set, host resolves this field from process.env at runtime; env wins over stored values. */
626
+ envVarName?: string;
627
+ /**
628
+ * When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
629
+ * pattern or documentation URL). Do not use for secret values.
630
+ */
631
+ copyValue?: string;
632
+ /** Accessible label for the copy control (default: Copy). */
633
+ copyButtonLabel?: string;
634
+ }>;
635
+ type CredentialRequirement = Readonly<{
636
+ slotKey: string;
637
+ label: string;
638
+ acceptedTypes: ReadonlyArray<CredentialTypeId>;
639
+ optional?: true;
640
+ helpText?: string;
641
+ helpUrl?: string;
642
+ }>;
643
+ type CredentialBindingKey = Readonly<{
644
+ workflowId: WorkflowId;
645
+ nodeId: NodeId;
646
+ slotKey: string;
647
+ }>;
648
+ type CredentialBinding = Readonly<{
649
+ key: CredentialBindingKey;
650
+ instanceId: CredentialInstanceId;
651
+ updatedAt: string;
652
+ }>;
653
+ type CredentialHealth = Readonly<{
654
+ status: CredentialHealthStatus;
655
+ message?: string;
656
+ testedAt?: string;
657
+ expiresAt?: string;
658
+ details?: Readonly<Record<string, unknown>>;
659
+ }>;
660
+ type OAuth2ProviderFromPublicConfig = Readonly<{
661
+ authorizeUrlFieldKey: string;
662
+ tokenUrlFieldKey: string;
663
+ userInfoUrlFieldKey?: string;
664
+ }>;
665
+ type CredentialOAuth2ScopesFromPublicConfig = Readonly<{
666
+ presetFieldKey: string;
667
+ presetScopes: Readonly<Record<string, ReadonlyArray<string>>>;
668
+ customPresetKey?: string;
669
+ customScopesFieldKey?: string;
670
+ }>;
671
+ type CredentialOAuth2AuthDefinition = Readonly<{
672
+ kind: "oauth2";
175
673
  providerId: string;
176
674
  scopes: ReadonlyArray<string>;
177
675
  scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
@@ -184,6 +682,27 @@ type CredentialOAuth2AuthDefinition = Readonly<{
184
682
  scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
185
683
  clientIdFieldKey?: string;
186
684
  clientSecretFieldKey?: string;
685
+ } | {
686
+ kind: "oauth2";
687
+ /**
688
+ * Free-form provider identifier for telemetry, DB rows, and Better Auth provider naming.
689
+ * Not used for any registry lookup — URLs come from {@link authorizeUrl} / {@link tokenUrl}.
690
+ */
691
+ providerId: string;
692
+ /**
693
+ * Authorization endpoint. May contain `{publicFieldKey}` placeholders that the runtime
694
+ * substitutes from the credential's resolved public config (URL-encoded).
695
+ * Example: `https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize`
696
+ */
697
+ authorizeUrl: string;
698
+ /** Token endpoint. Same templating rules as {@link authorizeUrl}. */
699
+ tokenUrl: string;
700
+ /** Optional userinfo endpoint. Same templating rules as {@link authorizeUrl}. */
701
+ userInfoUrl?: string;
702
+ scopes: ReadonlyArray<string>;
703
+ scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
704
+ clientIdFieldKey?: string;
705
+ clientSecretFieldKey?: string;
187
706
  }>;
188
707
  type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
189
708
  type CredentialAdvancedSectionPresentation = Readonly<{
@@ -274,9 +793,74 @@ declare class CredentialUnboundError extends Error {
274
793
  private static createMessage;
275
794
  }
276
795
  //#endregion
277
- //#region src/contracts/CostTrackingTelemetryContract.d.ts
278
- type CostTrackingComponent = "chat" | "ocr" | "rag";
279
- declare const CostTrackingTelemetryMetricNames: {
796
+ //#region src/contracts/collectionTypes.d.ts
797
+ /**
798
+ * Represents a typed store for a single collection.
799
+ * All rows include auto-managed id, created_at, and updated_at fields.
800
+ */
801
+ interface CollectionStore<TRow extends Record<string, unknown> = Record<string, unknown>> {
802
+ /**
803
+ * Insert a new row. id, created_at, and updated_at are auto-populated.
804
+ */
805
+ insert(row: TRow): Promise<TRow & {
806
+ id: string;
807
+ created_at: Date;
808
+ updated_at: Date;
809
+ }>;
810
+ /**
811
+ * Get a single row by id.
812
+ */
813
+ get(id: string): Promise<(TRow & {
814
+ id: string;
815
+ created_at: Date;
816
+ updated_at: Date;
817
+ }) | null>;
818
+ /**
819
+ * Find a single row matching the provided filter.
820
+ */
821
+ findOne(filter: Partial<TRow>): Promise<(TRow & {
822
+ id: string;
823
+ created_at: Date;
824
+ updated_at: Date;
825
+ }) | null>;
826
+ /**
827
+ * List rows with optional pagination and filtering.
828
+ */
829
+ list(opts?: {
830
+ limit?: number;
831
+ offset?: number;
832
+ where?: Partial<TRow>;
833
+ }): Promise<{
834
+ rows: ReadonlyArray<TRow & {
835
+ id: string;
836
+ created_at: Date;
837
+ updated_at: Date;
838
+ }>;
839
+ total: number;
840
+ }>;
841
+ /**
842
+ * Update a row by id with partial data.
843
+ */
844
+ update(id: string, patch: Partial<TRow>): Promise<TRow & {
845
+ id: string;
846
+ created_at: Date;
847
+ updated_at: Date;
848
+ }>;
849
+ /**
850
+ * Delete a row by id. Hard delete only (no soft delete).
851
+ */
852
+ delete(id: string): Promise<{
853
+ deleted: boolean;
854
+ }>;
855
+ }
856
+ /**
857
+ * Runtime collections context: keyed by collection name.
858
+ */
859
+ type CollectionsContext = Readonly<Record<string, CollectionStore>>;
860
+ //#endregion
861
+ //#region src/contracts/CostTrackingTelemetryContract.d.ts
862
+ type CostTrackingComponent = "chat" | "ocr" | "rag";
863
+ declare const CostTrackingTelemetryMetricNames: {
280
864
  readonly usage: "codemation.cost.usage";
281
865
  readonly estimatedCost: "codemation.cost.estimated";
282
866
  };
@@ -324,6 +908,8 @@ declare class NoOpTelemetryArtifactReference {
324
908
  //#region src/contracts/NoOpTelemetrySpanScope.d.ts
325
909
  declare class NoOpTelemetrySpanScope {
326
910
  static readonly value: TelemetrySpanScope;
911
+ /** Internal: the shared no-op {@link NodeExecutionTelemetry} that {@link NoOpNodeExecutionTelemetry} re-exposes. */
912
+ static readonly nodeExecutionTelemetryValue: NodeExecutionTelemetry;
327
913
  }
328
914
  //#endregion
329
915
  //#region src/contracts/NoOpNodeExecutionTelemetry.d.ts
@@ -358,6 +944,12 @@ declare class CodemationTelemetryAttributeNames {
358
944
  static readonly connectionInvocationId = "codemation.connection.invocation_id";
359
945
  static readonly toolName = "codemation.tool.name";
360
946
  static readonly traceParentRunId = "codemation.parent.run.id";
947
+ /** Per-item iteration that emitted this span/metric. Set on spans recorded inside a runnable per-item loop. */
948
+ static readonly iterationId = "codemation.iteration.id";
949
+ /** Item index (0-based) of the iteration. */
950
+ static readonly iterationIndex = "codemation.iteration.index";
951
+ /** Set when this span/metric was recorded under a sub-agent triggered by an outer LLM/tool call. */
952
+ static readonly parentInvocationId = "codemation.parent.invocation_id";
361
953
  }
362
954
  //#endregion
363
955
  //#region src/contracts/GenAiTelemetryAttributeNames.d.ts
@@ -437,322 +1029,36 @@ interface TelemetrySpanScope extends TelemetryScope {
437
1029
  readonly traceId: string;
438
1030
  readonly spanId: string;
439
1031
  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<{
1032
+ /**
1033
+ * Lift this span into a {@link NodeExecutionTelemetry} scoped to a different (nodeId, activationId).
1034
+ * Children created via the returned telemetry's `startChildSpan` get this span as their parent.
1035
+ *
1036
+ * Used at the sub-agent boundary so that nested runtime telemetry parents under the agent.tool.call
1037
+ * span instead of the orchestrator's node-level span.
1038
+ */
1039
+ asNodeTelemetry(args: Readonly<{
448
1040
  nodeId: NodeId;
449
1041
  activationId: NodeActivationId;
450
1042
  }>): NodeExecutionTelemetry;
451
1043
  }
452
- interface ExecutionTelemetryFactory {
453
- create(args: Readonly<{
454
- runId: RunId;
455
- workflowId: WorkflowId;
456
- parent?: ParentExecutionRef;
457
- policySnapshot?: PersistedRunPolicySnapshot;
458
- }>): ExecutionTelemetry;
459
- }
460
- //#endregion
461
- //#region src/contracts/runTypes.d.ts
462
- interface RunExecutionOptions {
463
- /** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
464
- localOnly?: boolean;
465
- /** Marks runs started from webhook handling so orchestration can apply webhook-specific continuation rules. */
466
- webhook?: boolean;
467
- mode?: "manual" | "debug";
468
- sourceWorkflowId?: WorkflowId;
469
- sourceRunId?: RunId;
470
- derivedFromRunId?: RunId;
471
- isMutable?: boolean;
472
- /** Set by the engine for this run: 0 = root, 1 = first child subworkflow, … */
473
- subworkflowDepth?: number;
474
- /** Effective cap after engine policy merge (successful node completions per run). */
475
- maxNodeActivations?: number;
476
- /** Effective cap after engine policy merge (subworkflow nesting). */
477
- maxSubworkflowDepth?: number;
478
- }
479
- /** Engine-owned counters persisted with the run (worker-safe). */
480
- interface EngineRunCounters {
481
- completedNodeActivations: number;
482
- }
483
- type RunStopCondition = Readonly<{
484
- kind: "workflowCompleted";
485
- }> | Readonly<{
486
- kind: "nodeCompleted";
487
- nodeId: NodeId;
488
- }>;
489
- interface RunStateResetRequest {
490
- clearFromNodeId: NodeId;
491
- }
492
- interface PersistedRunControlState {
493
- stopCondition?: RunStopCondition;
494
- }
495
- interface PersistedWorkflowSnapshotNode {
496
- id: NodeId;
497
- kind: NodeKind;
498
- name?: string;
499
- nodeTokenId: PersistedTokenId;
500
- configTokenId: PersistedTokenId;
501
- tokenName?: string;
502
- configTokenName?: string;
503
- config: unknown;
504
- }
505
- interface PersistedWorkflowSnapshot {
506
- id: WorkflowId;
507
- name: string;
508
- nodes: ReadonlyArray<PersistedWorkflowSnapshotNode>;
509
- edges: ReadonlyArray<Edge>;
510
- /** When the snapshot was built from a live workflow definition that configured a workflow error handler. */
511
- workflowErrorHandlerConfigured?: boolean;
512
- /** Connection metadata for child nodes not in the execution graph (e.g. AI agent attachments). */
513
- connections?: ReadonlyArray<WorkflowNodeConnection>;
514
- }
515
- type PinnedNodeOutputsByPort = Readonly<Record<OutputPortKey, Items>>;
516
- interface PersistedMutableNodeState {
517
- pinnedOutputsByPort?: PinnedNodeOutputsByPort;
518
- lastDebugInput?: Items;
519
- }
520
- interface PersistedMutableRunState {
521
- nodesById: Readonly<Record<NodeId, PersistedMutableNodeState>>;
522
- }
523
- type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
524
- interface RunQueueEntry {
525
- nodeId: NodeId;
526
- input: Items;
527
- toInput?: InputPortKey;
528
- batchId?: string;
529
- from?: Readonly<{
530
- nodeId: NodeId;
531
- output: OutputPortKey;
532
- }>;
533
- collect?: Readonly<{
534
- expectedInputs: ReadonlyArray<InputPortKey>;
535
- received: Readonly<Record<InputPortKey, Items>>;
536
- }>;
537
- }
538
- type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
539
- interface NodeExecutionError {
540
- message: string;
541
- name?: string;
542
- stack?: string;
543
- details?: JsonValue;
544
- }
545
- interface NodeExecutionSnapshot {
546
- runId: RunId;
547
- workflowId: WorkflowId;
548
- nodeId: NodeId;
549
- activationId?: NodeActivationId;
550
- parent?: ParentExecutionRef;
551
- status: NodeExecutionStatus;
552
- usedPinnedOutput?: boolean;
553
- queuedAt?: string;
554
- startedAt?: string;
555
- finishedAt?: string;
556
- updatedAt: string;
557
- inputsByPort?: NodeInputsByPort;
558
- outputs?: NodeOutputs;
559
- error?: NodeExecutionError;
560
- }
561
- /** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
562
- type ConnectionInvocationId = string;
563
- /**
564
- * One logical LLM or tool call under an owning workflow node (e.g. AI agent).
565
- * The owning node defines what {@link managedInput} and {@link managedOutput} contain.
566
- */
567
- interface ConnectionInvocationRecord {
568
- readonly invocationId: ConnectionInvocationId;
569
- readonly runId: RunId;
570
- readonly workflowId: WorkflowId;
571
- readonly connectionNodeId: NodeId;
572
- readonly parentAgentNodeId: NodeId;
573
- readonly parentAgentActivationId: NodeActivationId;
574
- readonly status: NodeExecutionStatus;
575
- readonly managedInput?: JsonValue;
576
- readonly managedOutput?: JsonValue;
577
- readonly error?: NodeExecutionError;
578
- readonly queuedAt?: string;
579
- readonly startedAt?: string;
580
- readonly finishedAt?: string;
581
- readonly updatedAt: string;
582
- }
583
- /** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
584
- type ConnectionInvocationAppendArgs = Readonly<{
585
- invocationId: ConnectionInvocationId;
586
- connectionNodeId: NodeId;
587
- parentAgentNodeId: NodeId;
588
- parentAgentActivationId: NodeActivationId;
589
- status: NodeExecutionStatus;
590
- managedInput?: JsonValue;
591
- managedOutput?: JsonValue;
592
- error?: NodeExecutionError;
593
- queuedAt?: string;
594
- startedAt?: string;
595
- finishedAt?: string;
596
- }>;
597
- interface RunCurrentState {
598
- outputsByNode: Record<NodeId, NodeOutputs>;
599
- nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
600
- /** Append-only history of connection-scoped invocations (LLM/tool) for inspector and canvas. */
601
- connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
602
- mutableState?: PersistedMutableRunState;
603
- }
604
- interface CurrentStateExecutionRequest {
605
- workflow: WorkflowDefinition;
606
- items?: Items;
607
- parent?: ParentExecutionRef;
608
- executionOptions?: RunExecutionOptions;
609
- workflowSnapshot?: PersistedWorkflowSnapshot;
610
- mutableState?: PersistedMutableRunState;
611
- currentState?: RunCurrentState;
612
- stopCondition?: RunStopCondition;
613
- reset?: RunStateResetRequest;
614
- }
615
- interface ExecutionFrontierPlan {
616
- rootNodeId?: NodeId;
617
- rootNodeInput?: Items;
618
- queue: RunQueueEntry[];
619
- currentState: RunCurrentState;
620
- stopCondition: RunStopCondition;
621
- satisfiedNodeIds: ReadonlyArray<NodeId>;
622
- skippedNodeIds: ReadonlyArray<NodeId>;
623
- clearedNodeIds: ReadonlyArray<NodeId>;
624
- preservedPinnedNodeIds: ReadonlyArray<NodeId>;
625
- }
626
- type RunStatus = "running" | "pending" | "completed" | "failed";
627
- interface RunSummary {
628
- runId: RunId;
629
- workflowId: WorkflowId;
630
- startedAt: string;
631
- status: RunStatus;
632
- /** ISO timestamp when the run finished (derived from node snapshots or store `updatedAt`); omit while running/pending. */
633
- finishedAt?: string;
634
- parent?: ParentExecutionRef;
635
- executionOptions?: RunExecutionOptions;
636
- }
637
- interface PendingNodeExecution {
638
- runId: RunId;
639
- activationId: NodeActivationId;
640
- workflowId: WorkflowId;
641
- nodeId: NodeId;
642
- itemsIn: number;
643
- inputsByPort: NodeInputsByPort;
644
- receiptId: string;
645
- queue?: string;
646
- batchId?: string;
647
- enqueuedAt: string;
648
- }
649
- interface PersistedRunSchedulingState {
650
- pending?: PendingNodeExecution;
651
- queue: RunQueueEntry[];
652
- }
653
- interface PersistedRunState {
654
- runId: RunId;
655
- workflowId: WorkflowId;
656
- startedAt: string;
657
- /** Canonical terminal time for listings and retention when persisted on the run root. */
658
- finishedAt?: string;
659
- /** Optimistic concurrency / CAS on the run aggregate (repository may increment on save). */
660
- revision?: number;
661
- parent?: ParentExecutionRef;
662
- executionOptions?: RunExecutionOptions;
663
- control?: PersistedRunControlState;
664
- workflowSnapshot?: PersistedWorkflowSnapshot;
665
- mutableState?: PersistedMutableRunState;
666
- /** Frozen at createRun from workflow + runtime defaults for prune/storage decisions. */
667
- policySnapshot?: PersistedRunPolicySnapshot;
668
- /** Successful node completions so far (for activation budget). */
669
- engineCounters?: EngineRunCounters;
670
- status: RunStatus;
671
- pending?: PendingNodeExecution;
672
- queue: RunQueueEntry[];
673
- outputsByNode: Record<NodeId, NodeOutputs>;
674
- nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
675
- /** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
676
- connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
677
- }
678
- interface WorkflowExecutionRepository {
679
- createRun(args: {
680
- runId: RunId;
681
- workflowId: WorkflowId;
682
- startedAt: string;
683
- parent?: ParentExecutionRef;
684
- executionOptions?: RunExecutionOptions;
685
- control?: PersistedRunControlState;
686
- workflowSnapshot?: PersistedWorkflowSnapshot;
687
- mutableState?: PersistedMutableRunState;
688
- policySnapshot?: PersistedRunPolicySnapshot;
689
- engineCounters?: EngineRunCounters;
690
- }): Promise<void>;
691
- load(runId: RunId): Promise<PersistedRunState | undefined>;
692
- loadSchedulingState(runId: RunId): Promise<PersistedRunSchedulingState | undefined>;
693
- save(state: PersistedRunState): Promise<void>;
694
- deleteRun?(runId: RunId): Promise<void>;
695
- }
696
- interface WorkflowExecutionListingRepository {
697
- listRuns(args?: Readonly<{
698
- workflowId?: WorkflowId;
699
- limit?: number;
700
- }>): Promise<ReadonlyArray<RunSummary>>;
701
- }
702
- /** Runs eligible for retention-based pruning (completed or failed, older than cutoff). */
703
- interface RunPruneCandidate {
704
- readonly runId: RunId;
705
- readonly workflowId: WorkflowId;
706
- readonly startedAt: string;
707
- readonly finishedAt: string;
708
- }
709
- interface WorkflowExecutionPruneRepository {
710
- listRunsOlderThan(args: Readonly<{
711
- nowIso: string;
712
- defaultRetentionSeconds: number;
713
- limit?: number;
714
- }>): Promise<ReadonlyArray<RunPruneCandidate>>;
715
- }
716
- type RunResult = {
717
- runId: RunId;
718
- workflowId: WorkflowId;
719
- startedAt: string;
720
- status: "completed";
721
- outputs: Items;
722
- } | {
723
- runId: RunId;
724
- workflowId: WorkflowId;
725
- startedAt: string;
726
- status: "pending";
727
- pending: PendingNodeExecution;
728
- } | {
729
- runId: RunId;
730
- workflowId: WorkflowId;
731
- startedAt: string;
732
- status: "failed";
733
- error: {
734
- message: string;
735
- };
736
- };
737
- type WebhookRunResult = Readonly<{
738
- runId: RunId;
739
- workflowId: WorkflowId;
740
- startedAt: string;
741
- runStatus: "pending" | "completed";
742
- response: Items;
743
- }>;
744
- interface PersistedWorkflowTokenRegistryLike {
745
- register(type: TypeToken<unknown>, packageId: string, persistedNameOverride?: string): string;
746
- getTokenId(type: TypeToken<unknown>): string | undefined;
747
- resolve(tokenId: string): TypeToken<unknown> | undefined;
748
- registerFromWorkflows?(workflows: ReadonlyArray<WorkflowDefinition>): void;
749
- }
750
- interface RunCompletionNotifier {
751
- resolveRunCompletion(result: RunResult): void;
752
- resolveWebhookResponse(result: WebhookRunResult): void;
1044
+ interface NodeExecutionTelemetry extends ExecutionTelemetry, TelemetrySpanScope {
1045
+ startChildSpan(args: TelemetryChildSpanStart): TelemetrySpanScope;
753
1046
  }
754
- interface RunEventPublisherDeps {
755
- eventBus?: RunEventBus;
1047
+ interface ExecutionTelemetry extends TelemetryScope {
1048
+ readonly traceId: string;
1049
+ readonly spanId: string;
1050
+ forNode(args: Readonly<{
1051
+ nodeId: NodeId;
1052
+ activationId: NodeActivationId;
1053
+ }>): NodeExecutionTelemetry;
1054
+ }
1055
+ interface ExecutionTelemetryFactory {
1056
+ create(args: Readonly<{
1057
+ runId: RunId;
1058
+ workflowId: WorkflowId;
1059
+ parent?: ParentExecutionRef;
1060
+ policySnapshot?: PersistedRunPolicySnapshot;
1061
+ }>): ExecutionTelemetry;
756
1062
  }
757
1063
  //#endregion
758
1064
  //#region src/contracts/workflowActivationPolicy.d.ts
@@ -925,6 +1231,21 @@ interface ExecutionContext {
925
1231
  telemetry: ExecutionTelemetry;
926
1232
  binary: ExecutionBinaryService;
927
1233
  getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
1234
+ /** Per-item iteration id, set by {@link NodeExecutor} on the ctx passed into runnable `execute`. */
1235
+ iterationId?: NodeIterationId;
1236
+ /** Item index (0-based) within the current activation's batch; set alongside {@link iterationId}. */
1237
+ itemIndex?: number;
1238
+ /** When set, this ctx is executing inside a sub-agent triggered by the named parent invocation. */
1239
+ parentInvocationId?: ConnectionInvocationId;
1240
+ /**
1241
+ * Present iff the run was started by a TestSuiteOrchestrator. The {@link IsTestRunNode}
1242
+ * branches on this; assertion-emitting nodes use it to decide whether to record results.
1243
+ */
1244
+ testContext?: RunTestContext;
1245
+ /**
1246
+ * Collections registered in the codemation config, keyed by collection name.
1247
+ */
1248
+ readonly collections?: CollectionsContext;
928
1249
  }
929
1250
  interface ExecutionContextFactory {
930
1251
  create(args: {
@@ -939,6 +1260,7 @@ interface ExecutionContextFactory {
939
1260
  nodeState?: NodeExecutionStatePublisher;
940
1261
  telemetry?: ExecutionTelemetry;
941
1262
  getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
1263
+ testContext?: RunTestContext;
942
1264
  }): ExecutionContext;
943
1265
  }
944
1266
  interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
@@ -948,12 +1270,34 @@ interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase>
948
1270
  telemetry: NodeExecutionTelemetry;
949
1271
  binary: NodeBinaryAttachmentService;
950
1272
  }
1273
+ interface PollingTriggerHandle {
1274
+ /**
1275
+ * Start the polling loop. The runtime registers its own cleanup handle so callers do not need to
1276
+ * call {@link TriggerSetupContext.registerCleanup} for the loop.
1277
+ * @returns The state returned by the first cycle (or `undefined` when the overlap guard fired).
1278
+ */
1279
+ start<TState, TItem>(args: {
1280
+ intervalMs: number;
1281
+ seedState?: TState;
1282
+ runCycle: (cycleCtx: {
1283
+ previousState: TState | undefined;
1284
+ signal: AbortSignal;
1285
+ }) => Promise<{
1286
+ items: Items<TItem>;
1287
+ nextState: TState;
1288
+ }>;
1289
+ }): Promise<TState | undefined>;
1290
+ /** Convenience dedup-window helper. */
1291
+ readonly dedup: PollingTriggerDedupWindow;
1292
+ }
951
1293
  interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
952
1294
  trigger: TriggerInstanceId;
953
1295
  config: TConfig;
954
1296
  previousState: TSetupState$1;
955
1297
  registerCleanup(cleanup: TriggerCleanupHandle): void;
956
1298
  emit(items: Items): Promise<void>;
1299
+ /** Generic polling-trigger surface. Pre-binds trigger id, emit, and registerCleanup. */
1300
+ readonly polling: PollingTriggerHandle;
957
1301
  }
958
1302
  interface TriggerTestItemsContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
959
1303
  trigger: TriggerInstanceId;
@@ -1148,6 +1492,8 @@ interface EngineDeps {
1148
1492
  workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;
1149
1493
  /** When set, logs inactive-workflow skips at boot and trigger start/stop on activation changes. */
1150
1494
  triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics;
1495
+ /** When set, the polling-trigger runtime uses this logger for cycle info/debug/error. */
1496
+ pollingTriggerLogger?: PollingTriggerLogger;
1151
1497
  }
1152
1498
  //#endregion
1153
1499
  //#region src/contracts/retryPolicySpec.types.d.ts
@@ -1179,14 +1525,9 @@ interface ExponentialRetryPolicySpec {
1179
1525
  }
1180
1526
  //#endregion
1181
1527
  //#region src/contracts/workflowTypes.d.ts
1182
- type WorkflowId = string;
1183
- type NodeId = string;
1184
1528
  type NodeIdRef<TJson = unknown> = NodeId & Readonly<{
1185
1529
  __codemationNodeJson?: TJson;
1186
1530
  }>;
1187
- type OutputPortKey = string;
1188
- type InputPortKey = string;
1189
- type PersistedTokenId = string;
1190
1531
  type NodeKind = "trigger" | "node";
1191
1532
  type JsonPrimitive = string | number | boolean | null;
1192
1533
  interface JsonObject {
@@ -1206,7 +1547,6 @@ interface Edge {
1206
1547
  input: InputPortKey;
1207
1548
  };
1208
1549
  }
1209
- type NodeConnectionName = string;
1210
1550
  /**
1211
1551
  * Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
1212
1552
  * but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
@@ -1272,6 +1612,14 @@ interface NodeConfigBase {
1272
1612
  readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
1273
1613
  readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
1274
1614
  getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
1615
+ /**
1616
+ * Marker: this node emits {@link import("./assertionTypes").AssertionResult}-shaped items on its
1617
+ * `main` port. The TestSuiteOrchestrator (and host-side TestAssertionPersister) listen for
1618
+ * `nodeCompleted` events from nodes with this flag set, and persist their output items as
1619
+ * TestAssertion records (only when the run carries a `testContext`). Set on assertion node
1620
+ * configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).
1621
+ */
1622
+ readonly emitsAssertions?: true;
1275
1623
  }
1276
1624
  declare const runnableNodeInputType: unique symbol;
1277
1625
  declare const runnableNodeOutputType: unique symbol;
@@ -1301,6 +1649,12 @@ interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonV
1301
1649
  readonly kind: "trigger";
1302
1650
  readonly [triggerNodeOutputType]?: TOutputJson$1;
1303
1651
  readonly [triggerNodeSetupStateType]?: TSetupState$1;
1652
+ /**
1653
+ * Distinguishes triggers driven by the live activation policy (webhooks, cron, polling) from
1654
+ * triggers driven only by the {@link TestSuiteOrchestrator}. `WorkflowActivation` skips
1655
+ * `"test"` triggers; the orchestrator skips `"live"` triggers. Defaults to `"live"` when omitted.
1656
+ */
1657
+ readonly triggerKind?: "live" | "test";
1304
1658
  }
1305
1659
  type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
1306
1660
  type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;
@@ -1351,6 +1705,12 @@ type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
1351
1705
  type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
1352
1706
  type RunId = string;
1353
1707
  type NodeActivationId = string;
1708
+ /**
1709
+ * One per-item iteration of a runnable node's execute loop. Refines `NodeActivationId` for
1710
+ * per-item connection invocations and telemetry. Undefined when the executing node is a batch
1711
+ * node or trigger that does not iterate items.
1712
+ */
1713
+ type NodeIterationId = string;
1354
1714
  interface ParentExecutionRef {
1355
1715
  runId: RunId;
1356
1716
  workflowId: WorkflowId;
@@ -1361,6 +1721,12 @@ interface ParentExecutionRef {
1361
1721
  engineMaxNodeActivations?: number;
1362
1722
  /** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
1363
1723
  engineMaxSubworkflowDepth?: number;
1724
+ /**
1725
+ * Test-suite linkage inherited by the child subworkflow run. Set by whichever node
1726
+ * spawns the subworkflow when its own `ctx.testContext` is present, so assertions
1727
+ * emitted inside a subworkflow land under the correct parent test case.
1728
+ */
1729
+ testContext?: RunTestContext;
1364
1730
  }
1365
1731
  interface RunDataSnapshot {
1366
1732
  getOutputs(nodeId: NodeId): NodeOutputs | undefined;
@@ -1457,23 +1823,61 @@ interface WorkflowPolicyRuntimeDefaults {
1457
1823
  readonly storagePolicy?: WorkflowStoragePolicyMode;
1458
1824
  }
1459
1825
  //#endregion
1460
- //#region src/contracts/emitPorts.d.ts
1461
- declare const EMIT_PORTS_BRAND: unique symbol;
1462
- type PortsEmission = Readonly<{
1463
- readonly [EMIT_PORTS_BRAND]: true;
1464
- readonly ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>;
1465
- }>;
1466
- declare function emitPorts(ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>): PortsEmission;
1467
- declare function isPortsEmission(value: unknown): value is PortsEmission;
1468
- declare function isUnbrandedPortsEmissionShape(value: unknown): value is Readonly<{
1469
- ports: unknown;
1470
- }>;
1471
- //#endregion
1472
- //#region src/contracts/itemMeta.d.ts
1826
+ //#region src/contracts/assertionTypes.d.ts
1473
1827
  /**
1474
- * Reads `meta._cm.originIndex` when present (used for fan-in merge-by-origin and Merge routing).
1828
+ * One assertion emitted by an assertion-emitting node (a node whose config sets
1829
+ * `emitsAssertions: true`). Each emitted item on `main` carries one of these as `item.json`.
1830
+ *
1831
+ * Pass/fail is derived from `score >= (passThreshold ?? 0.5)` — see {@link deriveAssertionPassed}.
1832
+ * The `errored` marker is for cases where the assertion code itself threw (distinct from
1833
+ * "the assertion was evaluated and the score was low") and is treated as a hard fail in rollups
1834
+ * regardless of `score`.
1475
1835
  */
1476
- declare function getOriginIndexFromItem(item: Item): number | undefined;
1836
+ interface AssertionResult {
1837
+ readonly name: string;
1838
+ /** 0..1 score. Source of truth for pass/fail (compared against `passThreshold`). */
1839
+ readonly score: number;
1840
+ /** 0..1 threshold for "passed". When omitted, consumers default to 0.5. */
1841
+ readonly passThreshold?: number;
1842
+ /** True when evaluating the assertion threw — treated as fail regardless of `score`. */
1843
+ readonly errored?: true;
1844
+ /** What the assertion expected. Free-form JSON; UIs render with a JSON viewer. */
1845
+ readonly expected?: JsonValue;
1846
+ /** What the workflow actually produced. */
1847
+ readonly actual?: JsonValue;
1848
+ /** Short human-readable explanation, especially for fails / errors. */
1849
+ readonly message?: string;
1850
+ /** Bag of supplemental fields (e.g. judge prompt, judge raw response, comparison method). */
1851
+ readonly details?: Readonly<Record<string, JsonValue>>;
1852
+ }
1853
+ /**
1854
+ * Default {@link AssertionResult.passThreshold} when authors omit it. Boolean-style assertions
1855
+ * (assertEqual / contains / etc.) emit `score: 1` or `score: 0` so this default works for them;
1856
+ * AI-judge assertions are expected to set their own threshold.
1857
+ */
1858
+ declare const DEFAULT_ASSERTION_PASS_THRESHOLD = 0.5;
1859
+ /**
1860
+ * Derive whether an assertion result is considered "passing" using the score-based contract:
1861
+ * `errored` always fails, otherwise `score >= (passThreshold ?? 0.5)`. This is the canonical
1862
+ * derivation — UI and rollup code should call it rather than inlining the comparison so future
1863
+ * tweaks (e.g. NaN handling) land in one place.
1864
+ */
1865
+ declare function deriveAssertionPassed(result: {
1866
+ readonly score: number;
1867
+ readonly passThreshold?: number;
1868
+ readonly errored?: true;
1869
+ }): boolean;
1870
+ /**
1871
+ * Provenance for a persisted {@link AssertionResult}: which node produced it and where in the
1872
+ * per-item iteration tree it landed. Filled in by the host-side persister, not the node itself.
1873
+ */
1874
+ interface AssertionResultProvenance {
1875
+ readonly nodeId: NodeId;
1876
+ /** Per-item iteration id when the emitting node ran inside a per-item loop. */
1877
+ readonly iterationId?: string;
1878
+ /** Item index (0-based) within the activation that produced this assertion. */
1879
+ readonly itemIndex?: number;
1880
+ }
1477
1881
  //#endregion
1478
1882
  //#region src/contracts/itemExpr.d.ts
1479
1883
  declare const ITEM_EXPR_BRAND: unique symbol;
@@ -1515,34 +1919,6 @@ type Expr<T, TItemJson = unknown> = ItemExpr<T, TItemJson>;
1515
1919
  type Param<T, TItemJson = unknown> = T | Expr<T, TItemJson>;
1516
1920
  type ParamDeep<T, TItemJson = unknown> = Expr<T, TItemJson> | (T extends readonly (infer U)[] ? ReadonlyArray<ParamDeep<U, TItemJson>> : never) | (T extends object ? { [K in keyof T]: ParamDeep<T[K], TItemJson> } : T);
1517
1921
  //#endregion
1518
- //#region src/contracts/NoRetryPolicy.d.ts
1519
- declare class NoRetryPolicy implements NoneRetryPolicySpec {
1520
- readonly kind: "none";
1521
- }
1522
- //#endregion
1523
- //#region src/contracts/RetryPolicy.d.ts
1524
- declare class RetryPolicy implements FixedRetryPolicySpec {
1525
- readonly maxAttempts: number;
1526
- readonly delayMs: number;
1527
- readonly kind: "fixed";
1528
- constructor(maxAttempts: number, delayMs: number);
1529
- /** Default for HTTP-style transient failures: 3 tries, 1s between attempts. */
1530
- static readonly defaultForHttp: FixedRetryPolicySpec;
1531
- /** Default for LLM / agent calls: 3 tries, 2s fixed backoff. */
1532
- static readonly defaultForAiAgent: FixedRetryPolicySpec;
1533
- }
1534
- //#endregion
1535
- //#region src/contracts/ExpRetryPolicy.d.ts
1536
- declare class ExpRetryPolicy implements ExponentialRetryPolicySpec {
1537
- readonly maxAttempts: number;
1538
- readonly initialDelayMs: number;
1539
- readonly multiplier: number;
1540
- readonly maxDelayMs?: number | undefined;
1541
- readonly jitter?: boolean | undefined;
1542
- readonly kind: "exponential";
1543
- constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined);
1544
- }
1545
- //#endregion
1546
1922
  //#region src/contracts/CostCatalogContract.d.ts
1547
1923
  interface CostCatalogEntry {
1548
1924
  readonly component: CostTrackingUsageRecord["component"];
@@ -1558,19 +1934,6 @@ interface CostCatalog {
1558
1934
  findEntry(args: CostTrackingUsageRecord): CostCatalogEntry | undefined;
1559
1935
  }
1560
1936
  //#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
1574
1937
  //#region src/contracts/executionPersistenceContracts.d.ts
1575
1938
  /** Canonical id for persisted execution rows (activation or connection invocation). */
1576
1939
  type ExecutionInstanceId = string;
@@ -1696,6 +2059,29 @@ interface WorkflowRunDetailDto {
1696
2059
  readonly mutableState?: PersistedMutableRunState;
1697
2060
  readonly slotStates: ReadonlyArray<SlotExecutionStateDto>;
1698
2061
  readonly executionInstances: ReadonlyArray<ExecutionInstanceDto>;
2062
+ readonly iterations?: ReadonlyArray<RunIterationDto>;
2063
+ }
2064
+ /**
2065
+ * Per-item iteration projected from connection invocations and node activations.
2066
+ *
2067
+ * One iteration = one item processed by an agent within an activation. Multiple invocations
2068
+ * (LLM rounds, tool calls) belonging to the same iteration share the iterationId.
2069
+ */
2070
+ interface RunIterationDto {
2071
+ readonly iterationId: string;
2072
+ readonly agentNodeId: NodeId;
2073
+ readonly activationId: NodeActivationId;
2074
+ readonly itemIndex: number;
2075
+ readonly itemSummary?: string;
2076
+ readonly status: NodeExecutionStatus;
2077
+ readonly startedAt?: string;
2078
+ readonly finishedAt?: string;
2079
+ readonly invocationIds: ReadonlyArray<string>;
2080
+ readonly parentInvocationId?: string;
2081
+ /** Estimated cost rolled up from telemetry cost metric points, keyed by ISO currency code (e.g. "USD"). Values are minor units (cents-of-cents per the metric's `cost.currency_scale`). */
2082
+ readonly estimatedCostMinorByCurrency?: Readonly<Record<string, number>>;
2083
+ /** Currency scale (denominator) per currency, when present on the metric points. Joined with `estimatedCostMinorByCurrency` to format human-readable amounts. */
2084
+ readonly estimatedCostCurrencyScaleByCurrency?: Readonly<Record<string, number>>;
1699
2085
  }
1700
2086
  interface SlotExecutionStateDto {
1701
2087
  readonly slotNodeId: NodeId;
@@ -1724,12 +2110,77 @@ interface ExecutionInstanceDto {
1724
2110
  readonly inputJson?: JsonValue;
1725
2111
  readonly outputJson?: JsonValue;
1726
2112
  readonly error?: Readonly<NodeExecutionError>;
2113
+ /** Per-item iteration that produced this instance. Set on connectionInvocation rows produced inside per-item runnable loops. */
2114
+ readonly iterationId?: string;
2115
+ /** Item index (0-based) of the iteration. */
2116
+ readonly itemIndex?: number;
2117
+ /** Parent invocation id when this instance was emitted by a sub-agent triggered by an outer LLM/tool call. */
2118
+ readonly parentInvocationId?: string;
1727
2119
  }
1728
2120
  interface WorkflowDetailSelectionState {
1729
2121
  readonly selectedSlotNodeId: NodeId | null;
1730
2122
  readonly selectedInstanceId: ExecutionInstanceId | null;
1731
2123
  }
1732
2124
  //#endregion
2125
+ //#region src/contracts/emitPorts.d.ts
2126
+ declare const EMIT_PORTS_BRAND: unique symbol;
2127
+ type PortsEmission = Readonly<{
2128
+ readonly [EMIT_PORTS_BRAND]: true;
2129
+ readonly ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>;
2130
+ }>;
2131
+ declare function emitPorts(ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>): PortsEmission;
2132
+ declare function isPortsEmission(value: unknown): value is PortsEmission;
2133
+ declare function isUnbrandedPortsEmissionShape(value: unknown): value is Readonly<{
2134
+ ports: unknown;
2135
+ }>;
2136
+ //#endregion
2137
+ //#region src/contracts/itemMeta.d.ts
2138
+ /**
2139
+ * Reads `meta._cm.originIndex` when present (used for fan-in merge-by-origin and Merge routing).
2140
+ */
2141
+ declare function getOriginIndexFromItem(item: Item): number | undefined;
2142
+ //#endregion
2143
+ //#region src/contracts/NoRetryPolicy.d.ts
2144
+ declare class NoRetryPolicy implements NoneRetryPolicySpec {
2145
+ readonly kind: "none";
2146
+ }
2147
+ //#endregion
2148
+ //#region src/contracts/RetryPolicy.d.ts
2149
+ declare class RetryPolicy implements FixedRetryPolicySpec {
2150
+ readonly maxAttempts: number;
2151
+ readonly delayMs: number;
2152
+ readonly kind: "fixed";
2153
+ constructor(maxAttempts: number, delayMs: number);
2154
+ /** Default for HTTP-style transient failures: 3 tries, 1s between attempts. */
2155
+ static readonly defaultForHttp: FixedRetryPolicySpec;
2156
+ /** Default for LLM / agent calls: 3 tries, 2s fixed backoff. */
2157
+ static readonly defaultForAiAgent: FixedRetryPolicySpec;
2158
+ }
2159
+ //#endregion
2160
+ //#region src/contracts/ExpRetryPolicy.d.ts
2161
+ declare class ExpRetryPolicy implements ExponentialRetryPolicySpec {
2162
+ readonly maxAttempts: number;
2163
+ readonly initialDelayMs: number;
2164
+ readonly multiplier: number;
2165
+ readonly maxDelayMs?: number | undefined;
2166
+ readonly jitter?: boolean | undefined;
2167
+ readonly kind: "exponential";
2168
+ constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined);
2169
+ }
2170
+ //#endregion
2171
+ //#region src/contracts/NoOpCostTrackingTelemetry.d.ts
2172
+ declare class NoOpCostTrackingTelemetry implements CostTrackingTelemetry {
2173
+ captureUsage(_: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
2174
+ forScope(_: TelemetryScope): CostTrackingTelemetry;
2175
+ }
2176
+ //#endregion
2177
+ //#region src/contracts/NoOpCostTrackingTelemetryFactory.d.ts
2178
+ declare class NoOpCostTrackingTelemetryFactory implements CostTrackingTelemetryFactory {
2179
+ create(_: Readonly<{
2180
+ telemetry: ExecutionTelemetry;
2181
+ }>): CostTrackingTelemetry;
2182
+ }
2183
+ //#endregion
1733
2184
  //#region src/contracts/runFinishedAtFactory.d.ts
1734
2185
  type RunFinishedAtSource = Pick<PersistedRunState, "status" | "nodeSnapshotsByNodeId" | "finishedAt">;
1735
2186
  /** Derives workflow end time from persisted run root or node snapshots for run listings. */
@@ -1792,7 +2243,6 @@ declare class WorkflowBuilder {
1792
2243
  private readonly options?;
1793
2244
  private readonly nodes;
1794
2245
  private readonly edges;
1795
- private seq;
1796
2246
  constructor(meta: {
1797
2247
  id: WorkflowId;
1798
2248
  name: string;
@@ -1802,8 +2252,37 @@ declare class WorkflowBuilder {
1802
2252
  trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>>;
1803
2253
  start<TConfig extends AnyRunnableNodeConfig>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
1804
2254
  build(): WorkflowDefinition;
2255
+ private validateNodeIds;
1805
2256
  }
1806
2257
  //#endregion
2258
+ //#region src/workflow/dsl/WorkflowDefinitionError.d.ts
2259
+ /**
2260
+ * Thrown by {@link WorkflowBuilder.build} when the workflow definition is structurally invalid.
2261
+ *
2262
+ * Common causes:
2263
+ * - A node has an empty effective id (label is blank and no explicit `id` was given).
2264
+ * - Two or more nodes share the same effective id (label slugs collide or explicit ids clash).
2265
+ *
2266
+ * Fix: provide an explicit `id:` on the offending node configs.
2267
+ */
2268
+ declare class WorkflowDefinitionError extends Error {
2269
+ constructor(message: string);
2270
+ }
2271
+ //#endregion
2272
+ //#region src/workflow/dsl/NodeIdSlugifier.d.ts
2273
+ /**
2274
+ * Converts a human-readable node label into a stable, URL-safe identifier segment.
2275
+ *
2276
+ * Rules:
2277
+ * - Lowercase the entire string.
2278
+ * - Replace every run of characters outside `[a-z0-9]` with a single `-`.
2279
+ * - Strip any leading or trailing `-` characters.
2280
+ * - Return `""` for blank/empty input.
2281
+ */
2282
+ declare const NodeIdSlugifier: {
2283
+ slugify(label: string): string;
2284
+ };
2285
+ //#endregion
1807
2286
  //#region src/workflow/definition/ConnectionInvocationIdFactory.d.ts
1808
2287
  /**
1809
2288
  * Unique ids for persisted connection invocation history rows (LLM/tool calls under an owning node).
@@ -1838,6 +2317,22 @@ declare class ConnectionNodeIdFactory {
1838
2317
  static normalizeToolName(toolName: string): string;
1839
2318
  }
1840
2319
  //#endregion
2320
+ //#region src/workflow/definition/NodeIterationIdFactory.d.ts
2321
+ /**
2322
+ * Unique ids for one per-item iteration of a runnable node's execute loop.
2323
+ *
2324
+ * Activations are per-batch (one scheduled execution of a node, possibly with N items).
2325
+ * Iterations refine that to one identifier per item-index inside the batch loop, so per-item
2326
+ * connection invocations and telemetry can be grouped without time-window heuristics.
2327
+ */
2328
+ declare class NodeIterationIdFactory {
2329
+ static create(): string;
2330
+ /** Deterministic id for tests when a stable sequence is needed. */
2331
+ static createForTest(seed: string, sequence: number): string;
2332
+ /** Deterministic id derived from a connection node id (for sub-agent / tool-call scopes). */
2333
+ static createForConnection(connectionNodeId: NodeId, sequence: number): string;
2334
+ }
2335
+ //#endregion
1841
2336
  //#region src/workflow/definition/WorkflowExecutableNodeClassifier.d.ts
1842
2337
  /**
1843
2338
  * Derives which workflow nodes participate in the main execution graph vs connection-only children.
@@ -2001,37 +2496,6 @@ declare class Engine implements NodeActivationContinuation, NodeExecutionRequest
2001
2496
  handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;
2002
2497
  }
2003
2498
  //#endregion
2004
- //#region src/workflowSnapshots/WorkflowSnapshotCodec.d.ts
2005
- declare class WorkflowSnapshotCodec {
2006
- private readonly tokenRegistry;
2007
- constructor(tokenRegistry: PersistedWorkflowTokenRegistryLike);
2008
- create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
2009
- hydrate(snapshotNode: PersistedWorkflowSnapshotNode, liveConfig: NodeConfigBase): NodeConfigBase;
2010
- private serializeConfig;
2011
- private injectTokenIds;
2012
- private mergeValue;
2013
- private mergeNestedValue;
2014
- private restoreNonSerializableProperties;
2015
- private restoreTypeProperty;
2016
- private resolveTokenId;
2017
- private resolveTokenName;
2018
- private asTypeToken;
2019
- private asRecord;
2020
- }
2021
- //#endregion
2022
- //#region src/policies/executionLimits/EngineExecutionLimitsPolicyFactory.d.ts
2023
- /**
2024
- * Builds {@link EngineExecutionLimitsPolicy} by merging {@link ENGINE_EXECUTION_LIMITS_DEFAULTS} with optional `overrides` (e.g. host `runtime.engineExecutionLimits`).
2025
- */
2026
- declare class EngineExecutionLimitsPolicyFactory {
2027
- create(overrides?: Partial<EngineExecutionLimitsPolicyConfig>): EngineExecutionLimitsPolicy;
2028
- }
2029
- //#endregion
2030
- //#region src/policies/storage/RunPolicySnapshotFactory.d.ts
2031
- declare class RunPolicySnapshotFactory {
2032
- static create(workflow: WorkflowDefinition, defaults?: WorkflowPolicyRuntimeDefaults): PersistedRunPolicySnapshot;
2033
- }
2034
- //#endregion
2035
2499
  //#region src/policies/storage/WorkflowStoragePolicyEvaluator.d.ts
2036
2500
  declare class WorkflowStoragePolicyEvaluator {
2037
2501
  private readonly nodeResolver;
@@ -2061,6 +2525,37 @@ declare class WorkflowPolicyErrorServices {
2061
2525
  resolveWorkflowErrorHandler(spec: WorkflowErrorHandlerSpec | undefined): WorkflowErrorHandler | undefined;
2062
2526
  }
2063
2527
  //#endregion
2528
+ //#region src/policies/executionLimits/EngineExecutionLimitsPolicyFactory.d.ts
2529
+ /**
2530
+ * Builds {@link EngineExecutionLimitsPolicy} by merging {@link ENGINE_EXECUTION_LIMITS_DEFAULTS} with optional `overrides` (e.g. host `runtime.engineExecutionLimits`).
2531
+ */
2532
+ declare class EngineExecutionLimitsPolicyFactory {
2533
+ create(overrides?: Partial<EngineExecutionLimitsPolicyConfig>): EngineExecutionLimitsPolicy;
2534
+ }
2535
+ //#endregion
2536
+ //#region src/policies/storage/RunPolicySnapshotFactory.d.ts
2537
+ declare class RunPolicySnapshotFactory {
2538
+ static create(workflow: WorkflowDefinition, defaults?: WorkflowPolicyRuntimeDefaults): PersistedRunPolicySnapshot;
2539
+ }
2540
+ //#endregion
2541
+ //#region src/workflowSnapshots/WorkflowSnapshotCodec.d.ts
2542
+ declare class WorkflowSnapshotCodec {
2543
+ private readonly tokenRegistry;
2544
+ constructor(tokenRegistry: PersistedWorkflowTokenRegistryLike);
2545
+ create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
2546
+ hydrate(snapshotNode: PersistedWorkflowSnapshotNode, liveConfig: NodeConfigBase): NodeConfigBase;
2547
+ private serializeConfig;
2548
+ private injectTokenIds;
2549
+ private mergeValue;
2550
+ private mergeNestedValue;
2551
+ private restoreNonSerializableProperties;
2552
+ private restoreTypeProperty;
2553
+ private resolveTokenId;
2554
+ private resolveTokenName;
2555
+ private asTypeToken;
2556
+ private asRecord;
2557
+ }
2558
+ //#endregion
2064
2559
  //#region src/runtime/EngineWorkflowRunnerService.d.ts
2065
2560
  declare class EngineWorkflowRunnerService {
2066
2561
  private readonly engine;
@@ -2143,5 +2638,5 @@ declare class RunIntentService {
2143
2638
  private createWebhookExecutionOptions;
2144
2639
  }
2145
2640
  //#endregion
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
2641
+ export { RunRevision as $, InputPortKey as $a, PersistedMutableNodeState as $i, NodeActivationRequestBase as $n, NoOpExecutionTelemetryFactory as $r, PersistedRunPolicySnapshot as $t, RunFinishedAtFactory as A, TypeToken as Aa, CredentialSessionFactoryArgs as Ai, ExponentialRetryPolicySpec as An, WebhookControlSignal as Ar, ItemBinary as At, isUnbrandedPortsEmissionShape as B, singleton as Ba, PollingTriggerLogger as Bi, BinaryStorageWriteResult as Bn, TelemetryArtifactAttachment as Br, NodeDefinition as Bt, AnyTriggerNodeConfig as C, WorkflowExecutionRepository as Ca, CredentialInstanceRecord as Ci, WorkflowStoragePolicySpec as Cn, WorkflowRepository as Cr, deriveAssertionPassed as Ct, BranchStepsArg as D, InjectionToken$1 as Da, CredentialOAuth2ScopesFromPublicConfig as Di, runnableNodeOutputType as Dn, WorkflowSnapshotResolver as Dr, Edge as Dt, BranchOutputGuard as E, Disposable as Ea, CredentialOAuth2AuthDefinition as Ei, runnableNodeInputType as En, WorkflowSnapshotFactory as Er, BinaryPreviewKind as Et, NoRetryPolicy as F, injectable as Fa, CredentialTypeId as Fi, BinaryBody as Fn, AllWorkflowsActiveWorkflowActivationPolicy as Fr, JsonPrimitive as Ft, ExecutionPayloadPolicyFields as G, RunEvent as Ga, CurrentStateExecutionRequest as Gi, ExecutionContext as Gn, TelemetryMetricRecord as Gr, NodeIterationId as Gt, ConnectionInvocationKind as H, ENGINE_EXECUTION_LIMITS_DEFAULTS as Ha, ConnectionInvocationAppendArgs as Hi, EngineHost as Hn, TelemetryAttributePrimitive as Hr, NodeErrorHandlerArgs as Ht, getOriginIndexFromItem as I, instanceCachingFactory as Ia, CredentialTypeRegistry as Ii, BinaryStorage as In, WorkflowActivationPolicy as Ir, JsonValue as It, PersistedExecutionInstanceRecord as J, TestCaseRunStatus as Ja, NodeExecutionError as Ji, LiveWorkflowRepository as Jn, TelemetrySpanEventRecord as Jr, NodeOutputs as Jt, PayloadStorageKind as K, RunEventBus as Ka, EngineRunCounters as Ki, ExecutionContextFactory as Kn, TelemetryScope as Kr, NodeKind as Kt, PortsEmission as L, instancePerContainerCachingFactory as La, CredentialUnboundError as Li, BinaryStorageReadResult as Ln, ExecutionTelemetry as Lr, MutableRunData as Lt, NoOpCostTrackingTelemetry as M, delay as Ma, CredentialSetupStatus as Mi, NoneRetryPolicySpec as Mn, WebhookTriggerMatcher as Mr, JsonArray as Mt, ExpRetryPolicy as N, inject as Na, CredentialType as Ni, RetryPolicySpec as Nn, WebhookTriggerResolution as Nr, JsonNonArray as Nt, StepSequenceOutput as O, Lifecycle as Oa, CredentialRequirement as Oi, triggerNodeOutputType as On, HttpMethod as Or, ExecutionMode as Ot, RetryPolicy as P, injectAll as Pa, CredentialTypeDefinition as Pi, BinaryAttachmentCreateRequest as Pn, WebhookTriggerRoutingDiagnostics as Pr, JsonObject as Pt, RunIterationDto as Q, TestTriggerSetupContext as Qa, PendingNodeExecution as Qi, NodeActivationRequest as Qn, CodemationTelemetryAttributeNames as Qr, ParentExecutionRef as Qt, emitPorts as R, predicateAwareClassFactory as Ra, OAuth2ProviderFromPublicConfig as Ri, BinaryStorageStatResult as Rn, ExecutionTelemetryFactory as Rr, NodeActivationId as Rt, AnyRunnableNodeConfig as S, WorkflowExecutionPruneRepository as Sa, CredentialInstanceId as Si, WorkflowStoragePolicyResolver as Sn, WorkflowNodeInstanceFactory as Sr, DEFAULT_ASSERTION_PASS_THRESHOLD as St, BranchMoreArgs as T, DependencyContainer$1 as Ta, CredentialMaterialSourceKind as Ti, nodeRef as Tn, WorkflowRunnerService as Tr, BinaryAttachment as Tt, ExecutionInstanceDto as U, EngineExecutionLimitsPolicy as Ua, ConnectionInvocationId as Ui, ExecutableTriggerNode as Un, TelemetryAttributes as Ur, NodeErrorHandlerSpec as Ut, BatchId as V, CoreTokens as Va, PollingTriggerDedupWindow as Vi, EngineDeps as Vn, TelemetryArtifactReference as Vr, NodeErrorHandler as Vt, ExecutionInstanceId as W, EngineExecutionLimitsPolicyConfig as Wa, ConnectionInvocationRecord as Wi, ExecutionBinaryService as Wn, TelemetryChildSpanStart as Wr, NodeIdRef as Wt, PersistedRunWorkItemKind as X, TestSuiteRunId as Xa, NodeExecutionStatus as Xi, NodeActivationContinuation as Xn, CodemationTelemetryMetricNames as Xr, NodeSchedulerDecision as Xt, PersistedRunSlotProjectionRecord as Y, TestSuiteRunStatus as Ya, NodeExecutionSnapshot as Yi, MultiInputNode as Yn, TelemetrySpanScope as Yr, NodeRef as Yt, PersistedRunWorkItemRecord as Z, TestTriggerNodeConfig as Za, NodeInputsByPort as Zi, NodeActivationReceipt as Zn, GenAiTelemetryAttributeNames as Zr, PairedItemRef as Zt, NodeIdSlugifier as _, RunStopCondition as _a, CredentialBindingKey as _i, WorkflowNodeConnection as _n, TriggerRuntimeDiagnostics as _r, itemExpr as _t, RunPolicySnapshotFactory as a, PersistedWorkflowSnapshotNode as aa, CostTrackingPriceQuote as ai, RunnableNodeInputJson as an, NodeExecutionScheduler as ar, WorkflowRunDetailDto as at, ChainCursor as b, WebhookRunResult as ba, CredentialHealthStatus as bi, WorkflowStoragePolicyDecisionArgs as bn, TriggerSetupStateRepository as br, AssertionResult as bt, RunTerminalPersistenceCoordinator as c, RunCompletionNotifier as ca, CostTrackingTelemetryFactory as ci, TriggerNodeOutputJson as cn, NodeResolver as cr, Expr as ct, DefaultWorkflowGraphFactory as d, RunExecutionOptions as da, CollectionStore as di, WorkflowDefinition as dn, PreparedNodeActivationDispatch as dr, ItemExpr as dt, PersistedMutableRunState as ea, NoOpExecutionTelemetry as ei, RunDataFactory as en, NodeConnectionName as eo, NodeActivationScheduler as er, RunSlotProjectionState as et, WorkflowExecutableNodeClassifierFactory as f, RunPruneCandidate as fa, CollectionsContext as fi, WorkflowErrorContext as fn, RunnableNode as fr, ItemExprArgs as ft, ConnectionInvocationIdFactory as g, RunStatus as ga, CredentialBinding as gi, WorkflowGraphFactory as gn, TriggerNode as gr, isItemExpr as gt, ConnectionNodeIdFactory as h, RunStateResetRequest as ha, CredentialAuthDefinition as hi, WorkflowGraph as hn, TriggerCleanupHandle as hr, ItemExprResolvedContext as ht, WorkflowSnapshotCodec as i, PersistedWorkflowSnapshot as ia, CostTrackingComponent as ii, RunnableNodeConfig as in, WorkflowId as io, NodeExecutionRequestHandler as ir, WorkflowDetailSelectionState as it, NoOpCostTrackingTelemetryFactory as j, container$1 as ja, CredentialSessionService as ji, FixedRetryPolicySpec as jn, WebhookInvocationMatch as jr, Items as jt, ValidStepSequence as k, RegistrationOptions as ka, CredentialSessionFactory as ki, triggerNodeSetupStateType as kn, TriggerInstanceId as kr, Item as kt, WorkflowStoragePolicyEvaluator as l, RunCurrentState as la, CostTrackingTelemetryMetricNames as li, TriggerNodeSetupState as ln, PersistedTriggerSetupState as lr, Param as lt, NodeIterationIdFactory as m, RunResult as ma, CredentialAdvancedSectionPresentation as mi, WorkflowErrorHandlerSpec as mn, TestableTriggerNode as mr, ItemExprContext as mt, InMemoryLiveWorkflowRepository as n, PersistedRunSchedulingState as na, NoOpTelemetrySpanScope as ni, RunId as nn, OutputPortKey as no, NodeExecutionContext as nr, WorkItemId as nt, EngineExecutionLimitsPolicyFactory as o, PersistedWorkflowTokenRegistryLike as oa, CostTrackingTelemetry as oi, RunnableNodeOutputJson as on, NodeExecutionStatePublisher as or, CostCatalog as ot, WorkflowExecutableNodeClassifier as p, RunQueueEntry as pa, AnyCredentialType as pi, WorkflowErrorHandler as pn, RunnableNodeExecuteArgs as pr, ItemExprCallback as pt, PersistedExecutionInstanceKind as q, RunEventSubscription as qa, ExecutionFrontierPlan as qi, ItemNode as qn, TelemetrySpanEnd as qr, NodeOffloadPolicy as qt, EngineWorkflowRunnerService as r, PersistedRunState as ra, NoOpTelemetryArtifactReference as ri, RunIdFactory as rn, PersistedTokenId as ro, NodeExecutionRequest as rr, WorkItemStatus as rt, WorkflowPolicyErrorServices as s, PinnedNodeOutputsByPort as sa, CostTrackingTelemetryAttributeNames as si, TriggerNodeConfig as sn, NodeExecutor as sr, CostCatalogEntry as st, RunIntentService as t, PersistedRunControlState as ta, NoOpNodeExecutionTelemetry as ti, RunDataSnapshot as tn, NodeId as to, NodeBinaryAttachmentService as tr, SlotExecutionStateDto as tt, Engine as u, RunEventPublisherDeps as ua, CostTrackingUsageRecord as ui, UpstreamRefPlaceholder as un, PollingTriggerHandle as ur, ParamDeep as ut, WorkflowDefinitionError as v, RunSummary as va, CredentialFieldSchema as vi, WorkflowPolicyRuntimeDefaults as vn, TriggerSetupContext as vr, resolveItemExprsForExecution as vt, BooleanWhenOverloads as w, Container as wa, CredentialJsonRecord as wi, branchRef as wn, WorkflowRunnerResolver as wr, ActivationIdFactory as wt, WhenBuilder as x, WorkflowExecutionListingRepository as xa, CredentialHealthTester as xi, WorkflowStoragePolicyMode as xn, TriggerTestItemsContext as xr, AssertionResultProvenance as xt, WorkflowBuilder as y, RunTestContext as ya, CredentialHealth as yi, WorkflowPrunePolicySpec as yn, TriggerSetupStateFor as yr, resolveItemExprsInUnknown as yt, isPortsEmission as z, registry as za, NoOpPollingTriggerLogger as zi, BinaryStorageWriteRequest as zn, NodeExecutionTelemetry as zr, NodeConfigBase as zt };
2642
+ //# sourceMappingURL=RunIntentService-BE9CAkbf.d.ts.map