@graview/ship 0.1.0 → 0.1.3

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 (77) hide show
  1. package/README.md +165 -9
  2. package/dist/browser-adapter.d.ts +9 -9
  3. package/dist/browser-adapter.d.ts.map +1 -1
  4. package/dist/browser-adapter.js +6 -3
  5. package/dist/browser-adapter.js.map +1 -1
  6. package/dist/browser.d.ts +10 -6
  7. package/dist/browser.d.ts.map +1 -1
  8. package/dist/browser.js +4 -2
  9. package/dist/browser.js.map +1 -1
  10. package/dist/cli.d.ts +17 -7
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +41 -7
  13. package/dist/cli.js.map +1 -1
  14. package/dist/export.d.ts +27 -2
  15. package/dist/export.d.ts.map +1 -1
  16. package/dist/export.js +38 -5
  17. package/dist/export.js.map +1 -1
  18. package/dist/file-adapter.d.ts +8 -8
  19. package/dist/file-adapter.d.ts.map +1 -1
  20. package/dist/file-adapter.js +58 -8
  21. package/dist/file-adapter.js.map +1 -1
  22. package/dist/handler.d.ts +271 -0
  23. package/dist/handler.d.ts.map +1 -0
  24. package/dist/handler.js +581 -0
  25. package/dist/handler.js.map +1 -0
  26. package/dist/health.d.ts +9 -0
  27. package/dist/health.d.ts.map +1 -1
  28. package/dist/health.js +5 -1
  29. package/dist/health.js.map +1 -1
  30. package/dist/index.d.ts +14 -7
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +6 -3
  33. package/dist/index.js.map +1 -1
  34. package/dist/live-protocol.d.ts +208 -0
  35. package/dist/live-protocol.d.ts.map +1 -0
  36. package/dist/live-protocol.js +380 -0
  37. package/dist/live-protocol.js.map +1 -0
  38. package/dist/live.d.ts +266 -0
  39. package/dist/live.d.ts.map +1 -0
  40. package/dist/live.js +74 -0
  41. package/dist/live.js.map +1 -0
  42. package/dist/meta.d.ts +13 -0
  43. package/dist/meta.d.ts.map +1 -0
  44. package/dist/meta.js +2 -0
  45. package/dist/meta.js.map +1 -0
  46. package/dist/open-store.d.ts +56 -7
  47. package/dist/open-store.d.ts.map +1 -1
  48. package/dist/open-store.js +141 -12
  49. package/dist/open-store.js.map +1 -1
  50. package/dist/remote.d.ts +237 -13
  51. package/dist/remote.d.ts.map +1 -1
  52. package/dist/remote.js +1033 -88
  53. package/dist/remote.js.map +1 -1
  54. package/dist/runtime.d.ts +34 -0
  55. package/dist/runtime.d.ts.map +1 -0
  56. package/dist/runtime.js +22 -0
  57. package/dist/runtime.js.map +1 -0
  58. package/dist/seat-headers.d.ts +26 -0
  59. package/dist/seat-headers.d.ts.map +1 -0
  60. package/dist/seat-headers.js +26 -0
  61. package/dist/seat-headers.js.map +1 -0
  62. package/dist/serve.d.ts +16 -106
  63. package/dist/serve.d.ts.map +1 -1
  64. package/dist/serve.js +95 -217
  65. package/dist/serve.js.map +1 -1
  66. package/dist/source-edit.d.ts.map +1 -1
  67. package/dist/source-edit.js +6 -1
  68. package/dist/source-edit.js.map +1 -1
  69. package/dist/steps.d.ts +43 -0
  70. package/dist/steps.d.ts.map +1 -1
  71. package/dist/steps.js +69 -0
  72. package/dist/steps.js.map +1 -1
  73. package/dist/websocket.d.ts +14 -0
  74. package/dist/websocket.d.ts.map +1 -0
  75. package/dist/websocket.js +163 -0
  76. package/dist/websocket.js.map +1 -0
  77. package/package.json +6 -2
