@graphorin/protocol 0.6.1 → 0.7.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @graphorin/protocol
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#154](https://github.com/o-stepper/graphorin/pull/154) [`fe98522`](https://github.com/o-stepper/graphorin/commit/fe98522ce2477c9a7dc09029f9dcfdb1f7c9aa04) Thanks [@o-stepper](https://github.com/o-stepper)! - W-072: every export map's `import` condition becomes `default`, and the Node floor rises to `>=22.12.0`.
8
+
9
+ CJS consumers previously hit a bewildering `ERR_PACKAGE_PATH_NOT_EXPORTED` instead of a clear ESM-only signal. With the `default` condition, plain `require('@graphorin/core')` works via Node's stable `require(esm)` - which shipped in 22.12, hence the engines bump across every workspace manifest (packages, examples, benchmarks, docs; enforced by the widened mvp-readiness sweep). No dual-instance hazard: there is no CJS build, `require()` returns the same ESM module instance. ESM consumers are unaffected (`default` serves both paths; `types` stays first). The pack gate now runs attw under the full `node16` profile (was `esm-only`) and adds a runtime `require(esm)` smoke against the packed tarballs. Installs on Node 22.0-22.11 with `engine-strict` will refuse - upgrade Node (see the migration guide).
10
+
11
+ ### Patch Changes
12
+
13
+ - [#160](https://github.com/o-stepper/graphorin/pull/160) [`4ee256e`](https://github.com/o-stepper/graphorin/commit/4ee256e30fe9190cef6c48dc6785464757707156) Thanks [@o-stepper](https://github.com/o-stepper)! - W-109: the package doc no longer promises forward-compatible negotiation that does not exist. It now states the actual contract: the frame ENVELOPE (kind set, control-frame fields, the `v: '1'` literal) is validated strictly on both sides and evolves only lockstep (the 0.x deployment model; `v: '2'` frames are rejected), while the deliberate additive extension points live inside the envelope (event `type` + `payload: z.unknown()`, RPC `result: z.unknown()`, the `initialize` capabilities record - which the shipped client currently does not consume). New contract tests pin both classes of behaviour: unknown event types and arbitrary payload/result values pass; extra envelope fields, unknown kinds and `v: '2'` fail. No schema or wire behaviour changed.
14
+
15
+ - [#164](https://github.com/o-stepper/graphorin/pull/164) [`764239b`](https://github.com/o-stepper/graphorin/commit/764239b97e0e0202442e91272583f13adeb12d00) Thanks [@o-stepper](https://github.com/o-stepper)! - Tarballs now ship `src/` so the published `dist/**/*.d.ts.map` files actually work (W-136): the maps referenced `../src/*.ts` that the `files` whitelist excluded, so go-to-definition fell back into `.d.ts` and the shipped maps were dead weight. The pack gate gains a `map-integrity` leg: every source referenced by a shipped map must resolve inside the tarball (or be embedded via `sourcesContent`), with an anti-vacuous guard - a package whose tsdown config emits declaration maps must contain a non-zero number of `.d.ts.map` files, so a cache-restored dist that silently dropped maps fails the gate instead of passing vacuously. `mvp-readiness` now requires `src` in every publishable `files` array.
16
+
17
+ - [#154](https://github.com/o-stepper/graphorin/pull/154) [`fe98522`](https://github.com/o-stepper/graphorin/commit/fe98522ce2477c9a7dc09029f9dcfdb1f7c9aa04) Thanks [@o-stepper](https://github.com/o-stepper)! - W-046: JSON-safe `WireAgentEvent` projection for all binary-bearing event variants, applied on the server WS path.
18
+
19
+ `@graphorin/core` gains `WireFileGeneratedEvent`, `WireToolExecutePartialEvent`, `WireAgentEndEvent` (whose `result.state` is the `WireRunState` projection) plus the `WireAgentEvent` union and pure `toWireAgentEvent`/`fromWireAgentEvent` codecs. The `AgentEvent` TSDoc now documents the real two-layer wire contract (envelope `{eventId, subject, type, payload}` with `payload = WireAgentEvent`) instead of the false claim that `@graphorin/protocol` re-exports the union; protocol stays zod-only with a doc pointer. The server's `backgroundStreamAgent` projects every streamed event before emitting, so `file.generated`, binary `tool.execute.partial` chunks and a multimodal `agent.end` state arrive at WS clients decodable instead of as numeric-key mush. An exhaustive `Record<AgentEvent['type'], ...>` fixture gate in core forces a wire decision for every future event variant.
20
+
3
21
  ## 0.6.1
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
6
6
  [![Node.js: 22+](https://img.shields.io/badge/Node.js-22%2B-43853d.svg)](https://nodejs.org)
7
7
 
8
- - **Version:** v0.6.1
8
+ - **Version:** v0.7.0
9
9
  - **License:** [MIT](./LICENSE) (© 2026 Oleksiy Stepurenko)
10
10
  - **Repository:** <https://github.com/o-stepper/graphorin/tree/main/packages/protocol>
11
11
  - **Issues:** <https://github.com/o-stepper/graphorin/issues>
@@ -68,4 +68,4 @@ MIT © 2026 Oleksiy Stepurenko. See [`LICENSE`](./LICENSE).
68
68
 
69
69
  ---
70
70
 
71
- **Project Graphorin** · v0.6.1 · MIT License · © 2026 Oleksiy Stepurenko · <https://github.com/o-stepper/graphorin>
71
+ **Project Graphorin** · v0.7.0 · MIT License · © 2026 Oleksiy Stepurenko · <https://github.com/o-stepper/graphorin>
@@ -34,7 +34,6 @@ declare const InitializeRequest: z.ZodObject<{
34
34
  capabilities?: Record<string, unknown> | undefined;
35
35
  }>;
36
36
  }, "strict", z.ZodTypeAny, {
37
- method: "initialize";
38
37
  v: "1";
39
38
  params: {
40
39
  clientInfo: {
@@ -45,8 +44,8 @@ declare const InitializeRequest: z.ZodObject<{
45
44
  };
46
45
  jsonrpc: "2.0";
47
46
  id: string | number;
48
- }, {
49
47
  method: "initialize";
48
+ }, {
50
49
  v: "1";
51
50
  params: {
52
51
  clientInfo: {
@@ -57,6 +56,7 @@ declare const InitializeRequest: z.ZodObject<{
57
56
  };
58
57
  jsonrpc: "2.0";
59
58
  id: string | number;
59
+ method: "initialize";
60
60
  }>;
61
61
  declare const SubscribeRequest: z.ZodObject<{
62
62
  v: z.ZodLiteral<"1">;
@@ -74,7 +74,6 @@ declare const SubscribeRequest: z.ZodObject<{
74
74
  sinceEventId?: string | undefined;
75
75
  }>;
76
76
  }, "strict", z.ZodTypeAny, {
77
- method: "subscription.subscribe";
78
77
  v: "1";
79
78
  params: {
80
79
  subject: string;
@@ -82,8 +81,8 @@ declare const SubscribeRequest: z.ZodObject<{
82
81
  };
83
82
  jsonrpc: "2.0";
84
83
  id: string | number;
85
- }, {
86
84
  method: "subscription.subscribe";
85
+ }, {
87
86
  v: "1";
88
87
  params: {
89
88
  subject: string;
@@ -91,6 +90,7 @@ declare const SubscribeRequest: z.ZodObject<{
91
90
  };
92
91
  jsonrpc: "2.0";
93
92
  id: string | number;
93
+ method: "subscription.subscribe";
94
94
  }>;
95
95
  declare const UnsubscribeRequest: z.ZodObject<{
96
96
  v: z.ZodLiteral<"1">;
@@ -105,21 +105,21 @@ declare const UnsubscribeRequest: z.ZodObject<{
105
105
  subscriptionId: string;
106
106
  }>;
107
107
  }, "strict", z.ZodTypeAny, {
108
- method: "subscription.unsubscribe";
109
108
  v: "1";
110
109
  params: {
111
110
  subscriptionId: string;
112
111
  };
113
112
  jsonrpc: "2.0";
114
113
  id: string | number;
115
- }, {
116
114
  method: "subscription.unsubscribe";
115
+ }, {
117
116
  v: "1";
118
117
  params: {
119
118
  subscriptionId: string;
120
119
  };
121
120
  jsonrpc: "2.0";
122
121
  id: string | number;
122
+ method: "subscription.unsubscribe";
123
123
  }>;
124
124
  declare const RunCancelRequest: z.ZodObject<{
125
125
  v: z.ZodLiteral<"1">;
@@ -143,7 +143,6 @@ declare const RunCancelRequest: z.ZodObject<{
143
143
  onPendingApprovals?: "deny" | "preserve" | undefined;
144
144
  }>;
145
145
  }, "strict", z.ZodTypeAny, {
146
- method: "run.cancel";
147
146
  v: "1";
148
147
  params: {
149
148
  runId: string;
@@ -153,8 +152,8 @@ declare const RunCancelRequest: z.ZodObject<{
153
152
  };
154
153
  jsonrpc: "2.0";
155
154
  id: string | number;
156
- }, {
157
155
  method: "run.cancel";
156
+ }, {
158
157
  v: "1";
159
158
  params: {
160
159
  runId: string;
@@ -164,6 +163,7 @@ declare const RunCancelRequest: z.ZodObject<{
164
163
  };
165
164
  jsonrpc: "2.0";
166
165
  id: string | number;
166
+ method: "run.cancel";
167
167
  }>;
168
168
  declare const PingRequest: z.ZodObject<{
169
169
  v: z.ZodLiteral<"1">;
@@ -178,18 +178,18 @@ declare const PingRequest: z.ZodObject<{
178
178
  nonce?: string | undefined;
179
179
  }>>;
180
180
  }, "strict", z.ZodTypeAny, {
181
- method: "ping";
182
181
  v: "1";
183
182
  jsonrpc: "2.0";
184
183
  id: string | number;
184
+ method: "ping";
185
185
  params?: {
186
186
  nonce?: string | undefined;
187
187
  } | undefined;
188
188
  }, {
189
- method: "ping";
190
189
  v: "1";
191
190
  jsonrpc: "2.0";
192
191
  id: string | number;
192
+ method: "ping";
193
193
  params?: {
194
194
  nonce?: string | undefined;
195
195
  } | undefined;
@@ -206,19 +206,19 @@ declare const CancelledNotification: z.ZodObject<{
206
206
  requestId: string;
207
207
  }>;
208
208
  }, "strict", z.ZodTypeAny, {
209
- method: "notifications/cancelled";
210
209
  v: "1";
211
210
  params: {
212
211
  requestId: string;
213
212
  };
214
213
  jsonrpc: "2.0";
215
- }, {
216
214
  method: "notifications/cancelled";
215
+ }, {
217
216
  v: "1";
218
217
  params: {
219
218
  requestId: string;
220
219
  };
221
220
  jsonrpc: "2.0";
221
+ method: "notifications/cancelled";
222
222
  }>;
223
223
  /**
224
224
  * Zod schema for every legal client → server frame. Use
@@ -259,7 +259,6 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
259
259
  capabilities?: Record<string, unknown> | undefined;
260
260
  }>;
261
261
  }, "strict", z.ZodTypeAny, {
262
- method: "initialize";
263
262
  v: "1";
264
263
  params: {
265
264
  clientInfo: {
@@ -270,8 +269,8 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
270
269
  };
271
270
  jsonrpc: "2.0";
272
271
  id: string | number;
273
- }, {
274
272
  method: "initialize";
273
+ }, {
275
274
  v: "1";
276
275
  params: {
277
276
  clientInfo: {
@@ -282,6 +281,7 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
282
281
  };
283
282
  jsonrpc: "2.0";
284
283
  id: string | number;
284
+ method: "initialize";
285
285
  }>, z.ZodObject<{
286
286
  v: z.ZodLiteral<"1">;
287
287
  jsonrpc: z.ZodLiteral<"2.0">;
@@ -298,7 +298,6 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
298
298
  sinceEventId?: string | undefined;
299
299
  }>;
300
300
  }, "strict", z.ZodTypeAny, {
301
- method: "subscription.subscribe";
302
301
  v: "1";
303
302
  params: {
304
303
  subject: string;
@@ -306,8 +305,8 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
306
305
  };
307
306
  jsonrpc: "2.0";
308
307
  id: string | number;
309
- }, {
310
308
  method: "subscription.subscribe";
309
+ }, {
311
310
  v: "1";
312
311
  params: {
313
312
  subject: string;
@@ -315,6 +314,7 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
315
314
  };
316
315
  jsonrpc: "2.0";
317
316
  id: string | number;
317
+ method: "subscription.subscribe";
318
318
  }>, z.ZodObject<{
319
319
  v: z.ZodLiteral<"1">;
320
320
  jsonrpc: z.ZodLiteral<"2.0">;
@@ -328,21 +328,21 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
328
328
  subscriptionId: string;
329
329
  }>;
330
330
  }, "strict", z.ZodTypeAny, {
331
- method: "subscription.unsubscribe";
332
331
  v: "1";
333
332
  params: {
334
333
  subscriptionId: string;
335
334
  };
336
335
  jsonrpc: "2.0";
337
336
  id: string | number;
338
- }, {
339
337
  method: "subscription.unsubscribe";
338
+ }, {
340
339
  v: "1";
341
340
  params: {
342
341
  subscriptionId: string;
343
342
  };
344
343
  jsonrpc: "2.0";
345
344
  id: string | number;
345
+ method: "subscription.unsubscribe";
346
346
  }>, z.ZodObject<{
347
347
  v: z.ZodLiteral<"1">;
348
348
  jsonrpc: z.ZodLiteral<"2.0">;
@@ -365,7 +365,6 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
365
365
  onPendingApprovals?: "deny" | "preserve" | undefined;
366
366
  }>;
367
367
  }, "strict", z.ZodTypeAny, {
368
- method: "run.cancel";
369
368
  v: "1";
370
369
  params: {
371
370
  runId: string;
@@ -375,8 +374,8 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
375
374
  };
376
375
  jsonrpc: "2.0";
377
376
  id: string | number;
378
- }, {
379
377
  method: "run.cancel";
378
+ }, {
380
379
  v: "1";
381
380
  params: {
382
381
  runId: string;
@@ -386,6 +385,7 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
386
385
  };
387
386
  jsonrpc: "2.0";
388
387
  id: string | number;
388
+ method: "run.cancel";
389
389
  }>, z.ZodObject<{
390
390
  v: z.ZodLiteral<"1">;
391
391
  jsonrpc: z.ZodLiteral<"2.0">;
@@ -399,18 +399,18 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
399
399
  nonce?: string | undefined;
400
400
  }>>;
401
401
  }, "strict", z.ZodTypeAny, {
402
- method: "ping";
403
402
  v: "1";
404
403
  jsonrpc: "2.0";
405
404
  id: string | number;
405
+ method: "ping";
406
406
  params?: {
407
407
  nonce?: string | undefined;
408
408
  } | undefined;
409
409
  }, {
410
- method: "ping";
411
410
  v: "1";
412
411
  jsonrpc: "2.0";
413
412
  id: string | number;
413
+ method: "ping";
414
414
  params?: {
415
415
  nonce?: string | undefined;
416
416
  } | undefined;
@@ -426,19 +426,19 @@ declare const ClientMessageSchema: z.ZodDiscriminatedUnion<"method", [z.ZodObjec
426
426
  requestId: string;
427
427
  }>;
428
428
  }, "strict", z.ZodTypeAny, {
429
- method: "notifications/cancelled";
430
429
  v: "1";
431
430
  params: {
432
431
  requestId: string;
433
432
  };
434
433
  jsonrpc: "2.0";
435
- }, {
436
434
  method: "notifications/cancelled";
435
+ }, {
437
436
  v: "1";
438
437
  params: {
439
438
  requestId: string;
440
439
  };
441
440
  jsonrpc: "2.0";
441
+ method: "notifications/cancelled";
442
442
  }>]>;
443
443
  /**
444
444
  * Inferred TypeScript union for the `ClientMessage` discriminator. A
@@ -1 +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;;;;;;;;cArC1B,kBAAgB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAUhB,aAAW,CAAA,CAAA;;;;;;;;;;;EA2Be,CAAA,CAAA,CAAA;CAAA,EAAA,QAAA,cAAA,EAAA;EAgBpB,MAAA,EAAA,MAAA;EAQA,CAAA,EAAA,GAAA;EASI,OAAA,EAAA,KAAA;EACL,EAAA,EAAA,MAAA,GAAA,MAAA;EACkB,MAAA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Q/B,eAAA,GAAkB,CAAA,CAAE,aAAa;;;;;;;;iBAS7B,mBAAA,UACL,2BACG,CAAA,CAAE,aAAa;;iBAKb,kBAAA,UACL,2BACG,CAAA,CAAE,aAAa;;iBAKb,oBAAA,UACL,2BACG,CAAA,CAAE,aAAa;;iBAKb,kBAAA,UACL,2BACG,CAAA,CAAE,aAAa;;iBAKb,aAAA,UAAuB,2BAA2B,CAAA,CAAE,aAAa;;iBAKjE,uBAAA,UACL,2BACG,CAAA,CAAE,aAAa"}
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.6.1";
2
+ var version = "0.7.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };
@@ -1 +1 @@
1
- {"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@graphorin/protocol\",\n \"version\": \"0.6.1\",\n \"description\": \"Wire protocol contract for the Graphorin framework: Zod schemas + TypeScript types for the WebSocket subprotocol `graphorin.protocol.v1`. Defines the `ClientMessage` and `ServerMessage` discriminated unions, the JSON-RPC-shaped control channel (`initialize` / `subscription.subscribe` / `subscription.unsubscribe` / `run.cancel` / `ping`), the typed event push frames (`{ kind: 'event', subject, type, payload, eventId }`), the asynchronous server-initiated error frames (`{ kind: 'error', code, message }`), the subprotocol negotiation helpers, and the close-code taxonomy (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). Browser-friendly: zero Node-only dependencies; the only runtime dependency is `zod`. Created and maintained by Oleksiy Stepurenko.\",\n \"license\": \"MIT\",\n \"author\": \"Oleksiy Stepurenko\",\n \"homepage\": \"https://github.com/o-stepper/graphorin/tree/main/packages/protocol\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/o-stepper/graphorin.git\",\n \"directory\": \"packages/protocol\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/o-stepper/graphorin/issues\"\n },\n \"keywords\": [\n \"graphorin\",\n \"ai\",\n \"agents\",\n \"framework\",\n \"protocol\",\n \"websocket\",\n \"subprotocol\",\n \"zod\",\n \"wire-format\",\n \"browser-friendly\"\n ],\n \"type\": \"module\",\n \"engines\": {\n \"node\": \">=22.0.0\"\n },\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"sideEffects\": false,\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"./client-message\": {\n \"types\": \"./dist/client-message.d.ts\",\n \"import\": \"./dist/client-message.js\"\n },\n \"./server-message\": {\n \"types\": \"./dist/server-message.d.ts\",\n \"import\": \"./dist/server-message.js\"\n },\n \"./subprotocol\": {\n \"types\": \"./dist/subprotocol.d.ts\",\n \"import\": \"./dist/subprotocol.js\"\n },\n \"./close-codes\": {\n \"types\": \"./dist/close-codes.d.ts\",\n \"import\": \"./dist/close-codes.js\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"README.md\",\n \"CHANGELOG.md\",\n \"LICENSE\"\n ],\n \"scripts\": {\n \"build\": \"tsdown\",\n \"typecheck\": \"tsc --noEmit && tsc -p tsconfig.tests.json\",\n \"test\": \"vitest run\",\n \"lint\": \"biome check .\",\n \"clean\": \"rimraf dist .turbo *.tsbuildinfo\"\n },\n \"dependencies\": {\n \"zod\": \"^3.25.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"provenance\": true\n }\n}\n"],"mappings":";cAEa"}
1
+ {"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@graphorin/protocol\",\n \"version\": \"0.7.0\",\n \"description\": \"Wire protocol contract for the Graphorin framework: Zod schemas + TypeScript types for the WebSocket subprotocol `graphorin.protocol.v1`. Defines the `ClientMessage` and `ServerMessage` discriminated unions, the JSON-RPC-shaped control channel (`initialize` / `subscription.subscribe` / `subscription.unsubscribe` / `run.cancel` / `ping`), the typed event push frames (`{ kind: 'event', subject, type, payload, eventId }`), the asynchronous server-initiated error frames (`{ kind: 'error', code, message }`), the subprotocol negotiation helpers, and the close-code taxonomy (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). Browser-friendly: zero Node-only dependencies; the only runtime dependency is `zod`. Created and maintained by Oleksiy Stepurenko.\",\n \"license\": \"MIT\",\n \"author\": \"Oleksiy Stepurenko\",\n \"homepage\": \"https://github.com/o-stepper/graphorin/tree/main/packages/protocol\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/o-stepper/graphorin.git\",\n \"directory\": \"packages/protocol\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/o-stepper/graphorin/issues\"\n },\n \"keywords\": [\n \"graphorin\",\n \"ai\",\n \"agents\",\n \"framework\",\n \"protocol\",\n \"websocket\",\n \"subprotocol\",\n \"zod\",\n \"wire-format\",\n \"browser-friendly\"\n ],\n \"type\": \"module\",\n \"engines\": {\n \"node\": \">=22.12.0\"\n },\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"sideEffects\": false,\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"./client-message\": {\n \"types\": \"./dist/client-message.d.ts\",\n \"default\": \"./dist/client-message.js\"\n },\n \"./server-message\": {\n \"types\": \"./dist/server-message.d.ts\",\n \"default\": \"./dist/server-message.js\"\n },\n \"./subprotocol\": {\n \"types\": \"./dist/subprotocol.d.ts\",\n \"default\": \"./dist/subprotocol.js\"\n },\n \"./close-codes\": {\n \"types\": \"./dist/close-codes.d.ts\",\n \"default\": \"./dist/close-codes.js\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"src\",\n \"README.md\",\n \"CHANGELOG.md\",\n \"LICENSE\"\n ],\n \"scripts\": {\n \"build\": \"tsdown\",\n \"typecheck\": \"tsc --noEmit && tsc -p tsconfig.tests.json\",\n \"test\": \"vitest run\",\n \"lint\": \"biome check .\",\n \"clean\": \"rimraf dist .turbo *.tsbuildinfo\"\n },\n \"dependencies\": {\n \"zod\": \"^3.25.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"provenance\": true\n }\n}\n"],"mappings":";cAEa"}
@@ -62,15 +62,15 @@ declare const SubscribedFrame: z.ZodObject<{
62
62
  snapshotEventId: z.ZodOptional<z.ZodString>;
63
63
  }, "strict", z.ZodTypeAny, {
64
64
  v: "1";
65
- subject: string;
66
- subscriptionId: string;
67
65
  kind: "subscribed";
66
+ subscriptionId: string;
67
+ subject: string;
68
68
  snapshotEventId?: string | undefined;
69
69
  }, {
70
70
  v: "1";
71
- subject: string;
72
- subscriptionId: string;
73
71
  kind: "subscribed";
72
+ subscriptionId: string;
73
+ subject: string;
74
74
  snapshotEventId?: string | undefined;
75
75
  }>;
76
76
  declare const UnsubscribedFrame: z.ZodObject<{
@@ -79,12 +79,12 @@ declare const UnsubscribedFrame: z.ZodObject<{
79
79
  subscriptionId: z.ZodString;
80
80
  }, "strict", z.ZodTypeAny, {
81
81
  v: "1";
82
- subscriptionId: string;
83
82
  kind: "unsubscribed";
83
+ subscriptionId: string;
84
84
  }, {
85
85
  v: "1";
86
- subscriptionId: string;
87
86
  kind: "unsubscribed";
87
+ subscriptionId: string;
88
88
  }>;
89
89
  declare const EventFrame: z.ZodObject<{
90
90
  v: z.ZodLiteral<"1">;
@@ -97,17 +97,17 @@ declare const EventFrame: z.ZodObject<{
97
97
  }, "strict", z.ZodTypeAny, {
98
98
  v: "1";
99
99
  type: string;
100
- subject: string;
101
- subscriptionId: string;
102
100
  kind: "event";
101
+ subscriptionId: string;
102
+ subject: string;
103
103
  eventId: string;
104
104
  payload?: unknown;
105
105
  }, {
106
106
  v: "1";
107
107
  type: string;
108
- subject: string;
109
- subscriptionId: string;
110
108
  kind: "event";
109
+ subscriptionId: string;
110
+ subject: string;
111
111
  eventId: string;
112
112
  payload?: unknown;
113
113
  }>;
@@ -120,14 +120,14 @@ declare const LifecycleFrame: z.ZodObject<{
120
120
  }, "strict", z.ZodTypeAny, {
121
121
  v: "1";
122
122
  status: "aborted" | "running" | "paused" | "completed" | "failed";
123
- subscriptionId: string;
124
123
  kind: "lifecycle";
124
+ subscriptionId: string;
125
125
  reason?: string | undefined;
126
126
  }, {
127
127
  v: "1";
128
128
  status: "aborted" | "running" | "paused" | "completed" | "failed";
129
- subscriptionId: string;
130
129
  kind: "lifecycle";
130
+ subscriptionId: string;
131
131
  reason?: string | undefined;
132
132
  }>;
133
133
  declare const ErrorFrame: z.ZodObject<{
@@ -143,16 +143,16 @@ declare const ErrorFrame: z.ZodObject<{
143
143
  code: string;
144
144
  message: string;
145
145
  kind: "error";
146
- subscriptionId?: string | undefined;
147
146
  data?: unknown;
147
+ subscriptionId?: string | undefined;
148
148
  fatal?: boolean | undefined;
149
149
  }, {
150
150
  v: "1";
151
151
  code: string;
152
152
  message: string;
153
153
  kind: "error";
154
- subscriptionId?: string | undefined;
155
154
  data?: unknown;
155
+ subscriptionId?: string | undefined;
156
156
  fatal?: boolean | undefined;
157
157
  }>;
158
158
  declare const PongFrame: z.ZodObject<{
@@ -177,15 +177,15 @@ declare const ReplayMarkerFrame: z.ZodObject<{
177
177
  note: z.ZodOptional<z.ZodString>;
178
178
  }, "strict", z.ZodTypeAny, {
179
179
  v: "1";
180
- subscriptionId: string;
181
180
  kind: "replay-marker";
181
+ subscriptionId: string;
182
182
  eventId: string;
183
183
  droppedCount?: number | undefined;
184
184
  note?: string | undefined;
185
185
  }, {
186
186
  v: "1";
187
- subscriptionId: string;
188
187
  kind: "replay-marker";
188
+ subscriptionId: string;
189
189
  eventId: string;
190
190
  droppedCount?: number | undefined;
191
191
  note?: string | undefined;
@@ -257,15 +257,15 @@ declare const ServerMessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
257
257
  snapshotEventId: z.ZodOptional<z.ZodString>;
258
258
  }, "strict", z.ZodTypeAny, {
259
259
  v: "1";
260
- subject: string;
261
- subscriptionId: string;
262
260
  kind: "subscribed";
261
+ subscriptionId: string;
262
+ subject: string;
263
263
  snapshotEventId?: string | undefined;
264
264
  }, {
265
265
  v: "1";
266
- subject: string;
267
- subscriptionId: string;
268
266
  kind: "subscribed";
267
+ subscriptionId: string;
268
+ subject: string;
269
269
  snapshotEventId?: string | undefined;
270
270
  }>, z.ZodObject<{
271
271
  v: z.ZodLiteral<"1">;
@@ -273,12 +273,12 @@ declare const ServerMessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
273
273
  subscriptionId: z.ZodString;
274
274
  }, "strict", z.ZodTypeAny, {
275
275
  v: "1";
276
- subscriptionId: string;
277
276
  kind: "unsubscribed";
277
+ subscriptionId: string;
278
278
  }, {
279
279
  v: "1";
280
- subscriptionId: string;
281
280
  kind: "unsubscribed";
281
+ subscriptionId: string;
282
282
  }>, z.ZodObject<{
283
283
  v: z.ZodLiteral<"1">;
284
284
  kind: z.ZodLiteral<"event">;
@@ -290,17 +290,17 @@ declare const ServerMessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
290
290
  }, "strict", z.ZodTypeAny, {
291
291
  v: "1";
292
292
  type: string;
293
- subject: string;
294
- subscriptionId: string;
295
293
  kind: "event";
294
+ subscriptionId: string;
295
+ subject: string;
296
296
  eventId: string;
297
297
  payload?: unknown;
298
298
  }, {
299
299
  v: "1";
300
300
  type: string;
301
- subject: string;
302
- subscriptionId: string;
303
301
  kind: "event";
302
+ subscriptionId: string;
303
+ subject: string;
304
304
  eventId: string;
305
305
  payload?: unknown;
306
306
  }>, z.ZodObject<{
@@ -312,14 +312,14 @@ declare const ServerMessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
312
312
  }, "strict", z.ZodTypeAny, {
313
313
  v: "1";
314
314
  status: "aborted" | "running" | "paused" | "completed" | "failed";
315
- subscriptionId: string;
316
315
  kind: "lifecycle";
316
+ subscriptionId: string;
317
317
  reason?: string | undefined;
318
318
  }, {
319
319
  v: "1";
320
320
  status: "aborted" | "running" | "paused" | "completed" | "failed";
321
- subscriptionId: string;
322
321
  kind: "lifecycle";
322
+ subscriptionId: string;
323
323
  reason?: string | undefined;
324
324
  }>, z.ZodObject<{
325
325
  v: z.ZodLiteral<"1">;
@@ -334,16 +334,16 @@ declare const ServerMessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
334
334
  code: string;
335
335
  message: string;
336
336
  kind: "error";
337
- subscriptionId?: string | undefined;
338
337
  data?: unknown;
338
+ subscriptionId?: string | undefined;
339
339
  fatal?: boolean | undefined;
340
340
  }, {
341
341
  v: "1";
342
342
  code: string;
343
343
  message: string;
344
344
  kind: "error";
345
- subscriptionId?: string | undefined;
346
345
  data?: unknown;
346
+ subscriptionId?: string | undefined;
347
347
  fatal?: boolean | undefined;
348
348
  }>, z.ZodObject<{
349
349
  v: z.ZodLiteral<"1">;
@@ -366,15 +366,15 @@ declare const ServerMessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
366
366
  note: z.ZodOptional<z.ZodString>;
367
367
  }, "strict", z.ZodTypeAny, {
368
368
  v: "1";
369
- subscriptionId: string;
370
369
  kind: "replay-marker";
370
+ subscriptionId: string;
371
371
  eventId: string;
372
372
  droppedCount?: number | undefined;
373
373
  note?: string | undefined;
374
374
  }, {
375
375
  v: "1";
376
- subscriptionId: string;
377
376
  kind: "replay-marker";
377
+ subscriptionId: string;
378
378
  eventId: string;
379
379
  droppedCount?: number | undefined;
380
380
  note?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"server-message.d.ts","names":[],"sources":["../src/server-message.ts"],"sourcesContent":[],"mappings":";;;;cAiCM,YAAU,CAAA,CAAA;;;;;CASA,EAAA,QAAA,cAAA,EAAA;EAAA,CAAA,EAAA,GAAA;EASV,OAAA,EAAA,KAAA;;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Aa;;KAEjC,uBAAA,GAA0B,CAAA,CAAE,aAAa;;KAEzC,gBAAA,GAAmB,CAAA,CAAE,aAAa;;KAElC,gBAAA,GAAmB,CAAA,CAAE,aAAa;;;;;;;;iBAS9B,YAAA,UAAsB,2BAA2B;;iBAKjD,gBAAA,UAA0B,2BAA2B;;iBAKrD,YAAA,UAAsB,2BAA2B;;iBAKjD,iBAAA,UAA2B,2BAA2B;;iBAKtD,mBAAA,UAA6B,2BAA2B;;iBAKxD,WAAA,UAAqB,2BAA2B;;iBAKhD,mBAAA,UAA6B,2BAA2B;;iBAKxD,YAAA,UAAsB,2BAA2B;;iBAKjD,YAAA,UAAsB,2BAA2B;;;;;;;;;cAYpD,iBAAe"}
@@ -16,8 +16,20 @@ import { z } from "zod";
16
16
  * - server-initiated messages that do not correlate with a
17
17
  * single client RPC id.
18
18
  *
19
- * Every frame carries the `v: '1'` literal so future revisions can
20
- * negotiate forward-compatible additions without a subprotocol bump.
19
+ * Versioning contract (W-109, honest edition): the frame ENVELOPE -
20
+ * the set of `kind`s, the fields of the control frames, and the
21
+ * `v: '1'` literal - is validated strictly (`.strict()`, literal `v`)
22
+ * on BOTH server and client, and evolves only in lockstep with both
23
+ * sides shipping together: there is NO negotiation, and a frame with
24
+ * `v: '2'` is rejected outright. That is the deployment model of the
25
+ * 0.x line. The additive extension points are deliberate and inside
26
+ * the envelope: the `type` string + `payload: z.unknown()` of event
27
+ * frames (consumers ignore unknown `type`s per the agent-event
28
+ * convention), `result: z.unknown()` of RPC responses, and the
29
+ * `capabilities` record of the `initialize` result (which today the
30
+ * shipped client does not consume). If additive envelope evolution is
31
+ * ever promised publicly, that is a separate negotiation feature -
32
+ * do not loosen `.strict()` for it piecemeal.
21
33
  *
22
34
  * @packageDocumentation
23
35
  */