@matimo/core 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +252 -0
- package/destructive-keywords.yaml +70 -0
- package/dist/approval/approval-handler.d.ts +74 -0
- package/dist/approval/approval-handler.d.ts.map +1 -0
- package/dist/approval/approval-handler.js +210 -0
- package/dist/approval/approval-handler.js.map +1 -0
- package/dist/auth/oauth2-config.d.ts +104 -0
- package/dist/auth/oauth2-config.d.ts.map +1 -0
- package/dist/auth/oauth2-config.js +38 -0
- package/dist/auth/oauth2-config.js.map +1 -0
- package/dist/auth/oauth2-handler.d.ts +130 -0
- package/dist/auth/oauth2-handler.d.ts.map +1 -0
- package/dist/auth/oauth2-handler.js +265 -0
- package/dist/auth/oauth2-handler.js.map +1 -0
- package/dist/auth/oauth2-provider-loader.d.ts +68 -0
- package/dist/auth/oauth2-provider-loader.d.ts.map +1 -0
- package/dist/auth/oauth2-provider-loader.js +120 -0
- package/dist/auth/oauth2-provider-loader.js.map +1 -0
- package/dist/core/schema.d.ts +259 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +187 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/tool-loader.d.ts +57 -0
- package/dist/core/tool-loader.d.ts.map +1 -0
- package/dist/core/tool-loader.js +250 -0
- package/dist/core/tool-loader.js.map +1 -0
- package/dist/core/tool-registry.d.ts +48 -0
- package/dist/core/tool-registry.d.ts.map +1 -0
- package/dist/core/tool-registry.js +93 -0
- package/dist/core/tool-registry.js.map +1 -0
- package/dist/core/types.d.ts +162 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +5 -0
- package/dist/core/types.js.map +1 -0
- package/dist/decorators/index.d.ts +2 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +2 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/tool-decorator.d.ts +97 -0
- package/dist/decorators/tool-decorator.d.ts.map +1 -0
- package/dist/decorators/tool-decorator.js +157 -0
- package/dist/decorators/tool-decorator.js.map +1 -0
- package/dist/encodings/parameter-encoding.d.ts +51 -0
- package/dist/encodings/parameter-encoding.d.ts.map +1 -0
- package/dist/encodings/parameter-encoding.js +124 -0
- package/dist/encodings/parameter-encoding.js.map +1 -0
- package/dist/errors/matimo-error.d.ts +41 -0
- package/dist/errors/matimo-error.d.ts.map +1 -0
- package/dist/errors/matimo-error.js +71 -0
- package/dist/errors/matimo-error.js.map +1 -0
- package/dist/executors/command-executor.d.ts +19 -0
- package/dist/executors/command-executor.d.ts.map +1 -0
- package/dist/executors/command-executor.js +98 -0
- package/dist/executors/command-executor.js.map +1 -0
- package/dist/executors/function-executor.d.ts +23 -0
- package/dist/executors/function-executor.d.ts.map +1 -0
- package/dist/executors/function-executor.js +181 -0
- package/dist/executors/function-executor.js.map +1 -0
- package/dist/executors/http-executor.d.ts +78 -0
- package/dist/executors/http-executor.d.ts.map +1 -0
- package/dist/executors/http-executor.js +279 -0
- package/dist/executors/http-executor.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/langchain.d.ts +46 -0
- package/dist/integrations/langchain.d.ts.map +1 -0
- package/dist/integrations/langchain.js +197 -0
- package/dist/integrations/langchain.js.map +1 -0
- package/dist/logging/index.d.ts +3 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +3 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/logger.d.ts +96 -0
- package/dist/logging/logger.d.ts.map +1 -0
- package/dist/logging/logger.js +53 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/logging/winston-logger.d.ts +29 -0
- package/dist/logging/winston-logger.d.ts.map +1 -0
- package/dist/logging/winston-logger.js +73 -0
- package/dist/logging/winston-logger.js.map +1 -0
- package/dist/matimo-instance.d.ts +140 -0
- package/dist/matimo-instance.d.ts.map +1 -0
- package/dist/matimo-instance.js +412 -0
- package/dist/matimo-instance.js.map +1 -0
- package/package.json +96 -0
- package/tools/calculator/calculator.ts +145 -0
- package/tools/calculator/definition.yaml +70 -0
- package/tools/edit/definition.yaml +115 -0
- package/tools/edit/edit.ts +187 -0
- package/tools/execute/definition.yaml +90 -0
- package/tools/execute/execute.ts +207 -0
- package/tools/read/definition.yaml +106 -0
- package/tools/read/read.ts +118 -0
- package/tools/search/definition.yaml +148 -0
- package/tools/search/search.ts +192 -0
- package/tools/web/definition.yaml +132 -0
- package/tools/web/web.ts +134 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { applyParameterEncodings } from '../encodings/parameter-encoding';
|
|
3
|
+
import { MatimoError, ErrorCode, fromHttpError } from '../errors/matimo-error';
|
|
4
|
+
/**
|
|
5
|
+
* HttpExecutor - Executes HTTP requests
|
|
6
|
+
* Handles authentication, retries, and response validation
|
|
7
|
+
*/
|
|
8
|
+
export class HttpExecutor {
|
|
9
|
+
/**
|
|
10
|
+
* Execute a tool that makes an HTTP request
|
|
11
|
+
*/
|
|
12
|
+
async execute(tool, params) {
|
|
13
|
+
if (tool.execution.type !== 'http') {
|
|
14
|
+
throw new MatimoError('Tool execution type is not http', ErrorCode.EXECUTION_FAILED, {
|
|
15
|
+
expectedType: 'http',
|
|
16
|
+
actualType: tool.execution.type,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const { method, url, headers = {}, body, timeout, query_params, parameter_encoding, } = tool.execution;
|
|
20
|
+
const queryParams = query_params;
|
|
21
|
+
const parameterEncodings = parameter_encoding;
|
|
22
|
+
// Apply parameter encodings (e.g., MIME encoding for email parameters)
|
|
23
|
+
let finalParams = params;
|
|
24
|
+
if (parameterEncodings && parameterEncodings.length > 0) {
|
|
25
|
+
finalParams = applyParameterEncodings(params, parameterEncodings);
|
|
26
|
+
}
|
|
27
|
+
// Validate URL parameters are provided
|
|
28
|
+
this.validateUrlParameters(url, finalParams);
|
|
29
|
+
// Implement parameter templating
|
|
30
|
+
let finalUrl = this.templateString(url, finalParams);
|
|
31
|
+
// Handle query parameters - only include non-empty ones
|
|
32
|
+
if (queryParams) {
|
|
33
|
+
const queryString = this.buildQueryString(queryParams, finalParams);
|
|
34
|
+
if (queryString) {
|
|
35
|
+
finalUrl += '?' + queryString;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const templatedHeaders = this.templateObject(headers, finalParams, tool.parameters);
|
|
39
|
+
const templatedBody = body && typeof body === 'object'
|
|
40
|
+
? this.templateObject(body, finalParams, tool.parameters)
|
|
41
|
+
: body;
|
|
42
|
+
// Build request config
|
|
43
|
+
const requestConfig = {
|
|
44
|
+
method,
|
|
45
|
+
url: finalUrl,
|
|
46
|
+
};
|
|
47
|
+
if (Object.keys(templatedHeaders).length > 0) {
|
|
48
|
+
requestConfig.headers = templatedHeaders;
|
|
49
|
+
}
|
|
50
|
+
if (templatedBody !== undefined) {
|
|
51
|
+
requestConfig.data = templatedBody;
|
|
52
|
+
}
|
|
53
|
+
if (timeout !== undefined) {
|
|
54
|
+
requestConfig.timeout = timeout;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const response = await axios.request(requestConfig);
|
|
58
|
+
const success = response.status >= 200 && response.status < 300;
|
|
59
|
+
return {
|
|
60
|
+
success,
|
|
61
|
+
data: response.data,
|
|
62
|
+
statusCode: response.status,
|
|
63
|
+
headers: response.headers,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
// If this is already a MatimoError, rethrow to preserve semantics
|
|
68
|
+
if (error instanceof MatimoError) {
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
// Normalize any HTTP/axios-like or generic errors into MatimoError.
|
|
72
|
+
// This keeps callers consistent and preserves original cause via details.cause.
|
|
73
|
+
throw fromHttpError(error, 'HTTP request failed');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Replace parameter placeholders in a string
|
|
78
|
+
*/
|
|
79
|
+
templateString(str, params) {
|
|
80
|
+
let result = str;
|
|
81
|
+
for (const [key, value] of Object.entries(params)) {
|
|
82
|
+
const placeholder = `{${key}}`;
|
|
83
|
+
// Allow empty-string values to be substituted (validation allows empty strings)
|
|
84
|
+
if (value !== undefined && value !== null) {
|
|
85
|
+
result = result.replace(new RegExp(placeholder, 'g'), String(value));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Check if a string is an unfilled placeholder
|
|
92
|
+
* Only matches single placeholders like "{param}", not "{...}" or embedded placeholders
|
|
93
|
+
*/
|
|
94
|
+
isUnfilledPlaceholder(str) {
|
|
95
|
+
// Match exactly "{word}" where word is a valid identifier
|
|
96
|
+
return /^\{[a-zA-Z_][a-zA-Z0-9_]*\}$/.test(str);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Validate that all URL parameters are provided
|
|
100
|
+
*/
|
|
101
|
+
validateUrlParameters(url, params) {
|
|
102
|
+
// Extract all placeholders from URL like {param_name}
|
|
103
|
+
const urlParamMatches = url.match(/\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g);
|
|
104
|
+
if (!urlParamMatches) {
|
|
105
|
+
return; // No parameters in URL
|
|
106
|
+
}
|
|
107
|
+
for (const match of urlParamMatches) {
|
|
108
|
+
const paramName = match.slice(1, -1); // Remove { }
|
|
109
|
+
const paramValue = params[paramName];
|
|
110
|
+
// Check if parameter is missing or undefined
|
|
111
|
+
if (paramValue === undefined) {
|
|
112
|
+
throw new MatimoError(`Required URL parameter '${paramName}' is missing`, ErrorCode.INVALID_SCHEMA, { url, missingParam: paramName });
|
|
113
|
+
}
|
|
114
|
+
// Allow null, empty string, 0, false, etc. as valid values
|
|
115
|
+
// Just ensure the parameter is defined
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Build query string from query_params, only including provided values
|
|
120
|
+
*/
|
|
121
|
+
buildQueryString(queryParams, params) {
|
|
122
|
+
const parts = [];
|
|
123
|
+
for (const [key, template] of Object.entries(queryParams)) {
|
|
124
|
+
const value = this.templateString(template, params);
|
|
125
|
+
// Only include if not empty and didn't result in "{param}" (unfilled placeholder)
|
|
126
|
+
if (value && !value.startsWith('{')) {
|
|
127
|
+
parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return parts.join('&');
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Replace parameter placeholders in an object (headers, body, query params)
|
|
134
|
+
*
|
|
135
|
+
* CORE PRINCIPLE: "Define once in YAML, embed correctly at execution time"
|
|
136
|
+
*
|
|
137
|
+
* This method intelligently handles different parameter types:
|
|
138
|
+
* - STRING placeholders like "{title}": Always templated as strings
|
|
139
|
+
* - OBJECT placeholders like "{parent}": Embedded directly as JSON objects (not stringified) if paramDefinitions specifies type:object
|
|
140
|
+
* - ARRAY placeholders like "{items}": Embedded directly as JSON arrays (not stringified) if paramDefinitions specifies type:array
|
|
141
|
+
*
|
|
142
|
+
* Key behaviors:
|
|
143
|
+
* - Recursively processes nested objects
|
|
144
|
+
* - Skips keys with unfilled placeholders (e.g., "{sort_by}" when sort_by not provided)
|
|
145
|
+
* - Uses parameter schema type from YAML to determine how to embed values
|
|
146
|
+
* - Preserves JSON structure for complex types (objects/arrays) sent to APIs
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```
|
|
150
|
+
* // YAML definition:
|
|
151
|
+
* parameters:
|
|
152
|
+
* parent:
|
|
153
|
+
* type: object // <-- Tells executor to embed as-is, not stringify
|
|
154
|
+
* items:
|
|
155
|
+
* type: array // <-- Tells executor to embed as-is, not stringify
|
|
156
|
+
* title:
|
|
157
|
+
* type: string // <-- String templating applies
|
|
158
|
+
*
|
|
159
|
+
* body:
|
|
160
|
+
* parent: "{parent}" // Object embedded as {"id": "123", ...}
|
|
161
|
+
* items: "{items}" // Array embedded as [{"name": "a"}, ...]
|
|
162
|
+
* title: "{title}" // String embedded as "My Title"
|
|
163
|
+
*
|
|
164
|
+
* // JavaScript call:
|
|
165
|
+
* const result = await matimo.execute('notion_create_page', {
|
|
166
|
+
* parent: { database_id: 'abc123' }, // JavaScript object
|
|
167
|
+
* items: [{ type: 'text' }], // JavaScript array
|
|
168
|
+
* title: 'Create This Page' // String
|
|
169
|
+
* });
|
|
170
|
+
*
|
|
171
|
+
* // HTTP body sent to API:
|
|
172
|
+
* {
|
|
173
|
+
* "parent": {"database_id": "abc123"}, // Proper JSON object
|
|
174
|
+
* "items": [{"type": "text"}], // Proper JSON array
|
|
175
|
+
* "title": "Create This Page" // String
|
|
176
|
+
* }
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
templateObject(obj, params, paramDefinitions) {
|
|
180
|
+
const result = {};
|
|
181
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
182
|
+
if (typeof value === 'string') {
|
|
183
|
+
// Check if this is exactly a placeholder like "{parent}"
|
|
184
|
+
const paramNameMatch = value.match(/^\{([a-zA-Z_][a-zA-Z0-9_]*)\}$/);
|
|
185
|
+
if (paramNameMatch) {
|
|
186
|
+
const paramName = paramNameMatch[1];
|
|
187
|
+
const paramValue = params[paramName];
|
|
188
|
+
// If parameter is defined in schema with type object or array,
|
|
189
|
+
// embed the value directly instead of stringifying
|
|
190
|
+
if (paramValue !== undefined && paramDefinitions?.[paramName]) {
|
|
191
|
+
const paramType = paramDefinitions[paramName].type;
|
|
192
|
+
if ((paramType === 'object' || paramType === 'array') && paramValue !== null) {
|
|
193
|
+
result[key] = paramValue;
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// Otherwise, do normal string templating
|
|
199
|
+
const templated = this.templateString(value, params);
|
|
200
|
+
if (templated !== undefined &&
|
|
201
|
+
templated !== null &&
|
|
202
|
+
!this.isUnfilledPlaceholder(templated)) {
|
|
203
|
+
// Extract parameter name from template (e.g., "{page_size}" → "page_size")
|
|
204
|
+
const paramName = paramNameMatch ? paramNameMatch[1] : null;
|
|
205
|
+
// If this is a single parameter placeholder, use the parameter's defined type
|
|
206
|
+
if (paramName && paramDefinitions?.[paramName]) {
|
|
207
|
+
const paramType = paramDefinitions[paramName].type;
|
|
208
|
+
if (paramType === 'number' && !isNaN(Number(templated))) {
|
|
209
|
+
result[key] = Number(templated);
|
|
210
|
+
}
|
|
211
|
+
else if (paramType === 'boolean') {
|
|
212
|
+
result[key] = templated === 'true' || templated === '1' || templated === 'yes';
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
result[key] = templated;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
result[key] = templated;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
else if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
224
|
+
// Recursively template nested objects
|
|
225
|
+
const nestedResult = this.templateObject(value, params, paramDefinitions);
|
|
226
|
+
// Only include nested object if it has content
|
|
227
|
+
if (Object.keys(nestedResult).length > 0) {
|
|
228
|
+
result[key] = nestedResult;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else if (Array.isArray(value)) {
|
|
232
|
+
// Handle arrays of objects
|
|
233
|
+
const templatedArray = value
|
|
234
|
+
.map((item) => {
|
|
235
|
+
if (typeof item === 'string') {
|
|
236
|
+
const templated = this.templateString(item, params);
|
|
237
|
+
// Skip unfilled placeholders; allow empty strings
|
|
238
|
+
if (templated !== undefined &&
|
|
239
|
+
templated !== null &&
|
|
240
|
+
!this.isUnfilledPlaceholder(templated)) {
|
|
241
|
+
// Extract parameter name from template
|
|
242
|
+
const paramNameMatch = item.match(/^\{([a-zA-Z_][a-zA-Z0-9_]*)\}$/);
|
|
243
|
+
const paramName = paramNameMatch ? paramNameMatch[1] : null;
|
|
244
|
+
// If this is a single parameter placeholder, use the parameter's defined type
|
|
245
|
+
if (paramName && paramDefinitions?.[paramName]) {
|
|
246
|
+
const paramType = paramDefinitions[paramName].type;
|
|
247
|
+
if (paramType === 'number' && !isNaN(Number(templated))) {
|
|
248
|
+
return Number(templated);
|
|
249
|
+
}
|
|
250
|
+
else if (paramType === 'boolean') {
|
|
251
|
+
return templated === 'true' || templated === '1' || templated === 'yes';
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return templated;
|
|
255
|
+
}
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
else if (typeof item === 'object' && item !== null && !Array.isArray(item)) {
|
|
259
|
+
const templated = this.templateObject(item, params, paramDefinitions);
|
|
260
|
+
// Only include if has content
|
|
261
|
+
return Object.keys(templated).length > 0 ? templated : null;
|
|
262
|
+
}
|
|
263
|
+
return item;
|
|
264
|
+
})
|
|
265
|
+
.filter((item) => item !== null);
|
|
266
|
+
// Only include array if it has items
|
|
267
|
+
if (templatedArray.length > 0) {
|
|
268
|
+
result[key] = templatedArray;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
else if (value !== undefined && value !== null) {
|
|
272
|
+
result[key] = value;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return result;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
export default HttpExecutor;
|
|
279
|
+
//# sourceMappingURL=http-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-executor.js","sourceRoot":"","sources":["../../src/executors/http-executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/E;;;GAGG;AAEH,MAAM,OAAO,YAAY;IACvB;;OAEG;IACH,KAAK,CAAC,OA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0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matimo - Universal AI Agent Tools Ecosystem
|
|
3
|
+
*
|
|
4
|
+
* Framework-agnostic SDK that enables any developer to integrate 1000+ tools
|
|
5
|
+
* across any AI framework (LangChain, CrewAI, Anthropic SDK, etc.).
|
|
6
|
+
*/
|
|
7
|
+
export type { Parameter, AuthConfig, HttpExecution, CommandExecution, FunctionExecution, OutputSchema, RateLimitConfig, ErrorHandlingConfig, ToolDefinition, } from './core/types';
|
|
8
|
+
export { ParameterSchema, AuthConfigSchema, ExecutionConfigSchema } from './core/schema';
|
|
9
|
+
export { ToolLoader } from './core/tool-loader';
|
|
10
|
+
export { ToolRegistry } from './core/tool-registry';
|
|
11
|
+
export { CommandExecutor } from './executors/command-executor';
|
|
12
|
+
export { HttpExecutor } from './executors/http-executor';
|
|
13
|
+
export { FunctionExecutor } from './executors/function-executor';
|
|
14
|
+
export { applyParameterEncodings } from './encodings/parameter-encoding';
|
|
15
|
+
export type { ParameterEncodingConfig } from './encodings/parameter-encoding';
|
|
16
|
+
export { tool, setGlobalMatimoInstance, getGlobalMatimoInstance, } from './decorators/tool-decorator';
|
|
17
|
+
export { MatimoError, ErrorCode, createValidationError, createExecutionError, } from './errors/matimo-error';
|
|
18
|
+
export { MatimoLogger, LogLevel, LoggerConfig, getLoggerConfig, setGlobalMatimoLogger, getGlobalMatimoLogger, } from './logging';
|
|
19
|
+
export { WinstonMatimoLogger, createLogger } from './logging/winston-logger';
|
|
20
|
+
export { MatimoInstance, matimo } from './matimo-instance';
|
|
21
|
+
export type { InitOptions } from './matimo-instance';
|
|
22
|
+
export type { OAuth2Provider, OAuth2Token, OAuth2Config, AuthorizationOptions, TokenResponse, OAuth2Endpoints, } from './auth/oauth2-config';
|
|
23
|
+
export type { ProviderDefinition } from './core/schema';
|
|
24
|
+
export { OAuth2ProviderLoader } from './auth/oauth2-provider-loader';
|
|
25
|
+
export { OAuth2Handler } from './auth/oauth2-handler';
|
|
26
|
+
export { convertToolsToLangChain } from './integrations/langchain';
|
|
27
|
+
export type { LangChainTool } from './integrations/langchain';
|
|
28
|
+
export { ApprovalHandler, getGlobalApprovalHandler } from './approval/approval-handler';
|
|
29
|
+
export type { ApprovalRequest, ApprovalCallback } from './approval/approval-handler';
|
|
30
|
+
//# 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,EACL,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7E,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;AAK9D,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACxF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matimo - Universal AI Agent Tools Ecosystem
|
|
3
|
+
*
|
|
4
|
+
* Framework-agnostic SDK that enables any developer to integrate 1000+ tools
|
|
5
|
+
* across any AI framework (LangChain, CrewAI, Anthropic SDK, etc.).
|
|
6
|
+
*/
|
|
7
|
+
export { ParameterSchema, AuthConfigSchema, ExecutionConfigSchema } from './core/schema';
|
|
8
|
+
export { ToolLoader } from './core/tool-loader';
|
|
9
|
+
export { ToolRegistry } from './core/tool-registry';
|
|
10
|
+
// Executors
|
|
11
|
+
export { CommandExecutor } from './executors/command-executor';
|
|
12
|
+
export { HttpExecutor } from './executors/http-executor';
|
|
13
|
+
export { FunctionExecutor } from './executors/function-executor';
|
|
14
|
+
// Parameter Encoding
|
|
15
|
+
export { applyParameterEncodings } from './encodings/parameter-encoding';
|
|
16
|
+
// Decorators
|
|
17
|
+
export { tool, setGlobalMatimoInstance, getGlobalMatimoInstance, } from './decorators/tool-decorator';
|
|
18
|
+
// Error handling
|
|
19
|
+
export { MatimoError, ErrorCode, createValidationError, createExecutionError, } from './errors/matimo-error';
|
|
20
|
+
// Logging
|
|
21
|
+
export { getLoggerConfig, setGlobalMatimoLogger, getGlobalMatimoLogger, } from './logging';
|
|
22
|
+
export { WinstonMatimoLogger, createLogger } from './logging/winston-logger';
|
|
23
|
+
// Matimo instance and namespace
|
|
24
|
+
export { MatimoInstance, matimo } from './matimo-instance';
|
|
25
|
+
export { OAuth2ProviderLoader } from './auth/oauth2-provider-loader';
|
|
26
|
+
export { OAuth2Handler } from './auth/oauth2-handler';
|
|
27
|
+
// LangChain integration
|
|
28
|
+
export { convertToolsToLangChain } from './integrations/langchain';
|
|
29
|
+
// Generic Approval System - Simple, scalable flow for any tool
|
|
30
|
+
// Tools declare requires_approval in YAML, or system detects destructive keywords
|
|
31
|
+
// Single approval callback handles all tools - no per-provider logic needed
|
|
32
|
+
export { ApprovalHandler, getGlobalApprovalHandler } from './approval/approval-handler';
|
|
33
|
+
//# 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,UAAU;AACV,OAAO,EAIL,eAAe,EACf,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7E,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;AAGnE,+DAA+D;AAC/D,kFAAkF;AAClF,4EAA4E;AAC5E,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,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,eAA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/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logging/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EACf,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|