@codemation/core-nodes 0.1.0 → 0.2.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.
- package/CHANGELOG.md +45 -0
- package/dist/index.cjs +444 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +173 -60
- package/dist/index.d.ts +173 -60
- package/dist/index.js +428 -138
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/chatModels/OpenAIStructuredOutputMethodFactory.ts +46 -0
- package/src/index.ts +1 -0
- package/src/nodes/AIAgentConfig.ts +3 -0
- package/src/nodes/AIAgentExecutionHelpersFactory.ts +18 -11
- package/src/nodes/AIAgentNode.ts +145 -6
- package/src/nodes/AgentStructuredOutputRepairPromptFactory.ts +61 -0
- package/src/nodes/AgentStructuredOutputRunner.ts +222 -0
- package/src/nodes/NodeBackedToolRuntime.ts +12 -3
- package/src/nodes/aiAgent.ts +2 -0
- package/src/nodes/mapData.ts +15 -2
- package/src/nodes/switch.ts +0 -1
- package/src/workflowAuthoring/WorkflowAgentNodeFactory.types.ts +5 -9
- package/src/workflowAuthoring/WorkflowAuthoringOptions.types.ts +9 -3
- package/src/workflowAuthoring/WorkflowBranchBuilder.types.ts +4 -3
- package/src/workflowAuthoring/WorkflowChain.types.ts +8 -3
- package/src/workflowAuthoring.types.ts +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -311,8 +311,10 @@ interface TriggerCleanupHandle {
|
|
|
311
311
|
stop(): Promise<void> | void;
|
|
312
312
|
}
|
|
313
313
|
/**
|
|
314
|
-
* Per-item runnable node: return JSON, an array to fan-out on `main`, or {@link emitPorts}
|
|
315
|
-
* Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input`
|
|
314
|
+
* Per-item runnable node: return JSON, an array to fan-out on `main`, an explicit `Item`, or {@link emitPorts}
|
|
315
|
+
* for multi-port emission. Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input`
|
|
316
|
+
* (wire `item.json` is unchanged). Transform helpers may opt into binary preservation, while routers and
|
|
317
|
+
* pass-through nodes should return explicit items when they need to preserve full item state.
|
|
316
318
|
*/
|
|
317
319
|
interface RunnableNodeExecuteArgs<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown> {
|
|
318
320
|
readonly input: TInputJson$1;
|
|
@@ -442,7 +444,6 @@ interface NodeConfigBase {
|
|
|
442
444
|
declare const runnableNodeInputType: unique symbol;
|
|
443
445
|
declare const runnableNodeOutputType: unique symbol;
|
|
444
446
|
declare const triggerNodeOutputType: unique symbol;
|
|
445
|
-
type LineageCarryPolicy = "emitOnly" | "carryThrough";
|
|
446
447
|
/**
|
|
447
448
|
* Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).
|
|
448
449
|
* **`TOutputJson`** is emitted `item.json` on outputs.
|
|
@@ -456,11 +457,6 @@ interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> ex
|
|
|
456
457
|
* Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
|
|
457
458
|
*/
|
|
458
459
|
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
459
|
-
/**
|
|
460
|
-
* Overrides default lineage propagation for `execute` outputs (binary/meta/paired).
|
|
461
|
-
* Routers with multiple {@link RunnableNode#outputPorts} default to **`carryThrough`**; others default to **`emitOnly`**.
|
|
462
|
-
*/
|
|
463
|
-
readonly lineageCarry?: LineageCarryPolicy;
|
|
464
460
|
/**
|
|
465
461
|
* When an activation receives **zero** input items, the engine normally runs `execute` zero times.
|
|
466
462
|
* Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).
|
|
@@ -594,6 +590,12 @@ type CredentialFieldSchema = Readonly<{
|
|
|
594
590
|
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
595
591
|
required?: true;
|
|
596
592
|
order?: number;
|
|
593
|
+
/**
|
|
594
|
+
* Where this field appears in the credential dialog. Use `"advanced"` for optional or
|
|
595
|
+
* power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).
|
|
596
|
+
* Defaults to `"default"` when omitted.
|
|
597
|
+
*/
|
|
598
|
+
visibility?: "default" | "advanced";
|
|
597
599
|
placeholder?: string;
|
|
598
600
|
helpText?: string;
|
|
599
601
|
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
@@ -626,26 +628,47 @@ type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
|
626
628
|
tokenUrlFieldKey: string;
|
|
627
629
|
userInfoUrlFieldKey?: string;
|
|
628
630
|
}>;
|
|
631
|
+
type CredentialOAuth2ScopesFromPublicConfig = Readonly<{
|
|
632
|
+
presetFieldKey: string;
|
|
633
|
+
presetScopes: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
634
|
+
customPresetKey?: string;
|
|
635
|
+
customScopesFieldKey?: string;
|
|
636
|
+
}>;
|
|
629
637
|
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
630
638
|
kind: "oauth2";
|
|
631
639
|
providerId: string;
|
|
632
640
|
scopes: ReadonlyArray<string>;
|
|
641
|
+
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
633
642
|
clientIdFieldKey?: string;
|
|
634
643
|
clientSecretFieldKey?: string;
|
|
635
644
|
} | {
|
|
636
645
|
kind: "oauth2";
|
|
637
646
|
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
638
647
|
scopes: ReadonlyArray<string>;
|
|
648
|
+
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
639
649
|
clientIdFieldKey?: string;
|
|
640
650
|
clientSecretFieldKey?: string;
|
|
641
651
|
}>;
|
|
642
652
|
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
653
|
+
type CredentialAdvancedSectionPresentation = Readonly<{
|
|
654
|
+
/** Collapsible section title (default: "Advanced"). */
|
|
655
|
+
title?: string;
|
|
656
|
+
/** Optional short helper text shown inside the section (above the fields). */
|
|
657
|
+
description?: string;
|
|
658
|
+
/** When true, the advanced section starts expanded. Default: false (collapsed). */
|
|
659
|
+
defaultOpen?: boolean;
|
|
660
|
+
}>;
|
|
643
661
|
type CredentialTypeDefinition = Readonly<{
|
|
644
662
|
typeId: CredentialTypeId;
|
|
645
663
|
displayName: string;
|
|
646
664
|
description?: string;
|
|
647
665
|
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
648
666
|
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
667
|
+
/**
|
|
668
|
+
* Optional labels for the collapsible block that contains every field with `visibility: "advanced"`.
|
|
669
|
+
* If omitted, the UI still shows that block with defaults (title "Advanced", collapsed).
|
|
670
|
+
*/
|
|
671
|
+
advancedSection?: CredentialAdvancedSectionPresentation;
|
|
649
672
|
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
650
673
|
auth?: CredentialAuthDefinition;
|
|
651
674
|
}>;
|
|
@@ -819,6 +842,16 @@ interface ChatModelConfig {
|
|
|
819
842
|
interface LangChainChatModelLike {
|
|
820
843
|
invoke(input: unknown, options?: unknown): Promise<unknown>;
|
|
821
844
|
bindTools?(tools: ReadonlyArray<unknown>): LangChainChatModelLike;
|
|
845
|
+
withStructuredOutput?(outputSchema: ZodSchemaAny, config?: ChatModelStructuredOutputOptions): LangChainStructuredOutputModelLike;
|
|
846
|
+
}
|
|
847
|
+
interface LangChainStructuredOutputModelLike {
|
|
848
|
+
invoke(input: unknown, options?: unknown): Promise<unknown>;
|
|
849
|
+
}
|
|
850
|
+
interface ChatModelStructuredOutputOptions {
|
|
851
|
+
readonly method?: "jsonSchema" | "functionCalling" | "jsonMode";
|
|
852
|
+
readonly strict?: boolean;
|
|
853
|
+
readonly includeRaw?: boolean;
|
|
854
|
+
readonly tools?: ReadonlyArray<unknown>;
|
|
822
855
|
}
|
|
823
856
|
interface ChatModelFactory<TConfig extends ChatModelConfig = ChatModelConfig> {
|
|
824
857
|
create(args: Readonly<{
|
|
@@ -858,6 +891,7 @@ interface AgentNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> exten
|
|
|
858
891
|
readonly chatModel: ChatModelConfig;
|
|
859
892
|
readonly tools?: ReadonlyArray<ToolConfig>;
|
|
860
893
|
readonly guardrails?: AgentGuardrailConfig;
|
|
894
|
+
readonly outputSchema?: ZodType<TOutputJson$1>;
|
|
861
895
|
}
|
|
862
896
|
//#endregion
|
|
863
897
|
//#region ../core/src/execution/ItemValueResolver.d.ts
|
|
@@ -868,18 +902,27 @@ declare class ItemValueResolver {
|
|
|
868
902
|
resolveConfigForItem<TConfig extends RunnableNodeConfig<any, any>>(ctx: NodeExecutionContext<TConfig>, item: Item, itemIndex: number, items: ReadonlyArray<Item>): Promise<NodeExecutionContext<TConfig>>;
|
|
869
903
|
}
|
|
870
904
|
//#endregion
|
|
905
|
+
//#region ../core/src/execution/RunnableOutputBehaviorResolver.d.ts
|
|
906
|
+
type RunnableOutputBehavior = Readonly<{
|
|
907
|
+
keepBinaries: boolean;
|
|
908
|
+
}>;
|
|
909
|
+
declare class RunnableOutputBehaviorResolver {
|
|
910
|
+
resolve(config: RunnableNodeConfig): RunnableOutputBehavior;
|
|
911
|
+
private isKeepBinariesEnabled;
|
|
912
|
+
}
|
|
913
|
+
//#endregion
|
|
871
914
|
//#region ../core/src/execution/NodeOutputNormalizer.d.ts
|
|
872
915
|
declare class NodeOutputNormalizer {
|
|
873
916
|
normalizeExecuteResult(args: Readonly<{
|
|
874
917
|
baseItem: Item;
|
|
875
918
|
raw: unknown;
|
|
876
|
-
|
|
919
|
+
behavior: RunnableOutputBehavior;
|
|
877
920
|
}>): NodeOutputs;
|
|
878
921
|
private arrayFanOutToMain;
|
|
879
922
|
private emitPortsToOutputs;
|
|
880
923
|
private normalizePortPayload;
|
|
881
924
|
private isItemLike;
|
|
882
|
-
private
|
|
925
|
+
private applyOutput;
|
|
883
926
|
}
|
|
884
927
|
//#endregion
|
|
885
928
|
//#region src/chatModels/openAiChatModelConfig.d.ts
|
|
@@ -908,6 +951,15 @@ declare class OpenAIChatModelFactory implements ChatModelFactory<OpenAIChatModel
|
|
|
908
951
|
}>): Promise<LangChainChatModelLike>;
|
|
909
952
|
}
|
|
910
953
|
//#endregion
|
|
954
|
+
//#region src/chatModels/OpenAIStructuredOutputMethodFactory.d.ts
|
|
955
|
+
declare class OpenAIStructuredOutputMethodFactory {
|
|
956
|
+
private static readonly isoDatePattern;
|
|
957
|
+
create(chatModelConfig: ChatModelConfig): ChatModelStructuredOutputOptions | undefined;
|
|
958
|
+
private readModelName;
|
|
959
|
+
private supportsJsonSchema;
|
|
960
|
+
private supportsSnapshotAtOrAfter;
|
|
961
|
+
}
|
|
962
|
+
//#endregion
|
|
911
963
|
//#region src/chatModels/OpenAiCredentialSession.d.ts
|
|
912
964
|
/** Resolved credential session for OpenAI-compatible chat models (API key + optional custom base URL). */
|
|
913
965
|
type OpenAiCredentialSession = Readonly<{
|
|
@@ -947,45 +999,6 @@ declare class AgentOutputFactory {
|
|
|
947
999
|
static fromAgentContent(content: string): unknown;
|
|
948
1000
|
}
|
|
949
1001
|
//#endregion
|
|
950
|
-
//#region src/nodes/AgentToolCallPortMapFactory.d.ts
|
|
951
|
-
declare class AgentToolCallPortMap {
|
|
952
|
-
static fromInput(input: unknown): NodeInputsByPort;
|
|
953
|
-
}
|
|
954
|
-
//#endregion
|
|
955
|
-
//#region src/nodes/AIAgentConfig.d.ts
|
|
956
|
-
interface AIAgentOptions<TInputJson$1 = unknown, _TOutputJson = unknown> {
|
|
957
|
-
readonly name: string;
|
|
958
|
-
readonly messages: AgentMessageConfig<TInputJson$1>;
|
|
959
|
-
readonly chatModel: ChatModelConfig;
|
|
960
|
-
readonly tools?: ReadonlyArray<ToolConfig>;
|
|
961
|
-
readonly id?: string;
|
|
962
|
-
readonly retryPolicy?: RetryPolicySpec;
|
|
963
|
-
readonly guardrails?: AgentGuardrailConfig;
|
|
964
|
-
/** Engine applies with {@link RunnableNodeConfig.inputSchema} before {@link AIAgentNode.execute}. */
|
|
965
|
-
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
966
|
-
}
|
|
967
|
-
/**
|
|
968
|
-
* AI agent: credential bindings are keyed to connection-owned LLM/tool node ids (ConnectionNodeIdFactory),
|
|
969
|
-
* not to the agent workflow node id.
|
|
970
|
-
*/
|
|
971
|
-
declare class AIAgent<TInputJson$1 = unknown, TOutputJson$1 = unknown> implements RunnableNodeConfig<TInputJson$1, TOutputJson$1>, AgentNodeConfig<TInputJson$1, TOutputJson$1> {
|
|
972
|
-
readonly kind: "node";
|
|
973
|
-
readonly type: TypeToken<unknown>;
|
|
974
|
-
readonly execution: {
|
|
975
|
-
readonly hint: "local";
|
|
976
|
-
};
|
|
977
|
-
readonly icon: "lucide:bot";
|
|
978
|
-
readonly name: string;
|
|
979
|
-
readonly messages: AgentMessageConfig<TInputJson$1>;
|
|
980
|
-
readonly chatModel: ChatModelConfig;
|
|
981
|
-
readonly tools: ReadonlyArray<ToolConfig>;
|
|
982
|
-
readonly id?: string;
|
|
983
|
-
readonly retryPolicy: RetryPolicySpec;
|
|
984
|
-
readonly guardrails?: AgentGuardrailConfig;
|
|
985
|
-
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
986
|
-
constructor(options: AIAgentOptions<TInputJson$1, TOutputJson$1>);
|
|
987
|
-
}
|
|
988
|
-
//#endregion
|
|
989
1002
|
//#region src/nodes/ConnectionCredentialExecutionContextFactory.d.ts
|
|
990
1003
|
/**
|
|
991
1004
|
* Builds a {@link NodeExecutionContext} whose identity for credential binding and `getCredential`
|
|
@@ -1046,19 +1059,106 @@ declare class AIAgentExecutionHelpersFactory {
|
|
|
1046
1059
|
* (duplicate `zod` copies), fall back to Zod `toJSONSchema` with draft-07.
|
|
1047
1060
|
* - Strip root `$schema` for OpenAI; normalize invalid `required` keywords for cfworker; ensure `properties`.
|
|
1048
1061
|
*/
|
|
1049
|
-
|
|
1062
|
+
createJsonSchemaRecord(inputSchema: ZodSchemaAny, options: Readonly<{
|
|
1063
|
+
schemaName: string;
|
|
1064
|
+
requireObjectRoot: boolean;
|
|
1065
|
+
}>): Record<string, unknown>;
|
|
1050
1066
|
/**
|
|
1051
1067
|
* `@cfworker/json-schema` iterates `schema.required` with `for...of`; it must be a string array or absent.
|
|
1052
1068
|
*/
|
|
1053
1069
|
private sanitizeJsonSchemaRequiredKeywordsForCfworker;
|
|
1054
1070
|
}
|
|
1055
1071
|
//#endregion
|
|
1072
|
+
//#region src/nodes/AgentStructuredOutputRepairPromptFactory.d.ts
|
|
1073
|
+
declare class AgentStructuredOutputRepairPromptFactory {
|
|
1074
|
+
private readonly executionHelpers;
|
|
1075
|
+
private static readonly maxSchemaLength;
|
|
1076
|
+
private static readonly maxInvalidContentLength;
|
|
1077
|
+
private static readonly maxValidationErrorLength;
|
|
1078
|
+
constructor(executionHelpers: AIAgentExecutionHelpersFactory);
|
|
1079
|
+
create(args: Readonly<{
|
|
1080
|
+
schema: ZodSchemaAny;
|
|
1081
|
+
invalidContent: string;
|
|
1082
|
+
validationError: string;
|
|
1083
|
+
}>): ReadonlyArray<AgentMessageDto>;
|
|
1084
|
+
private truncate;
|
|
1085
|
+
}
|
|
1086
|
+
//#endregion
|
|
1087
|
+
//#region src/nodes/AgentStructuredOutputRunner.d.ts
|
|
1088
|
+
declare class AgentStructuredOutputRunner {
|
|
1089
|
+
private readonly repairPromptFactory;
|
|
1090
|
+
private readonly openAiStructuredOutputMethodFactory;
|
|
1091
|
+
private static readonly repairAttemptCount;
|
|
1092
|
+
constructor(repairPromptFactory: AgentStructuredOutputRepairPromptFactory, openAiStructuredOutputMethodFactory: OpenAIStructuredOutputMethodFactory);
|
|
1093
|
+
resolve<TOutput>(args: Readonly<{
|
|
1094
|
+
model: LangChainChatModelLike;
|
|
1095
|
+
chatModelConfig: ChatModelConfig;
|
|
1096
|
+
schema: ZodSchemaAny;
|
|
1097
|
+
conversation: ReadonlyArray<BaseMessage>;
|
|
1098
|
+
rawFinalResponse?: AIMessage;
|
|
1099
|
+
agentName: string;
|
|
1100
|
+
nodeId: string;
|
|
1101
|
+
invokeTextModel: (messages: ReadonlyArray<BaseMessage>) => Promise<AIMessage>;
|
|
1102
|
+
invokeStructuredModel: (model: LangChainStructuredOutputModelLike, messages: ReadonlyArray<BaseMessage>) => Promise<unknown>;
|
|
1103
|
+
}>): Promise<TOutput>;
|
|
1104
|
+
private retryWithRepairPrompt;
|
|
1105
|
+
private createStructuredOutputModel;
|
|
1106
|
+
private getStructuredOutputOptions;
|
|
1107
|
+
private supportsNativeStructuredOutput;
|
|
1108
|
+
private tryParseAndValidate;
|
|
1109
|
+
private tryValidateStructuredValue;
|
|
1110
|
+
private summarizeError;
|
|
1111
|
+
private toJson;
|
|
1112
|
+
}
|
|
1113
|
+
//#endregion
|
|
1114
|
+
//#region src/nodes/AgentToolCallPortMapFactory.d.ts
|
|
1115
|
+
declare class AgentToolCallPortMap {
|
|
1116
|
+
static fromInput(input: unknown): NodeInputsByPort;
|
|
1117
|
+
}
|
|
1118
|
+
//#endregion
|
|
1119
|
+
//#region src/nodes/AIAgentConfig.d.ts
|
|
1120
|
+
interface AIAgentOptions<TInputJson$1 = unknown, _TOutputJson = unknown> {
|
|
1121
|
+
readonly name: string;
|
|
1122
|
+
readonly messages: AgentMessageConfig<TInputJson$1>;
|
|
1123
|
+
readonly chatModel: ChatModelConfig;
|
|
1124
|
+
readonly tools?: ReadonlyArray<ToolConfig>;
|
|
1125
|
+
readonly id?: string;
|
|
1126
|
+
readonly retryPolicy?: RetryPolicySpec;
|
|
1127
|
+
readonly guardrails?: AgentGuardrailConfig;
|
|
1128
|
+
/** Engine applies with {@link RunnableNodeConfig.inputSchema} before {@link AIAgentNode.execute}. */
|
|
1129
|
+
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
1130
|
+
readonly outputSchema?: ZodType<_TOutputJson>;
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* AI agent: credential bindings are keyed to connection-owned LLM/tool node ids (ConnectionNodeIdFactory),
|
|
1134
|
+
* not to the agent workflow node id.
|
|
1135
|
+
*/
|
|
1136
|
+
declare class AIAgent<TInputJson$1 = unknown, TOutputJson$1 = unknown> implements RunnableNodeConfig<TInputJson$1, TOutputJson$1>, AgentNodeConfig<TInputJson$1, TOutputJson$1> {
|
|
1137
|
+
readonly kind: "node";
|
|
1138
|
+
readonly type: TypeToken<unknown>;
|
|
1139
|
+
readonly execution: {
|
|
1140
|
+
readonly hint: "local";
|
|
1141
|
+
};
|
|
1142
|
+
readonly icon: "lucide:bot";
|
|
1143
|
+
readonly name: string;
|
|
1144
|
+
readonly messages: AgentMessageConfig<TInputJson$1>;
|
|
1145
|
+
readonly chatModel: ChatModelConfig;
|
|
1146
|
+
readonly tools: ReadonlyArray<ToolConfig>;
|
|
1147
|
+
readonly id?: string;
|
|
1148
|
+
readonly retryPolicy: RetryPolicySpec;
|
|
1149
|
+
readonly guardrails?: AgentGuardrailConfig;
|
|
1150
|
+
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
1151
|
+
readonly outputSchema?: ZodType<TOutputJson$1>;
|
|
1152
|
+
constructor(options: AIAgentOptions<TInputJson$1, TOutputJson$1>);
|
|
1153
|
+
}
|
|
1154
|
+
//#endregion
|
|
1056
1155
|
//#region src/nodes/NodeBackedToolRuntime.d.ts
|
|
1057
1156
|
declare class NodeBackedToolRuntime {
|
|
1058
1157
|
private readonly nodeResolver;
|
|
1059
1158
|
private readonly itemValueResolver;
|
|
1060
1159
|
private readonly outputNormalizer;
|
|
1061
|
-
|
|
1160
|
+
private readonly outputBehaviorResolver;
|
|
1161
|
+
constructor(nodeResolver: NodeResolver, itemValueResolver: ItemValueResolver, outputNormalizer: NodeOutputNormalizer, outputBehaviorResolver: RunnableOutputBehaviorResolver);
|
|
1062
1162
|
execute(config: NodeBackedToolConfig<any, ZodSchemaAny, ZodSchemaAny>, args: ToolExecuteArgs): Promise<unknown>;
|
|
1063
1163
|
private executeResolvedNode;
|
|
1064
1164
|
private isRunnableNode;
|
|
@@ -1070,6 +1170,7 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
1070
1170
|
private readonly nodeResolver;
|
|
1071
1171
|
private readonly nodeBackedToolRuntime;
|
|
1072
1172
|
private readonly executionHelpers;
|
|
1173
|
+
private readonly structuredOutputRunner;
|
|
1073
1174
|
kind: "node";
|
|
1074
1175
|
outputPorts: readonly ["main"];
|
|
1075
1176
|
/**
|
|
@@ -1081,7 +1182,7 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
1081
1182
|
private readonly connectionCredentialExecutionContextFactory;
|
|
1082
1183
|
/** One resolved model/tools bundle per activation context (same ctx across items in a batch). */
|
|
1083
1184
|
private readonly preparedByExecutionContext;
|
|
1084
|
-
constructor(nodeResolver: NodeResolver, credentialSessions: CredentialSessionService, nodeBackedToolRuntime: NodeBackedToolRuntime, executionHelpers: AIAgentExecutionHelpersFactory);
|
|
1185
|
+
constructor(nodeResolver: NodeResolver, credentialSessions: CredentialSessionService, nodeBackedToolRuntime: NodeBackedToolRuntime, executionHelpers: AIAgentExecutionHelpersFactory, structuredOutputRunner: AgentStructuredOutputRunner);
|
|
1085
1186
|
execute(args: RunnableNodeExecuteArgs<AIAgent<any, any>>): Promise<unknown>;
|
|
1086
1187
|
private getOrPrepareExecution;
|
|
1087
1188
|
/**
|
|
@@ -1099,11 +1200,13 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
1099
1200
|
private cannotExecuteAnotherToolRound;
|
|
1100
1201
|
private finishOrThrowWhenTurnCapHitWithToolCalls;
|
|
1101
1202
|
private appendAssistantAndToolMessages;
|
|
1203
|
+
private resolveFinalOutputJson;
|
|
1102
1204
|
private buildOutputItem;
|
|
1103
1205
|
private bindToolsToModel;
|
|
1104
1206
|
private resolveTools;
|
|
1105
1207
|
private createItemScopedTools;
|
|
1106
1208
|
private invokeModel;
|
|
1209
|
+
private invokeStructuredModel;
|
|
1107
1210
|
private markQueuedTools;
|
|
1108
1211
|
private executeToolCalls;
|
|
1109
1212
|
private planToolCalls;
|
|
@@ -1120,7 +1223,12 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
1120
1223
|
* json-schema validation). {@link NodeBackedToolConfig#toolKind} is stable across copies.
|
|
1121
1224
|
*/
|
|
1122
1225
|
private isNodeBackedToolConfig;
|
|
1226
|
+
/**
|
|
1227
|
+
* Callable tools use {@link CallableToolConfig#toolKind} for cross-package / JSON round-trip safety.
|
|
1228
|
+
*/
|
|
1229
|
+
private isCallableToolConfig;
|
|
1123
1230
|
private resolveGuardrails;
|
|
1231
|
+
private getAgentDisplayName;
|
|
1124
1232
|
}
|
|
1125
1233
|
//#endregion
|
|
1126
1234
|
//#region src/nodes/CallbackNode.d.ts
|
|
@@ -1308,7 +1416,6 @@ declare class Switch<TInputJson$1 = unknown> implements RunnableNodeConfig<TInpu
|
|
|
1308
1416
|
readonly hint: "local";
|
|
1309
1417
|
};
|
|
1310
1418
|
readonly icon: "lucide:git-branch-plus";
|
|
1311
|
-
readonly lineageCarry: "carryThrough";
|
|
1312
1419
|
readonly declaredOutputPorts: ReadonlyArray<string>;
|
|
1313
1420
|
constructor(name: string, cfg: Readonly<{
|
|
1314
1421
|
cases: readonly string[];
|
|
@@ -1384,10 +1491,14 @@ declare class MapDataNode implements RunnableNode<MapData<any, any>> {
|
|
|
1384
1491
|
}
|
|
1385
1492
|
//#endregion
|
|
1386
1493
|
//#region src/nodes/mapData.d.ts
|
|
1494
|
+
interface MapDataOptions {
|
|
1495
|
+
readonly id?: string;
|
|
1496
|
+
readonly keepBinaries?: boolean;
|
|
1497
|
+
}
|
|
1387
1498
|
declare class MapData<TInputJson$1 = unknown, TOutputJson$1 = unknown> implements RunnableNodeConfig<TInputJson$1, TOutputJson$1> {
|
|
1388
1499
|
readonly name: string;
|
|
1389
1500
|
readonly map: (item: Item<TInputJson$1>, ctx: NodeExecutionContext<MapData<TInputJson$1, TOutputJson$1>>) => TOutputJson$1;
|
|
1390
|
-
readonly
|
|
1501
|
+
private readonly options;
|
|
1391
1502
|
readonly kind: "node";
|
|
1392
1503
|
readonly type: TypeToken<unknown>;
|
|
1393
1504
|
readonly execution: {
|
|
@@ -1395,7 +1506,9 @@ declare class MapData<TInputJson$1 = unknown, TOutputJson$1 = unknown> implement
|
|
|
1395
1506
|
};
|
|
1396
1507
|
/** Zero mapped items should still allow downstream nodes to run. */
|
|
1397
1508
|
readonly continueWhenEmptyOutput: true;
|
|
1398
|
-
|
|
1509
|
+
readonly keepBinaries: boolean;
|
|
1510
|
+
constructor(name: string, map: (item: Item<TInputJson$1>, ctx: NodeExecutionContext<MapData<TInputJson$1, TOutputJson$1>>) => TOutputJson$1, options?: MapDataOptions);
|
|
1511
|
+
get id(): string | undefined;
|
|
1399
1512
|
}
|
|
1400
1513
|
//#endregion
|
|
1401
1514
|
//#region src/nodes/MergeNode.d.ts
|
|
@@ -1570,9 +1683,9 @@ declare function createWorkflowBuilder(meta: Readonly<{
|
|
|
1570
1683
|
}>): WorkflowBuilder;
|
|
1571
1684
|
//#endregion
|
|
1572
1685
|
//#region src/workflowAuthoring/WorkflowAuthoringOptions.types.d.ts
|
|
1573
|
-
type
|
|
1686
|
+
type WorkflowAgentMessages<TCurrentJson> = AgentMessageConfig<TCurrentJson>;
|
|
1574
1687
|
interface WorkflowAgentOptions<TCurrentJson, TOutputSchema extends z.ZodTypeAny | undefined = undefined> {
|
|
1575
|
-
readonly
|
|
1688
|
+
readonly messages: WorkflowAgentMessages<TCurrentJson>;
|
|
1576
1689
|
readonly model: string | ChatModelConfig;
|
|
1577
1690
|
readonly tools?: ReadonlyArray<ToolConfig>;
|
|
1578
1691
|
readonly outputSchema?: TOutputSchema;
|
|
@@ -1587,7 +1700,7 @@ declare class WorkflowBranchBuilder<TCurrentJson> {
|
|
|
1587
1700
|
constructor(steps?: ReadonlyArray<AnyRunnableNodeConfig>);
|
|
1588
1701
|
then<TOutputJson$1, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson$1>>(config: TConfig): WorkflowBranchBuilder<RunnableNodeOutputJson<TConfig>>;
|
|
1589
1702
|
map<TNextJson$1>(mapper: (item: TCurrentJson) => TNextJson$1): WorkflowBranchBuilder<TNextJson$1>;
|
|
1590
|
-
map<TNextJson$1>(name: string, mapper: (item: TCurrentJson) => TNextJson$1,
|
|
1703
|
+
map<TNextJson$1>(name: string, mapper: (item: TCurrentJson) => TNextJson$1, options?: MapDataOptions): WorkflowBranchBuilder<TNextJson$1>;
|
|
1591
1704
|
wait(duration: number | string): WorkflowBranchBuilder<TCurrentJson>;
|
|
1592
1705
|
wait(name: string, duration: number | string, id?: string): WorkflowBranchBuilder<TCurrentJson>;
|
|
1593
1706
|
split<TElem>(getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[]): WorkflowBranchBuilder<TElem>;
|
|
@@ -1611,7 +1724,7 @@ declare class WorkflowChain<TCurrentJson> {
|
|
|
1611
1724
|
constructor(chain: ChainCursor<TCurrentJson>);
|
|
1612
1725
|
then<TOutputJson$1, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson$1>>(config: TConfig): WorkflowChain<RunnableNodeOutputJson<TConfig>>;
|
|
1613
1726
|
map<TNextJson$1>(mapper: (item: TCurrentJson) => TNextJson$1): WorkflowChain<TNextJson$1>;
|
|
1614
|
-
map<TNextJson$1>(name: string, mapper: (item: TCurrentJson) => TNextJson$1,
|
|
1727
|
+
map<TNextJson$1>(name: string, mapper: (item: TCurrentJson) => TNextJson$1, options?: MapDataOptions): WorkflowChain<TNextJson$1>;
|
|
1615
1728
|
wait(duration: number | string): WorkflowChain<TCurrentJson>;
|
|
1616
1729
|
wait(name: string, duration: number | string, id?: string): WorkflowChain<TCurrentJson>;
|
|
1617
1730
|
split<TElem>(getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[]): WorkflowChain<TElem>;
|
|
@@ -1714,5 +1827,5 @@ declare class AIAgentConnectionWorkflowExpander {
|
|
|
1714
1827
|
private assertNoIdCollision;
|
|
1715
1828
|
}
|
|
1716
1829
|
//#endregion
|
|
1717
|
-
export { AIAgent, AIAgentConnectionWorkflowExpander, AIAgentExecutionHelpersFactory, AIAgentNode, AgentItemPortMap, AgentMessageFactory, AgentOutputFactory, AgentToolCallPortMap, Aggregate, AggregateNode, Callback, CallbackHandler, CallbackNode, CallbackOptions, CallbackResultNormalizer, CanvasIconName, ConnectionCredentialExecutionContextFactory, ConnectionCredentialNode, ConnectionCredentialNodeConfig, ConnectionCredentialNodeConfigFactory, ExecutedToolCall, Filter, FilterNode, HttpRequest, HttpRequestDownloadMode, HttpRequestNode, HttpRequestOutputJson, If, IfNode, ItemScopedToolBinding, ManualTrigger, ManualTriggerNode, MapData, MapDataNode, Merge, MergeMode, MergeNode, NoOp, NoOpNode, OpenAIChatModelConfig, OpenAIChatModelFactory, OpenAiChatModelPresets, OpenAiCredentialSession, PlannedToolCall, ResolvedTool, Split, SplitNode, SubWorkflow, SubWorkflowNode, Switch, SwitchCaseKeyResolver, SwitchNode, Wait, WaitDuration, WaitNode, WebhookRespondNowAndContinueError, WebhookRespondNowError, WebhookTrigger, WebhookTriggerNode, type WorkflowAgentOptions, WorkflowAuthoringBuilder, WorkflowBranchBuilder, WorkflowChain, createWorkflowBuilder, openAiChatModelPresets, registerCoreNodes, workflow };
|
|
1830
|
+
export { AIAgent, AIAgentConnectionWorkflowExpander, AIAgentExecutionHelpersFactory, AIAgentNode, AgentItemPortMap, AgentMessageFactory, AgentOutputFactory, AgentStructuredOutputRepairPromptFactory, AgentStructuredOutputRunner, AgentToolCallPortMap, Aggregate, AggregateNode, Callback, CallbackHandler, CallbackNode, CallbackOptions, CallbackResultNormalizer, CanvasIconName, ConnectionCredentialExecutionContextFactory, ConnectionCredentialNode, ConnectionCredentialNodeConfig, ConnectionCredentialNodeConfigFactory, ExecutedToolCall, Filter, FilterNode, HttpRequest, HttpRequestDownloadMode, HttpRequestNode, HttpRequestOutputJson, If, IfNode, ItemScopedToolBinding, ManualTrigger, ManualTriggerNode, MapData, MapDataNode, MapDataOptions, Merge, MergeMode, MergeNode, NoOp, NoOpNode, OpenAIChatModelConfig, OpenAIChatModelFactory, OpenAIStructuredOutputMethodFactory, OpenAiChatModelPresets, OpenAiCredentialSession, PlannedToolCall, ResolvedTool, Split, SplitNode, SubWorkflow, SubWorkflowNode, Switch, SwitchCaseKeyResolver, SwitchNode, Wait, WaitDuration, WaitNode, WebhookRespondNowAndContinueError, WebhookRespondNowError, WebhookTrigger, WebhookTriggerNode, type WorkflowAgentMessages, type WorkflowAgentOptions, WorkflowAuthoringBuilder, WorkflowBranchBuilder, WorkflowChain, createWorkflowBuilder, openAiChatModelPresets, registerCoreNodes, workflow };
|
|
1718
1831
|
//# sourceMappingURL=index.d.cts.map
|