@superbee/core 0.2.0-pre.1 → 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.
- package/README.md +127 -0
- package/dist/artifact-contract.d.ts +90 -0
- package/dist/artifact-contract.d.ts.map +1 -0
- package/dist/artifact-contract.js +205 -0
- package/dist/artifact-contract.js.map +1 -0
- package/dist/backend.d.ts +16 -1
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +85 -42
- package/dist/backend.js.map +1 -1
- package/dist/bundle-ops.d.ts +1 -1
- package/dist/bundle-ops.d.ts.map +1 -1
- package/dist/bundle-ops.js +2 -2
- package/dist/bundle-ops.js.map +1 -1
- package/dist/bundle.d.ts +2 -1
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +3 -3
- package/dist/bundle.js.map +1 -1
- package/dist/document-codec.d.ts +6 -1
- package/dist/document-codec.d.ts.map +1 -1
- package/dist/document-codec.js +8 -4
- package/dist/document-codec.js.map +1 -1
- package/dist/document-field-actions.d.ts +13 -1
- package/dist/document-field-actions.d.ts.map +1 -1
- package/dist/document-field-actions.js +47 -6
- package/dist/document-field-actions.js.map +1 -1
- package/dist/document-mutation.d.ts +15 -1
- package/dist/document-mutation.d.ts.map +1 -1
- package/dist/document-mutation.js +42 -11
- package/dist/document-mutation.js.map +1 -1
- package/dist/document-write-policy.d.ts.map +1 -1
- package/dist/document-write-policy.js +4 -2
- package/dist/document-write-policy.js.map +1 -1
- package/dist/engine.d.ts +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +4 -3
- package/dist/engine.js.map +1 -1
- package/dist/file-journaled-backend-internal.d.ts +19 -0
- package/dist/file-journaled-backend-internal.d.ts.map +1 -0
- package/dist/file-journaled-backend-internal.js +10 -0
- package/dist/file-journaled-backend-internal.js.map +1 -0
- package/dist/file-journaled-backend.d.ts +162 -0
- package/dist/file-journaled-backend.d.ts.map +1 -0
- package/dist/file-journaled-backend.js +1113 -0
- package/dist/file-journaled-backend.js.map +1 -0
- package/dist/filesystem-host.d.ts +15 -0
- package/dist/filesystem-host.d.ts.map +1 -0
- package/dist/filesystem-host.js +20 -0
- package/dist/filesystem-host.js.map +1 -0
- package/dist/filesystem-identity.d.ts +86 -4
- package/dist/filesystem-identity.d.ts.map +1 -1
- package/dist/filesystem-identity.js +338 -102
- package/dist/filesystem-identity.js.map +1 -1
- package/dist/filesystem-lock.d.ts +16 -3
- package/dist/filesystem-lock.d.ts.map +1 -1
- package/dist/filesystem-lock.js +323 -77
- package/dist/filesystem-lock.js.map +1 -1
- package/dist/filesystem-push-role.d.ts +77 -0
- package/dist/filesystem-push-role.d.ts.map +1 -0
- package/dist/filesystem-push-role.js +165 -0
- package/dist/filesystem-push-role.js.map +1 -0
- package/dist/filesystem.d.ts +17 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +18 -0
- package/dist/filesystem.js.map +1 -0
- package/dist/frontmatter.d.ts +8 -0
- package/dist/frontmatter.d.ts.map +1 -1
- package/dist/frontmatter.js +14 -4
- package/dist/frontmatter.js.map +1 -1
- package/dist/governed-body-write.d.ts +106 -0
- package/dist/governed-body-write.d.ts.map +1 -0
- package/dist/governed-body-write.js +251 -0
- package/dist/governed-body-write.js.map +1 -0
- package/dist/heads-digest.d.ts +32 -0
- package/dist/heads-digest.d.ts.map +1 -0
- package/dist/heads-digest.js +37 -0
- package/dist/heads-digest.js.map +1 -0
- package/dist/host-policy-snapshot.d.ts +9 -0
- package/dist/host-policy-snapshot.d.ts.map +1 -0
- package/dist/host-policy-snapshot.js +33 -0
- package/dist/host-policy-snapshot.js.map +1 -0
- package/dist/host-text.d.ts +31 -0
- package/dist/host-text.d.ts.map +1 -0
- package/dist/host-text.js +77 -0
- package/dist/host-text.js.map +1 -0
- package/dist/hosted-transport/answer-rows.d.ts +216 -0
- package/dist/hosted-transport/answer-rows.d.ts.map +1 -0
- package/dist/hosted-transport/answer-rows.js +396 -0
- package/dist/hosted-transport/answer-rows.js.map +1 -0
- package/dist/hosted-transport/carrier.d.ts +142 -0
- package/dist/hosted-transport/carrier.d.ts.map +1 -0
- package/dist/hosted-transport/carrier.js +241 -0
- package/dist/hosted-transport/carrier.js.map +1 -0
- package/dist/hosted-transport/history-pages.d.ts +55 -0
- package/dist/hosted-transport/history-pages.d.ts.map +1 -0
- package/dist/hosted-transport/history-pages.js +69 -0
- package/dist/hosted-transport/history-pages.js.map +1 -0
- package/dist/hosted-transport/index.d.ts +18 -0
- package/dist/hosted-transport/index.d.ts.map +1 -0
- package/dist/hosted-transport/index.js +18 -0
- package/dist/hosted-transport/index.js.map +1 -0
- package/dist/hosted-transport/operations.d.ts +85 -0
- package/dist/hosted-transport/operations.d.ts.map +1 -0
- package/dist/hosted-transport/operations.js +128 -0
- package/dist/hosted-transport/operations.js.map +1 -0
- package/dist/hosted-transport/paged-reads.d.ts +87 -0
- package/dist/hosted-transport/paged-reads.d.ts.map +1 -0
- package/dist/hosted-transport/paged-reads.js +238 -0
- package/dist/hosted-transport/paged-reads.js.map +1 -0
- package/dist/hosted-transport/read-adapter.d.ts +250 -0
- package/dist/hosted-transport/read-adapter.d.ts.map +1 -0
- package/dist/hosted-transport/read-adapter.js +557 -0
- package/dist/hosted-transport/read-adapter.js.map +1 -0
- package/dist/hosted-transport/root-write.d.ts +114 -0
- package/dist/hosted-transport/root-write.d.ts.map +1 -0
- package/dist/hosted-transport/root-write.js +171 -0
- package/dist/hosted-transport/root-write.js.map +1 -0
- package/dist/hosted-transport/whole-document-transport.d.ts +174 -0
- package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -0
- package/dist/hosted-transport/whole-document-transport.js +411 -0
- package/dist/hosted-transport/whole-document-transport.js.map +1 -0
- package/dist/index.d.ts +22 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-backend.d.ts +38 -6
- package/dist/indexeddb-backend.d.ts.map +1 -1
- package/dist/indexeddb-backend.js +511 -46
- package/dist/indexeddb-backend.js.map +1 -1
- package/dist/journaled-backend.d.ts +296 -7
- package/dist/journaled-backend.d.ts.map +1 -1
- package/dist/journaled-backend.js +312 -0
- package/dist/journaled-backend.js.map +1 -1
- package/dist/kind-coverage.d.ts +99 -0
- package/dist/kind-coverage.d.ts.map +1 -0
- package/dist/kind-coverage.js +186 -0
- package/dist/kind-coverage.js.map +1 -0
- package/dist/kinds.d.ts +31 -1
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +83 -16
- package/dist/kinds.js.map +1 -1
- package/dist/links.d.ts +1 -1
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +5 -10
- package/dist/links.js.map +1 -1
- package/dist/managed-document-metadata.d.ts +2 -0
- package/dist/managed-document-metadata.d.ts.map +1 -0
- package/dist/managed-document-metadata.js +9 -0
- package/dist/managed-document-metadata.js.map +1 -0
- package/dist/memory-backend.d.ts +2 -2
- package/dist/memory-backend.d.ts.map +1 -1
- package/dist/memory-backend.js +32 -16
- package/dist/memory-backend.js.map +1 -1
- package/dist/paths.d.ts +6 -2
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +35 -33
- package/dist/paths.js.map +1 -1
- package/dist/platform.d.ts +84 -6
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +9 -4
- package/dist/platform.js.map +1 -1
- package/dist/portable-export.d.ts +119 -0
- package/dist/portable-export.d.ts.map +1 -0
- package/dist/portable-export.js +501 -0
- package/dist/portable-export.js.map +1 -0
- package/dist/publication-filesystem.d.ts +1 -1
- package/dist/publication-filesystem.d.ts.map +1 -1
- package/dist/publication-filesystem.js +1 -1
- package/dist/publication-filesystem.js.map +1 -1
- package/dist/query-filter.d.ts +7 -2
- package/dist/query-filter.d.ts.map +1 -1
- package/dist/query-filter.js +24 -1
- package/dist/query-filter.js.map +1 -1
- package/dist/query-order.d.ts +22 -0
- package/dist/query-order.d.ts.map +1 -0
- package/dist/query-order.js +42 -0
- package/dist/query-order.js.map +1 -0
- package/dist/remote-backend.d.ts +91 -27
- package/dist/remote-backend.d.ts.map +1 -1
- package/dist/remote-backend.js +217 -49
- package/dist/remote-backend.js.map +1 -1
- package/dist/remote-document-codec.d.ts +15 -0
- package/dist/remote-document-codec.d.ts.map +1 -0
- package/dist/remote-document-codec.js +103 -0
- package/dist/remote-document-codec.js.map +1 -0
- package/dist/remote-error.d.ts +38 -0
- package/dist/remote-error.d.ts.map +1 -0
- package/dist/remote-error.js +59 -0
- package/dist/remote-error.js.map +1 -0
- package/dist/remote-operations.d.ts +6 -3
- package/dist/remote-operations.d.ts.map +1 -1
- package/dist/remote-operations.js +20 -5
- package/dist/remote-operations.js.map +1 -1
- package/dist/remote-parsers.d.ts +86 -0
- package/dist/remote-parsers.d.ts.map +1 -0
- package/dist/remote-parsers.js +181 -0
- package/dist/remote-parsers.js.map +1 -0
- package/dist/remote.d.ts +7 -2
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +6 -1
- package/dist/remote.js.map +1 -1
- package/dist/storage.d.ts +4 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +4 -1
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +28 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/uncertain-write.d.ts +49 -13
- package/dist/uncertain-write.d.ts.map +1 -1
- package/dist/uncertain-write.js +36 -12
- package/dist/uncertain-write.js.map +1 -1
- package/dist/versioning.d.ts +9 -4
- package/dist/versioning.d.ts.map +1 -1
- package/dist/versioning.js +9 -4
- package/dist/versioning.js.map +1 -1
- package/package.json +34 -2
package/dist/remote.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
/** Browser-safe client adapter for the Superbee wire protocol. */
|
|
2
|
-
export { RemoteBackend
|
|
2
|
+
export { RemoteBackend } from "./remote-backend.js";
|
|
3
|
+
export { RemoteError } from "./remote-error.js";
|
|
4
|
+
// The heads and snapshot grammar's reference validators, for a host that serves the same grammar
|
|
5
|
+
// through routes of its own; `RemoteBackend.heads` and `RemoteBackend.snapshot` call these.
|
|
6
|
+
export { SNAPSHOT_DIGEST_MISMATCH, SNAPSHOT_TRUNCATED, parseHeadsAnswer, readSnapshotStream } from "./remote-parsers.js";
|
|
7
|
+
export { headsDigest, isHeadsDigest, sortHeads } from "./heads-digest.js";
|
|
3
8
|
//# sourceMappingURL=remote.js.map
|
package/dist/remote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,iGAAiG;AACjG,4FAA4F;AAC5F,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/storage.d.ts
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
export type { BlobKey, ConceptId, DeleteOptions, Frontmatter, HeadResult, OkfDocument, QueryFilter, ReadBlobResult, ReadResult, ReservedFilename, ReservedReadResult, StorageBackend, StorageCapabilities, Version, VersionInfo, WriteOptions, } from "./types.js";
|
|
3
3
|
export { InvalidInputError } from "./errors.js";
|
|
4
4
|
export { MalformedDocumentError } from "./frontmatter-contract.js";
|
|
5
|
-
export { RESERVED_FILENAMES, assertSafeBlobKey, assertSafeConceptId, assertSafeReservedDir, conceptIdFromPath, isReservedFile, pathFromConceptId, toPosix, } from "./paths.js";
|
|
5
|
+
export { RESERVED_FILENAMES, assertSafeBlobKey, assertSafeConceptId, assertSafeReservedDir, assertSafeReservedFilename, compareStorageKeys, conceptIdFromPath, isReservedFile, pathFromConceptId, toPosix, } from "./paths.js";
|
|
6
6
|
export { VersionConflict, isContentVersion, stripETagWrapper } from "./version-transport.js";
|
|
7
7
|
export { IntentHoldConflict, IntentStateConflict } from "./journaled-backend.js";
|
|
8
|
-
export type { IntentPatch, IntentRecord, JournaledBackend, JournaledReadResult, JournaledWriteOptions, MetaRecord, NewIntentRecord, } from "./journaled-backend.js";
|
|
8
|
+
export type { IntentPatch, IntentRecord, JournaledBackend, JournaledDeleteOptions, JournaledDeleteResult, JournaledHead, JournaledHeadsOptions, JournaledReadResult, JournaledWriteOptions, MetaRecord, NewIntentRecord, } from "./journaled-backend.js";
|
|
9
9
|
export { isRequestIdentity } from "./uncertain-write.js";
|
|
10
10
|
export type { Outcome } from "./uncertain-write.js";
|
|
11
|
+
export { headsDigest, isHeadsDigest, sortHeads } from "./heads-digest.js";
|
|
12
|
+
export type { DocumentHead } from "./heads-digest.js";
|
|
11
13
|
//# sourceMappingURL=storage.d.ts.map
|
package/dist/storage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,YAAY,EACV,OAAO,EACP,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,OAAO,EACP,WAAW,EACX,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACr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gB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,UAAU,EACV,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1E,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/storage.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Runtime-neutral storage contract for Worker, browser, and custom backend consumers. */
|
|
2
2
|
export { InvalidInputError } from "./errors.js";
|
|
3
3
|
export { MalformedDocumentError } from "./frontmatter-contract.js";
|
|
4
|
-
export { RESERVED_FILENAMES, assertSafeBlobKey, assertSafeConceptId, assertSafeReservedDir, conceptIdFromPath, isReservedFile, pathFromConceptId, toPosix, } from "./paths.js";
|
|
4
|
+
export { RESERVED_FILENAMES, assertSafeBlobKey, assertSafeConceptId, assertSafeReservedDir, assertSafeReservedFilename, compareStorageKeys, conceptIdFromPath, isReservedFile, pathFromConceptId, toPosix, } from "./paths.js";
|
|
5
5
|
export { VersionConflict, isContentVersion, stripETagWrapper } from "./version-transport.js";
|
|
6
6
|
// The journaled-backend seam: what an adapter adds to `StorageBackend` to host a browser-local
|
|
7
7
|
// working copy's intent journal. Runtime-neutral, like the seam it extends.
|
|
@@ -9,4 +9,7 @@ export { IntentHoldConflict, IntentStateConflict } from "./journaled-backend.js"
|
|
|
9
9
|
// The wire request identity (`WriteOptions.requestId`) and the outcome shape an authority records
|
|
10
10
|
// for it: runtime-neutral, so Worker and browser consumers reach them through this seam.
|
|
11
11
|
export { isRequestIdentity } from "./uncertain-write.js";
|
|
12
|
+
// The heads digest a wire authority and a working copy both mint over every document id and
|
|
13
|
+
// version, so a client can learn in one round trip whether anything changed.
|
|
14
|
+
export { headsDigest, isHeadsDigest, sortHeads } from "./heads-digest.js";
|
|
12
15
|
//# sourceMappingURL=storage.js.map
|
package/dist/storage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAqB1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,OAAO,GACR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,+FAA+F;AAC/F,4EAA4E;AAC5E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAqB1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,OAAO,GACR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,+FAA+F;AAC/F,4EAA4E;AAC5E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAcjF,kGAAkG;AAClG,yFAAyF;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,4FAA4F;AAC5F,6EAA6E;AAC7E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -140,7 +140,8 @@ export interface ReadBlobResult {
|
|
|
140
140
|
export interface VersionInfo {
|
|
141
141
|
/** Opaque content-addressed version token for this revision. */
|
|
142
142
|
version: Version;
|
|
143
|
-
/** Who wrote this revision.
|
|
143
|
+
/** Who wrote this revision. History-keeping backends default at write time to a local identity.
|
|
144
|
+
* FilesystemBackend reports `unattributed` when document bytes carry no mutation attribution. */
|
|
144
145
|
actor: string;
|
|
145
146
|
/** ISO-8601 instant this revision was recorded. */
|
|
146
147
|
timestamp: string;
|
|
@@ -349,11 +350,16 @@ export interface StorageBackend {
|
|
|
349
350
|
* a facet it chooses to honor. A backend that does not implement this method
|
|
350
351
|
* (FilesystemBackend / MemoryBackend — both local to their data, where a head projection
|
|
351
352
|
* saves nothing) is served by the engine's fallback (`list` +
|
|
352
|
-
* `readMany`, bodies read then dropped)
|
|
353
|
-
*
|
|
354
|
-
*
|
|
353
|
+
* `readMany`, bodies read then dropped). Both paths honor the scan's malformed-doc
|
|
354
|
+
* resilience: given `onSkip`, a backend reports each document it could not parse there and
|
|
355
|
+
* leaves it out; without it, a malformed document fails the scan.
|
|
355
356
|
*/
|
|
356
|
-
queryHeads?(filter?: QueryFilter
|
|
357
|
+
queryHeads?(filter?: QueryFilter, options?: {
|
|
358
|
+
onSkip?: (skip: {
|
|
359
|
+
id: ConceptId;
|
|
360
|
+
reason: string;
|
|
361
|
+
}) => void;
|
|
362
|
+
}): Promise<HeadResult[]>;
|
|
357
363
|
/**
|
|
358
364
|
* OPTIONAL capabilities self-declaration. `StorageBackend` carries
|
|
359
365
|
* no capabilities descriptor by default, so a wire router that wants to report an adapter's
|
|
@@ -395,6 +401,23 @@ export interface QueryFilter {
|
|
|
395
401
|
* (e.g. `tags: [a,b]`) matches on membership. A field the doc lacks never matches (empty set).
|
|
396
402
|
*/
|
|
397
403
|
fields?: Record<string, string>;
|
|
404
|
+
/**
|
|
405
|
+
* Restrict to concepts whose `sources` list holds at least one entry carrying this identity
|
|
406
|
+
* (see {@link SourceIdentity}). A selector naming neither key imposes no constraint, like an
|
|
407
|
+
* empty `tags` list.
|
|
408
|
+
*/
|
|
409
|
+
sources?: SourceIdentity;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* An OKF `sources[]` identity: `resource` names the provider namespace and `id` the record within
|
|
413
|
+
* it. Each supplied key must equal the entry's own property of the same name by exact,
|
|
414
|
+
* case-sensitive string comparison: no trimming, URL normalization, or `String()` coercion. An
|
|
415
|
+
* entry that is not a mapping, or whose property is absent or not a string, never matches, and
|
|
416
|
+
* neither does a `sources` value that is not a list.
|
|
417
|
+
*/
|
|
418
|
+
export interface SourceIdentity {
|
|
419
|
+
resource?: string;
|
|
420
|
+
id?: string;
|
|
398
421
|
}
|
|
399
422
|
/** A single resolved outbound cross-link (a standard markdown link, never a wikilink). */
|
|
400
423
|
export interface Link {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,uJAAuJ;IACvJ,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB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AU,CAAC,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iGAAiG;IACjG,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,mDAAmD;AACnD,MAAM,WAAW,eAAe;IAC9B,uFAAuF;IACvF,OAAO,EAAE,gBAAgB,CAAC;IAC1B,yGAAyG;IACzG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -16,8 +16,11 @@
|
|
|
16
16
|
* injectable clock, and a transport's own latency is real.
|
|
17
17
|
*/
|
|
18
18
|
import type { Version } from "./types.js";
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The operation an intent performs: a whole-document write, or `document.delete` (the document
|
|
21
|
+
* leaves at exactly the intent's base). The union is open.
|
|
22
|
+
*/
|
|
23
|
+
export type OperationKind = "document.write" | "document.delete" | (string & {});
|
|
21
24
|
/**
|
|
22
25
|
* The journal states of an intent. `unknown` is the primitive's own classification of an
|
|
23
26
|
* exhausted attempt: the authority may or may not hold the write, and a later attempt begins
|
|
@@ -31,6 +34,15 @@ export interface OperationIntent {
|
|
|
31
34
|
kind: OperationKind;
|
|
32
35
|
/** The target the operation applies to; a concept id for `document.write`. */
|
|
33
36
|
target: string;
|
|
37
|
+
/**
|
|
38
|
+
* The tombstone a create acknowledges it re-creates: the id's latest deletion, as the
|
|
39
|
+
* authority named it. Set only by an explicit decision to re-create a deleted document (the
|
|
40
|
+
* caller's own observed delete, or `keep` on a "deleted remotely" conflict), and only on a
|
|
41
|
+
* create recorded after that decision; never inferred by a transport. An authority whose latest
|
|
42
|
+
* deletion of the id is another one refuses the create, and the refusal comes back as a
|
|
43
|
+
* conflict.
|
|
44
|
+
*/
|
|
45
|
+
recreates?: Version;
|
|
34
46
|
/** The shared version the local edit was made against, or `null` for a create. */
|
|
35
47
|
base: Version | null;
|
|
36
48
|
/** The content-addressed version of `content`. */
|
|
@@ -50,9 +62,17 @@ export interface OperationIntent {
|
|
|
50
62
|
export type Outcome = {
|
|
51
63
|
kind: "committed";
|
|
52
64
|
version: Version;
|
|
53
|
-
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The shared head moved. `actual` is the version the authority serves now, or `null` when it
|
|
68
|
+
* serves none ("deleted remotely"). With `actual: null`, `tombstone` names the deletion the
|
|
69
|
+
* authority reported, when it reported one: the acknowledgement a deliberate re-create sends.
|
|
70
|
+
* It is never a version any read serves, so it is never a base or a remote version.
|
|
71
|
+
*/
|
|
72
|
+
| {
|
|
54
73
|
kind: "conflict";
|
|
55
74
|
actual: Version | null;
|
|
75
|
+
tombstone?: Version;
|
|
56
76
|
} | {
|
|
57
77
|
kind: "refused";
|
|
58
78
|
code: string;
|
|
@@ -72,6 +92,8 @@ export interface OperationTransport {
|
|
|
72
92
|
/** Wait `ms`, resolving early and harmlessly when `signal` aborts. Injected by tests. */
|
|
73
93
|
export type Sleep = (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
74
94
|
export interface UncertainWriteOptions {
|
|
95
|
+
/** Exact-content writes may settle matching conflicts; governed writes require recorded evidence. */
|
|
96
|
+
settlement?: "exact-content" | "recorded-only";
|
|
75
97
|
/** How long one submission may take before its outcome is treated as unknown. */
|
|
76
98
|
deadlineMs?: number;
|
|
77
99
|
/** Lookups attempted after an unknown submission before giving up (default 3). */
|
|
@@ -90,7 +112,11 @@ export interface UncertainWriteResult {
|
|
|
90
112
|
/** How many times `lookup` was called in this call. */
|
|
91
113
|
lookups: number;
|
|
92
114
|
}
|
|
93
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* Refusal codes that pause shared operations rather than say the content is wrong: the caller's
|
|
117
|
+
* authorization is gone, or a hosted sync quota (`REQUEST_CAPACITY_*`, one per scope the host
|
|
118
|
+
* names) is spent. Nothing is lost; the refused intents are requeued when the store resumes.
|
|
119
|
+
*/
|
|
94
120
|
export declare const AUTHORIZATION_REFUSAL_CODES: ReadonlySet<string>;
|
|
95
121
|
/** True when a refusal reports lost permission, which pauses further shared operations. */
|
|
96
122
|
export declare function isAuthorizationRefusal(outcome: Outcome): boolean;
|
|
@@ -114,10 +140,12 @@ export declare function mintRequestId(): string;
|
|
|
114
140
|
* at that version. This is the wire's post-expiry compare-and-swap property: a committed write
|
|
115
141
|
* whose acknowledgement was lost and whose recorded outcome expired from the authority's
|
|
116
142
|
* retention window is resubmitted with its original `base`, which no longer matches, and the
|
|
117
|
-
* authority answers a conflict against the version the client itself committed.
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
143
|
+
* authority answers a conflict against the version the client itself committed. If the head
|
|
144
|
+
* has meanwhile returned to `base` exactly, the premise matches and the resubmission is applied
|
|
145
|
+
* again instead (see {@link performUncertainWrite}). The mapping depends only on the outcome and
|
|
146
|
+
* the intent, so the primitive owns it and every consumer settles such a write as acknowledged
|
|
147
|
+
* rather than presenting it as a concurrent edit. Every other conflict, including one against
|
|
148
|
+
* an absent head (`actual: null`), is returned unchanged.
|
|
121
149
|
*/
|
|
122
150
|
export declare function settleAgainstIntent(outcome: Outcome, intent: OperationIntent): Outcome;
|
|
123
151
|
/**
|
|
@@ -125,9 +153,9 @@ export declare function settleAgainstIntent(outcome: Outcome, intent: OperationI
|
|
|
125
153
|
*
|
|
126
154
|
* Flow: when the intent has never been submitted, submit it; when it has (`attempts > 0`), or
|
|
127
155
|
* when a submission's outcome is unknown, look the request identity up. A positive lookup
|
|
128
|
-
* settles the intent. A `null` lookup
|
|
129
|
-
* resubmission with the same `requestId` is the first delivery and is allowed, up
|
|
130
|
-
* `maxSubmissions`. A lookup that fails leaves the outcome unknown and the intent for a later
|
|
156
|
+
* settles the intent. A `null` lookup is taken as proof that the authority never recorded the
|
|
157
|
+
* request, so a resubmission with the same `requestId` is the first delivery and is allowed, up
|
|
158
|
+
* to `maxSubmissions`. A lookup that fails leaves the outcome unknown and the intent for a later
|
|
131
159
|
* call.
|
|
132
160
|
*
|
|
133
161
|
* No resubmission happens without a `null` lookup because a blind retry after an unknown
|
|
@@ -135,8 +163,16 @@ export declare function settleAgainstIntent(outcome: Outcome, intent: OperationI
|
|
|
135
163
|
* twice, and even on one with it the retry can only ever learn what the lookup already knew.
|
|
136
164
|
* The lookup is what turns "unknown" into a fact before any second delivery.
|
|
137
165
|
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
166
|
+
* That fact is only as good as the transport's `null`. An authority that has expired or lost a
|
|
167
|
+
* record answers as if it never recorded it, and the reference wire transport returns `null`
|
|
168
|
+
* then. The resubmission is guarded only by its `base`, and versions are content hashes: if the
|
|
169
|
+
* write had landed and a third party has since restored `base` exactly, the premise matches, the
|
|
170
|
+
* write is applied a second time over that revert, and the outcome is `committed`. The hosted
|
|
171
|
+
* transport never answers `null` for an absent record once the intent is older than the host's
|
|
172
|
+
* stated retention window, less a skew margin, so it does not resubmit there.
|
|
173
|
+
*
|
|
174
|
+
* By default every outcome passes through {@link settleAgainstIntent}, so a conflict naming the
|
|
175
|
+
* intent's own version is committed. `recorded-only` preserves the recorded outcome instead.
|
|
140
176
|
*/
|
|
141
177
|
export declare function performUncertainWrite(transport: OperationTransport, intent: OperationIntent, options?: UncertainWriteOptions): Promise<UncertainWriteResult>;
|
|
142
178
|
//# sourceMappingURL=uncertain-write.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uncertain-write.d.ts","sourceRoot":"","sources":["../src/uncertain-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"uncertain-write.d.ts","sourceRoot":"","sources":["../src/uncertain-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;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;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAKtF;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,kBAAkB,EAC7B,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CA4C/B"}
|
package/dist/uncertain-write.js
CHANGED
|
@@ -15,8 +15,19 @@
|
|
|
15
15
|
* `sleep` used for the submission deadline and the delay between lookups; there is no
|
|
16
16
|
* injectable clock, and a transport's own latency is real.
|
|
17
17
|
*/
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Refusal codes that pause shared operations rather than say the content is wrong: the caller's
|
|
20
|
+
* authorization is gone, or a hosted sync quota (`REQUEST_CAPACITY_*`, one per scope the host
|
|
21
|
+
* names) is spent. Nothing is lost; the refused intents are requeued when the store resumes.
|
|
22
|
+
*/
|
|
23
|
+
export const AUTHORIZATION_REFUSAL_CODES = new Set([
|
|
24
|
+
"AUTH_REQUIRED",
|
|
25
|
+
"FORBIDDEN",
|
|
26
|
+
"UNAUTHORIZED",
|
|
27
|
+
"PERMISSION_DENIED",
|
|
28
|
+
"REQUEST_CAPACITY_PRINCIPAL",
|
|
29
|
+
"REQUEST_CAPACITY_BUNDLE",
|
|
30
|
+
]);
|
|
20
31
|
/** True when a refusal reports lost permission, which pauses further shared operations. */
|
|
21
32
|
export function isAuthorizationRefusal(outcome) {
|
|
22
33
|
return outcome.kind === "refused" && AUTHORIZATION_REFUSAL_CODES.has(outcome.code);
|
|
@@ -77,10 +88,12 @@ const UNKNOWN = { kind: "unknown" };
|
|
|
77
88
|
* at that version. This is the wire's post-expiry compare-and-swap property: a committed write
|
|
78
89
|
* whose acknowledgement was lost and whose recorded outcome expired from the authority's
|
|
79
90
|
* retention window is resubmitted with its original `base`, which no longer matches, and the
|
|
80
|
-
* authority answers a conflict against the version the client itself committed.
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
91
|
+
* authority answers a conflict against the version the client itself committed. If the head
|
|
92
|
+
* has meanwhile returned to `base` exactly, the premise matches and the resubmission is applied
|
|
93
|
+
* again instead (see {@link performUncertainWrite}). The mapping depends only on the outcome and
|
|
94
|
+
* the intent, so the primitive owns it and every consumer settles such a write as acknowledged
|
|
95
|
+
* rather than presenting it as a concurrent edit. Every other conflict, including one against
|
|
96
|
+
* an absent head (`actual: null`), is returned unchanged.
|
|
84
97
|
*/
|
|
85
98
|
export function settleAgainstIntent(outcome, intent) {
|
|
86
99
|
if (outcome.kind === "conflict" && outcome.actual !== null && outcome.actual === intent.local) {
|
|
@@ -112,9 +125,9 @@ async function submitOnce(transport, intent, deadlineMs, sleep) {
|
|
|
112
125
|
*
|
|
113
126
|
* Flow: when the intent has never been submitted, submit it; when it has (`attempts > 0`), or
|
|
114
127
|
* when a submission's outcome is unknown, look the request identity up. A positive lookup
|
|
115
|
-
* settles the intent. A `null` lookup
|
|
116
|
-
* resubmission with the same `requestId` is the first delivery and is allowed, up
|
|
117
|
-
* `maxSubmissions`. A lookup that fails leaves the outcome unknown and the intent for a later
|
|
128
|
+
* settles the intent. A `null` lookup is taken as proof that the authority never recorded the
|
|
129
|
+
* request, so a resubmission with the same `requestId` is the first delivery and is allowed, up
|
|
130
|
+
* to `maxSubmissions`. A lookup that fails leaves the outcome unknown and the intent for a later
|
|
118
131
|
* call.
|
|
119
132
|
*
|
|
120
133
|
* No resubmission happens without a `null` lookup because a blind retry after an unknown
|
|
@@ -122,10 +135,21 @@ async function submitOnce(transport, intent, deadlineMs, sleep) {
|
|
|
122
135
|
* twice, and even on one with it the retry can only ever learn what the lookup already knew.
|
|
123
136
|
* The lookup is what turns "unknown" into a fact before any second delivery.
|
|
124
137
|
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
138
|
+
* That fact is only as good as the transport's `null`. An authority that has expired or lost a
|
|
139
|
+
* record answers as if it never recorded it, and the reference wire transport returns `null`
|
|
140
|
+
* then. The resubmission is guarded only by its `base`, and versions are content hashes: if the
|
|
141
|
+
* write had landed and a third party has since restored `base` exactly, the premise matches, the
|
|
142
|
+
* write is applied a second time over that revert, and the outcome is `committed`. The hosted
|
|
143
|
+
* transport never answers `null` for an absent record once the intent is older than the host's
|
|
144
|
+
* stated retention window, less a skew margin, so it does not resubmit there.
|
|
145
|
+
*
|
|
146
|
+
* By default every outcome passes through {@link settleAgainstIntent}, so a conflict naming the
|
|
147
|
+
* intent's own version is committed. `recorded-only` preserves the recorded outcome instead.
|
|
127
148
|
*/
|
|
128
149
|
export async function performUncertainWrite(transport, intent, options = {}) {
|
|
150
|
+
if (options.settlement !== undefined && options.settlement !== "exact-content" && options.settlement !== "recorded-only") {
|
|
151
|
+
throw new Error("Unknown uncertain-write settlement mode.");
|
|
152
|
+
}
|
|
129
153
|
const sleep = options.sleep ?? defaultSleep;
|
|
130
154
|
const maxLookups = Math.max(1, options.maxLookups ?? 3);
|
|
131
155
|
const maxSubmissions = Math.max(1, options.maxSubmissions ?? 2);
|
|
@@ -134,7 +158,7 @@ export async function performUncertainWrite(transport, intent, options = {}) {
|
|
|
134
158
|
let submissions = 0;
|
|
135
159
|
let lookups = 0;
|
|
136
160
|
const finish = (raw) => {
|
|
137
|
-
const outcome = settleAgainstIntent(raw, intent);
|
|
161
|
+
const outcome = options.settlement === "recorded-only" ? raw : settleAgainstIntent(raw, intent);
|
|
138
162
|
return { intent: { ...intent, attempts, state: stateForOutcome(outcome) }, outcome, lookups };
|
|
139
163
|
};
|
|
140
164
|
// A previously submitted intent starts at the lookup, never at a submission.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uncertain-write.js","sourceRoot":"","sources":["../src/uncertain-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"uncertain-write.js","sourceRoot":"","sources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C,CAAC;QACzD,CAAC;QACD,cAAc,GAAG,KAAK,CAAC;QACvB,IAAI,QAAoC,CAAC;QACzC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC;YAChD,IAAI,KAAK,GAAG,CAAC;gBAAE,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC;YAC1C,OAAO,IAAI,CAAC,CAAC;YACb,IAAI,CAAC;gBACH,QAAQ,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACtD,CAAC;YAAC,MAAM,CAAC;gBACP,QAAQ,GAAG,SAAS,CAAC;gBACrB,SAAS;YACX,CAAC;YACD,MAAM;QACR,CAAC;QACD,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;QACnD,IAAI,QAAQ,KAAK,IAAI;YAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC/C,cAAc,GAAG,IAAI,CAAC;IACxB,CAAC;AACH,CAAC"}
|
package/dist/versioning.d.ts
CHANGED
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
* These make the seam's "hardest case" (content-addressed versions, compare-and-swap
|
|
5
5
|
* writes, actor attribution) implementable uniformly across adapters:
|
|
6
6
|
* - {@link contentVersion} defines the opaque {@link Version} token as a SHA-256 over
|
|
7
|
-
* the canonically serialized document
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* the canonically serialized document. A version token is a property of a backend,
|
|
8
|
+
* not of the content: the filesystem adapter hashes the on-disk bytes exactly as
|
|
9
|
+
* written, so a hand-authored file keeps its bytes and its token; the in-memory and
|
|
10
|
+
* wire adapters hash a re-serialization, which folds long strings, expands flow
|
|
11
|
+
* sequences and normalizes timestamps, so content Superbee did not author may carry a
|
|
12
|
+
* different token there. An engine-written document carries the same token in either
|
|
13
|
+
* store, because the engine wrote the canonical bytes. Bytes are the promise that
|
|
14
|
+
* travels between backends (decision of 2026-09-17, "bytes win"); no promise rests on
|
|
15
|
+
* cross-backend token equality.
|
|
11
16
|
* - {@link blobVersion} is the SAME idea for opaque blob bytes, but hashes the raw
|
|
12
17
|
* `Uint8Array` directly with no string/UTF-8 step — a doc-shaped hash would corrupt
|
|
13
18
|
* binary content, so blobs get their own primitive rather than reusing `contentVersion`
|
package/dist/versioning.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../src/versioning.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../src/versioning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE7F,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAExD;AAED,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAGrC"}
|
package/dist/versioning.js
CHANGED
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
* These make the seam's "hardest case" (content-addressed versions, compare-and-swap
|
|
5
5
|
* writes, actor attribution) implementable uniformly across adapters:
|
|
6
6
|
* - {@link contentVersion} defines the opaque {@link Version} token as a SHA-256 over
|
|
7
|
-
* the canonically serialized document
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* the canonically serialized document. A version token is a property of a backend,
|
|
8
|
+
* not of the content: the filesystem adapter hashes the on-disk bytes exactly as
|
|
9
|
+
* written, so a hand-authored file keeps its bytes and its token; the in-memory and
|
|
10
|
+
* wire adapters hash a re-serialization, which folds long strings, expands flow
|
|
11
|
+
* sequences and normalizes timestamps, so content Superbee did not author may carry a
|
|
12
|
+
* different token there. An engine-written document carries the same token in either
|
|
13
|
+
* store, because the engine wrote the canonical bytes. Bytes are the promise that
|
|
14
|
+
* travels between backends (decision of 2026-09-17, "bytes win"); no promise rests on
|
|
15
|
+
* cross-backend token equality.
|
|
11
16
|
* - {@link blobVersion} is the SAME idea for opaque blob bytes, but hashes the raw
|
|
12
17
|
* `Uint8Array` directly with no string/UTF-8 step — a doc-shaped hash would corrupt
|
|
13
18
|
* binary content, so blobs get their own primitive rather than reusing `contentVersion`
|
package/dist/versioning.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioning.js","sourceRoot":"","sources":["../src/versioning.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"versioning.js","sourceRoot":"","sources":["../src/versioning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE7F,sFAAsF;AACtF,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,GAAgB;IAC7C,OAAO,UAAU,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AAC9E,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,OAAO,UAAU,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;AACpC,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CAAC,KAAiB;IAC3C,OAAO,UAAU,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,GAAG,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IACrE,OAAO,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC;AACvF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superbee/core",
|
|
3
|
-
"version": "0.2.0-pre.
|
|
3
|
+
"version": "0.2.0-pre.10",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "OKF store engine
|
|
5
|
+
"description": "OKF store engine \u2014 bundle I/O, cross-links, derived backlinks, freshness, and versioned writes.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"./dist/bundle.js"
|
|
16
16
|
],
|
|
17
17
|
"exports": {
|
|
18
|
+
"./governed-body-write": {
|
|
19
|
+
"types": "./dist/governed-body-write.d.ts",
|
|
20
|
+
"default": "./dist/governed-body-write.js"
|
|
21
|
+
},
|
|
18
22
|
"./view-admission": {
|
|
19
23
|
"types": "./dist/view-admission.d.ts",
|
|
20
24
|
"default": "./dist/view-admission.js"
|
|
@@ -71,6 +75,10 @@
|
|
|
71
75
|
"types": "./dist/publication-filesystem.d.ts",
|
|
72
76
|
"default": "./dist/publication-filesystem.js"
|
|
73
77
|
},
|
|
78
|
+
"./query-order": {
|
|
79
|
+
"types": "./dist/query-order.d.ts",
|
|
80
|
+
"default": "./dist/query-order.js"
|
|
81
|
+
},
|
|
74
82
|
"./query-filter": {
|
|
75
83
|
"types": "./dist/query-filter.d.ts",
|
|
76
84
|
"default": "./dist/query-filter.js"
|
|
@@ -87,6 +95,10 @@
|
|
|
87
95
|
"types": "./dist/remote-operations.d.ts",
|
|
88
96
|
"default": "./dist/remote-operations.js"
|
|
89
97
|
},
|
|
98
|
+
"./hosted-transport": {
|
|
99
|
+
"types": "./dist/hosted-transport/index.d.ts",
|
|
100
|
+
"default": "./dist/hosted-transport/index.js"
|
|
101
|
+
},
|
|
90
102
|
"./storage": {
|
|
91
103
|
"types": "./dist/storage.d.ts",
|
|
92
104
|
"default": "./dist/storage.js"
|
|
@@ -107,6 +119,10 @@
|
|
|
107
119
|
"types": "./dist/journaled-backend.d.ts",
|
|
108
120
|
"default": "./dist/journaled-backend.js"
|
|
109
121
|
},
|
|
122
|
+
"./file-journaled-backend": {
|
|
123
|
+
"types": "./dist/file-journaled-backend.d.ts",
|
|
124
|
+
"default": "./dist/file-journaled-backend.js"
|
|
125
|
+
},
|
|
110
126
|
"./uncertain-write": {
|
|
111
127
|
"types": "./dist/uncertain-write.d.ts",
|
|
112
128
|
"default": "./dist/uncertain-write.js"
|
|
@@ -114,6 +130,22 @@
|
|
|
114
130
|
"./platform": {
|
|
115
131
|
"types": "./dist/platform.d.ts",
|
|
116
132
|
"default": "./dist/platform.js"
|
|
133
|
+
},
|
|
134
|
+
"./filesystem": {
|
|
135
|
+
"types": "./dist/filesystem.d.ts",
|
|
136
|
+
"default": "./dist/filesystem.js"
|
|
137
|
+
},
|
|
138
|
+
"./filesystem-push-role": {
|
|
139
|
+
"types": "./dist/filesystem-push-role.d.ts",
|
|
140
|
+
"default": "./dist/filesystem-push-role.js"
|
|
141
|
+
},
|
|
142
|
+
"./artifact-contract": {
|
|
143
|
+
"types": "./dist/artifact-contract.d.ts",
|
|
144
|
+
"default": "./dist/artifact-contract.js"
|
|
145
|
+
},
|
|
146
|
+
"./portable-export": {
|
|
147
|
+
"types": "./dist/portable-export.d.ts",
|
|
148
|
+
"default": "./dist/portable-export.js"
|
|
117
149
|
}
|
|
118
150
|
},
|
|
119
151
|
"files": [
|