@dexto/agent-management 1.6.26 → 1.6.27
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.
|
@@ -78,6 +78,7 @@ const agentSpawnerToolsFactory = {
|
|
|
78
78
|
updateWorkspaceRootHint(spawnerRuntime, context);
|
|
79
79
|
attachTaskForker({ toolServices, taskForker: spawnerRuntime, logger });
|
|
80
80
|
const taskSessions = /* @__PURE__ */ new Map();
|
|
81
|
+
const taskHostRuntimeContexts = /* @__PURE__ */ new Map();
|
|
81
82
|
const emitTasksUpdate = (sessionId) => {
|
|
82
83
|
const tasks = taskRegistry.list({
|
|
83
84
|
status: ["running", "completed", "failed", "cancelled"]
|
|
@@ -100,13 +101,14 @@ const agentSpawnerToolsFactory = {
|
|
|
100
101
|
}
|
|
101
102
|
});
|
|
102
103
|
};
|
|
103
|
-
const triggerBackgroundCompletion = (taskId, sessionId) => {
|
|
104
|
+
const triggerBackgroundCompletion = (taskId, sessionId, hostRuntime) => {
|
|
104
105
|
if (!sessionId) {
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
108
|
agent.emit("tool:background-completed", {
|
|
108
109
|
toolCallId: taskId,
|
|
109
|
-
sessionId
|
|
110
|
+
sessionId,
|
|
111
|
+
...hostRuntime !== void 0 && { hostRuntime }
|
|
110
112
|
});
|
|
111
113
|
const taskInfo = taskRegistry.getInfo(taskId);
|
|
112
114
|
const resultText = (() => {
|
|
@@ -154,9 +156,14 @@ const agentSpawnerToolsFactory = {
|
|
|
154
156
|
sessionId,
|
|
155
157
|
content,
|
|
156
158
|
source: "external",
|
|
157
|
-
metadata: { taskId }
|
|
159
|
+
metadata: { taskId },
|
|
160
|
+
...hostRuntime !== void 0 && { hostRuntime }
|
|
158
161
|
});
|
|
159
|
-
agent.generate(content, sessionId
|
|
162
|
+
agent.generate(content, sessionId, {
|
|
163
|
+
...hostRuntime !== void 0 && {
|
|
164
|
+
executionContext: hostRuntime
|
|
165
|
+
}
|
|
166
|
+
}).catch(() => void 0);
|
|
160
167
|
}
|
|
161
168
|
}).catch(() => {
|
|
162
169
|
});
|
|
@@ -169,6 +176,9 @@ const agentSpawnerToolsFactory = {
|
|
|
169
176
|
if (event.sessionId) {
|
|
170
177
|
taskSessions.set(taskId, event.sessionId);
|
|
171
178
|
}
|
|
179
|
+
if (event.hostRuntime !== void 0) {
|
|
180
|
+
taskHostRuntimeContexts.set(taskId, event.hostRuntime);
|
|
181
|
+
}
|
|
172
182
|
try {
|
|
173
183
|
taskRegistry.register(
|
|
174
184
|
{
|
|
@@ -186,6 +196,7 @@ const agentSpawnerToolsFactory = {
|
|
|
186
196
|
);
|
|
187
197
|
} catch (error) {
|
|
188
198
|
taskSessions.delete(taskId);
|
|
199
|
+
taskHostRuntimeContexts.delete(taskId);
|
|
189
200
|
event.promise.catch(() => void 0);
|
|
190
201
|
logger.warn(
|
|
191
202
|
`Failed to register background task ${taskId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -196,8 +207,10 @@ const agentSpawnerToolsFactory = {
|
|
|
196
207
|
emitTasksUpdate(event.sessionId);
|
|
197
208
|
event.promise.finally(() => {
|
|
198
209
|
taskSessions.delete(taskId);
|
|
210
|
+
const hostRuntime = taskHostRuntimeContexts.get(taskId);
|
|
211
|
+
taskHostRuntimeContexts.delete(taskId);
|
|
199
212
|
emitTasksUpdate(event.sessionId);
|
|
200
|
-
triggerBackgroundCompletion(taskId, event.sessionId);
|
|
213
|
+
triggerBackgroundCompletion(taskId, event.sessionId, hostRuntime);
|
|
201
214
|
});
|
|
202
215
|
};
|
|
203
216
|
const abortController = new AbortController();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAiBvD,OAAO,EAGH,KAAK,kBAAkB,EAC1B,MAAM,cAAc,CAAC;AAqCtB,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/tool-factories/agent-spawner/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAiBvD,OAAO,EAGH,KAAK,kBAAkB,EAC1B,MAAM,cAAc,CAAC;AAqCtB,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,kBAAkB,CAiYpE,CAAC"}
|
|
@@ -68,6 +68,7 @@ const agentSpawnerToolsFactory = {
|
|
|
68
68
|
updateWorkspaceRootHint(spawnerRuntime, context);
|
|
69
69
|
attachTaskForker({ toolServices, taskForker: spawnerRuntime, logger });
|
|
70
70
|
const taskSessions = /* @__PURE__ */ new Map();
|
|
71
|
+
const taskHostRuntimeContexts = /* @__PURE__ */ new Map();
|
|
71
72
|
const emitTasksUpdate = (sessionId) => {
|
|
72
73
|
const tasks = taskRegistry.list({
|
|
73
74
|
status: ["running", "completed", "failed", "cancelled"]
|
|
@@ -90,13 +91,14 @@ const agentSpawnerToolsFactory = {
|
|
|
90
91
|
}
|
|
91
92
|
});
|
|
92
93
|
};
|
|
93
|
-
const triggerBackgroundCompletion = (taskId, sessionId) => {
|
|
94
|
+
const triggerBackgroundCompletion = (taskId, sessionId, hostRuntime) => {
|
|
94
95
|
if (!sessionId) {
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
98
|
agent.emit("tool:background-completed", {
|
|
98
99
|
toolCallId: taskId,
|
|
99
|
-
sessionId
|
|
100
|
+
sessionId,
|
|
101
|
+
...hostRuntime !== void 0 && { hostRuntime }
|
|
100
102
|
});
|
|
101
103
|
const taskInfo = taskRegistry.getInfo(taskId);
|
|
102
104
|
const resultText = (() => {
|
|
@@ -144,9 +146,14 @@ const agentSpawnerToolsFactory = {
|
|
|
144
146
|
sessionId,
|
|
145
147
|
content,
|
|
146
148
|
source: "external",
|
|
147
|
-
metadata: { taskId }
|
|
149
|
+
metadata: { taskId },
|
|
150
|
+
...hostRuntime !== void 0 && { hostRuntime }
|
|
148
151
|
});
|
|
149
|
-
agent.generate(content, sessionId
|
|
152
|
+
agent.generate(content, sessionId, {
|
|
153
|
+
...hostRuntime !== void 0 && {
|
|
154
|
+
executionContext: hostRuntime
|
|
155
|
+
}
|
|
156
|
+
}).catch(() => void 0);
|
|
150
157
|
}
|
|
151
158
|
}).catch(() => {
|
|
152
159
|
});
|
|
@@ -159,6 +166,9 @@ const agentSpawnerToolsFactory = {
|
|
|
159
166
|
if (event.sessionId) {
|
|
160
167
|
taskSessions.set(taskId, event.sessionId);
|
|
161
168
|
}
|
|
169
|
+
if (event.hostRuntime !== void 0) {
|
|
170
|
+
taskHostRuntimeContexts.set(taskId, event.hostRuntime);
|
|
171
|
+
}
|
|
162
172
|
try {
|
|
163
173
|
taskRegistry.register(
|
|
164
174
|
{
|
|
@@ -176,6 +186,7 @@ const agentSpawnerToolsFactory = {
|
|
|
176
186
|
);
|
|
177
187
|
} catch (error) {
|
|
178
188
|
taskSessions.delete(taskId);
|
|
189
|
+
taskHostRuntimeContexts.delete(taskId);
|
|
179
190
|
event.promise.catch(() => void 0);
|
|
180
191
|
logger.warn(
|
|
181
192
|
`Failed to register background task ${taskId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -186,8 +197,10 @@ const agentSpawnerToolsFactory = {
|
|
|
186
197
|
emitTasksUpdate(event.sessionId);
|
|
187
198
|
event.promise.finally(() => {
|
|
188
199
|
taskSessions.delete(taskId);
|
|
200
|
+
const hostRuntime = taskHostRuntimeContexts.get(taskId);
|
|
201
|
+
taskHostRuntimeContexts.delete(taskId);
|
|
189
202
|
emitTasksUpdate(event.sessionId);
|
|
190
|
-
triggerBackgroundCompletion(taskId, event.sessionId);
|
|
203
|
+
triggerBackgroundCompletion(taskId, event.sessionId, hostRuntime);
|
|
191
204
|
});
|
|
192
205
|
};
|
|
193
206
|
const abortController = new AbortController();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/agent-management",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.27",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"yaml": "^2.8.3",
|
|
19
19
|
"zod": "^3.25.0",
|
|
20
|
-
"@dexto/agent-config": "1.6.
|
|
21
|
-
"@dexto/core": "1.6.
|
|
22
|
-
"@dexto/orchestration": "1.6.
|
|
23
|
-
"@dexto/tools-builtins": "1.6.
|
|
20
|
+
"@dexto/agent-config": "1.6.27",
|
|
21
|
+
"@dexto/core": "1.6.27",
|
|
22
|
+
"@dexto/orchestration": "1.6.27",
|
|
23
|
+
"@dexto/tools-builtins": "1.6.27"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^22.13.5"
|