@spooky-sync/core 0.0.1-canary.155 → 0.0.1-canary.157

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/src/types.ts CHANGED
@@ -162,6 +162,29 @@ export interface Sp00kyConfig<S extends SchemaStructure> {
162
162
  * Inspect via `window.__00__.getState().database.tabs` and `__sqliteStats`.
163
163
  */
164
164
  sharedTabs?: boolean;
165
+ /**
166
+ * Persist the in-browser SSP circuit (store + view caches) as a snapshot so a
167
+ * reload can restore it instead of re-materializing. Default `false`, and
168
+ * that default is deliberate.
169
+ *
170
+ * The circuit is DERIVED state: the durable local store (OPFS SQLite) is the
171
+ * source of truth, and every first paint already reads row bodies from it
172
+ * (`DataManager.createNewQuery` / `materializeRecords`) using the circuit only
173
+ * for row identity and ordering. A snapshot buys nothing on reload while
174
+ * costing a full deep clone of every row of every ingested table plus a JSON
175
+ * encode of the result, `Circuit::save` in the Rust core, mirroring the
176
+ * server's rule in `ssp-node`: *never per-ingest*.
177
+ *
178
+ * When enabled, snapshots are written on a checkpoint interval
179
+ * ({@link circuitCheckpointMs}) and on `pagehide`, never per ingest or per
180
+ * query registration. Enable only for a workload that has measured a win.
181
+ */
182
+ persistCircuit?: boolean;
183
+ /**
184
+ * Checkpoint interval in milliseconds for {@link persistCircuit}. Defaults to
185
+ * 30000. Ignored when `persistCircuit` is off.
186
+ */
187
+ circuitCheckpointMs?: number;
165
188
  /** A pino browser transmit object for forwarding logs (e.g. via @spooky-sync/core/otel). */
166
189
  otelTransmit?: PinoTransmit;
167
190
  /**