@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.
Files changed (157) hide show
  1. package/README.md +103 -0
  2. package/dist/chunk-3YLVPZRJ.cjs +32 -0
  3. package/dist/chunk-3YLVPZRJ.cjs.map +1 -0
  4. package/dist/chunk-AXUNV4MK.js +28 -0
  5. package/dist/chunk-AXUNV4MK.js.map +1 -0
  6. package/dist/chunk-BM4EVYI5.js +1069 -0
  7. package/dist/chunk-BM4EVYI5.js.map +1 -0
  8. package/dist/chunk-P3UEAZHK.cjs +171 -0
  9. package/dist/chunk-P3UEAZHK.cjs.map +1 -0
  10. package/dist/chunk-RPAMQCFH.js +167 -0
  11. package/dist/chunk-RPAMQCFH.js.map +1 -0
  12. package/dist/chunk-Z7TGIG77.cjs +1108 -0
  13. package/dist/chunk-Z7TGIG77.cjs.map +1 -0
  14. package/dist/cli.cjs +154 -0
  15. package/dist/cli.cjs.map +1 -0
  16. package/dist/cli.d.ts +10 -0
  17. package/dist/cli.d.ts.map +1 -0
  18. package/dist/cli.js +147 -0
  19. package/dist/cli.js.map +1 -0
  20. package/dist/codegen/build.d.ts +23 -0
  21. package/dist/codegen/build.d.ts.map +1 -0
  22. package/dist/codegen/generator.d.ts +15 -0
  23. package/dist/codegen/generator.d.ts.map +1 -0
  24. package/dist/codegen/index.d.ts +21 -0
  25. package/dist/codegen/index.d.ts.map +1 -0
  26. package/dist/codegen/init.d.ts +17 -0
  27. package/dist/codegen/init.d.ts.map +1 -0
  28. package/dist/codegen/run.d.ts +19 -0
  29. package/dist/codegen/run.d.ts.map +1 -0
  30. package/dist/codegen/scan/scanN8n.d.ts +17 -0
  31. package/dist/codegen/scan/scanN8n.d.ts.map +1 -0
  32. package/dist/codegen/scan/scanSkill.d.ts +17 -0
  33. package/dist/codegen/scan/scanSkill.d.ts.map +1 -0
  34. package/dist/codegen/scan/scanTools.d.ts +31 -0
  35. package/dist/codegen/scan/scanTools.d.ts.map +1 -0
  36. package/dist/codegen/scan/scanner.d.ts +26 -0
  37. package/dist/codegen/scan/scanner.d.ts.map +1 -0
  38. package/dist/codegen/scan/schemaFromTs.d.ts +16 -0
  39. package/dist/codegen/scan/schemaFromTs.d.ts.map +1 -0
  40. package/dist/codegen/types.d.ts +81 -0
  41. package/dist/codegen/types.d.ts.map +1 -0
  42. package/dist/core.cjs +20 -0
  43. package/dist/core.cjs.map +1 -0
  44. package/dist/core.d.ts +8 -0
  45. package/dist/core.d.ts.map +1 -0
  46. package/dist/core.js +3 -0
  47. package/dist/core.js.map +1 -0
  48. package/dist/discovery/MCPProcessManager.d.ts +57 -0
  49. package/dist/discovery/MCPProcessManager.d.ts.map +1 -0
  50. package/dist/discovery/errors.d.ts +13 -0
  51. package/dist/discovery/errors.d.ts.map +1 -0
  52. package/dist/discovery/load/LangChainLoader.d.ts +7 -0
  53. package/dist/discovery/load/LangChainLoader.d.ts.map +1 -0
  54. package/dist/discovery/load/MCPLoader.d.ts +8 -0
  55. package/dist/discovery/load/MCPLoader.d.ts.map +1 -0
  56. package/dist/discovery/load/N8nLoader.d.ts +25 -0
  57. package/dist/discovery/load/N8nLoader.d.ts.map +1 -0
  58. package/dist/discovery/load/SkillLoader.d.ts +20 -0
  59. package/dist/discovery/load/SkillLoader.d.ts.map +1 -0
  60. package/dist/discovery/load/SkillManifest.d.ts +79 -0
  61. package/dist/discovery/load/SkillManifest.d.ts.map +1 -0
  62. package/dist/discovery/load/SkillMdParser.d.ts +31 -0
  63. package/dist/discovery/load/SkillMdParser.d.ts.map +1 -0
  64. package/dist/discovery/load/index.d.ts +6 -0
  65. package/dist/discovery/load/index.d.ts.map +1 -0
  66. package/dist/discovery/load/resolveEntry.d.ts +7 -0
  67. package/dist/discovery/load/resolveEntry.d.ts.map +1 -0
  68. package/dist/discovery/scan/DirectoryScanner.d.ts +37 -0
  69. package/dist/discovery/scan/DirectoryScanner.d.ts.map +1 -0
  70. package/dist/discovery/scan/scanUtil.d.ts +16 -0
  71. package/dist/discovery/scan/scanUtil.d.ts.map +1 -0
  72. package/dist/discovery/types.d.ts +99 -0
  73. package/dist/discovery/types.d.ts.map +1 -0
  74. package/dist/index.cjs +3014 -0
  75. package/dist/index.cjs.map +1 -0
  76. package/dist/index.d.ts +68 -0
  77. package/dist/index.d.ts.map +1 -0
  78. package/dist/index.js +2778 -0
  79. package/dist/index.js.map +1 -0
  80. package/dist/llm/AgentLLMAdapter.d.ts +27 -0
  81. package/dist/llm/AgentLLMAdapter.d.ts.map +1 -0
  82. package/dist/llm/LangChainToolsHub.d.ts +31 -0
  83. package/dist/llm/LangChainToolsHub.d.ts.map +1 -0
  84. package/dist/llm/OpenAICompatibleClient.d.ts +64 -0
  85. package/dist/llm/OpenAICompatibleClient.d.ts.map +1 -0
  86. package/dist/llm/ReActAgent.d.ts +35 -0
  87. package/dist/llm/ReActAgent.d.ts.map +1 -0
  88. package/dist/llm-export.cjs +20 -0
  89. package/dist/llm-export.cjs.map +1 -0
  90. package/dist/llm-export.d.ts +9 -0
  91. package/dist/llm-export.d.ts.map +1 -0
  92. package/dist/llm-export.js +3 -0
  93. package/dist/llm-export.js.map +1 -0
  94. package/dist/mcp/MCPClientAdapter.d.ts +34 -0
  95. package/dist/mcp/MCPClientAdapter.d.ts.map +1 -0
  96. package/dist/mcp/connectMCP.d.ts +47 -0
  97. package/dist/mcp/connectMCP.d.ts.map +1 -0
  98. package/dist/mcp/index.d.ts +10 -0
  99. package/dist/mcp/index.d.ts.map +1 -0
  100. package/dist/mcp/registerMCPTools.d.ts +24 -0
  101. package/dist/mcp/registerMCPTools.d.ts.map +1 -0
  102. package/dist/observability/EventLog.d.ts +60 -0
  103. package/dist/observability/EventLog.d.ts.map +1 -0
  104. package/dist/observability/Logger.d.ts +33 -0
  105. package/dist/observability/Logger.d.ts.map +1 -0
  106. package/dist/observability/Metrics.d.ts +70 -0
  107. package/dist/observability/Metrics.d.ts.map +1 -0
  108. package/dist/observability/Tracing.d.ts +69 -0
  109. package/dist/observability/Tracing.d.ts.map +1 -0
  110. package/dist/registry/ToolRegistry.d.ts +68 -0
  111. package/dist/registry/ToolRegistry.d.ts.map +1 -0
  112. package/dist/report/AgentReportGenerator.d.ts +53 -0
  113. package/dist/report/AgentReportGenerator.d.ts.map +1 -0
  114. package/dist/report/agent-report-template.html +362 -0
  115. package/dist/report/index.d.ts +3 -0
  116. package/dist/report/index.d.ts.map +1 -0
  117. package/dist/report/types.d.ts +101 -0
  118. package/dist/report/types.d.ts.map +1 -0
  119. package/dist/runAgent.d.ts +37 -0
  120. package/dist/runAgent.d.ts.map +1 -0
  121. package/dist/runtime/Budget.d.ts +63 -0
  122. package/dist/runtime/Budget.d.ts.map +1 -0
  123. package/dist/runtime/Evidence.d.ts +19 -0
  124. package/dist/runtime/Evidence.d.ts.map +1 -0
  125. package/dist/runtime/PTCRuntime.d.ts +115 -0
  126. package/dist/runtime/PTCRuntime.d.ts.map +1 -0
  127. package/dist/runtime/PTCRuntimeObservability.d.ts +26 -0
  128. package/dist/runtime/PTCRuntimeObservability.d.ts.map +1 -0
  129. package/dist/runtime/PTCRuntimePipeline.d.ts +62 -0
  130. package/dist/runtime/PTCRuntimePipeline.d.ts.map +1 -0
  131. package/dist/runtime/PolicyEngine.d.ts +67 -0
  132. package/dist/runtime/PolicyEngine.d.ts.map +1 -0
  133. package/dist/runtime/Retry.d.ts +33 -0
  134. package/dist/runtime/Retry.d.ts.map +1 -0
  135. package/dist/runtime/SchemaValidator.d.ts +42 -0
  136. package/dist/runtime/SchemaValidator.d.ts.map +1 -0
  137. package/dist/templates/mcp-server.js +48 -0
  138. package/dist/templates/n8n-invoker.js +11 -0
  139. package/dist/templates/skill-invoker.js +11 -0
  140. package/dist/templates/tool-index.js +9 -0
  141. package/dist/toolDescriptor.d.ts +38 -0
  142. package/dist/toolDescriptor.d.ts.map +1 -0
  143. package/dist/types/Events.d.ts +99 -0
  144. package/dist/types/Events.d.ts.map +1 -0
  145. package/dist/types/ToolIntent.d.ts +40 -0
  146. package/dist/types/ToolIntent.d.ts.map +1 -0
  147. package/dist/types/ToolResult.d.ts +30 -0
  148. package/dist/types/ToolResult.d.ts.map +1 -0
  149. package/dist/types/ToolSpec.d.ts +99 -0
  150. package/dist/types/ToolSpec.d.ts.map +1 -0
  151. package/dist/types/index.d.ts +6 -0
  152. package/dist/types/index.d.ts.map +1 -0
  153. package/extensions/examples/README.md +40 -0
  154. package/extensions/examples/scripts/agent-tool-react-stock.mjs +30 -0
  155. package/extensions/examples/tools/instruction-only/skill/SKILL.md +26 -0
  156. package/extensions/examples/tools/web-search/mcp/mcp.json +8 -0
  157. package/package.json +122 -0
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generate MCP server entrypoint, tool-specs.json, invokers for function/skill/n8n.
3
+ * Templates are loaded from ./templates/ (shipped next to this module or in dist/templates).
4
+ */
5
+ import type { MCPToolSpec } from "./types.js";
6
+ /** Write generated files into outDir. projectPath is the folder containing source. */
7
+ export declare function generate(options: {
8
+ specs: MCPToolSpec[];
9
+ outDir: string;
10
+ projectPath: string;
11
+ }): Promise<{
12
+ entryPath: string;
13
+ mcpJsonPath: string;
14
+ }>;
15
+ //# sourceMappingURL=generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/codegen/generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAgD,MAAM,YAAY,CAAC;AAqE5F,sFAAsF;AACtF,wBAAsB,QAAQ,CAAC,OAAO,EAAE;IACtC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAmFtD"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * MCP build: init → build → run. Scan @tool, SKILL, n8n; generate standalone MCP npm package.
3
+ */
4
+ export { initProject } from "./init.js";
5
+ export type { InitOptions } from "./init.js";
6
+ export { buildMcpPackage, buildFunctionToTool } from "./build.js";
7
+ export type { BuildOptions } from "./build.js";
8
+ export { runMcpServer, runGeneratedMCP } from "./run.js";
9
+ export type { RunOptions } from "./run.js";
10
+ export { scanForTools } from "./scan/scanner.js";
11
+ export type { ScanResult } from "./scan/scanner.js";
12
+ export { scanForSkill } from "./scan/scanSkill.js";
13
+ export type { ScanSkillResult } from "./scan/scanSkill.js";
14
+ export { scanForN8n } from "./scan/scanN8n.js";
15
+ export type { ScanN8nResult } from "./scan/scanN8n.js";
16
+ export { scanForAllTools } from "./scan/scanTools.js";
17
+ export type { ScanAllToolsResult, ScanAllToolsOptions } from "./scan/scanTools.js";
18
+ export { buildInputSchemaFromParams, buildOutputSchemaFromReturnType } from "./scan/schemaFromTs.js";
19
+ export { generate } from "./generator.js";
20
+ export type { FunctionToolSpec, ScanOptions, BuildResult, SideEffect } from "./types.js";
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Scaffold a new MCP tool project: @tool TS, SKILL sample, tsconfig, README.
3
+ * Use: init → build → run.
4
+ */
5
+ export interface InitOptions {
6
+ /** Target directory to create project (default: cwd). */
7
+ targetPath?: string;
8
+ }
9
+ /**
10
+ * Create project template at targetPath. Writes tsconfig, src/tools/example.ts,
11
+ * skills/hello-skill (SKILL.md + handler.js), and README.
12
+ */
13
+ export declare function initProject(options?: InitOptions): Promise<{
14
+ targetPath: string;
15
+ filesCreated: string[];
16
+ }>;
17
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/codegen/init.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAqFD;;;GAGG;AACH,wBAAsB,WAAW,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAoBpH"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Run step: start the generated MCP server (stdio) for testing. Spawns entrypoint via npx tsx.
3
+ */
4
+ import { spawn } from "node:child_process";
5
+ export interface RunOptions {
6
+ /** Directory containing generated mcp-server (default: cwd or cwd/dist). */
7
+ path?: string;
8
+ }
9
+ /**
10
+ * Start the MCP server from the given directory.
11
+ * Expects mcp-server.ts and tool-specs.json there; runs via npx tsx mcp-server.ts.
12
+ * Returns a child process; caller should handle stdin/stdout and cleanup.
13
+ */
14
+ export declare function runMcpServer(options?: RunOptions): Promise<{
15
+ process: ReturnType<typeof spawn>;
16
+ }>;
17
+ /** @deprecated Use runMcpServer. */
18
+ export declare const runGeneratedMCP: typeof runMcpServer;
19
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/codegen/run.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,MAAM,WAAW,UAAU;IACzB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAA;CAAE,CAAC,CAkC3G;AAED,oCAAoC;AACpC,eAAO,MAAM,eAAe,qBAAe,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Scan project for workflow.json (n8n) directories; produce MCP tool specs.
3
+ * Reuses discovery: findDirsContainingFile, pathToToolName, readWorkflowMeta (N8nLoader).
4
+ */
5
+ import type { N8nToolSpec } from "../types.js";
6
+ export interface ScanN8nResult {
7
+ n8n: N8nToolSpec[];
8
+ errors: Array<{
9
+ dir: string;
10
+ message: string;
11
+ }>;
12
+ }
13
+ /**
14
+ * Scan projectPath for workflow.json directories; return n8n tool specs.
15
+ */
16
+ export declare function scanForN8n(projectPath: string): Promise<ScanN8nResult>;
17
+ //# sourceMappingURL=scanN8n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scanN8n.d.ts","sourceRoot":"","sources":["../../../src/codegen/scan/scanN8n.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,WAAW,EAAE,CAAC;IACnB,MAAM,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjD;AAID;;GAEG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA2B5E"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Scan project for SKILL.md directories; produce MCP tool specs.
3
+ * Reuses discovery: findDirsContainingFile, pathToToolName, loadSkillDefinition.
4
+ */
5
+ import type { SkillToolSpec } from "../types.js";
6
+ export interface ScanSkillResult {
7
+ skills: SkillToolSpec[];
8
+ errors: Array<{
9
+ dir: string;
10
+ message: string;
11
+ }>;
12
+ }
13
+ /**
14
+ * Scan projectPath for SKILL.md directories; return skill tool specs.
15
+ */
16
+ export declare function scanForSkill(projectPath: string): Promise<ScanSkillResult>;
17
+ //# sourceMappingURL=scanSkill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scanSkill.d.ts","sourceRoot":"","sources":["../../../src/codegen/scan/scanSkill.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,MAAM,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjD;AAID;;GAEG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA0BhF"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Scan project for all tools: @tool (TypeScript), SKILL.md directories, workflow.json (n8n).
3
+ * Single entry for MCP build; aggregates specs from scanner, scanSkill, scanN8n.
4
+ */
5
+ import type { MCPToolSpec } from "../types.js";
6
+ export interface ScanAllToolsResult {
7
+ /** All tools from function, skill, and n8n sources. */
8
+ specs: MCPToolSpec[];
9
+ errors: Array<{
10
+ file: string;
11
+ message: string;
12
+ }>;
13
+ warnings: Array<{
14
+ file: string;
15
+ message: string;
16
+ }>;
17
+ }
18
+ export interface ScanAllToolsOptions {
19
+ /** Glob patterns for TS files (default: ["**\/*.ts"]). Used for @tool (TypeScript) scanning only. */
20
+ include?: string[];
21
+ /** Path to tsconfig.json (default: projectPath/tsconfig.json). Used for @tool scanning only. */
22
+ tsconfigPath?: string;
23
+ /** Include n8n (workflow.json) tools. Default false: we do not start or install n8n-local; set true if you use n8n. */
24
+ includeN8n?: boolean;
25
+ }
26
+ /**
27
+ * Scan projectPath for all tools (function, SKILL, and optionally n8n); return unified specs and errors.
28
+ * By default n8n is not scanned (includeN8n: false); we do not start or install n8n-local.
29
+ */
30
+ export declare function scanForAllTools(projectPath: string, options?: ScanAllToolsOptions): Promise<ScanAllToolsResult>;
31
+ //# sourceMappingURL=scanTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scanTools.d.ts","sourceRoot":"","sources":["../../../src/codegen/scan/scanTools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,mBAAmB;IAClC,qGAAqG;IACrG,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,gGAAgG;IAChG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CA0B7B"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Scan TypeScript source files for exported functions with @tool JSDoc.
3
+ * Extracts description, @effect, and builds inputSchema from param types.
4
+ * Reuses discovery pathToToolName for consistent tool naming.
5
+ */
6
+ import type { FunctionToolSpec } from "../types.js";
7
+ export interface ScanResult {
8
+ specs: FunctionToolSpec[];
9
+ errors: Array<{
10
+ file: string;
11
+ message: string;
12
+ }>;
13
+ warnings: Array<{
14
+ file: string;
15
+ message: string;
16
+ }>;
17
+ }
18
+ /**
19
+ * Scan a project folder for exported functions annotated with @tool.
20
+ */
21
+ export declare function scanForTools(options: {
22
+ projectPath: string;
23
+ include?: string[];
24
+ tsconfigPath?: string;
25
+ }): ScanResult;
26
+ //# sourceMappingURL=scanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../../src/codegen/scan/scanner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAOpD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,UAAU,CAmGb"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Build JSON Schema from TypeScript parameter types using the compiler API.
3
+ * MVP: primitives, optional, array, object. Complex types fallback to {} with warn.
4
+ */
5
+ import * as ts from "typescript";
6
+ /**
7
+ * Build output JSON Schema from function return type (unwrap Promise if present).
8
+ * For use in codegen when auto-deriving schema.
9
+ */
10
+ export declare function buildOutputSchemaFromReturnType(node: ts.FunctionDeclaration | ts.ArrowFunction | ts.FunctionExpression, typeChecker: ts.TypeChecker, onWarn?: (message: string) => void): object;
11
+ /** Build { type: "object", properties, required } from function parameters. */
12
+ export declare function buildInputSchemaFromParams(node: ts.FunctionDeclaration | ts.ArrowFunction | ts.FunctionExpression, typeChecker: ts.TypeChecker, onWarn?: (message: string) => void): {
13
+ schema: object;
14
+ required: string[];
15
+ };
16
+ //# sourceMappingURL=schemaFromTs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaFromTs.d.ts","sourceRoot":"","sources":["../../../src/codegen/scan/schemaFromTs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,EAAE,CAAC,mBAAmB,GAAG,EAAE,CAAC,aAAa,GAAG,EAAE,CAAC,kBAAkB,EACvE,WAAW,EAAE,EAAE,CAAC,WAAW,EAC3B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACjC,MAAM,CAkBR;AAED,+EAA+E;AAC/E,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,EAAE,CAAC,mBAAmB,GAAG,EAAE,CAAC,aAAa,GAAG,EAAE,CAAC,kBAAkB,EACvE,WAAW,EAAE,EAAE,CAAC,WAAW,EAC3B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACjC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA6BxC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Types for MCP build: tools from @tool (TypeScript), SKILL.md, workflow.json (n8n).
3
+ * See function-to-tool-and-hitl-gateway-mvp.md.
4
+ */
5
+ /** HITL side-effect classification. */
6
+ export type SideEffect = "none" | "local_write" | "external_write" | "destructive";
7
+ /** Discriminated union: function (from @tool), skill (SKILL.md), or n8n (workflow.json). */
8
+ export type MCPToolSpec = FunctionToolSpec | SkillToolSpec | N8nToolSpec;
9
+ /** Single tool spec from @tool function (before MCP packaging). */
10
+ export interface FunctionToolSpec {
11
+ kind: "function";
12
+ /** Tool display name: path-based, e.g. file.test.write for file/test.ts export write. */
13
+ name: string;
14
+ /** One-line description from JSDoc. */
15
+ description: string;
16
+ /** JSON Schema for arguments (object with param names as properties). Auto-derived from params when not provided. */
17
+ inputSchema: object;
18
+ /** JSON Schema for return value. Auto-derived from return type when not provided. */
19
+ outputSchema?: object;
20
+ /** HITL metadata. */
21
+ _meta?: {
22
+ hitl?: {
23
+ sideEffect?: SideEffect;
24
+ };
25
+ };
26
+ /** Source file path (relative to project root). */
27
+ sourcePath: string;
28
+ /** Export name (function name). */
29
+ exportName: string;
30
+ }
31
+ /** Single tool spec from SKILL.md directory. */
32
+ export interface SkillToolSpec {
33
+ kind: "skill";
34
+ name: string;
35
+ description: string;
36
+ inputSchema: object;
37
+ _meta?: {
38
+ hitl?: {
39
+ sideEffect?: SideEffect;
40
+ };
41
+ };
42
+ /** Skill directory path (relative to project root). */
43
+ sourcePath: string;
44
+ }
45
+ /** Single tool spec from n8n workflow.json directory. */
46
+ export interface N8nToolSpec {
47
+ kind: "n8n";
48
+ name: string;
49
+ description: string;
50
+ inputSchema: object;
51
+ _meta?: {
52
+ hitl?: {
53
+ sideEffect?: SideEffect;
54
+ };
55
+ };
56
+ /** n8n tool directory path (relative to project root). */
57
+ sourcePath: string;
58
+ /** Webhook URL if present in workflow (for runtime invocation). */
59
+ webhookUrl?: string;
60
+ }
61
+ /** Options for scanning a folder for @tool functions. */
62
+ export interface ScanOptions {
63
+ /** Project root (folder containing tsconfig or source). */
64
+ projectPath: string;
65
+ /** Glob or path pattern for TS files (default: "src/**\/*.ts"). */
66
+ include?: string[];
67
+ /** Path to tsconfig.json (default: projectPath/tsconfig.json). */
68
+ tsconfigPath?: string;
69
+ }
70
+ /** Result of a full build (scan + generate). */
71
+ export interface BuildResult {
72
+ /** Path to the generated output directory. */
73
+ outDir: string;
74
+ /** Number of tools discovered. */
75
+ toolCount: number;
76
+ /** Path to generated mcp-server entry (e.g. mcp-server.js or mcp-server.ts). */
77
+ entryPath: string;
78
+ /** Path to generated mcp.json (command/args to run the server). */
79
+ mcpJsonPath: string;
80
+ }
81
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/codegen/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,uCAAuC;AACvC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,aAAa,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAEnF,4FAA4F;AAC5F,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,aAAa,GAAG,WAAW,CAAC;AAEzE,mEAAmE;AACnE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,qHAAqH;IACrH,WAAW,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE;YAAE,UAAU,CAAC,EAAE,UAAU,CAAA;SAAE,CAAA;KAAE,CAAC;IAC/C,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE;YAAE,UAAU,CAAC,EAAE,UAAU,CAAA;SAAE,CAAA;KAAE,CAAC;IAC/C,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,yDAAyD;AACzD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE;YAAE,UAAU,CAAC,EAAE,UAAU,CAAA;SAAE,CAAA;KAAE,CAAC;IAC/C,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,yDAAyD;AACzD,MAAM,WAAW,WAAW;IAC1B,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,gDAAgD;AAChD,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,WAAW,EAAE,MAAM,CAAC;CACrB"}
package/dist/core.cjs ADDED
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var chunk3YLVPZRJ_cjs = require('./chunk-3YLVPZRJ.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "DEFAULT_INPUT_SCHEMA", {
8
+ enumerable: true,
9
+ get: function () { return chunk3YLVPZRJ_cjs.DEFAULT_INPUT_SCHEMA; }
10
+ });
11
+ Object.defineProperty(exports, "DEFAULT_OUTPUT_SCHEMA", {
12
+ enumerable: true,
13
+ get: function () { return chunk3YLVPZRJ_cjs.DEFAULT_OUTPUT_SCHEMA; }
14
+ });
15
+ Object.defineProperty(exports, "createToolSpec", {
16
+ enumerable: true,
17
+ get: function () { return chunk3YLVPZRJ_cjs.createToolSpec; }
18
+ });
19
+ //# sourceMappingURL=core.cjs.map
20
+ //# sourceMappingURL=core.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"core.cjs"}
package/dist/core.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Core types and createToolSpec only.
3
+ * Use this entry point from extensions to avoid circular dependency with the main index
4
+ * (which re-exports builtin-tools and example-tools).
5
+ */
6
+ export type { ToolKind, Capability, HitlSideEffect, CostHints, ToolSpec, CreateToolSpecOptions, } from "./types/ToolSpec.js";
7
+ export { createToolSpec, DEFAULT_INPUT_SCHEMA, DEFAULT_OUTPUT_SCHEMA, } from "./types/ToolSpec.js";
8
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,EACV,QAAQ,EACR,UAAU,EACV,cAAc,EACd,SAAS,EACT,QAAQ,EACR,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC"}
package/dist/core.js ADDED
@@ -0,0 +1,3 @@
1
+ export { DEFAULT_INPUT_SCHEMA, DEFAULT_OUTPUT_SCHEMA, createToolSpec } from './chunk-AXUNV4MK.js';
2
+ //# sourceMappingURL=core.js.map
3
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"core.js"}
@@ -0,0 +1,57 @@
1
+ import type { MCPServerConfig } from "./types.js";
2
+ /**
3
+ * Connection info for an MCP server.
4
+ */
5
+ export interface MCPConnectionInfo {
6
+ /** Transport type: "url" for SSE/HTTP, "stdio" for command-based */
7
+ type: "url" | "stdio";
8
+ /** SSE/HTTP URL (when type="url") */
9
+ url?: string;
10
+ /** Command to spawn (when type="stdio") */
11
+ command?: string;
12
+ /** Command arguments (when type="stdio") */
13
+ args?: string[];
14
+ /** Environment variables (when type="stdio") */
15
+ env?: Record<string, string>;
16
+ /** Working directory when spawning (when type="stdio") */
17
+ cwd?: string;
18
+ }
19
+ /**
20
+ * Manages MCP server connection information extracted from directory discovery.
21
+ *
22
+ * This class provides connection configuration for MCP servers discovered
23
+ * from mcp.json files. The actual MCP client creation and lifecycle management
24
+ * is the consumer's responsibility (using @modelcontextprotocol/sdk or similar).
25
+ *
26
+ * Usage:
27
+ * ```ts
28
+ * const manager = new MCPProcessManager();
29
+ * const info = manager.getConnectionInfo("my-tool", mcpConfig);
30
+ * if (info.type === "stdio") {
31
+ * // Spawn process with info.command, info.args, info.env
32
+ * } else {
33
+ * // Connect SSE client to info.url
34
+ * }
35
+ * ```
36
+ */
37
+ export declare class MCPProcessManager {
38
+ private readonly connections;
39
+ /**
40
+ * Get connection info for an MCP tool based on its config.
41
+ * Caches the result by tool name.
42
+ */
43
+ getConnectionInfo(toolName: string, config: MCPServerConfig): MCPConnectionInfo;
44
+ /**
45
+ * Remove cached connection info for a tool.
46
+ */
47
+ remove(toolName: string): boolean;
48
+ /**
49
+ * Get all registered tool names.
50
+ */
51
+ getToolNames(): string[];
52
+ /**
53
+ * Clear all cached connection info.
54
+ */
55
+ dispose(): void;
56
+ }
57
+ //# sourceMappingURL=MCPProcessManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MCPProcessManager.d.ts","sourceRoot":"","sources":["../../src/discovery/MCPProcessManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;IACtB,qCAAqC;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAwC;IAEpE;;;OAGG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,iBAAiB;IAkB/E;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIjC;;OAEG;IACH,YAAY,IAAI,MAAM,EAAE;IAIxB;;OAEG;IACH,OAAO,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Error thrown during directory-based tool discovery.
3
+ */
4
+ export declare class DiscoveryError extends Error {
5
+ /** Absolute path to the tool directory that caused the error */
6
+ readonly toolDir: string;
7
+ /** Phase in which the error occurred */
8
+ readonly phase: "manifest" | "load" | "validate";
9
+ /** The underlying cause */
10
+ readonly cause?: Error;
11
+ constructor(toolDir: string, phase: "manifest" | "load" | "validate", message: string, cause?: Error);
12
+ }
13
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/discovery/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,gEAAgE;IAChE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wCAAwC;IACxC,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;IACjD,2BAA2B;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;gBAGrB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,EACvC,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,KAAK;CAQhB"}
@@ -0,0 +1,7 @@
1
+ import type { ToolManifest, LoadedTool } from "../types.js";
2
+ /**
3
+ * Load a LangChain tool from its directory.
4
+ * Dynamically imports the entry point and validates it has an invoke() method.
5
+ */
6
+ export declare function loadLangChainTool(dirPath: string, manifest: ToolManifest, extensions?: string[]): Promise<LoadedTool>;
7
+ //# sourceMappingURL=LangChainLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LangChainLoader.d.ts","sourceRoot":"","sources":["../../../src/discovery/load/LangChainLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI5D;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,YAAY,EACtB,UAAU,CAAC,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,UAAU,CAAC,CAyCrB"}
@@ -0,0 +1,8 @@
1
+ import type { ToolManifest, LoadedTool } from "../types.js";
2
+ /**
3
+ * Load an MCP tool from its directory.
4
+ * Reads mcp.json and validates it has either command or url.
5
+ * Supports both Cursor's mcpServers wrapper format and bare server config.
6
+ */
7
+ export declare function loadMCPTool(dirPath: string, manifest: ToolManifest): Promise<LoadedTool>;
8
+ //# sourceMappingURL=MCPLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MCPLoader.d.ts","sourceRoot":"","sources":["../../../src/discovery/load/MCPLoader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA+C7E;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,UAAU,CAAC,CAwCrB"}
@@ -0,0 +1,25 @@
1
+ import type { ToolManifest, LoadedTool } from "../types.js";
2
+ /** Metadata extracted from workflow.json for spec building (used by N8nLoader and codegen scanN8n). */
3
+ export interface WorkflowMeta {
4
+ name: string;
5
+ description: string;
6
+ webhookUrl?: string;
7
+ workflowDef: Record<string, unknown>;
8
+ }
9
+ /**
10
+ * Read and parse workflow.json in dirPath; return metadata and raw workflow.
11
+ * Shared by loadN8nTool (runtime) and codegen scanN8n.
12
+ */
13
+ export declare function readWorkflowMeta(dirPath: string, workflowFileName?: string): Promise<WorkflowMeta>;
14
+ /**
15
+ * Load an n8n tool from its directory.
16
+ * Reads workflow.json and validates it has a "nodes" array.
17
+ *
18
+ * Description for the tool spec is taken (in order) from:
19
+ * 1. tool.json "description" (if present)
20
+ * 2. workflow.json "description" or "meta.description"
21
+ * 3. workflow.json "name" (n8n workflow name)
22
+ * 4. Fallback: "n8n tool: <dirName>"
23
+ */
24
+ export declare function loadN8nTool(dirPath: string, manifest: ToolManifest): Promise<LoadedTool>;
25
+ //# sourceMappingURL=N8nLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"N8nLoader.d.ts","sourceRoot":"","sources":["../../../src/discovery/load/N8nLoader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG5D,uGAAuG;AACvG,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,gBAAgB,GAAE,MAAwB,GACzC,OAAO,CAAC,YAAY,CAAC,CAwDvB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,UAAU,CAAC,CAMrB"}
@@ -0,0 +1,20 @@
1
+ import type { ToolManifest, LoadedTool } from "../types.js";
2
+ /**
3
+ * Load a Skill tool from its directory following Anthropic's Agent Skills spec.
4
+ *
5
+ * Requires a SKILL.md file with YAML frontmatter (name, description).
6
+ * The SKILL.md body provides instructions (Level 2), and bundled files
7
+ * in the directory provide resources (Level 3).
8
+ *
9
+ * Optionally loads a handler function (handler.js/mjs) for programmatic execution.
10
+ *
11
+ * @see https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview
12
+ */
13
+ export declare function loadSkillTool(dirPath: string, manifest: ToolManifest, extensions?: string[]): Promise<LoadedTool>;
14
+ /**
15
+ * Load one or more skill programs from a directory.
16
+ * When manifest.programs is set (e.g. { "default": "handler.js", "report": "report.js" }),
17
+ * returns one LoadedTool per program; otherwise returns a single LoadedTool (entryPoint or "handler").
18
+ */
19
+ export declare function loadSkillTools(dirPath: string, manifest: ToolManifest, extensions?: string[]): Promise<LoadedTool[]>;
20
+ //# sourceMappingURL=SkillLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillLoader.d.ts","sourceRoot":"","sources":["../../../src/discovery/load/SkillLoader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAuG5D;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,YAAY,EACtB,UAAU,CAAC,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,UAAU,CAAC,CAMrB;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,YAAY,EACtB,UAAU,CAAC,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,UAAU,EAAE,CAAC,CA8DvB"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Parsed SKILL.md manifest following Anthropic's Agent Skills specification.
3
+ *
4
+ * A SKILL.md file has:
5
+ * - YAML frontmatter with `name` and `description` (Level 1: metadata, always loaded)
6
+ * - Markdown body with instructions (Level 2: loaded when triggered)
7
+ * - Bundled resource files referenced from the body (Level 3: loaded as needed)
8
+ *
9
+ * @see https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview
10
+ */
11
+ /**
12
+ * YAML frontmatter from SKILL.md (Agent Skills spec).
13
+ * Level 1 (metadata) — always loaded at startup for discovery.
14
+ * @see https://agentskills.io/specification
15
+ */
16
+ export interface SkillFrontmatter {
17
+ /**
18
+ * Skill name identifier (required).
19
+ * - Max 64 characters; lowercase letters, numbers, hyphens only
20
+ * - Must not start or end with hyphen; no consecutive hyphens
21
+ */
22
+ name: string;
23
+ /**
24
+ * What the skill does and when to use it (required).
25
+ * - Max 1024 characters
26
+ */
27
+ description: string;
28
+ /** Optional: license name or reference (e.g. Apache-2.0, LICENSE.txt). */
29
+ license?: string;
30
+ /** Optional: environment requirements, max 500 characters. */
31
+ compatibility?: string;
32
+ /** Optional: arbitrary key-value metadata. */
33
+ metadata?: Record<string, string>;
34
+ /** Optional: space-delimited list of pre-approved tools (experimental). */
35
+ allowedTools?: string;
36
+ }
37
+ /**
38
+ * A resource file bundled with the skill.
39
+ * Resources are Level 3 — loaded only as needed during execution.
40
+ */
41
+ export interface SkillResource {
42
+ /** Relative path from the skill directory */
43
+ relativePath: string;
44
+ /** Absolute path on disk */
45
+ absolutePath: string;
46
+ /** File extension (e.g., ".md", ".py", ".json") */
47
+ extension: string;
48
+ /** Resource type inferred from extension */
49
+ type: "instructions" | "code" | "data";
50
+ }
51
+ /**
52
+ * Full parsed SKILL.md with progressive disclosure levels.
53
+ */
54
+ export interface SkillDefinition {
55
+ /** Level 1: Metadata from YAML frontmatter (always loaded, ~100 tokens) */
56
+ frontmatter: SkillFrontmatter;
57
+ /** Level 2: Markdown body instructions (loaded when skill triggered, <5k tokens recommended) */
58
+ instructions: string;
59
+ /** Level 3: Bundled resource files (loaded as needed, effectively unlimited) */
60
+ resources: SkillResource[];
61
+ /** Absolute path to the skill directory */
62
+ dirPath: string;
63
+ /** Absolute path to the SKILL.md file */
64
+ skillMdPath: string;
65
+ }
66
+ /**
67
+ * Validation error for SKILL.md parsing.
68
+ */
69
+ export declare class SkillManifestError extends Error {
70
+ readonly path: string;
71
+ readonly field: string;
72
+ constructor(path: string, field: string, message: string);
73
+ }
74
+ /**
75
+ * Validate a SkillFrontmatter object.
76
+ * Throws SkillManifestError if invalid.
77
+ */
78
+ export declare function validateFrontmatter(fm: Partial<SkillFrontmatter>, filePath: string): asserts fm is SkillFrontmatter;
79
+ //# sourceMappingURL=SkillManifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillManifest.d.ts","sourceRoot":"","sources":["../../../src/discovery/load/SkillManifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAElC,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,WAAW,EAAE,gBAAgB,CAAC;IAE9B,gGAAgG;IAChG,YAAY,EAAE,MAAM,CAAC;IAErB,gFAAgF;IAChF,SAAS,EAAE,aAAa,EAAE,CAAC;IAE3B,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAEhB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;aAEzB,IAAI,EAAE,MAAM;aACZ,KAAK,EAAE,MAAM;gBADb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EAC7B,OAAO,EAAE,MAAM;CAKlB;AAWD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,OAAO,CAAC,gBAAgB,CAAC,EAC7B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,EAAE,IAAI,gBAAgB,CA+EhC"}