@nichoth/simple-sync 0.0.0-stage → 0.0.5

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 (67) hide show
  1. package/README.md +469 -2
  2. package/dist/client/db.d.ts +67 -0
  3. package/dist/client/db.d.ts.map +1 -0
  4. package/dist/client/db.js +1 -0
  5. package/dist/client/db.js.map +7 -0
  6. package/dist/client/idb.d.ts +12 -0
  7. package/dist/client/idb.d.ts.map +1 -0
  8. package/dist/client/idb.js +72 -0
  9. package/dist/client/idb.js.map +7 -0
  10. package/dist/client/index.d.ts +143 -0
  11. package/dist/client/index.d.ts.map +1 -0
  12. package/dist/client/index.js +362 -0
  13. package/dist/client/index.js.map +7 -0
  14. package/dist/client/sqlite-opfs-rpc.d.ts +21 -0
  15. package/dist/client/sqlite-opfs-rpc.d.ts.map +1 -0
  16. package/dist/client/sqlite-opfs-rpc.js +55 -0
  17. package/dist/client/sqlite-opfs-rpc.js.map +7 -0
  18. package/dist/client/sqlite-opfs.d.ts +15 -0
  19. package/dist/client/sqlite-opfs.d.ts.map +1 -0
  20. package/dist/client/sqlite-opfs.js +31 -0
  21. package/dist/client/sqlite-opfs.js.map +7 -0
  22. package/dist/client/sqlite-opfs.worker.d.ts +6 -0
  23. package/dist/client/sqlite-opfs.worker.d.ts.map +1 -0
  24. package/dist/client/sqlite-opfs.worker.js +47 -0
  25. package/dist/client/sqlite-opfs.worker.js.map +7 -0
  26. package/dist/client/sqlite.d.ts +25 -0
  27. package/dist/client/sqlite.d.ts.map +1 -0
  28. package/dist/client/sqlite.js +117 -0
  29. package/dist/client/sqlite.js.map +7 -0
  30. package/dist/client.d.ts +6 -0
  31. package/dist/client.d.ts.map +1 -0
  32. package/dist/client.js +11 -0
  33. package/dist/client.js.map +7 -0
  34. package/dist/hash.d.ts +23 -0
  35. package/dist/hash.d.ts.map +1 -0
  36. package/dist/hash.js +29 -0
  37. package/dist/hash.js.map +7 -0
  38. package/dist/index.d.ts +10 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +18 -0
  41. package/dist/index.js.map +7 -0
  42. package/dist/meta.json +511 -0
  43. package/dist/op.d.ts +41 -0
  44. package/dist/op.d.ts.map +1 -0
  45. package/dist/op.js +46 -0
  46. package/dist/op.js.map +7 -0
  47. package/dist/reduce.d.ts +55 -0
  48. package/dist/reduce.d.ts.map +1 -0
  49. package/dist/reduce.js +173 -0
  50. package/dist/reduce.js.map +7 -0
  51. package/dist/server/errors.d.ts +16 -0
  52. package/dist/server/errors.d.ts.map +1 -0
  53. package/dist/server/errors.js +14 -0
  54. package/dist/server/errors.js.map +7 -0
  55. package/dist/server/index.d.ts +75 -0
  56. package/dist/server/index.d.ts.map +1 -0
  57. package/dist/server/index.js +324 -0
  58. package/dist/server/index.js.map +7 -0
  59. package/dist/server.d.ts +2 -0
  60. package/dist/server.d.ts.map +1 -0
  61. package/dist/server.js +5 -0
  62. package/dist/server.js.map +7 -0
  63. package/dist/types.d.ts +105 -0
  64. package/dist/types.d.ts.map +1 -0
  65. package/dist/types.js +1 -0
  66. package/dist/types.js.map +7 -0
  67. package/package.json +118 -4
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/server/index.ts"],
4
+ "sourcesContent": ["import { Server, type Connection, type WSMessage } from 'partyserver'\nimport type { Op, Envelope, ReducedState } from '../types.js'\nimport { hashState } from '../hash.js'\nimport { isBenignConnectionError } from './errors.js'\n\n/**\n * Server-side base for Simple Sync. Subclass and assign a\n * `reduce` method (or use the exported `lastWriteWins`).\n *\n * Subclass example:\n *\n * import { SyncServer, lastWriteWins } from '@substrate-system/simple-sync'\n * export class Sync extends SyncServer {\n * reduce = lastWriteWins\n * }\n *\n * The DO must be declared as a SQLite class in wrangler.jsonc:\n *\n * \"migrations\": [\n * { \"tag\": \"vN\", \"new_sqlite_classes\": [\"Sync\"] }\n * ]\n */\nexport abstract class SyncServer<\n Env extends Cloudflare.Env = Cloudflare.Env\n> extends Server<Env> {\n /**\n * Pure reducer. Subclass must provide one. The default\n * `lastWriteWins` (exported from `@substrate-system/simple-sync`)\n * is the usual choice. May return null to indicate whole-state\n * delete; the server will delete the row from reductions,\n * remove from _current, and broadcast kind:'state-deleted'.\n */\n abstract reduce (\n state:ReducedState | null,\n op:Op\n ):Promise<ReducedState | null>\n\n /** Cached current state, keyed by state id. */\n private _current:Map<string, ReducedState> = new Map()\n /** True once onStart has finished rehydrating. */\n private _ready = false\n /**\n * Opt-in: when true, compact the `ops` table to the single\n * highest-seq op per device after each write batch. Default false\n * \u2014 existing workers keep their full op-log. LWW correctness is\n * independent of the op-log (it reads `reductions.__ts`).\n */\n protected dropAppliedOps:boolean = false\n\n async onStart ():Promise<void> {\n this.ctx.storage.sql.exec(\n `CREATE TABLE IF NOT EXISTS ops (\n id TEXT PRIMARY KEY,\n machine_id TEXT NOT NULL,\n seq INTEGER NOT NULL,\n type TEXT NOT NULL,\n target TEXT,\n value TEXT NOT NULL,\n ts INTEGER NOT NULL\n )`\n )\n this.ctx.storage.sql.exec(\n `CREATE INDEX IF NOT EXISTS idx_ops_machine_seq\n ON ops (machine_id, seq)`\n )\n this.ctx.storage.sql.exec(\n `CREATE TABLE IF NOT EXISTS reductions (\n id TEXT PRIMARY KEY,\n hash TEXT NOT NULL,\n ts_json TEXT NOT NULL DEFAULT '{}',\n author_json TEXT NOT NULL DEFAULT '{}',\n value TEXT NOT NULL\n )`\n )\n\n // Hard migration: existing DOs without ts_json column.\n // Pre-006 rows have __ts nested inside value JSON. The new\n // top-level __ts column defaults to {} for those rows, leaving\n // behavior LWW-stale until the next op touches each row. Per\n // the design's \"hard break\" policy this is acceptable; new\n // deployments start clean.\n try {\n this.ctx.storage.sql.exec(\n 'ALTER TABLE reductions ADD COLUMN ts_json TEXT NOT NULL DEFAULT \\'{}\\''\n )\n } catch {\n // Column already exists; ignore. New tables get it from CREATE.\n }\n\n // Hard migration: existing DOs without author_json column.\n // Pre-phase-4 rows have no __author field. The new top-level\n // author_json column defaults to {} for those rows, treating a\n // missing __author as lowest in tiebreak (prior arrival-order\n // behavior). Per the design's additive, optional policy this is\n // acceptable.\n try {\n this.ctx.storage.sql.exec(\n 'ALTER TABLE reductions ADD COLUMN author_json TEXT NOT ' +\n 'NULL DEFAULT \\'{}\\''\n )\n } catch {\n // Column already exists; ignore. New tables get it from CREATE.\n }\n\n // Load all cached reductions into memory.\n const rows = this.ctx.storage.sql.exec(\n 'SELECT id, hash, ts_json, author_json, value FROM reductions'\n ).toArray() as Array<{\n id:string\n hash:string\n ts_json:string\n author_json:string\n value:string\n }>\n this._current.clear()\n for (const r of rows) {\n try {\n const parsed = JSON.parse(\n r.author_json\n ) as Record<string, string>\n this._current.set(r.id, {\n id: r.id,\n hash: r.hash,\n __ts: JSON.parse(r.ts_json) as Record<string, number>,\n __author: Object.keys(parsed).length > 0 ?\n parsed :\n undefined,\n value: JSON.parse(r.value) as\n Readonly<Record<string, unknown>>\n })\n } catch {\n // Corrupt row; skip.\n }\n }\n this._ready = true\n }\n\n async onMessage (\n connection:Connection,\n message:WSMessage\n ):Promise<void> {\n let env:Envelope\n try {\n const text = typeof message === 'string' ?\n message :\n new TextDecoder().decode(message as ArrayBuffer)\n env = JSON.parse(text) as Envelope\n } catch {\n // AC1.4: drop unparseable messages silently.\n return\n }\n if (!env || typeof env !== 'object' || typeof env.kind !== 'string') {\n return\n }\n\n if (env.kind === 'hello') {\n await this._handleHello(connection, env)\n return\n }\n if (env.kind === 'write') {\n await this._handleWrite(env)\n }\n // `ready` and `state` are server -> client only; ignore inbound.\n }\n\n /**\n * Connection-level error handler. partyserver routes WebSocket\n * transport errors here (via `webSocketError`). Routine drops \u2014 a\n * client closing its tab, a dropped network, or\n * `SyncClient.disconnect()` \u2014 surface as retryable\n * \"Network connection lost\" / \"WebSocket peer disconnected\"\n * errors, so swallow those quietly; anything else stays visible\n * for debugging.\n *\n * This overrides partyserver's default `onError`, which logs\n * every error plus an \"Implement onError\" hint regardless of\n * cause. The DO does not enable hibernation, so the base's\n * hibernate-only connection close is not relevant here;\n * partyserver tears the socket down via `webSocketClose`.\n */\n onError (connection:Connection, error:unknown):void {\n if (isBenignConnectionError(error)) return\n console.error(\n '[SyncServer] connection error',\n connection.id,\n error\n )\n }\n\n private async _handleHello (\n connection:Connection,\n env:Extract<Envelope, { kind:'hello' }>\n ):Promise<void> {\n const deviceId = env.deviceId\n if (typeof deviceId !== 'string' || deviceId === '') return\n\n // Tag connection with deviceId for any future per-device logic.\n connection.setState({ deviceId })\n\n // Compute the seq we last saw from this device.\n const row = this.ctx.storage.sql.exec(\n 'SELECT MAX(seq) AS max FROM ops WHERE machine_id = ?',\n deviceId\n ).toArray() as Array<{ max:number | null }>\n const serverSeq = row[0]?.max ?? 0\n\n // requestFrom is the server's exclusive lower bound:\n // \"send me ops with seq > requestFrom\".\n // If client's lastSeq is ahead of ours, request the gap.\n // If equal, send `ready` with no requestFrom (no replay needed).\n const ready:Envelope = (typeof env.lastSeq === 'number' &&\n env.lastSeq > serverSeq) ?\n { kind: 'ready', requestFrom: serverSeq } :\n { kind: 'ready' }\n connection.send(JSON.stringify(ready))\n\n // Initial-sync: send one `state` envelope per state the client\n // does not already have (per env.states), in deterministic\n // order by state id.\n const known = new Map<string, string>()\n if (Array.isArray(env.states)) {\n for (const ks of env.states) {\n if (\n ks && typeof ks === 'object' &&\n typeof ks.id === 'string' &&\n typeof ks.hash === 'string'\n ) {\n known.set(ks.id, ks.hash)\n }\n }\n }\n\n // Deterministic lexicographic order by state id. Caveat: with seq >= 10,\n // 'state:dev:10:T' sorts BEFORE 'state:dev:2:T' (expected ASCII sort behavior).\n const ids = [...this._current.keys()].sort()\n for (const id of ids) {\n const state = this._current.get(id)!\n if (known.get(id) === state.hash) continue\n const env2:Envelope = { kind: 'state', state }\n connection.send(JSON.stringify(env2))\n }\n\n // After sending state envelopes, send state-deleted for any known\n // state ids the server no longer has (deleted while offline).\n // Iterate known states in sorted order for determinism.\n const knownIds = [...known.keys()].sort()\n for (const id of knownIds) {\n if (this._current.has(id)) continue\n const env3:Envelope = { kind: 'state-deleted', id }\n connection.send(JSON.stringify(env3))\n }\n }\n\n private async _handleWrite (\n env:Extract<Envelope, { kind:'write' }>\n ):Promise<void> {\n if (!Array.isArray(env.ops)) return\n\n const deletedIds:string[] = []\n const changedIds = new Set<string>()\n const appliedOpById = new Map<string, string>()\n\n for (const op of env.ops) {\n if (!this._validOpShape(op)) continue\n\n const machineId = this._machineFromOpId(op.id) ?? ''\n if (machineId === '') continue\n\n // RECORD FIRST: idempotency + gapless watermark.\n const cursor = this.ctx.storage.sql.exec(\n `INSERT OR IGNORE INTO ops\n (id, machine_id, seq, type, target, value, ts)\n VALUES (?, ?, ?, ?, ?, ?, ?)`,\n op.id,\n machineId,\n op.seq,\n op.type,\n op.target,\n JSON.stringify(op.value),\n op.ts\n )\n\n // Duplicate op (already recorded); skip apply.\n if (cursor.rowsWritten === 0) continue\n\n // APPLY (state effect only; on any drop the op stays\n // recorded).\n let next:ReducedState | null\n let stateId:string\n\n if (op.type === 'create') {\n // Create: pass prior=null, baseForReducer=null.\n // Reducer constructs id from op.id + op.ts.\n try {\n next = await this.reduce(null, op)\n if (next === null) {\n // Whole-state delete on create is invalid; skip.\n continue\n }\n } catch (err) {\n console.warn('[SyncServer] reduce threw', err)\n continue\n }\n\n // Defense-in-depth: validate returned id matches\n // expected format. Catches cases where a misbehaving\n // reducer invents or rewrites the state id, even when\n // the upstream op.id passed the _machineFromOpId check.\n // Expected format: state:${deviceId}:${seq}:${op.ts}\n const expectedId = `state:${machineId}:${op.seq}:${op.ts}`\n if (next.id !== expectedId) {\n console.warn(\n '[SyncServer] reducer returned malformed ' +\n 'state id',\n next.id,\n 'for op',\n op.id\n )\n continue\n }\n stateId = next.id\n } else {\n // Patch or delete: validate target.\n // AC5.5: reject empty or pending targets.\n if (\n op.target === '' ||\n (typeof op.target === 'string' &&\n op.target.startsWith('state:pending:'))\n ) {\n console.warn(\n '[SyncServer] retarget no longer supported,',\n 'dropping op',\n op.id\n )\n continue\n }\n\n // AC5.4: reject unknown targets.\n if (\n typeof op.target !== 'string' ||\n !this._current.has(op.target)\n ) {\n console.warn(\n '[SyncServer] unknown target',\n op.target,\n 'for op',\n op.id\n )\n continue\n }\n\n stateId = op.target\n const prior = this._current.get(stateId)!\n try {\n next = await this.reduce(prior, op)\n } catch (err) {\n console.warn('[SyncServer] reduce threw', err)\n continue\n }\n }\n\n // Handle result: null (whole-state delete) or\n // ReducedState.\n if (next === null) {\n // Whole-state delete.\n this._current.delete(stateId)\n this.ctx.storage.sql.exec(\n 'DELETE FROM reductions WHERE id = ?',\n stateId\n )\n deletedIds.push(stateId)\n } else {\n // State persisted.\n // Recompute hash if blank.\n if (\n typeof next.hash !== 'string' ||\n next.hash === ''\n ) {\n next = {\n ...next,\n hash: await hashState(next.value)\n }\n }\n this._current.set(next.id, next)\n this.ctx.storage.sql.exec(\n `INSERT OR REPLACE INTO reductions\n (id, hash, ts_json, author_json, value)\n VALUES (?, ?, ?, ?, ?)`,\n next.id,\n next.hash,\n JSON.stringify(next.__ts),\n JSON.stringify(next.__author ?? {}),\n JSON.stringify(next.value)\n )\n changedIds.add(next.id)\n appliedOpById.set(next.id, op.id)\n }\n }\n\n // Broadcast state-deleted envelopes.\n for (const id of deletedIds) {\n const outEnv:Envelope = { kind: 'state-deleted', id }\n this.broadcast(JSON.stringify(outEnv))\n }\n\n // Broadcast state envelopes for changed states.\n for (const id of changedIds) {\n const state = this._current.get(id)\n if (state) {\n const appliedOp = appliedOpById.get(id)\n const outEnv:Envelope = appliedOp ?\n { kind: 'state', state, appliedOp } :\n { kind: 'state', state }\n this.broadcast(JSON.stringify(outEnv))\n }\n }\n\n // Opt-in op-log compaction: keep one op per device.\n if (this.dropAppliedOps) this._pruneOps()\n }\n\n private _validOpShape (op:unknown):op is Op {\n if (!op || typeof op !== 'object') return false\n const o = op as Record<string, unknown>\n if (\n typeof o.id !== 'string' ||\n typeof o.seq !== 'number' ||\n typeof o.ts !== 'number' ||\n (o.target !== null && typeof o.target !== 'string')\n ) {\n return false\n }\n if (o.type === 'create') return true\n if (o.type === 'patch') {\n return !!(o.value && typeof o.value === 'object')\n }\n if (o.type === 'delete') {\n // Whole-state delete: value is null.\n if (o.value === null) return true\n // Field delete: value is { key: string }.\n const v = o.value as { key?:unknown } | null | undefined\n return !!(v && typeof v === 'object' &&\n typeof v.key === 'string')\n }\n return false\n }\n\n private _machineFromOpId (id:string):string | null {\n if (!id.startsWith('op:')) return null\n const rest = id.slice(3)\n const colon = rest.lastIndexOf(':')\n if (colon <= 0) return null\n return rest.slice(0, colon)\n }\n\n /**\n * Compact the ops table to the highest-seq op per device (Kafka\n * \"keep latest per key\"). Safe: LWW reads `reductions.__ts`, and\n * `_handleHello` only needs `MAX(seq)` per device, which the\n * retained op preserves.\n */\n private _pruneOps ():void {\n // Standard SQLite \"keep latest per group\" idiom: the\n // correlated subquery is evaluated per candidate row, so\n // deleting from `ops` while the subquery scans `ops AS o2` is\n // safe (SQLite computes the predicate against the pre-delete\n // table state for each row). Keeps exactly the max-seq row per\n // machine_id; a single-op device (seq < seq is false) is\n // untouched; an empty table is a no-op.\n this.ctx.storage.sql.exec(\n `DELETE FROM ops\n WHERE seq < (\n SELECT MAX(seq) FROM ops AS o2\n WHERE o2.machine_id = ops.machine_id\n )`\n )\n }\n\n /**\n * Current op count per device in the ops table. Read seam for the\n * example's op-count endpoint.\n */\n protected opCountsByDevice ():Record<string, number> {\n const rows = this.ctx.storage.sql.exec(\n 'SELECT machine_id, COUNT(*) AS n FROM ops GROUP BY machine_id'\n ).toArray() as Array<{ machine_id:string; n:number }>\n const out:Record<string, number> = {}\n for (const r of rows) out[r.machine_id] = r.n\n return out\n }\n}\n"],
5
+ "mappings": ";;AAAA,SAAS,cAA+C;AAExD,SAAS,iBAAiB;AAC1B,SAAS,+BAA+B;AAmBjC,MAAe,mBAEZ,OAAY;AAAA,EAxBtB,OAwBsB;AAAA;AAAA;AAAA;AAAA,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EAAE;AACZ,aAAO,CAAC,EAAE,KAAK,OAAO,MAAM,YACxB,OAAO,EAAE,QAAQ;AAAA,IACzB;AACA,WAAO;AAAA,EACX;AAAA,EAEQ,iBAAkB,IAAyB;AAC/C,QAAI,CAAC,GAAG,WAAW,KAAK,EAAG,QAAO;AAClC,UAAM,OAAO,GAAG,MAAM,CAAC;AACvB,UAAM,QAAQ,KAAK,YAAY,GAAG;AAClC,QAAI,SAAS,EAAG,QAAO;AACvB,WAAO,KAAK,MAAM,GAAG,KAAK;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQQ,YAAkB;AAQtB,SAAK,IAAI,QAAQ,IAAI;AAAA,MACjB;AAAA;AAAA;AAAA;AAAA;AAAA,IAKJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMU,mBAA2C;AACjD,UAAM,OAAO,KAAK,IAAI,QAAQ,IAAI;AAAA,MAC9B;AAAA,IACJ,EAAE,QAAQ;AACV,UAAM,MAA6B,CAAC;AACpC,eAAW,KAAK,KAAM,KAAI,EAAE,UAAU,IAAI,EAAE;AAC5C,WAAO;AAAA,EACX;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export { SyncServer } from './server/index.js';
2
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA"}
package/dist/server.js ADDED
@@ -0,0 +1,5 @@
1
+ import { SyncServer } from "./server/index.js";
2
+ export {
3
+ SyncServer
4
+ };
5
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/server.ts"],
4
+ "sourcesContent": ["export { SyncServer } from './server/index.js'\n"],
5
+ "mappings": "AAAA,SAAS,kBAAkB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Wire types for Simple Sync protocol. See design plan for protocol
3
+ * semantics: https://github.com/substrate-system/simple-sync (v1)
4
+ */
5
+ /**
6
+ * Operation type discriminator.
7
+ */
8
+ export type OpType = 'create' | 'patch' | 'delete';
9
+ /**
10
+ * Wire representation of a synchronization operation.
11
+ * Carries device-local ordering (seq), monotonic timestamp,
12
+ * and the mutation payload.
13
+ *
14
+ * See design plan for full protocol semantics.
15
+ */
16
+ export interface Op {
17
+ readonly seq: number;
18
+ readonly id: string;
19
+ readonly type: OpType;
20
+ readonly target: string | null;
21
+ readonly value: unknown;
22
+ readonly ts: number;
23
+ readonly sig?: string;
24
+ }
25
+ /**
26
+ * Wire representation of reduced (server-side) state.
27
+ * Includes content hash for verification and conflict detection.
28
+ *
29
+ * See design plan for full protocol semantics.
30
+ */
31
+ export interface ReducedState {
32
+ readonly id: string;
33
+ readonly hash: string;
34
+ /**
35
+ * Per-field write clock. Each key is a top-level field of `value`,
36
+ * mapped to the `ts` of the op that last wrote it. A key present here
37
+ * but ABSENT from `value` is a tombstone: the field was deleted at
38
+ * that `ts`. The reducer uses these to resolve writes (and deletes)
39
+ * last-write-wins by `ts`, regardless of arrival order. Excluded from
40
+ * `hash` (which is over `value` only).
41
+ */
42
+ readonly __ts: Readonly<Record<string, number>>;
43
+ /**
44
+ * Optional per-field writer clock: each key maps to the deviceId of
45
+ * the op that last wrote it. Forms a composite (ts, deviceId)
46
+ * ordering key with __ts so equal-ts writes resolve deterministically
47
+ * (higher deviceId wins) instead of by arrival order. Optional: states
48
+ * from reducers that do not set it fall back to arrival/incoming
49
+ * order. Excluded from `hash` (which is over `value` only).
50
+ */
51
+ readonly __author?: Readonly<Record<string, string>>;
52
+ readonly value: Readonly<Record<string, unknown>>;
53
+ }
54
+ /**
55
+ * Compact reference to a ReducedState (id + hash for verification).
56
+ */
57
+ export interface StateRef {
58
+ readonly id: string;
59
+ readonly hash: string;
60
+ }
61
+ /**
62
+ * Wire envelope types for the sync protocol.
63
+ * Discriminated union for type-safe message handling.
64
+ *
65
+ * See design plan for full protocol semantics.
66
+ */
67
+ export type Envelope = {
68
+ kind: 'hello';
69
+ deviceId: string;
70
+ lastSeq: number;
71
+ states?: readonly StateRef[];
72
+ } | {
73
+ kind: 'write';
74
+ ops: readonly Op[];
75
+ } | {
76
+ kind: 'ready';
77
+ requestFrom?: number;
78
+ } | {
79
+ kind: 'state';
80
+ state: ReducedState;
81
+ /**
82
+ * Optional write confirmation signal. The id (op:${deviceId}:${seq})
83
+ * of the operation that produced this broadcast. Present only on
84
+ * write-driven state broadcasts; omitted on hello-time re-broadcasts.
85
+ * Transport-only property (not part of ReducedState) — does not
86
+ * affect state hashing or deduplication.
87
+ */
88
+ appliedOp?: string;
89
+ } | {
90
+ kind: 'state-deleted';
91
+ id: string;
92
+ };
93
+ /**
94
+ * Payload shape for a delete operation.
95
+ * Specifies which field key to remove.
96
+ */
97
+ export type DeleteValue = {
98
+ key: string;
99
+ };
100
+ /**
101
+ * Payload shape for a patch operation.
102
+ * A record of field updates to shallow-merge into state.
103
+ */
104
+ export type PatchValue = Record<string, unknown>;
105
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;AAElD;;;;;;GAMG;AACH,MAAM,WAAW,EAAE;IACf,QAAQ,CAAC,GAAG,EAAC,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,EAAC,MAAM,CAAA;IAClB,QAAQ,CAAC,IAAI,EAAC,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAC,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,KAAK,EAAC,OAAO,CAAA;IACtB,QAAQ,CAAC,EAAE,EAAC,MAAM,CAAA;IAClB,QAAQ,C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AC,MAAM,CAAA;CAAE,CAAA;AAExC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,120 @@
1
1
  {
2
2
  "name": "@nichoth/simple-sync",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "type": "module",
4
+ "version": "0.0.5",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./client": {
13
+ "types": "./dist/client.d.ts",
14
+ "default": "./dist/client.js"
15
+ },
16
+ "./server": {
17
+ "types": "./dist/server.d.ts",
18
+ "default": "./dist/server.js"
19
+ },
20
+ "./sqlite": {
21
+ "types": "./dist/client/sqlite.d.ts",
22
+ "default": "./dist/client/sqlite.js"
23
+ },
24
+ "./sqlite-opfs": {
25
+ "types": "./dist/client/sqlite-opfs.d.ts",
26
+ "default": "./dist/client/sqlite-opfs.js"
27
+ }
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "scripts": {
33
+ "lint": "eslint \"./**/*.{ts,js}\"",
34
+ "stylelint": "stylelint \"**/*.css\" --ignore-pattern \"public/**\"",
35
+ "toc": "markdown-toc --maxdepth 4 -i README.md",
36
+ "test": "esbuild ./test/index.ts --bundle --loader:.css=empty | tapout --timeout 45000",
37
+ "test:e2e": "esbuild ./test/e2e.ts --bundle --loader:.css=empty '--define:__BASE_URL__=\"http://localhost:4444\"' | tapout --timeout 45000",
38
+ "build": "mkdir -p ./dist && rm -rf ./dist/* && npm run build-esm",
39
+ "build-example": "mkdir -p ./public && rm -rf ./public/* && VITE_DEBUG_MODE=staging vite --mode staging build",
40
+ "build-esm": "esbuild 'src/**/*.ts' --format=esm --metafile=dist/meta.json --keep-names --tsconfig=tsconfig.build.json --outdir=./dist --sourcemap && tsc --emitDeclarationOnly --project tsconfig.build.json",
41
+ "test:colors": "esbuild ./test/colors-reduce.ts --bundle --loader:.css=empty | tapout --timeout 45000",
42
+ "test:example3": "esbuild ./test/example3-reduce.ts --bundle --loader:.css=empty | tapout --timeout 45000",
43
+ "test:sqlite": "esbuild ./test/sqlite-adapter.ts --bundle --loader:.css=empty --loader:.wasm=dataurl | tapout --timeout 45000",
44
+ "test:sqlite-opfs": "esbuild ./test/sqlite-opfs-rpc.ts --bundle --loader:.css=empty --loader:.wasm=dataurl | tapout --timeout 45000",
45
+ "test:worker": "esbuild ./test/e2e.ts --bundle --loader:.css=empty '--define:__BASE_URL__=\"http://localhost:9999\"' | tapout --timeout 45000",
46
+ "test:prune": "esbuild ./test/prune-server.ts --bundle --loader:.css=empty '--define:__BASE_URL__=\"http://localhost:8888\"' | tapout --timeout 45000",
47
+ "dev:worker": "npm run build && wrangler dev",
48
+ "example:2": "vite --config vite.config.colors.js",
49
+ "build:2": "mkdir -p ./public && rm -rf ./public/* && vite build --config vite.config.colors.js",
50
+ "dev:worker:2": "npm run build:2 && wrangler dev -c wrangler.colors.jsonc",
51
+ "example:3": "vite --config vite.config.example3.js",
52
+ "build:3": "mkdir -p ./public && rm -rf ./public/* && vite build --config vite.config.example3.js",
53
+ "dev:worker:3": "npm run build:3 && wrangler dev -c wrangler.example3.jsonc",
54
+ "example:prune": "vite --config vite.config.prune.js",
55
+ "build:prune": "mkdir -p ./public && rm -rf ./public/* && vite build --config vite.config.prune.js",
56
+ "dev:worker:prune": "npm run build:prune && wrangler dev -c wrangler.prune.jsonc",
57
+ "example:sqlite": "vite --config vite.config.sqlite.js",
58
+ "build:sqlite": "mkdir -p ./public && rm -rf ./public/* && vite build --config vite.config.sqlite.js",
59
+ "start": "vite",
60
+ "preversion": "npm run lint",
61
+ "version": "npm run toc && auto-changelog -p --template keepachangelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md README.md",
62
+ "postversion": "git push --follow-tags && npm publish",
63
+ "prepublishOnly": "npm run build"
64
+ },
65
+ "dependencies": {
66
+ "idb": "^8.0.3",
67
+ "mitt": "^3.0.1",
68
+ "monotonic-timestamp": "^0.0.9"
69
+ },
70
+ "peerDependencies": {
71
+ "@sqlite.org/sqlite-wasm": "^3.53.0-build1"
72
+ },
73
+ "peerDependenciesMeta": {
74
+ "@sqlite.org/sqlite-wasm": {
75
+ "optional": true
76
+ }
77
+ },
78
+ "devDependencies": {
79
+ "@cloudflare/vite-plugin": "^1.19.0",
80
+ "@cloudflare/workers-types": "^4.20250109.0",
81
+ "@dotenvx/dotenvx": "^1.71.3",
82
+ "@hono/vite-dev-server": "^0.23.0",
83
+ "@preact/preset-vite": "^2.9.4",
84
+ "@preact/signals": "^2.5.1",
85
+ "@sqlite.org/sqlite-wasm": "^3.53.0-build1",
86
+ "@substrate-system/button": "^0.0.44",
87
+ "@substrate-system/css-normalize": "^0.0.15",
88
+ "@substrate-system/debug": "^0.9.38",
89
+ "@substrate-system/details-summary": "^0.0.3",
90
+ "@substrate-system/input": "^0.0.25",
91
+ "@substrate-system/keys": "^0.2.41",
92
+ "@substrate-system/routes": "^5.0.0",
93
+ "@substrate-system/tapout": "^0.0.38",
94
+ "@substrate-system/tapzero": "^0.10.16",
95
+ "@substrate-system/tool-tip": "^0.0.5",
96
+ "@types/node": "^25.8.0",
97
+ "auto-changelog": "^2.4.0",
98
+ "concurrently": "^9.1.2",
99
+ "esbuild": "^0.27.2",
100
+ "eslint": "^9.39.4",
101
+ "hono": "^4.12.21",
102
+ "hono-party": "^2.1.0",
103
+ "htm": "^3.1.1",
104
+ "ky": "^2.0.2",
105
+ "lightningcss": "^1.30.2",
106
+ "markdown-toc": "^1.2.0",
107
+ "neostandard": "^0.13.0",
108
+ "partyserver": "^0.5.6",
109
+ "preact": "^10.28.0",
110
+ "route-event": "^7.4.0",
111
+ "stylelint": "^16.12.0",
112
+ "stylelint-config-standard": "^39.0.1",
113
+ "tap-spec": "^5.0.0",
114
+ "typescript": "^5.9.3",
115
+ "typescript-eslint": "^8.59.3",
116
+ "vite": "^8.0.13",
117
+ "wrangler": "^4.95.0"
118
+ },
119
+ "author": "nichoth <nichoth@nichoth.com> (https://nichoth.com)"
120
+ }