@easynet/agent-tool 1.0.35 → 1.0.36

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.
Files changed (43) hide show
  1. package/dist/api/expose/extension-init/index.d.ts +3 -0
  2. package/dist/api/expose/extension-init/index.d.ts.map +1 -0
  3. package/dist/api/expose/extension-init/initExtension.d.ts +19 -0
  4. package/dist/api/expose/extension-init/initExtension.d.ts.map +1 -0
  5. package/dist/api/extension/index.d.ts +1 -0
  6. package/dist/api/extension/index.d.ts.map +1 -1
  7. package/dist/api/extension/overrideWithConfig.d.ts +6 -0
  8. package/dist/api/extension/overrideWithConfig.d.ts.map +1 -0
  9. package/dist/api/main.cjs +14 -14
  10. package/dist/api/main.js +3 -3
  11. package/dist/{chunk-DDIGAOYI.js → chunk-3L7CQ6XP.js} +3 -3
  12. package/dist/{chunk-DDIGAOYI.js.map → chunk-3L7CQ6XP.js.map} +1 -1
  13. package/dist/{chunk-P25NBSPT.cjs → chunk-5LCB63L7.cjs} +7 -7
  14. package/dist/{chunk-P25NBSPT.cjs.map → chunk-5LCB63L7.cjs.map} +1 -1
  15. package/dist/{chunk-S27O27OH.cjs → chunk-6ZGMI6KW.cjs} +15 -15
  16. package/dist/{chunk-S27O27OH.cjs.map → chunk-6ZGMI6KW.cjs.map} +1 -1
  17. package/dist/{chunk-PSVSVTHY.js → chunk-7VBJ64YC.js} +69 -7
  18. package/dist/chunk-7VBJ64YC.js.map +1 -0
  19. package/dist/{chunk-U3CAAURW.js → chunk-HEMWFWSK.js} +3 -3
  20. package/dist/{chunk-U3CAAURW.js.map → chunk-HEMWFWSK.js.map} +1 -1
  21. package/dist/{chunk-RRVM6JBA.js → chunk-JG5T3ZYC.js} +3 -3
  22. package/dist/{chunk-RRVM6JBA.js.map → chunk-JG5T3ZYC.js.map} +1 -1
  23. package/dist/{chunk-2WDDJYR7.cjs → chunk-LP7KHBA3.cjs} +70 -8
  24. package/dist/chunk-LP7KHBA3.cjs.map +1 -0
  25. package/dist/{chunk-Z5STQ2JO.cjs → chunk-WFRHBW32.cjs} +9 -9
  26. package/dist/{chunk-Z5STQ2JO.cjs.map → chunk-WFRHBW32.cjs.map} +1 -1
  27. package/dist/index.cjs +63 -50
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +18 -6
  32. package/dist/index.js.map +1 -1
  33. package/dist/tools/util/toolDescriptor.d.ts +3 -2
  34. package/dist/tools/util/toolDescriptor.d.ts.map +1 -1
  35. package/dist/utils/cli/index.cjs +233 -31
  36. package/dist/utils/cli/index.cjs.map +1 -1
  37. package/dist/utils/cli/index.d.ts.map +1 -1
  38. package/dist/utils/cli/index.js +201 -15
  39. package/dist/utils/cli/index.js.map +1 -1
  40. package/dist/utils/npmCache.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/dist/chunk-2WDDJYR7.cjs.map +0 -1
  43. package/dist/chunk-PSVSVTHY.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkS27O27OH_cjs = require('./chunk-S27O27OH.cjs');
4
- var chunkZ5STQ2JO_cjs = require('./chunk-Z5STQ2JO.cjs');
5
- var chunk2WDDJYR7_cjs = require('./chunk-2WDDJYR7.cjs');
3
+ var chunk6ZGMI6KW_cjs = require('./chunk-6ZGMI6KW.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
7
  require('./chunk-4KTWJQ32.cjs');
8
8
  var chunkDYDNPIV2_cjs = require('./chunk-DYDNPIV2.cjs');
@@ -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 } = chunkZ5STQ2JO_cjs.scanForTools({
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 = chunk2WDDJYR7_cjs.MCP_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: chunk2WDDJYR7_cjs.MCP_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 ?? chunk2WDDJYR7_cjs.MCP_KIND;
644
- const loaded = await chunkZ5STQ2JO_cjs.loadMCPTool(dirPath, { kind: chunk2WDDJYR7_cjs.MCP_KIND, name: toolName, entryPoint });
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 chunkS27O27OH_cjs.LangChainToolsHub; }
672
+ get: function () { return chunk6ZGMI6KW_cjs.LangChainToolsHub; }
661
673
  });
