@fuzdev/fuz_app 0.167.0 → 0.168.0

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.
Files changed (61) hide show
  1. package/dist/actions/CLAUDE.md +9 -8
  2. package/dist/actions/action_dispatcher.d.ts +1 -1
  3. package/dist/actions/action_dispatcher.d.ts.map +1 -1
  4. package/dist/actions/action_dispatcher.js +1 -1
  5. package/dist/actions/action_event.d.ts.map +1 -1
  6. package/dist/actions/action_event.js +1 -1
  7. package/dist/actions/action_event_data.d.ts +260 -65
  8. package/dist/actions/action_event_data.d.ts.map +1 -1
  9. package/dist/actions/action_event_data.js +11 -11
  10. package/dist/actions/action_event_types.d.ts +5 -14
  11. package/dist/actions/action_event_types.d.ts.map +1 -1
  12. package/dist/actions/action_event_types.js +3 -3
  13. package/dist/actions/action_rpc.js +5 -5
  14. package/dist/actions/action_spec.d.ts +8 -26
  15. package/dist/actions/action_spec.d.ts.map +1 -1
  16. package/dist/actions/action_spec.js +4 -4
  17. package/dist/actions/broadcast_api.d.ts +1 -1
  18. package/dist/actions/broadcast_api.js +1 -1
  19. package/dist/actions/cancel.d.ts +17 -9
  20. package/dist/actions/cancel.d.ts.map +1 -1
  21. package/dist/actions/cancel.js +3 -3
  22. package/dist/actions/heartbeat.d.ts +3 -4
  23. package/dist/actions/heartbeat.d.ts.map +1 -1
  24. package/dist/actions/heartbeat.js +4 -4
  25. package/dist/actions/peer_ping.d.ts +63 -23
  26. package/dist/actions/peer_ping.d.ts.map +1 -1
  27. package/dist/actions/peer_ping.js +20 -19
  28. package/dist/actions/peer_request.d.ts +6 -3
  29. package/dist/actions/peer_request.d.ts.map +1 -1
  30. package/dist/actions/peer_request.js +8 -2
  31. package/dist/actions/perform_action.d.ts +1 -1
  32. package/dist/actions/perform_action.d.ts.map +1 -1
  33. package/dist/actions/transports.d.ts +2 -3
  34. package/dist/actions/transports.d.ts.map +1 -1
  35. package/dist/actions/transports.js +0 -4
  36. package/dist/actions/transports_http.d.ts.map +1 -1
  37. package/dist/actions/transports_http.js +4 -3
  38. package/dist/actions/transports_ws.d.ts.map +1 -1
  39. package/dist/actions/ws_socket_session.d.ts.map +1 -1
  40. package/dist/actions/ws_socket_session.js +6 -5
  41. package/dist/http/CLAUDE.md +9 -8
  42. package/dist/http/jsonrpc.d.ts +231 -152
  43. package/dist/http/jsonrpc.d.ts.map +1 -1
  44. package/dist/http/jsonrpc.js +55 -85
  45. package/dist/http/jsonrpc_errors.d.ts +22 -4
  46. package/dist/http/jsonrpc_errors.d.ts.map +1 -1
  47. package/dist/http/jsonrpc_errors.js +37 -4
  48. package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
  49. package/dist/http/jsonrpc_helpers.js +13 -12
  50. package/dist/testing/CLAUDE.md +6 -3
  51. package/dist/testing/cross_backend/peer_ping_ws.d.ts +3 -2
  52. package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
  53. package/dist/testing/cross_backend/peer_ping_ws.js +49 -2
  54. package/dist/testing/rpc_helpers.d.ts +1 -1
  55. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  56. package/dist/testing/rpc_helpers.js +13 -14
  57. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  58. package/dist/testing/rpc_round_trip.js +11 -11
  59. package/dist/testing/transports/ws_client.js +1 -1
  60. package/dist/ui/SurfaceExplorer.svelte +2 -2
  61. package/package.json +2 -2
@@ -2,82 +2,94 @@
2
2
  * JSON-RPC 2.0 envelope schemas for RPC dispatch and SAES transport.
3
3
  *
