@dexto/core 1.17.0 → 1.18.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/agent/DextoAgent.cjs +2 -1
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +2 -1
- package/dist/approval/index.cjs +4 -0
- package/dist/approval/index.d.ts +1 -1
- package/dist/approval/index.d.ts.map +1 -1
- package/dist/approval/index.js +4 -0
- package/dist/events/index.cjs +2 -3
- package/dist/events/index.d.ts +6 -23
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +2 -3
- package/dist/llm/error-codes.cjs +1 -0
- package/dist/llm/error-codes.d.ts +1 -0
- package/dist/llm/error-codes.d.ts.map +1 -1
- package/dist/llm/error-codes.js +1 -0
- package/dist/llm/executor/provider-error.cjs +24 -1
- package/dist/llm/executor/provider-error.d.ts +9 -0
- package/dist/llm/executor/provider-error.d.ts.map +1 -1
- package/dist/llm/executor/provider-error.js +22 -1
- package/dist/llm/executor/turn-executor.cjs +1 -0
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +2 -0
- package/dist/llm/providers/codex-app-server.cjs +3 -3
- package/dist/llm/providers/codex-app-server.js +3 -3
- package/dist/llm/providers/local/errors.cjs +4 -4
- package/dist/llm/providers/local/errors.js +4 -4
- package/dist/llm/services/factory.cjs +2 -2
- package/dist/llm/services/factory.d.ts +1 -1
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +2 -2
- package/dist/logger/logger.cjs +4 -0
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +4 -0
- package/dist/resources/errors.cjs +1 -1
- package/dist/resources/errors.d.ts.map +1 -1
- package/dist/resources/errors.js +1 -1
- package/dist/session/session-manager.cjs +2 -0
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +2 -0
- package/dist/tools/activity.cjs +0 -16
- package/dist/tools/activity.d.ts +0 -2
- package/dist/tools/activity.d.ts.map +1 -1
- package/dist/tools/activity.js +0 -16
- package/dist/tools/tool-call-metadata.cjs +0 -12
- package/dist/tools/tool-call-metadata.d.ts +0 -3
- package/dist/tools/tool-call-metadata.d.ts.map +1 -1
- package/dist/tools/tool-call-metadata.js +0 -12
- package/dist/tools/tool-manager.cjs +10 -93
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +10 -93
- package/dist/utils/env.cjs +0 -5
- package/dist/utils/env.d.ts +0 -1
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +0 -4
- package/package.json +3 -3
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
extractToolCallMeta,
|
|
27
27
|
wrapToolParametersSchema
|
|
28
28
|
} from "./tool-call-metadata.js";
|
|
29
|
-
import { isBackgroundTasksEnabled } from "../utils/env.js";
|
|
30
29
|
function isRecord(value) {
|
|
31
30
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
32
31
|
}
|
|
@@ -1218,10 +1217,6 @@ let _ToolManager = class _ToolManager {
|
|
|
1218
1217
|
});
|
|
1219
1218
|
}
|
|
1220
1219
|
async replayExistingDirectToolExecution(call, invocation) {
|
|
1221
|
-
const { sessionId } = this.resolveToolExecutionInvocation(invocation);
|
|
1222
|
-
if (isBackgroundTasksEnabled() && call.meta?.runInBackground === true && sessionId !== void 0) {
|
|
1223
|
-
return void 0;
|
|
1224
|
-
}
|
|
1225
1220
|
const identity = this.resolveToolExecutionIdentity(
|
|
1226
1221
|
invocation ?? {},
|
|
1227
1222
|
call.toolCallId,
|
|
@@ -1358,14 +1353,11 @@ let _ToolManager = class _ToolManager {
|
|
|
1358
1353
|
}
|
|
1359
1354
|
async executePreparedToolCall(call, invocation, options) {
|
|
1360
1355
|
const { sessionId, abortSignal, runContext, hostRuntime } = this.resolveToolExecutionInvocation(invocation);
|
|
1361
|
-
const
|
|
1356
|
+
const executionIdentity = this.resolveToolExecutionIdentity(
|
|
1362
1357
|
invocation ?? {},
|
|
1363
1358
|
call.toolCallId,
|
|
1364
1359
|
call.parentToolCallId
|
|
1365
1360
|
);
|
|
1366
|
-
const backgroundTasksEnabled = isBackgroundTasksEnabled();
|
|
1367
|
-
const willRunInBackground = backgroundTasksEnabled && call.meta?.runInBackground === true && sessionId !== void 0;
|
|
1368
|
-
const executionIdentity = willRunInBackground ? void 0 : durableIdentity;
|
|
1369
1361
|
const executionId = executionIdentity === void 0 ? void 0 : createToolExecutionId(executionIdentity);
|
|
1370
1362
|
let toolArgs = call.input;
|
|
1371
1363
|
this.logger.debug(
|
|
@@ -1467,16 +1459,6 @@ let _ToolManager = class _ToolManager {
|
|
|
1467
1459
|
}
|
|
1468
1460
|
}
|
|
1469
1461
|
let result;
|
|
1470
|
-
const registerBackgroundTask = (promise, description) => {
|
|
1471
|
-
return {
|
|
1472
|
-
result: {
|
|
1473
|
-
taskId: call.toolCallId,
|
|
1474
|
-
status: "running",
|
|
1475
|
-
description
|
|
1476
|
-
},
|
|
1477
|
-
promise
|
|
1478
|
-
};
|
|
1479
|
-
};
|
|
1480
1462
|
if (call.identity.type === "mcp") {
|
|
1481
1463
|
const actualToolName = call.toolName.substring(_ToolManager.MCP_TOOL_PREFIX.length);
|
|
1482
1464
|
if (actualToolName.length === 0) {
|
|
@@ -1491,81 +1473,16 @@ let _ToolManager = class _ToolManager {
|
|
|
1491
1473
|
sessionId,
|
|
1492
1474
|
runContext
|
|
1493
1475
|
);
|
|
1494
|
-
|
|
1495
|
-
this.logger.debug(
|
|
1496
|
-
"Background tool execution disabled; running synchronously instead.",
|
|
1497
|
-
{ toolName: call.toolName }
|
|
1498
|
-
);
|
|
1499
|
-
}
|
|
1500
|
-
if (willRunInBackground) {
|
|
1501
|
-
const backgroundSessionId = sessionId;
|
|
1502
|
-
const { result: backgroundResult, promise } = registerBackgroundTask(
|
|
1503
|
-
executeMcpTool(),
|
|
1504
|
-
`MCP tool ${actualToolName}`
|
|
1505
|
-
);
|
|
1506
|
-
this.agentEventBus.emit("tool:background", {
|
|
1507
|
-
toolName: call.toolName,
|
|
1508
|
-
toolCallId: backgroundResult.taskId,
|
|
1509
|
-
sessionId: backgroundSessionId,
|
|
1510
|
-
description: backgroundResult.description,
|
|
1511
|
-
promise,
|
|
1512
|
-
...hostRuntime !== void 0 && { hostRuntime },
|
|
1513
|
-
...call.meta?.timeoutMs !== void 0 && {
|
|
1514
|
-
timeoutMs: call.meta.timeoutMs
|
|
1515
|
-
},
|
|
1516
|
-
...call.meta?.notifyOnComplete !== void 0 && {
|
|
1517
|
-
notifyOnComplete: call.meta.notifyOnComplete
|
|
1518
|
-
}
|
|
1519
|
-
});
|
|
1520
|
-
result = backgroundResult;
|
|
1521
|
-
} else {
|
|
1522
|
-
result = await executeMcpTool();
|
|
1523
|
-
}
|
|
1476
|
+
result = await executeMcpTool();
|
|
1524
1477
|
} else {
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
const { result: backgroundResult, promise } = registerBackgroundTask(
|
|
1534
|
-
this.executeLocalTool(call.toolName, toolArgs, {
|
|
1535
|
-
sessionId: backgroundSessionId,
|
|
1536
|
-
abortSignal,
|
|
1537
|
-
executionIdentity,
|
|
1538
|
-
toolCallId: call.toolCallId,
|
|
1539
|
-
parentToolCallId: call.parentToolCallId,
|
|
1540
|
-
runContext
|
|
1541
|
-
}),
|
|
1542
|
-
`Tool ${call.toolName}`
|
|
1543
|
-
);
|
|
1544
|
-
this.agentEventBus.emit("tool:background", {
|
|
1545
|
-
toolName: call.toolName,
|
|
1546
|
-
toolCallId: backgroundResult.taskId,
|
|
1547
|
-
sessionId: backgroundSessionId,
|
|
1548
|
-
description: backgroundResult.description,
|
|
1549
|
-
promise,
|
|
1550
|
-
...hostRuntime !== void 0 && { hostRuntime },
|
|
1551
|
-
...call.meta?.timeoutMs !== void 0 && {
|
|
1552
|
-
timeoutMs: call.meta.timeoutMs
|
|
1553
|
-
},
|
|
1554
|
-
...call.meta?.notifyOnComplete !== void 0 && {
|
|
1555
|
-
notifyOnComplete: call.meta.notifyOnComplete
|
|
1556
|
-
}
|
|
1557
|
-
});
|
|
1558
|
-
result = backgroundResult;
|
|
1559
|
-
} else {
|
|
1560
|
-
result = await this.executeLocalTool(call.toolName, toolArgs, {
|
|
1561
|
-
sessionId,
|
|
1562
|
-
abortSignal,
|
|
1563
|
-
executionIdentity,
|
|
1564
|
-
toolCallId: call.toolCallId,
|
|
1565
|
-
parentToolCallId: call.parentToolCallId,
|
|
1566
|
-
runContext
|
|
1567
|
-
});
|
|
1568
|
-
}
|
|
1478
|
+
result = await this.executeLocalTool(call.toolName, toolArgs, {
|
|
1479
|
+
sessionId,
|
|
1480
|
+
abortSignal,
|
|
1481
|
+
executionIdentity,
|
|
1482
|
+
toolCallId: call.toolCallId,
|
|
1483
|
+
parentToolCallId: call.parentToolCallId,
|
|
1484
|
+
runContext
|
|
1485
|
+
});
|
|
1569
1486
|
}
|
|
1570
1487
|
const duration = Date.now() - startTime;
|
|
1571
1488
|
this.logger.debug(
|
package/dist/utils/env.cjs
CHANGED
|
@@ -18,7 +18,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var env_exports = {};
|
|
20
20
|
__export(env_exports, {
|
|
21
|
-
isBackgroundTasksEnabled: () => isBackgroundTasksEnabled,
|
|
22
21
|
isTruthyEnv: () => isTruthyEnv,
|
|
23
22
|
readBooleanEnv: () => readBooleanEnv
|
|
24
23
|
});
|
|
@@ -38,12 +37,8 @@ function readBooleanEnv(name, defaultValue) {
|
|
|
38
37
|
if (FALSE_VALUES.has(normalized)) return false;
|
|
39
38
|
return defaultValue;
|
|
40
39
|
}
|
|
41
|
-
function isBackgroundTasksEnabled() {
|
|
42
|
-
return readBooleanEnv("DEXTO_BACKGROUND_TASKS_ENABLED", false);
|
|
43
|
-
}
|
|
44
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45
41
|
0 && (module.exports = {
|
|
46
|
-
isBackgroundTasksEnabled,
|
|
47
42
|
isTruthyEnv,
|
|
48
43
|
readBooleanEnv
|
|
49
44
|
});
|
package/dist/utils/env.d.ts
CHANGED
package/dist/utils/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIjD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAO3E
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIjD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAO3E"}
|
package/dist/utils/env.js
CHANGED
|
@@ -14,11 +14,7 @@ function readBooleanEnv(name, defaultValue) {
|
|
|
14
14
|
if (FALSE_VALUES.has(normalized)) return false;
|
|
15
15
|
return defaultValue;
|
|
16
16
|
}
|
|
17
|
-
function isBackgroundTasksEnabled() {
|
|
18
|
-
return readBooleanEnv("DEXTO_BACKGROUND_TASKS_ENABLED", false);
|
|
19
|
-
}
|
|
20
17
|
export {
|
|
21
|
-
isBackgroundTasksEnabled,
|
|
22
18
|
isTruthyEnv,
|
|
23
19
|
readBooleanEnv
|
|
24
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"nanoid": "^5.1.16",
|
|
175
175
|
"winston": "^3.17.0",
|
|
176
176
|
"yaml": "^2.8.3",
|
|
177
|
-
"@dexto/llm": "1.
|
|
177
|
+
"@dexto/llm": "1.18.1"
|
|
178
178
|
},
|
|
179
179
|
"devDependencies": {
|
|
180
180
|
"@opentelemetry/context-async-hooks": "^2.12.0",
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
"@opentelemetry/sdk-node": "^0.223.0",
|
|
199
199
|
"@opentelemetry/sdk-trace-base": "^2.12.0",
|
|
200
200
|
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
201
|
-
"better-sqlite3": "
|
|
201
|
+
"better-sqlite3": "~12.9.0",
|
|
202
202
|
"ioredis": "^5.7.0",
|
|
203
203
|
"pg": "^8.15.4",
|
|
204
204
|
"tsx": "^4.23.15",
|