@easynet/agent-tool 1.0.21 → 1.0.22
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/main.cjs +17 -17
- package/dist/api/main.js +6 -6
- package/dist/api/runtimeFromConfig.d.ts.map +1 -1
- package/dist/canonicalCoreSchemas-3BZJH6XD.js +4 -0
- package/dist/{canonicalCoreSchemas-JPTOIQKR.js.map → canonicalCoreSchemas-3BZJH6XD.js.map} +1 -1
- package/dist/canonicalCoreSchemas-P6KUD3WP.cjs +21 -0
- package/dist/{canonicalCoreSchemas-K57HKGZJ.cjs.map → canonicalCoreSchemas-P6KUD3WP.cjs.map} +1 -1
- package/dist/{chunk-P5UPHQ7N.js → chunk-3MUOBLNB.js} +3 -3
- package/dist/{chunk-P5UPHQ7N.js.map → chunk-3MUOBLNB.js.map} +1 -1
- package/dist/{chunk-6JWQVVL2.cjs → chunk-4KTWJQ32.cjs} +4 -4
- package/dist/{chunk-6JWQVVL2.cjs.map → chunk-4KTWJQ32.cjs.map} +1 -1
- package/dist/{chunk-NJNQCEHG.cjs → chunk-AH4NI4GN.cjs} +26 -29
- package/dist/chunk-AH4NI4GN.cjs.map +1 -0
- package/dist/{chunk-XDAMV3HZ.cjs → chunk-AT3N7SQK.cjs} +11 -11
- package/dist/{chunk-XDAMV3HZ.cjs.map → chunk-AT3N7SQK.cjs.map} +1 -1
- package/dist/{chunk-DUWEP2CH.js → chunk-BOMOGAFZ.js} +4 -4
- package/dist/{chunk-DUWEP2CH.js.map → chunk-BOMOGAFZ.js.map} +1 -1
- package/dist/{chunk-XYJRKFWR.js → chunk-BPHY6UVK.js} +7 -10
- package/dist/chunk-BPHY6UVK.js.map +1 -0
- package/dist/{chunk-FGGTT32N.cjs → chunk-DYDNPIV2.cjs} +2 -2
- package/dist/{chunk-FGGTT32N.cjs.map → chunk-DYDNPIV2.cjs.map} +1 -1
- package/dist/{chunk-DF5ETXKZ.cjs → chunk-FWIMPZC2.cjs} +14 -14
- package/dist/{chunk-DF5ETXKZ.cjs.map → chunk-FWIMPZC2.cjs.map} +1 -1
- package/dist/{chunk-GWBJEGS7.js → chunk-KDB3MY2H.js} +2 -2
- package/dist/{chunk-GWBJEGS7.js.map → chunk-KDB3MY2H.js.map} +1 -1
- package/dist/{chunk-DB7WQWTF.cjs → chunk-P2LVZGZ4.cjs} +12 -12
- package/dist/{chunk-DB7WQWTF.cjs.map → chunk-P2LVZGZ4.cjs.map} +1 -1
- package/dist/{chunk-SAYJJNA7.js → chunk-QP5FIRC2.js} +6 -6
- package/dist/{chunk-SAYJJNA7.js.map → chunk-QP5FIRC2.js.map} +1 -1
- package/dist/{chunk-ONIBCU2Y.cjs → chunk-TOSPHMYU.cjs} +7 -7
- package/dist/{chunk-ONIBCU2Y.cjs.map → chunk-TOSPHMYU.cjs.map} +1 -1
- package/dist/{chunk-K6AMVYFV.js → chunk-ZRDI2RKU.js} +3 -3
- package/dist/{chunk-K6AMVYFV.js.map → chunk-ZRDI2RKU.js.map} +1 -1
- package/dist/{chunk-IU35EFPK.js → chunk-ZRHPGW7W.js} +3 -3
- package/dist/{chunk-IU35EFPK.js.map → chunk-ZRHPGW7W.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 +3 -3
- package/dist/core/types/ToolSpec.d.ts.map +1 -1
- package/dist/index.cjs +68 -68
- package/dist/index.js +10 -10
- package/dist/tools/util/index.d.ts +1 -1
- package/dist/tools/util/index.d.ts.map +1 -1
- package/dist/utils/cli/index.cjs +21 -21
- package/dist/utils/cli/index.js +6 -6
- package/package.json +1 -1
- package/dist/canonicalCoreSchemas-JPTOIQKR.js +0 -4
- package/dist/canonicalCoreSchemas-K57HKGZJ.cjs +0 -21
- package/dist/chunk-NJNQCEHG.cjs.map +0 -1
- package/dist/chunk-XYJRKFWR.js.map +0 -1
package/dist/api/main.cjs
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
3
|
+
var chunkFWIMPZC2_cjs = require('../chunk-FWIMPZC2.cjs');
|
|
4
|
+
var chunkP2LVZGZ4_cjs = require('../chunk-P2LVZGZ4.cjs');
|
|
5
|
+
var chunkAH4NI4GN_cjs = require('../chunk-AH4NI4GN.cjs');
|
|
6
|
+
require('../chunk-TOSPHMYU.cjs');
|
|
7
|
+
require('../chunk-4KTWJQ32.cjs');
|
|
8
|
+
require('../chunk-DYDNPIV2.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
Object.defineProperty(exports, "createAgentTools", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkFWIMPZC2_cjs.createAgentTools; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "createLangChainToolsAsync", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkFWIMPZC2_cjs.createLangChainToolsAsync; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "createHttpService", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkP2LVZGZ4_cjs.createHttpService; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "createMCPServer", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkP2LVZGZ4_cjs.createMCPServer; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "createMCPServerStreamableHttp", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkP2LVZGZ4_cjs.createMCPServerStreamableHttp; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "createMCPStreamableHttpHandler", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkP2LVZGZ4_cjs.createMCPStreamableHttpHandler; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "createOpenAPIServer", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkP2LVZGZ4_cjs.createHttpService; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "runMCPServerOverStdio", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkP2LVZGZ4_cjs.runMCPServerOverStdio; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "PTCRuntime", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkAH4NI4GN_cjs.PTCRuntime; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "createRuntimeFromConfig", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkAH4NI4GN_cjs.createRuntimeFromConfig; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "createRuntimeFromConfigSync", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkAH4NI4GN_cjs.createRuntimeFromConfigSync; }
|
|
55
55
|
});
|
|
56
56
|
//# sourceMappingURL=main.cjs.map
|
|
57
57
|
//# sourceMappingURL=main.cjs.map
|
package/dist/api/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { createAgentTools, createLangChainToolsAsync } from '../chunk-
|
|
2
|
-
export { createHttpService, createMCPServer, createMCPServerStreamableHttp, createMCPStreamableHttpHandler, createHttpService as createOpenAPIServer, runMCPServerOverStdio } from '../chunk-
|
|
3
|
-
export { PTCRuntime, createRuntimeFromConfig, createRuntimeFromConfigSync } from '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
1
|
+
export { createAgentTools, createLangChainToolsAsync } from '../chunk-ZRDI2RKU.js';
|
|
2
|
+
export { createHttpService, createMCPServer, createMCPServerStreamableHttp, createMCPStreamableHttpHandler, createHttpService as createOpenAPIServer, runMCPServerOverStdio } from '../chunk-QP5FIRC2.js';
|
|
3
|
+
export { PTCRuntime, createRuntimeFromConfig, createRuntimeFromConfigSync } from '../chunk-BPHY6UVK.js';
|
|
4
|
+
import '../chunk-ZRHPGW7W.js';
|
|
5
|
+
import '../chunk-3MUOBLNB.js';
|
|
6
|
+
import '../chunk-KDB3MY2H.js';
|
|
7
7
|
//# sourceMappingURL=main.js.map
|
|
8
8
|
//# sourceMappingURL=main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeFromConfig.d.ts","sourceRoot":"","sources":["../../src/api/runtimeFromConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAgB3D;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,UAItC,CAAC;AAEF,4FAA4F;AAC5F,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+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;CACzB;AAED,uDAAuD;AACvD,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,iFA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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;AA6ED,qKAAqK;AACrK,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQjG;AAsFD;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,oBAAyB,GAAG,mBAAmB,CA6DnG;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAiB9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"canonicalCoreSchemas-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"canonicalCoreSchemas-3BZJH6XD.js"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk4KTWJQ32_cjs = require('./chunk-4KTWJQ32.cjs');
|
|
4
|
+
require('./chunk-DYDNPIV2.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "CORE_TOOL_SCHEMAS", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunk4KTWJQ32_cjs.CORE_TOOL_SCHEMAS; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "enrichSpecWithCanonicalSchema", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunk4KTWJQ32_cjs.enrichSpecWithCanonicalSchema; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "isGenericSchema", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunk4KTWJQ32_cjs.isGenericSchema; }
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=canonicalCoreSchemas-P6KUD3WP.cjs.map
|
|
21
|
+
//# sourceMappingURL=canonicalCoreSchemas-P6KUD3WP.cjs.map
|
package/dist/{canonicalCoreSchemas-K57HKGZJ.cjs.map → canonicalCoreSchemas-P6KUD3WP.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"canonicalCoreSchemas-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"canonicalCoreSchemas-P6KUD3WP.cjs"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeToolName } from './chunk-
|
|
1
|
+
import { normalizeToolName } from './chunk-KDB3MY2H.js';
|
|
2
2
|
|
|
3
3
|
// src/tools/util/canonicalCoreSchemas.ts
|
|
4
4
|
var S = (o) => o;
|
|
@@ -239,5 +239,5 @@ function enrichSpecWithCanonicalSchema(spec) {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
export { CORE_TOOL_SCHEMAS, enrichSpecWithCanonicalSchema, isGenericSchema };
|
|
242
|
-
//# sourceMappingURL=chunk-
|
|
243
|
-
//# sourceMappingURL=chunk-
|
|
242
|
+
//# sourceMappingURL=chunk-3MUOBLNB.js.map
|
|
243
|
+
//# sourceMappingURL=chunk-3MUOBLNB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tools/util/canonicalCoreSchemas.ts"],"names":[],"mappings":";;;AASA,IAAM,CAAA,GAAI,CAAC,CAAA,KAAc,CAAA;AAGlB,IAAM,iBAAA,GAGT;AAAA,EACF,kBAAA,EAAoB;AAAA,IAClB,aAAa,CAAA,CAAE;AAAA,MACb,IAAA,EAAM,QAAA;AAAA,MACN,UAAA,EAAY;AAAA,QACV,IAAA,EAAM,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,mCAAA,E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AA,MAAM,GAAA,GAAM,kBAAkB,UAAU,CAAA;AACxC,EAAA,MAAM,SAAA,GAAY,kBAAkB,GAAG,CAAA;AACvC,EAAA,IAAI,CAAC,WAAW,OAAO,IAAA;AACvB,EAAA,MAAM,WAAW,eAAA,CAAgB,IAAA,CAAK,WAAW,CAAA,GAAI,SAAA,CAAU,cAAc,IAAA,CAAK,WAAA;AAClF,EAAA,MAAM,SAAA,GACJ,UAAU,YAAA,IAAgB,eAAA,CAAgB,KAAK,YAAY,CAAA,GACvD,SAAA,CAAU,YAAA,GACV,IAAA,CAAK,YAAA;AACX,EAAA,IAAI,aAAa,IAAA,CAAK,WAAA,IAAe,SAAA,KAAc,IAAA,CAAK,cAAc,OAAO,IAAA;AAC7E,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,WAAA,EAAa,QAAA;AAAA,IACb,YAAA,EAAc;AAAA,GAChB;AACF","file":"chunk-P5UPHQ7N.js","sourcesContent":["/**\n * Canonical input/output schemas for core (builtin) tools.\n * Used when the builtin package registers specs with generic schema\n * (type: object, additionalProperties: true) so CLI describe and OpenAPI show real schemas.\n */\n\nimport type { ToolSpec } from \"../../core/types/ToolSpec.js\";\nimport { normalizeToolName } from \"../../core/types/ToolSpec.js\";\n\nconst S = (o: object) => o as Record<string, unknown>;\n\n/** Canonical inputSchema (and optional outputSchema) by tool name (e.g. core/fs.readText). */\nexport const CORE_TOOL_SCHEMAS: Record<\n string,\n { inputSchema: object; outputSchema?: object }\n> = {\n \"core/fs.readText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to the file (within sandbox)\" },\n maxBytes: { type: \"number\", description: \"Max bytes to read (optional)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n outputSchema: S({\n type: \"object\",\n properties: {\n result: {\n type: \"object\",\n properties: {\n path: { type: \"string\" },\n text: { type: \"string\" },\n bytes: { type: \"number\" },\n },\n },\n },\n }),\n },\n \"core.fs.writeText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to write (within sandbox)\" },\n content: { type: \"string\", description: \"UTF-8 content to write\" },\n },\n required: [\"path\", \"content\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.listDir\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Directory path (within sandbox)\" },\n maxEntries: { type: \"number\", description: \"Max entries to return (optional)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.searchText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to file or directory\" },\n pattern: { type: \"string\", description: \"Search pattern (regex or literal)\" },\n maxMatches: { type: \"number\", description: \"Max matches (optional)\" },\n },\n required: [\"path\", \"pattern\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.sha256\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to file (within sandbox)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.deletePath\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to delete (within sandbox)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to fetch\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" }, description: \"Optional request headers\" },\n timeoutMs: { type: \"number\", description: \"Request timeout in ms (optional)\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchJson\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to fetch\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" } },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.downloadFile\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to download\" },\n destPath: { type: \"string\", description: \"Destination path (within sandbox)\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" } },\n },\n required: [\"url\", \"destPath\"],\n additionalProperties: false,\n }),\n },\n \"core.http.head\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL for HEAD request\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.duckduckgoSearch\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n query: { type: \"string\", description: \"Search query\" },\n maxResults: { type: \"number\", description: \"Max results (optional)\" },\n },\n required: [\"query\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchPageMainContent\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"Page URL\" },\n maxLength: { type: \"number\", description: \"Max content length (optional)\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.util.json.select\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n json: { description: \"JSON value (object or string)\" },\n selector: { type: \"string\", description: \"JSONPath or selector\" },\n },\n required: [\"json\", \"selector\"],\n additionalProperties: false,\n }),\n },\n \"core.util.text.truncate\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n text: { type: \"string\", description: \"Text to truncate\" },\n maxLength: { type: \"number\", description: \"Max length\" },\n },\n required: [\"text\", \"maxLength\"],\n additionalProperties: false,\n }),\n },\n \"core.util.hash.sha256Text\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n text: { type: \"string\", description: \"Text to hash\" },\n },\n required: [\"text\"],\n additionalProperties: false,\n }),\n },\n \"core.util.time.now\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n timezone: { type: \"string\", description: \"IANA timezone (optional)\" },\n },\n additionalProperties: false,\n }),\n },\n \"core.util.template.render\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n template: { type: \"string\", description: \"Template string (e.g. Mustache)\" },\n data: { type: \"object\", description: \"Data object for template\" },\n },\n required: [\"template\", \"data\"],\n additionalProperties: false,\n }),\n },\n \"core.exec.runCommand\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n command: { type: \"string\", description: \"Command to run\" },\n args: { type: \"array\", items: { type: \"string\" }, description: \"Arguments (optional)\" },\n cwd: { type: \"string\", description: \"Working directory (optional)\" },\n timeoutMs: { type: \"number\", description: \"Timeout in ms (optional)\" },\n },\n required: [\"command\"],\n additionalProperties: false,\n }),\n },\n};\n\n/** True if schema looks like the generic permissive one. */\nexport function isGenericSchema(schema: unknown): boolean {\n if (schema === null || typeof schema !== \"object\") return false;\n const s = schema as Record<string, unknown>;\n if (s.type !== \"object\") return false;\n if (s.additionalProperties === true && !s.properties) return true;\n if (s.properties === undefined && s.required === undefined) return true;\n return false;\n}\n\n/**\n * If spec is a core tool with generic input/output schema, return spec with canonical schema.\n * Otherwise return spec unchanged.\n */\nexport function enrichSpecWithCanonicalSchema(spec: ToolSpec): ToolSpec {\n if (spec.kind !== \"core\") return spec;\n // Support prefixed names (e.g. npm.easynet.agent.tool.buildin.latest.core.fs.readText) by matching core.* suffix\n const coreSuffix = spec.name.includes(\".core.\") ? spec.name.slice(spec.name.indexOf(\".core.\") + 1) : spec.name;\n const key = normalizeToolName(coreSuffix);\n const canonical = CORE_TOOL_SCHEMAS[key];\n if (!canonical) return spec;\n const useInput = isGenericSchema(spec.inputSchema) ? canonical.inputSchema : spec.inputSchema;\n const useOutput =\n canonical.outputSchema && isGenericSchema(spec.outputSchema)\n ? canonical.outputSchema\n : spec.outputSchema;\n if (useInput === spec.inputSchema && useOutput === spec.outputSchema) return spec;\n return {\n ...spec,\n inputSchema: useInput,\n outputSchema: useOutput,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/tools/util/canonicalCoreSchemas.ts"],"names":[],"mappings":";;;AASA,IAAM,CAAA,GAAI,CAAC,CAAA,KAAc,CAAA;AAGlB,IAAM,iBAAA,GAGT;AAAA,EACF,kBAAA,EAAoB;AAAA,IAClB,aAAa,CAAA,CAAE;AAAA,MACb,IAAA,EAAM,QAAA;AAAA,MACN,UAAA,EA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AAA,CAAQ,QAAQ,CAAA,GAAI,CAAC,IAAI,IAAA,CAAK,IAAA;AAC1G,EAAA,MAAM,GAAA,GAAM,kBAAkB,UAAU,CAAA;AACxC,EAAA,MAAM,SAAA,GAAY,kBAAkB,GAAG,CAAA;AACvC,EAAA,IAAI,CAAC,WAAW,OAAO,IAAA;AACvB,EAAA,MAAM,WAAW,eAAA,CAAgB,IAAA,CAAK,WAAW,CAAA,GAAI,SAAA,CAAU,cAAc,IAAA,CAAK,WAAA;AAClF,EAAA,MAAM,SAAA,GACJ,UAAU,YAAA,IAAgB,eAAA,CAAgB,KAAK,YAAY,CAAA,GACvD,SAAA,CAAU,YAAA,GACV,IAAA,CAAK,YAAA;AACX,EAAA,IAAI,aAAa,IAAA,CAAK,WAAA,IAAe,SAAA,KAAc,IAAA,CAAK,cAAc,OAAO,IAAA;AAC7E,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,WAAA,EAAa,QAAA;AAAA,IACb,YAAA,EAAc;AAAA,GAChB;AACF","file":"chunk-3MUOBLNB.js","sourcesContent":["/**\n * Canonical input/output schemas for core (builtin) tools.\n * Used when the builtin package registers specs with generic schema\n * (type: object, additionalProperties: true) so CLI describe and OpenAPI show real schemas.\n */\n\nimport type { ToolSpec } from \"../../core/types/ToolSpec.js\";\nimport { normalizeToolName } from \"../../core/types/ToolSpec.js\";\n\nconst S = (o: object) => o as Record<string, unknown>;\n\n/** Canonical inputSchema (and optional outputSchema) by tool name (e.g. core/fs.readText). */\nexport const CORE_TOOL_SCHEMAS: Record<\n string,\n { inputSchema: object; outputSchema?: object }\n> = {\n \"core/fs.readText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to the file (within sandbox)\" },\n maxBytes: { type: \"number\", description: \"Max bytes to read (optional)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n outputSchema: S({\n type: \"object\",\n properties: {\n result: {\n type: \"object\",\n properties: {\n path: { type: \"string\" },\n text: { type: \"string\" },\n bytes: { type: \"number\" },\n },\n },\n },\n }),\n },\n \"core.fs.writeText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to write (within sandbox)\" },\n content: { type: \"string\", description: \"UTF-8 content to write\" },\n },\n required: [\"path\", \"content\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.listDir\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Directory path (within sandbox)\" },\n maxEntries: { type: \"number\", description: \"Max entries to return (optional)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.searchText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to file or directory\" },\n pattern: { type: \"string\", description: \"Search pattern (regex or literal)\" },\n maxMatches: { type: \"number\", description: \"Max matches (optional)\" },\n },\n required: [\"path\", \"pattern\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.sha256\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to file (within sandbox)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.deletePath\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to delete (within sandbox)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to fetch\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" }, description: \"Optional request headers\" },\n timeoutMs: { type: \"number\", description: \"Request timeout in ms (optional)\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchJson\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to fetch\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" } },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.downloadFile\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to download\" },\n destPath: { type: \"string\", description: \"Destination path (within sandbox)\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" } },\n },\n required: [\"url\", \"destPath\"],\n additionalProperties: false,\n }),\n },\n \"core.http.head\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL for HEAD request\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.duckduckgoSearch\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n query: { type: \"string\", description: \"Search query\" },\n maxResults: { type: \"number\", description: \"Max results (optional)\" },\n },\n required: [\"query\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchPageMainContent\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"Page URL\" },\n maxLength: { type: \"number\", description: \"Max content length (optional)\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.util.json.select\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n json: { description: \"JSON value (object or string)\" },\n selector: { type: \"string\", description: \"JSONPath or selector\" },\n },\n required: [\"json\", \"selector\"],\n additionalProperties: false,\n }),\n },\n \"core.util.text.truncate\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n text: { type: \"string\", description: \"Text to truncate\" },\n maxLength: { type: \"number\", description: \"Max length\" },\n },\n required: [\"text\", \"maxLength\"],\n additionalProperties: false,\n }),\n },\n \"core.util.hash.sha256Text\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n text: { type: \"string\", description: \"Text to hash\" },\n },\n required: [\"text\"],\n additionalProperties: false,\n }),\n },\n \"core.util.time.now\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n timezone: { type: \"string\", description: \"IANA timezone (optional)\" },\n },\n additionalProperties: false,\n }),\n },\n \"core.util.template.render\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n template: { type: \"string\", description: \"Template string (e.g. Mustache)\" },\n data: { type: \"object\", description: \"Data object for template\" },\n },\n required: [\"template\", \"data\"],\n additionalProperties: false,\n }),\n },\n \"core.exec.runCommand\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n command: { type: \"string\", description: \"Command to run\" },\n args: { type: \"array\", items: { type: \"string\" }, description: \"Arguments (optional)\" },\n cwd: { type: \"string\", description: \"Working directory (optional)\" },\n timeoutMs: { type: \"number\", description: \"Timeout in ms (optional)\" },\n },\n required: [\"command\"],\n additionalProperties: false,\n }),\n },\n};\n\n/** True if schema looks like the generic permissive one. */\nexport function isGenericSchema(schema: unknown): boolean {\n if (schema === null || typeof schema !== \"object\") return false;\n const s = schema as Record<string, unknown>;\n if (s.type !== \"object\") return false;\n if (s.additionalProperties === true && !s.properties) return true;\n if (s.properties === undefined && s.required === undefined) return true;\n return false;\n}\n\n/**\n * If spec is a core tool with generic input/output schema, return spec with canonical schema.\n * Otherwise return spec unchanged.\n */\nexport function enrichSpecWithCanonicalSchema(spec: ToolSpec): ToolSpec {\n if (spec.kind !== \"core\") return spec;\n // Support prefixed names (e.g. npm.easynet.agent.tool.buildin.latest.core.fs.readText) by matching core.* suffix\n const coreSuffix = spec.name.includes(\".core.\") ? spec.name.slice(spec.name.indexOf(\".core.\") + 1) : spec.name;\n const key = normalizeToolName(coreSuffix);\n const canonical = CORE_TOOL_SCHEMAS[key];\n if (!canonical) return spec;\n const useInput = isGenericSchema(spec.inputSchema) ? canonical.inputSchema : spec.inputSchema;\n const useOutput =\n canonical.outputSchema && isGenericSchema(spec.outputSchema)\n ? canonical.outputSchema\n : spec.outputSchema;\n if (useInput === spec.inputSchema && useOutput === spec.outputSchema) return spec;\n return {\n ...spec,\n inputSchema: useInput,\n outputSchema: useOutput,\n };\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDYDNPIV2_cjs = require('./chunk-DYDNPIV2.cjs');
|
|
4
4
|
|
|
5
5
|
// src/tools/util/canonicalCoreSchemas.ts
|
|
6
6
|
var S = (o) => o;
|
|
@@ -227,7 +227,7 @@ function isGenericSchema(schema) {
|
|
|
227
227
|
function enrichSpecWithCanonicalSchema(spec) {
|
|
228
228
|
if (spec.kind !== "core") return spec;
|
|
229
229
|
const coreSuffix = spec.name.includes(".core.") ? spec.name.slice(spec.name.indexOf(".core.") + 1) : spec.name;
|
|
230
|
-
const key =
|
|
230
|
+
const key = chunkDYDNPIV2_cjs.normalizeToolName(coreSuffix);
|
|
231
231
|
const canonical = CORE_TOOL_SCHEMAS[key];
|
|
232
232
|
if (!canonical) return spec;
|
|
233
233
|
const useInput = isGenericSchema(spec.inputSchema) ? canonical.inputSchema : spec.inputSchema;
|
|
@@ -243,5 +243,5 @@ function enrichSpecWithCanonicalSchema(spec) {
|
|
|
243
243
|
exports.CORE_TOOL_SCHEMAS = CORE_TOOL_SCHEMAS;
|
|
244
244
|
exports.enrichSpecWithCanonicalSchema = enrichSpecWithCanonicalSchema;
|
|
245
245
|
exports.isGenericSchema = isGenericSchema;
|
|
246
|
-
//# sourceMappingURL=chunk-
|
|
247
|
-
//# sourceMappingURL=chunk-
|
|
246
|
+
//# sourceMappingURL=chunk-4KTWJQ32.cjs.map
|
|
247
|
+
//# sourceMappingURL=chunk-4KTWJQ32.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tools/util/canonicalCoreSchemas.ts"],"names":["normalizeToolName"],"mappings":";;;;;AASA,IAAM,CAAA,GAAI,CAAC,CAAA,KAAc,CAAA;AAGlB,IAAM,iBAAA,GAGT;AAAA,EACF,kBAAA,EAAoB;AAAA,IAClB,aAAa,CAAA,CAAE;AAAA,MACb,IAAA,EAAM,QAAA;AAAA,MACN,UAAA,EAAY;AAAA,QACV,IAAA,EAAM,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,mCAAA,EAAoC;AAAA,QACzE,QAAA,EAAU,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,8BAAA;AAA+B,OAC1E;A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AAA;AACvC,EAAA,IAAI,CAAC,WAAW,OAAO,IAAA;AACvB,EAAA,MAAM,WAAW,eAAA,CAAgB,IAAA,CAAK,WAAW,CAAA,GAAI,SAAA,CAAU,cAAc,IAAA,CAAK,WAAA;AAClF,EAAA,MAAM,SAAA,GACJ,UAAU,YAAA,IAAgB,eAAA,CAAgB,KAAK,YAAY,CAAA,GACvD,SAAA,CAAU,YAAA,GACV,IAAA,CAAK,YAAA;AACX,EAAA,IAAI,aAAa,IAAA,CAAK,WAAA,IAAe,SAAA,KAAc,IAAA,CAAK,cAAc,OAAO,IAAA;AAC7E,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,WAAA,EAAa,QAAA;AAAA,IACb,YAAA,EAAc;AAAA,GAChB;AACF","file":"chunk-6JWQVVL2.cjs","sourcesContent":["/**\n * Canonical input/output schemas for core (builtin) tools.\n * Used when the builtin package registers specs with generic schema\n * (type: object, additionalProperties: true) so CLI describe and OpenAPI show real schemas.\n */\n\nimport type { ToolSpec } from \"../../core/types/ToolSpec.js\";\nimport { normalizeToolName } from \"../../core/types/ToolSpec.js\";\n\nconst S = (o: object) => o as Record<string, unknown>;\n\n/** Canonical inputSchema (and optional outputSchema) by tool name (e.g. core/fs.readText). */\nexport const CORE_TOOL_SCHEMAS: Record<\n string,\n { inputSchema: object; outputSchema?: object }\n> = {\n \"core/fs.readText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to the file (within sandbox)\" },\n maxBytes: { type: \"number\", description: \"Max bytes to read (optional)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n outputSchema: S({\n type: \"object\",\n properties: {\n result: {\n type: \"object\",\n properties: {\n path: { type: \"string\" },\n text: { type: \"string\" },\n bytes: { type: \"number\" },\n },\n },\n },\n }),\n },\n \"core.fs.writeText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to write (within sandbox)\" },\n content: { type: \"string\", description: \"UTF-8 content to write\" },\n },\n required: [\"path\", \"content\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.listDir\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Directory path (within sandbox)\" },\n maxEntries: { type: \"number\", description: \"Max entries to return (optional)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.searchText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to file or directory\" },\n pattern: { type: \"string\", description: \"Search pattern (regex or literal)\" },\n maxMatches: { type: \"number\", description: \"Max matches (optional)\" },\n },\n required: [\"path\", \"pattern\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.sha256\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to file (within sandbox)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.deletePath\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to delete (within sandbox)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to fetch\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" }, description: \"Optional request headers\" },\n timeoutMs: { type: \"number\", description: \"Request timeout in ms (optional)\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchJson\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to fetch\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" } },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.downloadFile\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to download\" },\n destPath: { type: \"string\", description: \"Destination path (within sandbox)\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" } },\n },\n required: [\"url\", \"destPath\"],\n additionalProperties: false,\n }),\n },\n \"core.http.head\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL for HEAD request\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.duckduckgoSearch\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n query: { type: \"string\", description: \"Search query\" },\n maxResults: { type: \"number\", description: \"Max results (optional)\" },\n },\n required: [\"query\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchPageMainContent\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"Page URL\" },\n maxLength: { type: \"number\", description: \"Max content length (optional)\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.util.json.select\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n json: { description: \"JSON value (object or string)\" },\n selector: { type: \"string\", description: \"JSONPath or selector\" },\n },\n required: [\"json\", \"selector\"],\n additionalProperties: false,\n }),\n },\n \"core.util.text.truncate\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n text: { type: \"string\", description: \"Text to truncate\" },\n maxLength: { type: \"number\", description: \"Max length\" },\n },\n required: [\"text\", \"maxLength\"],\n additionalProperties: false,\n }),\n },\n \"core.util.hash.sha256Text\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n text: { type: \"string\", description: \"Text to hash\" },\n },\n required: [\"text\"],\n additionalProperties: false,\n }),\n },\n \"core.util.time.now\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n timezone: { type: \"string\", description: \"IANA timezone (optional)\" },\n },\n additionalProperties: false,\n }),\n },\n \"core.util.template.render\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n template: { type: \"string\", description: \"Template string (e.g. Mustache)\" },\n data: { type: \"object\", description: \"Data object for template\" },\n },\n required: [\"template\", \"data\"],\n additionalProperties: false,\n }),\n },\n \"core.exec.runCommand\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n command: { type: \"string\", description: \"Command to run\" },\n args: { type: \"array\", items: { type: \"string\" }, description: \"Arguments (optional)\" },\n cwd: { type: \"string\", description: \"Working directory (optional)\" },\n timeoutMs: { type: \"number\", description: \"Timeout in ms (optional)\" },\n },\n required: [\"command\"],\n additionalProperties: false,\n }),\n },\n};\n\n/** True if schema looks like the generic permissive one. */\nexport function isGenericSchema(schema: unknown): boolean {\n if (schema === null || typeof schema !== \"object\") return false;\n const s = schema as Record<string, unknown>;\n if (s.type !== \"object\") return false;\n if (s.additionalProperties === true && !s.properties) return true;\n if (s.properties === undefined && s.required === undefined) return true;\n return false;\n}\n\n/**\n * If spec is a core tool with generic input/output schema, return spec with canonical schema.\n * Otherwise return spec unchanged.\n */\nexport function enrichSpecWithCanonicalSchema(spec: ToolSpec): ToolSpec {\n if (spec.kind !== \"core\") return spec;\n // Support prefixed names (e.g. npm.easynet.agent.tool.buildin.latest.core.fs.readText) by matching core.* suffix\n const coreSuffix = spec.name.includes(\".core.\") ? spec.name.slice(spec.name.indexOf(\".core.\") + 1) : spec.name;\n const key = normalizeToolName(coreSuffix);\n const canonical = CORE_TOOL_SCHEMAS[key];\n if (!canonical) return spec;\n const useInput = isGenericSchema(spec.inputSchema) ? canonical.inputSchema : spec.inputSchema;\n const useOutput =\n canonical.outputSchema && isGenericSchema(spec.outputSchema)\n ? canonical.outputSchema\n : spec.outputSchema;\n if (useInput === spec.inputSchema && useOutput === spec.outputSchema) return spec;\n return {\n ...spec,\n inputSchema: useInput,\n outputSchema: useOutput,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/tools/util/canonicalCoreSchemas.ts"],"names":["normalizeToolName"],"mappings":";;;;;AASA,IAAM,CAAA,GAAI,CAAC,CAAA,KAAc,CAAA;AAGlB,IAAM,iBAAA,GAGT;AAAA,EACF,kBAAA,EAAoB;AAAA,IAClB,aAAa,CAAA,CAAE;AAAA,MACb,IAAA,EAAM,QAAA;AAAA,MACN,UAAA,EAAY;AAAA,QACV,IAAA,EAAM,EAAE,IAAA,EAAM,QAAA,EAAU,aAAa,mCAAA,EAAo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MAAM,GAAA,GAAMA,oCAAkB,UAAU,CAAA;AACxC,EAAA,MAAM,SAAA,GAAY,kBAAkB,GAAG,CAAA;AACvC,EAAA,IAAI,CAAC,WAAW,OAAO,IAAA;AACvB,EAAA,MAAM,WAAW,eAAA,CAAgB,IAAA,CAAK,WAAW,CAAA,GAAI,SAAA,CAAU,cAAc,IAAA,CAAK,WAAA;AAClF,EAAA,MAAM,SAAA,GACJ,UAAU,YAAA,IAAgB,eAAA,CAAgB,KAAK,YAAY,CAAA,GACvD,SAAA,CAAU,YAAA,GACV,IAAA,CAAK,YAAA;AACX,EAAA,IAAI,aAAa,IAAA,CAAK,WAAA,IAAe,SAAA,KAAc,IAAA,CAAK,cAAc,OAAO,IAAA;AAC7E,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,WAAA,EAAa,QAAA;AAAA,IACb,YAAA,EAAc;AAAA,GAChB;AACF","file":"chunk-4KTWJQ32.cjs","sourcesContent":["/**\n * Canonical input/output schemas for core (builtin) tools.\n * Used when the builtin package registers specs with generic schema\n * (type: object, additionalProperties: true) so CLI describe and OpenAPI show real schemas.\n */\n\nimport type { ToolSpec } from \"../../core/types/ToolSpec.js\";\nimport { normalizeToolName } from \"../../core/types/ToolSpec.js\";\n\nconst S = (o: object) => o as Record<string, unknown>;\n\n/** Canonical inputSchema (and optional outputSchema) by tool name (e.g. core/fs.readText). */\nexport const CORE_TOOL_SCHEMAS: Record<\n string,\n { inputSchema: object; outputSchema?: object }\n> = {\n \"core/fs.readText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to the file (within sandbox)\" },\n maxBytes: { type: \"number\", description: \"Max bytes to read (optional)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n outputSchema: S({\n type: \"object\",\n properties: {\n result: {\n type: \"object\",\n properties: {\n path: { type: \"string\" },\n text: { type: \"string\" },\n bytes: { type: \"number\" },\n },\n },\n },\n }),\n },\n \"core.fs.writeText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to write (within sandbox)\" },\n content: { type: \"string\", description: \"UTF-8 content to write\" },\n },\n required: [\"path\", \"content\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.listDir\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Directory path (within sandbox)\" },\n maxEntries: { type: \"number\", description: \"Max entries to return (optional)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.searchText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to file or directory\" },\n pattern: { type: \"string\", description: \"Search pattern (regex or literal)\" },\n maxMatches: { type: \"number\", description: \"Max matches (optional)\" },\n },\n required: [\"path\", \"pattern\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.sha256\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to file (within sandbox)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.fs.deletePath\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Path to delete (within sandbox)\" },\n },\n required: [\"path\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchText\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to fetch\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" }, description: \"Optional request headers\" },\n timeoutMs: { type: \"number\", description: \"Request timeout in ms (optional)\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchJson\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to fetch\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" } },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.downloadFile\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL to download\" },\n destPath: { type: \"string\", description: \"Destination path (within sandbox)\" },\n headers: { type: \"object\", additionalProperties: { type: \"string\" } },\n },\n required: [\"url\", \"destPath\"],\n additionalProperties: false,\n }),\n },\n \"core.http.head\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"URL for HEAD request\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.http.duckduckgoSearch\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n query: { type: \"string\", description: \"Search query\" },\n maxResults: { type: \"number\", description: \"Max results (optional)\" },\n },\n required: [\"query\"],\n additionalProperties: false,\n }),\n },\n \"core.http.fetchPageMainContent\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"Page URL\" },\n maxLength: { type: \"number\", description: \"Max content length (optional)\" },\n },\n required: [\"url\"],\n additionalProperties: false,\n }),\n },\n \"core.util.json.select\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n json: { description: \"JSON value (object or string)\" },\n selector: { type: \"string\", description: \"JSONPath or selector\" },\n },\n required: [\"json\", \"selector\"],\n additionalProperties: false,\n }),\n },\n \"core.util.text.truncate\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n text: { type: \"string\", description: \"Text to truncate\" },\n maxLength: { type: \"number\", description: \"Max length\" },\n },\n required: [\"text\", \"maxLength\"],\n additionalProperties: false,\n }),\n },\n \"core.util.hash.sha256Text\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n text: { type: \"string\", description: \"Text to hash\" },\n },\n required: [\"text\"],\n additionalProperties: false,\n }),\n },\n \"core.util.time.now\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n timezone: { type: \"string\", description: \"IANA timezone (optional)\" },\n },\n additionalProperties: false,\n }),\n },\n \"core.util.template.render\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n template: { type: \"string\", description: \"Template string (e.g. Mustache)\" },\n data: { type: \"object\", description: \"Data object for template\" },\n },\n required: [\"template\", \"data\"],\n additionalProperties: false,\n }),\n },\n \"core.exec.runCommand\": {\n inputSchema: S({\n type: \"object\",\n properties: {\n command: { type: \"string\", description: \"Command to run\" },\n args: { type: \"array\", items: { type: \"string\" }, description: \"Arguments (optional)\" },\n cwd: { type: \"string\", description: \"Working directory (optional)\" },\n timeoutMs: { type: \"number\", description: \"Timeout in ms (optional)\" },\n },\n required: [\"command\"],\n additionalProperties: false,\n }),\n },\n};\n\n/** True if schema looks like the generic permissive one. */\nexport function isGenericSchema(schema: unknown): boolean {\n if (schema === null || typeof schema !== \"object\") return false;\n const s = schema as Record<string, unknown>;\n if (s.type !== \"object\") return false;\n if (s.additionalProperties === true && !s.properties) return true;\n if (s.properties === undefined && s.required === undefined) return true;\n return false;\n}\n\n/**\n * If spec is a core tool with generic input/output schema, return spec with canonical schema.\n * Otherwise return spec unchanged.\n */\nexport function enrichSpecWithCanonicalSchema(spec: ToolSpec): ToolSpec {\n if (spec.kind !== \"core\") return spec;\n // Support prefixed names (e.g. npm.easynet.agent.tool.buildin.latest.core.fs.readText) by matching core.* suffix\n const coreSuffix = spec.name.includes(\".core.\") ? spec.name.slice(spec.name.indexOf(\".core.\") + 1) : spec.name;\n const key = normalizeToolName(coreSuffix);\n const canonical = CORE_TOOL_SCHEMAS[key];\n if (!canonical) return spec;\n const useInput = isGenericSchema(spec.inputSchema) ? canonical.inputSchema : spec.inputSchema;\n const useOutput =\n canonical.outputSchema && isGenericSchema(spec.outputSchema)\n ? canonical.outputSchema\n : spec.outputSchema;\n if (useInput === spec.inputSchema && useOutput === spec.outputSchema) return spec;\n return {\n ...spec,\n inputSchema: useInput,\n outputSchema: useOutput,\n };\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkTOSPHMYU_cjs = require('./chunk-TOSPHMYU.cjs');
|
|
4
|
+
var chunkDYDNPIV2_cjs = require('./chunk-DYDNPIV2.cjs');
|
|
5
5
|
var Ajv = require('ajv');
|
|
6
6
|
var addFormats = require('ajv-formats');
|
|
7
7
|
var cockatiel = require('cockatiel');
|
|
@@ -940,10 +940,10 @@ var Tracing = class {
|
|
|
940
940
|
}
|
|
941
941
|
};
|
|
942
942
|
function resolveTool(toolName, registry) {
|
|
943
|
-
const key =
|
|
943
|
+
const key = chunkDYDNPIV2_cjs.normalizeToolName(toolName);
|
|
944
944
|
const spec = registry.get(key);
|
|
945
945
|
if (!spec) {
|
|
946
|
-
throw
|
|
946
|
+
throw chunkTOSPHMYU_cjs.createTaggedError(
|
|
947
947
|
"TOOL_NOT_FOUND",
|
|
948
948
|
`Tool not found: ${toolName}`,
|
|
949
949
|
{ availableTools: registry.snapshot().slice(0, 20).map((s) => s.name) }
|
|
@@ -982,7 +982,7 @@ function validateInput(spec, args, validator) {
|
|
|
982
982
|
if (error instanceof SchemaValidationError) {
|
|
983
983
|
const requiredKeys = getRequiredKeys(spec.inputSchema);
|
|
984
984
|
const passedKeys = args != null && typeof args === "object" && !Array.isArray(args) ? Object.keys(args) : [];
|
|
985
|
-
throw
|
|
985
|
+
throw chunkTOSPHMYU_cjs.createTaggedError("INPUT_SCHEMA_INVALID", error.message, {
|
|
986
986
|
errors: error.errors,
|
|
987
987
|
schema: spec.inputSchema,
|
|
988
988
|
requiredKeys: requiredKeys.length ? requiredKeys : void 0,
|
|
@@ -1055,7 +1055,7 @@ async function requireHumanApproval(spec, args, ctx, deps) {
|
|
|
1055
1055
|
sideEffect,
|
|
1056
1056
|
reason: err instanceof Error ? err.message : String(err)
|
|
1057
1057
|
});
|
|
1058
|
-
throw
|
|
1058
|
+
throw chunkTOSPHMYU_cjs.createTaggedError(
|
|
1059
1059
|
"HITL_DENIED",
|
|
1060
1060
|
`Human denied approval for ${spec.name} (${sideEffect})`,
|
|
1061
1061
|
{ reason: err instanceof Error ? err.message : String(err) }
|
|
@@ -1068,7 +1068,7 @@ async function requireHumanApproval(spec, args, ctx, deps) {
|
|
|
1068
1068
|
sideEffect,
|
|
1069
1069
|
reason: "User rejected"
|
|
1070
1070
|
});
|
|
1071
|
-
throw
|
|
1071
|
+
throw chunkTOSPHMYU_cjs.createTaggedError("HITL_DENIED", `Human denied approval for ${spec.name} (${sideEffect})`);
|
|
1072
1072
|
}
|
|
1073
1073
|
deps.eventLog.append({
|
|
1074
1074
|
...baseEvent,
|
|
@@ -1080,7 +1080,7 @@ async function requireHumanApproval(spec, args, ctx, deps) {
|
|
|
1080
1080
|
async function executeWithBudget(spec, args, ctx, spanId, deps) {
|
|
1081
1081
|
const adapter = deps.adapters.get(spec.kind);
|
|
1082
1082
|
if (!adapter) {
|
|
1083
|
-
throw
|
|
1083
|
+
throw chunkTOSPHMYU_cjs.createTaggedError(
|
|
1084
1084
|
"TOOL_NOT_FOUND",
|
|
1085
1085
|
`No adapter registered for kind: ${spec.kind}`
|
|
1086
1086
|
);
|
|
@@ -1108,7 +1108,7 @@ async function executeWithBudget(spec, args, ctx, spanId, deps) {
|
|
|
1108
1108
|
return result;
|
|
1109
1109
|
});
|
|
1110
1110
|
};
|
|
1111
|
-
const retryFn = () =>
|
|
1111
|
+
const retryFn = () => chunkTOSPHMYU_cjs.withRetry(executeFn, {
|
|
1112
1112
|
maxRetries,
|
|
1113
1113
|
onRetry: (error, attempt) => {
|
|
1114
1114
|
deps.metrics.recordRetry(spec.name);
|
|
@@ -1135,7 +1135,7 @@ async function executeWithBudget(spec, args, ctx, spanId, deps) {
|
|
|
1135
1135
|
});
|
|
1136
1136
|
} catch (error) {
|
|
1137
1137
|
if (error instanceof Error && error.message.includes("timed out")) {
|
|
1138
|
-
throw
|
|
1138
|
+
throw chunkTOSPHMYU_cjs.createTaggedError("TIMEOUT", error.message);
|
|
1139
1139
|
}
|
|
1140
1140
|
throw error;
|
|
1141
1141
|
}
|
|
@@ -1149,7 +1149,7 @@ function validateOutput(spec, result, validator) {
|
|
|
1149
1149
|
);
|
|
1150
1150
|
} catch (error) {
|
|
1151
1151
|
if (error instanceof SchemaValidationError) {
|
|
1152
|
-
throw
|
|
1152
|
+
throw chunkTOSPHMYU_cjs.createTaggedError("OUTPUT_SCHEMA_INVALID", error.message, {
|
|
1153
1153
|
errors: error.errors
|
|
1154
1154
|
});
|
|
1155
1155
|
}
|
|
@@ -1242,7 +1242,7 @@ var PTCRuntime = class {
|
|
|
1242
1242
|
logger;
|
|
1243
1243
|
constructor(options = {}) {
|
|
1244
1244
|
this.config = options.config ?? {};
|
|
1245
|
-
this.registry = options.registry ?? new
|
|
1245
|
+
this.registry = options.registry ?? new chunkTOSPHMYU_cjs.ToolRegistry();
|
|
1246
1246
|
this.validator = options.validator ?? new SchemaValidator();
|
|
1247
1247
|
this.policy = options.policy ?? new PolicyEngine(this.config.policy);
|
|
1248
1248
|
this.budget = options.budget ?? new BudgetManager(this.config.budget);
|
|
@@ -1343,7 +1343,7 @@ var PTCRuntime = class {
|
|
|
1343
1343
|
tracing: this.tracing
|
|
1344
1344
|
});
|
|
1345
1345
|
if (!this.budget.checkRateLimit(spec.name)) {
|
|
1346
|
-
throw
|
|
1346
|
+
throw chunkTOSPHMYU_cjs.createTaggedError(
|
|
1347
1347
|
"BUDGET_EXCEEDED",
|
|
1348
1348
|
`Rate limit exceeded for tool: ${spec.name}`
|
|
1349
1349
|
);
|
|
@@ -1366,7 +1366,7 @@ var PTCRuntime = class {
|
|
|
1366
1366
|
const toolError = asToolReturnedError(result);
|
|
1367
1367
|
if (toolError) {
|
|
1368
1368
|
const hint = buildInputSchemaHint(spec.inputSchema);
|
|
1369
|
-
throw
|
|
1369
|
+
throw chunkTOSPHMYU_cjs.createTaggedError("UPSTREAM_ERROR", toolError.message, {
|
|
1370
1370
|
...toolError.details && typeof toolError.details === "object" && !Array.isArray(toolError.details) ? toolError.details : {},
|
|
1371
1371
|
hint: hint ?? "Check the tool's input schema for required property names."
|
|
1372
1372
|
});
|
|
@@ -1526,7 +1526,7 @@ function npmDescriptorToRegistryPrefix(descriptor, resolvedVersion) {
|
|
|
1526
1526
|
const scope = slashIdx < 0 ? scopeAndPackage : scopeAndPackage.slice(0, slashIdx).replace(/^@/, "");
|
|
1527
1527
|
const pkg = slashIdx < 0 ? "" : scopeAndPackage.slice(slashIdx + 1);
|
|
1528
1528
|
const segment = [scope, pkg, version].filter(Boolean).join(".");
|
|
1529
|
-
const normalized =
|
|
1529
|
+
const normalized = chunkDYDNPIV2_cjs.normalizeToolName(segment);
|
|
1530
1530
|
if (!normalized) return "";
|
|
1531
1531
|
return "npm." + normalized + ".";
|
|
1532
1532
|
}
|
|
@@ -1552,7 +1552,7 @@ function expandToolDescriptorsToRegistryNames(descriptors, registryNames) {
|
|
|
1552
1552
|
const out = [];
|
|
1553
1553
|
const seen = /* @__PURE__ */ new Set();
|
|
1554
1554
|
function add(name) {
|
|
1555
|
-
const key =
|
|
1555
|
+
const key = chunkDYDNPIV2_cjs.normalizeToolName(name);
|
|
1556
1556
|
if (registryNames.includes(key) && !seen.has(key)) {
|
|
1557
1557
|
seen.add(key);
|
|
1558
1558
|
out.push(key);
|
|
@@ -1576,7 +1576,7 @@ function expandToolDescriptorsToRegistryNames(descriptors, registryNames) {
|
|
|
1576
1576
|
}
|
|
1577
1577
|
continue;
|
|
1578
1578
|
}
|
|
1579
|
-
const name =
|
|
1579
|
+
const name = chunkDYDNPIV2_cjs.normalizeToolName(s);
|
|
1580
1580
|
add(name);
|
|
1581
1581
|
}
|
|
1582
1582
|
return out;
|
|
@@ -1731,7 +1731,7 @@ async function importFromCache(packageRoot) {
|
|
|
1731
1731
|
fileUrl
|
|
1732
1732
|
);
|
|
1733
1733
|
}
|
|
1734
|
-
var requireFromPackage = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
1734
|
+
var requireFromPackage = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-AH4NI4GN.cjs', document.baseURI).href)));
|
|
1735
1735
|
function getProjectRequire() {
|
|
1736
1736
|
const cwd = process.cwd();
|
|
1737
1737
|
if (fs.existsSync(path.join(cwd, "package.json"))) return module$1.createRequire(path.join(cwd, "package.json"));
|
|
@@ -1778,7 +1778,7 @@ function loadExtensionFromNodeModules() {
|
|
|
1778
1778
|
function createPrefixingRegistry(registry, prefix) {
|
|
1779
1779
|
return {
|
|
1780
1780
|
register(spec) {
|
|
1781
|
-
registry.register({ ...spec, name: prefix +
|
|
1781
|
+
registry.register({ ...spec, name: prefix + chunkDYDNPIV2_cjs.normalizeToolName(spec.name) });
|
|
1782
1782
|
},
|
|
1783
1783
|
bulkRegister(specs) {
|
|
1784
1784
|
specs.forEach((s) => this.register(s));
|
|
@@ -1892,7 +1892,7 @@ function loadExampleTools() {
|
|
|
1892
1892
|
}
|
|
1893
1893
|
}
|
|
1894
1894
|
function createRuntimeFromConfigSync(options = {}) {
|
|
1895
|
-
const registry = new
|
|
1895
|
+
const registry = new chunkTOSPHMYU_cjs.ToolRegistry();
|
|
1896
1896
|
const stepLog = options.stepLog;
|
|
1897
1897
|
if (options.coreTools !== void 0) {
|
|
1898
1898
|
if (stepLog) stepLog("Trying extension from node_modules");
|
|
@@ -1903,8 +1903,7 @@ function createRuntimeFromConfigSync(options = {}) {
|
|
|
1903
1903
|
const resolvedVersion = getInstalledPackageVersion(extensionNode.packageName);
|
|
1904
1904
|
const prefix = npmDescriptorToRegistryPrefix(descriptor, resolvedVersion ?? void 0);
|
|
1905
1905
|
const reg = prefix ? createPrefixingRegistry(registry, prefix) : registry;
|
|
1906
|
-
const
|
|
1907
|
-
const coreAdapter = extensionNode.registerCoreTools(reg, options.coreTools, coreOptions);
|
|
1906
|
+
const coreAdapter = extensionNode.registerCoreTools(reg, options.coreTools);
|
|
1908
1907
|
const runtime3 = new PTCRuntime({ registry });
|
|
1909
1908
|
runtime3.registerAdapter(coreAdapter);
|
|
1910
1909
|
if (options.exampleTools !== void 0) {
|
|
@@ -1923,8 +1922,7 @@ function createRuntimeFromConfigSync(options = {}) {
|
|
|
1923
1922
|
if (stepLog) stepLog("Registered extension from cache");
|
|
1924
1923
|
const prefix = npmDescriptorToRegistryPrefix(extensionCache.descriptor, extensionCache.resolvedVersion);
|
|
1925
1924
|
const reg = prefix ? createPrefixingRegistry(registry, prefix) : registry;
|
|
1926
|
-
const
|
|
1927
|
-
const coreAdapter = extensionCache.registerCoreTools(reg, options.coreTools, coreOptions);
|
|
1925
|
+
const coreAdapter = extensionCache.registerCoreTools(reg, options.coreTools);
|
|
1928
1926
|
const runtime3 = new PTCRuntime({ registry });
|
|
1929
1927
|
runtime3.registerAdapter(coreAdapter);
|
|
1930
1928
|
if (options.exampleTools !== void 0) {
|
|
@@ -1959,11 +1957,10 @@ async function createRuntimeFromConfig(options = {}) {
|
|
|
1959
1957
|
const extension = await loadExtensionFromToolYamlCacheAsync(options.configFilePath, options.stepLog);
|
|
1960
1958
|
if (extension) {
|
|
1961
1959
|
if (options.stepLog) options.stepLog("Registered extension from async cache");
|
|
1962
|
-
const registry = new
|
|
1960
|
+
const registry = new chunkTOSPHMYU_cjs.ToolRegistry();
|
|
1963
1961
|
const prefix = npmDescriptorToRegistryPrefix(extension.descriptor, extension.resolvedVersion);
|
|
1964
1962
|
const reg = prefix ? createPrefixingRegistry(registry, prefix) : registry;
|
|
1965
|
-
const
|
|
1966
|
-
const coreAdapter = extension.registerCoreTools(reg, options.coreTools, coreOptions);
|
|
1963
|
+
const coreAdapter = extension.registerCoreTools(reg, options.coreTools);
|
|
1967
1964
|
const runtime = new PTCRuntime({ registry });
|
|
1968
1965
|
runtime.registerAdapter(coreAdapter);
|
|
1969
1966
|
return { runtime, registry };
|
|
@@ -2012,5 +2009,5 @@ exports.resolveSandboxedPath = resolveSandboxedPath;
|
|
|
2012
2009
|
exports.resolveToolDescriptor = resolveToolDescriptor;
|
|
2013
2010
|
exports.sanitizeForLog = sanitizeForLog;
|
|
2014
2011
|
exports.summarizeForLog = summarizeForLog;
|
|
2015
|
-
//# sourceMappingURL=chunk-
|
|
2016
|
-
//# sourceMappingURL=chunk-
|
|
2012
|
+
//# sourceMappingURL=chunk-AH4NI4GN.cjs.map
|
|
2013
|
+
//# sourceMappingURL=chunk-AH4NI4GN.cjs.map
|