@superbee/core 0.1.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.
- package/dist/backend.d.ts +77 -0
- package/dist/backend.d.ts.map +1 -0
- package/dist/backend.js +380 -0
- package/dist/backend.js.map +1 -0
- package/dist/bundle.d.ts +38 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +107 -0
- package/dist/bundle.js.map +1 -0
- package/dist/content-type.d.ts +72 -0
- package/dist/content-type.d.ts.map +1 -0
- package/dist/content-type.js +149 -0
- package/dist/content-type.js.map +1 -0
- package/dist/document-mutation.d.ts +83 -0
- package/dist/document-mutation.d.ts.map +1 -0
- package/dist/document-mutation.js +319 -0
- package/dist/document-mutation.js.map +1 -0
- package/dist/document-precondition.d.ts +62 -0
- package/dist/document-precondition.d.ts.map +1 -0
- package/dist/document-precondition.js +134 -0
- package/dist/document-precondition.js.map +1 -0
- package/dist/document-write-policy.d.ts +42 -0
- package/dist/document-write-policy.d.ts.map +1 -0
- package/dist/document-write-policy.js +134 -0
- package/dist/document-write-policy.js.map +1 -0
- package/dist/engine.d.ts +48 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +209 -0
- package/dist/engine.js.map +1 -0
- package/dist/errors.d.ts +36 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +50 -0
- package/dist/errors.js.map +1 -0
- package/dist/filesystem-identity.d.ts +208 -0
- package/dist/filesystem-identity.d.ts.map +1 -0
- package/dist/filesystem-identity.js +675 -0
- package/dist/filesystem-identity.js.map +1 -0
- package/dist/filesystem-lock.d.ts +65 -0
- package/dist/filesystem-lock.d.ts.map +1 -0
- package/dist/filesystem-lock.js +460 -0
- package/dist/filesystem-lock.js.map +1 -0
- package/dist/freshness.d.ts +31 -0
- package/dist/freshness.d.ts.map +1 -0
- package/dist/freshness.js +98 -0
- package/dist/freshness.js.map +1 -0
- package/dist/frontmatter-contract.d.ts +17 -0
- package/dist/frontmatter-contract.d.ts.map +1 -0
- package/dist/frontmatter-contract.js +29 -0
- package/dist/frontmatter-contract.js.map +1 -0
- package/dist/frontmatter.d.ts +30 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/frontmatter.js +115 -0
- package/dist/frontmatter.js.map +1 -0
- package/dist/index-marker.d.ts +3 -0
- package/dist/index-marker.d.ts.map +1 -0
- package/dist/index-marker.js +3 -0
- package/dist/index-marker.js.map +1 -0
- package/dist/index-projection.d.ts +79 -0
- package/dist/index-projection.d.ts.map +1 -0
- package/dist/index-projection.js +245 -0
- package/dist/index-projection.js.map +1 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +110 -0
- package/dist/index.js.map +1 -0
- package/dist/kinds-load.d.ts +13 -0
- package/dist/kinds-load.d.ts.map +1 -0
- package/dist/kinds-load.js +34 -0
- package/dist/kinds-load.js.map +1 -0
- package/dist/kinds.d.ts +241 -0
- package/dist/kinds.d.ts.map +1 -0
- package/dist/kinds.js +1001 -0
- package/dist/kinds.js.map +1 -0
- package/dist/links.d.ts +62 -0
- package/dist/links.d.ts.map +1 -0
- package/dist/links.js +203 -0
- package/dist/links.js.map +1 -0
- package/dist/meaningful-change-time.d.ts +11 -0
- package/dist/meaningful-change-time.d.ts.map +1 -0
- package/dist/meaningful-change-time.js +16 -0
- package/dist/meaningful-change-time.js.map +1 -0
- package/dist/memory-backend.d.ts +55 -0
- package/dist/memory-backend.d.ts.map +1 -0
- package/dist/memory-backend.js +214 -0
- package/dist/memory-backend.js.map +1 -0
- package/dist/mutation-attribution.d.ts +19 -0
- package/dist/mutation-attribution.d.ts.map +1 -0
- package/dist/mutation-attribution.js +34 -0
- package/dist/mutation-attribution.js.map +1 -0
- package/dist/mutation.d.ts +89 -0
- package/dist/mutation.d.ts.map +1 -0
- package/dist/mutation.js +94 -0
- package/dist/mutation.js.map +1 -0
- package/dist/page.d.ts +87 -0
- package/dist/page.d.ts.map +1 -0
- package/dist/page.js +151 -0
- package/dist/page.js.map +1 -0
- package/dist/paths.d.ts +78 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +148 -0
- package/dist/paths.js.map +1 -0
- package/dist/portable-frontmatter.d.ts +8 -0
- package/dist/portable-frontmatter.d.ts.map +1 -0
- package/dist/portable-frontmatter.js +35 -0
- package/dist/portable-frontmatter.js.map +1 -0
- package/dist/publication-filesystem.d.ts +6 -0
- package/dist/publication-filesystem.d.ts.map +1 -0
- package/dist/publication-filesystem.js +6 -0
- package/dist/publication-filesystem.js.map +1 -0
- package/dist/query-filter.d.ts +12 -0
- package/dist/query-filter.d.ts.map +1 -0
- package/dist/query-filter.js +29 -0
- package/dist/query-filter.js.map +1 -0
- package/dist/query-selection.d.ts +25 -0
- package/dist/query-selection.d.ts.map +1 -0
- package/dist/query-selection.js +48 -0
- package/dist/query-selection.js.map +1 -0
- package/dist/remote-backend.d.ts +152 -0
- package/dist/remote-backend.d.ts.map +1 -0
- package/dist/remote-backend.js +505 -0
- package/dist/remote-backend.js.map +1 -0
- package/dist/remote.d.ts +4 -0
- package/dist/remote.d.ts.map +1 -0
- package/dist/remote.js +3 -0
- package/dist/remote.js.map +1 -0
- package/dist/storage.d.ts +7 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +6 -0
- package/dist/storage.js.map +1 -0
- package/dist/types.d.ts +438 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/dist/validation.d.ts +22 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +12 -0
- package/dist/validation.js.map +1 -0
- package/dist/version-transport.d.ts +13 -0
- package/dist/version-transport.d.ts.map +1 -0
- package/dist/version-transport.js +26 -0
- package/dist/version-transport.js.map +1 -0
- package/dist/versioning.d.ts +48 -0
- package/dist/versioning.d.ts.map +1 -0
- package/dist/versioning.js +62 -0
- package/dist/versioning.js.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1 @@
|
|
|
1
|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AAM,IAAI,EAAE,CAAC,CAAC;YACzD,MAAM,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAoD,CAAC;YACtF,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,OAAO,CAAC,WAAW;gBAAE,MAAM;YAChC,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;QAC/B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/dist/remote.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACjE,YAAY,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/remote.js
ADDED
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Runtime-neutral storage contract for Worker, browser, and custom backend consumers. */
|
|
2
|
+
export type { BlobKey, ConceptId, DeleteOptions, Frontmatter, HeadResult, OkfDocument, QueryFilter, ReadBlobResult, ReadResult, ReservedFilename, ReservedReadResult, StorageBackend, StorageCapabilities, Version, VersionInfo, WriteOptions, } from "./types.js";
|
|
3
|
+
export { InvalidInputError } from "./errors.js";
|
|
4
|
+
export { MalformedDocumentError } from "./frontmatter-contract.js";
|
|
5
|
+
export { RESERVED_FILENAMES, assertSafeBlobKey, assertSafeConceptId, assertSafeReservedDir, conceptIdFromPath, isReservedFile, pathFromConceptId, toPosix, } from "./paths.js";
|
|
6
|
+
export { VersionConflict, stripETagWrapper } from "./version-transport.js";
|
|
7
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +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,EACrB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,OAAO,GACR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/storage.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Runtime-neutral storage contract for Worker, browser, and custom backend consumers. */
|
|
2
|
+
export { InvalidInputError } from "./errors.js";
|
|
3
|
+
export { MalformedDocumentError } from "./frontmatter-contract.js";
|
|
4
|
+
export { RESERVED_FILENAMES, assertSafeBlobKey, assertSafeConceptId, assertSafeReservedDir, conceptIdFromPath, isReservedFile, pathFromConceptId, toPosix, } from "./paths.js";
|
|
5
|
+
export { VersionConflict, stripETagWrapper } from "./version-transport.js";
|
|
6
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +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,MAAM,wBAAwB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared type shapes for the OKF store engine.
|
|
3
|
+
*
|
|
4
|
+
* These are the contract types originally sketched in `index.ts`; they are kept
|
|
5
|
+
* here so the implementation modules can import them without a cycle, and are
|
|
6
|
+
* re-exported verbatim from `index.ts` to keep the public contract stable.
|
|
7
|
+
*
|
|
8
|
+
* @see OKF spec — GoogleCloudPlatform/knowledge-catalog, `okf/SPEC.md`
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* A concept's stable identity within a bundle: its path relative to the bundle
|
|
13
|
+
* root with exactly the final `.md` removed (e.g. `tables/users`). IDs always use
|
|
14
|
+
* forward slashes and are canonical storage keys, not file-like aliases: `x` maps
|
|
15
|
+
* to `x.md`, while canonical id `x.md` maps to the distinct file `x.md.md`.
|
|
16
|
+
* Directory hierarchy implies parent/child but is NOT emitted as graph edges —
|
|
17
|
+
* only explicit body links are.
|
|
18
|
+
*/
|
|
19
|
+
export type ConceptId = string;
|
|
20
|
+
/**
|
|
21
|
+
* A blob's stable identity within a bundle: a bundle-relative path key (e.g.
|
|
22
|
+
* `artifacts/report.html`). Unlike a {@link ConceptId}, a blob key is the LITERAL
|
|
23
|
+
* relative path (no `.md` stripped) and the blob/concept namespaces are disjoint by
|
|
24
|
+
* construction — a blob key may never end in `.md` (see `assertSafeBlobKey` in
|
|
25
|
+
* `paths.ts`), so the concept walk never has to distinguish the two kinds of file by
|
|
26
|
+
* content, only by extension.
|
|
27
|
+
*/
|
|
28
|
+
export type BlobKey = string;
|
|
29
|
+
/**
|
|
30
|
+
* The parsed YAML frontmatter of a concept document.
|
|
31
|
+
*
|
|
32
|
+
* Per OKF §4.1 the ONLY spec-required field is {@link Frontmatter.type}. All
|
|
33
|
+
* other well-known fields are optional/recommended, and producers MAY add
|
|
34
|
+
* arbitrary extra keys — consumers MUST preserve unknown keys on round-trip and
|
|
35
|
+
* MUST NOT reject a document for carrying them (OKF v0.1 §9 / v0.2 §11 permissive consumption).
|
|
36
|
+
*/
|
|
37
|
+
export interface Frontmatter {
|
|
38
|
+
/** REQUIRED, non-empty. Free-form kind of concept (e.g. `"BigQuery Table"`, `"Spec"`). Not centrally registered; consumers tolerate unknown values. */
|
|
39
|
+
type: string;
|
|
40
|
+
/** Human-readable display name; consumers MAY derive it from the filename if omitted. */
|
|
41
|
+
title?: string;
|
|
42
|
+
/** Single-sentence summary; used by index generators, search snippets, previews. */
|
|
43
|
+
description?: string;
|
|
44
|
+
/** Canonical URI of the underlying asset; correctly ABSENT for abstract concepts. */
|
|
45
|
+
resource?: string;
|
|
46
|
+
/** Cross-cutting categorization tags. */
|
|
47
|
+
tags?: string[];
|
|
48
|
+
/** Legacy v0.1 ISO-8601 datetime of last meaningful change (`generated.at` is the v0.2 clock). */
|
|
49
|
+
timestamp?: string;
|
|
50
|
+
/** Bundle-version marker; permitted ONLY in the bundle-root `index.md` frontmatter (OKF v0.1 §11 / v0.2 §12). */
|
|
51
|
+
okf_version?: string;
|
|
52
|
+
/** Arbitrary producer-defined keys are permitted and preserved on round-trip. */
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
/** A fully parsed concept document: identity, frontmatter, and raw markdown body. */
|
|
56
|
+
export interface OkfDocument {
|
|
57
|
+
/** Concept ID (bundle-relative path minus `.md`). */
|
|
58
|
+
id: ConceptId;
|
|
59
|
+
/** Parsed YAML frontmatter. */
|
|
60
|
+
frontmatter: Frontmatter;
|
|
61
|
+
/** The markdown body following the closing `---` delimiter. */
|
|
62
|
+
body: string;
|
|
63
|
+
}
|
|
64
|
+
/** A handle to an opened bundle rooted at an absolute filesystem directory. */
|
|
65
|
+
export interface Bundle {
|
|
66
|
+
/** Absolute path to the bundle root directory. */
|
|
67
|
+
root: string;
|
|
68
|
+
/**
|
|
69
|
+
* Storage adapter the engine routes I/O through. Optional and defaulted: when
|
|
70
|
+
* omitted, the engine uses a filesystem adapter rooted at {@link Bundle.root}, so
|
|
71
|
+
* existing `{ root }` callers keep working unchanged. Supplying a different
|
|
72
|
+
* {@link StorageBackend} makes a non-filesystem store (e.g. a future remote
|
|
73
|
+
* adapter) a plug-in, not a rewrite.
|
|
74
|
+
*/
|
|
75
|
+
backend?: StorageBackend;
|
|
76
|
+
}
|
|
77
|
+
/** The two OKF reserved filenames the engine reads/writes directly (v0.1 §6/§7; v0.2 §8/§9). */
|
|
78
|
+
export type ReservedFilename = "index.md" | "log.md";
|
|
79
|
+
/**
|
|
80
|
+
* An opaque version token for a stored concept document — the unit of optimistic
|
|
81
|
+
* concurrency. It is CONTENT-ADDRESSED by intent (a SHA-256 over the serialized
|
|
82
|
+
* document), so identical content yields the same token, but callers MUST treat it
|
|
83
|
+
* as opaque: compare it for equality, never parse or order it. A document-centric
|
|
84
|
+
* remote backend uses this exact shape as its per-doc head etag.
|
|
85
|
+
*/
|
|
86
|
+
export type Version = string;
|
|
87
|
+
/** A concept document read from a backend, together with the {@link Version} of the returned bytes. */
|
|
88
|
+
export interface ReadResult {
|
|
89
|
+
/** The parsed concept document. */
|
|
90
|
+
doc: OkfDocument;
|
|
91
|
+
/** Opaque version token of exactly these bytes — pass it back as {@link WriteOptions.expectedVersion} for a compare-and-swap. */
|
|
92
|
+
version: Version;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A concept document's HEAD projection: identity + full frontmatter + version, NEVER the
|
|
96
|
+
* body. This is the row shape `queryHeads` (engine) / {@link StorageBackend.queryHeads}
|
|
97
|
+
* (seam) return — full frontmatter rather than a fixed thin column set because every
|
|
98
|
+
* frontmatter consumer (`--fields` projection, kind-declared columns,
|
|
99
|
+
* {@link QueryFilter.fields} equality) needs arbitrary keys, while bodies are the actual
|
|
100
|
+
* transfer weight a scan does not need.
|
|
101
|
+
*/
|
|
102
|
+
export interface HeadResult {
|
|
103
|
+
/** Concept ID (bundle-relative path minus `.md`). */
|
|
104
|
+
id: ConceptId;
|
|
105
|
+
/** The document's FULL parsed frontmatter. */
|
|
106
|
+
frontmatter: Frontmatter;
|
|
107
|
+
/** Opaque content-addressed version token of the full document these heads project — the same token {@link StorageBackend.read} returns, usable as a CAS basis. */
|
|
108
|
+
version: Version;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The raw content of a reserved file (`index.md` / `log.md`) together with the
|
|
112
|
+
* {@link Version} of exactly those bytes — the CAS basis for a conditional
|
|
113
|
+
* {@link StorageBackend.writeReserved}. Reserved files are unparsed markdown, so
|
|
114
|
+
* their version is the content-address of the raw string (same digest a concept
|
|
115
|
+
* document's on-disk bytes carry), which makes the token identical across adapters.
|
|
116
|
+
*/
|
|
117
|
+
export interface ReservedReadResult {
|
|
118
|
+
/** Raw file content. */
|
|
119
|
+
content: string;
|
|
120
|
+
/** Opaque content-addressed version token of exactly this content. */
|
|
121
|
+
version: Version;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* A blob read from a backend: its raw bytes, resolved MIME content-type, and the
|
|
125
|
+
* {@link Version} of exactly those bytes (the compare-and-swap basis for a later
|
|
126
|
+
* {@link StorageBackend.writeBlob}). The version is a hash of the RAW BYTES (see
|
|
127
|
+
* `blobVersion` in `versioning.ts`) — never routed through a string/UTF-8 encoding,
|
|
128
|
+
* so binary content round-trips byte-identical and hashes identically regardless of
|
|
129
|
+
* backend.
|
|
130
|
+
*/
|
|
131
|
+
export interface ReadBlobResult {
|
|
132
|
+
/** Raw blob bytes, exactly as written. */
|
|
133
|
+
bytes: Uint8Array;
|
|
134
|
+
/** Resolved MIME content-type (see `content-type.ts`'s single resolution point). */
|
|
135
|
+
contentType: string;
|
|
136
|
+
/** Opaque content-addressed version token of exactly these bytes. */
|
|
137
|
+
version: Version;
|
|
138
|
+
}
|
|
139
|
+
/** One entry in a document's version history (newest-first as returned by {@link StorageBackend.versions}). */
|
|
140
|
+
export interface VersionInfo {
|
|
141
|
+
/** Opaque content-addressed version token for this revision. */
|
|
142
|
+
version: Version;
|
|
143
|
+
/** Who wrote this revision. Defaults to a local identity when the write was unattributed. */
|
|
144
|
+
actor: string;
|
|
145
|
+
/** ISO-8601 instant this revision was recorded. */
|
|
146
|
+
timestamp: string;
|
|
147
|
+
/**
|
|
148
|
+
* The client-declared sub-identity/label under {@link VersionInfo.actor} (the principal), when
|
|
149
|
+
* one was attested. ABSENT on backends that record no agent: FilesystemBackend (keeps no
|
|
150
|
+
* history), the reference server / local `--dir` (no auth manufactures it). Only the auth'd
|
|
151
|
+
* worker's `withActor` splits a client's claimed actor into this field under the server-set
|
|
152
|
+
* principal — see the actor-identity design. Free-form, sanitized at the trust boundary.
|
|
153
|
+
*/
|
|
154
|
+
agent?: string;
|
|
155
|
+
}
|
|
156
|
+
/** Options controlling a conditional / attributed {@link StorageBackend.write}. */
|
|
157
|
+
export interface WriteOptions {
|
|
158
|
+
/**
|
|
159
|
+
* Compare-and-swap guard. When set to a {@link Version} token, the write succeeds
|
|
160
|
+
* ONLY if the backend's current version for `id` equals that token; otherwise it
|
|
161
|
+
* throws a typed `VersionConflict`. When set to `null`, the write is an
|
|
162
|
+
* **expect-absent create**: it succeeds ONLY if `id` does not currently exist;
|
|
163
|
+
* otherwise it throws `VersionConflict` (with `expected: null`, `actual: <current>`).
|
|
164
|
+
* This closes the seam's create-race gap — bundle initialization and portable-index
|
|
165
|
+
* projection use it for first-ever-create paths instead of an unconditional write. When omitted
|
|
166
|
+
* entirely, the write is UNCONDITIONAL (last-writer-wins, the historical default).
|
|
167
|
+
* Passing a version token for a not-yet-existing document is also a conflict (its
|
|
168
|
+
* current version is "none").
|
|
169
|
+
*/
|
|
170
|
+
expectedVersion?: Version | null;
|
|
171
|
+
/** Who is performing this write; recorded against the new version. Defaults to a local identity when omitted. */
|
|
172
|
+
actor?: string;
|
|
173
|
+
/**
|
|
174
|
+
* OPTIONAL client-declared agent label recorded ALONGSIDE {@link WriteOptions.actor} (the
|
|
175
|
+
* principal). Additive: a backend that ignores it (FilesystemBackend) or a caller that omits it
|
|
176
|
+
* behaves exactly as before. NOT part of the content-addressed version token, so it never
|
|
177
|
+
* affects CAS or cross-backend token parity.
|
|
178
|
+
*/
|
|
179
|
+
agent?: string;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Options controlling a conditional {@link StorageBackend.delete} / {@link
|
|
183
|
+
* StorageBackend.deleteBlob}. Deliberately NOT {@link WriteOptions}: a delete records no
|
|
184
|
+
* new revision (no `actor` to attribute one to — D5, deleting a document also purges its
|
|
185
|
+
* history, so per-write attribution has nothing left to attach to), and expect-absent is
|
|
186
|
+
* meaningless for a delete (there is no "create" reading of removing something that isn't
|
|
187
|
+
* there) — so unlike `WriteOptions.expectedVersion`, this `expectedVersion` carries NO
|
|
188
|
+
* `null` branch.
|
|
189
|
+
*/
|
|
190
|
+
export interface DeleteOptions {
|
|
191
|
+
/**
|
|
192
|
+
* Compare-and-swap guard. When set, the delete succeeds ONLY if the backend's current
|
|
193
|
+
* version for the target equals this token; otherwise it throws a typed
|
|
194
|
+
* `VersionConflict`. When omitted, the delete is unconditional. In BOTH cases, deleting
|
|
195
|
+
* an already-ABSENT target is never an error and never a conflict — it returns `false`
|
|
196
|
+
* regardless of `expectedVersion` (idempotency, AXI P6: absence is success, not failure).
|
|
197
|
+
*/
|
|
198
|
+
expectedVersion?: Version;
|
|
199
|
+
}
|
|
200
|
+
/** Optional backend capabilities reported without adapter-class inference. */
|
|
201
|
+
export interface StorageCapabilities {
|
|
202
|
+
/** Whether `versions()` retains more than the current revision. */
|
|
203
|
+
history?: boolean;
|
|
204
|
+
/** Whether conditional writes and deletes enforce atomic compare-and-swap. */
|
|
205
|
+
enforced_cas: boolean;
|
|
206
|
+
/** Whether blob operations are implemented for real. */
|
|
207
|
+
blobs: boolean;
|
|
208
|
+
/** Whether query projection push-down is available. */
|
|
209
|
+
projections?: boolean;
|
|
210
|
+
/** Whether server-side backlink traversal is available. */
|
|
211
|
+
backlinks?: boolean;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* The storage seam the OKF engine operates over. The engine keeps ALL OKF
|
|
215
|
+
* semantics (id safety, non-empty `type`, link/backlink derivation, freshness);
|
|
216
|
+
* a backend ONLY persists and retrieves concept documents and the reserved
|
|
217
|
+
* `index.md`/`log.md` files.
|
|
218
|
+
*
|
|
219
|
+
* The contract is deliberately shaped for the HARDEST backend — networked,
|
|
220
|
+
* concurrent, multi-writer, versioned, attributed — so that a document-centric
|
|
221
|
+
* remote store is a plug-in, not a rewrite: {@link StorageBackend.read} surfaces a
|
|
222
|
+
* content-addressed {@link Version}; {@link StorageBackend.write} takes an optional
|
|
223
|
+
* compare-and-swap {@link WriteOptions.expectedVersion} (throwing `VersionConflict`
|
|
224
|
+
* on mismatch) and an {@link WriteOptions.actor}; {@link StorageBackend.versions}
|
|
225
|
+
* exposes history; {@link StorageBackend.readMany} batches reads so link-graph /
|
|
226
|
+
* backlink traversal does not do N single round-trips. `FilesystemBackend` is the
|
|
227
|
+
* DEGENERATE adapter (single-version history, enforced CAS through a same-user cross-process
|
|
228
|
+
* filesystem critical section over the on-disk hash);
|
|
229
|
+
* `MemoryBackend` proves the same contract for the hard case (a real version chain,
|
|
230
|
+
* enforced CAS, per-write attribution).
|
|
231
|
+
*
|
|
232
|
+
* Every `ConceptId` passed through this seam is canonical and exact. Backends MUST NOT
|
|
233
|
+
* normalize aliases independently: the invariant is
|
|
234
|
+
* `conceptIdFromPath(pathFromConceptId(id)) === id`, and the route/write key owns the
|
|
235
|
+
* identity of the returned document even when the input document carries a different `id`.
|
|
236
|
+
*/
|
|
237
|
+
export interface StorageBackend {
|
|
238
|
+
/** Read + parse the concept document at `id`, with its version token. Rejects (ENOENT-shaped) if absent. */
|
|
239
|
+
read(id: ConceptId): Promise<ReadResult>;
|
|
240
|
+
/**
|
|
241
|
+
* Batch-read `ids`, returning results in the SAME order. Rejects (ENOENT-shaped)
|
|
242
|
+
* if any id is absent — callers list-then-read a known set. This is the single
|
|
243
|
+
* round-trip the graph / backlink traversal uses instead of N {@link StorageBackend.read} calls.
|
|
244
|
+
*/
|
|
245
|
+
readMany(ids: ConceptId[]): Promise<ReadResult[]>;
|
|
246
|
+
/**
|
|
247
|
+
* Persist the concept document at `id` (create or overwrite) and return the new
|
|
248
|
+
* {@link Version}. Honors {@link WriteOptions.expectedVersion} (compare-and-swap; a
|
|
249
|
+
* `null` token means expect-ABSENT, i.e. create-if-absent) and records
|
|
250
|
+
* {@link WriteOptions.actor}. With no options this is an unconditional write under a
|
|
251
|
+
* defaulted actor — the historical behavior.
|
|
252
|
+
*/
|
|
253
|
+
write(id: ConceptId, doc: OkfDocument, options?: WriteOptions): Promise<Version>;
|
|
254
|
+
/** True when a concept document exists at `id`. */
|
|
255
|
+
exists(id: ConceptId): Promise<boolean>;
|
|
256
|
+
/** Concept ids (reserved files excluded), optionally restricted to a bundle-relative `prefix`. */
|
|
257
|
+
list(prefix?: string): Promise<ConceptId[]>;
|
|
258
|
+
/**
|
|
259
|
+
* Version history for `id`, newest-first, or `[]` when the document does not exist.
|
|
260
|
+
* A backend that keeps no history (e.g. a plain filesystem) honestly returns just
|
|
261
|
+
* the single current version.
|
|
262
|
+
*/
|
|
263
|
+
versions(id: ConceptId): Promise<VersionInfo[]>;
|
|
264
|
+
/**
|
|
265
|
+
* Raw content of a reserved file at `dir` (`""` = bundle root) with its
|
|
266
|
+
* {@link Version}, or `null` if absent. The version is the CAS basis a caller
|
|
267
|
+
* passes back as {@link WriteOptions.expectedVersion} to
|
|
268
|
+
* {@link StorageBackend.writeReserved} for a read-modify-write that does not lose
|
|
269
|
+
* a concurrent writer's update.
|
|
270
|
+
*/
|
|
271
|
+
readReserved(dir: string, name: ReservedFilename): Promise<ReservedReadResult | null>;
|
|
272
|
+
/**
|
|
273
|
+
* Persist raw content of a reserved file at `dir` and return its new {@link Version}.
|
|
274
|
+
* Honors {@link WriteOptions.expectedVersion} (compare-and-swap → typed
|
|
275
|
+
* `VersionConflict` on mismatch; passing a version token for an absent file is a
|
|
276
|
+
* conflict; passing `null` means expect-ABSENT, i.e. create-if-absent — a conflict
|
|
277
|
+
* when the file already exists); with no options the write is unconditional (the
|
|
278
|
+
* historical last-writer-wins). The filesystem adapter enforces the version premise
|
|
279
|
+
* with an external same-user cross-process mutation lock; `MemoryBackend` enforces it in memory.
|
|
280
|
+
*/
|
|
281
|
+
writeReserved(dir: string, name: ReservedFilename, content: string, options?: WriteOptions): Promise<Version>;
|
|
282
|
+
/**
|
|
283
|
+
* Hard-delete the concept document at `id` (no tombstone — the row/file is gone, not
|
|
284
|
+
* marked deleted). Non-cascading: outbound links FROM this doc and inbound links from
|
|
285
|
+
* OTHER docs still naming it are left exactly as written (backlinks are derived, so a
|
|
286
|
+
* dangling reference simply resolves to nothing on the next graph walk — no cleanup
|
|
287
|
+
* pass runs here). Returns `true` when a document existed and was removed, `false`
|
|
288
|
+
* when it was already absent — idempotent, NEVER a rejection for "nothing to delete."
|
|
289
|
+
* Honors {@link DeleteOptions.expectedVersion} (compare-and-swap → typed
|
|
290
|
+
* `VersionConflict` on mismatch), but an ABSENT target returns `false` regardless of
|
|
291
|
+
* `expectedVersion` (absence always wins over a stale-version check — there is nothing
|
|
292
|
+
* left to conflict with). Rejects (via the engine's reserved-file / id-safety guards,
|
|
293
|
+
* not this seam method itself) for `index.md`/`log.md` — see `deleteDoc` in
|
|
294
|
+
* `bundle.ts`.
|
|
295
|
+
*/
|
|
296
|
+
delete(id: ConceptId, options?: DeleteOptions): Promise<boolean>;
|
|
297
|
+
/**
|
|
298
|
+
* Read the blob at `key` (raw bytes, resolved content-type, and its {@link Version}),
|
|
299
|
+
* or `null` if absent. Unlike {@link StorageBackend.read}, a missing blob is a normal
|
|
300
|
+
* `null` result, not a rejection — callers probe with `readBlob` the way they probe a
|
|
301
|
+
* file, not the way they read a known-to-exist concept.
|
|
302
|
+
*/
|
|
303
|
+
readBlob(key: BlobKey): Promise<ReadBlobResult | null>;
|
|
304
|
+
/**
|
|
305
|
+
* Persist the blob at `key` (create or overwrite) and return the new {@link Version}
|
|
306
|
+
* (the SHA-256 of the raw bytes). Honors {@link WriteOptions.expectedVersion}
|
|
307
|
+
* (compare-and-swap; `null` = expect-absent create) and {@link WriteOptions.actor}
|
|
308
|
+
* for contract parity with {@link StorageBackend.write} — attribution recording is
|
|
309
|
+
* backend-specific (unobserved on a plain filesystem, same as docs). `contentType`
|
|
310
|
+
* is an explicit override; omitted, it is inferred from `key`'s extension at read
|
|
311
|
+
* time. Whether an explicit override is PERSISTED is backend-specific and
|
|
312
|
+
* documented per-adapter (`FilesystemBackend` infers-on-read; `MemoryBackend`
|
|
313
|
+
* persists it) — both resolve through the ONE MIME source in `content-type.ts`.
|
|
314
|
+
*/
|
|
315
|
+
writeBlob(key: BlobKey, bytes: Uint8Array, contentType?: string, options?: WriteOptions): Promise<Version>;
|
|
316
|
+
/** True when a blob exists at `key`. */
|
|
317
|
+
existsBlob(key: BlobKey): Promise<boolean>;
|
|
318
|
+
/** Blob keys, optionally restricted to a bundle-relative `prefix`, sorted. Never includes concept documents or reserved files. */
|
|
319
|
+
listBlobs(prefix?: string): Promise<BlobKey[]>;
|
|
320
|
+
/**
|
|
321
|
+
* Hard-delete the blob at `key` (no tombstone, no history to purge — blobs never
|
|
322
|
+
* carried one). Returns `true` when a blob existed and was removed, `false` when it
|
|
323
|
+
* was already absent — idempotent, mirroring {@link StorageBackend.delete} exactly
|
|
324
|
+
* (same {@link DeleteOptions} CAS contract: an absent target returns `false`
|
|
325
|
+
* regardless of `expectedVersion`).
|
|
326
|
+
*/
|
|
327
|
+
deleteBlob(key: BlobKey, options?: DeleteOptions): Promise<boolean>;
|
|
328
|
+
/**
|
|
329
|
+
* OPTIONAL head-projection push-down (the wire-transfer optimization the protocol's
|
|
330
|
+
* `GET /docs?fields=frontmatter&prefix=&type=&tag=` push-down row was specified for).
|
|
331
|
+
* Returns {@link HeadResult} rows — full frontmatter + version, NEVER bodies.
|
|
332
|
+
*
|
|
333
|
+
* CONTRACT (the backend does not own filter semantics): this is a push-down
|
|
334
|
+
* HINT. A backend MAY over-return (ignore any facet it cannot push server-side); the
|
|
335
|
+
* ENGINE re-applies the one canonical predicate (`matchesFilter`, `engine.ts`) to
|
|
336
|
+
* whatever comes back, so semantics stay in core. A backend MUST NOT under-return for
|
|
337
|
+
* a facet it chooses to honor. A backend that does not implement this method
|
|
338
|
+
* (FilesystemBackend / MemoryBackend — both local to their data, where a head projection
|
|
339
|
+
* saves nothing) is served by the engine's fallback (`list` +
|
|
340
|
+
* `readMany`, bodies read then dropped), which additionally honors the scan's
|
|
341
|
+
* malformed-doc resilience (`QueryOptions.onSkip`); the push-down path does not — a
|
|
342
|
+
* malformed doc fails the server-side scan, exactly as the wire `list` always has.
|
|
343
|
+
*/
|
|
344
|
+
queryHeads?(filter?: QueryFilter): Promise<HeadResult[]>;
|
|
345
|
+
/**
|
|
346
|
+
* OPTIONAL capabilities self-declaration. `StorageBackend` carries
|
|
347
|
+
* no capabilities descriptor by default, so a wire router that wants to report an adapter's
|
|
348
|
+
* real guarantees (`GET /v0/capabilities`, `docs/WIRE-PROTOCOL.md`) has historically inferred
|
|
349
|
+
* them via `instanceof` against the two in-repo adapters — correct for those two, but unable
|
|
350
|
+
* to classify a THIRD adapter it has never heard of (for example, a document-centric hosted
|
|
351
|
+
* backend). A backend that implements this method reports its own limits instead of
|
|
352
|
+
* being guessed at; a backend that does NOT implement it falls back to the router's
|
|
353
|
+
* pre-existing `instanceof` inference. `FilesystemBackend` self-declares because enforced
|
|
354
|
+
* cross-process CAS and retained history are now intentionally different capabilities.
|
|
355
|
+
*/
|
|
356
|
+
capabilities?(): StorageCapabilities;
|
|
357
|
+
}
|
|
358
|
+
/** Options for {@link initBundle}. */
|
|
359
|
+
export interface InitBundleOptions {
|
|
360
|
+
/** Supported OKF authoring version stamped into the root `index.md`. Defaults to the current product edition. */
|
|
361
|
+
okfVersion?: string;
|
|
362
|
+
/**
|
|
363
|
+
* Require that this call CREATE the bundle: the root `index.md` write runs expect-absent
|
|
364
|
+
* through the backend's CAS, and a pre-existing or concurrently created `index.md` throws
|
|
365
|
+
* `VersionConflict` instead of opening the existing bundle. Default false (open-or-create).
|
|
366
|
+
*/
|
|
367
|
+
expectNew?: boolean;
|
|
368
|
+
}
|
|
369
|
+
/** Filter for {@link query}. Provided facets are ANDed; reserved files are always excluded. */
|
|
370
|
+
export interface QueryFilter {
|
|
371
|
+
/** Restrict to concepts whose frontmatter `type` equals this value. */
|
|
372
|
+
type?: string;
|
|
373
|
+
/** Restrict to concepts carrying ALL of these tags. */
|
|
374
|
+
tags?: string[];
|
|
375
|
+
/** Restrict to concept IDs beginning with this bundle-relative prefix. */
|
|
376
|
+
prefix?: string;
|
|
377
|
+
/**
|
|
378
|
+
* Restrict to concepts whose frontmatter field equals this value. Multiple entries are ANDed
|
|
379
|
+
* with each other and with the other facets. Comparison mirrors kind enum validation's coercion:
|
|
380
|
+
* the frontmatter value is coerced to string(s) with `String(v)` per element (a scalar becomes a
|
|
381
|
+
* one-element set, an array is coerced element-wise) and the requested value must be a member of
|
|
382
|
+
* that set — so an unquoted YAML scalar (e.g. `priority: 1`) matches `"1"`, and an array field
|
|
383
|
+
* (e.g. `tags: [a,b]`) matches on membership. A field the doc lacks never matches (empty set).
|
|
384
|
+
*/
|
|
385
|
+
fields?: Record<string, string>;
|
|
386
|
+
}
|
|
387
|
+
/** A single resolved outbound cross-link (a standard markdown link, never a wikilink). */
|
|
388
|
+
export interface Link {
|
|
389
|
+
/** Source concept ID (the document the link appears in). */
|
|
390
|
+
from: ConceptId;
|
|
391
|
+
/** Resolved target concept ID. MAY point at a not-yet-written concept (broken links are valid, §5). */
|
|
392
|
+
to: ConceptId;
|
|
393
|
+
/** The link's display text. */
|
|
394
|
+
text: string;
|
|
395
|
+
/** The raw target as written in the markdown, before resolution (e.g. `/a/b.md`, `./x.md`). */
|
|
396
|
+
href: string;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Filter for {@link queryEdges} — the whole-bundle derived edge list, filtered. `from`/`to` each
|
|
400
|
+
* accept a single {@link ConceptId}, a trailing-slash prefix (`"tasks/"` matches any id starting
|
|
401
|
+
* with that literal string — one rule, no glob syntax), or an array of either (union: a match
|
|
402
|
+
* against ANY entry satisfies that facet). Providing both `from` and `to` ANDs them. `text` is an
|
|
403
|
+
* EXACT match against the link's display text (never substring/regex/case-insensitive). All facets
|
|
404
|
+
* are optional. ID selectors are exact canonical engine identities (`x` and `x.md` are distinct),
|
|
405
|
+
* not path-like aliases. An empty filter returns every edge in the bundle (still including
|
|
406
|
+
* dangling ones — a link to a nonexistent doc is a valid edge, per §5).
|
|
407
|
+
*/
|
|
408
|
+
export interface EdgeFilter {
|
|
409
|
+
/** Restrict to edges whose source matches this id/prefix (or union of ids/prefixes). */
|
|
410
|
+
from?: string | string[];
|
|
411
|
+
/** Restrict to edges whose resolved target matches this id/prefix (or union of ids/prefixes). */
|
|
412
|
+
to?: string | string[];
|
|
413
|
+
/** Restrict to edges whose display text exactly equals this value. */
|
|
414
|
+
text?: string;
|
|
415
|
+
}
|
|
416
|
+
/** A consumer-derived freshness verdict, including OKF v0.2's absolute `stale_after` date. */
|
|
417
|
+
export type FreshnessVerdict = "fresh" | "stale" | "empty";
|
|
418
|
+
/** Inputs for a {@link freshness} judgment. */
|
|
419
|
+
export interface FreshnessOptions {
|
|
420
|
+
/** Instant to compare against; defaults to "now". */
|
|
421
|
+
now?: Date;
|
|
422
|
+
/** Bundle edition; v0.2 activates the standard `stale_after` lifecycle field. */
|
|
423
|
+
okfVersion?: string;
|
|
424
|
+
/** Maximum age before a concept is judged `stale`. */
|
|
425
|
+
maxAgeMs?: number;
|
|
426
|
+
/** ISO-8601 timestamps of upstream dependencies; any newer than the concept marks it `stale`. */
|
|
427
|
+
dependsOn?: string[];
|
|
428
|
+
}
|
|
429
|
+
/** The outcome of a {@link freshness} judgment. */
|
|
430
|
+
export interface FreshnessResult {
|
|
431
|
+
/** `fresh` / `stale` / `empty` (no usable clock and no elapsed v0.2 `stale_after`). */
|
|
432
|
+
verdict: FreshnessVerdict;
|
|
433
|
+
/** Age in milliseconds relative to the comparison instant, when a meaningful-change time was present. */
|
|
434
|
+
ageMs?: number;
|
|
435
|
+
/** Human-readable reason (e.g. exceeded max age, a dependency is newer). */
|
|
436
|
+
reason?: string;
|
|
437
|
+
}
|
|
438
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iHAAiH;IACjH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,qFAAq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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"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared type shapes for the OKF store engine.
|
|
3
|
+
*
|
|
4
|
+
* These are the contract types originally sketched in `index.ts`; they are kept
|
|
5
|
+
* here so the implementation modules can import them without a cycle, and are
|
|
6
|
+
* re-exported verbatim from `index.ts` to keep the public contract stable.
|
|
7
|
+
*
|
|
8
|
+
* @see OKF spec — GoogleCloudPlatform/knowledge-catalog, `okf/SPEC.md`
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal port of `packages/schemas/src/validation.ts` from holaxis-agentstate.
|
|
3
|
+
*
|
|
4
|
+
* The source module is a zod-backed WARN-FIRST validation layer. `content-type.ts`
|
|
5
|
+
* consumes ONLY the {@link ValidationWarning} shape from it (a type-only import),
|
|
6
|
+
* so `@superbee/core` ports just that type and deliberately drops the zod
|
|
7
|
+
* runtime — keeping the store engine dependency-free at this layer. If a full
|
|
8
|
+
* schema-validation stage is ever needed here, restore the zod pieces from the
|
|
9
|
+
* source repo.
|
|
10
|
+
*/
|
|
11
|
+
/** Non-fatal validation warning. Mirrors the `errorResponse` {code,message,details} grammar. */
|
|
12
|
+
export type ValidationWarning = {
|
|
13
|
+
/** Stable machine code (e.g. "IGNORED_FIELD", "INVALID_FIELD"). */
|
|
14
|
+
code: string;
|
|
15
|
+
/** Human-readable message. */
|
|
16
|
+
message: string;
|
|
17
|
+
/** JSON-path of the offending field (`issue.path.join(".")`), when applicable. */
|
|
18
|
+
field?: string;
|
|
19
|
+
/** Strictly non-fatal. There is NO "error" severity on a 200 response. */
|
|
20
|
+
severity: "warning" | "info";
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gGAAgG;AAChG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC;CAC9B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal port of `packages/schemas/src/validation.ts` from holaxis-agentstate.
|
|
3
|
+
*
|
|
4
|
+
* The source module is a zod-backed WARN-FIRST validation layer. `content-type.ts`
|
|
5
|
+
* consumes ONLY the {@link ValidationWarning} shape from it (a type-only import),
|
|
6
|
+
* so `@superbee/core` ports just that type and deliberately drops the zod
|
|
7
|
+
* runtime — keeping the store engine dependency-free at this layer. If a full
|
|
8
|
+
* schema-validation stage is ever needed here, restore the zod pieces from the
|
|
9
|
+
* source repo.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Runtime-neutral version transport primitives shared by storage adapters and HTTP clients. */
|
|
2
|
+
import type { Version } from "./types.js";
|
|
3
|
+
/** Recover a bare version token from a quoted or weak HTTP ETag. */
|
|
4
|
+
export declare function stripETagWrapper(raw: string): string;
|
|
5
|
+
/** Typed optimistic-concurrency rejection raised by every conforming backend. */
|
|
6
|
+
export declare class VersionConflict extends Error {
|
|
7
|
+
readonly name = "VersionConflict";
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly expected: Version | null;
|
|
10
|
+
readonly actual: Version | null;
|
|
11
|
+
constructor(id: string, expected: Version | null, actual: Version | null);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=version-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-transport.d.ts","sourceRoot":"","sources":["../src/version-transport.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOpD;AAED,iFAAiF;AACjF,qBAAa,eAAgB,SAAQ,KAAK;IACxC,SAAkB,IAAI,qBAAqB;IAC3C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;gBAEpB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;CASzE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Runtime-neutral version transport primitives shared by storage adapters and HTTP clients. */
|
|
2
|
+
/** Recover a bare version token from a quoted or weak HTTP ETag. */
|
|
3
|
+
export function stripETagWrapper(raw) {
|
|
4
|
+
let value = raw.trim();
|
|
5
|
+
if (value.startsWith("W/"))
|
|
6
|
+
value = value.slice(2);
|
|
7
|
+
if (value.length >= 2 && value.startsWith('"') && value.endsWith('"')) {
|
|
8
|
+
value = value.slice(1, -1);
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
/** Typed optimistic-concurrency rejection raised by every conforming backend. */
|
|
13
|
+
export class VersionConflict extends Error {
|
|
14
|
+
name = "VersionConflict";
|
|
15
|
+
id;
|
|
16
|
+
expected;
|
|
17
|
+
actual;
|
|
18
|
+
constructor(id, expected, actual) {
|
|
19
|
+
super(`version conflict on '${id}': expected ${expected ?? "absent"}, found ${actual ?? "none"} ` +
|
|
20
|
+
`(the document changed since you read it — re-read and retry)`);
|
|
21
|
+
this.id = id;
|
|
22
|
+
this.expected = expected;
|
|
23
|
+
this.actual = actual;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=version-transport.js.map
|