4
4
  * Params are object-only following MCP (no positional arrays); per-action
5
- * spec.input narrows further. Result is the full JSON-RPC valid value
6
- * space per spec §5 ("determined by the method invoked"): object, array,
7
- * string, number, boolean, or null — the per-action spec.output is the
8
- * actual contract. The envelope-level loose-object-only constraint
9
- * inherited from MCP would reject any action with `output: z.null()` /
10
- * `z.string()` / etc. on the wire, so we relax it here while keeping
11
- * MCP-superset shape on params + _meta.
5
+ * spec.input narrows further. Result is any value per spec §5 ("determined
6
+ * by the method invoked") — the per-action spec.output is the actual
7
+ * contract, so an action whose output is `null` or a string travels in the
8
+ * same envelope as one whose output is an object.
12
9
  *
13
- * MCP `_meta` types (`JsonrpcMcpMeta`, `JsonrpcRequestParamsMeta`) are
14
- * exported as building blocks for per-action schemas but are NOT validated
15
- * at the envelope level — `_meta` content validation belongs in per-action
16
- * schemas where it produces the correct error code (`invalid_params`, not
17
- * `invalid_request`).
10
+ * The envelopes are `loose_object`s: JSON-RPC and MCP both extend them with
11
+ * members a reader passes over, so an unknown key is kept rather than
12
+ * refused. A parse returns the frame itself, not a copy.
18
13
  *
19
14
  * @source https://github.com/modelcontextprotocol/typescript-sdk
20
15
  * @see https://www.jsonrpc.org/specification
21
16
  * @module
22
17
  */
23
- import { z } from 'zod';
18
+ import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
24
19
  export declare const JSONRPC_VERSION = "2.0";
25
20
  /** A uniquely identifying id for a request in JSON-RPC. Like MCP, excludes null. */
26
- export declare const JsonrpcRequestId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
27
- export type JsonrpcRequestId = z.infer<typeof JsonrpcRequestId>;
21
+ export declare const JsonrpcRequestId: import("@fuzdev/fuz_schema/schema.ts").Schema<string | number, string | number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>]>;
22
+ export type JsonrpcRequestId = Infer<typeof JsonrpcRequestId>;
28
23
  /** A JSON-RPC method name. */
29
- export declare const JsonrpcMethod: z.ZodString;
30
- export type JsonrpcMethod = z.infer<typeof JsonrpcMethod>;
31
- /** A progress token, used to associate progress notifications with the original request. */
32
- export declare const JsonrpcProgressToken: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
33
- export type JsonrpcProgressToken = z.infer<typeof JsonrpcProgressToken>;
34
- /** MCP metadata object — loose to allow additional properties and `.extend`. */
35
- export declare const JsonrpcMcpMeta: z.ZodObject<{}, z.core.$loose>;
36
- export type JsonrpcMcpMeta = z.infer<typeof JsonrpcMcpMeta>;
37
- /** Request params metadata — extends MCP meta with optional progress token. */
38
- export declare const JsonrpcRequestParamsMeta: z.ZodObject<{
39
- progressToken: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
40
- }, z.core.$loose>;
41
- export type JsonrpcRequestParamsMeta = z.infer<typeof JsonrpcRequestParamsMeta>;
42
- /** Request params — loose object. Per-action schemas validate `_meta` content. */
43
- export declare const JsonrpcRequestParams: z.ZodObject<{}, z.core.$loose>;
44
- export type JsonrpcRequestParams = z.infer<typeof JsonrpcRequestParams>;
45
- /** Notification params — loose object. Per-action schemas validate `_meta` content. */
46
- export declare const JsonrpcNotificationParams: z.ZodObject<{}, z.core.$loose>;
47
- export type JsonrpcNotificationParams = z.infer<typeof JsonrpcNotificationParams>;
24
+ export declare const JsonrpcMethod: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
25
+ export type JsonrpcMethod = Infer<typeof JsonrpcMethod>;
26
+ /** Request params — an object, its keys kept. Per-action schemas validate the content. */
27
+ export declare const JsonrpcRequestParams: import("@fuzdev/fuz_schema/schema.ts").Schema<{} & Record<string, unknown>, {} & Record<string, unknown>, "loose_object", {}>;
28
+ export type JsonrpcRequestParams = Infer<typeof JsonrpcRequestParams>;
29
+ /** Notification params — an object, its keys kept. Per-action schemas validate the content. */
30
+ export declare const JsonrpcNotificationParams: import("@fuzdev/fuz_schema/schema.ts").Schema<{} & Record<string, unknown>, {} & Record<string, unknown>, "loose_object", {}>;
31
+ export type JsonrpcNotificationParams = Infer<typeof JsonrpcNotificationParams>;
48
32
  /**
49
- * Result — any JSON value per JSON-RPC 2.0 §5. Per-action `spec.output`
50
- * is the actual contract; the envelope only asserts presence + JSON-ness.
33
+ * Result — any value per JSON-RPC 2.0 §5. Per-action `spec.output` is the
34
+ * actual contract; the envelope asserts only that the key is present.
51
35
  *
52
- * `z.json()` is required (not implicitly optional like `z.unknown()` /
53
- * `z.any()`, which would let an error envelope `{jsonrpc, id, error}`
54
- * parse successfully against the success envelope and break union
55
- * discrimination).
36
+ * `unknown` needs its key, so an error envelope `{jsonrpc, id, error}` fails
37
+ * the success envelope at `result` and the two stay apart in a union. It
38
+ * also takes what isn't a JSON value: `undefined` at a present key or a
39
+ * `Date`, which no parsed frame holds, and `±Infinity`, which `JSON.parse`
40
+ * makes of an out-of-range number such as `1e400` and which no server
41
+ * writes.
56
42
  */
