@easynet/agent-tool 1.0.49 → 1.0.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/api/extension/dynamicImportAdapter.d.ts.map +1 -1
- package/dist/api/extension/registerFromManifest.d.ts.map +1 -1
- package/dist/api/main.cjs +15 -15
- package/dist/api/main.js +4 -4
- package/dist/{chunk-XHFZEA7L.cjs → chunk-3GK6IK3N.cjs} +28 -28
- package/dist/{chunk-XHFZEA7L.cjs.map → chunk-3GK6IK3N.cjs.map} +1 -1
- package/dist/{chunk-5GXFZ4GF.cjs → chunk-E3JK57SR.cjs} +15 -15
- package/dist/{chunk-5GXFZ4GF.cjs.map → chunk-E3JK57SR.cjs.map} +1 -1
- package/dist/{chunk-ZRHPGW7W.js → chunk-FCYBA7PR.js} +3 -3
- package/dist/{chunk-ZRHPGW7W.js.map → chunk-FCYBA7PR.js.map} +1 -1
- package/dist/{chunk-C6IARXVY.js → chunk-H4RZJVNS.js} +3 -3
- package/dist/{chunk-C6IARXVY.js.map → chunk-H4RZJVNS.js.map} +1 -1
- package/dist/{chunk-FECO5FHB.js → chunk-NYUSA2YV.js} +4 -4
- package/dist/{chunk-FECO5FHB.js.map → chunk-NYUSA2YV.js.map} +1 -1
- package/dist/{chunk-KDB3MY2H.js → chunk-ODEHUAR4.js} +2 -2
- package/dist/chunk-ODEHUAR4.js.map +1 -0
- package/dist/{chunk-DYDNPIV2.cjs → chunk-QEJF3KDV.cjs} +2 -2
- package/dist/chunk-QEJF3KDV.cjs.map +1 -0
- package/dist/{chunk-BCMMIJAQ.cjs → chunk-QEZLUBAL.cjs} +11 -11
- package/dist/{chunk-BCMMIJAQ.cjs.map → chunk-QEZLUBAL.cjs.map} +1 -1
- package/dist/{chunk-TOSPHMYU.cjs → chunk-WQMHMPNC.cjs} +7 -7
- package/dist/{chunk-TOSPHMYU.cjs.map → chunk-WQMHMPNC.cjs.map} +1 -1
- package/dist/{chunk-2S465X6Q.js → chunk-ZWYRMANX.js} +4 -4
- package/dist/{chunk-2S465X6Q.js.map → chunk-ZWYRMANX.js.map} +1 -1
- package/dist/core/index.cjs +4 -4
- package/dist/core/index.js +1 -1
- package/dist/core/runtime.cjs +6 -6
- package/dist/core/runtime.js +2 -2
- package/dist/core/types/ToolSpec.d.ts +2 -0
- package/dist/core/types/ToolSpec.d.ts.map +1 -1
- package/dist/index.cjs +42 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/utils/cli/index.cjs +18 -18
- package/dist/utils/cli/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-DYDNPIV2.cjs.map +0 -1
- package/dist/chunk-KDB3MY2H.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamicImportAdapter.d.ts","sourceRoot":"","sources":["../../../src/api/extension/dynamicImportAdapter.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAuB/D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,2BAA2B,CAAC,QAAQ;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,QAAQ,CAAC;IAC9G,aAAa,EAAE;QAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;KAAE,CAAC;CACjH;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EACjD,OAAO,EAAE,2BAA2B,CAAC,QAAQ,CAAC,GAC7C,WAAW,
|
|
1
|
+
{"version":3,"file":"dynamicImportAdapter.d.ts","sourceRoot":"","sources":["../../../src/api/extension/dynamicImportAdapter.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAuB/D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,2BAA2B,CAAC,QAAQ;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,QAAQ,CAAC;IAC9G,aAAa,EAAE;QAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;KAAE,CAAC;CACjH;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EACjD,OAAO,EAAE,2BAA2B,CAAC,QAAQ,CAAC,GAC7C,WAAW,CA4Cb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerFromManifest.d.ts","sourceRoot":"","sources":["../../../src/api/extension/registerFromManifest.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGxE,2FAA2F;AAC3F,MAAM,WAAW,sBAAsB;IACrC,sFAAsF;IACtF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,2BAA2B;IAC1C,gFAAgF;IAChF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,mHAAmH;IACnH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,iBAAiB,EAAE,MAAM,GAAG,uBAAuB,CAgBxF;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,2BAA2B,GACnC,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"registerFromManifest.d.ts","sourceRoot":"","sources":["../../../src/api/extension/registerFromManifest.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAGxE,2FAA2F;AAC3F,MAAM,WAAW,sBAAsB;IACrC,sFAAsF;IACtF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,2BAA2B;IAC1C,gFAAgF;IAChF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,mHAAmH;IACnH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,iBAAiB,EAAE,MAAM,GAAG,uBAAuB,CAgBxF;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,2BAA2B,GACnC,QAAQ,EAAE,CA4CZ"}
|
package/dist/api/main.cjs
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var chunkE3JK57SR_cjs = require('../chunk-E3JK57SR.cjs');
|
|
4
|
+
var chunk3GK6IK3N_cjs = require('../chunk-3GK6IK3N.cjs');
|
|
5
|
+
require('../chunk-WQMHMPNC.cjs');
|
|
6
|
+
require('../chunk-QEJF3KDV.cjs');
|
|
7
7
|
require('../chunk-UUNG3GL3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "createAgentTools", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkE3JK57SR_cjs.createAgentTools; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "createLangChainToolsAsync", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkE3JK57SR_cjs.createLangChainToolsAsync; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "PTCRuntime", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunk3GK6IK3N_cjs.PTCRuntime; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "createHttpService", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunk3GK6IK3N_cjs.createHttpService; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "createMCPServer", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunk3GK6IK3N_cjs.createMCPServer; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "createMCPServerStreamableHttp", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunk3GK6IK3N_cjs.createMCPServerStreamableHttp; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "createMCPStreamableHttpHandler", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunk3GK6IK3N_cjs.createMCPStreamableHttpHandler; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "createOpenAPIServer", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunk3GK6IK3N_cjs.createHttpService; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "createRuntimeFromConfig", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunk3GK6IK3N_cjs.createRuntimeFromConfig; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "createRuntimeFromConfigSync", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunk3GK6IK3N_cjs.createRuntimeFromConfigSync; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "runMCPServerOverStdio", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunk3GK6IK3N_cjs.runMCPServerOverStdio; }
|
|
54
54
|
});
|
|
55
55
|
//# sourceMappingURL=main.cjs.map
|
|
56
56
|
//# sourceMappingURL=main.cjs.map
|
package/dist/api/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createAgentTools, createLangChainToolsAsync } from '../chunk-
|
|
2
|
-
export { PTCRuntime, createHttpService, createMCPServer, createMCPServerStreamableHttp, createMCPStreamableHttpHandler, createHttpService as createOpenAPIServer, createRuntimeFromConfig, createRuntimeFromConfigSync, runMCPServerOverStdio } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { createAgentTools, createLangChainToolsAsync } from '../chunk-H4RZJVNS.js';
|
|
2
|
+
export { PTCRuntime, createHttpService, createMCPServer, createMCPServerStreamableHttp, createMCPStreamableHttpHandler, createHttpService as createOpenAPIServer, createRuntimeFromConfig, createRuntimeFromConfigSync, runMCPServerOverStdio } from '../chunk-ZWYRMANX.js';
|
|
3
|
+
import '../chunk-FCYBA7PR.js';
|
|
4
|
+
import '../chunk-ODEHUAR4.js';
|
|
5
5
|
import '../chunk-NTWOVFEY.js';
|
|
6
6
|
//# sourceMappingURL=main.js.map
|
|
7
7
|
//# sourceMappingURL=main.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkWQMHMPNC_cjs = require('./chunk-WQMHMPNC.cjs');
|
|
4
|
+
var chunkQEJF3KDV_cjs = require('./chunk-QEJF3KDV.cjs');
|
|
5
5
|
var chunkUUNG3GL3_cjs = require('./chunk-UUNG3GL3.cjs');
|
|
6
6
|
var fs = require('fs');
|
|
7
7
|
var path = require('path');
|
|
@@ -134,7 +134,7 @@ function npmDescriptorToRegistryPrefix(descriptor, resolvedVersion) {
|
|
|
134
134
|
const scope = slashIdx < 0 ? scopeAndPackage : scopeAndPackage.slice(0, slashIdx).replace(/^@/, "");
|
|
135
135
|
const pkg = slashIdx < 0 ? "" : scopeAndPackage.slice(slashIdx + 1);
|
|
136
136
|
const segment = [scope, pkg, version].filter(Boolean).join(".");
|
|
137
|
-
const normalized =
|
|
137
|
+
const normalized = chunkQEJF3KDV_cjs.normalizeToolName(segment);
|
|
138
138
|
if (!normalized) return "";
|
|
139
139
|
return "npm." + normalized + ".";
|
|
140
140
|
}
|
|
@@ -150,7 +150,7 @@ function npmDescriptorToPackagePrefix(descriptor) {
|
|
|
150
150
|
const scope = slashIdx < 0 ? scopeAndPackage : scopeAndPackage.slice(0, slashIdx).replace(/^@/, "");
|
|
151
151
|
const pkg = slashIdx < 0 ? "" : scopeAndPackage.slice(slashIdx + 1);
|
|
152
152
|
const segment = [scope, pkg].filter(Boolean).join(".");
|
|
153
|
-
const normalized =
|
|
153
|
+
const normalized = chunkQEJF3KDV_cjs.normalizeToolName(segment);
|
|
154
154
|
if (!normalized) return "";
|
|
155
155
|
return "npm." + normalized;
|
|
156
156
|
}
|
|
@@ -167,7 +167,7 @@ function npmDescriptorToPackagePrefixWithVersion(descriptor) {
|
|
|
167
167
|
const scope = slashIdx < 0 ? scopeAndPackage : scopeAndPackage.slice(0, slashIdx).replace(/^@/, "");
|
|
168
168
|
const pkg = slashIdx < 0 ? "" : scopeAndPackage.slice(slashIdx + 1);
|
|
169
169
|
const segment = [scope, pkg, version].filter(Boolean).join(".");
|
|
170
|
-
const normalized =
|
|
170
|
+
const normalized = chunkQEJF3KDV_cjs.normalizeToolName(segment);
|
|
171
171
|
if (!normalized) return "";
|
|
172
172
|
return "npm." + normalized;
|
|
173
173
|
}
|
|
@@ -179,7 +179,7 @@ function expandToolDescriptorsToRegistryNames(descriptors, registryNames) {
|
|
|
179
179
|
const out = [];
|
|
180
180
|
const seen = /* @__PURE__ */ new Set();
|
|
181
181
|
function add(name) {
|
|
182
|
-
const key =
|
|
182
|
+
const key = chunkQEJF3KDV_cjs.normalizeToolName(name);
|
|
183
183
|
if (registryNames.includes(key) && !seen.has(key)) {
|
|
184
184
|
seen.add(key);
|
|
185
185
|
out.push(key);
|
|
@@ -227,7 +227,7 @@ function expandToolDescriptorsToRegistryNames(descriptors, registryNames) {
|
|
|
227
227
|
}
|
|
228
228
|
continue;
|
|
229
229
|
}
|
|
230
|
-
const name =
|
|
230
|
+
const name = chunkQEJF3KDV_cjs.normalizeToolName(s);
|
|
231
231
|
add(name);
|
|
232
232
|
}
|
|
233
233
|
return out;
|
|
@@ -240,7 +240,7 @@ function fileDescriptorToPackagePrefix(descriptor) {
|
|
|
240
240
|
const path = parseToolPath(descriptor.trim());
|
|
241
241
|
if (!path || path.protocol !== "file") return "";
|
|
242
242
|
const pathPart = `${path.scope}/${path.packageWithVersion}`;
|
|
243
|
-
const normalized =
|
|
243
|
+
const normalized = chunkQEJF3KDV_cjs.normalizeToolName(pathPart);
|
|
244
244
|
if (!normalized) return "";
|
|
245
245
|
return "file." + normalized;
|
|
246
246
|
}
|
|
@@ -1164,10 +1164,10 @@ var Tracing = class {
|
|
|
1164
1164
|
}
|
|
1165
1165
|
};
|
|
1166
1166
|
function resolveTool(toolName, registry) {
|
|
1167
|
-
const key =
|
|
1167
|
+
const key = chunkQEJF3KDV_cjs.normalizeToolName(toolName);
|
|
1168
1168
|
const spec = registry.get(key);
|
|
1169
1169
|
if (!spec) {
|
|
1170
|
-
throw
|
|
1170
|
+
throw chunkWQMHMPNC_cjs.createTaggedError(
|
|
1171
1171
|
"TOOL_NOT_FOUND",
|
|
1172
1172
|
`Tool not found: ${toolName}`,
|
|
1173
1173
|
{ availableTools: registry.snapshot().slice(0, 20).map((s) => s.name) }
|
|
@@ -1206,7 +1206,7 @@ function validateInput(spec, args, validator) {
|
|
|
1206
1206
|
if (error instanceof SchemaValidationError) {
|
|
1207
1207
|
const requiredKeys = getRequiredKeys(spec.inputSchema);
|
|
1208
1208
|
const passedKeys = args != null && typeof args === "object" && !Array.isArray(args) ? Object.keys(args) : [];
|
|
1209
|
-
throw
|
|
1209
|
+
throw chunkWQMHMPNC_cjs.createTaggedError("INPUT_SCHEMA_INVALID", error.message, {
|
|
1210
1210
|
errors: error.errors,
|
|
1211
1211
|
schema: spec.inputSchema,
|
|
1212
1212
|
requiredKeys: requiredKeys.length ? requiredKeys : void 0,
|
|
@@ -1279,7 +1279,7 @@ async function requireHumanApproval(spec, args, ctx, deps) {
|
|
|
1279
1279
|
sideEffect,
|
|
1280
1280
|
reason: err instanceof Error ? err.message : String(err)
|
|
1281
1281
|
});
|
|
1282
|
-
throw
|
|
1282
|
+
throw chunkWQMHMPNC_cjs.createTaggedError(
|
|
1283
1283
|
"HITL_DENIED",
|
|
1284
1284
|
`Human denied approval for ${spec.name} (${sideEffect})`,
|
|
1285
1285
|
{ reason: err instanceof Error ? err.message : String(err) }
|
|
@@ -1292,7 +1292,7 @@ async function requireHumanApproval(spec, args, ctx, deps) {
|
|
|
1292
1292
|
sideEffect,
|
|
1293
1293
|
reason: "User rejected"
|
|
1294
1294
|
});
|
|
1295
|
-
throw
|
|
1295
|
+
throw chunkWQMHMPNC_cjs.createTaggedError("HITL_DENIED", `Human denied approval for ${spec.name} (${sideEffect})`);
|
|
1296
1296
|
}
|
|
1297
1297
|
deps.eventLog.append({
|
|
1298
1298
|
...baseEvent,
|
|
@@ -1304,7 +1304,7 @@ async function requireHumanApproval(spec, args, ctx, deps) {
|
|
|
1304
1304
|
async function executeWithBudget(spec, args, ctx, spanId, deps) {
|
|
1305
1305
|
const adapter = deps.adapters.get(spec.kind);
|
|
1306
1306
|
if (!adapter) {
|
|
1307
|
-
throw
|
|
1307
|
+
throw chunkWQMHMPNC_cjs.createTaggedError(
|
|
1308
1308
|
"TOOL_NOT_FOUND",
|
|
1309
1309
|
`No adapter registered for kind: ${spec.kind}`
|
|
1310
1310
|
);
|
|
@@ -1332,7 +1332,7 @@ async function executeWithBudget(spec, args, ctx, spanId, deps) {
|
|
|
1332
1332
|
return result;
|
|
1333
1333
|
});
|
|
1334
1334
|
};
|
|
1335
|
-
const retryFn = () =>
|
|
1335
|
+
const retryFn = () => chunkWQMHMPNC_cjs.withRetry(executeFn, {
|
|
1336
1336
|
maxRetries,
|
|
1337
1337
|
onRetry: (error, attempt) => {
|
|
1338
1338
|
deps.metrics.recordRetry(spec.name);
|
|
@@ -1359,7 +1359,7 @@ async function executeWithBudget(spec, args, ctx, spanId, deps) {
|
|
|
1359
1359
|
});
|
|
1360
1360
|
} catch (error) {
|
|
1361
1361
|
if (error instanceof Error && error.message.includes("timed out")) {
|
|
1362
|
-
throw
|
|
1362
|
+
throw chunkWQMHMPNC_cjs.createTaggedError("TIMEOUT", error.message);
|
|
1363
1363
|
}
|
|
1364
1364
|
throw error;
|
|
1365
1365
|
}
|
|
@@ -1373,7 +1373,7 @@ function validateOutput(spec, result, validator) {
|
|
|
1373
1373
|
);
|
|
1374
1374
|
} catch (error) {
|
|
1375
1375
|
if (error instanceof SchemaValidationError) {
|
|
1376
|
-
throw
|
|
1376
|
+
throw chunkWQMHMPNC_cjs.createTaggedError("OUTPUT_SCHEMA_INVALID", error.message, {
|
|
1377
1377
|
errors: error.errors
|
|
1378
1378
|
});
|
|
1379
1379
|
}
|
|
@@ -1466,7 +1466,7 @@ var PTCRuntime = class {
|
|
|
1466
1466
|
logger;
|
|
1467
1467
|
constructor(options = {}) {
|
|
1468
1468
|
this.config = options.config ?? {};
|
|
1469
|
-
this.registry = options.registry ?? new
|
|
1469
|
+
this.registry = options.registry ?? new chunkWQMHMPNC_cjs.ToolRegistry();
|
|
1470
1470
|
this.validator = options.validator ?? new SchemaValidator();
|
|
1471
1471
|
this.policy = options.policy ?? new PolicyEngine(this.config.policy);
|
|
1472
1472
|
this.budget = options.budget ?? new BudgetManager(this.config.budget);
|
|
@@ -1567,7 +1567,7 @@ var PTCRuntime = class {
|
|
|
1567
1567
|
tracing: this.tracing
|
|
1568
1568
|
});
|
|
1569
1569
|
if (!this.budget.checkRateLimit(spec.name)) {
|
|
1570
|
-
throw
|
|
1570
|
+
throw chunkWQMHMPNC_cjs.createTaggedError(
|
|
1571
1571
|
"BUDGET_EXCEEDED",
|
|
1572
1572
|
`Rate limit exceeded for tool: ${spec.name}`
|
|
1573
1573
|
);
|
|
@@ -1590,7 +1590,7 @@ var PTCRuntime = class {
|
|
|
1590
1590
|
const toolError = asToolReturnedError(result);
|
|
1591
1591
|
if (toolError) {
|
|
1592
1592
|
const hint = buildInputSchemaHint(spec.inputSchema);
|
|
1593
|
-
throw
|
|
1593
|
+
throw chunkWQMHMPNC_cjs.createTaggedError("UPSTREAM_ERROR", toolError.message, {
|
|
1594
1594
|
...toolError.details && typeof toolError.details === "object" && !Array.isArray(toolError.details) ? toolError.details : {},
|
|
1595
1595
|
hint: hint ?? "Check the tool's input schema for required property names."
|
|
1596
1596
|
});
|
|
@@ -1741,7 +1741,7 @@ async function resolveSandboxedPath2(inputPath, sandboxRoot) {
|
|
|
1741
1741
|
real = path.resolve(realParent, path.basename(resolved));
|
|
1742
1742
|
}
|
|
1743
1743
|
if (sandboxValidationEnabled && !isWithinRoot(real, normalizedRoot)) {
|
|
1744
|
-
throw
|
|
1744
|
+
throw chunkWQMHMPNC_cjs.createTaggedError(
|
|
1745
1745
|
"PATH_OUTSIDE_SANDBOX",
|
|
1746
1746
|
`Path "${inputPath}" resolves to "${real}" which is outside sandbox "${normalizedRoot}"`,
|
|
1747
1747
|
{ inputPath, resolvedPath: real, sandboxRoot: normalizedRoot }
|
|
@@ -1756,7 +1756,7 @@ function isWithinRoot(path$1, root) {
|
|
|
1756
1756
|
}
|
|
1757
1757
|
|
|
1758
1758
|
// src/api/runtimeFromConfig.ts
|
|
1759
|
-
var requireFromPackage = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
1759
|
+
var requireFromPackage = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-3GK6IK3N.cjs', document.baseURI).href)));
|
|
1760
1760
|
function getProjectRequire() {
|
|
1761
1761
|
const cwd = process.cwd();
|
|
1762
1762
|
if (fs.existsSync(path.join(cwd, "package.json"))) return module$1.createRequire(path.join(cwd, "package.json"));
|
|
@@ -1813,7 +1813,7 @@ function loadExtensionFromNodeModules() {
|
|
|
1813
1813
|
function createPrefixingRegistry(registry, prefix) {
|
|
1814
1814
|
return {
|
|
1815
1815
|
register(spec) {
|
|
1816
|
-
registry.register({ ...spec, name: prefix +
|
|
1816
|
+
registry.register({ ...spec, name: prefix + chunkQEJF3KDV_cjs.normalizeToolName(spec.name) });
|
|
1817
1817
|
},
|
|
1818
1818
|
bulkRegister(specs) {
|
|
1819
1819
|
specs.forEach((s) => this.register(s));
|
|
@@ -2023,7 +2023,7 @@ async function loadAllExtensionsFromToolYamlAsync(configFilePath, stepLog) {
|
|
|
2023
2023
|
return loaded;
|
|
2024
2024
|
}
|
|
2025
2025
|
function createRuntimeFromConfigSync(options = {}) {
|
|
2026
|
-
const registry = new
|
|
2026
|
+
const registry = new chunkWQMHMPNC_cjs.ToolRegistry();
|
|
2027
2027
|
const stepLog = options.stepLog;
|
|
2028
2028
|
setSandboxValidationEnabled(options.coreTools?.enableSandboxValidation === true);
|
|
2029
2029
|
if (options.coreTools !== void 0) {
|
|
@@ -2066,7 +2066,7 @@ async function createRuntimeFromConfig(options = {}) {
|
|
|
2066
2066
|
const all = await loadAllExtensionsFromToolYamlAsync(options.configFilePath, options.stepLog);
|
|
2067
2067
|
if (all.length > 0) {
|
|
2068
2068
|
if (options.stepLog) options.stepLog(`Registered ${all.length} extension(s) from tool.yaml`);
|
|
2069
|
-
const registry = new
|
|
2069
|
+
const registry = new chunkWQMHMPNC_cjs.ToolRegistry();
|
|
2070
2070
|
const runtime = new PTCRuntime({ registry });
|
|
2071
2071
|
for (const ext of all) {
|
|
2072
2072
|
const prefix = ext.descriptor.startsWith("file:") ? fileDescriptorToRegistryPrefix(ext.descriptor) : npmDescriptorToRegistryPrefix(ext.descriptor, ext.resolvedVersion);
|
|
@@ -2434,7 +2434,7 @@ var DEFAULT_CTX2 = {
|
|
|
2434
2434
|
]
|
|
2435
2435
|
};
|
|
2436
2436
|
function toMcpToolName(registryName) {
|
|
2437
|
-
return
|
|
2437
|
+
return chunkQEJF3KDV_cjs.normalizeToolName(registryName);
|
|
2438
2438
|
}
|
|
2439
2439
|
async function createMcpServerWithTools(runtime, options) {
|
|
2440
2440
|
const { McpServer } = await import('@modelcontextprotocol/sdk/server/mcp.js');
|
|
@@ -2575,5 +2575,5 @@ exports.resolveSandboxedPath2 = resolveSandboxedPath2;
|
|
|
2575
2575
|
exports.resolveToolDescriptor = resolveToolDescriptor;
|
|
2576
2576
|
exports.runMCPServerOverStdio = runMCPServerOverStdio;
|
|
2577
2577
|
exports.setSandboxValidationEnabled = setSandboxValidationEnabled;
|
|
2578
|
-
//# sourceMappingURL=chunk-
|
|
2579
|
-
//# sourceMappingURL=chunk-
|
|
2578
|
+
//# sourceMappingURL=chunk-3GK6IK3N.cjs.map
|
|
2579
|
+
//# sourceMappingURL=chunk-3GK6IK3N.cjs.map
|