@easynet/agent-tool 1.0.104 → 1.0.105

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/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  require('./chunk-HMC5G5FQ.cjs');
4
- var chunk2THI5UWA_cjs = require('./chunk-2THI5UWA.cjs');
4
+ var chunkMQXOFUSU_cjs = require('./chunk-MQXOFUSU.cjs');
5
5
  var chunk45MCEW2Y_cjs = require('./chunk-45MCEW2Y.cjs');
6
6
  require('./chunk-AGLGFQUW.cjs');
7
7
  require('./chunk-JW4EMVTE.cjs');
@@ -114,7 +114,7 @@ var LangChainToolsHub = class {
114
114
  const intent = buildIntent(spec.name, enriched.inputSchema, normalizedArgs);
115
115
  const ctx = ctxFactory();
116
116
  const result = await runtime.invoke(intent, ctx);
117
- return chunk2THI5UWA_cjs.toToolObservationText(result, { includeFeedbackMarker: true });
117
+ return chunkMQXOFUSU_cjs.toToolObservationText(result, { includeFeedbackMarker: true });
118
118
  }
119
119
  });
120
120
  }
@@ -222,9 +222,9 @@ function resolveEmbeddedToolConfigPath() {
222
222
  }
223
223
  var EMBEDDED_TOOL_CONFIG_PATH = resolveEmbeddedToolConfigPath();
224
224
  function loadMergedToolConfig(overridePath) {
225
- const baseConfig = chunk2THI5UWA_cjs.loadToolConfig(EMBEDDED_TOOL_CONFIG_PATH);
225
+ const baseConfig = chunkMQXOFUSU_cjs.loadToolConfig(EMBEDDED_TOOL_CONFIG_PATH);
226
226
  if (!overridePath) return baseConfig;
227
- const overrideConfig = chunk2THI5UWA_cjs.loadToolConfig(overridePath);
227
+ const overrideConfig = chunkMQXOFUSU_cjs.loadToolConfig(overridePath);
228
228
  return utils.deepMerge({}, baseConfig, overrideConfig);
229
229
  }
230
230
  function flattenSourceGroupedToolConfig(sources) {
@@ -236,7 +236,7 @@ function flattenSourceGroupedToolConfig(sources) {
236
236
  }
237
237
  continue;
238
238
  }
239
- const packagePrefix = descriptor.startsWith("npm:") ? chunk2THI5UWA_cjs.npmDescriptorToPackagePrefix(descriptor) : descriptor.startsWith("file:") ? chunk2THI5UWA_cjs.fileDescriptorToPackagePrefix(descriptor) : "";
239
+ const packagePrefix = descriptor.startsWith("npm:") ? chunkMQXOFUSU_cjs.npmDescriptorToPackagePrefix(descriptor) : descriptor.startsWith("file:") ? chunkMQXOFUSU_cjs.fileDescriptorToPackagePrefix(descriptor) : "";
240
240
  for (const [toolName, toolConfig] of Object.entries(toolMap)) {
241
241
  flat[packagePrefix ? `${packagePrefix}::${toolName}` : toolName] = toolConfig;
242
242
  }
@@ -244,14 +244,14 @@ function flattenSourceGroupedToolConfig(sources) {
244
244
  return flat;
245
245
  }
246
246
  function buildConfiguredToolSelections(toolConfig) {
247
- return chunk2THI5UWA_cjs.getPathSourceDescriptors(toolConfig);
247
+ return chunkMQXOFUSU_cjs.getPathSourceDescriptors(toolConfig);
248
248
  }
