@codemation/core-nodes 0.4.3 → 0.7.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 +237 -0
- package/dist/index.cjs +3541 -470
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1843 -685
- package/dist/index.d.ts +1843 -685
- package/dist/index.js +3498 -465
- package/dist/index.js.map +1 -1
- package/package.json +8 -5
- package/src/authoring/defineRestNode.types.ts +204 -0
- package/src/chatModels/OpenAIChatModelFactory.ts +17 -8
- package/src/chatModels/OpenAiStrictJsonSchemaFactory.ts +123 -0
- package/src/credentials/ApiKeyCredentialType.ts +60 -0
- package/src/credentials/BasicAuthCredentialType.ts +51 -0
- package/src/credentials/BearerTokenCredentialType.ts +40 -0
- package/src/credentials/OAuth2ClientCredentialsTypeFactory.ts +117 -0
- package/src/credentials/OAuth2TokenExchangeFactory.ts +52 -0
- package/src/credentials/index.ts +4 -0
- package/src/http/HttpBodyBuilder.ts +118 -0
- package/src/http/HttpRequestExecutor.ts +153 -0
- package/src/http/HttpUrlBuilder.ts +22 -0
- package/src/http/httpRequest.types.ts +96 -0
- package/src/index.ts +10 -1
- package/src/nodes/AIAgentExecutionHelpersFactory.ts +45 -59
- package/src/nodes/AIAgentNode.ts +391 -288
- package/src/nodes/AgentMessageFactory.ts +57 -49
- package/src/nodes/AgentStructuredOutputRunner.ts +65 -71
- package/src/nodes/AgentToolExecutionCoordinator.ts +31 -16
- package/src/nodes/AssertionNode.ts +42 -0
- package/src/nodes/CronTriggerFactory.ts +45 -0
- package/src/nodes/CronTriggerNode.ts +40 -0
- package/src/nodes/HttpRequestNodeFactory.ts +160 -16
- package/src/nodes/IsTestRunNode.ts +25 -0
- package/src/nodes/NodeBackedToolRuntime.ts +40 -4
- package/src/nodes/TestTriggerNode.ts +33 -0
- package/src/nodes/WebhookTriggerFactory.ts +1 -1
- package/src/nodes/aggregate.ts +1 -1
- package/src/nodes/aiAgentSupport.types.ts +22 -2
- package/src/nodes/assertion.ts +42 -0
- package/src/nodes/collections/collectionDeleteNode.types.ts +23 -0
- package/src/nodes/collections/collectionFindOneNode.types.ts +26 -0
- package/src/nodes/collections/collectionGetNode.types.ts +26 -0
- package/src/nodes/collections/collectionInsertNode.types.ts +22 -0
- package/src/nodes/collections/collectionListNode.types.ts +30 -0
- package/src/nodes/collections/collectionUpdateNode.types.ts +23 -0
- package/src/nodes/collections/index.ts +6 -0
- package/src/nodes/httpRequest.ts +106 -1
- package/src/nodes/if.ts +1 -1
- package/src/nodes/isTestRun.ts +24 -0
- package/src/nodes/mapData.ts +1 -0
- package/src/nodes/merge.ts +1 -1
- package/src/nodes/noOp.ts +1 -0
- package/src/nodes/split.ts +1 -1
- package/src/nodes/testTrigger.ts +72 -0
- package/src/nodes/wait.ts +1 -0
- package/src/chatModels/OpenAIStructuredOutputMethodFactory.ts +0 -46
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AssistantModelMessage, ModelMessage, ToolModelMessage } from "ai";
|
|
2
|
+
import { Cron, CronCallback } from "croner";
|
|
3
3
|
import { ReadableStream } from "node:stream/web";
|
|
4
|
-
import { DependencyContainer as Container, InjectionToken as TypeToken } from "tsyringe";
|
|
5
4
|
import { ZodType, input, output, z } from "zod";
|
|
5
|
+
import { DependencyContainer as Container, InjectionToken as TypeToken } from "tsyringe";
|
|
6
6
|
|
|
7
7
|
//#region src/canvasIconName.d.ts
|
|
8
8
|
/**
|
|
@@ -14,170 +14,223 @@ import { ZodType, input, output, z } from "zod";
|
|
|
14
14
|
*/
|
|
15
15
|
type CanvasIconName = string;
|
|
16
16
|
//#endregion
|
|
17
|
-
//#region ../core/src/contracts/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
//#region ../core/src/contracts/baseTypes.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* Minimal base types that have no dependencies on other contracts.
|
|
20
|
+
* Used by credentialTypes, workflowTypes, and other contract layers
|
|
21
|
+
* to avoid circular dependencies.
|
|
22
|
+
*/
|
|
23
|
+
type WorkflowId = string;
|
|
24
|
+
type NodeId = string;
|
|
25
|
+
type OutputPortKey = string;
|
|
26
|
+
type InputPortKey = string;
|
|
27
|
+
type NodeConnectionName = string;
|
|
23
28
|
//#endregion
|
|
24
|
-
//#region ../core/src/contracts/
|
|
25
|
-
|
|
26
|
-
type
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
//#region ../core/src/contracts/credentialTypes.d.ts
|
|
30
|
+
type CredentialTypeId = string;
|
|
31
|
+
type CredentialInstanceId = string;
|
|
32
|
+
type CredentialMaterialSourceKind = "db" | "env" | "code";
|
|
33
|
+
type CredentialSetupStatus = "draft" | "ready";
|
|
34
|
+
type CredentialHealthStatus = "unknown" | "healthy" | "failing";
|
|
35
|
+
type CredentialFieldSchema = Readonly<{
|
|
36
|
+
key: string;
|
|
37
|
+
label: string;
|
|
38
|
+
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
39
|
+
required?: true;
|
|
40
|
+
order?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Where this field appears in the credential dialog. Use `"advanced"` for optional or
|
|
43
|
+
* power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).
|
|
44
|
+
* Defaults to `"default"` when omitted.
|
|
45
|
+
*/
|
|
46
|
+
visibility?: "default" | "advanced";
|
|
47
|
+
placeholder?: string;
|
|
48
|
+
helpText?: string;
|
|
49
|
+
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
50
|
+
envVarName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
|
|
53
|
+
* pattern or documentation URL). Do not use for secret values.
|
|
54
|
+
*/
|
|
55
|
+
copyValue?: string;
|
|
56
|
+
/** Accessible label for the copy control (default: Copy). */
|
|
57
|
+
copyButtonLabel?: string;
|
|
58
|
+
}>;
|
|
59
|
+
type CredentialRequirement = Readonly<{
|
|
60
|
+
slotKey: string;
|
|
61
|
+
label: string;
|
|
62
|
+
acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
63
|
+
optional?: true;
|
|
64
|
+
helpText?: string;
|
|
65
|
+
helpUrl?: string;
|
|
66
|
+
}>;
|
|
67
|
+
type CredentialHealth = Readonly<{
|
|
68
|
+
status: CredentialHealthStatus;
|
|
69
|
+
message?: string;
|
|
70
|
+
testedAt?: string;
|
|
71
|
+
expiresAt?: string;
|
|
72
|
+
details?: Readonly<Record<string, unknown>>;
|
|
73
|
+
}>;
|
|
74
|
+
type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
75
|
+
authorizeUrlFieldKey: string;
|
|
76
|
+
tokenUrlFieldKey: string;
|
|
77
|
+
userInfoUrlFieldKey?: string;
|
|
78
|
+
}>;
|
|
79
|
+
type CredentialOAuth2ScopesFromPublicConfig = Readonly<{
|
|
80
|
+
presetFieldKey: string;
|
|
81
|
+
presetScopes: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
82
|
+
customPresetKey?: string;
|
|
83
|
+
customScopesFieldKey?: string;
|
|
84
|
+
}>;
|
|
85
|
+
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
86
|
+
kind: "oauth2";
|
|
87
|
+
providerId: string;
|
|
88
|
+
scopes: ReadonlyArray<string>;
|
|
89
|
+
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
90
|
+
clientIdFieldKey?: string;
|
|
91
|
+
clientSecretFieldKey?: string;
|
|
92
|
+
} | {
|
|
93
|
+
kind: "oauth2";
|
|
94
|
+
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
95
|
+
scopes: ReadonlyArray<string>;
|
|
96
|
+
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
97
|
+
clientIdFieldKey?: string;
|
|
98
|
+
clientSecretFieldKey?: string;
|
|
99
|
+
} | {
|
|
100
|
+
kind: "oauth2";
|
|
101
|
+
/**
|
|
102
|
+
* Free-form provider identifier for telemetry, DB rows, and Better Auth provider naming.
|
|
103
|
+
* Not used for any registry lookup — URLs come from {@link authorizeUrl} / {@link tokenUrl}.
|
|
104
|
+
*/
|
|
105
|
+
providerId: string;
|
|
106
|
+
/**
|
|
107
|
+
* Authorization endpoint. May contain `{publicFieldKey}` placeholders that the runtime
|
|
108
|
+
* substitutes from the credential's resolved public config (URL-encoded).
|
|
109
|
+
* Example: `https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize`
|
|
110
|
+
*/
|
|
111
|
+
authorizeUrl: string;
|
|
112
|
+
/** Token endpoint. Same templating rules as {@link authorizeUrl}. */
|
|
113
|
+
tokenUrl: string;
|
|
114
|
+
/** Optional userinfo endpoint. Same templating rules as {@link authorizeUrl}. */
|
|
115
|
+
userInfoUrl?: string;
|
|
116
|
+
scopes: ReadonlyArray<string>;
|
|
117
|
+
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
118
|
+
clientIdFieldKey?: string;
|
|
119
|
+
clientSecretFieldKey?: string;
|
|
120
|
+
}>;
|
|
121
|
+
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
122
|
+
type CredentialAdvancedSectionPresentation = Readonly<{
|
|
123
|
+
/** Collapsible section title (default: "Advanced"). */
|
|
124
|
+
title?: string;
|
|
125
|
+
/** Optional short helper text shown inside the section (above the fields). */
|
|
126
|
+
description?: string;
|
|
127
|
+
/** When true, the advanced section starts expanded. Default: false (collapsed). */
|
|
128
|
+
defaultOpen?: boolean;
|
|
129
|
+
}>;
|
|
130
|
+
type CredentialTypeDefinition = Readonly<{
|
|
131
|
+
typeId: CredentialTypeId;
|
|
132
|
+
displayName: string;
|
|
133
|
+
description?: string;
|
|
134
|
+
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
135
|
+
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
136
|
+
/**
|
|
137
|
+
* Optional labels for the collapsible block that contains every field with `visibility: "advanced"`.
|
|
138
|
+
* If omitted, the UI still shows that block with defaults (title "Advanced", collapsed).
|
|
139
|
+
*/
|
|
140
|
+
advancedSection?: CredentialAdvancedSectionPresentation;
|
|
141
|
+
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
142
|
+
auth?: CredentialAuthDefinition;
|
|
32
143
|
}>;
|
|
33
144
|
/**
|
|
34
|
-
*
|
|
145
|
+
* JSON-shaped credential field bag (public config, resolved secret material, etc.).
|
|
35
146
|
*/
|
|
36
|
-
type
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
147
|
+
type CredentialJsonRecord = Readonly<Record<string, unknown>>;
|
|
148
|
+
/**
|
|
149
|
+
* Persisted credential instance with typed `publicConfig`.
|
|
150
|
+
* Hosts may specialize `secretRef` with a stricter union while remaining
|
|
151
|
+
* assignable here for session/test callbacks.
|
|
152
|
+
*/
|
|
153
|
+
type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
154
|
+
instanceId: CredentialInstanceId;
|
|
155
|
+
typeId: CredentialTypeId;
|
|
156
|
+
displayName: string;
|
|
157
|
+
sourceKind: CredentialMaterialSourceKind;
|
|
158
|
+
publicConfig: TPublicConfig;
|
|
159
|
+
secretRef: CredentialJsonRecord;
|
|
160
|
+
tags: ReadonlyArray<string>;
|
|
161
|
+
setupStatus: CredentialSetupStatus;
|
|
162
|
+
createdAt: string;
|
|
163
|
+
updatedAt: string;
|
|
42
164
|
}>;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
|
|
167
|
+
* Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
|
|
168
|
+
* against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
|
|
169
|
+
*/
|
|
170
|
+
type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
171
|
+
instance: CredentialInstanceRecord<TPublicConfig>;
|
|
172
|
+
material: TMaterial;
|
|
173
|
+
publicConfig: TPublicConfig;
|
|
47
174
|
}>;
|
|
48
|
-
|
|
49
|
-
|
|
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
|
|
53
|
-
//#region ../core/src/contracts/retryPolicySpec.types.d.ts
|
|
175
|
+
type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
|
|
176
|
+
type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
|
|
54
177
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
|
|
178
|
+
* Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
|
|
179
|
+
* Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
|
|
59
180
|
*/
|
|
60
|
-
type
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
78
|
-
readonly jitter?: boolean;
|
|
181
|
+
type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
|
|
182
|
+
definition: CredentialTypeDefinition;
|
|
183
|
+
createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
|
|
184
|
+
test: CredentialHealthTester<TPublicConfig, TMaterial>;
|
|
185
|
+
}>;
|
|
186
|
+
/**
|
|
187
|
+
* Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
|
|
188
|
+
* and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
|
|
189
|
+
* Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
|
|
190
|
+
*/
|
|
191
|
+
type AnyCredentialType = CredentialType<any, any, unknown>;
|
|
192
|
+
interface CredentialSessionService {
|
|
193
|
+
getSession<TSession = unknown>(args: Readonly<{
|
|
194
|
+
workflowId: WorkflowId;
|
|
195
|
+
nodeId: NodeId;
|
|
196
|
+
slotKey: string;
|
|
197
|
+
}>): Promise<TSession>;
|
|
79
198
|
}
|
|
80
199
|
//#endregion
|
|
81
|
-
//#region ../core/src/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
readonly
|
|
88
|
-
|
|
89
|
-
readonly unit?: string;
|
|
90
|
-
readonly attributes?: TelemetryAttributes;
|
|
200
|
+
//#region ../core/src/triggers/polling/PollingTriggerDedupWindow.d.ts
|
|
201
|
+
/**
|
|
202
|
+
* Merges processed-ID windows for polling triggers, capping the total to avoid unbounded growth.
|
|
203
|
+
* Plugin code receives an instance of this class via {@link PollingTriggerHandle.dedup}.
|
|
204
|
+
*/
|
|
205
|
+
declare class PollingTriggerDedupWindow {
|
|
206
|
+
static readonly defaultCapN = 2000;
|
|
207
|
+
merge(previous: ReadonlyArray<string>, incoming: ReadonlyArray<string>, capN?: number): ReadonlyArray<string>;
|
|
91
208
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region ../core/src/contracts/runTypes.d.ts
|
|
211
|
+
/**
|
|
212
|
+
* Test-suite linkage for a run. When set, this run was started by a TestSuiteOrchestrator
|
|
213
|
+
* as one test case inside a TestSuiteRun. The `IsTestRun` node and host-side persisters key
|
|
214
|
+
* off the presence of this field. Subworkflow runs inherit it from their parent run.
|
|
215
|
+
*/
|
|
216
|
+
interface RunTestContext {
|
|
217
|
+
readonly testSuiteRunId: string;
|
|
218
|
+
readonly testCaseIndex: number;
|
|
219
|
+
/**
|
|
220
|
+
* Optional human-friendly label for this test case (e.g. an email subject when fixtures
|
|
221
|
+
* are loaded from a mailbox). Resolved per item by `TestTrigger.caseLabel(item)` if set,
|
|
222
|
+
* persisted on `Run.test_case_label` so the Tests-tab tree-table can show "RFQ for batch 14"
|
|
223
|
+
* instead of "run_1777755971399_bbb86beac1396".
|
|
224
|
+
*/
|
|
225
|
+
readonly testCaseLabel?: string;
|
|
96
226
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
readonly bytes?: number;
|
|
105
|
-
readonly truncated?: boolean;
|
|
106
|
-
readonly expiresAt?: Date;
|
|
107
|
-
}
|
|
108
|
-
interface TelemetryArtifactReference {
|
|
109
|
-
readonly artifactId: string;
|
|
110
|
-
readonly traceId?: string;
|
|
111
|
-
readonly spanId?: string;
|
|
112
|
-
}
|
|
113
|
-
interface TelemetrySpanEnd {
|
|
114
|
-
readonly status?: "ok" | "error";
|
|
115
|
-
readonly statusMessage?: string;
|
|
116
|
-
readonly endedAt?: Date;
|
|
117
|
-
readonly attributes?: TelemetryAttributes;
|
|
118
|
-
}
|
|
119
|
-
interface TelemetryChildSpanStart {
|
|
120
|
-
readonly name: string;
|
|
121
|
-
readonly kind?: "internal" | "client";
|
|
122
|
-
readonly startedAt?: Date;
|
|
123
|
-
readonly attributes?: TelemetryAttributes;
|
|
124
|
-
}
|
|
125
|
-
interface TelemetryScope {
|
|
126
|
-
readonly traceId?: string;
|
|
127
|
-
readonly spanId?: string;
|
|
128
|
-
readonly costTracking?: CostTrackingTelemetry;
|
|
129
|
-
addSpanEvent(args: TelemetrySpanEventRecord): Promise<void> | void;
|
|
130
|
-
recordMetric(args: TelemetryMetricRecord): Promise<void> | void;
|
|
131
|
-
attachArtifact(args: TelemetryArtifactAttachment): Promise<TelemetryArtifactReference> | TelemetryArtifactReference;
|
|
132
|
-
}
|
|
133
|
-
interface TelemetrySpanScope extends TelemetryScope {
|
|
134
|
-
readonly traceId: string;
|
|
135
|
-
readonly spanId: string;
|
|
136
|
-
end(args?: TelemetrySpanEnd): Promise<void> | void;
|
|
137
|
-
}
|
|
138
|
-
interface NodeExecutionTelemetry extends ExecutionTelemetry, TelemetrySpanScope {
|
|
139
|
-
startChildSpan(args: TelemetryChildSpanStart): TelemetrySpanScope;
|
|
140
|
-
}
|
|
141
|
-
interface ExecutionTelemetry extends TelemetryScope {
|
|
142
|
-
readonly traceId: string;
|
|
143
|
-
readonly spanId: string;
|
|
144
|
-
forNode(args: Readonly<{
|
|
145
|
-
nodeId: NodeId;
|
|
146
|
-
activationId: NodeActivationId;
|
|
147
|
-
}>): NodeExecutionTelemetry;
|
|
148
|
-
}
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region ../core/src/contracts/CostTrackingTelemetryContract.d.ts
|
|
151
|
-
type CostTrackingComponent = "chat" | "ocr" | "rag";
|
|
152
|
-
interface CostTrackingUsageRecord {
|
|
153
|
-
readonly component: CostTrackingComponent;
|
|
154
|
-
readonly provider: string;
|
|
155
|
-
readonly operation: string;
|
|
156
|
-
readonly pricingKey: string;
|
|
157
|
-
readonly usageUnit: string;
|
|
158
|
-
readonly quantity: number;
|
|
159
|
-
readonly modelName?: string;
|
|
160
|
-
readonly attributes?: TelemetryAttributes;
|
|
161
|
-
}
|
|
162
|
-
interface CostTrackingPriceQuote {
|
|
163
|
-
readonly currency: string;
|
|
164
|
-
readonly currencyScale: number;
|
|
165
|
-
readonly estimatedAmountMinor: number;
|
|
166
|
-
readonly estimateKind: "catalog";
|
|
167
|
-
}
|
|
168
|
-
interface CostTrackingTelemetry {
|
|
169
|
-
captureUsage(args: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
|
|
170
|
-
forScope(scope: TelemetryScope): CostTrackingTelemetry;
|
|
171
|
-
}
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region ../core/src/contracts/runTypes.d.ts
|
|
174
|
-
type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
|
|
175
|
-
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
|
|
176
|
-
interface NodeExecutionError {
|
|
177
|
-
message: string;
|
|
178
|
-
name?: string;
|
|
179
|
-
stack?: string;
|
|
180
|
-
details?: JsonValue;
|
|
227
|
+
type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
|
|
228
|
+
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
|
|
229
|
+
interface NodeExecutionError {
|
|
230
|
+
message: string;
|
|
231
|
+
name?: string;
|
|
232
|
+
stack?: string;
|
|
233
|
+
details?: JsonValue;
|
|
181
234
|
}
|
|
182
235
|
/** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
|
|
183
236
|
type ConnectionInvocationId = string;
|
|
@@ -194,6 +247,9 @@ type ConnectionInvocationAppendArgs = Readonly<{
|
|
|
194
247
|
queuedAt?: string;
|
|
195
248
|
startedAt?: string;
|
|
196
249
|
finishedAt?: string;
|
|
250
|
+
iterationId?: NodeIterationId;
|
|
251
|
+
itemIndex?: number;
|
|
252
|
+
parentInvocationId?: ConnectionInvocationId;
|
|
197
253
|
}>;
|
|
198
254
|
interface PendingNodeExecution {
|
|
199
255
|
runId: RunId;
|
|
@@ -229,291 +285,85 @@ type RunResult = {
|
|
|
229
285
|
};
|
|
230
286
|
};
|
|
231
287
|
//#endregion
|
|
232
|
-
//#region ../core/src/contracts/
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
288
|
+
//#region ../core/src/contracts/retryPolicySpec.types.d.ts
|
|
289
|
+
/**
|
|
290
|
+
* In-process retry policy for runnable nodes. Serialized configs use the same
|
|
291
|
+
* `kind` discriminator (`JSON.stringify` / persisted workflows).
|
|
292
|
+
*
|
|
293
|
+
* `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
|
|
294
|
+
*/
|
|
295
|
+
type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
|
|
296
|
+
interface NoneRetryPolicySpec {
|
|
297
|
+
readonly kind: "none";
|
|
239
298
|
}
|
|
240
|
-
interface
|
|
241
|
-
|
|
242
|
-
|
|
299
|
+
interface FixedRetryPolicySpec {
|
|
300
|
+
readonly kind: "fixed";
|
|
301
|
+
/** Total attempts including the first execution. Must be >= 1. */
|
|
302
|
+
readonly maxAttempts: number;
|
|
303
|
+
readonly delayMs: number;
|
|
243
304
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TRestSteps & ValidStepSequence<RunnableNodeOutputJson<TFirstStep>, TRestSteps>;
|
|
254
|
-
type BooleanWhenOverloads<TCurrentJson, TReturn> = {
|
|
255
|
-
<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, steps: BranchStepsArg<TCurrentJson, TSteps>): TReturn;
|
|
256
|
-
<TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs<TCurrentJson, TFirstStep, TRestSteps>): TReturn;
|
|
257
|
-
};
|
|
258
|
-
//#endregion
|
|
259
|
-
//#region ../core/src/workflow/dsl/WhenBuilder.d.ts
|
|
260
|
-
declare class WhenBuilder<TCurrentJson> {
|
|
261
|
-
private readonly wf;
|
|
262
|
-
private readonly from;
|
|
263
|
-
private readonly branchPort;
|
|
264
|
-
constructor(wf: WorkflowBuilder, from: NodeRef, branchPort: OutputPortKey);
|
|
265
|
-
addBranch<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(steps: TSteps & ValidStepSequence<TCurrentJson, TSteps>): this;
|
|
266
|
-
readonly when: BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>>;
|
|
267
|
-
build(): WorkflowDefinition;
|
|
305
|
+
interface ExponentialRetryPolicySpec {
|
|
306
|
+
readonly kind: "exponential";
|
|
307
|
+
/** Total attempts including the first execution. Must be >= 1. */
|
|
308
|
+
readonly maxAttempts: number;
|
|
309
|
+
readonly initialDelayMs: number;
|
|
310
|
+
readonly multiplier: number;
|
|
311
|
+
readonly maxDelayMs?: number;
|
|
312
|
+
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
313
|
+
readonly jitter?: boolean;
|
|
268
314
|
}
|
|
269
315
|
//#endregion
|
|
270
|
-
//#region ../core/src/
|
|
271
|
-
type
|
|
272
|
-
|
|
273
|
-
output: OutputPortKey;
|
|
274
|
-
inputPortHint?: InputPortKey;
|
|
316
|
+
//#region ../core/src/contracts/workflowTypes.d.ts
|
|
317
|
+
type NodeIdRef<TJson = unknown> = NodeId & Readonly<{
|
|
318
|
+
__codemationNodeJson?: TJson;
|
|
275
319
|
}>;
|
|
276
|
-
type
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}> & BranchOutputGuard<TCurrentJson, TTrueSteps, TFalseSteps>): ChainCursor<StepSequenceOutput<TCurrentJson, TTrueSteps>>;
|
|
281
|
-
};
|
|
282
|
-
declare class ChainCursor<TCurrentJson> {
|
|
283
|
-
private readonly wf;
|
|
284
|
-
private readonly endpoints;
|
|
285
|
-
constructor(wf: WorkflowBuilder, endpoints: ReadonlyArray<ChainCursorEndpoint>);
|
|
286
|
-
then<TOutputJson$1, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
287
|
-
thenIntoInputHints<TOutputJson$1, TConfig extends RunnableNodeConfig<any, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
288
|
-
readonly when: ChainCursorWhenOverloads<TCurrentJson>;
|
|
289
|
-
route<TNextJson$1>(branches: Readonly<Record<OutputPortKey, (branch: ChainCursor<TCurrentJson>) => ChainCursor<TNextJson$1> | undefined>>): ChainCursor<TNextJson$1>;
|
|
290
|
-
build(): WorkflowDefinition;
|
|
291
|
-
private resolveSharedInputPortHint;
|
|
292
|
-
}
|
|
293
|
-
//#endregion
|
|
294
|
-
//#region ../core/src/workflow/dsl/WorkflowBuilder.d.ts
|
|
295
|
-
declare class WorkflowBuilder {
|
|
296
|
-
private readonly meta;
|
|
297
|
-
private readonly options?;
|
|
298
|
-
private readonly nodes;
|
|
299
|
-
private readonly edges;
|
|
300
|
-
private seq;
|
|
301
|
-
constructor(meta: {
|
|
302
|
-
id: WorkflowId;
|
|
303
|
-
name: string;
|
|
304
|
-
}, options?: Readonly<Record<string, never>> | undefined);
|
|
305
|
-
private add;
|
|
306
|
-
private connect;
|
|
307
|
-
trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>>;
|
|
308
|
-
start<TConfig extends AnyRunnableNodeConfig>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
309
|
-
build(): WorkflowDefinition;
|
|
310
|
-
}
|
|
311
|
-
//#endregion
|
|
312
|
-
//#region ../core/src/contracts/runtimeTypes.d.ts
|
|
313
|
-
interface WorkflowRunnerService {
|
|
314
|
-
runById(args: {
|
|
315
|
-
workflowId: WorkflowId;
|
|
316
|
-
startAt?: NodeId;
|
|
317
|
-
items: Items;
|
|
318
|
-
parent?: ParentExecutionRef;
|
|
319
|
-
}): Promise<RunResult>;
|
|
320
|
-
}
|
|
321
|
-
interface NodeResolver {
|
|
322
|
-
resolve<T>(token: TypeToken<T>): T;
|
|
320
|
+
type NodeKind = "trigger" | "node";
|
|
321
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
322
|
+
interface JsonObject {
|
|
323
|
+
readonly [key: string]: JsonValue;
|
|
323
324
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
markRunning(args: {
|
|
331
|
-
nodeId: NodeId;
|
|
332
|
-
activationId?: NodeActivationId;
|
|
333
|
-
inputsByPort?: NodeInputsByPort;
|
|
334
|
-
}): Promise<void>;
|
|
335
|
-
markCompleted(args: {
|
|
325
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
326
|
+
type JsonArray = ReadonlyArray<JsonValue>;
|
|
327
|
+
/** JSON value that is not a top-level array (nested arrays inside objects are allowed). */
|
|
328
|
+
type JsonNonArray = JsonPrimitive | JsonObject;
|
|
329
|
+
interface Edge {
|
|
330
|
+
from: {
|
|
336
331
|
nodeId: NodeId;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}): Promise<void>;
|
|
341
|
-
markFailed(args: {
|
|
332
|
+
output: OutputPortKey;
|
|
333
|
+
};
|
|
334
|
+
to: {
|
|
342
335
|
nodeId: NodeId;
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
error: Error;
|
|
346
|
-
}): Promise<void>;
|
|
347
|
-
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
336
|
+
input: InputPortKey;
|
|
337
|
+
};
|
|
348
338
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
339
|
+
/**
|
|
340
|
+
* Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
|
|
341
|
+
* but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
|
|
342
|
+
* also be connection-owned nodes for recursive agent attachments.
|
|
343
|
+
*/
|
|
344
|
+
interface WorkflowNodeConnection {
|
|
345
|
+
readonly parentNodeId: NodeId;
|
|
346
|
+
readonly connectionName: NodeConnectionName;
|
|
347
|
+
readonly childNodeIds: ReadonlyArray<NodeId>;
|
|
353
348
|
}
|
|
354
|
-
interface
|
|
349
|
+
interface WorkflowDefinition {
|
|
350
|
+
id: WorkflowId;
|
|
355
351
|
name: string;
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
interface ExecutionContext {
|
|
373
|
-
runId: RunId;
|
|
374
|
-
workflowId: WorkflowId;
|
|
375
|
-
parent?: ParentExecutionRef;
|
|
376
|
-
/** This run's subworkflow depth (0 = root). */
|
|
377
|
-
subworkflowDepth: number;
|
|
378
|
-
/** Effective activation budget cap for this run (after policy merge). */
|
|
379
|
-
engineMaxNodeActivations: number;
|
|
380
|
-
/** Effective subworkflow nesting cap for this run (after policy merge). */
|
|
381
|
-
engineMaxSubworkflowDepth: number;
|
|
382
|
-
now: () => Date;
|
|
383
|
-
data: RunDataSnapshot;
|
|
384
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
385
|
-
telemetry: ExecutionTelemetry;
|
|
386
|
-
binary: ExecutionBinaryService;
|
|
387
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
388
|
-
}
|
|
389
|
-
interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
|
|
390
|
-
nodeId: NodeId;
|
|
391
|
-
activationId: NodeActivationId;
|
|
392
|
-
config: TConfig;
|
|
393
|
-
telemetry: NodeExecutionTelemetry;
|
|
394
|
-
binary: NodeBinaryAttachmentService;
|
|
395
|
-
}
|
|
396
|
-
interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
397
|
-
trigger: TriggerInstanceId;
|
|
398
|
-
config: TConfig;
|
|
399
|
-
previousState: TSetupState$1;
|
|
400
|
-
registerCleanup(cleanup: TriggerCleanupHandle): void;
|
|
401
|
-
emit(items: Items): Promise<void>;
|
|
402
|
-
}
|
|
403
|
-
interface TriggerTestItemsContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
404
|
-
trigger: TriggerInstanceId;
|
|
405
|
-
nodeId: NodeId;
|
|
406
|
-
config: TConfig;
|
|
407
|
-
previousState: TSetupState$1;
|
|
408
|
-
}
|
|
409
|
-
interface TriggerCleanupHandle {
|
|
410
|
-
stop(): Promise<void> | void;
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
* Per-item runnable node: return JSON, an array to fan-out on `main`, an explicit `Item`, or {@link emitPorts}
|
|
414
|
-
* for multi-port emission. Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input`
|
|
415
|
-
* (wire `item.json` is unchanged). Transform helpers may opt into binary preservation, while routers and
|
|
416
|
-
* pass-through nodes should return explicit items when they need to preserve full item state.
|
|
417
|
-
*/
|
|
418
|
-
interface RunnableNodeExecuteArgs<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown> {
|
|
419
|
-
readonly input: TInputJson$1;
|
|
420
|
-
readonly item: Item;
|
|
421
|
-
readonly itemIndex: number;
|
|
422
|
-
readonly items: Items;
|
|
423
|
-
readonly ctx: NodeExecutionContext<TConfig>;
|
|
424
|
-
}
|
|
425
|
-
interface RunnableNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, _TOutputJson = unknown> {
|
|
426
|
-
readonly kind: "node";
|
|
427
|
-
/**
|
|
428
|
-
* Declared output ports (e.g. `["main"]`).
|
|
429
|
-
*
|
|
430
|
-
* Prefer describing dynamic router ports (Switch) and fixed multi-ports (If true/false)
|
|
431
|
-
* via {@link NodeConfigBase.declaredOutputPorts}. Engine defaults to `["main"]` when omitted.
|
|
432
|
-
*/
|
|
433
|
-
readonly outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
434
|
-
/** When omitted, engine uses {@link RunnableNodeConfig.inputSchema} or `z.unknown()`. */
|
|
435
|
-
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
436
|
-
execute(args: RunnableNodeExecuteArgs<TConfig, TInputJson$1>): Promise<unknown> | unknown;
|
|
437
|
-
}
|
|
438
|
-
interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
439
|
-
kind: "node";
|
|
440
|
-
/**
|
|
441
|
-
* Declared output ports (typically `["main"]`).
|
|
442
|
-
*
|
|
443
|
-
* Prefer describing ports for authoring/canvas via {@link NodeConfigBase.declaredOutputPorts}.
|
|
444
|
-
* Engine defaults to `["main"]` when omitted.
|
|
445
|
-
*/
|
|
446
|
-
outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
447
|
-
executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
448
|
-
}
|
|
449
|
-
type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;
|
|
450
|
-
interface TriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> {
|
|
451
|
-
kind: "trigger";
|
|
452
|
-
outputPorts: readonly ["main"];
|
|
453
|
-
setup(ctx: TriggerSetupContext<TConfig>): Promise<TriggerSetupStateFor<TConfig>>;
|
|
454
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
455
|
-
}
|
|
456
|
-
interface TestableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> extends TriggerNode<TConfig> {
|
|
457
|
-
getTestItems(ctx: TriggerTestItemsContext<TConfig>): Promise<Items>;
|
|
458
|
-
}
|
|
459
|
-
type ExecutableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> = TriggerNode<TConfig>;
|
|
460
|
-
//#endregion
|
|
461
|
-
//#region ../core/src/contracts/workflowTypes.d.ts
|
|
462
|
-
type WorkflowId = string;
|
|
463
|
-
type NodeId = string;
|
|
464
|
-
type NodeIdRef<TJson = unknown> = NodeId & Readonly<{
|
|
465
|
-
__codemationNodeJson?: TJson;
|
|
466
|
-
}>;
|
|
467
|
-
type OutputPortKey = string;
|
|
468
|
-
type InputPortKey = string;
|
|
469
|
-
type NodeKind = "trigger" | "node";
|
|
470
|
-
type JsonPrimitive = string | number | boolean | null;
|
|
471
|
-
interface JsonObject {
|
|
472
|
-
readonly [key: string]: JsonValue;
|
|
473
|
-
}
|
|
474
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
475
|
-
type JsonArray = ReadonlyArray<JsonValue>;
|
|
476
|
-
/** JSON value that is not a top-level array (nested arrays inside objects are allowed). */
|
|
477
|
-
type JsonNonArray = JsonPrimitive | JsonObject;
|
|
478
|
-
interface Edge {
|
|
479
|
-
from: {
|
|
480
|
-
nodeId: NodeId;
|
|
481
|
-
output: OutputPortKey;
|
|
482
|
-
};
|
|
483
|
-
to: {
|
|
484
|
-
nodeId: NodeId;
|
|
485
|
-
input: InputPortKey;
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
type NodeConnectionName = string;
|
|
489
|
-
/**
|
|
490
|
-
* Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
|
|
491
|
-
* but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
|
|
492
|
-
* also be connection-owned nodes for recursive agent attachments.
|
|
493
|
-
*/
|
|
494
|
-
interface WorkflowNodeConnection {
|
|
495
|
-
readonly parentNodeId: NodeId;
|
|
496
|
-
readonly connectionName: NodeConnectionName;
|
|
497
|
-
readonly childNodeIds: ReadonlyArray<NodeId>;
|
|
498
|
-
}
|
|
499
|
-
interface WorkflowDefinition {
|
|
500
|
-
id: WorkflowId;
|
|
501
|
-
name: string;
|
|
502
|
-
nodes: NodeDefinition[];
|
|
503
|
-
edges: Edge[];
|
|
504
|
-
/**
|
|
505
|
-
* Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
|
|
506
|
-
* When omitted, all nodes in {@link nodes} are treated as executable for topology.
|
|
507
|
-
*/
|
|
508
|
-
readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
509
|
-
/** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
|
|
510
|
-
discoveryPathSegments?: readonly string[];
|
|
511
|
-
/** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
|
|
512
|
-
readonly prunePolicy?: WorkflowPrunePolicySpec;
|
|
513
|
-
/** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
|
|
514
|
-
readonly storagePolicy?: WorkflowStoragePolicySpec;
|
|
515
|
-
/** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
|
|
516
|
-
readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
|
|
352
|
+
nodes: NodeDefinition[];
|
|
353
|
+
edges: Edge[];
|
|
354
|
+
/**
|
|
355
|
+
* Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
|
|
356
|
+
* When omitted, all nodes in {@link nodes} are treated as executable for topology.
|
|
357
|
+
*/
|
|
358
|
+
readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
359
|
+
/** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
|
|
360
|
+
discoveryPathSegments?: readonly string[];
|
|
361
|
+
/** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
|
|
362
|
+
readonly prunePolicy?: WorkflowPrunePolicySpec;
|
|
363
|
+
/** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
|
|
364
|
+
readonly storagePolicy?: WorkflowStoragePolicySpec;
|
|
365
|
+
/** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
|
|
366
|
+
readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
|
|
517
367
|
}
|
|
518
368
|
interface NodeConfigBase {
|
|
519
369
|
readonly kind: NodeKind;
|
|
@@ -542,6 +392,14 @@ interface NodeConfigBase {
|
|
|
542
392
|
readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
|
|
543
393
|
readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
|
|
544
394
|
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
395
|
+
/**
|
|
396
|
+
* Marker: this node emits {@link import("./assertionTypes").AssertionResult}-shaped items on its
|
|
397
|
+
* `main` port. The TestSuiteOrchestrator (and host-side TestAssertionPersister) listen for
|
|
398
|
+
* `nodeCompleted` events from nodes with this flag set, and persist their output items as
|
|
399
|
+
* TestAssertion records (only when the run carries a `testContext`). Set on assertion node
|
|
400
|
+
* configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).
|
|
401
|
+
*/
|
|
402
|
+
readonly emitsAssertions?: true;
|
|
545
403
|
}
|
|
546
404
|
declare const runnableNodeInputType: unique symbol;
|
|
547
405
|
declare const runnableNodeOutputType: unique symbol;
|
|
@@ -571,6 +429,12 @@ interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonV
|
|
|
571
429
|
readonly kind: "trigger";
|
|
572
430
|
readonly [triggerNodeOutputType]?: TOutputJson$1;
|
|
573
431
|
readonly [triggerNodeSetupStateType]?: TSetupState$1;
|
|
432
|
+
/**
|
|
433
|
+
* Distinguishes triggers driven by the live activation policy (webhooks, cron, polling) from
|
|
434
|
+
* triggers driven only by the {@link TestSuiteOrchestrator}. `WorkflowActivation` skips
|
|
435
|
+
* `"test"` triggers; the orchestrator skips `"live"` triggers. Defaults to `"live"` when omitted.
|
|
436
|
+
*/
|
|
437
|
+
readonly triggerKind?: "live" | "test";
|
|
574
438
|
}
|
|
575
439
|
type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
|
|
576
440
|
type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;
|
|
@@ -620,6 +484,12 @@ type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
|
|
|
620
484
|
type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
|
|
621
485
|
type RunId = string;
|
|
622
486
|
type NodeActivationId = string;
|
|
487
|
+
/**
|
|
488
|
+
* One per-item iteration of a runnable node's execute loop. Refines `NodeActivationId` for
|
|
489
|
+
* per-item connection invocations and telemetry. Undefined when the executing node is a batch
|
|
490
|
+
* node or trigger that does not iterate items.
|
|
491
|
+
*/
|
|
492
|
+
type NodeIterationId = string;
|
|
623
493
|
interface ParentExecutionRef {
|
|
624
494
|
runId: RunId;
|
|
625
495
|
workflowId: WorkflowId;
|
|
@@ -630,12 +500,21 @@ interface ParentExecutionRef {
|
|
|
630
500
|
engineMaxNodeActivations?: number;
|
|
631
501
|
/** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
|
|
632
502
|
engineMaxSubworkflowDepth?: number;
|
|
503
|
+
/**
|
|
504
|
+
* Test-suite linkage inherited by the child subworkflow run. Set by whichever node
|
|
505
|
+
* spawns the subworkflow when its own `ctx.testContext` is present, so assertions
|
|
506
|
+
* emitted inside a subworkflow land under the correct parent test case.
|
|
507
|
+
*/
|
|
508
|
+
testContext?: RunTestContext;
|
|
633
509
|
}
|
|
634
510
|
interface RunDataSnapshot {
|
|
635
511
|
getOutputs(nodeId: NodeId): NodeOutputs | undefined;
|
|
636
512
|
getOutputItems<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, output?: OutputPortKey): Items<TJson>;
|
|
637
513
|
getOutputItem<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, itemIndex: number, output?: OutputPortKey): Item<TJson> | undefined;
|
|
638
514
|
}
|
|
515
|
+
interface ActivationIdFactory {
|
|
516
|
+
makeActivationId(): NodeActivationId;
|
|
517
|
+
}
|
|
639
518
|
type UpstreamRefPlaceholder = `$${number}`;
|
|
640
519
|
/** Whether to persist run execution data after the workflow finishes. */
|
|
641
520
|
type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
|
|
@@ -683,155 +562,564 @@ interface NodeErrorHandler {
|
|
|
683
562
|
}
|
|
684
563
|
type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
685
564
|
//#endregion
|
|
686
|
-
//#region ../core/src/contracts/
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
type
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
565
|
+
//#region ../core/src/contracts/testTriggerTypes.d.ts
|
|
566
|
+
/**
|
|
567
|
+
* Identifier minted by the host (or in-memory test runner) for one execution of a test suite.
|
|
568
|
+
* One TestSuiteRun produces N child workflow runs, one per item yielded by `generateItems`.
|
|
569
|
+
*/
|
|
570
|
+
type TestSuiteRunId = string;
|
|
571
|
+
/**
|
|
572
|
+
* Setup context passed to a {@link TestTriggerNodeConfig.generateItems} callback. Distinct from
|
|
573
|
+
* {@link import("./runtimeTypes").TriggerSetupContext} on purpose: test triggers are not
|
|
574
|
+
* activated by the live trigger lifecycle (webhooks, cron, polling) and never call `emit` —
|
|
575
|
+
* the orchestrator pulls from the iterable they return and dispatches one run per item.
|
|
576
|
+
*/
|
|
577
|
+
interface TestTriggerSetupContext<TConfig extends TestTriggerNodeConfig<unknown> = TestTriggerNodeConfig<unknown>> {
|
|
578
|
+
readonly workflowId: WorkflowId;
|
|
579
|
+
readonly nodeId: NodeId;
|
|
580
|
+
readonly config: TConfig;
|
|
581
|
+
readonly testSuiteRunId: TestSuiteRunId;
|
|
698
582
|
/**
|
|
699
|
-
*
|
|
700
|
-
*
|
|
701
|
-
*
|
|
583
|
+
* Resolves a credential session for a slot declared on this trigger's
|
|
584
|
+
* {@link import("./workflowTypes").NodeConfigBase.getCredentialRequirements}. Same contract as
|
|
585
|
+
* {@link import("./runtimeTypes").ExecutionContext.getCredential}.
|
|
702
586
|
*/
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
587
|
+
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
588
|
+
/** AbortSignal raised when the suite is cancelled — long-running pulls should bail out. */
|
|
589
|
+
readonly signal: AbortSignal;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* A trigger config that emits **test cases**. Each item yielded by {@link generateItems}
|
|
593
|
+
* becomes one workflow run (with `executionOptions.testContext` set), so 10 yielded items
|
|
594
|
+
* → 10 runs marked under the same TestSuiteRun.
|
|
595
|
+
*
|
|
596
|
+
* The trigger is otherwise a normal {@link TriggerNodeConfig} (so the canvas treats it like
|
|
597
|
+
* any other trigger), but its `triggerKind` is `"test"` so the live activation policy skips it.
|
|
598
|
+
*/
|
|
599
|
+
interface TestTriggerNodeConfig<TOutputJson$1 = unknown> extends TriggerNodeConfig<TOutputJson$1, undefined> {
|
|
600
|
+
readonly triggerKind: "test";
|
|
708
601
|
/**
|
|
709
|
-
*
|
|
710
|
-
*
|
|
602
|
+
* Author-supplied async iterable of items, evaluated lazily. Implementations may fetch from
|
|
603
|
+
* credentialed APIs, read fixture files, or yield hard-coded items. The orchestrator iterates
|
|
604
|
+
* and dispatches one run per item, with concurrency capped by {@link concurrency} (default 4).
|
|
711
605
|
*/
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
606
|
+
generateItems(ctx: TestTriggerSetupContext<TestTriggerNodeConfig<TOutputJson$1>>): AsyncIterable<Item<TOutputJson$1>>;
|
|
607
|
+
/** Per-suite-run cap on simultaneously-executing test cases. Default: 4. */
|
|
608
|
+
readonly concurrency?: number;
|
|
609
|
+
/**
|
|
610
|
+
* Free-form description of where the test cases come from — surfaced in the node properties
|
|
611
|
+
* panel and the suite-detail header so authors revisiting the workflow six months later
|
|
612
|
+
* remember which mailbox / folder / fixture file the cases originate from.
|
|
613
|
+
*
|
|
614
|
+
* Example: `"All emails in the Gmail label \"test/triage-fixtures\" — 14 messages as of 2026-05-03."`
|
|
615
|
+
*/
|
|
616
|
+
readonly description?: string;
|
|
617
|
+
/**
|
|
618
|
+
* Resolves a human-readable label for one yielded test case (e.g. email subject). The
|
|
619
|
+
* orchestrator calls this once per yielded item, persists the result on the run, and the
|
|
620
|
+
* Tests-tab UI uses it to render the case row instead of the opaque runId. Return
|
|
621
|
+
* `undefined` to fall back to "Case #N".
|
|
622
|
+
*/
|
|
623
|
+
caseLabel?(item: Item<TOutputJson$1>): string | undefined;
|
|
624
|
+
}
|
|
625
|
+
//#endregion
|
|
626
|
+
//#region ../core/src/contracts/assertionTypes.d.ts
|
|
627
|
+
/**
|
|
628
|
+
* One assertion emitted by an assertion-emitting node (a node whose config sets
|
|
629
|
+
* `emitsAssertions: true`). Each emitted item on `main` carries one of these as `item.json`.
|
|
630
|
+
*
|
|
631
|
+
* Pass/fail is derived from `score >= (passThreshold ?? 0.5)` — see {@link deriveAssertionPassed}.
|
|
632
|
+
* The `errored` marker is for cases where the assertion code itself threw (distinct from
|
|
633
|
+
* "the assertion was evaluated and the score was low") and is treated as a hard fail in rollups
|
|
634
|
+
* regardless of `score`.
|
|
635
|
+
*/
|
|
636
|
+
interface AssertionResult {
|
|
637
|
+
readonly name: string;
|
|
638
|
+
/** 0..1 score. Source of truth for pass/fail (compared against `passThreshold`). */
|
|
639
|
+
readonly score: number;
|
|
640
|
+
/** 0..1 threshold for "passed". When omitted, consumers default to 0.5. */
|
|
641
|
+
readonly passThreshold?: number;
|
|
642
|
+
/** True when evaluating the assertion threw — treated as fail regardless of `score`. */
|
|
643
|
+
readonly errored?: true;
|
|
644
|
+
/** What the assertion expected. Free-form JSON; UIs render with a JSON viewer. */
|
|
645
|
+
readonly expected?: JsonValue;
|
|
646
|
+
/** What the workflow actually produced. */
|
|
647
|
+
readonly actual?: JsonValue;
|
|
648
|
+
/** Short human-readable explanation, especially for fails / errors. */
|
|
649
|
+
readonly message?: string;
|
|
650
|
+
/** Bag of supplemental fields (e.g. judge prompt, judge raw response, comparison method). */
|
|
651
|
+
readonly details?: Readonly<Record<string, JsonValue>>;
|
|
652
|
+
}
|
|
653
|
+
//#endregion
|
|
654
|
+
//#region ../core/src/contracts/telemetryTypes.d.ts
|
|
655
|
+
type TelemetryAttributePrimitive = string | number | boolean | null;
|
|
656
|
+
interface TelemetryAttributes {
|
|
657
|
+
readonly [key: string]: TelemetryAttributePrimitive | undefined;
|
|
658
|
+
}
|
|
659
|
+
interface TelemetryMetricRecord {
|
|
660
|
+
readonly name: string;
|
|
661
|
+
readonly value: number;
|
|
662
|
+
readonly unit?: string;
|
|
663
|
+
readonly attributes?: TelemetryAttributes;
|
|
664
|
+
}
|
|
665
|
+
interface TelemetrySpanEventRecord {
|
|
666
|
+
readonly name: string;
|
|
667
|
+
readonly occurredAt?: Date;
|
|
668
|
+
readonly attributes?: TelemetryAttributes;
|
|
669
|
+
}
|
|
670
|
+
interface TelemetryArtifactAttachment {
|
|
671
|
+
readonly kind: string;
|
|
672
|
+
readonly contentType: string;
|
|
673
|
+
readonly previewText?: string;
|
|
674
|
+
readonly previewJson?: JsonValue;
|
|
675
|
+
readonly payloadText?: string;
|
|
676
|
+
readonly payloadJson?: JsonValue;
|
|
677
|
+
readonly bytes?: number;
|
|
678
|
+
readonly truncated?: boolean;
|
|
679
|
+
readonly expiresAt?: Date;
|
|
680
|
+
}
|
|
681
|
+
interface TelemetryArtifactReference {
|
|
682
|
+
readonly artifactId: string;
|
|
683
|
+
readonly traceId?: string;
|
|
684
|
+
readonly spanId?: string;
|
|
685
|
+
}
|
|
686
|
+
interface TelemetrySpanEnd {
|
|
687
|
+
readonly status?: "ok" | "error";
|
|
688
|
+
readonly statusMessage?: string;
|
|
689
|
+
readonly endedAt?: Date;
|
|
690
|
+
readonly attributes?: TelemetryAttributes;
|
|
691
|
+
}
|
|
692
|
+
interface TelemetryChildSpanStart {
|
|
693
|
+
readonly name: string;
|
|
694
|
+
readonly kind?: "internal" | "client";
|
|
695
|
+
readonly startedAt?: Date;
|
|
696
|
+
readonly attributes?: TelemetryAttributes;
|
|
697
|
+
}
|
|
698
|
+
interface TelemetryScope {
|
|
699
|
+
readonly traceId?: string;
|
|
700
|
+
readonly spanId?: string;
|
|
701
|
+
readonly costTracking?: CostTrackingTelemetry;
|
|
702
|
+
addSpanEvent(args: TelemetrySpanEventRecord): Promise<void> | void;
|
|
703
|
+
recordMetric(args: TelemetryMetricRecord): Promise<void> | void;
|
|
704
|
+
attachArtifact(args: TelemetryArtifactAttachment): Promise<TelemetryArtifactReference> | TelemetryArtifactReference;
|
|
705
|
+
}
|
|
706
|
+
interface TelemetrySpanScope extends TelemetryScope {
|
|
707
|
+
readonly traceId: string;
|
|
708
|
+
readonly spanId: string;
|
|
709
|
+
end(args?: TelemetrySpanEnd): Promise<void> | void;
|
|
710
|
+
/**
|
|
711
|
+
* Lift this span into a {@link NodeExecutionTelemetry} scoped to a different (nodeId, activationId).
|
|
712
|
+
* Children created via the returned telemetry's `startChildSpan` get this span as their parent.
|
|
713
|
+
*
|
|
714
|
+
* Used at the sub-agent boundary so that nested runtime telemetry parents under the agent.tool.call
|
|
715
|
+
* span instead of the orchestrator's node-level span.
|
|
716
|
+
*/
|
|
717
|
+
asNodeTelemetry(args: Readonly<{
|
|
718
|
+
nodeId: NodeId;
|
|
719
|
+
activationId: NodeActivationId;
|
|
720
|
+
}>): NodeExecutionTelemetry;
|
|
721
|
+
}
|
|
722
|
+
interface NodeExecutionTelemetry extends ExecutionTelemetry, TelemetrySpanScope {
|
|
723
|
+
startChildSpan(args: TelemetryChildSpanStart): TelemetrySpanScope;
|
|
724
|
+
}
|
|
725
|
+
interface ExecutionTelemetry extends TelemetryScope {
|
|
726
|
+
readonly traceId: string;
|
|
727
|
+
readonly spanId: string;
|
|
728
|
+
forNode(args: Readonly<{
|
|
729
|
+
nodeId: NodeId;
|
|
730
|
+
activationId: NodeActivationId;
|
|
731
|
+
}>): NodeExecutionTelemetry;
|
|
732
|
+
}
|
|
733
|
+
//#endregion
|
|
734
|
+
//#region ../core/src/contracts/CostTrackingTelemetryContract.d.ts
|
|
735
|
+
type CostTrackingComponent = "chat" | "ocr" | "rag";
|
|
736
|
+
interface CostTrackingUsageRecord {
|
|
737
|
+
readonly component: CostTrackingComponent;
|
|
738
|
+
readonly provider: string;
|
|
739
|
+
readonly operation: string;
|
|
740
|
+
readonly pricingKey: string;
|
|
741
|
+
readonly usageUnit: string;
|
|
742
|
+
readonly quantity: number;
|
|
743
|
+
readonly modelName?: string;
|
|
744
|
+
readonly attributes?: TelemetryAttributes;
|
|
745
|
+
}
|
|
746
|
+
interface CostTrackingPriceQuote {
|
|
747
|
+
readonly currency: string;
|
|
748
|
+
readonly currencyScale: number;
|
|
749
|
+
readonly estimatedAmountMinor: number;
|
|
750
|
+
readonly estimateKind: "catalog";
|
|
751
|
+
}
|
|
752
|
+
interface CostTrackingTelemetry {
|
|
753
|
+
captureUsage(args: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
|
|
754
|
+
forScope(scope: TelemetryScope): CostTrackingTelemetry;
|
|
755
|
+
}
|
|
756
|
+
//#endregion
|
|
757
|
+
//#region ../core/src/contracts/webhookTypes.d.ts
|
|
758
|
+
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
759
|
+
interface WebhookControlSignal {
|
|
760
|
+
readonly __webhookControl: true;
|
|
761
|
+
readonly kind: "respondNow" | "respondNowAndContinue";
|
|
762
|
+
readonly responseItems: Items;
|
|
763
|
+
readonly continueItems?: Items;
|
|
764
|
+
}
|
|
765
|
+
interface TriggerInstanceId {
|
|
766
|
+
workflowId: WorkflowId;
|
|
767
|
+
nodeId: NodeId;
|
|
768
|
+
}
|
|
769
|
+
//#endregion
|
|
770
|
+
//#region ../core/src/contracts/collectionTypes.d.ts
|
|
771
|
+
/**
|
|
772
|
+
* Represents a typed store for a single collection.
|
|
773
|
+
* All rows include auto-managed id, created_at, and updated_at fields.
|
|
774
|
+
*/
|
|
775
|
+
interface CollectionStore<TRow extends Record<string, unknown> = Record<string, unknown>> {
|
|
776
|
+
/**
|
|
777
|
+
* Insert a new row. id, created_at, and updated_at are auto-populated.
|
|
778
|
+
*/
|
|
779
|
+
insert(row: TRow): Promise<TRow & {
|
|
780
|
+
id: string;
|
|
781
|
+
created_at: Date;
|
|
782
|
+
updated_at: Date;
|
|
783
|
+
}>;
|
|
784
|
+
/**
|
|
785
|
+
* Get a single row by id.
|
|
786
|
+
*/
|
|
787
|
+
get(id: string): Promise<(TRow & {
|
|
788
|
+
id: string;
|
|
789
|
+
created_at: Date;
|
|
790
|
+
updated_at: Date;
|
|
791
|
+
}) | null>;
|
|
792
|
+
/**
|
|
793
|
+
* Find a single row matching the provided filter.
|
|
794
|
+
*/
|
|
795
|
+
findOne(filter: Partial<TRow>): Promise<(TRow & {
|
|
796
|
+
id: string;
|
|
797
|
+
created_at: Date;
|
|
798
|
+
updated_at: Date;
|
|
799
|
+
}) | null>;
|
|
800
|
+
/**
|
|
801
|
+
* List rows with optional pagination and filtering.
|
|
802
|
+
*/
|
|
803
|
+
list(opts?: {
|
|
804
|
+
limit?: number;
|
|
805
|
+
offset?: number;
|
|
806
|
+
where?: Partial<TRow>;
|
|
807
|
+
}): Promise<{
|
|
808
|
+
rows: ReadonlyArray<TRow & {
|
|
809
|
+
id: string;
|
|
810
|
+
created_at: Date;
|
|
811
|
+
updated_at: Date;
|
|
812
|
+
}>;
|
|
813
|
+
total: number;
|
|
814
|
+
}>;
|
|
815
|
+
/**
|
|
816
|
+
* Update a row by id with partial data.
|
|
817
|
+
*/
|
|
818
|
+
update(id: string, patch: Partial<TRow>): Promise<TRow & {
|
|
819
|
+
id: string;
|
|
820
|
+
created_at: Date;
|
|
821
|
+
updated_at: Date;
|
|
822
|
+
}>;
|
|
823
|
+
/**
|
|
824
|
+
* Delete a row by id. Hard delete only (no soft delete).
|
|
825
|
+
*/
|
|
826
|
+
delete(id: string): Promise<{
|
|
827
|
+
deleted: boolean;
|
|
828
|
+
}>;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Runtime collections context: keyed by collection name.
|
|
832
|
+
*/
|
|
833
|
+
type CollectionsContext = Readonly<Record<string, CollectionStore>>;
|
|
834
|
+
//#endregion
|
|
835
|
+
//#region ../core/src/contracts/emitPorts.d.ts
|
|
836
|
+
declare const EMIT_PORTS_BRAND: unique symbol;
|
|
837
|
+
type PortsEmission = Readonly<{
|
|
838
|
+
readonly [EMIT_PORTS_BRAND]: true;
|
|
839
|
+
readonly ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>;
|
|
840
|
+
}>;
|
|
841
|
+
//#endregion
|
|
842
|
+
//#region ../core/src/workflow/dsl/workflowBuilderTypes.d.ts
|
|
843
|
+
type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
|
|
844
|
+
type AnyTriggerNodeConfig = TriggerNodeConfig<any>;
|
|
845
|
+
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;
|
|
846
|
+
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;
|
|
847
|
+
type TypesMatch<TLeft, TRight> = [TLeft] extends [TRight] ? ([TRight] extends [TLeft] ? true : false) : false;
|
|
848
|
+
type BranchOutputGuard<TCurrentJson, TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TypesMatch<StepSequenceOutput<TCurrentJson, TTrueSteps>, StepSequenceOutput<TCurrentJson, TFalseSteps>> extends true ? unknown : never;
|
|
849
|
+
type BranchStepsArg<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps & ValidStepSequence<TCurrentJson, TSteps>;
|
|
850
|
+
type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TRestSteps & ValidStepSequence<RunnableNodeOutputJson<TFirstStep>, TRestSteps>;
|
|
851
|
+
type BooleanWhenOverloads<TCurrentJson, TReturn> = {
|
|
852
|
+
<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, steps: BranchStepsArg<TCurrentJson, TSteps>): TReturn;
|
|
853
|
+
<TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs<TCurrentJson, TFirstStep, TRestSteps>): TReturn;
|
|
854
|
+
};
|
|
855
|
+
//#endregion
|
|
856
|
+
//#region ../core/src/workflow/dsl/WhenBuilder.d.ts
|
|
857
|
+
declare class WhenBuilder<TCurrentJson> {
|
|
858
|
+
private readonly wf;
|
|
859
|
+
private readonly from;
|
|
860
|
+
private readonly branchPort;
|
|
861
|
+
constructor(wf: WorkflowBuilder, from: NodeRef, branchPort: OutputPortKey);
|
|
862
|
+
addBranch<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(steps: TSteps & ValidStepSequence<TCurrentJson, TSteps>): this;
|
|
863
|
+
readonly when: BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>>;
|
|
864
|
+
build(): WorkflowDefinition;
|
|
865
|
+
}
|
|
866
|
+
//#endregion
|
|
867
|
+
//#region ../core/src/workflow/dsl/ChainCursorResolver.d.ts
|
|
868
|
+
type ChainCursorEndpoint = Readonly<{
|
|
869
|
+
node: NodeRef;
|
|
870
|
+
output: OutputPortKey;
|
|
871
|
+
inputPortHint?: InputPortKey;
|
|
872
|
+
}>;
|
|
873
|
+
type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> & {
|
|
874
|
+
<TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined>(branches: Readonly<{
|
|
875
|
+
true?: TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TTrueSteps> : never;
|
|
876
|
+
false?: TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TFalseSteps> : never;
|
|
877
|
+
}> & BranchOutputGuard<TCurrentJson, TTrueSteps, TFalseSteps>): ChainCursor<StepSequenceOutput<TCurrentJson, TTrueSteps>>;
|
|
878
|
+
};
|
|
879
|
+
declare class ChainCursor<TCurrentJson> {
|
|
880
|
+
private readonly wf;
|
|
881
|
+
private readonly endpoints;
|
|
882
|
+
constructor(wf: WorkflowBuilder, endpoints: ReadonlyArray<ChainCursorEndpoint>);
|
|
883
|
+
then<TOutputJson$1, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
884
|
+
thenIntoInputHints<TOutputJson$1, TConfig extends RunnableNodeConfig<any, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
885
|
+
readonly when: ChainCursorWhenOverloads<TCurrentJson>;
|
|
886
|
+
route<TNextJson$1>(branches: Readonly<Record<OutputPortKey, (branch: ChainCursor<TCurrentJson>) => ChainCursor<TNextJson$1> | undefined>>): ChainCursor<TNextJson$1>;
|
|
887
|
+
build(): WorkflowDefinition;
|
|
888
|
+
private resolveSharedInputPortHint;
|
|
889
|
+
}
|
|
890
|
+
//#endregion
|
|
891
|
+
//#region ../core/src/workflow/dsl/WorkflowBuilder.d.ts
|
|
892
|
+
declare class WorkflowBuilder {
|
|
893
|
+
private readonly meta;
|
|
894
|
+
private readonly options?;
|
|
895
|
+
private readonly nodes;
|
|
896
|
+
private readonly edges;
|
|
897
|
+
constructor(meta: {
|
|
898
|
+
id: WorkflowId;
|
|
899
|
+
name: string;
|
|
900
|
+
}, options?: Readonly<Record<string, never>> | undefined);
|
|
901
|
+
private add;
|
|
902
|
+
private connect;
|
|
903
|
+
trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>>;
|
|
904
|
+
start<TConfig extends AnyRunnableNodeConfig>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
905
|
+
build(): WorkflowDefinition;
|
|
906
|
+
private validateNodeIds;
|
|
907
|
+
}
|
|
908
|
+
//#endregion
|
|
909
|
+
//#region ../core/src/contracts/runtimeTypes.d.ts
|
|
910
|
+
interface WorkflowRunnerService {
|
|
911
|
+
runById(args: {
|
|
912
|
+
workflowId: WorkflowId;
|
|
913
|
+
startAt?: NodeId;
|
|
914
|
+
items: Items;
|
|
915
|
+
parent?: ParentExecutionRef;
|
|
916
|
+
}): Promise<RunResult>;
|
|
917
|
+
}
|
|
918
|
+
interface NodeResolver {
|
|
919
|
+
resolve<T>(token: TypeToken<T>): T;
|
|
920
|
+
}
|
|
921
|
+
interface NodeExecutionStatePublisher {
|
|
922
|
+
markQueued(args: {
|
|
923
|
+
nodeId: NodeId;
|
|
924
|
+
activationId?: NodeActivationId;
|
|
925
|
+
inputsByPort?: NodeInputsByPort;
|
|
926
|
+
}): Promise<void>;
|
|
927
|
+
markRunning(args: {
|
|
928
|
+
nodeId: NodeId;
|
|
929
|
+
activationId?: NodeActivationId;
|
|
930
|
+
inputsByPort?: NodeInputsByPort;
|
|
931
|
+
}): Promise<void>;
|
|
932
|
+
markCompleted(args: {
|
|
933
|
+
nodeId: NodeId;
|
|
934
|
+
activationId?: NodeActivationId;
|
|
935
|
+
inputsByPort?: NodeInputsByPort;
|
|
936
|
+
outputs?: NodeOutputs;
|
|
937
|
+
}): Promise<void>;
|
|
938
|
+
markFailed(args: {
|
|
939
|
+
nodeId: NodeId;
|
|
940
|
+
activationId?: NodeActivationId;
|
|
941
|
+
inputsByPort?: NodeInputsByPort;
|
|
942
|
+
error: Error;
|
|
943
|
+
}): Promise<void>;
|
|
944
|
+
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
945
|
+
}
|
|
946
|
+
type BinaryBody = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array | ArrayBuffer;
|
|
947
|
+
interface BinaryStorageReadResult {
|
|
948
|
+
body: ReadableStream<Uint8Array>;
|
|
949
|
+
size?: number;
|
|
950
|
+
}
|
|
951
|
+
interface BinaryAttachmentCreateRequest {
|
|
952
|
+
name: string;
|
|
953
|
+
body: BinaryBody;
|
|
954
|
+
mimeType: string;
|
|
955
|
+
filename?: string;
|
|
956
|
+
previewKind?: BinaryAttachment["previewKind"];
|
|
957
|
+
}
|
|
958
|
+
interface NodeBinaryAttachmentService extends ExecutionBinaryService {
|
|
959
|
+
attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;
|
|
960
|
+
withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
|
|
961
|
+
}
|
|
962
|
+
interface ExecutionBinaryService {
|
|
963
|
+
forNode(args: {
|
|
964
|
+
nodeId: NodeId;
|
|
965
|
+
activationId: NodeActivationId;
|
|
966
|
+
}): NodeBinaryAttachmentService;
|
|
967
|
+
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
968
|
+
}
|
|
969
|
+
interface ExecutionContext {
|
|
970
|
+
runId: RunId;
|
|
971
|
+
workflowId: WorkflowId;
|
|
972
|
+
parent?: ParentExecutionRef;
|
|
973
|
+
/** This run's subworkflow depth (0 = root). */
|
|
974
|
+
subworkflowDepth: number;
|
|
975
|
+
/** Effective activation budget cap for this run (after policy merge). */
|
|
976
|
+
engineMaxNodeActivations: number;
|
|
977
|
+
/** Effective subworkflow nesting cap for this run (after policy merge). */
|
|
978
|
+
engineMaxSubworkflowDepth: number;
|
|
979
|
+
now: () => Date;
|
|
980
|
+
data: RunDataSnapshot;
|
|
981
|
+
nodeState?: NodeExecutionStatePublisher;
|
|
982
|
+
telemetry: ExecutionTelemetry;
|
|
983
|
+
binary: ExecutionBinaryService;
|
|
984
|
+
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
985
|
+
/** Per-item iteration id, set by {@link NodeExecutor} on the ctx passed into runnable `execute`. */
|
|
986
|
+
iterationId?: NodeIterationId;
|
|
987
|
+
/** Item index (0-based) within the current activation's batch; set alongside {@link iterationId}. */
|
|
988
|
+
itemIndex?: number;
|
|
989
|
+
/** When set, this ctx is executing inside a sub-agent triggered by the named parent invocation. */
|
|
990
|
+
parentInvocationId?: ConnectionInvocationId;
|
|
991
|
+
/**
|
|
992
|
+
* Present iff the run was started by a TestSuiteOrchestrator. The {@link IsTestRunNode}
|
|
993
|
+
* branches on this; assertion-emitting nodes use it to decide whether to record results.
|
|
994
|
+
*/
|
|
995
|
+
testContext?: RunTestContext;
|
|
996
|
+
/**
|
|
997
|
+
* Collections registered in the codemation config, keyed by collection name.
|
|
998
|
+
*/
|
|
999
|
+
readonly collections?: CollectionsContext;
|
|
1000
|
+
}
|
|
1001
|
+
interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
|
|
1002
|
+
nodeId: NodeId;
|
|
1003
|
+
activationId: NodeActivationId;
|
|
1004
|
+
config: TConfig;
|
|
1005
|
+
telemetry: NodeExecutionTelemetry;
|
|
1006
|
+
binary: NodeBinaryAttachmentService;
|
|
1007
|
+
}
|
|
1008
|
+
interface PollingTriggerHandle {
|
|
772
1009
|
/**
|
|
773
|
-
*
|
|
774
|
-
*
|
|
1010
|
+
* Start the polling loop. The runtime registers its own cleanup handle so callers do not need to
|
|
1011
|
+
* call {@link TriggerSetupContext.registerCleanup} for the loop.
|
|
1012
|
+
* @returns The state returned by the first cycle (or `undefined` when the overlap guard fired).
|
|
775
1013
|
*/
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
1014
|
+
start<TState, TItem>(args: {
|
|
1015
|
+
intervalMs: number;
|
|
1016
|
+
seedState?: TState;
|
|
1017
|
+
runCycle: (cycleCtx: {
|
|
1018
|
+
previousState: TState | undefined;
|
|
1019
|
+
signal: AbortSignal;
|
|
1020
|
+
}) => Promise<{
|
|
1021
|
+
items: Items<TItem>;
|
|
1022
|
+
nextState: TState;
|
|
1023
|
+
}>;
|
|
1024
|
+
}): Promise<TState | undefined>;
|
|
1025
|
+
/** Convenience dedup-window helper. */
|
|
1026
|
+
readonly dedup: PollingTriggerDedupWindow;
|
|
1027
|
+
}
|
|
1028
|
+
interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
1029
|
+
trigger: TriggerInstanceId;
|
|
1030
|
+
config: TConfig;
|
|
1031
|
+
previousState: TSetupState$1;
|
|
1032
|
+
registerCleanup(cleanup: TriggerCleanupHandle): void;
|
|
1033
|
+
emit(items: Items): Promise<void>;
|
|
1034
|
+
/** Generic polling-trigger surface. Pre-binds trigger id, emit, and registerCleanup. */
|
|
1035
|
+
readonly polling: PollingTriggerHandle;
|
|
1036
|
+
}
|
|
1037
|
+
interface TriggerTestItemsContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
1038
|
+
trigger: TriggerInstanceId;
|
|
1039
|
+
nodeId: NodeId;
|
|
1040
|
+
config: TConfig;
|
|
1041
|
+
previousState: TSetupState$1;
|
|
1042
|
+
}
|
|
1043
|
+
interface TriggerCleanupHandle {
|
|
1044
|
+
stop(): Promise<void> | void;
|
|
1045
|
+
}
|
|
784
1046
|
/**
|
|
785
|
-
*
|
|
786
|
-
*
|
|
787
|
-
*
|
|
1047
|
+
* Per-item runnable node: return JSON, an array to fan-out on `main`, an explicit `Item`, or {@link emitPorts}
|
|
1048
|
+
* for multi-port emission. Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input`
|
|
1049
|
+
* (wire `item.json` is unchanged). Transform helpers may opt into binary preservation, while routers and
|
|
1050
|
+
* pass-through nodes should return explicit items when they need to preserve full item state.
|
|
788
1051
|
*/
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
1052
|
+
interface RunnableNodeExecuteArgs<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown> {
|
|
1053
|
+
readonly input: TInputJson$1;
|
|
1054
|
+
readonly item: Item;
|
|
1055
|
+
readonly itemIndex: number;
|
|
1056
|
+
readonly items: Items;
|
|
1057
|
+
readonly ctx: NodeExecutionContext<TConfig>;
|
|
1058
|
+
}
|
|
1059
|
+
interface RunnableNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, _TOutputJson = unknown> {
|
|
1060
|
+
readonly kind: "node";
|
|
1061
|
+
/**
|
|
1062
|
+
* Declared output ports (e.g. `["main"]`).
|
|
1063
|
+
*
|
|
1064
|
+
* Prefer describing dynamic router ports (Switch) and fixed multi-ports (If true/false)
|
|
1065
|
+
* via {@link NodeConfigBase.declaredOutputPorts}. Engine defaults to `["main"]` when omitted.
|
|
1066
|
+
*/
|
|
1067
|
+
readonly outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
1068
|
+
/** When omitted, engine uses {@link RunnableNodeConfig.inputSchema} or `z.unknown()`. */
|
|
1069
|
+
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
1070
|
+
execute(args: RunnableNodeExecuteArgs<TConfig, TInputJson$1>): Promise<unknown> | unknown;
|
|
1071
|
+
}
|
|
1072
|
+
interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
1073
|
+
kind: "node";
|
|
1074
|
+
/**
|
|
1075
|
+
* Declared output ports (typically `["main"]`).
|
|
1076
|
+
*
|
|
1077
|
+
* Prefer describing ports for authoring/canvas via {@link NodeConfigBase.declaredOutputPorts}.
|
|
1078
|
+
* Engine defaults to `["main"]` when omitted.
|
|
1079
|
+
*/
|
|
1080
|
+
outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
1081
|
+
executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
1082
|
+
}
|
|
1083
|
+
type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;
|
|
1084
|
+
interface TriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> {
|
|
1085
|
+
kind: "trigger";
|
|
1086
|
+
outputPorts: readonly ["main"];
|
|
1087
|
+
setup(ctx: TriggerSetupContext<TConfig>): Promise<TriggerSetupStateFor<TConfig>>;
|
|
1088
|
+
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
1089
|
+
}
|
|
1090
|
+
interface TestableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> extends TriggerNode<TConfig> {
|
|
1091
|
+
getTestItems(ctx: TriggerTestItemsContext<TConfig>): Promise<Items>;
|
|
1092
|
+
}
|
|
1093
|
+
type ExecutableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> = TriggerNode<TConfig>;
|
|
1094
|
+
//#endregion
|
|
1095
|
+
//#region ../core/src/contracts/itemExpr.d.ts
|
|
1096
|
+
declare const ITEM_EXPR_BRAND: unique symbol;
|
|
1097
|
+
type ItemExprResolvedContext = Readonly<{
|
|
1098
|
+
runId: RunId;
|
|
1099
|
+
workflowId: WorkflowId;
|
|
1100
|
+
nodeId: NodeId;
|
|
1101
|
+
activationId: NodeActivationId;
|
|
1102
|
+
data: RunDataSnapshot;
|
|
800
1103
|
}>;
|
|
801
1104
|
/**
|
|
802
|
-
*
|
|
803
|
-
* Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
|
|
804
|
-
* against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
|
|
1105
|
+
* Context aligned with former {@link ItemInputMapperContext} — use **`data`** to read any completed upstream node.
|
|
805
1106
|
*/
|
|
806
|
-
type
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
1107
|
+
type ItemExprContext = ItemExprResolvedContext;
|
|
1108
|
+
type ItemExprArgs<TItemJson = unknown> = Readonly<{
|
|
1109
|
+
item: Item<TItemJson>;
|
|
1110
|
+
itemIndex: number;
|
|
1111
|
+
items: Items<TItemJson>;
|
|
1112
|
+
ctx: ItemExprContext;
|
|
810
1113
|
}>;
|
|
811
|
-
type
|
|
812
|
-
type
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
* Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
|
|
816
|
-
*/
|
|
817
|
-
type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
|
|
818
|
-
definition: CredentialTypeDefinition;
|
|
819
|
-
createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
|
|
820
|
-
test: CredentialHealthTester<TPublicConfig, TMaterial>;
|
|
1114
|
+
type ItemExprCallback<T, TItemJson = unknown> = (args: ItemExprArgs<TItemJson>) => T | Promise<T>;
|
|
1115
|
+
type ItemExpr<T, TItemJson = unknown> = Readonly<{
|
|
1116
|
+
readonly [ITEM_EXPR_BRAND]: true;
|
|
1117
|
+
readonly fn: ItemExprCallback<T, TItemJson>;
|
|
821
1118
|
}>;
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
*/
|
|
827
|
-
type AnyCredentialType = CredentialType<any, any, unknown>;
|
|
828
|
-
interface CredentialSessionService {
|
|
829
|
-
getSession<TSession = unknown>(args: Readonly<{
|
|
830
|
-
workflowId: WorkflowId;
|
|
831
|
-
nodeId: NodeId;
|
|
832
|
-
slotKey: string;
|
|
833
|
-
}>): Promise<TSession>;
|
|
834
|
-
}
|
|
1119
|
+
//#endregion
|
|
1120
|
+
//#region ../core/src/contracts/params.d.ts
|
|
1121
|
+
type Expr<T, TItemJson = unknown> = ItemExpr<T, TItemJson>;
|
|
1122
|
+
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);
|
|
835
1123
|
//#endregion
|
|
836
1124
|
//#region ../core/src/authoring/defineNode.types.d.ts
|
|
837
1125
|
type ResolvableCredentialType = AnyCredentialType | CredentialTypeId;
|
|
@@ -897,6 +1185,15 @@ type ToolExecuteArgs<TConfig extends ToolConfig = ToolConfig, TInput = unknown>
|
|
|
897
1185
|
item: Item;
|
|
898
1186
|
itemIndex: number;
|
|
899
1187
|
items: Items;
|
|
1188
|
+
/**
|
|
1189
|
+
* Optional sub-agent boundary hooks: when present, the live `agent.tool.call` span and the
|
|
1190
|
+
* planned tool-call invocationId are forwarded so node-backed runtimes can re-root their child
|
|
1191
|
+
* execution scope. Plain function tools may safely ignore these hooks.
|
|
1192
|
+
*/
|
|
1193
|
+
hooks?: Readonly<{
|
|
1194
|
+
parentSpan?: TelemetrySpanScope;
|
|
1195
|
+
parentInvocationId?: ConnectionInvocationId;
|
|
1196
|
+
}>;
|
|
900
1197
|
}>;
|
|
901
1198
|
type AgentMessageRole = "system" | "user" | "assistant";
|
|
902
1199
|
type AgentMessageBuildArgs<TInputJson$1 = unknown> = Readonly<{
|
|
@@ -947,25 +1244,47 @@ interface ChatModelConfig {
|
|
|
947
1244
|
readonly presentation?: AgentCanvasPresentation;
|
|
948
1245
|
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
949
1246
|
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1247
|
+
/**
|
|
1248
|
+
* Provider-neutral chat language model wrapper returned by a {@link ChatModelFactory}.
|
|
1249
|
+
*
|
|
1250
|
+
* Thin adapter around an AI SDK `LanguageModelV2` (from `@ai-sdk/provider`) plus the call-site
|
|
1251
|
+
* defaults Codemation needs at every generate/stream: the provider label, the model name used for
|
|
1252
|
+
* pricing / telemetry, and the default invocation options (max output tokens, temperature,
|
|
1253
|
+
* provider-specific overrides).
|
|
1254
|
+
*
|
|
1255
|
+
* The consumer (AIAgentNode / AgentStructuredOutputRunner) passes `languageModel` directly into
|
|
1256
|
+
* `generateText({ model, ... })` from the `ai` package.
|
|
1257
|
+
*/
|
|
1258
|
+
interface ChatLanguageModel {
|
|
1259
|
+
/** AI SDK `LanguageModelV2` instance (kept `unknown` to avoid leaking the SDK type into `@codemation/core`). */
|
|
1260
|
+
readonly languageModel: unknown;
|
|
1261
|
+
/** Stable pricing/telemetry key — e.g. `"gpt-4.1-nano"`. */
|
|
1262
|
+
readonly modelName: string;
|
|
1263
|
+
/** Provider label — e.g. `"openai"`. Used for cost tracking. */
|
|
1264
|
+
readonly provider?: string;
|
|
1265
|
+
/** Defaults merged into every call. Consumers may override per-invocation. */
|
|
1266
|
+
readonly defaultCallOptions?: ChatLanguageModelCallOptions;
|
|
954
1267
|
}
|
|
955
|
-
interface
|
|
956
|
-
|
|
1268
|
+
interface ChatLanguageModelCallOptions {
|
|
1269
|
+
readonly maxOutputTokens?: number;
|
|
1270
|
+
readonly temperature?: number;
|
|
1271
|
+
readonly providerOptions?: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
|
|
957
1272
|
}
|
|
958
|
-
|
|
959
|
-
|
|
1273
|
+
/**
|
|
1274
|
+
* Options for a structured-output generate call. Mirrors
|
|
1275
|
+
* `generateText({ output: Output.object(...) })` from the `ai` package.
|
|
1276
|
+
*/
|
|
1277
|
+
interface StructuredOutputOptions {
|
|
1278
|
+
/** Optional schema name — used by some providers as the JSON schema name attribute. */
|
|
1279
|
+
readonly schemaName?: string;
|
|
1280
|
+
/** When `true`, the consumer should pass a strict-mode-compatible JSON Schema record. */
|
|
960
1281
|
readonly strict?: boolean;
|
|
961
|
-
readonly includeRaw?: boolean;
|
|
962
|
-
readonly tools?: ReadonlyArray<unknown>;
|
|
963
1282
|
}
|
|
964
1283
|
interface ChatModelFactory<TConfig extends ChatModelConfig = ChatModelConfig> {
|
|
965
1284
|
create(args: Readonly<{
|
|
966
1285
|
config: TConfig;
|
|
967
1286
|
ctx: NodeExecutionContext<any>;
|
|
968
|
-
}>): Promise<
|
|
1287
|
+
}>): Promise<ChatLanguageModel> | ChatLanguageModel;
|
|
969
1288
|
}
|
|
970
1289
|
type NodeBackedToolInputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = Readonly<{
|
|
971
1290
|
input: TToolInput;
|
|
@@ -1002,6 +1321,32 @@ interface AgentNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> exten
|
|
|
1002
1321
|
readonly outputSchema?: ZodType<TOutputJson$1>;
|
|
1003
1322
|
}
|
|
1004
1323
|
//#endregion
|
|
1324
|
+
//#region ../core/src/execution/ChildExecutionScopeFactory.d.ts
|
|
1325
|
+
/**
|
|
1326
|
+
* Builds a re-rooted child execution context for sub-agent (and other deeply-nested) invocations.
|
|
1327
|
+
*
|
|
1328
|
+
* At the orchestrator's `agent.tool.call` boundary the inner runtime needs a ctx whose:
|
|
1329
|
+
* - `nodeId` is the tool's connection node id (so inner LLM/tool connection ids derive correctly),
|
|
1330
|
+
* - `activationId` is fresh (so its connection-invocation rows are uniquely identifiable),
|
|
1331
|
+
* - `telemetry` parents children under the tool-call span (not the orchestrator's node span),
|
|
1332
|
+
* - `binary` is scoped to the new (nodeId, activationId),
|
|
1333
|
+
* - `parentInvocationId` points back to the tool-call invocation for downstream lineage.
|
|
1334
|
+
*
|
|
1335
|
+
* Registered via factory in {@link EngineRuntimeRegistrar} so constructors stay free of parameter
|
|
1336
|
+
* decorators (Next/SWC and coverage tooling cannot parse them on in-repo sources).
|
|
1337
|
+
*/
|
|
1338
|
+
declare class ChildExecutionScopeFactory {
|
|
1339
|
+
private readonly activationIdFactory;
|
|
1340
|
+
constructor(activationIdFactory: ActivationIdFactory);
|
|
1341
|
+
forSubAgent<TConfig extends RunnableNodeConfig<any, any>>(args: Readonly<{
|
|
1342
|
+
parentCtx: NodeExecutionContext<TConfig>;
|
|
1343
|
+
childNodeId: NodeId;
|
|
1344
|
+
childConfig: TConfig;
|
|
1345
|
+
parentInvocationId: ConnectionInvocationId;
|
|
1346
|
+
parentSpan: TelemetrySpanScope;
|
|
1347
|
+
}>): NodeExecutionContext<TConfig>;
|
|
1348
|
+
}
|
|
1349
|
+
//#endregion
|
|
1005
1350
|
//#region ../core/src/execution/ItemExprResolver.d.ts
|
|
1006
1351
|
/**
|
|
1007
1352
|
* Resolves {@link import("../contracts/itemExpr").ItemExpr} leaves on runnable config before {@link RunnableNode.execute}.
|
|
@@ -1033,6 +1378,351 @@ declare class NodeOutputNormalizer {
|
|
|
1033
1378
|
private applyOutput;
|
|
1034
1379
|
}
|
|
1035
1380
|
//#endregion
|
|
1381
|
+
//#region src/http/httpRequest.types.d.ts
|
|
1382
|
+
/**
|
|
1383
|
+
* Binary reference key into `item.binary`.
|
|
1384
|
+
*/
|
|
1385
|
+
type BinaryRef = string;
|
|
1386
|
+
/**
|
|
1387
|
+
* Discriminated union for the HTTP request body.
|
|
1388
|
+
*/
|
|
1389
|
+
type HttpBodySpec = Readonly<{
|
|
1390
|
+
kind: "none";
|
|
1391
|
+
}> | Readonly<{
|
|
1392
|
+
kind: "json";
|
|
1393
|
+
data: unknown;
|
|
1394
|
+
}> | Readonly<{
|
|
1395
|
+
kind: "form";
|
|
1396
|
+
data: Readonly<Record<string, string>>;
|
|
1397
|
+
}> | Readonly<{
|
|
1398
|
+
kind: "multipart";
|
|
1399
|
+
fields: Readonly<Record<string, string>>;
|
|
1400
|
+
binaries?: Readonly<Record<string, BinaryRef>>;
|
|
1401
|
+
}> | Readonly<{
|
|
1402
|
+
/**
|
|
1403
|
+
* Send raw bytes from a binary slot as the request body.
|
|
1404
|
+
* The binary attachment's `mimeType` is used as `Content-Type` unless
|
|
1405
|
+
* the request `headers` map already contains `content-type`.
|
|
1406
|
+
*/
|
|
1407
|
+
kind: "binary";
|
|
1408
|
+
/** Key into `item.binary` to read the request body bytes from. */
|
|
1409
|
+
slot: string;
|
|
1410
|
+
}>;
|
|
1411
|
+
/**
|
|
1412
|
+
* Session interface that credential types implement.
|
|
1413
|
+
* Returns header/query deltas so the executor can merge them without
|
|
1414
|
+
* mutating the immutable HttpRequestSpec.
|
|
1415
|
+
*/
|
|
1416
|
+
interface CredentialSession {
|
|
1417
|
+
applyToRequest(spec: HttpRequestSpec): HttpCredentialDelta;
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Mutations the credential session wants to apply to the outgoing request.
|
|
1421
|
+
*/
|
|
1422
|
+
type HttpCredentialDelta = Readonly<{
|
|
1423
|
+
headers?: Readonly<Record<string, string>>;
|
|
1424
|
+
query?: Readonly<Record<string, string>>;
|
|
1425
|
+
}>;
|
|
1426
|
+
/**
|
|
1427
|
+
* Full specification of one HTTP request. All URLs are fully resolved before
|
|
1428
|
+
* being passed here (template substitution already applied by the caller).
|
|
1429
|
+
*/
|
|
1430
|
+
type HttpRequestSpec = Readonly<{
|
|
1431
|
+
url: string;
|
|
1432
|
+
method: string;
|
|
1433
|
+
headers?: Readonly<Record<string, string>>;
|
|
1434
|
+
query?: Readonly<Record<string, string | string[]>>;
|
|
1435
|
+
body?: HttpBodySpec;
|
|
1436
|
+
credential?: CredentialSession;
|
|
1437
|
+
download?: Readonly<{
|
|
1438
|
+
mode: "auto" | "always" | "never";
|
|
1439
|
+
binaryName: string;
|
|
1440
|
+
}>;
|
|
1441
|
+
/**
|
|
1442
|
+
* When set to `"binary"`, the response body is written to a binary slot
|
|
1443
|
+
* instead of being parsed as JSON/text. Overrides `download` mode.
|
|
1444
|
+
*/
|
|
1445
|
+
responseFormat?: "json" | "text" | "binary";
|
|
1446
|
+
/** Binary slot name for the response body when `responseFormat === "binary"`. Defaults to `"response"`. */
|
|
1447
|
+
responseBinarySlot?: string;
|
|
1448
|
+
/** Maximum allowed response size in bytes (checked against Content-Length before allocating). Defaults to 100 MiB. */
|
|
1449
|
+
responseSizeCapBytes?: number;
|
|
1450
|
+
/** Execution context — needed for binary attach. */
|
|
1451
|
+
ctx: NodeExecutionContext<RunnableNodeConfig<unknown, unknown>>;
|
|
1452
|
+
}>;
|
|
1453
|
+
/**
|
|
1454
|
+
* Result of executing an HTTP request.
|
|
1455
|
+
*/
|
|
1456
|
+
type HttpRequestResult = Readonly<{
|
|
1457
|
+
url: string;
|
|
1458
|
+
method: string;
|
|
1459
|
+
status: number;
|
|
1460
|
+
ok: boolean;
|
|
1461
|
+
statusText: string;
|
|
1462
|
+
mimeType: string;
|
|
1463
|
+
headers: Readonly<Record<string, string>>;
|
|
1464
|
+
json?: unknown;
|
|
1465
|
+
text?: string;
|
|
1466
|
+
bodyBinaryName?: string;
|
|
1467
|
+
/** Set when `responseFormat === "binary"`. Name of the binary slot the response body was written to. */
|
|
1468
|
+
binarySlot?: string;
|
|
1469
|
+
/** Set when `responseFormat === "binary"`. The MIME type of the stored response. */
|
|
1470
|
+
contentType?: string;
|
|
1471
|
+
/** Set when `responseFormat === "binary"`. Size in bytes of the stored response. */
|
|
1472
|
+
size?: number;
|
|
1473
|
+
/** Set when `responseFormat === "binary"`. Filename inferred from URL or Content-Disposition. */
|
|
1474
|
+
filename?: string;
|
|
1475
|
+
}>;
|
|
1476
|
+
//#endregion
|
|
1477
|
+
//#region src/credentials/ApiKeyCredentialType.d.ts
|
|
1478
|
+
/**
|
|
1479
|
+
* API key credential that injects a key either as an HTTP header or a query parameter.
|
|
1480
|
+
*/
|
|
1481
|
+
declare const apiKeyCredentialType: Readonly<{
|
|
1482
|
+
definition: Readonly<{
|
|
1483
|
+
typeId: CredentialTypeId;
|
|
1484
|
+
displayName: string;
|
|
1485
|
+
description?: string;
|
|
1486
|
+
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1487
|
+
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1488
|
+
advancedSection?: CredentialAdvancedSectionPresentation;
|
|
1489
|
+
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
1490
|
+
auth?: CredentialAuthDefinition;
|
|
1491
|
+
}>;
|
|
1492
|
+
createSession: CredentialSessionFactory<{
|
|
1493
|
+
placement: unknown;
|
|
1494
|
+
name: unknown;
|
|
1495
|
+
}, {
|
|
1496
|
+
apiKey: unknown;
|
|
1497
|
+
}, CredentialSession>;
|
|
1498
|
+
test: CredentialHealthTester<{
|
|
1499
|
+
placement: unknown;
|
|
1500
|
+
name: unknown;
|
|
1501
|
+
}, {
|
|
1502
|
+
apiKey: unknown;
|
|
1503
|
+
}>;
|
|
1504
|
+
}> & {
|
|
1505
|
+
readonly key: string;
|
|
1506
|
+
};
|
|
1507
|
+
//#endregion
|
|
1508
|
+
//#region src/credentials/BasicAuthCredentialType.d.ts
|
|
1509
|
+
/**
|
|
1510
|
+
* HTTP Basic authentication credential.
|
|
1511
|
+
* Session sets `Authorization: Basic <base64(username:password)>`.
|
|
1512
|
+
*/
|
|
1513
|
+
declare const basicAuthCredentialType: Readonly<{
|
|
1514
|
+
definition: Readonly<{
|
|
1515
|
+
typeId: CredentialTypeId;
|
|
1516
|
+
displayName: string;
|
|
1517
|
+
description?: string;
|
|
1518
|
+
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1519
|
+
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1520
|
+
advancedSection?: CredentialAdvancedSectionPresentation;
|
|
1521
|
+
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
1522
|
+
auth?: CredentialAuthDefinition;
|
|
1523
|
+
}>;
|
|
1524
|
+
createSession: CredentialSessionFactory<{
|
|
1525
|
+
username: unknown;
|
|
1526
|
+
}, {
|
|
1527
|
+
password: unknown;
|
|
1528
|
+
}, CredentialSession>;
|
|
1529
|
+
test: CredentialHealthTester<{
|
|
1530
|
+
username: unknown;
|
|
1531
|
+
}, {
|
|
1532
|
+
password: unknown;
|
|
1533
|
+
}>;
|
|
1534
|
+
}> & {
|
|
1535
|
+
readonly key: string;
|
|
1536
|
+
};
|
|
1537
|
+
//#endregion
|
|
1538
|
+
//#region src/credentials/BearerTokenCredentialType.d.ts
|
|
1539
|
+
/**
|
|
1540
|
+
* Simple Bearer token credential.
|
|
1541
|
+
* Session sets `Authorization: Bearer <token>` on every request.
|
|
1542
|
+
*/
|
|
1543
|
+
declare const bearerTokenCredentialType: Readonly<{
|
|
1544
|
+
definition: Readonly<{
|
|
1545
|
+
typeId: CredentialTypeId;
|
|
1546
|
+
displayName: string;
|
|
1547
|
+
description?: string;
|
|
1548
|
+
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1549
|
+
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1550
|
+
advancedSection?: CredentialAdvancedSectionPresentation;
|
|
1551
|
+
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
1552
|
+
auth?: CredentialAuthDefinition;
|
|
1553
|
+
}>;
|
|
1554
|
+
createSession: CredentialSessionFactory<Readonly<Record<string, unknown>>, {
|
|
1555
|
+
token: unknown;
|
|
1556
|
+
}, CredentialSession>;
|
|
1557
|
+
test: CredentialHealthTester<Readonly<Record<string, unknown>>, {
|
|
1558
|
+
token: unknown;
|
|
1559
|
+
}>;
|
|
1560
|
+
}> & {
|
|
1561
|
+
readonly key: string;
|
|
1562
|
+
};
|
|
1563
|
+
//#endregion
|
|
1564
|
+
//#region src/credentials/OAuth2ClientCredentialsTypeFactory.d.ts
|
|
1565
|
+
/**
|
|
1566
|
+
* OAuth2 client-credentials flow credential.
|
|
1567
|
+
*
|
|
1568
|
+
* This is a machine-to-machine flow: no user redirect occurs. The session
|
|
1569
|
+
* POSTs to the configured `tokenUrl` with `client_credentials` grant, caches
|
|
1570
|
+
* the resulting access token for the duration of the session, and injects it
|
|
1571
|
+
* as `Authorization: Bearer <token>` on each request.
|
|
1572
|
+
*
|
|
1573
|
+
* Token caching is per-session only (one createSession call = one token fetch
|
|
1574
|
+
* at most). Cross-session caching would require host-level state and is out of
|
|
1575
|
+
* scope here. Because the engine creates a fresh session per execution, a new
|
|
1576
|
+
* token is fetched once per node activation.
|
|
1577
|
+
*
|
|
1578
|
+
* NOTE: `auth` is intentionally omitted from the definition. The OAuth2
|
|
1579
|
+
* `auth: { kind: "oauth2" }` shape signals an authorization-code / user-redirect
|
|
1580
|
+
* flow; using it here would cause the host UI to render an OAuth consent button
|
|
1581
|
+
* that goes nowhere. Client-credentials is a purely server-side flow.
|
|
1582
|
+
*/
|
|
1583
|
+
declare const oauth2ClientCredentialsType: Readonly<{
|
|
1584
|
+
definition: Readonly<{
|
|
1585
|
+
typeId: CredentialTypeId;
|
|
1586
|
+
displayName: string;
|
|
1587
|
+
description?: string;
|
|
1588
|
+
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1589
|
+
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1590
|
+
advancedSection?: CredentialAdvancedSectionPresentation;
|
|
1591
|
+
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
1592
|
+
auth?: CredentialAuthDefinition;
|
|
1593
|
+
}>;
|
|
1594
|
+
createSession: CredentialSessionFactory<{
|
|
1595
|
+
tokenUrl: unknown;
|
|
1596
|
+
scopes: unknown;
|
|
1597
|
+
audience: unknown;
|
|
1598
|
+
}, {
|
|
1599
|
+
clientId: unknown;
|
|
1600
|
+
clientSecret: unknown;
|
|
1601
|
+
}, CredentialSession>;
|
|
1602
|
+
test: CredentialHealthTester<{
|
|
1603
|
+
tokenUrl: unknown;
|
|
1604
|
+
scopes: unknown;
|
|
1605
|
+
audience: unknown;
|
|
1606
|
+
}, {
|
|
1607
|
+
clientId: unknown;
|
|
1608
|
+
clientSecret: unknown;
|
|
1609
|
+
}>;
|
|
1610
|
+
}> & {
|
|
1611
|
+
readonly key: string;
|
|
1612
|
+
};
|
|
1613
|
+
//#endregion
|
|
1614
|
+
//#region src/authoring/defineRestNode.types.d.ts
|
|
1615
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
1616
|
+
/**
|
|
1617
|
+
* API endpoint descriptor.
|
|
1618
|
+
*/
|
|
1619
|
+
type RestNodeApi = Readonly<{
|
|
1620
|
+
/**
|
|
1621
|
+
* Base URL, e.g. `"https://api.slack.com"`.
|
|
1622
|
+
*/
|
|
1623
|
+
baseUrl: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* Path relative to `baseUrl`. May contain `{paramName}` placeholders that
|
|
1626
|
+
* are substituted from `input` keys before the request is made.
|
|
1627
|
+
* Example: `"/users/{userId}/profile"`
|
|
1628
|
+
*/
|
|
1629
|
+
path: string;
|
|
1630
|
+
/** HTTP method (default: GET). */
|
|
1631
|
+
method?: string;
|
|
1632
|
+
}>;
|
|
1633
|
+
/**
|
|
1634
|
+
* The HTTP result shape passed into the `response` mapper.
|
|
1635
|
+
*/
|
|
1636
|
+
type RestNodeResponseContext = Readonly<{
|
|
1637
|
+
status: number;
|
|
1638
|
+
ok: boolean;
|
|
1639
|
+
statusText: string;
|
|
1640
|
+
mimeType: string;
|
|
1641
|
+
headers: Readonly<Record<string, string>>;
|
|
1642
|
+
json?: unknown;
|
|
1643
|
+
text?: string;
|
|
1644
|
+
}>;
|
|
1645
|
+
/**
|
|
1646
|
+
* What the `request` callback may return to customise the request.
|
|
1647
|
+
*/
|
|
1648
|
+
type RestNodeRequestShape = Readonly<{
|
|
1649
|
+
/** Additional path parameters to substitute (merged with `input`). */
|
|
1650
|
+
pathParams?: Readonly<Record<string, string>>;
|
|
1651
|
+
/** Extra query params. */
|
|
1652
|
+
query?: Readonly<Record<string, string>>;
|
|
1653
|
+
/** Extra headers. */
|
|
1654
|
+
headers?: Readonly<Record<string, string>>;
|
|
1655
|
+
/** Request body. */
|
|
1656
|
+
body?: HttpBodySpec;
|
|
1657
|
+
}>;
|
|
1658
|
+
/**
|
|
1659
|
+
* Error handling policy for non-2xx responses.
|
|
1660
|
+
* - `"throw"` (default) — throws an `Error` for non-2xx responses.
|
|
1661
|
+
* - `"passthrough"` — returns the result regardless of status.
|
|
1662
|
+
*/
|
|
1663
|
+
type RestNodeErrorPolicy = "throw" | "passthrough";
|
|
1664
|
+
interface DefineRestNodeOptions<TKey$1 extends string, TCredentials extends DefinedNodeCredentialBindings | undefined, TInputJson$1, TOutputJson$1> {
|
|
1665
|
+
readonly key: TKey$1;
|
|
1666
|
+
readonly title: string;
|
|
1667
|
+
readonly description?: string;
|
|
1668
|
+
readonly icon?: string;
|
|
1669
|
+
readonly api: RestNodeApi;
|
|
1670
|
+
/**
|
|
1671
|
+
* Credential bindings keyed by slot. Use the built-in credential types from
|
|
1672
|
+
* `@codemation/core-nodes` (e.g. `bearerTokenCredentialType`) or any custom one.
|
|
1673
|
+
* The slot key must match what the `request` callback's context uses.
|
|
1674
|
+
*/
|
|
1675
|
+
readonly credentials?: TCredentials;
|
|
1676
|
+
/**
|
|
1677
|
+
* Zod schema for per-item input. Validated before `execute`.
|
|
1678
|
+
*/
|
|
1679
|
+
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
1680
|
+
/**
|
|
1681
|
+
* Builds the per-request customisations from the item input.
|
|
1682
|
+
* Return `body`, `query`, `headers`, and/or `pathParams`.
|
|
1683
|
+
*/
|
|
1684
|
+
request?(context: Readonly<{
|
|
1685
|
+
input: TInputJson$1;
|
|
1686
|
+
}>): MaybePromise<RestNodeRequestShape>;
|
|
1687
|
+
/**
|
|
1688
|
+
* Maps the HTTP response to the node's output JSON.
|
|
1689
|
+
* When omitted, the output is `{ status, ok, statusText, mimeType, headers, json, text }`.
|
|
1690
|
+
*/
|
|
1691
|
+
response?(context: RestNodeResponseContext & Readonly<{
|
|
1692
|
+
input: TInputJson$1;
|
|
1693
|
+
}>): MaybePromise<TOutputJson$1>;
|
|
1694
|
+
/**
|
|
1695
|
+
* How to handle non-2xx responses.
|
|
1696
|
+
* @default "throw"
|
|
1697
|
+
*/
|
|
1698
|
+
readonly errorPolicy?: RestNodeErrorPolicy;
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* Declarative helper for creating thin API-wrapper nodes.
|
|
1702
|
+
*
|
|
1703
|
+
* Usage:
|
|
1704
|
+
* ```ts
|
|
1705
|
+
* export const postMessage = defineRestNode({
|
|
1706
|
+
* key: "slack.post-message",
|
|
1707
|
+
* title: "Send Slack message",
|
|
1708
|
+
* icon: "si:slack",
|
|
1709
|
+
* api: { baseUrl: "https://slack.com/api", path: "/chat.postMessage", method: "POST" },
|
|
1710
|
+
* credentials: { auth: bearerTokenCredentialType },
|
|
1711
|
+
* inputSchema: z.object({ channel: z.string(), text: z.string() }),
|
|
1712
|
+
* request: ({ input }) => ({
|
|
1713
|
+
* body: { kind: "json", data: { channel: input.channel, text: input.text } },
|
|
1714
|
+
* }),
|
|
1715
|
+
* response: ({ json }) => ({ messageTs: (json as any).ts }),
|
|
1716
|
+
* });
|
|
1717
|
+
* ```
|
|
1718
|
+
*
|
|
1719
|
+
* - `defineRestNode` is a thin wrapper over `defineNode`; it does not introduce a new runtime kind.
|
|
1720
|
+
* - Credential sessions are resolved via the `credentials` binding map (same as `defineNode`).
|
|
1721
|
+
* - Path `{placeholder}` substitution is applied from `input` keys before the request is made.
|
|
1722
|
+
* - Non-2xx responses throw an `Error` by default (`errorPolicy: "throw"`).
|
|
1723
|
+
*/
|
|
1724
|
+
declare function defineRestNode<TKey$1 extends string, TCredentials extends DefinedNodeCredentialBindings | undefined, TInputJson$1, TOutputJson$1 = RestNodeResponseContext>(options: DefineRestNodeOptions<TKey$1, TCredentials, TInputJson$1, TOutputJson$1>): DefinedNode<TKey$1, Record<string, never>, TInputJson$1, TOutputJson$1, TCredentials>;
|
|
1725
|
+
//#endregion
|
|
1036
1726
|
//#region src/chatModels/openAiChatModelConfig.d.ts
|
|
1037
1727
|
declare class OpenAIChatModelConfig implements ChatModelConfig {
|
|
1038
1728
|
readonly name: string;
|
|
@@ -1058,16 +1748,96 @@ declare class OpenAIChatModelFactory implements ChatModelFactory<OpenAIChatModel
|
|
|
1058
1748
|
create(args: Readonly<{
|
|
1059
1749
|
config: OpenAIChatModelConfig;
|
|
1060
1750
|
ctx: NodeExecutionContext<any>;
|
|
1061
|
-
}>): Promise<
|
|
1751
|
+
}>): Promise<ChatLanguageModel>;
|
|
1752
|
+
}
|
|
1753
|
+
//#endregion
|
|
1754
|
+
//#region src/nodes/ConnectionCredentialExecutionContextFactory.d.ts
|
|
1755
|
+
/**
|
|
1756
|
+
* Builds a {@link NodeExecutionContext} whose identity for credential binding and `getCredential`
|
|
1757
|
+
* is a **connection-owned** workflow node id (`ConnectionNodeIdFactory` in `@codemation/core`),
|
|
1758
|
+
* not the executing parent node. Use for LLM slots, tool slots, or any connection-scoped owner.
|
|
1759
|
+
*/
|
|
1760
|
+
declare class ConnectionCredentialExecutionContextFactory {
|
|
1761
|
+
private readonly credentialResolverFactory;
|
|
1762
|
+
constructor(credentialSessions: CredentialSessionService);
|
|
1763
|
+
forConnectionNode<TConfig extends NodeConfigBase>(ctx: NodeExecutionContext<TConfig>, args: Readonly<{
|
|
1764
|
+
connectionNodeId: NodeId;
|
|
1765
|
+
getCredentialRequirements: () => ReadonlyArray<CredentialRequirement>;
|
|
1766
|
+
}>): NodeExecutionContext<TConfig>;
|
|
1767
|
+
}
|
|
1768
|
+
//#endregion
|
|
1769
|
+
//#region src/nodes/AIAgentExecutionHelpersFactory.d.ts
|
|
1770
|
+
/**
|
|
1771
|
+
* Helper utilities shared by {@link AIAgentNode} and supporting runners.
|
|
1772
|
+
*
|
|
1773
|
+
* Responsibilities:
|
|
1774
|
+
* - {@link #createConnectionCredentialExecutionContextFactory} centralizes credential-context wiring.
|
|
1775
|
+
* - {@link #createJsonSchemaRecord} is a pure Zod → draft-07 converter used by both
|
|
1776
|
+
* `OpenAiStrictJsonSchemaFactory` (to feed OpenAI-strict structured output) and the
|
|
1777
|
+
* `AgentStructuredOutputRepairPromptFactory` (to show a required-schema reminder).
|
|
1778
|
+
*/
|
|
1779
|
+
declare class AIAgentExecutionHelpersFactory {
|
|
1780
|
+
createConnectionCredentialExecutionContextFactory(credentialSessions: CredentialSessionService): ConnectionCredentialExecutionContextFactory;
|
|
1781
|
+
/**
|
|
1782
|
+
* Produces a plain JSON Schema object (`draft-07`) from a Zod schema, as needed by
|
|
1783
|
+
* OpenAI tool-parameter schemas and the structured-output repair prompt.
|
|
1784
|
+
* - Prefers the schema's **instance** `toJSONSchema(...)` method so we stay inside the Zod
|
|
1785
|
+
* instance that created the schema (works across consumer/framework tsx namespaces — see
|
|
1786
|
+
* {@link ZodInstanceToJsonSchema}). Falls back to the framework-imported module function.
|
|
1787
|
+
* - Strips root `$schema` (OpenAI ignores it).
|
|
1788
|
+
* - Sanitizes `required` for cfworker json-schema compatibility (must be a string array or absent).
|
|
1789
|
+
*/
|
|
1790
|
+
createJsonSchemaRecord(inputSchema: ZodSchemaAny, options: Readonly<{
|
|
1791
|
+
schemaName: string;
|
|
1792
|
+
requireObjectRoot: boolean;
|
|
1793
|
+
}>): Record<string, unknown>;
|
|
1794
|
+
/**
|
|
1795
|
+
* Runs Zod's `toJSONSchema` via the schema's own instance method when available, so consumer
|
|
1796
|
+
* schemas loaded under a different tsx namespace still convert correctly. If the caller handed us
|
|
1797
|
+
* a payload that lacks that method (e.g. a plain JSON Schema record or a Zod instance whose
|
|
1798
|
+
* prototype was stripped), we fall back to the framework-bundled module function.
|
|
1799
|
+
*/
|
|
1800
|
+
private convertZodSchemaToJsonSchema;
|
|
1801
|
+
/**
|
|
1802
|
+
* `@cfworker/json-schema` iterates `schema.required` with `for...of`; it must be a string array or absent.
|
|
1803
|
+
*/
|
|
1804
|
+
private sanitizeJsonSchemaRequiredKeywordsForCfworker;
|
|
1062
1805
|
}
|
|
1063
1806
|
//#endregion
|
|
1064
|
-
//#region src/chatModels/
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1807
|
+
//#region src/chatModels/OpenAiStrictJsonSchemaFactory.d.ts
|
|
1808
|
+
/**
|
|
1809
|
+
* Produces an OpenAI **strict mode**–compliant JSON Schema for an AIAgent `outputSchema`.
|
|
1810
|
+
*
|
|
1811
|
+
* Why this exists: AI SDK's default Zod → JSON Schema conversion (Zod v4's `toJSONSchema`) can
|
|
1812
|
+
* emit `unevaluatedProperties: false` or skip `additionalProperties: false` on object branches.
|
|
1813
|
+
* OpenAI's strict-mode validator rejects anything missing `additionalProperties: false` at
|
|
1814
|
+
* `context=()` (the root) and requires **all properties** in `required`. We convert here so all
|
|
1815
|
+
* legal Zod root shapes work (object, union, discriminated union, nullable-object wrapper, array,
|
|
1816
|
+
* intersection, …) and hand AI SDK a pre-tagged `jsonSchema(...)` record that passes straight
|
|
1817
|
+
* through to the provider.
|
|
1818
|
+
*
|
|
1819
|
+
* Rules enforced on the produced JSON Schema record:
|
|
1820
|
+
* - Every `type: "object"` node (root and nested under `allOf`/`anyOf`/`oneOf`/`items`/`prefixItems`/`$defs`):
|
|
1821
|
+
* - `additionalProperties: false`
|
|
1822
|
+
* - `required` lists **every** key in `properties` (OpenAI strict requires all properties required;
|
|
1823
|
+
* express optionality via `.nullable()` / `z.union([..., z.null()])`).
|
|
1824
|
+
* - `properties` is always an object (empty object allowed).
|
|
1825
|
+
* - `$schema`, `unevaluatedProperties`, and `default` are stripped (OpenAI rejects / ignores them).
|
|
1826
|
+
* - `sanitizeJsonSchemaRequiredKeywordsForCfworker` invariants from
|
|
1827
|
+
* {@link AIAgentExecutionHelpersFactory.createJsonSchemaRecord} are preserved as a starting point.
|
|
1828
|
+
*/
|
|
1829
|
+
declare class OpenAiStrictJsonSchemaFactory {
|
|
1830
|
+
private readonly executionHelpers;
|
|
1831
|
+
constructor(executionHelpers: AIAgentExecutionHelpersFactory);
|
|
1832
|
+
createStructuredOutputRecord(schema: ZodSchemaAny, options: Readonly<{
|
|
1833
|
+
schemaName: string;
|
|
1834
|
+
title?: string;
|
|
1835
|
+
}>): Record<string, unknown>;
|
|
1836
|
+
private strictifyRecursive;
|
|
1837
|
+
private stripOpenAiRejectedKeywords;
|
|
1838
|
+
private isObjectNode;
|
|
1839
|
+
private readPropertiesObject;
|
|
1840
|
+
private recurseIntoComposites;
|
|
1071
1841
|
}
|
|
1072
1842
|
//#endregion
|
|
1073
1843
|
//#region src/chatModels/OpenAiCredentialSession.d.ts
|
|
@@ -1089,41 +1859,6 @@ declare class OpenAiChatModelPresets {
|
|
|
1089
1859
|
}
|
|
1090
1860
|
declare const openAiChatModelPresets: OpenAiChatModelPresets;
|
|
1091
1861
|
//#endregion
|
|
1092
|
-
//#region src/nodes/AgentMessageFactory.d.ts
|
|
1093
|
-
declare class AgentMessageFactory {
|
|
1094
|
-
static createPromptMessages(messages: ReadonlyArray<AgentMessageDto>): ReadonlyArray<BaseMessage>;
|
|
1095
|
-
static createSystemPrompt(systemMessage: string): SystemMessage;
|
|
1096
|
-
static createUserPrompt(prompt: string): HumanMessage;
|
|
1097
|
-
static createAssistantPrompt(prompt: string): AIMessage;
|
|
1098
|
-
static createToolMessage(toolCallId: string, content: string): ToolMessage;
|
|
1099
|
-
static extractContent(message: unknown): string;
|
|
1100
|
-
static extractToolCalls(message: unknown): ReadonlyArray<AgentToolCall>;
|
|
1101
|
-
private static isRecord;
|
|
1102
|
-
private static createPromptMessage;
|
|
1103
|
-
}
|
|
1104
|
-
//#endregion
|
|
1105
|
-
//#region src/nodes/AgentOutputFactory.d.ts
|
|
1106
|
-
declare class AgentOutputFactory {
|
|
1107
|
-
static fromUnknown(value: unknown): NodeOutputs;
|
|
1108
|
-
static replaceJson(item: Item, value: unknown): Item;
|
|
1109
|
-
static fromAgentContent(content: string): unknown;
|
|
1110
|
-
}
|
|
1111
|
-
//#endregion
|
|
1112
|
-
//#region src/nodes/ConnectionCredentialExecutionContextFactory.d.ts
|
|
1113
|
-
/**
|
|
1114
|
-
* Builds a {@link NodeExecutionContext} whose identity for credential binding and `getCredential`
|
|
1115
|
-
* is a **connection-owned** workflow node id (`ConnectionNodeIdFactory` in `@codemation/core`),
|
|
1116
|
-
* not the executing parent node. Use for LLM slots, tool slots, or any connection-scoped owner.
|
|
1117
|
-
*/
|
|
1118
|
-
declare class ConnectionCredentialExecutionContextFactory {
|
|
1119
|
-
private readonly credentialResolverFactory;
|
|
1120
|
-
constructor(credentialSessions: CredentialSessionService);
|
|
1121
|
-
forConnectionNode<TConfig extends NodeConfigBase>(ctx: NodeExecutionContext<TConfig>, args: Readonly<{
|
|
1122
|
-
connectionNodeId: NodeId;
|
|
1123
|
-
getCredentialRequirements: () => ReadonlyArray<CredentialRequirement>;
|
|
1124
|
-
}>): NodeExecutionContext<TConfig>;
|
|
1125
|
-
}
|
|
1126
|
-
//#endregion
|
|
1127
1862
|
//#region src/nodes/aiAgentSupport.types.d.ts
|
|
1128
1863
|
declare class AgentItemPortMap {
|
|
1129
1864
|
static fromItem(item: Item): NodeInputsByPort;
|
|
@@ -1136,15 +1871,33 @@ type ResolvedTool = Readonly<{
|
|
|
1136
1871
|
execute(args: ToolExecuteArgs<ToolConfig, unknown>): Promise<unknown>;
|
|
1137
1872
|
}>;
|
|
1138
1873
|
}>;
|
|
1874
|
+
/**
|
|
1875
|
+
* Per-item binding of a tool: the user config plus the resolved runtime and a snapshot of the
|
|
1876
|
+
* original Zod `inputSchema`.
|
|
1877
|
+
*
|
|
1878
|
+
* `execute` accepts optional `hooks` so the agent coordinator can pass the live `agent.tool.call`
|
|
1879
|
+
* span and the planned tool-call's `invocationId`. Node-backed sub-agent tools use these hooks
|
|
1880
|
+
* via {@link ChildExecutionScopeFactory} to re-root their runtime ctx under the tool-call boundary
|
|
1881
|
+
* (fresh activationId, telemetry parented at the tool-call span, `parentInvocationId` set).
|
|
1882
|
+
*/
|
|
1139
1883
|
type ItemScopedToolBinding = Readonly<{
|
|
1140
1884
|
config: ToolConfig;
|
|
1141
|
-
|
|
1885
|
+
inputSchema: ZodSchemaAny;
|
|
1886
|
+
execute(input: unknown, hooks?: ItemScopedToolCallHooks): Promise<unknown>;
|
|
1887
|
+
}>;
|
|
1888
|
+
type ItemScopedToolCallHooks = Readonly<{
|
|
1889
|
+
/** Live agent.tool.call span (used to parent sub-agent telemetry). */
|
|
1890
|
+
parentSpan?: TelemetrySpanScope;
|
|
1891
|
+
/** invocationId of the parent tool call (used to thread `parentInvocationId` through ctx). */
|
|
1892
|
+
parentInvocationId?: ConnectionInvocationId;
|
|
1142
1893
|
}>;
|
|
1143
1894
|
type PlannedToolCall = Readonly<{
|
|
1144
1895
|
binding: ItemScopedToolBinding;
|
|
1145
1896
|
toolCall: AgentToolCall;
|
|
1146
1897
|
invocationIndex: number;
|
|
1147
1898
|
nodeId: string;
|
|
1899
|
+
/** Stable id reused across queued / running / completed connection invocation rows for this tool call. */
|
|
1900
|
+
invocationId: string;
|
|
1148
1901
|
}>;
|
|
1149
1902
|
type ExecutedToolCall = Readonly<{
|
|
1150
1903
|
toolName: string;
|
|
@@ -1153,30 +1906,33 @@ type ExecutedToolCall = Readonly<{
|
|
|
1153
1906
|
serialized: string;
|
|
1154
1907
|
}>;
|
|
1155
1908
|
//#endregion
|
|
1156
|
-
//#region src/nodes/
|
|
1909
|
+
//#region src/nodes/AgentMessageFactory.d.ts
|
|
1157
1910
|
/**
|
|
1158
|
-
*
|
|
1159
|
-
*
|
|
1911
|
+
* AI-SDK-shaped message construction for the AIAgent stack. Emits plain `ModelMessage[]`
|
|
1912
|
+
* ( `{ role: 'system' | 'user' | 'assistant' | 'tool', content: ... }` ) as consumed by
|
|
1913
|
+
* `generateText({ messages })` from the `ai` package.
|
|
1160
1914
|
*/
|
|
1161
|
-
declare class
|
|
1162
|
-
|
|
1163
|
-
createDynamicStructuredTool(entry: ResolvedTool, toolCredentialContext: NodeExecutionContext<any>, item: Item, itemIndex: number, items: Items): DynamicStructuredTool;
|
|
1915
|
+
declare class AgentMessageFactory {
|
|
1916
|
+
static createPromptMessages(messages: ReadonlyArray<AgentMessageDto>): ReadonlyArray<ModelMessage>;
|
|
1164
1917
|
/**
|
|
1165
|
-
*
|
|
1166
|
-
*
|
|
1167
|
-
* expects (`required` must be an array; draft 2020-12 output can break validation).
|
|
1168
|
-
* - Otherwise LangChain `toJsonSchema` (Standard Schema + JSON passthrough); if the result is still Zod
|
|
1169
|
-
* (duplicate `zod` copies), fall back to Zod `toJSONSchema` with draft-07.
|
|
1170
|
-
* - Strip root `$schema` for OpenAI; normalize invalid `required` keywords for cfworker; ensure `properties`.
|
|
1918
|
+
* Builds the assistant message that contains optional text plus one or more tool-call parts,
|
|
1919
|
+
* matching the shape AI SDK emits between steps.
|
|
1171
1920
|
*/
|
|
1172
|
-
|
|
1173
|
-
schemaName: string;
|
|
1174
|
-
requireObjectRoot: boolean;
|
|
1175
|
-
}>): Record<string, unknown>;
|
|
1921
|
+
static createAssistantWithToolCalls(text: string | undefined, toolCalls: ReadonlyArray<AgentToolCall>): AssistantModelMessage;
|
|
1176
1922
|
/**
|
|
1177
|
-
*
|
|
1923
|
+
* Builds the `{ role: "tool", content: [{ type: "tool-result", ... }, ...] }` message returned
|
|
1924
|
+
* to the model after each tool round.
|
|
1178
1925
|
*/
|
|
1179
|
-
|
|
1926
|
+
static createToolResultsMessage(executedToolCalls: ReadonlyArray<ExecutedToolCall>): ToolModelMessage;
|
|
1927
|
+
private static toToolResultJson;
|
|
1928
|
+
private static createPromptMessage;
|
|
1929
|
+
}
|
|
1930
|
+
//#endregion
|
|
1931
|
+
//#region src/nodes/AgentOutputFactory.d.ts
|
|
1932
|
+
declare class AgentOutputFactory {
|
|
1933
|
+
static fromUnknown(value: unknown): NodeOutputs;
|
|
1934
|
+
static replaceJson(item: Item, value: unknown): Item;
|
|
1935
|
+
static fromAgentContent(content: string): unknown;
|
|
1180
1936
|
}
|
|
1181
1937
|
//#endregion
|
|
1182
1938
|
//#region src/nodes/AgentStructuredOutputRepairPromptFactory.d.ts
|
|
@@ -1195,26 +1951,46 @@ declare class AgentStructuredOutputRepairPromptFactory {
|
|
|
1195
1951
|
}
|
|
1196
1952
|
//#endregion
|
|
1197
1953
|
//#region src/nodes/AgentStructuredOutputRunner.d.ts
|
|
1954
|
+
type StructuredOutputSchemaForModel = ZodSchemaAny | Readonly<Record<string, unknown>>;
|
|
1955
|
+
/**
|
|
1956
|
+
* Orchestrates a 2-attempt repair loop on top of `generateText({ output: Output.object(...) })`.
|
|
1957
|
+
*
|
|
1958
|
+
* Strategy:
|
|
1959
|
+
* 1. If the caller already has a raw final text (from a prior tool-calling turn), try parsing it
|
|
1960
|
+
* directly against the schema — fast path for models that already emit strict JSON.
|
|
1961
|
+
* 2. Otherwise, run a native structured-output call via {@link invokeStructuredModel}. For the
|
|
1962
|
+
* OpenAI-strict path, a {@link OpenAiStrictJsonSchemaFactory}-built JSON Schema record is
|
|
1963
|
+
* handed to AI SDK's `jsonSchema(...)` wrapper (preserves `additionalProperties: false` at
|
|
1964
|
+
* every object depth).
|
|
1965
|
+
* 3. If the structured call fails (AI_NoObjectGeneratedError / ZodError / schema reject), run a
|
|
1966
|
+
* text-mode repair prompt with the validation error appended, up to 2 attempts.
|
|
1967
|
+
*/
|
|
1198
1968
|
declare class AgentStructuredOutputRunner {
|
|
1199
1969
|
private readonly repairPromptFactory;
|
|
1200
|
-
private readonly
|
|
1970
|
+
private readonly openAiStrictJsonSchemaFactory;
|
|
1201
1971
|
private static readonly repairAttemptCount;
|
|
1202
|
-
|
|
1972
|
+
private static readonly structuredOutputSchemaName;
|
|
1973
|
+
constructor(repairPromptFactory: AgentStructuredOutputRepairPromptFactory, openAiStrictJsonSchemaFactory: OpenAiStrictJsonSchemaFactory);
|
|
1203
1974
|
resolve<TOutput>(args: Readonly<{
|
|
1204
|
-
model:
|
|
1975
|
+
model: ChatLanguageModel;
|
|
1205
1976
|
chatModelConfig: ChatModelConfig;
|
|
1206
1977
|
schema: ZodSchemaAny;
|
|
1207
|
-
conversation: ReadonlyArray<
|
|
1208
|
-
|
|
1978
|
+
conversation: ReadonlyArray<ModelMessage>;
|
|
1979
|
+
rawFinalText?: string;
|
|
1209
1980
|
agentName: string;
|
|
1210
1981
|
nodeId: string;
|
|
1211
|
-
invokeTextModel: (messages: ReadonlyArray<
|
|
1212
|
-
|
|
1982
|
+
invokeTextModel: (messages: ReadonlyArray<ModelMessage>) => Promise<{
|
|
1983
|
+
text: string;
|
|
1984
|
+
}>;
|
|
1985
|
+
invokeStructuredModel: (schema: StructuredOutputSchemaForModel, messages: ReadonlyArray<ModelMessage>, options: StructuredOutputOptions | undefined) => Promise<unknown>;
|
|
1213
1986
|
}>): Promise<TOutput>;
|
|
1214
1987
|
private retryWithRepairPrompt;
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1988
|
+
/**
|
|
1989
|
+
* Chooses strict mode for OpenAI chat-model configs, off otherwise. Extendable in future for
|
|
1990
|
+
* other providers that adopt the same "supply a JSON Schema record directly" contract.
|
|
1991
|
+
*/
|
|
1992
|
+
private resolveStructuredOutputOptions;
|
|
1993
|
+
private resolveOutputSchemaForModel;
|
|
1218
1994
|
private tryParseAndValidate;
|
|
1219
1995
|
private tryValidateStructuredValue;
|
|
1220
1996
|
private summarizeError;
|
|
@@ -1321,7 +2097,6 @@ declare class AgentToolExecutionCoordinator {
|
|
|
1321
2097
|
private createRepairPayload;
|
|
1322
2098
|
private createRepairDetails;
|
|
1323
2099
|
private createValidationMessage;
|
|
1324
|
-
private parseToolOutput;
|
|
1325
2100
|
private toJsonValue;
|
|
1326
2101
|
private extractErrorDetails;
|
|
1327
2102
|
private serializeIssue;
|
|
@@ -1347,8 +2122,24 @@ declare class NodeBackedToolRuntime {
|
|
|
1347
2122
|
private readonly itemExprResolver;
|
|
1348
2123
|
private readonly outputNormalizer;
|
|
1349
2124
|
private readonly outputBehaviorResolver;
|
|
1350
|
-
|
|
2125
|
+
private readonly childExecutionScopeFactory;
|
|
2126
|
+
constructor(nodeResolver: NodeResolver, itemExprResolver: ItemExprResolver, outputNormalizer: NodeOutputNormalizer, outputBehaviorResolver: RunnableOutputBehaviorResolver, childExecutionScopeFactory: ChildExecutionScopeFactory);
|
|
1351
2127
|
execute(config: NodeBackedToolConfig<any, ZodSchemaAny, ZodSchemaAny>, args: ToolExecuteArgs): Promise<unknown>;
|
|
2128
|
+
/**
|
|
2129
|
+
* Returns a re-rooted child ctx for nested-agent tools (so their LLM/tool connection ids derive
|
|
2130
|
+
* from the tool connection node, telemetry parents under the tool-call span, and connection
|
|
2131
|
+
* invocations carry `parentInvocationId`). Plain runnable tools (non-agent) keep the orchestrator
|
|
2132
|
+
* ctx with only `config` swapped — no nesting concern.
|
|
2133
|
+
*
|
|
2134
|
+
* The caller (`AIAgentNode.createItemScopedTools`) already wraps the orchestrator ctx via
|
|
2135
|
+
* `ConnectionCredentialExecutionContextFactory.forConnectionNode`, so `args.ctx.nodeId` is the
|
|
2136
|
+
* tool's own connection node id (e.g. `AIAgentNode:2__conn__tool__searchInMail`). We pass that
|
|
2137
|
+
* through as the sub-agent's `nodeId`; deriving another `toolConnectionNodeId(args.ctx.nodeId,
|
|
2138
|
+
* config.name)` here would prepend a duplicate `__conn__tool__<name>` segment and exponentially
|
|
2139
|
+
* deepen ids on each invocation, which also breaks credential resolution because user-provided
|
|
2140
|
+
* bindings sit on the single-level connection node id.
|
|
2141
|
+
*/
|
|
2142
|
+
private resolveNodeCtx;
|
|
1352
2143
|
private executeResolvedNode;
|
|
1353
2144
|
private isRunnableNode;
|
|
1354
2145
|
private isMultiInputNode;
|
|
@@ -1363,28 +2154,21 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
1363
2154
|
private readonly toolExecutionCoordinator;
|
|
1364
2155
|
kind: "node";
|
|
1365
2156
|
outputPorts: readonly ["main"];
|
|
1366
|
-
/**
|
|
1367
|
-
* Engine validates {@link RunnableNodeConfig.inputSchema} (Zod) on {@code item.json} before enqueue, then resolves
|
|
1368
|
-
* per-item **`itemExpr`** leaves on config before {@link #execute}. Prefer modeling prompts as
|
|
1369
|
-
* {@code { messages: [{ role, content }, ...] }} (on input or config) so persisted inputs are visible in the UI.
|
|
1370
|
-
*/
|
|
1371
2157
|
readonly inputSchema: z.ZodUnknown;
|
|
1372
2158
|
private readonly connectionCredentialExecutionContextFactory;
|
|
1373
|
-
/** One resolved model/tools bundle per activation context (same ctx across items in a batch). */
|
|
1374
2159
|
private readonly preparedByExecutionContext;
|
|
1375
2160
|
constructor(nodeResolver: NodeResolver, credentialSessions: CredentialSessionService, nodeBackedToolRuntime: NodeBackedToolRuntime, executionHelpers: AIAgentExecutionHelpersFactory, structuredOutputRunner: AgentStructuredOutputRunner, toolExecutionCoordinator: AgentToolExecutionCoordinator);
|
|
1376
2161
|
execute(args: RunnableNodeExecuteArgs<AIAgent<any, any>>): Promise<unknown>;
|
|
1377
2162
|
private getOrPrepareExecution;
|
|
1378
|
-
/**
|
|
1379
|
-
* Resolves the chat model and tools once per activation, then reuses for every item in the batch.
|
|
1380
|
-
*/
|
|
1381
2163
|
private prepareExecution;
|
|
1382
|
-
/**
|
|
1383
|
-
* One item: build prompts, optionally bind tools, run the multi-turn loop, map the final model message to workflow JSON.
|
|
1384
|
-
*/
|
|
1385
2164
|
private runAgentForItem;
|
|
1386
2165
|
/**
|
|
1387
|
-
*
|
|
2166
|
+
* Multi-turn loop:
|
|
2167
|
+
* - Each turn is a single `generateText` call with tools exposed but **not auto-executed**
|
|
2168
|
+
* (we control tool dispatch so that {@link AgentToolExecutionCoordinator} drives repair /
|
|
2169
|
+
* connection-invocation recording / transient-error handling exactly like before).
|
|
2170
|
+
* - When the model returns no tool calls the loop ends with the model's text as the final answer.
|
|
2171
|
+
* - Respects `guardrails.maxTurns` and `guardrails.onTurnLimitReached`.
|
|
1388
2172
|
*/
|
|
1389
2173
|
private runTurnLoopUntilFinalAnswer;
|
|
1390
2174
|
private cannotExecuteAnotherToolRound;
|
|
@@ -1392,20 +2176,52 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
1392
2176
|
private appendAssistantAndToolMessages;
|
|
1393
2177
|
private resolveFinalOutputJson;
|
|
1394
2178
|
private buildOutputItem;
|
|
1395
|
-
private bindToolsToModel;
|
|
1396
2179
|
private resolveTools;
|
|
1397
2180
|
private createItemScopedTools;
|
|
1398
|
-
|
|
1399
|
-
|
|
2181
|
+
/**
|
|
2182
|
+
* Builds an AI SDK {@link ToolSet} where every tool ships a pre-converted JSON Schema (via
|
|
2183
|
+
* {@link jsonSchema}) — not the raw Zod schema — and carries **no** `execute`. Two reasons:
|
|
2184
|
+
*
|
|
2185
|
+
* 1. Codemation owns tool dispatch + the per-tool repair loop (see {@link AgentToolExecutionCoordinator}),
|
|
2186
|
+
* so the AI SDK must surface tool calls back to us instead of auto-running them.
|
|
2187
|
+
* 2. The AI SDK's `asSchema` helper discriminates between Zod v3 / Zod v4 / Standard Schema via
|
|
2188
|
+
* runtime feature-detection (`~standard`, `_zod`, etc.). Handing it a pre-built
|
|
2189
|
+
* {@link jsonSchema} record — which is tagged with `Symbol.for('vercel.ai.schema')` — skips all
|
|
2190
|
+
* of that detection and guarantees the provider receives a draft-07 JSON Schema with
|
|
2191
|
+
* `additionalProperties: false` at every object depth (see {@link OpenAiStrictJsonSchemaFactory}
|
|
2192
|
+
* for the same logic applied to structured-output schemas). Codemation still runs its own Zod
|
|
2193
|
+
* validation on tool inputs before execute — the schema handed to the model is advisory.
|
|
2194
|
+
*/
|
|
2195
|
+
private buildToolSet;
|
|
2196
|
+
/**
|
|
2197
|
+
* One `generateText` turn (no auto tool execution) with Codemation-owned child-span telemetry
|
|
2198
|
+
* and connection-invocation state recording.
|
|
2199
|
+
*/
|
|
2200
|
+
private invokeTextTurn;
|
|
2201
|
+
/**
|
|
2202
|
+
* Structured-output turn: runs `generateText({ output: Output.object({ schema }) })` via the
|
|
2203
|
+
* structured-output runner. We keep this as a separate helper because the runner needs the raw
|
|
2204
|
+
* validated value (not just text) back, and must be able to retry on Zod failures.
|
|
2205
|
+
*/
|
|
2206
|
+
private invokeStructuredTurn;
|
|
2207
|
+
private isZodSchema;
|
|
2208
|
+
private resolveCallOptions;
|
|
2209
|
+
/**
|
|
2210
|
+
* Build a no-code-friendly output payload for an LLM round.
|
|
2211
|
+
*
|
|
2212
|
+
* Always includes `content` (matching the canvas snapshot shape used elsewhere) and adds a
|
|
2213
|
+
* `toolCalls` array when the round produced tool calls so the execution inspector surfaces the
|
|
2214
|
+
* planned calls instead of just an empty `""` for tool-only rounds.
|
|
2215
|
+
*/
|
|
2216
|
+
private summarizeTurnOutput;
|
|
2217
|
+
private extractTurnResult;
|
|
2218
|
+
private extractAssistantMessage;
|
|
2219
|
+
private extractUsageFromResult;
|
|
2220
|
+
private toFiniteNumber;
|
|
1400
2221
|
private createModelInvocationSpan;
|
|
1401
2222
|
private recordModelUsageMetrics;
|
|
1402
2223
|
private captureCostTrackingUsage;
|
|
1403
2224
|
private resolveChatModelName;
|
|
1404
|
-
private extractModelUsageMetrics;
|
|
1405
|
-
private extractUsageObject;
|
|
1406
|
-
private readUsageNumber;
|
|
1407
|
-
private readNestedUsageValue;
|
|
1408
|
-
private isRecord;
|
|
1409
2225
|
private markQueuedTools;
|
|
1410
2226
|
private planToolCalls;
|
|
1411
2227
|
private failTrackedNodeInvocation;
|
|
@@ -1413,21 +2229,59 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
1413
2229
|
private resultToJsonValue;
|
|
1414
2230
|
private createPromptMessages;
|
|
1415
2231
|
private resolveToolRuntime;
|
|
1416
|
-
/**
|
|
1417
|
-
* Consumer apps can resolve two copies of `@codemation/core`, breaking `instanceof NodeBackedToolConfig` and
|
|
1418
|
-
* sending node-backed tools down the plugin-tool branch with `inputSchema: undefined` (LangChain then crashes in
|
|
1419
|
-
* json-schema validation). {@link NodeBackedToolConfig#toolKind} is stable across copies.
|
|
1420
|
-
*/
|
|
1421
2232
|
private isNodeBackedToolConfig;
|
|
1422
|
-
/**
|
|
1423
|
-
* Callable tools use {@link CallableToolConfig#toolKind} for cross-package / JSON round-trip safety.
|
|
1424
|
-
*/
|
|
1425
2233
|
private isCallableToolConfig;
|
|
1426
2234
|
private resolveGuardrails;
|
|
1427
2235
|
private getAgentDisplayName;
|
|
1428
2236
|
private extractErrorDetails;
|
|
1429
2237
|
}
|
|
1430
2238
|
//#endregion
|
|
2239
|
+
//#region src/nodes/AssertionNode.d.ts
|
|
2240
|
+
/**
|
|
2241
|
+
* Runs the author's `assertions` callback for each input item and emits one workflow `Item` per
|
|
2242
|
+
* returned {@link AssertionResult} on `main`. Persistence is handled by a host-side subscriber
|
|
2243
|
+
* to `nodeCompleted` events that filters on `config.emitsAssertions === true`; this node does
|
|
2244
|
+
* not write to any store on its own.
|
|
2245
|
+
*
|
|
2246
|
+
* If the author callback throws, we emit a single synthetic AssertionResult with `errored: true`
|
|
2247
|
+
* and `score: 0`. Without this catch the whole node would fail and no assertion row would be
|
|
2248
|
+
* persisted — making the rollup blind to "the assertion code itself is broken." The synthetic
|
|
2249
|
+
* row keeps `failedAssertionsByRunId` consistent and gives the UI something to surface.
|
|
2250
|
+
*/
|
|
2251
|
+
declare class AssertionNode implements RunnableNode<Assertion<any>> {
|
|
2252
|
+
kind: "node";
|
|
2253
|
+
outputPorts: readonly ["main"];
|
|
2254
|
+
execute(args: RunnableNodeExecuteArgs<Assertion<any>>): Promise<unknown>;
|
|
2255
|
+
}
|
|
2256
|
+
//#endregion
|
|
2257
|
+
//#region src/nodes/assertion.d.ts
|
|
2258
|
+
interface AssertionOptions<TInputJson$1> {
|
|
2259
|
+
readonly name?: string;
|
|
2260
|
+
readonly id?: string;
|
|
2261
|
+
readonly icon?: string;
|
|
2262
|
+
/**
|
|
2263
|
+
* Author callback. Returns one or more {@link AssertionResult}s per input item. Each becomes
|
|
2264
|
+
* one emitted output item — useful for per-row reporting in the Tests tab. Return `[]` to
|
|
2265
|
+
* emit nothing for this case (rare; usually you want at least a "no-op" pass).
|
|
2266
|
+
*/
|
|
2267
|
+
assertions(item: Item<TInputJson$1>, ctx: NodeExecutionContext<Assertion<TInputJson$1>>): Promise<ReadonlyArray<AssertionResult>> | ReadonlyArray<AssertionResult>;
|
|
2268
|
+
}
|
|
2269
|
+
/**
|
|
2270
|
+
* Generic assertion node — the "callback" form. For declarative shorthands (StringEquals,
|
|
2271
|
+
* JudgeByAgent) compose this with helpers added in later phases. Sets `emitsAssertions: true`
|
|
2272
|
+
* so host-side persisters know to record its outputs as `TestAssertion` rows.
|
|
2273
|
+
*/
|
|
2274
|
+
declare class Assertion<TInputJson$1 = unknown> implements RunnableNodeConfig<TInputJson$1, AssertionResult> {
|
|
2275
|
+
readonly kind: "node";
|
|
2276
|
+
readonly type: TypeToken<unknown>;
|
|
2277
|
+
readonly icon: string;
|
|
2278
|
+
readonly name: string;
|
|
2279
|
+
readonly id?: string;
|
|
2280
|
+
readonly emitsAssertions: true;
|
|
2281
|
+
readonly assertions: AssertionOptions<TInputJson$1>["assertions"];
|
|
2282
|
+
constructor(options: AssertionOptions<TInputJson$1>);
|
|
2283
|
+
}
|
|
2284
|
+
//#endregion
|
|
1431
2285
|
//#region src/nodes/CallbackNode.d.ts
|
|
1432
2286
|
declare class CallbackNode implements RunnableNode<Callback<any, any>> {
|
|
1433
2287
|
kind: "node";
|
|
@@ -1472,10 +2326,13 @@ declare class HttpRequestNode implements RunnableNode<HttpRequest<any, any>> {
|
|
|
1472
2326
|
readonly outputPorts: readonly ["main"];
|
|
1473
2327
|
execute(args: RunnableNodeExecuteArgs<HttpRequest<any, any>>): Promise<unknown>;
|
|
1474
2328
|
private executeItem;
|
|
2329
|
+
private handleBinaryResponse;
|
|
2330
|
+
private resolveCredential;
|
|
1475
2331
|
private resolveUrl;
|
|
1476
2332
|
private asRecord;
|
|
1477
2333
|
private readHeaders;
|
|
1478
2334
|
private resolveMimeType;
|
|
2335
|
+
private isJsonMimeType;
|
|
1479
2336
|
private shouldAttachBody;
|
|
1480
2337
|
private resolveFilename;
|
|
1481
2338
|
private readFilenameFromContentDisposition;
|
|
@@ -1492,17 +2349,72 @@ type HttpRequestOutputJson = Readonly<{
|
|
|
1492
2349
|
statusText: string;
|
|
1493
2350
|
mimeType: string;
|
|
1494
2351
|
headers: Readonly<Record<string, string>>;
|
|
2352
|
+
json?: unknown;
|
|
2353
|
+
text?: string;
|
|
1495
2354
|
bodyBinaryName?: string;
|
|
2355
|
+
/** Set when `responseFormat === "binary"`. Name of the binary slot the response was stored in. */
|
|
2356
|
+
binarySlot?: string;
|
|
2357
|
+
/** Set when `responseFormat === "binary"`. MIME type of the stored response. */
|
|
2358
|
+
contentType?: string;
|
|
2359
|
+
/** Set when `responseFormat === "binary"`. Size in bytes of the stored response. */
|
|
2360
|
+
size?: number;
|
|
2361
|
+
/** Set when `responseFormat === "binary"`. Filename inferred from URL or Content-Disposition. */
|
|
2362
|
+
filename?: string;
|
|
1496
2363
|
}>;
|
|
2364
|
+
/**
|
|
2365
|
+
* The built-in HTTP request credential type IDs accepted by the `HttpRequest` node.
|
|
2366
|
+
* These match the four generic credential types shipped with `@codemation/core-nodes`.
|
|
2367
|
+
*/
|
|
2368
|
+
declare const HTTP_REQUEST_ACCEPTED_CREDENTIAL_TYPES: ReadonlyArray<string>;
|
|
1497
2369
|
declare class HttpRequest<TInputJson$1 = Readonly<{
|
|
1498
2370
|
url?: string;
|
|
1499
2371
|
}>, TOutputJson$1 = HttpRequestOutputJson> implements RunnableNodeConfig<TInputJson$1, TOutputJson$1> {
|
|
1500
2372
|
readonly name: string;
|
|
1501
2373
|
readonly args: Readonly<{
|
|
2374
|
+
/** HTTP method (default: GET). */
|
|
1502
2375
|
method?: string;
|
|
2376
|
+
/**
|
|
2377
|
+
* Legacy: field name on item.json to read the URL from.
|
|
2378
|
+
* Use `url` for a literal/templated URL instead.
|
|
2379
|
+
*/
|
|
1503
2380
|
urlField?: string;
|
|
2381
|
+
/** Literal or templated URL. When present, takes precedence over `urlField`. */
|
|
2382
|
+
url?: string;
|
|
2383
|
+
/** Extra headers to add to every request. */
|
|
2384
|
+
headers?: Readonly<Record<string, string>>;
|
|
2385
|
+
/** Query parameters to append to the URL. */
|
|
2386
|
+
query?: Readonly<Record<string, string>>;
|
|
2387
|
+
/** Request body specification. For canvas use, pass a JSON string in `body.data`. */
|
|
2388
|
+
body?: HttpBodySpec;
|
|
2389
|
+
/**
|
|
2390
|
+
* Credential slot key. When set, the node resolves a credential via
|
|
2391
|
+
* `ctx.getCredential(credentialSlot)` and applies it to the request.
|
|
2392
|
+
* The slot must be declared in `getCredentialRequirements()`.
|
|
2393
|
+
*/
|
|
2394
|
+
credentialSlot?: string;
|
|
1504
2395
|
binaryName?: string;
|
|
1505
2396
|
downloadMode?: HttpRequestDownloadMode;
|
|
2397
|
+
/**
|
|
2398
|
+
* Controls how the response body is handled.
|
|
2399
|
+
* - `"json"` / `"text"`: existing behaviour (parse + emit on `item.json`).
|
|
2400
|
+
* - `"binary"`: read the response as raw bytes and store via `ctx.binary.attach`.
|
|
2401
|
+
* The output JSON contains `{ status, headers, binarySlot, contentType, size, filename }`
|
|
2402
|
+
* but NOT the raw bytes. Use `responseBinarySlot` to name the slot (default `"response"`).
|
|
2403
|
+
*
|
|
2404
|
+
* When omitted, the existing `downloadMode` logic applies (backward-compatible).
|
|
2405
|
+
*/
|
|
2406
|
+
responseFormat?: "json" | "text" | "binary";
|
|
2407
|
+
/**
|
|
2408
|
+
* Name of the binary slot to write the response body into when `responseFormat === "binary"`.
|
|
2409
|
+
* Defaults to `"response"`.
|
|
2410
|
+
*/
|
|
2411
|
+
responseBinarySlot?: string;
|
|
2412
|
+
/**
|
|
2413
|
+
* Maximum response size in bytes for binary mode. Checked against the `Content-Length`
|
|
2414
|
+
* response header before allocating memory. Defaults to 100 MiB (104857600).
|
|
2415
|
+
* Requests whose `Content-Length` exceeds this cap are rejected before the body is read.
|
|
2416
|
+
*/
|
|
2417
|
+
responseSizeCapBytes?: number;
|
|
1506
2418
|
id?: string;
|
|
1507
2419
|
}>;
|
|
1508
2420
|
readonly retryPolicy: RetryPolicySpec;
|
|
@@ -1511,11 +2423,52 @@ declare class HttpRequest<TInputJson$1 = Readonly<{
|
|
|
1511
2423
|
readonly execution: {
|
|
1512
2424
|
readonly hint: "local";
|
|
1513
2425
|
};
|
|
2426
|
+
readonly icon: "lucide:globe";
|
|
1514
2427
|
constructor(name: string, args?: Readonly<{
|
|
2428
|
+
/** HTTP method (default: GET). */
|
|
1515
2429
|
method?: string;
|
|
2430
|
+
/**
|
|
2431
|
+
* Legacy: field name on item.json to read the URL from.
|
|
2432
|
+
* Use `url` for a literal/templated URL instead.
|
|
2433
|
+
*/
|
|
1516
2434
|
urlField?: string;
|
|
2435
|
+
/** Literal or templated URL. When present, takes precedence over `urlField`. */
|
|
2436
|
+
url?: string;
|
|
2437
|
+
/** Extra headers to add to every request. */
|
|
2438
|
+
headers?: Readonly<Record<string, string>>;
|
|
2439
|
+
/** Query parameters to append to the URL. */
|
|
2440
|
+
query?: Readonly<Record<string, string>>;
|
|
2441
|
+
/** Request body specification. For canvas use, pass a JSON string in `body.data`. */
|
|
2442
|
+
body?: HttpBodySpec;
|
|
2443
|
+
/**
|
|
2444
|
+
* Credential slot key. When set, the node resolves a credential via
|
|
2445
|
+
* `ctx.getCredential(credentialSlot)` and applies it to the request.
|
|
2446
|
+
* The slot must be declared in `getCredentialRequirements()`.
|
|
2447
|
+
*/
|
|
2448
|
+
credentialSlot?: string;
|
|
1517
2449
|
binaryName?: string;
|
|
1518
2450
|
downloadMode?: HttpRequestDownloadMode;
|
|
2451
|
+
/**
|
|
2452
|
+
* Controls how the response body is handled.
|
|
2453
|
+
* - `"json"` / `"text"`: existing behaviour (parse + emit on `item.json`).
|
|
2454
|
+
* - `"binary"`: read the response as raw bytes and store via `ctx.binary.attach`.
|
|
2455
|
+
* The output JSON contains `{ status, headers, binarySlot, contentType, size, filename }`
|
|
2456
|
+
* but NOT the raw bytes. Use `responseBinarySlot` to name the slot (default `"response"`).
|
|
2457
|
+
*
|
|
2458
|
+
* When omitted, the existing `downloadMode` logic applies (backward-compatible).
|
|
2459
|
+
*/
|
|
2460
|
+
responseFormat?: "json" | "text" | "binary";
|
|
2461
|
+
/**
|
|
2462
|
+
* Name of the binary slot to write the response body into when `responseFormat === "binary"`.
|
|
2463
|
+
* Defaults to `"response"`.
|
|
2464
|
+
*/
|
|
2465
|
+
responseBinarySlot?: string;
|
|
2466
|
+
/**
|
|
2467
|
+
* Maximum response size in bytes for binary mode. Checked against the `Content-Length`
|
|
2468
|
+
* response header before allocating memory. Defaults to 100 MiB (104857600).
|
|
2469
|
+
* Requests whose `Content-Length` exceeds this cap are rejected before the body is read.
|
|
2470
|
+
*/
|
|
2471
|
+
responseSizeCapBytes?: number;
|
|
1519
2472
|
id?: string;
|
|
1520
2473
|
}>, retryPolicy?: RetryPolicySpec);
|
|
1521
2474
|
get id(): string | undefined;
|
|
@@ -1523,6 +2476,10 @@ declare class HttpRequest<TInputJson$1 = Readonly<{
|
|
|
1523
2476
|
get urlField(): string;
|
|
1524
2477
|
get binaryName(): string;
|
|
1525
2478
|
get downloadMode(): HttpRequestDownloadMode;
|
|
2479
|
+
get responseFormat(): "json" | "text" | "binary" | undefined;
|
|
2480
|
+
get responseBinarySlot(): string;
|
|
2481
|
+
get responseSizeCapBytes(): number;
|
|
2482
|
+
getCredentialRequirements(): ReadonlyArray<CredentialRequirement>;
|
|
1526
2483
|
}
|
|
1527
2484
|
//#endregion
|
|
1528
2485
|
//#region src/nodes/AggregateNode.d.ts
|
|
@@ -1543,7 +2500,7 @@ declare class Aggregate<TIn = unknown, TOut = unknown> implements RunnableNodeCo
|
|
|
1543
2500
|
readonly hint: "local";
|
|
1544
2501
|
};
|
|
1545
2502
|
readonly keepBinaries: true;
|
|
1546
|
-
readonly icon: "
|
|
2503
|
+
readonly icon: "builtin:aggregate-rows";
|
|
1547
2504
|
constructor(name: string, aggregate: (items: Items<TIn>, ctx: NodeExecutionContext<Aggregate<TIn, TOut>>) => TOut | Promise<TOut>, id?: string | undefined);
|
|
1548
2505
|
}
|
|
1549
2506
|
//#endregion
|
|
@@ -1584,11 +2541,43 @@ declare class If<TInputJson$1 = unknown> implements RunnableNodeConfig<TInputJso
|
|
|
1584
2541
|
readonly execution: {
|
|
1585
2542
|
readonly hint: "local";
|
|
1586
2543
|
};
|
|
1587
|
-
readonly icon: "lucide:split";
|
|
2544
|
+
readonly icon: "lucide:split@rot=90";
|
|
1588
2545
|
readonly declaredOutputPorts: readonly ["true", "false"];
|
|
1589
2546
|
constructor(name: string, predicate: (item: Item<TInputJson$1>, index: number, items: Items<TInputJson$1>, ctx: NodeExecutionContext<If<TInputJson$1>>) => boolean, id?: string | undefined);
|
|
1590
2547
|
}
|
|
1591
2548
|
//#endregion
|
|
2549
|
+
//#region src/nodes/IsTestRunNode.d.ts
|
|
2550
|
+
/**
|
|
2551
|
+
* Routes each item to the `true` port if `ctx.testContext` is set (the run was started by the
|
|
2552
|
+
* TestSuiteOrchestrator), else to `false`. Lets workflow authors guard real side-effects:
|
|
2553
|
+
*
|
|
2554
|
+
* GmailTrigger / TestTrigger → ClassifyAgent → IsTestRun
|
|
2555
|
+
* ├── true → AssertionNode
|
|
2556
|
+
* └── false → SendReply
|
|
2557
|
+
*/
|
|
2558
|
+
declare class IsTestRunNode implements RunnableNode<IsTestRun<unknown>> {
|
|
2559
|
+
kind: "node";
|
|
2560
|
+
execute(args: RunnableNodeExecuteArgs<IsTestRun<unknown>>): unknown;
|
|
2561
|
+
}
|
|
2562
|
+
//#endregion
|
|
2563
|
+
//#region src/nodes/isTestRun.d.ts
|
|
2564
|
+
/**
|
|
2565
|
+
* Branches per-item on whether the current run is a test run. Output ports: `true`, `false`.
|
|
2566
|
+
* The wire payload is unchanged — this is a router, not a transform.
|
|
2567
|
+
*/
|
|
2568
|
+
declare class IsTestRun<TInputJson$1 = unknown> implements RunnableNodeConfig<TInputJson$1, TInputJson$1> {
|
|
2569
|
+
readonly kind: "node";
|
|
2570
|
+
readonly type: TypeToken<unknown>;
|
|
2571
|
+
readonly execution: {
|
|
2572
|
+
readonly hint: "local";
|
|
2573
|
+
};
|
|
2574
|
+
readonly icon: "lucide:flask-conical";
|
|
2575
|
+
readonly declaredOutputPorts: readonly ["true", "false"];
|
|
2576
|
+
readonly name: string;
|
|
2577
|
+
readonly id?: string;
|
|
2578
|
+
constructor(name?: string, id?: string);
|
|
2579
|
+
}
|
|
2580
|
+
//#endregion
|
|
1592
2581
|
//#region src/nodes/SwitchNode.d.ts
|
|
1593
2582
|
/**
|
|
1594
2583
|
* Routes each item to exactly one output port. Port names must match workflow edges (see {@link Switch} config).
|
|
@@ -1645,10 +2634,49 @@ declare class Split<TIn = unknown, TElem = unknown> implements RunnableNodeConfi
|
|
|
1645
2634
|
* Mirrors {@link MapData}'s empty-output behavior.
|
|
1646
2635
|
*/
|
|
1647
2636
|
readonly continueWhenEmptyOutput: true;
|
|
1648
|
-
readonly icon: "
|
|
2637
|
+
readonly icon: "builtin:split-rows";
|
|
1649
2638
|
constructor(name: string, getElements: (item: Item<TIn>, ctx: NodeExecutionContext<Split<TIn, TElem>>) => readonly TElem[], id?: string | undefined);
|
|
1650
2639
|
}
|
|
1651
2640
|
//#endregion
|
|
2641
|
+
//#region src/nodes/CronTriggerFactory.d.ts
|
|
2642
|
+
type CronTickJson = {
|
|
2643
|
+
firedAt: string;
|
|
2644
|
+
scheduledFor: string;
|
|
2645
|
+
};
|
|
2646
|
+
/**
|
|
2647
|
+
* Schedules a workflow on a standard cron expression.
|
|
2648
|
+
*
|
|
2649
|
+
* Each tick emits one item: `{ firedAt: string, scheduledFor: string }` — both ISO-8601 timestamps.
|
|
2650
|
+
* `firedAt` is the wall-clock moment the callback ran; `scheduledFor` is the cron-computed
|
|
2651
|
+
* firing instant (these differ when the job was delayed).
|
|
2652
|
+
*
|
|
2653
|
+
* Timezone defaults to UTC when omitted — cron without an explicit TZ is a DST footgun.
|
|
2654
|
+
*/
|
|
2655
|
+
declare class CronTrigger implements TriggerNodeConfig<CronTickJson> {
|
|
2656
|
+
readonly name: string;
|
|
2657
|
+
private readonly args;
|
|
2658
|
+
readonly kind: "trigger";
|
|
2659
|
+
readonly type: TypeToken<unknown>;
|
|
2660
|
+
readonly icon: "lucide:clock";
|
|
2661
|
+
readonly id?: string;
|
|
2662
|
+
constructor(name: string, args: Readonly<{
|
|
2663
|
+
schedule: string;
|
|
2664
|
+
timezone?: string;
|
|
2665
|
+
}>, id?: string);
|
|
2666
|
+
get schedule(): string;
|
|
2667
|
+
get timezone(): string | undefined;
|
|
2668
|
+
createJob(callback: CronCallback): Cron;
|
|
2669
|
+
}
|
|
2670
|
+
//#endregion
|
|
2671
|
+
//#region src/nodes/CronTriggerNode.d.ts
|
|
2672
|
+
declare class CronTriggerNode implements TestableTriggerNode<CronTrigger> {
|
|
2673
|
+
readonly kind: "trigger";
|
|
2674
|
+
readonly outputPorts: readonly ["main"];
|
|
2675
|
+
setup(ctx: TriggerSetupContext<CronTrigger>): Promise<undefined>;
|
|
2676
|
+
execute(items: Items, _ctx: NodeExecutionContext<CronTrigger>): Promise<NodeOutputs>;
|
|
2677
|
+
getTestItems(ctx: TriggerTestItemsContext<CronTrigger>): Promise<Items>;
|
|
2678
|
+
}
|
|
2679
|
+
//#endregion
|
|
1652
2680
|
//#region src/nodes/ManualTriggerNode.d.ts
|
|
1653
2681
|
/**
|
|
1654
2682
|
* Setup is intentionally a no-op: the engine host can run workflows manually
|
|
@@ -1705,6 +2733,7 @@ declare class MapData<TInputJson$1 = unknown, TOutputJson$1 = unknown> implement
|
|
|
1705
2733
|
};
|
|
1706
2734
|
/** Zero mapped items should still allow downstream nodes to run. */
|
|
1707
2735
|
readonly continueWhenEmptyOutput: true;
|
|
2736
|
+
readonly icon: "lucide:square-pen";
|
|
1708
2737
|
readonly keepBinaries: boolean;
|
|
1709
2738
|
constructor(name: string, map: (item: Item<TInputJson$1>, ctx: NodeExecutionContext<MapData<TInputJson$1, TOutputJson$1>>) => TOutputJson$1, options?: MapDataOptions);
|
|
1710
2739
|
get id(): string | undefined;
|
|
@@ -1732,7 +2761,7 @@ declare class Merge<TInputJson$1 = unknown, TOutputJson$1 = TInputJson$1> implem
|
|
|
1732
2761
|
readonly id?: string | undefined;
|
|
1733
2762
|
readonly kind: "node";
|
|
1734
2763
|
readonly type: TypeToken<unknown>;
|
|
1735
|
-
readonly icon: "lucide:
|
|
2764
|
+
readonly icon: "lucide:merge@rot=90";
|
|
1736
2765
|
constructor(name: string, cfg?: Readonly<{
|
|
1737
2766
|
mode: MergeMode;
|
|
1738
2767
|
/**
|
|
@@ -1759,6 +2788,7 @@ declare class NoOp<TItemJson = unknown> implements RunnableNodeConfig<TItemJson,
|
|
|
1759
2788
|
readonly execution: {
|
|
1760
2789
|
readonly hint: "local";
|
|
1761
2790
|
};
|
|
2791
|
+
readonly icon: "lucide:circle-dashed";
|
|
1762
2792
|
constructor(name?: string, id?: string | undefined);
|
|
1763
2793
|
}
|
|
1764
2794
|
//#endregion
|
|
@@ -1787,6 +2817,71 @@ declare class SubWorkflow<TInputJson$1 = unknown, TOutputJson$1 = unknown> imple
|
|
|
1787
2817
|
} | UpstreamRefPlaceholder> | undefined, startAt?: NodeId | undefined, id?: string | undefined);
|
|
1788
2818
|
}
|
|
1789
2819
|
//#endregion
|
|
2820
|
+
//#region src/nodes/TestTriggerNode.d.ts
|
|
2821
|
+
/**
|
|
2822
|
+
* Author-defined test-fixture trigger. Live activation skips this trigger (filtered by
|
|
2823
|
+
* `triggerKind === "test"` in `TriggerRuntimeService`); the `TestSuiteOrchestrator` drives its
|
|
2824
|
+
* `generateItems` callback during a TestSuiteRun and dispatches one workflow run per yielded item.
|
|
2825
|
+
*
|
|
2826
|
+
* `setup` is intentionally a no-op for symmetry with other trigger nodes — the real work happens
|
|
2827
|
+
* in the orchestrator. `execute` is a passthrough so items provided to `engine.runWorkflow(...)`
|
|
2828
|
+
* (one per case) flow downstream unchanged on `main`.
|
|
2829
|
+
*/
|
|
2830
|
+
declare class TestTriggerNode implements TriggerNode<TestTriggerNodeConfig<any>> {
|
|
2831
|
+
kind: "trigger";
|
|
2832
|
+
outputPorts: readonly ["main"];
|
|
2833
|
+
setup(_ctx: TriggerSetupContext<TestTriggerNodeConfig<any>>): Promise<undefined>;
|
|
2834
|
+
execute(items: Items, _ctx: NodeExecutionContext<TestTriggerNodeConfig<any>>): Promise<NodeOutputs>;
|
|
2835
|
+
}
|
|
2836
|
+
//#endregion
|
|
2837
|
+
//#region src/nodes/testTrigger.d.ts
|
|
2838
|
+
interface TestTriggerOptions<TOutputJson$1> {
|
|
2839
|
+
readonly name?: string;
|
|
2840
|
+
readonly id?: string;
|
|
2841
|
+
readonly icon?: string;
|
|
2842
|
+
/** Cap on simultaneous in-flight test cases for one suite run. Default: 4 (orchestrator). */
|
|
2843
|
+
readonly concurrency?: number;
|
|
2844
|
+
readonly credentialRequirements?: ReadonlyArray<CredentialRequirement>;
|
|
2845
|
+
/**
|
|
2846
|
+
* Free-form description of where the test cases come from. Shown in the node properties
|
|
2847
|
+
* panel and the Tests-tab suite-detail header so authors revisiting the workflow six months
|
|
2848
|
+
* later remember which mailbox / folder / fixture file the cases originate from.
|
|
2849
|
+
*/
|
|
2850
|
+
readonly description?: string;
|
|
2851
|
+
/**
|
|
2852
|
+
* Author callback that yields one item per test case. Items are dispatched as separate
|
|
2853
|
+
* workflow runs by the TestSuiteOrchestrator, with `executionOptions.testContext` set.
|
|
2854
|
+
* The provided context exposes credential resolution and an AbortSignal for cancellation.
|
|
2855
|
+
*/
|
|
2856
|
+
generateItems(ctx: TestTriggerSetupContext<TestTrigger<TOutputJson$1>>): AsyncIterable<Item<TOutputJson$1>>;
|
|
2857
|
+
/**
|
|
2858
|
+
* Optional resolver: extract a human-readable label from a yielded item. The orchestrator
|
|
2859
|
+
* persists this on the run, so the Tests-tab tree-table shows e.g. "RFQ for batch 14"
|
|
2860
|
+
* instead of an opaque runId. Typical use: `(item) => item.json.subject` for mailbox tests.
|
|
2861
|
+
*/
|
|
2862
|
+
caseLabel?(item: Item<TOutputJson$1>): string | undefined;
|
|
2863
|
+
}
|
|
2864
|
+
/**
|
|
2865
|
+
* Trigger config for a test fixture source. Drop one (or more) of these on the canvas alongside
|
|
2866
|
+
* a workflow's live triggers; clicking "Run tests" on the Tests tab invokes
|
|
2867
|
+
* {@link TestTriggerOptions.generateItems} via the TestSuiteOrchestrator.
|
|
2868
|
+
*/
|
|
2869
|
+
declare class TestTrigger<TOutputJson$1 = unknown> implements TestTriggerNodeConfig<TOutputJson$1> {
|
|
2870
|
+
readonly kind: "trigger";
|
|
2871
|
+
readonly triggerKind: "test";
|
|
2872
|
+
readonly type: TypeToken<unknown>;
|
|
2873
|
+
readonly icon: string;
|
|
2874
|
+
readonly name: string;
|
|
2875
|
+
readonly id?: string;
|
|
2876
|
+
readonly concurrency?: number;
|
|
2877
|
+
readonly description?: string;
|
|
2878
|
+
readonly generateItems: TestTriggerOptions<TOutputJson$1>["generateItems"];
|
|
2879
|
+
readonly caseLabel?: TestTriggerOptions<TOutputJson$1>["caseLabel"];
|
|
2880
|
+
private readonly credentialRequirements;
|
|
2881
|
+
constructor(options: TestTriggerOptions<TOutputJson$1>);
|
|
2882
|
+
getCredentialRequirements(): ReadonlyArray<CredentialRequirement>;
|
|
2883
|
+
}
|
|
2884
|
+
//#endregion
|
|
1790
2885
|
//#region src/nodes/WaitDurationFactory.d.ts
|
|
1791
2886
|
declare class WaitDuration {
|
|
1792
2887
|
static normalize(milliseconds: number): number;
|
|
@@ -1811,6 +2906,7 @@ declare class Wait<TItemJson = unknown> implements RunnableNodeConfig<TItemJson,
|
|
|
1811
2906
|
};
|
|
1812
2907
|
/** Pass-through empty batches should still advance to downstream nodes. */
|
|
1813
2908
|
readonly continueWhenEmptyOutput: true;
|
|
2909
|
+
readonly icon: "lucide:hourglass";
|
|
1814
2910
|
constructor(name: string, milliseconds: number, id?: string | undefined);
|
|
1815
2911
|
}
|
|
1816
2912
|
//#endregion
|
|
@@ -1841,7 +2937,7 @@ declare class WebhookTrigger<TSchema extends WebhookInputSchema | undefined = un
|
|
|
1841
2937
|
readonly id?: string | undefined;
|
|
1842
2938
|
readonly kind: "trigger";
|
|
1843
2939
|
readonly type: TypeToken<unknown>;
|
|
1844
|
-
readonly icon = "lucide:
|
|
2940
|
+
readonly icon = "lucide:webhook";
|
|
1845
2941
|
constructor(name: string, args: Readonly<{
|
|
1846
2942
|
endpointKey: string;
|
|
1847
2943
|
methods: ReadonlyArray<HttpMethod>;
|
|
@@ -2030,5 +3126,67 @@ declare class AIAgentConnectionWorkflowExpander {
|
|
|
2030
3126
|
private assertNoIdCollision;
|
|
2031
3127
|
}
|
|
2032
3128
|
//#endregion
|
|
2033
|
-
|
|
3129
|
+
//#region src/nodes/collections/collectionInsertNode.types.d.ts
|
|
3130
|
+
declare const collectionInsertNode: DefinedNode<"collection-insert", {
|
|
3131
|
+
collectionName: string;
|
|
3132
|
+
data: Record<string, unknown>;
|
|
3133
|
+
}, unknown, Record<string, unknown> & {
|
|
3134
|
+
id: string;
|
|
3135
|
+
created_at: Date;
|
|
3136
|
+
updated_at: Date;
|
|
3137
|
+
}, undefined>;
|
|
3138
|
+
//#endregion
|
|
3139
|
+
//#region src/nodes/collections/collectionGetNode.types.d.ts
|
|
3140
|
+
declare const collectionGetNode: DefinedNode<"collection-get", {
|
|
3141
|
+
collectionName: string;
|
|
3142
|
+
id: string;
|
|
3143
|
+
}, unknown, never[] | (Record<string, unknown> & {
|
|
3144
|
+
id: string;
|
|
3145
|
+
created_at: Date;
|
|
3146
|
+
updated_at: Date;
|
|
3147
|
+
}), undefined>;
|
|
3148
|
+
//#endregion
|
|
3149
|
+
//#region src/nodes/collections/collectionFindOneNode.types.d.ts
|
|
3150
|
+
declare const collectionFindOneNode: DefinedNode<"collection-find-one", {
|
|
3151
|
+
collectionName: string;
|
|
3152
|
+
where: Record<string, unknown>;
|
|
3153
|
+
}, unknown, never[] | (Record<string, unknown> & {
|
|
3154
|
+
id: string;
|
|
3155
|
+
created_at: Date;
|
|
3156
|
+
updated_at: Date;
|
|
3157
|
+
}), undefined>;
|
|
3158
|
+
//#endregion
|
|
3159
|
+
//#region src/nodes/collections/collectionListNode.types.d.ts
|
|
3160
|
+
declare const collectionListNode: DefinedNode<"collection-list", {
|
|
3161
|
+
collectionName: string;
|
|
3162
|
+
limit?: number | undefined;
|
|
3163
|
+
offset?: number | undefined;
|
|
3164
|
+
where?: Record<string, unknown> | undefined;
|
|
3165
|
+
}, unknown, (Record<string, unknown> & {
|
|
3166
|
+
id: string;
|
|
3167
|
+
created_at: Date;
|
|
3168
|
+
updated_at: Date;
|
|
3169
|
+
})[], undefined>;
|
|
3170
|
+
//#endregion
|
|
3171
|
+
//#region src/nodes/collections/collectionUpdateNode.types.d.ts
|
|
3172
|
+
declare const collectionUpdateNode: DefinedNode<"collection-update", {
|
|
3173
|
+
collectionName: string;
|
|
3174
|
+
id: string;
|
|
3175
|
+
patch: Record<string, unknown>;
|
|
3176
|
+
}, unknown, Record<string, unknown> & {
|
|
3177
|
+
id: string;
|
|
3178
|
+
created_at: Date;
|
|
3179
|
+
updated_at: Date;
|
|
3180
|
+
}, undefined>;
|
|
3181
|
+
//#endregion
|
|
3182
|
+
//#region src/nodes/collections/collectionDeleteNode.types.d.ts
|
|
3183
|
+
declare const collectionDeleteNode: DefinedNode<"collection-delete", {
|
|
3184
|
+
collectionName: string;
|
|
3185
|
+
id: string;
|
|
3186
|
+
}, unknown, {
|
|
3187
|
+
deleted: boolean;
|
|
3188
|
+
id: string;
|
|
3189
|
+
}, undefined>;
|
|
3190
|
+
//#endregion
|
|
3191
|
+
export { AIAgent, AIAgentConnectionWorkflowExpander, AIAgentExecutionHelpersFactory, AIAgentNode, AgentItemPortMap, AgentMessageFactory, AgentOutputFactory, AgentStructuredOutputRepairPromptFactory, AgentStructuredOutputRunner, AgentToolCallPortMap, AgentToolErrorClassifier, AgentToolExecutionCoordinator, AgentToolRepairExhaustedError, AgentToolRepairPolicy, Aggregate, AggregateNode, Assertion, AssertionNode, AssertionOptions, BinaryRef, Callback, CallbackHandler, CallbackNode, CallbackOptions, CallbackResultNormalizer, CanvasIconName, ConnectionCredentialExecutionContextFactory, ConnectionCredentialNode, ConnectionCredentialNodeConfig, ConnectionCredentialNodeConfigFactory, CredentialSession, CronTickJson, CronTrigger, CronTriggerNode, DefineRestNodeOptions, type ExecutedToolCall, Filter, FilterNode, HTTP_REQUEST_ACCEPTED_CREDENTIAL_TYPES, HttpBodySpec, HttpCredentialDelta, HttpRequest, HttpRequestDownloadMode, HttpRequestNode, HttpRequestOutputJson, HttpRequestResult, HttpRequestSpec, If, IfNode, IsTestRun, IsTestRunNode, type ItemScopedToolBinding, ManualTrigger, ManualTriggerNode, MapData, MapDataNode, MapDataOptions, Merge, MergeMode, MergeNode, NoOp, NoOpNode, OpenAIChatModelConfig, OpenAIChatModelFactory, OpenAiChatModelPresets, OpenAiCredentialSession, OpenAiStrictJsonSchemaFactory, type PlannedToolCall, type ResolvedTool, RestNodeApi, RestNodeErrorPolicy, RestNodeRequestShape, RestNodeResponseContext, Split, SplitNode, SubWorkflow, SubWorkflowNode, Switch, SwitchCaseKeyResolver, SwitchNode, TestTrigger, TestTriggerNode, TestTriggerOptions, Wait, WaitDuration, WaitNode, WebhookRespondNowAndContinueError, WebhookRespondNowError, WebhookTrigger, WebhookTriggerNode, type WorkflowAgentMessages, type WorkflowAgentOptions, WorkflowAuthoringBuilder, WorkflowBranchBuilder, WorkflowChain, apiKeyCredentialType, basicAuthCredentialType, bearerTokenCredentialType, collectionDeleteNode, collectionFindOneNode, collectionGetNode, collectionInsertNode, collectionListNode, collectionUpdateNode, createWorkflowBuilder, defineRestNode, oauth2ClientCredentialsType, openAiChatModelPresets, registerCoreNodes, workflow };
|
|
2034
3192
|
//# sourceMappingURL=index.d.ts.map
|