@codemation/core 0.3.0 → 0.5.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 (82) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/{EngineRuntimeRegistration.types-Bjeo7Sfq.d.ts → EngineRuntimeRegistration.types-BtTZolK0.d.ts} +2 -2
  3. package/dist/{EngineWorkflowRunnerService-Dd4yD31l.d.cts → EngineWorkflowRunnerService-Ddl0fekp.d.cts} +2 -2
  4. package/dist/{InMemoryRunDataFactory-OUzDmAHt.d.cts → InMemoryRunDataFactory-i-u2yngD.d.cts} +11 -3
  5. package/dist/{RunIntentService-Bkg4oYrM.d.cts → RunIntentService-Cjx-glgz.d.cts} +232 -237
  6. package/dist/{RunIntentService-BAKikN8h.d.ts → RunIntentService-Dkr4YwN8.d.ts} +313 -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-B2v4wtys.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/credentialTypes.ts +9 -0
  46. package/src/contracts/emitPorts.ts +27 -0
  47. package/src/contracts/index.ts +3 -0
  48. package/src/contracts/itemMeta.ts +11 -0
  49. package/src/contracts/itemValue.ts +147 -0
  50. package/src/contracts/runtimeTypes.ts +39 -22
  51. package/src/contracts/workflowTypes.ts +26 -56
  52. package/src/execution/FanInMergeByOriginMerger.ts +67 -0
  53. package/src/execution/ItemValueResolver.ts +27 -0
  54. package/src/execution/NodeActivationRequestComposer.ts +25 -0
  55. package/src/execution/NodeActivationRequestInputPreparer.ts +57 -25
  56. package/src/execution/NodeExecutor.ts +199 -30
  57. package/src/execution/NodeOutputNormalizer.ts +90 -0
  58. package/src/execution/index.ts +2 -0
  59. package/src/index.ts +2 -0
  60. package/src/orchestration/NodeExecutionRequestHandlerService.ts +39 -18
  61. package/src/orchestration/RunContinuationService.ts +11 -17
  62. package/src/planning/CurrentStateFrontierPlanner.ts +20 -20
  63. package/src/planning/RunQueuePlanner.ts +56 -19
  64. package/src/planning/WorkflowTopologyPlanner.ts +57 -33
  65. package/src/testing/ItemHarnessNode.ts +4 -10
  66. package/src/testing/ItemHarnessNodeConfig.ts +7 -16
  67. package/src/testing/RegistrarEngineTestKitFactory.ts +2 -0
  68. package/src/testing/SubWorkflowRunnerTestNode.ts +28 -43
  69. package/src/testing/SwitchHarnessNode.ts +54 -0
  70. package/src/types/index.ts +3 -0
  71. package/src/workflow/dsl/ChainCursorResolver.ts +68 -23
  72. package/src/workflow/dsl/WorkflowBuilder.ts +3 -5
  73. package/src/workflow/dsl/workflowBuilderTypes.ts +5 -8
  74. package/src/workflowSnapshots/MissingRuntimeNode.ts +4 -4
  75. package/src/workflowSnapshots/MissingRuntimeNodeConfig.ts +2 -2
  76. package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +16 -7
  77. package/dist/bootstrap-BD6CobHl.js.map +0 -1
  78. package/dist/bootstrap-DwS5S7s9.cjs.map +0 -1
  79. package/dist/runtime-Cy-3FTI_.js.map +0 -1
  80. package/dist/runtime-ZJUpWmPH.cjs.map +0 -1
  81. package/dist/workflowActivationPolicy-B8HzTk3o.js.map +0 -1
  82. 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,157 @@ 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 CredentialOAuth2ScopesFromPublicConfig = Readonly<{
162
+ presetFieldKey: string;
163
+ presetScopes: Readonly<Record<string, ReadonlyArray<string>>>;
164
+ customPresetKey?: string;
165
+ customScopesFieldKey?: string;
166
+ }>;
167
+ type CredentialOAuth2AuthDefinition = Readonly<{
168
+ kind: "oauth2";
169
+ providerId: string;
170
+ scopes: ReadonlyArray<string>;
171
+ scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
172
+ clientIdFieldKey?: string;
173
+ clientSecretFieldKey?: string;
174
+ } | {
175
+ kind: "oauth2";
176
+ providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
177
+ scopes: ReadonlyArray<string>;
178
+ scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
179
+ clientIdFieldKey?: string;
180
+ clientSecretFieldKey?: string;
181
+ }>;
182
+ type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
183
+ type CredentialTypeDefinition = Readonly<{
184
+ typeId: CredentialTypeId;
185
+ displayName: string;
186
+ description?: string;
187
+ publicFields?: ReadonlyArray<CredentialFieldSchema>;
188
+ secretFields?: ReadonlyArray<CredentialFieldSchema>;
189
+ supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
190
+ auth?: CredentialAuthDefinition;
191
+ }>;
192
+ /**
193
+ * JSON-shaped credential field bag (public config, resolved secret material, etc.).
194
+ */
195
+ type CredentialJsonRecord = Readonly<Record<string, unknown>>;
196
+ /**
197
+ * Persisted credential instance with typed `publicConfig`.
198
+ * Hosts may specialize `secretRef` with a stricter union while remaining
199
+ * assignable here for session/test callbacks.
200
+ */
201
+ type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
202
+ instanceId: CredentialInstanceId;
203
+ typeId: CredentialTypeId;
204
+ displayName: string;
205
+ sourceKind: CredentialMaterialSourceKind;
206
+ publicConfig: TPublicConfig;
207
+ secretRef: CredentialJsonRecord;
208
+ tags: ReadonlyArray<string>;
209
+ setupStatus: CredentialSetupStatus;
210
+ createdAt: string;
211
+ updatedAt: string;
212
+ }>;
213
+ /**
214
+ * Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
215
+ * Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
216
+ * against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
217
+ */
218
+ type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
219
+ instance: CredentialInstanceRecord<TPublicConfig>;
220
+ material: TMaterial;
221
+ publicConfig: TPublicConfig;
222
+ }>;
223
+ type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
224
+ type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
225
+ /**
226
+ * Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
227
+ * Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
228
+ */
229
+ type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
230
+ definition: CredentialTypeDefinition;
231
+ createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
232
+ test: CredentialHealthTester<TPublicConfig, TMaterial>;
233
+ }>;
234
+ /**
235
+ * Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
236
+ * and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
237
+ * Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
238
+ */
239
+ type AnyCredentialType = CredentialType<any, any, unknown>;
240
+ interface CredentialSessionService {
241
+ getSession<TSession = unknown>(args: Readonly<{
242
+ workflowId: WorkflowId;
243
+ nodeId: NodeId;
244
+ slotKey: string;
245
+ }>): Promise<TSession>;
246
+ }
247
+ interface CredentialTypeRegistry {
248
+ listTypes(): ReadonlyArray<CredentialTypeDefinition>;
249
+ getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
250
+ }
251
+ declare class CredentialUnboundError extends Error {
252
+ readonly bindingKey: CredentialBindingKey;
253
+ readonly acceptedTypes: ReadonlyArray<CredentialTypeId>;
254
+ constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray<CredentialTypeId>);
255
+ private static createMessage;
256
+ }
257
+ //#endregion
163
258
  //#region src/contracts/runTypes.d.ts
