@ipab/ipfs-store 0.0.0 → 0.1.0-rc.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.
@@ -0,0 +1,83 @@
1
+ import { CID } from "multiformats/cid";
2
+ import type { IpfsAccess, IpfsNode } from "@silvermoon-work/ipfs-access";
3
+ import type { UnixFSEntry } from "ipfs-unixfs-exporter";
4
+ import { type IpfsClient } from "./index.js";
5
+ import { type ContentLimits } from "./dag.js";
6
+ import { type IpfsStoreOptions, type StoreConfiguration } from "./configuration.js";
7
+ export type { IpfsStoreOptions, StoreConfiguration } from "./configuration.js";
8
+ export interface IpfsReadOptions {
9
+ signal?: AbortSignal;
10
+ hints?: readonly string[];
11
+ allowGateway?: (url: URL) => boolean;
12
+ }
13
+ export interface StoreUsage {
14
+ cachedBytes: number;
15
+ pinnedBytes: number;
16
+ }
17
+ export interface StoreGcResult {
18
+ removedBlocks: number;
19
+ reclaimedBytes: number;
20
+ }
21
+ export type UnixfsNode = Extract<UnixFSEntry, {
22
+ type: "file" | "raw" | "directory";
23
+ }>;
24
+ /** Verified IPFS/UnixFS content only. Configuration and source ownership belong to the host. */
25
+ export declare class IpfsStore implements IpfsClient, IpfsAccess {
26
+ readonly configuration: StoreConfiguration;
27
+ readonly limits: Readonly<ContentLimits>;
28
+ private readonly lifetime;
29
+ private readonly retainedBlocks;
30
+ private readonly retentionBudget;
31
+ private readonly gateway;
32
+ private backend;
33
+ private retention?;
34
+ private retentionStore?;
35
+ private coordinated;
36
+ private source;
37
+ private closing?;
38
+ private ownsBackend;
39
+ private upstream?;
40
+ constructor(options: IpfsStoreOptions);
41
+ /** Adapt a caller-owned CAR or block port without reading configuration or owning its close. */
42
+ static fromClient(client: IpfsClient, limits?: Partial<ContentLimits>, dataDir?: string): IpfsStore;
43
+ get retainedBytes(): number;
44
+ get supportsRetention(): boolean;
45
+ /** Explicit host read-through port; publication and retention always stay local. */
46
+ withLocalSource(source: IpfsClient): IpfsStore;
47
+ /** Independent reader budget/lifetime; closing it never closes the shared backing store. */
48
+ scope(limits?: Partial<ContentLimits>): IpfsStore;
49
+ private signal;
50
+ private client;
51
+ private access;
52
+ readonly block: {
53
+ get: (cid: string, options?: {
54
+ signal?: AbortSignal;
55
+ }) => Promise<Uint8Array>;
56
+ };
57
+ put(cid: CID, bytes: Uint8Array, options?: IpfsReadOptions): Promise<void>;
58
+ private coordinator;
59
+ registerOwner(owner: string, roots: readonly string[]): void;
60
+ retain(owner: string, roots: readonly string[], options?: IpfsReadOptions): Promise<void>;
61
+ confirmRetained(owner: string, roots: readonly string[], options?: IpfsReadOptions): Promise<void>;
62
+ recoverOwner(owner: string, roots: readonly string[] | (() => readonly string[]), options?: IpfsReadOptions & {
63
+ isIdle?: () => boolean;
64
+ }): Promise<void>;
65
+ reconcile(owner: string, roots: readonly string[] | (() => readonly string[]), options?: IpfsReadOptions): Promise<number>;
66
+ pin(root: CID | string, options?: IpfsReadOptions): Promise<void>;
67
+ unpin(root: CID | string, options?: IpfsReadOptions): Promise<void>;
68
+ pins(): readonly string[];
69
+ private localMaintenance;
70
+ private localClosure;
71
+ usage(options?: IpfsReadOptions): Promise<StoreUsage>;
72
+ gc(options?: IpfsReadOptions): Promise<StoreGcResult>;
73
+ stageBlock(session: string, cid: CID, bytes: Uint8Array, options?: IpfsReadOptions): Promise<void>;
74
+ finishImport(session: string, root: CID | string, owner?: string, options?: IpfsReadOptions): Promise<void>;
75
+ discardImport(session: string, options?: IpfsReadOptions): Promise<void>;
76
+ read(path: CID | string, options?: IpfsReadOptions): Promise<UnixfsNode>;
77
+ readContent(cid: CID, options?: IpfsReadOptions): Promise<IpfsNode>;
78
+ putContent(content: ReadableStream<Uint8Array>, options?: IpfsReadOptions): Promise<CID>;
79
+ resolveContent(cid: CID, path: string, options?: IpfsReadOptions): Promise<CID>;
80
+ prepare(root: CID | string, options?: IpfsReadOptions): Promise<void>;
81
+ close(): Promise<void>;
82
+ }
83
+ //# sourceMappingURL=store.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,EACf,IAAI,EAAE,GAAG,GAAG,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC;IAQV,aAAa,CACjB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC;IAGV,IAAI,CACR,IAAI,EAAE,GAAG,GAAG,MAAM,EAClB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,UAAU,CAAC;IAwChB,WAAW,CACf,GAAG,EAAE,GAAG,EACR,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,QAAQ,CAAC;IA4Cd,UAAU,CACd,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC,EACnC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,GAAG,CAAC;IA8ET,cAAc,CAClB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,GAAG,CAAC;IAyBf,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOzE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAWvB"}
package/dist/store.js ADDED
@@ -0,0 +1,436 @@
1
+ import { CID } from "multiformats/cid";
2
+ import { unixfs } from "@helia/unixfs";
3
+ import { createIpfsGatewayClient, contentStore, openContent, prepareContent, withGatewayHints, } from "./index.js";
4
+ import { ContentBlocks, defaultContentLimits, } from "./dag.js";
5
+ import { SharedContent } from "./storage.js";
6
+ import { ContentError } from "./errors.js";
7
+ import { join } from "node:path";
8
+ import { Retention } from "./retention.js";
9
+ import { validateConfiguration, } from "./configuration.js";
10
+ /** Verified IPFS/UnixFS content only. Configuration and source ownership belong to the host. */
11
+ export class IpfsStore {
12
+ configuration;
13
+ limits;
14
+ lifetime = new AbortController();
15
+ retainedBlocks = new Map();
16
+ retentionBudget;
17
+ gateway;
18
+ backend;
19
+ retention;
20
+ retentionStore;
21
+ coordinated = true;
22
+ source;
23
+ closing;
24
+ ownsBackend = true;
25
+ upstream;
26
+ constructor(options) {
27
+ this.configuration = validateConfiguration(options);
28
+ const config = this.configuration;
29
+ this.limits = Object.freeze({ ...defaultContentLimits, ...config.limits });
30
+ for (const [key, value] of Object.entries(this.limits))
31
+ if (!Object.hasOwn(defaultContentLimits, key) ||
32
+ !Number.isSafeInteger(value) ||
33
+ value <= 0)
34
+ throw new Error("Invalid IPFS content capacity.");
35
+ this.retentionBudget = { bytes: 0, limit: this.limits.bytes };
36
+ this.gateway = config.gateway
37
+ ? createIpfsGatewayClient(config.gateway, { allowPath: true })
38
+ : undefined;
39
+ this.source = this.gateway;
40
+ this.backend = new SharedContent(config.dataDir, this.source, this.limits.blockBytes);
41
+ }
42
+ /** Adapt a caller-owned CAR or block port without reading configuration or owning its close. */
43
+ static fromClient(client, limits = {}, dataDir) {
44
+ const value = client;
45
+ if (!value ||
46
+ typeof value !== "object" ||
47
+ !("block" in value) ||
48
+ !value.block ||
49
+ typeof value.block !== "object" ||
50
+ !("get" in value.block) ||
51
+ typeof value.block.get !== "function")
52
+ throw new Error("An IPFS block port is required.");
53
+ const store = new IpfsStore({ dataDir: dataDir ?? ".", limits });
54
+ store.source = client;
55
+ store.coordinated = false;
56
+ store.backend = dataDir
57
+ ? new SharedContent(dataDir, client, store.limits.blockBytes)
58
+ : new ContentBlocks(client, store.limits);
59
+ return store;
60
+ }
61
+ get retainedBytes() {
62
+ return this.retentionBudget.bytes;
63
+ }
64
+ get supportsRetention() {
65
+ return this.coordinated;
66
+ }
67
+ /** Explicit host read-through port; publication and retention always stay local. */
68
+ withLocalSource(source) {
69
+ if (!this.supportsRetention)
70
+ throw new ContentError("read_only", "Only coordinated local stores accept a local source.");
71
+ const store = new IpfsStore(this.configuration);
72
+ store.source = source;
73
+ store.backend = new SharedContent(this.configuration.dataDir, source, this.limits.blockBytes);
74
+ return store;
75
+ }
76
+ /** Independent reader budget/lifetime; closing it never closes the shared backing store. */
77
+ scope(limits = {}) {
78
+ const effective = { ...this.limits, ...limits };
79
+ for (const key of Object.keys(this.limits))
80
+ effective[key] = Math.min(effective[key], this.limits[key]);
81
+ const reader = new IpfsStore({ dataDir: ".", limits: effective });
82
+ reader.backend = this.backend;
83
+ reader.source = this.source;
84
+ reader.ownsBackend = false;
85
+ reader.upstream = this.signal({});
86
+ reader.coordinated = this.coordinated;
87
+ Object.defineProperty(reader, "configuration", {
88
+ value: this.configuration,
89
+ });
90
+ reader.retentionStore = this;
91
+ return reader;
92
+ }
93
+ signal(options) {
94
+ return AbortSignal.any([
95
+ this.lifetime.signal,
96
+ ...(this.upstream ? [this.upstream] : []),
97
+ ...(options.signal ? [options.signal] : []),
98
+ ]);
99
+ }
100
+ client(options) {
101
+ if (!options.hints?.length || !options.allowGateway)
102
+ return this.backend;
103
+ const source = withGatewayHints(this.source ?? {
104
+ block: {
105
+ get: () => Promise.reject(new Error("Missing local content block.")),
106
+ },
107
+ }, options.hints, options.allowGateway);
108
+ return {
109
+ block: {
110
+ get: async (cid, request) => {
111
+ return this.backend.readBlock(cid, request, source);
112
+ },
113
+ },
114
+ };
115
+ }
116
+ access(options) {
117
+ return {
118
+ signal: this.signal(options),
119
+ retainedBlocks: this.retainedBlocks,
120
+ retentionBudget: this.retentionBudget,
121
+ maxBlockBytes: this.limits.blockBytes,
122
+ maxDagBlocks: this.limits.blocks,
123
+ depth: this.limits.depth,
124
+ };
125
+ }
126
+ block = {
127
+ get: async (cid, options = {}) => {
128
+ const access = this.access(options);
129
+ access.signal.throwIfAborted();
130
+ const key = CID.parse(cid).toV1().toString();
131
+ const retained = this.retainedBlocks.get(key);
132
+ if (retained)
133
+ return Uint8Array.from(retained);
134
+ // Low-level reads retain and verify through the same bounded content path as UnixFS reads.
135
+ for await (const bytes of contentStore(this.backend, access).get(CID.parse(cid)))
136
+ return Uint8Array.from(bytes);
137
+ throw new Error("Missing local content block.");
138
+ },
139
+ };
140
+ async put(cid, bytes, options = {}) {
141
+ await this.backend.put(cid, bytes, { signal: this.signal(options) });
142
+ }
143
+ coordinator() {
144
+ this.signal({}).throwIfAborted();
145
+ if (!this.supportsRetention)
146
+ throw new ContentError("read_only", "Source adapters do not support coordinated retention.");
147
+ if (this.retentionStore)
148
+ return this.retentionStore.coordinator();
149
+ if (!this.retention) {
150
+ const config = this.configuration;
151
+ const directory = config.coordinationDir ?? join(config.dataDir, "retention");
152
+ this.retention = new Retention(directory, {
153
+ prepare: async (root, signal) => {
154
+ await prepareContent(this.backend, root, {
155
+ signal: signal ?? this.signal({}),
156
+ maxBlockBytes: this.limits.blockBytes,
157
+ maxDagBlocks: this.limits.blocks,
158
+ depth: this.limits.depth,
159
+ retentionBudget: { bytes: 0, limit: this.limits.bytes },
160
+ retainedBlocks: new Map(),
161
+ });
162
+ },
163
+ });
164
+ }
165
+ return this.retention;
166
+ }
167
+ registerOwner(owner, roots) {
168
+ this.signal({}).throwIfAborted();
169
+ this.coordinator().register(owner, roots);
170
+ }
171
+ async retain(owner, roots, options = {}) {
172
+ return this.coordinator().retain(owner, roots, this.signal(options));
173
+ }
174
+ async confirmRetained(owner, roots, options = {}) {
175
+ return this.coordinator().confirm(owner, roots, this.signal(options));
176
+ }
177
+ async recoverOwner(owner, roots, options = {}) {
178
+ return this.coordinator().recover(owner, roots, this.signal(options), options.isIdle);
179
+ }
180
+ async reconcile(owner, roots, options = {}) {
181
+ return this.coordinator().reconcile(owner, roots, this.signal(options));
182
+ }
183
+ async pin(root, options = {}) {
184
+ return this.coordinator().pin(root.toString(), this.signal(options));
185
+ }
186
+ async unpin(root, options = {}) {
187
+ return this.coordinator().unpin(root.toString(), this.signal(options));
188
+ }
189
+ pins() {
190
+ return this.coordinator().pins();
191
+ }
192
+ localMaintenance() {
193
+ this.signal({}).throwIfAborted();
194
+ if (!this.supportsRetention || !(this.backend instanceof SharedContent))
195
+ throw new ContentError("unsupported_content", "Space queries and garbage collection require a coordinated local Store.");
196
+ return this.backend;
197
+ }
198
+ async localClosure(backend, roots, signal) {
199
+ const blocks = new Map();
200
+ for (const root of roots) {
201
+ const retainedBlocks = new Map();
202
+ await prepareContent({
203
+ block: {
204
+ get: (value) => backend.readLocalBlock(CID.parse(value), signal),
205
+ },
206
+ }, root, {
207
+ signal,
208
+ maxBlockBytes: this.limits.blockBytes,
209
+ maxDagBlocks: this.limits.blocks,
210
+ depth: this.limits.depth,
211
+ retentionBudget: { bytes: 0, limit: this.limits.bytes },
212
+ retainedBlocks,
213
+ });
214
+ for (const [key, bytes] of retainedBlocks)
215
+ blocks.set(key, bytes.byteLength);
216
+ }
217
+ return blocks;
218
+ }
219
+ async usage(options = {}) {
220
+ const backend = this.localMaintenance();
221
+ const signal = this.signal(options);
222
+ return this.coordinator().maintain(async ({ pinned }) => {
223
+ const inventory = await backend.inventory(signal);
224
+ const blocks = await this.localClosure(backend, pinned, signal);
225
+ return {
226
+ cachedBytes: [...inventory.values()].reduce((sum, size) => sum + size, 0),
227
+ pinnedBytes: [...blocks.values()].reduce((sum, size) => sum + size, 0),
228
+ };
229
+ }, signal);
230
+ }
231
+ async gc(options = {}) {
232
+ const backend = this.localMaintenance();
233
+ const signal = this.signal(options);
234
+ return this.coordinator().maintain(async ({ roots, staged }) => {
235
+ const inventory = await backend.inventory(signal);
236
+ const marked = await this.localClosure(backend, roots, signal);
237
+ for (const key of staged)
238
+ marked.set(key, 0);
239
+ let removedBlocks = 0;
240
+ let reclaimedBytes = 0;
241
+ // Complete verification before any deletion. New publications outside this snapshot survive.
242
+ for (const key of inventory.keys()) {
243
+ signal.throwIfAborted();
244
+ if (marked.has(key))
245
+ continue;
246
+ reclaimedBytes += await backend.removeBlock(key, signal);
247
+ removedBlocks++;
248
+ }
249
+ return { removedBlocks, reclaimedBytes };
250
+ }, signal);
251
+ }
252
+ async stageBlock(session, cid, bytes, options = {}) {
253
+ const signal = this.signal(options);
254
+ return this.coordinator().stage(session, cid.toString(), () => this.backend.put(cid, bytes, { signal }), signal);
255
+ }
256
+ async finishImport(session, root, owner, options = {}) {
257
+ return this.coordinator().finish(session, root.toString(), owner, this.signal(options));
258
+ }
259
+ async discardImport(session, options = {}) {
260
+ return this.coordinator().discard(session, this.signal(options));
261
+ }
262
+ async read(path, options = {}) {
263
+ const root = CID.parse(path.toString().split("/")[0]);
264
+ if (root.code !== 0x55 && root.code !== 0x70)
265
+ throw new ContentError("unsupported_content", "Only regular UnixFS files and directories are supported.");
266
+ const node = await openContent(this.client(options), path.toString(), this.access(options));
267
+ if (node.type === "directory") {
268
+ const ownerSignal = this.signal(options);
269
+ return {
270
+ ...node,
271
+ entries: async function* (entryOptions = {}) {
272
+ const signal = AbortSignal.any([
273
+ ownerSignal,
274
+ ...(entryOptions.signal ? [entryOptions.signal] : []),
275
+ ]);
276
+ signal.throwIfAborted();
277
+ for await (const entry of node.entries({ ...entryOptions, signal })) {
278
+ signal.throwIfAborted();
279
+ yield entry;
280
+ }
281
+ signal.throwIfAborted();
282
+ },
283
+ };
284
+ }
285
+ if (node.type !== "raw" &&
286
+ !(node.type === "file" && ["file", "raw"].includes(node.unixfs.type)))
287
+ throw new ContentError("unsupported_content", "Only regular UnixFS files and directories are supported.");
288
+ return node;
289
+ }
290
+ async readContent(cid, options = {}) {
291
+ const lifetime = new AbortController();
292
+ const signal = AbortSignal.any([
293
+ lifetime.signal,
294
+ ...(options.signal ? [options.signal] : []),
295
+ ]);
296
+ const node = await this.read(cid, { ...options, signal });
297
+ if (node.type === "directory") {
298
+ const read = this.read.bind(this);
299
+ const entries = async function* () {
300
+ for await (const entry of node.entries()) {
301
+ const target = await read(entry.cid, { ...options, signal });
302
+ yield {
303
+ name: entry.name,
304
+ kind: target.type === "directory" ? "directory" : "file",
305
+ cid: entry.cid,
306
+ };
307
+ }
308
+ };
309
+ return { kind: "directory", entries: entries() };
310
+ }
311
+ const iterator = node.content()[Symbol.asyncIterator]();
312
+ return {
313
+ kind: "file",
314
+ content: new ReadableStream({
315
+ async pull(controller) {
316
+ try {
317
+ const result = await iterator.next();
318
+ if (result.done)
319
+ controller.close();
320
+ else
321
+ controller.enqueue(result.value);
322
+ }
323
+ catch (error) {
324
+ controller.error(error);
325
+ }
326
+ },
327
+ async cancel() {
328
+ lifetime.abort(new Error("IPFS file stream canceled."));
329
+ await iterator.return();
330
+ },
331
+ }, { highWaterMark: 0 }),
332
+ };
333
+ }
334
+ async putContent(content, options = {}) {
335
+ const signal = this.signal(options);
336
+ signal.throwIfAborted();
337
+ if (!(content instanceof ReadableStream))
338
+ throw new ContentError("unsupported_content", "putContent requires a byte stream.");
339
+ const reader = content.getReader();
340
+ let imported = 0;
341
+ const getBlock = this.block.get;
342
+ const putBlock = this.put.bind(this);
343
+ const limits = this.limits;
344
+ const blockstore = {
345
+ get: async function* (cid) {
346
+ yield await getBlock(cid.toString(), { signal });
347
+ },
348
+ put: async (cid, bytes) => {
349
+ signal.throwIfAborted();
350
+ if (!(bytes instanceof Uint8Array))
351
+ throw new ContentError("unsupported_content", "putContent requires bytes.");
352
+ if (bytes.byteLength > limits.blockBytes)
353
+ throw new ContentError("capacity_exceeded", "IPFS block byte capacity exceeded.");
354
+ await putBlock(cid, bytes, options);
355
+ return cid;
356
+ },
357
+ has: async (cid) => {
358
+ try {
359
+ await getBlock(cid.toString(), { signal });
360
+ return true;
361
+ }
362
+ catch {
363
+ return false;
364
+ }
365
+ },
366
+ };
367
+ async function* input() {
368
+ for (;;) {
369
+ signal.throwIfAborted();
370
+ const item = await reader.read();
371
+ if (item.done)
372
+ return;
373
+ if (!(item.value instanceof Uint8Array))
374
+ throw new ContentError("unsupported_content", "putContent requires bytes.");
375
+ imported += item.value.byteLength;
376
+ if (imported > limits.bytes)
377
+ throw new ContentError("capacity_exceeded", "IPFS import byte capacity exceeded.");
378
+ for (let offset = 0; offset < item.value.length; offset += 262_144)
379
+ yield item.value.subarray(offset, offset + 262_144);
380
+ }
381
+ }
382
+ try {
383
+ const cid = await unixfs({ blockstore }).addByteStream(input(), {
384
+ signal,
385
+ cidVersion: 1,
386
+ rawLeaves: true,
387
+ blockWriteConcurrency: 1,
388
+ });
389
+ await this.read(cid, options);
390
+ return cid;
391
+ }
392
+ finally {
393
+ try {
394
+ await reader.cancel();
395
+ }
396
+ finally {
397
+ reader.releaseLock();
398
+ }
399
+ }
400
+ }
401
+ async resolveContent(cid, path, options = {}) {
402
+ if (typeof path !== "string" ||
403
+ path.includes("\0") ||
404
+ path.includes("\\") ||
405
+ (path !== "" &&
406
+ path.split("/").some((part) => !part || part === "." || part === "..")))
407
+ throw new ContentError("unsupported_content", "Expected a directory-relative content path.");
408
+ if (path === "")
409
+ return (await this.read(cid, options)).cid;
410
+ let target = cid;
411
+ for (const part of path.split("/")) {
412
+ const directory = await this.read(target, options);
413
+ if (directory.type !== "directory")
414
+ throw new ContentError("unsupported_content", "Cannot resolve a path through a file.");
415
+ target = (await this.read(`${target.toString()}/${part}`, options)).cid;
416
+ }
417
+ return target;
418
+ }
419
+ prepare(root, options = {}) {
420
+ return prepareContent(this.client(options), root.toString(), this.access(options));
421
+ }
422
+ close() {
423
+ this.closing ??= (async () => {
424
+ this.lifetime.abort(new Error("IPFS store is closed."));
425
+ if (this.ownsBackend)
426
+ await this.backend.close();
427
+ if (this.ownsBackend)
428
+ await this.retention?.close();
429
+ await this.gateway?.close();
430
+ this.retainedBlocks.clear();
431
+ this.retentionBudget.bytes = 0;
432
+ })();
433
+ return this.closing;
434
+ }
435
+ }
436
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAOvC,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,gBAAgB,GAGjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,aA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AAC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;QAC1E,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,CAAC,IAAkB,EAAE,UAA2B,EAAE;QACvD,OAAO,cAAc,CACnB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EACpB,IAAI,CAAC,QAAQ,EAAE,EACf,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CACrB,CAAC;IACJ,CAAC;IACD,KAAK;QACH,IAAI,CAAC,OAAO,KAAK,CAAC,KAAK,IAAI,EAAE;YAC3B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;YACxD,IAAI,IAAI,CAAC,WAAW;gBAAE,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACjD,IAAI,IAAI,CAAC,WAAW;gBAAE,MAAM,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC;YACpD,MAAM,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;YAC5B,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;YAC5B,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,CAAC;QACjC,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,13 +1,75 @@
1
1
  {
2
2
  "name": "@ipab/ipfs-store",
3
- "version": "0.0.0",
4
- "description": "Local and Kubo IPFS storage with retention coordination. Bootstrap placeholder only.",
3
+ "version": "0.1.0-rc.1",
4
+ "private": false,
5
+ "description": "Verified bounded UnixFS content acquisition and shared block storage.",
6
+ "type": "module",
7
+ "sideEffects": false,
5
8
  "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/silvermoon-work/ipab.git"
9
+ "files": [
10
+ "dist",
11
+ "src"
12
+ ],
13
+ "homepage": "https://github.com/silvermoon-work/ipab#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/silvermoon-work/ipab/issues"
9
16
  },
