@graview/ship 0.1.2 → 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.
- package/README.md +119 -11
- package/dist/browser.d.ts +4 -4
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +2 -2
- package/dist/browser.js.map +1 -1
- package/dist/handler.d.ts +134 -25
- package/dist/handler.d.ts.map +1 -1
- package/dist/handler.js +311 -315
- package/dist/handler.js.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/live-protocol.d.ts +208 -0
- package/dist/live-protocol.d.ts.map +1 -0
- package/dist/live-protocol.js +380 -0
- package/dist/live-protocol.js.map +1 -0
- package/dist/live.d.ts +123 -7
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +31 -1
- package/dist/live.js.map +1 -1
- package/dist/remote.d.ts +147 -4
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +631 -56
- package/dist/remote.js.map +1 -1
- package/dist/runtime.d.ts +7 -5
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +3 -2
- package/dist/runtime.js.map +1 -1
- package/dist/seat-headers.d.ts +6 -0
- package/dist/seat-headers.d.ts.map +1 -1
- package/dist/seat-headers.js +6 -0
- package/dist/seat-headers.js.map +1 -1
- package/dist/serve.d.ts +5 -3
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +17 -4
- package/dist/serve.js.map +1 -1
- package/dist/websocket.d.ts +1 -1
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +10 -2
- package/dist/websocket.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -42,7 +42,8 @@ declaration plus one persistence adapter is a running deployment.
|
|
|
42
42
|
`Response`, for any runtime: a Cloudflare Worker or Durable Object, Deno, Bun. `serveStore`
|
|
43
43
|
is a thin `node:http` wrapper around it. Import it from `@graview/ship/runtime`, the entry
|
|
44
44
|
that reaches no `node:` builtin: the store, migrations, the handler and `openRemote`, without
|
|
45
|
-
the file adapter or the page's localStorage.
|
|
45
|
+
the file adapter or the page's localStorage. A host that opens, migrates and heals its own
|
|
46
|
+
`Store` hands it over instead of an adapter: `createStoreHandler({ app, store, seatOf, flush })`.
|
|
46
47
|
- **Content moves as steps.** The step DSL (`stepsMigration`) has five content steps beside
|
|
47
48
|
the schema ones — `put-node`, `patch-node`, `drop-node`, `put-edge`, `drop-edge` — each
|
|
48
49
|
judged against the stored graph when it runs, so a default that is already there is not
|
|
@@ -69,14 +70,14 @@ so a host in front of it knows what it must keep answering for `openRemote`, `gr
|
|
|
69
70
|
| Method | Path | Says |
|
|
70
71
|
|---|---|---|
|
|
71
72
|
| GET | `/graview/state` | the graph, the log, the stored version and the modules on |
|
|
72
|
-
| POST | `/graview/ops` | calls in, the ops they produced out — or `undo`, batches to take back; 409 with the policy's sentence when refused |
|
|
73
|
+
| POST | `/graview/ops` | calls in, the ops they produced out — or `undo`, batches to take back; a `batch` already in the log is answered with the ops it made; 409 with the policy's sentence and a `reason` when refused, 429 with `Retry-After` when the host is busy |
|
|
73
74
|
| GET | `/graview/since?seq=N` | the ops appended after N — everyone else's |
|
|
74
75
|
| GET | `/graview/health` | ship's own report, plus where the data is |
|
|
75
76
|
| GET | `/graview/export` | the whole store as one bundle, the way out |
|
|
76
|
-
| POST | `/graview/here` | say where you are; answers with who else is,
|
|
77
|
+
| POST | `/graview/here` | say where you are; answers with who else is, the ops since `seq`, and the `participant` key you are held under |
|
|
77
78
|
| GET | `/graview/who` | who is here right now |
|
|
78
|
-
| POST | `/graview/leave` | say you have gone |
|
|
79
|
-
| GET | `/graview/live` | the live wire: a WebSocket of hello/welcome, call/undo/ack/refused/conflict, ops and presence; 426 to a plain request |
|
|
79
|
+
| POST | `/graview/leave` | say you have gone — only ever yourself |
|
|
80
|
+
| GET | `/graview/live` | the live wire: a WebSocket of hello/welcome, call/undo/ack/refused/conflict/busy, ops and presence, declaration and reload; 426 to a plain request |
|
|
80
81
|
|
|
81
82
|
Who is asking is the host's to say: `serveStore({ seatOf })` reads its own credential from
|
|
82
83
|
the `Request` and returns the principal every call is judged under, or a promise of it. The framework's clients also send the seat
|
|
@@ -84,8 +85,11 @@ as headers (`SEAT_HEADERS`: who, as what, by what name, and for whom), and a sto
|
|
|
84
85
|
them only when told to — `serveStore({ trustSeatHeaders: true })`, which `graview serve`
|
|
85
86
|
sets for a server on 127.0.0.1 and says so. A store with neither answers 401 on every route
|
|
86
87
|
but health. Whatever a host asks for rides along: `openRemote({ headers })` sends them with
|
|
87
|
-
every request, and the framework never reads them.
|
|
88
|
-
|
|
88
|
+
every request, and the framework never reads them. What a call came through (`via`: `web`,
|
|
89
|
+
`api`, `mcp:Claude`), recorded on the op, is the host's word too: `viaOf(request, seat)` says
|
|
90
|
+
it, or `SEAT_HEADERS.via` where the seat headers are trusted (`openRemote({ via })` sends it,
|
|
91
|
+
`mcp` and `cli` from the commands). A `via` in a call's body or message is never read; without
|
|
92
|
+
either, a socket's calls are `web` and an HTTP call's `api`. `openRemote(...).settled()` resolves once every call sent
|
|
89
93
|
so far has been answered — a browser never waits for it; a host that must report the
|
|
90
94
|
server's verdict before it exits does.
|
|
91
95
|
|
|
@@ -95,16 +99,33 @@ server's verdict before it exits does.
|
|
|
95
99
|
it as it lands. Calls go down it too; while it is down the client polls and posts, reconnects,
|
|
96
100
|
and catches up from the last op it has. Polling stays: it is the wire `curl` can drive.
|
|
97
101
|
|
|
102
|
+
**A host can watch it.** `remote.status()` is `connecting`, `online` or `offline`
|
|
103
|
+
(`RemoteStatus`), and `remote.onStatus(listener)` is told each time it changes — an offline
|
|
104
|
+
banner's switch. It is offline while a socket that was welcomed is down and nothing has been
|
|
105
|
+
heard since, or when a poll or a call does not reach the server (a network failure, or a 502,
|
|
106
|
+
503 or 504 from a gateway); online once a welcome or any answer lands, a refusal included. A
|
|
107
|
+
call made while the server is away is not taken back: it stays shown, `remote.pending()`
|
|
108
|
+
counts it, and it goes again the moment the server is reached. `remote.counters()`
|
|
109
|
+
(`RemoteCounters`) counts `reconnects`, `rebases` (the server's ops landing under pending
|
|
110
|
+
calls), `conflicts` and `resyncs`, for a beacon. Three options shape it: `backoff`, a function
|
|
111
|
+
of the attempt in milliseconds or `{ min, max, factor }` for the jittered default (250, 10000,
|
|
112
|
+
2); `presenceEveryMs`, how often an unchanged presence is said again down the socket; and
|
|
113
|
+
`visible`, a predicate — while it answers false no presence is said, and in a page it reads
|
|
114
|
+
`document.visibilityState` unless given.
|
|
115
|
+
|
|
98
116
|
| From | Message | Carries |
|
|
99
117
|
|---|---|---|
|
|
100
|
-
| client | `hello` | `seq`, the last op it has (none: the welcome carries the whole state); `protocol` |
|
|
101
|
-
| client | `call` | `cid`, `calls`, `intent`, `batch`,
|
|
118
|
+
| client | `hello` | `seq`, the last op it has (none: the welcome carries the whole state); `protocol`; `wire` (`LIVE_WIRE`); `build`, the host's build the page runs |
|
|
119
|
+
| client | `call` | `cid`, `calls`, `intent`, `batch`, and `base`: the revision of each field it changes |
|
|
102
120
|
| client | `undo` | `cid`, `batches` to take back |
|
|
103
121
|
| client | `here` / `bye` | a presence, as `/graview/here` takes it; gone |
|
|
104
|
-
| server | `welcome` | `protocol`, `seq` (the server's last), and the `ops` after the client's seq |
|
|
122
|
+
| server | `welcome` | `protocol`, `wire`, `version` (the declaration it serves), `build`, `participant` (this socket's own key, built from its seat), `seq` (the server's last), and the `ops` after the client's seq |
|
|
105
123
|
| server | `ack` | `cid`, `batch`, `seq` and the `ops` the call made |
|
|
106
|
-
| server | `refused` / `conflict` | `cid` and the sentence; a conflict names each field, theirs, yours and who wrote theirs |
|
|
124
|
+
| server | `refused` / `conflict` | `cid` and the sentence; a refusal's `reason` and, when the policy knows who could, `wouldNeed`; a conflict names each field, theirs, yours and who wrote theirs |
|
|
125
|
+
| server | `busy` | `cid` and `retryAfter` in milliseconds: not now, and not refused — the client sends the call again after the wait |
|
|
107
126
|
| server | `ops` / `presence` | everybody's ops as they land, in seq order; who is here |
|
|
127
|
+
| server | `declaration` | `version`: the declaration changed, and the socket is served again after a new hello |
|
|
128
|
+
| server | `reload` | `reason` and `protocol`, the lowest served: the hello's protocol is no longer served |
|
|
108
129
|
|
|
109
130
|
Seqs mean what `/graview/since?seq=N` means, and `hello` and `welcome` carry `WIRE_PROTOCOL`.
|
|
110
131
|
A host on any runtime attaches a socket with `createStoreHandler(...).connect(request, { send,
|
|
@@ -112,12 +133,99 @@ close })`, which reads the seat from the upgrade and answers with the connection
|
|
|
112
133
|
message to; `serveStore` does this for Node's upgrade. What a seat may not see holds on the
|
|
113
134
|
socket as on the routes.
|
|
114
135
|
|
|
136
|
+
A host that hibernates — a Durable Object wakes on a message with no closure left — holds
|
|
137
|
+
each socket's state itself. `liveProtocol({ store })` (from `@graview/ship/runtime`) is the
|
|
138
|
+
same protocol as functions over the store and one plain-JSON `LiveSocketState` per socket,
|
|
139
|
+
`{ seat, via, cursor?, participant?, held? }`, the thing `serializeAttachment` keeps:
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
const live = liveProtocol({ store, version: app.version, flush });
|
|
143
|
+
// On the upgrade: the seat and channel, read once (handler.seatFor(request) does this with seatOf and viaOf).
|
|
144
|
+
ws.serializeAttachment(live.open(seat, "web"));
|
|
145
|
+
// On each message, after any wake:
|
|
146
|
+
const peer = { ...ws.deserializeAttachment(), send: (text) => ws.send(text) };
|
|
147
|
+
const { landed, presence } = await live.receive(peer, text, whoIsHere);
|
|
148
|
+
const { send, ...state } = peer;
|
|
149
|
+
ws.serializeAttachment(state);
|
|
150
|
+
if (landed) live.publish(landed, otherPeers); // each as its own seat sees them, from its own cursor
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`connect()` is this protocol with the state in memory, so there is one implementation.
|
|
154
|
+
|
|
155
|
+
**Who is here is the server's to say.** A presence carries its `kind`, a display `name`
|
|
156
|
+
and, for an agent, `onBehalfOf` (the person's id) and `onBehalfOfName`, all built from the
|
|
157
|
+
seat by `presenceFrom`; a client's own claim of any of them, or of another key, is not read.
|
|
158
|
+
A socket's key is built at `hello` and said back as `welcome.participant`, and
|
|
159
|
+
`openRemote(...).participant()` hands it on, so a client leaves itself out of who is here.
|
|
160
|
+
Somebody without a socket — an agent acting over MCP or an RPC, a polling tab — is announced:
|
|
161
|
+
`handler.announce(visitorPresence(seat), ttlMs)` tells every socket and poll at once and
|
|
162
|
+
stands until `until`. The handler does this itself for every op an agent seat lands in its
|
|
163
|
+
store (`POST /graview/ops`, an MCP handler over the same store, the host's own loop), for
|
|
164
|
+
`VISITOR_PRESENCE_TTL_MS`; `createStoreHandler({ announceAgents: false })` turns it off and a
|
|
165
|
+
number sets the time. A hibernating host keeps `who` itself, with `announcePresence(who,
|
|
166
|
+
visitorPresence(seat), ttlMs)`, and hands it to `receive` and `tell`; a visitor past its
|
|
167
|
+
`until` is never told. Each seat is told as it may see: an agent acting for a person the
|
|
168
|
+
seat may not see is shown without `onBehalfOf` or the name. The Shell draws it as "Claude,
|
|
169
|
+
for Ada" (`presenceName`).
|
|
170
|
+
|
|
171
|
+
**The declaration changes under open tabs.** A host that adds a field calls
|
|
172
|
+
`handler.declarationChanged({ app })` — over an adapter the handler opens the store again
|
|
173
|
+
with `openStore`, which migrates it; over a store the host holds it is handed
|
|
174
|
+
`{ app, store, flush?, migrated? }`. Every socket is told `declaration`; a sleeping host
|
|
175
|
+
makes a `liveProtocol` over the new store and calls `declared(peers)`. `openRemote` asks its
|
|
176
|
+
`resolveApp(version)` for the app at that version (a TS app imports it; a document-declared
|
|
177
|
+
app fetches and compiles its document), opens a new remote store on the server's migrated
|
|
178
|
+
state and hands it to `remote.onDeclaration((next, version) => …)`. The calls still on the
|
|
179
|
+
way are offered again there under the batch they were sent in, so one the server already
|
|
180
|
+
made is not made twice, and one that no longer fits is refused in words on
|
|
181
|
+
`next.onRefusal`. No page reloads. A polling client learns it the same way: every answer a
|
|
182
|
+
poll reads (`/graview/state`, `/graview/since`, `/graview/here`, the `/graview/ops` answer)
|
|
183
|
+
says the declaration `version` and the host's `build`, and `openRemote` compares it on each.
|
|
184
|
+
|
|
185
|
+
**Version skew.** A host says its `build` (an opaque string) in every welcome; a page that
|
|
186
|
+
said another in its hello keeps working and `remote.onBuild(…)` is told once. A host with
|
|
187
|
+
`minProtocol` answers an older protocol's hello with `reload`: `openRemote` writes every
|
|
188
|
+
call not yet answered to its `carry` (`{ storage, key }`, `sessionStorage` in a page),
|
|
189
|
+
calls `reloadPage`, and the next `openRemote` with the same `carry` offers them again.
|
|
190
|
+
Two codecs on one path are told apart by `hello.wire`, and by the WebSocket subprotocol
|
|
191
|
+
`LIVE_SUBPROTOCOL` (`graview.ship.1`): `serveStore` answers it, a Worker answers its upgrade
|
|
192
|
+
with `liveSubprotocol(request)`, and `openRemote` sends it with `subprotocol: true` or hands
|
|
193
|
+
it to its `socket` factory. `WIRE_PROTOCOL` stays 1: every message and field is additive.
|
|
194
|
+
|
|
115
195
|
**A stale write is a conflict, not a loss.** A field's revision is the seq of the op that last
|
|
116
196
|
wrote it (`FieldRevisions`, derived from the log). A call that carries a `base` older than the
|
|
117
197
|
field is refused, before anything is written, naming the field, theirs and yours.
|
|
118
198
|
`openRemote` sends one with every call and hands the refusal to `remote.onConflict(…)`,
|
|
119
199
|
with `conflict.keepTheirs()` and `conflict.useMine()`.
|
|
120
200
|
|
|
201
|
+
**A refusal says why** (FR-46). Every `refused` on the socket, and every refusing answer of
|
|
202
|
+
`POST /graview/ops` (409, or 413 at a host's cap), carries a `reason` from a closed set,
|
|
203
|
+
`REFUSAL_REASONS`, which never changes meaning:
|
|
204
|
+
|
|
205
|
+
| `reason` | What it means |
|
|
206
|
+
|---|---|
|
|
207
|
+
| `forbidden` | the seat may not: the policy, a sight, an agent's declared acts, a module turned off; `wouldNeed` names the roles that could, when the policy knows them |
|
|
208
|
+
| `missing` | what the call names is not there: a record, or a batch to take back |
|
|
209
|
+
| `invalid` | the call as asked does not fit: its arguments, the kind, a rule, a call before `hello` |
|
|
210
|
+
| `limit` | the host's hard cap: the call can never succeed as asked, however long the caller waits |
|
|
211
|
+
|
|
212
|
+
`openRemote`'s `remote.onRefusal((sentence, refusal) => …)` is handed the reason beside the
|
|
213
|
+
sentence, and `remote.send` throws a `RemoteRefusedError` carrying it. The routes' other
|
|
214
|
+
refusing answers say one too: 401 `forbidden`, 404 `missing`, 400 `invalid`.
|
|
215
|
+
|
|
216
|
+
**Busy is not refused** (FR-45). A host's `limit` option — on `createStoreHandler`, `serveStore`
|
|
217
|
+
and `liveProtocol` — is asked of every change before it is judged, with the seat, the channel,
|
|
218
|
+
the size in bytes and the calls. It answers nothing, `{ retryAfter }` or `{ refuse }`:
|
|
219
|
+
|
|
220
|
+
- **busy** — `{ retryAfter }` in milliseconds, for a rate or a queue: "not now". The socket says
|
|
221
|
+
`busy` and HTTP answers 429 with `Retry-After`. Nothing is judged and nothing is refused:
|
|
222
|
+
`openRemote` keeps the change shown and pending and sends it again after the wait. Every later
|
|
223
|
+
call on that socket is busy too until the held one comes again, and HTTP posts go one at a
|
|
224
|
+
time, so a burst lands in the order it was made.
|
|
225
|
+
- **refused, `limit`** — `{ refuse }`, a sentence, for a hard cap such as a message over the
|
|
226
|
+
size a host takes: it would be refused however long the client waited, so it is refused now
|
|
227
|
+
and taken back.
|
|
228
|
+
|
|
121
229
|
## The hosted-store contract
|
|
122
230
|
|
|
123
231
|
A third party stands up their own host — a file store or SQLite, `graview serve`,
|
package/dist/browser.d.ts
CHANGED
|
@@ -18,13 +18,13 @@ export type { AppBundle, ExportOptions } from "./export.js";
|
|
|
18
18
|
export type { StoredMeta } from "./meta.js";
|
|
19
19
|
export { health } from "./health.js";
|
|
20
20
|
export type { HealthReport } from "./health.js";
|
|
21
|
-
export { openRemote, seatHeaders } from "./remote.js";
|
|
21
|
+
export { openRemote, RemoteRefusedError, seatHeaders } from "./remote.js";
|
|
22
22
|
export { SEAT_HEADERS } from "./seat-headers.js";
|
|
23
23
|
export { createBroadcastPresence, presenceChannelName } from "./presence.js";
|
|
24
24
|
export type { BroadcastPresenceOptions, ChannelLike } from "./presence.js";
|
|
25
|
-
export type { LiveSocketLike, RemoteConflict, RemoteOptions, RemoteStore } from "./remote.js";
|
|
26
|
-
export { conflictSentence, LIVE_PATH } from "./live.js";
|
|
27
|
-
export type { LiveClientMessage, LiveServerMessage } from "./live.js";
|
|
25
|
+
export type { LiveSocketLike, RemoteBackoff, RemoteConflict, RemoteCounters, RemoteOptions, RemoteRefusal, RemoteStatus, RemoteStore } from "./remote.js";
|
|
26
|
+
export { conflictSentence, LIVE_PATH, LIVE_SUBPROTOCOL, LIVE_WIRE, REFUSAL_REASONS } from "./live.js";
|
|
27
|
+
export type { LiveClientMessage, LiveServerMessage, RefusalReason, WireRefusal } from "./live.js";
|
|
28
28
|
export { assertPhotoFits, photosUsed, storageBytes, PhotoTooLarge, PHOTO_BUDGET_BYTES, PHOTO_MAX_BYTES, } from "./photos.js";
|
|
29
29
|
export type { PhotoBudget, PhotoField } from "./photos.js";
|
|
30
30
|
//# sourceMappingURL=browser.d.ts.map
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAChF,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,MAAM,iBA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eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC7E,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3E,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1J,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACtG,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAClG,OAAO,EACL,eAAe,EACf,UAAU,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/browser.js
CHANGED
|
@@ -10,9 +10,9 @@ export { openStore } from "./open-store.js";
|
|
|
10
10
|
export { applyToSnapshot } from "./snapshot.js";
|
|
11
11
|
export { assertBundle, exportBundle } from "./export.js";
|
|
12
12
|
export { health } from "./health.js";
|
|
13
|
-
export { openRemote, seatHeaders } from "./remote.js";
|
|
13
|
+
export { openRemote, RemoteRefusedError, seatHeaders } from "./remote.js";
|
|
14
14
|
export { SEAT_HEADERS } from "./seat-headers.js";
|
|
15
15
|
export { createBroadcastPresence, presenceChannelName } from "./presence.js";
|
|
16
|
-
export { conflictSentence, LIVE_PATH } from "./live.js";
|
|
16
|
+
export { conflictSentence, LIVE_PATH, LIVE_SUBPROTOCOL, LIVE_WIRE, REFUSAL_REASONS } from "./live.js";
|
|
17
17
|
export { assertPhotoFits, photosUsed, storageBytes, PhotoTooLarge, PHOTO_BUDGET_BYTES, PHOTO_MAX_BYTES, } from "./photos.js";
|
|
18
18
|
//# sourceMappingURL=browser.js.map
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,GACV,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,GACV,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAG7E,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEtG,OAAO,EACL,eAAe,EACf,UAAU,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC"}
|
package/dist/handler.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AnySchema, type GraviewApp, type PersistenceAdapter, type Presence, type Principal, type Store } from "@graview/core";
|
|
2
|
-
import { type LiveConnection, type LiveSocket } from "./live.js";
|
|
2
|
+
import { type Limit, type LiveConnection, type LiveSocket } from "./live.js";
|
|
3
|
+
import { presenceSeenBy, type LiveProtocol, type LiveSocketState } from "./live-protocol.js";
|
|
3
4
|
import { type OpenedStore } from "./open-store.js";
|
|
4
5
|
import { SEAT_HEADERS } from "./seat-headers.js";
|
|
5
6
|
import type { GraphSnapshot } from "./snapshot.js";
|
|
@@ -40,7 +41,9 @@ import type { GraphSnapshot } from "./snapshot.js";
|
|
|
40
41
|
* Polling is the floor, on purpose: a poll is a thing a person can
|
|
41
42
|
* reproduce with `curl`, and a thing every runtime can answer. Beside it,
|
|
42
43
|
* `connect` serves the live wire (FR-05, `./live.ts`) to whatever socket a
|
|
43
|
-
* host hands it, and `GET /graview/live` names it on the wire.
|
|
44
|
+
* host hands it, and `GET /graview/live` names it on the wire. The live
|
|
45
|
+
* protocol itself is `liveProtocol` (`./live-protocol.ts`), over state a
|
|
46
|
+
* host may hold instead of this closure (FR-41).
|
|
44
47
|
*/
|
|
45
48
|
/**
|
|
46
49
|
* THE WIRE, AS A CONTRACT. Every route the handler answers, in one place a
|
|
@@ -57,7 +60,7 @@ export declare const WIRE: readonly [{
|
|
|
57
60
|
}, {
|
|
58
61
|
readonly method: "POST";
|
|
59
62
|
readonly path: "/graview/ops";
|
|
60
|
-
readonly says: "calls in, the ops they produced out — or `undo`, batches to take back; 409 with the policy's sentence when refused";
|
|
63
|
+
readonly says: "calls in, the ops they produced out — or `undo`, batches to take back; a `batch` already in the log is answered with the ops it made; 409 with the policy's sentence and a `reason` when refused, 429 with `Retry-After` when the host is busy";
|
|
61
64
|
}, {
|
|
62
65
|
readonly method: "GET";
|
|
63
66
|
readonly path: "/graview/since";
|
|
@@ -73,7 +76,7 @@ export declare const WIRE: readonly [{
|
|
|
73
76
|
}, {
|
|
74
77
|
readonly method: "POST";
|
|
75
78
|
readonly path: "/graview/here";
|
|
76
|
-
readonly says: "say where you are; answers with who else is,
|
|
79
|
+
readonly says: "say where you are; answers with who else is, the ops since `seq`, and the `participant` key you are held under";
|
|
77
80
|
}, {
|
|
78
81
|
readonly method: "GET";
|
|
79
82
|
readonly path: "/graview/who";
|
|
@@ -81,20 +84,16 @@ export declare const WIRE: readonly [{
|
|
|
81
84
|
}, {
|
|
82
85
|
readonly method: "POST";
|
|
83
86
|
readonly path: "/graview/leave";
|
|
84
|
-
readonly says: "say you have gone";
|
|
87
|
+
readonly says: "say you have gone — only ever yourself";
|
|
85
88
|
}, {
|
|
86
89
|
readonly method: "GET";
|
|
87
90
|
readonly path: "/graview/live";
|
|
88
|
-
readonly says: "the live wire: a WebSocket of hello/welcome, call/undo/ack/refused/conflict, ops and presence; 426 to a plain request";
|
|
91
|
+
readonly says: "the live wire: a WebSocket of hello/welcome, call/undo/ack/refused/conflict/busy, ops and presence, declaration and reload; 426 to a plain request";
|
|
89
92
|
}];
|
|
90
|
-
export { SEAT_HEADERS };
|
|
91
|
-
|
|
93
|
+
export { presenceSeenBy, SEAT_HEADERS };
|
|
94
|
+
/** What every handler takes, whoever holds the store. */
|
|
95
|
+
interface HandlerOptions<S extends AnySchema> {
|
|
92
96
|
readonly app: GraviewApp<S>;
|
|
93
|
-
/** Where the graph lives: any `PersistenceAdapter` — a file, SQLite, Durable Object storage. */
|
|
94
|
-
readonly adapter: PersistenceAdapter<string>;
|
|
95
|
-
/** What to put in an empty store on first start. */
|
|
96
|
-
readonly seed?: GraphSnapshot;
|
|
97
|
-
readonly scope?: string;
|
|
98
97
|
/**
|
|
99
98
|
* Who a request is. The host's to say — from a session, a bearer token,
|
|
100
99
|
* whatever it authenticates with — and the store judges every call under
|
|
@@ -102,6 +101,16 @@ export interface StoreHandlerOptions<S extends AnySchema> {
|
|
|
102
101
|
* verifies a token with `crypto.subtle`.
|
|
103
102
|
*/
|
|
104
103
|
readonly seatOf?: (request: Request) => Principal | Promise<Principal>;
|
|
104
|
+
/**
|
|
105
|
+
* WHAT THE CALLS CAME THROUGH (FR-52): the host's word, recorded as `via`
|
|
106
|
+
* on every op a request or a socket makes — `web`, `api`, `mcp:Claude`.
|
|
107
|
+
* Handed the request (the upgrade, for a socket) and the seat `seatOf`
|
|
108
|
+
* said. A client's own `via` is never read: a browser could otherwise
|
|
109
|
+
* record its edit as Claude's. Absent, or answering nothing, a socket's
|
|
110
|
+
* calls are `web` and an HTTP request's `api` — unless the host trusts
|
|
111
|
+
* the seat headers, when `SEAT_HEADERS.via` says it as they say the seat.
|
|
112
|
+
*/
|
|
113
|
+
readonly viaOf?: (request: Request, seat: Principal) => string | undefined | Promise<string | undefined>;
|
|
105
114
|
/**
|
|
106
115
|
* BELIEVE THE SEAT HEADERS (`SEAT_HEADERS`) — off by default (FR-06).
|
|
107
116
|
*
|
|
@@ -116,6 +125,60 @@ export interface StoreHandlerOptions<S extends AnySchema> {
|
|
|
116
125
|
readonly where?: string;
|
|
117
126
|
/** How long a presence stands after its last word. Three heartbeats by default. */
|
|
118
127
|
readonly presenceTtlMs?: number;
|
|
128
|
+
/**
|
|
129
|
+
* AN AGENT THAT ACTS IS IN THE ROOM (FR-47). Every op an agent seat lands
|
|
130
|
+
* in the store — through `POST /graview/ops`, an MCP handler over the
|
|
131
|
+
* same store, the host's own loop — announces it to who is here, as the
|
|
132
|
+
* agent and for whom, standing over what it wrote, for this long after
|
|
133
|
+
* its last op: `VISITOR_PRESENCE_TTL_MS` when `true` or unsaid, the
|
|
134
|
+
* number of ms when one is given, never when `false`. An agent seat that
|
|
135
|
+
* holds a socket of its own is there already, and is not announced twice.
|
|
136
|
+
*/
|
|
137
|
+
readonly announceAgents?: boolean | number;
|
|
138
|
+
/**
|
|
139
|
+
* THE HOST'S LIMITS (FR-45, FR-46): asked of every change — a socket's
|
|
140
|
+
* `call` or `undo`, a `POST /graview/ops` — before it is judged.
|
|
141
|
+
* `{ retryAfter }` is BUSY: the socket says `busy`, HTTP answers 429 with
|
|
142
|
+
* `Retry-After`, and the client sends the change again after the wait.
|
|
143
|
+
* `{ refuse }` is a hard cap: refused with reason `limit` (413 over
|
|
144
|
+
* HTTP), and the client takes the change back.
|
|
145
|
+
*/
|
|
146
|
+
readonly limit?: Limit;
|
|
147
|
+
/**
|
|
148
|
+
* THE HOST'S BUILD (FR-44), an opaque string said in every welcome. A
|
|
149
|
+
* client on another build keeps working and is told once, so a person
|
|
150
|
+
* can reload when it suits them.
|
|
151
|
+
*/
|
|
152
|
+
readonly build?: string;
|
|
153
|
+
/**
|
|
154
|
+
* THE LOWEST LIVE PROTOCOL SERVED (FR-44). A socket whose hello says an
|
|
155
|
+
* older one is answered `reload`: its client keeps what it had not sent,
|
|
156
|
+
* reloads onto a build that speaks this one, and offers it again there.
|
|
157
|
+
* Absent, every protocol is served.
|
|
158
|
+
*/
|
|
159
|
+
readonly minProtocol?: number;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* THE DECLARATION THE HOST NOW SERVES (FR-43), handed to
|
|
163
|
+
* `declarationChanged`. Over a store the host holds, `store` is the one it
|
|
164
|
+
* migrated to `app` (with `flush` and `migrated` as at the start); over an
|
|
165
|
+
* adapter, the handler opens it again itself with `openStore`, which
|
|
166
|
+
* migrates what is stored.
|
|
167
|
+
*/
|
|
168
|
+
export interface DeclarationChange {
|
|
169
|
+
readonly app: GraviewApp<AnySchema>;
|
|
170
|
+
readonly store?: Store<AnySchema>;
|
|
171
|
+
readonly flush?: () => Promise<void>;
|
|
172
|
+
readonly migrated?: readonly string[];
|
|
173
|
+
}
|
|
174
|
+
/** The handler opens its own store from an adapter: one declaration plus one adapter is a running deployment. */
|
|
175
|
+
export interface AdapterStoreHandlerOptions<S extends AnySchema> extends HandlerOptions<S> {
|
|
176
|
+
/** Where the graph lives: any `PersistenceAdapter` — a file, SQLite, Durable Object storage. */
|
|
177
|
+
readonly adapter: PersistenceAdapter<string>;
|
|
178
|
+
readonly store?: never;
|
|
179
|
+
/** What to put in an empty store on first start. */
|
|
180
|
+
readonly seed?: GraphSnapshot;
|
|
181
|
+
readonly scope?: string;
|
|
119
182
|
/**
|
|
120
183
|
* THE MODULES THIS WORKSPACE HAS ON (FR-12) — usually what it pays for.
|
|
121
184
|
* Handed to `openStore`, which records a change from what the store's
|
|
@@ -125,9 +188,26 @@ export interface StoreHandlerOptions<S extends AnySchema> {
|
|
|
125
188
|
*/
|
|
126
189
|
readonly enabledModules?: readonly string[];
|
|
127
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* THE HANDLER OVER A STORE THE HOST ALREADY HOLDS (FR-42). A host with its
|
|
193
|
+
* own durability — a ledger of snapshots in parts, epochs, quarantine and
|
|
194
|
+
* restore, its own meter — opens, migrates and heals its `Store` itself,
|
|
195
|
+
* and the wire is served from that instance. Closing the handler does not
|
|
196
|
+
* close the store: it is the host's.
|
|
197
|
+
*/
|
|
198
|
+
export interface HeldStoreHandlerOptions<S extends AnySchema> extends HandlerOptions<S> {
|
|
199
|
+
readonly store: Store<S>;
|
|
200
|
+
readonly adapter?: never;
|
|
201
|
+
/** Resolves once what landed is durable: a call's answer waits for it. Absent, the answer goes at once. */
|
|
202
|
+
readonly flush?: () => Promise<void>;
|
|
203
|
+
/** What opening the store migrated, in the migrations' own words: said in the state, as `openStore`'s would be. */
|
|
204
|
+
readonly migrated?: readonly string[];
|
|
205
|
+
}
|
|
206
|
+
export type StoreHandlerOptions<S extends AnySchema> = AdapterStoreHandlerOptions<S> | HeldStoreHandlerOptions<S>;
|
|
128
207
|
export interface StoreHandler<S extends AnySchema> {
|
|
129
208
|
readonly store: Store<S>;
|
|
130
|
-
|
|
209
|
+
/** The open `openStore` made, when the handler opened the store from an adapter; absent over a store the host holds. */
|
|
210
|
+
readonly opened?: OpenedStore<S>;
|
|
131
211
|
/** Every WIRE route: a `Request` in, a `Response` out. Bound, so it can be handed on as it is. */
|
|
132
212
|
readonly handle: (request: Request) => Promise<Response>;
|
|
133
213
|
/**
|
|
@@ -135,28 +215,57 @@ export interface StoreHandler<S extends AnySchema> {
|
|
|
135
215
|
* (the seat is read from it, as on every route) and a way to send text
|
|
136
216
|
* down the socket; it answers with the connection to hand each message
|
|
137
217
|
* the client sends and the close, or with the `Response` refusing it (a
|
|
138
|
-
* 401 when it cannot say who is asking). A Worker
|
|
139
|
-
*
|
|
140
|
-
*
|
|
218
|
+
* 401 when it cannot say who is asking). A Worker attaches a
|
|
219
|
+
* `WebSocketPair`'s server end here; `serveStore` attaches Node's
|
|
220
|
+
* upgrade. A host that hibernates holds each socket's state itself
|
|
221
|
+
* instead: `seatFor` and `protocol`.
|
|
141
222
|
*/
|
|
142
223
|
readonly connect: (request: Request, socket: LiveSocket) => Promise<LiveConnection | Response>;
|
|
143
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* THE STATE A SOCKET STARTS WITH (FR-41): its seat, read by `seatOf`
|
|
226
|
+
* from the upgrade, and its channel, said by `viaOf` (FR-52) — or the
|
|
227
|
+
* `Response` refusing it. A hibernating host keeps it in the socket's
|
|
228
|
+
* attachment and hands it, with each message, to `protocol.receive`.
|
|
229
|
+
*/
|
|
230
|
+
readonly seatFor: (request: Request) => Promise<LiveSocketState | Response>;
|
|
231
|
+
/** The live protocol over this handler's store, for a host that holds its sockets' state itself (FR-41). Made again when the declaration changes. */
|
|
232
|
+
readonly protocol: LiveProtocol<S>;
|
|
233
|
+
/**
|
|
234
|
+
* THE DECLARATION CHANGED (FR-43). The handler serves `change.app` from
|
|
235
|
+
* now on, over the store migrated to it — the host's, or the one it opens
|
|
236
|
+
* again from its adapter — and every open socket is told
|
|
237
|
+
* `{ t: "declaration", version }`. A client of `openRemote` then opens on
|
|
238
|
+
* the new declaration without reloading the page. While the change is
|
|
239
|
+
* made, every request and message waits for it, so nothing lands on the
|
|
240
|
+
* store being let go. `store`, `opened` and `protocol` are the new ones
|
|
241
|
+
* afterwards.
|
|
242
|
+
*/
|
|
243
|
+
declarationChanged(change: DeclarationChange): Promise<void>;
|
|
244
|
+
/**
|
|
245
|
+
* SOMEBODY HERE WITHOUT A SOCKET (FR-47): an agent acting over MCP or an
|
|
246
|
+
* RPC, a polling tab. Told to every socket and every poll at once, as
|
|
247
|
+
* each seat may see them, and gone `ttlMs` after (30 s unsaid) unless
|
|
248
|
+
* announced again. The host builds the presence — `visitorPresence(seat)`
|
|
249
|
+
* — because it is the host who knows who the seat is.
|
|
250
|
+
*/
|
|
251
|
+
announce(presence: Presence, ttlMs?: number): void;
|
|
252
|
+
/** Writes what is pending and lets the adapter go — or, over a store the host holds, writes what is pending and leaves the store open. */
|
|
144
253
|
close(): Promise<void>;
|
|
145
254
|
}
|
|
146
255
|
/** A seat read from a request's headers — only ever when the host trusts them. */
|
|
147
256
|
export declare function seatFromHeaders(request: Request): Principal;
|
|
148
|
-
/**
|
|
149
|
-
* WHO IS HERE, AS ONE SEAT MAY BE TOLD (FR-02). Somebody whose own record
|
|
150
|
-
* the seat may not see is not shown to it at all; anybody else is, without
|
|
151
|
-
* where they stand or what they hover when that names a record the seat
|
|
152
|
-
* may not see. A participant whose id is no record is shown as they are.
|
|
153
|
-
*/
|
|
154
|
-
export declare function presenceSeenBy(who: readonly Presence[], sees: (id: string) => boolean): Presence[];
|
|
155
257
|
/**
|
|
156
258
|
* Open the store and answer the wire for it. The migration runs HERE, once,
|
|
157
259
|
* against the stored graph — which is the whole reason a server is the
|
|
158
260
|
* honest place for it. A browser that migrates its own copy migrates it once
|
|
159
261
|
* per browser; a server that migrates the roster migrates the roster.
|
|
262
|
+
*
|
|
263
|
+
* Or answer the wire for a store the host opened itself (FR-42): the
|
|
264
|
+
* adapter form is that, over the store `openStore` hands back.
|
|
160
265
|
*/
|
|
266
|
+
export declare function createStoreHandler<S extends AnySchema>(options: AdapterStoreHandlerOptions<S>): Promise<StoreHandler<S> & {
|
|
267
|
+
readonly opened: OpenedStore<S>;
|
|
268
|
+
}>;
|
|
269
|
+
export declare function createStoreHandler<S extends AnySchema>(options: HeldStoreHandlerOptions<S>): Promise<StoreHandler<S>>;
|
|
161
270
|
export declare function createStoreHandler<S extends AnySchema>(options: StoreHandlerOptions<S>): Promise<StoreHandler<S>>;
|
|
162
271
|
//# sourceMappingURL=handler.d.ts.map
|
package/dist/handler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"A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