@codemation/core 0.10.2 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +183 -0
- package/dist/CostCatalogContract-DZgcUBE4.d.cts +19 -0
- package/dist/{EngineRuntimeRegistration.types-ClLuY1FG.d.ts → EngineRuntimeRegistration.types-BQbS9_gs.d.ts} +2 -2
- package/dist/{EngineRuntimeRegistration.types-BryWi2mA.d.cts → EngineRuntimeRegistration.types-Cggm5GVY.d.cts} +8 -2
- package/dist/{InMemoryRunDataFactory-DeXNJt1O.d.cts → InMemoryRunDataFactory-C7YItvHG.d.cts} +9 -19
- package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js → InMemoryRunEventBusRegistry-Bwunvt1T.js} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js.map → InMemoryRunEventBusRegistry-Bwunvt1T.js.map} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs → InMemoryRunEventBusRegistry-Sa86VxuV.cjs} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs.map → InMemoryRunEventBusRegistry-Sa86VxuV.cjs.map} +1 -1
- package/dist/ItemsInputNormalizer-C_dpn76M.d.cts +407 -0
- package/dist/ItemsInputNormalizer-CwdOhSAK.cjs +43 -0
- package/dist/ItemsInputNormalizer-CwdOhSAK.cjs.map +1 -0
- package/dist/ItemsInputNormalizer-D-MH8MBs.js +36 -0
- package/dist/ItemsInputNormalizer-D-MH8MBs.js.map +1 -0
- package/dist/ItemsInputNormalizer-_Mfcd3YU.d.ts +321 -0
- package/dist/RunIntentService-BVur7x9n.d.ts +285 -0
- package/dist/RunIntentService-CEF-sFfI.d.cts +206 -0
- package/dist/{RunIntentService-BqNjrksF.d.cts → agentMcpTypes-ZiNbNsEi.d.cts} +1717 -1809
- package/dist/bootstrap/index.cjs +4 -2
- package/dist/bootstrap/index.d.cts +8 -3
- package/dist/bootstrap/index.d.ts +6 -4
- package/dist/bootstrap/index.js +4 -2
- package/dist/{bootstrap-DtjQtuvi.cjs → bootstrap-BxuTFTLB.cjs} +41 -34
- package/dist/bootstrap-BxuTFTLB.cjs.map +1 -0
- package/dist/{bootstrap-BfFKGzyj.js → bootstrap-D_Yyi0wL.js} +9 -2
- package/dist/bootstrap-D_Yyi0wL.js.map +1 -0
- package/dist/browser.cjs +16 -0
- package/dist/browser.d.cts +4 -0
- package/dist/browser.d.ts +3 -0
- package/dist/browser.js +4 -0
- package/dist/contracts-CK0x6w_G.cjs +74 -0
- package/dist/contracts-CK0x6w_G.cjs.map +1 -0
- package/dist/contracts-DXdfTdpW.js +50 -0
- package/dist/contracts-DXdfTdpW.js.map +1 -0
- package/dist/contracts.cjs +6 -0
- package/dist/contracts.d.cts +5 -0
- package/dist/contracts.d.ts +2 -0
- package/dist/contracts.js +3 -0
- package/dist/di-0Wop7z1y.js +376 -0
- package/dist/di-0Wop7z1y.js.map +1 -0
- package/dist/di-BlEKdoZS.cjs +489 -0
- package/dist/di-BlEKdoZS.cjs.map +1 -0
- package/dist/executionPersistenceContracts-BgZMRsTa.d.cts +275 -0
- package/dist/{index-CJQtTY_M.d.ts → index-62Ba9f7D.d.ts} +114 -320
- package/dist/{RunIntentService-CI-F8qQ7.d.ts → index-zWGtEhrf.d.ts} +1811 -1914
- package/dist/index.cjs +76 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -656
- package/dist/index.d.ts +5 -3
- package/dist/index.js +52 -50
- package/dist/index.js.map +1 -1
- package/dist/params-B5SENSzZ.d.cts +44 -0
- package/dist/{runtime-_ywksLa6.cjs → runtime-DBzq5YBi.cjs} +125 -489
- package/dist/runtime-DBzq5YBi.cjs.map +1 -0
- package/dist/{runtime-DbMjpb5d.js → runtime-cxmUkk0l.js} +117 -369
- package/dist/runtime-cxmUkk0l.js.map +1 -0
- package/dist/testing.cjs +23 -21
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +4 -3
- package/dist/testing.d.ts +3 -2
- package/dist/testing.js +5 -3
- package/dist/testing.js.map +1 -1
- package/package.json +12 -17
- package/src/ai/AgentConnectionNodeCollector.ts +47 -5
- package/src/authoring/defineNode.types.ts +21 -1
- package/src/authoring/definePollingTrigger.types.ts +20 -0
- package/src/binaries/UnavailableBinaryStorage.ts +6 -0
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +9 -0
- package/src/browser.ts +1 -0
- package/src/contracts/AgentBindError.ts +11 -0
- package/src/contracts/CodemationTelemetryAttributeNames.ts +4 -0
- package/src/contracts/NoOpAgentMcpIntegration.ts +13 -0
- package/src/contracts/agentMcpTypes.ts +64 -0
- package/src/contracts/index.ts +4 -0
- package/src/contracts/mcpTypes.ts +29 -0
- package/src/contracts/runTypes.ts +8 -0
- package/src/contracts/runtimeTypes.ts +4 -0
- package/src/contracts/workflowTypes.ts +21 -0
- package/src/contracts.ts +3 -0
- package/src/credentials/OAuthFlowExecutor.types.ts +45 -0
- package/src/di/CoreTokens.ts +7 -0
- package/src/execution/InProcessRetryRunner.ts +31 -5
- package/src/execution/NodeExecutor.ts +27 -7
- package/src/execution/NodeRunStateWriter.ts +2 -0
- package/src/index.ts +10 -0
- package/src/orchestration/RunContinuationService.ts +6 -2
- package/src/runStorage/InMemoryBinaryStorageRegistry.ts +10 -0
- package/src/scheduler/InlineDrivingScheduler.ts +26 -22
- package/src/types/index.ts +1 -0
- package/src/validation/WorkflowEdgePortError.types.ts +16 -0
- package/src/validation/WorkflowEdgePortValidator.ts +52 -0
- package/src/workflow/definition/ConnectionInvocationIdFactory.ts +4 -3
- package/src/workflow/definition/ConnectionNodeIdFactory.ts +25 -0
- package/src/workflow/definition/NodeIterationIdFactory.ts +5 -3
- package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +42 -10
- package/tsdown.config.ts +1 -1
- package/dist/bootstrap-BfFKGzyj.js.map +0 -1
- package/dist/bootstrap-DtjQtuvi.cjs.map +0 -1
- package/dist/runtime-DbMjpb5d.js.map +0 -1
- package/dist/runtime-_ywksLa6.cjs.map +0 -1
|
@@ -1,34 +1,8 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { container as container$1, delay, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, predicateAwareClassFactory, registry, singleton } from "tsyringe";
|
|
1
|
+
import { S as resolveItemExprsForExecution, _ as AgentConnectionNodeCollector, a as injectable, g as NodeIterationIdFactory, h as CredentialUnboundError, w as ConnectionNodeIdFactory, y as AgentConfigInspector } from "./di-0Wop7z1y.js";
|
|
3
2
|
import { ZodError, z } from "zod";
|
|
4
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
5
3
|
import { ReadableStream } from "node:stream/web";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
6
5
|
|
|
7
|
-
//#region src/di/CoreTokens.ts
|
|
8
|
-
const CoreTokens = {
|
|
9
|
-
PersistedWorkflowTokenRegistry: Symbol.for("codemation.core.PersistedWorkflowTokenRegistry"),
|
|
10
|
-
CredentialSessionService: Symbol.for("codemation.core.CredentialSessionService"),
|
|
11
|
-
CredentialTypeRegistry: Symbol.for("codemation.core.CredentialTypeRegistry"),
|
|
12
|
-
WorkflowRunnerService: Symbol.for("codemation.core.WorkflowRunnerService"),
|
|
13
|
-
LiveWorkflowRepository: Symbol.for("codemation.core.LiveWorkflowRepository"),
|
|
14
|
-
WorkflowRepository: Symbol.for("codemation.core.WorkflowRepository"),
|
|
15
|
-
NodeResolver: Symbol.for("codemation.core.NodeResolver"),
|
|
16
|
-
WorkflowNodeInstanceFactory: Symbol.for("codemation.core.WorkflowNodeInstanceFactory"),
|
|
17
|
-
RunIdFactory: Symbol.for("codemation.core.RunIdFactory"),
|
|
18
|
-
ActivationIdFactory: Symbol.for("codemation.core.ActivationIdFactory"),
|
|
19
|
-
WorkflowExecutionRepository: Symbol.for("codemation.core.WorkflowExecutionRepository"),
|
|
20
|
-
TriggerSetupStateRepository: Symbol.for("codemation.core.TriggerSetupStateRepository"),
|
|
21
|
-
NodeActivationScheduler: Symbol.for("codemation.core.NodeActivationScheduler"),
|
|
22
|
-
RunDataFactory: Symbol.for("codemation.core.RunDataFactory"),
|
|
23
|
-
ExecutionContextFactory: Symbol.for("codemation.core.ExecutionContextFactory"),
|
|
24
|
-
RunEventBus: Symbol.for("codemation.core.RunEventBus"),
|
|
25
|
-
BinaryStorage: Symbol.for("codemation.core.BinaryStorage"),
|
|
26
|
-
WebhookBasePath: Symbol.for("codemation.core.WebhookBasePath"),
|
|
27
|
-
EngineExecutionLimitsPolicy: Symbol.for("codemation.core.EngineExecutionLimitsPolicy"),
|
|
28
|
-
WorkflowActivationPolicy: Symbol.for("codemation.core.WorkflowActivationPolicy")
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
6
|
//#region src/runtime-types/persistedRuntimeTypeModelRegistry.ts
|
|
33
7
|
/** Shared metadata key used to attach persisted runtime-type information to decorated classes. */
|
|
34
8
|
const persistedRuntimeTypeMetadataKey = Symbol.for("codemation.core.persistedRuntimeTypeMetadata");
|
|
@@ -137,248 +111,6 @@ function chatModel(options = {}) {
|
|
|
137
111
|
return InjectableRuntimeDecoratorComposer.compose("chatModel", options, import.meta.url);
|
|
138
112
|
}
|
|
139
113
|
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region src/ai/NodeBackedToolConfig.ts
|
|
142
|
-
var NodeBackedToolConfig = class {
|
|
143
|
-
type;
|
|
144
|
-
toolKind = "nodeBacked";
|
|
145
|
-
description;
|
|
146
|
-
presentation;
|
|
147
|
-
inputSchemaValue;
|
|
148
|
-
outputSchemaValue;
|
|
149
|
-
mapInputValue;
|
|
150
|
-
mapOutputValue;
|
|
151
|
-
constructor(name, node$1, options) {
|
|
152
|
-
this.name = name;
|
|
153
|
-
this.node = node$1;
|
|
154
|
-
this.type = node$1.type;
|
|
155
|
-
this.description = options.description;
|
|
156
|
-
this.presentation = options.presentation;
|
|
157
|
-
this.inputSchemaValue = options.inputSchema;
|
|
158
|
-
this.outputSchemaValue = options.outputSchema;
|
|
159
|
-
this.mapInputValue = options.mapInput;
|
|
160
|
-
this.mapOutputValue = options.mapOutput;
|
|
161
|
-
}
|
|
162
|
-
getCredentialRequirements() {
|
|
163
|
-
return this.node.getCredentialRequirements?.() ?? [];
|
|
164
|
-
}
|
|
165
|
-
getInputSchema() {
|
|
166
|
-
return this.inputSchemaValue;
|
|
167
|
-
}
|
|
168
|
-
getOutputSchema() {
|
|
169
|
-
return this.outputSchemaValue;
|
|
170
|
-
}
|
|
171
|
-
toNodeItem(args) {
|
|
172
|
-
const mapped = this.mapInputValue?.(args) ?? args.input;
|
|
173
|
-
if (this.isItem(mapped)) return mapped;
|
|
174
|
-
return { json: mapped };
|
|
175
|
-
}
|
|
176
|
-
toToolOutput(args) {
|
|
177
|
-
const raw = this.mapOutputValue?.(args) ?? this.readDefaultToolOutput(args.outputs);
|
|
178
|
-
return this.outputSchemaValue.parse(raw);
|
|
179
|
-
}
|
|
180
|
-
readDefaultToolOutput(outputs) {
|
|
181
|
-
const firstMainItem = outputs.main?.[0];
|
|
182
|
-
if (!firstMainItem) throw new Error(`Node-backed tool "${this.name}" did not produce a main output item.`);
|
|
183
|
-
return firstMainItem.json;
|
|
184
|
-
}
|
|
185
|
-
isItem(value) {
|
|
186
|
-
return typeof value === "object" && value !== null && "json" in value;
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
//#endregion
|
|
191
|
-
//#region src/contracts/itemExpr.ts
|
|
192
|
-
const ITEM_EXPR_BRAND = Symbol.for("codemation.itemExpr");
|
|
193
|
-
function itemExpr(fn) {
|
|
194
|
-
return {
|
|
195
|
-
[ITEM_EXPR_BRAND]: true,
|
|
196
|
-
fn
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
function isItemExpr(value) {
|
|
200
|
-
if (typeof value !== "object" || value === null) return false;
|
|
201
|
-
const v = value;
|
|
202
|
-
if (v[ITEM_EXPR_BRAND] === true) return true;
|
|
203
|
-
const keys = Object.keys(v);
|
|
204
|
-
if (keys.length === 1 && keys[0] === "fn" && typeof v.fn === "function") return true;
|
|
205
|
-
for (const sym of Object.getOwnPropertySymbols(v)) if (sym.description === "codemation.itemExpr" && v[sym] === true) return true;
|
|
206
|
-
return false;
|
|
207
|
-
}
|
|
208
|
-
function containsItemExprInUnknown(value, seen = /* @__PURE__ */ new WeakSet()) {
|
|
209
|
-
if (isItemExpr(value)) return true;
|
|
210
|
-
if (value === null || typeof value !== "object") return false;
|
|
211
|
-
if (seen.has(value)) return false;
|
|
212
|
-
seen.add(value);
|
|
213
|
-
if (Array.isArray(value)) return value.some((entry) => containsItemExprInUnknown(entry, seen));
|
|
214
|
-
for (const entry of Object.values(value)) if (containsItemExprInUnknown(entry, seen)) return true;
|
|
215
|
-
return false;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Deep-resolves {@link itemExpr} leaves. Returns a new graph (does not mutate the original config object).
|
|
219
|
-
*/
|
|
220
|
-
async function resolveItemExprsInUnknown(value, args, seen = /* @__PURE__ */ new WeakSet()) {
|
|
221
|
-
if (isItemExpr(value)) return await Promise.resolve(value.fn(args));
|
|
222
|
-
if (value === null || typeof value !== "object") return value;
|
|
223
|
-
if (seen.has(value)) return value;
|
|
224
|
-
seen.add(value);
|
|
225
|
-
if (Array.isArray(value)) {
|
|
226
|
-
const out$1 = [];
|
|
227
|
-
for (let i = 0; i < value.length; i++) out$1.push(await resolveItemExprsInUnknown(value[i], args, seen));
|
|
228
|
-
return out$1;
|
|
229
|
-
}
|
|
230
|
-
const rec = value;
|
|
231
|
-
const entries = Object.entries(rec);
|
|
232
|
-
const proto = Object.getPrototypeOf(value);
|
|
233
|
-
if (proto !== Object.prototype && proto !== null && entries.length === 0) return value;
|
|
234
|
-
const out = Object.create(proto);
|
|
235
|
-
for (const [k, v] of entries) out[k] = await resolveItemExprsInUnknown(v, args, seen);
|
|
236
|
-
return out;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Clones runnable config (best-effort) so per-item {@link itemExpr} resolution never mutates shared instances.
|
|
240
|
-
*/
|
|
241
|
-
async function resolveItemExprsForExecution(config, nodeCtx, item, itemIndex, items) {
|
|
242
|
-
const exprArgs = {
|
|
243
|
-
item,
|
|
244
|
-
itemIndex,
|
|
245
|
-
items,
|
|
246
|
-
ctx: {
|
|
247
|
-
runId: nodeCtx.runId,
|
|
248
|
-
workflowId: nodeCtx.workflowId,
|
|
249
|
-
nodeId: nodeCtx.nodeId,
|
|
250
|
-
activationId: nodeCtx.activationId,
|
|
251
|
-
data: nodeCtx.data
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
if (!containsItemExprInUnknown(config)) return;
|
|
255
|
-
return await resolveItemExprsInUnknown(config, exprArgs);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
//#endregion
|
|
259
|
-
//#region src/ai/AgentConfigInspectorFactory.ts
|
|
260
|
-
var AgentConfigInspector = class {
|
|
261
|
-
static isAgentNodeConfig(config) {
|
|
262
|
-
if (!config) return false;
|
|
263
|
-
const candidate = config;
|
|
264
|
-
return !!candidate.chatModel && this.hasCompatibleMessageConfiguration(candidate);
|
|
265
|
-
}
|
|
266
|
-
static hasCompatibleMessageConfiguration(candidate) {
|
|
267
|
-
const messages = candidate.messages;
|
|
268
|
-
if (messages === void 0 || messages === null) return false;
|
|
269
|
-
if (Array.isArray(messages)) return messages.length > 0;
|
|
270
|
-
if (typeof messages === "object") {
|
|
271
|
-
if (isItemExpr(messages)) return true;
|
|
272
|
-
const o = messages;
|
|
273
|
-
return Array.isArray(o.prompt) && o.prompt.length > 0 || typeof o.buildMessages === "function";
|
|
274
|
-
}
|
|
275
|
-
return false;
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
//#endregion
|
|
280
|
-
//#region src/workflow/definition/ConnectionNodeIdFactory.ts
|
|
281
|
-
/**
|
|
282
|
-
* Deterministic ids for workflow connection-owned child nodes (LLM slot, tools, etc.).
|
|
283
|
-
* These are stable across loads.
|
|
284
|
-
*/
|
|
285
|
-
var ConnectionNodeIdFactory = class {
|
|
286
|
-
static connectionSegment = "__conn__";
|
|
287
|
-
static languageModelConnectionNodeId(parentNodeId) {
|
|
288
|
-
return `${parentNodeId}${this.connectionSegment}llm`;
|
|
289
|
-
}
|
|
290
|
-
static toolConnectionNodeId(parentNodeId, toolName) {
|
|
291
|
-
const normalized = this.normalizeToolName(toolName);
|
|
292
|
-
return `${parentNodeId}${this.connectionSegment}tool${this.connectionSegment}${normalized}`;
|
|
293
|
-
}
|
|
294
|
-
static isLanguageModelConnectionNodeId(nodeId) {
|
|
295
|
-
return nodeId.endsWith(`${this.connectionSegment}llm`);
|
|
296
|
-
}
|
|
297
|
-
static isToolConnectionNodeId(nodeId) {
|
|
298
|
-
return nodeId.includes(`${this.connectionSegment}tool${this.connectionSegment}`);
|
|
299
|
-
}
|
|
300
|
-
static parseLanguageModelConnectionNodeId(nodeId) {
|
|
301
|
-
if (!this.isLanguageModelConnectionNodeId(nodeId)) return;
|
|
302
|
-
const suffix = `${this.connectionSegment}llm`;
|
|
303
|
-
const parentNodeId = nodeId.slice(0, -suffix.length);
|
|
304
|
-
return parentNodeId ? { parentNodeId } : void 0;
|
|
305
|
-
}
|
|
306
|
-
static parseToolConnectionNodeId(nodeId) {
|
|
307
|
-
if (!this.isToolConnectionNodeId(nodeId)) return;
|
|
308
|
-
const marker = `${this.connectionSegment}tool${this.connectionSegment}`;
|
|
309
|
-
const idx = nodeId.lastIndexOf(marker);
|
|
310
|
-
if (idx < 0) return;
|
|
311
|
-
const parentNodeId = nodeId.slice(0, idx);
|
|
312
|
-
const normalizedToolName = nodeId.slice(idx + marker.length);
|
|
313
|
-
if (!parentNodeId || !normalizedToolName) return;
|
|
314
|
-
return {
|
|
315
|
-
parentNodeId,
|
|
316
|
-
normalizedToolName
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
/** True when `nodeId` is a connection-owned child of `parentNodeId` (LLM or tool slot). */
|
|
320
|
-
static isConnectionOwnedDescendantOf(parentNodeId, nodeId) {
|
|
321
|
-
return nodeId.startsWith(`${parentNodeId}${this.connectionSegment}`);
|
|
322
|
-
}
|
|
323
|
-
/** Normalizes a tool display name to a stable id segment. */
|
|
324
|
-
static normalizeToolName(toolName) {
|
|
325
|
-
return toolName.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "tool";
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
//#endregion
|
|
330
|
-
//#region src/ai/AgentConnectionNodeCollector.ts
|
|
331
|
-
const AgentConnectionNodeCollector = new class {
|
|
332
|
-
collect(parentNodeId, agentConfig) {
|
|
333
|
-
const collected = [];
|
|
334
|
-
this.collectInto(parentNodeId, agentConfig, collected);
|
|
335
|
-
return collected;
|
|
336
|
-
}
|
|
337
|
-
collectInto(parentNodeId, agentConfig, collected) {
|
|
338
|
-
collected.push({
|
|
339
|
-
nodeId: ConnectionNodeIdFactory.languageModelConnectionNodeId(parentNodeId),
|
|
340
|
-
parentNodeId,
|
|
341
|
-
connectionName: "llm",
|
|
342
|
-
role: "languageModel",
|
|
343
|
-
name: agentConfig.chatModel.presentation?.label ?? agentConfig.chatModel.name,
|
|
344
|
-
typeName: agentConfig.chatModel.name,
|
|
345
|
-
icon: agentConfig.chatModel.presentation?.icon,
|
|
346
|
-
credentialSource: agentConfig.chatModel
|
|
347
|
-
});
|
|
348
|
-
for (const tool$1 of agentConfig.tools ?? []) {
|
|
349
|
-
const toolNodeId = ConnectionNodeIdFactory.toolConnectionNodeId(parentNodeId, tool$1.name);
|
|
350
|
-
const isNestedAgent = this.isNodeBackedAgentTool(tool$1);
|
|
351
|
-
collected.push({
|
|
352
|
-
nodeId: toolNodeId,
|
|
353
|
-
parentNodeId,
|
|
354
|
-
connectionName: "tools",
|
|
355
|
-
role: isNestedAgent ? "nestedAgent" : "tool",
|
|
356
|
-
name: tool$1.presentation?.label ?? tool$1.name,
|
|
357
|
-
typeName: tool$1.name,
|
|
358
|
-
icon: tool$1.presentation?.icon,
|
|
359
|
-
credentialSource: tool$1
|
|
360
|
-
});
|
|
361
|
-
this.collectNestedAgentTools(toolNodeId, tool$1, collected);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
collectNestedAgentTools(toolNodeId, tool$1, collected) {
|
|
365
|
-
if (!this.isNodeBackedAgentTool(tool$1)) return;
|
|
366
|
-
const innerAgent = tool$1 instanceof NodeBackedToolConfig ? tool$1.node : tool$1.node;
|
|
367
|
-
this.collectInto(toolNodeId, innerAgent, collected);
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* After JSON round-trip (persisted snapshots), tools are plain objects — `instanceof NodeBackedToolConfig` fails.
|
|
371
|
-
* Detect node-backed tools structurally via {@link NodeBackedToolConfig#toolKind}.
|
|
372
|
-
*/
|
|
373
|
-
isNodeBackedAgentTool(tool$1) {
|
|
374
|
-
if (tool$1 instanceof NodeBackedToolConfig) return AgentConfigInspector.isAgentNodeConfig(tool$1.node);
|
|
375
|
-
if (!tool$1 || typeof tool$1 !== "object") return false;
|
|
376
|
-
const t = tool$1;
|
|
377
|
-
if (t.toolKind !== "nodeBacked") return false;
|
|
378
|
-
return AgentConfigInspector.isAgentNodeConfig(t.node);
|
|
379
|
-
}
|
|
380
|
-
}();
|
|
381
|
-
|
|
382
114
|
//#endregion
|
|
383
115
|
//#region src/workflow/dsl/WhenBuilder.ts
|
|
384
116
|
var WhenBuilder = class WhenBuilder {
|
|
@@ -655,10 +387,13 @@ var WorkflowBuilder = class {
|
|
|
655
387
|
//#region src/workflow/definition/ConnectionInvocationIdFactory.ts
|
|
656
388
|
/**
|
|
657
389
|
* Unique ids for persisted connection invocation history rows (LLM/tool calls under an owning node).
|
|
390
|
+
*
|
|
391
|
+
* Uses Web Crypto's `randomUUID` so this module is safe in browser-bundle contexts —
|
|
392
|
+
* paired with `NodeIterationIdFactory` which had the same `node:crypto` regression.
|
|
658
393
|
*/
|
|
659
394
|
var ConnectionInvocationIdFactory = class {
|
|
660
395
|
static create() {
|
|
661
|
-
return `cinv_${randomUUID()}`;
|
|
396
|
+
return `cinv_${globalThis.crypto.randomUUID()}`;
|
|
662
397
|
}
|
|
663
398
|
/** Deterministic id for tests when a stable sequence is needed. */
|
|
664
399
|
static createForTest(runId, connectionNodeId, sequence) {
|
|
@@ -666,29 +401,6 @@ var ConnectionInvocationIdFactory = class {
|
|
|
666
401
|
}
|
|
667
402
|
};
|
|
668
403
|
|
|
669
|
-
//#endregion
|
|
670
|
-
//#region src/workflow/definition/NodeIterationIdFactory.ts
|
|
671
|
-
/**
|
|
672
|
-
* Unique ids for one per-item iteration of a runnable node's execute loop.
|
|
673
|
-
*
|
|
674
|
-
* Activations are per-batch (one scheduled execution of a node, possibly with N items).
|
|
675
|
-
* Iterations refine that to one identifier per item-index inside the batch loop, so per-item
|
|
676
|
-
* connection invocations and telemetry can be grouped without time-window heuristics.
|
|
677
|
-
*/
|
|
678
|
-
var NodeIterationIdFactory = class {
|
|
679
|
-
static create() {
|
|
680
|
-
return `iter_${randomUUID()}`;
|
|
681
|
-
}
|
|
682
|
-
/** Deterministic id for tests when a stable sequence is needed. */
|
|
683
|
-
static createForTest(seed, sequence) {
|
|
684
|
-
return `iter_${seed}_${sequence}`;
|
|
685
|
-
}
|
|
686
|
-
/** Deterministic id derived from a connection node id (for sub-agent / tool-call scopes). */
|
|
687
|
-
static createForConnection(connectionNodeId, sequence) {
|
|
688
|
-
return `iter_${connectionNodeId}_${sequence}`;
|
|
689
|
-
}
|
|
690
|
-
};
|
|
691
|
-
|
|
692
404
|
//#endregion
|
|
693
405
|
//#region src/workflow/definition/WorkflowExecutableNodeClassifier.ts
|
|
694
406
|
/**
|
|
@@ -927,6 +639,10 @@ var UnavailableBinaryStorage = class {
|
|
|
927
639
|
return { exists: false };
|
|
928
640
|
}
|
|
929
641
|
async delete() {}
|
|
642
|
+
async deleteMany() {}
|
|
643
|
+
async listByPrefix() {
|
|
644
|
+
return [];
|
|
645
|
+
}
|
|
930
646
|
};
|
|
931
647
|
|
|
932
648
|
//#endregion
|
|
@@ -1428,21 +1144,6 @@ var ExpRetryPolicy = class {
|
|
|
1428
1144
|
}
|
|
1429
1145
|
};
|
|
1430
1146
|
|
|
1431
|
-
//#endregion
|
|
1432
|
-
//#region src/contracts/credentialTypes.ts
|
|
1433
|
-
var CredentialUnboundError = class CredentialUnboundError extends Error {
|
|
1434
|
-
constructor(bindingKey, acceptedTypes = []) {
|
|
1435
|
-
super(CredentialUnboundError.createMessage(bindingKey, acceptedTypes));
|
|
1436
|
-
this.bindingKey = bindingKey;
|
|
1437
|
-
this.acceptedTypes = acceptedTypes;
|
|
1438
|
-
this.name = "CredentialUnboundError";
|
|
1439
|
-
}
|
|
1440
|
-
static createMessage(bindingKey, acceptedTypes) {
|
|
1441
|
-
const acceptedTypesSuffix = acceptedTypes.length > 0 ? ` Accepted credential types: ${acceptedTypes.join(", ")}.` : "";
|
|
1442
|
-
return `Credential slot "${bindingKey.slotKey}" is not bound for workflow ${bindingKey.workflowId} node ${bindingKey.nodeId}.${acceptedTypesSuffix}`;
|
|
1443
|
-
}
|
|
1444
|
-
};
|
|
1445
|
-
|
|
1446
1147
|
//#endregion
|
|
1447
1148
|
//#region src/contracts/CostTrackingTelemetryContract.ts
|
|
1448
1149
|
const CostTrackingTelemetryMetricNames = {
|
|
@@ -1564,19 +1265,6 @@ var NoOpExecutionTelemetryFactory = class {
|
|
|
1564
1265
|
}
|
|
1565
1266
|
};
|
|
1566
1267
|
|
|
1567
|
-
//#endregion
|
|
1568
|
-
//#region src/contracts/runFinishedAtFactory.ts
|
|
1569
|
-
/** Derives workflow end time from persisted run root or node snapshots for run listings. */
|
|
1570
|
-
var RunFinishedAtFactory = class {
|
|
1571
|
-
static resolveIso(state) {
|
|
1572
|
-
if (state.finishedAt && state.status !== "running" && state.status !== "pending") return state.finishedAt;
|
|
1573
|
-
if (state.status === "running" || state.status === "pending") return;
|
|
1574
|
-
let max;
|
|
1575
|
-
for (const snap of Object.values(state.nodeSnapshotsByNodeId)) if (snap?.finishedAt && (!max || snap.finishedAt > max)) max = snap.finishedAt;
|
|
1576
|
-
return max;
|
|
1577
|
-
}
|
|
1578
|
-
};
|
|
1579
|
-
|
|
1580
1268
|
//#endregion
|
|
1581
1269
|
//#region src/contracts/workflowActivationPolicy.ts
|
|
1582
1270
|
/** Default for tests and harnesses: every workflow is treated as active (legacy behavior). */
|
|
@@ -1605,6 +1293,10 @@ var CodemationTelemetryAttributeNames = class {
|
|
|
1605
1293
|
static iterationIndex = "codemation.iteration.index";
|
|
1606
1294
|
/** Set when this span/metric was recorded under a sub-agent triggered by an outer LLM/tool call. */
|
|
1607
1295
|
static parentInvocationId = "codemation.parent.invocation_id";
|
|
1296
|
+
/** MCP server id on spans created for callTool invocations. */
|
|
1297
|
+
static mcpServerId = "mcp.server_id";
|
|
1298
|
+
/** MCP tool name on spans created for callTool invocations. */
|
|
1299
|
+
static mcpToolName = "mcp.tool_name";
|
|
1608
1300
|
};
|
|
1609
1301
|
|
|
1610
1302
|
//#endregion
|
|
@@ -1630,13 +1322,6 @@ var CodemationTelemetryMetricNames = class {
|
|
|
1630
1322
|
static gmailAttachmentBytes = "codemation.gmail.attachment_bytes";
|
|
1631
1323
|
};
|
|
1632
1324
|
|
|
1633
|
-
//#endregion
|
|
1634
|
-
//#region src/contracts/workflowTypes.ts
|
|
1635
|
-
function nodeRef(nodeId) {
|
|
1636
|
-
return nodeId;
|
|
1637
|
-
}
|
|
1638
|
-
const branchRef = (index) => `$${index}`;
|
|
1639
|
-
|
|
1640
1325
|
//#endregion
|
|
1641
1326
|
//#region src/execution/ExecutionTelemetryCostTrackingDecoratorFactory.ts
|
|
1642
1327
|
var ExecutionTelemetryCostTrackingDecoratorFactory = class {
|
|
@@ -1820,18 +1505,21 @@ var CatalogBackedCostTrackingTelemetryFactory = class {
|
|
|
1820
1505
|
|
|
1821
1506
|
//#endregion
|
|
1822
1507
|
//#region src/execution/InProcessRetryRunner.ts
|
|
1508
|
+
/** Maximum permitted retry attempts — workflow-declared values above this are clamped. */
|
|
1509
|
+
const HARD_MAX_RETRY_ATTEMPTS = 10;
|
|
1823
1510
|
var InProcessRetryRunner = class InProcessRetryRunner {
|
|
1824
1511
|
constructor(sleeper) {
|
|
1825
1512
|
this.sleeper = sleeper;
|
|
1826
1513
|
}
|
|
1827
|
-
async run(policy, work) {
|
|
1828
|
-
const spec = InProcessRetryRunner.normalizePolicy(policy);
|
|
1514
|
+
async run(policy, work, shouldRetry, warn) {
|
|
1515
|
+
const spec = InProcessRetryRunner.normalizePolicy(policy, warn);
|
|
1829
1516
|
let lastError;
|
|
1830
1517
|
for (let attempt = 1; attempt <= spec.maxAttempts; attempt++) try {
|
|
1831
1518
|
return await work();
|
|
1832
1519
|
} catch (error) {
|
|
1833
1520
|
lastError = error;
|
|
1834
1521
|
if (attempt >= spec.maxAttempts) break;
|
|
1522
|
+
if (shouldRetry !== void 0 && !shouldRetry(error)) break;
|
|
1835
1523
|
const delayMs = InProcessRetryRunner.delayAfterFailureMs(spec, attempt);
|
|
1836
1524
|
await this.sleeper.sleep(delayMs);
|
|
1837
1525
|
}
|
|
@@ -1846,7 +1534,7 @@ var InProcessRetryRunner = class InProcessRetryRunner {
|
|
|
1846
1534
|
if (spec.maxDelayMs !== void 0 && ms > spec.maxDelayMs) ms = spec.maxDelayMs;
|
|
1847
1535
|
return Math.max(0, Math.floor(ms));
|
|
1848
1536
|
}
|
|
1849
|
-
static normalizePolicy(policy) {
|
|
1537
|
+
static normalizePolicy(policy, warn) {
|
|
1850
1538
|
if (policy === void 0) return {
|
|
1851
1539
|
kind: "none",
|
|
1852
1540
|
maxAttempts: 1
|
|
@@ -1862,17 +1550,19 @@ var InProcessRetryRunner = class InProcessRetryRunner {
|
|
|
1862
1550
|
};
|
|
1863
1551
|
if (kind === "fixed") {
|
|
1864
1552
|
const p = policy;
|
|
1553
|
+
const raw = InProcessRetryRunner.assertPositiveInt(p.maxAttempts, "fixed.maxAttempts");
|
|
1865
1554
|
return {
|
|
1866
1555
|
kind: "fixed",
|
|
1867
|
-
maxAttempts: InProcessRetryRunner.
|
|
1556
|
+
maxAttempts: InProcessRetryRunner.clampMaxAttempts(raw, warn),
|
|
1868
1557
|
delayMs: InProcessRetryRunner.assertNonNegativeFinite(p.delayMs, "fixed.delayMs")
|
|
1869
1558
|
};
|
|
1870
1559
|
}
|
|
1871
1560
|
if (kind === "exponential") {
|
|
1872
1561
|
const p = policy;
|
|
1562
|
+
const raw = InProcessRetryRunner.assertPositiveInt(p.maxAttempts, "exponential.maxAttempts");
|
|
1873
1563
|
return {
|
|
1874
1564
|
kind: "exponential",
|
|
1875
|
-
maxAttempts: InProcessRetryRunner.
|
|
1565
|
+
maxAttempts: InProcessRetryRunner.clampMaxAttempts(raw, warn),
|
|
1876
1566
|
initialDelayMs: InProcessRetryRunner.assertNonNegativeFinite(p.initialDelayMs, "exponential.initialDelayMs"),
|
|
1877
1567
|
multiplier: InProcessRetryRunner.assertMultiplier(p.multiplier),
|
|
1878
1568
|
maxDelayMs: p.maxDelayMs === void 0 ? void 0 : InProcessRetryRunner.assertNonNegativeFinite(p.maxDelayMs, "exponential.maxDelayMs"),
|
|
@@ -1884,6 +1574,13 @@ var InProcessRetryRunner = class InProcessRetryRunner {
|
|
|
1884
1574
|
maxAttempts: 1
|
|
1885
1575
|
};
|
|
1886
1576
|
}
|
|
1577
|
+
static clampMaxAttempts(requested, warn) {
|
|
1578
|
+
if (requested > HARD_MAX_RETRY_ATTEMPTS) {
|
|
1579
|
+
warn?.(`Retry policy maxAttempts (${requested}) exceeds hard ceiling (${HARD_MAX_RETRY_ATTEMPTS}); clamping to ${HARD_MAX_RETRY_ATTEMPTS}.`);
|
|
1580
|
+
return HARD_MAX_RETRY_ATTEMPTS;
|
|
1581
|
+
}
|
|
1582
|
+
return requested;
|
|
1583
|
+
}
|
|
1887
1584
|
static assertPositiveInt(value, label) {
|
|
1888
1585
|
if (typeof value !== "number" || !Number.isFinite(value) || value < 1 || !Number.isInteger(value)) throw new Error(`Retry policy ${label} must be a positive integer`);
|
|
1889
1586
|
return value;
|
|
@@ -2086,12 +1783,24 @@ var NodeExecutor = class {
|
|
|
2086
1783
|
this.outputBehaviorResolver = outputBehaviorResolver ?? new RunnableOutputBehaviorResolver();
|
|
2087
1784
|
}
|
|
2088
1785
|
async execute(request) {
|
|
1786
|
+
await this.assertRequiredCredentialsBound(request);
|
|
2089
1787
|
const policy = request.ctx.config.retryPolicy;
|
|
2090
1788
|
return await this.retryRunner.run(policy, async () => {
|
|
2091
1789
|
const nodeInstance = this.nodeInstanceFactory.createByType(request.ctx.config.type);
|
|
2092
1790
|
if (request.kind === "multi") return await this.executeMultiInputActivation(request, nodeInstance);
|
|
2093
1791
|
return await this.executeSingleInputNode(request, nodeInstance);
|
|
2094
|
-
});
|
|
1792
|
+
}, (error) => !this.isCredentialError(error));
|
|
1793
|
+
}
|
|
1794
|
+
async assertRequiredCredentialsBound(request) {
|
|
1795
|
+
if (!request.ctx.getCredential) return;
|
|
1796
|
+
for (const req of request.ctx.config.getCredentialRequirements?.() ?? []) {
|
|
1797
|
+
if (req.optional) continue;
|
|
1798
|
+
await request.ctx.getCredential(req.slotKey);
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
isCredentialError(e) {
|
|
1802
|
+
if (e instanceof CredentialUnboundError) return true;
|
|
1803
|
+
return (e instanceof Error ? e.cause : void 0) instanceof CredentialUnboundError;
|
|
2095
1804
|
}
|
|
2096
1805
|
async executeMultiInputActivation(request, node$1) {
|
|
2097
1806
|
const multiInputNode = node$1;
|
|
@@ -2401,16 +2110,20 @@ var WorkflowSnapshotCodec = class {
|
|
|
2401
2110
|
name: workflow.name,
|
|
2402
2111
|
workflowErrorHandlerConfigured: workflow.workflowErrorHandler !== void 0,
|
|
2403
2112
|
...workflow.connections !== void 0 && workflow.connections.length > 0 ? { connections: workflow.connections } : {},
|
|
2404
|
-
nodes: workflow.nodes.map((node$1) =>
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2113
|
+
nodes: workflow.nodes.map((node$1) => {
|
|
2114
|
+
const inspectorSummaryRows = this.safeInspectorSummary(node$1.config);
|
|
2115
|
+
return {
|
|
2116
|
+
id: node$1.id,
|
|
2117
|
+
kind: node$1.kind,
|
|
2118
|
+
name: node$1.name,
|
|
2119
|
+
nodeTokenId: this.resolveTokenId(node$1.type),
|
|
2120
|
+
configTokenId: this.resolveTokenId(node$1.config.type),
|
|
2121
|
+
tokenName: this.resolveTokenName(node$1.type),
|
|
2122
|
+
configTokenName: this.resolveTokenName(node$1.config.type),
|
|
2123
|
+
config: this.serializeConfig(node$1.config),
|
|
2124
|
+
...inspectorSummaryRows !== void 0 ? { inspectorSummary: inspectorSummaryRows } : {}
|
|
2125
|
+
};
|
|
2126
|
+
}),
|
|
2414
2127
|
edges: workflow.edges.map((edge) => ({
|
|
2415
2128
|
from: {
|
|
2416
2129
|
nodeId: edge.from.nodeId,
|
|
@@ -2450,6 +2163,34 @@ var WorkflowSnapshotCodec = class {
|
|
|
2450
2163
|
return fallback;
|
|
2451
2164
|
}
|
|
2452
2165
|
}
|
|
2166
|
+
/**
|
|
2167
|
+
* Safely call `config.inspectorSummary()` and return a plain JSON-safe array, or undefined.
|
|
2168
|
+
* Returns undefined if the method is absent, throws, or produces no valid rows.
|
|
2169
|
+
*/
|
|
2170
|
+
safeInspectorSummary(config) {
|
|
2171
|
+
const fn = config.inspectorSummary;
|
|
2172
|
+
if (typeof fn !== "function") return void 0;
|
|
2173
|
+
let raw;
|
|
2174
|
+
try {
|
|
2175
|
+
raw = fn.call(config);
|
|
2176
|
+
} catch {
|
|
2177
|
+
return;
|
|
2178
|
+
}
|
|
2179
|
+
if (!Array.isArray(raw)) return void 0;
|
|
2180
|
+
const rows = [];
|
|
2181
|
+
for (const entry of raw) {
|
|
2182
|
+
if (!entry || typeof entry !== "object") continue;
|
|
2183
|
+
const { label, value } = entry;
|
|
2184
|
+
if (typeof label !== "string" || typeof value !== "string") continue;
|
|
2185
|
+
const trimmedLabel = label.trim();
|
|
2186
|
+
if (trimmedLabel.length === 0) continue;
|
|
2187
|
+
rows.push({
|
|
2188
|
+
label: trimmedLabel,
|
|
2189
|
+
value
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
return rows.length > 0 ? rows : void 0;
|
|
2193
|
+
}
|
|
2453
2194
|
injectTokenIds(target, source) {
|
|
2454
2195
|
const type = this.asTypeToken(source.type);
|
|
2455
2196
|
if (type) target.tokenId = this.tokenRegistry.getTokenId(type) ?? this.resolveTokenName(type) ?? "unknown";
|
|
@@ -2720,6 +2461,8 @@ var NodeRunStateWriter = class {
|
|
|
2720
2461
|
status: args.status,
|
|
2721
2462
|
managedInput: args.managedInput,
|
|
2722
2463
|
managedOutput: args.managedOutput,
|
|
2464
|
+
statusLabel: args.statusLabel,
|
|
2465
|
+
subjectName: args.subjectName,
|
|
2723
2466
|
error: args.error,
|
|
2724
2467
|
queuedAt: args.queuedAt,
|
|
2725
2468
|
startedAt: args.startedAt,
|
|
@@ -3082,7 +2825,7 @@ var RunContinuationService = class {
|
|
|
3082
2825
|
});
|
|
3083
2826
|
const completedActivations = (state.engineCounters?.completedNodeActivations ?? 0) + 1;
|
|
3084
2827
|
const engineCounters = { completedNodeActivations: completedActivations };
|
|
3085
|
-
const maxNodeActivations = state.executionOptions?.maxNodeActivations ??
|
|
2828
|
+
const maxNodeActivations = state.executionOptions?.maxNodeActivations ?? this.executionLimitsPolicy.createRootExecutionOptions().maxNodeActivations;
|
|
3086
2829
|
if (this.semantics.isStopConditionSatisfied(state.control?.stopCondition, args.nodeId)) {
|
|
3087
2830
|
const completedState = this.persistedRunStateTerminalBuilder.mergeTerminal({
|
|
3088
2831
|
state,
|
|
@@ -3406,7 +3149,7 @@ var RunContinuationService = class {
|
|
|
3406
3149
|
});
|
|
3407
3150
|
const completedActivations = (args.state.engineCounters?.completedNodeActivations ?? 0) + 1;
|
|
3408
3151
|
const engineCounters = { completedNodeActivations: completedActivations };
|
|
3409
|
-
const maxNodeActivations = args.state.executionOptions?.maxNodeActivations ??
|
|
3152
|
+
const maxNodeActivations = args.state.executionOptions?.maxNodeActivations ?? this.executionLimitsPolicy.createRootExecutionOptions().maxNodeActivations;
|
|
3410
3153
|
if (this.semantics.isStopConditionSatisfied(args.state.control?.stopCondition, args.args.nodeId)) {
|
|
3411
3154
|
const completedState = this.persistedRunStateTerminalBuilder.mergeTerminal({
|
|
3412
3155
|
state: args.state,
|
|
@@ -4635,25 +4378,24 @@ var InlineDrivingScheduler = class {
|
|
|
4635
4378
|
this.scheduledRuns.delete(runId);
|
|
4636
4379
|
try {
|
|
4637
4380
|
const q = this.queuesByRunId.get(runId) ?? [];
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
}
|
|
4655
|
-
await this.resumeAfterExecutionResult(cont, request, outputs ?? {});
|
|
4381
|
+
if (q.length === 0) return;
|
|
4382
|
+
const { request } = q.shift();
|
|
4383
|
+
const cont = this.continuation;
|
|
4384
|
+
if (!cont) throw new Error("InlineDrivingScheduler is missing a continuation (setContinuation was not called)");
|
|
4385
|
+
await cont.markNodeRunning({
|
|
4386
|
+
runId: request.runId,
|
|
4387
|
+
activationId: request.activationId,
|
|
4388
|
+
nodeId: request.nodeId,
|
|
4389
|
+
inputsByPort: request.kind === "multi" ? request.inputsByPort : { in: request.input }
|
|
4390
|
+
});
|
|
4391
|
+
let outputs;
|
|
4392
|
+
try {
|
|
4393
|
+
outputs = await this.nodeExecutor.execute(request);
|
|
4394
|
+
} catch (e) {
|
|
4395
|
+
await this.resumeAfterExecutionError(cont, request, this.asError(e));
|
|
4396
|
+
return;
|
|
4656
4397
|
}
|
|
4398
|
+
await this.resumeAfterExecutionResult(cont, request, outputs ?? {});
|
|
4657
4399
|
} finally {
|
|
4658
4400
|
if ((this.queuesByRunId.get(runId)?.length ?? 0) === 0) this.queuesByRunId.delete(runId);
|
|
4659
4401
|
this.drainingRuns.delete(runId);
|
|
@@ -4663,10 +4405,10 @@ var InlineDrivingScheduler = class {
|
|
|
4663
4405
|
scheduleDrain(runId) {
|
|
4664
4406
|
if (this.drainingRuns.has(runId) || this.scheduledRuns.has(runId)) return;
|
|
4665
4407
|
this.scheduledRuns.add(runId);
|
|
4666
|
-
|
|
4408
|
+
setImmediate(() => {
|
|
4667
4409
|
this.scheduledRuns.delete(runId);
|
|
4668
4410
|
this.drainRun(runId);
|
|
4669
|
-
}
|
|
4411
|
+
});
|
|
4670
4412
|
}
|
|
4671
4413
|
async resumeAfterExecutionResult(continuation, request, outputs) {
|
|
4672
4414
|
try {
|
|
@@ -4916,6 +4658,12 @@ var InMemoryBinaryStorage = class {
|
|
|
4916
4658
|
async delete(storageKey) {
|
|
4917
4659
|
this.values.delete(storageKey);
|
|
4918
4660
|
}
|
|
4661
|
+
async deleteMany(storageKeys) {
|
|
4662
|
+
for (const key of storageKeys) this.values.delete(key);
|
|
4663
|
+
}
|
|
4664
|
+
async listByPrefix(prefix) {
|
|
4665
|
+
return Array.from(this.values.keys()).filter((key) => key.startsWith(prefix));
|
|
4666
|
+
}
|
|
4919
4667
|
};
|
|
4920
4668
|
|
|
4921
4669
|
//#endregion
|
|
@@ -6144,5 +5892,5 @@ var WorkflowRepositoryWebhookTriggerMatcherFactory = class {
|
|
|
6144
5892
|
};
|
|
6145
5893
|
|
|
6146
5894
|
//#endregion
|
|
6147
|
-
export {
|
|
6148
|
-
//# sourceMappingURL=runtime-
|
|
5895
|
+
export { CostTrackingTelemetryMetricNames as $, PersistedWorkflowTokenRegistry as A, PersistedRuntimeTypeNameResolver as At, DefaultExecutionContextFactory as B, DefaultDrivingScheduler as C, chatModel as Ct, NodeInstanceFactoryFactory as D, InjectableRuntimeDecoratorComposer as Dt, StaticCostCatalog as E, tool as Et, RunnableOutputBehaviorResolver as F, NoOpExecutionTelemetryFactory as G, GenAiTelemetryAttributeNames as H, NodeOutputNormalizer as I, NoOpTelemetrySpanScope as J, NoOpExecutionTelemetry as K, ItemExprResolver as L, NodeExecutorFactory as M, NodeExecutor as N, NodeInstanceFactory as O, PersistedRuntimeTypeMetadataStore as Ot, InProcessRetryRunnerFactory as P, CostTrackingTelemetryAttributeNames as Q, InProcessRetryRunner as R, HintOnlyOffloadPolicy as S, WhenBuilder as St, RunPolicySnapshotFactory as T, node as Tt, CodemationTelemetryAttributeNames as U, CodemationTelemetryMetricNames as V, AllWorkflowsActiveWorkflowActivationPolicy as W, NoOpCostTrackingTelemetryFactory as X, NoOpTelemetryArtifactReference as Y, NoOpCostTrackingTelemetry as Z, RunTerminalPersistenceCoordinator as _, ConnectionInvocationIdFactory as _t, InMemoryLiveWorkflowRepository as a, isUnbrandedPortsEmissionShape as at, LocalOnlyScheduler as b, NodeIdSlugifier as bt, EngineFactory as c, getOriginIndexFromItem as ct, PollingTriggerRuntime as d, UnavailableBinaryStorage as dt, ExpRetryPolicy as et, PollingTriggerDedupWindow as f, NodeEventPublisher as ft, WorkflowPolicyErrorServices as g, WorkflowExecutableNodeClassifier as gt, WorkflowStoragePolicyEvaluator as h, WorkflowExecutableNodeClassifierFactory as ht, RunIntentService as i, isPortsEmission as it, MissingRuntimeTriggerToken as j, WorkflowSnapshotCodec as k, StackTraceCallSitePathResolver as kt, Engine as l, ChildExecutionScopeFactory as lt, InMemoryBinaryStorage as m, DefaultWorkflowGraphFactory as mt, WorkflowRepositoryWebhookTriggerMatcher as n, NoRetryPolicy as nt, EngineWorkflowRunnerServiceFactory as o, DefaultAsyncSleeper as ot, InMemoryRunDataFactory as p, ConnectionInvocationEventPublisher as pt, NoOpNodeExecutionTelemetry as q, RunIntentServiceFactory as r, emitPorts as rt, EngineWorkflowRunnerService as s, CredentialResolverFactory as st, WorkflowRepositoryWebhookTriggerMatcherFactory as t, RetryPolicy as tt, NoOpPollingTriggerLogger as u, DefaultExecutionBinaryService as ut, ENGINE_EXECUTION_LIMITS_DEFAULTS as v, WorkflowBuilder as vt, ConfigDrivenOffloadPolicy as w, getPersistedRuntimeTypeMetadata as wt, InlineDrivingScheduler as x, ChainCursor as xt, EngineExecutionLimitsPolicy as y, WorkflowDefinitionError as yt, CatalogBackedCostTrackingTelemetryFactory as z };
|
|
5896
|
+
//# sourceMappingURL=runtime-cxmUkk0l.js.map
|