10
17
  "publishConfig": {
18
+ "registry": "https://registry.npmjs.org/",
11
19
  "access": "public"
20
+ },
21
+ "engines": {
22
+ "node": ">=22.15.0"
23
+ },
24
+ "main": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
+ },
31
+ "./dag": {
32
+ "types": "./dist/dag.d.ts",
33
+ "import": "./dist/dag.js"
34
+ },
35
+ "./node": {
36
+ "types": "./dist/node.d.ts",
37
+ "import": "./dist/node.js"
38
+ },
39
+ "./package.json": "./package.json"
40
+ },
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/silvermoon-work/ipab.git",
44
+ "directory": "packages/ipfs-store"
45
+ },
46
+ "dependencies": {
47
+ "@helia/http": "3.0.4",
48
+ "@helia/unixfs": "8.0.9",
49
+ "@helia/block-brokers": "5.2.4",
50
+ "@helia/routers": "4.0.6",
51
+ "@ipld/dag-cbor": "10.0.2",
52
+ "@ipld/dag-pb": "4.2.0",
53
+ "@silvermoon-work/ipfs-access": "0.1.0",
54
+ "@silvermoon-work/ipfs-payload": "0.1.0",
55
+ "blockstore-core": "7.0.1",
56
+ "multiformats": "14.0.5",
57
+ "ipfs-unixfs-exporter": "16.2.3"
58
+ },
59
+ "devDependencies": {
60
+ "@ipld/car": "5.4.6",
61
+ "@types/node": "26.6.6",
62
+ "@vitest/coverage-v8": "5.1.0",
63
+ "ipfs-unixfs-importer": "17.1.1",
64
+ "typescript": "6.0.3",
65
+ "vitest": "5.1.0"
66
+ },
67
+ "scripts": {
68
+ "build": "node scripts/build.mjs",
69
+ "lint-package": "publint --strict",
70
+ "typecheck": "tsc --noEmit --project tsconfig.json",
71
+ "test": "vitest run --root . --config ../../vitest.config.ts",
72
+ "test-ci": "vitest run --root . --config ../../vitest.config.ts --tags-filter \"!release-e2e\"",
73
+ "test-coverage": "vitest run --root . --config ../../vitest.config.ts --coverage"
12
74
  }
13
75
  }