@easynet/agent-tool 1.0.44 → 1.0.46
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 +14 -14
- package/dist/api/main.js +3 -3
- package/dist/{chunk-GYO7ZNFJ.js → chunk-5GFSI7ZJ.js} +11 -9
- package/dist/chunk-5GFSI7ZJ.js.map +1 -0
- package/dist/{chunk-OVMBDOKU.js → chunk-H66TKSG4.js} +3 -3
- package/dist/{chunk-OVMBDOKU.js.map → chunk-H66TKSG4.js.map} +1 -1
- package/dist/{chunk-N4PVR66J.cjs → chunk-LG5K7WOK.cjs} +9 -9
- package/dist/{chunk-N4PVR66J.cjs.map → chunk-LG5K7WOK.cjs.map} +1 -1
- package/dist/{chunk-ZRNYEFY3.cjs → chunk-O4XXNLNE.cjs} +7 -7
- package/dist/{chunk-ZRNYEFY3.cjs.map → chunk-O4XXNLNE.cjs.map} +1 -1
- package/dist/{chunk-E6KWBXZC.cjs → chunk-QW27JAFS.cjs} +15 -15
- package/dist/{chunk-E6KWBXZC.cjs.map → chunk-QW27JAFS.cjs.map} +1 -1
- package/dist/{chunk-KCA5RPPX.js → chunk-SRTE2OUH.js} +3 -3
- package/dist/{chunk-KCA5RPPX.js.map → chunk-SRTE2OUH.js.map} +1 -1
- package/dist/{chunk-TRTPE426.cjs → chunk-XC7KPJLZ.cjs} +21 -20
- package/dist/chunk-XC7KPJLZ.cjs.map +1 -0
- package/dist/{chunk-H2FRG24O.js → chunk-YDYG4HF5.js} +3 -3
- package/dist/{chunk-H2FRG24O.js.map → chunk-YDYG4HF5.js.map} +1 -1
- package/dist/index.cjs +52 -52
- package/dist/index.js +5 -5
- package/dist/tools/util/toolConfig.d.ts.map +1 -1
- package/dist/utils/cli/index.cjs +17 -17
- package/dist/utils/cli/index.js +3 -3
- package/dist/utils/npmCache.d.ts +1 -1
- package/dist/utils/npmCache.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-GYO7ZNFJ.js.map +0 -1
- package/dist/chunk-TRTPE426.cjs.map +0 -1
package/dist/utils/cli/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
4
|
+
var chunkLG5K7WOK_cjs = require('../../chunk-LG5K7WOK.cjs');
|
|
5
|
+
var chunkO4XXNLNE_cjs = require('../../chunk-O4XXNLNE.cjs');
|
|
6
|
+
var chunkXC7KPJLZ_cjs = require('../../chunk-XC7KPJLZ.cjs');
|
|
7
7
|
require('../../chunk-TOSPHMYU.cjs');
|
|
8
8
|
require('../../chunk-DYDNPIV2.cjs');
|
|
9
9
|
var chunkUUNG3GL3_cjs = require('../../chunk-UUNG3GL3.cjs');
|
|
@@ -204,10 +204,10 @@ async function getRuntimeWithTools(pathOpt, verbose = false) {
|
|
|
204
204
|
const stepLog = verbose ? (msg) => process.stderr.write(`[agent-tool] ${msg}
|
|
205
205
|
`) : void 0;
|
|
206
206
|
if (stepLog) stepLog(`Loading tool config from ${searchDir}`);
|
|
207
|
-
const config =
|
|
207
|
+
const config = chunkXC7KPJLZ_cjs.findAndLoadToolConfig(searchDir);
|
|
208
208
|
let sandboxRoot = cwd;
|
|
209
209
|
if (config.sandboxedPath && typeof config.sandboxedPath === "string" && config.configPath) {
|
|
210
|
-
sandboxRoot =
|
|
210
|
+
sandboxRoot = chunkXC7KPJLZ_cjs.resolveSandboxedPath2(config.configPath, config.sandboxedPath);
|
|
211
211
|
}
|
|
212
212
|
if (stepLog) {
|
|
213
213
|
if (config.configPath) {
|
|
@@ -222,7 +222,7 @@ async function getRuntimeWithTools(pathOpt, verbose = false) {
|
|
|
222
222
|
enableSandboxValidation: config.enableSandboxValidation ?? DEFAULT_CORE_CONFIG.enableSandboxValidation,
|
|
223
223
|
allowedHosts: []
|
|
224
224
|
};
|
|
225
|
-
const result = await
|
|
225
|
+
const result = await chunkXC7KPJLZ_cjs.createRuntimeFromConfig({
|
|
226
226
|
coreTools: coreConfig,
|
|
227
227
|
configFilePath: config.configPath,
|
|
228
228
|
stepLog
|
|
@@ -378,7 +378,7 @@ Next: cd ${path2__namespace.default.basename(targetPath)} && npm install && npm
|
|
|
378
378
|
}
|
|
379
379
|
async function cmdInit(pathOpt) {
|
|
380
380
|
try {
|
|
381
|
-
const { targetPath, filesCreated } = await
|
|
381
|
+
const { targetPath, filesCreated } = await chunkLG5K7WOK_cjs.initProject({ targetPath: pathOpt || void 0 });
|
|
382
382
|
process.stdout.write(`Initialized project at ${targetPath}
|
|
383
383
|
Created: ${filesCreated.join(", ")}
|
|
384
384
|
Next: npm install && npm run build
|
|
@@ -392,7 +392,7 @@ Next: npm install && npm run build
|
|
|
392
392
|
}
|
|
393
393
|
async function cmdBuild(pathOpt, outDir, include, includeN8n) {
|
|
394
394
|
try {
|
|
395
|
-
const result = await
|
|
395
|
+
const result = await chunkLG5K7WOK_cjs.buildMcpPackage({
|
|
396
396
|
projectPath: pathOpt || void 0,
|
|
397
397
|
outDir: outDir || void 0,
|
|
398
398
|
include: include.length > 0 ? include : void 0,
|
|
@@ -413,7 +413,7 @@ mcp.json: ${result.mcpJsonPath}
|
|
|
413
413
|
}
|
|
414
414
|
async function cmdServe(pathOpt) {
|
|
415
415
|
try {
|
|
416
|
-
const { process: child } = await
|
|
416
|
+
const { process: child } = await chunkLG5K7WOK_cjs.runMcpServer({ path: pathOpt || void 0 });
|
|
417
417
|
child.stdin?.pipe(process.stdin);
|
|
418
418
|
child.stdout?.pipe(process.stdout);
|
|
419
419
|
process.stdin?.unref();
|
|
@@ -431,7 +431,7 @@ var LS_DESC_MAX = 72;
|
|
|
431
431
|
function formatLsOutput(specs) {
|
|
432
432
|
const rows = specs.map((spec) => {
|
|
433
433
|
const { name } = parseToolName(spec.name);
|
|
434
|
-
const scope =
|
|
434
|
+
const scope = chunkXC7KPJLZ_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
|
|
435
435
|
const desc = (spec.description ?? "").replace(/\n/g, " ").trim().slice(0, LS_DESC_MAX);
|
|
436
436
|
return { scope, name, description: desc || "(no description)" };
|
|
437
437
|
});
|
|
@@ -458,7 +458,7 @@ function formatLsOutput(specs) {
|
|
|
458
458
|
}
|
|
459
459
|
function formatDescribeOutput(spec) {
|
|
460
460
|
const { name: localName } = parseToolName(spec.name);
|
|
461
|
-
const scope =
|
|
461
|
+
const scope = chunkXC7KPJLZ_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
|
|
462
462
|
const sections = [];
|
|
463
463
|
sections.push("\u250C\u2500 Tool");
|
|
464
464
|
sections.push(`\u2502 name: ${spec.name}`);
|
|
@@ -494,7 +494,7 @@ async function cmdLs(pathOpt, verbose = false) {
|
|
|
494
494
|
process.stdout.write("No tools registered.\n");
|
|
495
495
|
const cwd = process.cwd();
|
|
496
496
|
const searchDir = path2__namespace.default.resolve(cwd, pathOpt ?? ".");
|
|
497
|
-
const config =
|
|
497
|
+
const config = chunkXC7KPJLZ_cjs.findAndLoadToolConfig(searchDir);
|
|
498
498
|
const hasNpmTools = Array.isArray(config.tools) && config.tools.some((t) => typeof t === "string" && t.startsWith("npm:"));
|
|
499
499
|
if (hasNpmTools) {
|
|
500
500
|
process.stdout.write(
|
|
@@ -519,7 +519,7 @@ async function cmdDescribe(toolName, pathOpt, verbose = false) {
|
|
|
519
519
|
}
|
|
520
520
|
try {
|
|
521
521
|
const { registry } = await getRuntimeWithTools(pathOpt, verbose);
|
|
522
|
-
const registryName =
|
|
522
|
+
const registryName = chunkXC7KPJLZ_cjs.resolveToolDescriptor(toolName.trim());
|
|
523
523
|
const spec = registry.get(registryName);
|
|
524
524
|
if (!spec) {
|
|
525
525
|
process.stderr.write(`Tool not found: ${toolName}
|
|
@@ -568,7 +568,7 @@ async function cmdRun(toolName, toolArgsJson, pathOpt, verbose = false) {
|
|
|
568
568
|
}
|
|
569
569
|
try {
|
|
570
570
|
const { runtime, registry } = await getRuntimeWithTools(pathOpt, verbose);
|
|
571
|
-
const registryName =
|
|
571
|
+
const registryName = chunkXC7KPJLZ_cjs.resolveToolDescriptor(toolName.trim());
|
|
572
572
|
if (!registry.get(registryName)) {
|
|
573
573
|
process.stderr.write(`Tool not found: ${toolName}
|
|
574
574
|
`);
|
|
@@ -596,10 +596,10 @@ async function cmdStartMcp(pathOpt, verbose = false, stdio = false, port = 3e3,
|
|
|
596
596
|
try {
|
|
597
597
|
const { runtime } = await getRuntimeWithTools(pathOpt, verbose);
|
|
598
598
|
if (stdio) {
|
|
599
|
-
await
|
|
599
|
+
await chunkO4XXNLNE_cjs.runMCPServerOverStdio(runtime);
|
|
600
600
|
return 0;
|
|
601
601
|
}
|
|
602
|
-
const streamable = await
|
|
602
|
+
const streamable = await chunkO4XXNLNE_cjs.createMCPServerStreamableHttp(runtime, { port, host, path: "/mcp" });
|
|
603
603
|
const { url, port: actualPort } = await streamable.listen(port, host);
|
|
604
604
|
process.stdout.write(`MCP Streamable HTTP: ${url}
|
|
605
605
|
`);
|
|
@@ -615,7 +615,7 @@ async function cmdStartMcp(pathOpt, verbose = false, stdio = false, port = 3e3,
|
|
|
615
615
|
async function cmdStartHttp(port, host, pathOpt, verbose = false) {
|
|
616
616
|
try {
|
|
617
617
|
const { runtime } = await getRuntimeWithTools(pathOpt, verbose);
|
|
618
|
-
const http = await
|
|
618
|
+
const http = await chunkO4XXNLNE_cjs.createHttpService(runtime);
|
|
619
619
|
const { port: actualPort, host: actualHost } = await http.listen({ port, host });
|
|
620
620
|
const base = `http://${actualHost}:${actualPort}`;
|
|
621
621
|
process.stdout.write(`API: ${base}/invoke (POST), ${base}/tools (GET)
|
package/dist/utils/cli/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { initProject, buildMcpPackage, runMcpServer } from '../../chunk-
|
|
3
|
-
import { runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService } from '../../chunk-
|
|
4
|
-
import { findAndLoadToolConfig, resolveToolDescriptor, resolveSandboxedPath2, createRuntimeFromConfig, getDisplayScope } from '../../chunk-
|
|
2
|
+
import { initProject, buildMcpPackage, runMcpServer } from '../../chunk-SRTE2OUH.js';
|
|
3
|
+
import { runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService } from '../../chunk-YDYG4HF5.js';
|
|
4
|
+
import { findAndLoadToolConfig, resolveToolDescriptor, resolveSandboxedPath2, createRuntimeFromConfig, getDisplayScope } from '../../chunk-5GFSI7ZJ.js';
|
|
5
5
|
import '../../chunk-ZRHPGW7W.js';
|
|
6
6
|
import '../../chunk-KDB3MY2H.js';
|
|
7
7
|
import { enrichSpecWithCanonicalSchema } from '../../chunk-NTWOVFEY.js';
|
package/dist/utils/npmCache.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ensurePackageInCache, getPackageEntryPath, importFromCache, resolveLatestVersionFromRegistry, type EnsurePackageInCacheOptions, } from "@easynet/agent-common";
|
|
1
|
+
export { ensurePackageInCache, getPackageEntryPath, importFromCache, resolveLatestVersionFromRegistry, type EnsurePackageInCacheOptions, } from "@easynet/agent-common/npm";
|
|
2
2
|
//# sourceMappingURL=npmCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npmCache.d.ts","sourceRoot":"","sources":["../../src/utils/npmCache.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,gCAAgC,EAChC,KAAK,2BAA2B,GACjC,MAAM,
|
|
1
|
+
{"version":3,"file":"npmCache.d.ts","sourceRoot":"","sources":["../../src/utils/npmCache.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,gCAAgC,EAChC,KAAK,2BAA2B,GACjC,MAAM,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easynet/agent-tool",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.46",
|
|
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",
|