@codemation/core 0.0.19 → 0.2.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 +22 -0
- package/dist/EngineRuntimeRegistration.types-0sgV2XL2.d.ts +42 -0
- package/dist/EngineWorkflowRunnerService-Dx7bJsJR.d.cts +73 -0
- package/dist/InMemoryRunDataFactory-qIYQEar7.d.cts +94 -0
- package/dist/{InMemoryLiveWorkflowRepository-DxoualoC.d.ts → RunIntentService-BCvGdOSY.d.ts} +438 -9
- package/dist/{RunIntentService-C1nu_YwM.js → RunIntentService-BFA48UpH.js} +252 -67
- package/dist/RunIntentService-BFA48UpH.js.map +1 -0
- package/dist/{InMemoryLiveWorkflowRepository-orY1VsWG.d.cts → RunIntentService-CV8izV8t.d.cts} +214 -7
- package/dist/{RunIntentService-ZkjpY7MS.cjs → RunIntentService-DcxXf_AM.cjs} +262 -65
- package/dist/RunIntentService-DcxXf_AM.cjs.map +1 -0
- package/dist/bootstrap/index.cjs +14 -1135
- package/dist/bootstrap/index.d.cts +7 -60
- package/dist/bootstrap/index.d.ts +4 -40
- package/dist/bootstrap/index.js +3 -1122
- package/dist/bootstrap-D67Sf2BF.js +1136 -0
- package/dist/bootstrap-D67Sf2BF.js.map +1 -0
- package/dist/bootstrap-DoQHAEQJ.cjs +1203 -0
- package/dist/bootstrap-DoQHAEQJ.cjs.map +1 -0
- package/dist/{index-BIewO9-9.d.ts → index-CueSzHsf.d.ts} +37 -260
- package/dist/index.cjs +99 -223
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +201 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.js +93 -218
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +329 -3
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +181 -4
- package/dist/testing.d.ts +181 -3
- package/dist/testing.js +319 -2
- package/dist/testing.js.map +1 -1
- package/dist/workflowActivationPolicy-B8HzTk3o.js +201 -0
- package/dist/workflowActivationPolicy-B8HzTk3o.js.map +1 -0
- package/dist/workflowActivationPolicy-BzyzXLa_.cjs +231 -0
- package/dist/workflowActivationPolicy-BzyzXLa_.cjs.map +1 -0
- package/package.json +1 -1
- package/src/ai/AgentConnectionNodeCollector.ts +99 -0
- package/src/ai/AgentToolFactory.ts +38 -2
- package/src/ai/AiHost.ts +1 -1
- package/src/authoring/defineNode.types.ts +6 -0
- package/src/browser.ts +11 -0
- package/src/contracts/executionPersistenceContracts.ts +186 -0
- package/src/contracts/index.ts +1 -0
- package/src/contracts/runFinishedAtFactory.ts +5 -2
- package/src/contracts/runTypes.ts +10 -0
- package/src/contracts/runtimeTypes.ts +6 -2
- package/src/contracts/workflowTypes.ts +3 -2
- package/src/events/EventPublishingWorkflowExecutionRepository.ts +5 -0
- package/src/execution/ActivationEnqueueService.ts +8 -8
- package/src/execution/PersistedRunStateTerminalBuilder.ts +3 -0
- package/src/index.ts +6 -0
- package/src/orchestration/NodeExecutionRequestHandlerService.ts +11 -6
- package/src/orchestration/RunContinuationService.ts +94 -24
- package/src/runStorage/InMemoryWorkflowExecutionRepository.ts +14 -1
- package/src/scheduler/DefaultDrivingScheduler.ts +21 -11
- package/src/scheduler/InlineDrivingScheduler.ts +17 -21
- package/src/testing/CapturingScheduler.ts +15 -0
- package/src/testing/EngineTestKitRunIdFactory.ts +24 -0
- package/src/testing/InMemoryTriggerSetupStateRepository.ts +21 -0
- package/src/testing/PrefixedSequentialIdGenerator.ts +17 -0
- package/src/testing/RegistrarEngineTestKit.types.ts +76 -0
- package/src/testing/RegistrarEngineTestKitFactory.ts +154 -0
- package/src/testing/SubWorkflowRunnerTestNode.ts +83 -0
- package/src/testing/WorkflowTestHarnessManualTrigger.ts +39 -0
- package/src/testing/WorkflowTestKit.types.ts +9 -0
- package/src/testing/WorkflowTestKitBuilder.ts +77 -0
- package/src/testing/WorkflowTestKitNodeRegistrationContextFactory.ts +17 -0
- package/src/testing/WorkflowTestKitRunNodeWorkflowFactory.ts +26 -0
- package/src/testing.ts +19 -0
- package/src/types/index.ts +1 -0
- package/src/workflow/definition/ConnectionNodeIdFactory.ts +28 -0
- package/dist/InMemoryLiveWorkflowRepository-BTzHpQ6e.cjs +0 -151
- package/dist/InMemoryLiveWorkflowRepository-BTzHpQ6e.cjs.map +0 -1
- package/dist/InMemoryLiveWorkflowRepository-BoLNnVLg.js +0 -139
- package/dist/InMemoryLiveWorkflowRepository-BoLNnVLg.js.map +0 -1
- package/dist/RunIntentService-C1nu_YwM.js.map +0 -1
- package/dist/RunIntentService-DjbxzBBP.d.cts +0 -288
- package/dist/RunIntentService-ZkjpY7MS.cjs.map +0 -1
- package/dist/WorkflowSnapshotCodec-DSEzKyt3.d.cts +0 -22
- package/dist/bootstrap/index.cjs.map +0 -1
- package/dist/bootstrap/index.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { t as
|
|
1
|
+
import { $ as delay, B as NodeEventPublisher, F as DefaultAsyncSleeper, G as getPersistedRuntimeTypeMetadata, H as WorkflowExecutableNodeClassifier, I as CredentialResolverFactory, J as InjectableRuntimeDecoratorComposer, K as node, N as InProcessRetryRunner, P as DefaultExecutionContextFactory, Q as container, R as DefaultExecutionBinaryService, U as ConnectionNodeIdFactory, V as WorkflowExecutableNodeClassifierFactory, W as chatModel, X as StackTraceCallSitePathResolver, Y as PersistedRuntimeTypeMetadataStore, Z as PersistedRuntimeTypeNameResolver, a as InMemoryBinaryStorage, at as predicateAwareClassFactory, ct as CoreTokens, et as inject, i as InMemoryRunDataFactory, it as instancePerContainerCachingFactory, n as InMemoryLiveWorkflowRepository, nt as injectable, ot as registry, q as tool, r as RunFinishedAtFactory, rt as instanceCachingFactory, s as EngineExecutionLimitsPolicy, st as singleton, t as RunIntentService, tt as injectAll, z as UnavailableBinaryStorage } from "./RunIntentService-BFA48UpH.js";
|
|
2
|
+
import { a as WhenBuilder, i as ChainCursor, n as InMemoryRunEventBus, r as WorkflowBuilder, t as AllWorkflowsActiveWorkflowActivationPolicy } from "./workflowActivationPolicy-B8HzTk3o.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
|
|
@@ -83,6 +83,7 @@ function defineNode(options) {
|
|
|
83
83
|
const DefinedRunnableNodeConfig = class {
|
|
84
84
|
kind = "node";
|
|
85
85
|
type = DefinedNodeRuntime;
|
|
86
|
+
icon = options.icon;
|
|
86
87
|
constructor(name, config, id) {
|
|
87
88
|
this.name = name;
|
|
88
89
|
this.config = config;
|
|
@@ -235,11 +236,48 @@ var NodeBackedToolConfig = class {
|
|
|
235
236
|
}
|
|
236
237
|
};
|
|
237
238
|
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/ai/AgentConfigInspectorFactory.ts
|
|
241
|
+
var AgentConfigInspector = class {
|
|
242
|
+
static isAgentNodeConfig(config) {
|
|
243
|
+
if (!config) return false;
|
|
244
|
+
const candidate = config;
|
|
245
|
+
return !!candidate.chatModel && this.hasCompatibleMessageConfiguration(candidate);
|
|
246
|
+
}
|
|
247
|
+
static hasCompatibleMessageConfiguration(candidate) {
|
|
248
|
+
const messages = candidate.messages;
|
|
249
|
+
if (messages === void 0 || messages === null) return false;
|
|
250
|
+
if (Array.isArray(messages)) return messages.length > 0;
|
|
251
|
+
if (typeof messages === "object") {
|
|
252
|
+
const o = messages;
|
|
253
|
+
return Array.isArray(o.prompt) && o.prompt.length > 0 || typeof o.buildMessages === "function";
|
|
254
|
+
}
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
|
|
238
259
|
//#endregion
|
|
239
260
|
//#region src/ai/AgentToolFactory.ts
|
|
240
261
|
var AgentToolFactoryImpl = class {
|
|
241
262
|
asTool(node$1, options) {
|
|
242
|
-
return new NodeBackedToolConfig(options.name ?? node$1.name ?? "tool", node$1, options);
|
|
263
|
+
return new NodeBackedToolConfig(options.name ?? node$1.name ?? "tool", node$1, this.withDefaultAgentInputMapper(node$1, options));
|
|
264
|
+
}
|
|
265
|
+
withDefaultAgentInputMapper(node$1, options) {
|
|
266
|
+
if (options.mapInput || !AgentConfigInspector.isAgentNodeConfig(node$1)) return options;
|
|
267
|
+
return {
|
|
268
|
+
...options,
|
|
269
|
+
mapInput: ({ input: input$1, item }) => this.mergeAgentToolInputWithCurrentItem(input$1, item)
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
mergeAgentToolInputWithCurrentItem(input$1, item) {
|
|
273
|
+
if (!this.isMergeableRecord(input$1) || !this.isMergeableRecord(item.json)) return input$1;
|
|
274
|
+
return {
|
|
275
|
+
...item.json,
|
|
276
|
+
...input$1
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
isMergeableRecord(value) {
|
|
280
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
243
281
|
}
|
|
244
282
|
};
|
|
245
283
|
const AgentToolFactory = new AgentToolFactoryImpl();
|
|
@@ -269,26 +307,6 @@ var AgentMessageConfigNormalizer = class {
|
|
|
269
307
|
}
|
|
270
308
|
};
|
|
271
309
|
|
|
272
|
-
//#endregion
|
|
273
|
-
//#region src/ai/AgentConfigInspectorFactory.ts
|
|
274
|
-
var AgentConfigInspector = class {
|
|
275
|
-
static isAgentNodeConfig(config) {
|
|
276
|
-
if (!config) return false;
|
|
277
|
-
const candidate = config;
|
|
278
|
-
return !!candidate.chatModel && this.hasCompatibleMessageConfiguration(candidate);
|
|
279
|
-
}
|
|
280
|
-
static hasCompatibleMessageConfiguration(candidate) {
|
|
281
|
-
const messages = candidate.messages;
|
|
282
|
-
if (messages === void 0 || messages === null) return false;
|
|
283
|
-
if (Array.isArray(messages)) return messages.length > 0;
|
|
284
|
-
if (typeof messages === "object") {
|
|
285
|
-
const o = messages;
|
|
286
|
-
return Array.isArray(o.prompt) && o.prompt.length > 0 || typeof o.buildMessages === "function";
|
|
287
|
-
}
|
|
288
|
-
return false;
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
|
|
292
310
|
//#endregion
|
|
293
311
|
//#region src/ai/AiHost.ts
|
|
294
312
|
/** Defaults aligned with common tool-agent iteration limits (many products use ~10 max rounds). */
|
|
@@ -298,155 +316,57 @@ const AgentGuardrailDefaults = {
|
|
|
298
316
|
};
|
|
299
317
|
|
|
300
318
|
//#endregion
|
|
301
|
-
//#region src/
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
this.
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
319
|
+
//#region src/ai/AgentConnectionNodeCollector.ts
|
|
320
|
+
const AgentConnectionNodeCollector = new class {
|
|
321
|
+
collect(parentNodeId, agentConfig) {
|
|
322
|
+
const collected = [];
|
|
323
|
+
this.collectInto(parentNodeId, agentConfig, collected);
|
|
324
|
+
return collected;
|
|
325
|
+
}
|
|
326
|
+
collectInto(parentNodeId, agentConfig, collected) {
|
|
327
|
+
collected.push({
|
|
328
|
+
nodeId: ConnectionNodeIdFactory.languageModelConnectionNodeId(parentNodeId),
|
|
329
|
+
parentNodeId,
|
|
330
|
+
connectionName: "llm",
|
|
331
|
+
role: "languageModel",
|
|
332
|
+
name: agentConfig.chatModel.presentation?.label ?? agentConfig.chatModel.name,
|
|
333
|
+
typeName: agentConfig.chatModel.name,
|
|
334
|
+
icon: agentConfig.chatModel.presentation?.icon,
|
|
335
|
+
credentialSource: agentConfig.chatModel
|
|
336
|
+
});
|
|
337
|
+
for (const tool$1 of agentConfig.tools ?? []) {
|
|
338
|
+
const toolNodeId = ConnectionNodeIdFactory.toolConnectionNodeId(parentNodeId, tool$1.name);
|
|
339
|
+
const isNestedAgent = this.isNodeBackedAgentTool(tool$1);
|
|
340
|
+
collected.push({
|
|
341
|
+
nodeId: toolNodeId,
|
|
342
|
+
parentNodeId,
|
|
343
|
+
connectionName: "tools",
|
|
344
|
+
role: isNestedAgent ? "nestedAgent" : "tool",
|
|
345
|
+
name: tool$1.presentation?.label ?? tool$1.name,
|
|
346
|
+
typeName: tool$1.name,
|
|
347
|
+
icon: tool$1.presentation?.icon,
|
|
348
|
+
credentialSource: tool$1
|
|
325
349
|
});
|
|
350
|
+
this.collectNestedAgentTools(toolNodeId, tool$1, collected);
|
|
326
351
|
}
|
|
327
|
-
return this;
|
|
328
|
-
}
|
|
329
|
-
when = (branch, steps, ...more) => {
|
|
330
|
-
const list = Array.isArray(steps) ? steps : [steps, ...more];
|
|
331
|
-
const port = branch ? "true" : "false";
|
|
332
|
-
const b = new WhenBuilder(this.wf, this.from, port);
|
|
333
|
-
b.addBranch(list);
|
|
334
|
-
return b;
|
|
335
|
-
};
|
|
336
|
-
build() {
|
|
337
|
-
return this.wf.build();
|
|
338
352
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const list = Array.isArray(steps) ? steps : steps ? [steps, ...more] : more;
|
|
357
|
-
const port = arg1 ? "true" : "false";
|
|
358
|
-
const b = new WhenBuilder(this.wf, this.cursor, port);
|
|
359
|
-
b.addBranch(list);
|
|
360
|
-
return b;
|
|
361
|
-
}
|
|
362
|
-
const branches = arg1;
|
|
363
|
-
const makeMerge = this.wf.options?.makeMergeNode;
|
|
364
|
-
if (!makeMerge) throw new Error("WorkflowBuilder is missing options.makeMergeNode (required for when({true,false}). Use createWorkflowBuilder from \"@codemation/core-nodes\".");
|
|
365
|
-
const wfAny = this.wf;
|
|
366
|
-
const buildBranch = (port, branchSteps) => {
|
|
367
|
-
const list = branchSteps ?? [];
|
|
368
|
-
let prev = null;
|
|
369
|
-
for (const cfg of list) {
|
|
370
|
-
const ref = wfAny.add(cfg);
|
|
371
|
-
if (!prev) wfAny.connect(this.cursor, ref, port, "in");
|
|
372
|
-
else wfAny.connect(prev, ref, "main", "in");
|
|
373
|
-
prev = ref;
|
|
374
|
-
}
|
|
375
|
-
if (!prev) return {
|
|
376
|
-
end: this.cursor,
|
|
377
|
-
endOutput: port
|
|
378
|
-
};
|
|
379
|
-
return {
|
|
380
|
-
end: prev,
|
|
381
|
-
endOutput: "main"
|
|
382
|
-
};
|
|
383
|
-
};
|
|
384
|
-
const t = buildBranch("true", branches.true);
|
|
385
|
-
const f = buildBranch("false", branches.false);
|
|
386
|
-
const merge = wfAny.add(makeMerge("Merge (auto)"));
|
|
387
|
-
wfAny.connect(t.end, merge, t.endOutput, "true");
|
|
388
|
-
wfAny.connect(f.end, merge, f.endOutput, "false");
|
|
389
|
-
return new ChainCursor(this.wf, merge, "main");
|
|
390
|
-
});
|
|
391
|
-
build() {
|
|
392
|
-
return this.wf.build();
|
|
393
|
-
}
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
//#endregion
|
|
397
|
-
//#region src/workflow/dsl/WorkflowBuilder.ts
|
|
398
|
-
var WorkflowBuilder = class {
|
|
399
|
-
nodes = [];
|
|
400
|
-
edges = [];
|
|
401
|
-
seq = 0;
|
|
402
|
-
constructor(meta, options) {
|
|
403
|
-
this.meta = meta;
|
|
404
|
-
this.options = options;
|
|
405
|
-
}
|
|
406
|
-
add(config) {
|
|
407
|
-
const tokenName = typeof config.type === "function" ? config.type.name : String(config.type);
|
|
408
|
-
const id = config.id ?? `${tokenName}:${++this.seq}`;
|
|
409
|
-
this.nodes.push({
|
|
410
|
-
id,
|
|
411
|
-
kind: config.kind,
|
|
412
|
-
type: config.type,
|
|
413
|
-
name: config.name,
|
|
414
|
-
config
|
|
415
|
-
});
|
|
416
|
-
return {
|
|
417
|
-
id,
|
|
418
|
-
kind: config.kind,
|
|
419
|
-
name: config.name
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
connect(from, to, fromOutput = "main", toInput = "in") {
|
|
423
|
-
this.edges.push({
|
|
424
|
-
from: {
|
|
425
|
-
nodeId: from.id,
|
|
426
|
-
output: fromOutput
|
|
427
|
-
},
|
|
428
|
-
to: {
|
|
429
|
-
nodeId: to.id,
|
|
430
|
-
input: toInput
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
trigger(config) {
|
|
435
|
-
const ref = this.add(config);
|
|
436
|
-
return new ChainCursor(this, ref, "main");
|
|
437
|
-
}
|
|
438
|
-
start(config) {
|
|
439
|
-
const ref = this.add(config);
|
|
440
|
-
return new ChainCursor(this, ref, "main");
|
|
441
|
-
}
|
|
442
|
-
build() {
|
|
443
|
-
return {
|
|
444
|
-
...this.meta,
|
|
445
|
-
nodes: this.nodes,
|
|
446
|
-
edges: this.edges
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
};
|
|
353
|
+
collectNestedAgentTools(toolNodeId, tool$1, collected) {
|
|
354
|
+
if (!this.isNodeBackedAgentTool(tool$1)) return;
|
|
355
|
+
const innerAgent = tool$1 instanceof NodeBackedToolConfig ? tool$1.node : tool$1.node;
|
|
356
|
+
this.collectInto(toolNodeId, innerAgent, collected);
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* After JSON round-trip (persisted snapshots), tools are plain objects — `instanceof NodeBackedToolConfig` fails.
|
|
360
|
+
* Detect node-backed tools structurally via {@link NodeBackedToolConfig#toolKind}.
|
|
361
|
+
*/
|
|
362
|
+
isNodeBackedAgentTool(tool$1) {
|
|
363
|
+
if (tool$1 instanceof NodeBackedToolConfig) return AgentConfigInspector.isAgentNodeConfig(tool$1.node);
|
|
364
|
+
if (!tool$1 || typeof tool$1 !== "object") return false;
|
|
365
|
+
const t = tool$1;
|
|
366
|
+
if (t.toolKind !== "nodeBacked") return false;
|
|
367
|
+
return AgentConfigInspector.isAgentNodeConfig(t.node);
|
|
368
|
+
}
|
|
369
|
+
}();
|
|
450
370
|
|
|
451
371
|
//#endregion
|
|
452
372
|
//#region src/workflow/definition/ConnectionInvocationIdFactory.ts
|
|
@@ -492,45 +412,6 @@ var DefaultWorkflowGraphFactory = class {
|
|
|
492
412
|
}
|
|
493
413
|
};
|
|
494
414
|
|
|
495
|
-
//#endregion
|
|
496
|
-
//#region src/events/InMemoryRunEventSubscription.ts
|
|
497
|
-
var InMemoryRunEventSubscription = class {
|
|
498
|
-
constructor(onClose) {
|
|
499
|
-
this.onClose = onClose;
|
|
500
|
-
}
|
|
501
|
-
async close() {
|
|
502
|
-
this.onClose();
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
//#endregion
|
|
507
|
-
//#region src/events/InMemoryRunEventBusRegistry.ts
|
|
508
|
-
var InMemoryRunEventBus = class {
|
|
509
|
-
globalListeners = /* @__PURE__ */ new Set();
|
|
510
|
-
listenersByWorkflowId = /* @__PURE__ */ new Map();
|
|
511
|
-
async publish(event) {
|
|
512
|
-
for (const listener of this.globalListeners) listener(event);
|
|
513
|
-
for (const listener of this.listenersByWorkflowId.get(event.workflowId) ?? []) listener(event);
|
|
514
|
-
}
|
|
515
|
-
async subscribe(onEvent) {
|
|
516
|
-
this.globalListeners.add(onEvent);
|
|
517
|
-
return new InMemoryRunEventSubscription(() => {
|
|
518
|
-
this.globalListeners.delete(onEvent);
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
async subscribeToWorkflow(workflowId, onEvent) {
|
|
522
|
-
const existing = this.listenersByWorkflowId.get(workflowId) ?? /* @__PURE__ */ new Set();
|
|
523
|
-
existing.add(onEvent);
|
|
524
|
-
this.listenersByWorkflowId.set(workflowId, existing);
|
|
525
|
-
return new InMemoryRunEventSubscription(() => {
|
|
526
|
-
const listeners = this.listenersByWorkflowId.get(workflowId);
|
|
527
|
-
if (!listeners) return;
|
|
528
|
-
listeners.delete(onEvent);
|
|
529
|
-
if (listeners.size === 0) this.listenersByWorkflowId.delete(workflowId);
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
};
|
|
533
|
-
|
|
534
415
|
//#endregion
|
|
535
416
|
//#region src/events/EventPublishingWorkflowExecutionRepository.ts
|
|
536
417
|
var EventPublishingWorkflowExecutionRepository = class {
|
|
@@ -552,6 +433,9 @@ var EventPublishingWorkflowExecutionRepository = class {
|
|
|
552
433
|
async load(runId) {
|
|
553
434
|
return await this.inner.load(runId);
|
|
554
435
|
}
|
|
436
|
+
async loadSchedulingState(runId) {
|
|
437
|
+
return await this.inner.loadSchedulingState(runId);
|
|
438
|
+
}
|
|
555
439
|
async save(state) {
|
|
556
440
|
await this.inner.save(state);
|
|
557
441
|
await this.eventBus.publish({
|
|
@@ -677,14 +561,5 @@ var CredentialUnboundError = class CredentialUnboundError extends Error {
|
|
|
677
561
|
const branchRef = (index) => `$${index}`;
|
|
678
562
|
|
|
679
563
|
//#endregion
|
|
680
|
-
|
|
681
|
-
/** Default for tests and harnesses: every workflow is treated as active (legacy behavior). */
|
|
682
|
-
var AllWorkflowsActiveWorkflowActivationPolicy = class {
|
|
683
|
-
isActive(_workflowId) {
|
|
684
|
-
return true;
|
|
685
|
-
}
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
//#endregion
|
|
689
|
-
export { AgentConfigInspector, AgentGuardrailDefaults, AgentMessageConfigNormalizer, AgentToolFactory, AllWorkflowsActiveWorkflowActivationPolicy, ChainCursor, ConnectionInvocationIdFactory, ConnectionNodeIdFactory, CoreTokens, CredentialResolverFactory, CredentialUnboundError, DefaultAsyncSleeper, DefaultExecutionBinaryService, DefaultExecutionContextFactory, DefaultWorkflowGraphFactory, DefinedNodeRegistry, EngineExecutionLimitsPolicy, EventPublishingWorkflowExecutionRepository, ExpRetryPolicy, InMemoryBinaryStorage, InMemoryLiveWorkflowRepository, InMemoryRunDataFactory, InMemoryRunEventBus, InProcessRetryRunner, InjectableRuntimeDecoratorComposer, ItemsInputNormalizer, NoRetryPolicy, NodeBackedToolConfig, NodeEventPublisher, PersistedRuntimeTypeMetadataStore, PersistedRuntimeTypeNameResolver, RetryPolicy, RunFinishedAtFactory, RunIntentService, StackTraceCallSitePathResolver, SystemClock, UnavailableBinaryStorage, WhenBuilder, WorkflowBuilder, WorkflowExecutableNodeClassifier, WorkflowExecutableNodeClassifierFactory, branchRef, chatModel, container, defineCredential, defineNode, delay, getPersistedRuntimeTypeMetadata, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, node, predicateAwareClassFactory, registry, singleton, tool };
|
|
564
|
+
export { AgentConfigInspector, AgentConnectionNodeCollector, AgentGuardrailDefaults, AgentMessageConfigNormalizer, AgentToolFactory, AllWorkflowsActiveWorkflowActivationPolicy, ChainCursor, ConnectionInvocationIdFactory, ConnectionNodeIdFactory, CoreTokens, CredentialResolverFactory, CredentialUnboundError, DefaultAsyncSleeper, DefaultExecutionBinaryService, DefaultExecutionContextFactory, DefaultWorkflowGraphFactory, DefinedNodeRegistry, EngineExecutionLimitsPolicy, EventPublishingWorkflowExecutionRepository, ExpRetryPolicy, InMemoryBinaryStorage, InMemoryLiveWorkflowRepository, InMemoryRunDataFactory, InMemoryRunEventBus, InProcessRetryRunner, InjectableRuntimeDecoratorComposer, ItemsInputNormalizer, NoRetryPolicy, NodeBackedToolConfig, NodeEventPublisher, PersistedRuntimeTypeMetadataStore, PersistedRuntimeTypeNameResolver, RetryPolicy, RunFinishedAtFactory, RunIntentService, StackTraceCallSitePathResolver, SystemClock, UnavailableBinaryStorage, WhenBuilder, WorkflowBuilder, WorkflowExecutableNodeClassifier, WorkflowExecutableNodeClassifierFactory, branchRef, chatModel, container, defineCredential, defineNode, delay, getPersistedRuntimeTypeMetadata, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, node, predicateAwareClassFactory, registry, singleton, tool };
|
|
690
565
|
//# sourceMappingURL=index.js.map
|