@graphorin/protocol 0.5.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # @graphorin/protocol
2
+
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Initial Phase 14b release: Zod schemas + TypeScript types for the
8
+ `graphorin.protocol.v1` WebSocket subprotocol — the discriminated
9
+ unions `ClientMessage` and `ServerMessage`, the JSON-RPC-shaped
10
+ control channel (`initialize` / `subscription.subscribe` /
11
+ `subscription.unsubscribe` / `run.cancel` / `ping`), the typed
12
+ push event frames, the asynchronous server-error frames, the
13
+ subprotocol negotiation helpers, and the close-code taxonomy.
14
+ Browser-friendly: zero Node-only dependencies; only `zod` at
15
+ runtime. Created and maintained by Oleksiy Stepurenko.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Oleksiy Stepurenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # @graphorin/protocol
2
+
3
+ > Wire-format contract for the [Graphorin](https://github.com/o-stepper/graphorin) framework's WebSocket subprotocol.
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
6
+ [![Node.js: 22+](https://img.shields.io/badge/Node.js-22%2B-43853d.svg)](https://nodejs.org)
7
+
8
+ - **Version:** v0.5.0
9
+ - **License:** [MIT](./LICENSE) (© 2026 Oleksiy Stepurenko)
10
+ - **Repository:** <https://github.com/o-stepper/graphorin/tree/main/packages/protocol>
11
+ - **Issues:** <https://github.com/o-stepper/graphorin/issues>
12
+
13
+ `@graphorin/protocol` is the single source of truth for the shape of every frame exchanged over `wss://.../v1/ws`. Both [`@graphorin/server`](../server/README.md) and [`@graphorin/client`](../client/README.md) import their schemas from this package so the two implementations cannot drift.
14
+
15
+ ## What ships in v0.1 (Phase 14b)
16
+
17
+ | Surface | Detail |
18
+ |---|---|
19
+ | **Subprotocol** | `graphorin.protocol.v1` (`SUBPROTOCOL_NAME`). Browser clients attach a single-use ticket as a second `Sec-WebSocket-Protocol` token via `formatTicketSubprotocol(ticket)` ⇒ `'ticket.<value>'`. |
20
+ | **Client → Server frames** | Discriminated union `ClientMessage` covering `initialize`, `subscription.subscribe`, `subscription.unsubscribe`, `run.cancel`, `ping`, and the MCP-compatible `notifications/cancelled` notification. |
21
+ | **Server → Client frames** | Discriminated union `ServerMessage` covering JSON-RPC responses (`result` / `error`), typed push events (`{ kind: 'event', subject, type, payload, eventId }`), lifecycle frames, async error frames, `pong`, `subscribed` / `unsubscribed`, and `replay-marker`. |
22
+ | **Close codes** | Application-private 4xxx range per RFC 6455 § 7.4: `4001 auth.required`, `4002 auth.invalid`, `4003 auth.revoked`, `4004 auth.scope_denied`, `4005 rate.limited`, `4006 flow.throttled`, `4007 server.shutdown`, `4008 protocol.violation`. |
23
+ | **Bundle** | Browser-friendly. Zero Node-only dependencies; the only runtime dependency is `zod`. |
24
+
25
+ ## Direct dependencies
26
+
27
+ - [`zod`](https://zod.dev) (`^3.25.0`) — runtime schema validation. The MIT-licensed Zod project supplies the discriminated union, strict-object, and `safeParse` primitives that back every `*Schema` export. No other runtime dependency exists; the package is otherwise pure TypeScript.
28
+
29
+ ## Install
30
+
31
+ ```bash
32
+ pnpm add @graphorin/protocol zod
33
+ ```
34
+
35
+ > Other npm-registry-compatible package managers (`npm`, `yarn`, `bun`) work identically.
36
+
37
+ ## Usage
38
+
39
+ ```ts
40
+ import {
41
+ ClientMessageSchema,
42
+ ServerMessageSchema,
43
+ SUBPROTOCOL_NAME,
44
+ formatTicketSubprotocol,
45
+ isEventFrame,
46
+ } from '@graphorin/protocol';
47
+
48
+ // 1. Validate an inbound client frame on the server.
49
+ const parsed = ClientMessageSchema.safeParse(JSON.parse(rawFrame));
50
+ if (!parsed.success) {
51
+ ws.close(4008, 'protocol.violation');
52
+ return;
53
+ }
54
+
55
+ // 2. Build the subprotocol header for a browser client.
56
+ ws.subprotocol = `${SUBPROTOCOL_NAME}, ${formatTicketSubprotocol(ticket)}`;
57
+
58
+ // 3. Narrow a server frame on the client.
59
+ const incoming = ServerMessageSchema.parse(JSON.parse(rawFrame));
60
+ if (isEventFrame(incoming)) {
61
+ console.log(incoming.subject, incoming.type, incoming.payload);
62
+ }
63
+ ```
64
+
65
+ ## License
66
+
67
+ MIT © 2026 Oleksiy Stepurenko. See [`LICENSE`](./LICENSE).
68
+
69
+ ---
70
+
71
+ **Project Graphorin** · v0.5.0 · MIT License · © 2026 Oleksiy Stepurenko · <https://github.com/o-stepper/graphorin>
@@ -0,0 +1,478 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/client-message.d.ts
4
+
5
+ declare const RpcId: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
6
+ declare const InitializeRequest: z.ZodObject<{
7
+ v: z.ZodLiteral<"1">;
8
+ jsonrpc: z.ZodLiteral<"2.0">;
9
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
10
+ method: z.ZodLiteral<"initialize">;
11
+ params: z.ZodObject<{
12
+ clientInfo: z.ZodObject<{
13
+ name: z.ZodString;
14
+ version: z.ZodString;
15
+ }, "strict", z.ZodTypeAny, {
16
+ name: string;
17
+ version: string;
18
+ }, {
19
+ name: string;
20
+ version: string;
21
+ }>;
22
+ capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
23
+ }, "strict", z.ZodTypeAny, {
24
+ clientInfo: {
25
+ name: string;
26
+ version: string;
27
+ };
28
+ capabilities?: Record<string, unknown> | undefined;
29
+ }, {
30
+ clientInfo: {
31
+ name: string;
32
+ version: string;
33
+ };
34
+ capabilities?: Record<string, unknown> | undefined;
35
+ }>;
36
+ }, "strict", z.ZodTypeAny, {
37
+ method: "initialize";
38
+ v: "1";
39
+ params: {
40
+ clientInfo: {
41
+ name: string;
42
+ version: string;
43
+ };
44
+ capabilities?: Record<string, unknown> | undefined;
45
+ };
46
+ jsonrpc: "2.0";
47
+ id: string | number;
48
+ }, {
49
+ method: "initialize";
50
+ v: "1";
51
+ params: {
52
+ clientInfo: {
53
+ name: string;
54
+ version: string;
55
+ };
56
+ capabilities?: Record<string, unknown> | undefined;
57
+ };
58
+ jsonrpc: "2.0";
59
+ id: string | number;
60
+ }>;
61
+ declare const SubscribeRequest: z.ZodObject<{
62
+ v: z.ZodLiteral<"1">;
63
+ jsonrpc: z.ZodLiteral<"2.0">;
64
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
65
+ method: z.ZodLiteral<"subscription.subscribe">;
66
+ params: z.ZodObject<{
67
+ subject: z.ZodString;
68
+ sinceEventId: z.ZodOptional<z.ZodString>;
69
+ }, "strict", z.ZodTypeAny, {
70
+ subject: string;
71
+ sinceEventId?: string | undefined;
72
+ }, {
73
+ subject: string;
74
+ sinceEventId?: string | undefined;
75
+ }>;
76
+ }, "strict", z.ZodTypeAny, {
77
+ method: "subscription.subscribe";
78
+ v: "1";
79
+ params: {
80
+ subject: string;
81
+ sinceEventId?: string | undefined;
82
+ };
83
+ jsonrpc: "2.0";
84
+ id: string | number;
85
+ }, {
86
+ method: "subscription.subscribe";
87
+ v: "1";
88
+ params: {
89
+ subject: string;
90
+ sinceEventId?: string | undefined;
91
+ };
92
+ jsonrpc: "2.0";
93
+ id: string | number;
94
+ }>;
95
+ declare const UnsubscribeRequest: z.ZodObject<{
96
+ v: z.ZodLiteral<"1">;
97
+ jsonrpc: z.ZodLiteral<"2.0">;
98
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
99
+ method: z.ZodLiteral<"subscription.unsubscribe">;
100
+ params: z.ZodObject<{
101
+ subscriptionId: z.ZodString;
102
+ }, "strict", z.ZodTypeAny, {
103
+ subscriptionId: string;
104
+ }, {
105
+ subscriptionId: string;
106
+ }>;
107
+ }, "strict", z.ZodTypeAny, {
108
+ method: "subscription.unsubscribe";
109
+ v: "1";
110
+ params: {
111
+ subscriptionId: string;
112
+ };
113
+ jsonrpc: "2.0";
114
+ id: string | number;
115
+ }, {
116
+ method: "subscription.unsubscribe";
117
+ v: "1";
118
+ params: {
119
+ subscriptionId: string;
120
+ };
121
+ jsonrpc: "2.0";
122
+ id: string | number;
123
+ }>;
124
+ declare const RunCancelRequest: z.ZodObject<{
125
+ v: z.ZodLiteral<"1">;
126
+ jsonrpc: z.ZodLiteral<"2.0">;
127
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
128
+ method: z.ZodLiteral<"run.cancel">;
129
+ params: z.ZodObject<{
130
+ runId: z.ZodString;
131
+ reason: z.ZodOptional<z.ZodString>;
132
+ drain: z.ZodOptional<z.ZodBoolean>;
133
+ onPendingApprovals: z.ZodOptional<z.ZodEnum<["deny", "preserve"]>>;
134
+ }, "strict", z.ZodTypeAny, {
135
+ runId: string;
136
+ reason?: string | undefined;
137
+ drain?: boolean | undefined;
138
+ onPendingApprovals?: "deny" | "preserve" | undefined;
139
+ }, {
140
+ runId: string;
141
+ reason?: string | undefined;
142
+ drain?: boolean | undefined;
143
+ onPendingApprovals?: "deny" | "preserve" | undefined;
144
+ }>;
145
+ }, "strict", z.ZodTypeAny, {
146
+ method: "run.cancel";
147
+ v: "1";
148
+ params: {
149
+ runId: string;
150
+ reason?: string | undefined;
151
+ drain?: boolean | undefined;
152
+ onPendingApprovals?: "deny" | "preserve" | undefined;
153
+ };
154
+ jsonrpc: "2.0";
155
+ id: string | number;
156
+ }, {
157
+ method: "run.cancel";
158
+ v: "1";
159
+ params: {
160
+ runId: string;
161
+ reason?: string | undefined;
162
+ drain?: boolean | undefined;
163
+ onPendingApprovals?: "deny" | "preserve" | undefined;
164
+ };
165
+ jsonrpc: "2.0";
166
+ id: string | number;
167
+ }>;
168
+ declare const PingRequest: z.ZodObject<{
169
+ v: z.ZodLiteral<"1">;
170
+ jsonrpc: z.ZodLiteral<"2.0">;
171
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
172
+ method: z.ZodLiteral<"ping">;
173
+ params: z.ZodOptional<z.ZodObject<{
174
+ nonce: z.ZodOptional<z.ZodString>;
175
+ }, "strict", z.ZodTypeAny, {
176
+ nonce?: string | undefined;
177
+ }, {
178
+ nonce?: string | undefined;
179
+ }>>;
180
+ }, "strict", z.ZodTypeAny, {
181
+ method: "ping";
182
+ v: "1";
183
+ jsonrpc: "2.0";
184
+ id: string | number;
185
+ params?: {
186
+ nonce?: string | undefined;
187
+ } | undefined;
188
+ }, {
189
+ method: "ping";
190
+ v: "1";
191
+ jsonrpc: "2.0";
192
+ id: string | number;
193
+ params?: {
194
+ nonce?: string | undefined;
195
+ } | undefined;
196
+ }>;
197
+ declare const CancelledNotification: z.ZodObject<{
198
+ v: z.ZodLiteral<"1">;
199
+ jsonrpc: z.ZodLiteral<"2.0">;
200
+ method: z.ZodLiteral<"notifications/cancelled">;
201
+ params: z.ZodObject<{
202
+ requestId: z.ZodString;
203
+ }, "strict", z.ZodTypeAny, {
204
+ requestId: string;
205
+ }, {
206
+ requestId: string;
207
+ }>;
208
+ }, "strict", z.ZodTypeAny, {
209
+ method: "notifications/cancelled";
210
+ v: "1";
211
+ params: {
212
+ requestId: string;
213
+ };
214
+ jsonrpc: "2.0";
215
+ }, {
216
+ method: "notifications/cancelled";
217
+ v: "1";
218
+ params: {
219
+ requestId: string;
220
+ };
221
+ jsonrpc: "2.0";
222
+ }>;
223
+ /**
224
+ * Zod schema for every legal client → server frame. Use
225
+ * {@link ClientMessageSchema}.safeParse() inside the server upgrade
226
+ * handler before dispatching to the corresponding subscription /
227
+ * cancel / ping handler.
228
+ *
229
+ * @stable
230
+ */
231
+ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObject<{
232
+ v: z.ZodLiteral<"1">;
233
+ jsonrpc: z.ZodLiteral<"2.0">;
234
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
235
+ method: z.ZodLiteral<"initialize">;
236
+ params: z.ZodObject<{
237
+ clientInfo: z.ZodObject<{
238
+ name: z.ZodString;
239
+ version: z.ZodString;
240
+ }, "strict", z.ZodTypeAny, {
241
+ name: string;
242
+ version: string;
243
+ }, {
244
+ name: string;
245
+ version: string;
246
+ }>;
247
+ capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
248
+ }, "strict", z.ZodTypeAny, {
249
+ clientInfo: {
250
+ name: string;
251
+ version: string;
252
+ };
253
+ capabilities?: Record<string, unknown> | undefined;
254
+ }, {
255
+ clientInfo: {
256
+ name: string;
257
+ version: string;
258
+ };
259
+ capabilities?: Record<string, unknown> | undefined;
260
+ }>;
261
+ }, "strict", z.ZodTypeAny, {
262
+ method: "initialize";
263
+ v: "1";
264
+ params: {
265
+ clientInfo: {
266
+ name: string;
267
+ version: string;
268
+ };
269
+ capabilities?: Record<string, unknown> | undefined;
270
+ };
271
+ jsonrpc: "2.0";
272
+ id: string | number;
273
+ }, {
274
+ method: "initialize";
275
+ v: "1";
276
+ params: {
277
+ clientInfo: {
278
+ name: string;
279
+ version: string;
280
+ };
281
+ capabilities?: Record<string, unknown> | undefined;
282
+ };
283
+ jsonrpc: "2.0";
284
+ id: string | number;
285
+ }>, z.ZodObject<{
286
+ v: z.ZodLiteral<"1">;
287
+ jsonrpc: z.ZodLiteral<"2.0">;
288
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
289
+ method: z.ZodLiteral<"subscription.subscribe">;
290
+ params: z.ZodObject<{
291
+ subject: z.ZodString;
292
+ sinceEventId: z.ZodOptional<z.ZodString>;
293
+ }, "strict", z.ZodTypeAny, {
294
+ subject: string;
295
+ sinceEventId?: string | undefined;
296
+ }, {
297
+ subject: string;
298
+ sinceEventId?: string | undefined;
299
+ }>;
300
+ }, "strict", z.ZodTypeAny, {
301
+ method: "subscription.subscribe";
302
+ v: "1";
303
+ params: {
304
+ subject: string;
305
+ sinceEventId?: string | undefined;
306
+ };
307
+ jsonrpc: "2.0";
308
+ id: string | number;
309
+ }, {
310
+ method: "subscription.subscribe";
311
+ v: "1";
312
+ params: {
313
+ subject: string;
314
+ sinceEventId?: string | undefined;
315
+ };
316
+ jsonrpc: "2.0";
317
+ id: string | number;
318
+ }>, z.ZodObject<{
319
+ v: z.ZodLiteral<"1">;
320
+ jsonrpc: z.ZodLiteral<"2.0">;
321
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
322
+ method: z.ZodLiteral<"subscription.unsubscribe">;
323
+ params: z.ZodObject<{
324
+ subscriptionId: z.ZodString;
325
+ }, "strict", z.ZodTypeAny, {
326
+ subscriptionId: string;
327
+ }, {
328
+ subscriptionId: string;
329
+ }>;
330
+ }, "strict", z.ZodTypeAny, {
331
+ method: "subscription.unsubscribe";
332
+ v: "1";
333
+ params: {
334
+ subscriptionId: string;
335
+ };
336
+ jsonrpc: "2.0";
337
+ id: string | number;
338
+ }, {
339
+ method: "subscription.unsubscribe";
340
+ v: "1";
341
+ params: {
342
+ subscriptionId: string;
343
+ };
344
+ jsonrpc: "2.0";
345
+ id: string | number;
346
+ }>, z.ZodObject<{
347
+ v: z.ZodLiteral<"1">;
348
+ jsonrpc: z.ZodLiteral<"2.0">;
349
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
350
+ method: z.ZodLiteral<"run.cancel">;
351
+ params: z.ZodObject<{
352
+ runId: z.ZodString;
353
+ reason: z.ZodOptional<z.ZodString>;
354
+ drain: z.ZodOptional<z.ZodBoolean>;
355
+ onPendingApprovals: z.ZodOptional<z.ZodEnum<["deny", "preserve"]>>;
356
+ }, "strict", z.ZodTypeAny, {
357
+ runId: string;
358
+ reason?: string | undefined;
359
+ drain?: boolean | undefined;
360
+ onPendingApprovals?: "deny" | "preserve" | undefined;
361
+ }, {
362
+ runId: string;
363
+ reason?: string | undefined;
364
+ drain?: boolean | undefined;
365
+ onPendingApprovals?: "deny" | "preserve" | undefined;
366
+ }>;
367
+ }, "strict", z.ZodTypeAny, {
368
+ method: "run.cancel";
369
+ v: "1";
370
+ params: {
371
+ runId: string;
372
+ reason?: string | undefined;
373
+ drain?: boolean | undefined;
374
+ onPendingApprovals?: "deny" | "preserve" | undefined;
375
+ };
376
+ jsonrpc: "2.0";
377
+ id: string | number;
378
+ }, {
379
+ method: "run.cancel";
380
+ v: "1";
381
+ params: {
382
+ runId: string;
383
+ reason?: string | undefined;
384
+ drain?: boolean | undefined;
385
+ onPendingApprovals?: "deny" | "preserve" | undefined;
386
+ };
387
+ jsonrpc: "2.0";
388
+ id: string | number;
389
+ }>, z.ZodObject<{
390
+ v: z.ZodLiteral<"1">;
391
+ jsonrpc: z.ZodLiteral<"2.0">;
392
+ id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
393
+ method: z.ZodLiteral<"ping">;
394
+ params: z.ZodOptional<z.ZodObject<{
395
+ nonce: z.ZodOptional<z.ZodString>;
396
+ }, "strict", z.ZodTypeAny, {
397
+ nonce?: string | undefined;
398
+ }, {
399
+ nonce?: string | undefined;
400
+ }>>;
401
+ }, "strict", z.ZodTypeAny, {
402
+ method: "ping";
403
+ v: "1";
404
+ jsonrpc: "2.0";
405
+ id: string | number;
406
+ params?: {
407
+ nonce?: string | undefined;
408
+ } | undefined;
409
+ }, {
410
+ method: "ping";
411
+ v: "1";
412
+ jsonrpc: "2.0";
413
+ id: string | number;
414
+ params?: {
415
+ nonce?: string | undefined;
416
+ } | undefined;
417
+ }>, z.ZodObject<{
418
+ v: z.ZodLiteral<"1">;
419
+ jsonrpc: z.ZodLiteral<"2.0">;
420
+ method: z.ZodLiteral<"notifications/cancelled">;
421
+ params: z.ZodObject<{
422
+ requestId: z.ZodString;
423
+ }, "strict", z.ZodTypeAny, {
424
+ requestId: string;
425
+ }, {
426
+ requestId: string;
427
+ }>;
428
+ }, "strict", z.ZodTypeAny, {
429
+ method: "notifications/cancelled";
430
+ v: "1";
431
+ params: {
432
+ requestId: string;
433
+ };
434
+ jsonrpc: "2.0";
435
+ }, {
436
+ method: "notifications/cancelled";
437
+ v: "1";
438
+ params: {
439
+ requestId: string;
440
+ };
441
+ jsonrpc: "2.0";
442
+ }>]>;
443
+ /**
444
+ * Inferred TypeScript union for the `ClientMessage` discriminator. A
445
+ * value satisfying this type round-trips through
446
+ * {@link ClientMessageSchema} without throwing.
447
+ *
448
+ * @stable
449
+ */
450
+ type ClientMessage = z.infer<typeof ClientMessageSchema>;
451
+ /**
452
+ * Convenience type for the JSON-RPC `id` slot. Matches the Graphorin
453
+ * subset (string + integer; no `null`, no float).
454
+ *
455
+ * @stable
456
+ */
457
+ type ClientMessageId = z.infer<typeof RpcId>;
458
+ /**
459
+ * Type guard helpers — one per `method` literal — so consumers can
460
+ * narrow the `ClientMessage` union without re-stringifying the
461
+ * discriminator.
462
+ *
463
+ * @stable
464
+ */
465
+ declare function isInitializeRequest(message: ClientMessage): message is z.infer<typeof InitializeRequest>;
466
+ /** @stable */
467
+ declare function isSubscribeRequest(message: ClientMessage): message is z.infer<typeof SubscribeRequest>;
468
+ /** @stable */
469
+ declare function isUnsubscribeRequest(message: ClientMessage): message is z.infer<typeof UnsubscribeRequest>;
470
+ /** @stable */
471
+ declare function isRunCancelRequest(message: ClientMessage): message is z.infer<typeof RunCancelRequest>;
472
+ /** @stable */
473
+ declare function isPingRequest(message: ClientMessage): message is z.infer<typeof PingRequest>;
474
+ /** @stable */
475
+ declare function isCancelledNotification(message: ClientMessage): message is z.infer<typeof CancelledNotification>;
476
+ //#endregion
477
+ export { ClientMessage, ClientMessageId, ClientMessageSchema, isCancelledNotification, isInitializeRequest, isPingRequest, isRunCancelRequest, isSubscribeRequest, isUnsubscribeRequest };
478
+ //# sourceMappingURL=client-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-message.d.ts","names":[],"sources":["../src/client-message.ts"],"sourcesContent":[],"mappings":";;;;cAiBM,OAAK,CAAA,CAAA,UAAA,CAAA,CAAA,WAAA,CAAA,CAAA;cA6CL,mBAAiB,CAAA,CAAA;;;;;;;;;;;;;;MAAA,OAAA,EAAA,MAAA;IAAA,CAAA,CAAA;IAUjB,YAAA,eAQK,YAAA,YAAA,cAAA,CAAA,CAAA;;;;;;;;;;;;;EARW,CAAA,CAAA;CAAA,EAAA,QAAA,cAAA,EAAA;EAUhB,MAAA,EAAA,YAAA;;;;;;;;;;;CAAkB,EAAA;EAAA,MAAA,EAAA,YAAA;EAUlB,CAAA,EAAA,GAAA;;;;;;;;;;;cApBA,kBAAgB,CAAA,CAAA;;;;;;IAoBA,OAAA,aAAA;IAAA,YAAA,eAAA,YAAA,CAAA;EAUhB,CAAA,EAAA,QAAA,cAQK,EAAA;;;;;;;;;;;;;EARM,CAAA;EAAA,OAAA,EAAA,KAAA;EAUX,EAAA,EAAA,MAAA,GAAA,MAAA;;;;;;;;EAAqB,OAAA,EAAA,KAAA;EAAA,EAAA,EAAA,MAAA,GAAA,MAAA;AAiB3B,CAAA,CAAA;cA/CM,oBAAkB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;EA+CQ,MAAA,EAAA,0BAAA;;;;;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