@superbee/core 0.1.6 → 0.2.0-pre.10

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 (248) hide show
  1. package/README.md +127 -0
  2. package/dist/artifact-contract.d.ts +90 -0
  3. package/dist/artifact-contract.d.ts.map +1 -0
  4. package/dist/artifact-contract.js +205 -0
  5. package/dist/artifact-contract.js.map +1 -0
  6. package/dist/backend.d.ts +16 -1
  7. package/dist/backend.d.ts.map +1 -1
  8. package/dist/backend.js +112 -47
  9. package/dist/backend.js.map +1 -1
  10. package/dist/bundle-ops.d.ts +42 -0
  11. package/dist/bundle-ops.d.ts.map +1 -0
  12. package/dist/bundle-ops.js +88 -0
  13. package/dist/bundle-ops.js.map +1 -0
  14. package/dist/bundle.d.ts +10 -28
  15. package/dist/bundle.d.ts.map +1 -1
  16. package/dist/bundle.js +12 -69
  17. package/dist/bundle.js.map +1 -1
  18. package/dist/document-codec.d.ts +6 -1
  19. package/dist/document-codec.d.ts.map +1 -1
  20. package/dist/document-codec.js +8 -4
  21. package/dist/document-codec.js.map +1 -1
  22. package/dist/document-field-actions.d.ts +107 -0
  23. package/dist/document-field-actions.d.ts.map +1 -0
  24. package/dist/document-field-actions.js +302 -0
  25. package/dist/document-field-actions.js.map +1 -0
  26. package/dist/document-mutation.d.ts +61 -3
  27. package/dist/document-mutation.d.ts.map +1 -1
  28. package/dist/document-mutation.js +116 -25
  29. package/dist/document-mutation.js.map +1 -1
  30. package/dist/document-write-policy.d.ts +0 -1
  31. package/dist/document-write-policy.d.ts.map +1 -1
  32. package/dist/document-write-policy.js +7 -4
  33. package/dist/document-write-policy.js.map +1 -1
  34. package/dist/engine.d.ts +3 -1
  35. package/dist/engine.d.ts.map +1 -1
  36. package/dist/engine.js +6 -4
  37. package/dist/engine.js.map +1 -1
  38. package/dist/file-journaled-backend-internal.d.ts +19 -0
  39. package/dist/file-journaled-backend-internal.d.ts.map +1 -0
  40. package/dist/file-journaled-backend-internal.js +10 -0
  41. package/dist/file-journaled-backend-internal.js.map +1 -0
  42. package/dist/file-journaled-backend.d.ts +162 -0
  43. package/dist/file-journaled-backend.d.ts.map +1 -0
  44. package/dist/file-journaled-backend.js +1113 -0
  45. package/dist/file-journaled-backend.js.map +1 -0
  46. package/dist/filesystem-host.d.ts +15 -0
  47. package/dist/filesystem-host.d.ts.map +1 -0
  48. package/dist/filesystem-host.js +20 -0
  49. package/dist/filesystem-host.js.map +1 -0
  50. package/dist/filesystem-identity.d.ts +86 -4
  51. package/dist/filesystem-identity.d.ts.map +1 -1
  52. package/dist/filesystem-identity.js +338 -102
  53. package/dist/filesystem-identity.js.map +1 -1
  54. package/dist/filesystem-lock.d.ts +16 -3
  55. package/dist/filesystem-lock.d.ts.map +1 -1
  56. package/dist/filesystem-lock.js +323 -77
  57. package/dist/filesystem-lock.js.map +1 -1
  58. package/dist/filesystem-push-role.d.ts +77 -0
  59. package/dist/filesystem-push-role.d.ts.map +1 -0
  60. package/dist/filesystem-push-role.js +165 -0
  61. package/dist/filesystem-push-role.js.map +1 -0
  62. package/dist/filesystem.d.ts +17 -0
  63. package/dist/filesystem.d.ts.map +1 -0
  64. package/dist/filesystem.js +18 -0
  65. package/dist/filesystem.js.map +1 -0
  66. package/dist/freshness.d.ts +10 -7
  67. package/dist/freshness.d.ts.map +1 -1
  68. package/dist/freshness.js +14 -11
  69. package/dist/freshness.js.map +1 -1
  70. package/dist/frontmatter-contract.d.ts +2 -2
  71. package/dist/frontmatter-contract.js +2 -2
  72. package/dist/frontmatter.d.ts +11 -1
  73. package/dist/frontmatter.d.ts.map +1 -1
  74. package/dist/frontmatter.js +20 -7
  75. package/dist/frontmatter.js.map +1 -1
  76. package/dist/governed-body-write.d.ts +106 -0
  77. package/dist/governed-body-write.d.ts.map +1 -0
  78. package/dist/governed-body-write.js +251 -0
  79. package/dist/governed-body-write.js.map +1 -0
  80. package/dist/heads-digest.d.ts +32 -0
  81. package/dist/heads-digest.d.ts.map +1 -0
  82. package/dist/heads-digest.js +37 -0
  83. package/dist/heads-digest.js.map +1 -0
  84. package/dist/host-policy-snapshot.d.ts +9 -0
  85. package/dist/host-policy-snapshot.d.ts.map +1 -0
  86. package/dist/host-policy-snapshot.js +33 -0
  87. package/dist/host-policy-snapshot.js.map +1 -0
  88. package/dist/host-text.d.ts +31 -0
  89. package/dist/host-text.d.ts.map +1 -0
  90. package/dist/host-text.js +77 -0
  91. package/dist/host-text.js.map +1 -0
  92. package/dist/hosted-transport/answer-rows.d.ts +216 -0
  93. package/dist/hosted-transport/answer-rows.d.ts.map +1 -0
  94. package/dist/hosted-transport/answer-rows.js +396 -0
  95. package/dist/hosted-transport/answer-rows.js.map +1 -0
  96. package/dist/hosted-transport/carrier.d.ts +142 -0
  97. package/dist/hosted-transport/carrier.d.ts.map +1 -0
  98. package/dist/hosted-transport/carrier.js +241 -0
  99. package/dist/hosted-transport/carrier.js.map +1 -0
  100. package/dist/hosted-transport/history-pages.d.ts +55 -0
  101. package/dist/hosted-transport/history-pages.d.ts.map +1 -0
  102. package/dist/hosted-transport/history-pages.js +69 -0
  103. package/dist/hosted-transport/history-pages.js.map +1 -0
  104. package/dist/hosted-transport/index.d.ts +18 -0
  105. package/dist/hosted-transport/index.d.ts.map +1 -0
  106. package/dist/hosted-transport/index.js +18 -0
  107. package/dist/hosted-transport/index.js.map +1 -0
  108. package/dist/hosted-transport/operations.d.ts +85 -0
  109. package/dist/hosted-transport/operations.d.ts.map +1 -0
  110. package/dist/hosted-transport/operations.js +128 -0
  111. package/dist/hosted-transport/operations.js.map +1 -0
  112. package/dist/hosted-transport/paged-reads.d.ts +87 -0
  113. package/dist/hosted-transport/paged-reads.d.ts.map +1 -0
  114. package/dist/hosted-transport/paged-reads.js +238 -0
  115. package/dist/hosted-transport/paged-reads.js.map +1 -0
  116. package/dist/hosted-transport/read-adapter.d.ts +250 -0
  117. package/dist/hosted-transport/read-adapter.d.ts.map +1 -0
  118. package/dist/hosted-transport/read-adapter.js +557 -0
  119. package/dist/hosted-transport/read-adapter.js.map +1 -0
  120. package/dist/hosted-transport/root-write.d.ts +114 -0
  121. package/dist/hosted-transport/root-write.d.ts.map +1 -0
  122. package/dist/hosted-transport/root-write.js +171 -0
  123. package/dist/hosted-transport/root-write.js.map +1 -0
  124. package/dist/hosted-transport/whole-document-transport.d.ts +174 -0
  125. package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -0
  126. package/dist/hosted-transport/whole-document-transport.js +411 -0
  127. package/dist/hosted-transport/whole-document-transport.js.map +1 -0
  128. package/dist/index.d.ts +29 -8
  129. package/dist/index.d.ts.map +1 -1
  130. package/dist/index.js +26 -6
  131. package/dist/index.js.map +1 -1
  132. package/dist/indexeddb-backend.d.ts +197 -0
  133. package/dist/indexeddb-backend.d.ts.map +1 -0
  134. package/dist/indexeddb-backend.js +1183 -0
  135. package/dist/indexeddb-backend.js.map +1 -0
  136. package/dist/journaled-backend.d.ts +467 -0
  137. package/dist/journaled-backend.d.ts.map +1 -0
  138. package/dist/journaled-backend.js +389 -0
  139. package/dist/journaled-backend.js.map +1 -0
  140. package/dist/kind-coverage.d.ts +99 -0
  141. package/dist/kind-coverage.d.ts.map +1 -0
  142. package/dist/kind-coverage.js +186 -0
  143. package/dist/kind-coverage.js.map +1 -0
  144. package/dist/kind-field-mutation.d.ts +15 -0
  145. package/dist/kind-field-mutation.d.ts.map +1 -0
  146. package/dist/kind-field-mutation.js +160 -0
  147. package/dist/kind-field-mutation.js.map +1 -0
  148. package/dist/kinds.d.ts +31 -1
  149. package/dist/kinds.d.ts.map +1 -1
  150. package/dist/kinds.js +86 -17
  151. package/dist/kinds.js.map +1 -1
  152. package/dist/links.d.ts +1 -1
  153. package/dist/links.d.ts.map +1 -1
  154. package/dist/links.js +5 -10
  155. package/dist/links.js.map +1 -1
  156. package/dist/managed-document-metadata.d.ts +2 -0
  157. package/dist/managed-document-metadata.d.ts.map +1 -0
  158. package/dist/managed-document-metadata.js +9 -0
  159. package/dist/managed-document-metadata.js.map +1 -0
  160. package/dist/meaningful-change-time.d.ts +6 -6
  161. package/dist/meaningful-change-time.d.ts.map +1 -1
  162. package/dist/meaningful-change-time.js +12 -13
  163. package/dist/meaningful-change-time.js.map +1 -1
  164. package/dist/memory-backend.d.ts +2 -2
  165. package/dist/memory-backend.d.ts.map +1 -1
  166. package/dist/memory-backend.js +32 -16
  167. package/dist/memory-backend.js.map +1 -1
  168. package/dist/mutation.d.ts.map +1 -1
  169. package/dist/mutation.js +2 -2
  170. package/dist/mutation.js.map +1 -1
  171. package/dist/page.d.ts.map +1 -1
  172. package/dist/page.js +2 -1
  173. package/dist/page.js.map +1 -1
  174. package/dist/paths.d.ts +6 -2
  175. package/dist/paths.d.ts.map +1 -1
  176. package/dist/paths.js +35 -33
  177. package/dist/paths.js.map +1 -1
  178. package/dist/platform.d.ts +239 -0
  179. package/dist/platform.d.ts.map +1 -0
  180. package/dist/platform.js +82 -0
  181. package/dist/platform.js.map +1 -0
  182. package/dist/portable-export.d.ts +119 -0
  183. package/dist/portable-export.d.ts.map +1 -0
  184. package/dist/portable-export.js +501 -0
  185. package/dist/portable-export.js.map +1 -0
  186. package/dist/publication-filesystem.d.ts +1 -1
  187. package/dist/publication-filesystem.d.ts.map +1 -1
  188. package/dist/publication-filesystem.js +1 -1
  189. package/dist/publication-filesystem.js.map +1 -1
  190. package/dist/query-filter.d.ts +7 -2
  191. package/dist/query-filter.d.ts.map +1 -1
  192. package/dist/query-filter.js +24 -1
  193. package/dist/query-filter.js.map +1 -1
  194. package/dist/query-order.d.ts +22 -0
  195. package/dist/query-order.d.ts.map +1 -0
  196. package/dist/query-order.js +42 -0
  197. package/dist/query-order.js.map +1 -0
  198. package/dist/recipes.d.ts +3 -1
  199. package/dist/recipes.d.ts.map +1 -1
  200. package/dist/recipes.js +4 -4
  201. package/dist/recipes.js.map +1 -1
  202. package/dist/remote-backend.d.ts +114 -22
  203. package/dist/remote-backend.d.ts.map +1 -1
  204. package/dist/remote-backend.js +285 -44
  205. package/dist/remote-backend.js.map +1 -1
  206. package/dist/remote-document-codec.d.ts +15 -0
  207. package/dist/remote-document-codec.d.ts.map +1 -0
  208. package/dist/remote-document-codec.js +103 -0
  209. package/dist/remote-document-codec.js.map +1 -0
  210. package/dist/remote-error.d.ts +38 -0
  211. package/dist/remote-error.d.ts.map +1 -0
  212. package/dist/remote-error.js +59 -0
  213. package/dist/remote-error.js.map +1 -0
  214. package/dist/remote-operations.d.ts +63 -0
  215. package/dist/remote-operations.d.ts.map +1 -0
  216. package/dist/remote-operations.js +125 -0
  217. package/dist/remote-operations.js.map +1 -0
  218. package/dist/remote-parsers.d.ts +86 -0
  219. package/dist/remote-parsers.d.ts.map +1 -0
  220. package/dist/remote-parsers.js +181 -0
  221. package/dist/remote-parsers.js.map +1 -0
  222. package/dist/remote.d.ts +7 -2
  223. package/dist/remote.d.ts.map +1 -1
  224. package/dist/remote.js +6 -1
  225. package/dist/remote.js.map +1 -1
  226. package/dist/sha256.d.ts +21 -0
  227. package/dist/sha256.d.ts.map +1 -0
  228. package/dist/sha256.js +114 -0
  229. package/dist/sha256.js.map +1 -0
  230. package/dist/storage.d.ts +8 -2
  231. package/dist/storage.d.ts.map +1 -1
  232. package/dist/storage.js +11 -2
  233. package/dist/storage.js.map +1 -1
  234. package/dist/types.d.ts +40 -5
  235. package/dist/types.d.ts.map +1 -1
  236. package/dist/uncertain-write.d.ts +178 -0
  237. package/dist/uncertain-write.d.ts.map +1 -0
  238. package/dist/uncertain-write.js +198 -0
  239. package/dist/uncertain-write.js.map +1 -0
  240. package/dist/version-transport.d.ts +7 -0
  241. package/dist/version-transport.d.ts.map +1 -1
  242. package/dist/version-transport.js +9 -0
  243. package/dist/version-transport.js.map +1 -1
  244. package/dist/versioning.d.ts +18 -7
  245. package/dist/versioning.d.ts.map +1 -1
  246. package/dist/versioning.js +23 -14
  247. package/dist/versioning.js.map +1 -1
  248. package/package.json +75 -4
