@pgxsinkit/client 0.2.7 → 0.5.0

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 (153) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE-APACHE-2.0 +202 -0
  3. package/NOTICE +81 -0
  4. package/README.md +11 -3
  5. package/dist/boot-report.d.ts +11 -8
  6. package/dist/boot-report.d.ts.map +1 -1
  7. package/dist/circuits/envelope-to-change.d.ts +39 -0
  8. package/dist/circuits/envelope-to-change.d.ts.map +1 -0
  9. package/dist/circuits/group-sync.d.ts +123 -0
  10. package/dist/circuits/group-sync.d.ts.map +1 -0
  11. package/dist/circuits/shape-group.d.ts +77 -0
  12. package/dist/circuits/shape-group.d.ts.map +1 -0
  13. package/dist/circuits/stream-inbox.d.ts +126 -0
  14. package/dist/circuits/stream-inbox.d.ts.map +1 -0
  15. package/dist/circuits/stream-source.d.ts +96 -0
  16. package/dist/circuits/stream-source.d.ts.map +1 -0
  17. package/dist/circuits/subscription-client.d.ts +143 -0
  18. package/dist/circuits/subscription-client.d.ts.map +1 -0
  19. package/dist/circuits/sync-engine.d.ts +131 -0
  20. package/dist/circuits/sync-engine.d.ts.map +1 -0
  21. package/dist/debug.d.ts +0 -10
  22. package/dist/debug.d.ts.map +1 -1
  23. package/dist/event-lane.d.ts +32 -1
  24. package/dist/event-lane.d.ts.map +1 -1
  25. package/dist/export-data.d.ts +3 -3
  26. package/dist/export-dump.d.ts +9 -9
  27. package/dist/export-dump.d.ts.map +1 -1
  28. package/dist/export-store.d.ts +13 -13
  29. package/dist/index.d.ts +237 -113
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +7037 -6665
  32. package/dist/index.js.map +46 -43
  33. package/dist/local-store.d.ts +1 -1
  34. package/dist/local-store.d.ts.map +1 -1
  35. package/dist/local-tables.d.ts +59 -1
  36. package/dist/local-tables.d.ts.map +1 -1
  37. package/dist/mutation.d.ts +2 -2
  38. package/dist/mutation.d.ts.map +1 -1
  39. package/dist/mutations-api.d.ts.map +1 -1
  40. package/dist/opfs-effects.d.ts +30 -2
  41. package/dist/opfs-effects.d.ts.map +1 -1
  42. package/dist/schema.d.ts +12 -1
  43. package/dist/schema.d.ts.map +1 -1
  44. package/dist/store-boot.d.ts +30 -2
  45. package/dist/store-boot.d.ts.map +1 -1
  46. package/dist/store-build.d.ts +19 -0
  47. package/dist/store-build.d.ts.map +1 -0
  48. package/dist/store-engine.d.ts +22 -0
  49. package/dist/store-engine.d.ts.map +1 -0
  50. package/dist/store-meta.d.ts +29 -3
  51. package/dist/store-meta.d.ts.map +1 -1
  52. package/dist/store-ownership-lock.d.ts +33 -0
  53. package/dist/store-ownership-lock.d.ts.map +1 -0
  54. package/dist/store-path.d.ts +40 -28
  55. package/dist/store-path.d.ts.map +1 -1
  56. package/dist/sync/apply.d.ts +17 -25
  57. package/dist/sync/apply.d.ts.map +1 -1
  58. package/dist/sync/copy.d.ts +84 -8
  59. package/dist/sync/copy.d.ts.map +1 -1
  60. package/dist/sync/drizzle-executor.d.ts +4 -4
  61. package/dist/sync/drizzle-executor.d.ts.map +1 -1
  62. package/dist/sync/fold.d.ts +40 -0
  63. package/dist/sync/fold.d.ts.map +1 -0
  64. package/dist/sync/metadata-tables.d.ts +25 -1
  65. package/dist/sync/metadata-tables.d.ts.map +1 -1
  66. package/dist/sync/subscription-state.d.ts +26 -7
  67. package/dist/sync/subscription-state.d.ts.map +1 -1
  68. package/dist/sync/types.d.ts +9 -129
  69. package/dist/sync/types.d.ts.map +1 -1
  70. package/dist/testing.d.ts +1 -1
  71. package/dist/testing.js +4 -3
  72. package/dist/testing.js.map +4 -4
  73. package/dist/worker/attach-sync-client.d.ts +27 -14
  74. package/dist/worker/attach-sync-client.d.ts.map +1 -1
  75. package/dist/worker/define-sync-worker.d.ts +52 -19
  76. package/dist/worker/define-sync-worker.d.ts.map +1 -1
  77. package/dist/worker/engine-control.d.ts +53 -0
  78. package/dist/worker/engine-control.d.ts.map +1 -1
  79. package/dist/worker/live-query-manager.d.ts +3 -3
  80. package/dist/worker/live-query-manager.d.ts.map +1 -1
  81. package/dist/worker/live-query-params-guard.d.ts +5 -5
  82. package/dist/worker/protocol.d.ts +26 -7
  83. package/dist/worker/protocol.d.ts.map +1 -1
  84. package/package.json +11 -9
  85. package/skills/core/SKILL.md +145 -63
  86. package/skills/operating/SKILL.md +221 -221
  87. package/skills/operating/references/postgres-builds.md +48 -0
  88. package/src/boot-report.ts +13 -12
  89. package/src/circuits/envelope-to-change.ts +211 -0
  90. package/src/circuits/group-sync.ts +1047 -0
  91. package/src/circuits/shape-group.ts +158 -0
  92. package/src/circuits/stream-inbox.ts +225 -0
  93. package/src/circuits/stream-source.ts +191 -0
  94. package/src/circuits/subscription-client.ts +353 -0
  95. package/src/circuits/sync-engine.ts +643 -0
  96. package/src/debug.ts +1 -85
  97. package/src/event-lane.ts +132 -14
  98. package/src/export-data.ts +4 -4
  99. package/src/export-dump.ts +24 -28
  100. package/src/export-store.ts +17 -17
  101. package/src/index.ts +797 -544
  102. package/src/lazy-guard.ts +1 -1
  103. package/src/live-rows-sql.ts +1 -1
  104. package/src/local-store.ts +2 -2
  105. package/src/local-tables.ts +76 -5
  106. package/src/mutation.ts +9 -8
  107. package/src/mutations-api.ts +2 -2
  108. package/src/opfs-effects.ts +74 -10
  109. package/src/schema.ts +126 -29
  110. package/src/store-boot.ts +71 -7
  111. package/src/store-build.ts +37 -0
  112. package/src/store-engine.ts +94 -0
  113. package/src/store-lifecycle.ts +1 -1
  114. package/src/store-meta.ts +155 -4
  115. package/src/store-ownership-lock.ts +109 -0
  116. package/src/store-path.ts +56 -40
  117. package/src/sync/apply.ts +104 -156
  118. package/src/sync/copy.ts +116 -21
  119. package/src/sync/drizzle-executor.ts +13 -14
  120. package/src/sync/fold.ts +94 -0
  121. package/src/sync/metadata-tables.ts +43 -2
  122. package/src/sync/subscription-state.ts +28 -10
  123. package/src/sync/types.ts +13 -141
  124. package/src/testing.ts +4 -4
  125. package/src/worker/attach-sync-client.ts +150 -57
  126. package/src/worker/define-sync-worker.ts +325 -87
  127. package/src/worker/engine-control.ts +89 -0
  128. package/src/worker/engine-router.ts +1 -1
  129. package/src/worker/live-query-fingerprint.ts +4 -4
  130. package/src/worker/live-query-manager.ts +12 -12
  131. package/src/worker/live-query-params-guard.ts +10 -10
  132. package/src/worker/protocol.ts +38 -7
  133. package/dist/read-stream-stall.d.ts +0 -54
  134. package/dist/read-stream-stall.d.ts.map +0 -1
  135. package/dist/shape-sync.d.ts +0 -207
  136. package/dist/shape-sync.d.ts.map +0 -1
  137. package/dist/sync/index.d.ts +0 -32
  138. package/dist/sync/index.d.ts.map +0 -1
  139. package/dist/sync/nudge.d.ts +0 -49
  140. package/dist/sync/nudge.d.ts.map +0 -1
  141. package/dist/sync/shape-inbox.d.ts +0 -215
  142. package/dist/sync/shape-inbox.d.ts.map +0 -1
  143. package/dist/sync/tags.d.ts +0 -142
  144. package/dist/sync/tags.d.ts.map +0 -1
  145. package/dist/sync-auth.d.ts +0 -53
  146. package/dist/sync-auth.d.ts.map +0 -1
  147. package/src/read-stream-stall.ts +0 -102
  148. package/src/shape-sync.ts +0 -533
  149. package/src/sync/index.ts +0 -1124
  150. package/src/sync/nudge.ts +0 -110
  151. package/src/sync/shape-inbox.ts +0 -566
  152. package/src/sync/tags.ts +0 -390
  153. package/src/sync-auth.ts +0 -117