package/dist/live.d.ts ADDED
@@ -0,0 +1,266 @@
1
+ import { type FieldConflict, type FieldRevision, type MutationCall, type Operation, type Presence, type Principal, type RefusalReason } from "@graview/core";
2
+ export { REFUSAL_REASONS } from "@graview/core";
3
+ export type { RefusalReason, WireRefusal } from "@graview/core";
4
+ /**
5
+ * THE LIVE WIRE (FR-05): the same store, pushed down a WebSocket.
6
+ *
7
+ * Polling stays — it is the wire a person can reproduce with `curl`, and
8
+ * every runtime answers it — and beside it, at `LIVE_PATH`, one socket per
9
+ * client carries the same things as messages: calls in, the ops they made
10
+ * out, everybody else's ops the moment they land, and who is here. Each
11
+ * message is one JSON object, told apart by `t`.
12
+ *
13
+ * The protocol is numbered by `WIRE_PROTOCOL` (`@graview/core`), which
14
+ * `hello` and `welcome` both say. The socket is an addition to protocol 1,
15
+ * not a new protocol: every client of protocol 1 is still served, so the
16
+ * number stays where it is (docs/stability.md, "The wire"). So did the
17
+ * `declaration` push (FR-43) and the skew messages and fields — `reload`,
18
+ * `wire`, `build` (FR-44): a protocol-1 client that does not know them
19
+ * ignores them, and raising the number would make every server with a
20
+ * `minProtocol` send every open tab a `reload` for nothing.
21
+ *
22
+ * Seqs mean what they mean on `GET /graview/since?seq=N`: the position of
23
+ * an op in the store's log, and a client's seq is the last one it has. -1
24
+ * is "none yet".
25
+ *
26
+ * What a seat may not see holds here exactly as on the HTTP routes (FR-02,
27
+ * FR-16): every op a socket is sent is the op as that seat may see it,
28
+ * withheld in place where it touched what the seat may not see, and who is
29
+ * here is told as the seat may be told it.
30
+ */
31
+ export declare const LIVE_PATH = "/graview/live";
32
+ /**
33
+ * THE CODEC'S NAME (FR-44). A host that serves two codecs on one path —
34
+ * its own older one and ship's, through a deploy — tells them apart before
35
+ * reading a word: `hello.wire` says it, and so does the WebSocket
36
+ * subprotocol `LIVE_SUBPROTOCOL` the client asks for. A hello that names
37
+ * another wire is answered `error` and not welcomed; one that names none is
38
+ * ship's, as every hello before this was.
39
+ */
40
+ export declare const LIVE_WIRE = "graview.ship";
41
+ /**
42
+ * The WebSocket subprotocol ship's client asks for, `graview.ship.<WIRE_PROTOCOL>`:
43
+ * `openRemote` hands it to the socket factory, `serveStore` answers it,
44
+ * and a Worker answers it with what `liveSubprotocol(request)` says.
45
+ */
46
+ export declare const LIVE_SUBPROTOCOL = "graview.ship.1";
47
+ /** The subprotocol to answer an upgrade with: `LIVE_SUBPROTOCOL` when the client offered it, else none. */
48
+ export declare function liveSubprotocol(request: Request): string | undefined;
49
+ /** What a client says. A field the server does not know is ignored, never refused. */
50
+ export type LiveClientMessage =
51
+ /**
52
+ * The first word on a socket. `seq` is the last op the client has: the
53
+ * welcome carries exactly the ops after it. Without one, the welcome
54
+ * carries the whole state, as `GET /graview/state` would.
55
+ */
56
+ {
57
+ readonly t: "hello";
58
+ readonly seq?: number;
59
+ /** The protocol this client speaks; absent is 1. A server whose `minProtocol` is past it answers `reload` (FR-44). */
60
+ readonly protocol?: number;
61
+ /** The codec, `LIVE_WIRE`; absent is ship's (FR-44). */
62
+ readonly wire?: string;
63
+ /** The host's build this client runs, an opaque string: said for the host to count, never judged (FR-44). */
64
+ readonly build?: string;
65
+ }
66
+ /**
67
+ * Calls, as `POST /graview/ops` takes them. `cid` names the answer.
68
+ * `batch` is the batch the ops land in — the client's own provisional
69
+ * one, so a call it sent twice across a reconnect is answered with the
70
+ * ops it already made rather than made again. `base` is the revision of
71
+ * each field the calls change as the client last saw it; one that moved
72
+ * since is a `conflict`. What the calls came through is not the
73
+ * client's to say: the host records its own `via` (FR-52).
74
+ */
75
+ | {
76
+ readonly t: "call";
77
+ readonly cid: string;
78
+ readonly calls: readonly MutationCall[];
79
+ readonly intent?: string;
80
+ readonly batch?: string;
81
+ readonly base?: readonly FieldRevision[];
82
+ }
83
+ /** Batches to take back, judged as the seat that asks. */
84
+ | {
85
+ readonly t: "undo";
86
+ readonly cid: string;
87
+ readonly batches: readonly string[];
88
+ readonly intent?: string;
89
+ readonly batch?: string;
90
+ }
91
+ /**
92
+ * Where this client is, as `POST /graview/here` takes it. Who it is —
93
+ * the key, the kind, for whom — is the server's to say from the seat;
94
+ * a claim of any of them is not read (FR-47).
95
+ */
96
+ | {
97
+ readonly t: "here";
98
+ readonly presence: Presence;
99
+ }
100
+ /** Gone, as `POST /graview/leave`. */
101
+ | {
102
+ readonly t: "bye";
103
+ };
104
+ /** What the server says. */
105
+ export type LiveServerMessage =
106
+ /**
107
+ * The answer to `hello`: the protocol the server speaks, the last seq in
108
+ * its log, and the ops after the client's seq. `state` only when the
109
+ * hello named no seq.
110
+ */
111
+ {
112
+ readonly t: "welcome";
113
+ readonly protocol: number;
114
+ /** The codec, `LIVE_WIRE` (FR-44). Absent from a server before it. */
115
+ readonly wire?: string;
116
+ /** The declaration version the server serves (FR-43). Absent from a server before it. */
117
+ readonly version?: number;
118
+ /** The host's build, an opaque string: a client on another build keeps working, and is told once (FR-44). */
119
+ readonly build?: string;
120
+ /** This socket's own key in `presence`, built from its seat, so a client can leave itself out of who is here (FR-47). */
121
+ readonly participant?: string;
122
+ readonly seq: number;
123
+ readonly ops: readonly Operation[];
124
+ /** `horizon`: the seq `log` begins at, when the store was compacted (FR-23); absent, 0. */
125
+ readonly state?: {
126
+ readonly version: number;
127
+ readonly snapshot: unknown;
128
+ readonly log: readonly Operation[];
129
+ readonly migrated: readonly string[];
130
+ readonly enabledModules?: readonly string[];
131
+ readonly horizon?: number;
132
+ };
133
+ }
134
+ /** A call or undo landed: the ops it made, in the batch they landed in. Every op before them has already been sent. */
135
+ | {
136
+ readonly t: "ack";
137
+ readonly cid: string;
138
+ readonly seq: number;
139
+ readonly batch: string;
140
+ readonly ops: readonly Operation[];
141
+ }
142
+ /**
143
+ * Refused, in the policy's own sentence, and why as a code a program can
144
+ * branch on (FR-46): `forbidden`, `missing`, `invalid` or `limit`
145
+ * (`REFUSAL_REASONS`), with `wouldNeed` — the roles that could — when
146
+ * the policy knows them. Final: nothing landed, and the client takes the
147
+ * change back.
148
+ */
149
+ | {
150
+ readonly t: "refused";
151
+ readonly cid: string;
152
+ readonly sentence: string;
153
+ readonly reason: RefusalReason;
154
+ readonly wouldNeed?: readonly string[];
155
+ }
156
+ /**
157
+ * NOT NOW (FR-45): the host is busy — a rate, a queue — and the call was
158
+ * not judged. Nothing landed, and nothing is refused: the client keeps
159
+ * the change shown and sends it again after `retryAfter` milliseconds.
160
+ * Every later call on the socket is busy too until this `cid` comes
161
+ * again, so a burst lands in the order it was made.
162
+ */
163
+ | {
164
+ readonly t: "busy";
165
+ readonly cid?: string;
166
+ readonly retryAfter: number;
167
+ readonly sentence?: string;
168
+ }
169
+ /** A stale write: each field that moved since the call's base, theirs and yours. Nothing landed. */
170
+ | {
171
+ readonly t: "conflict";
172
+ readonly cid: string;
173
+ readonly sentence: string;
174
+ readonly conflicts: readonly FieldConflict[];
175
+ }
176
+ /** Ops that landed, everybody's, in seq order and none skipped; `seq` is the last of them. */
177
+ | {
178
+ readonly t: "ops";
179
+ readonly seq: number;
180
+ readonly ops: readonly Operation[];
181
+ }
182
+ /** Who else is here now. */
183
+ | {
184
+ readonly t: "presence";
185
+ readonly who: readonly Presence[];
186
+ }
187
+ /**
188
+ * THE DECLARATION CHANGED (FR-43): the server serves `version` now, on a
189
+ * store migrated to it. The socket is no longer served under the old
190
+ * one — a call is refused until it says hello again — and the client
191
+ * opens on the new declaration, offering its unanswered calls again.
192
+ */
193
+ | {
194
+ readonly t: "declaration";
195
+ readonly version: number;
196
+ }
197
+ /**
198
+ * THIS SERVER NO LONGER SERVES THE CLIENT'S PROTOCOL (FR-44). `protocol`
199
+ * is the lowest it serves. Said in answer to `hello`, and nothing
200
+ * follows: the client keeps what it had not sent, reloads onto a build
201
+ * that speaks it, and offers them again there.
202
+ */
203
+ | {
204
+ readonly t: "reload";
205
+ readonly reason: string;
206
+ readonly protocol: number;
207
+ }
208
+ /** A message the server could not read. */
209
+ | {
210
+ readonly t: "error";
211
+ readonly sentence: string;
212
+ };
213
+ /**
214
+ * WHAT A HOST'S `limit` IS ASKED (FR-45, FR-46): one change, from one seat,
215
+ * before it is judged — on the socket a `call` or an `undo`, over HTTP the
216
+ * body of `POST /graview/ops`.
217
+ */
218
+ export interface LimitAsked {
219
+ readonly seat: Principal;
220
+ /** What the change came through, as the host said it (FR-52). */
221
+ readonly via: string;
222
+ readonly t: "call" | "undo";
223
+ /** Its size on the wire, in UTF-8 bytes: the socket message, or the request body. */
224
+ readonly bytes: number;
225
+ /** The calls it carries; none for an undo. */
226
+ readonly calls: readonly MutationCall[];
227
+ }
228
+ /**
229
+ * WHAT A HOST'S `limit` ANSWERS. Nothing: the change goes on to be judged.
230
+ *
231
+ * - `{ retryAfter, sentence? }` — BUSY: not now (a rate, a queue). The
232
+ * socket says `busy` and HTTP answers 429 with `Retry-After`; the client
233
+ * keeps the change and sends it again after `retryAfter` milliseconds.
234
+ * - `{ refuse }` — REFUSED, reason `limit`: never as asked (over a hard
235
+ * size cap, more calls in one batch than the host takes). The socket says
236
+ * `refused` and HTTP answers 413; the client takes the change back.
237
+ */
238
+ export type LimitAnswer = {
239
+ readonly retryAfter: number;
240
+ readonly sentence?: string;
241
+ } | {
242
+ readonly refuse: string;
243
+ };
244
+ /** A host's word on whether a change may be judged now: busy, refused at its limit, or nothing. */
245
+ export type Limit = (asked: LimitAsked) => LimitAnswer | undefined | Promise<LimitAnswer | undefined>;
246
+ /** A message's size in UTF-8 bytes, as a host's cap counts it. */
247
+ export declare function bytesOf(text: string): number;
248
+ /**
249
+ * WHAT A HOST HANDS THE PROTOCOL: a way to send one text message down the
250
+ * socket, and to close it. A Worker's `WebSocketPair`, a Durable Object's
251
+ * accepted socket, Node's upgrade, a test's array: whatever carries text.
252
+ */
253
+ export interface LiveSocket {
254
+ send(text: string): void;
255
+ close?(code?: number, reason?: string): void;
256
+ }
257
+ /** The server's end of one socket: hand it every message the client sends, and say when the socket closed. */
258
+ export interface LiveConnection {
259
+ receive(text: string): void;
260
+ close(): void;
261
+ }
262
+ /** Said as a person would read it: a short value, or "nothing". */
263
+ export declare function sayValue(value: unknown): string;
264
+ /** "Ana changed label to “Book the church hall” while you were editing; yours was “Book the village hall”. Keep theirs, or send yours again." */
265
+ export declare function conflictSentence(conflicts: readonly FieldConflict[]): string;
266
+ //# sourceMappingURL=live.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MA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,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9C;AAED,8GAA8G;AAC9G,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,mEAAmE;AACnE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM/C;AAED,iJAAiJ;AACjJ,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,CAK5E"}
package/dist/live.js ADDED
@@ -0,0 +1,74 @@
1
+ import { WIRE_PROTOCOL } from "@graview/core";
2
+ export { REFUSAL_REASONS } from "@graview/core";
3
+ /**
4
+ * THE LIVE WIRE (FR-05): the same store, pushed down a WebSocket.
5
+ *
6
+ * Polling stays — it is the wire a person can reproduce with `curl`, and
7
+ * every runtime answers it — and beside it, at `LIVE_PATH`, one socket per
8
+ * client carries the same things as messages: calls in, the ops they made
9
+ * out, everybody else's ops the moment they land, and who is here. Each
10
+ * message is one JSON object, told apart by `t`.
11
+ *
12
+ * The protocol is numbered by `WIRE_PROTOCOL` (`@graview/core`), which
13
+ * `hello` and `welcome` both say. The socket is an addition to protocol 1,
14
+ * not a new protocol: every client of protocol 1 is still served, so the
15
+ * number stays where it is (docs/stability.md, "The wire"). So did the
16
+ * `declaration` push (FR-43) and the skew messages and fields — `reload`,
17
+ * `wire`, `build` (FR-44): a protocol-1 client that does not know them
18
+ * ignores them, and raising the number would make every server with a
19
+ * `minProtocol` send every open tab a `reload` for nothing.
20
+ *
21
+ * Seqs mean what they mean on `GET /graview/since?seq=N`: the position of
22
+ * an op in the store's log, and a client's seq is the last one it has. -1
23
+ * is "none yet".
24
+ *
25
+ * What a seat may not see holds here exactly as on the HTTP routes (FR-02,
26
+ * FR-16): every op a socket is sent is the op as that seat may see it,
27
+ * withheld in place where it touched what the seat may not see, and who is
28
+ * here is told as the seat may be told it.
29
+ */
30
+ export const LIVE_PATH = "/graview/live";
31
+ /**
32
+ * THE CODEC'S NAME (FR-44). A host that serves two codecs on one path —
33
+ * its own older one and ship's, through a deploy — tells them apart before
34
+ * reading a word: `hello.wire` says it, and so does the WebSocket
35
+ * subprotocol `LIVE_SUBPROTOCOL` the client asks for. A hello that names
36
+ * another wire is answered `error` and not welcomed; one that names none is
37
+ * ship's, as every hello before this was.
38
+ */
39
+ export const LIVE_WIRE = "graview.ship";
40
+ /**
41
+ * The WebSocket subprotocol ship's client asks for, `graview.ship.<WIRE_PROTOCOL>`:
42
+ * `openRemote` hands it to the socket factory, `serveStore` answers it,
43
+ * and a Worker answers it with what `liveSubprotocol(request)` says.
44
+ */
45
+ export const LIVE_SUBPROTOCOL = `${LIVE_WIRE}.${WIRE_PROTOCOL}`;
46
+ /** The subprotocol to answer an upgrade with: `LIVE_SUBPROTOCOL` when the client offered it, else none. */
47
+ export function liveSubprotocol(request) {
48
+ const offered = (request.headers.get("sec-websocket-protocol") ?? "").split(",").map((one) => one.trim());
49
+ return offered.includes(LIVE_SUBPROTOCOL) ? LIVE_SUBPROTOCOL : undefined;
50
+ }
51
+ /** A message's size in UTF-8 bytes, as a host's cap counts it. */
52
+ export function bytesOf(text) {
53
+ return new TextEncoder().encode(text).length;
54
+ }
55
+ /** Said as a person would read it: a short value, or "nothing". */
56
+ export function sayValue(value) {
57
+ if (value === undefined || value === null || value === "")
58
+ return "nothing";
59
+ if (typeof value === "string")
60
+ return `“${value.length > 60 ? `${value.slice(0, 57)}…` : value}”`;
61
+ if (typeof value === "number" || typeof value === "boolean")
62
+ return String(value);
63
+ const text = JSON.stringify(value);
64
+ return text.length > 60 ? `${text.slice(0, 57)}…` : text;
65
+ }
66
+ /** "Ana changed label to “Book the church hall” while you were editing; yours was “Book the village hall”. Keep theirs, or send yours again." */
67
+ export function conflictSentence(conflicts) {
68
+ const first = conflicts[0];
69
+ if (!first)
70
+ return "Someone changed this while you were editing.";
71
+ const more = conflicts.length > 1 ? ` (and ${conflicts.length - 1} more)` : "";
72
+ return `${first.by} changed ${first.field} to ${sayValue(first.theirs)} while you were editing; yours was ${sayValue(first.yours)}${more}. Keep theirs, or send yours again.`;
73
+ }
74
+ //# sourceMappingURL=live.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live.js","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgI,MAAM,eAAe,CAAC;AAC5K,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,cAAc,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,SAAS,IAAI,aAAa,EAAE,CAAC;AAEhE,2GAA2G;AAC3G,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1G,OAAO,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC;AA8ID,kEAAkE;AAClE,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;AAC/C,CAAC;AAkBD,mEAAmE;AACnE,MAAM,UAAU,QAAQ,CAAC,KAAc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graph: the declaration version it was last
4
+ * migrated to, and — from FR-31 — the framework that wrote it and the
5
+ * formats it wrote in, so a reader can tell a newer shape from its own.
6
+ * A meta written before the stamp has neither, and reads as format 1.
7
+ */
8
+ export interface StoredMeta {
9
+ readonly version: number;
10
+ readonly framework?: string;
11
+ readonly formats?: Partial<Record<FormatName, number>>;
12
+ }
13
+ //# sourceMappingURL=meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;CACxD"}
package/dist/meta.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
- import { Store, type AnySchema, type GraviewApp, type Operation, type PersistenceAdapter, type StoreOptions } from "@graview/core";
1
+ import { Store, type AnySchema, type CompactOptions, type Epoch, type GraviewApp, type Operation, type PersistenceAdapter, type StoreOptions, type VerifyResult } from "@graview/core";
2
+ import type { StoredMeta } from "./meta.js";
2
3
  import type { GraphSnapshot } from "./snapshot.js";