@@ -0,0 +1,239 @@
1
+ /**
2
+ * The platform contract an application programs against, above the two execution
3
+ * implementations: request-driven (every verb is a request to the shared authority) and
4
+ * browser-local (every verb runs against the page's own working copy, related to the authority
5
+ * by synchronization). A presentation receives a {@link PlatformRuntime} and nothing else; it
6
+ * never touches a backend, a transport, or a store.
7
+ *
8
+ * Provenance is the explicit result difference the two implementations are allowed to have.
9
+ * Every read, query row, validation, and commit states where its answer stands with respect to
10
+ * the shared authority:
11
+ *
12
+ * - `shared-confirmed`: the authority acknowledged or served exactly this content at the
13
+ * runtime's last exchange with it. It may only be produced from an authority acknowledgement
14
+ * (a write the authority answered, or an intent it acknowledged under its request identity)
15
+ * or from an authority read (a request-driven read, or a working copy refreshed from the
16
+ * authority with no local edit outstanding). A local write never produces it, so no
17
+ * presentation can report shared confirmation without an acknowledgement. It says nothing
18
+ * about what the authority holds now: request-driven's last exchange is the request itself,
19
+ * browser-local's is its last sync, and the authority may have moved (or deleted the document)
20
+ * since. A document the authority deleted disappears from a browser-local working copy at
21
+ * its next sync (pull reconciles deletions against the authority's heads) unless a local
22
+ * edit holds it, in which case pull retains the local content and rewrites its base to an
23
+ * absent shared version, and the document reads `local-pending` until push delivers the edit
24
+ * and settles the authority's conflict answer (a 412 whose actual version is `null`) as a
25
+ * conflict against an absent remote, from which point it reads `local-conflict` with
26
+ * `remote: null`; request-driven answers absence directly. Between syncs a deleted document
27
+ * still reads `shared-confirmed` at its last served version, so a presentation must not read
28
+ * `shared-confirmed` as proof of present existence.
29
+ * - `local-pending`: the working copy holds a local edit the authority has not accepted;
30
+ * `requestId` names the journaled intent that will deliver it and `base` the shared version
31
+ * the edit was made against.
32
+ * - `local-conflict`: the authority's head moved under a local edit; `remote` is the version the
33
+ * authority held when the conflict was recorded, and the local content is retained. Any
34
+ * conflict intent on a document decides its provenance, even after further local edits
35
+ * chained behind it.
36
+ *
37
+ * One token space per runtime. In every provenance state `version` is the runtime's own premise
38
+ * token: the value an application may pass back as `expectedVersion`, equal to the `version` of
39
+ * a query row for the same document. For browser-local that is the working copy's document
40
+ * version; for request-driven it is the authority's. `shared-confirmed` also carries
41
+ * `acknowledged`, the token the authority mints for the same content, which differs from
42
+ * `version` whenever the authority hashes bytes the working copy normalizes differently (a
43
+ * filesystem authority over hand-authored files). An application compares `acknowledged` to the
44
+ * authority and `version` to its own runtime, never one to the other.
45
+ *
46
+ * Model semantics (what a document is, how a query filters, what a kind warns about, when a
47
+ * commit changes nothing) are identical across implementations; the contract kit in
48
+ * `@superbee/browser-local` proves that by running one row table against both.
49
+ *
50
+ * This module carries types and pure helpers only: no behaviour, no Node builtins, so it
51
+ * bundles for the browser (see `test/browser-bundle.test.ts`).
52
+ */
53
+ import type { ConceptId, Frontmatter, OkfDocument, QueryFilter, Version } from "./types.js";
54
+ import type { ValidationWarning } from "./validation.js";
55
+ /** Which execution implementation answers a runtime's verbs. */
56
+ export type ExecutionMode = "request-driven" | "browser-local";
57
+ /** Where a result stands with respect to the shared authority. */
58
+ export type Provenance = {
59
+ state: "shared-confirmed";
60
+ version: Version;
61
+ acknowledged: Version;
62
+ } | {
63
+ state: "local-pending";
64
+ version: Version;
65
+ base: Version | null;
66
+ requestId: string;
67
+ } | {
68
+ state: "local-conflict";
69
+ version: Version;
70
+ base: Version | null;
71
+ remote: Version | null;
72
+ requestId: string;
73
+ };
74
+ /** The three words a presentation shows for a provenance. */
75
+ export type ProvenanceLabel = "shared" | "pending" | "conflict";
76
+ /** What an implementation can do; a presentation adapts its affordances to these, never to the mode name. */
77
+ export interface PlatformCapabilities {
78
+ mode: ExecutionMode;
79
+ /** Commits succeed without the authority reachable. */
80
+ offlineCommits: boolean;
81
+ /** Documents and pending edits survive a reload of the host. */
82
+ localPersistence: boolean;
83
+ }
84
+ export interface PlatformDocument {
85
+ doc: OkfDocument;
86
+ provenance: Provenance;
87
+ }
88
+ export interface PlatformQueryRow {
89
+ id: ConceptId;
90
+ version: Version;
91
+ frontmatter: Frontmatter;
92
+ provenance: Provenance;
93
+ }
94
+ export interface PlatformValidation {
95
+ id: ConceptId;
96
+ /** Kind warnings for this document against the bundle's own conventions; empty when it conforms or no kind governs it. */
97
+ warnings: ValidationWarning[];
98
+ provenance: Provenance;
99
+ }
100
+ /** A body edit; `expectedVersion` is the version the application read and is editing over. */
101
+ export interface PlatformEdit {
102
+ body: string;
103
+ /**
104
+ * The version the edit was made against: the `version` a read, query row, or commit of this
105
+ * runtime reported. Omitted, the runtime reads, decides and writes with its own retry. Given,
106
+ * the commit is a single compare-and-swap at that premise: request-driven
107
+ * rejects a stale premise with `VersionConflict` at commit time; browser-local applies the edit
108
+ * to the working copy at that local premise and surfaces a moved shared head as
109
+ * `local-conflict` when it synchronizes.
110
+ */
111
+ expectedVersion?: Version;
112
+ }
113
+ export interface PlatformCommit {
114
+ id: ConceptId;
115
+ /** False when the engine found nothing to change; the provenance is then the document's existing one. */
116
+ changed: boolean;
117
+ provenance: Provenance;
118
+ }
119
+ /**
120
+ * Why a browser-local sync applied none of the deletions a verified listing implied:
121
+ * `empty-listing` names no document while the working copy holds some, `over-half` names so
122
+ * few that more than half of the working copy would go. Only a listing that would remove at
123
+ * least eight documents is bounded; fewer are applied on the authority's word.
124
+ */
125
+ export type RefusedDeletionsReason = "empty-listing" | "over-half";
126
+ /**
127
+ * The deletions a browser-local sync refused to apply, exactly as recorded on its last pull.
128
+ * `digest` names the listing that implied them; a caller that has judged the shrink genuine
129
+ * passes the record back as {@link PlatformSyncOptions.acceptRefusedDeletions}.
130
+ */
131
+ export interface RefusedDeletions {
132
+ /** How many documents the listing would have removed from the working copy. */
133
+ deletions: number;
134
+ reason: RefusedDeletionsReason;
135
+ /** The heads digest of the listing that was refused. */
136
+ digest: string;
137
+ }
138
+ /** How the runtime's last sync ended; see {@link PlatformSyncStatus.lastSync}. */
139
+ export interface PlatformSyncOutcome {
140
+ /** False when the sync rejected (a carrier failure, or an authority answer the runtime could not apply). */
141
+ ok: boolean;
142
+ /** The rejection's `name: message` when `ok` is false. */
143
+ error?: string;
144
+ /** The deletions the last completed pull refused; present until a pull applies or clears them. */
145
+ refusedDeletions?: RefusedDeletions;
146
+ }
147
+ export interface PlatformSyncOptions {
148
+ /**
149
+ * The refusal the last sync reported (`lastSync.refusedDeletions`), passed back to say the
150
+ * shrink it describes is genuine. Browser-local applies the deletions only when the
151
+ * authority's current listing still carries the same digest, count and reason; a listing
152
+ * that has moved since is refused afresh. When another realm holds the push role, a sync
153
+ * passing it applies nothing, records `lastSync.ok` false and rejects, so the caller can retry.
154
+ * One whose pull another realm supersedes twice also records `lastSync.ok` false and rejects,
155
+ * possibly with some deletions applied, and reports a refusal in `lastSync.refusedDeletions`
156
+ * for the retry to pass back: a fresh one when the listing moved, not necessarily the one
157
+ * passed. It is shown only while the superseding pull's marker is unfinished, and is held in
158
+ * memory only, so a page reload loses it; a later plain pull that refuses records it on its
159
+ * marker again.
160
+ * Request-driven ignores it: nothing is ever refused there.
161
+ */
162
+ acceptRefusedDeletions?: RefusedDeletions;
163
+ }
164
+ /**
165
+ * The runtime's relation to the authority as of its last exchange. `online` reports the
166
+ * carrier: it turns false only when a request could not reach the authority, never on an
167
+ * answer the authority gave. `lastSync` reports the sync verb itself, and is the field a
168
+ * presentation must show to distinguish "synchronized" from "tried and failed": `ok` is false
169
+ * whenever `sync` rejected, whatever the cause, with the rejection's text in `error`.
170
+ *
171
+ * Browser-local applies a verified heads listing on the authority's word, including the
172
+ * documents it no longer names, with one bound: a listing that would remove at least eight
173
+ * documents and more than half of the working copy (or every document) is refused as a whole.
174
+ * The refreshes in that sync still apply, nothing is removed, `lastSync.ok` stays true, and
175
+ * `lastSync.refusedDeletions` carries the refusal until a later pull applies or clears it. A
176
+ * genuine shrink of that size therefore never reconciles on its own; the recovery path is to
177
+ * pass the recorded refusal back as `sync({ acceptRefusedDeletions })`, which applies the
178
+ * deletions if the authority still lists the same state and refuses afresh if it has moved.
179
+ * Request-driven has no working copy and leaves `lastSync` undefined: the status is the answer
180
+ * to the request that produced it.
181
+ */
182
+ export interface PlatformSyncStatus {
183
+ mode: ExecutionMode;
184
+ /** Whether the last request to the authority succeeded; `null` before any was made. */
185
+ online: boolean | null;
186
+ /** Local edits the authority has not yet acknowledged (pending, in flight, or of unknown outcome). */
187
+ pending: number;
188
+ conflicts: number;
189
+ refused: number;
190
+ /**
191
+ * Working-copy documents whose bytes neither a recorded shared base nor an intent accounts
192
+ * for: a defect in the working copy, since every local write journals an intent. `query`
193
+ * omits such a document and `read` rejects it; this count is where it surfaces. Always 0 in
194
+ * request-driven mode, which has no working copy.
195
+ */
196
+ unconfirmed: number;
197
+ /** Delivery is paused (an authorization refusal); `pausedReason` says why. */
198
+ paused: boolean;
199
+ pausedReason?: string;
200
+ /** The runtime's working set is complete: the authority's for request-driven, a finished bootstrap for browser-local. */
201
+ complete: boolean;
202
+ /**
203
+ * How the last sync ended, and any deletions its pull refused. Browser-local fills it from
204
+ * the sync's own outcome and the pull marker (so a refusal recorded before this runtime was
205
+ * created still shows); request-driven leaves it undefined. Absent before any sync.
206
+ */
207
+ lastSync?: PlatformSyncOutcome;
208
+ }
209
+ export interface PlatformRuntime {
210
+ capabilities(): PlatformCapabilities;
211
+ /** Rejects ENOENT-shaped for an absent id and with `InvalidInputError` for an invalid one. */
212
+ read(id: ConceptId): Promise<PlatformDocument>;
213
+ /** Rows ordered by id, as the engine orders them. */
214
+ query(filter?: QueryFilter): Promise<PlatformQueryRow[]>;
215
+ validate(id: ConceptId): Promise<PlatformValidation>;
216
+ commit(id: ConceptId, edit: PlatformEdit): Promise<PlatformCommit>;
217
+ syncStatus(): Promise<PlatformSyncStatus>;
218
+ /**
219
+ * Push pending work and pull the authority's changes; a no-op returning the status in
220
+ * request-driven mode. `options` carries the recovery path for refused deletions; see
221
+ * {@link PlatformSyncOptions}.
222
+ */
223
+ sync(options?: PlatformSyncOptions): Promise<PlatformSyncStatus>;
224
+ }
225
+ /** The word a presentation shows for a provenance. */
226
+ export declare function provenanceLabel(provenance: Provenance): ProvenanceLabel;
227
+ /** True only when the authority acknowledged or served this content at the runtime's last exchange with it. */
228
+ export declare function isSharedConfirmed(provenance: Provenance): provenance is Extract<Provenance, {
229
+ state: "shared-confirmed";
230
+ }>;
231
+ /**
232
+ * A confirmation from an authority answer; callers must hold that answer, never infer it from a
233
+ * local write. `version` is the runtime's own premise token and `acknowledged` the authority's
234
+ * token for the same content; omitted, the two are the same token space.
235
+ */
236
+ export declare function sharedConfirmed(version: Version, acknowledged?: Version): Provenance;
237
+ export declare function localPending(version: Version, base: Version | null, requestId: string): Provenance;
238
+ export declare function localConflict(version: Version, base: Version | null, remote: Version | null, requestId: string): Provenance;
239
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,gEAAgE;AAChE,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAE/D,kEAAkE;AAClE,MAAM,MAAM,UAAU,GAClB;IAAE,KAAK,EAAE,kBAAkB,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,GACtE;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACrF;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CA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mB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAClE;AAED,sDAAsD;AACtD,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,eAAe,CASvE;AAED,+GAA+G;AAC/G,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,IAAI,OAAO,CAAC,UAAU,EAAE;IAAE,KAAK,EAAE,kBAAkB,CAAA;CAAE,CAAC,CAE1H;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,GAAE,OAAiB,GAAG,UAAU,CAE7F;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,CAElG;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,CAE3H"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The platform contract an application programs against, above the two execution
3
+ * implementations: request-driven (every verb is a request to the shared authority) and
4
+ * browser-local (every verb runs against the page's own working copy, related to the authority
5
+ * by synchronization). A presentation receives a {@link PlatformRuntime} and nothing else; it
6
+ * never touches a backend, a transport, or a store.
7
+ *
8
+ * Provenance is the explicit result difference the two implementations are allowed to have.
9
+ * Every read, query row, validation, and commit states where its answer stands with respect to
10
+ * the shared authority:
11
+ *
12
+ * - `shared-confirmed`: the authority acknowledged or served exactly this content at the
13
+ * runtime's last exchange with it. It may only be produced from an authority acknowledgement
14
+ * (a write the authority answered, or an intent it acknowledged under its request identity)
15
+ * or from an authority read (a request-driven read, or a working copy refreshed from the
16
+ * authority with no local edit outstanding). A local write never produces it, so no
17
+ * presentation can report shared confirmation without an acknowledgement. It says nothing
18
+ * about what the authority holds now: request-driven's last exchange is the request itself,
19
+ * browser-local's is its last sync, and the authority may have moved (or deleted the document)
20
+ * since. A document the authority deleted disappears from a browser-local working copy at
21
+ * its next sync (pull reconciles deletions against the authority's heads) unless a local
22
+ * edit holds it, in which case pull retains the local content and rewrites its base to an
23
+ * absent shared version, and the document reads `local-pending` until push delivers the edit
24
+ * and settles the authority's conflict answer (a 412 whose actual version is `null`) as a
25
+ * conflict against an absent remote, from which point it reads `local-conflict` with
26
+ * `remote: null`; request-driven answers absence directly. Between syncs a deleted document
27
+ * still reads `shared-confirmed` at its last served version, so a presentation must not read
28
+ * `shared-confirmed` as proof of present existence.
29
+ * - `local-pending`: the working copy holds a local edit the authority has not accepted;
30
+ * `requestId` names the journaled intent that will deliver it and `base` the shared version
31
+ * the edit was made against.
32
+ * - `local-conflict`: the authority's head moved under a local edit; `remote` is the version the
33
+ * authority held when the conflict was recorded, and the local content is retained. Any
34
+ * conflict intent on a document decides its provenance, even after further local edits
35
+ * chained behind it.
36
+ *
37
+ * One token space per runtime. In every provenance state `version` is the runtime's own premise
38
+ * token: the value an application may pass back as `expectedVersion`, equal to the `version` of
39
+ * a query row for the same document. For browser-local that is the working copy's document
40
+ * version; for request-driven it is the authority's. `shared-confirmed` also carries
41
+ * `acknowledged`, the token the authority mints for the same content, which differs from
42
+ * `version` whenever the authority hashes bytes the working copy normalizes differently (a
43
+ * filesystem authority over hand-authored files). An application compares `acknowledged` to the
44
+ * authority and `version` to its own runtime, never one to the other.
45
+ *
46
+ * Model semantics (what a document is, how a query filters, what a kind warns about, when a
47
+ * commit changes nothing) are identical across implementations; the contract kit in
48
+ * `@superbee/browser-local` proves that by running one row table against both.
49
+ *
50
+ * This module carries types and pure helpers only: no behaviour, no Node builtins, so it
51
+ * bundles for the browser (see `test/browser-bundle.test.ts`).
52
+ */
53
+ /** The word a presentation shows for a provenance. */
54
+ export function provenanceLabel(provenance) {
55
+ switch (provenance.state) {
56
+ case "shared-confirmed":
57
+ return "shared";
58
+ case "local-pending":
59
+ return "pending";
60
+ case "local-conflict":
61
+ return "conflict";
62
+ }
63
+ }
64
+ /** True only when the authority acknowledged or served this content at the runtime's last exchange with it. */
65
+ export function isSharedConfirmed(provenance) {
66
+ return provenance.state === "shared-confirmed";
67
+ }
68
+ /**
69
+ * A confirmation from an authority answer; callers must hold that answer, never infer it from a
70
+ * local write. `version` is the runtime's own premise token and `acknowledged` the authority's
71
+ * token for the same content; omitted, the two are the same token space.
72
+ */
73
+ export function sharedConfirmed(version, acknowledged = version) {
74
+ return { state: "shared-confirmed", version, acknowledged };
75
+ }
76
+ export function localPending(version, base, requestId) {
77
+ return { state: "local-pending", version, base, requestId };
78
+ }
79
+ export function localConflict(version, base, remote, requestId) {
80
+ return { state: "local-conflict", version, base, remote, requestId };
81
+ }
82
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAkLH,sDAAsD;AACtD,MAAM,UAAU,eAAe,CAAC,UAAsB;IACpD,QAAQ,UAAU,CAAC,KAAK,EAAE,CAAC;QACzB,KAAK,kBAAkB;YACrB,OAAO,QAAQ,CAAC;QAClB,KAAK,eAAe;YAClB,OAAO,SAAS,CAAC;QACnB,KAAK,gBAAgB;YACnB,OAAO,UAAU,CAAC;IACtB,CAAC;AACH,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,iBAAiB,CAAC,UAAsB;IACtD,OAAO,UAAU,CAAC,KAAK,KAAK,kBAAkB,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAAgB,EAAE,eAAwB,OAAO;IAC/E,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAgB,EAAE,IAAoB,EAAE,SAAiB;IACpF,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAgB,EAAE,IAAoB,EAAE,MAAsB,EAAE,SAAiB;IAC7G,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACvE,CAAC"}
@@ -0,0 +1,119 @@
1
+ export declare const EXPORT_MANIFEST = "superbee-export.json";
2
+ export declare const EXPORT_FORMAT = "superbee-export/1";
3
+ /** The host's own bounds (20,000 objects, 64 MiB stored), plus room for headers and the manifest. */
4
+ export declare const MAX_EXPORT_ENTRIES = 20001;
5
+ export declare const MAX_EXPORT_BYTES: number;
6
+ /** Why an archive was refused: `incomplete` is an export the host stopped; the rest are contract failures. */
7
+ export type ArchiveProblem = "incomplete" | "malformed" | "unsafe_path" | "manifest_mismatch" | "wrong_bundle" | "unsupported_format";
8
+ export declare class ExportArchiveError extends Error {
9
+ readonly name = "ExportArchiveError";
10
+ readonly problem: ArchiveProblem;
11
+ constructor(problem: ArchiveProblem, message: string);
12
+ }
13
+ export type EntryKind = "document" | "reserved" | "blob";
14
+ export interface ArchiveEntry {
15
+ /** The bundle-relative path the entry is placed at. */
16
+ readonly path: string;
17
+ readonly kind: EntryKind;
18
+ readonly bytes: Uint8Array;
19
+ }
20
+ export interface ExportSource {
21
+ readonly tenantId: string;
22
+ readonly bundleId: string;
23
+ readonly revision: number;
24
+ readonly okfEdition: string | null;
25
+ }
26
+ export interface VerifiedExport {
27
+ readonly source: ExportSource;
28
+ readonly exportedAt: string;
29
+ readonly counts: {
30
+ readonly documents: number;
31
+ readonly reserved: number;
32
+ readonly blobs: number;
33
+ };
34
+ /** Every entry but the manifest, in archive order. */
35
+ readonly entries: readonly ArchiveEntry[];
36
+ /** Stored bytes, the manifest excluded. */
37
+ readonly bytes: number;
38
+ /** A paged export's page; absent on the whole archive (and on pages once joined). */
39
+ readonly page?: ExportPage;
40
+ }
41
+ /** What one page of a paged export states (`page` in its manifest). */
42
+ export interface ExportPage {
43
+ /** The inventory position of the page's first object. */
44
+ readonly from: number;
45
+ /** Objects the page carries. */
46
+ readonly count: number;
47
+ /** Objects in the whole bundle. */
48
+ readonly total: number;
49
+ /** The cursor of the next page; absent on the last. */
50
+ readonly next?: string;
51
+ /** The whole bundle's counts, as every page's manifest states them. */
52
+ readonly counts: VerifiedExport["counts"];
53
+ }
54
+ export declare function crc32(bytes: Uint8Array): number;
55
+ interface RawEntry {
56
+ readonly name: string;
57
+ readonly data: Uint8Array;
58
+ }
59
+ /**
60
+ * The entries of a store-only zip, strictly: one end record at the very end, a central directory
61
+ * that ends where it starts it, and local records laid end to end from offset zero, each stored,
62
+ * uncompressed, with no data descriptor and a matching CRC.
63
+ */
64
+ export declare function readStoredZip(archive: Uint8Array): RawEntry[];
65
+ /** What an archive path is in a bundle, or an `unsafe_path` refusal. The core guards decide. */
66
+ export declare function classifyEntryPath(entryPath: string): EntryKind;
67
+ /**
68
+ * The first two paths that one folder cannot hold apart: the same file under folding, a file where
69
+ * a folder must be, or one folder spelled two ways (a case-insensitive disk would merge them, and
70
+ * the files in it would no longer be at the paths their ids name).
71
+ */
72
+ export declare function findEntryCollision(paths: readonly string[]): readonly [string, string] | null;
73
+ /**
74
+ * Verify a whole export archive for `bundleId` and return its entries. Any failure is an
75
+ * {@link ExportArchiveError}; nothing is returned for an archive that is not complete and exact.
76
+ */
77
+ export declare function verifyExport(archive: Uint8Array, bundleId: string, options?: {
78
+ readonly paged?: boolean;
79
+ }): VerifiedExport;
80
+ /**
81
+ * The pages of one paged export, checked as each arrives and joined once the last has: every page
82
+ * must name the first page's source (one revision, one edition), state the same whole (its total,
83
+ * at most an export's entries, and its counts), start where the one before ended, and only the
84
+ * last may name no next page. So a host that repeats or skips a page is refused at that page, and
85
+ * a run of pages is at most `total` long. Joined, the pages must hold every object once, add up to
86
+ * the bundle's counts, and keep every path apart from the others in one folder.
87
+ */
88
+ export declare class ExportPageChain {
89
+ #private;
90
+ /** Adds the next page; answers its next cursor, or undefined once the export is whole. */
91
+ add(verified: VerifiedExport): string | undefined;
92
+ /** The whole bundle, as one archive would have carried it. */
93
+ joined(): VerifiedExport;
94
+ }
95
+ /** Join the verified pages of one paged export ({@link ExportPageChain}). */
96
+ export declare function joinExportPages(pages: readonly VerifiedExport[]): VerifiedExport;
97
+ /** Exact transport evidence, kept outside any materialized OKF bundle. */
98
+ export interface ExportProvenance {
99
+ readonly source: ExportSource;
100
+ readonly exportedAt: string;
101
+ /** SHA-256 and byte length of each accepted raw manifest, in page order. */
102
+ readonly manifests: readonly {
103
+ readonly sha256: string;
104
+ readonly bytes: number;
105
+ }[];
106
+ /** SHA-256 of UTF-8 JSON for path-sorted {path,kind,bytes,sha256} inventory rows. */
107
+ readonly inventorySha256: string;
108
+ }
109
+ /** Evidence for an accepted handle; refuses forged or subsequently mutated values. */
110
+ export declare function exportProvenance(verified: VerifiedExport): ExportProvenance;
111
+ /**
112
+ * Materialize a complete verified export in a fresh private child of an existing caller-owned
113
+ * parent. Returns only after every file is written. The caller owns cleanup of the returned
114
+ * directory and must keep that parent private while using the result. No target is overwritten,
115
+ * no transport metadata is written, and failure removes only this call's newly created child.
116
+ */
117
+ export declare function materializeExport(verified: VerifiedExport, parentDirectory: string): Promise<string>;
118
+ export {};
119
+ //# sourceMappingURL=portable-export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portable-export.d.ts","sourceRoot":"","sources":["../src/portable-export.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,eAAe,yBAAyB,CAAC;AAEtD,eAAO,MAAM,aAAa,sBAAsB,CAAC;AAEjD,qGAAqG;AACrG,eAAO,MAAM,kBAAkB,QAAS,CAAC;AACzC,eAAO,MAAM,gBAAgB,QAAoB,CAAC;AAOlD,8GAA8G;AAC9G,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,WAAW,GAA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