matimo 0.1.0-alpha.1

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 (90) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +651 -0
  3. package/dist/auth/oauth2-config.d.ts +104 -0
  4. package/dist/auth/oauth2-config.d.ts.map +1 -0
  5. package/dist/auth/oauth2-config.js +38 -0
  6. package/dist/auth/oauth2-config.js.map +1 -0
  7. package/dist/auth/oauth2-handler.d.ts +130 -0
  8. package/dist/auth/oauth2-handler.d.ts.map +1 -0
  9. package/dist/auth/oauth2-handler.js +265 -0
  10. package/dist/auth/oauth2-handler.js.map +1 -0
  11. package/dist/auth/oauth2-provider-loader.d.ts +68 -0
  12. package/dist/auth/oauth2-provider-loader.d.ts.map +1 -0
  13. package/dist/auth/oauth2-provider-loader.js +120 -0
  14. package/dist/auth/oauth2-provider-loader.js.map +1 -0
  15. package/dist/core/schema.d.ts +238 -0
  16. package/dist/core/schema.d.ts.map +1 -0
  17. package/dist/core/schema.js +168 -0
  18. package/dist/core/schema.js.map +1 -0
  19. package/dist/core/tool-loader.d.ts +29 -0
  20. package/dist/core/tool-loader.d.ts.map +1 -0
  21. package/dist/core/tool-loader.js +98 -0
  22. package/dist/core/tool-loader.js.map +1 -0
  23. package/dist/core/tool-registry.d.ts +48 -0
  24. package/dist/core/tool-registry.d.ts.map +1 -0
  25. package/dist/core/tool-registry.js +89 -0
  26. package/dist/core/tool-registry.js.map +1 -0
  27. package/dist/core/types.d.ts +143 -0
  28. package/dist/core/types.d.ts.map +1 -0
  29. package/dist/core/types.js +5 -0
  30. package/dist/core/types.js.map +1 -0
  31. package/dist/decorators/index.d.ts +2 -0
  32. package/dist/decorators/index.d.ts.map +1 -0
  33. package/dist/decorators/index.js +2 -0
  34. package/dist/decorators/index.js.map +1 -0
  35. package/dist/decorators/tool-decorator.d.ts +97 -0
  36. package/dist/decorators/tool-decorator.d.ts.map +1 -0
  37. package/dist/decorators/tool-decorator.js +154 -0
  38. package/dist/decorators/tool-decorator.js.map +1 -0
  39. package/dist/encodings/parameter-encoding.d.ts +51 -0
  40. package/dist/encodings/parameter-encoding.d.ts.map +1 -0
  41. package/dist/encodings/parameter-encoding.js +116 -0
  42. package/dist/encodings/parameter-encoding.js.map +1 -0
  43. package/dist/errors/matimo-error.d.ts +34 -0
  44. package/dist/errors/matimo-error.d.ts.map +1 -0
  45. package/dist/errors/matimo-error.js +49 -0
  46. package/dist/errors/matimo-error.js.map +1 -0
  47. package/dist/executors/command-executor.d.ts +19 -0
  48. package/dist/executors/command-executor.d.ts.map +1 -0
  49. package/dist/executors/command-executor.js +94 -0
  50. package/dist/executors/command-executor.js.map +1 -0
  51. package/dist/executors/http-executor.d.ts +26 -0
  52. package/dist/executors/http-executor.d.ts.map +1 -0
  53. package/dist/executors/http-executor.js +133 -0
  54. package/dist/executors/http-executor.js.map +1 -0
  55. package/dist/index.d.ts +22 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +23 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/matimo-instance.d.ts +98 -0
  60. package/dist/matimo-instance.d.ts.map +1 -0
  61. package/dist/matimo-instance.js +260 -0
  62. package/dist/matimo-instance.js.map +1 -0
  63. package/docs/Gemfile +5 -0
  64. package/docs/RELEASES.md +69 -0
  65. package/docs/ROADMAP.md +138 -0
  66. package/docs/_config.yml +27 -0
  67. package/docs/api-reference/ERRORS.md +445 -0
  68. package/docs/api-reference/SDK.md +582 -0
  69. package/docs/api-reference/TYPES.md +415 -0
  70. package/docs/architecture/OAUTH.md +1366 -0
  71. package/docs/architecture/OVERVIEW.md +564 -0
  72. package/docs/assets/logo.png +0 -0
  73. package/docs/community/COMMIT_GUIDELINES.md +552 -0
  74. package/docs/framework-integrations/LANGCHAIN.md +286 -0
  75. package/docs/getting-started/QUICK_START.md +211 -0
  76. package/docs/getting-started/YOUR_FIRST_TOOL.md +217 -0
  77. package/docs/getting-started/installation.md +124 -0
  78. package/docs/index.md +288 -0
  79. package/docs/tool-development/DECORATOR_GUIDE.md +633 -0
  80. package/docs/tool-development/OAUTH_LINK.md +5 -0
  81. package/docs/tool-development/PROVIDER_CONFIGURATION.md +458 -0
  82. package/docs/tool-development/TESTING.md +412 -0
  83. package/docs/tool-development/TOOL_SPECIFICATION.md +793 -0
  84. package/docs/tool-development/YAML_TOOLS.md +65 -0
  85. package/docs/troubleshooting/FAQ.md +391 -0
  86. package/docs/user-guide/AUTHENTICATION.md +255 -0
  87. package/docs/user-guide/DEVELOPMENT_STANDARDS.md +698 -0
  88. package/docs/user-guide/SDK_PATTERNS.md +316 -0
  89. package/docs/user-guide/TOOL_DISCOVERY.md +209 -0
  90. package/package.json +96 -0
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Global Matimo instance for decorator usage
3
+ * Set via setGlobalMatimoInstance() before using @tool decorators
4
+ */
5
+ let globalMatimoInstance = null;
6
+ /**
7
+ * Set the global Matimo instance for decorator usage
8
+ *
9
+ * Must be called before any @tool decorated methods are invoked
10
+ *
11
+ * @param instance - The MatimoInstance to use globally
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const matimo = await MatimoInstance.init('./tools');
16
+ * setGlobalMatimoInstance(matimo);
17
+ *
18
+ * class MyAgent {
19
+ * @tool('calculator')
20
+ * async calculate(operation: string, a: number, b: number) { }
21
+ * }
22
+ *
23
+ * const agent = new MyAgent();
24
+ * await agent.calculate('add', 5, 3);
25
+ * ```
26
+ */
27
+ export function setGlobalMatimoInstance(instance) {
28
+ globalMatimoInstance = instance;
29
+ }
30
+ /**
31
+ * Get the global Matimo instance
32
+ *
33
+ * @throws {Error} If no global instance is set
34
+ */
35
+ export function getGlobalMatimoInstance() {
36
+ if (!globalMatimoInstance) {
37
+ throw new Error('Global MatimoInstance not set. Call setGlobalMatimoInstance() before using @tool decorator.');
38
+ }
39
+ return globalMatimoInstance;
40
+ }
41
+ /**
42
+ * Tool decorator - transforms a method into a tool executor
43
+ *
44
+ * Automatically calls matimo.execute() with the method's arguments mapped to tool parameters.
45
+ * Must be used in a class that has a `matimo` property or after setGlobalMatimoInstance() is called.
46
+ *
47
+ * Works with both traditional and modern TypeScript decorator syntax.
48
+ *
49
+ * @param toolName - Name of the tool to execute (e.g., 'calculator', 'github-get-repo')
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * // Using global instance
54
+ * const matimo = await MatimoInstance.init('./tools');
55
+ * setGlobalMatimoInstance(matimo);
56
+ *
57
+ * class MyAgent {
58
+ * @tool('calculator')
59
+ * async calculate(operation: string, a: number, b: number) {
60
+ * // Automatically executes: matimo.execute('calculator', { operation, a, b })
61
+ * }
62
+ *
63
+ * @tool('github-get-repo')
64
+ * async getRepo(owner: string, repo: string) {
65
+ * // Automatically executes: matimo.execute('github-get-repo', { owner, repo })
66
+ * }
67
+ * }
68
+ *
69
+ * const agent = new MyAgent();
70
+ * const result = await agent.calculate('add', 5, 3);
71
+ * ```
72
+ *
73
+ * @example
74
+ * ```typescript
75
+ * // Using instance property
76
+ * class MyAgent {
77
+ * constructor(public matimo: MatimoInstance) {}
78
+ *
79
+ * @tool('calculator')
80
+ * async calculate(operation: string, a: number, b: number) { }
81
+ * }
82
+ *
83
+ * const matimo = await MatimoInstance.init('./tools');
84
+ * const agent = new MyAgent(matimo);
85
+ * const result = await agent.calculate('add', 5, 3);
86
+ * ```
87
+ */
88
+ export function tool(toolName) {
89
+ return function (_target,
90
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
91
+ _context) {
92
+ // Handle modern experimental decorator API
93
+ // The decorator can be used on methods and will receive the method and context
94
+ // Return a new function that intercepts the call
95
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
96
+ return async function (...args) {
97
+ return executeToolViaDecorator(toolName, this, args);
98
+ };
99
+ };
100
+ }
101
+ /**
102
+ * Execute tool via decorator - shared logic for both decorator syntaxes
103
+ * Exported for testing purposes
104
+ */
105
+ export async function executeToolViaDecorator(toolName, thisArg,
106
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
107
+ args) {
108
+ // Get Matimo instance (from class property or global)
109
+ let matimoInstance = null;
110
+ if (thisArg && typeof thisArg === 'object' && 'matimo' in thisArg) {
111
+ matimoInstance = thisArg.matimo || null;
112
+ }
113
+ if (!matimoInstance) {
114
+ matimoInstance = globalMatimoInstance;
115
+ }
116
+ if (!matimoInstance) {
117
+ throw new Error(`Matimo instance not found for @tool('${toolName}') decorator. ` +
118
+ `Either add matimo property to class or call setGlobalMatimoInstance() first.`);
119
+ }
120
+ // Get tool definition
121
+ const toolDef = matimoInstance.getTool(toolName);
122
+ if (!toolDef) {
123
+ throw new Error(`Tool '${toolName}' not found in Matimo registry`);
124
+ }
125
+ // Convert positional arguments to parameters object
126
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
127
+ const params = convertArgsToParams(args, toolDef);
128
+ // Execute tool via Matimo
129
+ return matimoInstance.execute(toolName, params);
130
+ }
131
+ /**
132
+ * Convert positional arguments to named parameters object
133
+ * Maps function arguments to tool parameter names in order
134
+ * Exported for testing purposes
135
+ *
136
+ * @example
137
+ * ```
138
+ * Tool has parameters: { operation, a, b }
139
+ * Args: ['add', 5, 3]
140
+ * Result: { operation: 'add', a: 5, b: 3 }
141
+ * ```
142
+ */
143
+ export function convertArgsToParams(args, toolDef) {
144
+ const params = {};
145
+ if (!toolDef.parameters) {
146
+ return params;
147
+ }
148
+ const paramNames = Object.keys(toolDef.parameters);
149
+ for (let i = 0; i < args.length && i < paramNames.length; i++) {
150
+ params[paramNames[i]] = args[i];
151
+ }
152
+ return params;
153
+ }
154
+ //# sourceMappingURL=tool-decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-decorator.js","sourceRoot":"","sources":["../../src/decorators/tool-decorator.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,IAAI,oBAAoB,GAA0B,IAAI,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA+B;IACrE,oBA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MAAM,IAAI,KAAK,CAAC,SAAS,QAAQ,gCAAgC,CAAC,CAAC;IACrE,CAAC;IAED,oDAAoD;IACpD,8DAA8D;IAC9D,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,EAAE,OAAc,CAAC,CAAC;IAEzD,0BAA0B;IAC1B,OAAO,cAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AACD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAe,EACf,OAAuB;IAEvB,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAEnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9D,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Generic parameter encoding system for transforming input parameters
3
+ * Used to convert structured parameters into API-specific formats (MIME, JSON, etc.)
4
+ *
5
+ * This is YAML-driven via the parameter_encoding directive in tool definitions.
6
+ * No tool-specific code needed - keeps Matimo universal.
7
+ */
8
+ /**
9
+ * Encoding configuration from YAML
10
+ */
11
+ export interface ParameterEncodingConfig {
12
+ source: string[];
13
+ target: string;
14
+ encoding: string;
15
+ options?: Record<string, unknown>;
16
+ }
17
+ /**
18
+ * Apply parameter encodings to transform input parameters
19
+ * @param params - User-provided parameters
20
+ * @param encodings - List of encoding configurations from tool YAML
21
+ * @returns Parameters with encoded values added
22
+ */
23
+ export declare function applyParameterEncodings(params: Record<string, unknown>, encodings: ParameterEncodingConfig[]): Record<string, unknown>;
24
+ /**
25
+ * Example usage in YAML:
26
+ *
27
+ * execution:
28
+ * type: http
29
+ * method: POST
30
+ * url: 'https://www.googleapis.com/gmail/v1/users/me/messages/send'
31
+ * headers:
32
+ * Content-Type: 'application/json'
33
+ * Authorization: 'Bearer {GMAIL_ACCESS_TOKEN}'
34
+ *
35
+ * parameter_encoding:
36
+ * - source: [to, subject, body, cc, bcc, is_html]
37
+ * target: raw
38
+ * encoding: mime_rfc2822_base64url
39
+ *
40
+ * body:
41
+ * raw: '{raw}'
42
+ *
43
+ * Then users call:
44
+ * matimo.execute('gmail-send-email', {
45
+ * to: 'user@example.com',
46
+ * subject: 'Hello',
47
+ * body: 'Hi there',
48
+ * GMAIL_ACCESS_TOKEN: token
49
+ * });
50
+ */
51
+ //# sourceMappingURL=parameter-encoding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameter-encoding.d.ts","sourceRoot":"","sources":["../../src/encodings/parameter-encoding.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,SAAS,EAAE,uBAAuB,EAAE,GACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoBzB;AAoED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Generic parameter encoding system for transforming input parameters
3
+ * Used to convert structured parameters into API-specific formats (MIME, JSON, etc.)
4
+ *
5
+ * This is YAML-driven via the parameter_encoding directive in tool definitions.
6
+ * No tool-specific code needed - keeps Matimo universal.
7
+ */
8
+ /**
9
+ * Apply parameter encodings to transform input parameters
10
+ * @param params - User-provided parameters
11
+ * @param encodings - List of encoding configurations from tool YAML
12
+ * @returns Parameters with encoded values added
13
+ */
14
+ export function applyParameterEncodings(params, encodings) {
15
+ const result = { ...params };
16
+ for (const config of encodings) {
17
+ // Extract source parameters
18
+ const sourceValues = {};
19
+ for (const key of config.source) {
20
+ if (key in params) {
21
+ sourceValues[key] = params[key];
22
+ }
23
+ }
24
+ // Apply encoding function
25
+ const encodedValue = encodeParameters(sourceValues, config.encoding, config.options);
26
+ // Store in target parameter
27
+ result[config.target] = encodedValue;
28
+ }
29
+ return result;
30
+ }
31
+ /**
32
+ * Route to specific encoding function based on type
33
+ */
34
+ function encodeParameters(sourceValues, encoding, _options) {
35
+ switch (encoding) {
36
+ case 'mime_rfc2822_base64url':
37
+ return encodeMimeRfc2822(sourceValues);
38
+ case 'json_compact':
39
+ return JSON.stringify(sourceValues);
40
+ case 'url_encoded':
41
+ return encodeUrlParams(sourceValues);
42
+ default:
43
+ throw new Error(`Unknown parameter encoding type: ${encoding}`);
44
+ }
45
+ }
46
+ /**
47
+ * Encode parameters as RFC 2822 MIME message with base64url encoding
48
+ * Used for Gmail and other email APIs that accept raw MIME format
49
+ */
50
+ function encodeMimeRfc2822(sourceValues) {
51
+ const to = sourceValues.to;
52
+ const subject = sourceValues.subject;
53
+ const body = sourceValues.body;
54
+ const cc = sourceValues.cc;
55
+ const bcc = sourceValues.bcc;
56
+ const isHtml = sourceValues.is_html || false;
57
+ if (!to || !subject || !body) {
58
+ throw new Error('MIME encoding requires: to, subject, body parameters');
59
+ }
60
+ // Build RFC 2822 MIME message
61
+ let message = '';
62
+ message += `To: ${to}\r\n`;
63
+ message += `Subject: ${subject}\r\n`;
64
+ if (cc)
65
+ message += `Cc: ${cc}\r\n`;
66
+ if (bcc)
67
+ message += `Bcc: ${bcc}\r\n`;
68
+ message += `Content-Type: ${isHtml ? 'text/html' : 'text/plain'}; charset="UTF-8"\r\n`;
69
+ message += 'Content-Transfer-Encoding: 7bit\r\n';
70
+ message += '\r\n'; // Empty line separates headers from body
71
+ message += body;
72
+ // Convert to base64url
73
+ const base64 = Buffer.from(message).toString('base64');
74
+ // Replace standard base64 characters with URL-safe variants
75
+ return base64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
76
+ }
77
+ /**
78
+ * Encode parameters as URL-encoded form data
79
+ */
80
+ function encodeUrlParams(sourceValues) {
81
+ const params = new URLSearchParams();
82
+ for (const [key, value] of Object.entries(sourceValues)) {
83
+ if (value !== undefined && value !== null) {
84
+ params.append(key, String(value));
85
+ }
86
+ }
87
+ return params.toString();
88
+ }
89
+ /**
90
+ * Example usage in YAML:
91
+ *
92
+ * execution:
93
+ * type: http
94
+ * method: POST
95
+ * url: 'https://www.googleapis.com/gmail/v1/users/me/messages/send'
96
+ * headers:
97
+ * Content-Type: 'application/json'
98
+ * Authorization: 'Bearer {GMAIL_ACCESS_TOKEN}'
99
+ *
100
+ * parameter_encoding:
101
+ * - source: [to, subject, body, cc, bcc, is_html]
102
+ * target: raw
103
+ * encoding: mime_rfc2822_base64url
104
+ *
105
+ * body:
106
+ * raw: '{raw}'
107
+ *
108
+ * Then users call:
109
+ * matimo.execute('gmail-send-email', {
110
+ * to: 'user@example.com',
111
+ * subject: 'Hello',
112
+ * body: 'Hi there',
113
+ * GMAIL_ACCESS_TOKEN: token
114
+ * });
115
+ */
116
+ //# sourceMappingURL=parameter-encoding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameter-encoding.js","sourceRoot":"","sources":["../../src/encodings/parameter-encoding.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAA+B,EAC/B,SAAoC;IAEpC,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;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CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Error codes and custom error class for Matimo
3
+ */
4
+ export declare enum ErrorCode {
5
+ INVALID_SCHEMA = "INVALID_SCHEMA",
6
+ EXECUTION_FAILED = "EXECUTION_FAILED",
7
+ AUTH_FAILED = "AUTH_FAILED",
8
+ TOOL_NOT_FOUND = "TOOL_NOT_FOUND",
9
+ FILE_NOT_FOUND = "FILE_NOT_FOUND",
10
+ VALIDATION_FAILED = "VALIDATION_FAILED",
11
+ RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED",
12
+ TIMEOUT = "TIMEOUT",
13
+ NETWORK_ERROR = "NETWORK_ERROR",
14
+ INVALID_PARAMETER = "INVALID_PARAMETER",
15
+ UNKNOWN_ERROR = "UNKNOWN_ERROR"
16
+ }
17
+ /**
18
+ * Custom error class for Matimo
19
+ */
20
+ export declare class MatimoError extends Error {
21
+ code: ErrorCode;
22
+ details?: Record<string, unknown> | undefined;
23
+ constructor(message: string, code: ErrorCode, details?: Record<string, unknown> | undefined);
24
+ toJSON(): Record<string, unknown>;
25
+ }
26
+ /**
27
+ * Create a validation error with context
28
+ */
29
+ export declare function createValidationError(message: string, details?: Record<string, unknown>): MatimoError;
30
+ /**
31
+ * Create an execution error with context
32
+ */
33
+ export declare function createExecutionError(message: string, details?: Record<string, unknown>): MatimoError;
34
+ //# sourceMappingURL=matimo-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matimo-error.d.ts","sourceRoot":"","sources":["../../src/errors/matimo-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,oBAAY,SAAS;IACnB,cAAc,mBAAmB;IACjC,gBAAgB,qBAAqB;IACrC,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB;IAC3C,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,iBAAiB,sBAAsB;IACvC,aAAa,kBAAkB;CAChC;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IAG3B,IAAI,EAAE,SAAS;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAFxC,OAAO,EAAE,MAAM,EACR,IAAI,EAAE,SAAS,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;IAM1C,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAQlC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,WAAW,CAEb;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,WAAW,CAEb"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Error codes and custom error class for Matimo
3
+ */
4
+ export var ErrorCode;
5
+ (function (ErrorCode) {
6
+ ErrorCode["INVALID_SCHEMA"] = "INVALID_SCHEMA";
7
+ ErrorCode["EXECUTION_FAILED"] = "EXECUTION_FAILED";
8
+ ErrorCode["AUTH_FAILED"] = "AUTH_FAILED";
9
+ ErrorCode["TOOL_NOT_FOUND"] = "TOOL_NOT_FOUND";
10
+ ErrorCode["FILE_NOT_FOUND"] = "FILE_NOT_FOUND";
11
+ ErrorCode["VALIDATION_FAILED"] = "VALIDATION_FAILED";
12
+ ErrorCode["RATE_LIMIT_EXCEEDED"] = "RATE_LIMIT_EXCEEDED";
13
+ ErrorCode["TIMEOUT"] = "TIMEOUT";
14
+ ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR";
15
+ ErrorCode["INVALID_PARAMETER"] = "INVALID_PARAMETER";
16
+ ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
17
+ })(ErrorCode || (ErrorCode = {}));
18
+ /**
19
+ * Custom error class for Matimo
20
+ */
21
+ export class MatimoError extends Error {
22
+ constructor(message, code, details) {
23
+ super(message);
24
+ this.code = code;
25
+ this.details = details;
26
+ this.name = 'MatimoError';
27
+ }
28
+ toJSON() {
29
+ return {
30
+ name: this.name,
31
+ message: this.message,
32
+ code: this.code,
33
+ details: this.details,
34
+ };
35
+ }
36
+ }
37
+ /**
38
+ * Create a validation error with context
39
+ */
40
+ export function createValidationError(message, details) {
41
+ return new MatimoError(message, ErrorCode.VALIDATION_FAILED, details);
42
+ }
43
+ /**
44
+ * Create an execution error with context
45
+ */
46
+ export function createExecutionError(message, details) {
47
+ return new MatimoError(message, ErrorCode.EXECUTION_FAILED, details);
48
+ }
49
+ //# sourceMappingURL=matimo-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matimo-error.js","sourceRoot":"","sources":["../../src/errors/matimo-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAN,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,8CAAiC,CAAA;IACjC,kDAAqC,CAAA;IACrC,wCAA2B,CAAA;IAC3B,8CAAiC,CAAA;IACjC,8CAAiC,CAAA;IACjC,oDAAuC,CAAA;IACvC,wDAA2C,CAAA;IAC3C,gCAAmB,CAAA;IACnB,4CAA+B,CAAA;IAC/B,oDAAuC,CAAA;IACvC,4CAA+B,CAAA;AACjC,CAAC,EAZW,SAAS,KAAT,SAAS,QAYpB;AAED;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,YACE,OAAe,EACR,IAAe,EACf,OAAiC;QAExC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,SAAI,GAAJ,IAAI,CAAW;QACf,YAAO,GAAP,OAAO,CAA0B;QAGxC,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;IAED,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAe,EACf,OAAiC;IAEjC,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;AACxE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAe,EACf,OAAiC;IAEjC,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { ToolDefinition } from '../core/schema';
2
+ /**
3
+ * CommandExecutor - Executes shell commands
4
+ * Handles parameter templating, timeouts, and error capture
5
+ */
6
+ export declare class CommandExecutor {
7
+ private cwd?;
8
+ constructor(cwd?: string);
9
+ /**
10
+ * Execute a tool that runs a shell command
11
+ */
12
+ execute(tool: ToolDefinition, params: Record<string, unknown>): Promise<unknown>;
13
+ /**
14
+ * Replace parameter placeholders in a string
15
+ */
16
+ private templateString;
17
+ }
18
+ export default CommandExecutor;
19
+ //# sourceMappingURL=command-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-executor.d.ts","sourceRoot":"","sources":["../../src/executors/command-executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;GAGG;AAEH,qBAAa,eAAe;IAC1B,OAAO,CAAC,GAAG,CAAC,CAAS;gBAET,GAAG,CAAC,EAAE,MAAM;IAIxB;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAkFtF;;OAEG;IACH,OAAO,CAAC,cAAc;CAQvB;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,94 @@
1
+ import { spawn } from 'child_process';
2
+ /**
3
+ * CommandExecutor - Executes shell commands
4
+ * Handles parameter templating, timeouts, and error capture
5
+ */
6
+ export class CommandExecutor {
7
+ constructor(cwd) {
8
+ this.cwd = cwd;
9
+ }
10
+ /**
11
+ * Execute a tool that runs a shell command
12
+ */
13
+ async execute(tool, params) {
14
+ if (tool.execution.type !== 'command') {
15
+ throw new Error('Tool execution type is not command');
16
+ }
17
+ const { command, args = [], timeout = 30000 } = tool.execution;
18
+ const startTime = Date.now();
19
+ // Implement parameter templating
20
+ const templatedCommand = this.templateString(command, params);
21
+ const templatedArgs = args.map((arg) => this.templateString(arg, params));
22
+ return new Promise((resolve) => {
23
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
+ const spawnOptions = {
25
+ stdio: ['pipe', 'pipe', 'pipe'],
26
+ };
27
+ // Set working directory if provided
28
+ if (this.cwd) {
29
+ spawnOptions.cwd = this.cwd;
30
+ }
31
+ const child = spawn(templatedCommand, templatedArgs, spawnOptions);
32
+ let stdout = '';
33
+ let stderr = '';
34
+ let timedOut = false;
35
+ // Set up timeout
36
+ const timer = setTimeout(() => {
37
+ timedOut = true;
38
+ child.kill('SIGTERM');
39
+ }, timeout);
40
+ child.stdout?.on('data', (data) => {
41
+ stdout += data.toString();
42
+ });
43
+ child.stderr?.on('data', (data) => {
44
+ stderr += data.toString();
45
+ });
46
+ child.on('close', (code) => {
47
+ clearTimeout(timer);
48
+ const duration = Date.now() - startTime;
49
+ if (timedOut) {
50
+ resolve({
51
+ success: false,
52
+ error: 'timeout',
53
+ exitCode: -1,
54
+ duration,
55
+ });
56
+ }
57
+ else {
58
+ const exitCode = code || 0;
59
+ const success = exitCode === 0;
60
+ resolve({
61
+ success,
62
+ stdout: stdout.trim(),
63
+ stderr: stderr.trim(),
64
+ exitCode,
65
+ duration,
66
+ });
67
+ }
68
+ });
69
+ child.on('error', (error) => {
70
+ clearTimeout(timer);
71
+ const duration = Date.now() - startTime;
72
+ resolve({
73
+ success: false,
74
+ error: error.message,
75
+ exitCode: -1,
76
+ duration,
77
+ });
78
+ });
79
+ });
80
+ }
81
+ /**
82
+ * Replace parameter placeholders in a string
83
+ */
84
+ templateString(str, params) {
85
+ let result = str;
86
+ for (const [key, value] of Object.entries(params)) {
87
+ const placeholder = `{${key}}`;
88
+ result = result.replace(new RegExp(placeholder, 'g'), String(value));
89
+ }
90
+ return result;
91
+ }
92
+ }
93
+ export default CommandExecutor;
94
+ //# sourceMappingURL=command-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-executor.js","sourceRoot":"","sources":["../../src/executors/command-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC;;;GAGG;AAEH,MAAM,OAAO,eAAe;IAG1B,YAAY,GAAY;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,IAAoB,EAAE,MAA+B;QACjE,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/D,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,iCAAiC;QACjC,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC9D,MAAM,aAAa,G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AC,KAAK,CAAC,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { ToolDefinition } from '../core/schema';
2
+ /**
3
+ * HttpExecutor - Executes HTTP requests
4
+ * Handles authentication, retries, and response validation
5
+ */
6
+ export declare class HttpExecutor {
7
+ /**
8
+ * Execute a tool that makes an HTTP request
9
+ */
10
+ execute(tool: ToolDefinition, params: Record<string, unknown>): Promise<unknown>;
11
+ /**
12
+ * Replace parameter placeholders in a string
13
+ */
14
+ private templateString;
15
+ /**
16
+ * Build query string from query_params, only including provided values
17
+ */
18
+ private buildQueryString;
19
+ /**
20
+ * Replace parameter placeholders in an object (headers, body)
21
+ * Recursively handles nested objects
22
+ */
23
+ private templateObject;
24
+ }
25
+ export default HttpExecutor;
26
+ //# sourceMappingURL=http-executor.d.ts.map
@@ -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;AAGhD;;;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;IAiFtF;;OAEG;IACH,OAAO,CAAC,cAAc;IAWtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAexB;;;OAGG;IACH,OAAO,CAAC,cAAc;CA2BvB;AAED,eAAe,YAAY,CAAC"}