249
249
  function runtimeOptionsFromConfig(opts, toolConfig, configPathForResolve, extensionEmbeddedDefaults) {
250
250
  const coreTools = opts.coreTools ?? { sandboxRoot: process.cwd(), allowedHosts: [], enableSandboxValidation: false };
251
251
  {
252
252
  const updates = {};
253
253
  if (toolConfig.sandboxedPath && typeof toolConfig.sandboxedPath === "string") {
254
- updates.sandboxRoot = chunk2THI5UWA_cjs.resolveSandboxedPath(configPathForResolve, toolConfig.sandboxedPath);
254
+ updates.sandboxRoot = chunkMQXOFUSU_cjs.resolveSandboxedPath(configPathForResolve, toolConfig.sandboxedPath);
255
255
  }
256
256
  if (typeof toolConfig.enableSandboxValidation === "boolean") {
257
257
  updates.enableSandboxValidation = toolConfig.enableSandboxValidation;
@@ -293,14 +293,14 @@ async function createLangChainAgentToolsAsync(options) {
293
293
  configPathForResolve,
294
294
  {}
295
295
  );
296
- const { runtime } = await chunk2THI5UWA_cjs.createRuntimeFromConfig(runtimeOpts);
296
+ const { runtime } = await chunkMQXOFUSU_cjs.createRuntimeFromConfig(runtimeOpts);
297
297
  const hub = new LangChainToolsHub(runtime);
298
298
  const names = buildConfiguredToolSelections(mergedToolConfig);
299
299
  if (names.length > 0) {
300
300
  const registryNames = runtime.getRegistry().snapshot().map((s) => s.name);
301
- const allBarePackages = names.every((n) => chunk2THI5UWA_cjs.isBarePackageDescriptor(String(n)));
301
+ const allBarePackages = names.every((n) => chunkMQXOFUSU_cjs.isBarePackageDescriptor(String(n)));
302
302
  if (allBarePackages) return hub.getLangChainTools();
303
- return hub.getLangChainToolsForNames(chunk2THI5UWA_cjs.expandToolDescriptorsToRegistryNames(names, registryNames));
303
+ return hub.getLangChainToolsForNames(chunkMQXOFUSU_cjs.expandToolDescriptorsToRegistryNames(names, registryNames));
304
304
  }
305
305
  return hub.getLangChainTools();
306
306
  }
@@ -328,7 +328,7 @@ function getInstalledPackageVersionFromRequire(packageName, req) {
328
328
  }
329
329
  }
330
330
  function resolveFileDescriptorRoot(descriptor, configFilePath) {
331
- const parsed = chunk2THI5UWA_cjs.parseToolPath(descriptor.trim());
331
+ const parsed = chunkMQXOFUSU_cjs.parseToolPath(descriptor.trim());
332
332
  if (!parsed || parsed.protocol !== "file") return null;
333
333
  const localPath = path.isAbsolute(configFilePath) ? configFilePath : path.resolve(process.cwd(), configFilePath);
334
334
  const configDir = path.dirname(localPath);
@@ -338,7 +338,7 @@ function resolveFileDescriptorRoot(descriptor, configFilePath) {
338
338
  return resolvedPath;
339
339
  }
340
340
  function resolveNpmDescriptorRoot(descriptor, configFilePath) {
341
- const parsed = chunk2THI5UWA_cjs.parseNpmDescriptor(descriptor.trim());
341
+ const parsed = chunkMQXOFUSU_cjs.parseNpmDescriptor(descriptor.trim());
342
342
  if (!parsed) return null;
343
343
  const localPath = path.isAbsolute(configFilePath) ? configFilePath : path.resolve(process.cwd(), configFilePath);
344
344
  const configDir = path.dirname(localPath);
@@ -358,18 +358,18 @@ function resolveNpmDescriptorRoot(descriptor, configFilePath) {
358
358
  try {
359
359
  const installed = getInstalledPackageVersionFromRequire(parsed.packageName, configRequire);
360
360
  const requested = parsed.version === "latest" || !parsed.version?.trim() ? null : parsed.version;
361
- const resolvedVersion = requested ?? installed ?? chunk2THI5UWA_cjs.resolveLatestVersionFromRegistry(parsed.packageName, { cwd: npmCwd });
361
+ const resolvedVersion = requested ?? installed ?? chunkMQXOFUSU_cjs.resolveLatestVersionFromRegistry(parsed.packageName, { cwd: npmCwd });
362
362
  if (installed === resolvedVersion) {
363
363
  return path.dirname(configRequire.resolve(`${parsed.packageName}/package.json`));
364
364
  }
365
365
  } catch {
366
366
  }
367
367
  }
368
- const cacheBase = chunk2THI5UWA_cjs.getCacheBaseFromToolConfig(localPath);
368
+ const cacheBase = chunkMQXOFUSU_cjs.getCacheBaseFromToolConfig(localPath);
369
369
  const cacheOptions = cacheBase ? [{ cacheBase, cwd: npmCwd }, { cwd: npmCwd }] : [{ cwd: npmCwd }];
370
370
  for (const opts of cacheOptions) {
371
371
  try {
372
- const cacheDir = chunk2THI5UWA_cjs.ensurePackageInCache(parsed.packageName, parsed.version, opts);
372
+ const cacheDir = chunkMQXOFUSU_cjs.ensurePackageInCache(parsed.packageName, parsed.version, opts);
373
373
  return cacheDir;
374
374
  } catch {
375
375
  if (cacheBase && "cacheBase" in opts) continue;
@@ -384,9 +384,9 @@ function resolveDescriptorRoot(descriptor, configFilePath) {
384
384
  return null;
385
385
  }
386
386
  function resolveAgentSkillRoots(options) {
387
- const config = chunk2THI5UWA_cjs.loadToolConfig(options.configFilePath);
387
+ const config = chunkMQXOFUSU_cjs.loadToolConfig(options.configFilePath);
388
388
  const skillPath = options.skillPath ?? config.skillPath ?? "skills";
389
- const descriptors = chunk2THI5UWA_cjs.getPathSourceDescriptors(config);
389
+ const descriptors = chunkMQXOFUSU_cjs.getPathSourceDescriptors(config);
390
390
  const roots = descriptors.map((descriptor) => resolveDescriptorRoot(descriptor, options.configFilePath)).filter((value) => typeof value === "string").map((root) => resolveSkillDirectory(root, skillPath)).filter((value) => typeof value === "string");
391
391
  return [...new Set(roots)];
392
392
  }
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import './chunk-JEOBJ37J.js';
2
- import { loadToolConfig, getPathSourceDescriptors, createRuntimeFromConfig, isBarePackageDescriptor, expandToolDescriptorsToRegistryNames, resolveSandboxedPath, toToolObservationText, parseNpmDescriptor, resolveLatestVersionFromRegistry, getCacheBaseFromToolConfig, ensurePackageInCache, parseToolPath, npmDescriptorToPackagePrefix, fileDescriptorToPackagePrefix } from './chunk-2MSEJB6X.js';
2
+ import { loadToolConfig, getPathSourceDescriptors, createRuntimeFromConfig, isBarePackageDescriptor, expandToolDescriptorsToRegistryNames, resolveSandboxedPath, toToolObservationText, parseNpmDescriptor, resolveLatestVersionFromRegistry, getCacheBaseFromToolConfig, ensurePackageInCache, parseToolPath, npmDescriptorToPackagePrefix, fileDescriptorToPackagePrefix } from './chunk-OZUNZILF.js';
3
3
  import { LANGCHAIN_KIND } from './chunk-2Y6T67HJ.js';
4
4
  import './chunk-IVL4TBFB.js';
5
5
  import './chunk-BDUSB6GT.js';
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkYAIP4AYQ_cjs = require('../../chunk-YAIP4AYQ.cjs');
5
- var chunk2THI5UWA_cjs = require('../../chunk-2THI5UWA.cjs');
5
+ var chunkMQXOFUSU_cjs = require('../../chunk-MQXOFUSU.cjs');
6
6
  require('../../chunk-45MCEW2Y.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 = chunk2THI5UWA_cjs.findAndLoadToolConfig(searchDir);
273
+ const config = chunkMQXOFUSU_cjs.findAndLoadToolConfig(searchDir);
274
274
  let sandboxRoot = cwd;
275
275
  if (config.sandboxedPath && typeof config.sandboxedPath === "string" && config.configPath) {
276
- sandboxRoot = chunk2THI5UWA_cjs.resolveSandboxedPath(config.configPath, config.sandboxedPath);
276
+ sandboxRoot = chunkMQXOFUSU_cjs.resolveSandboxedPath(config.configPath, config.sandboxedPath);
277
277
  }
278
278
  if (stepLog) {
279
279
  if (config.configPath) {
280
- const n = chunk2THI5UWA_cjs.getToolSourceDescriptors(config).length;
280
+ const n = chunkMQXOFUSU_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 chunk2THI5UWA_cjs.createRuntimeFromConfig({
291
+ const result = await chunkMQXOFUSU_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 = chunk2THI5UWA_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
455
+ const scope = chunkMQXOFUSU_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 = chunk2THI5UWA_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
482
+ const scope = chunkMQXOFUSU_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 = chunk2THI5UWA_cjs.findAndLoadToolConfig(searchDir);
519
- const hasNpmTools = chunk2THI5UWA_cjs.getToolSourceDescriptors(config).some((t) => typeof t === "string" && t.startsWith("npm:"));
518
+ const config = chunkMQXOFUSU_cjs.findAndLoadToolConfig(searchDir);
519
+ const hasNpmTools = chunkMQXOFUSU_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 = chunk2THI5UWA_cjs.resolveToolDescriptor(toolName.trim());
543
+ const registryName = chunkMQXOFUSU_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 = chunk2THI5UWA_cjs.resolveToolDescriptor(toolName.trim());
592
+ const registryName = chunkMQXOFUSU_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 chunk2THI5UWA_cjs.runMCPServerOverStdio(runtime);
620
+ await chunkMQXOFUSU_cjs.runMCPServerOverStdio(runtime);
621
621
  return 0;
622
622
  }
623
- const streamable = await chunk2THI5UWA_cjs.createMCPServerStreamableHttp(runtime, { port, host, path: "/mcp" });
623
+ const streamable = await chunkMQXOFUSU_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 chunk2THI5UWA_cjs.createHttpService(runtime);
639
+ const http = await chunkMQXOFUSU_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)
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { initProject, buildMCPPackage, runMCPServer } from '../../chunk-WNWMAS7C.js';
3
- import { findAndLoadToolConfig, getToolSourceDescriptors, resolveToolDescriptor, runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-2MSEJB6X.js';
3
+ import { findAndLoadToolConfig, getToolSourceDescriptors, resolveToolDescriptor, runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-OZUNZILF.js';
4
4
  import '../../chunk-2Y6T67HJ.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.104",
3
+ "version": "1.0.105",
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",
@@ -50,8 +50,8 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@easynet/agent-common": "latest",
53
- "@langchain/core": "1.1.27",
54
- "@langchain/openai": "1.2.9",
53
+ "@langchain/core": "1.1.31",
54
+ "@langchain/openai": "1.2.12",
55
55
  "@modelcontextprotocol/sdk": ">=1.25.0",
56
56
  "@types/express": "^5.0.3",
57
57
  "ajv": "^8.17.1",
@@ -60,7 +60,7 @@
60
60
  "eventemitter3": "^5.0.1",
61
61
  "express": "^5.1.0",
62
62
  "jmespath": "^0.16.0",
63
- "langchain": "1.2.25",
63
+ "langchain": "1.2.30",
64
64
  "mustache": "^4.2.0",
65
65
  "p-retry": "^6.2.1",
66
66
  "p-timeout": "^6.1.4",
@@ -69,15 +69,15 @@
69
69
  "uuid": "^11.0.5"
70
70
  },
71
71
  "devDependencies": {
72
- "@langchain/core": "1.1.27",
73
- "@langchain/openai": "1.2.9",
72
+ "@langchain/core": "1.1.31",
73
+ "@langchain/openai": "1.2.12",
74
74
  "@semantic-release/git": "^10.0.1",
75
75
  "@types/jmespath": "^0.15.2",
76
76
  "@types/mustache": "^4.2.5",
77
77
  "@types/node": "^22.10.0",
78
78
  "@types/uuid": "^10.0.0",
79
- "deepagents": "1.8.0",
80
- "langchain": "1.2.25",
79
+ "deepagents": "1.8.1",
80
+ "langchain": "1.2.30",
81
81
  "semantic-release": "^24.2.0",
82
82
  "tsup": "^8.3.5",
83
83
  "typescript": "^5.7.2",
@@ -85,9 +85,9 @@
85
85
  "zod": "^3.23.0"
86
86
  },
87
87
  "peerDependencies": {
88
- "@langchain/core": "1.1.27",
88
+ "@langchain/core": "1.1.31",
89
89
  "@modelcontextprotocol/sdk": ">=1.25.0",
90
- "langchain": "1.2.25",
90
+ "langchain": "1.2.30",
91
91
  "zod": ">=3.23.0"
92
92
  },
93
93
  "peerDependenciesMeta": {
@@ -105,10 +105,10 @@
105
105
  }
106
106
  },
107
107
  "overrides": {
108
- "@langchain/core": "1.1.27",
109
- "@langchain/openai": "1.2.9",
110
- "deepagents": "1.8.0",
111
- "langchain": "1.2.25"
108
+ "@langchain/core": "1.1.31",
109
+ "@langchain/openai": "1.2.12",
110
+ "deepagents": "1.8.1",
111
+ "langchain": "1.2.30"
112
112
  },
113
113
  "engines": {
114
114
  "node": ">=18.0.0"