57
- export declare const JsonrpcResult: z.ZodJSONSchema;
58
- export type JsonrpcResult = z.infer<typeof JsonrpcResult>;
43
+ export declare const JsonrpcResult: import("@fuzdev/fuz_schema/schema.ts").Schema<unknown, unknown, "unknown", undefined>;
44
+ export type JsonrpcResult = Infer<typeof JsonrpcResult>;
59
45
  /** A request that expects a response. */
60
- export declare const JsonrpcRequest: z.ZodObject<{
61
- jsonrpc: z.ZodLiteral<"2.0">;
62
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
63
- method: z.ZodString;
64
- params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
65
- }, z.core.$loose>;
66
- export type JsonrpcRequest = z.infer<typeof JsonrpcRequest>;
46
+ export declare const JsonrpcRequest: import("@fuzdev/fuz_schema/schema.ts").Schema<{
47
+ id: string | number;
48
+ method: string;
49
+ jsonrpc: "2.0";
50
+ params?: ({} & Record<string, unknown>) | undefined;
51
+ } & Record<string, unknown>, {
52
+ id: string | number;
53
+ method: string;
54
+ jsonrpc: "2.0";
55
+ params?: ({} & Record<string, unknown>) | undefined;
56
+ } & Record<string, unknown>, "loose_object", {
57
+ jsonrpc: import("@fuzdev/fuz_schema/schema.ts").Schema<"2.0", "2.0", "literal", "2.0">;
58
+ id: import("@fuzdev/fuz_schema/schema.ts").Schema<string | number, string | number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>]>;
59
+ method: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
60
+ params: import("@fuzdev/fuz_schema/schema.ts").Schema<({} & Record<string, unknown>) | undefined, ({} & Record<string, unknown>) | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<{} & Record<string, unknown>, {} & Record<string, unknown>, "loose_object", {}>>>;
61
+ }>;
62
+ export type JsonrpcRequest = Infer<typeof JsonrpcRequest>;
67
63
  /** A notification which does not expect a response. */
