@easynet/agent-tool 1.0.0
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/README.md +103 -0
- package/dist/chunk-3YLVPZRJ.cjs +32 -0
- package/dist/chunk-3YLVPZRJ.cjs.map +1 -0
- package/dist/chunk-AXUNV4MK.js +28 -0
- package/dist/chunk-AXUNV4MK.js.map +1 -0
- package/dist/chunk-BM4EVYI5.js +1069 -0
- package/dist/chunk-BM4EVYI5.js.map +1 -0
- package/dist/chunk-P3UEAZHK.cjs +171 -0
- package/dist/chunk-P3UEAZHK.cjs.map +1 -0
- package/dist/chunk-RPAMQCFH.js +167 -0
- package/dist/chunk-RPAMQCFH.js.map +1 -0
- package/dist/chunk-Z7TGIG77.cjs +1108 -0
- package/dist/chunk-Z7TGIG77.cjs.map +1 -0
- package/dist/cli.cjs +154 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +147 -0
- package/dist/cli.js.map +1 -0
- package/dist/codegen/build.d.ts +23 -0
- package/dist/codegen/build.d.ts.map +1 -0
- package/dist/codegen/generator.d.ts +15 -0
- package/dist/codegen/generator.d.ts.map +1 -0
- package/dist/codegen/index.d.ts +21 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/init.d.ts +17 -0
- package/dist/codegen/init.d.ts.map +1 -0
- package/dist/codegen/run.d.ts +19 -0
- package/dist/codegen/run.d.ts.map +1 -0
- package/dist/codegen/scan/scanN8n.d.ts +17 -0
- package/dist/codegen/scan/scanN8n.d.ts.map +1 -0
- package/dist/codegen/scan/scanSkill.d.ts +17 -0
- package/dist/codegen/scan/scanSkill.d.ts.map +1 -0
- package/dist/codegen/scan/scanTools.d.ts +31 -0
- package/dist/codegen/scan/scanTools.d.ts.map +1 -0
- package/dist/codegen/scan/scanner.d.ts +26 -0
- package/dist/codegen/scan/scanner.d.ts.map +1 -0
- package/dist/codegen/scan/schemaFromTs.d.ts +16 -0
- package/dist/codegen/scan/schemaFromTs.d.ts.map +1 -0
- package/dist/codegen/types.d.ts +81 -0
- package/dist/codegen/types.d.ts.map +1 -0
- package/dist/core.cjs +20 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.ts +8 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +3 -0
- package/dist/core.js.map +1 -0
- package/dist/discovery/MCPProcessManager.d.ts +57 -0
- package/dist/discovery/MCPProcessManager.d.ts.map +1 -0
- package/dist/discovery/errors.d.ts +13 -0
- package/dist/discovery/errors.d.ts.map +1 -0
- package/dist/discovery/load/LangChainLoader.d.ts +7 -0
- package/dist/discovery/load/LangChainLoader.d.ts.map +1 -0
- package/dist/discovery/load/MCPLoader.d.ts +8 -0
- package/dist/discovery/load/MCPLoader.d.ts.map +1 -0
- package/dist/discovery/load/N8nLoader.d.ts +25 -0
- package/dist/discovery/load/N8nLoader.d.ts.map +1 -0
- package/dist/discovery/load/SkillLoader.d.ts +20 -0
- package/dist/discovery/load/SkillLoader.d.ts.map +1 -0
- package/dist/discovery/load/SkillManifest.d.ts +79 -0
- package/dist/discovery/load/SkillManifest.d.ts.map +1 -0
- package/dist/discovery/load/SkillMdParser.d.ts +31 -0
- package/dist/discovery/load/SkillMdParser.d.ts.map +1 -0
- package/dist/discovery/load/index.d.ts +6 -0
- package/dist/discovery/load/index.d.ts.map +1 -0
- package/dist/discovery/load/resolveEntry.d.ts +7 -0
- package/dist/discovery/load/resolveEntry.d.ts.map +1 -0
- package/dist/discovery/scan/DirectoryScanner.d.ts +37 -0
- package/dist/discovery/scan/DirectoryScanner.d.ts.map +1 -0
- package/dist/discovery/scan/scanUtil.d.ts +16 -0
- package/dist/discovery/scan/scanUtil.d.ts.map +1 -0
- package/dist/discovery/types.d.ts +99 -0
- package/dist/discovery/types.d.ts.map +1 -0
- package/dist/index.cjs +3014 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2778 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/AgentLLMAdapter.d.ts +27 -0
- package/dist/llm/AgentLLMAdapter.d.ts.map +1 -0
- package/dist/llm/LangChainToolsHub.d.ts +31 -0
- package/dist/llm/LangChainToolsHub.d.ts.map +1 -0
- package/dist/llm/OpenAICompatibleClient.d.ts +64 -0
- package/dist/llm/OpenAICompatibleClient.d.ts.map +1 -0
- package/dist/llm/ReActAgent.d.ts +35 -0
- package/dist/llm/ReActAgent.d.ts.map +1 -0
- package/dist/llm-export.cjs +20 -0
- package/dist/llm-export.cjs.map +1 -0
- package/dist/llm-export.d.ts +9 -0
- package/dist/llm-export.d.ts.map +1 -0
- package/dist/llm-export.js +3 -0
- package/dist/llm-export.js.map +1 -0
- package/dist/mcp/MCPClientAdapter.d.ts +34 -0
- package/dist/mcp/MCPClientAdapter.d.ts.map +1 -0
- package/dist/mcp/connectMCP.d.ts +47 -0
- package/dist/mcp/connectMCP.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +10 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/registerMCPTools.d.ts +24 -0
- package/dist/mcp/registerMCPTools.d.ts.map +1 -0
- package/dist/observability/EventLog.d.ts +60 -0
- package/dist/observability/EventLog.d.ts.map +1 -0
- package/dist/observability/Logger.d.ts +33 -0
- package/dist/observability/Logger.d.ts.map +1 -0
- package/dist/observability/Metrics.d.ts +70 -0
- package/dist/observability/Metrics.d.ts.map +1 -0
- package/dist/observability/Tracing.d.ts +69 -0
- package/dist/observability/Tracing.d.ts.map +1 -0
- package/dist/registry/ToolRegistry.d.ts +68 -0
- package/dist/registry/ToolRegistry.d.ts.map +1 -0
- package/dist/report/AgentReportGenerator.d.ts +53 -0
- package/dist/report/AgentReportGenerator.d.ts.map +1 -0
- package/dist/report/agent-report-template.html +362 -0
- package/dist/report/index.d.ts +3 -0
- package/dist/report/index.d.ts.map +1 -0
- package/dist/report/types.d.ts +101 -0
- package/dist/report/types.d.ts.map +1 -0
- package/dist/runAgent.d.ts +37 -0
- package/dist/runAgent.d.ts.map +1 -0
- package/dist/runtime/Budget.d.ts +63 -0
- package/dist/runtime/Budget.d.ts.map +1 -0
- package/dist/runtime/Evidence.d.ts +19 -0
- package/dist/runtime/Evidence.d.ts.map +1 -0
- package/dist/runtime/PTCRuntime.d.ts +115 -0
- package/dist/runtime/PTCRuntime.d.ts.map +1 -0
- package/dist/runtime/PTCRuntimeObservability.d.ts +26 -0
- package/dist/runtime/PTCRuntimeObservability.d.ts.map +1 -0
- package/dist/runtime/PTCRuntimePipeline.d.ts +62 -0
- package/dist/runtime/PTCRuntimePipeline.d.ts.map +1 -0
- package/dist/runtime/PolicyEngine.d.ts +67 -0
- package/dist/runtime/PolicyEngine.d.ts.map +1 -0
- package/dist/runtime/Retry.d.ts +33 -0
- package/dist/runtime/Retry.d.ts.map +1 -0
- package/dist/runtime/SchemaValidator.d.ts +42 -0
- package/dist/runtime/SchemaValidator.d.ts.map +1 -0
- package/dist/templates/mcp-server.js +48 -0
- package/dist/templates/n8n-invoker.js +11 -0
- package/dist/templates/skill-invoker.js +11 -0
- package/dist/templates/tool-index.js +9 -0
- package/dist/toolDescriptor.d.ts +38 -0
- package/dist/toolDescriptor.d.ts.map +1 -0
- package/dist/types/Events.d.ts +99 -0
- package/dist/types/Events.d.ts.map +1 -0
- package/dist/types/ToolIntent.d.ts +40 -0
- package/dist/types/ToolIntent.d.ts.map +1 -0
- package/dist/types/ToolResult.d.ts +30 -0
- package/dist/types/ToolResult.d.ts.map +1 -0
- package/dist/types/ToolSpec.d.ts +99 -0
- package/dist/types/ToolSpec.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/extensions/examples/README.md +40 -0
- package/extensions/examples/scripts/agent-tool-react-stock.mjs +30 -0
- package/extensions/examples/tools/instruction-only/skill/SKILL.md +26 -0
- package/extensions/examples/tools/web-search/mcp/mcp.json +8 -0
- package/package.json +122 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { SkillDefinition, SkillFrontmatter, SkillResource } from "./SkillManifest.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parse a SKILL.md file into its constituent parts:
|
|
4
|
+
* - YAML frontmatter (metadata)
|
|
5
|
+
* - Markdown body (instructions)
|
|
6
|
+
*
|
|
7
|
+
* Supports the standard YAML frontmatter format:
|
|
8
|
+
* ```
|
|
9
|
+
* ---
|
|
10
|
+
* name: my-skill
|
|
11
|
+
* description: Does something useful
|
|
12
|
+
* ---
|
|
13
|
+
*
|
|
14
|
+
* # Instructions here...
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseSkillMd(content: string, filePath: string): {
|
|
18
|
+
frontmatter: SkillFrontmatter;
|
|
19
|
+
instructions: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Scan a skill directory for bundled resource files (Level 3).
|
|
23
|
+
* Recursively finds all files except SKILL.md and tool.json.
|
|
24
|
+
*/
|
|
25
|
+
export declare function scanSkillResources(dirPath: string): Promise<SkillResource[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Load and parse a complete skill from a directory containing SKILL.md.
|
|
28
|
+
* Returns the full SkillDefinition with all three progressive disclosure levels.
|
|
29
|
+
*/
|
|
30
|
+
export declare function loadSkillDefinition(dirPath: string): Promise<SkillDefinition>;
|
|
31
|
+
//# sourceMappingURL=SkillMdParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkillMdParser.d.ts","sourceRoot":"","sources":["../../../src/discovery/load/SkillMdParser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAgB5B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf;IAAE,WAAW,EAAE,gBAAgB,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAsEzD;AA8CD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAIlF;AAgDD;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAwBnF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { loadMCPTool } from "./MCPLoader.js";
|
|
2
|
+
export { loadLangChainTool } from "./LangChainLoader.js";
|
|
3
|
+
export { loadSkillTool, loadSkillTools } from "./SkillLoader.js";
|
|
4
|
+
export { loadN8nTool } from "./N8nLoader.js";
|
|
5
|
+
export { resolveEntryPoint } from "./resolveEntry.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/discovery/load/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the entry point file for a tool directory.
|
|
3
|
+
* If baseName already has an extension, verifies the file exists.
|
|
4
|
+
* Otherwise tries each extension in order.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolveEntryPoint(dirPath: string, baseName: string, extensions?: string[]): Promise<string>;
|
|
7
|
+
//# sourceMappingURL=resolveEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveEntry.d.ts","sourceRoot":"","sources":["../../../src/discovery/load/resolveEntry.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,MAAM,EAAuB,GACxC,OAAO,CAAC,MAAM,CAAC,CAsBjB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ToolSpec } from "../../types/ToolSpec.js";
|
|
2
|
+
import type { DirectoryScannerOptions } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Scans filesystem directories for tool definitions.
|
|
5
|
+
* A tool can be declared via tool.json or inferred from conventional files
|
|
6
|
+
* (SKILL.md, workflow.json, mcp.json, or an index entry point).
|
|
7
|
+
*/
|
|
8
|
+
export declare class DirectoryScanner {
|
|
9
|
+
private readonly roots;
|
|
10
|
+
private readonly extensions;
|
|
11
|
+
private readonly onError?;
|
|
12
|
+
constructor(options: DirectoryScannerOptions);
|
|
13
|
+
/**
|
|
14
|
+
* Scan all root directories and return discovered ToolSpecs.
|
|
15
|
+
* Errors in individual tool directories are reported via onError
|
|
16
|
+
* and do not prevent other tools from loading.
|
|
17
|
+
*/
|
|
18
|
+
scan(): Promise<ToolSpec[]>;
|
|
19
|
+
private scanRoot;
|
|
20
|
+
/**
|
|
21
|
+
* Recursively scan directories for tool definitions.
|
|
22
|
+
* Directories can be detected via tool.json or inferred markers.
|
|
23
|
+
*/
|
|
24
|
+
private scanRecursive;
|
|
25
|
+
private loadToolDir;
|
|
26
|
+
private inferManifest;
|
|
27
|
+
private fileExists;
|
|
28
|
+
private hasEntryPoint;
|
|
29
|
+
private hasLangchainFiles;
|
|
30
|
+
private listLangchainEntryFiles;
|
|
31
|
+
private loadByKind;
|
|
32
|
+
private loadLangChainTools;
|
|
33
|
+
private toToolSpec;
|
|
34
|
+
private buildBaseSpec;
|
|
35
|
+
private applyKindSpecificFields;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=DirectoryScanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DirectoryScanner.d.ts","sourceRoot":"","sources":["../../../src/discovery/scan/DirectoryScanner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAEV,uBAAuB,EAExB,MAAM,aAAa,CAAC;AAUrB;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6C;IACnE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAW;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAA0C;gBAEvD,OAAO,EAAE,uBAAuB;IAe5C;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YAWnB,QAAQ;IAItB;;;OAGG;YACW,aAAa;YAyCb,WAAW;YA8EX,aAAa;YAuCb,UAAU;YASV,aAAa;YASb,iBAAiB;YAKjB,uBAAuB;YAuBvB,UAAU;YA2BV,kBAAkB;IAkDhC,OAAO,CAAC,UAAU;IAqBlB,OAAO,CAAC,aAAa;IAwBrB,OAAO,CAAC,uBAAuB;CAmFhC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared scan utilities for directory-based tool discovery.
|
|
3
|
+
* Used by discovery (DirectoryScanner) and codegen (scanSkill, scanN8n, etc.).
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Recursively find all directories under rootPath that contain a file named fileName.
|
|
7
|
+
* Skips node_modules and dot-directories.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findDirsContainingFile(rootPath: string, fileName: string): Promise<string[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Build tool display name from relative path + program/export name.
|
|
12
|
+
* e.g. "skill-dir" + "my-skill" → "skill-dir.my-skill";
|
|
13
|
+
* "src/tools/example.ts" + "add" → "src.tools.example.add"
|
|
14
|
+
*/
|
|
15
|
+
export declare function pathToToolName(sourcePath: string, programName: string): string;
|
|
16
|
+
//# sourceMappingURL=scanUtil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanUtil.d.ts","sourceRoot":"","sources":["../../../src/discovery/scan/scanUtil.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,EAAE,CAAC,CAInB;AA+BD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAQ9E"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { Capability, CostHints, ToolKind } from "../types/ToolSpec.js";
|
|
2
|
+
import type { SkillDefinition } from "./load/SkillManifest.js";
|
|
3
|
+
/**
|
|
4
|
+
* Cursor-compatible MCP server configuration.
|
|
5
|
+
* Supports command-based (stdio) and URL-based (SSE/HTTP) servers.
|
|
6
|
+
*/
|
|
7
|
+
export interface MCPServerConfig {
|
|
8
|
+
/** Command to spawn the MCP server process */
|
|
9
|
+
command?: string;
|
|
10
|
+
/** Arguments for the command */
|
|
11
|
+
args?: string[];
|
|
12
|
+
/** Environment variables for the spawned process */
|
|
13
|
+
env?: Record<string, string>;
|
|
14
|
+
/** Working directory when spawning (stdio); default to caller cwd */
|
|
15
|
+
cwd?: string;
|
|
16
|
+
/** SSE/HTTP URL for remote MCP server */
|
|
17
|
+
url?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Discoverable tool kinds (subset of ToolKind that can be directory-discovered).
|
|
21
|
+
*/
|
|
22
|
+
export type DiscoverableKind = Extract<ToolKind, "mcp" | "langchain" | "skill" | "n8n">;
|
|
23
|
+
/**
|
|
24
|
+
* Tool manifest read from tool.json or inferred from conventional files.
|
|
25
|
+
*/
|
|
26
|
+
export interface ToolManifest {
|
|
27
|
+
/** Tool kind — determines which loader and adapter handle this tool */
|
|
28
|
+
kind: DiscoverableKind;
|
|
29
|
+
/** Tool name override (default: "<namespace>/<dirname>") */
|
|
30
|
+
name?: string;
|
|
31
|
+
/** Semver version (default: "1.0.0") */
|
|
32
|
+
version?: string;
|
|
33
|
+
/** Human-readable description */
|
|
34
|
+
description?: string;
|
|
35
|
+
/** Searchable tags */
|
|
36
|
+
tags?: string[];
|
|
37
|
+
/** Required capabilities for PolicyEngine gating */
|
|
38
|
+
capabilities?: Capability[];
|
|
39
|
+
/** Cost hints for routing/budgeting */
|
|
40
|
+
costHints?: CostHints;
|
|
41
|
+
/**
|
|
42
|
+
* Entry point file relative to tool directory.
|
|
43
|
+
* Defaults per kind:
|
|
44
|
+
* mcp → "mcp.json"
|
|
45
|
+
* langchain → "index" (or all *.js/*.mjs files when inside a "langchain" folder)
|
|
46
|
+
* skill → "handler"
|
|
47
|
+
* n8n → "workflow.json"
|
|
48
|
+
*/
|
|
49
|
+
entryPoint?: string;
|
|
50
|
+
/**
|
|
51
|
+
* For skills only: multiple programs (entry points) in this skill directory.
|
|
52
|
+
* Map of program key → entry file (e.g. { "default": "handler.js", "report": "report.js" }).
|
|
53
|
+
* "default" is the main tool name (e.g. tools/yahoo-finance); others get tools/yahoo-finance/report.
|
|
54
|
+
* When absent, single entryPoint (or "handler") is used.
|
|
55
|
+
*/
|
|
56
|
+
programs?: Record<string, string>;
|
|
57
|
+
/** JSON Schema for input validation */
|
|
58
|
+
inputSchema?: object;
|
|
59
|
+
/** JSON Schema for output validation */
|
|
60
|
+
outputSchema?: object;
|
|
61
|
+
/** Whether this tool is enabled (default: true). Set false to skip. */
|
|
62
|
+
enabled?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Configuration for the DirectoryScanner.
|
|
66
|
+
*/
|
|
67
|
+
export interface DirectoryScannerOptions {
|
|
68
|
+
/** One or more root directories to scan for tool subdirectories */
|
|
69
|
+
roots: Array<string | {
|
|
70
|
+
path: string;
|
|
71
|
+
namespace?: string;
|
|
72
|
+
}>;
|
|
73
|
+
/** Namespace prefix for discovered tool names (default: "dir") */
|
|
74
|
+
namespace?: string;
|
|
75
|
+
/** File extensions to try for JS/TS entry points (default: [".js", ".mjs"]) */
|
|
76
|
+
extensions?: string[];
|
|
77
|
+
/** Callback for non-fatal errors during scan (tool dir path, error) */
|
|
78
|
+
onError?: (toolDir: string, error: Error) => void;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Result from loading a single tool directory.
|
|
82
|
+
*/
|
|
83
|
+
export interface LoadedTool {
|
|
84
|
+
/** The parsed manifest */
|
|
85
|
+
manifest: ToolManifest;
|
|
86
|
+
/** Absolute path to the tool directory */
|
|
87
|
+
dirPath: string;
|
|
88
|
+
/** Loaded implementation (LangChainToolLike instance or SkillHandler function) */
|
|
89
|
+
impl?: unknown;
|
|
90
|
+
/** For MCP tools: the parsed server config from mcp.json */
|
|
91
|
+
mcpConfig?: MCPServerConfig;
|
|
92
|
+
/** For n8n tools: the parsed workflow definition */
|
|
93
|
+
workflowDef?: unknown;
|
|
94
|
+
/** For Skill tools: the parsed SKILL.md definition with progressive disclosure levels */
|
|
95
|
+
skillDefinition?: SkillDefinition;
|
|
96
|
+
/** For Skill tools with multiple programs: key for naming (e.g. "default", "report") */
|
|
97
|
+
programKey?: string;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/discovery/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,8CAA8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