@codemation/core-nodes-ocr 0.2.1 → 0.2.3
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 +14 -0
- package/dist/codemation.plugin.cjs +254 -8
- package/dist/codemation.plugin.cjs.map +1 -1
- package/dist/codemation.plugin.d.cts +7 -1
- package/dist/codemation.plugin.d.ts +7 -1
- package/dist/codemation.plugin.js +255 -9
- package/dist/codemation.plugin.js.map +1 -1
- package/dist/{index-C2KJPzqN.d.ts → index-rc7dB1Ws.d.ts} +353 -281
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/metadata.json +4 -4
- package/dist/{runtimeTypes-ffl603pJ.d.cts → runtimeTypes-MQgcsey7.d.cts} +265 -193
- package/package.json +2 -2
- package/dist/index-DoHR1J8T.d.ts +0 -880
- package/dist/index-OvXJkNm1.d.ts +0 -874
- package/dist/runtimeTypes-C6YqmQG-.d.cts +0 -762
package/dist/index-OvXJkNm1.d.ts
DELETED
|
@@ -1,874 +0,0 @@
|
|
|
1
|
-
import { ZodType, z } from "zod";
|
|
2
|
-
import { ReadableStream } from "node:stream/web";
|
|
3
|
-
import { DependencyContainer as Container, InjectionToken as TypeToken } from "tsyringe";
|
|
4
|
-
|
|
5
|
-
//#region ../core/src/contracts/baseTypes.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Minimal base types that have no dependencies on other contracts.
|
|
8
|
-
* Used by credentialTypes, workflowTypes, and other contract layers
|
|
9
|
-
* to avoid circular dependencies.
|
|
10
|
-
*/
|
|
11
|
-
type WorkflowId = string;
|
|
12
|
-
type NodeId = string;
|
|
13
|
-
type OutputPortKey = string;
|
|
14
|
-
type InputPortKey = string;
|
|
15
|
-
type NodeConnectionName = string;
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region ../core/src/contracts/credentialTypes.d.ts
|
|
18
|
-
type CredentialTypeId = string;
|
|
19
|
-
type CredentialInstanceId = string;
|
|
20
|
-
type CredentialMaterialSourceKind = "db" | "env" | "code";
|
|
21
|
-
type CredentialSetupStatus = "draft" | "ready";
|
|
22
|
-
type CredentialHealthStatus = "unknown" | "healthy" | "failing";
|
|
23
|
-
type CredentialFieldSchema = Readonly<{
|
|
24
|
-
key: string;
|
|
25
|
-
label: string;
|
|
26
|
-
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
27
|
-
required?: true;
|
|
28
|
-
order?: number;
|
|
29
|
-
/**
|
|
30
|
-
* Where this field appears in the credential dialog. Use `"advanced"` for optional or
|
|
31
|
-
* power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).
|
|
32
|
-
* Defaults to `"default"` when omitted.
|
|
33
|
-
*/
|
|
34
|
-
visibility?: "default" | "advanced";
|
|
35
|
-
placeholder?: string;
|
|
36
|
-
helpText?: string;
|
|
37
|
-
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
38
|
-
envVarName?: string;
|
|
39
|
-
/**
|
|
40
|
-
* When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
|
|
41
|
-
* pattern or documentation URL). Do not use for secret values.
|
|
42
|
-
*/
|
|
43
|
-
copyValue?: string;
|
|
44
|
-
/** Accessible label for the copy control (default: Copy). */
|
|
45
|
-
copyButtonLabel?: string;
|
|
46
|
-
}>;
|
|
47
|
-
type CredentialRequirement = Readonly<{
|
|
48
|
-
slotKey: string;
|
|
49
|
-
label: string;
|
|
50
|
-
acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
51
|
-
optional?: true;
|
|
52
|
-
helpText?: string;
|
|
53
|
-
helpUrl?: string;
|
|
54
|
-
}>;
|
|
55
|
-
type CredentialHealth = Readonly<{
|
|
56
|
-
status: CredentialHealthStatus;
|
|
57
|
-
message?: string;
|
|
58
|
-
testedAt?: string;
|
|
59
|
-
expiresAt?: string;
|
|
60
|
-
details?: Readonly<Record<string, unknown>>;
|
|
61
|
-
}>;
|
|
62
|
-
type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
63
|
-
authorizeUrlFieldKey: string;
|
|
64
|
-
tokenUrlFieldKey: string;
|
|
65
|
-
userInfoUrlFieldKey?: string;
|
|
66
|
-
}>;
|
|
67
|
-
type CredentialOAuth2ScopesFromPublicConfig = Readonly<{
|
|
68
|
-
presetFieldKey: string;
|
|
69
|
-
presetScopes: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
70
|
-
customPresetKey?: string;
|
|
71
|
-
customScopesFieldKey?: string;
|
|
72
|
-
}>;
|
|
73
|
-
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
74
|
-
kind: "oauth2";
|
|
75
|
-
providerId: string;
|
|
76
|
-
scopes: ReadonlyArray<string>;
|
|
77
|
-
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
78
|
-
clientIdFieldKey?: string;
|
|
79
|
-
clientSecretFieldKey?: string;
|
|
80
|
-
} | {
|
|
81
|
-
kind: "oauth2";
|
|
82
|
-
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
83
|
-
scopes: ReadonlyArray<string>;
|
|
84
|
-
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
85
|
-
clientIdFieldKey?: string;
|
|
86
|
-
clientSecretFieldKey?: string;
|
|
87
|
-
} | {
|
|
88
|
-
kind: "oauth2";
|
|
89
|
-
/**
|
|
90
|
-
* Free-form provider identifier for telemetry, DB rows, and Better Auth provider naming.
|
|
91
|
-
* Not used for any registry lookup — URLs come from {@link authorizeUrl} / {@link tokenUrl}.
|
|
92
|
-
*/
|
|
93
|
-
providerId: string;
|
|
94
|
-
/**
|
|
95
|
-
* Authorization endpoint. May contain `{publicFieldKey}` placeholders that the runtime
|
|
96
|
-
* substitutes from the credential's resolved public config (URL-encoded).
|
|
97
|
-
* Example: `https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize`
|
|
98
|
-
*/
|
|
99
|
-
authorizeUrl: string;
|
|
100
|
-
/** Token endpoint. Same templating rules as {@link authorizeUrl}. */
|
|
101
|
-
tokenUrl: string;
|
|
102
|
-
/** Optional userinfo endpoint. Same templating rules as {@link authorizeUrl}. */
|
|
103
|
-
userInfoUrl?: string;
|
|
104
|
-
scopes: ReadonlyArray<string>;
|
|
105
|
-
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
106
|
-
clientIdFieldKey?: string;
|
|
107
|
-
clientSecretFieldKey?: string;
|
|
108
|
-
}>;
|
|
109
|
-
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
110
|
-
type CredentialAdvancedSectionPresentation = Readonly<{
|
|
111
|
-
/** Collapsible section title (default: "Advanced"). */
|
|
112
|
-
title?: string;
|
|
113
|
-
/** Optional short helper text shown inside the section (above the fields). */
|
|
114
|
-
description?: string;
|
|
115
|
-
/** When true, the advanced section starts expanded. Default: false (collapsed). */
|
|
116
|
-
defaultOpen?: boolean;
|
|
117
|
-
}>;
|
|
118
|
-
type CredentialTypeDefinition = Readonly<{
|
|
119
|
-
typeId: CredentialTypeId;
|
|
120
|
-
displayName: string;
|
|
121
|
-
description?: string;
|
|
122
|
-
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
123
|
-
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
124
|
-
/**
|
|
125
|
-
* Optional labels for the collapsible block that contains every field with `visibility: "advanced"`.
|
|
126
|
-
* If omitted, the UI still shows that block with defaults (title "Advanced", collapsed).
|
|
127
|
-
*/
|
|
128
|
-
advancedSection?: CredentialAdvancedSectionPresentation;
|
|
129
|
-
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
130
|
-
auth?: CredentialAuthDefinition;
|
|
131
|
-
}>;
|
|
132
|
-
/**
|
|
133
|
-
* JSON-shaped credential field bag (public config, resolved secret material, etc.).
|
|
134
|
-
*/
|
|
135
|
-
type CredentialJsonRecord = Readonly<Record<string, unknown>>;
|
|
136
|
-
/**
|
|
137
|
-
* Persisted credential instance with typed `publicConfig`.
|
|
138
|
-
* Hosts may specialize `secretRef` with a stricter union while remaining
|
|
139
|
-
* assignable here for session/test callbacks.
|
|
140
|
-
*/
|
|
141
|
-
type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
142
|
-
instanceId: CredentialInstanceId;
|
|
143
|
-
typeId: CredentialTypeId;
|
|
144
|
-
displayName: string;
|
|
145
|
-
sourceKind: CredentialMaterialSourceKind;
|
|
146
|
-
publicConfig: TPublicConfig;
|
|
147
|
-
secretRef: CredentialJsonRecord;
|
|
148
|
-
tags: ReadonlyArray<string>;
|
|
149
|
-
setupStatus: CredentialSetupStatus;
|
|
150
|
-
createdAt: string;
|
|
151
|
-
updatedAt: string;
|
|
152
|
-
}>;
|
|
153
|
-
/**
|
|
154
|
-
* Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
|
|
155
|
-
* Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
|
|
156
|
-
* against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
|
|
157
|
-
*/
|
|
158
|
-
type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
159
|
-
instance: CredentialInstanceRecord<TPublicConfig>;
|
|
160
|
-
material: TMaterial;
|
|
161
|
-
publicConfig: TPublicConfig;
|
|
162
|
-
}>;
|
|
163
|
-
type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
|
|
164
|
-
type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
|
|
165
|
-
/**
|
|
166
|
-
* Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
|
|
167
|
-
* Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
|
|
168
|
-
*/
|
|
169
|
-
type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
|
|
170
|
-
definition: CredentialTypeDefinition;
|
|
171
|
-
createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
|
|
172
|
-
test: CredentialHealthTester<TPublicConfig, TMaterial>;
|
|
173
|
-
}>;
|
|
174
|
-
/**
|
|
175
|
-
* Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
|
|
176
|
-
* and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
|
|
177
|
-
* Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
|
|
178
|
-
*/
|
|
179
|
-
type AnyCredentialType = CredentialType<any, any, unknown>;
|
|
180
|
-
//#endregion
|
|
181
|
-
//#region ../core/src/contracts/runTypes.d.ts
|
|
182
|
-
/**
|
|
183
|
-
* Test-suite linkage for a run. When set, this run was started by a TestSuiteOrchestrator
|
|
184
|
-
* as one test case inside a TestSuiteRun. The `IsTestRun` node and host-side persisters key
|
|
185
|
-
* off the presence of this field. Subworkflow runs inherit it from their parent run.
|
|
186
|
-
*/
|
|
187
|
-
interface RunTestContext {
|
|
188
|
-
readonly testSuiteRunId: string;
|
|
189
|
-
readonly testCaseIndex: number;
|
|
190
|
-
/**
|
|
191
|
-
* Optional human-friendly label for this test case (e.g. an email subject when fixtures
|
|
192
|
-
* are loaded from a mailbox). Resolved per item by `TestTrigger.caseLabel(item)` if set,
|
|
193
|
-
* persisted on `Run.test_case_label` so the Tests-tab tree-table can show "RFQ for batch 14"
|
|
194
|
-
* instead of "run_1777755971399_bbb86beac1396".
|
|
195
|
-
*/
|
|
196
|
-
readonly testCaseLabel?: string;
|
|
197
|
-
}
|
|
198
|
-
type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
|
|
199
|
-
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
|
|
200
|
-
interface NodeExecutionError {
|
|
201
|
-
message: string;
|
|
202
|
-
name?: string;
|
|
203
|
-
stack?: string;
|
|
204
|
-
details?: JsonValue;
|
|
205
|
-
}
|
|
206
|
-
/** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
|
|
207
|
-
type ConnectionInvocationId = string;
|
|
208
|
-
/** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
|
|
209
|
-
type ConnectionInvocationAppendArgs = Readonly<{
|
|
210
|
-
invocationId: ConnectionInvocationId;
|
|
211
|
-
connectionNodeId: NodeId;
|
|
212
|
-
parentAgentNodeId: NodeId;
|
|
213
|
-
parentAgentActivationId: NodeActivationId;
|
|
214
|
-
status: NodeExecutionStatus;
|
|
215
|
-
managedInput?: JsonValue;
|
|
216
|
-
managedOutput?: JsonValue;
|
|
217
|
-
error?: NodeExecutionError;
|
|
218
|
-
queuedAt?: string;
|
|
219
|
-
startedAt?: string;
|
|
220
|
-
finishedAt?: string;
|
|
221
|
-
iterationId?: NodeIterationId;
|
|
222
|
-
itemIndex?: number;
|
|
223
|
-
parentInvocationId?: ConnectionInvocationId;
|
|
224
|
-
}>;
|
|
225
|
-
//#endregion
|
|
226
|
-
//#region ../core/src/contracts/retryPolicySpec.types.d.ts
|
|
227
|
-
/**
|
|
228
|
-
* In-process retry policy for runnable nodes. Serialized configs use the same
|
|
229
|
-
* `kind` discriminator (`JSON.stringify` / persisted workflows).
|
|
230
|
-
*
|
|
231
|
-
* `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
|
|
232
|
-
*/
|
|
233
|
-
type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
|
|
234
|
-
interface NoneRetryPolicySpec {
|
|
235
|
-
readonly kind: "none";
|
|
236
|
-
}
|
|
237
|
-
interface FixedRetryPolicySpec {
|
|
238
|
-
readonly kind: "fixed";
|
|
239
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
240
|
-
readonly maxAttempts: number;
|
|
241
|
-
readonly delayMs: number;
|
|
242
|
-
}
|
|
243
|
-
interface ExponentialRetryPolicySpec {
|
|
244
|
-
readonly kind: "exponential";
|
|
245
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
246
|
-
readonly maxAttempts: number;
|
|
247
|
-
readonly initialDelayMs: number;
|
|
248
|
-
readonly multiplier: number;
|
|
249
|
-
readonly maxDelayMs?: number;
|
|
250
|
-
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
251
|
-
readonly jitter?: boolean;
|
|
252
|
-
}
|
|
253
|
-
//#endregion
|
|
254
|
-
//#region ../core/src/contracts/workflowTypes.d.ts
|
|
255
|
-
type NodeIdRef<TJson = unknown> = NodeId & Readonly<{
|
|
256
|
-
__codemationNodeJson?: TJson;
|
|
257
|
-
}>;
|
|
258
|
-
type NodeKind = "trigger" | "node";
|
|
259
|
-
type JsonPrimitive = string | number | boolean | null;
|
|
260
|
-
interface JsonObject {
|
|
261
|
-
readonly [key: string]: JsonValue;
|
|
262
|
-
}
|
|
263
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
264
|
-
type JsonArray = ReadonlyArray<JsonValue>;
|
|
265
|
-
interface Edge {
|
|
266
|
-
from: {
|
|
267
|
-
nodeId: NodeId;
|
|
268
|
-
output: OutputPortKey;
|
|
269
|
-
};
|
|
270
|
-
to: {
|
|
271
|
-
nodeId: NodeId;
|
|
272
|
-
input: InputPortKey;
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
|
|
277
|
-
* but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
|
|
278
|
-
* also be connection-owned nodes for recursive agent attachments.
|
|
279
|
-
*/
|
|
280
|
-
interface WorkflowNodeConnection {
|
|
281
|
-
readonly parentNodeId: NodeId;
|
|
282
|
-
readonly connectionName: NodeConnectionName;
|
|
283
|
-
readonly childNodeIds: ReadonlyArray<NodeId>;
|
|
284
|
-
}
|
|
285
|
-
interface WorkflowDefinition {
|
|
286
|
-
id: WorkflowId;
|
|
287
|
-
name: string;
|
|
288
|
-
nodes: NodeDefinition[];
|
|
289
|
-
edges: Edge[];
|
|
290
|
-
/**
|
|
291
|
-
* Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
|
|
292
|
-
* When omitted, all nodes in {@link nodes} are treated as executable for topology.
|
|
293
|
-
*/
|
|
294
|
-
readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
295
|
-
/** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
|
|
296
|
-
discoveryPathSegments?: readonly string[];
|
|
297
|
-
/** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
|
|
298
|
-
readonly prunePolicy?: WorkflowPrunePolicySpec;
|
|
299
|
-
/** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
|
|
300
|
-
readonly storagePolicy?: WorkflowStoragePolicySpec;
|
|
301
|
-
/** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
|
|
302
|
-
readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
|
|
303
|
-
}
|
|
304
|
-
interface NodeConfigBase {
|
|
305
|
-
readonly kind: NodeKind;
|
|
306
|
-
readonly type: TypeToken<unknown>;
|
|
307
|
-
readonly name?: string;
|
|
308
|
-
readonly id?: NodeId;
|
|
309
|
-
readonly icon?: string;
|
|
310
|
-
readonly execution?: Readonly<{
|
|
311
|
-
hint?: "local" | "worker";
|
|
312
|
-
queue?: string;
|
|
313
|
-
}>;
|
|
314
|
-
/** In-process execute retries (runnable nodes). Triggers typically omit this. */
|
|
315
|
-
readonly retryPolicy?: RetryPolicySpec;
|
|
316
|
-
/** Recover from execute failures; return outputs to continue, or rethrow to fail the node. */
|
|
317
|
-
readonly nodeErrorHandler?: NodeErrorHandlerSpec;
|
|
318
|
-
/**
|
|
319
|
-
* When true, edges carrying zero items on an output port still schedule single-input downstream nodes.
|
|
320
|
-
* Decided from the **source** node that produced the (empty) output. Default (false/undefined): empty
|
|
321
|
-
* main batches skip downstream execution and propagate the empty path.
|
|
322
|
-
*/
|
|
323
|
-
readonly continueWhenEmptyOutput?: boolean;
|
|
324
|
-
/**
|
|
325
|
-
* Declared I/O port names for canvas authoring (unioned with ports inferred from edges).
|
|
326
|
-
* Use for dynamic routers (Switch) and future error ports.
|
|
327
|
-
*/
|
|
328
|
-
readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
|
|
329
|
-
readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
|
|
330
|
-
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
331
|
-
/**
|
|
332
|
-
* Marker: this node emits {@link import("./assertionTypes").AssertionResult}-shaped items on its
|
|
333
|
-
* `main` port. The TestSuiteOrchestrator (and host-side TestAssertionPersister) listen for
|
|
334
|
-
* `nodeCompleted` events from nodes with this flag set, and persist their output items as
|
|
335
|
-
* TestAssertion records (only when the run carries a `testContext`). Set on assertion node
|
|
336
|
-
* configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).
|
|
337
|
-
*/
|
|
338
|
-
readonly emitsAssertions?: true;
|
|
339
|
-
/**
|
|
340
|
-
* Static configuration summary surfaced in the workflow inspector — the design-time
|
|
341
|
-
* "what does this node do" panel that renders before any run telemetry exists.
|
|
342
|
-
*
|
|
343
|
-
* Return 2–6 short label/value pairs derived from this config (method + url for an HTTP
|
|
344
|
-
* call, model + tool list for an agent, schedule + timezone for a cron trigger, etc.).
|
|
345
|
-
* Values are truncated by the UI; aim for one line each. Return `undefined` to opt out
|
|
346
|
-
* — the inspector hides the section when no rows are produced.
|
|
347
|
-
*
|
|
348
|
-
* Implement on the config class instance so the function can read sibling config fields.
|
|
349
|
-
* `defineNode({ inspectorSummary })` plumbs through to this.
|
|
350
|
-
*/
|
|
351
|
-
inspectorSummary?(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* One row of a node's static configuration summary. See {@link NodeConfigBase.inspectorSummary}.
|
|
355
|
-
*/
|
|
356
|
-
interface NodeInspectorSummaryRow {
|
|
357
|
-
readonly label: string;
|
|
358
|
-
readonly value: string;
|
|
359
|
-
}
|
|
360
|
-
declare const runnableNodeInputType: unique symbol;
|
|
361
|
-
declare const runnableNodeOutputType: unique symbol;
|
|
362
|
-
/**
|
|
363
|
-
* Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).
|
|
364
|
-
* **`TOutputJson`** is emitted `item.json` on outputs.
|
|
365
|
-
*/
|
|
366
|
-
interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
|
|
367
|
-
readonly kind: "node";
|
|
368
|
-
readonly [runnableNodeInputType]?: TInputJson$1;
|
|
369
|
-
readonly [runnableNodeOutputType]?: TOutputJson$1;
|
|
370
|
-
/**
|
|
371
|
-
* Optional Zod input contract for {@link RunnableNode} when not set on the node class.
|
|
372
|
-
* Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
|
|
373
|
-
*/
|
|
374
|
-
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
375
|
-
/**
|
|
376
|
-
* When an activation receives **zero** input items, the engine normally runs `execute` zero times.
|
|
377
|
-
* Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).
|
|
378
|
-
* Used by batch-style callback nodes (built-in `Callback`) so `callback([], ctx)` still runs.
|
|
379
|
-
*/
|
|
380
|
-
readonly emptyBatchExecution?: "skip" | "runOnce";
|
|
381
|
-
}
|
|
382
|
-
interface NodeDefinition {
|
|
383
|
-
id: NodeId;
|
|
384
|
-
kind: NodeKind;
|
|
385
|
-
type: TypeToken<unknown>;
|
|
386
|
-
name?: string;
|
|
387
|
-
config: NodeConfigBase;
|
|
388
|
-
}
|
|
389
|
-
type PairedItemRef = Readonly<{
|
|
390
|
-
nodeId: NodeId;
|
|
391
|
-
output: OutputPortKey;
|
|
392
|
-
itemIndex: number;
|
|
393
|
-
}>;
|
|
394
|
-
type BinaryPreviewKind = "image" | "audio" | "video" | "download";
|
|
395
|
-
type BinaryAttachment = Readonly<{
|
|
396
|
-
id: string;
|
|
397
|
-
storageKey: string;
|
|
398
|
-
mimeType: string;
|
|
399
|
-
size: number;
|
|
400
|
-
storageDriver: string;
|
|
401
|
-
previewKind: BinaryPreviewKind;
|
|
402
|
-
createdAt: string;
|
|
403
|
-
runId: RunId;
|
|
404
|
-
workflowId: WorkflowId;
|
|
405
|
-
nodeId: NodeId;
|
|
406
|
-
activationId: NodeActivationId;
|
|
407
|
-
filename?: string;
|
|
408
|
-
sha256?: string;
|
|
409
|
-
}>;
|
|
410
|
-
type ItemBinary = Readonly<Record<string, BinaryAttachment>>;
|
|
411
|
-
type Item<TJson = unknown> = Readonly<{
|
|
412
|
-
json: TJson;
|
|
413
|
-
binary?: ItemBinary;
|
|
414
|
-
meta?: Readonly<Record<string, unknown>>;
|
|
415
|
-
paired?: ReadonlyArray<PairedItemRef>;
|
|
416
|
-
}>;
|
|
417
|
-
type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
|
|
418
|
-
type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
|
|
419
|
-
type RunId = string;
|
|
420
|
-
type NodeActivationId = string;
|
|
421
|
-
/**
|
|
422
|
-
* One per-item iteration of a runnable node's execute loop. Refines `NodeActivationId` for
|
|
423
|
-
* per-item connection invocations and telemetry. Undefined when the executing node is a batch
|
|
424
|
-
* node or trigger that does not iterate items.
|
|
425
|
-
*/
|
|
426
|
-
type NodeIterationId = string;
|
|
427
|
-
interface ParentExecutionRef {
|
|
428
|
-
runId: RunId;
|
|
429
|
-
workflowId: WorkflowId;
|
|
430
|
-
nodeId: NodeId;
|
|
431
|
-
/** Subworkflow depth of the **spawning** run (0 = root). Passed when starting a child run. */
|
|
432
|
-
subworkflowDepth?: number;
|
|
433
|
-
/** Effective max node activations from the parent run (propagated to child policy merge). */
|
|
434
|
-
engineMaxNodeActivations?: number;
|
|
435
|
-
/** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
|
|
436
|
-
engineMaxSubworkflowDepth?: number;
|
|
437
|
-
/**
|
|
438
|
-
* Test-suite linkage inherited by the child subworkflow run. Set by whichever node
|
|
439
|
-
* spawns the subworkflow when its own `ctx.testContext` is present, so assertions
|
|
440
|
-
* emitted inside a subworkflow land under the correct parent test case.
|
|
441
|
-
*/
|
|
442
|
-
testContext?: RunTestContext;
|
|
443
|
-
}
|
|
444
|
-
interface RunDataSnapshot {
|
|
445
|
-
getOutputs(nodeId: NodeId): NodeOutputs | undefined;
|
|
446
|
-
getOutputItems<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, output?: OutputPortKey): Items<TJson>;
|
|
447
|
-
getOutputItem<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, itemIndex: number, output?: OutputPortKey): Item<TJson> | undefined;
|
|
448
|
-
}
|
|
449
|
-
/** Whether to persist run execution data after the workflow finishes. */
|
|
450
|
-
type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
|
|
451
|
-
type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken<WorkflowStoragePolicyResolver>;
|
|
452
|
-
interface WorkflowStoragePolicyResolver {
|
|
453
|
-
shouldPersist(args: WorkflowStoragePolicyDecisionArgs): boolean | Promise<boolean>;
|
|
454
|
-
}
|
|
455
|
-
interface WorkflowStoragePolicyDecisionArgs {
|
|
456
|
-
readonly runId: RunId;
|
|
457
|
-
readonly workflowId: WorkflowId;
|
|
458
|
-
readonly workflow: WorkflowDefinition;
|
|
459
|
-
readonly finalStatus: "completed" | "failed";
|
|
460
|
-
readonly startedAt: string;
|
|
461
|
-
readonly finishedAt: string;
|
|
462
|
-
}
|
|
463
|
-
interface WorkflowPrunePolicySpec {
|
|
464
|
-
readonly runDataRetentionSeconds?: number;
|
|
465
|
-
readonly binaryRetentionSeconds?: number;
|
|
466
|
-
readonly telemetrySpanRetentionSeconds?: number;
|
|
467
|
-
readonly telemetryArtifactRetentionSeconds?: number;
|
|
468
|
-
readonly telemetryMetricRetentionSeconds?: number;
|
|
469
|
-
}
|
|
470
|
-
interface WorkflowErrorHandler {
|
|
471
|
-
onError(ctx: WorkflowErrorContext): void | Promise<void>;
|
|
472
|
-
}
|
|
473
|
-
interface WorkflowErrorContext {
|
|
474
|
-
readonly runId: RunId;
|
|
475
|
-
readonly workflowId: WorkflowId;
|
|
476
|
-
readonly workflow: WorkflowDefinition;
|
|
477
|
-
readonly failedNodeId: NodeId;
|
|
478
|
-
readonly error: Error;
|
|
479
|
-
readonly startedAt: string;
|
|
480
|
-
readonly finishedAt: string;
|
|
481
|
-
}
|
|
482
|
-
type WorkflowErrorHandlerSpec = TypeToken<WorkflowErrorHandler> | WorkflowErrorHandler;
|
|
483
|
-
interface NodeErrorHandlerArgs<TConfig$1 extends NodeConfigBase = NodeConfigBase> {
|
|
484
|
-
readonly kind: "single" | "multi";
|
|
485
|
-
readonly items: Items;
|
|
486
|
-
readonly inputsByPort: Readonly<Record<InputPortKey, Items>> | undefined;
|
|
487
|
-
readonly ctx: NodeExecutionContext<TConfig$1>;
|
|
488
|
-
readonly error: Error;
|
|
489
|
-
}
|
|
490
|
-
interface NodeErrorHandler {
|
|
491
|
-
handle<TConfig$1 extends NodeConfigBase>(args: NodeErrorHandlerArgs<TConfig$1>): Promise<NodeOutputs>;
|
|
492
|
-
}
|
|
493
|
-
type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
494
|
-
//#endregion
|
|
495
|
-
//#region ../core/src/contracts/CostTrackingTelemetryContract.d.ts
|
|
496
|
-
type CostTrackingComponent = "chat" | "ocr" | "rag";
|
|
497
|
-
interface CostTrackingUsageRecord {
|
|
498
|
-
readonly component: CostTrackingComponent;
|
|
499
|
-
readonly provider: string;
|
|
500
|
-
readonly operation: string;
|
|
501
|
-
readonly pricingKey: string;
|
|
502
|
-
readonly usageUnit: string;
|
|
503
|
-
readonly quantity: number;
|
|
504
|
-
readonly modelName?: string;
|
|
505
|
-
readonly attributes?: TelemetryAttributes;
|
|
506
|
-
}
|
|
507
|
-
interface CostTrackingPriceQuote {
|
|
508
|
-
readonly currency: string;
|
|
509
|
-
readonly currencyScale: number;
|
|
510
|
-
readonly estimatedAmountMinor: number;
|
|
511
|
-
readonly estimateKind: "catalog";
|
|
512
|
-
}
|
|
513
|
-
interface CostTrackingTelemetry {
|
|
514
|
-
captureUsage(args: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
|
|
515
|
-
forScope(scope: TelemetryScope): CostTrackingTelemetry;
|
|
516
|
-
}
|
|
517
|
-
//#endregion
|
|
518
|
-
//#region ../core/src/contracts/telemetryTypes.d.ts
|
|
519
|
-
type TelemetryAttributePrimitive = string | number | boolean | null;
|
|
520
|
-
interface TelemetryAttributes {
|
|
521
|
-
readonly [key: string]: TelemetryAttributePrimitive | undefined;
|
|
522
|
-
}
|
|
523
|
-
interface TelemetryMetricRecord {
|
|
524
|
-
readonly name: string;
|
|
525
|
-
readonly value: number;
|
|
526
|
-
readonly unit?: string;
|
|
527
|
-
readonly attributes?: TelemetryAttributes;
|
|
528
|
-
}
|
|
529
|
-
interface TelemetrySpanEventRecord {
|
|
530
|
-
readonly name: string;
|
|
531
|
-
readonly occurredAt?: Date;
|
|
532
|
-
readonly attributes?: TelemetryAttributes;
|
|
533
|
-
}
|
|
534
|
-
interface TelemetryArtifactAttachment {
|
|
535
|
-
readonly kind: string;
|
|
536
|
-
readonly contentType: string;
|
|
537
|
-
readonly previewText?: string;
|
|
538
|
-
readonly previewJson?: JsonValue;
|
|
539
|
-
readonly payloadText?: string;
|
|
540
|
-
readonly payloadJson?: JsonValue;
|
|
541
|
-
readonly bytes?: number;
|
|
542
|
-
readonly truncated?: boolean;
|
|
543
|
-
readonly expiresAt?: Date;
|
|
544
|
-
}
|
|
545
|
-
interface TelemetryArtifactReference {
|
|
546
|
-
readonly artifactId: string;
|
|
547
|
-
readonly traceId?: string;
|
|
548
|
-
readonly spanId?: string;
|
|
549
|
-
}
|
|
550
|
-
interface TelemetrySpanEnd {
|
|
551
|
-
readonly status?: "ok" | "error";
|
|
552
|
-
readonly statusMessage?: string;
|
|
553
|
-
readonly endedAt?: Date;
|
|
554
|
-
readonly attributes?: TelemetryAttributes;
|
|
555
|
-
}
|
|
556
|
-
interface TelemetryChildSpanStart {
|
|
557
|
-
readonly name: string;
|
|
558
|
-
readonly kind?: "internal" | "client";
|
|
559
|
-
readonly startedAt?: Date;
|
|
560
|
-
readonly attributes?: TelemetryAttributes;
|
|
561
|
-
}
|
|
562
|
-
interface TelemetryScope {
|
|
563
|
-
readonly traceId?: string;
|
|
564
|
-
readonly spanId?: string;
|
|
565
|
-
readonly costTracking?: CostTrackingTelemetry;
|
|
566
|
-
addSpanEvent(args: TelemetrySpanEventRecord): Promise<void> | void;
|
|
567
|
-
recordMetric(args: TelemetryMetricRecord): Promise<void> | void;
|
|
568
|
-
attachArtifact(args: TelemetryArtifactAttachment): Promise<TelemetryArtifactReference> | TelemetryArtifactReference;
|
|
569
|
-
}
|
|
570
|
-
interface TelemetrySpanScope extends TelemetryScope {
|
|
571
|
-
readonly traceId: string;
|
|
572
|
-
readonly spanId: string;
|
|
573
|
-
end(args?: TelemetrySpanEnd): Promise<void> | void;
|
|
574
|
-
/**
|
|
575
|
-
* Lift this span into a {@link NodeExecutionTelemetry} scoped to a different (nodeId, activationId).
|
|
576
|
-
* Children created via the returned telemetry's `startChildSpan` get this span as their parent.
|
|
577
|
-
*
|
|
578
|
-
* Used at the sub-agent boundary so that nested runtime telemetry parents under the agent.tool.call
|
|
579
|
-
* span instead of the orchestrator's node-level span.
|
|
580
|
-
*/
|
|
581
|
-
asNodeTelemetry(args: Readonly<{
|
|
582
|
-
nodeId: NodeId;
|
|
583
|
-
activationId: NodeActivationId;
|
|
584
|
-
}>): NodeExecutionTelemetry;
|
|
585
|
-
}
|
|
586
|
-
interface NodeExecutionTelemetry extends ExecutionTelemetry, TelemetrySpanScope {
|
|
587
|
-
startChildSpan(args: TelemetryChildSpanStart): TelemetrySpanScope;
|
|
588
|
-
}
|
|
589
|
-
interface ExecutionTelemetry extends TelemetryScope {
|
|
590
|
-
readonly traceId: string;
|
|
591
|
-
readonly spanId: string;
|
|
592
|
-
forNode(args: Readonly<{
|
|
593
|
-
nodeId: NodeId;
|
|
594
|
-
activationId: NodeActivationId;
|
|
595
|
-
}>): NodeExecutionTelemetry;
|
|
596
|
-
}
|
|
597
|
-
//#endregion
|
|
598
|
-
//#region ../core/src/contracts/mcpTypes.d.ts
|
|
599
|
-
type McpServerTransport = "http";
|
|
600
|
-
interface McpServerDeclaration {
|
|
601
|
-
/** Globally unique slug, e.g. "gmail". Workflow authors reference this. */
|
|
602
|
-
id: string;
|
|
603
|
-
displayName: string;
|
|
604
|
-
description: string;
|
|
605
|
-
transport: McpServerTransport;
|
|
606
|
-
url: string;
|
|
607
|
-
/**
|
|
608
|
-
* Credential types accepted by this MCP server, matching CredentialRequirement.acceptedTypes.
|
|
609
|
-
* Absent or empty means no credential is required.
|
|
610
|
-
*/
|
|
611
|
-
acceptedCredentialTypes?: ReadonlyArray<string>;
|
|
612
|
-
/**
|
|
613
|
-
* Documentation only in MVP. The bind-time validator checks
|
|
614
|
-
* requiredScopes ⊆ CredentialInstance.scopesGranted.
|
|
615
|
-
*/
|
|
616
|
-
requiredScopes?: string[];
|
|
617
|
-
/** Non-secret static headers merged onto every MCP request. */
|
|
618
|
-
staticHeaders?: Record<string, string>;
|
|
619
|
-
/**
|
|
620
|
-
* Overrides for tool descriptions advertised by the MCP server.
|
|
621
|
-
* Applied by the connection pool after tools/list.
|
|
622
|
-
* Key: exact tool name as returned by the server.
|
|
623
|
-
*/
|
|
624
|
-
toolDescriptionOverrides?: Record<string, string>;
|
|
625
|
-
}
|
|
626
|
-
//#endregion
|
|
627
|
-
//#region ../core/src/contracts/collectionTypes.d.ts
|
|
628
|
-
/**
|
|
629
|
-
* Represents a typed store for a single collection.
|
|
630
|
-
* All rows include auto-managed id, created_at, and updated_at fields.
|
|
631
|
-
*/
|
|
632
|
-
interface CollectionStore<TRow extends Record<string, unknown> = Record<string, unknown>> {
|
|
633
|
-
/**
|
|
634
|
-
* Insert a new row. id, created_at, and updated_at are auto-populated.
|
|
635
|
-
*/
|
|
636
|
-
insert(row: TRow): Promise<TRow & {
|
|
637
|
-
id: string;
|
|
638
|
-
created_at: Date;
|
|
639
|
-
updated_at: Date;
|
|
640
|
-
}>;
|
|
641
|
-
/**
|
|
642
|
-
* Get a single row by id.
|
|
643
|
-
*/
|
|
644
|
-
get(id: string): Promise<(TRow & {
|
|
645
|
-
id: string;
|
|
646
|
-
created_at: Date;
|
|
647
|
-
updated_at: Date;
|
|
648
|
-
}) | null>;
|
|
649
|
-
/**
|
|
650
|
-
* Find a single row matching the provided filter.
|
|
651
|
-
*/
|
|
652
|
-
findOne(filter: Partial<TRow>): Promise<(TRow & {
|
|
653
|
-
id: string;
|
|
654
|
-
created_at: Date;
|
|
655
|
-
updated_at: Date;
|
|
656
|
-
}) | null>;
|
|
657
|
-
/**
|
|
658
|
-
* List rows with optional pagination and filtering.
|
|
659
|
-
*/
|
|
660
|
-
list(opts?: {
|
|
661
|
-
limit?: number;
|
|
662
|
-
offset?: number;
|
|
663
|
-
where?: Partial<TRow>;
|
|
664
|
-
}): Promise<{
|
|
665
|
-
rows: ReadonlyArray<TRow & {
|
|
666
|
-
id: string;
|
|
667
|
-
created_at: Date;
|
|
668
|
-
updated_at: Date;
|
|
669
|
-
}>;
|
|
670
|
-
total: number;
|
|
671
|
-
}>;
|
|
672
|
-
/**
|
|
673
|
-
* Update a row by id with partial data.
|
|
674
|
-
*/
|
|
675
|
-
update(id: string, patch: Partial<TRow>): Promise<TRow & {
|
|
676
|
-
id: string;
|
|
677
|
-
created_at: Date;
|
|
678
|
-
updated_at: Date;
|
|
679
|
-
}>;
|
|
680
|
-
/**
|
|
681
|
-
* Delete a row by id. Hard delete only (no soft delete).
|
|
682
|
-
*/
|
|
683
|
-
delete(id: string): Promise<{
|
|
684
|
-
deleted: boolean;
|
|
685
|
-
}>;
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* Runtime collections context: keyed by collection name.
|
|
689
|
-
*/
|
|
690
|
-
type CollectionsContext = Readonly<Record<string, CollectionStore>>;
|
|
691
|
-
//#endregion
|
|
692
|
-
//#region ../core/src/policies/executionLimits/EngineExecutionLimitsPolicy.d.ts
|
|
693
|
-
interface EngineExecutionLimitsPolicyConfig {
|
|
694
|
-
readonly defaultMaxNodeActivations: number;
|
|
695
|
-
readonly hardMaxNodeActivations: number;
|
|
696
|
-
readonly defaultMaxSubworkflowDepth: number;
|
|
697
|
-
readonly hardMaxSubworkflowDepth: number;
|
|
698
|
-
}
|
|
699
|
-
//#endregion
|
|
700
|
-
//#region ../core/src/contracts/runtimeTypes.d.ts
|
|
701
|
-
interface NodeExecutionStatePublisher {
|
|
702
|
-
markQueued(args: {
|
|
703
|
-
nodeId: NodeId;
|
|
704
|
-
activationId?: NodeActivationId;
|
|
705
|
-
inputsByPort?: NodeInputsByPort;
|
|
706
|
-
}): Promise<void>;
|
|
707
|
-
markRunning(args: {
|
|
708
|
-
nodeId: NodeId;
|
|
709
|
-
activationId?: NodeActivationId;
|
|
710
|
-
inputsByPort?: NodeInputsByPort;
|
|
711
|
-
}): Promise<void>;
|
|
712
|
-
markCompleted(args: {
|
|
713
|
-
nodeId: NodeId;
|
|
714
|
-
activationId?: NodeActivationId;
|
|
715
|
-
inputsByPort?: NodeInputsByPort;
|
|
716
|
-
outputs?: NodeOutputs;
|
|
717
|
-
}): Promise<void>;
|
|
718
|
-
markFailed(args: {
|
|
719
|
-
nodeId: NodeId;
|
|
720
|
-
activationId?: NodeActivationId;
|
|
721
|
-
inputsByPort?: NodeInputsByPort;
|
|
722
|
-
error: Error;
|
|
723
|
-
}): Promise<void>;
|
|
724
|
-
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
725
|
-
/**
|
|
726
|
-
* Annotates the current snapshot for `nodeId` with the id of the child run spawned by a
|
|
727
|
-
* SubWorkflow invocation. Called from `SubWorkflowNode.execute` after `runById` resolves.
|
|
728
|
-
* The engine's subsequent `markCompleted` call preserves the value via `previous.childRunId`.
|
|
729
|
-
*/
|
|
730
|
-
setChildRunId?(args: {
|
|
731
|
-
nodeId: NodeId;
|
|
732
|
-
childRunId: RunId;
|
|
733
|
-
}): Promise<void>;
|
|
734
|
-
}
|
|
735
|
-
type BinaryBody = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array | ArrayBuffer;
|
|
736
|
-
interface BinaryStorageReadResult {
|
|
737
|
-
body: ReadableStream<Uint8Array>;
|
|
738
|
-
size?: number;
|
|
739
|
-
}
|
|
740
|
-
interface BinaryAttachmentCreateRequest {
|
|
741
|
-
name: string;
|
|
742
|
-
body: BinaryBody;
|
|
743
|
-
mimeType: string;
|
|
744
|
-
filename?: string;
|
|
745
|
-
previewKind?: BinaryAttachment["previewKind"];
|
|
746
|
-
}
|
|
747
|
-
interface NodeBinaryAttachmentService extends ExecutionBinaryService {
|
|
748
|
-
attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;
|
|
749
|
-
withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
|
|
750
|
-
}
|
|
751
|
-
interface ExecutionBinaryService {
|
|
752
|
-
forNode(args: {
|
|
753
|
-
nodeId: NodeId;
|
|
754
|
-
activationId: NodeActivationId;
|
|
755
|
-
}): NodeBinaryAttachmentService;
|
|
756
|
-
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
757
|
-
}
|
|
758
|
-
interface ExecutionContext {
|
|
759
|
-
runId: RunId;
|
|
760
|
-
workflowId: WorkflowId;
|
|
761
|
-
parent?: ParentExecutionRef;
|
|
762
|
-
/** This run's subworkflow depth (0 = root). */
|
|
763
|
-
subworkflowDepth: number;
|
|
764
|
-
/** Effective activation budget cap for this run (after policy merge). */
|
|
765
|
-
engineMaxNodeActivations: number;
|
|
766
|
-
/** Effective subworkflow nesting cap for this run (after policy merge). */
|
|
767
|
-
engineMaxSubworkflowDepth: number;
|
|
768
|
-
now: () => Date;
|
|
769
|
-
data: RunDataSnapshot;
|
|
770
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
771
|
-
telemetry: ExecutionTelemetry;
|
|
772
|
-
binary: ExecutionBinaryService;
|
|
773
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
774
|
-
/** Per-item iteration id, set by {@link NodeExecutor} on the ctx passed into runnable `execute`. */
|
|
775
|
-
iterationId?: NodeIterationId;
|
|
776
|
-
/** Item index (0-based) within the current activation's batch; set alongside {@link iterationId}. */
|
|
777
|
-
itemIndex?: number;
|
|
778
|
-
/** When set, this ctx is executing inside a sub-agent triggered by the named parent invocation. */
|
|
779
|
-
parentInvocationId?: ConnectionInvocationId;
|
|
780
|
-
/**
|
|
781
|
-
* Present iff the run was started by a TestSuiteOrchestrator. The {@link IsTestRunNode}
|
|
782
|
-
* branches on this; assertion-emitting nodes use it to decide whether to record results.
|
|
783
|
-
*/
|
|
784
|
-
testContext?: RunTestContext;
|
|
785
|
-
/**
|
|
786
|
-
* Collections registered in the codemation config, keyed by collection name.
|
|
787
|
-
*/
|
|
788
|
-
readonly collections?: CollectionsContext;
|
|
789
|
-
}
|
|
790
|
-
interface NodeExecutionContext<TConfig$1 extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
|
|
791
|
-
nodeId: NodeId;
|
|
792
|
-
activationId: NodeActivationId;
|
|
793
|
-
config: TConfig$1;
|
|
794
|
-
telemetry: NodeExecutionTelemetry;
|
|
795
|
-
binary: NodeBinaryAttachmentService;
|
|
796
|
-
}
|
|
797
|
-
//#endregion
|
|
798
|
-
//#region ../core/src/contracts/itemExpr.d.ts
|
|
799
|
-
declare const ITEM_EXPR_BRAND: unique symbol;
|
|
800
|
-
type ItemExprResolvedContext = Readonly<{
|
|
801
|
-
runId: RunId;
|
|
802
|
-
workflowId: WorkflowId;
|
|
803
|
-
nodeId: NodeId;
|
|
804
|
-
activationId: NodeActivationId;
|
|
805
|
-
data: RunDataSnapshot;
|
|
806
|
-
}>;
|
|
807
|
-
/**
|
|
808
|
-
* Context aligned with former {@link ItemInputMapperContext} — use **`data`** to read any completed upstream node.
|
|
809
|
-
*/
|
|
810
|
-
type ItemExprContext = ItemExprResolvedContext;
|
|
811
|
-
type ItemExprArgs<TItemJson = unknown> = Readonly<{
|
|
812
|
-
item: Item<TItemJson>;
|
|
813
|
-
itemIndex: number;
|
|
814
|
-
items: Items<TItemJson>;
|
|
815
|
-
ctx: ItemExprContext;
|
|
816
|
-
}>;
|
|
817
|
-
type ItemExprCallback<T, TItemJson = unknown> = (args: ItemExprArgs<TItemJson>) => T | Promise<T>;
|
|
818
|
-
type ItemExpr<T, TItemJson = unknown> = Readonly<{
|
|
819
|
-
readonly [ITEM_EXPR_BRAND]: true;
|
|
820
|
-
readonly fn: ItemExprCallback<T, TItemJson>;
|
|
821
|
-
}>;
|
|
822
|
-
//#endregion
|
|
823
|
-
//#region ../core/src/contracts/params.d.ts
|
|
824
|
-
type Expr<T, TItemJson = unknown> = ItemExpr<T, TItemJson>;
|
|
825
|
-
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);
|
|
826
|
-
//#endregion
|
|
827
|
-
//#region ../core/src/authoring/defineNode.types.d.ts
|
|
828
|
-
type ResolvableCredentialType = AnyCredentialType | CredentialTypeId;
|
|
829
|
-
type DefinedNodeCredentialBinding = ResolvableCredentialType | Readonly<{
|
|
830
|
-
readonly type: ResolvableCredentialType | ReadonlyArray<ResolvableCredentialType>;
|
|
831
|
-
readonly label?: string;
|
|
832
|
-
readonly optional?: true;
|
|
833
|
-
readonly helpText?: string;
|
|
834
|
-
readonly helpUrl?: string;
|
|
835
|
-
}>;
|
|
836
|
-
type DefinedNodeCredentialBindings = Readonly<Record<string, DefinedNodeCredentialBinding>>;
|
|
837
|
-
type DefinedNodeConfigInput<TConfigResolved extends CredentialJsonRecord, TItemJson> = ParamDeep<TConfigResolved, TItemJson>;
|
|
838
|
-
interface DefinedNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson$1, TOutputJson$1, _TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
|
|
839
|
-
readonly kind: "defined-node";
|
|
840
|
-
readonly key: TKey$1;
|
|
841
|
-
readonly title: string;
|
|
842
|
-
readonly description?: string;
|
|
843
|
-
create<TConfigItemJson = TInputJson$1>(config: DefinedNodeConfigInput<TConfig$1, TConfigItemJson>, name?: string, id?: string): RunnableNodeConfig<TInputJson$1, TOutputJson$1>;
|
|
844
|
-
register(context: {
|
|
845
|
-
registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
|
|
846
|
-
}): void;
|
|
847
|
-
}
|
|
848
|
-
//#endregion
|
|
849
|
-
//#region ../core/src/authoring/defineCollection.types.d.ts
|
|
850
|
-
type CollectionFieldType = "text" | "int" | "bigint" | "double" | "bool" | "timestamptz" | "jsonb" | "uuid";
|
|
851
|
-
interface CollectionFieldDefinition {
|
|
852
|
-
readonly type: CollectionFieldType;
|
|
853
|
-
readonly nullable: boolean;
|
|
854
|
-
readonly default?: unknown;
|
|
855
|
-
}
|
|
856
|
-
interface CollectionIndexDefinition {
|
|
857
|
-
readonly on: ReadonlyArray<string>;
|
|
858
|
-
readonly unique?: boolean;
|
|
859
|
-
}
|
|
860
|
-
interface CollectionDefinition {
|
|
861
|
-
readonly name: string;
|
|
862
|
-
readonly fields: Readonly<Record<string, CollectionFieldDefinition>>;
|
|
863
|
-
readonly indexes: ReadonlyArray<CollectionIndexDefinition>;
|
|
864
|
-
}
|
|
865
|
-
interface DefinedCollection<TDefinition extends CollectionDefinition = CollectionDefinition> {
|
|
866
|
-
readonly kind: "defined-collection";
|
|
867
|
-
readonly definition: TDefinition;
|
|
868
|
-
register(context: {
|
|
869
|
-
registerCollection(d: CollectionDefinition): void;
|
|
870
|
-
}): void;
|
|
871
|
-
}
|
|
872
|
-
//#endregion
|
|
873
|
-
export { TypeToken as a, WorkflowDefinition as c, CredentialAuthDefinition as d, CredentialFieldSchema as f, CredentialTypeId as g, CredentialSessionFactory as h, Container as i, AnyCredentialType as l, CredentialMaterialSourceKind as m, DefinedCollection as n, EngineExecutionLimitsPolicyConfig as o, CredentialHealthTester as p, DefinedNode as r, McpServerDeclaration as s, CollectionDefinition as t, CredentialAdvancedSectionPresentation as u };
|
|
874
|
-
//# sourceMappingURL=index-OvXJkNm1.d.ts.map
|