3
4
  /**
4
5
  * ONE declaration plus ONE adapter is a running deployment.
@@ -12,12 +13,8 @@ import type { GraphSnapshot } from "./snapshot.js";
12
13
  export interface OpenStoreOptions<S extends AnySchema> {
13
14
  readonly app: GraviewApp<S>;
14
15
  readonly adapter: PersistenceAdapter<string> & {
15
- loadMeta?(scope: string): {
16
- version: number;
17
- } | null;
18
- saveMeta?(scope: string, meta: {
19
- version: number;
20
- }): void;
16
+ loadMeta?(scope: string): StoredMeta | null;
17
+ saveMeta?(scope: string, meta: StoredMeta): void;
21
18
  };
22
19
  readonly scope?: string;
23
20
  /** First-run data when nothing is stored yet. */
@@ -37,21 +34,73 @@ export interface OpenStoreOptions<S extends AnySchema> {
37
34
  * first, so the seed really is the first load again.
38
35
  */
39
36
  readonly fresh?: boolean;
37
+ /**
38
+ * Prove the stored graph against its log on open (FR-20). When the two
39
+ * disagree, the graph is rebuilt from the log, saved, and the opened
40
+ * store says so in `rebuilt`. A log that does not fold at all cannot be
41
+ * rebuilt from, and the open throws rather than trusting either.
42
+ */
43
+ readonly verify?: boolean;
40
44
  /**
41
45
  * Overrides for the store. The declaration's own policy and modules are
42
46
  * applied before these, so an app that declares who may do what gets it
43
47
  * enforced by the store ship opens without saying so twice.
44
48
  */
45
49
  readonly storeOptions?: Partial<StoreOptions<S>>;
50
+ /**
51
+ * THE MODULES THIS WORKSPACE HAS ON (FR-12): the host's word, usually
52
+ * what the workspace pays for. The store opens with the set its log last
53
+ * said, and when this differs, turning the difference off or on is
54
+ * written as an op authored `system · modules` — in the history like any
55
+ * change — before the store is handed back. Absent, the log's word
56
+ * stands, and every module when it never said one.
57
+ */
58
+ readonly enabledModules?: readonly string[];
46
59
  }
