@poe-platform/safe-fs 0.1.816 → 0.1.817

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 CHANGED
@@ -15,6 +15,9 @@ To bound aggregate pages across multiple live stores, pass the same
15
15
  This shares a 256 KiB resident-page budget; `cache.residentBytes` reports current
16
16
  page retention. Eviction uses each store's filesystem, and each store still owns
17
17
  its `close()` cleanup. The budget excludes caller buffers and backend storage.
18
+ Call `await storage.prepare()` before opening a directory iterator when its
19
+ snapshot includes the scratch directory. It acquires and unlinks the backing
20
+ handle up front, so later spills do not mutate that directory's namespace.
18
21
  `IntegerTable.entries()` replays records in unsigned key order with a fixed
19
22
  16-level node stack and batches of at most 128 records. It accepts zero-filled
20
23
  caller storage with `allocate`, `read` and `write`; mutation during traversal
@@ -44,6 +44,8 @@ export declare class PagedStorage {
44
44
  private closing;
45
45
  constructor(context: PagedStorageContext, maxPages?: number, cache?: PagedStorageCache | undefined);
46
46
  allocate(length: number): number;
47
+ /** Acquire and unlink backing storage before observing a directory snapshot. */
48
+ prepare(): Promise<void>;
47
49
  private operation;
48
50
  private spill;
49
51
  private flush;
@@ -73,6 +73,11 @@ export class PagedStorage {
73
73
  this.end += length;
74
74
  return offset;
75
75
  }
76
+ /** Acquire and unlink backing storage before observing a directory snapshot. */
77
+ async prepare() {
78
+ await this.operation(async () => { if (!this.descriptor)
79
+ await this.spill(); });
80
+ }
76
81
  operation(action) {
77
82
  this.signal.throwIfAborted();
78
83
  const execute = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-fs",
3
- "version": "0.1.816",
3
+ "version": "0.1.817",
4
4
  "description": "Composable filesystem with a portable core and explicit Node adapters",
5
5
  "type": "module",
6
6
  "license": "MIT",