modality-kit 0.12.2 → 0.12.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.
- package/dist/index.js +4 -4
- package/dist/types/util_response.d.ts +2 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -239,19 +239,19 @@ function formatErrorResponse(errorData, operation, meta) {
|
|
|
239
239
|
operation,
|
|
240
240
|
meta
|
|
241
241
|
};
|
|
242
|
-
} else if (errorData instanceof
|
|
242
|
+
} else if (errorData instanceof ErrorCode) {
|
|
243
243
|
errorResponse = {
|
|
244
244
|
success: false,
|
|
245
245
|
error: errorData.message,
|
|
246
|
+
code: errorData.code,
|
|
247
|
+
reason: errorData.cause?.message,
|
|
246
248
|
operation,
|
|
247
249
|
meta
|
|
248
250
|
};
|
|
249
|
-
} else if (errorData instanceof
|
|
251
|
+
} else if (errorData instanceof Error) {
|
|
250
252
|
errorResponse = {
|
|
251
253
|
success: false,
|
|
252
254
|
error: errorData.message,
|
|
253
|
-
code: errorData.code,
|
|
254
|
-
reason: errorData.cause?.message,
|
|
255
255
|
operation,
|
|
256
256
|
meta
|
|
257
257
|
};
|
|
@@ -17,20 +17,18 @@ export interface McpErrorResponse {
|
|
|
17
17
|
reason?: string;
|
|
18
18
|
meta?: Record<string, any>;
|
|
19
19
|
}
|
|
20
|
-
interface SuccessData {
|
|
20
|
+
interface SuccessData extends Record<string, any> {
|
|
21
21
|
message?: string;
|
|
22
22
|
instructions?: string;
|
|
23
|
-
[key: string]: any;
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
26
25
|
* Generic error data interface for MCP error responses
|
|
27
26
|
*/
|
|
28
|
-
interface ErrorData {
|
|
27
|
+
interface ErrorData extends Record<string, any> {
|
|
29
28
|
success?: boolean;
|
|
30
29
|
message: string;
|
|
31
30
|
code?: string;
|
|
32
31
|
operation?: string;
|
|
33
|
-
[key: string]: any;
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* Format a successful response for MCP tools
|
package/package.json
CHANGED