47
60
  export interface OpenedStore<S extends AnySchema> {
48
61
  readonly store: Store<S>;
49
62
  /** Operations the opening appended: the migration run, when one happened. */
50
63
  readonly migrated: readonly Operation[];
64
+ /**
65
+ * The epoch this opening began (FR-27), when it began one: the seed a new
66
+ * scope starts from, the graph a migration run left (with the change in
67
+ * a sentence), or what a store from before epochs held.
68
+ */
69
+ readonly epoch?: Epoch;
70
+ /** What verifying on open found, when `verify` was asked for. */
71
+ readonly verified?: VerifyResult;
72
+ /**
73
+ * The graph was rebuilt from the log because the stored one disagreed:
74
+ * the hash it had (`from`), the hash it has now (`to`), and the op after
75
+ * which the stored graph had drifted, when one could be named.
76
+ */
77
+ readonly rebuilt?: {
78
+ readonly from: string;
79
+ readonly to: string;
80
+ readonly divergedAfter?: string;
81
+ };
51
82
  /** Resolves when every write accepted so far has settled on the adapter. */
52
83
  flush(): Promise<void>;
53
84
  /** Stops persisting. The store keeps working; nothing further is written. */
54
85
  close(): void;
86
+ /**
87
+ * COMPACTS THE LOG BEHIND AN UNDO HORIZON (FR-23). The checkpoint
88
+ * `store.checkpoint(options)` makes (by default: keep the last 90 days
89
+ * and the last 1000 ops, whichever keeps more) becomes the horizon; the
90
+ * adapter archives the ops and epochs before it, then the store lets go
91
+ * of them. The next open loads the checkpoint and the tail, undo stops at
92
+ * the horizon and says so, and `exportBundle(app, store, { full: true })`
93
+ * still carries everything. Settles after every write accepted before
94
+ * it. Refused by an adapter that keeps no archive.
95
+ */
96
+ compact(options?: CompactOptions): Promise<Compaction>;
97
+ }
98
+ /** What `compact` did: where the log now begins, and how many ops it archived (0 when nothing was old enough). */
99
+ export interface Compaction {
100
+ readonly horizon: number;
101
+ readonly archived: number;
102
+ /** The checkpoint that became the horizon, when one did. */
103
+ readonly checkpoint?: Epoch;
55
104
  }
56
105
  export declare function openStore<S extends AnySchema>(options: OpenStoreOptions<S>): Promise<OpenedStore<S>>;
57
106
  //# sourceMappingURL=open-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"open-store.d.ts","sourceRoot":"","sources":["../src/open-store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;;GAQG;AAEH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,SAAS;IACnD,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,QAAQ,CAAC,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