@easynet/agent-tool 1.0.35 → 1.0.37
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/extension-init/index.d.ts +3 -0
- package/dist/api/expose/extension-init/index.d.ts.map +1 -0
- package/dist/api/expose/extension-init/initExtension.d.ts +19 -0
- package/dist/api/expose/extension-init/initExtension.d.ts.map +1 -0
- package/dist/api/extension/index.d.ts +1 -0
- package/dist/api/extension/index.d.ts.map +1 -1
- package/dist/api/extension/overrideWithConfig.d.ts +6 -0
- package/dist/api/extension/overrideWithConfig.d.ts.map +1 -0
- package/dist/api/main.cjs +15 -15
- package/dist/api/main.js +4 -4
- package/dist/canonicalCoreSchemas-PHGTNPN5.js +3 -0
- package/dist/{canonicalCoreSchemas-3BZJH6XD.js.map → canonicalCoreSchemas-PHGTNPN5.js.map} +1 -1
- package/dist/canonicalCoreSchemas-TY7NCWCC.cjs +16 -0
- package/dist/{canonicalCoreSchemas-P6KUD3WP.cjs.map → canonicalCoreSchemas-TY7NCWCC.cjs.map} +1 -1
- package/dist/{chunk-S27O27OH.cjs → chunk-4HPV2K7P.cjs} +17 -17
- package/dist/{chunk-S27O27OH.cjs.map → chunk-4HPV2K7P.cjs.map} +1 -1
- package/dist/{chunk-PSVSVTHY.js → chunk-7VBJ64YC.js} +69 -7
- package/dist/chunk-7VBJ64YC.js.map +1 -0
- package/dist/{chunk-P25NBSPT.cjs → chunk-DTWOUO7M.cjs} +10 -10
- package/dist/{chunk-P25NBSPT.cjs.map → chunk-DTWOUO7M.cjs.map} +1 -1
- package/dist/{chunk-U3CAAURW.js → chunk-HEMWFWSK.js} +3 -3
- package/dist/{chunk-U3CAAURW.js.map → chunk-HEMWFWSK.js.map} +1 -1
- package/dist/{chunk-2WDDJYR7.cjs → chunk-LP7KHBA3.cjs} +70 -8
- package/dist/chunk-LP7KHBA3.cjs.map +1 -0
- package/dist/{chunk-RRVM6JBA.js → chunk-NCPOKCX5.js} +4 -4
- package/dist/{chunk-RRVM6JBA.js.map → chunk-NCPOKCX5.js.map} +1 -1
- package/dist/{chunk-DDIGAOYI.js → chunk-NJ46JOBI.js} +5 -5
- package/dist/{chunk-DDIGAOYI.js.map → chunk-NJ46JOBI.js.map} +1 -1
- package/dist/chunk-NTWOVFEY.js +16 -0
- package/dist/chunk-NTWOVFEY.js.map +1 -0
- package/dist/chunk-UUNG3GL3.cjs +19 -0
- package/dist/chunk-UUNG3GL3.cjs.map +1 -0
- package/dist/{chunk-Z5STQ2JO.cjs → chunk-WFRHBW32.cjs} +9 -9
- package/dist/{chunk-Z5STQ2JO.cjs.map → chunk-WFRHBW32.cjs.map} +1 -1
- package/dist/index.cjs +64 -51
- 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 +19 -7
- package/dist/index.js.map +1 -1
- package/dist/tools/util/canonicalCoreSchemas.d.ts +6 -10
- package/dist/tools/util/canonicalCoreSchemas.d.ts.map +1 -1
- package/dist/tools/util/toolDescriptor.d.ts +3 -2
- package/dist/tools/util/toolDescriptor.d.ts.map +1 -1
- package/dist/utils/cli/index.cjs +235 -33
- package/dist/utils/cli/index.cjs.map +1 -1
- package/dist/utils/cli/index.d.ts.map +1 -1
- package/dist/utils/cli/index.js +202 -16
- package/dist/utils/cli/index.js.map +1 -1
- package/dist/utils/npmCache.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/canonicalCoreSchemas-3BZJH6XD.js +0 -4
- package/dist/canonicalCoreSchemas-P6KUD3WP.cjs +0 -21
- package/dist/chunk-2WDDJYR7.cjs.map +0 -1
- package/dist/chunk-3MUOBLNB.js +0 -243
- package/dist/chunk-3MUOBLNB.js.map +0 -1
- package/dist/chunk-4KTWJQ32.cjs +0 -247
- package/dist/chunk-4KTWJQ32.cjs.map +0 -1
- package/dist/chunk-PSVSVTHY.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk4HPV2K7P_cjs = require('./chunk-4HPV2K7P.cjs');
|
|
4
|
+
var chunkWFRHBW32_cjs = require('./chunk-WFRHBW32.cjs');
|
|
5
|
+
var chunkLP7KHBA3_cjs = require('./chunk-LP7KHBA3.cjs');
|
|
6
6
|
var chunkTOSPHMYU_cjs = require('./chunk-TOSPHMYU.cjs');
|
|
7
|
-
require('./chunk-4KTWJQ32.cjs');
|
|
8
7
|
var chunkDYDNPIV2_cjs = require('./chunk-DYDNPIV2.cjs');
|
|
8
|
+
require('./chunk-UUNG3GL3.cjs');
|
|
9
9
|
var promises = require('dns/promises');
|
|
10
10
|
var path6 = require('path');
|
|
11
11
|
var promises$1 = require('fs/promises');
|
|
@@ -481,7 +481,7 @@ function generateExtensionManifest(projectRoot = process.cwd(), options = {}) {
|
|
|
481
481
|
const root = path6__default.default.resolve(projectRoot);
|
|
482
482
|
const outDir = path6__default.default.resolve(options.outDir ?? path6__default.default.join(root, "dist"));
|
|
483
483
|
const kind = options.kind ?? "core";
|
|
484
|
-
const { specs, errors } =
|
|
484
|
+
const { specs, errors } = chunkWFRHBW32_cjs.scanForTools({
|
|
485
485
|
projectPath: root,
|
|
486
486
|
include: options.include ?? ["**/*.ts"],
|
|
487
487
|
tsconfigPath: options.tsconfigPath
|
|
@@ -535,6 +535,18 @@ function generateManifest(projectRoot = process.cwd(), options = {}) {
|
|
|
535
535
|
if (toolYamlCopied > 0) console.log(`Copied ${toolYamlCopied} .tool.yaml/.example.yaml file(s) to dist`);
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
+
// src/api/extension/overrideWithConfig.ts
|
|
539
|
+
function overrideWithConfig(defaults, config) {
|
|
540
|
+
const c = config != null && typeof config === "object" && !Array.isArray(config) ? config : {};
|
|
541
|
+
const out = { ...defaults };
|
|
542
|
+
for (const key of Object.keys(defaults)) {
|
|
543
|
+
if (key in c && c[key] !== void 0) {
|
|
544
|
+
out[key] = c[key];
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
return out;
|
|
548
|
+
}
|
|
549
|
+
|
|
538
550
|
// src/api/extension/groupPrefix.ts
|
|
539
551
|
function getGroupNamePrefixes(options) {
|
|
540
552
|
const { groups, only, groupPrefixMap } = options;
|
|
@@ -559,7 +571,7 @@ var MCPClientAdapter = class {
|
|
|
559
571
|
constructor(client) {
|
|
560
572
|
this.client = client;
|
|
561
573
|
}
|
|
562
|
-
kind =
|
|
574
|
+
kind = chunkLP7KHBA3_cjs.MCP_KIND;
|
|
563
575
|
async invoke(spec, args, _ctx) {
|
|
564
576
|
const params = args != null && typeof args === "object" && !Array.isArray(args) ? args : {};
|
|
565
577
|
const result = await this.client.callTool({ name: spec.name, arguments: params });
|
|
@@ -600,7 +612,7 @@ function mcpToolsToSpecs(tools) {
|
|
|
600
612
|
return tools.map((t) => ({
|
|
601
613
|
name: t.name,
|
|
602
614
|
version: "1.0.0",
|
|
603
|
-
kind:
|
|
615
|
+
kind: chunkLP7KHBA3_cjs.MCP_KIND,
|
|
604
616
|
description: t.description ?? `MCP tool: ${t.name}`,
|
|
605
617
|
inputSchema: t.inputSchema ?? chunkDYDNPIV2_cjs.DEFAULT_INPUT_SCHEMA,
|
|
606
618
|
outputSchema: chunkDYDNPIV2_cjs.DEFAULT_OUTPUT_SCHEMA,
|
|
@@ -640,8 +652,8 @@ async function registerMCPToolsFromConfig(runtime, registry, options = {}) {
|
|
|
640
652
|
const configPath = options.configPath ?? process.env.MCP_CONFIG_PATH ?? path6.join(process.cwd(), "mcp.json");
|
|
641
653
|
const dirPath = path6.dirname(configPath);
|
|
642
654
|
const entryPoint = path6.basename(configPath);
|
|
643
|
-
const toolName = options.toolName ??
|
|
644
|
-
const loaded = await
|
|
655
|
+
const toolName = options.toolName ?? chunkLP7KHBA3_cjs.MCP_KIND;
|
|
656
|
+
const loaded = await chunkWFRHBW32_cjs.loadMCPTool(dirPath, { kind: chunkLP7KHBA3_cjs.MCP_KIND, name: toolName, entryPoint });
|
|
645
657
|
if (!loaded.mcpConfig) {
|
|
646
658
|
throw new Error("mcp.json must have command or url");
|
|
647
659
|
}
|
|
@@ -657,171 +669,171 @@ async function registerMCPToolsFromConfig(runtime, registry, options = {}) {
|
|
|
657
669
|
|
|
658
670
|
Object.defineProperty(exports, "LangChainToolsHub", {
|
|
659
671
|
enumerable: true,
|
|
660
|
-
get: function () { return
|
|
672
|
+
get: function () { return chunk4HPV2K7P_cjs.LangChainToolsHub; }
|
|
661
673
|
});
|
|
662
674
|
Object.defineProperty(exports, "createAgentTools", {
|
|
663
675
|
enumerable: true,
|
|
664
|
-
get: function () { return
|
|
676
|
+
get: function () { return chunk4HPV2K7P_cjs.createAgentTools; }
|
|
665
677
|
});
|
|
666
678
|
Object.defineProperty(exports, "DirectoryScanner", {
|
|
667
679
|
enumerable: true,
|
|
668
|
-
get: function () { return
|
|
680
|
+
get: function () { return chunkWFRHBW32_cjs.DirectoryScanner; }
|
|
669
681
|
});
|
|
670
682
|
Object.defineProperty(exports, "DiscoveryError", {
|
|
671
683
|
enumerable: true,
|
|
672
|
-
get: function () { return
|
|
684
|
+
get: function () { return chunkWFRHBW32_cjs.DiscoveryError; }
|
|
673
685
|
});
|
|
674
686
|
Object.defineProperty(exports, "SkillManifestError", {
|
|
675
687
|
enumerable: true,
|
|
676
|
-
get: function () { return
|
|
688
|
+
get: function () { return chunkWFRHBW32_cjs.SkillManifestError; }
|
|
677
689
|
});
|
|
678
690
|
Object.defineProperty(exports, "buildFunctionToTool", {
|
|
679
691
|
enumerable: true,
|
|
680
|
-
get: function () { return
|
|
692
|
+
get: function () { return chunkWFRHBW32_cjs.buildFunctionToTool; }
|
|
681
693
|
});
|
|
682
694
|
Object.defineProperty(exports, "buildMcpPackage", {
|
|
683
695
|
enumerable: true,
|
|
684
|
-
get: function () { return
|
|
696
|
+
get: function () { return chunkWFRHBW32_cjs.buildMcpPackage; }
|
|
685
697
|
});
|
|
686
698
|
Object.defineProperty(exports, "initProject", {
|
|
687
699
|
enumerable: true,
|
|
688
|
-
get: function () { return
|
|
700
|
+
get: function () { return chunkWFRHBW32_cjs.initProject; }
|
|
689
701
|
});
|
|
690
702
|
Object.defineProperty(exports, "loadMCPTool", {
|
|
691
703
|
enumerable: true,
|
|
692
|
-
get: function () { return
|
|
704
|
+
get: function () { return chunkWFRHBW32_cjs.loadMCPTool; }
|
|
693
705
|
});
|
|
694
706
|
Object.defineProperty(exports, "loadSkillDefinition", {
|
|
695
707
|
enumerable: true,
|
|
696
|
-
get: function () { return
|
|
708
|
+
get: function () { return chunkWFRHBW32_cjs.loadSkillDefinition; }
|
|
697
709
|
});
|
|
698
710
|
Object.defineProperty(exports, "parseSkillMd", {
|
|
699
711
|
enumerable: true,
|
|
700
|
-
get: function () { return
|
|
712
|
+
get: function () { return chunkWFRHBW32_cjs.parseSkillMd; }
|
|
701
713
|
});
|
|
702
714
|
Object.defineProperty(exports, "runGeneratedMCP", {
|
|
703
715
|
enumerable: true,
|
|
704
|
-
get: function () { return
|
|
716
|
+
get: function () { return chunkWFRHBW32_cjs.runGeneratedMCP; }
|
|
705
717
|
});
|
|
706
718
|
Object.defineProperty(exports, "runMcpServer", {
|
|
707
719
|
enumerable: true,
|
|
708
|
-
get: function () { return
|
|
720
|
+
get: function () { return chunkWFRHBW32_cjs.runMcpServer; }
|
|
709
721
|
});
|
|
710
722
|
Object.defineProperty(exports, "scan", {
|
|
711
723
|
enumerable: true,
|
|
712
|
-
get: function () { return
|
|
724
|
+
get: function () { return chunkWFRHBW32_cjs.scan; }
|
|
713
725
|
});
|
|
714
726
|
Object.defineProperty(exports, "scanForTools", {
|
|
715
727
|
enumerable: true,
|
|
716
|
-
get: function () { return
|
|
728
|
+
get: function () { return chunkWFRHBW32_cjs.scanForTools; }
|
|
717
729
|
});
|
|
718
730
|
Object.defineProperty(exports, "scanSkillResources", {
|
|
719
731
|
enumerable: true,
|
|
720
|
-
get: function () { return
|
|
732
|
+
get: function () { return chunkWFRHBW32_cjs.scanSkillResources; }
|
|
721
733
|
});
|
|
722
734
|
Object.defineProperty(exports, "validateFrontmatter", {
|
|
723
735
|
enumerable: true,
|
|
724
|
-
get: function () { return
|
|
736
|
+
get: function () { return chunkWFRHBW32_cjs.validateFrontmatter; }
|
|
725
737
|
});
|
|
726
738
|
Object.defineProperty(exports, "BudgetManager", {
|
|
727
739
|
enumerable: true,
|
|
728
|
-
get: function () { return
|
|
740
|
+
get: function () { return chunkLP7KHBA3_cjs.BudgetManager; }
|
|
729
741
|
});
|
|
730
742
|
Object.defineProperty(exports, "EventLog", {
|
|
731
743
|
enumerable: true,
|
|
732
|
-
get: function () { return
|
|
744
|
+
get: function () { return chunkLP7KHBA3_cjs.EventLog; }
|
|
733
745
|
});
|
|
734
746
|
Object.defineProperty(exports, "Metrics", {
|
|
735
747
|
enumerable: true,
|
|
736
|
-
get: function () { return
|
|
748
|
+
get: function () { return chunkLP7KHBA3_cjs.Metrics; }
|
|
737
749
|
});
|
|
738
750
|
Object.defineProperty(exports, "PTCRuntime", {
|
|
739
751
|
enumerable: true,
|
|
740
|
-
get: function () { return
|
|
752
|
+
get: function () { return chunkLP7KHBA3_cjs.PTCRuntime; }
|
|
741
753
|
});
|
|
742
754
|
Object.defineProperty(exports, "PolicyDeniedError", {
|
|
743
755
|
enumerable: true,
|
|
744
|
-
get: function () { return
|
|
756
|
+
get: function () { return chunkLP7KHBA3_cjs.PolicyDeniedError; }
|
|
745
757
|
});
|
|
746
758
|
Object.defineProperty(exports, "PolicyEngine", {
|
|
747
759
|
enumerable: true,
|
|
748
|
-
get: function () { return
|
|
760
|
+
get: function () { return chunkLP7KHBA3_cjs.PolicyEngine; }
|
|
749
761
|
});
|
|
750
762
|
Object.defineProperty(exports, "SchemaValidationError", {
|
|
751
763
|
enumerable: true,
|
|
752
|
-
get: function () { return
|
|
764
|
+
get: function () { return chunkLP7KHBA3_cjs.SchemaValidationError; }
|
|
753
765
|
});
|
|
754
766
|
Object.defineProperty(exports, "SchemaValidator", {
|
|
755
767
|
enumerable: true,
|
|
756
|
-
get: function () { return
|
|
768
|
+
get: function () { return chunkLP7KHBA3_cjs.SchemaValidator; }
|
|
757
769
|
});
|
|
758
770
|
Object.defineProperty(exports, "Tracing", {
|
|
759
771
|
enumerable: true,
|
|
760
|
-
get: function () { return
|
|
772
|
+
get: function () { return chunkLP7KHBA3_cjs.Tracing; }
|
|
761
773
|
});
|
|
762
774
|
Object.defineProperty(exports, "buildEvidence", {
|
|
763
775
|
enumerable: true,
|
|
764
|
-
get: function () { return
|
|
776
|
+
get: function () { return chunkLP7KHBA3_cjs.buildEvidence; }
|
|
765
777
|
});
|
|
766
778
|
Object.defineProperty(exports, "createLogger", {
|
|
767
779
|
enumerable: true,
|
|
768
|
-
get: function () { return
|
|
780
|
+
get: function () { return chunkLP7KHBA3_cjs.createLogger; }
|
|
769
781
|
});
|
|
770
782
|
Object.defineProperty(exports, "ensurePackageInCache", {
|
|
771
783
|
enumerable: true,
|
|
772
|
-
get: function () { return
|
|
784
|
+
get: function () { return chunkLP7KHBA3_cjs.ensurePackageInCache; }
|
|
773
785
|
});
|
|
774
786
|
Object.defineProperty(exports, "expandToolDescriptorsToRegistryNames", {
|
|
775
787
|
enumerable: true,
|
|
776
|
-
get: function () { return
|
|
788
|
+
get: function () { return chunkLP7KHBA3_cjs.expandToolDescriptorsToRegistryNames; }
|
|
777
789
|
});
|
|
778
790
|
Object.defineProperty(exports, "getPackageEntryPath", {
|
|
779
791
|
enumerable: true,
|
|
780
|
-
get: function () { return
|
|
792
|
+
get: function () { return chunkLP7KHBA3_cjs.getPackageEntryPath; }
|
|
781
793
|
});
|
|
782
794
|
Object.defineProperty(exports, "importFromCache", {
|
|
783
795
|
enumerable: true,
|
|
784
|
-
get: function () { return
|
|
796
|
+
get: function () { return chunkLP7KHBA3_cjs.importFromCache; }
|
|
785
797
|
});
|
|
786
798
|
Object.defineProperty(exports, "isNpmToolDescriptor", {
|
|
787
799
|
enumerable: true,
|
|
788
|
-
get: function () { return
|
|
800
|
+
get: function () { return chunkLP7KHBA3_cjs.isNpmToolDescriptor; }
|
|
789
801
|
});
|
|
790
802
|
Object.defineProperty(exports, "loadToolConfig", {
|
|
791
803
|
enumerable: true,
|
|
792
|
-
get: function () { return
|
|
804
|
+
get: function () { return chunkLP7KHBA3_cjs.loadToolConfig; }
|
|
793
805
|
});
|
|
794
806
|
Object.defineProperty(exports, "normalizeToolList", {
|
|
795
807
|
enumerable: true,
|
|
796
|
-
get: function () { return
|
|
808
|
+
get: function () { return chunkLP7KHBA3_cjs.normalizeToolList; }
|
|
797
809
|
});
|
|
798
810
|
Object.defineProperty(exports, "npmDescriptorToRegistryPrefix", {
|
|
799
811
|
enumerable: true,
|
|
800
|
-
get: function () { return
|
|
812
|
+
get: function () { return chunkLP7KHBA3_cjs.npmDescriptorToRegistryPrefix; }
|
|
801
813
|
});
|
|
802
814
|
Object.defineProperty(exports, "parseNpmToolDescriptor", {
|
|
803
815
|
enumerable: true,
|
|
804
|
-
get: function () { return
|
|
816
|
+
get: function () { return chunkLP7KHBA3_cjs.parseNpmToolDescriptor; }
|
|
805
817
|
});
|
|
806
818
|
Object.defineProperty(exports, "resolveLatestVersionFromRegistry", {
|
|
807
819
|
enumerable: true,
|
|
808
|
-
get: function () { return
|
|
820
|
+
get: function () { return chunkLP7KHBA3_cjs.resolveLatestVersionFromRegistry; }
|
|
809
821
|
});
|
|
810
822
|
Object.defineProperty(exports, "resolveNpmToolDescriptor", {
|
|
811
823
|
enumerable: true,
|
|
812
|
-
get: function () { return
|
|
824
|
+
get: function () { return chunkLP7KHBA3_cjs.resolveNpmToolDescriptor; }
|
|
813
825
|
});
|
|
814
826
|
Object.defineProperty(exports, "resolveToolDescriptor", {
|
|
815
827
|
enumerable: true,
|
|
816
|
-
get: function () { return
|
|
828
|
+
get: function () { return chunkLP7KHBA3_cjs.resolveToolDescriptor; }
|
|
817
829
|
});
|
|
818
830
|
Object.defineProperty(exports, "sanitizeForLog", {
|
|
819
831
|
enumerable: true,
|
|
820
|
-
get: function () { return
|
|
832
|
+
get: function () { return chunkLP7KHBA3_cjs.sanitizeForLog; }
|
|
821
833
|
});
|
|
822
834
|
Object.defineProperty(exports, "summarizeForLog", {
|
|
823
835
|
enumerable: true,
|
|
824
|
-
get: function () { return
|
|
836
|
+
get: function () { return chunkLP7KHBA3_cjs.summarizeForLog; }
|
|
825
837
|
});
|
|
826
838
|
Object.defineProperty(exports, "ToolRegistry", {
|
|
827
839
|
enumerable: true,
|
|
@@ -868,6 +880,7 @@ exports.isIpInBlockedCidrs = isIpInBlockedCidrs;
|
|
|
868
880
|
exports.loadExtensionManifest = loadExtensionManifest;
|
|
869
881
|
exports.loadToolYaml = loadToolYaml;
|
|
870
882
|
exports.mcpToolsToSpecs = mcpToolsToSpecs;
|
|
883
|
+
exports.overrideWithConfig = overrideWithConfig;
|
|
871
884
|
exports.registerExtension = registerExtension;
|
|
872
885
|
exports.registerMCPToolsFromConfig = registerMCPToolsFromConfig;
|
|
873
886
|
exports.registerToolsFromManifest = registerToolsFromManifest;
|