68
- export declare const JsonrpcNotification: z.ZodObject<{
69
- jsonrpc: z.ZodLiteral<"2.0">;
70
- method: z.ZodString;
71
- params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
72
- }, z.core.$loose>;
73
- export type JsonrpcNotification = z.infer<typeof JsonrpcNotification>;
64
+ export declare const JsonrpcNotification: import("@fuzdev/fuz_schema/schema.ts").Schema<{
65
+ method: string;
66
+ jsonrpc: "2.0";
67
+ params?: ({} & Record<string, unknown>) | undefined;
68
+ } & Record<string, unknown>, {
69
+ method: string;
70
+ jsonrpc: "2.0";
71
+ params?: ({} & Record<string, unknown>) | undefined;
72
+ } & Record<string, unknown>, "loose_object", {
73
+ jsonrpc: import("@fuzdev/fuz_schema/schema.ts").Schema<"2.0", "2.0", "literal", "2.0">;
74
+ method: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
75
+ params: import("@fuzdev/fuz_schema/schema.ts").Schema<({} & Record<string, unknown>) | undefined, ({} & Record<string, unknown>) | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<{} & Record<string, unknown>, {} & Record<string, unknown>, "loose_object", {}>>>;
76
+ }>;
77
+ export type JsonrpcNotification = Infer<typeof JsonrpcNotification>;
74
78
  /** A successful (non-error) response to a request. */
75
- export declare const JsonrpcResponse: z.ZodObject<{
76
- jsonrpc: z.ZodLiteral<"2.0">;
77
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
78
- result: z.ZodJSONSchema;
79
- }, z.core.$loose>;
80
- export type JsonrpcResponse = z.infer<typeof JsonrpcResponse>;
79
+ export declare const JsonrpcResponse: import("@fuzdev/fuz_schema/schema.ts").Schema<{
80
+ id: string | number;
81
+ jsonrpc: "2.0";
82
+ result: unknown;
83
+ } & Record<string, unknown>, {
84
+ id: string | number;
85
+ jsonrpc: "2.0";
86
+ result: unknown;
87
+ } & Record<string, unknown>, "loose_object", {
88
+ jsonrpc: import("@fuzdev/fuz_schema/schema.ts").Schema<"2.0", "2.0", "literal", "2.0">;
89
+ id: import("@fuzdev/fuz_schema/schema.ts").Schema<string | number, string | number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>]>;
90
+ result: import("@fuzdev/fuz_schema/schema.ts").Schema<unknown, unknown, "unknown", undefined>;
91
+ }>;
92
+ export type JsonrpcResponse = Infer<typeof JsonrpcResponse>;
81
93
  export declare const JSONRPC_PARSE_ERROR = -32700;
82
94
  export declare const JSONRPC_INVALID_REQUEST = -32600;
83
95
  export declare const JSONRPC_METHOD_NOT_FOUND = -32601;
@@ -87,110 +99,177 @@ export declare const JSONRPC_INTERNAL_ERROR = -32603;
87
99
  export declare const JSONRPC_SERVER_ERROR_START = -32000;
88
100
  /** End of the server-defined error code range (-32099). */
89
101
  export declare const JSONRPC_SERVER_ERROR_END = -32099;
90
- /** A server-defined error code in the -32000 to -32099 range. */
91
- export declare const JsonrpcServerErrorCode: z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">;
92
- export type JsonrpcServerErrorCode = z.infer<typeof JsonrpcServerErrorCode>;
93
102
  /**
94
- * A valid JSON-RPC error code — one of the 5 standard codes or
95
- * a server-defined code in the -32000 to -32099 range.
103
+ * A server-defined error code, an integer in the -32000 to -32099 range (the
104
+ * Rust spine's codes are `i32`s).
96
105
  */
97
- export declare const JsonrpcErrorCode: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
98
- export type JsonrpcErrorCode = z.infer<typeof JsonrpcErrorCode>;
106
+ export declare const JsonrpcServerErrorCode: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
107
+ readonly '~types'?: {
108
+ readonly input: number;
109
+ readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>;
110
+ } | undefined;
111
+ };
112
+ export type JsonrpcServerErrorCode = Infer<typeof JsonrpcServerErrorCode>;
113
+ /**
114
+ * A valid JSON-RPC error code — one of the standard codes or a
115
+ * server-defined code in the -32000 to -32099 range.
116
+ */
117
+ export declare const JsonrpcErrorCode: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
118
+ readonly '~types'?: {
119
+ readonly input: number;
120
+ readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>;
121
+ } | undefined;
122
+ }]>;
123
+ export type JsonrpcErrorCode = Infer<typeof JsonrpcErrorCode>;
99
124
  /**
100
125
  * Whether `value` is a valid JSON-RPC error code — the codes `JsonrpcErrorCode`
101
- * parses, but integer-only in the server range. A numeric `code` alone doesn't make an error a
102
- * JSON-RPC one: a `DOMException`'s `code` is a small positive number.
126
+ * parses. A numeric `code` alone doesn't make an error a JSON-RPC one: a
127
+ * `DOMException`'s `code` is a small positive number.
103
128
  *
104
129
  * @param value - the candidate code
105
130
  * @returns whether `value` is one of the standard codes or an integer in the server range
106
131
  */
