@codemation/core 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/{EngineRuntimeRegistration.types-Bjeo7Sfq.d.ts → EngineRuntimeRegistration.types-BtTZolK0.d.ts} +2 -2
- package/dist/{EngineWorkflowRunnerService-Dd4yD31l.d.cts → EngineWorkflowRunnerService-Ddl0fekp.d.cts} +2 -2
- package/dist/{InMemoryRunDataFactory-OUzDmAHt.d.cts → InMemoryRunDataFactory-i-u2yngD.d.cts} +11 -3
- package/dist/{RunIntentService-Bkg4oYrM.d.cts → RunIntentService-Cjx-glgz.d.cts} +232 -237
- package/dist/{RunIntentService-BAKikN8h.d.ts → RunIntentService-Dkr4YwN8.d.ts} +313 -259
- package/dist/bootstrap/index.cjs +2 -2
- package/dist/bootstrap/index.d.cts +19 -7
- package/dist/bootstrap/index.d.ts +3 -3
- package/dist/bootstrap/index.js +2 -2
- package/dist/{bootstrap-DwS5S7s9.cjs → bootstrap-DHH2uo-W.cjs} +4 -2
- package/dist/bootstrap-DHH2uo-W.cjs.map +1 -0
- package/dist/{bootstrap-BD6CobHl.js → bootstrap-DbUlOl11.js} +4 -2
- package/dist/bootstrap-DbUlOl11.js.map +1 -0
- package/dist/{index-uCm9l0nw.d.ts → index-B2v4wtys.d.ts} +62 -34
- package/dist/index.cjs +22 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +108 -42
- package/dist/index.d.ts +3 -3
- package/dist/index.js +13 -16
- package/dist/index.js.map +1 -1
- package/dist/{runtime-Cy-3FTI_.js → runtime-BdH94eBR.js} +502 -123
- package/dist/runtime-BdH94eBR.js.map +1 -0
- package/dist/{runtime-ZJUpWmPH.cjs → runtime-feFn8OmG.cjs} +561 -122
- package/dist/runtime-feFn8OmG.cjs.map +1 -0
- package/dist/testing.cjs +40 -36
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +17 -26
- package/dist/testing.d.ts +17 -26
- package/dist/testing.js +40 -36
- package/dist/testing.js.map +1 -1
- package/dist/{workflowActivationPolicy-BzyzXLa_.cjs → workflowActivationPolicy-6V3OJD3N.cjs} +65 -19
- package/dist/workflowActivationPolicy-6V3OJD3N.cjs.map +1 -0
- package/dist/{workflowActivationPolicy-B8HzTk3o.js → workflowActivationPolicy-Td9HTOuD.js} +65 -19
- package/dist/workflowActivationPolicy-Td9HTOuD.js.map +1 -0
- package/package.json +2 -1
- package/src/ai/AgentConfigInspectorFactory.ts +4 -0
- package/src/ai/AgentMessageConfigNormalizerFactory.ts +7 -0
- package/src/ai/AgentToolFactory.ts +2 -2
- package/src/ai/AiHost.ts +11 -10
- package/src/ai/NodeBackedToolConfig.ts +1 -1
- package/src/authoring/defineNode.types.ts +48 -72
- package/src/authoring/index.ts +1 -1
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +8 -0
- package/src/contracts/credentialTypes.ts +9 -0
- package/src/contracts/emitPorts.ts +27 -0
- package/src/contracts/index.ts +3 -0
- package/src/contracts/itemMeta.ts +11 -0
- package/src/contracts/itemValue.ts +147 -0
- package/src/contracts/runtimeTypes.ts +39 -22
- package/src/contracts/workflowTypes.ts +26 -56
- package/src/execution/FanInMergeByOriginMerger.ts +67 -0
- package/src/execution/ItemValueResolver.ts +27 -0
- package/src/execution/NodeActivationRequestComposer.ts +25 -0
- package/src/execution/NodeActivationRequestInputPreparer.ts +57 -25
- package/src/execution/NodeExecutor.ts +199 -30
- package/src/execution/NodeOutputNormalizer.ts +90 -0
- package/src/execution/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/orchestration/NodeExecutionRequestHandlerService.ts +39 -18
- package/src/orchestration/RunContinuationService.ts +11 -17
- package/src/planning/CurrentStateFrontierPlanner.ts +20 -20
- package/src/planning/RunQueuePlanner.ts +56 -19
- package/src/planning/WorkflowTopologyPlanner.ts +57 -33
- package/src/testing/ItemHarnessNode.ts +4 -10
- package/src/testing/ItemHarnessNodeConfig.ts +7 -16
- package/src/testing/RegistrarEngineTestKitFactory.ts +2 -0
- package/src/testing/SubWorkflowRunnerTestNode.ts +28 -43
- package/src/testing/SwitchHarnessNode.ts +54 -0
- package/src/types/index.ts +3 -0
- package/src/workflow/dsl/ChainCursorResolver.ts +68 -23
- package/src/workflow/dsl/WorkflowBuilder.ts +3 -5
- package/src/workflow/dsl/workflowBuilderTypes.ts +5 -8
- package/src/workflowSnapshots/MissingRuntimeNode.ts +4 -4
- package/src/workflowSnapshots/MissingRuntimeNodeConfig.ts +2 -2
- package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +16 -7
- package/dist/bootstrap-BD6CobHl.js.map +0 -1
- package/dist/bootstrap-DwS5S7s9.cjs.map +0 -1
- package/dist/runtime-Cy-3FTI_.js.map +0 -1
- package/dist/runtime-ZJUpWmPH.cjs.map +0 -1
- package/dist/workflowActivationPolicy-B8HzTk3o.js.map +0 -1
- package/dist/workflowActivationPolicy-BzyzXLa_.cjs.map +0 -1
|
@@ -3,62 +3,6 @@ import { DependencyContainer as Container, DependencyContainer as DependencyCont
|
|
|
3
3
|
import { ZodType } from "zod";
|
|
4
4
|
import { ReadableStream } from "node:stream/web";
|
|
5
5
|
|
|
6
|
-
//#region src/contracts/retryPolicySpec.types.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* In-process retry policy for runnable nodes. Serialized configs use the same
|
|
9
|
-
* `kind` discriminator (`JSON.stringify` / persisted workflows).
|
|
10
|
-
*
|
|
11
|
-
* `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
|
|
12
|
-
*/
|
|
13
|
-
type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
|
|
14
|
-
interface NoneRetryPolicySpec {
|
|
15
|
-
readonly kind: "none";
|
|
16
|
-
}
|
|
17
|
-
interface FixedRetryPolicySpec {
|
|
18
|
-
readonly kind: "fixed";
|
|
19
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
20
|
-
readonly maxAttempts: number;
|
|
21
|
-
readonly delayMs: number;
|
|
22
|
-
}
|
|
23
|
-
interface ExponentialRetryPolicySpec {
|
|
24
|
-
readonly kind: "exponential";
|
|
25
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
26
|
-
readonly maxAttempts: number;
|
|
27
|
-
readonly initialDelayMs: number;
|
|
28
|
-
readonly multiplier: number;
|
|
29
|
-
readonly maxDelayMs?: number;
|
|
30
|
-
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
31
|
-
readonly jitter?: boolean;
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/contracts/NoRetryPolicy.d.ts
|
|
35
|
-
declare class NoRetryPolicy implements NoneRetryPolicySpec {
|
|
36
|
-
readonly kind: "none";
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/contracts/RetryPolicy.d.ts
|
|
40
|
-
declare class RetryPolicy implements FixedRetryPolicySpec {
|
|
41
|
-
readonly maxAttempts: number;
|
|
42
|
-
readonly delayMs: number;
|
|
43
|
-
readonly kind: "fixed";
|
|
44
|
-
constructor(maxAttempts: number, delayMs: number);
|
|
45
|
-
/** Default for HTTP-style transient failures: 3 tries, 1s between attempts. */
|
|
46
|
-
static readonly defaultForHttp: FixedRetryPolicySpec;
|
|
47
|
-
/** Default for LLM / agent calls: 3 tries, 2s fixed backoff. */
|
|
48
|
-
static readonly defaultForAiAgent: FixedRetryPolicySpec;
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/contracts/ExpRetryPolicy.d.ts
|
|
52
|
-
declare class ExpRetryPolicy implements ExponentialRetryPolicySpec {
|
|
53
|
-
readonly maxAttempts: number;
|
|
54
|
-
readonly initialDelayMs: number;
|
|
55
|
-
readonly multiplier: number;
|
|
56
|
-
readonly maxDelayMs?: number | undefined;
|
|
57
|
-
readonly jitter?: boolean | undefined;
|
|
58
|
-
readonly kind: "exponential";
|
|
59
|
-
constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined);
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
62
6
|
//#region src/events/runEvents.d.ts
|
|
63
7
|
type RunEvent = Readonly<{
|
|
64
8
|
kind: "runCreated";
|
|
@@ -160,6 +104,157 @@ declare const CoreTokens: {
|
|
|
160
104
|
readonly WorkflowActivationPolicy: TypeToken<WorkflowActivationPolicy>;
|
|
161
105
|
};
|
|
162
106
|
//#endregion
|
|
107
|
+
//#region src/contracts/credentialTypes.d.ts
|
|
108
|
+
type CredentialTypeId = string;
|
|
109
|
+
type CredentialInstanceId = string;
|
|
110
|
+
type CredentialMaterialSourceKind = "db" | "env" | "code";
|
|
111
|
+
type CredentialSetupStatus = "draft" | "ready";
|
|
112
|
+
type CredentialHealthStatus = "unknown" | "healthy" | "failing";
|
|
113
|
+
type CredentialFieldSchema = Readonly<{
|
|
114
|
+
key: string;
|
|
115
|
+
label: string;
|
|
116
|
+
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
117
|
+
required?: true;
|
|
118
|
+
order?: number;
|
|
119
|
+
placeholder?: string;
|
|
120
|
+
helpText?: string;
|
|
121
|
+
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
122
|
+
envVarName?: string;
|
|
123
|
+
/**
|
|
124
|
+
* When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
|
|
125
|
+
* pattern or documentation URL). Do not use for secret values.
|
|
126
|
+
*/
|
|
127
|
+
copyValue?: string;
|
|
128
|
+
/** Accessible label for the copy control (default: Copy). */
|
|
129
|
+
copyButtonLabel?: string;
|
|
130
|
+
}>;
|
|
131
|
+
type CredentialRequirement = Readonly<{
|
|
132
|
+
slotKey: string;
|
|
133
|
+
label: string;
|
|
134
|
+
acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
135
|
+
optional?: true;
|
|
136
|
+
helpText?: string;
|
|
137
|
+
helpUrl?: string;
|
|
138
|
+
}>;
|
|
139
|
+
type CredentialBindingKey = Readonly<{
|
|
140
|
+
workflowId: WorkflowId;
|
|
141
|
+
nodeId: NodeId;
|
|
142
|
+
slotKey: string;
|
|
143
|
+
}>;
|
|
144
|
+
type CredentialBinding = Readonly<{
|
|
145
|
+
key: CredentialBindingKey;
|
|
146
|
+
instanceId: CredentialInstanceId;
|
|
147
|
+
updatedAt: string;
|
|
148
|
+
}>;
|
|
149
|
+
type CredentialHealth = Readonly<{
|
|
150
|
+
status: CredentialHealthStatus;
|
|
151
|
+
message?: string;
|
|
152
|
+
testedAt?: string;
|
|
153
|
+
expiresAt?: string;
|
|
154
|
+
details?: Readonly<Record<string, unknown>>;
|
|
155
|
+
}>;
|
|
156
|
+
type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
157
|
+
authorizeUrlFieldKey: string;
|
|
158
|
+
tokenUrlFieldKey: string;
|
|
159
|
+
userInfoUrlFieldKey?: string;
|
|
160
|
+
}>;
|
|
161
|
+
type CredentialOAuth2ScopesFromPublicConfig = Readonly<{
|
|
162
|
+
presetFieldKey: string;
|
|
163
|
+
presetScopes: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
164
|
+
customPresetKey?: string;
|
|
165
|
+
customScopesFieldKey?: string;
|
|
166
|
+
}>;
|
|
167
|
+
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
168
|
+
kind: "oauth2";
|
|
169
|
+
providerId: string;
|
|
170
|
+
scopes: ReadonlyArray<string>;
|
|
171
|
+
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
172
|
+
clientIdFieldKey?: string;
|
|
173
|
+
clientSecretFieldKey?: string;
|
|
174
|
+
} | {
|
|
175
|
+
kind: "oauth2";
|
|
176
|
+
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
177
|
+
scopes: ReadonlyArray<string>;
|
|
178
|
+
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
179
|
+
clientIdFieldKey?: string;
|
|
180
|
+
clientSecretFieldKey?: string;
|
|
181
|
+
}>;
|
|
182
|
+
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
183
|
+
type CredentialTypeDefinition = Readonly<{
|
|
184
|
+
typeId: CredentialTypeId;
|
|
185
|
+
displayName: string;
|
|
186
|
+
description?: string;
|
|
187
|
+
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
188
|
+
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
189
|
+
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
190
|
+
auth?: CredentialAuthDefinition;
|
|
191
|
+
}>;
|
|
192
|
+
/**
|
|
193
|
+
* JSON-shaped credential field bag (public config, resolved secret material, etc.).
|
|
194
|
+
*/
|
|
195
|
+
type CredentialJsonRecord = Readonly<Record<string, unknown>>;
|
|
196
|
+
/**
|
|
197
|
+
* Persisted credential instance with typed `publicConfig`.
|
|
198
|
+
* Hosts may specialize `secretRef` with a stricter union while remaining
|
|
199
|
+
* assignable here for session/test callbacks.
|
|
200
|
+
*/
|
|
201
|
+
type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
202
|
+
instanceId: CredentialInstanceId;
|
|
203
|
+
typeId: CredentialTypeId;
|
|
204
|
+
displayName: string;
|
|
205
|
+
sourceKind: CredentialMaterialSourceKind;
|
|
206
|
+
publicConfig: TPublicConfig;
|
|
207
|
+
secretRef: CredentialJsonRecord;
|
|
208
|
+
tags: ReadonlyArray<string>;
|
|
209
|
+
setupStatus: CredentialSetupStatus;
|
|
210
|
+
createdAt: string;
|
|
211
|
+
updatedAt: string;
|
|
212
|
+
}>;
|
|
213
|
+
/**
|
|
214
|
+
* Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
|
|
215
|
+
* Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
|
|
216
|
+
* against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
|
|
217
|
+
*/
|
|
218
|
+
type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
219
|
+
instance: CredentialInstanceRecord<TPublicConfig>;
|
|
220
|
+
material: TMaterial;
|
|
221
|
+
publicConfig: TPublicConfig;
|
|
222
|
+
}>;
|
|
223
|
+
type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
|
|
224
|
+
type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
|
|
225
|
+
/**
|
|
226
|
+
* Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
|
|
227
|
+
* Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
|
|
228
|
+
*/
|
|
229
|
+
type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
|
|
230
|
+
definition: CredentialTypeDefinition;
|
|
231
|
+
createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
|
|
232
|
+
test: CredentialHealthTester<TPublicConfig, TMaterial>;
|
|
233
|
+
}>;
|
|
234
|
+
/**
|
|
235
|
+
* Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
|
|
236
|
+
* and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
|
|
237
|
+
* Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
|
|
238
|
+
*/
|
|
239
|
+
type AnyCredentialType = CredentialType<any, any, unknown>;
|
|
240
|
+
interface CredentialSessionService {
|
|
241
|
+
getSession<TSession = unknown>(args: Readonly<{
|
|
242
|
+
workflowId: WorkflowId;
|
|
243
|
+
nodeId: NodeId;
|
|
244
|
+
slotKey: string;
|
|
245
|
+
}>): Promise<TSession>;
|
|
246
|
+
}
|
|
247
|
+
interface CredentialTypeRegistry {
|
|
248
|
+
listTypes(): ReadonlyArray<CredentialTypeDefinition>;
|
|
249
|
+
getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
|
|
250
|
+
}
|
|
251
|
+
declare class CredentialUnboundError extends Error {
|
|
252
|
+
readonly bindingKey: CredentialBindingKey;
|
|
253
|
+
readonly acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
254
|
+
constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray<CredentialTypeId>);
|
|
255
|
+
private static createMessage;
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
163
258
|
//#region src/contracts/runTypes.d.ts
|
|
164
259
|
interface RunExecutionOptions {
|
|
165
260
|
/** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
|
|
@@ -679,31 +774,41 @@ interface EngineHost {
|
|
|
679
774
|
credentialSessions: CredentialSessionService;
|
|
680
775
|
workflows?: WorkflowRunnerService;
|
|
681
776
|
}
|
|
682
|
-
interface Node<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
683
|
-
kind: "node";
|
|
684
|
-
outputPorts: ReadonlyArray<OutputPortKey>;
|
|
685
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
686
|
-
}
|
|
687
777
|
/**
|
|
688
|
-
*
|
|
689
|
-
* Engine applies
|
|
778
|
+
* Per-item runnable node: return JSON, an array to fan-out on `main`, or {@link emitPorts} for multi-port emission.
|
|
779
|
+
* Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input` (wire `item.json` is unchanged).
|
|
690
780
|
*/
|
|
691
|
-
interface
|
|
781
|
+
interface RunnableNodeExecuteArgs<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown> {
|
|
782
|
+
readonly input: TInputJson$1;
|
|
783
|
+
readonly item: Item;
|
|
784
|
+
readonly itemIndex: number;
|
|
785
|
+
readonly items: Items;
|
|
786
|
+
readonly ctx: NodeExecutionContext<TConfig>;
|
|
787
|
+
}
|
|
788
|
+
interface RunnableNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, _TOutputJson = unknown> {
|
|
692
789
|
readonly kind: "node";
|
|
693
|
-
|
|
790
|
+
/**
|
|
791
|
+
* Declared output ports (e.g. `["main"]`).
|
|
792
|
+
*
|
|
793
|
+
* Prefer describing dynamic router ports (Switch) and fixed multi-ports (If true/false)
|
|
794
|
+
* via {@link NodeConfigBase.declaredOutputPorts}. Engine defaults to `["main"]` when omitted.
|
|
795
|
+
*/
|
|
796
|
+
readonly outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
694
797
|
/** When omitted, engine uses {@link RunnableNodeConfig.inputSchema} or `z.unknown()`. */
|
|
695
798
|
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
696
|
-
|
|
697
|
-
input: TInputJson$1;
|
|
698
|
-
item: Item;
|
|
699
|
-
itemIndex: number;
|
|
700
|
-
items: Items;
|
|
701
|
-
ctx: NodeExecutionContext<TConfig>;
|
|
702
|
-
}>): Promise<TOutputJson$1> | TOutputJson$1;
|
|
799
|
+
execute(args: RunnableNodeExecuteArgs<TConfig, TInputJson$1>): Promise<unknown> | unknown;
|
|
703
800
|
}
|
|
801
|
+
/** @deprecated Use {@link RunnableNode} */
|
|
802
|
+
type ItemNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, TOutputJson$1 = unknown> = RunnableNode<TConfig, TInputJson$1, TOutputJson$1>;
|
|
704
803
|
interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
705
804
|
kind: "node";
|
|
706
|
-
|
|
805
|
+
/**
|
|
806
|
+
* Declared output ports (typically `["main"]`).
|
|
807
|
+
*
|
|
808
|
+
* Prefer describing ports for authoring/canvas via {@link NodeConfigBase.declaredOutputPorts}.
|
|
809
|
+
* Engine defaults to `["main"]` when omitted.
|
|
810
|
+
*/
|
|
811
|
+
outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
707
812
|
executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
708
813
|
}
|
|
709
814
|
type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;
|
|
@@ -833,6 +938,34 @@ interface EngineDeps {
|
|
|
833
938
|
triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics;
|
|
834
939
|
}
|
|
835
940
|
//#endregion
|
|
941
|
+
//#region src/contracts/retryPolicySpec.types.d.ts
|
|
942
|
+
/**
|
|
943
|
+
* In-process retry policy for runnable nodes. Serialized configs use the same
|
|
944
|
+
* `kind` discriminator (`JSON.stringify` / persisted workflows).
|
|
945
|
+
*
|
|
946
|
+
* `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
|
|
947
|
+
*/
|
|
948
|
+
type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
|
|
949
|
+
interface NoneRetryPolicySpec {
|
|
950
|
+
readonly kind: "none";
|
|
951
|
+
}
|
|
952
|
+
interface FixedRetryPolicySpec {
|
|
953
|
+
readonly kind: "fixed";
|
|
954
|
+
/** Total attempts including the first execution. Must be >= 1. */
|
|
955
|
+
readonly maxAttempts: number;
|
|
956
|
+
readonly delayMs: number;
|
|
957
|
+
}
|
|
958
|
+
interface ExponentialRetryPolicySpec {
|
|
959
|
+
readonly kind: "exponential";
|
|
960
|
+
/** Total attempts including the first execution. Must be >= 1. */
|
|
961
|
+
readonly maxAttempts: number;
|
|
962
|
+
readonly initialDelayMs: number;
|
|
963
|
+
readonly multiplier: number;
|
|
964
|
+
readonly maxDelayMs?: number;
|
|
965
|
+
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
966
|
+
readonly jitter?: boolean;
|
|
967
|
+
}
|
|
968
|
+
//#endregion
|
|
836
969
|
//#region src/contracts/workflowTypes.d.ts
|
|
837
970
|
type WorkflowId = string;
|
|
838
971
|
type NodeId = string;
|
|
@@ -846,6 +979,8 @@ interface JsonObject {
|
|
|
846
979
|
}
|
|
847
980
|
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
848
981
|
type JsonArray = ReadonlyArray<JsonValue>;
|
|
982
|
+
/** JSON value that is not a top-level array (nested arrays inside objects are allowed). */
|
|
983
|
+
type JsonNonArray = JsonPrimitive | JsonObject;
|
|
849
984
|
interface Edge {
|
|
850
985
|
from: {
|
|
851
986
|
nodeId: NodeId;
|
|
@@ -915,65 +1050,42 @@ interface NodeConfigBase {
|
|
|
915
1050
|
* main batches skip downstream execution and propagate the empty path.
|
|
916
1051
|
*/
|
|
917
1052
|
readonly continueWhenEmptyOutput?: boolean;
|
|
1053
|
+
/**
|
|
1054
|
+
* Declared I/O port names for canvas authoring (unioned with ports inferred from edges).
|
|
1055
|
+
* Use for dynamic routers (Switch) and future error ports.
|
|
1056
|
+
*/
|
|
1057
|
+
readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
|
|
1058
|
+
readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
|
|
918
1059
|
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
919
1060
|
}
|
|
920
1061
|
declare const runnableNodeInputType: unique symbol;
|
|
921
1062
|
declare const runnableNodeOutputType: unique symbol;
|
|
922
|
-
/** Phantom: JSON shape on the wire from upstream before {@link RunnableNodeConfig.mapInput}. */
|
|
923
|
-
declare const runnableNodeWireType: unique symbol;
|
|
924
1063
|
declare const triggerNodeOutputType: unique symbol;
|
|
1064
|
+
type LineageCarryPolicy = "emitOnly" | "carryThrough";
|
|
925
1065
|
/**
|
|
926
|
-
*
|
|
927
|
-
*
|
|
928
|
-
* node’s outputs in this run (e.g. `ctx.data.getOutputItems(nodeIdA, "main")` while mapping at D), not only
|
|
929
|
-
* the immediate predecessor’s {@link ItemInputMapperArgs.item}.
|
|
930
|
-
*/
|
|
931
|
-
interface ItemInputMapperContext {
|
|
932
|
-
readonly runId: RunId;
|
|
933
|
-
readonly workflowId: WorkflowId;
|
|
934
|
-
/** Node whose activation is being prepared (the consumer of `mapInput`). */
|
|
935
|
-
readonly nodeId: NodeId;
|
|
936
|
-
readonly activationId: NodeActivationId;
|
|
937
|
-
readonly parent?: ParentExecutionRef;
|
|
938
|
-
readonly data: RunDataSnapshot;
|
|
939
|
-
}
|
|
940
|
-
/**
|
|
941
|
-
* Arguments for optional per-item input mapping applied by the engine before Zod validation.
|
|
1066
|
+
* Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).
|
|
1067
|
+
* **`TOutputJson`** is emitted `item.json` on outputs.
|
|
942
1068
|
*/
|
|
943
|
-
interface
|
|
944
|
-
readonly item: Item<TWireJson$1>;
|
|
945
|
-
readonly itemIndex: number;
|
|
946
|
-
readonly items: Items<TWireJson$1>;
|
|
947
|
-
readonly ctx: ItemInputMapperContext;
|
|
948
|
-
}
|
|
949
|
-
/**
|
|
950
|
-
* Per-item mapper before Zod validation. Uses a **bivariant** method signature so concrete
|
|
951
|
-
* `ItemInputMapper<SpecificWire, TIn>` remains assignable to `RunnableNodeConfig` fields typed as
|
|
952
|
-
* `ItemInputMapper<unknown, unknown>` (same pattern as React-style callbacks).
|
|
953
|
-
*/
|
|
954
|
-
type ItemInputMapper<TWireJson$1 = unknown, TInputJson$1 = unknown> = {
|
|
955
|
-
bivarianceHack(args: ItemInputMapperArgs<TWireJson$1>): TInputJson$1 | Promise<TInputJson$1>;
|
|
956
|
-
}["bivarianceHack"];
|
|
957
|
-
/**
|
|
958
|
-
* Runnable node: **`TInputJson`** is the payload after `mapInput` (if any) + Zod validation — what {@link ItemNode}
|
|
959
|
-
* `executeOne` receives. **`TOutputJson`** is emitted `item.json` on outputs. **`TWireJson`** is `item.json` from
|
|
960
|
-
* upstream **before** `mapInput`; it defaults to **`TInputJson`** when there is no mapper or wire differs from execute input.
|
|
961
|
-
*/
|
|
962
|
-
interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown, TWireJson$1 = TInputJson$1> extends NodeConfigBase {
|
|
1069
|
+
interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
|
|
963
1070
|
readonly kind: "node";
|
|
964
1071
|
readonly [runnableNodeInputType]?: TInputJson$1;
|
|
965
1072
|
readonly [runnableNodeOutputType]?: TOutputJson$1;
|
|
966
|
-
readonly [runnableNodeWireType]?: TWireJson$1;
|
|
967
1073
|
/**
|
|
968
|
-
* Optional Zod input contract for {@link
|
|
1074
|
+
* Optional Zod input contract for {@link RunnableNode} when not set on the node class.
|
|
969
1075
|
* Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
|
|
970
1076
|
*/
|
|
971
1077
|
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
972
1078
|
/**
|
|
973
|
-
*
|
|
974
|
-
*
|
|
1079
|
+
* Overrides default lineage propagation for `execute` outputs (binary/meta/paired).
|
|
1080
|
+
* Routers with multiple {@link RunnableNode#outputPorts} default to **`carryThrough`**; others default to **`emitOnly`**.
|
|
975
1081
|
*/
|
|
976
|
-
readonly
|
|
1082
|
+
readonly lineageCarry?: LineageCarryPolicy;
|
|
1083
|
+
/**
|
|
1084
|
+
* When an activation receives **zero** input items, the engine normally runs `execute` zero times.
|
|
1085
|
+
* Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).
|
|
1086
|
+
* Used by batch-style callback nodes (built-in `Callback`) so `callback([], ctx)` still runs.
|
|
1087
|
+
*/
|
|
1088
|
+
readonly emptyBatchExecution?: "skip" | "runOnce";
|
|
977
1089
|
}
|
|
978
1090
|
declare const triggerNodeSetupStateType: unique symbol;
|
|
979
1091
|
interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonValue | undefined = undefined> extends NodeConfigBase {
|
|
@@ -981,9 +1093,8 @@ interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonV
|
|
|
981
1093
|
readonly [triggerNodeOutputType]?: TOutputJson$1;
|
|
982
1094
|
readonly [triggerNodeSetupStateType]?: TSetupState$1;
|
|
983
1095
|
}
|
|
984
|
-
type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any
|
|
985
|
-
type
|
|
986
|
-
type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson, any> ? TOutputJson : never;
|
|
1096
|
+
type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
|
|
1097
|
+
type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;
|
|
987
1098
|
type TriggerNodeOutputJson<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<infer TOutputJson, any> ? TOutputJson : never;
|
|
988
1099
|
type TriggerNodeSetupState<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<any, infer TSetupState> ? TSetupState : never;
|
|
989
1100
|
interface NodeDefinition {
|
|
@@ -1127,147 +1238,85 @@ interface WorkflowPolicyRuntimeDefaults {
|
|
|
1127
1238
|
readonly storagePolicy?: WorkflowStoragePolicyMode;
|
|
1128
1239
|
}
|
|
1129
1240
|
//#endregion
|
|
1130
|
-
//#region src/contracts/
|
|
1131
|
-
|
|
1132
|
-
type
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
type CredentialHealthStatus = "unknown" | "healthy" | "failing";
|
|
1136
|
-
type CredentialFieldSchema = Readonly<{
|
|
1137
|
-
key: string;
|
|
1138
|
-
label: string;
|
|
1139
|
-
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
1140
|
-
required?: true;
|
|
1141
|
-
order?: number;
|
|
1142
|
-
placeholder?: string;
|
|
1143
|
-
helpText?: string;
|
|
1144
|
-
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
1145
|
-
envVarName?: string;
|
|
1146
|
-
/**
|
|
1147
|
-
* When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
|
|
1148
|
-
* pattern or documentation URL). Do not use for secret values.
|
|
1149
|
-
*/
|
|
1150
|
-
copyValue?: string;
|
|
1151
|
-
/** Accessible label for the copy control (default: Copy). */
|
|
1152
|
-
copyButtonLabel?: string;
|
|
1241
|
+
//#region src/contracts/emitPorts.d.ts
|
|
1242
|
+
declare const EMIT_PORTS_BRAND: unique symbol;
|
|
1243
|
+
type PortsEmission = Readonly<{
|
|
1244
|
+
readonly [EMIT_PORTS_BRAND]: true;
|
|
1245
|
+
readonly ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>;
|
|
1153
1246
|
}>;
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
optional?: true;
|
|
1159
|
-
helpText?: string;
|
|
1160
|
-
helpUrl?: string;
|
|
1247
|
+
declare function emitPorts(ports: Readonly<Partial<Record<OutputPortKey, Items | ReadonlyArray<JsonNonArray>>>>): PortsEmission;
|
|
1248
|
+
declare function isPortsEmission(value: unknown): value is PortsEmission;
|
|
1249
|
+
declare function isUnbrandedPortsEmissionShape(value: unknown): value is Readonly<{
|
|
1250
|
+
ports: unknown;
|
|
1161
1251
|
}>;
|
|
1162
|
-
|
|
1252
|
+
//#endregion
|
|
1253
|
+
//#region src/contracts/itemMeta.d.ts
|
|
1254
|
+
/**
|
|
1255
|
+
* Reads `meta._cm.originIndex` when present (used for fan-in merge-by-origin and Merge routing).
|
|
1256
|
+
*/
|
|
1257
|
+
declare function getOriginIndexFromItem(item: Item): number | undefined;
|
|
1258
|
+
//#endregion
|
|
1259
|
+
//#region src/contracts/itemValue.d.ts
|
|
1260
|
+
declare const ITEM_VALUE_BRAND: unique symbol;
|
|
1261
|
+
type ItemValueResolvedContext = Readonly<{
|
|
1262
|
+
runId: RunId;
|
|
1163
1263
|
workflowId: WorkflowId;
|
|
1164
1264
|
nodeId: NodeId;
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
type CredentialBinding = Readonly<{
|
|
1168
|
-
key: CredentialBindingKey;
|
|
1169
|
-
instanceId: CredentialInstanceId;
|
|
1170
|
-
updatedAt: string;
|
|
1171
|
-
}>;
|
|
1172
|
-
type CredentialHealth = Readonly<{
|
|
1173
|
-
status: CredentialHealthStatus;
|
|
1174
|
-
message?: string;
|
|
1175
|
-
testedAt?: string;
|
|
1176
|
-
expiresAt?: string;
|
|
1177
|
-
details?: Readonly<Record<string, unknown>>;
|
|
1178
|
-
}>;
|
|
1179
|
-
type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
1180
|
-
authorizeUrlFieldKey: string;
|
|
1181
|
-
tokenUrlFieldKey: string;
|
|
1182
|
-
userInfoUrlFieldKey?: string;
|
|
1183
|
-
}>;
|
|
1184
|
-
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
1185
|
-
kind: "oauth2";
|
|
1186
|
-
providerId: string;
|
|
1187
|
-
scopes: ReadonlyArray<string>;
|
|
1188
|
-
clientIdFieldKey?: string;
|
|
1189
|
-
clientSecretFieldKey?: string;
|
|
1190
|
-
} | {
|
|
1191
|
-
kind: "oauth2";
|
|
1192
|
-
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
1193
|
-
scopes: ReadonlyArray<string>;
|
|
1194
|
-
clientIdFieldKey?: string;
|
|
1195
|
-
clientSecretFieldKey?: string;
|
|
1196
|
-
}>;
|
|
1197
|
-
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
1198
|
-
type CredentialTypeDefinition = Readonly<{
|
|
1199
|
-
typeId: CredentialTypeId;
|
|
1200
|
-
displayName: string;
|
|
1201
|
-
description?: string;
|
|
1202
|
-
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1203
|
-
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1204
|
-
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
1205
|
-
auth?: CredentialAuthDefinition;
|
|
1265
|
+
activationId: NodeActivationId;
|
|
1266
|
+
data: RunDataSnapshot;
|
|
1206
1267
|
}>;
|
|
1207
1268
|
/**
|
|
1208
|
-
*
|
|
1209
|
-
*/
|
|
1210
|
-
type CredentialJsonRecord = Readonly<Record<string, unknown>>;
|
|
1211
|
-
/**
|
|
1212
|
-
* Persisted credential instance with typed `publicConfig`.
|
|
1213
|
-
* Hosts may specialize `secretRef` with a stricter union while remaining
|
|
1214
|
-
* assignable here for session/test callbacks.
|
|
1269
|
+
* Context aligned with former {@link ItemInputMapperContext} — use **`data`** to read any completed upstream node.
|
|
1215
1270
|
*/
|
|
1216
|
-
type
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
secretRef: CredentialJsonRecord;
|
|
1223
|
-
tags: ReadonlyArray<string>;
|
|
1224
|
-
setupStatus: CredentialSetupStatus;
|
|
1225
|
-
createdAt: string;
|
|
1226
|
-
updatedAt: string;
|
|
1271
|
+
type ItemValueContext = ItemValueResolvedContext;
|
|
1272
|
+
type ItemValueArgs<TItemJson = unknown> = Readonly<{
|
|
1273
|
+
item: Item<TItemJson>;
|
|
1274
|
+
itemIndex: number;
|
|
1275
|
+
items: Items<TItemJson>;
|
|
1276
|
+
ctx: ItemValueContext;
|
|
1227
1277
|
}>;
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
*/
|
|
1233
|
-
type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
1234
|
-
instance: CredentialInstanceRecord<TPublicConfig>;
|
|
1235
|
-
material: TMaterial;
|
|
1236
|
-
publicConfig: TPublicConfig;
|
|
1278
|
+
type ItemValueCallback<T, TItemJson = unknown> = (args: ItemValueArgs<TItemJson>) => T | Promise<T>;
|
|
1279
|
+
type ItemValue<T, TItemJson = unknown> = Readonly<{
|
|
1280
|
+
readonly [ITEM_VALUE_BRAND]: true;
|
|
1281
|
+
readonly fn: ItemValueCallback<T, TItemJson>;
|
|
1237
1282
|
}>;
|
|
1238
|
-
|
|
1239
|
-
|
|
1283
|
+
declare function itemValue<T, TItemJson = unknown>(fn: ItemValueCallback<T, TItemJson>): ItemValue<T, TItemJson>;
|
|
1284
|
+
declare function isItemValue<T, TItemJson = unknown>(value: unknown): value is ItemValue<T, TItemJson>;
|
|
1240
1285
|
/**
|
|
1241
|
-
*
|
|
1242
|
-
* Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
|
|
1286
|
+
* Deep-resolves {@link itemValue} leaves. Returns a new graph (does not mutate the original config object).
|
|
1243
1287
|
*/
|
|
1244
|
-
|
|
1245
|
-
definition: CredentialTypeDefinition;
|
|
1246
|
-
createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
|
|
1247
|
-
test: CredentialHealthTester<TPublicConfig, TMaterial>;
|
|
1248
|
-
}>;
|
|
1288
|
+
declare function resolveItemValuesInUnknown(value: unknown, args: ItemValueArgs, seen?: WeakSet<object>): Promise<unknown>;
|
|
1249
1289
|
/**
|
|
1250
|
-
*
|
|
1251
|
-
* and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
|
|
1252
|
-
* Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
|
|
1290
|
+
* Clones runnable config (best-effort) so per-item {@link itemValue} resolution never mutates shared instances.
|
|
1253
1291
|
*/
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
slotKey: string;
|
|
1260
|
-
}>): Promise<TSession>;
|
|
1292
|
+
declare function resolveItemValuesForExecution(config: unknown, nodeCtx: NodeExecutionContext, item: Item, itemIndex: number, items: Items): Promise<unknown | undefined>;
|
|
1293
|
+
//#endregion
|
|
1294
|
+
//#region src/contracts/NoRetryPolicy.d.ts
|
|
1295
|
+
declare class NoRetryPolicy implements NoneRetryPolicySpec {
|
|
1296
|
+
readonly kind: "none";
|
|
1261
1297
|
}
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1298
|
+
//#endregion
|
|
1299
|
+
//#region src/contracts/RetryPolicy.d.ts
|
|
1300
|
+
declare class RetryPolicy implements FixedRetryPolicySpec {
|
|
1301
|
+
readonly maxAttempts: number;
|
|
1302
|
+
readonly delayMs: number;
|
|
1303
|
+
readonly kind: "fixed";
|
|
1304
|
+
constructor(maxAttempts: number, delayMs: number);
|
|
1305
|
+
/** Default for HTTP-style transient failures: 3 tries, 1s between attempts. */
|
|
1306
|
+
static readonly defaultForHttp: FixedRetryPolicySpec;
|
|
1307
|
+
/** Default for LLM / agent calls: 3 tries, 2s fixed backoff. */
|
|
1308
|
+
static readonly defaultForAiAgent: FixedRetryPolicySpec;
|
|
1265
1309
|
}
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1310
|
+
//#endregion
|
|
1311
|
+
//#region src/contracts/ExpRetryPolicy.d.ts
|
|
1312
|
+
declare class ExpRetryPolicy implements ExponentialRetryPolicySpec {
|
|
1313
|
+
readonly maxAttempts: number;
|
|
1314
|
+
readonly initialDelayMs: number;
|
|
1315
|
+
readonly multiplier: number;
|
|
1316
|
+
readonly maxDelayMs?: number | undefined;
|
|
1317
|
+
readonly jitter?: boolean | undefined;
|
|
1318
|
+
readonly kind: "exponential";
|
|
1319
|
+
constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined);
|
|
1271
1320
|
}
|
|
1272
1321
|
//#endregion
|
|
1273
1322
|
//#region src/contracts/executionPersistenceContracts.d.ts
|
|
@@ -1437,17 +1486,17 @@ declare class RunFinishedAtFactory {
|
|
|
1437
1486
|
}
|
|
1438
1487
|
//#endregion
|
|
1439
1488
|
//#region src/workflow/dsl/workflowBuilderTypes.d.ts
|
|
1440
|
-
type AnyRunnableNodeConfig = RunnableNodeConfig<any, any
|
|
1489
|
+
type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
|
|
1441
1490
|
type AnyTriggerNodeConfig = TriggerNodeConfig<any>;
|
|
1442
|
-
type ValidStepSequence<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps extends readonly [] ? readonly [] : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<
|
|
1443
|
-
type StepSequenceOutput<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? TSteps extends readonly [] ? TCurrentJson : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<
|
|
1491
|
+
type ValidStepSequence<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps extends readonly [] ? readonly [] : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? readonly [TFirst, ...ValidStepSequence<TNextJson, TRest>] : never : never : TSteps;
|
|
1492
|
+
type StepSequenceOutput<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? TSteps extends readonly [] ? TCurrentJson : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? StepSequenceOutput<TNextJson, TRest> : never : never : TCurrentJson : TCurrentJson;
|
|
1444
1493
|
type TypesMatch<TLeft, TRight> = [TLeft] extends [TRight] ? ([TRight] extends [TLeft] ? true : false) : false;
|
|
1445
1494
|
type BranchOutputGuard<TCurrentJson, TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TypesMatch<StepSequenceOutput<TCurrentJson, TTrueSteps>, StepSequenceOutput<TCurrentJson, TFalseSteps>> extends true ? unknown : never;
|
|
1446
1495
|
type BranchStepsArg<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps & ValidStepSequence<TCurrentJson, TSteps>;
|
|
1447
|
-
type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<
|
|
1496
|
+
type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TRestSteps & ValidStepSequence<RunnableNodeOutputJson<TFirstStep>, TRestSteps>;
|
|
1448
1497
|
type BooleanWhenOverloads<TCurrentJson, TReturn> = {
|
|
1449
1498
|
<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, steps: BranchStepsArg<TCurrentJson, TSteps>): TReturn;
|
|
1450
|
-
<TFirstStep extends RunnableNodeConfig<
|
|
1499
|
+
<TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs<TCurrentJson, TFirstStep, TRestSteps>): TReturn;
|
|
1451
1500
|
};
|
|
1452
1501
|
//#endregion
|
|
1453
1502
|
//#region src/workflow/dsl/WhenBuilder.d.ts
|
|
@@ -1462,6 +1511,11 @@ declare class WhenBuilder<TCurrentJson> {
|
|
|
1462
1511
|
}
|
|
1463
1512
|
//#endregion
|
|
1464
1513
|
//#region src/workflow/dsl/ChainCursorResolver.d.ts
|
|
1514
|
+
type ChainCursorEndpoint = Readonly<{
|
|
1515
|
+
node: NodeRef;
|
|
1516
|
+
output: OutputPortKey;
|
|
1517
|
+
inputPortHint?: InputPortKey;
|
|
1518
|
+
}>;
|
|
1465
1519
|
type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> & {
|
|
1466
1520
|
<TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined>(branches: Readonly<{
|
|
1467
1521
|
true?: TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TTrueSteps> : never;
|
|
@@ -1470,12 +1524,14 @@ type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson,
|
|
|
1470
1524
|
};
|
|
1471
1525
|
declare class ChainCursor<TCurrentJson> {
|
|
1472
1526
|
private readonly wf;
|
|
1473
|
-
private readonly
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1527
|
+
private readonly endpoints;
|
|
1528
|
+
constructor(wf: WorkflowBuilder, endpoints: ReadonlyArray<ChainCursorEndpoint>);
|
|
1529
|
+
then<TOutputJson$1, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
1530
|
+
thenIntoInputHints<TOutputJson$1, TConfig extends RunnableNodeConfig<any, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
1477
1531
|
readonly when: ChainCursorWhenOverloads<TCurrentJson>;
|
|
1532
|
+
route<TNextJson$1>(branches: Readonly<Record<OutputPortKey, (branch: ChainCursor<TCurrentJson>) => ChainCursor<TNextJson$1> | undefined>>): ChainCursor<TNextJson$1>;
|
|
1478
1533
|
build(): WorkflowDefinition;
|
|
1534
|
+
private resolveSharedInputPortHint;
|
|
1479
1535
|
}
|
|
1480
1536
|
//#endregion
|
|
1481
1537
|
//#region src/workflow/dsl/WorkflowBuilder.d.ts
|
|
@@ -1488,9 +1544,7 @@ declare class WorkflowBuilder {
|
|
|
1488
1544
|
constructor(meta: {
|
|
1489
1545
|
id: WorkflowId;
|
|
1490
1546
|
name: string;
|
|
1491
|
-
}, options?: Readonly<
|
|
1492
|
-
makeMergeNode?: (name: string) => AnyRunnableNodeConfig;
|
|
1493
|
-
}> | undefined);
|
|
1547
|
+
}, options?: Readonly<Record<string, never>> | undefined);
|
|
1494
1548
|
private add;
|
|
1495
1549
|
private connect;
|
|
1496
1550
|
trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>>;
|
|
@@ -1837,5 +1891,5 @@ declare class RunIntentService {
|
|
|
1837
1891
|
private createWebhookExecutionOptions;
|
|
1838
1892
|
}
|
|
1839
1893
|
//#endregion
|
|
1840
|
-
export {
|
|
1841
|
-
//# sourceMappingURL=RunIntentService-
|
|
1894
|
+
export { ItemValueResolvedContext as $, RunEventBus as $i, PreparedNodeActivationDispatch as $n, RunStatus as $r, UpstreamRefPlaceholder as $t, ExecutionInstanceDto as A, OAuth2ProviderFromPublicConfig as Ai, EngineDeps as An, ExecutionFrontierPlan as Ar, NodeErrorHandlerArgs as At, RunSlotProjectionState as B, inject as Bi, NodeActivationReceipt as Bn, PersistedRunState as Br, ParentExecutionRef as Bt, BranchOutputGuard as C, CredentialSessionService as Ci, BinaryAttachmentCreateRequest as Cn, AllWorkflowsActiveWorkflowActivationPolicy as Cr, LineageCarryPolicy as Ct, RunFinishedAtFactory as D, CredentialTypeId as Di, BinaryStorageStatResult as Dn, ConnectionInvocationRecord as Dr, NodeConnectionName as Dt, ValidStepSequence as E, CredentialTypeDefinition as Ei, BinaryStorageReadResult as En, ConnectionInvocationId as Er, NodeConfigBase as Et, PersistedExecutionInstanceRecord as F, Lifecycle as Fi, ExecutionContextFactory as Fn, PendingNodeExecution as Fr, NodeOutputs as Ft, WorkflowRunDetailDto as G, predicateAwareClassFactory as Gi, NodeExecutionContext as Gn, RunCompletionNotifier as Gr, RunId as Gt, WorkItemId as H, injectable as Hi, NodeActivationRequestBase as Hn, PersistedWorkflowSnapshotNode as Hr, PersistedTokenId as Ht, PersistedRunSlotProjectionRecord as I, RegistrationOptions as Ii, ItemNode as In, PersistedMutableNodeState as Ir, NodeRef as It, NoRetryPolicy as J, CoreTokens as Ji, NodeExecutionScheduler as Jn, RunExecutionOptions as Jr, RunnableNodeInputJson as Jt, ExpRetryPolicy as K, registry as Ki, NodeExecutionRequest as Kn, RunCurrentState as Kr, RunIdFactory as Kt, PersistedRunWorkItemKind as L, TypeToken as Li, LiveWorkflowRepository as Ln, PersistedMutableRunState as Lr, NodeSchedulerDecision as Lt, ExecutionPayloadPolicyFields as M, DependencyContainer$1 as Mi, ExecutableTriggerNode as Mn, NodeExecutionSnapshot as Mr, NodeId as Mt, PayloadStorageKind as N, Disposable as Ni, ExecutionBinaryService as Nn, NodeExecutionStatus as Nr, NodeKind as Nt, BatchId as O, CredentialTypeRegistry as Oi, BinaryStorageWriteRequest as On, CurrentStateExecutionRequest as Or, NodeDefinition as Ot, PersistedExecutionInstanceKind as P, InjectionToken$1 as Pi, ExecutionContext as Pn, NodeInputsByPort as Pr, NodeOffloadPolicy as Pt, ItemValueContext as Q, RunEvent as Qi, PersistedTriggerSetupState as Qn, RunStateResetRequest as Qr, TriggerNodeSetupState as Qt, PersistedRunWorkItemRecord as R, container$1 as Ri, MultiInputNode as Rn, PersistedRunControlState as Rr, OutputPortKey as Rt, BranchMoreArgs as S, CredentialSessionFactoryArgs as Si, RetryPolicySpec as Sn, WebhookTriggerRoutingDiagnostics as Sr, JsonValue as St, StepSequenceOutput as T, CredentialType as Ti, BinaryStorage as Tn, ConnectionInvocationAppendArgs as Tr, NodeActivationId as Tt, WorkItemStatus as U, instanceCachingFactory as Ui, NodeActivationScheduler as Un, PersistedWorkflowTokenRegistryLike as Ur, RunDataFactory as Ut, SlotExecutionStateDto as V, injectAll as Vi, NodeActivationRequest as Vn, PersistedWorkflowSnapshot as Vr, PersistedRunPolicySnapshot as Vt, WorkflowDetailSelectionState as W, instancePerContainerCachingFactory as Wi, NodeBinaryAttachmentService as Wn, PinnedNodeOutputsByPort as Wr, RunDataSnapshot as Wt, ItemValueArgs as X, EngineExecutionLimitsPolicy as Xi, NodeExecutor as Xn, RunQueueEntry as Xr, TriggerNodeConfig as Xt, ItemValue as Y, ENGINE_EXECUTION_LIMITS_DEFAULTS as Yi, NodeExecutionStatePublisher as Yn, RunPruneCandidate as Yr, RunnableNodeOutputJson as Yt, ItemValueCallback as Z, EngineExecutionLimitsPolicyConfig as Zi, NodeResolver as Zn, RunResult as Zr, TriggerNodeOutputJson as Zt, ChainCursor as _, CredentialMaterialSourceKind as _i, triggerNodeOutputType as _n, TriggerInstanceId as _r, Items as _t, RunTerminalPersistenceCoordinator as a, WorkflowExecutionRepository as ai, WorkflowGraphFactory as an, TriggerRuntimeDiagnostics as ar, PortsEmission as at, AnyTriggerNodeConfig as b, CredentialRequirement as bi, FixedRetryPolicySpec as bn, WebhookTriggerMatcher as br, JsonObject as bt, EngineExecutionLimitsPolicyFactory as c, CredentialBinding as ci, WorkflowPolicyRuntimeDefaults as cn, TriggerSetupStateRepository as cr, isUnbrandedPortsEmissionShape as ct, DefaultWorkflowGraphFactory as d, CredentialHealth as di, WorkflowStoragePolicyMode as dn, WorkflowRepository as dr, BinaryPreviewKind as dt, RunEventSubscription as ea, RunStopCondition as ei, WorkflowDefinition as en, RunnableNode as er, isItemValue as et, WorkflowExecutableNodeClassifierFactory as f, CredentialHealthStatus as fi, WorkflowStoragePolicyResolver as fn, WorkflowRunnerResolver as fr, Edge as ft, WorkflowBuilder as g, CredentialJsonRecord as gi, runnableNodeOutputType as gn, HttpMethod as gr, ItemBinary as gt, ConnectionInvocationIdFactory as h, CredentialInstanceRecord as hi, runnableNodeInputType as hn, WorkflowSnapshotResolver as hr, Item as ht, WorkflowPolicyErrorServices as i, WorkflowExecutionPruneRepository as ii, WorkflowGraph as in, TriggerNode as ir, getOriginIndexFromItem as it, ExecutionInstanceId as j, Container as ji, EngineHost as jn, NodeExecutionError as jr, NodeErrorHandlerSpec as jt, ConnectionInvocationKind as k, CredentialUnboundError as ki, BinaryStorageWriteResult as kn, EngineRunCounters as kr, NodeErrorHandler as kt, WorkflowSnapshotCodec as l, CredentialBindingKey as li, WorkflowPrunePolicySpec as ln, TriggerTestItemsContext as lr, ActivationIdFactory as lt, ConnectionNodeIdFactory as m, CredentialInstanceId as mi, branchRef as mn, WorkflowSnapshotFactory as mr, InputPortKey as mt, InMemoryLiveWorkflowRepository as n, WebhookRunResult as ni, WorkflowErrorHandler as nn, TestableTriggerNode as nr, resolveItemValuesForExecution as nt, WorkflowStoragePolicyEvaluator as o, AnyCredentialType as oi, WorkflowId as on, TriggerSetupContext as or, emitPorts as ot, WorkflowExecutableNodeClassifier as p, CredentialHealthTester as pi, WorkflowStoragePolicySpec as pn, WorkflowRunnerService as pr, ExecutionMode as pt, RetryPolicy as q, singleton as qi, NodeExecutionRequestHandler as qn, RunEventPublisherDeps as qr, RunnableNodeConfig as qt, EngineWorkflowRunnerService as r, WorkflowExecutionListingRepository as ri, WorkflowErrorHandlerSpec as rn, TriggerCleanupHandle as rr, resolveItemValuesInUnknown as rt, RunPolicySnapshotFactory as s, CredentialAuthDefinition as si, WorkflowNodeConnection as sn, TriggerSetupStateFor as sr, isPortsEmission as st, RunIntentService as t, RunSummary as ti, WorkflowErrorContext as tn, RunnableNodeExecuteArgs as tr, itemValue as tt, Engine as u, CredentialFieldSchema as ui, WorkflowStoragePolicyDecisionArgs as un, WorkflowNodeInstanceFactory as ur, BinaryAttachment as ut, WhenBuilder as v, CredentialOAuth2AuthDefinition as vi, triggerNodeSetupStateType as vn, WebhookControlSignal as vr, JsonArray as vt, BranchStepsArg as w, CredentialSetupStatus as wi, BinaryBody as wn, WorkflowActivationPolicy as wr, MutableRunData as wt, BooleanWhenOverloads as x, CredentialSessionFactory as xi, NoneRetryPolicySpec as xn, WebhookTriggerResolution as xr, JsonPrimitive as xt, AnyRunnableNodeConfig as y, CredentialOAuth2ScopesFromPublicConfig as yi, ExponentialRetryPolicySpec as yn, WebhookInvocationMatch as yr, JsonNonArray as yt, RunRevision as z, delay as zi, NodeActivationContinuation as zn, PersistedRunSchedulingState as zr, PairedItemRef as zt };
|
|
1895
|
+
//# sourceMappingURL=RunIntentService-Dkr4YwN8.d.ts.map
|