@easynet/agent-tool 1.0.98 → 1.0.99
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/createAgentTools.d.ts +1 -0
- package/dist/api/createAgentTools.d.ts.map +1 -1
- package/dist/api/register-tools.d.ts +1 -0
- package/dist/api/register-tools.d.ts.map +1 -1
- package/dist/api/runtimeFromConfig.d.ts.map +1 -1
- package/dist/{chunk-ODML7BYU.js → chunk-3TT5M7A3.js} +31 -4
- package/dist/chunk-3TT5M7A3.js.map +1 -0
- package/dist/{chunk-GNYBAJZZ.cjs → chunk-TJUWCIYZ.cjs} +33 -6
- package/dist/chunk-TJUWCIYZ.cjs.map +1 -0
- package/dist/index.cjs +39 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/cli/index.cjs +14 -14
- package/dist/utils/cli/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-GNYBAJZZ.cjs.map +0 -1
- package/dist/chunk-ODML7BYU.js.map +0 -1
package/dist/utils/cli/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkXUIGSBWG_cjs = require('../../chunk-XUIGSBWG.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkTJUWCIYZ_cjs = require('../../chunk-TJUWCIYZ.cjs');
|
|
6
6
|
require('../../chunk-VLV5F6HX.cjs');
|
|
7
7
|
require('../../chunk-AGLGFQUW.cjs');
|
|
8
8
|
require('../../chunk-JW4EMVTE.cjs');
|
|
@@ -270,14 +270,14 @@ async function getRuntimeWithTools(pathOpt, verbose = false) {
|
|
|
270
270
|
const stepLog = verbose ? (msg) => process.stderr.write(`[agent-tool] ${msg}
|
|
271
271
|
`) : void 0;
|
|
272
272
|
if (stepLog) stepLog(`Loading tool config from ${searchDir}`);
|
|
273
|
-
const config =
|
|
273
|
+
const config = chunkTJUWCIYZ_cjs.findAndLoadToolConfig(searchDir);
|
|
274
274
|
let sandboxRoot = cwd;
|
|
275
275
|
if (config.sandboxedPath && typeof config.sandboxedPath === "string" && config.configPath) {
|
|
276
|
-
sandboxRoot =
|
|
276
|
+
sandboxRoot = chunkTJUWCIYZ_cjs.resolveSandboxedPath(config.configPath, config.sandboxedPath);
|
|
277
277
|
}
|
|
278
278
|
if (stepLog) {
|
|
279
279
|
if (config.configPath) {
|
|
280
|
-
const n =
|
|
280
|
+
const n = chunkTJUWCIYZ_cjs.getToolSourceDescriptors(config).length;
|
|
281
281
|
stepLog(`Config: ${config.configPath} (${n} tool(s)), sandbox: ${sandboxRoot}`);
|
|
282
282
|
} else {
|
|
283
283
|
stepLog("No tool.yaml found");
|
|
@@ -288,7 +288,7 @@ async function getRuntimeWithTools(pathOpt, verbose = false) {
|
|
|
288
288
|
enableSandboxValidation: config.enableSandboxValidation ?? DEFAULT_CORE_CONFIG.enableSandboxValidation,
|
|
289
289
|
allowedHosts: []
|
|
290
290
|
};
|
|
291
|
-
const result = await
|
|
291
|
+
const result = await chunkTJUWCIYZ_cjs.createRuntimeFromConfig({
|
|
292
292
|
coreTools: coreConfig,
|
|
293
293
|
configFilePath: config.configPath,
|
|
294
294
|
stepLog
|
|
@@ -452,7 +452,7 @@ var LS_DESC_MAX = 72;
|
|
|
452
452
|
function formatLsOutput(specs) {
|
|
453
453
|
const rows = specs.map((spec) => {
|
|
454
454
|
const { name } = parseToolName(spec.name);
|
|
455
|
-
const scope =
|
|
455
|
+
const scope = chunkTJUWCIYZ_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
|
|
456
456
|
const desc = (spec.description ?? "").replace(/\n/g, " ").trim().slice(0, LS_DESC_MAX);
|
|
457
457
|
return { scope, name, description: desc || "(no description)" };
|
|
458
458
|
});
|
|
@@ -479,7 +479,7 @@ function formatLsOutput(specs) {
|
|
|
479
479
|
}
|
|
480
480
|
function formatDescribeOutput(spec) {
|
|
481
481
|
const { name: localName } = parseToolName(spec.name);
|
|
482
|
-
const scope =
|
|
482
|
+
const scope = chunkTJUWCIYZ_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
|
|
483
483
|
const sections = [];
|
|
484
484
|
sections.push("\u250C\u2500 Tool");
|
|
485
485
|
sections.push(`\u2502 name: ${spec.name}`);
|
|
@@ -515,8 +515,8 @@ async function cmdLs(pathOpt, verbose = false) {
|
|
|
515
515
|
process.stdout.write("No tools registered.\n");
|
|
516
516
|
const cwd = process.cwd();
|
|
517
517
|
const searchDir = path2__namespace.default.resolve(cwd, pathOpt ?? ".");
|
|
518
|
-
const config =
|
|
519
|
-
const hasNpmTools =
|
|
518
|
+
const config = chunkTJUWCIYZ_cjs.findAndLoadToolConfig(searchDir);
|
|
519
|
+
const hasNpmTools = chunkTJUWCIYZ_cjs.getToolSourceDescriptors(config).some((t) => typeof t === "string" && t.startsWith("npm:"));
|
|
520
520
|
if (hasNpmTools) {
|
|
521
521
|
process.stdout.write(
|
|
522
522
|
"Tip: Install builtin tools in this directory so 'agent-tool ls' finds them: npm init -y && npm install @easynet/agent-tool-buildin\n"
|
|
@@ -540,7 +540,7 @@ async function cmdDescribe(toolName, pathOpt, verbose = false) {
|
|
|
540
540
|
}
|
|
541
541
|
try {
|
|
542
542
|
const { registry } = await getRuntimeWithTools(pathOpt, verbose);
|
|
543
|
-
const registryName =
|
|
543
|
+
const registryName = chunkTJUWCIYZ_cjs.resolveToolDescriptor(toolName.trim());
|
|
544
544
|
const spec = registry.get(registryName);
|
|
545
545
|
if (!spec) {
|
|
546
546
|
process.stderr.write(`Tool not found: ${toolName}
|
|
@@ -589,7 +589,7 @@ async function cmdRun(toolName, toolArgsJson, pathOpt, verbose = false) {
|
|
|
589
589
|
}
|
|
590
590
|
try {
|
|
591
591
|
const { runtime, registry } = await getRuntimeWithTools(pathOpt, verbose);
|
|
592
|
-
const registryName =
|
|
592
|
+
const registryName = chunkTJUWCIYZ_cjs.resolveToolDescriptor(toolName.trim());
|
|
593
593
|
if (!registry.get(registryName)) {
|
|
594
594
|
process.stderr.write(`Tool not found: ${toolName}
|
|
595
595
|
`);
|
|
@@ -617,10 +617,10 @@ async function cmdStartMcp(pathOpt, verbose = false, stdio = false, port = 3e3,
|
|
|
617
617
|
try {
|
|
618
618
|
const { runtime } = await getRuntimeWithTools(pathOpt, verbose);
|
|
619
619
|
if (stdio) {
|
|
620
|
-
await
|
|
620
|
+
await chunkTJUWCIYZ_cjs.runMCPServerOverStdio(runtime);
|
|
621
621
|
return 0;
|
|
622
622
|
}
|
|
623
|
-
const streamable = await
|
|
623
|
+
const streamable = await chunkTJUWCIYZ_cjs.createMCPServerStreamableHttp(runtime, { port, host, path: "/mcp" });
|
|
624
624
|
const { url } = await streamable.listen(port, host);
|
|
625
625
|
process.stdout.write(`MCP Streamable HTTP: ${url}
|
|
626
626
|
`);
|
|
@@ -636,7 +636,7 @@ async function cmdStartMcp(pathOpt, verbose = false, stdio = false, port = 3e3,
|
|
|
636
636
|
async function cmdStartHttp(port, host, pathOpt, verbose = false) {
|
|
637
637
|
try {
|
|
638
638
|
const { runtime } = await getRuntimeWithTools(pathOpt, verbose);
|
|
639
|
-
const http = await
|
|
639
|
+
const http = await chunkTJUWCIYZ_cjs.createHttpService(runtime);
|
|
640
640
|
const { port: actualPort, host: actualHost } = await http.listen({ port, host });
|
|
641
641
|
const base = `http://${actualHost}:${actualPort}`;
|
|
642
642
|
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
2
|
import { initProject, buildMCPPackage, runMCPServer } from '../../chunk-34SG3EMW.js';
|
|
3
|
-
import { findAndLoadToolConfig, getToolSourceDescriptors, resolveToolDescriptor, runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-
|
|
3
|
+
import { findAndLoadToolConfig, getToolSourceDescriptors, resolveToolDescriptor, runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-3TT5M7A3.js';
|
|
4
4
|
import '../../chunk-POUTZDWB.js';
|
|
5
5
|
import '../../chunk-IVL4TBFB.js';
|
|
6
6
|
import '../../chunk-BDUSB6GT.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.99",
|
|
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",
|