@gonvex/protocol 0.1.18 → 0.1.20

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/README.md CHANGED
@@ -29,6 +29,8 @@ The package includes:
29
29
  - JSON-safe value types
30
30
  - function manifest types
31
31
  - WebSocket client and server message unions
32
+ - live-query result, progress, patch, and revision frames
33
+ - durable sync open/batch-open, snapshot, delta, reset, ready, and cursor types
32
34
  - browser telemetry and message trace types
33
35
 
34
36
  ## Related Packages
package/dist/index.d.ts CHANGED
@@ -77,11 +77,40 @@ export type BrowserTelemetryInfo = {
77
77
  export type QueryCacheDirective = {
78
78
  protocolVersion: 1;
79
79
  scope: string;
80
+ /**
81
+ * Visibility-only scope (project/tenant/user/permissions, no code epoch)
82
+ * under which sync collections are persisted and resumed. Unlike `scope`,
83
+ * it survives deploys; resume safety comes from the server's authoritative
84
+ * reconcile. Absent on runtimes that predate deploy-stable sync scopes.
85
+ */
86
+ syncScope?: string;
80
87
  epoch: string;
81
88
  maxAgeMs: number;
82
89
  };
83
90
  export type ServerCapabilities = {
91
+ /** WebSocket protocol generation implemented by this runtime. */
92
+ protocolVersion?: number;
93
+ /** Exact runtime build identifier, normally the deployed Git commit SHA. */
94
+ runtimeVersion?: string;
84
95
  syncBatch?: 1;
96
+ /** sync.ready frames always carry a collection integrity digest. */
97
+ syncIntegrity?: 1;
98
+ /** Server accepts `query.subscribeMany` batched subscription frames. */
99
+ queryBatch?: 1;
100
+ /** Server accepts `mutation.callMany` batched offline-queue flushes. */
101
+ mutationBatch?: 1;
102
+ };
103
+ export type QuerySubscribeRequest = {
104
+ id: string;
105
+ path: string;
106
+ args: JsonValue;
107
+ cacheRevision?: string;
108
+ };
109
+ export type MutationCallRequest = {
110
+ id: string;
111
+ path: string;
112
+ args: JsonValue;
113
+ trace?: MessageTrace;
85
114
  };
86
115
  export type SyncOpenRequest = {
87
116
  id: string;
@@ -89,12 +118,16 @@ export type SyncOpenRequest = {
89
118
  args: JsonValue;
90
119
  cursor?: SyncCursor;
91
120
  keys?: string[];
121
+ hashes?: Record<string, string>;
122
+ digest?: string;
123
+ fullIntegrity?: boolean;
92
124
  };
93
125
  export type SyncReady = {
94
126
  id: string;
95
127
  path?: string;
96
128
  cursor: SyncCursor;
97
129
  mode?: "eager" | "progressive";
130
+ digest?: string;
98
131
  };
99
132
  export type GonvexManifest = {
100
133
  project: string;
@@ -108,6 +141,7 @@ export type ClientMessage = {
108
141
  token?: string;
109
142
  project?: string;
110
143
  tenant?: string;
144
+ device?: BrowserTelemetryInfo;
111
145
  } | {
112
146
  type: "query.subscribe";
113
147
  id: string;
@@ -124,9 +158,15 @@ export type ClientMessage = {
124
158
  args: JsonValue;
125
159
  cursor?: SyncCursor;
126
160
  keys?: string[];
161
+ hashes?: Record<string, string>;
162
+ digest?: string;
163
+ fullIntegrity?: boolean;
127
164
  } | {
128
165
  type: "sync.openMany";
129
166
  opens: SyncOpenRequest[];
167
+ } | {
168
+ type: "query.subscribeMany";
169
+ subscribes: QuerySubscribeRequest[];
130
170
  } | {
131
171
  type: "sync.close";
132
172
  id: string;
@@ -136,6 +176,9 @@ export type ClientMessage = {
136
176
  path: string;
137
177
  args: JsonValue;
138
178
  trace?: MessageTrace;
179
+ } | {
180
+ type: "mutation.callMany";
181
+ calls: MutationCallRequest[];
139
182
  } | {
140
183
  type: "action.call";
141
184
  id: string;
@@ -216,6 +259,7 @@ export type ServerMessage = {
216
259
  mode?: "eager" | "progressive";
217
260
  maxRows?: number;
218
261
  maxBytes?: number;
262
+ hashes?: Record<string, string>;
219
263
  } | {
220
264
  type: "sync.delta";
221
265
  id: string;
@@ -224,16 +268,28 @@ export type ServerMessage = {
224
268
  upserts?: JsonValue[];
225
269
  deleted?: string[];
226
270
  mutationIds?: string[];
271
+ hashes?: Record<string, string>;
272
+ digest?: string;
227
273
  } | ({
228
274
  type: "sync.ready";
275
+ digest?: string;
229
276
  } & SyncReady) | {
230
277
  type: "sync.readyMany";
231
278
  ready: SyncReady[];
279
+ } | {
280
+ type: "sync.needHashes";
281
+ id: string;
282
+ path?: string;
283
+ } | {
284
+ type: "sync.syncing";
285
+ id: string;
286
+ path?: string;
287
+ reason: "disconnected" | "reconciling" | "listener-reconnecting" | "integrity-reconciling";
232
288
  } | {
233
289
  type: "sync.reset";
234
290
  id: string;
235
291
  path?: string;
236
- reason: "cursor-expired" | "definition-changed" | "visibility-changed" | "recover";
292
+ reason: "cursor-expired" | "definition-changed" | "visibility-changed" | "integrity-mismatch" | "integrity-missing" | "recover";
237
293
  } | {
238
294
  type: "sync.error";
239
295
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonvex/protocol",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"