@codemation/core 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/{EngineRuntimeRegistration.types-Bjeo7Sfq.d.ts → EngineRuntimeRegistration.types-DU6MsjU9.d.ts} +2 -2
  3. package/dist/{EngineWorkflowRunnerService-Dd4yD31l.d.cts → EngineWorkflowRunnerService-BBkL4VQF.d.cts} +2 -2
  4. package/dist/{InMemoryRunDataFactory-OUzDmAHt.d.cts → InMemoryRunDataFactory-CsYEMJK2.d.cts} +11 -3
  5. package/dist/{RunIntentService-Bkg4oYrM.d.cts → RunIntentService-BvlTpmEb.d.cts} +224 -237
  6. package/dist/{RunIntentService-BAKikN8h.d.ts → RunIntentService-zbTchO9T.d.ts} +305 -259
  7. package/dist/bootstrap/index.cjs +2 -2
  8. package/dist/bootstrap/index.d.cts +19 -7
  9. package/dist/bootstrap/index.d.ts +3 -3
  10. package/dist/bootstrap/index.js +2 -2
  11. package/dist/{bootstrap-DwS5S7s9.cjs → bootstrap-DHH2uo-W.cjs} +4 -2
  12. package/dist/bootstrap-DHH2uo-W.cjs.map +1 -0
  13. package/dist/{bootstrap-BD6CobHl.js → bootstrap-DbUlOl11.js} +4 -2
  14. package/dist/bootstrap-DbUlOl11.js.map +1 -0
  15. package/dist/{index-uCm9l0nw.d.ts → index-CUt13qs1.d.ts} +62 -34
  16. package/dist/index.cjs +22 -15
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +108 -42
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +13 -16
  21. package/dist/index.js.map +1 -1
  22. package/dist/{runtime-Cy-3FTI_.js → runtime-BdH94eBR.js} +502 -123
  23. package/dist/runtime-BdH94eBR.js.map +1 -0
  24. package/dist/{runtime-ZJUpWmPH.cjs → runtime-feFn8OmG.cjs} +561 -122
  25. package/dist/runtime-feFn8OmG.cjs.map +1 -0
  26. package/dist/testing.cjs +40 -36
  27. package/dist/testing.cjs.map +1 -1
  28. package/dist/testing.d.cts +17 -26
  29. package/dist/testing.d.ts +17 -26
  30. package/dist/testing.js +40 -36
  31. package/dist/testing.js.map +1 -1
  32. package/dist/{workflowActivationPolicy-BzyzXLa_.cjs → workflowActivationPolicy-6V3OJD3N.cjs} +65 -19
  33. package/dist/workflowActivationPolicy-6V3OJD3N.cjs.map +1 -0
  34. package/dist/{workflowActivationPolicy-B8HzTk3o.js → workflowActivationPolicy-Td9HTOuD.js} +65 -19
  35. package/dist/workflowActivationPolicy-Td9HTOuD.js.map +1 -0
  36. package/package.json +2 -1
  37. package/src/ai/AgentConfigInspectorFactory.ts +4 -0
  38. package/src/ai/AgentMessageConfigNormalizerFactory.ts +7 -0
  39. package/src/ai/AgentToolFactory.ts +2 -2
  40. package/src/ai/AiHost.ts +11 -10
  41. package/src/ai/NodeBackedToolConfig.ts +1 -1
  42. package/src/authoring/defineNode.types.ts +48 -72
  43. package/src/authoring/index.ts +1 -1
  44. package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +8 -0
  45. package/src/contracts/emitPorts.ts +27 -0
  46. package/src/contracts/index.ts +3 -0
  47. package/src/contracts/itemMeta.ts +11 -0
  48. package/src/contracts/itemValue.ts +147 -0
  49. package/src/contracts/runtimeTypes.ts +39 -22
  50. package/src/contracts/workflowTypes.ts +26 -56
  51. package/src/execution/FanInMergeByOriginMerger.ts +67 -0
  52. package/src/execution/ItemValueResolver.ts +27 -0
  53. package/src/execution/NodeActivationRequestComposer.ts +25 -0
  54. package/src/execution/NodeActivationRequestInputPreparer.ts +57 -25
  55. package/src/execution/NodeExecutor.ts +199 -30
  56. package/src/execution/NodeOutputNormalizer.ts +90 -0
  57. package/src/execution/index.ts +2 -0
  58. package/src/index.ts +2 -0
  59. package/src/orchestration/NodeExecutionRequestHandlerService.ts +39 -18
  60. package/src/orchestration/RunContinuationService.ts +11 -17
  61. package/src/planning/CurrentStateFrontierPlanner.ts +20 -20
  62. package/src/planning/RunQueuePlanner.ts +56 -19
  63. package/src/planning/WorkflowTopologyPlanner.ts +57 -33
  64. package/src/testing/ItemHarnessNode.ts +4 -10
  65. package/src/testing/ItemHarnessNodeConfig.ts +7 -16
  66. package/src/testing/RegistrarEngineTestKitFactory.ts +2 -0
  67. package/src/testing/SubWorkflowRunnerTestNode.ts +28 -43
  68. package/src/testing/SwitchHarnessNode.ts +54 -0
  69. package/src/types/index.ts +3 -0
  70. package/src/workflow/dsl/ChainCursorResolver.ts +68 -23
  71. package/src/workflow/dsl/WorkflowBuilder.ts +3 -5
  72. package/src/workflow/dsl/workflowBuilderTypes.ts +5 -8
  73. package/src/workflowSnapshots/MissingRuntimeNode.ts +4 -4
  74. package/src/workflowSnapshots/MissingRuntimeNodeConfig.ts +2 -2
  75. package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +16 -7
  76. package/dist/bootstrap-BD6CobHl.js.map +0 -1
  77. package/dist/bootstrap-DwS5S7s9.cjs.map +0 -1
  78. package/dist/runtime-Cy-3FTI_.js.map +0 -1
  79. package/dist/runtime-ZJUpWmPH.cjs.map +0 -1
  80. package/dist/workflowActivationPolicy-B8HzTk3o.js.map +0 -1
  81. package/dist/workflowActivationPolicy-BzyzXLa_.cjs.map +0 -1
@@ -3,62 +3,6 @@ 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/retryPolicySpec.types.d.ts
7
- /**
8
- * In-process retry policy for runnable nodes. Serialized configs use the same
9
- * `kind` discriminator (`JSON.stringify` / persisted workflows).
10
- *
11
- * `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
12
- */
13
- type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
14
- interface NoneRetryPolicySpec {
15
- readonly kind: "none";
16
- }
17
- interface FixedRetryPolicySpec {
18
- readonly kind: "fixed";
19
- /** Total attempts including the first execution. Must be >= 1. */
20
- readonly maxAttempts: number;
21
- readonly delayMs: number;
22
- }
23
- interface ExponentialRetryPolicySpec {
24
- readonly kind: "exponential";
25
- /** Total attempts including the first execution. Must be >= 1. */
26
- readonly maxAttempts: number;
27
- readonly initialDelayMs: number;
28
- readonly multiplier: number;
29
- readonly maxDelayMs?: number;
30
- /** When true, each delay is multiplied by a random factor in [1, 1.2). */
31
- readonly jitter?: boolean;
32
- }
33
- //#endregion
34
- //#region src/contracts/NoRetryPolicy.d.ts
35
- declare class NoRetryPolicy implements NoneRetryPolicySpec {
36
- readonly kind: "none";
37
- }
38
- //#endregion
39
- //#region src/contracts/RetryPolicy.d.ts
40
- declare class RetryPolicy implements FixedRetryPolicySpec {
41
- readonly maxAttempts: number;
42
- readonly delayMs: number;
43
- readonly kind: "fixed";
44
- constructor(maxAttempts: number, delayMs: number);
45
- /** Default for HTTP-style transient failures: 3 tries, 1s between attempts. */
46
- static readonly defaultForHttp: FixedRetryPolicySpec;
47
- /** Default for LLM / agent calls: 3 tries, 2s fixed backoff. */
48
- static readonly defaultForAiAgent: FixedRetryPolicySpec;
49
- }
50
- //#endregion
51
- //#region src/contracts/ExpRetryPolicy.d.ts
52
- declare class ExpRetryPolicy implements ExponentialRetryPolicySpec {
53
- readonly maxAttempts: number;
54
- readonly initialDelayMs: number;
55
- readonly multiplier: number;
56
- readonly maxDelayMs?: number | undefined;
57
- readonly jitter?: boolean | undefined;
58
- readonly kind: "exponential";
59
- constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined);
60
- }
61
- //#endregion
62
6
  //#region src/events/runEvents.d.ts