107
132
  export declare const is_jsonrpc_error_code: (value: unknown) => value is JsonrpcErrorCode;
108
133
  /** Error object within a JSON-RPC error response. */
109
- export declare const JsonrpcErrorObject: z.ZodObject<{
110
- code: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
111
- message: z.ZodString;
112
- data: z.ZodOptional<z.ZodUnknown>;
113
- }, z.core.$loose>;
114
- export type JsonrpcErrorObject = z.infer<typeof JsonrpcErrorObject>;
134
+ export declare const JsonrpcErrorObject: import("@fuzdev/fuz_schema/schema.ts").Schema<{
135
+ message: string;
136
+ code: -32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">;
137
+ data?: unknown;
138
+ } & Record<string, unknown>, {
139
+ message: string;
140
+ code: number;
141
+ data?: unknown;
142
+ } & Record<string, unknown>, "loose_object", {
143
+ code: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
144
+ readonly '~types'?: {
145
+ readonly input: number;
146
+ readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>;
147
+ } | undefined;
148
+ }]>;
149
+ message: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
150
+ data: import("@fuzdev/fuz_schema/schema.ts").Schema<unknown, unknown, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<unknown, unknown, "unknown", undefined>>>;
151
+ }>;
152
+ export type JsonrpcErrorObject = Infer<typeof JsonrpcErrorObject>;
115
153
  /** A response that indicates an error occurred. */
116
- export declare const JsonrpcErrorResponse: z.ZodObject<{
117
- jsonrpc: z.ZodLiteral<"2.0">;
118
- id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
119
- error: z.ZodObject<{
120
- code: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
121
- message: z.ZodString;
122
- data: z.ZodOptional<z.ZodUnknown>;
123
- }, z.core.$loose>;
124
- }, z.core.$loose>;
125
- export type JsonrpcErrorResponse = z.infer<typeof JsonrpcErrorResponse>;
154
+ export declare const JsonrpcErrorResponse: import("@fuzdev/fuz_schema/schema.ts").Schema<{
155
+ error: {
156
+ message: string;
157
+ code: -32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">;
158
+ data?: unknown;
159
+ } & Record<string, unknown>;
160
+ id: string | number | null;
161
+ jsonrpc: "2.0";
162
+ } & Record<string, unknown>, {
163
+ error: {
164
+ message: string;
165
+ code: number;
166
+ data?: unknown;
167
+ } & Record<string, unknown>;
168
+ id: string | number | null;
169
+ jsonrpc: "2.0";
170
+ } & Record<string, unknown>, "loose_object", {
171
+ jsonrpc: import("@fuzdev/fuz_schema/schema.ts").Schema<"2.0", "2.0", "literal", "2.0">;
172
+ id: import("@fuzdev/fuz_schema/schema.ts").Schema<string | number | null, string | number | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string | number, string | number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>]>>>;
173
+ error: import("@fuzdev/fuz_schema/schema.ts").Schema<{
174
+ message: string;
175
+ code: -32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">;
176
+ data?: unknown;
177
+ } & Record<string, unknown>, {
178
+ message: string;
179
+ code: number;
180
+ data?: unknown;
181
+ } & Record<string, unknown>, "loose_object", {
182
+ code: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
183
+ readonly '~types'?: {
184
+ readonly input: number;
185
+ readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>;
186
+ } | undefined;
187
+ }]>;
188
+ message: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
189
+ data: import("@fuzdev/fuz_schema/schema.ts").Schema<unknown, unknown, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<unknown, unknown, "unknown", undefined>>>;
190
+ }>;
191
+ }>;
192
+ export type JsonrpcErrorResponse = Infer<typeof JsonrpcErrorResponse>;
126
193
  /** A successful response or an error response. */
