@codemation/core-nodes 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -21,9 +21,9 @@ type PortsEmission = Readonly<{
21
21
  readonly ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>;
22
22
  }>;
23
23
  //#endregion
24
- //#region ../core/src/contracts/itemValue.d.ts
25
- declare const ITEM_VALUE_BRAND: unique symbol;
26
- type ItemValueResolvedContext = Readonly<{
24
+ //#region ../core/src/contracts/itemExpr.d.ts
25
+ declare const ITEM_EXPR_BRAND: unique symbol;
26
+ type ItemExprResolvedContext = Readonly<{
27
27
  runId: RunId;
28
28
  workflowId: WorkflowId;
29
29
  nodeId: NodeId;
@@ -33,19 +33,23 @@ type ItemValueResolvedContext = Readonly<{
33
33
  /**
34
34
  * Context aligned with former {@link ItemInputMapperContext} — use **`data`** to read any completed upstream node.
35
35
  */
36
- type ItemValueContext = ItemValueResolvedContext;
37
- type ItemValueArgs<TItemJson = unknown> = Readonly<{
36
+ type ItemExprContext = ItemExprResolvedContext;
37
+ type ItemExprArgs<TItemJson = unknown> = Readonly<{
38
38
  item: Item<TItemJson>;
39
39
  itemIndex: number;
40
40
  items: Items<TItemJson>;
41
- ctx: ItemValueContext;
41
+ ctx: ItemExprContext;
42
42
  }>;
43
- type ItemValueCallback<T, TItemJson = unknown> = (args: ItemValueArgs<TItemJson>) => T | Promise<T>;
44
- type ItemValue<T, TItemJson = unknown> = Readonly<{
45
- readonly [ITEM_VALUE_BRAND]: true;
46
- readonly fn: ItemValueCallback<T, TItemJson>;
43
+ type ItemExprCallback<T, TItemJson = unknown> = (args: ItemExprArgs<TItemJson>) => T | Promise<T>;
44
+ type ItemExpr<T, TItemJson = unknown> = Readonly<{
45
+ readonly [ITEM_EXPR_BRAND]: true;
46
+ readonly fn: ItemExprCallback<T, TItemJson>;
47
47
  }>;
48
48
  //#endregion
49
+ //#region ../core/src/contracts/params.d.ts
50
+ type Expr<T, TItemJson = unknown> = ItemExpr<T, TItemJson>;
51
+ type ParamDeep<T, TItemJson = unknown> = Expr<T, TItemJson> | (T extends readonly (infer U)[] ? ReadonlyArray<ParamDeep<U, TItemJson>> : never) | (T extends object ? { [K in keyof T]: ParamDeep<T[K], TItemJson> } : T);
52
+ //#endregion
49
53
  //#region ../core/src/contracts/retryPolicySpec.types.d.ts
50
54
  /**
51
55
  * In-process retry policy for runnable nodes. Serialized configs use the same
@@ -362,6 +366,9 @@ type ExecutableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = Trigger
362
366
  //#region ../core/src/contracts/workflowTypes.d.ts
363
367
  type WorkflowId = string;
364
368
  type NodeId = string;
369
+ type NodeIdRef<TJson = unknown> = NodeId & Readonly<{
370
+ __codemationNodeJson?: TJson;
371
+ }>;
365
372
  type OutputPortKey = string;
366
373
  type InputPortKey = string;
367
374
  type NodeKind = "trigger" | "node";
@@ -531,8 +538,8 @@ interface ParentExecutionRef {
531
538
  }
532
539
  interface RunDataSnapshot {
533
540
  getOutputs(nodeId: NodeId): NodeOutputs | undefined;
534
- getOutputItems(nodeId: NodeId, output?: OutputPortKey): Items;
535
- getOutputItem(nodeId: NodeId, itemIndex: number, output?: OutputPortKey): Item | undefined;
541
+ getOutputItems<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, output?: OutputPortKey): Items<TJson>;
542
+ getOutputItem<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, itemIndex: number, output?: OutputPortKey): Item<TJson> | undefined;
536
543
  }
537
544
  type UpstreamRefPlaceholder = `$${number}`;
538
545
  /** Whether to persist run execution data after the workflow finishes. */
@@ -738,12 +745,13 @@ type DefinedNodeCredentialBinding = ResolvableCredentialType | Readonly<{
738
745
  readonly helpUrl?: string;
739
746
  }>;
740
747
  type DefinedNodeCredentialBindings = Readonly<Record<string, DefinedNodeCredentialBinding>>;
748
+ type DefinedNodeConfigInput<TConfigResolved extends CredentialJsonRecord, TItemJson> = ParamDeep<TConfigResolved, TItemJson>;
741
749
  interface DefinedNode<TKey$1 extends string, TConfig extends CredentialJsonRecord, TInputJson$1, TOutputJson$1, _TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
742
750
  readonly kind: "defined-node";
743
751
  readonly key: TKey$1;
744
752
  readonly title: string;
745
753
  readonly description?: string;
746
- create(config: TConfig, name?: string, id?: string): RunnableNodeConfig<TInputJson$1, TOutputJson$1>;
754
+ create<TConfigItemJson = TInputJson$1>(config: DefinedNodeConfigInput<TConfig, TConfigItemJson>, name?: string, id?: string): RunnableNodeConfig<TInputJson$1, TOutputJson$1>;
747
755
  register(context: {
748
756
  registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
749
757
  }): void;
@@ -814,7 +822,7 @@ type AgentMessageLine<TInputJson$1 = unknown> = AgentMessageDto | AgentMessageTe
814
822
  * Message list for an agent. Prefer a **plain array** of `{ role, content }` (optionally with function `content` for templates).
815
823
  * Use the object form only when you need `buildMessages` to append messages after optional `prompt` lines.
816
824
  */
817
- type AgentMessageConfig<TInputJson$1 = unknown> = ItemValue<ReadonlyArray<AgentMessageLine<TInputJson$1>>, TInputJson$1> | ReadonlyArray<AgentMessageLine<TInputJson$1>> | {
825
+ type AgentMessageConfig<TInputJson$1 = unknown> = Expr<ReadonlyArray<AgentMessageLine<TInputJson$1>>, TInputJson$1> | ReadonlyArray<AgentMessageLine<TInputJson$1>> | {
818
826
  readonly prompt?: ReadonlyArray<AgentMessageLine<TInputJson$1>>;
819
827
  readonly buildMessages?: (args: AgentMessageBuildArgs<TInputJson$1>) => ReadonlyArray<AgentMessageDto>;
820
828
  };
@@ -894,11 +902,11 @@ interface AgentNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> exten
894
902
  readonly outputSchema?: ZodType<TOutputJson$1>;
895
903
  }
896
904
  //#endregion
897
- //#region ../core/src/execution/ItemValueResolver.d.ts
905
+ //#region ../core/src/execution/ItemExprResolver.d.ts
898
906
  /**
899
- * Resolves {@link import("../contracts/itemValue").ItemValue} leaves on runnable config before {@link RunnableNode.execute}.
907
+ * Resolves {@link import("../contracts/itemExpr").ItemExpr} leaves on runnable config before {@link RunnableNode.execute}.
900
908
  */
901
- declare class ItemValueResolver {
909
+ declare class ItemExprResolver {
902
910
  resolveConfigForItem<TConfig extends RunnableNodeConfig<any, any>>(ctx: NodeExecutionContext<TConfig>, item: Item, itemIndex: number, items: ReadonlyArray<Item>): Promise<NodeExecutionContext<TConfig>>;
903
911
  }
904
912
  //#endregion
@@ -1155,10 +1163,10 @@ declare class AIAgent<TInputJson$1 = unknown, TOutputJson$1 = unknown> implement
1155
1163
  //#region src/nodes/NodeBackedToolRuntime.d.ts
1156
1164
  declare class NodeBackedToolRuntime {
1157
1165
  private readonly nodeResolver;
1158
- private readonly itemValueResolver;
1166
+ private readonly itemExprResolver;
1159
1167
  private readonly outputNormalizer;
1160
1168
  private readonly outputBehaviorResolver;
1161
- constructor(nodeResolver: NodeResolver, itemValueResolver: ItemValueResolver, outputNormalizer: NodeOutputNormalizer, outputBehaviorResolver: RunnableOutputBehaviorResolver);
1169
+ constructor(nodeResolver: NodeResolver, itemExprResolver: ItemExprResolver, outputNormalizer: NodeOutputNormalizer, outputBehaviorResolver: RunnableOutputBehaviorResolver);
1162
1170
  execute(config: NodeBackedToolConfig<any, ZodSchemaAny, ZodSchemaAny>, args: ToolExecuteArgs): Promise<unknown>;
1163
1171
  private executeResolvedNode;
1164
1172
  private isRunnableNode;
@@ -1175,7 +1183,7 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
1175
1183
  outputPorts: readonly ["main"];
1176
1184
  /**
1177
1185
  * Engine validates {@link RunnableNodeConfig.inputSchema} (Zod) on {@code item.json} before enqueue, then resolves
1178
- * per-item **`itemValue`** leaves on config before {@link #execute}. Prefer modeling prompts as
1186
+ * per-item **`itemExpr`** leaves on config before {@link #execute}. Prefer modeling prompts as
1179
1187
  * {@code { messages: [{ role, content }, ...] }} (on input or config) so persisted inputs are visible in the UI.
1180
1188
  */
1181
1189
  readonly inputSchema: z.ZodUnknown;
@@ -1345,6 +1353,7 @@ declare class Aggregate<TIn = unknown, TOut = unknown> implements RunnableNodeCo
1345
1353
  readonly execution: {
1346
1354
  readonly hint: "local";
1347
1355
  };
1356
+ readonly keepBinaries: true;
1348
1357
  readonly icon: "lucide:layers";
1349
1358
  constructor(name: string, aggregate: (items: Items<TIn>, ctx: NodeExecutionContext<Aggregate<TIn, TOut>>) => TOut | Promise<TOut>, id?: string | undefined);
1350
1359
  }
@@ -1441,6 +1450,7 @@ declare class Split<TIn = unknown, TElem = unknown> implements RunnableNodeConfi
1441
1450
  readonly execution: {
1442
1451
  readonly hint: "local";
1443
1452
  };
1453
+ readonly keepBinaries: true;
1444
1454
  /**
1445
1455
  * When splitting yields zero items for a batch, downstream single-input nodes still run once with an empty batch.
1446
1456
  * Mirrors {@link MapData}'s empty-output behavior.
@@ -1713,7 +1723,7 @@ declare class WorkflowBranchBuilder<TCurrentJson> {
1713
1723
  agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowBranchBuilder<z.output<TOutputSchema>>;
1714
1724
  agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowBranchBuilder<Record<string, unknown>>;
1715
1725
  agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowBranchBuilder<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
1716
- node<TConfig extends Record<string, unknown>, TOutputJson$1>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson$1> | string, config: TConfig, name?: string, id?: string): WorkflowBranchBuilder<TOutputJson$1>;
1726
+ node<TConfig extends CredentialJsonRecord, TInputJson$1, TOutputJson$1>(definitionOrKey: DefinedNode<string, TConfig, TInputJson$1, TOutputJson$1> | string, config: DefinedNodeConfigInput<TConfig, TCurrentJson>, name?: string, id?: string): TCurrentJson extends TInputJson$1 ? WorkflowBranchBuilder<TOutputJson$1> : never;
1717
1727
  getSteps(): ReadonlyArray<AnyRunnableNodeConfig>;
1718
1728
  }
1719
1729
  //#endregion
@@ -1770,7 +1780,7 @@ declare class WorkflowChain<TCurrentJson> {
1770
1780
  agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowChain<z.output<TOutputSchema>>;
1771
1781
  agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowChain<Record<string, unknown>>;
1772
1782
  agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowChain<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
1773
- node<TConfig extends Record<string, unknown>, TOutputJson$1>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson$1> | string, config: TConfig, name?: string, id?: string): WorkflowChain<TOutputJson$1>;
1783
+ node<TConfig extends CredentialJsonRecord, TInputJson$1, TOutputJson$1>(definitionOrKey: DefinedNode<string, TConfig, TInputJson$1, TOutputJson$1> | string, config: DefinedNodeConfigInput<TConfig, TCurrentJson>, name?: string, id?: string): TCurrentJson extends TInputJson$1 ? WorkflowChain<TOutputJson$1> : never;
1774
1784
  build(): WorkflowDefinition;
1775
1785
  }
1776
1786
  //#endregion
package/dist/index.d.ts CHANGED
@@ -21,9 +21,9 @@ type PortsEmission = Readonly<{
21
21
  readonly ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>;
22
22
  }>;
23
23
  //#endregion
24
- //#region ../core/src/contracts/itemValue.d.ts
25
- declare const ITEM_VALUE_BRAND: unique symbol;
26
- type ItemValueResolvedContext = Readonly<{
24
+ //#region ../core/src/contracts/itemExpr.d.ts
25
+ declare const ITEM_EXPR_BRAND: unique symbol;
26
+ type ItemExprResolvedContext = Readonly<{
27
27
  runId: RunId;
28
28
  workflowId: WorkflowId;
29
29
  nodeId: NodeId;
@@ -33,19 +33,23 @@ type ItemValueResolvedContext = Readonly<{
33
33
  /**
34
34
  * Context aligned with former {@link ItemInputMapperContext} — use **`data`** to read any completed upstream node.
35
35
  */
36
- type ItemValueContext = ItemValueResolvedContext;
37
- type ItemValueArgs<TItemJson = unknown> = Readonly<{
36
+ type ItemExprContext = ItemExprResolvedContext;
37
+ type ItemExprArgs<TItemJson = unknown> = Readonly<{
38
38
  item: Item<TItemJson>;
39
39
  itemIndex: number;
40
40
  items: Items<TItemJson>;
41
- ctx: ItemValueContext;
41
+ ctx: ItemExprContext;
42
42
  }>;
43
- type ItemValueCallback<T, TItemJson = unknown> = (args: ItemValueArgs<TItemJson>) => T | Promise<T>;
44
- type ItemValue<T, TItemJson = unknown> = Readonly<{
45
- readonly [ITEM_VALUE_BRAND]: true;
46
- readonly fn: ItemValueCallback<T, TItemJson>;
43
+ type ItemExprCallback<T, TItemJson = unknown> = (args: ItemExprArgs<TItemJson>) => T | Promise<T>;
44
+ type ItemExpr<T, TItemJson = unknown> = Readonly<{
45
+ readonly [ITEM_EXPR_BRAND]: true;
46
+ readonly fn: ItemExprCallback<T, TItemJson>;
47
47
  }>;
48
48
  //#endregion
49
+ //#region ../core/src/contracts/params.d.ts
50
+ type Expr<T, TItemJson = unknown> = ItemExpr<T, TItemJson>;
51
+ type ParamDeep<T, TItemJson = unknown> = Expr<T, TItemJson> | (T extends readonly (infer U)[] ? ReadonlyArray<ParamDeep<U, TItemJson>> : never) | (T extends object ? { [K in keyof T]: ParamDeep<T[K], TItemJson> } : T);
52
+ //#endregion
49
53
  //#region ../core/src/contracts/retryPolicySpec.types.d.ts
50
54
  /**
51
55
  * In-process retry policy for runnable nodes. Serialized configs use the same
@@ -362,6 +366,9 @@ type ExecutableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = Trigger
362
366
  //#region ../core/src/contracts/workflowTypes.d.ts
363
367
  type WorkflowId = string;
364
368
  type NodeId = string;
369
+ type NodeIdRef<TJson = unknown> = NodeId & Readonly<{
370
+ __codemationNodeJson?: TJson;
371
+ }>;
365
372
  type OutputPortKey = string;
366
373
  type InputPortKey = string;
367
374
  type NodeKind = "trigger" | "node";
@@ -531,8 +538,8 @@ interface ParentExecutionRef {
531
538
  }
532
539
  interface RunDataSnapshot {
533
540
  getOutputs(nodeId: NodeId): NodeOutputs | undefined;
534
- getOutputItems(nodeId: NodeId, output?: OutputPortKey): Items;
535
- getOutputItem(nodeId: NodeId, itemIndex: number, output?: OutputPortKey): Item | undefined;
541
+ getOutputItems<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, output?: OutputPortKey): Items<TJson>;
542
+ getOutputItem<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, itemIndex: number, output?: OutputPortKey): Item<TJson> | undefined;
536
543
  }
537
544
  type UpstreamRefPlaceholder = `$${number}`;
538
545
  /** Whether to persist run execution data after the workflow finishes. */
@@ -738,12 +745,13 @@ type DefinedNodeCredentialBinding = ResolvableCredentialType | Readonly<{
738
745
  readonly helpUrl?: string;
739
746
  }>;
740
747
  type DefinedNodeCredentialBindings = Readonly<Record<string, DefinedNodeCredentialBinding>>;
748
+ type DefinedNodeConfigInput<TConfigResolved extends CredentialJsonRecord, TItemJson> = ParamDeep<TConfigResolved, TItemJson>;
741
749
  interface DefinedNode<TKey$1 extends string, TConfig extends CredentialJsonRecord, TInputJson$1, TOutputJson$1, _TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
742
750
  readonly kind: "defined-node";
743
751
  readonly key: TKey$1;
744
752
  readonly title: string;
745
753
  readonly description?: string;
746
- create(config: TConfig, name?: string, id?: string): RunnableNodeConfig<TInputJson$1, TOutputJson$1>;
754
+ create<TConfigItemJson = TInputJson$1>(config: DefinedNodeConfigInput<TConfig, TConfigItemJson>, name?: string, id?: string): RunnableNodeConfig<TInputJson$1, TOutputJson$1>;
747
755
  register(context: {
748
756
  registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
749
757
  }): void;
@@ -814,7 +822,7 @@ type AgentMessageLine<TInputJson$1 = unknown> = AgentMessageDto | AgentMessageTe
814
822
  * Message list for an agent. Prefer a **plain array** of `{ role, content }` (optionally with function `content` for templates).
815
823
  * Use the object form only when you need `buildMessages` to append messages after optional `prompt` lines.
816
824
  */
817
- type AgentMessageConfig<TInputJson$1 = unknown> = ItemValue<ReadonlyArray<AgentMessageLine<TInputJson$1>>, TInputJson$1> | ReadonlyArray<AgentMessageLine<TInputJson$1>> | {
825
+ type AgentMessageConfig<TInputJson$1 = unknown> = Expr<ReadonlyArray<AgentMessageLine<TInputJson$1>>, TInputJson$1> | ReadonlyArray<AgentMessageLine<TInputJson$1>> | {
818
826
  readonly prompt?: ReadonlyArray<AgentMessageLine<TInputJson$1>>;
819
827
  readonly buildMessages?: (args: AgentMessageBuildArgs<TInputJson$1>) => ReadonlyArray<AgentMessageDto>;
820
828
  };
@@ -894,11 +902,11 @@ interface AgentNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> exten
894
902
  readonly outputSchema?: ZodType<TOutputJson$1>;
895
903
  }
896
904
  //#endregion
897
- //#region ../core/src/execution/ItemValueResolver.d.ts
905
+ //#region ../core/src/execution/ItemExprResolver.d.ts
898
906
  /**
899
- * Resolves {@link import("../contracts/itemValue").ItemValue} leaves on runnable config before {@link RunnableNode.execute}.
907
+ * Resolves {@link import("../contracts/itemExpr").ItemExpr} leaves on runnable config before {@link RunnableNode.execute}.
900
908
  */
901
- declare class ItemValueResolver {
909
+ declare class ItemExprResolver {
902
910
  resolveConfigForItem<TConfig extends RunnableNodeConfig<any, any>>(ctx: NodeExecutionContext<TConfig>, item: Item, itemIndex: number, items: ReadonlyArray<Item>): Promise<NodeExecutionContext<TConfig>>;
903
911
  }
904
912
  //#endregion
@@ -1155,10 +1163,10 @@ declare class AIAgent<TInputJson$1 = unknown, TOutputJson$1 = unknown> implement
1155
1163
  //#region src/nodes/NodeBackedToolRuntime.d.ts
1156
1164
  declare class NodeBackedToolRuntime {
1157
1165
  private readonly nodeResolver;
1158
- private readonly itemValueResolver;
1166
+ private readonly itemExprResolver;
1159
1167
  private readonly outputNormalizer;
1160
1168
  private readonly outputBehaviorResolver;
1161
- constructor(nodeResolver: NodeResolver, itemValueResolver: ItemValueResolver, outputNormalizer: NodeOutputNormalizer, outputBehaviorResolver: RunnableOutputBehaviorResolver);
1169
+ constructor(nodeResolver: NodeResolver, itemExprResolver: ItemExprResolver, outputNormalizer: NodeOutputNormalizer, outputBehaviorResolver: RunnableOutputBehaviorResolver);
1162
1170
  execute(config: NodeBackedToolConfig<any, ZodSchemaAny, ZodSchemaAny>, args: ToolExecuteArgs): Promise<unknown>;
1163
1171
  private executeResolvedNode;
1164
1172
  private isRunnableNode;
@@ -1175,7 +1183,7 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
1175
1183
  outputPorts: readonly ["main"];
1176
1184
  /**
1177
1185
  * Engine validates {@link RunnableNodeConfig.inputSchema} (Zod) on {@code item.json} before enqueue, then resolves
1178
- * per-item **`itemValue`** leaves on config before {@link #execute}. Prefer modeling prompts as
1186
+ * per-item **`itemExpr`** leaves on config before {@link #execute}. Prefer modeling prompts as
1179
1187
  * {@code { messages: [{ role, content }, ...] }} (on input or config) so persisted inputs are visible in the UI.
1180
1188
  */
1181
1189
  readonly inputSchema: z.ZodUnknown;
@@ -1345,6 +1353,7 @@ declare class Aggregate<TIn = unknown, TOut = unknown> implements RunnableNodeCo
1345
1353
  readonly execution: {
1346
1354
  readonly hint: "local";
1347
1355
  };
1356
+ readonly keepBinaries: true;
1348
1357
  readonly icon: "lucide:layers";
1349
1358
  constructor(name: string, aggregate: (items: Items<TIn>, ctx: NodeExecutionContext<Aggregate<TIn, TOut>>) => TOut | Promise<TOut>, id?: string | undefined);
1350
1359
  }
@@ -1441,6 +1450,7 @@ declare class Split<TIn = unknown, TElem = unknown> implements RunnableNodeConfi
1441
1450
  readonly execution: {
1442
1451
  readonly hint: "local";
1443
1452
  };
1453
+ readonly keepBinaries: true;
1444
1454
  /**
1445
1455
  * When splitting yields zero items for a batch, downstream single-input nodes still run once with an empty batch.
1446
1456
  * Mirrors {@link MapData}'s empty-output behavior.
@@ -1713,7 +1723,7 @@ declare class WorkflowBranchBuilder<TCurrentJson> {
1713
1723
  agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowBranchBuilder<z.output<TOutputSchema>>;
1714
1724
  agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowBranchBuilder<Record<string, unknown>>;
1715
1725
  agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowBranchBuilder<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
1716
- node<TConfig extends Record<string, unknown>, TOutputJson$1>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson$1> | string, config: TConfig, name?: string, id?: string): WorkflowBranchBuilder<TOutputJson$1>;
1726
+ node<TConfig extends CredentialJsonRecord, TInputJson$1, TOutputJson$1>(definitionOrKey: DefinedNode<string, TConfig, TInputJson$1, TOutputJson$1> | string, config: DefinedNodeConfigInput<TConfig, TCurrentJson>, name?: string, id?: string): TCurrentJson extends TInputJson$1 ? WorkflowBranchBuilder<TOutputJson$1> : never;
1717
1727
  getSteps(): ReadonlyArray<AnyRunnableNodeConfig>;
1718
1728
  }
1719
1729
  //#endregion
@@ -1770,7 +1780,7 @@ declare class WorkflowChain<TCurrentJson> {
1770
1780
  agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowChain<z.output<TOutputSchema>>;
1771
1781
  agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowChain<Record<string, unknown>>;
1772
1782
  agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowChain<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
1773
- node<TConfig extends Record<string, unknown>, TOutputJson$1>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson$1> | string, config: TConfig, name?: string, id?: string): WorkflowChain<TOutputJson$1>;
1783
+ node<TConfig extends CredentialJsonRecord, TInputJson$1, TOutputJson$1>(definitionOrKey: DefinedNode<string, TConfig, TInputJson$1, TOutputJson$1> | string, config: DefinedNodeConfigInput<TConfig, TCurrentJson>, name?: string, id?: string): TCurrentJson extends TInputJson$1 ? WorkflowChain<TOutputJson$1> : never;
1774
1784
  build(): WorkflowDefinition;
1775
1785
  }
1776
1786
  //#endregion
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AgentConfigInspector, AgentConnectionNodeCollector, AgentGuardrailDefaults, AgentMessageConfigNormalizer, CallableToolConfig, ConnectionInvocationIdFactory, ConnectionNodeIdFactory, CoreTokens, DefinedNodeRegistry, ItemValueResolver, ItemsInputNormalizer, NodeBackedToolConfig, NodeOutputNormalizer, RetryPolicy, RunnableOutputBehaviorResolver, WorkflowBuilder, chatModel, emitPorts, getOriginIndexFromItem, inject, injectable, isPortsEmission, node } from "@codemation/core";
1
+ import { AgentConfigInspector, AgentConnectionNodeCollector, AgentGuardrailDefaults, AgentMessageConfigNormalizer, CallableToolConfig, ConnectionInvocationIdFactory, ConnectionNodeIdFactory, CoreTokens, DefinedNodeRegistry, ItemExprResolver, ItemsInputNormalizer, NodeBackedToolConfig, NodeOutputNormalizer, RetryPolicy, RunnableOutputBehaviorResolver, WorkflowBuilder, chatModel, emitPorts, getOriginIndexFromItem, inject, injectable, isPortsEmission, node } from "@codemation/core";
2
2
  import { ChatOpenAI } from "@langchain/openai";
3
3
  import { AIMessage, HumanMessage, SystemMessage, ToolMessage } from "@langchain/core/messages";
4
4
  import { isInteropZodSchema } from "@langchain/core/utils/types";
@@ -2690,9 +2690,9 @@ var AgentToolCallPortMap = class {
2690
2690
  //#region src/nodes/NodeBackedToolRuntime.ts
2691
2691
  var _ref$1, _ref2$1, _ref3$1;
2692
2692
  let NodeBackedToolRuntime = class NodeBackedToolRuntime$1 {
2693
- constructor(nodeResolver, itemValueResolver, outputNormalizer, outputBehaviorResolver) {
2693
+ constructor(nodeResolver, itemExprResolver, outputNormalizer, outputBehaviorResolver) {
2694
2694
  this.nodeResolver = nodeResolver;
2695
- this.itemValueResolver = itemValueResolver;
2695
+ this.itemExprResolver = itemExprResolver;
2696
2696
  this.outputNormalizer = outputNormalizer;
2697
2697
  this.outputBehaviorResolver = outputBehaviorResolver;
2698
2698
  }
@@ -2734,7 +2734,7 @@ let NodeBackedToolRuntime = class NodeBackedToolRuntime$1 {
2734
2734
  item: nodeInput,
2735
2735
  itemIndex: 0,
2736
2736
  items,
2737
- ctx: await this.itemValueResolver.resolveConfigForItem(ctx, nodeInput, 0, items)
2737
+ ctx: await this.itemExprResolver.resolveConfigForItem(ctx, nodeInput, 0, items)
2738
2738
  };
2739
2739
  const raw = await Promise.resolve(runnable.execute(execArgs));
2740
2740
  return this.outputNormalizer.normalizeExecuteResult({
@@ -2755,12 +2755,12 @@ let NodeBackedToolRuntime = class NodeBackedToolRuntime$1 {
2755
2755
  NodeBackedToolRuntime = __decorate([
2756
2756
  injectable(),
2757
2757
  __decorateParam(0, inject(CoreTokens.NodeResolver)),
2758
- __decorateParam(1, inject(ItemValueResolver)),
2758
+ __decorateParam(1, inject(ItemExprResolver)),
2759
2759
  __decorateParam(2, inject(NodeOutputNormalizer)),
2760
2760
  __decorateParam(3, inject(RunnableOutputBehaviorResolver)),
2761
2761
  __decorateMetadata("design:paramtypes", [
2762
2762
  Object,
2763
- typeof (_ref$1 = typeof ItemValueResolver !== "undefined" && ItemValueResolver) === "function" ? _ref$1 : Object,
2763
+ typeof (_ref$1 = typeof ItemExprResolver !== "undefined" && ItemExprResolver) === "function" ? _ref$1 : Object,
2764
2764
  typeof (_ref2$1 = typeof NodeOutputNormalizer !== "undefined" && NodeOutputNormalizer) === "function" ? _ref2$1 : Object,
2765
2765
  typeof (_ref3$1 = typeof RunnableOutputBehaviorResolver !== "undefined" && RunnableOutputBehaviorResolver) === "function" ? _ref3$1 : Object
2766
2766
  ])
@@ -2782,7 +2782,7 @@ let AIAgentNode = class AIAgentNode$1 {
2782
2782
  outputPorts = ["main"];
2783
2783
  /**
2784
2784
  * Engine validates {@link RunnableNodeConfig.inputSchema} (Zod) on {@code item.json} before enqueue, then resolves
2785
- * per-item **`itemValue`** leaves on config before {@link #execute}. Prefer modeling prompts as
2785
+ * per-item **`itemExpr`** leaves on config before {@link #execute}. Prefer modeling prompts as
2786
2786
  * {@code { messages: [{ role, content }, ...] }} (on input or config) so persisted inputs are visible in the UI.
2787
2787
  */
2788
2788
  inputSchema = unknown();
@@ -3428,6 +3428,7 @@ var Aggregate = class {
3428
3428
  kind = "node";
3429
3429
  type = AggregateNode;
3430
3430
  execution = { hint: "local" };
3431
+ keepBinaries = true;
3431
3432
  icon = "lucide:layers";
3432
3433
  constructor(name, aggregate, id) {
3433
3434
  this.name = name;
@@ -3582,6 +3583,7 @@ var Split = class {
3582
3583
  kind = "node";
3583
3584
  type = SplitNode;
3584
3585
  execution = { hint: "local" };
3586
+ keepBinaries = true;
3585
3587
  /**
3586
3588
  * When splitting yields zero items for a batch, downstream single-input nodes still run once with an empty batch.
3587
3589
  * Mirrors {@link MapData}'s empty-output behavior.