@dexto/agent-management 1.5.8 → 1.6.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/dist/AgentFactory.cjs +5 -9
- package/dist/AgentFactory.d.ts +6 -5
- package/dist/AgentFactory.d.ts.map +1 -1
- package/dist/AgentFactory.js +5 -9
- package/dist/AgentManager.cjs +2 -2
- package/dist/AgentManager.d.ts +1 -1
- package/dist/AgentManager.d.ts.map +1 -1
- package/dist/AgentManager.js +4 -4
- package/dist/agent-creation.cjs +95 -0
- package/dist/agent-creation.d.ts +15 -0
- package/dist/agent-creation.d.ts.map +1 -0
- package/dist/agent-creation.js +78 -0
- package/dist/config/config-enrichment.cjs +8 -14
- package/dist/config/config-enrichment.d.ts +7 -1
- package/dist/config/config-enrichment.d.ts.map +1 -1
- package/dist/config/config-enrichment.js +8 -14
- package/dist/config/config-manager.cjs +4 -4
- package/dist/config/config-manager.d.ts +1 -1
- package/dist/config/config-manager.d.ts.map +1 -1
- package/dist/config/config-manager.js +3 -1
- package/dist/config/loader.d.ts +3 -3
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/images/image-store.cjs +256 -0
- package/dist/images/image-store.d.ts +70 -0
- package/dist/images/image-store.d.ts.map +1 -0
- package/dist/images/image-store.js +210 -0
- package/dist/index.cjs +32 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -1
- package/dist/plugins/discover-plugins.cjs +15 -31
- package/dist/plugins/discover-plugins.d.ts.map +1 -1
- package/dist/plugins/discover-plugins.js +15 -31
- package/dist/plugins/index.cjs +0 -2
- package/dist/plugins/index.d.ts +5 -6
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +0 -2
- package/dist/plugins/list-plugins.cjs +3 -1
- package/dist/plugins/list-plugins.d.ts.map +1 -1
- package/dist/plugins/list-plugins.js +3 -1
- package/dist/plugins/load-plugin.cjs +0 -13
- package/dist/plugins/load-plugin.d.ts +3 -5
- package/dist/plugins/load-plugin.d.ts.map +1 -1
- package/dist/plugins/load-plugin.js +0 -13
- package/dist/plugins/schemas.cjs +1 -11
- package/dist/plugins/schemas.d.ts +14 -69
- package/dist/plugins/schemas.d.ts.map +1 -1
- package/dist/plugins/schemas.js +1 -10
- package/dist/plugins/types.d.ts +2 -20
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/plugins/validate-plugin.cjs +7 -37
- package/dist/plugins/validate-plugin.d.ts +6 -24
- package/dist/plugins/validate-plugin.d.ts.map +1 -1
- package/dist/plugins/validate-plugin.js +8 -38
- package/dist/preferences/loader.cjs +21 -6
- package/dist/preferences/loader.d.ts +4 -0
- package/dist/preferences/loader.d.ts.map +1 -1
- package/dist/preferences/loader.js +21 -6
- package/dist/preferences/schemas.cjs +5 -1
- package/dist/preferences/schemas.d.ts +32 -0
- package/dist/preferences/schemas.d.ts.map +1 -1
- package/dist/preferences/schemas.js +5 -1
- package/dist/registry/registry.d.ts +4 -44
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/types.cjs +4 -0
- package/dist/registry/types.d.ts +8 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.js +4 -0
- package/dist/runtime/AgentPool.d.ts +2 -2
- package/dist/runtime/AgentPool.d.ts.map +1 -1
- package/dist/runtime/AgentRuntime.cjs +32 -19
- package/dist/runtime/AgentRuntime.d.ts +2 -2
- package/dist/runtime/AgentRuntime.d.ts.map +1 -1
- package/dist/runtime/AgentRuntime.js +32 -19
- package/dist/runtime/approval-delegation.cjs +6 -3
- package/dist/runtime/approval-delegation.d.ts +3 -2
- package/dist/runtime/approval-delegation.d.ts.map +1 -1
- package/dist/runtime/approval-delegation.js +6 -3
- package/dist/runtime/schemas.cjs +1 -1
- package/dist/runtime/schemas.d.ts +1 -1
- package/dist/runtime/schemas.js +1 -1
- package/dist/runtime/types.d.ts +3 -2
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/{tool-provider → tool-factories/agent-spawner}/error-codes.d.ts +1 -1
- package/dist/tool-factories/agent-spawner/error-codes.d.ts.map +1 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/errors.d.ts +1 -1
- package/dist/tool-factories/agent-spawner/errors.d.ts.map +1 -0
- package/dist/tool-factories/agent-spawner/factory.cjs +327 -0
- package/dist/tool-factories/agent-spawner/factory.d.ts +4 -0
- package/dist/tool-factories/agent-spawner/factory.d.ts.map +1 -0
- package/dist/tool-factories/agent-spawner/factory.js +316 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/index.cjs +9 -9
- package/dist/{tool-provider → tool-factories/agent-spawner}/index.d.ts +3 -3
- package/dist/tool-factories/agent-spawner/index.d.ts.map +1 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/index.js +4 -4
- package/dist/tool-factories/agent-spawner/llm-resolution.d.ts.map +1 -0
- package/dist/{tool-provider/runtime-service.cjs → tool-factories/agent-spawner/runtime.cjs} +149 -83
- package/dist/{tool-provider/runtime-service.d.ts → tool-factories/agent-spawner/runtime.d.ts} +11 -6
- package/dist/tool-factories/agent-spawner/runtime.d.ts.map +1 -0
- package/dist/{tool-provider/runtime-service.js → tool-factories/agent-spawner/runtime.js} +145 -79
- package/dist/{tool-provider → tool-factories/agent-spawner}/schemas.cjs +4 -4
- package/dist/{tool-provider → tool-factories/agent-spawner}/schemas.d.ts +5 -5
- package/dist/tool-factories/agent-spawner/schemas.d.ts.map +1 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/schemas.js +4 -4
- package/dist/{tool-provider → tool-factories/agent-spawner}/spawn-agent-tool.cjs +17 -7
- package/dist/tool-factories/agent-spawner/spawn-agent-tool.d.ts +11 -0
- package/dist/tool-factories/agent-spawner/spawn-agent-tool.d.ts.map +1 -0
- package/dist/{tool-provider → tool-factories/agent-spawner}/spawn-agent-tool.js +17 -7
- package/dist/tool-factories/agent-spawner/types.d.ts.map +1 -0
- package/dist/utils/path.cjs +10 -1
- package/dist/utils/path.d.ts +5 -2
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js +10 -1
- package/dist/writer.d.ts +2 -1
- package/dist/writer.d.ts.map +1 -1
- package/package.json +6 -4
- package/dist/tool-provider/error-codes.d.ts.map +0 -1
- package/dist/tool-provider/errors.d.ts.map +0 -1
- package/dist/tool-provider/index.d.ts.map +0 -1
- package/dist/tool-provider/llm-resolution.d.ts.map +0 -1
- package/dist/tool-provider/runtime-service.d.ts.map +0 -1
- package/dist/tool-provider/schemas.d.ts.map +0 -1
- package/dist/tool-provider/spawn-agent-tool.d.ts +0 -10
- package/dist/tool-provider/spawn-agent-tool.d.ts.map +0 -1
- package/dist/tool-provider/tool-provider.cjs +0 -197
- package/dist/tool-provider/tool-provider.d.ts +0 -30
- package/dist/tool-provider/tool-provider.d.ts.map +0 -1
- package/dist/tool-provider/tool-provider.js +0 -180
- package/dist/tool-provider/types.d.ts.map +0 -1
- /package/dist/{tool-provider → tool-factories/agent-spawner}/error-codes.cjs +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/error-codes.js +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/errors.cjs +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/errors.js +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/llm-resolution.cjs +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/llm-resolution.d.ts +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/llm-resolution.js +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/types.cjs +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/types.d.ts +0 -0
- /package/dist/{tool-provider → tool-factories/agent-spawner}/types.js +0 -0
package/dist/writer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../src/writer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../src/writer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB5F;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACrC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,iBAAiB,EAC9B,SAAS,CAAC,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CA6Ff;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CACzC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,iBAAiB,EAC9B,SAAS,CAAC,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CAyBf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/agent-management",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"yaml": "^2.7.1",
|
|
18
18
|
"zod": "^3.25.0",
|
|
19
|
-
"@dexto/
|
|
20
|
-
"@dexto/
|
|
19
|
+
"@dexto/agent-config": "1.6.1",
|
|
20
|
+
"@dexto/core": "1.6.1",
|
|
21
|
+
"@dexto/orchestration": "1.6.1",
|
|
22
|
+
"@dexto/tools-builtins": "1.6.1"
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
23
25
|
"@types/node": "^22.13.5"
|
|
@@ -34,7 +36,7 @@
|
|
|
34
36
|
},
|
|
35
37
|
"sideEffects": false,
|
|
36
38
|
"scripts": {
|
|
37
|
-
"build": "cross-env NODE_OPTIONS='--max-old-space-size=4096' tsup && cross-env NODE_OPTIONS='--max-old-space-size=4096' tsc -
|
|
39
|
+
"build": "cross-env NODE_OPTIONS='--max-old-space-size=4096' tsup && node ../../scripts/clean-tsbuildinfo.mjs && cross-env NODE_OPTIONS='--max-old-space-size=4096' tsc -b tsconfig.json --emitDeclarationOnly && node scripts/fix-dist-aliases.mjs",
|
|
38
40
|
"dev": "tsup --watch",
|
|
39
41
|
"typecheck": "tsc -p tsconfig.typecheck.json --noEmit",
|
|
40
42
|
"lint": "eslint . --ext .ts"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/tool-provider/error-codes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,qBAAqB;IAE7B,iBAAiB,oCAAoC;IACrD,YAAY,+BAA+B;IAG3C,eAAe,kCAAkC;IAGjD,WAAW,8BAA8B;IAGzC,cAAc,iCAAiC;CAClD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/tool-provider/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AAGvE;;GAEG;AACH,qBAAa,iBAAiB;IAC1B,MAAM,CAAC,gBAAgB;IAWvB,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM;;;IAWhC,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM;;;IAWpC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;IAWhD,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM;CAUvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-provider/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"llm-resolution.d.ts","sourceRoot":"","sources":["../../src/tool-provider/llm-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,4CAA4C;IAC5C,GAAG,EAAE,SAAS,CAAC;IACf,wCAAwC;IACxC,UAAU,EACJ,mBAAmB,GACnB,eAAe,GACf,iBAAiB,CAAC;IACxB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB;IACtC,gDAAgD;IAChD,WAAW,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GAKG;AACH,eAAO,MAAM,qBAAqB;IAE1B,gDAAgD;;IAGhD,8CAA8C;;IAM9C,qFAAqF;;;;;;;;;;EAGhF,CAAC;AAEd,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* spawn_agent Tool
|
|
3
|
-
*
|
|
4
|
-
* Spawns a sub-agent to handle a specific task.
|
|
5
|
-
* The sub-agent will execute the task and return the result.
|
|
6
|
-
*/
|
|
7
|
-
import type { InternalTool } from '@dexto/core';
|
|
8
|
-
import type { RuntimeService } from './runtime-service.js';
|
|
9
|
-
export declare function createSpawnAgentTool(service: RuntimeService): InternalTool;
|
|
10
|
-
//# sourceMappingURL=spawn-agent-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spawn-agent-tool.d.ts","sourceRoot":"","sources":["../../src/tool-provider/spawn-agent-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAwB,MAAM,aAAa,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA4C3D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,GAAG,YAAY,CA0C1E"}
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var tool_provider_exports = {};
|
|
20
|
-
__export(tool_provider_exports, {
|
|
21
|
-
agentSpawnerToolsProvider: () => agentSpawnerToolsProvider
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(tool_provider_exports);
|
|
24
|
-
var import_orchestration = require("@dexto/orchestration");
|
|
25
|
-
var import_schemas = require("./schemas.js");
|
|
26
|
-
var import_runtime_service = require("./runtime-service.js");
|
|
27
|
-
var import_spawn_agent_tool = require("./spawn-agent-tool.js");
|
|
28
|
-
function bindOrchestrationTool(tool, context) {
|
|
29
|
-
return {
|
|
30
|
-
id: tool.id,
|
|
31
|
-
description: tool.description,
|
|
32
|
-
inputSchema: tool.inputSchema,
|
|
33
|
-
execute: (input) => tool.execute(input, context)
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
const agentSpawnerToolsProvider = {
|
|
37
|
-
type: "agent-spawner",
|
|
38
|
-
configSchema: import_schemas.AgentSpawnerConfigSchema,
|
|
39
|
-
create: (config, context) => {
|
|
40
|
-
const { logger, agent } = context;
|
|
41
|
-
const signalBus = new import_orchestration.SignalBus();
|
|
42
|
-
const taskRegistry = new import_orchestration.TaskRegistry(signalBus);
|
|
43
|
-
const conditionEngine = new import_orchestration.ConditionEngine(taskRegistry, signalBus, logger);
|
|
44
|
-
const toolContext = {
|
|
45
|
-
taskRegistry,
|
|
46
|
-
conditionEngine,
|
|
47
|
-
signalBus
|
|
48
|
-
};
|
|
49
|
-
const service = new import_runtime_service.RuntimeService(agent, config, logger);
|
|
50
|
-
agent.toolManager.setTaskForker(service);
|
|
51
|
-
logger.debug("RuntimeService wired as taskForker for context:fork skill support");
|
|
52
|
-
const taskSessions = /* @__PURE__ */ new Map();
|
|
53
|
-
const emitTasksUpdate = (sessionId) => {
|
|
54
|
-
const tasks = taskRegistry.list({
|
|
55
|
-
status: ["running", "completed", "failed", "cancelled"]
|
|
56
|
-
});
|
|
57
|
-
const scopedTasks = sessionId ? tasks.filter((task) => taskSessions.get(task.taskId) === sessionId) : tasks;
|
|
58
|
-
const runningCount = scopedTasks.filter((task) => task.status === "running").length;
|
|
59
|
-
agent.agentEventBus.emit("service:event", {
|
|
60
|
-
service: "orchestration",
|
|
61
|
-
event: "tasks-updated",
|
|
62
|
-
sessionId: sessionId ?? "",
|
|
63
|
-
data: {
|
|
64
|
-
runningCount,
|
|
65
|
-
tasks: scopedTasks.map((task) => ({
|
|
66
|
-
taskId: task.taskId,
|
|
67
|
-
status: task.status,
|
|
68
|
-
...task.description !== void 0 && { description: task.description }
|
|
69
|
-
}))
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
const triggerBackgroundCompletion = (taskId, sessionId) => {
|
|
74
|
-
if (!sessionId) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
agent.agentEventBus.emit("tool:background-completed", {
|
|
78
|
-
toolCallId: taskId,
|
|
79
|
-
sessionId
|
|
80
|
-
});
|
|
81
|
-
const taskInfo = taskRegistry.getInfo(taskId);
|
|
82
|
-
const resultText = (() => {
|
|
83
|
-
if (taskInfo?.status === "failed") {
|
|
84
|
-
return taskInfo.error ?? "Unknown error.";
|
|
85
|
-
}
|
|
86
|
-
if (taskInfo?.result !== void 0) {
|
|
87
|
-
if (typeof taskInfo.result === "string") {
|
|
88
|
-
return taskInfo.result;
|
|
89
|
-
}
|
|
90
|
-
try {
|
|
91
|
-
return JSON.stringify(taskInfo.result, null, 2);
|
|
92
|
-
} catch {
|
|
93
|
-
return String(taskInfo.result ?? "<unserializable result>");
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return "No result available.";
|
|
97
|
-
})();
|
|
98
|
-
const sanitizeCdata = (value) => value.replace(/\]\]>/g, "]]]]><![CDATA[>");
|
|
99
|
-
const safeDescription = taskInfo?.description ? sanitizeCdata(taskInfo.description) : null;
|
|
100
|
-
const safeResultText = sanitizeCdata(resultText);
|
|
101
|
-
const descriptionTag = safeDescription ? ` <description><![CDATA[${safeDescription}]]></description>
|
|
102
|
-
` : "";
|
|
103
|
-
const statusTag = taskInfo?.status ? ` <status>${taskInfo.status}</status>
|
|
104
|
-
` : "";
|
|
105
|
-
const content = [
|
|
106
|
-
{
|
|
107
|
-
type: "text",
|
|
108
|
-
text: `<background-task-completion>
|
|
109
|
-
<origin>task</origin>
|
|
110
|
-
<note>The following response was reported by the background task (not user input).</note>
|
|
111
|
-
<taskId>${taskId}</taskId>
|
|
112
|
-
` + statusTag + descriptionTag + ` <result><![CDATA[${safeResultText}]]></result>
|
|
113
|
-
</background-task-completion>`
|
|
114
|
-
}
|
|
115
|
-
];
|
|
116
|
-
agent.isSessionBusy(sessionId).then((isBusy) => {
|
|
117
|
-
if (isBusy) {
|
|
118
|
-
agent.queueMessage(sessionId, {
|
|
119
|
-
content,
|
|
120
|
-
kind: "background"
|
|
121
|
-
}).catch(() => void 0);
|
|
122
|
-
} else {
|
|
123
|
-
agent.agentEventBus.emit("run:invoke", {
|
|
124
|
-
sessionId,
|
|
125
|
-
content,
|
|
126
|
-
source: "external",
|
|
127
|
-
metadata: { taskId }
|
|
128
|
-
});
|
|
129
|
-
agent.generate(content, sessionId).catch(() => void 0);
|
|
130
|
-
}
|
|
131
|
-
}).catch(() => {
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
const handleBackground = (event) => {
|
|
135
|
-
const taskId = event.toolCallId;
|
|
136
|
-
if (taskRegistry.has(taskId)) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (event.sessionId) {
|
|
140
|
-
taskSessions.set(taskId, event.sessionId);
|
|
141
|
-
}
|
|
142
|
-
try {
|
|
143
|
-
taskRegistry.register(
|
|
144
|
-
{
|
|
145
|
-
type: "generic",
|
|
146
|
-
taskId,
|
|
147
|
-
description: event.description ?? `Tool ${event.toolName}`,
|
|
148
|
-
promise: event.promise
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
...event.timeoutMs !== void 0 && { timeout: event.timeoutMs },
|
|
152
|
-
...event.notifyOnComplete !== void 0 && {
|
|
153
|
-
notify: event.notifyOnComplete
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
);
|
|
157
|
-
} catch (error) {
|
|
158
|
-
taskSessions.delete(taskId);
|
|
159
|
-
event.promise.catch(() => void 0);
|
|
160
|
-
logger.warn(
|
|
161
|
-
`Failed to register background task ${taskId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
162
|
-
{ color: "yellow" }
|
|
163
|
-
);
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
emitTasksUpdate(event.sessionId);
|
|
167
|
-
event.promise.finally(() => {
|
|
168
|
-
taskSessions.delete(taskId);
|
|
169
|
-
emitTasksUpdate(event.sessionId);
|
|
170
|
-
triggerBackgroundCompletion(taskId, event.sessionId);
|
|
171
|
-
});
|
|
172
|
-
};
|
|
173
|
-
const backgroundAbortController = new AbortController();
|
|
174
|
-
agent.agentEventBus.on("tool:background", handleBackground, {
|
|
175
|
-
signal: backgroundAbortController.signal
|
|
176
|
-
});
|
|
177
|
-
agent.agentEventBus.on("agent:stopped", () => {
|
|
178
|
-
backgroundAbortController.abort();
|
|
179
|
-
});
|
|
180
|
-
const tool = (0, import_spawn_agent_tool.createSpawnAgentTool)(service);
|
|
181
|
-
return [
|
|
182
|
-
tool,
|
|
183
|
-
bindOrchestrationTool((0, import_orchestration.createWaitForTool)(), toolContext),
|
|
184
|
-
bindOrchestrationTool((0, import_orchestration.createCheckTaskTool)(), toolContext),
|
|
185
|
-
bindOrchestrationTool((0, import_orchestration.createListTasksTool)(), toolContext)
|
|
186
|
-
];
|
|
187
|
-
},
|
|
188
|
-
metadata: {
|
|
189
|
-
displayName: "Agent Spawner",
|
|
190
|
-
description: "Spawn sub-agents for task delegation",
|
|
191
|
-
category: "agents"
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
195
|
-
0 && (module.exports = {
|
|
196
|
-
agentSpawnerToolsProvider
|
|
197
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Spawner Tool Provider
|
|
3
|
-
*
|
|
4
|
-
* Custom tool provider that enables agents to spawn sub-agents for task delegation.
|
|
5
|
-
*/
|
|
6
|
-
import type { CustomToolProvider } from '@dexto/core';
|
|
7
|
-
import { type AgentSpawnerConfig } from './schemas.js';
|
|
8
|
-
/**
|
|
9
|
-
* Agent Spawner Tools Provider
|
|
10
|
-
*
|
|
11
|
-
* Provides tools for spawning and managing sub-agents:
|
|
12
|
-
* - spawn_agent: Spawn a sub-agent to handle a task
|
|
13
|
-
*
|
|
14
|
-
* Orchestration tools (for background task management):
|
|
15
|
-
* - wait_for: Wait for background task(s) to complete
|
|
16
|
-
* - check_task: Check status of a background task
|
|
17
|
-
* - list_tasks: List all tracked background tasks
|
|
18
|
-
*
|
|
19
|
-
* Configuration:
|
|
20
|
-
* ```yaml
|
|
21
|
-
* tools:
|
|
22
|
-
* customTools:
|
|
23
|
-
* - type: agent-spawner
|
|
24
|
-
* maxConcurrentAgents: 5
|
|
25
|
-
* defaultTimeout: 300000
|
|
26
|
-
* allowSpawning: true
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare const agentSpawnerToolsProvider: CustomToolProvider<'agent-spawner', AgentSpawnerConfig>;
|
|
30
|
-
//# sourceMappingURL=tool-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-provider.d.ts","sourceRoot":"","sources":["../../src/tool-provider/tool-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,aAAa,CAAC;AAYpE,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAmBjF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CAAC,eAAe,EAAE,kBAAkB,CAsM7F,CAAC"}
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ConditionEngine,
|
|
3
|
-
SignalBus,
|
|
4
|
-
TaskRegistry,
|
|
5
|
-
createCheckTaskTool,
|
|
6
|
-
createListTasksTool,
|
|
7
|
-
createWaitForTool
|
|
8
|
-
} from "@dexto/orchestration";
|
|
9
|
-
import { AgentSpawnerConfigSchema } from "./schemas.js";
|
|
10
|
-
import { RuntimeService } from "./runtime-service.js";
|
|
11
|
-
import { createSpawnAgentTool } from "./spawn-agent-tool.js";
|
|
12
|
-
function bindOrchestrationTool(tool, context) {
|
|
13
|
-
return {
|
|
14
|
-
id: tool.id,
|
|
15
|
-
description: tool.description,
|
|
16
|
-
inputSchema: tool.inputSchema,
|
|
17
|
-
execute: (input) => tool.execute(input, context)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
const agentSpawnerToolsProvider = {
|
|
21
|
-
type: "agent-spawner",
|
|
22
|
-
configSchema: AgentSpawnerConfigSchema,
|
|
23
|
-
create: (config, context) => {
|
|
24
|
-
const { logger, agent } = context;
|
|
25
|
-
const signalBus = new SignalBus();
|
|
26
|
-
const taskRegistry = new TaskRegistry(signalBus);
|
|
27
|
-
const conditionEngine = new ConditionEngine(taskRegistry, signalBus, logger);
|
|
28
|
-
const toolContext = {
|
|
29
|
-
taskRegistry,
|
|
30
|
-
conditionEngine,
|
|
31
|
-
signalBus
|
|
32
|
-
};
|
|
33
|
-
const service = new RuntimeService(agent, config, logger);
|
|
34
|
-
agent.toolManager.setTaskForker(service);
|
|
35
|
-
logger.debug("RuntimeService wired as taskForker for context:fork skill support");
|
|
36
|
-
const taskSessions = /* @__PURE__ */ new Map();
|
|
37
|
-
const emitTasksUpdate = (sessionId) => {
|
|
38
|
-
const tasks = taskRegistry.list({
|
|
39
|
-
status: ["running", "completed", "failed", "cancelled"]
|
|
40
|
-
});
|
|
41
|
-
const scopedTasks = sessionId ? tasks.filter((task) => taskSessions.get(task.taskId) === sessionId) : tasks;
|
|
42
|
-
const runningCount = scopedTasks.filter((task) => task.status === "running").length;
|
|
43
|
-
agent.agentEventBus.emit("service:event", {
|
|
44
|
-
service: "orchestration",
|
|
45
|
-
event: "tasks-updated",
|
|
46
|
-
sessionId: sessionId ?? "",
|
|
47
|
-
data: {
|
|
48
|
-
runningCount,
|
|
49
|
-
tasks: scopedTasks.map((task) => ({
|
|
50
|
-
taskId: task.taskId,
|
|
51
|
-
status: task.status,
|
|
52
|
-
...task.description !== void 0 && { description: task.description }
|
|
53
|
-
}))
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
const triggerBackgroundCompletion = (taskId, sessionId) => {
|
|
58
|
-
if (!sessionId) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
agent.agentEventBus.emit("tool:background-completed", {
|
|
62
|
-
toolCallId: taskId,
|
|
63
|
-
sessionId
|
|
64
|
-
});
|
|
65
|
-
const taskInfo = taskRegistry.getInfo(taskId);
|
|
66
|
-
const resultText = (() => {
|
|
67
|
-
if (taskInfo?.status === "failed") {
|
|
68
|
-
return taskInfo.error ?? "Unknown error.";
|
|
69
|
-
}
|
|
70
|
-
if (taskInfo?.result !== void 0) {
|
|
71
|
-
if (typeof taskInfo.result === "string") {
|
|
72
|
-
return taskInfo.result;
|
|
73
|
-
}
|
|
74
|
-
try {
|
|
75
|
-
return JSON.stringify(taskInfo.result, null, 2);
|
|
76
|
-
} catch {
|
|
77
|
-
return String(taskInfo.result ?? "<unserializable result>");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return "No result available.";
|
|
81
|
-
})();
|
|
82
|
-
const sanitizeCdata = (value) => value.replace(/\]\]>/g, "]]]]><![CDATA[>");
|
|
83
|
-
const safeDescription = taskInfo?.description ? sanitizeCdata(taskInfo.description) : null;
|
|
84
|
-
const safeResultText = sanitizeCdata(resultText);
|
|
85
|
-
const descriptionTag = safeDescription ? ` <description><![CDATA[${safeDescription}]]></description>
|
|
86
|
-
` : "";
|
|
87
|
-
const statusTag = taskInfo?.status ? ` <status>${taskInfo.status}</status>
|
|
88
|
-
` : "";
|
|
89
|
-
const content = [
|
|
90
|
-
{
|
|
91
|
-
type: "text",
|
|
92
|
-
text: `<background-task-completion>
|
|
93
|
-
<origin>task</origin>
|
|
94
|
-
<note>The following response was reported by the background task (not user input).</note>
|
|
95
|
-
<taskId>${taskId}</taskId>
|
|
96
|
-
` + statusTag + descriptionTag + ` <result><![CDATA[${safeResultText}]]></result>
|
|
97
|
-
</background-task-completion>`
|
|
98
|
-
}
|
|
99
|
-
];
|
|
100
|
-
agent.isSessionBusy(sessionId).then((isBusy) => {
|
|
101
|
-
if (isBusy) {
|
|
102
|
-
agent.queueMessage(sessionId, {
|
|
103
|
-
content,
|
|
104
|
-
kind: "background"
|
|
105
|
-
}).catch(() => void 0);
|
|
106
|
-
} else {
|
|
107
|
-
agent.agentEventBus.emit("run:invoke", {
|
|
108
|
-
sessionId,
|
|
109
|
-
content,
|
|
110
|
-
source: "external",
|
|
111
|
-
metadata: { taskId }
|
|
112
|
-
});
|
|
113
|
-
agent.generate(content, sessionId).catch(() => void 0);
|
|
114
|
-
}
|
|
115
|
-
}).catch(() => {
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
const handleBackground = (event) => {
|
|
119
|
-
const taskId = event.toolCallId;
|
|
120
|
-
if (taskRegistry.has(taskId)) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (event.sessionId) {
|
|
124
|
-
taskSessions.set(taskId, event.sessionId);
|
|
125
|
-
}
|
|
126
|
-
try {
|
|
127
|
-
taskRegistry.register(
|
|
128
|
-
{
|
|
129
|
-
type: "generic",
|
|
130
|
-
taskId,
|
|
131
|
-
description: event.description ?? `Tool ${event.toolName}`,
|
|
132
|
-
promise: event.promise
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
...event.timeoutMs !== void 0 && { timeout: event.timeoutMs },
|
|
136
|
-
...event.notifyOnComplete !== void 0 && {
|
|
137
|
-
notify: event.notifyOnComplete
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
);
|
|
141
|
-
} catch (error) {
|
|
142
|
-
taskSessions.delete(taskId);
|
|
143
|
-
event.promise.catch(() => void 0);
|
|
144
|
-
logger.warn(
|
|
145
|
-
`Failed to register background task ${taskId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
146
|
-
{ color: "yellow" }
|
|
147
|
-
);
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
emitTasksUpdate(event.sessionId);
|
|
151
|
-
event.promise.finally(() => {
|
|
152
|
-
taskSessions.delete(taskId);
|
|
153
|
-
emitTasksUpdate(event.sessionId);
|
|
154
|
-
triggerBackgroundCompletion(taskId, event.sessionId);
|
|
155
|
-
});
|
|
156
|
-
};
|
|
157
|
-
const backgroundAbortController = new AbortController();
|
|
158
|
-
agent.agentEventBus.on("tool:background", handleBackground, {
|
|
159
|
-
signal: backgroundAbortController.signal
|
|
160
|
-
});
|
|
161
|
-
agent.agentEventBus.on("agent:stopped", () => {
|
|
162
|
-
backgroundAbortController.abort();
|
|
163
|
-
});
|
|
164
|
-
const tool = createSpawnAgentTool(service);
|
|
165
|
-
return [
|
|
166
|
-
tool,
|
|
167
|
-
bindOrchestrationTool(createWaitForTool(), toolContext),
|
|
168
|
-
bindOrchestrationTool(createCheckTaskTool(), toolContext),
|
|
169
|
-
bindOrchestrationTool(createListTasksTool(), toolContext)
|
|
170
|
-
];
|
|
171
|
-
},
|
|
172
|
-
metadata: {
|
|
173
|
-
displayName: "Agent Spawner",
|
|
174
|
-
description: "Spawn sub-agents for task delegation",
|
|
175
|
-
category: "agents"
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
export {
|
|
179
|
-
agentSpawnerToolsProvider
|
|
180
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tool-provider/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IAEjB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|