127
- export declare const JsonrpcResponseOrError: z.ZodUnion<readonly [z.ZodObject<{
128
- jsonrpc: z.ZodLiteral<"2.0">;
129
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
130
- result: z.ZodJSONSchema;
131
- }, z.core.$loose>, z.ZodObject<{
132
- jsonrpc: z.ZodLiteral<"2.0">;
133
- id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
134
- error: z.ZodObject<{
135
- code: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
136
- message: z.ZodString;
137
- data: z.ZodOptional<z.ZodUnknown>;
138
- }, z.core.$loose>;
139
- }, z.core.$loose>]>;
140
- export type JsonrpcResponseOrError = z.infer<typeof JsonrpcResponseOrError>;
194
+ export declare const JsonrpcResponseOrError: import("@fuzdev/fuz_schema/schema.ts").Schema<({
195
+ id: string | number;
196
+ jsonrpc: "2.0";
197
+ result: unknown;
198
+ } & Record<string, unknown>) | ({
199
+ error: {
200
+ message: string;
201
+ code: -32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">;
202
+ data?: unknown;
203
+ } & Record<string, unknown>;
204
+ id: string | number | null;
205
+ jsonrpc: "2.0";
206
+ } & Record<string, unknown>), ({
207
+ id: string | number;
208
+ jsonrpc: "2.0";
209
+ result: unknown;
210
+ } & Record<string, unknown>) | ({
211
+ error: {
212
+ message: string;
213
+ code: number;
214
+ data?: unknown;
215
+ } & Record<string, unknown>;
216
+ id: string | number | null;
217
+ jsonrpc: "2.0";
218
+ } & Record<string, unknown>), "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<{
219
+ id: string | number;
220
+ jsonrpc: "2.0";
221
+ result: unknown;
222
+ } & Record<string, unknown>, {
223
+ id: string | number;
224
+ jsonrpc: "2.0";
225
+ result: unknown;
226
+ } & Record<string, unknown>, "loose_object", {
227
+ jsonrpc: import("@fuzdev/fuz_schema/schema.ts").Schema<"2.0", "2.0", "literal", "2.0">;
228
+ id: import("@fuzdev/fuz_schema/schema.ts").Schema<string | number, string | number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>]>;
229
+ result: import("@fuzdev/fuz_schema/schema.ts").Schema<unknown, unknown, "unknown", undefined>;
230
+ }>, import("@fuzdev/fuz_schema/schema.ts").Schema<{
231
+ error: {
232
+ message: string;
233
+ code: -32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">;
234
+ data?: unknown;
235
+ } & Record<string, unknown>;
236
+ id: string | number | null;
237
+ jsonrpc: "2.0";
238
+ } & Record<string, unknown>, {
239
+ error: {
240
+ message: string;
241
+ code: number;
242
+ data?: unknown;
243
+ } & Record<string, unknown>;
244
+ id: string | number | null;
245
+ jsonrpc: "2.0";
246
+ } & Record<string, unknown>, "loose_object", {
247
+ jsonrpc: import("@fuzdev/fuz_schema/schema.ts").Schema<"2.0", "2.0", "literal", "2.0">;
248
+ id: import("@fuzdev/fuz_schema/schema.ts").Schema<string | number | null, string | number | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string | number, string | number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>]>>>;
249
+ error: import("@fuzdev/fuz_schema/schema.ts").Schema<{
250
+ message: string;
251
+ code: -32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">;
252
+ data?: unknown;
253
+ } & Record<string, unknown>, {
254
+ message: string;
255
+ code: number;
256
+ data?: unknown;
257
+ } & Record<string, unknown>, "loose_object", {
258
+ code: import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603 | import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "union", readonly [import("@fuzdev/fuz_schema/schema.ts").Schema<-32700 | -32600 | -32601 | -32602 | -32603, -32700 | -32600 | -32601 | -32602 | -32603, "one_of", readonly [-32700, -32600, -32601, -32602, -32603]>, import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<number, "JsonrpcServerErrorCode">, number, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
259
+ readonly '~types'?: {
260
+ readonly input: number;
261
+ readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>;
262
+ } | undefined;
263
+ }]>;
264
+ message: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
265
+ data: import("@fuzdev/fuz_schema/schema.ts").Schema<unknown, unknown, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<unknown, unknown, "unknown", undefined>>>;
266
+ }>;
267
+ }>]>;
268
+ export type JsonrpcResponseOrError = Infer<typeof JsonrpcResponseOrError>;
141
269
  /** Any valid JSON-RPC message (request, notification, response, or error response). */
