matimo 0.1.0-alpha.2 → 0.1.0-alpha.4

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 (149) hide show
  1. package/README.md +128 -548
  2. package/package.json +24 -28
  3. package/packages/cli/bin/matimo.cjs +26 -0
  4. package/packages/cli/dist/cli.d.ts +6 -0
  5. package/packages/cli/dist/cli.d.ts.map +1 -0
  6. package/packages/cli/dist/cli.js +95 -0
  7. package/packages/cli/dist/cli.js.map +1 -0
  8. package/packages/cli/dist/commands/install.d.ts +6 -0
  9. package/packages/cli/dist/commands/install.d.ts.map +1 -0
  10. package/packages/cli/dist/commands/install.js +48 -0
  11. package/packages/cli/dist/commands/install.js.map +1 -0
  12. package/packages/cli/dist/commands/list.d.ts +9 -0
  13. package/packages/cli/dist/commands/list.d.ts.map +1 -0
  14. package/packages/cli/dist/commands/list.js +70 -0
  15. package/packages/cli/dist/commands/list.js.map +1 -0
  16. package/packages/cli/dist/commands/search.d.ts +2 -0
  17. package/packages/cli/dist/commands/search.d.ts.map +1 -0
  18. package/packages/cli/dist/commands/search.js +148 -0
  19. package/packages/cli/dist/commands/search.js.map +1 -0
  20. package/packages/core/dist/src/auth/oauth2-config.d.ts.map +1 -0
  21. package/packages/core/dist/src/auth/oauth2-config.js.map +1 -0
  22. package/packages/core/dist/src/auth/oauth2-handler.d.ts.map +1 -0
  23. package/packages/core/dist/src/auth/oauth2-handler.js.map +1 -0
  24. package/packages/core/dist/src/auth/oauth2-provider-loader.d.ts.map +1 -0
  25. package/packages/core/dist/src/auth/oauth2-provider-loader.js.map +1 -0
  26. package/{dist → packages/core/dist/src}/core/schema.d.ts +12 -2
  27. package/packages/core/dist/src/core/schema.d.ts.map +1 -0
  28. package/{dist → packages/core/dist/src}/core/schema.js +20 -6
  29. package/packages/core/dist/src/core/schema.js.map +1 -0
  30. package/{dist → packages/core/dist/src}/core/tool-loader.d.ts +16 -0
  31. package/packages/core/dist/src/core/tool-loader.d.ts.map +1 -0
  32. package/packages/core/dist/src/core/tool-loader.js +205 -0
  33. package/packages/core/dist/src/core/tool-loader.js.map +1 -0
  34. package/packages/core/dist/src/core/tool-registry.d.ts.map +1 -0
  35. package/{dist → packages/core/dist/src}/core/tool-registry.js +5 -1
  36. package/packages/core/dist/src/core/tool-registry.js.map +1 -0
  37. package/{dist → packages/core/dist/src}/core/types.d.ts +15 -1
  38. package/packages/core/dist/src/core/types.d.ts.map +1 -0
  39. package/{dist → packages/core/dist/src}/core/types.js.map +1 -1
  40. package/packages/core/dist/src/decorators/index.d.ts.map +1 -0
  41. package/packages/core/dist/src/decorators/index.js.map +1 -0
  42. package/packages/core/dist/src/decorators/tool-decorator.d.ts.map +1 -0
  43. package/{dist → packages/core/dist/src}/decorators/tool-decorator.js +7 -4
  44. package/packages/core/dist/src/decorators/tool-decorator.js.map +1 -0
  45. package/packages/core/dist/src/encodings/parameter-encoding.d.ts.map +1 -0
  46. package/{dist → packages/core/dist/src}/encodings/parameter-encoding.js +9 -2
  47. package/packages/core/dist/src/encodings/parameter-encoding.js.map +1 -0
  48. package/packages/core/dist/src/errors/matimo-error.d.ts.map +1 -0
  49. package/packages/core/dist/src/errors/matimo-error.js.map +1 -0
  50. package/packages/core/dist/src/executors/command-executor.d.ts.map +1 -0
  51. package/{dist → packages/core/dist/src}/executors/command-executor.js +5 -1
  52. package/packages/core/dist/src/executors/command-executor.js.map +1 -0
  53. package/packages/core/dist/src/executors/function-executor.d.ts +23 -0
  54. package/packages/core/dist/src/executors/function-executor.d.ts.map +1 -0
  55. package/packages/core/dist/src/executors/function-executor.js +164 -0
  56. package/packages/core/dist/src/executors/function-executor.js.map +1 -0
  57. package/packages/core/dist/src/executors/http-executor.d.ts.map +1 -0
  58. package/{dist → packages/core/dist/src}/executors/http-executor.js +5 -1
  59. package/packages/core/dist/src/executors/http-executor.js.map +1 -0
  60. package/{dist → packages/core/dist/src}/index.d.ts +5 -1
  61. package/packages/core/dist/src/index.d.ts.map +1 -0
  62. package/{dist → packages/core/dist/src}/index.js +3 -0
  63. package/packages/core/dist/src/index.js.map +1 -0
  64. package/packages/core/dist/src/integrations/langchain.d.ts +46 -0
  65. package/packages/core/dist/src/integrations/langchain.d.ts.map +1 -0
  66. package/packages/core/dist/src/integrations/langchain.js +197 -0
  67. package/packages/core/dist/src/integrations/langchain.js.map +1 -0
  68. package/{dist → packages/core/dist/src}/matimo-instance.d.ts +30 -4
  69. package/packages/core/dist/src/matimo-instance.d.ts.map +1 -0
  70. package/{dist → packages/core/dist/src}/matimo-instance.js +63 -10
  71. package/packages/core/dist/src/matimo-instance.js.map +1 -0
  72. package/packages/core/dist/tools/calculator/calculator.d.ts +26 -0
  73. package/packages/core/dist/tools/calculator/calculator.d.ts.map +1 -0
  74. package/packages/core/dist/tools/calculator/calculator.js +104 -0
  75. package/packages/core/dist/tools/calculator/calculator.js.map +1 -0
  76. package/packages/core/dist/tsconfig.tsbuildinfo +1 -0
  77. package/dist/auth/oauth2-config.d.ts.map +0 -1
  78. package/dist/auth/oauth2-config.js.map +0 -1
  79. package/dist/auth/oauth2-handler.d.ts.map +0 -1
  80. package/dist/auth/oauth2-handler.js.map +0 -1
  81. package/dist/auth/oauth2-provider-loader.d.ts.map +0 -1
  82. package/dist/auth/oauth2-provider-loader.js.map +0 -1
  83. package/dist/core/schema.d.ts.map +0 -1
  84. package/dist/core/schema.js.map +0 -1
  85. package/dist/core/tool-loader.d.ts.map +0 -1
  86. package/dist/core/tool-loader.js +0 -98
  87. package/dist/core/tool-loader.js.map +0 -1
  88. package/dist/core/tool-registry.d.ts.map +0 -1
  89. package/dist/core/tool-registry.js.map +0 -1
  90. package/dist/core/types.d.ts.map +0 -1
  91. package/dist/decorators/index.d.ts.map +0 -1
  92. package/dist/decorators/index.js.map +0 -1
  93. package/dist/decorators/tool-decorator.d.ts.map +0 -1
  94. package/dist/decorators/tool-decorator.js.map +0 -1
  95. package/dist/encodings/parameter-encoding.d.ts.map +0 -1
  96. package/dist/encodings/parameter-encoding.js.map +0 -1
  97. package/dist/errors/matimo-error.d.ts.map +0 -1
  98. package/dist/errors/matimo-error.js.map +0 -1
  99. package/dist/executors/command-executor.d.ts.map +0 -1
  100. package/dist/executors/command-executor.js.map +0 -1
  101. package/dist/executors/http-executor.d.ts.map +0 -1
  102. package/dist/executors/http-executor.js.map +0 -1
  103. package/dist/index.d.ts.map +0 -1
  104. package/dist/index.js.map +0 -1
  105. package/dist/matimo-instance.d.ts.map +0 -1
  106. package/dist/matimo-instance.js.map +0 -1
  107. package/docs/Gemfile +0 -5
  108. package/docs/RELEASES.md +0 -90
  109. package/docs/ROADMAP.md +0 -138
  110. package/docs/_config.yml +0 -27
  111. package/docs/api-reference/ERRORS.md +0 -445
  112. package/docs/api-reference/SDK.md +0 -582
  113. package/docs/api-reference/TYPES.md +0 -415
  114. package/docs/architecture/OAUTH.md +0 -1366
  115. package/docs/architecture/OVERVIEW.md +0 -564
  116. package/docs/assets/logo.png +0 -0
  117. package/docs/community/COMMIT_GUIDELINES.md +0 -552
  118. package/docs/framework-integrations/LANGCHAIN.md +0 -286
  119. package/docs/getting-started/QUICK_START.md +0 -212
  120. package/docs/getting-started/YOUR_FIRST_TOOL.md +0 -217
  121. package/docs/getting-started/installation.md +0 -124
  122. package/docs/index.md +0 -289
  123. package/docs/tool-development/DECORATOR_GUIDE.md +0 -633
  124. package/docs/tool-development/OAUTH_LINK.md +0 -5
  125. package/docs/tool-development/PROVIDER_CONFIGURATION.md +0 -458
  126. package/docs/tool-development/TESTING.md +0 -412
  127. package/docs/tool-development/TOOL_SPECIFICATION.md +0 -793
  128. package/docs/tool-development/YAML_TOOLS.md +0 -65
  129. package/docs/troubleshooting/FAQ.md +0 -391
  130. package/docs/user-guide/AUTHENTICATION.md +0 -255
  131. package/docs/user-guide/DEVELOPMENT_STANDARDS.md +0 -698
  132. package/docs/user-guide/SDK_PATTERNS.md +0 -316
  133. package/docs/user-guide/TOOL_DISCOVERY.md +0 -209
  134. /package/{dist → packages/core/dist/src}/auth/oauth2-config.d.ts +0 -0
  135. /package/{dist → packages/core/dist/src}/auth/oauth2-config.js +0 -0
  136. /package/{dist → packages/core/dist/src}/auth/oauth2-handler.d.ts +0 -0
  137. /package/{dist → packages/core/dist/src}/auth/oauth2-handler.js +0 -0
  138. /package/{dist → packages/core/dist/src}/auth/oauth2-provider-loader.d.ts +0 -0
  139. /package/{dist → packages/core/dist/src}/auth/oauth2-provider-loader.js +0 -0
  140. /package/{dist → packages/core/dist/src}/core/tool-registry.d.ts +0 -0
  141. /package/{dist → packages/core/dist/src}/core/types.js +0 -0
  142. /package/{dist → packages/core/dist/src}/decorators/index.d.ts +0 -0
  143. /package/{dist → packages/core/dist/src}/decorators/index.js +0 -0
  144. /package/{dist → packages/core/dist/src}/decorators/tool-decorator.d.ts +0 -0
  145. /package/{dist → packages/core/dist/src}/encodings/parameter-encoding.d.ts +0 -0
  146. /package/{dist → packages/core/dist/src}/errors/matimo-error.d.ts +0 -0
  147. /package/{dist → packages/core/dist/src}/errors/matimo-error.js +0 -0
  148. /package/{dist → packages/core/dist/src}/executors/command-executor.d.ts +0 -0
  149. /package/{dist → packages/core/dist/src}/executors/http-executor.d.ts +0 -0
