@interop/was-react 0.19.0 → 0.20.1

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 (72) hide show
  1. package/README.md +4 -3
  2. package/dist/auth/verifyResponse.d.ts.map +1 -1
  3. package/dist/auth/verifyResponse.js +10 -5
  4. package/dist/auth/verifyResponse.js.map +1 -1
  5. package/dist/identity/agents.d.ts +5 -0
  6. package/dist/identity/agents.d.ts.map +1 -1
  7. package/dist/identity/agents.js +10 -3
  8. package/dist/identity/agents.js.map +1 -1
  9. package/dist/identity/seedCredential.d.ts +5 -1
  10. package/dist/identity/seedCredential.d.ts.map +1 -1
  11. package/dist/identity/seedCredential.js +15 -28
  12. package/dist/identity/seedCredential.js.map +1 -1
  13. package/dist/index.d.ts +4 -3
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +7 -6
  16. package/dist/index.js.map +1 -1
  17. package/dist/react/hooks.d.ts +3 -2
  18. package/dist/react/hooks.d.ts.map +1 -1
  19. package/dist/react/hooks.js +8 -4
  20. package/dist/react/hooks.js.map +1 -1
  21. package/dist/session/authStore.d.ts +9 -0
  22. package/dist/session/authStore.d.ts.map +1 -1
  23. package/dist/session/authStore.js +113 -47
  24. package/dist/session/authStore.js.map +1 -1
  25. package/dist/session/localWipe.d.ts +1 -1
  26. package/dist/session/localWipe.js +2 -2
  27. package/dist/session/localWipe.js.map +1 -1
  28. package/dist/storage/adopt.d.ts +4 -1
  29. package/dist/storage/adopt.d.ts.map +1 -1
  30. package/dist/storage/adopt.js +4 -3
  31. package/dist/storage/adopt.js.map +1 -1
  32. package/dist/storage/descriptorManager.d.ts +1 -0
  33. package/dist/storage/descriptorManager.d.ts.map +1 -1
  34. package/dist/storage/descriptorManager.js +39 -21
  35. package/dist/storage/descriptorManager.js.map +1 -1
  36. package/dist/storage/entityStore.d.ts.map +1 -1
  37. package/dist/storage/entityStore.js +3 -0
  38. package/dist/storage/entityStore.js.map +1 -1
  39. package/dist/storage/publicUrl.js +3 -3
  40. package/dist/storage/storageContext.d.ts +178 -0
  41. package/dist/storage/storageContext.d.ts.map +1 -0
  42. package/dist/storage/storageContext.js +331 -0
  43. package/dist/storage/storageContext.js.map +1 -0
  44. package/dist/storage/storageManager.d.ts +61 -76
  45. package/dist/storage/storageManager.d.ts.map +1 -1
  46. package/dist/storage/storageManager.js +59 -150
  47. package/dist/storage/storageManager.js.map +1 -1
  48. package/dist/storage/syncController.d.ts +10 -1
  49. package/dist/storage/syncController.d.ts.map +1 -1
  50. package/dist/storage/syncController.js +12 -4
  51. package/dist/storage/syncController.js.map +1 -1
  52. package/dist/storage/syncStatusStore.d.ts +23 -2
  53. package/dist/storage/syncStatusStore.d.ts.map +1 -1
  54. package/dist/storage/syncStatusStore.js +22 -13
  55. package/dist/storage/syncStatusStore.js.map +1 -1
  56. package/dist/storage/wasRemoteStore.d.ts +24 -10
  57. package/dist/storage/wasRemoteStore.d.ts.map +1 -1
  58. package/dist/storage/wasRemoteStore.js +91 -36
  59. package/dist/storage/wasRemoteStore.js.map +1 -1
  60. package/dist/storage/wasSync.d.ts +24 -9
  61. package/dist/storage/wasSync.d.ts.map +1 -1
  62. package/dist/storage/wasSync.js +52 -21
  63. package/dist/storage/wasSync.js.map +1 -1
  64. package/dist/storage/writerId.d.ts +36 -0
  65. package/dist/storage/writerId.d.ts.map +1 -0
  66. package/dist/storage/writerId.js +76 -0
  67. package/dist/storage/writerId.js.map +1 -0
  68. package/package.json +9 -9
  69. package/dist/storage/rehydrate.d.ts +0 -64
  70. package/dist/storage/rehydrate.d.ts.map +0 -1
  71. package/dist/storage/rehydrate.js +0 -132
  72. package/dist/storage/rehydrate.js.map +0 -1
