@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.
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var chunkN4PVR66J_cjs = require('../../chunk-N4PVR66J.cjs');
5
- var chunkZRNYEFY3_cjs = require('../../chunk-ZRNYEFY3.cjs');
6
- var chunkTRTPE426_cjs = require('../../chunk-TRTPE426.cjs');
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 = chunkTRTPE426_cjs.findAndLoadToolConfig(searchDir);
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 = chunkTRTPE426_cjs.resolveSandboxedPath2(config.configPath, config.sandboxedPath);
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 chunkTRTPE426_cjs.createRuntimeFromConfig({
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 chunkN4PVR66J_cjs.initProject({ targetPath: pathOpt || void 0 });
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 chunkN4PVR66J_cjs.buildMcpPackage({
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 chunkN4PVR66J_cjs.runMcpServer({ path: pathOpt || void 0 });
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 = chunkTRTPE426_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
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 = chunkTRTPE426_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
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 = chunkTRTPE426_cjs.findAndLoadToolConfig(searchDir);
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 = chunkTRTPE426_cjs.resolveToolDescriptor(toolName.trim());
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 = chunkTRTPE426_cjs.resolveToolDescriptor(toolName.trim());
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 chunkZRNYEFY3_cjs.runMCPServerOverStdio(runtime);
599
+ await chunkO4XXNLNE_cjs.runMCPServerOverStdio(runtime);
600
600
  return 0;
601
601
  }
602
- const streamable = await chunkZRNYEFY3_cjs.createMCPServerStreamableHttp(runtime, { port, host, path: "/mcp" });
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 chunkZRNYEFY3_cjs.createHttpService(runtime);
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)
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { initProject, buildMcpPackage, runMcpServer } from '../../chunk-KCA5RPPX.js';
3
- import { runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService } from '../../chunk-H2FRG24O.js';
4
- import { findAndLoadToolConfig, resolveToolDescriptor, resolveSandboxedPath2, createRuntimeFromConfig, getDisplayScope } from '../../chunk-GYO7ZNFJ.js';
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';
@@ -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,uBAAuB,CAAC"}
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.44",
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",