@@ -0,0 +1,164 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { pathToFileURL } from 'node:url';
4
+ import axios from 'axios';
5
+ import { MatimoError, ErrorCode } from '../errors/matimo-error';
6
+ /**
7
+ * FunctionExecutor - Executes async functions
8
+ * Supports functions defined in:
9
+ * 1. Embedded code in tool YAML (legacy)
10
+ * 2. Colocated .ts files (recommended)
11
+ *
12
+ * For .ts files, the tool directory structure should be:
13
+ * tools/provider/tool-name/
14
+ * ├── definition.yaml
15
+ * └── tool-name.ts (exports default async function)
16
+ */
17
+ export class FunctionExecutor {
18
+ constructor(toolsPath) {
19
+ this.toolsPath = toolsPath || process.cwd();
20
+ }
21
+ /**
22
+ * Execute a tool that runs an async function
23
+ * Supports both embedded code and external .ts/.js files
24
+ */
25
+ async execute(tool, params) {
26
+ if (tool.execution.type !== 'function') {
27
+ throw new MatimoError('Tool execution type is not function', ErrorCode.EXECUTION_FAILED, {
28
+ expectedType: 'function',
29
+ actualType: tool.execution.type,
30
+ });
31
+ }
32
+ const { code, timeout = 30000 } = tool.execution;
33
+ const startTime = Date.now();
34
+ if (!code || code.trim().length === 0) {
35
+ throw new MatimoError('Function code is empty', ErrorCode.EXECUTION_FAILED, {
36
+ toolName: tool.name,
37
+ });
38
+ }
39
+ return new Promise((resolve) => {
40
+ let timedOut = false;
41
+ let settled = false;
42
+ // Set up timeout that properly rejects
43
+ const timer = setTimeout(() => {
44
+ timedOut = true;
45
+ if (!settled) {
46
+ settled = true;
47
+ resolve({
48
+ success: false,
49
+ error: 'Function execution timeout',
50
+ duration: Date.now() - startTime,
51
+ });
52
+ }
53
+ }, timeout);
54
+ const cleanup = () => {
55
+ clearTimeout(timer);
56
+ };
57
+ const handleError = (error) => {
58
+ cleanup();
59
+ if (!settled) {
60
+ settled = true;
61
+ resolve({
62
+ success: false,
63
+ error: error instanceof Error ? error.message : String(error),
64
+ duration: Date.now() - startTime,
65
+ });
66
+ }
67
+ };
68
+ const handleSuccess = (data) => {
69
+ cleanup();
70
+ if (!settled) {
71
+ settled = true;
72
+ if (timedOut) {
73
+ resolve({
74
+ success: false,
75
+ error: 'Function execution timeout',
76
+ duration: Date.now() - startTime,
77
+ });
78
+ }
79
+ else {
80
+ resolve(data);
81
+ }
82
+ }
83
+ };
84
+ try {
85
+ // Check if code is a file path (starts with ./ or contains .ts or .js)
86
+ if (code.includes('.ts') || code.includes('.js') || code.startsWith('./')) {
87
+ // Load from external file using dynamic import()
88
+ // This works with TypeScript via ESM import
89
+ // Resolve relative to the tool definition file location
90
+ let absolutePath;
91
+ if (tool._definitionPath) {
92
+ // Use the definition file directory as the base for relative paths
93
+ const definitionDir = path.dirname(tool._definitionPath);
94
+ absolutePath = path.resolve(definitionDir, code);
95
+ }
96
+ else {
97
+ // Fallback: use the old logic (for backward compatibility)
98
+ // Compute tool directory: tools/{provider}/{tool-name}/
99
+ const toolName = tool.name;
100
+ let toolDir;
101
+ if (toolName.includes('-')) {
102
+ const parts = toolName.split('-');
103
+ const provider = parts[0];
104
+ toolDir = path.join(this.toolsPath, provider, toolName);
105
+ }
106
+ else {
107
+ toolDir = path.join(this.toolsPath, toolName);
108
+ }
109
+ absolutePath = path.resolve(toolDir, code);
110
+ }
111
+ const fileUrl = pathToFileURL(absolutePath).href;
112
+ // Use dynamic import() for ESM/TypeScript compatibility with robust URL handling
113
+ import(fileUrl)
114
+ .then((module) => {
115
+ const fn = (module.default || module);
116
+ const result = fn(params);
117
+ // Handle both Promise and non-Promise returns
118
+ if (result instanceof Promise) {
119
+ result.then(handleSuccess).catch(handleError);
120
+ }
121
+ else {
122
+ handleSuccess(result);
123
+ }
124
+ })
125
+ .catch(handleError);
126
+ }
127
+ else {
128
+ // Execute embedded code (legacy) - create function from string
129
+ // SECURITY WARNING: Embedded code execution runs arbitrary JS with fs/path/axios access.
130
+ // This is a potential RCE vector if tool YAML files come from untrusted sources.
131
+ // Embedded code is DISABLED by default. Must explicitly opt-in via MATIMO_ALLOW_EMBEDDED_CODE=true
132
+ const embeddedCodeDisabled = process.env.MATIMO_ALLOW_EMBEDDED_CODE !== 'true';
133
+ if (embeddedCodeDisabled) {
134
+ throw new MatimoError('Embedded code execution is disabled by default for security. Use external .ts/.js files instead.', ErrorCode.EXECUTION_FAILED, {
135
+ toolName: tool.name,
136
+ recommendation: 'Create a separate .ts file in the tool directory instead of using embedded code',
137
+ enableFeatureFlag: 'Set MATIMO_ALLOW_EMBEDDED_CODE=true to enable (not recommended)',
138
+ });
139
+ }
140
+ // Log warning when embedded code is executed
141
+ console.info(`⚠️ Warning: Executing embedded code from tool '${tool.name}'. This carries security risks if tool YAML is from untrusted sources.`);
142
+ // In ESM modules, require is not available by default
143
+ // We pass a safe require function that embedded code can use
144
+ const functionBody = `return (${code})`;
145
+ const fn = new Function(functionBody)();
146
+ // Pass undefined for require in ESM - embedded code should use import syntax
147
+ const result = fn(params, {}, fs, path, axios, undefined);
148
+ // Handle both Promise and non-Promise returns
149
+ if (result instanceof Promise) {
150
+ result.then(handleSuccess).catch(handleError);
151
+ }
152
+ else {
153
+ handleSuccess(result);
154
+ }
155
+ }
156
+ }
157
+ catch (error) {
158
+ handleError(error);
159
+ }
160
+ });
161
+ }
162
+ }
163
+ export default FunctionExecutor;
164
+ //# sourceMappingURL=function-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-executor.js","sourceRoot":"","sources":["../../../src/executors/function-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,MAAM,OAAO,gBAAgB;IAG3B,YAAY,SAAkB;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,IAAoB,EAAE,MAA+B;QACjE,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACvC,MAAM,IAAI,WAAW,CAAC,qCAAqC,EAAE,SAAS,CAAC,gBAAgB,EAAE;gBACvF,YAAY,EAAE,UAAU;gBACxB,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI;aAChC,CAAC,CAAC;QACL,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,IAAI,CAAC,IAAI,IAAI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C,IAAI,CACV,mDAAmD,IAAI,CAAC,IAAI,wEAAwE,CACrI,CAAC;oBAEF,sDAAsD;oBACtD,6DAA6D;oBAC7D,MAAM,YAAY,GAAG,WAAW,IAAI,GAAG,CAAC;oBACxC,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,YAAY,CAAC,EAOhB,CAAC;oBACtB,6EAA6E;oBAC7E,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;oBAE1D,8CAA8C;oBAC9C,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;wBAC9B,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;oBAChD,CAAC;yBAAM,CAAC;wBACN,aAAa,CAAC,MAAM,CAAC,CAAC;oBACxB,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,WAAW,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-executor.d.ts","sourceRoot":"","sources":["../../../src/executors/http-executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIhD;;;GAGG;AAEH,qBAAa,YAAY;IACvB;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAoFtF;;OAEG;IACH,OAAO,CAAC,cAAc;IAWtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAexB;;;OAGG;IACH,OAAO,CAAC,cAAc;CA2BvB;AAED,eAAe,YAAY,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import axios from 'axios';
2
2
  import { applyParameterEncodings } from '../encodings/parameter-encoding';
