modality-kit 0.12.7 → 0.12.9

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;
@@ -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
  */
@@ -48,7 +48,7 @@ export interface AITool<T extends Record<string, unknown> | undefined = any, TPa
48
48
  };
49
49
  canAccess?: (auth: T) => boolean;
50
50
  description?: string;
51
- execute: (args: ToolParameters.InferOutput<TParams>, context: any) => Promise<any>;
51
+ execute: (args: ToolParameters.InferOutput<TParams>, context?: any) => Promise<any>;
52
52
  name: string;
53
53
  inputSchema?: TParams;
54
54
  timeoutMs?: number;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.12.7",
2
+ "version": "0.12.9",
3
3
  "name": "modality-kit",
4
4
  "repository": {
5
5
  "type": "git",