164
259
  interface RunExecutionOptions {
165
260
  /** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
@@ -679,31 +774,41 @@ interface EngineHost {
679
774
  credentialSessions: CredentialSessionService;
680
775
  workflows?: WorkflowRunnerService;
681
776
  }
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
777
  /**
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`.
778
+ * Per-item runnable node: return JSON, an array to fan-out on `main`, or {@link emitPorts} for multi-port emission.
779
+ * Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input` (wire `item.json` is unchanged).
690
780
  */
691
- interface ItemNode<TConfig extends NodeConfigBase = NodeConfigBase, TInputJson$1 = unknown, TOutputJson$1 = unknown> {
781
+ interface RunnableNodeExecuteArgs<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown> {
782
+ readonly input: TInputJson$1;
783
+ readonly item: Item;
784
+ readonly itemIndex: number;
785
+ readonly items: Items;
786
+ readonly ctx: NodeExecutionContext<TConfig>;
787
+ }
788
+ interface RunnableNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, _TOutputJson = unknown> {
692
789
  readonly kind: "node";
693
- readonly outputPorts: readonly ["main"];
790
+ /**
791
+ * Declared output ports (e.g. `["main"]`).
792
+ *
793
+ * Prefer describing dynamic router ports (Switch) and fixed multi-ports (If true/false)
794
+ * via {@link NodeConfigBase.declaredOutputPorts}. Engine defaults to `["main"]` when omitted.
795
+ */
796
+ readonly outputPorts?: ReadonlyArray<OutputPortKey>;
694
797
  /** When omitted, engine uses {@link RunnableNodeConfig.inputSchema} or `z.unknown()`. */
695
798
  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;
799
+ execute(args: RunnableNodeExecuteArgs<TConfig, TInputJson$1>): Promise<unknown> | unknown;
703
800
  }
801
+ /** @deprecated Use {@link RunnableNode} */
802
+ type ItemNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, TOutputJson$1 = unknown> = RunnableNode<TConfig, TInputJson$1, TOutputJson$1>;
704
803
  interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
705
804
  kind: "node";
706
- outputPorts: ReadonlyArray<OutputPortKey>;
805
+ /**
806
+ * Declared output ports (typically `["main"]`).
807
+ *
808
+ * Prefer describing ports for authoring/canvas via {@link NodeConfigBase.declaredOutputPorts}.
809
+ * Engine defaults to `["main"]` when omitted.
810
+ */
811
+ outputPorts?: ReadonlyArray<OutputPortKey>;
707
812
  executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
708
813
  }
709
814
  type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;
@@ -833,6 +938,34 @@ interface EngineDeps {
833
938
  triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics;
834
939
  }
835
940
  //#endregion
941
+ //#region src/contracts/retryPolicySpec.types.d.ts
942
+ /**
943
+ * In-process retry policy for runnable nodes. Serialized configs use the same
944
+ * `kind` discriminator (`JSON.stringify` / persisted workflows).
945
+ *
946
+ * `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
947
+ */
948
+ type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
949
+ interface NoneRetryPolicySpec {
950
+ readonly kind: "none";
951
+ }
952
+ interface FixedRetryPolicySpec {
953
+ readonly kind: "fixed";
954
+ /** Total attempts including the first execution. Must be >= 1. */
955
+ readonly maxAttempts: number;
956
+ readonly delayMs: number;
957
+ }
958
+ interface ExponentialRetryPolicySpec {
959
+ readonly kind: "exponential";
960
+ /** Total attempts including the first execution. Must be >= 1. */
961
+ readonly maxAttempts: number;
962
+ readonly initialDelayMs: number;
963
+ readonly multiplier: number;
964
+ readonly maxDelayMs?: number;
965
+ /** When true, each delay is multiplied by a random factor in [1, 1.2). */
966
+ readonly jitter?: boolean;
967
+ }
968
+ //#endregion
836
969
  //#region src/contracts/workflowTypes.d.ts
837
970
  type WorkflowId = string;
838
971
  type NodeId = string;
@@ -846,6 +979,8 @@ interface JsonObject {
846
979
  }
847
980
  type JsonValue = JsonPrimitive | JsonObject | JsonArray;
848
981
  type JsonArray = ReadonlyArray<JsonValue>;
982
+ /** JSON value that is not a top-level array (nested arrays inside objects are allowed). */
983
+ type JsonNonArray = JsonPrimitive | JsonObject;
849
984
  interface Edge {
850
985
  from: {
851
986
  nodeId: NodeId;
@@ -915,65 +1050,42 @@ interface NodeConfigBase {
915
1050
  * main batches skip downstream execution and propagate the empty path.
916
1051
  */
917
1052
  readonly continueWhenEmptyOutput?: boolean;
1053
+ /**
1054
+ * Declared I/O port names for canvas authoring (unioned with ports inferred from edges).
1055
+ * Use for dynamic routers (Switch) and future error ports.
1056
+ */
1057
+ readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
1058
+ readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
918
1059
  getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
919
1060
  }
920
1061
  declare const runnableNodeInputType: unique symbol;
921
1062
  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
1063
  declare const triggerNodeOutputType: unique symbol;
1064
+ type LineageCarryPolicy = "emitOnly" | "carryThrough";
925
1065
  /**
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.
1066
+ * Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).
1067
+ * **`TOutputJson`** is emitted `item.json` on outputs.
942
1068
  */
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).
953
- */
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 {
1069
+ interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
963
1070
  readonly kind: "node";
964
1071
  readonly [runnableNodeInputType]?: TInputJson$1;
965
1072
  readonly [runnableNodeOutputType]?: TOutputJson$1;
966
- readonly [runnableNodeWireType]?: TWireJson$1;
967
1073
  /**
968
- * Optional Zod input contract for {@link ItemNode} when not set on the node class.
1074
+ * Optional Zod input contract for {@link RunnableNode} when not set on the node class.
969
1075
  * Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
970
1076
  */
971
1077
  readonly inputSchema?: ZodType<TInputJson$1>;
972
1078
  /**
973
- * Optional per-item mapper: engine applies it before validating against the node’s `inputSchema`.
974
- * When omitted, the engine validates `item.json` directly.
1079
+ * Overrides default lineage propagation for `execute` outputs (binary/meta/paired).
1080
+ * Routers with multiple {@link RunnableNode#outputPorts} default to **`carryThrough`**; others default to **`emitOnly`**.
975
1081
  */
976
- readonly mapInput?: ItemInputMapper<TWireJson$1, TInputJson$1>;
1082
+ readonly lineageCarry?: LineageCarryPolicy;
1083
+ /**
1084
+ * When an activation receives **zero** input items, the engine normally runs `execute` zero times.
1085
+ * Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).
1086
+ * Used by batch-style callback nodes (built-in `Callback`) so `callback([], ctx)` still runs.
1087
+ */
1088
+ readonly emptyBatchExecution?: "skip" | "runOnce";
977
1089
  }
978
1090
  declare const triggerNodeSetupStateType: unique symbol;
979
1091
  interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonValue | undefined = undefined> extends NodeConfigBase {
@@ -981,9 +1093,8 @@ interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonV
981
1093
  readonly [triggerNodeOutputType]?: TOutputJson$1;
982
1094
  readonly [triggerNodeSetupStateType]?: TSetupState$1;
983
1095
  }
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;
1096
+ type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
1097
+ type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;
987
1098
  type TriggerNodeOutputJson<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<infer TOutputJson, any> ? TOutputJson : never;
988
1099
  type TriggerNodeSetupState<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<any, infer TSetupState> ? TSetupState : never;
989
1100
  interface NodeDefinition {
@@ -1127,147 +1238,85 @@ interface WorkflowPolicyRuntimeDefaults {
1127
1238
  readonly storagePolicy?: WorkflowStoragePolicyMode;
1128
1239
  }
1129
1240
  //#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;
1241
+ //#region src/contracts/emitPorts.d.ts
1242
+ declare const EMIT_PORTS_BRAND: unique symbol;
1243
+ type PortsEmission = Readonly<{
1244
+ readonly [EMIT_PORTS_BRAND]: true;
1245
+ readonly ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>;
1153
1246
  }>;
1154
- type CredentialRequirement = Readonly<{
1155
- slotKey: string;
1156
- label: string;
1157
- acceptedTypes: ReadonlyArray<CredentialTypeId>;
1158
- optional?: true;
1159
- helpText?: string;
1160
- helpUrl?: string;
1247
+ declare function emitPorts(ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>): PortsEmission;
1248
+ declare function isPortsEmission(value: unknown): value is PortsEmission;
1249
+ declare function isUnbrandedPortsEmissionShape(value: unknown): value is Readonly<{
1250
+ ports: unknown;
1161
1251
  }>;
1162
- type CredentialBindingKey = Readonly<{
1252
+ //#endregion
1253
+ //#region src/contracts/itemMeta.d.ts
1254
+ /**
1255
+ * Reads `meta._cm.originIndex` when present (used for fan-in merge-by-origin and Merge routing).
1256
+ */
1257
+ declare function getOriginIndexFromItem(item: Item): number | undefined;
1258
+ //#endregion
1259
+ //#region src/contracts/itemValue.d.ts
1260
+ declare const ITEM_VALUE_BRAND: unique symbol;
1261
+ type ItemValueResolvedContext = Readonly<{
1262
+ runId: RunId;
1163
1263
  workflowId: WorkflowId;
1164
1264
  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;
1265
+ activationId: NodeActivationId;
1266
+ data: RunDataSnapshot;
1206
1267
  }>;
1207
1268
  /**
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.
1269
+ * Context aligned with former {@link ItemInputMapperContext} use **`data`** to read any completed upstream node.
1215
1270
  */
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;
1271
+ type ItemValueContext = ItemValueResolvedContext;
1272
+ type ItemValueArgs<TItemJson = unknown> = Readonly<{
1273
+ item: Item<TItemJson>;
1274
+ itemIndex: number;
1275
+ items: Items<TItemJson>;
1276
+ ctx: ItemValueContext;
1227
1277
  }>;
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;
1278
+ type ItemValueCallback<T, TItemJson = unknown> = (args: ItemValueArgs<TItemJson>) => T | Promise<T>;
1279
+ type ItemValue<T, TItemJson = unknown> = Readonly<{
1280
+ readonly [ITEM_VALUE_BRAND]: true;
1281
+ readonly fn: ItemValueCallback<T, TItemJson>;
1237
1282
  }>;
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>;
1283
+ declare function itemValue<T, TItemJson = unknown>(fn: ItemValueCallback<T, TItemJson>): ItemValue<T, TItemJson>;
1284
+ declare function isItemValue<T, TItemJson = unknown>(value: unknown): value is ItemValue<T, TItemJson>;
1240
1285
  /**
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.
1286
+ * Deep-resolves {@link itemValue} leaves. Returns a new graph (does not mutate the original config object).
1243
1287
  */
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
- }>;
1288
+ declare function resolveItemValuesInUnknown(value: unknown, args: ItemValueArgs, seen?: WeakSet<object>): Promise<unknown>;
1249
1289
  /**
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.
1290
+ * Clones runnable config (best-effort) so per-item {@link itemValue} resolution never mutates shared instances.
1253
1291
  */
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>;
1292
+ declare function resolveItemValuesForExecution(config: unknown, nodeCtx: NodeExecutionContext, item: Item, itemIndex: number, items: Items): Promise<unknown | undefined>;
1293
+ //#endregion
1294
+ //#region src/contracts/NoRetryPolicy.d.ts
1295
+ declare class NoRetryPolicy implements NoneRetryPolicySpec {
1296
+ readonly kind: "none";
1261
1297
  }
1262
- interface CredentialTypeRegistry {
1263
- listTypes(): ReadonlyArray<CredentialTypeDefinition>;
1264
- getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
1298
+ //#endregion
1299
+ //#region src/contracts/RetryPolicy.d.ts
1300
+ declare class RetryPolicy implements FixedRetryPolicySpec {
1301
+ readonly maxAttempts: number;
1302
+ readonly delayMs: number;
1303
+ readonly kind: "fixed";
1304
+ constructor(maxAttempts: number, delayMs: number);
1305
+ /** Default for HTTP-style transient failures: 3 tries, 1s between attempts. */
1306
+ static readonly defaultForHttp: FixedRetryPolicySpec;
1307
+ /** Default for LLM / agent calls: 3 tries, 2s fixed backoff. */
1308
+ static readonly defaultForAiAgent: FixedRetryPolicySpec;
1265
1309
  }
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;
1310
+ //#endregion
1311
+ //#region src/contracts/ExpRetryPolicy.d.ts
1312
+ declare class ExpRetryPolicy implements ExponentialRetryPolicySpec {
1313
+ readonly maxAttempts: number;
1314
+ readonly initialDelayMs: number;
1315
+ readonly multiplier: number;
1316
+ readonly maxDelayMs?: number | undefined;
1317
+ readonly jitter?: boolean | undefined;
1318
+ readonly kind: "exponential";
1319
+ constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined);
1271
1320
  }
1272
1321
  //#endregion
1273
1322
  //#region src/contracts/executionPersistenceContracts.d.ts
@@ -1437,17 +1486,17 @@ declare class RunFinishedAtFactory {
1437
1486
  }
1438
1487
  //#endregion
1439
1488
  //#region src/workflow/dsl/workflowBuilderTypes.d.ts
1440
- type AnyRunnableNodeConfig = RunnableNodeConfig<any, any, any>;
1489
+ type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
1441
1490
  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;
1491
+ 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;
1492
+ 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
1493
  type TypesMatch<TLeft, TRight> = [TLeft] extends [TRight] ? ([TRight] extends [TLeft] ? true : false) : false;
1445
1494
  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
1495
  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>;
1496
+ type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TRestSteps & ValidStepSequence<RunnableNodeOutputJson<TFirstStep>, TRestSteps>;
1448
1497
  type BooleanWhenOverloads<TCurrentJson, TReturn> = {
1449
1498
  <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;
1499
+ <TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs<TCurrentJson, TFirstStep, TRestSteps>): TReturn;
1451
1500
  };
1452
1501
  //#endregion
1453
1502
  //#region src/workflow/dsl/WhenBuilder.d.ts
@@ -1462,6 +1511,11 @@ declare class WhenBuilder<TCurrentJson> {
1462
1511
  }
1463
1512
  //#endregion
1464
1513
  //#region src/workflow/dsl/ChainCursorResolver.d.ts
1514
+ type ChainCursorEndpoint = Readonly<{
1515
+ node: NodeRef;
1516
+ output: OutputPortKey;
1517
+ inputPortHint?: InputPortKey;
1518
+ }>;
1465
1519
  type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> & {
1466
1520
  <TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined>(branches: Readonly<{
1467
1521
  true?: TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TTrueSteps> : never;
@@ -1470,12 +1524,14 @@ type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson,
1470
1524
  };
1471
1525
  declare class ChainCursor<TCurrentJson> {
1472
1526
  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>>;
1527
+ private readonly endpoints;
1528
+ constructor(wf: WorkflowBuilder, endpoints: ReadonlyArray<ChainCursorEndpoint>);
1529
+ then<TOutputJson$1, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
1530
+ thenIntoInputHints<TOutputJson$1, TConfig extends RunnableNodeConfig<any, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
1477
1531
  readonly when: ChainCursorWhenOverloads<TCurrentJson>;
1532
+ route<TNextJson$1>(branches: Readonly<Record<OutputPortKey, (branch: ChainCursor<TCurrentJson>) => ChainCursor<TNextJson$1> | undefined>>): ChainCursor<TNextJson$1>;
1478
1533
  build(): WorkflowDefinition;
1534
+ private resolveSharedInputPortHint;
1479
1535
  }
1480
1536
  //#endregion
1481
1537
  //#region src/workflow/dsl/WorkflowBuilder.d.ts
@@ -1488,9 +1544,7 @@ declare class WorkflowBuilder {
1488
1544
  constructor(meta: {
1489
1545
  id: WorkflowId;
1490
1546
  name: string;
1491
- }, options?: Readonly<{
1492
- makeMergeNode?: (name: string) => AnyRunnableNodeConfig;
1493
- }> | undefined);
1547
+ }, options?: Readonly<Record<string, never>> | undefined);
1494
1548
  private add;
1495
1549
  private connect;
1496
1550
  trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>>;
@@ -1837,5 +1891,5 @@ declare class RunIntentService {
1837
1891
  private createWebhookExecutionOptions;
1838
1892
  }
1839
1893
  //#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
1894
+ export { ItemValueResolvedContext as $, RunEventBus as $i, PreparedNodeActivationDispatch as $n, RunStatus as $r, UpstreamRefPlaceholder as $t, ExecutionInstanceDto as A, OAuth2ProviderFromPublicConfig as Ai, EngineDeps as An, ExecutionFrontierPlan as Ar, NodeErrorHandlerArgs as At, RunSlotProjectionState as B, inject as Bi, NodeActivationReceipt as Bn, PersistedRunState as Br, ParentExecutionRef as Bt, BranchOutputGuard as C, CredentialSessionService as Ci, BinaryAttachmentCreateRequest as Cn, AllWorkflowsActiveWorkflowActivationPolicy as Cr, LineageCarryPolicy as Ct, RunFinishedAtFactory as D, CredentialTypeId as Di, BinaryStorageStatResult as Dn, ConnectionInvocationRecord as Dr, NodeConnectionName as Dt, ValidStepSequence as E, CredentialTypeDefinition as Ei, BinaryStorageReadResult as En, ConnectionInvocationId as Er, NodeConfigBase as Et, PersistedExecutionInstanceRecord as F, Lifecycle as Fi, ExecutionContextFactory as Fn, PendingNodeExecution as Fr, NodeOutputs as Ft, WorkflowRunDetailDto as G, predicateAwareClassFactory as Gi, NodeExecutionContext as Gn, RunCompletionNotifier as Gr, RunId as Gt, WorkItemId as H, injectable as Hi, NodeActivationRequestBase as Hn, PersistedWorkflowSnapshotNode as Hr, PersistedTokenId as Ht, PersistedRunSlotProjectionRecord as I, RegistrationOptions as Ii, ItemNode as In, PersistedMutableNodeState as Ir, NodeRef as It, NoRetryPolicy as J, CoreTokens as Ji, NodeExecutionScheduler as Jn, RunExecutionOptions as Jr, RunnableNodeInputJson as Jt, ExpRetryPolicy as K, registry as Ki, NodeExecutionRequest as Kn, RunCurrentState as Kr, RunIdFactory as Kt, PersistedRunWorkItemKind as L, TypeToken as Li, LiveWorkflowRepository as Ln, PersistedMutableRunState as Lr, NodeSchedulerDecision as Lt, ExecutionPayloadPolicyFields as M, DependencyContainer$1 as Mi, ExecutableTriggerNode as Mn, NodeExecutionSnapshot as Mr, NodeId as Mt, PayloadStorageKind as N, Disposable as Ni, ExecutionBinaryService as Nn, NodeExecutionStatus as Nr, NodeKind as Nt, BatchId as O, CredentialTypeRegistry as Oi, BinaryStorageWriteRequest as On, CurrentStateExecutionRequest as Or, NodeDefinition as Ot, PersistedExecutionInstanceKind as P, InjectionToken$1 as Pi, ExecutionContext as Pn, NodeInputsByPort as Pr, NodeOffloadPolicy as Pt, ItemValueContext as Q, RunEvent as Qi, PersistedTriggerSetupState as Qn, RunStateResetRequest as Qr, TriggerNodeSetupState as Qt, PersistedRunWorkItemRecord as R, container$1 as Ri, MultiInputNode as Rn, PersistedRunControlState as Rr, OutputPortKey as Rt, BranchMoreArgs as S, CredentialSessionFactoryArgs as Si, RetryPolicySpec as Sn, WebhookTriggerRoutingDiagnostics as Sr, JsonValue as St, StepSequenceOutput as T, CredentialType as Ti, BinaryStorage as Tn, ConnectionInvocationAppendArgs as Tr, NodeActivationId as Tt, WorkItemStatus as U, instanceCachingFactory as Ui, NodeActivationScheduler as Un, PersistedWorkflowTokenRegistryLike as Ur, RunDataFactory as Ut, SlotExecutionStateDto as V, injectAll as Vi, NodeActivationRequest as Vn, PersistedWorkflowSnapshot as Vr, PersistedRunPolicySnapshot as Vt, WorkflowDetailSelectionState as W, instancePerContainerCachingFactory as Wi, NodeBinaryAttachmentService as Wn, PinnedNodeOutputsByPort as Wr, RunDataSnapshot as Wt, ItemValueArgs as X, EngineExecutionLimitsPolicy as Xi, NodeExecutor as Xn, RunQueueEntry as Xr, TriggerNodeConfig as Xt, ItemValue as Y, ENGINE_EXECUTION_LIMITS_DEFAULTS as Yi, NodeExecutionStatePublisher as Yn, RunPruneCandidate as Yr, RunnableNodeOutputJson as Yt, ItemValueCallback as Z, EngineExecutionLimitsPolicyConfig 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, CredentialRequirement 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, RunEventSubscription as ea, 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, Container as ji, EngineHost as jn, NodeExecutionError as jr, NodeErrorHandlerSpec as jt, ConnectionInvocationKind as k, CredentialUnboundError 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, singleton 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, CredentialSetupStatus as wi, BinaryBody as wn, WorkflowActivationPolicy as wr, MutableRunData as wt, BooleanWhenOverloads as x, CredentialSessionFactory as xi, NoneRetryPolicySpec as xn, WebhookTriggerResolution as xr, JsonPrimitive as xt, AnyRunnableNodeConfig as y, CredentialOAuth2ScopesFromPublicConfig as yi, ExponentialRetryPolicySpec as yn, WebhookInvocationMatch as yr, JsonNonArray as yt, RunRevision as z, delay as zi, NodeActivationContinuation as zn, PersistedRunSchedulingState as zr, PairedItemRef as zt };
1895
+ //# sourceMappingURL=RunIntentService-Dkr4YwN8.d.ts.map