63
7
  type RunEvent = Readonly<{
64
8
  kind: "runCreated";
@@ -160,6 +104,149 @@ declare const CoreTokens: {
160
104
  readonly WorkflowActivationPolicy: TypeToken<WorkflowActivationPolicy>;
161
105
  };
162
106
  //#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
+ placeholder?: string;
120
+ helpText?: string;
121
+ /** When set, host resolves this field from process.env at runtime; env wins over stored values. */
122
+ envVarName?: string;
123
+ /**
124
+ * When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
125
+ * pattern or documentation URL). Do not use for secret values.
126
+ */
127
+ copyValue?: string;
128
+ /** Accessible label for the copy control (default: Copy). */
129
+ copyButtonLabel?: string;
130
+ }>;
131
+ type CredentialRequirement = Readonly<{
132
+ slotKey: string;
133
+ label: string;
134
+ acceptedTypes: ReadonlyArray<CredentialTypeId>;
135
+ optional?: true;
136
+ helpText?: string;
137
+ helpUrl?: string;
138
+ }>;
139
+ type CredentialBindingKey = Readonly<{
140
+ workflowId: WorkflowId;
141
+ nodeId: NodeId;
142
+ slotKey: string;
143
+ }>;
144
+ type CredentialBinding = Readonly<{
145
+ key: CredentialBindingKey;
146
+ instanceId: CredentialInstanceId;
147
+ updatedAt: string;
148
+ }>;
149
+ type CredentialHealth = Readonly<{
150
+ status: CredentialHealthStatus;
151
+ message?: string;
152
+ testedAt?: string;
153
+ expiresAt?: string;
154
+ details?: Readonly<Record<string, unknown>>;
155
+ }>;
156
+ type OAuth2ProviderFromPublicConfig = Readonly<{
157
+ authorizeUrlFieldKey: string;
158
+ tokenUrlFieldKey: string;
159
+ userInfoUrlFieldKey?: string;
160
+ }>;
161
+ type CredentialOAuth2AuthDefinition = Readonly<{
162
+ kind: "oauth2";
163
+ providerId: string;
164
+ scopes: ReadonlyArray<string>;
165
+ clientIdFieldKey?: string;
166
+ clientSecretFieldKey?: string;
167
+ } | {
168
+ kind: "oauth2";
169
+ providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
170
+ scopes: ReadonlyArray<string>;
171
+ clientIdFieldKey?: string;
172
+ clientSecretFieldKey?: string;
173
+ }>;
174
+ type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
175
+ type CredentialTypeDefinition = Readonly<{
176
+ typeId: CredentialTypeId;
177
+ displayName: string;
178
+ description?: string;
179
+ publicFields?: ReadonlyArray<CredentialFieldSchema>;
180
+ secretFields?: ReadonlyArray<CredentialFieldSchema>;
181
+ supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
182
+ auth?: CredentialAuthDefinition;
183
+ }>;
184
+ /**
185
+ * JSON-shaped credential field bag (public config, resolved secret material, etc.).
186
+ */
187
+ type CredentialJsonRecord = Readonly<Record<string, unknown>>;
188
+ /**
189
+ * Persisted credential instance with typed `publicConfig`.
190
+ * Hosts may specialize `secretRef` with a stricter union while remaining
191
+ * assignable here for session/test callbacks.
192
+ */
193
+ type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
194
+ instanceId: CredentialInstanceId;
195
+ typeId: CredentialTypeId;
196
+ displayName: string;
197
+ sourceKind: CredentialMaterialSourceKind;
198
+ publicConfig: TPublicConfig;
199
+ secretRef: CredentialJsonRecord;
200
+ tags: ReadonlyArray<string>;
201
+ setupStatus: CredentialSetupStatus;
202
+ createdAt: string;
203
+ updatedAt: string;
204
+ }>;
205
+ /**
206
+ * Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
207
+ * Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
208
+ * against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
209
+ */
210
+ type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
211
+ instance: CredentialInstanceRecord<TPublicConfig>;
212
+ material: TMaterial;
213
+ publicConfig: TPublicConfig;
214
+ }>;
215
+ type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
216
+ type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
217
+ /**
218
+ * Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
219
+ * Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
220
+ */
221
+ type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
222
+ definition: CredentialTypeDefinition;
223
+ createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
224
+ test: CredentialHealthTester<TPublicConfig, TMaterial>;
225
+ }>;
226
+ /**
227
+ * Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
228
+ * and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
229
+ * Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
230
+ */
231
+ type AnyCredentialType = CredentialType<any, any, unknown>;
232
+ interface CredentialSessionService {
233
+ getSession<TSession = unknown>(args: Readonly<{
234
+ workflowId: WorkflowId;
235
+ nodeId: NodeId;
236
+ slotKey: string;
237
+ }>): Promise<TSession>;
238
+ }
239
+ interface CredentialTypeRegistry {
240
+ listTypes(): ReadonlyArray<CredentialTypeDefinition>;
241
+ getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
242
+ }
243
+ declare class CredentialUnboundError extends Error {
244
+ readonly bindingKey: CredentialBindingKey;
245
+ readonly acceptedTypes: ReadonlyArray<CredentialTypeId>;
246
+ constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray<CredentialTypeId>);
247
+ private static createMessage;
248
+ }
249
+ //#endregion
163
250
  //#region src/contracts/runTypes.d.ts
