@easynet/agent-tool 1.0.43 → 1.0.45
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/api/runtimeFromConfig.d.ts +2 -0
- package/dist/api/runtimeFromConfig.d.ts.map +1 -1
- package/dist/{chunk-CTB3RP4C.cjs → chunk-5WY557HJ.cjs} +15 -15
- package/dist/{chunk-CTB3RP4C.cjs.map → chunk-5WY557HJ.cjs.map} +1 -1
- package/dist/{chunk-UFV5ZRAX.js → chunk-CLJCCBXA.js} +3 -3
- package/dist/{chunk-UFV5ZRAX.js.map → chunk-CLJCCBXA.js.map} +1 -1
- package/dist/{chunk-LO5Y3D4O.cjs → chunk-ETXVT6FE.cjs} +9 -9
- package/dist/{chunk-LO5Y3D4O.cjs.map → chunk-ETXVT6FE.cjs.map} +1 -1
- package/dist/{chunk-GVYVTQUB.cjs → chunk-H5SPD2O7.cjs} +7 -7
- package/dist/{chunk-GVYVTQUB.cjs.map → chunk-H5SPD2O7.cjs.map} +1 -1
- package/dist/{chunk-TXZITBLR.js → chunk-JH6TWGP4.js} +9 -8
- package/dist/chunk-JH6TWGP4.js.map +1 -0
- package/dist/{chunk-NE3PKHM7.js → chunk-ONXFQ6K5.js} +3 -3
- package/dist/{chunk-NE3PKHM7.js.map → chunk-ONXFQ6K5.js.map} +1 -1
- package/dist/{chunk-4MAR5XDN.js → chunk-YUA6KJWF.js} +3 -3
- package/dist/{chunk-4MAR5XDN.js.map → chunk-YUA6KJWF.js.map} +1 -1
- package/dist/{chunk-PAXUM4QS.cjs → chunk-YVL3UMM2.cjs} +9 -9
- package/dist/chunk-YVL3UMM2.cjs.map +1 -0
- 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/package.json +1 -1
- package/dist/chunk-PAXUM4QS.cjs.map +0 -1
- package/dist/chunk-TXZITBLR.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk5WY557HJ_cjs = require('./chunk-5WY557HJ.cjs');
|
|
4
|
+
var chunkETXVT6FE_cjs = require('./chunk-ETXVT6FE.cjs');
|
|
5
|
+
var chunkYVL3UMM2_cjs = require('./chunk-YVL3UMM2.cjs');
|
|
6
6
|
var chunkTOSPHMYU_cjs = require('./chunk-TOSPHMYU.cjs');
|
|
7
7
|
var chunkDYDNPIV2_cjs = require('./chunk-DYDNPIV2.cjs');
|
|
8
8
|
require('./chunk-UUNG3GL3.cjs');
|
|
@@ -443,7 +443,7 @@ function generateExtensionManifest(projectRoot = process.cwd(), options = {}) {
|
|
|
443
443
|
const root = path6__default.default.resolve(projectRoot);
|
|
444
444
|
const outDir = path6__default.default.resolve(options.outDir ?? path6__default.default.join(root, "dist"));
|
|
445
445
|
const kind = options.kind ?? "core";
|
|
446
|
-
const { specs, errors } =
|
|
446
|
+
const { specs, errors } = chunkETXVT6FE_cjs.scanForTools({
|
|
447
447
|
projectPath: root,
|
|
448
448
|
include: options.include ?? ["**/*.ts"],
|
|
449
449
|
tsconfigPath: options.tsconfigPath
|
|
@@ -533,7 +533,7 @@ var MCPClientAdapter = class {
|
|
|
533
533
|
constructor(client) {
|
|
534
534
|
this.client = client;
|
|
535
535
|
}
|
|
536
|
-
kind =
|
|
536
|
+
kind = chunkYVL3UMM2_cjs.MCP_KIND;
|
|
537
537
|
async invoke(spec, args, _ctx) {
|
|
538
538
|
const params = args != null && typeof args === "object" && !Array.isArray(args) ? args : {};
|
|
539
539
|
const result = await this.client.callTool({ name: spec.name, arguments: params });
|
|
@@ -574,7 +574,7 @@ function mcpToolsToSpecs(tools) {
|
|
|
574
574
|
return tools.map((t) => ({
|
|
575
575
|
name: t.name,
|
|
576
576
|
version: "1.0.0",
|
|
577
|
-
kind:
|
|
577
|
+
kind: chunkYVL3UMM2_cjs.MCP_KIND,
|
|
578
578
|
description: t.description ?? `MCP tool: ${t.name}`,
|
|
579
579
|
inputSchema: t.inputSchema ?? chunkDYDNPIV2_cjs.DEFAULT_INPUT_SCHEMA,
|
|
580
580
|
outputSchema: chunkDYDNPIV2_cjs.DEFAULT_OUTPUT_SCHEMA,
|
|
@@ -614,8 +614,8 @@ async function registerMCPToolsFromConfig(runtime, registry, options = {}) {
|
|
|
614
614
|
const configPath = options.configPath ?? process.env.MCP_CONFIG_PATH ?? path6.join(process.cwd(), "mcp.json");
|
|
615
615
|
const dirPath = path6.dirname(configPath);
|
|
616
616
|
const entryPoint = path6.basename(configPath);
|
|
617
|
-
const toolName = options.toolName ??
|
|
618
|
-
const loaded = await
|
|
617
|
+
const toolName = options.toolName ?? chunkYVL3UMM2_cjs.MCP_KIND;
|
|
618
|
+
const loaded = await chunkETXVT6FE_cjs.loadMCPTool(dirPath, { kind: chunkYVL3UMM2_cjs.MCP_KIND, name: toolName, entryPoint });
|
|
619
619
|
if (!loaded.mcpConfig) {
|
|
620
620
|
throw new Error("mcp.json must have command or url");
|
|
621
621
|
}
|
|
@@ -631,179 +631,179 @@ async function registerMCPToolsFromConfig(runtime, registry, options = {}) {
|
|
|
631
631
|
|
|
632
632
|
Object.defineProperty(exports, "LangChainToolsHub", {
|
|
633
633
|
enumerable: true,
|
|
634
|
-
get: function () { return
|
|
634
|
+
get: function () { return chunk5WY557HJ_cjs.LangChainToolsHub; }
|
|
635
635
|
});
|
|
636
636
|
Object.defineProperty(exports, "createAgentTools", {
|
|
637
637
|
enumerable: true,
|
|
638
|
-
get: function () { return
|
|
638
|
+
get: function () { return chunk5WY557HJ_cjs.createAgentTools; }
|
|
639
639
|
});
|
|
640
640
|
Object.defineProperty(exports, "DirectoryScanner", {
|
|
641
641
|
enumerable: true,
|
|
642
|
-
get: function () { return
|
|
642
|
+
get: function () { return chunkETXVT6FE_cjs.DirectoryScanner; }
|
|
643
643
|
});
|
|
644
644
|
Object.defineProperty(exports, "DiscoveryError", {
|
|
645
645
|
enumerable: true,
|
|
646
|
-
get: function () { return
|
|
646
|
+
get: function () { return chunkETXVT6FE_cjs.DiscoveryError; }
|
|
647
647
|
});
|
|
648
648
|
Object.defineProperty(exports, "SkillManifestError", {
|
|
649
649
|
enumerable: true,
|
|
650
|
-
get: function () { return
|
|
650
|
+
get: function () { return chunkETXVT6FE_cjs.SkillManifestError; }
|
|
651
651
|
});
|
|
652
652
|
Object.defineProperty(exports, "buildFunctionToTool", {
|
|
653
653
|
enumerable: true,
|
|
654
|
-
get: function () { return
|
|
654
|
+
get: function () { return chunkETXVT6FE_cjs.buildFunctionToTool; }
|
|
655
655
|
});
|
|
656
656
|
Object.defineProperty(exports, "buildMcpPackage", {
|
|
657
657
|
enumerable: true,
|
|
658
|
-
get: function () { return
|
|
658
|
+
get: function () { return chunkETXVT6FE_cjs.buildMcpPackage; }
|
|
659
659
|
});
|
|
660
660
|
Object.defineProperty(exports, "initProject", {
|
|
661
661
|
enumerable: true,
|
|
662
|
-
get: function () { return
|
|
662
|
+
get: function () { return chunkETXVT6FE_cjs.initProject; }
|
|
663
663
|
});
|
|
664
664
|
Object.defineProperty(exports, "loadMCPTool", {
|
|
665
665
|
enumerable: true,
|
|
666
|
-
get: function () { return
|
|
666
|
+
get: function () { return chunkETXVT6FE_cjs.loadMCPTool; }
|
|
667
667
|
});
|
|
668
668
|
Object.defineProperty(exports, "loadSkillDefinition", {
|
|
669
669
|
enumerable: true,
|
|
670
|
-
get: function () { return
|
|
670
|
+
get: function () { return chunkETXVT6FE_cjs.loadSkillDefinition; }
|
|
671
671
|
});
|
|
672
672
|
Object.defineProperty(exports, "parseSkillMd", {
|
|
673
673
|
enumerable: true,
|
|
674
|
-
get: function () { return
|
|
674
|
+
get: function () { return chunkETXVT6FE_cjs.parseSkillMd; }
|
|
675
675
|
});
|
|
676
676
|
Object.defineProperty(exports, "runGeneratedMCP", {
|
|
677
677
|
enumerable: true,
|
|
678
|
-
get: function () { return
|
|
678
|
+
get: function () { return chunkETXVT6FE_cjs.runGeneratedMCP; }
|
|
679
679
|
});
|
|
680
680
|
Object.defineProperty(exports, "runMcpServer", {
|
|
681
681
|
enumerable: true,
|
|
682
|
-
get: function () { return
|
|
682
|
+
get: function () { return chunkETXVT6FE_cjs.runMcpServer; }
|
|
683
683
|
});
|
|
684
684
|
Object.defineProperty(exports, "scan", {
|
|
685
685
|
enumerable: true,
|
|
686
|
-
get: function () { return
|
|
686
|
+
get: function () { return chunkETXVT6FE_cjs.scan; }
|
|
687
687
|
});
|
|
688
688
|
Object.defineProperty(exports, "scanForTools", {
|
|
689
689
|
enumerable: true,
|
|
690
|
-
get: function () { return
|
|
690
|
+
get: function () { return chunkETXVT6FE_cjs.scanForTools; }
|
|
691
691
|
});
|
|
692
692
|
Object.defineProperty(exports, "scanSkillResources", {
|
|
693
693
|
enumerable: true,
|
|
694
|
-
get: function () { return
|
|
694
|
+
get: function () { return chunkETXVT6FE_cjs.scanSkillResources; }
|
|
695
695
|
});
|
|
696
696
|
Object.defineProperty(exports, "validateFrontmatter", {
|
|
697
697
|
enumerable: true,
|
|
698
|
-
get: function () { return
|
|
698
|
+
get: function () { return chunkETXVT6FE_cjs.validateFrontmatter; }
|
|
699
699
|
});
|
|
700
700
|
Object.defineProperty(exports, "BudgetManager", {
|
|
701
701
|
enumerable: true,
|
|
702
|
-
get: function () { return
|
|
702
|
+
get: function () { return chunkYVL3UMM2_cjs.BudgetManager; }
|
|
703
703
|
});
|
|
704
704
|
Object.defineProperty(exports, "EventLog", {
|
|
705
705
|
enumerable: true,
|
|
706
|
-
get: function () { return
|
|
706
|
+
get: function () { return chunkYVL3UMM2_cjs.EventLog; }
|
|
707
707
|
});
|
|
708
708
|
Object.defineProperty(exports, "Metrics", {
|
|
709
709
|
enumerable: true,
|
|
710
|
-
get: function () { return
|
|
710
|
+
get: function () { return chunkYVL3UMM2_cjs.Metrics; }
|
|
711
711
|
});
|
|
712
712
|
Object.defineProperty(exports, "PTCRuntime", {
|
|
713
713
|
enumerable: true,
|
|
714
|
-
get: function () { return
|
|
714
|
+
get: function () { return chunkYVL3UMM2_cjs.PTCRuntime; }
|
|
715
715
|
});
|
|
716
716
|
Object.defineProperty(exports, "PolicyDeniedError", {
|
|
717
717
|
enumerable: true,
|
|
718
|
-
get: function () { return
|
|
718
|
+
get: function () { return chunkYVL3UMM2_cjs.PolicyDeniedError; }
|
|
719
719
|
});
|
|
720
720
|
Object.defineProperty(exports, "PolicyEngine", {
|
|
721
721
|
enumerable: true,
|
|
722
|
-
get: function () { return
|
|
722
|
+
get: function () { return chunkYVL3UMM2_cjs.PolicyEngine; }
|
|
723
723
|
});
|
|
724
724
|
Object.defineProperty(exports, "SchemaValidationError", {
|
|
725
725
|
enumerable: true,
|
|
726
|
-
get: function () { return
|
|
726
|
+
get: function () { return chunkYVL3UMM2_cjs.SchemaValidationError; }
|
|
727
727
|
});
|
|
728
728
|
Object.defineProperty(exports, "SchemaValidator", {
|
|
729
729
|
enumerable: true,
|
|
730
|
-
get: function () { return
|
|
730
|
+
get: function () { return chunkYVL3UMM2_cjs.SchemaValidator; }
|
|
731
731
|
});
|
|
732
732
|
Object.defineProperty(exports, "Tracing", {
|
|
733
733
|
enumerable: true,
|
|
734
|
-
get: function () { return
|
|
734
|
+
get: function () { return chunkYVL3UMM2_cjs.Tracing; }
|
|
735
735
|
});
|
|
736
736
|
Object.defineProperty(exports, "buildEvidence", {
|
|
737
737
|
enumerable: true,
|
|
738
|
-
get: function () { return
|
|
738
|
+
get: function () { return chunkYVL3UMM2_cjs.buildEvidence; }
|
|
739
739
|
});
|
|
740
740
|
Object.defineProperty(exports, "createLogger", {
|
|
741
741
|
enumerable: true,
|
|
742
|
-
get: function () { return
|
|
742
|
+
get: function () { return chunkYVL3UMM2_cjs.createLogger; }
|
|
743
743
|
});
|
|
744
744
|
Object.defineProperty(exports, "ensurePackageInCache", {
|
|
745
745
|
enumerable: true,
|
|
746
|
-
get: function () { return
|
|
746
|
+
get: function () { return chunkYVL3UMM2_cjs.ensurePackageInCache; }
|
|
747
747
|
});
|
|
748
748
|
Object.defineProperty(exports, "expandToolDescriptorsToRegistryNames", {
|
|
749
749
|
enumerable: true,
|
|
750
|
-
get: function () { return
|
|
750
|
+
get: function () { return chunkYVL3UMM2_cjs.expandToolDescriptorsToRegistryNames; }
|
|
751
751
|
});
|
|
752
752
|
Object.defineProperty(exports, "getPackageEntryPath", {
|
|
753
753
|
enumerable: true,
|
|
754
|
-
get: function () { return
|
|
754
|
+
get: function () { return chunkYVL3UMM2_cjs.getPackageEntryPath; }
|
|
755
755
|
});
|
|
756
756
|
Object.defineProperty(exports, "importFromCache", {
|
|
757
757
|
enumerable: true,
|
|
758
|
-
get: function () { return
|
|
758
|
+
get: function () { return chunkYVL3UMM2_cjs.importFromCache; }
|
|
759
759
|
});
|
|
760
760
|
Object.defineProperty(exports, "isNpmToolDescriptor", {
|
|
761
761
|
enumerable: true,
|
|
762
|
-
get: function () { return
|
|
762
|
+
get: function () { return chunkYVL3UMM2_cjs.isNpmToolDescriptor; }
|
|
763
763
|
});
|
|
764
764
|
Object.defineProperty(exports, "loadToolConfig", {
|
|
765
765
|
enumerable: true,
|
|
766
|
-
get: function () { return
|
|
766
|
+
get: function () { return chunkYVL3UMM2_cjs.loadToolConfig; }
|
|
767
767
|
});
|
|
768
768
|
Object.defineProperty(exports, "normalizeToolList", {
|
|
769
769
|
enumerable: true,
|
|
770
|
-
get: function () { return
|
|
770
|
+
get: function () { return chunkYVL3UMM2_cjs.normalizeToolList; }
|
|
771
771
|
});
|
|
772
772
|
Object.defineProperty(exports, "npmDescriptorToRegistryPrefix", {
|
|
773
773
|
enumerable: true,
|
|
774
|
-
get: function () { return
|
|
774
|
+
get: function () { return chunkYVL3UMM2_cjs.npmDescriptorToRegistryPrefix; }
|
|
775
775
|
});
|
|
776
776
|
Object.defineProperty(exports, "parseNpmToolDescriptor", {
|
|
777
777
|
enumerable: true,
|
|
778
|
-
get: function () { return
|
|
778
|
+
get: function () { return chunkYVL3UMM2_cjs.parseNpmToolDescriptor; }
|
|
779
779
|
});
|
|
780
780
|
Object.defineProperty(exports, "resolveLatestVersionFromRegistry", {
|
|
781
781
|
enumerable: true,
|
|
782
|
-
get: function () { return
|
|
782
|
+
get: function () { return chunkYVL3UMM2_cjs.resolveLatestVersionFromRegistry; }
|
|
783
783
|
});
|
|
784
784
|
Object.defineProperty(exports, "resolveNpmToolDescriptor", {
|
|
785
785
|
enumerable: true,
|
|
786
|
-
get: function () { return
|
|
786
|
+
get: function () { return chunkYVL3UMM2_cjs.resolveNpmToolDescriptor; }
|
|
787
787
|
});
|
|
788
788
|
Object.defineProperty(exports, "resolveSandboxedPath", {
|
|
789
789
|
enumerable: true,
|
|
790
|
-
get: function () { return
|
|
790
|
+
get: function () { return chunkYVL3UMM2_cjs.resolveSandboxedPath; }
|
|
791
791
|
});
|
|
792
792
|
Object.defineProperty(exports, "resolveToolDescriptor", {
|
|
793
793
|
enumerable: true,
|
|
794
|
-
get: function () { return
|
|
794
|
+
get: function () { return chunkYVL3UMM2_cjs.resolveToolDescriptor; }
|
|
795
795
|
});
|
|
796
796
|
Object.defineProperty(exports, "sanitizeForLog", {
|
|
797
797
|
enumerable: true,
|
|
798
|
-
get: function () { return
|
|
798
|
+
get: function () { return chunkYVL3UMM2_cjs.sanitizeForLog; }
|
|
799
799
|
});
|
|
800
800
|
Object.defineProperty(exports, "setSandboxValidationEnabled", {
|
|
801
801
|
enumerable: true,
|
|
802
|
-
get: function () { return
|
|
802
|
+
get: function () { return chunkYVL3UMM2_cjs.setSandboxValidationEnabled; }
|
|
803
803
|
});
|
|
804
804
|
Object.defineProperty(exports, "summarizeForLog", {
|
|
805
805
|
enumerable: true,
|
|
806
|
-
get: function () { return
|
|
806
|
+
get: function () { return chunkYVL3UMM2_cjs.summarizeForLog; }
|
|
807
807
|
});
|
|
808
808
|
Object.defineProperty(exports, "ToolRegistry", {
|
|
809
809
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { LangChainToolsHub, createAgentTools } from './chunk-
|
|
2
|
-
import { scanForTools, loadMCPTool } from './chunk-
|
|
3
|
-
export { DirectoryScanner, DiscoveryError, SkillManifestError, buildFunctionToTool, buildMcpPackage, initProject, loadMCPTool, loadSkillDefinition, parseSkillMd, runGeneratedMCP, runMcpServer, scan, scanForTools, scanSkillResources, validateFrontmatter } from './chunk-
|
|
4
|
-
import { MCP_KIND } from './chunk-
|
|
5
|
-
export { BudgetManager, EventLog, Metrics, PTCRuntime, PolicyDeniedError, PolicyEngine, SchemaValidationError, SchemaValidator, Tracing, buildEvidence, createLogger, ensurePackageInCache, expandToolDescriptorsToRegistryNames, getPackageEntryPath, importFromCache, isNpmToolDescriptor, loadToolConfig, normalizeToolList, npmDescriptorToRegistryPrefix, parseNpmToolDescriptor, resolveLatestVersionFromRegistry, resolveNpmToolDescriptor, resolveSandboxedPath, resolveToolDescriptor, sanitizeForLog, setSandboxValidationEnabled, summarizeForLog } from './chunk-
|
|
1
|
+
export { LangChainToolsHub, createAgentTools } from './chunk-YUA6KJWF.js';
|
|
2
|
+
import { scanForTools, loadMCPTool } from './chunk-ONXFQ6K5.js';
|
|
3
|
+
export { DirectoryScanner, DiscoveryError, SkillManifestError, buildFunctionToTool, buildMcpPackage, initProject, loadMCPTool, loadSkillDefinition, parseSkillMd, runGeneratedMCP, runMcpServer, scan, scanForTools, scanSkillResources, validateFrontmatter } from './chunk-ONXFQ6K5.js';
|
|
4
|
+
import { MCP_KIND } from './chunk-JH6TWGP4.js';
|
|
5
|
+
export { BudgetManager, EventLog, Metrics, PTCRuntime, PolicyDeniedError, PolicyEngine, SchemaValidationError, SchemaValidator, Tracing, buildEvidence, createLogger, ensurePackageInCache, expandToolDescriptorsToRegistryNames, getPackageEntryPath, importFromCache, isNpmToolDescriptor, loadToolConfig, normalizeToolList, npmDescriptorToRegistryPrefix, parseNpmToolDescriptor, resolveLatestVersionFromRegistry, resolveNpmToolDescriptor, resolveSandboxedPath, resolveToolDescriptor, sanitizeForLog, setSandboxValidationEnabled, summarizeForLog } from './chunk-JH6TWGP4.js';
|
|
6
6
|
import { createTaggedError } from './chunk-ZRHPGW7W.js';
|
|
7
7
|
export { ToolRegistry, createTaggedError, isRetryable, withRetry } from './chunk-ZRHPGW7W.js';
|
|
8
8
|
import { createToolSpec, DEFAULT_OUTPUT_SCHEMA, DEFAULT_INPUT_SCHEMA } from './chunk-KDB3MY2H.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolConfig.d.ts","sourceRoot":"","sources":["../../../src/tools/util/toolConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"toolConfig.d.ts","sourceRoot":"","sources":["../../../src/tools/util/toolConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,yGAAyG;AACzG,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,2GAA2G;IAC3G,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,yFAAyF;IACzF,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,gGAAgG;IAChG,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,gLAAgL;IAChL,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,iLAAiL;IACjL,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/H;AA8BD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CA2DlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAKxF;AAED,oEAAoE;AACpE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKnF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAU1F"}
|
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 chunkETXVT6FE_cjs = require('../../chunk-ETXVT6FE.cjs');
|
|
5
|
+
var chunkH5SPD2O7_cjs = require('../../chunk-H5SPD2O7.cjs');
|
|
6
|
+
var chunkYVL3UMM2_cjs = require('../../chunk-YVL3UMM2.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 = chunkYVL3UMM2_cjs.findAndLoadToolConfig(searchDir);
|
|
208
208
|
let sandboxRoot = cwd;
|
|
209
209
|
if (config.sandboxedPath && typeof config.sandboxedPath === "string" && config.configPath) {
|
|
210
|
-
sandboxRoot =
|
|
210
|
+
sandboxRoot = chunkYVL3UMM2_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 chunkYVL3UMM2_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 chunkETXVT6FE_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 chunkETXVT6FE_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 chunkETXVT6FE_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 = chunkYVL3UMM2_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 = chunkYVL3UMM2_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 = chunkYVL3UMM2_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 = chunkYVL3UMM2_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 = chunkYVL3UMM2_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 chunkH5SPD2O7_cjs.runMCPServerOverStdio(runtime);
|
|
600
600
|
return 0;
|
|
601
601
|
}
|
|
602
|
-
const streamable = await
|
|
602
|
+
const streamable = await chunkH5SPD2O7_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 chunkH5SPD2O7_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-ONXFQ6K5.js';
|
|
3
|
+
import { runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService } from '../../chunk-CLJCCBXA.js';
|
|
4
|
+
import { findAndLoadToolConfig, resolveToolDescriptor, resolveSandboxedPath2, createRuntimeFromConfig, getDisplayScope } from '../../chunk-JH6TWGP4.js';
|
|
5
5
|
import '../../chunk-ZRHPGW7W.js';
|
|
6
6
|
import '../../chunk-KDB3MY2H.js';
|
|
7
7
|
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.45",
|
|
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",
|