@easynet/agent-tool 1.0.47 → 1.0.49
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 +13 -13
- package/dist/api/main.js +2 -2
- package/dist/api/runtimeFromConfig.d.ts.map +1 -1
- package/dist/{chunk-2ZPDD7ZO.js → chunk-2S465X6Q.js} +46 -12
- package/dist/chunk-2S465X6Q.js.map +1 -0
- package/dist/{chunk-IAEVDXWS.cjs → chunk-5GXFZ4GF.cjs} +15 -15
- package/dist/{chunk-IAEVDXWS.cjs.map → chunk-5GXFZ4GF.cjs.map} +1 -1
- package/dist/{chunk-MDPU7EIO.cjs → chunk-BCMMIJAQ.cjs} +9 -9
- package/dist/{chunk-MDPU7EIO.cjs.map → chunk-BCMMIJAQ.cjs.map} +1 -1
- package/dist/{chunk-KYBIKD5R.js → chunk-C6IARXVY.js} +3 -3
- package/dist/{chunk-KYBIKD5R.js.map → chunk-C6IARXVY.js.map} +1 -1
- package/dist/{chunk-64ZQQV5C.js → chunk-FECO5FHB.js} +3 -3
- package/dist/{chunk-64ZQQV5C.js.map → chunk-FECO5FHB.js.map} +1 -1
- package/dist/{chunk-A5B6Q6EG.cjs → chunk-XHFZEA7L.cjs} +47 -13
- package/dist/chunk-XHFZEA7L.cjs.map +1 -0
- package/dist/index.cjs +24 -24
- package/dist/index.js +4 -4
- package/dist/utils/cli/index.cjs +16 -16
- package/dist/utils/cli/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-2ZPDD7ZO.js.map +0 -1
- package/dist/chunk-A5B6Q6EG.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk5GXFZ4GF_cjs = require('./chunk-5GXFZ4GF.cjs');
|
|
4
|
+
var chunkBCMMIJAQ_cjs = require('./chunk-BCMMIJAQ.cjs');
|
|
5
|
+
var chunkXHFZEA7L_cjs = require('./chunk-XHFZEA7L.cjs');
|
|
6
6
|
var chunkTOSPHMYU_cjs = require('./chunk-TOSPHMYU.cjs');
|
|
7
7
|
var chunkDYDNPIV2_cjs = require('./chunk-DYDNPIV2.cjs');
|
|
8
8
|
require('./chunk-UUNG3GL3.cjs');
|
|
@@ -269,7 +269,7 @@ function generateExtensionManifest(projectRoot = process.cwd(), options = {}) {
|
|
|
269
269
|
const root = path6__default.default.resolve(projectRoot);
|
|
270
270
|
const outDir = path6__default.default.resolve(options.outDir ?? path6__default.default.join(root, "dist"));
|
|
271
271
|
const kind = options.kind ?? "core";
|
|
272
|
-
const { specs, errors } =
|
|
272
|
+
const { specs, errors } = chunkBCMMIJAQ_cjs.scanForTools({
|
|
273
273
|
projectPath: root,
|
|
274
274
|
include: options.include ?? ["**/*.ts"],
|
|
275
275
|
tsconfigPath: options.tsconfigPath
|
|
@@ -522,83 +522,83 @@ function expandIpv6(ip) {
|
|
|
522
522
|
|
|
523
523
|
Object.defineProperty(exports, "createAgentTools", {
|
|
524
524
|
enumerable: true,
|
|
525
|
-
get: function () { return
|
|
525
|
+
get: function () { return chunk5GXFZ4GF_cjs.createAgentTools; }
|
|
526
526
|
});
|
|
527
527
|
Object.defineProperty(exports, "createLangChainToolsAsync", {
|
|
528
528
|
enumerable: true,
|
|
529
|
-
get: function () { return
|
|
529
|
+
get: function () { return chunk5GXFZ4GF_cjs.createLangChainToolsAsync; }
|
|
530
530
|
});
|
|
531
531
|
Object.defineProperty(exports, "buildFunctionToTool", {
|
|
532
532
|
enumerable: true,
|
|
533
|
-
get: function () { return
|
|
533
|
+
get: function () { return chunkBCMMIJAQ_cjs.buildFunctionToTool; }
|
|
534
534
|
});
|
|
535
535
|
Object.defineProperty(exports, "buildMcpPackage", {
|
|
536
536
|
enumerable: true,
|
|
537
|
-
get: function () { return
|
|
537
|
+
get: function () { return chunkBCMMIJAQ_cjs.buildMcpPackage; }
|
|
538
538
|
});
|
|
539
539
|
Object.defineProperty(exports, "initProject", {
|
|
540
540
|
enumerable: true,
|
|
541
|
-
get: function () { return
|
|
541
|
+
get: function () { return chunkBCMMIJAQ_cjs.initProject; }
|
|
542
542
|
});
|
|
543
543
|
Object.defineProperty(exports, "runGeneratedMCP", {
|
|
544
544
|
enumerable: true,
|
|
545
|
-
get: function () { return
|
|
545
|
+
get: function () { return chunkBCMMIJAQ_cjs.runGeneratedMCP; }
|
|
546
546
|
});
|
|
547
547
|
Object.defineProperty(exports, "runMcpServer", {
|
|
548
548
|
enumerable: true,
|
|
549
|
-
get: function () { return
|
|
549
|
+
get: function () { return chunkBCMMIJAQ_cjs.runMcpServer; }
|
|
550
550
|
});
|
|
551
551
|
Object.defineProperty(exports, "scan", {
|
|
552
552
|
enumerable: true,
|
|
553
|
-
get: function () { return
|
|
553
|
+
get: function () { return chunkBCMMIJAQ_cjs.scan; }
|
|
554
554
|
});
|
|
555
555
|
Object.defineProperty(exports, "scanForTools", {
|
|
556
556
|
enumerable: true,
|
|
557
|
-
get: function () { return
|
|
557
|
+
get: function () { return chunkBCMMIJAQ_cjs.scanForTools; }
|
|
558
558
|
});
|
|
559
559
|
Object.defineProperty(exports, "PTCRuntime", {
|
|
560
560
|
enumerable: true,
|
|
561
|
-
get: function () { return
|
|
561
|
+
get: function () { return chunkXHFZEA7L_cjs.PTCRuntime; }
|
|
562
562
|
});
|
|
563
563
|
Object.defineProperty(exports, "createMCPServer", {
|
|
564
564
|
enumerable: true,
|
|
565
|
-
get: function () { return
|
|
565
|
+
get: function () { return chunkXHFZEA7L_cjs.createMCPServer; }
|
|
566
566
|
});
|
|
567
567
|
Object.defineProperty(exports, "createMCPServerStreamableHttp", {
|
|
568
568
|
enumerable: true,
|
|
569
|
-
get: function () { return
|
|
569
|
+
get: function () { return chunkXHFZEA7L_cjs.createMCPServerStreamableHttp; }
|
|
570
570
|
});
|
|
571
571
|
Object.defineProperty(exports, "createMCPStreamableHttpHandler", {
|
|
572
572
|
enumerable: true,
|
|
573
|
-
get: function () { return
|
|
573
|
+
get: function () { return chunkXHFZEA7L_cjs.createMCPStreamableHttpHandler; }
|
|
574
574
|
});
|
|
575
575
|
Object.defineProperty(exports, "createOpenAPIServer", {
|
|
576
576
|
enumerable: true,
|
|
577
|
-
get: function () { return
|
|
577
|
+
get: function () { return chunkXHFZEA7L_cjs.createHttpService; }
|
|
578
578
|
});
|
|
579
579
|
Object.defineProperty(exports, "createRuntimeFromConfig", {
|
|
580
580
|
enumerable: true,
|
|
581
|
-
get: function () { return
|
|
581
|
+
get: function () { return chunkXHFZEA7L_cjs.createRuntimeFromConfig; }
|
|
582
582
|
});
|
|
583
583
|
Object.defineProperty(exports, "createRuntimeFromConfigSync", {
|
|
584
584
|
enumerable: true,
|
|
585
|
-
get: function () { return
|
|
585
|
+
get: function () { return chunkXHFZEA7L_cjs.createRuntimeFromConfigSync; }
|
|
586
586
|
});
|
|
587
587
|
Object.defineProperty(exports, "loadToolConfig", {
|
|
588
588
|
enumerable: true,
|
|
589
|
-
get: function () { return
|
|
589
|
+
get: function () { return chunkXHFZEA7L_cjs.loadToolConfig; }
|
|
590
590
|
});
|
|
591
591
|
Object.defineProperty(exports, "resolveSandboxedPath", {
|
|
592
592
|
enumerable: true,
|
|
593
|
-
get: function () { return
|
|
593
|
+
get: function () { return chunkXHFZEA7L_cjs.resolveSandboxedPath2; }
|
|
594
594
|
});
|
|
595
595
|
Object.defineProperty(exports, "runMCPServerOverStdio", {
|
|
596
596
|
enumerable: true,
|
|
597
|
-
get: function () { return
|
|
597
|
+
get: function () { return chunkXHFZEA7L_cjs.runMCPServerOverStdio; }
|
|
598
598
|
});
|
|
599
599
|
Object.defineProperty(exports, "setSandboxValidationEnabled", {
|
|
600
600
|
enumerable: true,
|
|
601
|
-
get: function () { return
|
|
601
|
+
get: function () { return chunkXHFZEA7L_cjs.setSandboxValidationEnabled; }
|
|
602
602
|
});
|
|
603
603
|
Object.defineProperty(exports, "ToolRegistry", {
|
|
604
604
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createAgentTools, createLangChainToolsAsync } from './chunk-
|
|
2
|
-
import { scanForTools } from './chunk-
|
|
3
|
-
export { buildFunctionToTool, buildMcpPackage, initProject, runGeneratedMCP, runMcpServer, scan, scanForTools } from './chunk-
|
|
4
|
-
export { PTCRuntime, createMCPServer, createMCPServerStreamableHttp, createMCPStreamableHttpHandler, createHttpService as createOpenAPIServer, createRuntimeFromConfig, createRuntimeFromConfigSync, loadToolConfig, resolveSandboxedPath2 as resolveSandboxedPath, runMCPServerOverStdio, setSandboxValidationEnabled } from './chunk-
|
|
1
|
+
export { createAgentTools, createLangChainToolsAsync } from './chunk-C6IARXVY.js';
|
|
2
|
+
import { scanForTools } from './chunk-FECO5FHB.js';
|
|
3
|
+
export { buildFunctionToTool, buildMcpPackage, initProject, runGeneratedMCP, runMcpServer, scan, scanForTools } from './chunk-FECO5FHB.js';
|
|
4
|
+
export { PTCRuntime, createMCPServer, createMCPServerStreamableHttp, createMCPStreamableHttpHandler, createHttpService as createOpenAPIServer, createRuntimeFromConfig, createRuntimeFromConfigSync, loadToolConfig, resolveSandboxedPath2 as resolveSandboxedPath, runMCPServerOverStdio, setSandboxValidationEnabled } from './chunk-2S465X6Q.js';
|
|
5
5
|
import { createTaggedError } from './chunk-ZRHPGW7W.js';
|
|
6
6
|
export { ToolRegistry, createTaggedError } from './chunk-ZRHPGW7W.js';
|
|
7
7
|
import { createToolSpec } from './chunk-KDB3MY2H.js';
|
package/dist/utils/cli/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkBCMMIJAQ_cjs = require('../../chunk-BCMMIJAQ.cjs');
|
|
5
|
+
var chunkXHFZEA7L_cjs = require('../../chunk-XHFZEA7L.cjs');
|
|
6
6
|
require('../../chunk-TOSPHMYU.cjs');
|
|
7
7
|
require('../../chunk-DYDNPIV2.cjs');
|
|
8
8
|
var chunkUUNG3GL3_cjs = require('../../chunk-UUNG3GL3.cjs');
|
|
@@ -203,10 +203,10 @@ async function getRuntimeWithTools(pathOpt, verbose = false) {
|
|
|
203
203
|
const stepLog = verbose ? (msg) => process.stderr.write(`[agent-tool] ${msg}
|
|
204
204
|
`) : void 0;
|
|
205
205
|
if (stepLog) stepLog(`Loading tool config from ${searchDir}`);
|
|
206
|
-
const config =
|
|
206
|
+
const config = chunkXHFZEA7L_cjs.findAndLoadToolConfig(searchDir);
|
|
207
207
|
let sandboxRoot = cwd;
|
|
208
208
|
if (config.sandboxedPath && typeof config.sandboxedPath === "string" && config.configPath) {
|
|
209
|
-
sandboxRoot =
|
|
209
|
+
sandboxRoot = chunkXHFZEA7L_cjs.resolveSandboxedPath(config.configPath, config.sandboxedPath);
|
|
210
210
|
}
|
|
211
211
|
if (stepLog) {
|
|
212
212
|
if (config.configPath) {
|
|
@@ -221,7 +221,7 @@ async function getRuntimeWithTools(pathOpt, verbose = false) {
|
|
|
221
221
|
enableSandboxValidation: config.enableSandboxValidation ?? DEFAULT_CORE_CONFIG.enableSandboxValidation,
|
|
222
222
|
allowedHosts: []
|
|
223
223
|
};
|
|
224
|
-
const result = await
|
|
224
|
+
const result = await chunkXHFZEA7L_cjs.createRuntimeFromConfig({
|
|
225
225
|
coreTools: coreConfig,
|
|
226
226
|
configFilePath: config.configPath,
|
|
227
227
|
stepLog
|
|
@@ -377,7 +377,7 @@ Next: cd ${path2__namespace.default.basename(targetPath)} && npm install && npm
|
|
|
377
377
|
}
|
|
378
378
|
async function cmdInit(pathOpt) {
|
|
379
379
|
try {
|
|
380
|
-
const { targetPath, filesCreated } = await
|
|
380
|
+
const { targetPath, filesCreated } = await chunkBCMMIJAQ_cjs.initProject({ targetPath: pathOpt || void 0 });
|
|
381
381
|
process.stdout.write(`Initialized project at ${targetPath}
|
|
382
382
|
Created: ${filesCreated.join(", ")}
|
|
383
383
|
Next: npm install && npm run build
|
|
@@ -391,7 +391,7 @@ Next: npm install && npm run build
|
|
|
391
391
|
}
|
|
392
392
|
async function cmdBuild(pathOpt, outDir, include, includeN8n) {
|
|
393
393
|
try {
|
|
394
|
-
const result = await
|
|
394
|
+
const result = await chunkBCMMIJAQ_cjs.buildMcpPackage({
|
|
395
395
|
projectPath: pathOpt || void 0,
|
|
396
396
|
outDir: outDir || void 0,
|
|
397
397
|
include: include.length > 0 ? include : void 0,
|
|
@@ -412,7 +412,7 @@ mcp.json: ${result.mcpJsonPath}
|
|
|
412
412
|
}
|
|
413
413
|
async function cmdServe(pathOpt) {
|
|
414
414
|
try {
|
|
415
|
-
const { process: child } = await
|
|
415
|
+
const { process: child } = await chunkBCMMIJAQ_cjs.runMcpServer({ path: pathOpt || void 0 });
|
|
416
416
|
child.stdin?.pipe(process.stdin);
|
|
417
417
|
child.stdout?.pipe(process.stdout);
|
|
418
418
|
process.stdin?.unref();
|
|
@@ -430,7 +430,7 @@ var LS_DESC_MAX = 72;
|
|
|
430
430
|
function formatLsOutput(specs) {
|
|
431
431
|
const rows = specs.map((spec) => {
|
|
432
432
|
const { name } = parseToolName(spec.name);
|
|
433
|
-
const scope =
|
|
433
|
+
const scope = chunkXHFZEA7L_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
|
|
434
434
|
const desc = (spec.description ?? "").replace(/\n/g, " ").trim().slice(0, LS_DESC_MAX);
|
|
435
435
|
return { scope, name, description: desc || "(no description)" };
|
|
436
436
|
});
|
|
@@ -457,7 +457,7 @@ function formatLsOutput(specs) {
|
|
|
457
457
|
}
|
|
458
458
|
function formatDescribeOutput(spec) {
|
|
459
459
|
const { name: localName } = parseToolName(spec.name);
|
|
460
|
-
const scope =
|
|
460
|
+
const scope = chunkXHFZEA7L_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
|
|
461
461
|
const sections = [];
|
|
462
462
|
sections.push("\u250C\u2500 Tool");
|
|
463
463
|
sections.push(`\u2502 name: ${spec.name}`);
|
|
@@ -493,7 +493,7 @@ async function cmdLs(pathOpt, verbose = false) {
|
|
|
493
493
|
process.stdout.write("No tools registered.\n");
|
|
494
494
|
const cwd = process.cwd();
|
|
495
495
|
const searchDir = path2__namespace.default.resolve(cwd, pathOpt ?? ".");
|
|
496
|
-
const config =
|
|
496
|
+
const config = chunkXHFZEA7L_cjs.findAndLoadToolConfig(searchDir);
|
|
497
497
|
const hasNpmTools = Array.isArray(config.tools) && config.tools.some((t) => typeof t === "string" && t.startsWith("npm:"));
|
|
498
498
|
if (hasNpmTools) {
|
|
499
499
|
process.stdout.write(
|
|
@@ -518,7 +518,7 @@ async function cmdDescribe(toolName, pathOpt, verbose = false) {
|
|
|
518
518
|
}
|
|
519
519
|
try {
|
|
520
520
|
const { registry } = await getRuntimeWithTools(pathOpt, verbose);
|
|
521
|
-
const registryName =
|
|
521
|
+
const registryName = chunkXHFZEA7L_cjs.resolveToolDescriptor(toolName.trim());
|
|
522
522
|
const spec = registry.get(registryName);
|
|
523
523
|
if (!spec) {
|
|
524
524
|
process.stderr.write(`Tool not found: ${toolName}
|
|
@@ -567,7 +567,7 @@ async function cmdRun(toolName, toolArgsJson, pathOpt, verbose = false) {
|
|
|
567
567
|
}
|
|
568
568
|
try {
|
|
569
569
|
const { runtime, registry } = await getRuntimeWithTools(pathOpt, verbose);
|
|
570
|
-
const registryName =
|
|
570
|
+
const registryName = chunkXHFZEA7L_cjs.resolveToolDescriptor(toolName.trim());
|
|
571
571
|
if (!registry.get(registryName)) {
|
|
572
572
|
process.stderr.write(`Tool not found: ${toolName}
|
|
573
573
|
`);
|
|
@@ -595,10 +595,10 @@ async function cmdStartMcp(pathOpt, verbose = false, stdio = false, port = 3e3,
|
|
|
595
595
|
try {
|
|
596
596
|
const { runtime } = await getRuntimeWithTools(pathOpt, verbose);
|
|
597
597
|
if (stdio) {
|
|
598
|
-
await
|
|
598
|
+
await chunkXHFZEA7L_cjs.runMCPServerOverStdio(runtime);
|
|
599
599
|
return 0;
|
|
600
600
|
}
|
|
601
|
-
const streamable = await
|
|
601
|
+
const streamable = await chunkXHFZEA7L_cjs.createMCPServerStreamableHttp(runtime, { port, host, path: "/mcp" });
|
|
602
602
|
const { url, port: actualPort } = await streamable.listen(port, host);
|
|
603
603
|
process.stdout.write(`MCP Streamable HTTP: ${url}
|
|
604
604
|
`);
|
|
@@ -614,7 +614,7 @@ async function cmdStartMcp(pathOpt, verbose = false, stdio = false, port = 3e3,
|
|
|
614
614
|
async function cmdStartHttp(port, host, pathOpt, verbose = false) {
|
|
615
615
|
try {
|
|
616
616
|
const { runtime } = await getRuntimeWithTools(pathOpt, verbose);
|
|
617
|
-
const http = await
|
|
617
|
+
const http = await chunkXHFZEA7L_cjs.createHttpService(runtime);
|
|
618
618
|
const { port: actualPort, host: actualHost } = await http.listen({ port, host });
|
|
619
619
|
const base = `http://${actualHost}:${actualPort}`;
|
|
620
620
|
process.stdout.write(`API: ${base}/invoke (POST), ${base}/tools (GET)
|
package/dist/utils/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { initProject, buildMcpPackage, runMcpServer } from '../../chunk-
|
|
3
|
-
import { findAndLoadToolConfig, resolveToolDescriptor, runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-
|
|
2
|
+
import { initProject, buildMcpPackage, runMcpServer } from '../../chunk-FECO5FHB.js';
|
|
3
|
+
import { findAndLoadToolConfig, resolveToolDescriptor, runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-2S465X6Q.js';
|
|
4
4
|
import '../../chunk-ZRHPGW7W.js';
|
|
5
5
|
import '../../chunk-KDB3MY2H.js';
|
|
6
6
|
import { enrichSpecWithCanonicalSchema } from '../../chunk-NTWOVFEY.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easynet/agent-tool",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.49",
|
|
4
4
|
"description": "MCP build: init → build → run. Turn your project (@tool, SKILL, n8n) into a standalone MCP npm server (no framework embedding, no package conflict).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|