@easynet/agent-tool 1.0.55 → 1.0.57
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/expose/openapiHttp.d.ts.map +1 -1
- package/dist/api/main.cjs +13 -13
- package/dist/api/main.js +2 -2
- package/dist/{chunk-XT2CXR6A.js → chunk-A5C2MUNA.js} +61 -10
- package/dist/{chunk-XT2CXR6A.js.map → chunk-A5C2MUNA.js.map} +1 -1
- package/dist/{chunk-TFT4RYFZ.cjs → chunk-DPOLJN7F.cjs} +13 -13
- package/dist/{chunk-TFT4RYFZ.cjs.map → chunk-DPOLJN7F.cjs.map} +1 -1
- package/dist/{chunk-WC54NBDE.js → chunk-IWM5B5DU.js} +3 -3
- package/dist/{chunk-WC54NBDE.js.map → chunk-IWM5B5DU.js.map} +1 -1
- package/dist/{chunk-D2T3NTFN.cjs → chunk-JXYANBTH.cjs} +62 -11
- package/dist/chunk-JXYANBTH.cjs.map +1 -0
- package/dist/{chunk-WAGGOFT3.cjs → chunk-MUBZV65R.cjs} +15 -15
- package/dist/{chunk-WAGGOFT3.cjs.map → chunk-MUBZV65R.cjs.map} +1 -1
- package/dist/{chunk-W4AGLV2U.js → chunk-Y75CRPVF.js} +3 -3
- package/dist/{chunk-W4AGLV2U.js.map → chunk-Y75CRPVF.js.map} +1 -1
- 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-D2T3NTFN.cjs.map +0 -1
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 chunkDPOLJN7F_cjs = require('../../chunk-DPOLJN7F.cjs');
|
|
5
|
+
var chunkJXYANBTH_cjs = require('../../chunk-JXYANBTH.cjs');
|
|
6
6
|
require('../../chunk-WQMHMPNC.cjs');
|
|
7
7
|
require('../../chunk-QEJF3KDV.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 = chunkJXYANBTH_cjs.findAndLoadToolConfig(searchDir);
|
|
207
207
|
let sandboxRoot = cwd;
|
|
208
208
|
if (config.sandboxedPath && typeof config.sandboxedPath === "string" && config.configPath) {
|
|
209
|
-
sandboxRoot =
|
|
209
|
+
sandboxRoot = chunkJXYANBTH_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 chunkJXYANBTH_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 chunkDPOLJN7F_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 chunkDPOLJN7F_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 chunkDPOLJN7F_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 = chunkJXYANBTH_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 = chunkJXYANBTH_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 = chunkJXYANBTH_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 = chunkJXYANBTH_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 = chunkJXYANBTH_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 chunkJXYANBTH_cjs.runMCPServerOverStdio(runtime);
|
|
599
599
|
return 0;
|
|
600
600
|
}
|
|
601
|
-
const streamable = await
|
|
601
|
+
const streamable = await chunkJXYANBTH_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 chunkJXYANBTH_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-Y75CRPVF.js';
|
|
3
|
+
import { findAndLoadToolConfig, resolveToolDescriptor, runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-A5C2MUNA.js';
|
|
4
4
|
import '../../chunk-FCYBA7PR.js';
|
|
5
5
|
import '../../chunk-ODEHUAR4.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.57",
|
|
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",
|