@@ -1,200 +1,109 @@
1
- /*!
2
- * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
- */
4
- /**
5
- * The storage manager: a thin process-wide holder for the one {@link LocalStore}
6
- * instance, the per-session {@link WasRemoteStore}, plus the per-install writer
7
- * id. Entity stores reach for the stores through {@link requireStore} /
8
- * {@link requireRemoteStore} inside their verbs rather than importing them
9
- * directly, which keeps this module free of store imports (no cycle) and lets
10
- * the app own the init/hydrate ordering.
11
- *
12
- * It also owns the writer-id concern end to end: {@link getWriterId} resolves
13
- * the per-install id, {@link setWriterId} installs the session's resolved value,
14
- * {@link clearWriterId} removes it (the clear-data wipe), and {@link stampLww}
15
- * is the one place a payload's last-write-wins fields are minted, so no caller
16
- * has to remember to stamp.
17
- */
18
- import { uuidv7 } from 'uuidv7';
19
- import { DEFAULT_STORAGE_KEY_PREFIX } from '../config.js';
20
- let localStore = null;
21
- let remoteStore = null;
1
+ let active = null;
22
2
  /**
23
- * Installs the opened store (called once by the app bootstrap).
3
+ * Makes `context` the active one (called by the session store at creation, so
4
+ * the facades resolve before any replica opens, again right before it opens a
5
+ * replica, and by {@link StorageContext.attachStore}). Idempotent for the
6
+ * context already active; throws while a DIFFERENT context still has a replica
7
+ * attached.
24
8
  *
25
- * @param store {LocalStore}
9
+ * @param context {StorageContext}
26
10
  * @returns {void}
27
11
  */