662
674
  Object.defineProperty(exports, "createAgentTools", {
663
675
  enumerable: true,
664
- get: function () { return chunkS27O27OH_cjs.createAgentTools; }
676
+ get: function () { return chunk6ZGMI6KW_cjs.createAgentTools; }
665
677
  });
666
678
  Object.defineProperty(exports, "DirectoryScanner", {
667
679
  enumerable: true,
668
- get: function () { return chunkZ5STQ2JO_cjs.DirectoryScanner; }
680
+ get: function () { return chunkWFRHBW32_cjs.DirectoryScanner; }
669
681
  });
670
682
  Object.defineProperty(exports, "DiscoveryError", {
671
683
  enumerable: true,
672
- get: function () { return chunkZ5STQ2JO_cjs.DiscoveryError; }
684
+ get: function () { return chunkWFRHBW32_cjs.DiscoveryError; }
673
685
  });
674
686
  Object.defineProperty(exports, "SkillManifestError", {
675
687
  enumerable: true,
676
- get: function () { return chunkZ5STQ2JO_cjs.SkillManifestError; }
688
+ get: function () { return chunkWFRHBW32_cjs.SkillManifestError; }
677
689
  });
678
690
  Object.defineProperty(exports, "buildFunctionToTool", {
679
691
  enumerable: true,
680
- get: function () { return chunkZ5STQ2JO_cjs.buildFunctionToTool; }
692
+ get: function () { return chunkWFRHBW32_cjs.buildFunctionToTool; }
681
693
  });
682
694
  Object.defineProperty(exports, "buildMcpPackage", {
683
695
  enumerable: true,
684
- get: function () { return chunkZ5STQ2JO_cjs.buildMcpPackage; }
696
+ get: function () { return chunkWFRHBW32_cjs.buildMcpPackage; }
685
697
  });
686
698
  Object.defineProperty(exports, "initProject", {
687
699
  enumerable: true,
688
- get: function () { return chunkZ5STQ2JO_cjs.initProject; }
700
+ get: function () { return chunkWFRHBW32_cjs.initProject; }
689
701
  });
690
702
  Object.defineProperty(exports, "loadMCPTool", {
691
703
  enumerable: true,
692
- get: function () { return chunkZ5STQ2JO_cjs.loadMCPTool; }
704
+ get: function () { return chunkWFRHBW32_cjs.loadMCPTool; }
693
705
  });
694
706
  Object.defineProperty(exports, "loadSkillDefinition", {
695
707
  enumerable: true,
696
- get: function () { return chunkZ5STQ2JO_cjs.loadSkillDefinition; }
708
+ get: function () { return chunkWFRHBW32_cjs.loadSkillDefinition; }
697
709
  });
698
710
  Object.defineProperty(exports, "parseSkillMd", {
699
711
  enumerable: true,
700
- get: function () { return chunkZ5STQ2JO_cjs.parseSkillMd; }
712
+ get: function () { return chunkWFRHBW32_cjs.parseSkillMd; }
701
713
  });
702
714
  Object.defineProperty(exports, "runGeneratedMCP", {
703
715
  enumerable: true,
704
- get: function () { return chunkZ5STQ2JO_cjs.runGeneratedMCP; }
716
+ get: function () { return chunkWFRHBW32_cjs.runGeneratedMCP; }
705
717
  });
706
718
  Object.defineProperty(exports, "runMcpServer", {
707
719
  enumerable: true,
708
- get: function () { return chunkZ5STQ2JO_cjs.runMcpServer; }
720
+ get: function () { return chunkWFRHBW32_cjs.runMcpServer; }
709
721
  });
710
722
  Object.defineProperty(exports, "scan", {
711
723
  enumerable: true,
712
- get: function () { return chunkZ5STQ2JO_cjs.scan; }
724
+ get: function () { return chunkWFRHBW32_cjs.scan; }
713
725
  });
