@easynet/agent-tool 1.0.48 → 1.0.50
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/api/runtimeFromConfig.d.ts.map +1 -1
- package/dist/{chunk-A5B6Q6EG.cjs → chunk-3GK6IK3N.cjs} +72 -38
- package/dist/chunk-3GK6IK3N.cjs.map +1 -0
- package/dist/{chunk-IAEVDXWS.cjs → chunk-E3JK57SR.cjs} +15 -15
- package/dist/{chunk-IAEVDXWS.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-KYBIKD5R.js → chunk-H4RZJVNS.js} +3 -3
- package/dist/{chunk-KYBIKD5R.js.map → chunk-H4RZJVNS.js.map} +1 -1
- package/dist/{chunk-64ZQQV5C.js → chunk-NYUSA2YV.js} +4 -4
- package/dist/{chunk-64ZQQV5C.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-MDPU7EIO.cjs → chunk-QEZLUBAL.cjs} +11 -11
- package/dist/{chunk-MDPU7EIO.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-2ZPDD7ZO.js → chunk-ZWYRMANX.js} +48 -14
- package/dist/chunk-ZWYRMANX.js.map +1 -0
- 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-2ZPDD7ZO.js.map +0 -1
- package/dist/chunk-A5B6Q6EG.cjs.map +0 -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeFromConfig.d.ts","sourceRoot":"","sources":["../../src/api/runtimeFromConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"runtimeFromConfig.d.ts","sourceRoot":"","sources":["../../src/api/runtimeFromConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAqC3D;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,EAAO,CAAC;AAEvD,gEAAgE;AAChE,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,8PAA8P;IAC9P,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxD,qKAAqK;IACrK,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1D,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,uDAAuD;AACvD,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,oEAAoE;IACpE,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,yEAAyE;IACzE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ,EAAE,YAAY,CAAC;CACxB;AAqFD,qKAAqK;AACrK,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQjG;AA+ND;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,oBAAyB,GAAG,mBAAmB,CA2CnG;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAoB9B"}
|
|
@@ -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');
|
|
@@ -14,6 +14,7 @@ var uuid = require('uuid');
|
|
|
14
14
|
var pTimeout = require('p-timeout');
|
|
15
15
|
var promises = require('fs/promises');
|
|
16
16
|
var module$1 = require('module');
|
|
17
|
+
var url = require('url');
|
|
17
18
|
var npm = require('@easynet/agent-common/npm');
|
|
18
19
|
var http = require('http');
|
|
19
20
|
|
|
@@ -133,7 +134,7 @@ function npmDescriptorToRegistryPrefix(descriptor, resolvedVersion) {
|
|
|
133
134
|
const scope = slashIdx < 0 ? scopeAndPackage : scopeAndPackage.slice(0, slashIdx).replace(/^@/, "");
|
|
134
135
|
const pkg = slashIdx < 0 ? "" : scopeAndPackage.slice(slashIdx + 1);
|
|
135
136
|
const segment = [scope, pkg, version].filter(Boolean).join(".");
|
|
136
|
-
const normalized =
|
|
137
|
+
const normalized = chunkQEJF3KDV_cjs.normalizeToolName(segment);
|
|
137
138
|
if (!normalized) return "";
|
|
138
139
|
return "npm." + normalized + ".";
|
|
139
140
|
}
|
|
@@ -149,7 +150,7 @@ function npmDescriptorToPackagePrefix(descriptor) {
|
|
|
149
150
|
const scope = slashIdx < 0 ? scopeAndPackage : scopeAndPackage.slice(0, slashIdx).replace(/^@/, "");
|
|
150
151
|
const pkg = slashIdx < 0 ? "" : scopeAndPackage.slice(slashIdx + 1);
|
|
151
152
|
const segment = [scope, pkg].filter(Boolean).join(".");
|
|
152
|
-
const normalized =
|
|
153
|
+
const normalized = chunkQEJF3KDV_cjs.normalizeToolName(segment);
|
|
153
154
|
if (!normalized) return "";
|
|
154
155
|
return "npm." + normalized;
|
|
155
156
|
}
|
|
@@ -166,7 +167,7 @@ function npmDescriptorToPackagePrefixWithVersion(descriptor) {
|
|
|
166
167
|
const scope = slashIdx < 0 ? scopeAndPackage : scopeAndPackage.slice(0, slashIdx).replace(/^@/, "");
|
|
167
168
|
const pkg = slashIdx < 0 ? "" : scopeAndPackage.slice(slashIdx + 1);
|
|
168
169
|
const segment = [scope, pkg, version].filter(Boolean).join(".");
|
|
169
|
-
const normalized =
|
|
170
|
+
const normalized = chunkQEJF3KDV_cjs.normalizeToolName(segment);
|
|
170
171
|
if (!normalized) return "";
|
|
171
172
|
return "npm." + normalized;
|
|
172
173
|
}
|
|
@@ -178,7 +179,7 @@ function expandToolDescriptorsToRegistryNames(descriptors, registryNames) {
|
|
|
178
179
|
const out = [];
|
|
179
180
|
const seen = /* @__PURE__ */ new Set();
|
|
180
181
|
function add(name) {
|
|
181
|
-
const key =
|
|
182
|
+
const key = chunkQEJF3KDV_cjs.normalizeToolName(name);
|
|
182
183
|
if (registryNames.includes(key) && !seen.has(key)) {
|
|
183
184
|
seen.add(key);
|
|
184
185
|
out.push(key);
|
|
@@ -226,7 +227,7 @@ function expandToolDescriptorsToRegistryNames(descriptors, registryNames) {
|
|
|
226
227
|
}
|
|
227
228
|
continue;
|
|
228
229
|
}
|
|
229
|
-
const name =
|
|
230
|
+
const name = chunkQEJF3KDV_cjs.normalizeToolName(s);
|
|
230
231
|
add(name);
|
|
231
232
|
}
|
|
232
233
|
return out;
|
|
@@ -239,7 +240,7 @@ function fileDescriptorToPackagePrefix(descriptor) {
|
|
|
239
240
|
const path = parseToolPath(descriptor.trim());
|
|
240
241
|
if (!path || path.protocol !== "file") return "";
|
|
241
242
|
const pathPart = `${path.scope}/${path.packageWithVersion}`;
|
|
242
|
-
const normalized =
|
|
243
|
+
const normalized = chunkQEJF3KDV_cjs.normalizeToolName(pathPart);
|
|
243
244
|
if (!normalized) return "";
|
|
244
245
|
return "file." + normalized;
|
|
245
246
|
}
|
|
@@ -1163,10 +1164,10 @@ var Tracing = class {
|
|
|
1163
1164
|
}
|
|
1164
1165
|
};
|
|
1165
1166
|
function resolveTool(toolName, registry) {
|
|
1166
|
-
const key =
|
|
1167
|
+
const key = chunkQEJF3KDV_cjs.normalizeToolName(toolName);
|
|
1167
1168
|
const spec = registry.get(key);
|
|
1168
1169
|
if (!spec) {
|
|
1169
|
-
throw
|
|
1170
|
+
throw chunkWQMHMPNC_cjs.createTaggedError(
|
|
1170
1171
|
"TOOL_NOT_FOUND",
|
|
1171
1172
|
`Tool not found: ${toolName}`,
|
|
1172
1173
|
{ availableTools: registry.snapshot().slice(0, 20).map((s) => s.name) }
|
|
@@ -1205,7 +1206,7 @@ function validateInput(spec, args, validator) {
|
|
|
1205
1206
|
if (error instanceof SchemaValidationError) {
|
|
1206
1207
|
const requiredKeys = getRequiredKeys(spec.inputSchema);
|
|
1207
1208
|
const passedKeys = args != null && typeof args === "object" && !Array.isArray(args) ? Object.keys(args) : [];
|
|
1208
|
-
throw
|
|
1209
|
+
throw chunkWQMHMPNC_cjs.createTaggedError("INPUT_SCHEMA_INVALID", error.message, {
|
|
1209
1210
|
errors: error.errors,
|
|
1210
1211
|
schema: spec.inputSchema,
|
|
1211
1212
|
requiredKeys: requiredKeys.length ? requiredKeys : void 0,
|
|
@@ -1278,7 +1279,7 @@ async function requireHumanApproval(spec, args, ctx, deps) {
|
|
|
1278
1279
|
sideEffect,
|
|
1279
1280
|
reason: err instanceof Error ? err.message : String(err)
|
|
1280
1281
|
});
|
|
1281
|
-
throw
|
|
1282
|
+
throw chunkWQMHMPNC_cjs.createTaggedError(
|
|
1282
1283
|
"HITL_DENIED",
|
|
1283
1284
|
`Human denied approval for ${spec.name} (${sideEffect})`,
|
|
1284
1285
|
{ reason: err instanceof Error ? err.message : String(err) }
|
|
@@ -1291,7 +1292,7 @@ async function requireHumanApproval(spec, args, ctx, deps) {
|
|
|
1291
1292
|
sideEffect,
|
|
1292
1293
|
reason: "User rejected"
|
|
1293
1294
|
});
|
|
1294
|
-
throw
|
|
1295
|
+
throw chunkWQMHMPNC_cjs.createTaggedError("HITL_DENIED", `Human denied approval for ${spec.name} (${sideEffect})`);
|
|
1295
1296
|
}
|
|
1296
1297
|
deps.eventLog.append({
|
|
1297
1298
|
...baseEvent,
|
|
@@ -1303,7 +1304,7 @@ async function requireHumanApproval(spec, args, ctx, deps) {
|
|
|
1303
1304
|
async function executeWithBudget(spec, args, ctx, spanId, deps) {
|
|
1304
1305
|
const adapter = deps.adapters.get(spec.kind);
|
|
1305
1306
|
if (!adapter) {
|
|
1306
|
-
throw
|
|
1307
|
+
throw chunkWQMHMPNC_cjs.createTaggedError(
|
|
1307
1308
|
"TOOL_NOT_FOUND",
|
|
1308
1309
|
`No adapter registered for kind: ${spec.kind}`
|
|
1309
1310
|
);
|
|
@@ -1331,7 +1332,7 @@ async function executeWithBudget(spec, args, ctx, spanId, deps) {
|
|
|
1331
1332
|
return result;
|
|
1332
1333
|
});
|
|
1333
1334
|
};
|
|
1334
|
-
const retryFn = () =>
|
|
1335
|
+
const retryFn = () => chunkWQMHMPNC_cjs.withRetry(executeFn, {
|
|
1335
1336
|
maxRetries,
|
|
1336
1337
|
onRetry: (error, attempt) => {
|
|
1337
1338
|
deps.metrics.recordRetry(spec.name);
|
|
@@ -1358,7 +1359,7 @@ async function executeWithBudget(spec, args, ctx, spanId, deps) {
|
|
|
1358
1359
|
});
|
|
1359
1360
|
} catch (error) {
|
|
1360
1361
|
if (error instanceof Error && error.message.includes("timed out")) {
|
|
1361
|
-
throw
|
|
1362
|
+
throw chunkWQMHMPNC_cjs.createTaggedError("TIMEOUT", error.message);
|
|
1362
1363
|
}
|
|
1363
1364
|
throw error;
|
|
1364
1365
|
}
|
|
@@ -1372,7 +1373,7 @@ function validateOutput(spec, result, validator) {
|
|
|
1372
1373
|
);
|
|
1373
1374
|
} catch (error) {
|
|
1374
1375
|
if (error instanceof SchemaValidationError) {
|
|
1375
|
-
throw
|
|
1376
|
+
throw chunkWQMHMPNC_cjs.createTaggedError("OUTPUT_SCHEMA_INVALID", error.message, {
|
|
1376
1377
|
errors: error.errors
|
|
1377
1378
|
});
|
|
1378
1379
|
}
|
|
@@ -1465,7 +1466,7 @@ var PTCRuntime = class {
|
|
|
1465
1466
|
logger;
|
|
1466
1467
|
constructor(options = {}) {
|
|
1467
1468
|
this.config = options.config ?? {};
|
|
1468
|
-
this.registry = options.registry ?? new
|
|
1469
|
+
this.registry = options.registry ?? new chunkWQMHMPNC_cjs.ToolRegistry();
|
|
1469
1470
|
this.validator = options.validator ?? new SchemaValidator();
|
|
1470
1471
|
this.policy = options.policy ?? new PolicyEngine(this.config.policy);
|
|
1471
1472
|
this.budget = options.budget ?? new BudgetManager(this.config.budget);
|
|
@@ -1566,7 +1567,7 @@ var PTCRuntime = class {
|
|
|
1566
1567
|
tracing: this.tracing
|
|
1567
1568
|
});
|
|
1568
1569
|
if (!this.budget.checkRateLimit(spec.name)) {
|
|
1569
|
-
throw
|
|
1570
|
+
throw chunkWQMHMPNC_cjs.createTaggedError(
|
|
1570
1571
|
"BUDGET_EXCEEDED",
|
|
1571
1572
|
`Rate limit exceeded for tool: ${spec.name}`
|
|
1572
1573
|
);
|
|
@@ -1589,7 +1590,7 @@ var PTCRuntime = class {
|
|
|
1589
1590
|
const toolError = asToolReturnedError(result);
|
|
1590
1591
|
if (toolError) {
|
|
1591
1592
|
const hint = buildInputSchemaHint(spec.inputSchema);
|
|
1592
|
-
throw
|
|
1593
|
+
throw chunkWQMHMPNC_cjs.createTaggedError("UPSTREAM_ERROR", toolError.message, {
|
|
1593
1594
|
...toolError.details && typeof toolError.details === "object" && !Array.isArray(toolError.details) ? toolError.details : {},
|
|
1594
1595
|
hint: hint ?? "Check the tool's input schema for required property names."
|
|
1595
1596
|
});
|
|
@@ -1740,7 +1741,7 @@ async function resolveSandboxedPath2(inputPath, sandboxRoot) {
|
|
|
1740
1741
|
real = path.resolve(realParent, path.basename(resolved));
|
|
1741
1742
|
}
|
|
1742
1743
|
if (sandboxValidationEnabled && !isWithinRoot(real, normalizedRoot)) {
|
|
1743
|
-
throw
|
|
1744
|
+
throw chunkWQMHMPNC_cjs.createTaggedError(
|
|
1744
1745
|
"PATH_OUTSIDE_SANDBOX",
|
|
1745
1746
|
`Path "${inputPath}" resolves to "${real}" which is outside sandbox "${normalizedRoot}"`,
|
|
1746
1747
|
{ inputPath, resolvedPath: real, sandboxRoot: normalizedRoot }
|
|
@@ -1755,13 +1756,23 @@ function isWithinRoot(path$1, root) {
|
|
|
1755
1756
|
}
|
|
1756
1757
|
|
|
1757
1758
|
// src/api/runtimeFromConfig.ts
|
|
1758
|
-
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)));
|
|
1759
1760
|
function getProjectRequire() {
|
|
1760
1761
|
const cwd = process.cwd();
|
|
1761
1762
|
if (fs.existsSync(path.join(cwd, "package.json"))) return module$1.createRequire(path.join(cwd, "package.json"));
|
|
1762
1763
|
if (fs.existsSync(path.join(cwd, "tool.yaml"))) return module$1.createRequire(path.join(cwd, "tool.yaml"));
|
|
1763
1764
|
return null;
|
|
1764
1765
|
}
|
|
1766
|
+
function findNearestPackageJson(startDir) {
|
|
1767
|
+
let dir = path.resolve(startDir);
|
|
1768
|
+
while (true) {
|
|
1769
|
+
const pkg = path.join(dir, "package.json");
|
|
1770
|
+
if (fs.existsSync(pkg)) return pkg;
|
|
1771
|
+
const parent = path.dirname(dir);
|
|
1772
|
+
if (parent === dir) return null;
|
|
1773
|
+
dir = parent;
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1765
1776
|
var DEFAULT_EXTENSION_PACKAGES = [];
|
|
1766
1777
|
function getInstalledPackageVersion(packageName) {
|
|
1767
1778
|
const projectRequire = getProjectRequire();
|
|
@@ -1802,7 +1813,7 @@ function loadExtensionFromNodeModules() {
|
|
|
1802
1813
|
function createPrefixingRegistry(registry, prefix) {
|
|
1803
1814
|
return {
|
|
1804
1815
|
register(spec) {
|
|
1805
|
-
registry.register({ ...spec, name: prefix +
|
|
1816
|
+
registry.register({ ...spec, name: prefix + chunkQEJF3KDV_cjs.normalizeToolName(spec.name) });
|
|
1806
1817
|
},
|
|
1807
1818
|
bulkRegister(specs) {
|
|
1808
1819
|
specs.forEach((s) => this.register(s));
|
|
@@ -1870,9 +1881,9 @@ function loadExtensionForDescriptorSync(descriptor, configFilePath, stepLog) {
|
|
|
1870
1881
|
if (!parsed) return null;
|
|
1871
1882
|
const localPath = path.isAbsolute(configFilePath) ? configFilePath : path.resolve(process.cwd(), configFilePath);
|
|
1872
1883
|
const configDir = path.dirname(localPath);
|
|
1873
|
-
const packageJsonPath =
|
|
1874
|
-
const
|
|
1875
|
-
const
|
|
1884
|
+
const packageJsonPath = findNearestPackageJson(configDir);
|
|
1885
|
+
const configRequire = packageJsonPath ? module$1.createRequire(packageJsonPath) : null;
|
|
1886
|
+
const npmCwd = packageJsonPath ? path.dirname(packageJsonPath) : configDir;
|
|
1876
1887
|
if (configRequire) {
|
|
1877
1888
|
try {
|
|
1878
1889
|
const mod = configRequire(parsed.packageName);
|
|
@@ -1880,7 +1891,7 @@ function loadExtensionForDescriptorSync(descriptor, configFilePath, stepLog) {
|
|
|
1880
1891
|
if (typeof fn === "function") {
|
|
1881
1892
|
const installed = getInstalledPackageVersionFromRequire(parsed.packageName, configRequire);
|
|
1882
1893
|
const requested = parsed.version === "latest" || !parsed.version?.trim() ? null : parsed.version;
|
|
1883
|
-
const resolvedVersion = requested === null ? npm.resolveLatestVersionFromRegistry(parsed.packageName) : requested;
|
|
1894
|
+
const resolvedVersion = requested === null ? npm.resolveLatestVersionFromRegistry(parsed.packageName, { cwd: npmCwd }) : requested;
|
|
1884
1895
|
if (installed === resolvedVersion) {
|
|
1885
1896
|
if (stepLog) stepLog(`Loaded ${parsed.packageName}@${resolvedVersion} from node_modules`);
|
|
1886
1897
|
return { register: fn, descriptor: entryStr, resolvedVersion };
|
|
@@ -1890,8 +1901,8 @@ function loadExtensionForDescriptorSync(descriptor, configFilePath, stepLog) {
|
|
|
1890
1901
|
}
|
|
1891
1902
|
}
|
|
1892
1903
|
const cacheBase = getCacheBaseFromToolConfig(localPath);
|
|
1893
|
-
const
|
|
1894
|
-
for (const opts of
|
|
1904
|
+
const cacheOptions = cacheBase ? [{ cacheBase, cwd: npmCwd }, { cwd: npmCwd }] : [{ cwd: npmCwd }];
|
|
1905
|
+
for (const opts of cacheOptions) {
|
|
1895
1906
|
try {
|
|
1896
1907
|
const cacheDir = npm.ensurePackageInCache(parsed.packageName, parsed.version, opts);
|
|
1897
1908
|
if (stepLog) stepLog(`Loaded ${parsed.packageName} from cache: ${cacheDir}`);
|
|
@@ -1905,7 +1916,7 @@ function loadExtensionForDescriptorSync(descriptor, configFilePath, stepLog) {
|
|
|
1905
1916
|
}
|
|
1906
1917
|
break;
|
|
1907
1918
|
} catch {
|
|
1908
|
-
if (
|
|
1919
|
+
if (cacheBase && "cacheBase" in opts) continue;
|
|
1909
1920
|
break;
|
|
1910
1921
|
}
|
|
1911
1922
|
}
|
|
@@ -1948,9 +1959,32 @@ async function loadExtensionForDescriptorAsync(descriptor, configFilePath, stepL
|
|
|
1948
1959
|
const parsed = parseNpmDescriptor(entryStr);
|
|
1949
1960
|
if (!parsed) return null;
|
|
1950
1961
|
const localPath = path.isAbsolute(configFilePath) ? configFilePath : path.resolve(process.cwd(), configFilePath);
|
|
1962
|
+
const configDir = path.dirname(localPath);
|
|
1963
|
+
const packageJsonPath = findNearestPackageJson(configDir);
|
|
1964
|
+
const configRequire = packageJsonPath ? module$1.createRequire(packageJsonPath) : null;
|
|
1965
|
+
const npmCwd = packageJsonPath ? path.dirname(packageJsonPath) : configDir;
|
|
1966
|
+
if (configRequire) {
|
|
1967
|
+
try {
|
|
1968
|
+
const installed = getInstalledPackageVersionFromRequire(parsed.packageName, configRequire);
|
|
1969
|
+
const requested = parsed.version === "latest" || !parsed.version?.trim() ? null : parsed.version;
|
|
1970
|
+
const resolvedVersion = requested === null ? npm.resolveLatestVersionFromRegistry(parsed.packageName, { cwd: npmCwd }) : requested;
|
|
1971
|
+
if (installed === resolvedVersion) {
|
|
1972
|
+
const pkgJsonResolved = configRequire.resolve(`${parsed.packageName}/package.json`);
|
|
1973
|
+
const packageRoot = path.dirname(pkgJsonResolved);
|
|
1974
|
+
const entryPath = npm.getPackageEntryPath(packageRoot);
|
|
1975
|
+
const mod = await import(url.pathToFileURL(entryPath).href);
|
|
1976
|
+
const fn = getRegisterFn(mod);
|
|
1977
|
+
if (typeof fn === "function") {
|
|
1978
|
+
if (stepLog) stepLog(`Loaded ${parsed.packageName}@${resolvedVersion} from node_modules (async import)`);
|
|
1979
|
+
return { register: fn, descriptor: entryStr, resolvedVersion };
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
} catch {
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1951
1985
|
const cacheBase = getCacheBaseFromToolConfig(localPath);
|
|
1952
|
-
const
|
|
1953
|
-
for (const opts of
|
|
1986
|
+
const cacheOptions = cacheBase ? [{ cacheBase, cwd: npmCwd }, { cwd: npmCwd }] : [{ cwd: npmCwd }];
|
|
1987
|
+
for (const opts of cacheOptions) {
|
|
1954
1988
|
try {
|
|
1955
1989
|
const cacheDir = npm.ensurePackageInCache(parsed.packageName, parsed.version, opts);
|
|
1956
1990
|
if (stepLog) stepLog(`Loaded ${parsed.packageName} from cache (async): ${cacheDir}`);
|
|
@@ -1962,7 +1996,7 @@ async function loadExtensionForDescriptorAsync(descriptor, configFilePath, stepL
|
|
|
1962
1996
|
}
|
|
1963
1997
|
break;
|
|
1964
1998
|
} catch {
|
|
1965
|
-
if (
|
|
1999
|
+
if (cacheBase && "cacheBase" in opts) continue;
|
|
1966
2000
|
break;
|
|
1967
2001
|
}
|
|
1968
2002
|
}
|
|
@@ -1989,7 +2023,7 @@ async function loadAllExtensionsFromToolYamlAsync(configFilePath, stepLog) {
|
|
|
1989
2023
|
return loaded;
|
|
1990
2024
|
}
|
|
1991
2025
|
function createRuntimeFromConfigSync(options = {}) {
|
|
1992
|
-
const registry = new
|
|
2026
|
+
const registry = new chunkWQMHMPNC_cjs.ToolRegistry();
|
|
1993
2027
|
const stepLog = options.stepLog;
|
|
1994
2028
|
setSandboxValidationEnabled(options.coreTools?.enableSandboxValidation === true);
|
|
1995
2029
|
if (options.coreTools !== void 0) {
|
|
@@ -2032,7 +2066,7 @@ async function createRuntimeFromConfig(options = {}) {
|
|
|
2032
2066
|
const all = await loadAllExtensionsFromToolYamlAsync(options.configFilePath, options.stepLog);
|
|
2033
2067
|
if (all.length > 0) {
|
|
2034
2068
|
if (options.stepLog) options.stepLog(`Registered ${all.length} extension(s) from tool.yaml`);
|
|
2035
|
-
const registry = new
|
|
2069
|
+
const registry = new chunkWQMHMPNC_cjs.ToolRegistry();
|
|
2036
2070
|
const runtime = new PTCRuntime({ registry });
|
|
2037
2071
|
for (const ext of all) {
|
|
2038
2072
|
const prefix = ext.descriptor.startsWith("file:") ? fileDescriptorToRegistryPrefix(ext.descriptor) : npmDescriptorToRegistryPrefix(ext.descriptor, ext.resolvedVersion);
|
|
@@ -2400,7 +2434,7 @@ var DEFAULT_CTX2 = {
|
|
|
2400
2434
|
]
|
|
2401
2435
|
};
|
|
2402
2436
|
function toMcpToolName(registryName) {
|
|
2403
|
-
return
|
|
2437
|
+
return chunkQEJF3KDV_cjs.normalizeToolName(registryName);
|
|
2404
2438
|
}
|
|
2405
2439
|
async function createMcpServerWithTools(runtime, options) {
|
|
2406
2440
|
const { McpServer } = await import('@modelcontextprotocol/sdk/server/mcp.js');
|
|
@@ -2541,5 +2575,5 @@ exports.resolveSandboxedPath2 = resolveSandboxedPath2;
|
|
|
2541
2575
|
exports.resolveToolDescriptor = resolveToolDescriptor;
|
|
2542
2576
|
exports.runMCPServerOverStdio = runMCPServerOverStdio;
|
|
2543
2577
|
exports.setSandboxValidationEnabled = setSandboxValidationEnabled;
|
|
2544
|
-
//# sourceMappingURL=chunk-
|
|
2545
|
-
//# sourceMappingURL=chunk-
|
|
2578
|
+
//# sourceMappingURL=chunk-3GK6IK3N.cjs.map
|
|
2579
|
+
//# sourceMappingURL=chunk-3GK6IK3N.cjs.map
|