@graview/ship 0.1.15 → 0.1.16
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 +2 -2
- package/dist/browser-adapter.d.ts +2 -2
- package/dist/browser-adapter.js +2 -2
- package/dist/export.d.ts +1 -1
- package/dist/handler.js +1 -1
- package/dist/live-protocol.d.ts +1 -1
- package/dist/migrations.js +3 -3
- package/dist/open-store.js +1 -1
- package/dist/photos.d.ts +1 -1
- package/dist/photos.js +1 -1
- package/dist/remote.js +2 -2
- package/dist/sync-seed.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -139,7 +139,7 @@ socket as on the routes, and so does its id (FR-55): no record id the seat may n
|
|
|
139
139
|
anything it is sent — a welcome, ops, an ack, a conflict, a route's answer. A seen record's
|
|
140
140
|
field that names a hidden one is cleared, or, when the record cannot do without that field,
|
|
141
141
|
the record is withheld from the seat whole; a withheld op keeps no hidden id in any
|
|
142
|
-
primitive. `seatLens(store, principal)` is that
|
|
142
|
+
primitive. `seatLens(store, principal)` is that judgment, the one every surface reads.
|
|
143
143
|
|
|
144
144
|
A host that hibernates — a Durable Object wakes on a message with no closure left — holds
|
|
145
145
|
each socket's state itself. `liveProtocol({ store })` (from `@graview/ship/runtime`) is the
|
|
@@ -336,7 +336,7 @@ any batch not shaped as a `Store` mints it, `batch:<tag>:<n>` or `undo:<tag>:<n>
|
|
|
336
336
|
shape. A host's own store mints there too with `new Store({ batchIds: serverBatchIds() })`,
|
|
337
337
|
so nothing a host lands itself — a migration, a seed, an agent's RPC — is in a batch a client
|
|
338
338
|
could have named first; `createStoreHandler` does this for the store it opens.
|
|
339
|
-
`authoredBy(author, seat)` is the
|
|
339
|
+
`authoredBy(author, seat)` is the judgment of "the same seat". A batch's tag belongs to the
|
|
340
340
|
first seat that landed under it, so nobody names another client's next batch
|
|
341
341
|
(`batch:<her tag>:<n+1>`) before she does: a batch under somebody else's tag is refused
|
|
342
342
|
`invalid`, and so is one under the store's own minting tag (`store.batchTag`), so even a held
|
|
@@ -31,7 +31,7 @@ export interface BrowserAdapterOptions {
|
|
|
31
31
|
* writes — the snapshot, the append-only log, the stored schema version —
|
|
32
32
|
* as three `localStorage` entries per scope. Not the epochs (FR-27): each
|
|
33
33
|
* keeps a whole copy of the graph as its base, and a second copy in a few
|
|
34
|
-
* megabytes ran a two-thousand-talk
|
|
34
|
+
* megabytes ran a two-thousand-talk program out of room; a page's store
|
|
35
35
|
* is verified by the host it is served from, not in the page. It slots into `openStore` unchanged, migrations included, so a
|
|
36
36
|
* sample app that remembers is the
|
|
37
37
|
* same lifecycle as a deployment that does, minus the server.
|
|
@@ -64,7 +64,7 @@ export declare function browserStartsFresh(location?: {
|
|
|
64
64
|
readonly webdriver?: boolean;
|
|
65
65
|
}): boolean;
|
|
66
66
|
/**
|
|
67
|
-
* Drops `?fresh=1` from the address once it has been
|
|
67
|
+
* Drops `?fresh=1` from the address once it has been honored, so the seed
|
|
68
68
|
* is the FIRST load rather than every load: a reload after starting fresh
|
|
69
69
|
* must keep what was done since, or "start fresh" is really "stop
|
|
70
70
|
* remembering".
|
package/dist/browser-adapter.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* writes — the snapshot, the append-only log, the stored schema version —
|
|
4
4
|
* as three `localStorage` entries per scope. Not the epochs (FR-27): each
|
|
5
5
|
* keeps a whole copy of the graph as its base, and a second copy in a few
|
|
6
|
-
* megabytes ran a two-thousand-talk
|
|
6
|
+
* megabytes ran a two-thousand-talk program out of room; a page's store
|
|
7
7
|
* is verified by the host it is served from, not in the page. It slots into `openStore` unchanged, migrations included, so a
|
|
8
8
|
* sample app that remembers is the
|
|
9
9
|
* same lifecycle as a deployment that does, minus the server.
|
|
@@ -92,7 +92,7 @@ export function browserStartsFresh(location = globalThis
|
|
|
92
92
|
return navigator?.webdriver === true;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
* Drops `?fresh=1` from the address once it has been
|
|
95
|
+
* Drops `?fresh=1` from the address once it has been honored, so the seed
|
|
96
96
|
* is the FIRST load rather than every load: a reload after starting fresh
|
|
97
97
|
* must keep what was done since, or "start fresh" is really "stop
|
|
98
98
|
* remembering".
|
package/dist/export.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { GraphSnapshot } from "./snapshot.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* THE ANTI-LOCK-IN CLAIM, as a data shape. Everything a deployment is —
|
|
5
5
|
* the graph, its whole attributed history, and the version it stands at —
|
|
6
|
-
* leaves in one JSON-
|
|
6
|
+
* leaves in one JSON-serializable bundle, and re-imports into any other
|
|
7
7
|
* deployment of the same declaration: hosted to self-hosted and back.
|
|
8
8
|
* A tenant who cannot leave was never a customer, only a hostage.
|
|
9
9
|
*/
|
package/dist/handler.js
CHANGED
|
@@ -362,7 +362,7 @@ function storeHandler(options, adapterName = "held by the host") {
|
|
|
362
362
|
asking = await seat();
|
|
363
363
|
}
|
|
364
364
|
catch {
|
|
365
|
-
// A poller the host does not
|
|
365
|
+
// A poller the host does not recognize is still told whether the store is well.
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
return send(200, {
|
package/dist/live-protocol.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export interface LiveSocketState {
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
|
-
* A SOCKET AS A HOST'S
|
|
67
|
+
* A SOCKET AS A HOST'S JUDGMENT IS HANDED IT (`build`, `viaOf`): its
|
|
68
68
|
* seat resolved to the principal, its channel, and the host's build it
|
|
69
69
|
* was opened under.
|
|
70
70
|
*/
|
package/dist/migrations.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { invert,
|
|
1
|
+
import { invert, normalize, writesOf, } from "@graview/core";
|
|
2
2
|
import { applyToSnapshot } from "./snapshot.js";
|
|
3
3
|
/** The single-step chain from a stored version to the declaration's. */
|
|
4
4
|
export function pendingMigrations(app, storedVersion) {
|
|
@@ -34,11 +34,11 @@ export function migrateSnapshot(app, stored, storedVersion, options = {}) {
|
|
|
34
34
|
const batch = `migration:${storedVersion}->${app.version ?? storedVersion}`;
|
|
35
35
|
for (const step of pendingMigrations(app, storedVersion)) {
|
|
36
36
|
/*
|
|
37
|
-
*
|
|
37
|
+
* Normalized, like every other op: a step that clears a field says so
|
|
38
38
|
* with a value rather than with an absence, so the inverse it carries is
|
|
39
39
|
* still there after the log has been through JSON.
|
|
40
40
|
*/
|
|
41
|
-
const primitives = step.apply(snapshot).map(
|
|
41
|
+
const primitives = step.apply(snapshot).map(normalize);
|
|
42
42
|
snapshot = applyToSnapshot(snapshot, primitives);
|
|
43
43
|
ops.push({
|
|
44
44
|
id: nextOpId(`${step.from}-${step.to}`),
|
package/dist/open-store.js
CHANGED
|
@@ -165,7 +165,7 @@ export async function openStore(options) {
|
|
|
165
165
|
}
|
|
166
166
|
adapter.saveMeta?.(scope, { version: target, ...formatStamp() });
|
|
167
167
|
/*
|
|
168
|
-
* Writes are
|
|
168
|
+
* Writes are SERIALIZED: a second diff's ops never land before the
|
|
169
169
|
* first's snapshot, and a failure is reported rather than swallowed —
|
|
170
170
|
* an app that thinks it persisted and did not is the worst quiet state.
|
|
171
171
|
*/
|
package/dist/photos.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { GraphReader } from "@graview/core";
|
|
|
12
12
|
* gutter.
|
|
13
13
|
*
|
|
14
14
|
* That is a trap this package sets and therefore a trap this package should
|
|
15
|
-
* spring. Three
|
|
15
|
+
* spring. Three defenses, in order:
|
|
16
16
|
*
|
|
17
17
|
* 1. **Downscale before anything is stored** (`downscale`, in
|
|
18
18
|
* `@graview/primitives` where a canvas is at hand). Nothing a model is
|
package/dist/photos.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* gutter.
|
|
12
12
|
*
|
|
13
13
|
* That is a trap this package sets and therefore a trap this package should
|
|
14
|
-
* spring. Three
|
|
14
|
+
* spring. Three defenses, in order:
|
|
15
15
|
*
|
|
16
16
|
* 1. **Downscale before anything is stored** (`downscale`, in
|
|
17
17
|
* `@graview/primitives` where a canvas is at hand). Nothing a model is
|
package/dist/remote.js
CHANGED
|
@@ -1052,7 +1052,7 @@ async function opening(options, offered, lostSaid, wiring) {
|
|
|
1052
1052
|
*
|
|
1053
1053
|
* And a refusal takes the optimism back. The alternative — leaving the
|
|
1054
1054
|
* hopeful change on screen and logging the refusal to a console — is the
|
|
1055
|
-
* one
|
|
1055
|
+
* one behavior that would make this whole design a lie: the interface
|
|
1056
1056
|
* would be showing a graph the server does not have.
|
|
1057
1057
|
*/
|
|
1058
1058
|
const appliedAll = store.applyAll.bind(store);
|
|
@@ -1137,7 +1137,7 @@ async function opening(options, offered, lostSaid, wiring) {
|
|
|
1137
1137
|
* `applyAll` is a whole gesture — a seat's plan lands as one batch — and
|
|
1138
1138
|
* `undo` is a take-back. The first version patched `apply` alone, so a
|
|
1139
1139
|
* robot's plans and undos stayed in the browser that made them while its
|
|
1140
|
-
* single presses
|
|
1140
|
+
* single presses traveled: two windows on one roster disagreed about
|
|
1141
1141
|
* exactly the changes an agent had made.
|
|
1142
1142
|
*/
|
|
1143
1143
|
store.applyAll = ((calls, applyOptions) => {
|
package/dist/sync-seed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { invert,
|
|
1
|
+
import { invert, normalize, writesOf, } from "@graview/core";
|
|
2
2
|
import { primitivesForSteps, sayStep } from "./steps.js";
|
|
3
3
|
const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
4
4
|
/**
|
|
@@ -59,7 +59,7 @@ export const SEED_SYNC_AUTHOR = { kind: "system", id: "ship:sync-seed" };
|
|
|
59
59
|
* nothing against this graph, which is the honest answer to a second run.
|
|
60
60
|
*/
|
|
61
61
|
export function contentOperation(steps, live, options = {}) {
|
|
62
|
-
const primitives = primitivesForSteps(steps, live).map(
|
|
62
|
+
const primitives = primitivesForSteps(steps, live).map(normalize);
|
|
63
63
|
if (primitives.length === 0)
|
|
64
64
|
return null;
|
|
65
65
|
const now = options.now ?? (() => new Date().toISOString());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graview/ship",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@graview/core": "0.1.
|
|
30
|
+
"@graview/core": "0.1.16"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"zod": "^4.6.5"
|