28
- export function setLocalStore(store) {
29
- localStore = store;
30
- }
31
- /**
32
- * The opened store, or throws if the app has not bootstrapped yet.
33
- *
34
- * @returns {LocalStore}
35
- */
36
- export function requireStore() {
37
- if (!localStore) {
38
- throw new Error('LocalStore is not initialized; open it first.');
12
+ export function activateStorageContext(context) {
13
+ if (active && active !== context && active.hasStore()) {
14
+ throw new Error('Another storage context still has a replica attached; ' +
15
+ 'one process hosts one live session (one provider) at a time.');
39
16
  }
40
- return localStore;
41
- }
42
- /**
43
- * Whether the store has been opened.
44
- *
45
- * @returns {boolean}
46
- */
47
- export function hasStore() {
48
- return localStore !== null;
17
+ active = context;
49
18
  }
50
19
  /**
51
- * Releases the held store reference (logout; the caller closes the db).
20
+ * Releases the active pointer if `context` holds it (called by
21
+ * `StorageContext.detachStore`, so every path that detaches a replica --
22
+ * `destroy`, logout, clear-data, the connected activation's fallback to
23
+ * `local` -- releases it and re-claims on re-attach); a no-op for any other
24
+ * context. Until the next claim the facades throw rather than resolve a
25
+ * retired session.
52
26
  *
27
+ * @param context {StorageContext}
53
28
  * @returns {void}
54
29
  */
55
- export function clearLocalStore() {
56
- localStore = null;
30
+ export function deactivateStorageContext(context) {
31
+ if (active === context) {
32
+ active = null;
33
+ }
57
34
  }
58
35
  /**
59
- * Installs the per-session delegated remote store (set once background sync
60
- * has bootstrapped it from the granted zcaps).
36
+ * Whether a storage context is active.
61
37
  *
62
- * @param store {WasRemoteStore}
63
- * @returns {void}
38
+ * @returns {boolean}
64
39
  */
65
- export function setRemoteStore(store) {
66
- remoteStore = store;
40
+ export function hasStorageContext() {
41
+ return active !== null;
67
42
  }
68
43
  /**
69
- * The connected session's remote store, or throws while no wallet-connected
70
- * session is active (local-only mode, or sync has not bootstrapped yet).
44
+ * The active storage context, or throws if no session store has been created.
71
45
  *
72
- * @returns {WasRemoteStore}
46
+ * @returns {StorageContext}
73
47
  */
74
- export function requireRemoteStore() {
75
- if (!remoteStore) {
76
- throw new Error('No WAS remote store is available; connect a wallet session first.');
48
+ export function requireStorageContext() {
49
+ if (!active) {
50
+ throw new Error('No storage context is active; create the session store first.');
77
51
  }
78
- return remoteStore;
52
+ return active;
79
53
  }
80
54
  /**
81
- * Whether a connected session's remote store is available.
55
+ * The active session's opened replica, or throws if none is open.
82
56
  *
83
- * @returns {boolean}
57
+ * @returns {LocalStore}
84
58
  */
85
- export function hasRemoteStore() {
86
- return remoteStore !== null;
59
+ export function requireStore() {
60
+ return requireStorageContext().requireStore();
87
61
  }
88
62
  /**
89
- * Releases the held remote store reference (logout / sync teardown).
63
+ * Whether the active session has a replica open.
90
64
  *
91
- * @returns {void}
65
+ * @returns {boolean}
92
66
  */
93
- export function clearRemoteStore() {
94
- remoteStore = null;
67
+ export function hasStore() {
68
+ return active?.hasStore() ?? false;
95
69
  }
96
70
  /**
97
- * The unpersisted fallback writer id for environments without `localStorage`
98
- * (tests, SSR): process-stable, so every stamp within one run agrees, minted
99
- * fresh on the next run.
100
- */
101
- let fallbackWriterId = null;
102
- /**
103
- * A stable per-install writer id (the last-write-wins tiebreak stamped into
104
- * every payload), persisted in localStorage under `<prefix>writerId`. In an
105
- * environment without `localStorage` it falls back to a process-stable
106
- * unpersisted id instead of throwing.
71
+ * The active session's remote store, or throws while no wallet-connected
72
+ * session is active.
107
73
  *
108
- * The id is an unkeyed, clearable attribution label -- never an identity. On a
109
- * miss it adopts a value left under the pre-rename `<prefix>clientId` key and
110
- * removes the old one, so an existing install keeps stamping the same id
111
- * across the rename rather than looking like a second writer.
112
- *
113
- * @param [options] {object}
114
- * @param [options.storageKeyPrefix] {string} the localStorage key prefix
115
- * (defaults to {@link DEFAULT_STORAGE_KEY_PREFIX})
116
- * @returns {string}
74
+ * @returns {WasRemoteStore}
117
75
  */
118
- export function getWriterId({ storageKeyPrefix = DEFAULT_STORAGE_KEY_PREFIX } = {}) {
119
- const writerIdKey = `${storageKeyPrefix}writerId`;
120
- const legacyKey = `${storageKeyPrefix}clientId`;
121
- try {
122
- let id = localStorage.getItem(writerIdKey);
123
- if (!id) {
124
- id = localStorage.getItem(legacyKey) || uuidv7();
125
- localStorage.setItem(writerIdKey, id);
126
- localStorage.removeItem(legacyKey);
127
- }
128
- return id;
129
- }
130
- catch {
131
- fallbackWriterId ??= uuidv7();
132
- return fallbackWriterId;
133
- }
76
+ export function requireRemoteStore() {
77
+ return requireStorageContext().requireRemoteStore();
134
78
  }
135
- let resolvedWriterId = null;
136
79
  /**
137
- * Installs the session's resolved writer id (called once by the session store,
138
- * under the app's configured `storageKeyPrefix`, before any replica opens).
80
+ * Whether the active session has a remote store available.
139
81
  *
140
- * @param id {string}
141
- * @returns {void}
82
+ * @returns {boolean}
142
83
  */
143
- export function setWriterId(id) {
144
- resolvedWriterId = id;
84
+ export function hasRemoteStore() {
85
+ return active?.hasRemoteStore() ?? false;
145
86
  }
146
87
  /**
147
- * The session's resolved writer id, or throws if it has not been installed
148
- * yet. Deliberately never falls back to {@link getWriterId}: that would resolve
149
- * under the DEFAULT key prefix, so an app with a custom `storageKeyPrefix`
150
- * would silently stamp a second writer id.
88
+ * The active session's writer id, or throws if no session store exists yet.
89
+ * Deliberately never falls back to `getWriterId`: that would resolve under the
90
+ * DEFAULT key prefix, so an app with a custom `storageKeyPrefix` would silently
91
+ * stamp a second writer id.
151
92
  *
152
93
  * @returns {string}
153
94
  */
154
95
  export function requireWriterId() {
155
- if (!resolvedWriterId) {
156
- throw new Error('Writer id is not resolved; create the session store first.');
157
- }
158
- return resolvedWriterId;
159
- }
160
- /**
161
- * Clears the persisted writer id (the clear-data grade of the wipe): removes
162
- * both the current key and the pre-rename one, so nothing this library wrote
163
- * survives in localStorage. A fresh id is installed in memory rather than the
164
- * resolved one being dropped, because the session keeps running over its new
165
- * anonymous replica and its write verbs still have to stamp; nothing persists
166
- * it, so the next run resolves and stores an id of its own.
167
- *
168
- * @param [options] {object}
169
- * @param [options.storageKeyPrefix] {string} the localStorage key prefix
170
- * (defaults to {@link DEFAULT_STORAGE_KEY_PREFIX})
171
- * @returns {void}
172
- */
173
- export function clearWriterId({ storageKeyPrefix = DEFAULT_STORAGE_KEY_PREFIX } = {}) {
174
- try {
175
- localStorage.removeItem(`${storageKeyPrefix}writerId`);
176
- localStorage.removeItem(`${storageKeyPrefix}clientId`);
177
- }
178
- catch {
179
- // No localStorage in this environment: nothing was persisted to clear.
180
- }
181
- fallbackWriterId = null;
182
- setWriterId(uuidv7());
96
+ return requireStorageContext().writerId;
183
97
  }
184
98
  /**
185
- * Stamps a payload with fresh last-write-wins fields: the current instant as
186
- * `updatedAt` and the session's resolved writer id. Any values the caller
187
- * supplied are overwritten -- a stamp must describe THIS write, or a hydrated
188
- * doc's older `updatedAt` would ride a later edit and lose the conflict.
99
+ * Stamps a payload with fresh last-write-wins fields under the active session
100
+ * (see {@link StorageContext.stampLww}); the entity-store write verbs call it
101
+ * on every write, and an app writing through `LocalStore` directly does too.
189
102
  *
190
103
  * @param payload {object}
191
104
  * @returns {object} the payload with the LWW fields set
192
105
  */
193
106
  export function stampLww(payload) {
194
- return {
195
- ...payload,
196
- updatedAt: new Date().toISOString(),
197
- writerId: requireWriterId()
198
- };
107
+ return requireStorageContext().stampLww(payload);
199
108
  }
200
109
  //# sourceMappingURL=storageManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"storageManager.js","sourceRoot":"","sources":["../../src/storage/storageManager.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAKzD,IAAI,UAAU,GAAsB,IAAI,CAAA;AACxC,IAAI,WAAW,GAA0B,IAAI,CAAA;AAE7C;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAiB;IAC7C,UAAU,GAAG,KAAK,CAAA;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;IAClE,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,UAAU,KAAK,IAAI,CAAA;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,UAAU,GAAG,IAAI,CAAA;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,KAAqB;IAClD,WAAW,GAAG,KAAK,CAAA;AACrB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAA;IACH,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,WAAW,K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EAAE;IACnC,IAAI,CAAC;QACH,YAAY,CAAC,UAAU,CAAC,GAAG,gBAAgB,UAAU,CAAC,CAAA;QACtD,YAAY,CAAC,UAAU,CAAC,GAAG,gBAAgB,UAAU,CAAC,CAAA;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,uEAAuE;IACzE,CAAC;IACD,gBAAgB,GAAG,IAAI,CAAA;IACvB,WAAW,CAAC,MAAM,EAAE,CAAC,CAAA;AACvB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAA2B,OAAU;IAC3D,OAAO;QACL,GAAG,OAAO;QACV,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,QAAQ,EAAE,eAAe,EAAE;KAC5B,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"storageManager.js","sourceRoot":"","sources":["../../src/storage/storageManager.ts"],"names":[],"mappings":"AAyBA,IAAI,MAAM,GAA0B,IAAI,CAAA;AAExC;;;;;;;;;GASG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAuB;IAC5D,IAAI,MAAM,IAAI,MAAM,KAAK,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CACb,wDAAwD;YACtD,8DAA8D,CACjE,CAAA;IACH,CAAC;IACD,MAAM,GAAG,OAAO,CAAA;AAClB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAuB;IAC9D,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,MAAM,GAAG,IAAI,CAAA;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,KAAK,IAAI,CAAA;AACxB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,qBAAqB,EAAE,CAAC,YAAY,EAAE,CAAA;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,MAAM,EAAE,QAAQ,EAAE,IAAI,KAAK,CAAA;AACpC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,qBAAqB,EAAE,CAAC,kBAAkB,EAAE,CAAA;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,MAAM,EAAE,cAAc,EAAE,IAAI,KAAK,CAAA;AAC1C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,qBAAqB,EAAE,CAAC,QAAQ,CAAA;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAA2B,OAAU;IAC3D,OAAO,qBAAqB,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;AAClD,CAAC"}
@@ -3,6 +3,7 @@ import { type SyncedDoc } from '../sync/index.js';
3
3
  import { type WasCollectionConfig, type WasSyncConfig } from '../config.js';
4
4
  import type { LocalStore } from './localStore.js';
5
5
  import type { WasRemoteStore } from './wasRemoteStore.js';
6
+ import type { SyncStatusStore } from './syncStatusStore.js';
6
7
  /**
7
8
  * Whether a replication error signals expired/revoked storage access. Every WAS
8
9
  * request the replication makes funnels through the sync port, which maps a
@@ -24,8 +25,16 @@ export declare function isAuthError(err: unknown): boolean;
24
25
  */
25
26
  export declare class SyncController {
26
27
  #private;
27
- constructor({ collections, sync }: {
28
+ /**
29
+ * @param options {object}
30
+ * @param options.collections {WasCollectionConfig[]}
31
+ * @param options.syncStatus {SyncStatusStore} the session's per-collection
32
+ * status store this controller reports into
33
+ * @param [options.sync] {WasSyncConfig}
34
+ */
35
+ constructor({ collections, syncStatus, sync }: {
28
36
  collections: WasCollectionConfig[];
37
+ syncStatus: SyncStatusStore;
29
38
  sync?: WasSyncConfig;
30
39
  });
31
40
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"syncController.d.ts","sourceRoot":"","sources":["../../src/storage/syncController.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAML,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAQzD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CA+BjD;AAED;;GAEG;AACH,qBAAa,cAAc;;gBAYb,EACV,WAAW,EACX,IAAI,EACL,EAAE;QACD,WAAW,EAAE,mBAAmB,EAAE,CAAA;QAClC,IAAI,CAAC,EAAE,aAAa,CAAA;KACrB;IAKD;;;;;;;;;;;;;OAaG;IACG,KAAK,CAAC,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACZ,EAAE;QACD,WAAW,EAAE,cAAc,CAAA;QAC3B,UAAU,EAAE,UAAU,CAAA;QACtB,cAAc,CAAC,EAAE,CACf,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,KAC5B,IAAI,CAAA;QACT,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;KACzB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgIjB;;;;;OAKG;IACH,MAAM,IAAI,IAAI;IAMd;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ5B"}
1
+ {"version":3,"file":"syncController.d.ts","sourceRoot":"","sources":["../../src/storage/syncController.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAML,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAO3D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CA+BjD;AAED;;GAEG;AACH,qBAAa,cAAc;;IAazB;;;;;;OAMG;gBACS,EACV,WAAW,EACX,UAAU,EACV,IAAI,EACL,EAAE;QACD,WAAW,EAAE,mBAAmB,EAAE,CAAA;QAClC,UAAU,EAAE,eAAe,CAAA;QAC3B,IAAI,CAAC,EAAE,aAAa,CAAA;KACrB;IAMD;;;;;;;;;;;;;OAaG;IACG,KAAK,CAAC,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,WAAW,EACZ,EAAE;QACD,WAAW,EAAE,cAAc,CAAA;QAC3B,UAAU,EAAE,UAAU,CAAA;QACtB,cAAc,CAAC,EAAE,CACf,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,KAC5B,IAAI,CAAA;QACT,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;KACzB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgIjB;;;;;OAKG;IACH,MAAM,IAAI,IAAI;IAMd;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ5B"}
@@ -1,6 +1,5 @@
1
1
  import { createWasReplication, createWasSyncPort, withFeedMasterRead, WasSyncAuthError } from '../sync/index.js';
2
2
  import { DEFAULT_SYNC_POLL_MS } from '../config.js';
3
- import { useSyncStatusStore } from './syncStatusStore.js';
4
3
  /**
5
4
  * Whether a replication error signals expired/revoked storage access. Every WAS
6
5
  * request the replication makes funnels through the sync port, which maps a
@@ -48,13 +47,22 @@ export function isAuthError(err) {
48
47
  export class SyncController {
49
48
  #collections;
50
49
  #sync;
50
+ #syncStatus;
51
51
  #replications = [];
52
52
  #onlineHandler;
53
53
  #pollTimer;
54
54
  #started = false;
55
55
  #stopped = false;
56
- constructor({ collections, sync }) {
56
+ /**
57
+ * @param options {object}
58
+ * @param options.collections {WasCollectionConfig[]}
59
+ * @param options.syncStatus {SyncStatusStore} the session's per-collection
60
+ * status store this controller reports into
61
+ * @param [options.sync] {WasSyncConfig}
62
+ */
63
+ constructor({ collections, syncStatus, sync }) {
57
64
  this.#collections = collections;
65
+ this.#syncStatus = syncStatus;
58
66
  this.#sync = sync ?? {};
59
67
  }
60
68
  /**
@@ -79,7 +87,7 @@ export class SyncController {
79
87
  return;
80
88
  }
81
89
  this.#started = true;
82
- const setStatus = useSyncStatusStore.getState().setStatus;
90
+ const setStatus = this.#syncStatus.getState().setStatus;
83
91
  const batchSize = this.#sync.batchSize;
84
92
  const retryMs = this.#sync.retryMs;
85
93
  const pollMs = this.#sync.pollMs ?? DEFAULT_SYNC_POLL_MS;
@@ -211,7 +219,7 @@ export class SyncController {
211
219
  // bootstrap) sees the controller as terminally stopped and bails.
212
220
  this.#stopped = true;
213
221
  await this.#teardownReplications();
214
- useSyncStatusStore.getState().reset();
222
+ this.#syncStatus.getState().reset();
215
223
  this.#started = false;
216
224
  }
217
225
  }
@@ -1 +1 @@
1
- {"version":3,"file":"syncController.js","sourceRoot":"","sources":["../../src/storage/syncController.ts"],"names":[],"mappings":"AAgCA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAGjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,oBAAoB,EAGrB,MAAM,cAAc,CAA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AAc,CAAC,CAAA;YACzD,IAAI,CAAC,cAAc,GAAG,SAAS,CAAA;QACjC,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;YAC9B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;QAC7B,CAAC;QACD,KAAK,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YAC1D,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;gBACzC,YAAY,CAAC,WAAW,EAAE,CAAA;YAC5B,CAAC;YACD,IAAI,CAAC;gBACH,MAAM,KAAK,CAAC,MAAM,EAAE,CAAA;YACtB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,GAAG,CAAC,CAAA;YACrD,CAAC;QACH,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;IACzB,CAAC;IAED;;;;;OAKG;IACH,MAAM;QACJ,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YAC3C,KAAK,CAAC,MAAM,EAAE,CAAA;QAChB,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI;QACR,qEAAqE;QACrE,kEAAkE;QAClE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;QACpB,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAA;QAClC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAA;QACrC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;IACvB,CAAC;CACF"}
1
+ {"version":3,"file":"syncController.js","sourceRoot":"","sources":["../../src/storage/syncController.ts"],"names":[],"mappings":"AAgCA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAGjB,MAAM,kBAAk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 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The per-collection replication status store, mirroring the WAS per-replica
6
+ * sync-status vocabulary, keyed by the registry's logical collection key. One
7
+ * is created per {@link StorageContext} (so per session provider, never
8
+ * process-wide): the sync controller writes to it off the RxDB replication
9
+ * `active$` / `error$` streams, and `useSyncStatus` reads it through the
10
+ * provider. In-memory only, like the session -- reset on logout.
11
+ */
12
+ import { type StoreApi } from 'zustand/vanilla';
1
13
  /**
2
14
  * A single collection's replication status:
3
15
  * - `idle` -- configured but no cycle has run yet
@@ -6,7 +18,7 @@
6
18
  * - `error` -- last cycle failed (RxDB is backing off / will retry)
7
19
  */
8
20
  export type SyncStatus = 'idle' | 'syncing' | 'synced' | 'error';
9
- export declare const useSyncStatusStore: import("zustand").UseBoundStore<import("zustand").StoreApi<{
21
+ interface SyncStatusState {
10
22
  /**
11
23
  * Keyed by the registry's LOGICAL collection key (`WasCollectionConfig.key`,
12
24
  * e.g. `actionItems`), not the WAS wire id. Two registry entries may share one
@@ -17,7 +29,15 @@ export declare const useSyncStatusStore: import("zustand").UseBoundStore<import(
17
29
  statuses: Record<string, SyncStatus>;
18
30
  setStatus: (collectionKey: string, status: SyncStatus) => void;
19
31
  reset: () => void;
20
- }>>;
32
+ }
33
+ export type SyncStatusStore = StoreApi<SyncStatusState>;
34
+ /**
35
+ * Creates one session's sync status store (a vanilla zustand store; subscribe
36
+ * to it from React with zustand's `useStore`).
37
+ *
38
+ * @returns {SyncStatusStore}
39
+ */
40
+ export declare function createSyncStatusStore(): SyncStatusStore;
21
41
  /**
22
42
  * The aggregate replication status derived from the per-collection statuses:
23
43
  * `offline` when no replication is running (local-only), otherwise rolled up as
@@ -41,4 +61,5 @@ export declare function deriveSyncRollup(statuses: SyncStatus[]): {
41
61
  label: string;
42
62
  title: string;
43
63
  };
64
+ export {};
44
65
  //# sourceMappingURL=syncStatusStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"syncStatusStore.d.ts","sourceRoot":"","sources":["../../src/storage/syncStatusStore.ts"],"names":[],"mappings":"AAYA;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEhE,eAAO,MAAM,kBAAkB;IAC7B;;;;;;OAMG;cACO,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;eACzB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI;WACvD,MAAM,IAAI;GAQhB,CAAA;AAEH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAA;AAEnE;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG;IACxD,KAAK,EAAE,UAAU,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CA2BA"}
1
+ {"version":3,"file":"syncStatusStore.d.ts","sourceRoot":"","sources":["../../src/storage/syncStatusStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEhE,UAAU,eAAe;IACvB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACpC,SAAS,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;IAC9D,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAA;AAEvD;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,eAAe,CASvD;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAA;AAEnE;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG;IACxD,KAAK,EAAE,UAAU,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CA2BA"}
@@ -2,20 +2,29 @@
2
2
  * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
3
  */
4
4
  /**
5
- * Zustand store holding per-collection replication status, mirroring the WAS
6
- * per-replica sync-status vocabulary, keyed by the registry's logical collection
7
- * key. The sync controller writes to it off the RxDB replication `active$` /
8
- * `error$` streams; UI (e.g. a header indicator or a settings page) reads from
9
- * it. In-memory only, like the session -- cleared on logout.
5
+ * The per-collection replication status store, mirroring the WAS per-replica
6
+ * sync-status vocabulary, keyed by the registry's logical collection key. One
7
+ * is created per {@link StorageContext} (so per session provider, never
8
+ * process-wide): the sync controller writes to it off the RxDB replication
9
+ * `active$` / `error$` streams, and `useSyncStatus` reads it through the
10
+ * provider. In-memory only, like the session -- reset on logout.
10
11
  */
11
- import { create } from 'zustand';
12
- export const useSyncStatusStore = create()(set => ({
13
- statuses: {},
14
- setStatus: (collectionKey, status) => set(state => ({
15
- statuses: { ...state.statuses, [collectionKey]: status }
16
- })),
17
- reset: () => set({ statuses: {} })
18
- }));
12
+ import { createStore } from 'zustand/vanilla';
13
+ /**
14
+ * Creates one session's sync status store (a vanilla zustand store; subscribe
15
+ * to it from React with zustand's `useStore`).
16
+ *
17
+ * @returns {SyncStatusStore}
18
+ */
19
+ export function createSyncStatusStore() {
20
+ return createStore()(set => ({
21
+ statuses: {},
22
+ setStatus: (collectionKey, status) => set(state => ({
23
+ statuses: { ...state.statuses, [collectionKey]: status }
24
+ })),
25
+ reset: () => set({ statuses: {} })
26
+ }));
27
+ }
19
28
  /**
20
29
  * Rolls the per-collection replication statuses up to a single aggregate plus
21
30
  * its display copy. With no collections registered it reports `offline`
@@ -1 +1 @@
1
- {"version":3,"file":"syncStatusStore.js","sourceRoot":"","sources":["../../src/storage/syncStatusStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAWhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,EAWpC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACX,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,CACnC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACZ,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE;KACzD,CAAC,CAAC;IACL,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;CACnC,CAAC,CAAC,CAAA;AASH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAsB;IAKrD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,YAAY;YACnB,KAAK,EAAE,mDAAmD;SAC3D,CAAA;IACH,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,OAAO;YACL,KAAK,EAAE,OAAO;YACd,KAAK,EAAE,YAAY;YACnB,KAAK,EAAE,+DAA+D;SACvE,CAAA;IACH,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9D,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,sDAAsD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AQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9D,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,sDAAsD;SAC9D,CAAA;IACH,CAAC;IACD,OAAO;QACL,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,oDAAoD;KAC5D,CAAA;AACH,CAAC"}
@@ -120,10 +120,16 @@ export declare class WasRemoteStore {
120
120
  * Reads one collection's `encryption` descriptor from its Collection Description,
121
121
  * invoked with that collection's delegated zcap. Returns the
122
122
  * {@link CollectionEncryption} block (a multi-recipient descriptor carries key
123
- * epochs) or `undefined` when the collection carries no descriptor. Non-fatal like
124
- * the descriptor PUTs: returns `undefined` rather than throwing when no capability
125
- * covers the collection or the read fails (offline, unauthorized), so a caller
126
- * can fall back to its cached copy.
123
+ * epochs), or `undefined` only when the answer is genuinely "no descriptor":
124
+ * no capability covers the collection, the collection is not found (which is
125
+ * also how WAS answers an unauthorized read), or the description carries no
126
+ * `encryption` member.
127
+ *
128
+ * Any other failure (a dropped connection, a 5xx) is thrown, wrapped with
129
+ * the collection id. It must NOT read as "no descriptor": a caller that takes
130
+ * it for one opens the collection under the fail-closed placeholder cipher,
131
+ * and a correctly provisioned collection then fails its first write or
132
+ * decrypt for a network hiccup.
127
133
  *
128
134
  * @param collectionId {string} the WAS collection id
129
135
  * @returns {Promise<CollectionEncryption | undefined>}
@@ -138,9 +144,13 @@ export declare class WasRemoteStore {
138
144
  * NOT `Collection.meta()`: that one DECODES `custom` to plaintext, which
139
145
  * `applyMeta` cannot consume.
140
146
  *
141
- * Non-fatal like the descriptor read: answers `undefined` rather than
142
- * throwing when no capability covers the collection, the read is unauthorized,
143
- * the app is offline, or the backend has no metadata support.
147
+ * Answers `undefined` for exactly the outcomes that mean "no metadata": no
148
+ * capability covers the collection, the read answered not-found (which is
149
+ * also how WAS answers an unauthorized read), or the backend has no metadata
150
+ * support (`501`). Any other failure is thrown, wrapped with the collection
151
+ * id, like {@link readCollectionEncryption}: a dropped connection is an
152
+ * unknown answer, not an absent one, and a caller that took it for "no
153
+ * schema" would skip the blinded-index install over a guess.
144
154
  *
145
155
  * @param collectionId {string} the WAS collection id
146
156
  * @returns {Promise<{ custom?: unknown } | undefined>}
@@ -301,9 +311,13 @@ export declare class WasRemoteStore {
301
311
  * Deliberately NOT `wasDescriptorSource` from the same subpath: that one
302
312
  * describes through the client's root capability, which a relying-party app
303
313
  * never holds. Every read here must invoke the per-collection grant, which is
304
- * exactly what {@link WasRemoteStore.readCollectionEncryption} does (and, like
305
- * the rest of the descriptor plumbing, it answers `undefined` rather than
306
- * throwing when the read is unauthorized or the app is offline).
314
+ * exactly what {@link WasRemoteStore.readCollectionEncryption} does.
315
+ *
316
+ * A read that fails for a transient reason is warned about and answered as
317
+ * `undefined` here: the refresh guard is already spent by the time the source
318
+ * is consulted, so the decrypt retry fails the same way it would under no
319
+ * refresh at all, and the caller sees the envelope's own unknown-epoch error
320
+ * rather than a network one.
307
321
  *
308
322
  * @param options {object}
309
323
  * @param options.remoteStore {WasRemoteStore}
@@ -1 +1 @@
1
- {"version":3,"file":"wasRemoteStore.d.ts","sourceRoot":"","sources":["../../src/storage/wasRemoteStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACN,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;AASlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,KAAK,EAAE,Y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