@ai-setting/roy-agent-core 1.7.49 → 1.7.51
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/dist/config/index.js +7 -7
- package/dist/env/agent/index.js +10 -10
- package/dist/env/commands/index.js +7 -7
- package/dist/env/context/index.js +3 -3
- package/dist/env/debug/index.js +7 -7
- package/dist/env/event-source/index.js +17 -14
- package/dist/env/hook/index.js +9 -6
- package/dist/env/index.js +38 -34
- package/dist/env/llm/index.js +7 -7
- package/dist/env/log-trace/index.js +7 -7
- package/dist/env/mcp/index.js +7 -7
- package/dist/env/memory/index.js +11 -11
- package/dist/env/plugin/index.js +7 -7
- package/dist/env/prompt/index.js +8 -8
- package/dist/env/session/index.js +7 -7
- package/dist/env/skill/index.js +7 -7
- package/dist/env/task/delegate/index.js +8 -8
- package/dist/env/task/index.js +17 -17
- package/dist/env/task/plugins/index.js +10 -9
- package/dist/env/task/storage/index.js +2 -2
- package/dist/env/task/tools/index.js +3 -3
- package/dist/env/tool/built-in/index.js +2 -2
- package/dist/env/tool/index.js +8 -8
- package/dist/env/workflow/engine/index.js +12 -9
- package/dist/env/workflow/hooks/index.js +25 -0
- package/dist/env/workflow/index.js +19 -17
- package/dist/env/workflow/nodes/index.js +2 -2
- package/dist/env/workflow/plugins/index.js +18 -0
- package/dist/env/workflow/service/index.js +2 -2
- package/dist/env/workflow/storage/index.js +3 -3
- package/dist/env/workflow/tools/index.js +11 -11
- package/dist/env/workflow/utils/index.js +24 -4
- package/dist/index.js +79 -70
- package/dist/shared/@ai-setting/{roy-agent-core-3ajh3cdj.js → roy-agent-core-0cfaqnz9.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-trd6my5j.js → roy-agent-core-1cv9j4dg.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-48f17g3x.js → roy-agent-core-2gay3sjt.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-e302nvzt.js → roy-agent-core-2k4xffaa.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-1pjct4nj.js → roy-agent-core-35s1w7tc.js} +230 -96
- package/dist/shared/@ai-setting/{roy-agent-core-hqtp5m8v.js → roy-agent-core-39xejr39.js} +13 -13
- package/dist/shared/@ai-setting/{roy-agent-core-v6zdngr7.js → roy-agent-core-3tv1q6f2.js} +8 -8
- package/dist/shared/@ai-setting/{roy-agent-core-mqaht7mm.js → roy-agent-core-4z3rq5gw.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-fm77q3tn.js → roy-agent-core-5apmk4qw.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-xmfyt3dg.js → roy-agent-core-6167phd4.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-wt37tszm.js → roy-agent-core-7evvpfwc.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-azdsyhvx.js → roy-agent-core-7g03zkkb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-v2d0bt7e.js → roy-agent-core-8s9jd2qy.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8pqq9yjt.js → roy-agent-core-978b6wfx.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-9csa89jx.js +46 -0
- package/dist/shared/@ai-setting/{roy-agent-core-x8ebdrtn.js → roy-agent-core-9faekt5n.js} +9 -5
- package/dist/shared/@ai-setting/{roy-agent-core-cnsjr3ws.js → roy-agent-core-9jzysq50.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-5ja22qkf.js → roy-agent-core-ak4dc3kg.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ncaqkyfj.js → roy-agent-core-athdr2m0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-bt6h398s.js → roy-agent-core-dsevjbck.js} +20 -7
- package/dist/shared/@ai-setting/{roy-agent-core-5hjtbvxf.js → roy-agent-core-dv714bqh.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-k0mx0tkh.js → roy-agent-core-dwx9hjwx.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-fs36xgcs.js +13 -0
- package/dist/shared/@ai-setting/{roy-agent-core-ydwtpzyf.js → roy-agent-core-fvs48d38.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-223v204d.js → roy-agent-core-gdsqp6j8.js} +139 -15
- package/dist/shared/@ai-setting/{roy-agent-core-emjpkx9s.js → roy-agent-core-k8b440n3.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-5vf48m39.js → roy-agent-core-kyasfzeh.js} +75 -754
- package/dist/shared/@ai-setting/roy-agent-core-na73mym1.js +367 -0
- package/dist/shared/@ai-setting/{roy-agent-core-j783tcqb.js → roy-agent-core-nde5gzta.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-e2569ptp.js → roy-agent-core-ne2t1pay.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-k0sy76cw.js → roy-agent-core-p2r27era.js} +17 -13
- package/dist/shared/@ai-setting/{roy-agent-core-xvf97xs4.js → roy-agent-core-p8ak03s0.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-56j2q0w6.js → roy-agent-core-qamktze3.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-khx0h4j2.js → roy-agent-core-qcspfszy.js} +11 -4
- package/dist/shared/@ai-setting/{roy-agent-core-rqyxdrxg.js → roy-agent-core-qm9jda8p.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-yq45m8mm.js → roy-agent-core-rnwr39b0.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-ed4tbkyj.js → roy-agent-core-rx16h2m1.js} +7 -3
- package/dist/shared/@ai-setting/{roy-agent-core-sea232w4.js → roy-agent-core-s214vmmd.js} +13 -13
- package/dist/shared/@ai-setting/{roy-agent-core-ecb8am8s.js → roy-agent-core-skzjs973.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-zc9k2n3c.js → roy-agent-core-stnddvx9.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-f51kwn6m.js → roy-agent-core-t37wbysj.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-xn12d221.js → roy-agent-core-tdbv7ff4.js} +5 -3
- package/dist/shared/@ai-setting/{roy-agent-core-yes3mr8n.js → roy-agent-core-tjg71zqp.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-yge38dkn.js → roy-agent-core-vrsxhw9e.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-kazn764f.js → roy-agent-core-vvxb9522.js} +20 -7
- package/dist/shared/@ai-setting/{roy-agent-core-vrj9c5y6.js → roy-agent-core-wwytg8rv.js} +14 -7
- package/dist/shared/@ai-setting/roy-agent-core-wxsgay02.js +302 -0
- package/dist/shared/@ai-setting/{roy-agent-core-c0mnxxck.js → roy-agent-core-x8n1r7h4.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-m9drr1fd.js → roy-agent-core-yd21n6c7.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-zff8vvs5.js → roy-agent-core-yhsssn86.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-zd077w51.js +1037 -0
- package/dist/shared/@ai-setting/{roy-agent-core-2bbj3jqd.js → roy-agent-core-zd3ddm4k.js} +1 -1
- package/package.json +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-98wwn2px.js +0 -35
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
AgentComponentAdapter,
|
|
9
9
|
init_agent_component_adapter
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-6167phd4.js";
|
|
11
11
|
import {
|
|
12
12
|
PythonCallNode,
|
|
13
13
|
SkillNode,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
init_skill_node,
|
|
18
18
|
init_tool_node,
|
|
19
19
|
init_workflow_node
|
|
20
|
-
} from "./roy-agent-core-
|
|
20
|
+
} from "./roy-agent-core-x8n1r7h4.js";
|
|
21
21
|
import {
|
|
22
22
|
WORKFLOW_SUBMIT_OUTPUT_TOOL_NAME,
|
|
23
23
|
init_json_schema_to_zod,
|
|
@@ -26,14 +26,22 @@ import {
|
|
|
26
26
|
parseWorkflowJsonOutput,
|
|
27
27
|
validateJsonOutputSchema
|
|
28
28
|
} from "./roy-agent-core-1db4vpc6.js";
|
|
29
|
+
import {
|
|
30
|
+
init_hooks
|
|
31
|
+
} from "./roy-agent-core-fs36xgcs.js";
|
|
32
|
+
import {
|
|
33
|
+
WorkflowHookPoints,
|
|
34
|
+
emitWorkflowNodeHook,
|
|
35
|
+
emitWorkflowRunHook
|
|
36
|
+
} from "./roy-agent-core-9csa89jx.js";
|
|
29
37
|
import {
|
|
30
38
|
TemplateResolver,
|
|
31
39
|
init_template_resolver
|
|
32
|
-
} from "./roy-agent-core-
|
|
40
|
+
} from "./roy-agent-core-tjg71zqp.js";
|
|
33
41
|
import {
|
|
34
42
|
DAGManager,
|
|
35
43
|
init_dag_manager
|
|
36
|
-
} from "./roy-agent-core-
|
|
44
|
+
} from "./roy-agent-core-8s9jd2qy.js";
|
|
37
45
|
import {
|
|
38
46
|
WorkflowError,
|
|
39
47
|
createWorkflowEvent,
|
|
@@ -49,7 +57,7 @@ import {
|
|
|
49
57
|
import {
|
|
50
58
|
TracedAs,
|
|
51
59
|
init_decorator
|
|
52
|
-
} from "./roy-agent-core-
|
|
60
|
+
} from "./roy-agent-core-dsevjbck.js";
|
|
53
61
|
import {
|
|
54
62
|
createLogger,
|
|
55
63
|
init_logger
|
|
@@ -400,6 +408,15 @@ var init_scheduler = __esm(() => {
|
|
|
400
408
|
log: true
|
|
401
409
|
})
|
|
402
410
|
], Scheduler.prototype, "getReadyNodes", null);
|
|
411
|
+
__legacyDecorateClassTS([
|
|
412
|
+
TracedAs("workflow.scheduler.markStarted", { recordParams: true, recordResult: false })
|
|
413
|
+
], Scheduler.prototype, "markStarted", null);
|
|
414
|
+
__legacyDecorateClassTS([
|
|
415
|
+
TracedAs("workflow.scheduler.markCompleted", { recordParams: true, recordResult: false })
|
|
416
|
+
], Scheduler.prototype, "markCompleted", null);
|
|
417
|
+
__legacyDecorateClassTS([
|
|
418
|
+
TracedAs("workflow.scheduler.markFailed", { recordParams: true, recordResult: false })
|
|
419
|
+
], Scheduler.prototype, "markFailed", null);
|
|
403
420
|
__legacyDecorateClassTS([
|
|
404
421
|
TracedAs("workflow.scheduler.processEdgesAfterCompletion", {
|
|
405
422
|
recordParams: true,
|
|
@@ -786,6 +803,18 @@ var init_executor = __esm(() => {
|
|
|
786
803
|
__legacyDecorateClassTS([
|
|
787
804
|
TracedAs("workflow.executor.executeNode", { recordParams: true, recordResult: true })
|
|
788
805
|
], Executor.prototype, "executeNode", null);
|
|
806
|
+
__legacyDecorateClassTS([
|
|
807
|
+
TracedAs("workflow.executor.executeWithTimeout", { recordParams: true, recordResult: true })
|
|
808
|
+
], Executor.prototype, "executeWithTimeout", null);
|
|
809
|
+
__legacyDecorateClassTS([
|
|
810
|
+
TracedAs("workflow.executor.executeWithRetry", { recordParams: true, recordResult: true })
|
|
811
|
+
], Executor.prototype, "executeWithRetry", null);
|
|
812
|
+
__legacyDecorateClassTS([
|
|
813
|
+
TracedAs("workflow.executor.cancelNode", { recordParams: true, recordResult: false })
|
|
814
|
+
], Executor.prototype, "cancelNode", null);
|
|
815
|
+
__legacyDecorateClassTS([
|
|
816
|
+
TracedAs("workflow.executor.cancelAll", { recordParams: false, recordResult: false })
|
|
817
|
+
], Executor.prototype, "cancelAll", null);
|
|
789
818
|
__legacyDecorateClassTS([
|
|
790
819
|
TracedAs("workflow.executor.writeNodeStart", { recordParams: true, recordResult: true })
|
|
791
820
|
], Executor.prototype, "writeNodeStart", null);
|
|
@@ -1292,97 +1321,7 @@ var init_ask_user_node = __esm(() => {
|
|
|
1292
1321
|
});
|
|
1293
1322
|
|
|
1294
1323
|
// src/env/workflow/engine/node-registry.ts
|
|
1295
|
-
|
|
1296
|
-
factories = new Map;
|
|
1297
|
-
toolRegistry;
|
|
1298
|
-
skillRegistry;
|
|
1299
|
-
agentRunner;
|
|
1300
|
-
workflowRunner;
|
|
1301
|
-
agentComponentAdapter;
|
|
1302
|
-
sessionComponent;
|
|
1303
|
-
constructor(options) {
|
|
1304
|
-
const {
|
|
1305
|
-
toolRegistry,
|
|
1306
|
-
skillRegistry,
|
|
1307
|
-
agentComponent,
|
|
1308
|
-
agentRunner,
|
|
1309
|
-
workflowRunner,
|
|
1310
|
-
sessionComponent
|
|
1311
|
-
} = options ?? {};
|
|
1312
|
-
this.toolRegistry = toolRegistry;
|
|
1313
|
-
this.skillRegistry = skillRegistry;
|
|
1314
|
-
this.workflowRunner = workflowRunner;
|
|
1315
|
-
this.sessionComponent = sessionComponent;
|
|
1316
|
-
if (agentRunner) {
|
|
1317
|
-
this.agentRunner = agentRunner;
|
|
1318
|
-
if (agentRunner.setSessionComponent && sessionComponent) {
|
|
1319
|
-
agentRunner.setSessionComponent(sessionComponent);
|
|
1320
|
-
}
|
|
1321
|
-
} else if (agentComponent) {
|
|
1322
|
-
this.agentComponentAdapter = new AgentComponentAdapter(agentComponent, {}, sessionComponent);
|
|
1323
|
-
this.agentRunner = this.agentComponentAdapter;
|
|
1324
|
-
}
|
|
1325
|
-
this.registerBuiltInTypes();
|
|
1326
|
-
}
|
|
1327
|
-
getAgentAdapter() {
|
|
1328
|
-
return this.agentComponentAdapter;
|
|
1329
|
-
}
|
|
1330
|
-
getAgentRunner() {
|
|
1331
|
-
return this.agentRunner;
|
|
1332
|
-
}
|
|
1333
|
-
getSessionComponent() {
|
|
1334
|
-
return this.sessionComponent;
|
|
1335
|
-
}
|
|
1336
|
-
registerBuiltInTypes() {
|
|
1337
|
-
this.factories.set("tool", (definition) => {
|
|
1338
|
-
if (!this.toolRegistry) {
|
|
1339
|
-
throw new Error("ToolRegistry is required for tool nodes");
|
|
1340
|
-
}
|
|
1341
|
-
return new ToolNode(definition, this.toolRegistry);
|
|
1342
|
-
});
|
|
1343
|
-
this.factories.set("skill", (definition) => {
|
|
1344
|
-
if (!this.skillRegistry) {
|
|
1345
|
-
throw new Error("SkillRegistry is required for skill nodes");
|
|
1346
|
-
}
|
|
1347
|
-
return new SkillNode(definition, this.skillRegistry);
|
|
1348
|
-
});
|
|
1349
|
-
this.factories.set("agent", (definition) => {
|
|
1350
|
-
if (!this.agentRunner) {
|
|
1351
|
-
throw new Error("AgentRunner is required for agent nodes");
|
|
1352
|
-
}
|
|
1353
|
-
return new AgentNode(definition, this.agentRunner);
|
|
1354
|
-
});
|
|
1355
|
-
this.factories.set("workflow", (definition) => {
|
|
1356
|
-
if (!this.workflowRunner) {
|
|
1357
|
-
throw new Error("WorkflowRunner is required for workflow nodes");
|
|
1358
|
-
}
|
|
1359
|
-
return new WorkflowNode(definition, this.workflowRunner);
|
|
1360
|
-
});
|
|
1361
|
-
this.factories.set("ask_user", (definition) => {
|
|
1362
|
-
return new AskUserNode(definition);
|
|
1363
|
-
});
|
|
1364
|
-
this.factories.set("python_call", (definition) => {
|
|
1365
|
-
return new PythonCallNode(definition);
|
|
1366
|
-
});
|
|
1367
|
-
}
|
|
1368
|
-
register(type, factory) {
|
|
1369
|
-
this.factories.set(type, factory);
|
|
1370
|
-
}
|
|
1371
|
-
has(type) {
|
|
1372
|
-
return this.factories.has(type);
|
|
1373
|
-
}
|
|
1374
|
-
list() {
|
|
1375
|
-
return Array.from(this.factories.keys());
|
|
1376
|
-
}
|
|
1377
|
-
createNode(definition, context) {
|
|
1378
|
-
const factory = this.factories.get(definition.type);
|
|
1379
|
-
if (!factory) {
|
|
1380
|
-
const availableTypes = this.list().join(", ");
|
|
1381
|
-
throw new Error(`Unknown node type: ${definition.type}. Available types: ${availableTypes}`);
|
|
1382
|
-
}
|
|
1383
|
-
return factory(definition, context);
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1324
|
+
var NodeRegistry;
|
|
1386
1325
|
var init_node_registry = __esm(() => {
|
|
1387
1326
|
init_tool_node();
|
|
1388
1327
|
init_skill_node();
|
|
@@ -1391,6 +1330,101 @@ var init_node_registry = __esm(() => {
|
|
|
1391
1330
|
init_workflow_node();
|
|
1392
1331
|
init_ask_user_node();
|
|
1393
1332
|
init_python_call_node();
|
|
1333
|
+
init_decorator();
|
|
1334
|
+
NodeRegistry = class NodeRegistry {
|
|
1335
|
+
factories = new Map;
|
|
1336
|
+
toolRegistry;
|
|
1337
|
+
skillRegistry;
|
|
1338
|
+
agentRunner;
|
|
1339
|
+
workflowRunner;
|
|
1340
|
+
agentComponentAdapter;
|
|
1341
|
+
sessionComponent;
|
|
1342
|
+
constructor(options) {
|
|
1343
|
+
const {
|
|
1344
|
+
toolRegistry,
|
|
1345
|
+
skillRegistry,
|
|
1346
|
+
agentComponent,
|
|
1347
|
+
agentRunner,
|
|
1348
|
+
workflowRunner,
|
|
1349
|
+
sessionComponent
|
|
1350
|
+
} = options ?? {};
|
|
1351
|
+
this.toolRegistry = toolRegistry;
|
|
1352
|
+
this.skillRegistry = skillRegistry;
|
|
1353
|
+
this.workflowRunner = workflowRunner;
|
|
1354
|
+
this.sessionComponent = sessionComponent;
|
|
1355
|
+
if (agentRunner) {
|
|
1356
|
+
this.agentRunner = agentRunner;
|
|
1357
|
+
if (agentRunner.setSessionComponent && sessionComponent) {
|
|
1358
|
+
agentRunner.setSessionComponent(sessionComponent);
|
|
1359
|
+
}
|
|
1360
|
+
} else if (agentComponent) {
|
|
1361
|
+
this.agentComponentAdapter = new AgentComponentAdapter(agentComponent, {}, sessionComponent);
|
|
1362
|
+
this.agentRunner = this.agentComponentAdapter;
|
|
1363
|
+
}
|
|
1364
|
+
this.registerBuiltInTypes();
|
|
1365
|
+
}
|
|
1366
|
+
getAgentAdapter() {
|
|
1367
|
+
return this.agentComponentAdapter;
|
|
1368
|
+
}
|
|
1369
|
+
getAgentRunner() {
|
|
1370
|
+
return this.agentRunner;
|
|
1371
|
+
}
|
|
1372
|
+
getSessionComponent() {
|
|
1373
|
+
return this.sessionComponent;
|
|
1374
|
+
}
|
|
1375
|
+
registerBuiltInTypes() {
|
|
1376
|
+
this.factories.set("tool", (definition) => {
|
|
1377
|
+
if (!this.toolRegistry) {
|
|
1378
|
+
throw new Error("ToolRegistry is required for tool nodes");
|
|
1379
|
+
}
|
|
1380
|
+
return new ToolNode(definition, this.toolRegistry);
|
|
1381
|
+
});
|
|
1382
|
+
this.factories.set("skill", (definition) => {
|
|
1383
|
+
if (!this.skillRegistry) {
|
|
1384
|
+
throw new Error("SkillRegistry is required for skill nodes");
|
|
1385
|
+
}
|
|
1386
|
+
return new SkillNode(definition, this.skillRegistry);
|
|
1387
|
+
});
|
|
1388
|
+
this.factories.set("agent", (definition) => {
|
|
1389
|
+
if (!this.agentRunner) {
|
|
1390
|
+
throw new Error("AgentRunner is required for agent nodes");
|
|
1391
|
+
}
|
|
1392
|
+
return new AgentNode(definition, this.agentRunner);
|
|
1393
|
+
});
|
|
1394
|
+
this.factories.set("workflow", (definition) => {
|
|
1395
|
+
if (!this.workflowRunner) {
|
|
1396
|
+
throw new Error("WorkflowRunner is required for workflow nodes");
|
|
1397
|
+
}
|
|
1398
|
+
return new WorkflowNode(definition, this.workflowRunner);
|
|
1399
|
+
});
|
|
1400
|
+
this.factories.set("ask_user", (definition) => {
|
|
1401
|
+
return new AskUserNode(definition);
|
|
1402
|
+
});
|
|
1403
|
+
this.factories.set("python_call", (definition) => {
|
|
1404
|
+
return new PythonCallNode(definition);
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
register(type, factory) {
|
|
1408
|
+
this.factories.set(type, factory);
|
|
1409
|
+
}
|
|
1410
|
+
has(type) {
|
|
1411
|
+
return this.factories.has(type);
|
|
1412
|
+
}
|
|
1413
|
+
list() {
|
|
1414
|
+
return Array.from(this.factories.keys());
|
|
1415
|
+
}
|
|
1416
|
+
createNode(definition, context) {
|
|
1417
|
+
const factory = this.factories.get(definition.type);
|
|
1418
|
+
if (!factory) {
|
|
1419
|
+
const availableTypes = this.list().join(", ");
|
|
1420
|
+
throw new Error(`Unknown node type: ${definition.type}. Available types: ${availableTypes}`);
|
|
1421
|
+
}
|
|
1422
|
+
return factory(definition, context);
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
__legacyDecorateClassTS([
|
|
1426
|
+
TracedAs("workflow.node-registry.createNode", { recordParams: false, recordResult: false })
|
|
1427
|
+
], NodeRegistry.prototype, "createNode", null);
|
|
1394
1428
|
});
|
|
1395
1429
|
|
|
1396
1430
|
// src/env/workflow/utils/agent-session-metadata.ts
|
|
@@ -1607,6 +1641,7 @@ var init_engine = __esm(() => {
|
|
|
1607
1641
|
init_scheduler();
|
|
1608
1642
|
init_executor();
|
|
1609
1643
|
init_node_registry();
|
|
1644
|
+
init_hooks();
|
|
1610
1645
|
init_agent_session_metadata();
|
|
1611
1646
|
init_logger();
|
|
1612
1647
|
init_decorator();
|
|
@@ -1883,6 +1918,16 @@ var init_engine = __esm(() => {
|
|
|
1883
1918
|
workflow_name: sessionState.workflowName,
|
|
1884
1919
|
input: options?.input
|
|
1885
1920
|
}));
|
|
1921
|
+
await emitWorkflowRunHook(WorkflowHookPoints.BEFORE_RUN, {
|
|
1922
|
+
runId,
|
|
1923
|
+
sessionId: sessionState.sessionId,
|
|
1924
|
+
workflowId: sessionState.workflowId,
|
|
1925
|
+
workflowName: sessionState.workflowName,
|
|
1926
|
+
status: "running",
|
|
1927
|
+
input: options?.input,
|
|
1928
|
+
totalNodes: this.safeNodeCount(sessionState),
|
|
1929
|
+
completedNodes: sessionState.nodeOutputs.size
|
|
1930
|
+
});
|
|
1886
1931
|
let pendingNodeId;
|
|
1887
1932
|
let agentSessionId;
|
|
1888
1933
|
switch (resumePoint.type) {
|
|
@@ -2005,6 +2050,16 @@ var init_engine = __esm(() => {
|
|
|
2005
2050
|
await sessionState.eventBus.publish(createWorkflowEvent("workflow.stopped", this.getRunIdFromSessionId(sessionId), {
|
|
2006
2051
|
reason: stopReason
|
|
2007
2052
|
}));
|
|
2053
|
+
await emitWorkflowRunHook(WorkflowHookPoints.AFTER_RUN, {
|
|
2054
|
+
runId: this.getRunIdFromSessionId(sessionId),
|
|
2055
|
+
sessionId: sessionState.sessionId,
|
|
2056
|
+
workflowId: sessionState.workflowId,
|
|
2057
|
+
workflowName: sessionState.workflowName,
|
|
2058
|
+
status: "stopped",
|
|
2059
|
+
stopReason,
|
|
2060
|
+
totalNodes: this.safeNodeCount(sessionState),
|
|
2061
|
+
completedNodes: sessionState.nodeOutputs?.size
|
|
2062
|
+
});
|
|
2008
2063
|
try {
|
|
2009
2064
|
await sessionState.cancellationScope?.waitForCleanup(force ? 500 : 1500);
|
|
2010
2065
|
} catch {}
|
|
@@ -2353,13 +2408,52 @@ var init_engine = __esm(() => {
|
|
|
2353
2408
|
scheduler.markFailed(nodeId);
|
|
2354
2409
|
return;
|
|
2355
2410
|
}
|
|
2411
|
+
await emitWorkflowNodeHook(WorkflowHookPoints.BEFORE_NODE, {
|
|
2412
|
+
runId: context.runId,
|
|
2413
|
+
sessionId: context.sessionId,
|
|
2414
|
+
workflowName: context.workflowName,
|
|
2415
|
+
nodeId,
|
|
2416
|
+
nodeType: nodeDef.type,
|
|
2417
|
+
status: "running",
|
|
2418
|
+
input: context.input,
|
|
2419
|
+
totalNodes: this.safeNodeCount(sessionState),
|
|
2420
|
+
completedNodes: sessionState.nodeOutputs.size,
|
|
2421
|
+
agentSessionId: context.agentSessionId
|
|
2422
|
+
});
|
|
2356
2423
|
try {
|
|
2357
2424
|
const result = await executor.executeNode(nodeDef, context);
|
|
2358
2425
|
if (result.error) {
|
|
2426
|
+
await emitWorkflowNodeHook(WorkflowHookPoints.AFTER_NODE, {
|
|
2427
|
+
runId: context.runId,
|
|
2428
|
+
sessionId: context.sessionId,
|
|
2429
|
+
workflowName: context.workflowName,
|
|
2430
|
+
nodeId,
|
|
2431
|
+
nodeType: nodeDef.type,
|
|
2432
|
+
status: "failed",
|
|
2433
|
+
output: result.output,
|
|
2434
|
+
error: result.error instanceof Error ? result.error.message : String(result.error),
|
|
2435
|
+
durationMs: result.durationMs,
|
|
2436
|
+
totalNodes: this.safeNodeCount(sessionState),
|
|
2437
|
+
completedNodes: sessionState.nodeOutputs.size,
|
|
2438
|
+
agentSessionId: context.agentSessionId
|
|
2439
|
+
});
|
|
2359
2440
|
return;
|
|
2360
2441
|
}
|
|
2361
2442
|
sessionState.nodeOutputs.set(nodeId, result.output);
|
|
2362
2443
|
scheduler.markCompleted(nodeId);
|
|
2444
|
+
await emitWorkflowNodeHook(WorkflowHookPoints.AFTER_NODE, {
|
|
2445
|
+
runId: context.runId,
|
|
2446
|
+
sessionId: context.sessionId,
|
|
2447
|
+
workflowName: context.workflowName,
|
|
2448
|
+
nodeId,
|
|
2449
|
+
nodeType: nodeDef.type,
|
|
2450
|
+
status: "completed",
|
|
2451
|
+
output: result.output,
|
|
2452
|
+
durationMs: result.durationMs,
|
|
2453
|
+
totalNodes: this.safeNodeCount(sessionState),
|
|
2454
|
+
completedNodes: sessionState.nodeOutputs.size,
|
|
2455
|
+
agentSessionId: context.agentSessionId
|
|
2456
|
+
});
|
|
2363
2457
|
if (result.output && typeof result.output === "object" && "workflowHistory" in result.output) {
|
|
2364
2458
|
const messages = result.output.workflowHistory;
|
|
2365
2459
|
if (Array.isArray(messages)) {
|
|
@@ -2528,6 +2622,13 @@ var init_engine = __esm(() => {
|
|
|
2528
2622
|
}
|
|
2529
2623
|
}
|
|
2530
2624
|
}
|
|
2625
|
+
safeNodeCount(sessionState) {
|
|
2626
|
+
try {
|
|
2627
|
+
return sessionState?.dagManager?.getNodeCount?.();
|
|
2628
|
+
} catch {
|
|
2629
|
+
return;
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2531
2632
|
buildNodeContext(sessionState, nodeId, globalInput) {
|
|
2532
2633
|
const nodeDef = sessionState.dagManager.getNode(nodeId);
|
|
2533
2634
|
const runId = this.getRunIdFromSessionId(sessionState.sessionId);
|
|
@@ -2620,6 +2721,17 @@ var init_engine = __esm(() => {
|
|
|
2620
2721
|
result: finalOutput,
|
|
2621
2722
|
duration_ms: durationMs
|
|
2622
2723
|
}), true);
|
|
2724
|
+
await emitWorkflowRunHook(WorkflowHookPoints.AFTER_RUN, {
|
|
2725
|
+
runId,
|
|
2726
|
+
sessionId: sessionState.sessionId,
|
|
2727
|
+
workflowId: sessionState.workflowId,
|
|
2728
|
+
workflowName: sessionState.workflowName,
|
|
2729
|
+
status: "completed",
|
|
2730
|
+
output: finalOutput,
|
|
2731
|
+
durationMs,
|
|
2732
|
+
totalNodes: this.safeNodeCount(sessionState),
|
|
2733
|
+
completedNodes: sessionState.nodeOutputs.size
|
|
2734
|
+
});
|
|
2623
2735
|
sessionState.resolveCompleted({
|
|
2624
2736
|
runId,
|
|
2625
2737
|
status: "completed",
|
|
@@ -2653,6 +2765,16 @@ var init_engine = __esm(() => {
|
|
|
2653
2765
|
error: { message: error.message, stack: error.stack },
|
|
2654
2766
|
failed_at: new Date().toISOString()
|
|
2655
2767
|
}), true);
|
|
2768
|
+
await emitWorkflowRunHook(WorkflowHookPoints.AFTER_RUN, {
|
|
2769
|
+
runId,
|
|
2770
|
+
sessionId: sessionState.sessionId,
|
|
2771
|
+
workflowId: sessionState.workflowId,
|
|
2772
|
+
workflowName: sessionState.workflowName,
|
|
2773
|
+
status: "failed",
|
|
2774
|
+
error: error.message,
|
|
2775
|
+
totalNodes: this.safeNodeCount(sessionState),
|
|
2776
|
+
completedNodes: sessionState.nodeOutputs.size
|
|
2777
|
+
});
|
|
2656
2778
|
const partialOutput = {};
|
|
2657
2779
|
for (const [nodeId, nodeOutput] of sessionState.nodeOutputs) {
|
|
2658
2780
|
partialOutput[nodeId] = nodeOutput;
|
|
@@ -2722,6 +2844,9 @@ var init_engine = __esm(() => {
|
|
|
2722
2844
|
__legacyDecorateClassTS([
|
|
2723
2845
|
TracedAs("workflow.engine.run", { recordParams: true, recordResult: true, log: true })
|
|
2724
2846
|
], WorkflowEngine.prototype, "run", null);
|
|
2847
|
+
__legacyDecorateClassTS([
|
|
2848
|
+
TracedAs("workflow.engine.initializeSessionState", { recordParams: true, recordResult: true })
|
|
2849
|
+
], WorkflowEngine.prototype, "initializeSessionState", null);
|
|
2725
2850
|
__legacyDecorateClassTS([
|
|
2726
2851
|
TracedAs("workflow.engine.runWithResume", { recordParams: true, recordResult: true })
|
|
2727
2852
|
], WorkflowEngine.prototype, "runWithResume", null);
|
|
@@ -2734,6 +2859,9 @@ var init_engine = __esm(() => {
|
|
|
2734
2859
|
__legacyDecorateClassTS([
|
|
2735
2860
|
TracedAs("workflow.engine.stop", { recordParams: true, recordResult: true, log: true })
|
|
2736
2861
|
], WorkflowEngine.prototype, "stop", null);
|
|
2862
|
+
__legacyDecorateClassTS([
|
|
2863
|
+
TracedAs("workflow.engine.propagateStopToChildSessions", { recordParams: false, recordResult: true })
|
|
2864
|
+
], WorkflowEngine.prototype, "propagateStopToChildSessions", null);
|
|
2737
2865
|
__legacyDecorateClassTS([
|
|
2738
2866
|
TracedAs("workflow.engine.scheduleAndExecute", { recordParams: true, recordResult: true })
|
|
2739
2867
|
], WorkflowEngine.prototype, "scheduleAndExecute", null);
|
|
@@ -2752,6 +2880,12 @@ var init_engine = __esm(() => {
|
|
|
2752
2880
|
__legacyDecorateClassTS([
|
|
2753
2881
|
TracedAs("workflow.engine.preExecuteValidation")
|
|
2754
2882
|
], WorkflowEngine.prototype, "preExecuteValidation", null);
|
|
2883
|
+
__legacyDecorateClassTS([
|
|
2884
|
+
TracedAs("workflow.engine.validateAndExecute", { recordParams: true, recordResult: true })
|
|
2885
|
+
], WorkflowEngine.prototype, "validateAndExecute", null);
|
|
2886
|
+
__legacyDecorateClassTS([
|
|
2887
|
+
TracedAs("workflow.engine.processConditionalEdgesAfterCompletion", { recordParams: true, recordResult: true })
|
|
2888
|
+
], WorkflowEngine.prototype, "processConditionalEdgesAfterCompletion", null);
|
|
2755
2889
|
__legacyDecorateClassTS([
|
|
2756
2890
|
TracedAs("workflow.engine.buildNodeContext")
|
|
2757
2891
|
], WorkflowEngine.prototype, "buildNodeContext", null);
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createQueryBackgroundProcessTool
|
|
3
|
+
} from "./roy-agent-core-amkqnyzy.js";
|
|
4
|
+
import {
|
|
5
|
+
SQLiteTaskStore,
|
|
6
|
+
getDefaultTaskDbPath
|
|
7
|
+
} from "./roy-agent-core-qm9jda8p.js";
|
|
1
8
|
import {
|
|
2
9
|
batchArchiveTaskTool,
|
|
3
10
|
batchDeleteTaskTool,
|
|
@@ -9,7 +16,7 @@ import {
|
|
|
9
16
|
searchTasksTool,
|
|
10
17
|
treeTasksTool,
|
|
11
18
|
updateTaskTool
|
|
12
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-7g03zkkb.js";
|
|
13
20
|
import {
|
|
14
21
|
createOperationTool,
|
|
15
22
|
deleteOperationTool,
|
|
@@ -17,9 +24,6 @@ import {
|
|
|
17
24
|
listOperationsTool,
|
|
18
25
|
updateOperationTool
|
|
19
26
|
} from "./roy-agent-core-rn57psp0.js";
|
|
20
|
-
import {
|
|
21
|
-
createQueryBackgroundProcessTool
|
|
22
|
-
} from "./roy-agent-core-amkqnyzy.js";
|
|
23
27
|
import {
|
|
24
28
|
TaskEntityEventTypes
|
|
25
29
|
} from "./roy-agent-core-8gxth0eh.js";
|
|
@@ -27,11 +31,7 @@ import {
|
|
|
27
31
|
BackgroundTaskManager,
|
|
28
32
|
createDelegateTool,
|
|
29
33
|
createStopTool
|
|
30
|
-
} from "./roy-agent-core-
|
|
31
|
-
import {
|
|
32
|
-
SQLiteTaskStore,
|
|
33
|
-
getDefaultTaskDbPath
|
|
34
|
-
} from "./roy-agent-core-rqyxdrxg.js";
|
|
34
|
+
} from "./roy-agent-core-p2r27era.js";
|
|
35
35
|
import {
|
|
36
36
|
TaskHookPoints
|
|
37
37
|
} from "./roy-agent-core-1pg0fepg.js";
|
|
@@ -40,19 +40,19 @@ import {
|
|
|
40
40
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
41
41
|
import {
|
|
42
42
|
BaseComponent
|
|
43
|
-
} from "./roy-agent-core-
|
|
43
|
+
} from "./roy-agent-core-tdbv7ff4.js";
|
|
44
44
|
import {
|
|
45
45
|
globalHookManager,
|
|
46
46
|
init_global_hook_manager
|
|
47
|
-
} from "./roy-agent-core-
|
|
47
|
+
} from "./roy-agent-core-4z3rq5gw.js";
|
|
48
48
|
import {
|
|
49
49
|
getEnvContextOrEmpty,
|
|
50
50
|
init_env_context
|
|
51
|
-
} from "./roy-agent-core-
|
|
51
|
+
} from "./roy-agent-core-5apmk4qw.js";
|
|
52
52
|
import {
|
|
53
53
|
TracedAs,
|
|
54
54
|
init_decorator
|
|
55
|
-
} from "./roy-agent-core-
|
|
55
|
+
} from "./roy-agent-core-dsevjbck.js";
|
|
56
56
|
import {
|
|
57
57
|
createLogger,
|
|
58
58
|
init_logger
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isToolUnavailableError,
|
|
3
3
|
truncateOutputInline
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-fvs48d38.js";
|
|
5
5
|
import {
|
|
6
6
|
AgentRegistry
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-rx16h2m1.js";
|
|
8
8
|
import {
|
|
9
9
|
enqueueToAddFakeUserMessage
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-dv714bqh.js";
|
|
11
11
|
import {
|
|
12
12
|
SessionMessageConverter
|
|
13
13
|
} from "./roy-agent-core-pk1b3kvf.js";
|
|
@@ -31,24 +31,24 @@ import {
|
|
|
31
31
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
32
32
|
import {
|
|
33
33
|
BaseComponent
|
|
34
|
-
} from "./roy-agent-core-
|
|
34
|
+
} from "./roy-agent-core-tdbv7ff4.js";
|
|
35
35
|
import {
|
|
36
36
|
globalHookManager,
|
|
37
37
|
init_global_hook_manager
|
|
38
|
-
} from "./roy-agent-core-
|
|
38
|
+
} from "./roy-agent-core-4z3rq5gw.js";
|
|
39
39
|
import {
|
|
40
40
|
init_context
|
|
41
|
-
} from "./roy-agent-core-
|
|
41
|
+
} from "./roy-agent-core-k8b440n3.js";
|
|
42
42
|
import {
|
|
43
43
|
getCurrentTaskId,
|
|
44
44
|
getEnvContext,
|
|
45
45
|
resolveEnvParentTaskId,
|
|
46
46
|
runWithEnvContextAsync
|
|
47
|
-
} from "./roy-agent-core-
|
|
47
|
+
} from "./roy-agent-core-5apmk4qw.js";
|
|
48
48
|
import {
|
|
49
49
|
TracedAs,
|
|
50
50
|
init_decorator
|
|
51
|
-
} from "./roy-agent-core-
|
|
51
|
+
} from "./roy-agent-core-dsevjbck.js";
|
|
52
52
|
import {
|
|
53
53
|
createLogger,
|
|
54
54
|
init_logger
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_context
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-k8b440n3.js";
|
|
4
4
|
import {
|
|
5
5
|
getEnvContext
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-5apmk4qw.js";
|
|
7
7
|
import {
|
|
8
8
|
__esm
|
|
9
9
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
globalHookManager,
|
|
14
14
|
init_global_hook_manager
|
|
15
|
-
} from "./roy-agent-core-
|
|
15
|
+
} from "./roy-agent-core-4z3rq5gw.js";
|
|
16
16
|
import {
|
|
17
17
|
TracedAs,
|
|
18
18
|
init_decorator,
|
|
19
19
|
wrapFunction
|
|
20
|
-
} from "./roy-agent-core-
|
|
20
|
+
} from "./roy-agent-core-dsevjbck.js";
|
|
21
21
|
import {
|
|
22
22
|
createLogger,
|
|
23
23
|
init_logger
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_hook
|
|
3
|
+
} from "./roy-agent-core-qcspfszy.js";
|
|
4
|
+
import {
|
|
5
|
+
globalHookManager
|
|
6
|
+
} from "./roy-agent-core-4z3rq5gw.js";
|
|
7
|
+
import {
|
|
8
|
+
__esm
|
|
9
|
+
} from "./roy-agent-core-fs0mn2jk.js";
|
|
10
|
+
|
|
11
|
+
// src/env/workflow/hooks/workflow-hook-points.ts
|
|
12
|
+
async function emitWorkflowRunHook(hookPoint, data, metadata = {}) {
|
|
13
|
+
await globalHookManager.execute(hookPoint, data, {
|
|
14
|
+
sourceId: "workflow",
|
|
15
|
+
runId: data.runId,
|
|
16
|
+
workflowName: data.workflowName,
|
|
17
|
+
...metadata
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
async function emitWorkflowNodeHook(hookPoint, data, metadata = {}) {
|
|
21
|
+
await globalHookManager.execute(hookPoint, data, {
|
|
22
|
+
sourceId: "workflow",
|
|
23
|
+
runId: data.runId,
|
|
24
|
+
workflowName: data.workflowName,
|
|
25
|
+
nodeId: data.nodeId,
|
|
26
|
+
...metadata
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function getRegisteredWorkflowHookPoints() {
|
|
30
|
+
return Object.values(WorkflowHookPoints).map((hookPoint) => ({
|
|
31
|
+
hookPoint,
|
|
32
|
+
count: globalHookManager.count(hookPoint)
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
var WorkflowHookPoints;
|
|
36
|
+
var init_workflow_hook_points = __esm(() => {
|
|
37
|
+
init_hook();
|
|
38
|
+
WorkflowHookPoints = {
|
|
39
|
+
BEFORE_RUN: "workflow:before.run",
|
|
40
|
+
AFTER_RUN: "workflow:after.run",
|
|
41
|
+
BEFORE_NODE: "workflow:before.node",
|
|
42
|
+
AFTER_NODE: "workflow:after.node"
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { WorkflowHookPoints, emitWorkflowRunHook, emitWorkflowNodeHook, getRegisteredWorkflowHookPoints, init_workflow_hook_points };
|