142
- export declare const JsonrpcMessage: z.ZodUnion<readonly [z.ZodObject<{
143
- jsonrpc: z.ZodLiteral<"2.0">;
144
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
145
- method: z.ZodString;
146
- params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
147
- }, z.core.$loose>, z.ZodObject<{
148
- jsonrpc: z.ZodLiteral<"2.0">;
149
- method: z.ZodString;
150
- params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
151
- }, z.core.$loose>, z.ZodObject<{
152
- jsonrpc: z.ZodLiteral<"2.0">;
153
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
154
- result: z.ZodJSONSchema;
155
- }, z.core.$loose>, z.ZodObject<{
156
- jsonrpc: z.ZodLiteral<"2.0">;
157
- id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
158
- error: z.ZodObject<{
159
- code: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
160
- message: z.ZodString;
161
- data: z.ZodOptional<z.ZodUnknown>;
162
- }, z.core.$loose>;
163
- }, z.core.$loose>]>;
164
- export type JsonrpcMessage = z.infer<typeof JsonrpcMessage>;
270
+ export type JsonrpcMessage = JsonrpcRequest | JsonrpcNotification | JsonrpcResponse | JsonrpcErrorResponse;
165
271
  /** Messages a client can send to a server (request or notification). */
166
- export declare const JsonrpcMessageFromClientToServer: z.ZodUnion<readonly [z.ZodObject<{
167
- jsonrpc: z.ZodLiteral<"2.0">;
168
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
169
- method: z.ZodString;
170
- params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
171
- }, z.core.$loose>, z.ZodObject<{
172
- jsonrpc: z.ZodLiteral<"2.0">;
173
- method: z.ZodString;
174
- params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
175
- }, z.core.$loose>]>;
176
- export type JsonrpcMessageFromClientToServer = z.infer<typeof JsonrpcMessageFromClientToServer>;
272
+ export type JsonrpcMessageFromClientToServer = JsonrpcRequest | JsonrpcNotification;
177
273
  /** Messages a server can send to a client (notification, response, or error response). */
178
- export declare const JsonrpcMessageFromServerToClient: z.ZodUnion<readonly [z.ZodObject<{
179
- jsonrpc: z.ZodLiteral<"2.0">;
180
- method: z.ZodString;
181
- params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
182
- }, z.core.$loose>, z.ZodObject<{
183
- jsonrpc: z.ZodLiteral<"2.0">;
184
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
185
- result: z.ZodJSONSchema;
186
- }, z.core.$loose>, z.ZodObject<{
187
- jsonrpc: z.ZodLiteral<"2.0">;
188
- id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
189
- error: z.ZodObject<{
190
- code: z.ZodUnion<readonly [z.ZodLiteral<-32700>, z.ZodLiteral<-32600>, z.ZodLiteral<-32601>, z.ZodLiteral<-32602>, z.ZodLiteral<-32603>, z.core.$ZodBranded<z.ZodNumber, "JsonrpcServerErrorCode", "out">]>;
191
- message: z.ZodString;
192
- data: z.ZodOptional<z.ZodUnknown>;
193
- }, z.core.$loose>;
194
- }, z.core.$loose>]>;
195
- export type JsonrpcMessageFromServerToClient = z.infer<typeof JsonrpcMessageFromServerToClient>;
274
+ export type JsonrpcMessageFromServerToClient = JsonrpcNotification | JsonrpcResponse | JsonrpcErrorResponse;
196
275
  //# sourceMappingURL=jsonrpc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsonrpc.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,iDAAoC,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,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