714
726
  Object.defineProperty(exports, "scanForTools", {
715
727
  enumerable: true,
716
- get: function () { return chunkZ5STQ2JO_cjs.scanForTools; }
728
+ get: function () { return chunkWFRHBW32_cjs.scanForTools; }
717
729
  });
718
730
  Object.defineProperty(exports, "scanSkillResources", {
719
731
  enumerable: true,
720
- get: function () { return chunkZ5STQ2JO_cjs.scanSkillResources; }
732
+ get: function () { return chunkWFRHBW32_cjs.scanSkillResources; }
721
733
  });
722
734
  Object.defineProperty(exports, "validateFrontmatter", {
723
735
  enumerable: true,
724
- get: function () { return chunkZ5STQ2JO_cjs.validateFrontmatter; }
736
+ get: function () { return chunkWFRHBW32_cjs.validateFrontmatter; }
725
737
  });
726
738
  Object.defineProperty(exports, "BudgetManager", {
727
739
  enumerable: true,
728
- get: function () { return chunk2WDDJYR7_cjs.BudgetManager; }
740
+ get: function () { return chunkLP7KHBA3_cjs.BudgetManager; }
729
741
  });
730
742
  Object.defineProperty(exports, "EventLog", {
731
743
  enumerable: true,
732
- get: function () { return chunk2WDDJYR7_cjs.EventLog; }
744
+ get: function () { return chunkLP7KHBA3_cjs.EventLog; }
733
745
  });
734
746
  Object.defineProperty(exports, "Metrics", {
735
747
  enumerable: true,
736
- get: function () { return chunk2WDDJYR7_cjs.Metrics; }
748
+ get: function () { return chunkLP7KHBA3_cjs.Metrics; }
737
749
  });
738
750
  Object.defineProperty(exports, "PTCRuntime", {
739
751
  enumerable: true,
740
- get: function () { return chunk2WDDJYR7_cjs.PTCRuntime; }
752
+ get: function () { return chunkLP7KHBA3_cjs.PTCRuntime; }
741
753
  });
742
754
  Object.defineProperty(exports, "PolicyDeniedError", {
743
755
  enumerable: true,
744
- get: function () { return chunk2WDDJYR7_cjs.PolicyDeniedError; }
756
+ get: function () { return chunkLP7KHBA3_cjs.PolicyDeniedError; }
745
757
  });
746
758
  Object.defineProperty(exports, "PolicyEngine", {
747
759
  enumerable: true,
748
- get: function () { return chunk2WDDJYR7_cjs.PolicyEngine; }
760
+ get: function () { return chunkLP7KHBA3_cjs.PolicyEngine; }
749
761
  });
750
762
  Object.defineProperty(exports, "SchemaValidationError", {
751
763
  enumerable: true,
752
- get: function () { return chunk2WDDJYR7_cjs.SchemaValidationError; }
764
+ get: function () { return chunkLP7KHBA3_cjs.SchemaValidationError; }
753
765
  });
754
766
  Object.defineProperty(exports, "SchemaValidator", {
755
767
  enumerable: true,
756
- get: function () { return chunk2WDDJYR7_cjs.SchemaValidator; }
768
+ get: function () { return chunkLP7KHBA3_cjs.SchemaValidator; }
757
769
  });
758
770
  Object.defineProperty(exports, "Tracing", {
759
771
  enumerable: true,
760
- get: function () { return chunk2WDDJYR7_cjs.Tracing; }
772
+ get: function () { return chunkLP7KHBA3_cjs.Tracing; }
761
773
  });
762
774
  Object.defineProperty(exports, "buildEvidence", {
763
775
  enumerable: true,
764
- get: function () { return chunk2WDDJYR7_cjs.buildEvidence; }
776
+ get: function () { return chunkLP7KHBA3_cjs.buildEvidence; }
765
777
  });
766
778
  Object.defineProperty(exports, "createLogger", {
767
779
  enumerable: true,
768
- get: function () { return chunk2WDDJYR7_cjs.createLogger; }
780
+ get: function () { return chunkLP7KHBA3_cjs.createLogger; }
769
781
  });
770
782
  Object.defineProperty(exports, "ensurePackageInCache", {
771
783
  enumerable: true,
772
- get: function () { return chunk2WDDJYR7_cjs.ensurePackageInCache; }
784
+ get: function () { return chunkLP7KHBA3_cjs.ensurePackageInCache; }
773
785
  });