3
+ import { MatimoError, ErrorCode } from '../errors/matimo-error';
3
4
  /**
4
5
  * HttpExecutor - Executes HTTP requests
5
6
  * Handles authentication, retries, and response validation
@@ -10,7 +11,10 @@ export class HttpExecutor {
10
11
  */
11
12
  async execute(tool, params) {
12
13
  if (tool.execution.type !== 'http') {
13
- throw new Error('Tool execution type is not http');
14
+ throw new MatimoError('Tool execution type is not http', ErrorCode.EXECUTION_FAILED, {
15
+ expectedType: 'http',
16
+ actualType: tool.execution.type,
17
+ });
14
18
  }
15
19
  const { method, url, headers = {}, body, timeout, query_params, parameter_encoding, } = tool.execution;
16
20
  const queryParams = query_params;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-executor.js","sourceRoot":"","sources":["../../../src/executors/http-executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;GAGG;AAEH,MAAM,OAAO,YAAY;IACvB;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,IAAoB,EAAE,MAA+B;QACjE,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACnC,MAAM,IAAI,WAAW,CAAC,iCAAiC,EAAE,SAAS,CAAC,gBAAgB,EAAE;gBACnF,YAAY,EAAE,MAAM;gBACpB,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI;aAChC,CAAC,CAAC;QACL,CAAC;QAED,MAAM,EACJ,MAAM,EACN,GAAG,EACH,OAAO,GAAG,EAAE,EACZ,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,kBAAkB,GACnB,GAAG,IAAI,CAAC,SAAS,CAAC;QACnB,MAAM,WAAW,GAAG,YAAY,CAAC;QACjC,MAAM,kBAAkB,GAAG,kBAAkB,CAA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AG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBAC/B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;wBAC7B,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBAC3C,CAAC;yBAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;wBAC7E,OAAO,IAAI,CAAC,cAAc,CAAC,IAA+B,EAAE,MAAM,CAAC,CAAC;oBACtE,CAAC;oBACD,OAAO,IAAI,CAAC;gBACd,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACtB,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,eAAe,YAAY,CAAC"}
@@ -4,19 +4,23 @@
4
4
  * Framework-agnostic SDK that enables any developer to integrate 1000+ tools
5
5
  * across any AI framework (LangChain, CrewAI, Anthropic SDK, etc.).
6
6
  */
7
- export type { Parameter, AuthConfig, HttpExecution, CommandExecution, OutputSchema, RateLimitConfig, ErrorHandlingConfig, } from './core/types';
7
+ export type { Parameter, AuthConfig, HttpExecution, CommandExecution, FunctionExecution, OutputSchema, RateLimitConfig, ErrorHandlingConfig, ToolDefinition, } from './core/types';
8
8
  export { ParameterSchema, AuthConfigSchema, ExecutionConfigSchema } from './core/schema';
9
9
  export { ToolLoader } from './core/tool-loader';
10
10
  export { ToolRegistry } from './core/tool-registry';
11
11
  export { CommandExecutor } from './executors/command-executor';
12
12
  export { HttpExecutor } from './executors/http-executor';
13
+ export { FunctionExecutor } from './executors/function-executor';
13
14
  export { applyParameterEncodings } from './encodings/parameter-encoding';
14
15
  export type { ParameterEncodingConfig } from './encodings/parameter-encoding';
15
16
  export { tool, setGlobalMatimoInstance, getGlobalMatimoInstance, } from './decorators/tool-decorator';
16
17
  export { MatimoError, ErrorCode, createValidationError, createExecutionError, } from './errors/matimo-error';
17
18
  export { MatimoInstance, matimo } from './matimo-instance';
19
+ export type { InitOptions } from './matimo-instance';
18
20
  export type { OAuth2Provider, OAuth2Token, OAuth2Config, AuthorizationOptions, TokenResponse, OAuth2Endpoints, } from './auth/oauth2-config';
19
21
  export type { ProviderDefinition } from './core/schema';
20
22
  export { OAuth2ProviderLoader } from './auth/oauth2-provider-loader';
21
23
  export { OAuth2Handler } from './auth/oauth2-handler';
24
+ export { convertToolsToLangChain } from './integrations/langchain';
25
+ export type { LangChainTool } from './integrations/langchain';
22
26
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,YAAY,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAG9E,OAAO,EACL,IAAI,EACJ,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,WAAW,EACX,SAAS,EACT,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,YAAY,EACV,cAAc,EACd,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC"}
@@ -10,6 +10,7 @@ export { ToolRegistry } from './core/tool-registry';
10
10
  // Executors
11
11
  export { CommandExecutor } from './executors/command-executor';
12
12
  export { HttpExecutor } from './executors/http-executor';
13
+ export { FunctionExecutor } from './executors/function-executor';
13
14
  // Parameter Encoding
14
15
  export { applyParameterEncodings } from './encodings/parameter-encoding';
15
16
  // Decorators
@@ -20,4 +21,6 @@ export { MatimoError, ErrorCode, createValidationError, createExecutionError, }
20
21
  export { MatimoInstance, matimo } from './matimo-instance';
21
22
  export { OAuth2ProviderLoader } from './auth/oauth2-provider-loader';
22
23
  export { OAuth2Handler } from './auth/oauth2-handler';
24
+ // LangChain integration
25
+ export { convertToolsToLangChain } from './integrations/langchain';
23
26
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,YAAY;AACZ,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,qBAAqB;AACrB,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,aAAa;AACb,OAAO,EACL,IAAI,EACJ,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AAErC,iBAAiB;AACjB,OAAO,EACL,WAAW,EACX,SAAS,EACT,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,gCAAgC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAa3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,wBAAwB;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * LangChain Integration for Matimo
3
+ *
4
+ * Converts Matimo tools to LangChain-compatible format.
5
+ * Simple, lightweight, scales to 2000+ tools.
6
+ *
7
+ * NOTE: Requires @langchain/core as peer dependency.
8
+ * Install with: npm install @langchain/core langchain
9
+ *
10
+ * Usage:
11
+ * const matimo = await MatimoInstance.init('./tools');
12
+ * const langchainTools = await convertToolsToLangChain(
13
+ * matimo.listTools(),
14
+ * matimo,
15
+ * { SLACK_BOT_TOKEN: process.env.SLACK_BOT_TOKEN }
16
+ * );
17
+ */
18
+ import { z } from 'zod';
19
+ import type { ToolDefinition } from '../core/types';
20
+ import type { MatimoInstance } from '../matimo-instance';
21
+ export interface LangChainTool {
22
+ name: string;
23
+ description: string;
24
+ schema: z.ZodSchema;
25
+ invoke: (input: Record<string, unknown>) => Promise<unknown>;
26
+ }
27
+ /**
28
+ * Convert Matimo tools to LangChain format
29
+ *
30
+ * @param tools - Matimo tools
31
+ * @param matimo - MatimoInstance
32
+ * @param secrets - Map of parameter names to secret values
33
+ * @param secretParamNames - Explicitly declared secret parameters (optional)
34
+ * @returns LangChain tools
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const tools = await convertToolsToLangChain(
39
+ * matimo.listTools().filter(t => t.name.startsWith('slack')),
40
+ * matimo,
41
+ * { SLACK_BOT_TOKEN: process.env.SLACK_BOT_TOKEN }
42
+ * );
43
+ * ```
44
+ */
45
+ export declare function convertToolsToLangChain(tools: ToolDefinition[], matimo: MatimoInstance, secrets?: Record<string, string>, secretParamNames?: Set<string>): Promise<LangChainTool[]>;
46
+ //# sourceMappingURL=langchain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"langchain.d.ts","sourceRoot":"","sources":["../../../src/integrations/langchain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC;IACpB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9D;AAgMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,cAAc,EAAE,EACvB,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACpC,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAC7B,OAAO,CAAC,aAAa,EAAE,CAAC,CAiB1B"}
@@ -0,0 +1,197 @@
1
+ /**
2
+ * LangChain Integration for Matimo
3
+ *
4
+ * Converts Matimo tools to LangChain-compatible format.
5
+ * Simple, lightweight, scales to 2000+ tools.
6
+ *
7
+ * NOTE: Requires @langchain/core as peer dependency.
8
+ * Install with: npm install @langchain/core langchain
9
+ *
10
+ * Usage:
11
+ * const matimo = await MatimoInstance.init('./tools');
12
+ * const langchainTools = await convertToolsToLangChain(
13
+ * matimo.listTools(),
14
+ * matimo,
15
+ * { SLACK_BOT_TOKEN: process.env.SLACK_BOT_TOKEN }
16
+ * );
17
+ */
18
+ import { z } from 'zod';
19
+ // Lazy load LangChain to avoid hard dependency
20
+ let langChainToolFn = null;
21
+ async function getLangChainTool() {
22
+ if (!langChainToolFn) {
23
+ try {
24
+ const langChainModule = await import('@langchain/core/tools');
25
+ langChainToolFn = langChainModule.tool;
26
+ }
27
+ catch {
28
+ throw new Error('LangChain not installed. Install: npm install @langchain/core langchain');
29
+ }
30
+ }
31
+ return langChainToolFn;
32
+ }
33
+ /**
34
+ * Convert parameter to Zod schema
35
+ *
36
+ * Supports:
37
+ * - enum constraints (if present, validates against allowed values)
38
+ * - default values (sets default in schema)
39
+ * - type validation (string, number, boolean, array, object)
40
+ * - description and required metadata
41
+ */
42
+ function parameterToZod(param) {
43
+ let schema;
44
+ // If enum is present, validate against allowed values
45
+ if (param.enum && param.enum.length > 0) {
46
+ // Create enum schema from allowed values using z.union for mixed types
47
+ const enumSchemas = param.enum.map((value) => z.literal(value));
48
+ // Build union from array of literal schemas (type-safe via unknown cast)
49
+ schema = z.union(enumSchemas);
50
+ }
51
+ else {
52
+ switch (param.type) {
53
+ case 'string':
54
+ schema = z.string();
55
+ break;
56
+ case 'number':
57
+ schema = z.number();
58
+ break;
59
+ case 'boolean':
60
+ schema = z.boolean();
61
+ break;
62
+ case 'array': {
63
+ const itemSchema = param.items ? parameterToZod(param.items) : z.unknown();
64
+ schema = z.array(itemSchema);
65
+ break;
66
+ }
67
+ case 'object': {
68
+ if (param.properties) {
69
+ const props = {};
70
+ for (const [key, prop] of Object.entries(param.properties)) {
71
+ props[key] = parameterToZod(prop);
72
+ }
73
+ schema = z.object(props);
74
+ }
75
+ else {
76
+ schema = z.record(z.string(), z.unknown());
77
+ }
78
+ break;
79
+ }
80
+ default:
81
+ schema = z.unknown();
82
+ }
83
+ }
84
+ if (param.description) {
85
+ schema = schema.describe(param.description);
86
+ }
87
+ // Apply default value if present
88
+ if (param.default !== undefined) {
89
+ schema = schema.default(param.default);
90
+ }
91
+ if (!param.required) {
92
+ schema = schema.optional();
93
+ }
94
+ return schema;
95
+ }
96
+ /**
97
+ * Auto-detect if a parameter name looks like a secret
98
+ * based on common patterns (TOKEN, KEY, SECRET, PASSWORD)
99
+ *
100
+ * Uses word-boundary matching and camelCase detection to avoid false positives:
101
+ * - ✅ Matches: "api_token", "API_KEY", "getToken", "secret", "password_hash"
102
+ * - ❌ Rejects: "monkey", "turkey_id", "donkey" (substrings only)
103
+ */
104
+ function isSecretParameter(paramName) {
105
+ const upperName = paramName.toUpperCase();
106
+ // Pattern 1: Word boundaries (works for snake_case: api_token, API_KEY)
107
+ if (/\b(TOKEN|KEY|SECRET|PASSWORD)\b/.test(upperName)) {
108
+ return true;
109
+ }
110
+ // Pattern 2: Underscore prefix/suffix (works for snake_case: _token_, prefix_token_)
111
+ if (/(^|_)(TOKEN|KEY|SECRET|PASSWORD)(_|$)/.test(upperName)) {
112
+ return true;
113
+ }
114
+ // Pattern 3: CamelCase detection (works for camelCase: getToken, apiKey)
115
+ // Check if secret word appears after a lowercase letter (camelCase boundary)
116
+ if (/[a-z](TOKEN|KEY|SECRET|PASSWORD)/.test(paramName)) {
117
+ return true;
118
+ }
119
+ return false;
120
+ }
121
+ /**
122
+ * Build Zod schema for tool input, excluding secret parameters
123
+ */
124
+ function buildInputSchema(tool, secretParams) {
125
+ if (!tool.parameters) {
126
+ return z.object({});
127
+ }
128
+ const shape = {};
129
+ for (const [name, param] of Object.entries(tool.parameters)) {
130
+ if (secretParams.has(name)) {
131
+ continue; // Skip secrets - they're injected
132
+ }
133
+ shape[name] = parameterToZod(param);
134
+ }
135
+ return z.object(shape);
136
+ }
137
+ /**
138
+ * Convert Matimo tool to LangChain format
139
+ */
140
+ async function convertTool(matimo, tool, secretParams, secrets) {
141
+ const toolFn = await getLangChainTool();
142
+ const schema = buildInputSchema(tool, secretParams);
143
+ return toolFn(async (input) => {
144
+ const params = { ...input };
145
+ // Inject secrets
146
+ for (const param of secretParams) {
147
+ if (param in secrets) {
148
+ params[param] = secrets[param];
149
+ }
150
+ }
151
+ try {
152
+ return await matimo.execute(tool.name, params);
153
+ }
154
+ catch (error) {
155
+ return `Error: ${error instanceof Error ? error.message : String(error)}`;
156
+ }
157
+ }, {
158
+ name: tool.name,
159
+ description: tool.description || tool.name,
160
+ schema,
161
+ });
162
+ }
163
+ /**
164
+ * Convert Matimo tools to LangChain format
165
+ *
166
+ * @param tools - Matimo tools
167
+ * @param matimo - MatimoInstance
168
+ * @param secrets - Map of parameter names to secret values
169
+ * @param secretParamNames - Explicitly declared secret parameters (optional)
170
+ * @returns LangChain tools
171
+ *
172
+ * @example
173
+ * ```ts
174
+ * const tools = await convertToolsToLangChain(
175
+ * matimo.listTools().filter(t => t.name.startsWith('slack')),
176
+ * matimo,
177
+ * { SLACK_BOT_TOKEN: process.env.SLACK_BOT_TOKEN }
178
+ * );
179
+ * ```
180
+ */
181
+ export async function convertToolsToLangChain(tools, matimo, secrets = {}, secretParamNames) {
182
+ // Start with explicitly declared secret param names or auto-detect from secrets keys
183
+ const detectedSecrets = secretParamNames || new Set(Object.keys(secrets));
184
+ // Auto-detect additional secret parameters by scanning all tool parameters
185
+ for (const tool of tools) {
186
+ if (tool.parameters) {
187
+ for (const paramName of Object.keys(tool.parameters)) {
188
+ // Auto-detect if parameter looks like a secret
189
+ if (isSecretParameter(paramName)) {
190
+ detectedSecrets.add(paramName);
191
+ }
192
+ }
193
+ }
194
+ }
195
+ return Promise.all(tools.map((tool) => convertTool(matimo, tool, detectedSecrets, secrets)));
196
+ }
197
+ //# sourceMappingURL=langchain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"langchain.js","sourceRoot":"","sources":["../../../src/integrations/langchain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,+CAA+C;AAC/C,IAAI,eAAe,GASR,IAAI,CAAC;AAEhB,KAAK,UAAU,gBAAgB;IAU7B,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,IAAI,CAAC;YACH,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;YAC9D,eAAe,GAAG,eAAe,CAAC,IAAI,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,cAAc,CAAC,KAAgB;IACtC,IAAI,MAA0B,CAAC;IAE/B,sDAAsD;IACtD,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxC,uEAAuE;QACvE,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAChE,yEAAyE;QACzE,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,WAA2D,CAAC,CAAC;IAChF,CAAC;SAAM,CAAC;QACN,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,QAAQ;gBACX,MAAM,GAAG,CAAC,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AI,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE1E,2EAA2E;IAC3E,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;gBACrD,+CAA+C;gBAC/C,IAAI,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC;oBACjC,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAC/F,CAAC"}
@@ -1,21 +1,47 @@
1
1
  import { ToolDefinition } from './core/schema';
2
+ /**
3
+ * Options for MatimoInstance initialization
4
+ */
5
+ export interface InitOptions {
6
+ toolPaths?: string[];
7
+ autoDiscover?: boolean;
8
+ includeCore?: boolean;
9
+ }
2
10
  /**
3
11
  * Matimo Instance - Single initialization point for tool execution
4
12
  * Combines loader, registry, and executors into one interface
5
13
  */
6
14
  export declare class MatimoInstance {
7
- private toolsPath;
15
+ private toolPaths;
8
16
  private loader;
9
17
  private registry;
10
18
  private commandExecutor;
11
19
  private httpExecutor;
20
+ private functionExecutor;
12
21
  private constructor();
13
22
  /**
14
- * Initialize Matimo with tools from a directory
15
- * @param toolsPath - Path to tools directory
23
+ * Initialize Matimo with tools from directory or auto-discovery
24
+ * @param options - Initialization options (string for backward compatibility)
16
25
  * @returns MatimoInstance ready to execute tools
26
+ *
27
+ * @example
28
+ * // Backward compatible - single path
29
+ * const matimo = await MatimoInstance.init('./tools');
30
+ *
31
+ * // New - auto-discovery
32
+ * const matimo = await MatimoInstance.init({ autoDiscover: true });
33
+ *
34
+ * // Explicit paths
35
+ * const matimo = await MatimoInstance.init({
36
+ * toolPaths: ['./tools', require.resolve('@matimo/slack/tools')]
37
+ * });
38
+ */
39
+ static init(options?: InitOptions | string): Promise<MatimoInstance>;
40
+ /**
41
+ * Get tool paths
42
+ * @returns Array of tool paths
17
43
  */
18
- static init(toolsPath: string): Promise<MatimoInstance>;
44
+ getToolPaths(): string[];
19
45
  /**
20
46
  * Execute a tool by name with parameters
21
47
  * @param toolName - Name of the tool to execute
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matimo-instance.d.ts","sourceRoot":"","sources":["../../src/matimo-instance.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,QAAQ,CAAe;IAC/B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,gBAAgB,CAAmB;IAE3C,OAAO;IAWP;;;;;;;;;;;;;;;;OAgBG;WACU,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA4C1E;;;OAGG;IACH,YAAY,IAAI,MAAM,EAAE;IAIxB;;;;;OAKG;IACG,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAgBlF;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE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