modality-kit 0.12.8 → 0.12.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/dist/index.js CHANGED
@@ -5071,10 +5071,7 @@ class JSONRPCUtils {
5071
5071
  return {
5072
5072
  valid: false,
5073
5073
  message,
5074
- error: {
5075
- code: -32600 /* INVALID_REQUEST */,
5076
- message: "Invalid request: batch array cannot be empty"
5077
- }
5074
+ error: JSONRPCUtils.createError(-32600 /* INVALID_REQUEST */, "Invalid request: batch array cannot be empty")
5078
5075
  };
5079
5076
  }
5080
5077
  for (const item of message) {
@@ -5096,20 +5093,14 @@ class JSONRPCUtils {
5096
5093
  return {
5097
5094
  valid: false,
5098
5095
  message,
5099
- error: {
5100
- code: -32600 /* INVALID_REQUEST */,
5101
- message: "Invalid request: message must be an object"
5102
- }
5096
+ error: JSONRPCUtils.createError(-32600 /* INVALID_REQUEST */, "Invalid request: message must be an object")
5103
5097
  };
5104
5098
  }
5105
5099
  if (message.jsonrpc !== JSONRPC_VERSION) {
5106
5100
  return {
5107
5101
  valid: false,
5108
5102
  message,
5109
- error: {
5110
- code: -32600 /* INVALID_REQUEST */,
5111
- message: `Invalid request: expect ${JSONRPC_VERSION}, received ${message.jsonrpc}`
5112
- }
5103
+ error: JSONRPCUtils.createError(-32600 /* INVALID_REQUEST */, `Invalid request: expect ${JSONRPC_VERSION}, received ${message.jsonrpc}`)
5113
5104
  };
5114
5105
  }
5115
5106
  if (!message.method || typeof message.method !== "string") {
@@ -5123,10 +5114,7 @@ class JSONRPCUtils {
5123
5114
  return {
5124
5115
  valid: false,
5125
5116
  message,
5126
- error: {
5127
- code: -32600 /* INVALID_REQUEST */,
5128
- message: "Invalid request: method must be a string"
5129
- }
5117
+ error: JSONRPCUtils.createError(-32600 /* INVALID_REQUEST */, `Invalid request: method must be a string`)
5130
5118
  };
5131
5119
  }
5132
5120
  const hasId = "id" in message;
@@ -5684,6 +5672,8 @@ class JSONRPCManager extends JSONRPCCall {
5684
5672
  this.methods.clear();
5685
5673
  }
5686
5674
  }
5675
+ // src/util_tests/isTestEnvironment.ts
5676
+ var isTestEnvironment = globalThis.Bun?.main?.includes?.("test");
5687
5677
  // src/websocket-client.ts
5688
5678
  var logger3 = getLoggerInstance("WebSocket-Client");
5689
5679
 
@@ -5951,8 +5941,6 @@ class LruCache {
5951
5941
  this.values.set(key, value);
5952
5942
  }
5953
5943
  }
5954
- // src/util_tests/isTestEnvironment.ts
5955
- var isTestEnvironment = globalThis.Bun?.main?.includes?.("test");
5956
5944
  export {
5957
5945
  withErrorHandling,
5958
5946
  setupAITools,
@@ -4,7 +4,7 @@
4
4
  * Utility class for JSON-RPC message handling, validation, and creation.
5
5
  * Extracted from schemas/jsonrpc.ts for independent use.
6
6
  */
7
- import { JSONRPCErrorCode, type JSONRPCParams, type JSONRPCId, type JSONRPCRequest, type JSONRPCNotification, type JSONRPCSuccessResponse, type JSONRPCErrorResponse, type JSONRPCError, type JSONRPCResponse, type JSONRPCMessage, type JSONRPCValidationResult } from './schemas/jsonrpc.js';
7
+ import { JSONRPCErrorCode, type JSONRPCParams, type JSONRPCId, type JSONRPCRequest, type JSONRPCNotification, type JSONRPCSuccessResponse, type JSONRPCErrorResponse, type JSONRPCError, type JSONRPCResponse, type JSONRPCMessage, type JSONRPCValidationResult } from "./schemas/jsonrpc.js";
8
8
  /**
9
9
  * Utility functions for JSON-RPC message handling
10
10
  */
@@ -10,14 +10,17 @@ export { loadVersion } from "./util_version";
10
10
  export { compressWithLanguageDetection as compressText } from "./util_text_compression";
11
11
  export { JSONRPCCall, createDataPendingOperations } from "./util_pending";
12
12
  export type { DataPendingOperation, PendingOperation } from "./util_pending";
13
+ /**
14
+ * JSON RPC related exports
15
+ */
13
16
  export { JSONRPCUtils } from "./JSONRPCUtils";
14
- export { JSONRPCErrorCode } from "./schemas/jsonrpc";
15
- export type { JSONRPCMessage, JSONRPCRequest, JSONRPCNotification, JSONRPCResponse, JSONRPCBatchRequest, JSONRPCBatchResponse, JSONRPCErrorResponse, JSONRPCValidationResult, JSONRPCError, JSONRPCParams, CommandExecuteParams, NotificationSendParams, } from "./schemas/jsonrpc";
16
17
  export { JSONRPCManager } from "./jsonrpc-manager";
18
+ export { JSONRPCErrorCode } from "./schemas/jsonrpc";
17
19
  export type { JSONRPCManagerEvents, JSONRPCManagerConfig, } from "./jsonrpc-manager";
18
- export { WebSocketClient } from "./websocket-client";
19
- export { LruCache } from "./lruCache";
20
+ export type { JSONRPCMessage, JSONRPCRequest, JSONRPCNotification, JSONRPCResponse, JSONRPCBatchRequest, JSONRPCBatchResponse, JSONRPCErrorResponse, JSONRPCValidationResult, JSONRPCError, JSONRPCParams, CommandExecuteParams, NotificationSendParams, } from "./schemas/jsonrpc";
20
21
  /**
21
22
  * For test tool
22
23
  */
23
24
  export { isTestEnvironment } from "./util_tests/isTestEnvironment";
25
+ export { WebSocketClient } from "./websocket-client";
26
+ export { LruCache } from "./lruCache";
@@ -98,7 +98,7 @@ export declare enum JSONRPCErrorCode {
98
98
  * This ensures strict JSON-RPC 2.0 compliance and wire protocol compatibility.
99
99
  * See: https://www.jsonrpc.org/specification#parameter_structures
100
100
  */
101
- export type JSONRPCParams = object | any[] | null;
101
+ export type JSONRPCParams = Record<any, any> | any[] | null;
102
102
  /**
103
103
  * JSON-RPC 2.0 ID type - string, number, or null
104
104
  */
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.12.8",
2
+ "version": "0.12.10",
3
3
  "name": "modality-kit",
4
4
  "repository": {
5
5
  "type": "git",