@the_library/public 1.0.0 → 2.0.1

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 (113) hide show
  1. package/README.md +201 -28
  2. package/assets/branding/pond-enterprise-logo.svg +1 -1
  3. package/dist/Book-CYyj_y_4.d.ts +621 -0
  4. package/dist/bookSearchService-YQskauJS.d.ts +300 -0
  5. package/dist/branding/index.js +1 -66
  6. package/dist/branding/index.js.map +1 -1
  7. package/dist/chunk-3XUKOVEF.js +2 -0
  8. package/dist/chunk-3XUKOVEF.js.map +1 -0
  9. package/dist/chunk-46FQHZNM.js +2 -0
  10. package/dist/chunk-46FQHZNM.js.map +1 -0
  11. package/dist/chunk-7G3BMGV2.js +2 -0
  12. package/dist/chunk-7G3BMGV2.js.map +1 -0
  13. package/dist/chunk-D4DXGA2W.js +2 -0
  14. package/dist/chunk-D4DXGA2W.js.map +1 -0
  15. package/dist/chunk-EMA2QJTW.js +2 -0
  16. package/dist/chunk-EMA2QJTW.js.map +1 -0
  17. package/dist/chunk-FN52YV7L.js +2 -0
  18. package/dist/chunk-FN52YV7L.js.map +1 -0
  19. package/dist/chunk-GWQNULP4.js +2 -0
  20. package/dist/chunk-GWQNULP4.js.map +1 -0
  21. package/dist/chunk-OELHBR4F.js +2 -0
  22. package/dist/chunk-OELHBR4F.js.map +1 -0
  23. package/dist/chunk-PV3X54EU.js +2 -0
  24. package/dist/chunk-PV3X54EU.js.map +1 -0
  25. package/dist/chunk-SD3INWZF.js +2 -0
  26. package/dist/chunk-SD3INWZF.js.map +1 -0
  27. package/dist/downloader/dl2-sw.js +1 -198
  28. package/dist/downloader/dl2-sw.js.map +1 -1
  29. package/dist/downloader/file-worker-v2.js +1 -257
  30. package/dist/downloader/file-worker-v2.js.map +1 -1
  31. package/dist/downloader/index.d.ts +30 -2
  32. package/dist/downloader/index.js +1 -537
  33. package/dist/downloader/index.js.map +1 -1
  34. package/dist/downloader/mu-worker-v2.js +1 -196
  35. package/dist/downloader/mu-worker-v2.js.map +1 -1
  36. package/dist/downloader/react.d.ts +1 -1
  37. package/dist/downloader/react.js +1 -31
  38. package/dist/downloader/react.js.map +1 -1
  39. package/dist/downloader/solid.d.ts +1 -1
  40. package/dist/downloader/solid.js +1 -18
  41. package/dist/downloader/solid.js.map +1 -1
  42. package/dist/downloader/sw.js +1 -118
  43. package/dist/downloader/sw.js.map +1 -1
  44. package/dist/downloader/vue.d.ts +1 -1
  45. package/dist/downloader/vue.js +1 -18
  46. package/dist/downloader/vue.js.map +1 -1
  47. package/dist/enriched-index-T0sDG7JR.d.ts +209 -0
  48. package/dist/global/public.global.js +68 -0
  49. package/dist/global/public.manifest.json +484 -0
  50. package/dist/level-state-DXqglpAX.d.ts +27 -0
  51. package/dist/models/astro.d.ts +4 -3
  52. package/dist/models/astro.js +1 -43
  53. package/dist/models/astro.js.map +1 -1
  54. package/dist/models/index.d.ts +449 -23
  55. package/dist/models/index.js +1 -339
  56. package/dist/models/index.js.map +1 -1
  57. package/dist/models/models.d.ts +195 -441
  58. package/dist/models/models.js +1 -45
  59. package/dist/models/patch-worker.js +1 -542
  60. package/dist/models/patch-worker.js.map +1 -1
  61. package/dist/models/react.d.ts +6 -5
  62. package/dist/models/react.js +1 -72
  63. package/dist/models/react.js.map +1 -1
  64. package/dist/models/solid.d.ts +16 -6
  65. package/dist/models/solid.js +1 -94
  66. package/dist/models/solid.js.map +1 -1
  67. package/dist/models/vue.d.ts +89 -7
  68. package/dist/models/vue.js +1 -97
  69. package/dist/models/vue.js.map +1 -1
  70. package/dist/orm-MJTHCG9E.d.ts +1003 -0
  71. package/dist/{session-vqOnyxga.d.ts → session-JudUKAV7.d.ts} +76 -74
  72. package/dist/{state-BTsp-E4v.d.ts → state-CkYavOSt.d.ts} +16 -0
  73. package/dist/{types-Dn0EFMO_.d.ts → types-B-IX3HBn.d.ts} +94 -21
  74. package/dist/{types-Xb8Ta9tZ.d.ts → types-Blyx2A7F.d.ts} +10 -36
  75. package/dist/web3/auth.d.ts +89 -0
  76. package/dist/web3/auth.js +13 -0
  77. package/dist/web3/auth.js.map +1 -0
  78. package/dist/web3/index.d.ts +1913 -126
  79. package/dist/web3/index.js +1 -1019
  80. package/dist/web3/index.js.map +1 -1
  81. package/dist/web3/network.d.ts +6 -0
  82. package/dist/web3/network.js +2 -0
  83. package/dist/web3/network.js.map +1 -0
  84. package/dist/web3/registry.d.ts +34 -9
  85. package/dist/web3/registry.js +1 -22
  86. package/dist/web3/vue.d.ts +31 -14
  87. package/dist/web3/vue.js +1 -390
  88. package/dist/web3/vue.js.map +1 -1
  89. package/package.json +36 -15
  90. package/dist/chunk-2HFOWE5R.js +0 -296
  91. package/dist/chunk-2HFOWE5R.js.map +0 -1
  92. package/dist/chunk-3L6LH2XK.js +0 -465
  93. package/dist/chunk-3L6LH2XK.js.map +0 -1
  94. package/dist/chunk-4CWVFPBN.js +0 -28
  95. package/dist/chunk-4CWVFPBN.js.map +0 -1
  96. package/dist/chunk-AGHPATVL.js +0 -65
  97. package/dist/chunk-AGHPATVL.js.map +0 -1
  98. package/dist/chunk-JDUYLUDJ.js +0 -4835
  99. package/dist/chunk-JDUYLUDJ.js.map +0 -1
  100. package/dist/chunk-OEZK7IX7.js +0 -77
  101. package/dist/chunk-OEZK7IX7.js.map +0 -1
  102. package/dist/chunk-PUYDAUCI.js +0 -2873
  103. package/dist/chunk-PUYDAUCI.js.map +0 -1
  104. package/dist/chunk-WHWMTS7D.js +0 -99
  105. package/dist/chunk-WHWMTS7D.js.map +0 -1
  106. package/dist/chunk-Y7RS6RTM.js +0 -342
  107. package/dist/chunk-Y7RS6RTM.js.map +0 -1
  108. package/dist/chunk-ZEZGI2TP.js +0 -197
  109. package/dist/chunk-ZEZGI2TP.js.map +0 -1
  110. package/dist/core-dao-core-logo-VDT2I5IW.svg +0 -33
  111. package/dist/level-state-J3pj64Tr.d.ts +0 -15
  112. package/dist/models/models_v2.global.js +0 -1
  113. package/dist/orm-BvkX0aBT.d.ts +0 -507