774
786
  Object.defineProperty(exports, "expandToolDescriptorsToRegistryNames", {
775
787
  enumerable: true,
776
- get: function () { return chunk2WDDJYR7_cjs.expandToolDescriptorsToRegistryNames; }
788
+ get: function () { return chunkLP7KHBA3_cjs.expandToolDescriptorsToRegistryNames; }
777
789
  });
778
790
  Object.defineProperty(exports, "getPackageEntryPath", {
779
791
  enumerable: true,
780
- get: function () { return chunk2WDDJYR7_cjs.getPackageEntryPath; }
792
+ get: function () { return chunkLP7KHBA3_cjs.getPackageEntryPath; }
781
793
  });
782
794
  Object.defineProperty(exports, "importFromCache", {
783
795
  enumerable: true,
784
- get: function () { return chunk2WDDJYR7_cjs.importFromCache; }
796
+ get: function () { return chunkLP7KHBA3_cjs.importFromCache; }
785
797
  });
786
798
  Object.defineProperty(exports, "isNpmToolDescriptor", {
787
799
  enumerable: true,
788
- get: function () { return chunk2WDDJYR7_cjs.isNpmToolDescriptor; }
800
+ get: function () { return chunkLP7KHBA3_cjs.isNpmToolDescriptor; }
789
801
  });
790
802
  Object.defineProperty(exports, "loadToolConfig", {
791
803
  enumerable: true,
792
- get: function () { return chunk2WDDJYR7_cjs.loadToolConfig; }
804
+ get: function () { return chunkLP7KHBA3_cjs.loadToolConfig; }
793
805
  });
794
806
  Object.defineProperty(exports, "normalizeToolList", {
795
807
  enumerable: true,
796
- get: function () { return chunk2WDDJYR7_cjs.normalizeToolList; }
808
+ get: function () { return chunkLP7KHBA3_cjs.normalizeToolList; }
797
809
  });
798
810
  Object.defineProperty(exports, "npmDescriptorToRegistryPrefix", {
799
811
  enumerable: true,
800
- get: function () { return chunk2WDDJYR7_cjs.npmDescriptorToRegistryPrefix; }
812
+ get: function () { return chunkLP7KHBA3_cjs.npmDescriptorToRegistryPrefix; }
801
813
  });
802
814
  Object.defineProperty(exports, "parseNpmToolDescriptor", {
803
815
  enumerable: true,
804
- get: function () { return chunk2WDDJYR7_cjs.parseNpmToolDescriptor; }
816
+ get: function () { return chunkLP7KHBA3_cjs.parseNpmToolDescriptor; }
805
817
  });
806
818
  Object.defineProperty(exports, "resolveLatestVersionFromRegistry", {
807
819
  enumerable: true,
808
- get: function () { return chunk2WDDJYR7_cjs.resolveLatestVersionFromRegistry; }
820
+ get: function () { return chunkLP7KHBA3_cjs.resolveLatestVersionFromRegistry; }
809
821
  });
810
822
  Object.defineProperty(exports, "resolveNpmToolDescriptor", {
811
823
  enumerable: true,
812
- get: function () { return chunk2WDDJYR7_cjs.resolveNpmToolDescriptor; }
824
+ get: function () { return chunkLP7KHBA3_cjs.resolveNpmToolDescriptor; }
813
825
  });
814
826
  Object.defineProperty(exports, "resolveToolDescriptor", {
815
827
  enumerable: true,
816
- get: function () { return chunk2WDDJYR7_cjs.resolveToolDescriptor; }
828
+ get: function () { return chunkLP7KHBA3_cjs.resolveToolDescriptor; }
817
829
  });
818
830
  Object.defineProperty(exports, "sanitizeForLog", {
819
831
  enumerable: true,
820
- get: function () { return chunk2WDDJYR7_cjs.sanitizeForLog; }
832
+ get: function () { return chunkLP7KHBA3_cjs.sanitizeForLog; }
821
833
  });
822
834
  Object.defineProperty(exports, "summarizeForLog", {
823
835
  enumerable: true,
824
- get: function () { return chunk2WDDJYR7_cjs.summarizeForLog; }
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;