164
251
  interface RunExecutionOptions {
165
252
  /** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
@@ -679,31 +766,41 @@ interface EngineHost {
679
766
  credentialSessions: CredentialSessionService;
680
767
  workflows?: WorkflowRunnerService;
681
768
  }
682
- interface Node<TConfig extends NodeConfigBase = NodeConfigBase> {
683
- kind: "node";
684
- outputPorts: ReadonlyArray<OutputPortKey>;
685
- execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
686
- }
687
769
  /**
688
- * Single-input runnable node with per-item execution on `main` only (1→1 default).
689
- * Engine applies {@link RunnableNodeConfig.mapInput} (if any) + `inputSchema.parse` before `executeOne`.
770
+ * Per-item runnable node: return JSON, an array to fan-out on `main`, or {@link emitPorts} for multi-port emission.
771
+ * Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input` (wire `item.json` is unchanged).
690
772
  */
691
- interface ItemNode<TConfig extends NodeConfigBase = NodeConfigBase, TInputJson$1 = unknown, TOutputJson$1 = unknown> {
773
+ interface RunnableNodeExecuteArgs<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown> {
774
+ readonly input: TInputJson$1;
775
+ readonly item: Item;
776
+ readonly itemIndex: number;
777
+ readonly items: Items;
778
+ readonly ctx: NodeExecutionContext<TConfig>;
779
+ }
780
+ interface RunnableNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, _TOutputJson = unknown> {
692
781
  readonly kind: "node";
693
- readonly outputPorts: readonly ["main"];
782
+ /**
783
+ * Declared output ports (e.g. `["main"]`).
784
+ *
785
+ * Prefer describing dynamic router ports (Switch) and fixed multi-ports (If true/false)
786
+ * via {@link NodeConfigBase.declaredOutputPorts}. Engine defaults to `["main"]` when omitted.
787
+ */
788
+ readonly outputPorts?: ReadonlyArray<OutputPortKey>;
694
789
  /** When omitted, engine uses {@link RunnableNodeConfig.inputSchema} or `z.unknown()`. */
695
790
  readonly inputSchema?: ZodType<TInputJson$1>;
696
- executeOne(args: Readonly<{
697
- input: TInputJson$1;
698
- item: Item;
699
- itemIndex: number;
700
- items: Items;
701
- ctx: NodeExecutionContext<TConfig>;
702
- }>): Promise<TOutputJson$1> | TOutputJson$1;
791
+ execute(args: RunnableNodeExecuteArgs<TConfig, TInputJson$1>): Promise<unknown> | unknown;
703
792
  }
793
+ /** @deprecated Use {@link RunnableNode} */
794
+ type ItemNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, TOutputJson$1 = unknown> = RunnableNode<TConfig, TInputJson$1, TOutputJson$1>;
704
795
  interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
705
796
  kind: "node";
706
- outputPorts: ReadonlyArray<OutputPortKey>;
797
+ /**
798
+ * Declared output ports (typically `["main"]`).
799
+ *
800
+ * Prefer describing ports for authoring/canvas via {@link NodeConfigBase.declaredOutputPorts}.
801
+ * Engine defaults to `["main"]` when omitted.
802
+ */
803
+ outputPorts?: ReadonlyArray<OutputPortKey>;
707
804
  executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
708
805
  }
709
806
  type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;
@@ -833,6 +930,34 @@ interface EngineDeps {
833
930
  triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics;
834
931
  }
835
932
  //#endregion
933
+ //#region src/contracts/retryPolicySpec.types.d.ts
934
+ /**
935
+ * In-process retry policy for runnable nodes. Serialized configs use the same
936
+ * `kind` discriminator (`JSON.stringify` / persisted workflows).
937
+ *
938
+ * `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
939
+ */
940
+ type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
941
+ interface NoneRetryPolicySpec {
942
+ readonly kind: "none";
943
+ }
944
+ interface FixedRetryPolicySpec {
945
+ readonly kind: "fixed";
946
+ /** Total attempts including the first execution. Must be >= 1. */
947
+ readonly maxAttempts: number;
948
+ readonly delayMs: number;
949
+ }
950
+ interface ExponentialRetryPolicySpec {
951
+ readonly kind: "exponential";
952
+ /** Total attempts including the first execution. Must be >= 1. */
953
+ readonly maxAttempts: number;
954
+ readonly initialDelayMs: number;
955
+ readonly multiplier: number;
956
+ readonly maxDelayMs?: number;
957
+ /** When true, each delay is multiplied by a random factor in [1, 1.2). */
958
+ readonly jitter?: boolean;
959
+ }
960
+ //#endregion
836
961
  //#region src/contracts/workflowTypes.d.ts
837
962
  type WorkflowId = string;
838
963
  type NodeId = string;
@@ -846,6 +971,8 @@ interface JsonObject {
846
971
  }
847
972
  type JsonValue = JsonPrimitive | JsonObject | JsonArray;
848
973
  type JsonArray = ReadonlyArray<JsonValue>;
974
+ /** JSON value that is not a top-level array (nested arrays inside objects are allowed). */
975
+ type JsonNonArray = JsonPrimitive | JsonObject;
849
976
  interface Edge {
850
977
  from: {
851
978
  nodeId: NodeId;
@@ -915,65 +1042,42 @@ interface NodeConfigBase {
915
1042
  * main batches skip downstream execution and propagate the empty path.
916
1043
  */
917
1044
  readonly continueWhenEmptyOutput?: boolean;
1045
+ /**
1046
+ * Declared I/O port names for canvas authoring (unioned with ports inferred from edges).
1047
+ * Use for dynamic routers (Switch) and future error ports.
1048
+ */
1049
+ readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
1050
+ readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
918
1051
  getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
919
1052
  }
920
1053
  declare const runnableNodeInputType: unique symbol;
921
1054
  declare const runnableNodeOutputType: unique symbol;
922
- /** Phantom: JSON shape on the wire from upstream before {@link RunnableNodeConfig.mapInput}. */
923
- declare const runnableNodeWireType: unique symbol;
924
1055
  declare const triggerNodeOutputType: unique symbol;
1056
+ type LineageCarryPolicy = "emitOnly" | "carryThrough";
925
1057
  /**
926
- * Read-only execution slice passed to {@link RunnableNodeConfig.mapInput} (aligned with the engine’s
927
- * node execution context for `runId`, `data`, etc.). Use **`ctx.data`** to read **any completed** upstream
928
- * node’s outputs in this run (e.g. `ctx.data.getOutputItems(nodeIdA, "main")` while mapping at D), not only
929
- * the immediate predecessor’s {@link ItemInputMapperArgs.item}.
930
- */
931
- interface ItemInputMapperContext {
932
- readonly runId: RunId;
933
- readonly workflowId: WorkflowId;
934
- /** Node whose activation is being prepared (the consumer of `mapInput`). */
935
- readonly nodeId: NodeId;
936
- readonly activationId: NodeActivationId;
937
- readonly parent?: ParentExecutionRef;
938
- readonly data: RunDataSnapshot;
939
- }
940
- /**
941
- * Arguments for optional per-item input mapping applied by the engine before Zod validation.
942
- */
943
- interface ItemInputMapperArgs<TWireJson$1 = unknown> {
944
- readonly item: Item<TWireJson$1>;
945
- readonly itemIndex: number;
946
- readonly items: Items<TWireJson$1>;
947
- readonly ctx: ItemInputMapperContext;
948
- }
949
- /**
950
- * Per-item mapper before Zod validation. Uses a **bivariant** method signature so concrete
951
- * `ItemInputMapper<SpecificWire, TIn>` remains assignable to `RunnableNodeConfig` fields typed as
952
- * `ItemInputMapper<unknown, unknown>` (same pattern as React-style callbacks).
1058
+ * Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).
1059
+ * **`TOutputJson`** is emitted `item.json` on outputs.
953
1060
  */
954
- type ItemInputMapper<TWireJson$1 = unknown, TInputJson$1 = unknown> = {
955
- bivarianceHack(args: ItemInputMapperArgs<TWireJson$1>): TInputJson$1 | Promise<TInputJson$1>;
956
- }["bivarianceHack"];
957
- /**
958
- * Runnable node: **`TInputJson`** is the payload after `mapInput` (if any) + Zod validation — what {@link ItemNode}
959
- * `executeOne` receives. **`TOutputJson`** is emitted `item.json` on outputs. **`TWireJson`** is `item.json` from
960
- * upstream **before** `mapInput`; it defaults to **`TInputJson`** when there is no mapper or wire differs from execute input.
961
- */
962
- interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown, TWireJson$1 = TInputJson$1> extends NodeConfigBase {
1061
+ interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
963
1062
  readonly kind: "node";
964
1063
  readonly [runnableNodeInputType]?: TInputJson$1;
965
1064
  readonly [runnableNodeOutputType]?: TOutputJson$1;
966
- readonly [runnableNodeWireType]?: TWireJson$1;
967
1065
  /**
968
- * Optional Zod input contract for {@link ItemNode} when not set on the node class.
1066
+ * Optional Zod input contract for {@link RunnableNode} when not set on the node class.
969
1067
  * Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
970
1068
  */
971
1069
  readonly inputSchema?: ZodType<TInputJson$1>;
972
1070
  /**
973
- * Optional per-item mapper: engine applies it before validating against the node’s `inputSchema`.
974
- * When omitted, the engine validates `item.json` directly.
1071
+ * Overrides default lineage propagation for `execute` outputs (binary/meta/paired).
1072
+ * Routers with multiple {@link RunnableNode#outputPorts} default to **`carryThrough`**; others default to **`emitOnly`**.
1073
+ */
1074
+ readonly lineageCarry?: LineageCarryPolicy;
1075
+ /**
1076
+ * When an activation receives **zero** input items, the engine normally runs `execute` zero times.
1077
+ * Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).
1078
+ * Used by batch-style callback nodes (built-in `Callback`) so `callback([], ctx)` still runs.
975
1079
  */
976
- readonly mapInput?: ItemInputMapper<TWireJson$1, TInputJson$1>;
1080
+ readonly emptyBatchExecution?: "skip" | "runOnce";
977
1081
  }
978
1082
  declare const triggerNodeSetupStateType: unique symbol;
979
1083
  interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonValue | undefined = undefined> extends NodeConfigBase {
@@ -981,9 +1085,8 @@ interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonV
981
1085
  readonly [triggerNodeOutputType]?: TOutputJson$1;
982
1086
  readonly [triggerNodeSetupStateType]?: TSetupState$1;
983
1087
  }
984
- type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any, any> ? TInputJson : never;
985
- type RunnableNodeWireJson<TConfig extends RunnableNodeConfig<any, any, any>> = TConfig extends RunnableNodeConfig<any, any, infer TWireJson> ? TWireJson : never;
986
- type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson, any> ? TOutputJson : never;
1088
+ type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
1089
+ type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;
987
1090
  type TriggerNodeOutputJson<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<infer TOutputJson, any> ? TOutputJson : never;
988
1091
  type TriggerNodeSetupState<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<any, infer TSetupState> ? TSetupState : never;
989
1092
  interface NodeDefinition {
@@ -1127,147 +1230,85 @@ interface WorkflowPolicyRuntimeDefaults {
1127
1230
  readonly storagePolicy?: WorkflowStoragePolicyMode;
1128
1231
  }
1129
1232
  //#endregion
1130
- //#region src/contracts/credentialTypes.d.ts
1131
- type CredentialTypeId = string;
1132
- type CredentialInstanceId = string;
1133
- type CredentialMaterialSourceKind = "db" | "env" | "code";
1134
- type CredentialSetupStatus = "draft" | "ready";
1135
- type CredentialHealthStatus = "unknown" | "healthy" | "failing";
1136
- type CredentialFieldSchema = Readonly<{
1137
- key: string;
1138
- label: string;
1139
- type: "string" | "password" | "textarea" | "json" | "boolean";
1140
- required?: true;
1141
- order?: number;
1142
- placeholder?: string;
1143
- helpText?: string;
1144
- /** When set, host resolves this field from process.env at runtime; env wins over stored values. */
1145
- envVarName?: string;
1146
- /**
1147
- * When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
1148
- * pattern or documentation URL). Do not use for secret values.
1149
- */
1150
- copyValue?: string;
1151
- /** Accessible label for the copy control (default: Copy). */
1152
- copyButtonLabel?: string;
1233
+ //#region src/contracts/emitPorts.d.ts
1234
+ declare const EMIT_PORTS_BRAND: unique symbol;
1235
+ type PortsEmission = Readonly<{
1236
+ readonly [EMIT_PORTS_BRAND]: true;
1237
+ readonly ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>;
1153
1238
  }>;
1154
- type CredentialRequirement = Readonly<{
1155
- slotKey: string;
1156
- label: string;
1157
- acceptedTypes: ReadonlyArray<CredentialTypeId>;
1158
- optional?: true;
1159
- helpText?: string;
1160
- helpUrl?: string;
1239
+ declare function emitPorts(ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>): PortsEmission;
1240
+ declare function isPortsEmission(value: unknown): value is PortsEmission;
1241
+ declare function isUnbrandedPortsEmissionShape(value: unknown): value is Readonly<{
1242
+ ports: unknown;
1161
1243
  }>;
1162
- type CredentialBindingKey = Readonly<{
1244
+ //#endregion
1245
+ //#region src/contracts/itemMeta.d.ts
1246
+ /**
1247
+ * Reads `meta._cm.originIndex` when present (used for fan-in merge-by-origin and Merge routing).
1248
+ */
1249
+ declare function getOriginIndexFromItem(item: Item): number | undefined;
1250
+ //#endregion
1251
+ //#region src/contracts/itemValue.d.ts
1252
+ declare const ITEM_VALUE_BRAND: unique symbol;
1253
+ type ItemValueResolvedContext = Readonly<{
1254
+ runId: RunId;
1163
1255
  workflowId: WorkflowId;
1164
1256
  nodeId: NodeId;
1165
- slotKey: string;
1166
- }>;
1167
- type CredentialBinding = Readonly<{
1168
- key: CredentialBindingKey;
1169
- instanceId: CredentialInstanceId;
1170
- updatedAt: string;
1171
- }>;
1172
- type CredentialHealth = Readonly<{
1173
- status: CredentialHealthStatus;
1174
- message?: string;
1175
- testedAt?: string;
1176
- expiresAt?: string;
1177
- details?: Readonly<Record<string, unknown>>;
1178
- }>;
1179
- type OAuth2ProviderFromPublicConfig = Readonly<{
1180
- authorizeUrlFieldKey: string;
1181
- tokenUrlFieldKey: string;
1182
- userInfoUrlFieldKey?: string;
1183
- }>;
1184
- type CredentialOAuth2AuthDefinition = Readonly<{
1185
- kind: "oauth2";
1186
- providerId: string;
1187
- scopes: ReadonlyArray<string>;
1188
- clientIdFieldKey?: string;
1189
- clientSecretFieldKey?: string;
1190
- } | {
1191
- kind: "oauth2";
1192
- providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
1193
- scopes: ReadonlyArray<string>;
1194
- clientIdFieldKey?: string;
1195
- clientSecretFieldKey?: string;
1196
- }>;
1197
- type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
1198
- type CredentialTypeDefinition = Readonly<{
1199
- typeId: CredentialTypeId;
1200
- displayName: string;
1201
- description?: string;
1202
- publicFields?: ReadonlyArray<CredentialFieldSchema>;
1203
- secretFields?: ReadonlyArray<CredentialFieldSchema>;
1204
- supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
1205
- auth?: CredentialAuthDefinition;
1257
+ activationId: NodeActivationId;
1258
+ data: RunDataSnapshot;
1206
1259
  }>;
1207
1260
  /**
1208
- * JSON-shaped credential field bag (public config, resolved secret material, etc.).
1209
- */
1210
- type CredentialJsonRecord = Readonly<Record<string, unknown>>;
1211
- /**
1212
- * Persisted credential instance with typed `publicConfig`.
1213
- * Hosts may specialize `secretRef` with a stricter union while remaining
1214
- * assignable here for session/test callbacks.
1261
+ * Context aligned with former {@link ItemInputMapperContext} use **`data`** to read any completed upstream node.
1215
1262
  */
1216
- type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
1217
- instanceId: CredentialInstanceId;
1218
- typeId: CredentialTypeId;
1219
- displayName: string;
1220
- sourceKind: CredentialMaterialSourceKind;
1221
- publicConfig: TPublicConfig;
1222
- secretRef: CredentialJsonRecord;
1223
- tags: ReadonlyArray<string>;
1224
- setupStatus: CredentialSetupStatus;
1225
- createdAt: string;
1226
- updatedAt: string;
1263
+ type ItemValueContext = ItemValueResolvedContext;
1264
+ type ItemValueArgs<TItemJson = unknown> = Readonly<{
1265
+ item: Item<TItemJson>;
1266
+ itemIndex: number;
1267
+ items: Items<TItemJson>;
1268
+ ctx: ItemValueContext;
1227
1269
  }>;
1228
- /**
1229
- * Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
1230
- * Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
1231
- * against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
1232
- */
1233
- type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
1234
- instance: CredentialInstanceRecord<TPublicConfig>;
1235
- material: TMaterial;
1236
- publicConfig: TPublicConfig;
1270
+ type ItemValueCallback<T, TItemJson = unknown> = (args: ItemValueArgs<TItemJson>) => T | Promise<T>;
1271
+ type ItemValue<T, TItemJson = unknown> = Readonly<{
1272
+ readonly [ITEM_VALUE_BRAND]: true;
1273
+ readonly fn: ItemValueCallback<T, TItemJson>;
1237
1274
  }>;
1238
- type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
1239
- type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
1275
+ declare function itemValue<T, TItemJson = unknown>(fn: ItemValueCallback<T, TItemJson>): ItemValue<T, TItemJson>;
1276
+ declare function isItemValue<T, TItemJson = unknown>(value: unknown): value is ItemValue<T, TItemJson>;
1240
1277
  /**
1241
- * Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
1242
- * Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
1278
+ * Deep-resolves {@link itemValue} leaves. Returns a new graph (does not mutate the original config object).
1243
1279
  */
1244
- type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
1245
- definition: CredentialTypeDefinition;
1246
- createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
1247
- test: CredentialHealthTester<TPublicConfig, TMaterial>;
1248
- }>;
1280
+ declare function resolveItemValuesInUnknown(value: unknown, args: ItemValueArgs, seen?: WeakSet<object>): Promise<unknown>;
1249
1281
  /**
1250
- * Credential type with unspecified generics used for `CodemationConfig.credentialTypes`, the host registry,
1251
- * and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
1252
- * Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
1282
+ * Clones runnable config (best-effort) so per-item {@link itemValue} resolution never mutates shared instances.
1253
1283
  */
1254
- type AnyCredentialType = CredentialType<any, any, unknown>;
1255
- interface CredentialSessionService {
1256
- getSession<TSession = unknown>(args: Readonly<{
1257
- workflowId: WorkflowId;
1258
- nodeId: NodeId;
1259
- slotKey: string;
1260
- }>): Promise<TSession>;
1284
+ declare function resolveItemValuesForExecution(config: unknown, nodeCtx: NodeExecutionContext, item: Item, itemIndex: number, items: Items): Promise<unknown | undefined>;
1285
+ //#endregion
1286
+ //#region src/contracts/NoRetryPolicy.d.ts
1287
+ declare class NoRetryPolicy implements NoneRetryPolicySpec {
1288
+ readonly kind: "none";
1261
1289
  }
1262
- interface CredentialTypeRegistry {
1263
- listTypes(): ReadonlyArray<CredentialTypeDefinition>;
1264
- getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
1290
+ //#endregion
1291
+ //#region src/contracts/RetryPolicy.d.ts
1292
+ declare class RetryPolicy implements FixedRetryPolicySpec {
1293
+ readonly maxAttempts: number;
1294
+ readonly delayMs: number;
1295
+ readonly kind: "fixed";
1296
+ constructor(maxAttempts: number, delayMs: number);
1297
+ /** Default for HTTP-style transient failures: 3 tries, 1s between attempts. */
1298
+ static readonly defaultForHttp: FixedRetryPolicySpec;
1299
+ /** Default for LLM / agent calls: 3 tries, 2s fixed backoff. */
1300
+ static readonly defaultForAiAgent: FixedRetryPolicySpec;
1265
1301
  }
1266
- declare class CredentialUnboundError extends Error {
1267
- readonly bindingKey: CredentialBindingKey;
1268
- readonly acceptedTypes: ReadonlyArray<CredentialTypeId>;
1269
- constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray<CredentialTypeId>);
1270
- private static createMessage;
1302
+ //#endregion
1303
+ //#region src/contracts/ExpRetryPolicy.d.ts
1304
+ declare class ExpRetryPolicy implements ExponentialRetryPolicySpec {
1305
+ readonly maxAttempts: number;
1306
+ readonly initialDelayMs: number;
1307
+ readonly multiplier: number;
1308
+ readonly maxDelayMs?: number | undefined;
1309
+ readonly jitter?: boolean | undefined;
1310
+ readonly kind: "exponential";
1311
+ constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined);
1271
1312
  }
1272
1313
  //#endregion
1273
1314
  //#region src/contracts/executionPersistenceContracts.d.ts
@@ -1437,17 +1478,17 @@ declare class RunFinishedAtFactory {
1437
1478
  }
1438
1479
  //#endregion
1439
1480
  //#region src/workflow/dsl/workflowBuilderTypes.d.ts
1440
- type AnyRunnableNodeConfig = RunnableNodeConfig<any, any, any>;
1481
+ type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
1441
1482
  type AnyTriggerNodeConfig = TriggerNodeConfig<any>;
1442
- type ValidStepSequence<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps extends readonly [] ? readonly [] : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<infer _TIn, infer TNextJson, TCurrentJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? readonly [TFirst, ...ValidStepSequence<TNextJson, TRest>] : never : never : TSteps;
1443
- type StepSequenceOutput<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? TSteps extends readonly [] ? TCurrentJson : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<infer _TIn, infer TNextJson, TCurrentJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? StepSequenceOutput<TNextJson, TRest> : never : never : TCurrentJson : TCurrentJson;
1483
+ type ValidStepSequence<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps extends readonly [] ? readonly [] : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? readonly [TFirst, ...ValidStepSequence<TNextJson, TRest>] : never : never : TSteps;
1484
+ type StepSequenceOutput<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? TSteps extends readonly [] ? TCurrentJson : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? StepSequenceOutput<TNextJson, TRest> : never : never : TCurrentJson : TCurrentJson;
1444
1485
  type TypesMatch<TLeft, TRight> = [TLeft] extends [TRight] ? ([TRight] extends [TLeft] ? true : false) : false;
1445
1486
  type BranchOutputGuard<TCurrentJson, TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TypesMatch<StepSequenceOutput<TCurrentJson, TTrueSteps>, StepSequenceOutput<TCurrentJson, TFalseSteps>> extends true ? unknown : never;
1446
1487
  type BranchStepsArg<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps & ValidStepSequence<TCurrentJson, TSteps>;
1447
- type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<any, any, TCurrentJson>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TRestSteps & ValidStepSequence<RunnableNodeOutputJson<TFirstStep>, TRestSteps>;
1488
+ type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TRestSteps & ValidStepSequence<RunnableNodeOutputJson<TFirstStep>, TRestSteps>;
1448
1489
  type BooleanWhenOverloads<TCurrentJson, TReturn> = {
1449
1490
  <TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, steps: BranchStepsArg<TCurrentJson, TSteps>): TReturn;
1450
- <TFirstStep extends RunnableNodeConfig<any, any, TCurrentJson>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs<TCurrentJson, TFirstStep, TRestSteps>): TReturn;
1491
+ <TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs<TCurrentJson, TFirstStep, TRestSteps>): TReturn;
1451
1492
  };
1452
1493
  //#endregion
1453
1494
  //#region src/workflow/dsl/WhenBuilder.d.ts
@@ -1462,6 +1503,11 @@ declare class WhenBuilder<TCurrentJson> {
1462
1503
  }
1463
1504
  //#endregion
1464
1505
  //#region src/workflow/dsl/ChainCursorResolver.d.ts
1506
+ type ChainCursorEndpoint = Readonly<{
1507
+ node: NodeRef;
1508
+ output: OutputPortKey;
1509
+ inputPortHint?: InputPortKey;
1510
+ }>;
1465
1511
  type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> & {
1466
1512
  <TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined>(branches: Readonly<{
1467
1513
  true?: TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TTrueSteps> : never;
@@ -1470,12 +1516,14 @@ type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson,
1470
1516
  };
1471
1517
  declare class ChainCursor<TCurrentJson> {
1472
1518
  private readonly wf;
1473
- private readonly cursor;
1474
- private readonly cursorOutput;
1475
- constructor(wf: WorkflowBuilder, cursor: NodeRef, cursorOutput: OutputPortKey);
1476
- then<TInputJson$1, TOutputJson$1, TConfig extends RunnableNodeConfig<TInputJson$1, TOutputJson$1, TCurrentJson>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
1519
+ private readonly endpoints;
1520
+ constructor(wf: WorkflowBuilder, endpoints: ReadonlyArray<ChainCursorEndpoint>);
1521
+ then<TOutputJson$1, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
1522
+ thenIntoInputHints<TOutputJson$1, TConfig extends RunnableNodeConfig<any, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
1477
1523
  readonly when: ChainCursorWhenOverloads<TCurrentJson>;
1524
+ route<TNextJson$1>(branches: Readonly<Record<OutputPortKey, (branch: ChainCursor<TCurrentJson>) => ChainCursor<TNextJson$1> | undefined>>): ChainCursor<TNextJson$1>;
1478
1525
  build(): WorkflowDefinition;
1526
+ private resolveSharedInputPortHint;
1479
1527
  }
1480
1528
  //#endregion
1481
1529
  //#region src/workflow/dsl/WorkflowBuilder.d.ts
@@ -1488,9 +1536,7 @@ declare class WorkflowBuilder {
1488
1536
  constructor(meta: {
1489
1537
  id: WorkflowId;
1490
1538
  name: string;
1491
- }, options?: Readonly<{
1492
- makeMergeNode?: (name: string) => AnyRunnableNodeConfig;
1493
- }> | undefined);
1539
+ }, options?: Readonly<Record<string, never>> | undefined);
1494
1540
  private add;
1495
1541
  private connect;
1496
1542
  trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>>;
@@ -1837,5 +1883,5 @@ declare class RunIntentService {
1837
1883
  private createWebhookExecutionOptions;
1838
1884
  }
1839
1885
  //#endregion
1840
- export { CredentialHealthTester as $, NodeExecutionRequest as $n, RunExecutionOptions as $r, RunId as $t, ExecutionInstanceDto as A, EngineExecutionLimitsPolicy as Ai, BinaryBody as An, ConnectionInvocationAppendArgs as Ar, JsonPrimitive as At, RunSlotProjectionState as B, NoneRetryPolicySpec as Bi, ExecutionContext as Bn, PendingNodeExecution as Br, NodeId as Bt, BranchOutputGuard as C, instanceCachingFactory as Ci, branchRef as Cn, WebhookControlSignal as Cr, ItemBinary as Ct, RunFinishedAtFactory as D, singleton as Di, triggerNodeOutputType as Dn, WebhookTriggerRoutingDiagnostics as Dr, Items as Dt, ValidStepSequence as E, registry as Ei, runnableNodeWireType as En, WebhookTriggerResolution as Er, ItemInputMapperContext as Et, PersistedExecutionInstanceRecord as F, ExpRetryPolicy as Fi, BinaryStorageWriteResult as Fn, ExecutionFrontierPlan as Fr, NodeConnectionName as Ft, WorkflowRunDetailDto as G, Node as Gn, PersistedRunState as Gr, NodeSchedulerDecision as Gt, WorkItemId as H, ItemNode as Hn, PersistedMutableRunState as Hr, NodeOffloadPolicy as Ht, PersistedRunSlotProjectionRecord as I, RetryPolicy as Ii, EngineDeps as In, NodeExecutionError as Ir, NodeDefinition as It, CredentialBinding as J, NodeActivationRequest as Jn, PersistedWorkflowTokenRegistryLike as Jr, ParentExecutionRef as Jt, AnyCredentialType as K, NodeActivationContinuation as Kn, PersistedWorkflowSnapshot as Kr, OutputPortKey as Kt, PersistedRunWorkItemKind as L, NoRetryPolicy as Li, EngineHost as Ln, NodeExecutionSnapshot as Lr, NodeErrorHandler as Lt, ExecutionPayloadPolicyFields as M, RunEvent as Mi, BinaryStorageReadResult as Mn, ConnectionInvocationRecord as Mr, MutableRunData as Mt, PayloadStorageKind as N, RunEventBus as Ni, BinaryStorageStatResult as Nn, CurrentStateExecutionRequest as Nr, NodeActivationId as Nt, BatchId as O, CoreTokens as Oi, triggerNodeSetupStateType as On, AllWorkflowsActiveWorkflowActivationPolicy as Or, JsonArray as Ot, PersistedExecutionInstanceKind as P, RunEventSubscription as Pi, BinaryStorageWriteRequest as Pn, EngineRunCounters as Pr, NodeConfigBase as Pt, CredentialHealthStatus as Q, NodeExecutionContext as Qn, RunEventPublisherDeps as Qr, RunDataSnapshot as Qt, PersistedRunWorkItemRecord as R, ExponentialRetryPolicySpec as Ri, ExecutableTriggerNode as Rn, NodeExecutionStatus as Rr, NodeErrorHandlerArgs as Rt, BranchMoreArgs as S, injectable as Si, WorkflowStoragePolicySpec as Sn, TriggerInstanceId as Sr, Item as St, StepSequenceOutput as T, predicateAwareClassFactory as Ti, runnableNodeOutputType as Tn, WebhookTriggerMatcher as Tr, ItemInputMapperArgs as Tt, WorkItemStatus as U, LiveWorkflowRepository as Un, PersistedRunControlState as Ur, NodeOutputs as Ut, SlotExecutionStateDto as V, RetryPolicySpec as Vi, ExecutionContextFactory as Vn, PersistedMutableNodeState as Vr, NodeKind as Vt, WorkflowDetailSelectionState as W, MultiInputNode as Wn, PersistedRunSchedulingState as Wr, NodeRef as Wt, CredentialFieldSchema as X, NodeActivationScheduler as Xn, RunCompletionNotifier as Xr, PersistedTokenId as Xt, CredentialBindingKey as Y, NodeActivationRequestBase as Yn, PinnedNodeOutputsByPort as Yr, PersistedRunPolicySnapshot as Yt, CredentialHealth as Z, NodeBinaryAttachmentService as Zn, RunCurrentState as Zr, RunDataFactory as Zt, ChainCursor as _, TypeToken as _i, WorkflowPolicyRuntimeDefaults as _n, WorkflowRunnerResolver as _r, BinaryAttachment as _t, RunTerminalPersistenceCoordinator as a, RunStopCondition as ai, TriggerNodeConfig as an, PersistedTriggerSetupState as ar, CredentialRequirement as at, AnyTriggerNodeConfig as b, inject as bi, WorkflowStoragePolicyMode as bn, WorkflowSnapshotResolver as br, ExecutionMode as bt, EngineExecutionLimitsPolicyFactory as c, WorkflowExecutionListingRepository as ci, UpstreamRefPlaceholder as cn, TriggerCleanupHandle as cr, CredentialSessionService as ct, DefaultWorkflowGraphFactory as d, Container as di, WorkflowErrorHandler as dn, TriggerSetupContext as dr, CredentialTypeDefinition as dt, RunPruneCandidate as ei, RunIdFactory as en, NodeExecutionRequestHandler as er, CredentialInstanceId as et, WorkflowExecutableNodeClassifierFactory as f, DependencyContainer$1 as fi, WorkflowErrorHandlerSpec as fn, TriggerSetupStateFor as fr, CredentialTypeId as ft, WorkflowBuilder as g, RegistrationOptions as gi, WorkflowNodeConnection as gn, WorkflowRepository as gr, ActivationIdFactory as gt, ConnectionInvocationIdFactory as h, Lifecycle as hi, WorkflowId as hn, WorkflowNodeInstanceFactory as hr, OAuth2ProviderFromPublicConfig as ht, WorkflowPolicyErrorServices as i, RunStatus as ii, RunnableNodeWireJson as in, NodeResolver as ir, CredentialOAuth2AuthDefinition as it, ExecutionInstanceId as j, EngineExecutionLimitsPolicyConfig as ji, BinaryStorage as jn, ConnectionInvocationId as jr, JsonValue as jt, ConnectionInvocationKind as k, ENGINE_EXECUTION_LIMITS_DEFAULTS as ki, BinaryAttachmentCreateRequest as kn, WorkflowActivationPolicy as kr, JsonObject as kt, WorkflowSnapshotCodec as l, WorkflowExecutionPruneRepository as li, WorkflowDefinition as ln, TriggerNode as lr, CredentialSetupStatus as lt, ConnectionNodeIdFactory as m, InjectionToken$1 as mi, WorkflowGraphFactory as mn, TriggerTestItemsContext as mr, CredentialUnboundError as mt, InMemoryLiveWorkflowRepository as n, RunResult as ni, RunnableNodeInputJson as nn, NodeExecutionStatePublisher as nr, CredentialJsonRecord as nt, WorkflowStoragePolicyEvaluator as o, RunSummary as oi, TriggerNodeOutputJson as on, PreparedNodeActivationDispatch as or, CredentialSessionFactory as ot, WorkflowExecutableNodeClassifier as p, Disposable as pi, WorkflowGraph as pn, TriggerSetupStateRepository as pr, CredentialTypeRegistry as pt, CredentialAuthDefinition as q, NodeActivationReceipt as qn, PersistedWorkflowSnapshotNode as qr, PairedItemRef as qt, EngineWorkflowRunnerService as r, RunStateResetRequest as ri, RunnableNodeOutputJson as rn, NodeExecutor as rr, CredentialMaterialSourceKind as rt, RunPolicySnapshotFactory as s, WebhookRunResult as si, TriggerNodeSetupState as sn, TestableTriggerNode as sr, CredentialSessionFactoryArgs as st, RunIntentService as t, RunQueueEntry as ti, RunnableNodeConfig as tn, NodeExecutionScheduler as tr, CredentialInstanceRecord as tt, Engine as u, WorkflowExecutionRepository as ui, WorkflowErrorContext as un, TriggerRuntimeDiagnostics as ur, CredentialType as ut, WhenBuilder as v, container$1 as vi, WorkflowPrunePolicySpec as vn, WorkflowRunnerService as vr, BinaryPreviewKind as vt, BranchStepsArg as w, instancePerContainerCachingFactory as wi, runnableNodeInputType as wn, WebhookInvocationMatch as wr, ItemInputMapper as wt, BooleanWhenOverloads as x, injectAll as xi, WorkflowStoragePolicyResolver as xn, HttpMethod as xr, InputPortKey as xt, AnyRunnableNodeConfig as y, delay as yi, WorkflowStoragePolicyDecisionArgs as yn, WorkflowSnapshotFactory as yr, Edge as yt, RunRevision as z, FixedRetryPolicySpec as zi, ExecutionBinaryService as zn, NodeInputsByPort as zr, NodeErrorHandlerSpec as zt };
1841
- //# sourceMappingURL=RunIntentService-BAKikN8h.d.ts.map
1886
+ export { ItemValueResolvedContext as $, RunEventSubscription as $i, PreparedNodeActivationDispatch as $n, RunStatus as $r, UpstreamRefPlaceholder as $t, ExecutionInstanceDto as A, Container as Ai, EngineDeps as An, ExecutionFrontierPlan as Ar, NodeErrorHandlerArgs as At, RunSlotProjectionState as B, injectAll as Bi, NodeActivationReceipt as Bn, PersistedRunState as Br, ParentExecutionRef as Bt, BranchOutputGuard as C, CredentialSetupStatus as Ci, BinaryAttachmentCreateRequest as Cn, AllWorkflowsActiveWorkflowActivationPolicy as Cr, LineageCarryPolicy as Ct, RunFinishedAtFactory as D, CredentialTypeRegistry as Di, BinaryStorageStatResult as Dn, ConnectionInvocationRecord as Dr, NodeConnectionName as Dt, ValidStepSequence as E, CredentialTypeId as Ei, BinaryStorageReadResult as En, ConnectionInvocationId as Er, NodeConfigBase as Et, PersistedExecutionInstanceRecord as F, RegistrationOptions as Fi, ExecutionContextFactory as Fn, PendingNodeExecution as Fr, NodeOutputs as Ft, WorkflowRunDetailDto as G, registry as Gi, NodeExecutionContext as Gn, RunCompletionNotifier as Gr, RunId as Gt, WorkItemId as H, instanceCachingFactory as Hi, NodeActivationRequestBase as Hn, PersistedWorkflowSnapshotNode as Hr, PersistedTokenId as Ht, PersistedRunSlotProjectionRecord as I, TypeToken as Ii, ItemNode as In, PersistedMutableNodeState as Ir, NodeRef as It, NoRetryPolicy as J, ENGINE_EXECUTION_LIMITS_DEFAULTS as Ji, NodeExecutionScheduler as Jn, RunExecutionOptions as Jr, RunnableNodeInputJson as Jt, ExpRetryPolicy as K, singleton as Ki, NodeExecutionRequest as Kn, RunCurrentState as Kr, RunIdFactory as Kt, PersistedRunWorkItemKind as L, container$1 as Li, LiveWorkflowRepository as Ln, PersistedMutableRunState as Lr, NodeSchedulerDecision as Lt, ExecutionPayloadPolicyFields as M, Disposable as Mi, ExecutableTriggerNode as Mn, NodeExecutionSnapshot as Mr, NodeId as Mt, PayloadStorageKind as N, InjectionToken$1 as Ni, ExecutionBinaryService as Nn, NodeExecutionStatus as Nr, NodeKind as Nt, BatchId as O, CredentialUnboundError as Oi, BinaryStorageWriteRequest as On, CurrentStateExecutionRequest as Or, NodeDefinition as Ot, PersistedExecutionInstanceKind as P, Lifecycle as Pi, ExecutionContext as Pn, NodeInputsByPort as Pr, NodeOffloadPolicy as Pt, ItemValueContext as Q, RunEventBus as Qi, PersistedTriggerSetupState as Qn, RunStateResetRequest as Qr, TriggerNodeSetupState as Qt, PersistedRunWorkItemRecord as R, delay as Ri, MultiInputNode as Rn, PersistedRunControlState as Rr, OutputPortKey as Rt, BranchMoreArgs as S, CredentialSessionService as Si, RetryPolicySpec as Sn, WebhookTriggerRoutingDiagnostics as Sr, JsonValue as St, StepSequenceOutput as T, CredentialTypeDefinition as Ti, BinaryStorage as Tn, ConnectionInvocationAppendArgs as Tr, NodeActivationId as Tt, WorkItemStatus as U, instancePerContainerCachingFactory as Ui, NodeActivationScheduler as Un, PersistedWorkflowTokenRegistryLike as Ur, RunDataFactory as Ut, SlotExecutionStateDto as V, injectable as Vi, NodeActivationRequest as Vn, PersistedWorkflowSnapshot as Vr, PersistedRunPolicySnapshot as Vt, WorkflowDetailSelectionState as W, predicateAwareClassFactory as Wi, NodeBinaryAttachmentService as Wn, PinnedNodeOutputsByPort as Wr, RunDataSnapshot as Wt, ItemValueArgs as X, EngineExecutionLimitsPolicyConfig as Xi, NodeExecutor as Xn, RunQueueEntry as Xr, TriggerNodeConfig as Xt, ItemValue as Y, EngineExecutionLimitsPolicy as Yi, NodeExecutionStatePublisher as Yn, RunPruneCandidate as Yr, RunnableNodeOutputJson as Yt, ItemValueCallback as Z, RunEvent as Zi, NodeResolver as Zn, RunResult as Zr, TriggerNodeOutputJson as Zt, ChainCursor as _, CredentialMaterialSourceKind as _i, triggerNodeOutputType as _n, TriggerInstanceId as _r, Items as _t, RunTerminalPersistenceCoordinator as a, WorkflowExecutionRepository as ai, WorkflowGraphFactory as an, TriggerRuntimeDiagnostics as ar, PortsEmission as at, AnyTriggerNodeConfig as b, CredentialSessionFactory as bi, FixedRetryPolicySpec as bn, WebhookTriggerMatcher as br, JsonObject as bt, EngineExecutionLimitsPolicyFactory as c, CredentialBinding as ci, WorkflowPolicyRuntimeDefaults as cn, TriggerSetupStateRepository as cr, isUnbrandedPortsEmissionShape as ct, DefaultWorkflowGraphFactory as d, CredentialHealth as di, WorkflowStoragePolicyMode as dn, WorkflowRepository as dr, BinaryPreviewKind as dt, RunStopCondition as ei, WorkflowDefinition as en, RunnableNode as er, isItemValue as et, WorkflowExecutableNodeClassifierFactory as f, CredentialHealthStatus as fi, WorkflowStoragePolicyResolver as fn, WorkflowRunnerResolver as fr, Edge as ft, WorkflowBuilder as g, CredentialJsonRecord as gi, runnableNodeOutputType as gn, HttpMethod as gr, ItemBinary as gt, ConnectionInvocationIdFactory as h, CredentialInstanceRecord as hi, runnableNodeInputType as hn, WorkflowSnapshotResolver as hr, Item as ht, WorkflowPolicyErrorServices as i, WorkflowExecutionPruneRepository as ii, WorkflowGraph as in, TriggerNode as ir, getOriginIndexFromItem as it, ExecutionInstanceId as j, DependencyContainer$1 as ji, EngineHost as jn, NodeExecutionError as jr, NodeErrorHandlerSpec as jt, ConnectionInvocationKind as k, OAuth2ProviderFromPublicConfig as ki, BinaryStorageWriteResult as kn, EngineRunCounters as kr, NodeErrorHandler as kt, WorkflowSnapshotCodec as l, CredentialBindingKey as li, WorkflowPrunePolicySpec as ln, TriggerTestItemsContext as lr, ActivationIdFactory as lt, ConnectionNodeIdFactory as m, CredentialInstanceId as mi, branchRef as mn, WorkflowSnapshotFactory as mr, InputPortKey as mt, InMemoryLiveWorkflowRepository as n, WebhookRunResult as ni, WorkflowErrorHandler as nn, TestableTriggerNode as nr, resolveItemValuesForExecution as nt, WorkflowStoragePolicyEvaluator as o, AnyCredentialType as oi, WorkflowId as on, TriggerSetupContext as or, emitPorts as ot, WorkflowExecutableNodeClassifier as p, CredentialHealthTester as pi, WorkflowStoragePolicySpec as pn, WorkflowRunnerService as pr, ExecutionMode as pt, RetryPolicy as q, CoreTokens as qi, NodeExecutionRequestHandler as qn, RunEventPublisherDeps as qr, RunnableNodeConfig as qt, EngineWorkflowRunnerService as r, WorkflowExecutionListingRepository as ri, WorkflowErrorHandlerSpec as rn, TriggerCleanupHandle as rr, resolveItemValuesInUnknown as rt, RunPolicySnapshotFactory as s, CredentialAuthDefinition as si, WorkflowNodeConnection as sn, TriggerSetupStateFor as sr, isPortsEmission as st, RunIntentService as t, RunSummary as ti, WorkflowErrorContext as tn, RunnableNodeExecuteArgs as tr, itemValue as tt, Engine as u, CredentialFieldSchema as ui, WorkflowStoragePolicyDecisionArgs as un, WorkflowNodeInstanceFactory as ur, BinaryAttachment as ut, WhenBuilder as v, CredentialOAuth2AuthDefinition as vi, triggerNodeSetupStateType as vn, WebhookControlSignal as vr, JsonArray as vt, BranchStepsArg as w, CredentialType as wi, BinaryBody as wn, WorkflowActivationPolicy as wr, MutableRunData as wt, BooleanWhenOverloads as x, CredentialSessionFactoryArgs as xi, NoneRetryPolicySpec as xn, WebhookTriggerResolution as xr, JsonPrimitive as xt, AnyRunnableNodeConfig as y, CredentialRequirement as yi, ExponentialRetryPolicySpec as yn, WebhookInvocationMatch as yr, JsonNonArray as yt, RunRevision as z, inject as zi, NodeActivationContinuation as zn, PersistedRunSchedulingState as zr, PairedItemRef as zt };
1887
+ //# sourceMappingURL=RunIntentService-zbTchO9T.d.ts.map