@@ -18,9 +18,15 @@
18
18
  * client-side quarantine (ADR-0053 decision 4): terminal deletion happens only on `acked`/`refused`/
19
19
  * `rejected`. A batch that keeps failing backs off at a ceiling, observably, while the Outbox keeps
20
20
  * absorbing appends — it is designed to hold offline weeks.
21
+ *
22
+ * ADR-0060 adds one wrinkle to that second invariant's `acked` half: with `events.ackedRetentionMs > 0` an
23
+ * acked row is STAMPED (`acked_at_us`) and retained for the retention rather than deleted at once, so a
24
+ * best-guess view can keep counting it across the ack→fold→sync window. It is a delayed delete, not a
25
+ * changed verdict — a stamped row is no longer PENDING anywhere in this file (assembly skips it, the drain
26
+ * signal ignores it), and the sweep retires it.
21
27
  */
22
28
  import { type EventAckStatus, type SyncTableRegistry } from "@pgxsinkit/contracts";
23
- /** The raw local-store seam the Event lane executes through (structurally PGlite; mirrors `MutationDb`). */
29
+ /** The raw local-store seam the Event lane executes through (structurally pgwasm; mirrors `MutationDb`). */
24
30
  export interface EventLaneDb {
25
31
  query: <TRow extends Record<string, unknown> = Record<string, unknown>>(sql: string, params?: unknown[]) => Promise<{
26
32
  rows: TRow[];
@@ -77,6 +83,28 @@ export interface EventLaneOptions {
77
83
  intervalMs?: number;
78
84
  /** Backoff tuning for deferred rows and for batch-level faults. */
79
85
  backoff?: EventBackoffOptions;
86
+ /**
87
+ * How long an **acked** row is RETAINED in the Outbox after the server accepts it, in ms (ADR-0060).
88
+ * Defaults to `0`.
89
+ *
90
+ * `0` is exactly the lane's original behaviour: an `acked` verdict DELETES the row on the spot, in the
91
+ * same statement that retires the terminal `refused`/`rejected` ones — no stamp, no sweep, no added cost
92
+ * on the default path. Anything greater turns on the **acked ledger**: the row stays, stamped with
93
+ * `acked_at_us`, until a sweep retires it that many ms later.
94
+ *
95
+ * It exists for ONE consumer shape — a best-guess view composing pending Outbox rows with down-synced
96
+ * aggregates. The server accepts an event well BEFORE its consumer folds it, and the folded row syncs
97
+ * back down later still, so a composition that drops the event at the ack dips for the whole ack→fold→sync
98
+ * window. With a retention the acked row is still there to be counted during it. The library takes no
99
+ * position on when the fold landed (it cannot know); the view keeps the row until its own synced value
100
+ * accounts for it, and the retention is the backstop.
101
+ *
102
+ * Retained rows are NOT pending: they are invisible to batch assembly (never re-posted), to the drain
103
+ * signal `{ empty }`, to `diagnostics().outbox`, and to the non-forced `destroy()` refusal. Size it to
104
+ * the deployment's ack→fold→sync latency plus margin, not to "how long I want the history" — the Outbox
105
+ * is not an archive.
106
+ */
107
+ ackedRetentionMs?: number;
80
108
  /** Per-Event-stream overrides, keyed by Event-stream name. */
81
109
  streams?: Record<string, EventStreamFlushOptions>;
82
110
  }
@@ -93,6 +121,9 @@ export interface EventAppendResult {
93
121
  * The **drain signal** (ADR-0053 decision 2): whether the Outbox is empty. Deliberately no count — a count
94
122
  * that updates only on transitions is stale by construction, and a count updated per append is a worse live
95
123
  * query. Richer detail is a query against the Outbox table.
124
+ *
125
+ * "Empty" is "nothing AWAITS A SERVER VERDICT", so acked rows the ledger is retaining (ADR-0060) do not
126
+ * hold it `false` — they have had their verdict.
96
127
  */
97
128
  export interface OutboxStatus {
98
129
  empty: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"event-lane.d.ts","sourceRoot":"","sources":["../src/event-lane.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EAUL,KAAK,cAAc,EAGnB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAK9B,4GAA4G;AAC5G,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAAE,KACf,OAAO,CAAC;QAAE,IAAI,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC,CAAC;CAChC;AAED,yHAAyH;AACzH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C;;;GAGG;AACH,eAAO,MAAM,+BAA+B,OAAQ,CAAC;AACrD,gGAAgG;AAChG,eAAO,MAAM,6BAA6B,OAAQ,CAAC;AACnD;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,SAAU,CAAC;AAExD,2GAA2G;AAC3G,MAAM,WAAW,mBAAmB;IAClC,+FAA+F;IAC/F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,0GAA0G;AAC1G,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;O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,MAAM,IAAI,CAAC;IAClB,uGAAuG;IACvG,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,+FAA+F;IAC/F,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,CA2EzF"}
@@ -1,6 +1,6 @@
1
1
  import type { MutationDiagnostics } from "@pgxsinkit/contracts";
2
2
  import { type DataExportReport } from "./export-store";
3
- import type { ClientPGlite } from "./index";
3
+ import type { PgwasmClient } from "./index";
4
4
  /** The default drain budget: actively flush + await the convergence barrier for up to 15s before failing. */
5
5
  export declare const DEFAULT_DRAIN_TIMEOUT_MS = 15000;
6
6
  /** The drain guard's tuning: the wait budget for reaching a fully-drained journal. */
@@ -61,7 +61,7 @@ export declare class DataExportDrainError extends Error {
61
61
  /** The dependencies {@link performDataExport} needs from the owning client — narrow, so it is unit-testable. */
62
62
  export interface DataExportDeps {
63
63
  /** The live store to checkpoint and dump (the clone source; the live engine is never suspended). */
64
- pglite: Pick<ClientPGlite, "exec" | "dumpDataDir">;
64
+ pgwasm: Pick<PgwasmClient, "exec" | "dumpDataDir">;
65
65
  /** The Mutation diagnostics seam (`client.diagnostics().mutation` / `readMutationStats`). */
66
66
  readMutationStats: () => Promise<MutationDiagnostics>;
67
67
  /** The optimistic flush (`client.flush()`), driven during the drain to send drainable rows. */
@@ -84,7 +84,7 @@ export interface DataExportDeps {
84
84
  cloneCleanupSql: string;
85
85
  /**
86
86
  * The store's configured plain store PATH (ADR-0036) — reduced to the `storeId` in the default artefact
87
- * file name. The resolved PGlite dataDir URL is deliberately NOT used: internal plumbing, never an
87
+ * file name. The resolved pgwasm dataDir URL is deliberately NOT used: internal plumbing, never an
88
88
  * artefact-name seed.
89
89
  */
90
90
  storePath?: string;
@@ -1,7 +1,7 @@
1
- import { PGlite } from "@electric-sql/pglite";
2
1
  import type { MutationDiagnostics } from "@pgxsinkit/contracts";
2
+ import { type Pgwasm } from "@pgxsinkit/pgwasm";
3
3
  import { type DiagnosticDumpReport } from "./export-store";
4
- import type { ClientPGlite } from "./index";
4
+ import type { PgwasmClient } from "./index";
5
5
  /** Options for {@link SyncClient.exportDiagnostics}. */
6
6
  export interface DiagnosticExportOptions {
7
7
  /**
@@ -21,12 +21,12 @@ export interface DiagnosticExportResult {
21
21
  /** The dependencies {@link performDiagnosticExport} needs from the owning client — narrow, so it is unit-testable. */
22
22
  export interface DiagnosticExportDeps {
23
23
  /** The live store to checkpoint and dump (the clone source; the live engine is never suspended). */
24
- pglite: Pick<ClientPGlite, "exec" | "dumpDataDir">;
24
+ pglite: Pick<PgwasmClient, "exec" | "dumpDataDir">;
25
25
  /** The Mutation diagnostics seam (`client.diagnostics().mutation` / `readMutationStats`). */
26
26
  readMutationStats: () => Promise<MutationDiagnostics>;
27
27
  /**
28
28
  * The store's configured plain store PATH (ADR-0036) — reduced to the `storeId` in the default artefact
29
- * file name. The resolved PGlite dataDir URL is deliberately NOT used: it is internal plumbing and must
29
+ * file name. The resolved pgwasm dataDir URL is deliberately NOT used: it is internal plumbing and must
30
30
  * not leak into an artefact name as something to imitate.
31
31
  */
32
32
  storePath?: string;
@@ -41,7 +41,7 @@ export interface CloneDumpPhases {
41
41
  checkpointStartedAtMs: number;
42
42
  /** `CHECKPOINT` wall — flushing dirty buffers before the internal datadir dump the clone consumes. */
43
43
  checkpointMs: number;
44
- /** Offset from `startPerf` when the throwaway clone's `PGlite.create({ loadDataDir })` began. */
44
+ /** Offset from `startPerf` when the throwaway clone's `pgwasm.create({ loadDataDir })` began. */
45
45
  cloneBootStartedAtMs: number;
46
46
  /** Clone boot wall — booting the memory-backed throwaway from the internal dump. */
47
47
  cloneBootMs: number;
@@ -60,14 +60,14 @@ export interface CloneDumpResult {
60
60
  /**
61
61
  * The throwaway-clone dump core shared by BOTH `pgDump` exports (ADR-0035 addendum): (1) a LIVE datadir dump
62
62
  * of the running store (`compression: "none"` — the clone consumes the bytes immediately, so gzip+gunzip is
63
- * pure waste); (2) a memory-backed THROWAWAY PGlite booted from it via `loadDataDir` — engine-less, no
63
+ * pure waste); (2) a memory-backed THROWAWAY pgwasm booted from it via `loadDataDir` — engine-less, no
64
64
  * `live` extension, nothing `pg_dump`'s `DEALLOCATE ALL` can corrupt; (3) `pg_dump` against the throwaway
65
65
  * with the caller's `args` (none for a diagnostic dump; the `-t` allowlist + `--no-owner` for a data
66
66
  * export); (4) discard the clone in a `finally`. Factored out so `performDiagnosticExport` and
67
67
  * `performDataExport` cannot drift on the clone plumbing, the memory-scheme selection, or the timing house
68
68
  * style — the ONLY differences between the two dumps are the `pg_dump` args and the artefact assembly.
69
69
  *
70
- * `@electric-sql/pglite-tools` is loaded ONLY via the dynamic `import()` here (ADR-0035 decision 7): its
70
+ * `@pgxsinkit/pgwasm-pg-dump` is loaded ONLY via the dynamic `import()` here (ADR-0035 decision 7): its
71
71
  * ~700 kB `pg_dump.wasm` (+ ~100 kB JS) stays off boot and off every non-exporting bundle.
72
72
  */
73
73
  export interface CloneDumpOptions {
@@ -79,9 +79,9 @@ export interface CloneDumpOptions {
79
79
  * triggers `pg_dump -t` would otherwise pull into the artefact (see `buildDataExportCloneCleanupSql`); a
80
80
  * diagnostic dump passes none (it wants the store verbatim).
81
81
  */
82
- prepareClone?: (clone: PGlite) => Promise<void>;
82
+ prepareClone?: (clone: Pgwasm) => Promise<void>;
83
83
  }
84
- export declare function runThrowawayCloneDump(pglite: Pick<ClientPGlite, "exec" | "dumpDataDir">, startPerf: number, options?: CloneDumpOptions): Promise<CloneDumpResult>;
84
+ export declare function runThrowawayCloneDump(pglite: Pick<PgwasmClient, "exec" | "dumpDataDir">, startPerf: number, options?: CloneDumpOptions): Promise<CloneDumpResult>;
85
85
  /**
86
86
  * Run a diagnostic dump (ADR-0035): live datadir dump → memory-backed throwaway clone → `pg_dump` → discard
87
87
  * the clone → assemble the report. The caller (`createSyncClient`) awaits engine-ready and enters the
@@ -1 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uB,CAC3C,IAAI,EAAE,oBAAoB,EAC1B,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,sBAAsB,CAAC,CA+BjC"}
@@ -1,5 +1,5 @@
1
1
  import type { MutationDiagnostics } from "@pgxsinkit/contracts";
2
- import type { ClientPGlite } from "./index";
2
+ import type { PgwasmClient } from "./index";
3
3
  /**
4
4
  * Monotonic clock (ms) — `performance.now()` where available, else `Date.now()` (mirrors BootReport).
5
5
  * Exported so the sibling diagnostic-dump path ({@link file://./export-dump.ts}) times its extra phases
@@ -9,7 +9,7 @@ export declare const nowMs: () => number;
9
9
  /** Options for {@link SyncClient.exportStore}. */
10
10
  export interface StoreExportOptions {
11
11
  /**
12
- * How to compress the tarball, forwarded to PGlite's `dumpDataDir`. `"auto"` (the default) gzips when a
12
+ * How to compress the tarball, forwarded to pgwasm's `dumpDataDir`. `"auto"` (the default) gzips when a
13
13
  * `CompressionStream` is available and falls back to an uncompressed tar otherwise; `"gzip"` forces
14
14
  * compression; `"none"` skips it. The report's `compression` records the compression that was actually
15
15
  * applied (which, under `"auto"`, is resolved at runtime).
@@ -44,7 +44,7 @@ export interface ExportReportCommon {
44
44
  diagnostics: MutationDiagnostics;
45
45
  }
46
46
  /**
47
- * A live **store backup** (ADR-0035): the whole datadir as a PGlite-restorable tarball, journal and overlay
47
+ * A live **store backup** (ADR-0035): the whole datadir as a pgwasm-restorable tarball, journal and overlay
48
48
  * included. `checkpoint`/`dump` are the only phases — a store backup is a `CHECKPOINT` + `dumpDataDir`, no
49
49
  * clone. Slice-1 shape, kept unchanged (the union is additive).
50
50
  */
@@ -70,7 +70,7 @@ export interface StoreBackupReport extends ExportReportCommon {
70
70
  * A **diagnostic dump** (ADR-0035, via the throwaway clone of the addendum): human-readable SQL of
71
71
  * EVERYTHING the store holds — synced tables, the `_overlay`/`_mutations` journal, the `pgxsinkit` metadata
72
72
  * schema, the read-model views, and the reconcile functions/triggers. It is a live datadir dump (checkpoint
73
- * + `dumpDataDir`) fed into a memory-backed throwaway PGlite via `loadDataDir`, against which `pg_dump` runs
73
+ * + `dumpDataDir`) fed into a memory-backed throwaway pgwasm via `loadDataDir`, against which `pg_dump` runs
74
74
  * — so the live engine is never touched (the addendum's whole point). Its phases add the clone boot and the
75
75
  * `pg_dump` walls to the shared checkpoint/dump pair.
76
76
  */
@@ -87,7 +87,7 @@ export interface DiagnosticDumpReport extends ExportReportCommon {
87
87
  dumpStartedAtMs: number;
88
88
  /** `dumpDataDir` wall — the uncompressed internal tarball the throwaway clone boots from (`compression: "none"`). */
89
89
  dumpMs: number;
90
- /** Offset from export start when the throwaway clone's `PGlite.create({ loadDataDir })` began. */
90
+ /** Offset from export start when the throwaway clone's `pgwasm.create({ loadDataDir })` began. */
91
91
  cloneBootStartedAtMs: number;
92
92
  /** Clone boot wall — booting the memory-backed throwaway from the internal dump. */
93
93
  cloneBootMs: number;
@@ -135,7 +135,7 @@ export interface DataExportReport extends ExportReportCommon {
135
135
  dumpStartedAtMs: number;
136
136
  /** `dumpDataDir` wall — the uncompressed internal tarball the throwaway clone boots from (`compression: "none"`). */
137
137
  dumpMs: number;
138
- /** Offset from export start when the throwaway clone's `PGlite.create({ loadDataDir })` began. */
138
+ /** Offset from export start when the throwaway clone's `pgwasm.create({ loadDataDir })` began. */
139
139
  cloneBootStartedAtMs: number;
140
140
  /** Clone boot wall — booting the memory-backed throwaway from the internal dump. */
141
141
  cloneBootMs: number;
@@ -154,14 +154,14 @@ export interface DataExportReport extends ExportReportCommon {
154
154
  export type ExportReport = StoreBackupReport | DiagnosticDumpReport | DataExportReport;
155
155
  /** The artefact + its report — the resolved value of {@link SyncClient.exportStore}. */
156
156
  export interface StoreExportResult {
157
- /** The store-backup tarball as a named `File`, restorable by PGlite via `loadDataDir`. */
157
+ /** The store-backup tarball as a named `File`, restorable by pgwasm via `loadDataDir`. */
158
158
  file: File;
159
159
  /** The structured record of the export (ADR-0035). */
160
160
  report: StoreBackupReport;
161
161
  }
162
162
  /**
163
163
  * Reduce a plain store PATH (ADR-0036) to a filesystem-safe token for the backup file name. Takes the
164
- * path's LAST segment (as PGlite's own `dumpDataDir` does when it names the inner db), then keeps only
164
+ * path's LAST segment (as pgwasm's own `dumpDataDir` does when it names the inner db), then keeps only
165
165
  * `[A-Za-z0-9._-]`. No scheme stripping — the store path is a plain name, never a storage URL. Falls back
166
166
  * to a fixed token for an empty path so the name is always well formed.
167
167
  */
@@ -180,12 +180,12 @@ export declare const compactTimestamp: () => string;
180
180
  * (the caller's export-start monotonic anchor) so the timings compose into either report.
181
181
  *
182
182
  * The `CHECKPOINT` is a utility statement — Drizzle has no builder for it, so a raw `exec` is the justified
183
- * tier-③ form here. Running it via `pglite.exec` serialises it behind any in-flight engine work on PGlite's
183
+ * tier-③ form here. Running it via `pglite.exec` serialises it behind any in-flight engine work on pgwasm's
184
184
  * single connection, flushing dirty buffers to the datadir the dump then reads — so the tarball reflects
185
185
  * committed state, not a torn mid-write datadir.
186
186
  */
187
- export declare function performDatadirDump(pglite: Pick<ClientPGlite, "exec" | "dumpDataDir">, compression: "auto" | "gzip" | "none", startPerf: number): Promise<{
188
- dumped: Awaited<ReturnType<ClientPGlite["dumpDataDir"]>>;
187
+ export declare function performDatadirDump(pglite: Pick<PgwasmClient, "exec" | "dumpDataDir">, compression: "auto" | "gzip" | "none", startPerf: number): Promise<{
188
+ dumped: Awaited<ReturnType<PgwasmClient["dumpDataDir"]>>;
189
189
  checkpointStartedAtMs: number;
190
190
  checkpointMs: number;
191
191
  dumpStartedAtMs: number;
@@ -194,12 +194,12 @@ export declare function performDatadirDump(pglite: Pick<ClientPGlite, "exec" | "
194
194
  /** The dependencies {@link performStoreExport} needs from the owning client — narrow, so it is unit-testable. */
195
195
  export interface StoreExportDeps {
196
196
  /** The live store to checkpoint and dump. */
197
- pglite: Pick<ClientPGlite, "exec" | "dumpDataDir">;
197
+ pglite: Pick<PgwasmClient, "exec" | "dumpDataDir">;
198
198
  /** The Mutation diagnostics seam (`client.diagnostics().mutation` / `readMutationStats`). */
199
199
  readMutationStats: () => Promise<MutationDiagnostics>;
200
200
  /**
201
201
  * The store's configured plain store PATH (ADR-0036) — reduced to the `storeId` in the default backup
202
- * file name (`deriveStoreId`). The resolved PGlite dataDir URL is deliberately NOT used here: it is
202
+ * file name (`deriveStoreId`). The resolved pgwasm dataDir URL is deliberately NOT used here: it is
203
203
  * internal plumbing and must not leak into an artefact name as something to imitate.
204
204
  */
205
205
  storePath?: string;