@@ -0,0 +1,209 @@
1
+ import { S as SidecarType, I as InstanceData, B as BridgeDefinition } from './orm-MJTHCG9E.js';
2
+
3
+ /**
4
+ * Sidecar binary wire format — parser and writer (SPEC §4).
5
+ *
6
+ * Every sidecar file begins with a 10-byte header (all multi-byte integers
7
+ * are big-endian):
8
+ *
9
+ * Offset Size Field
10
+ * 0 4 Magic number: 0x44504D31 ("DPM1")
11
+ * 4 1 Format version (currently 0x04)
12
+ * 5 3 recordCount (uint24, big-endian, max 16,777,215)
13
+ * 8 1 columnCount (uint8)
14
+ * 9 1 sidecarType (0x00 = Slim, 0x01 = Extended, 0x02 = Provenance)
15
+ *
16
+ * Format version history:
17
+ * 0x01 — uint16 recordCount + uint16 relation UIDs (max 65,535 records/UIDs)
18
+ * 0x02 — uint24 recordCount + uint24 relation UIDs (max 16.7M records/UIDs)
19
+ * BUG: uint24 UIDs silently truncated high-bit user-created IDs (> 0xFFFFFF).
20
+ * 0x03 — uint24 recordCount + uint32 relation UIDs (full 32-bit UID space, no truncation).
21
+ * Parsers accept 0x01/0x02/0x03; 0x02 files are treated as 0x03 on read
22
+ * (best-effort — low UIDs in those files were stored correctly).
23
+ * 0x04 — Adds hasBridges flag to Provenance sidecars (breaking change for PROV files).
24
+ * Provenance sidecars now include: [columns] [hasBridges: u8] [bridges...]
25
+ * Slim/Extended sidecars unchanged. Parsers accept 0x01/0x02/0x03/0x04.
26
+ * v0x03 Provenance files parsed as if hasBridges=0 (legacy, no bridges).
27
+ * 0x05 — Widens the top-level "ids" column and the Extended relations-tail UIDs
28
+ * (authorIds/tags/books, etc.) from Uint32 to Uint64 (optmized-uid/
29
+ * 11-wireId-64bits-refactor.md §5) — canonical wireIds now embed a
30
+ * 19-bit libraryAccountId above the 44-bit counter, so they routinely
31
+ * exceed 2^32. Columns are self-describing (a type byte per column),
32
+ * so a v0x05 writer just declares `ColumnType.Uint64` for "ids" and any
33
+ * reader handles it from that byte alone. The relations tail is NOT
34
+ * self-describing per-UID-width — it's version-dispatched, same as the
35
+ * v0x01/v0x02/v0x03 history below — so v0x05 files read/write relation
36
+ * UIDs at u64 unconditionally. Parsers accept 0x01/0x02/0x03/0x04/0x05.
37
+ * Ids/relation UIDs are `bigint` (BigUint64Array-backed) from the
38
+ * reader/writer outward; JSON boundaries above this layer must use the
39
+ * toJsonId/fromJsonId decimal-string convention (§3), not raw
40
+ * JSON.stringify.
41
+ * 0x06 — Provenance bridge conversion link ids (equivalentWith/childOf/parentOf's
42
+ * `id` field) switch from a fixed uint32 to a length-prefixed string
43
+ * (the same `varString` already used for `original`/system names).
44
+ * BUG this fixes: `BridgeLink.id` is `number | string` — a bridge
45
+ * target is EITHER a real Tag wireId OR a raw external classification
46
+ * notation (DDC/LCC/UDC/etc. call number — see book-manager's
47
+ * NOTATION_ONLY_SYSTEMS, api/bridges.ts), and most built-in
48
+ * classification systems are notation-only. `w.u32(Number(id))`
49
+ * mishandled BOTH: a numeric id above 0xFFFFFFFF silently wrapped
50
+ * (`>>> 0`), and a non-numeric notation (e.g. an LCC call number like
51
+ * "PZ73") coerced to NaN, which `>>> 0` turns into 0 — indistinguishable
52
+ * from a genuinely different bridge whose real target id is 0. A
53
+ * varString has neither failure mode: it stores whatever was there
54
+ * exactly. Parsers accept 0x01 through 0x06; v0x05-and-earlier
55
+ * Provenance files still read bridge ids as the u32 they were
56
+ * actually written as (already-corrupted values in those files are
57
+ * read-only history, same policy as the v0x02 relations bug above —
58
+ * this doesn't retroactively repair already-published sidecars, a
59
+ * v0x06 writer just stops producing new ones). Bridge link ids
60
+ * decode as `number` from legacy files, `string` from v0x06+ —
61
+ * `BridgeLink.id`'s existing `number | string` type already expects
62
+ * either, and every consumer already normalizes via String()/BigInt()
63
+ * with a fallback (orm.ts's getBridgedRelationIdsSync).
64
+ *
65
+ * Columns follow sequentially: columnType (u8), nameLen (u8), name (UTF-8),
66
+ * then the column data block. Extended sidecars carry two structured tail
67
+ * sections after the columns: relations (self-describing) and instances.
68
+ * Provenance sidecars (v0x04+) carry a hasBridges flag, followed by per-record
69
+ * bridge definitions (if hasBridges=1).
70
+ */
71
+
72
+ declare const SIDECAR_MAGIC = 1146113329;
73
+ declare const SIDECAR_FORMAT_VERSION = 6;
74
+ /** Column type codes (SPEC §4.1). */
75
+ declare enum ColumnType {
76
+ Uint8 = 1,
77
+ Uint16 = 2,
78
+ NullableString = 3,
79
+ Relation = 4,// structured tail — flat uint32 stream
80
+ InstanceArray = 5,// structured tail — self-describing instance section
81
+ Uint32 = 6,
82
+ Bool = 7,// stored as u8 0/1, decoded as boolean
83
+ Uint64 = 8
84
+ }
85
+ /** Picks the narrowest column type for a prop's bit width (versions.json). */
86
+ declare const columnTypeForBits: (bits: number) => ColumnType;
87
+ /**
88
+ * One entry of the instance field descriptor embedded in Extended sidecars.
89
+ *
90
+ * The instances tail is SELF-DESCRIBING: the writer embeds
91
+ * `fieldCount + (typeCode, name)*` once per file, and instances are encoded
92
+ * in descriptor order. The parser never consults any model schema, so:
93
+ * - old files keep parsing correctly after instanceFields change,
94
+ * - any model with `multipleInstances: true` works with zero new code,
95
+ * - files written under an older schema simply yield InstanceData objects
96
+ * missing the newer fields.
97
+ */
98
+ interface InstanceFieldSpec {
99
+ name: string;
100
+ type: ColumnType;
101
+ }
102
+ /**
103
+ * Derives the writer's field spec from schema instanceFields
104
+ * (generated-src JSON shape) plus optional per-index bit layouts from
105
+ * versions.json (`layout.instanceFields[objectTypeId]`).
106
+ * The writer appends `isDefault` automatically — do not include it here.
107
+ */
108
+ declare const instanceSpecFromFields: (fields: Array<{
109
+ name: string;
110
+ type: string;
111
+ bits?: number;
112
+ }>, fieldLayouts?: Record<number, {
113
+ bits: number;
114
+ }>) => InstanceFieldSpec[];
115
+ type ColumnData = Uint8Array | Uint16Array | Uint32Array | BigUint64Array | Array<string | null>;
116
+ interface SidecarHeader {
117
+ formatVersion: number;
118
+ recordCount: number;
119
+ columnCount: number;
120
+ sidecarType: SidecarType;
121
+ }
122
+ interface ParsedSidecar {
123
+ header: SidecarHeader;
124
+ columns: Map<string, ColumnData>;
125
+ /**
126
+ * Per-record target-UID arrays for every `has`-direction relation, keyed by
127
+ * the schema relation name (Extended sidecars only). Self-describing: the
128
+ * writer embeds the relation names in the file, so the parser needs no
129
+ * schema and new relations parse with zero code change.
130
+ *
131
+ * `bigint` — relation UIDs are real wireIds (v0x05+ reads them at u64;
132
+ * earlier versions' narrower values are widened to bigint here too, so
133
+ * every caller sees one consistent type regardless of source format).
134
+ */
135
+ relations?: Map<string, bigint[][]>;
136
+ /** Back-compat alias for `relations.get('authors')`. */
137
+ authorIds?: bigint[][];
138
+ /** Field descriptor the instances were encoded with (Extended only). */
139
+ instanceFields?: InstanceFieldSpec[];
140
+ /** Per-record instance objects, keyed by field name (Extended only). */
141
+ instances?: InstanceData[][];
142
+ /** Per-record bridges definitions (Provenance sidecar only, if hasBridges) */
143
+ bridges?: (BridgeDefinition | undefined)[];
144
+ }
145
+ declare const parseSidecar: (buf: ArrayBuffer) => ParsedSidecar;
146
+ /**
147
+ * Flattens a parsed sidecar into the generated `<Model>SlimCols` /
148
+ * `<Model>ExtendedCols` / `<Model>ProvCols` object shape.
149
+ * Provenance sidecars nest their uint8 columns under `fields`
150
+ * (`{ ids, fields: Record<name, Uint8Array> }`), matching `mergeProv`.
151
+ */
152
+ declare const colsFromSidecar: (parsed: ParsedSidecar) => Record<string, any>;
153
+ /**
154
+ * Extracts a single record as a cols object whose arrays have exactly one
155
+ * entry (index 0). Used by the worker's GetRecord command so the main thread
156
+ * can re-hydrate an evicted record with `merge*(cols, 0, lang)` without the
157
+ * worker knowing any model schema.
158
+ */
159
+ declare const extractRecordCols: (parsed: ParsedSidecar, index: number) => Record<string, any>;
160
+ interface SidecarColumn {
161
+ name: string;
162
+ type: ColumnType;
163
+ data: ColumnData;
164
+ }
165
+ /** One `has`-direction relation serialized into the Extended tail. */
166
+ interface SidecarRelationInput {
167
+ /** Schema relation name (e.g. 'authors', 'tags', 'books'). */
168
+ name: string;
169
+ /** Per-record arrays of target UIDs — real wireIds, written at u64 (v0x05+). */
170
+ data: bigint[][];
171
+ }
172
+ interface SidecarInput {
173
+ sidecarType: SidecarType;
174
+ recordCount: number;
175
+ columns: SidecarColumn[];
176
+ /** `has`-direction relation tails (Extended only). */
177
+ relations?: SidecarRelationInput[];
178
+ /** Back-compat sugar — serialized as the `authors` relation. */
179
+ authorIds?: bigint[][];
180
+ /**
181
+ * Encode order + types of the instance fields, derived from the schema
182
+ * via `instanceSpecFromFields`. `isDefault` is appended automatically.
183
+ * Required when `instances` is provided.
184
+ */
185
+ instanceFields?: InstanceFieldSpec[];
186
+ instances?: InstanceData[][];
187
+ /** Per-record bridge definition (Provenance only). */
188
+ bridges?: (BridgeDefinition | undefined)[];
189
+ }
190
+ declare const writeSidecar: (input: SidecarInput) => ArrayBuffer;
191
+ interface AiResultEntry {
192
+ ts: number;
193
+ value: any;
194
+ format: string;
195
+ }
196
+ /**
197
+ * AI sidecar payload — deliberately plain JSON, not the columnar binary format
198
+ * slim/extended/prov use. Each result's `value` is arbitrary/free-form JSON
199
+ * (the whole point of the format), so a fixed-width binary layout has nothing
200
+ * structural to encode beyond what gzip's own dictionary compression already
201
+ * reclaims from the repeated company/model/format strings — a custom format
202
+ * here would only add complexity and a second, undocumented versioning scheme
203
+ * alongside SIDECAR_FORMAT_VERSION/SidecarType. Gzip is applied at the file
204
+ * layer, the same as every other sidecar tier — not inside this function.
205
+ */
206
+ declare const serializeAiSidecar: (results: Map<bigint, Map<string, Map<string, Set<AiResultEntry>>>>) => ArrayBuffer;
207
+ declare const deserializeAiSidecar: (buf: ArrayBuffer) => Map<bigint, Map<string, Map<string, Set<AiResultEntry>>>>;
208
+
209
+ export { type AiResultEntry as A, ColumnType as C, type InstanceFieldSpec as I, type ParsedSidecar as P, SIDECAR_MAGIC as S, SIDECAR_FORMAT_VERSION as a, type ColumnData as b, columnTypeForBits as c, type SidecarHeader as d, colsFromSidecar as e, extractRecordCols as f, type SidecarColumn as g, type SidecarRelationInput as h, instanceSpecFromFields as i, type SidecarInput as j, deserializeAiSidecar as k, parseSidecar as p, serializeAiSidecar as s, writeSidecar as w };