modality-kit 0.1.5 → 0.1.7
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/dist/index.js +7 -6
- package/dist/types/index.d.ts +1 -1
- package/dist/types/util_logger.d.ts +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -151,11 +151,13 @@ class ModalityLogger {
|
|
|
151
151
|
if (stack) {
|
|
152
152
|
if (Object.keys(result).length) {
|
|
153
153
|
console.error(`
|
|
154
|
-
`, prefix, result,
|
|
154
|
+
`, prefix, result, `
|
|
155
|
+
`, stack, `
|
|
155
156
|
`);
|
|
156
157
|
} else {
|
|
157
158
|
console.error(`
|
|
158
|
-
`, prefix,
|
|
159
|
+
`, prefix, `
|
|
160
|
+
`, stack, `
|
|
159
161
|
`);
|
|
160
162
|
}
|
|
161
163
|
} else {
|
|
@@ -208,9 +210,9 @@ class ModalityLogger {
|
|
|
208
210
|
this.log("success", this.cook(message, data));
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
|
-
var
|
|
213
|
+
var getLoggerInstance = ModalityLogger.getInstance.bind(ModalityLogger);
|
|
212
214
|
// src/util_error.ts
|
|
213
|
-
var logger =
|
|
215
|
+
var logger = getLoggerInstance("General Error");
|
|
214
216
|
|
|
215
217
|
class ErrorCode extends Error {
|
|
216
218
|
constructor(message) {
|
|
@@ -242,9 +244,8 @@ function withErrorHandling(fn, operation) {
|
|
|
242
244
|
export {
|
|
243
245
|
withErrorHandling,
|
|
244
246
|
setupAITools,
|
|
245
|
-
|
|
247
|
+
getLoggerInstance,
|
|
246
248
|
formatSuccessResponse,
|
|
247
249
|
formatErrorResponse,
|
|
248
|
-
ModalityLogger,
|
|
249
250
|
ErrorCode
|
|
250
251
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { setupAITools } from "./util_mcp_tools_converter";
|
|
2
2
|
export type { AITools, AITool } from "./schemas/schemas_tool_config";
|
|
3
3
|
export { formatErrorResponse, formatSuccessResponse } from "./util_response";
|
|
4
|
-
export {
|
|
4
|
+
export { getLoggerInstance } from "./util_logger";
|
|
5
5
|
export { withErrorHandling, ErrorCode } from "./util_error";
|
|
@@ -7,7 +7,7 @@ export interface LoggerOptions {
|
|
|
7
7
|
timestampFormat?: "iso" | "locale" | false;
|
|
8
8
|
name?: string;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
declare class ModalityLogger {
|
|
11
11
|
private options;
|
|
12
12
|
private logLevel;
|
|
13
13
|
private constructor();
|
|
@@ -24,4 +24,5 @@ export declare class ModalityLogger {
|
|
|
24
24
|
error(message: string, error?: Error | unknown, additionalData?: any): void;
|
|
25
25
|
success(message: string, data?: any): void;
|
|
26
26
|
}
|
|
27
|
-
export declare const
|
|
27
|
+
export declare const getLoggerInstance: typeof ModalityLogger.getInstance;
|
|
28
|
+
export {};
|
package/package.json
CHANGED