@effect-vfs/core 0.8.0 → 0.10.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/README.md +9 -0
- package/dist/BytePath.d.ts +4 -1
- package/dist/BytePath.d.ts.map +1 -1
- package/dist/BytePath.js +6 -4
- package/dist/Caller.d.ts +107 -66
- package/dist/Caller.d.ts.map +1 -1
- package/dist/Caller.js +16 -86
- package/dist/LiveVolume.d.ts +75 -2
- package/dist/LiveVolume.d.ts.map +1 -1
- package/dist/LiveVolume.js +87 -3
- package/dist/Search.d.ts +32 -8
- package/dist/Search.d.ts.map +1 -1
- package/dist/Search.js +19 -10
- package/dist/SynchronousAdapter.d.ts +58 -0
- package/dist/SynchronousAdapter.d.ts.map +1 -0
- package/dist/SynchronousAdapter.js +116 -0
- package/dist/Target.d.ts +7 -91
- package/dist/Target.d.ts.map +1 -1
- package/dist/Target.js +7 -47
- package/dist/Testing.d.ts +5 -2
- package/dist/Testing.d.ts.map +1 -1
- package/dist/Testing.js +2 -1
- package/dist/VfsError.d.ts +4 -2
- package/dist/VfsError.d.ts.map +1 -1
- package/dist/VfsError.js +3 -1
- package/dist/VirtualFileSystem.d.ts +151 -44
- package/dist/VirtualFileSystem.d.ts.map +1 -1
- package/dist/VirtualFileSystem.js +31 -21
- package/dist/Volume.d.ts +6 -1
- package/dist/Volume.d.ts.map +1 -1
- package/dist/Volume.js +6 -2
- package/dist/Watch.d.ts +18 -0
- package/dist/Watch.d.ts.map +1 -1
- package/dist/Watch.js +12 -0
- package/dist/internal/adapterBinding.d.ts +13 -0
- package/dist/internal/adapterBinding.d.ts.map +1 -0
- package/dist/internal/adapterBinding.js +13 -0
- package/dist/internal/bytePath.d.ts +6 -1
- package/dist/internal/bytePath.d.ts.map +1 -1
- package/dist/internal/callerWatch.d.ts +36 -0
- package/dist/internal/callerWatch.d.ts.map +1 -0
- package/dist/internal/callerWatch.js +185 -0
- package/dist/internal/engine.d.ts +1305 -0
- package/dist/internal/engine.d.ts.map +1 -0
- package/dist/internal/engine.js +3458 -0
- package/dist/internal/errors.d.ts +1 -33
- package/dist/internal/errors.d.ts.map +1 -1
- package/dist/internal/errors.js +1 -45
- package/dist/internal/fixture.d.ts +2 -1
- package/dist/internal/fixture.d.ts.map +1 -1
- package/dist/internal/fixture.js +8 -4
- package/dist/internal/image.d.ts +4 -1
- package/dist/internal/image.d.ts.map +1 -1
- package/dist/internal/image.js +6 -3
- package/dist/internal/lines.d.ts.map +1 -1
- package/dist/internal/lines.js +3 -2
- package/dist/internal/liveImage.d.ts +4 -2
- package/dist/internal/liveImage.d.ts.map +1 -1
- package/dist/internal/liveImage.js +3 -1
- package/dist/internal/merkle.d.ts +7 -4
- package/dist/internal/merkle.d.ts.map +1 -1
- package/dist/internal/merkle.js +6 -4
- package/dist/internal/search.d.ts +3 -1
- package/dist/internal/search.d.ts.map +1 -1
- package/dist/internal/search.js +4 -3
- package/dist/internal/snapshotDelta.d.ts +11 -7
- package/dist/internal/snapshotDelta.d.ts.map +1 -1
- package/dist/internal/snapshotDelta.js +15 -9
- package/dist/internal/snapshotMerge.d.ts +1 -1
- package/dist/internal/snapshotMerge.d.ts.map +1 -1
- package/dist/internal/snapshotMerge.js +5 -2
- package/dist/internal/tree.d.ts +4 -2
- package/dist/internal/tree.d.ts.map +1 -1
- package/dist/internal/tree.js +4 -2
- package/dist/internal/virtualFileSystem.d.ts +20 -49
- package/dist/internal/virtualFileSystem.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem.js +85 -1927
- package/dist/internal/volumeLimits.d.ts +1 -0
- package/dist/internal/volumeLimits.d.ts.map +1 -1
- package/dist/internal/volumeLimits.js +3 -2
- package/dist/internal/volumeState.d.ts +10 -79
- package/dist/internal/volumeState.d.ts.map +1 -1
- package/dist/internal/volumeState.js +9 -79
- package/dist/internal/watchHub.d.ts +9 -5
- package/dist/internal/watchHub.d.ts.map +1 -1
- package/dist/internal/watchHub.js +35 -8
- package/package.json +16 -9
- package/dist/internal/inodeTable.d.ts +0 -20
- package/dist/internal/inodeTable.d.ts.map +0 -1
- package/dist/internal/inodeTable.js +0 -48
- package/dist/internal/path.d.ts +0 -56
- package/dist/internal/path.d.ts.map +0 -1
- package/dist/internal/path.js +0 -141
- package/dist/internal/resolution.d.ts +0 -135
- package/dist/internal/resolution.d.ts.map +0 -1
- package/dist/internal/resolution.js +0 -277
- package/dist/internal/testSeams.d.ts +0 -17
- package/dist/internal/testSeams.d.ts.map +0 -1
- package/dist/internal/testSeams.js +0 -20
- package/dist/internal/tokenRegistry.d.ts +0 -77
- package/dist/internal/tokenRegistry.d.ts.map +0 -1
- package/dist/internal/tokenRegistry.js +0 -128
- package/dist/internal/turnstile.d.ts +0 -8
- package/dist/internal/turnstile.d.ts.map +0 -1
- package/dist/internal/turnstile.js +0 -43
|
@@ -9,6 +9,7 @@ export declare const defaults: VolumeLimits;
|
|
|
9
9
|
/** @internal */
|
|
10
10
|
export declare const configuration: (options?: VolumeOptions, operation?: string) => Result.Result<{
|
|
11
11
|
options: {
|
|
12
|
+
readonly execution?: "cooperative" | "sync";
|
|
12
13
|
readonly identity?: string & import("effect/Brand").Brand<"@effect-vfs/core/VolumeIdentity">;
|
|
13
14
|
readonly maxEntries?: number;
|
|
14
15
|
readonly maxPendingOperations?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volumeLimits.d.ts","sourceRoot":"","sources":["../../src/internal/volumeLimits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"volumeLimits.d.ts","sourceRoot":"","sources":["../../src/internal/volumeLimits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAGjE,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAA;AAMtC,KAAK,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;AAM1C,gBAAgB;AAChB,eAAO,MAAM,QAAQ,EAAE,YAOrB,CAAA;AAEF,gBAAgB;AAChB,eAAO,MAAM,aAAa,aAAc,aAAa;;;;;;;;;;;;;;;;;;;;4CAelD,CAAA;AAEH,gBAAgB;AAChB,eAAO,MAAM,WAAW,aAAc,aAAa;;;;;;;6CACyB,CAAA;AAE5E,gBAAgB;AAChB,eAAO,MAAM,UAAU,WAAY,YAAY,YAAW,YAAY;;;;;;;6CAerE,CAAA;AAED,gBAAgB;AAChB,eAAO,MAAM,QAAQ,WAAY,YAAY,KAAG,YAY/C,CAAA;AAKD,gBAAgB;AAChB,eAAO,MAAM,UAAU,WACb,YAAY,aACT,YAAY,YACb,cAAc,sBACJ,cAAc,KACjC,OAGkE,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as ByteSize from "effect/ByteSize";
|
|
2
2
|
import * as Result from "effect/Result";
|
|
3
3
|
import { VolumeOptions } from "../Volume.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { Errors, State } from "./engine.js";
|
|
5
|
+
const decodeConfiguration = Errors.decodeConfiguration;
|
|
6
|
+
const MAX_FILE_BYTES = State.MAX_FILE_BYTES;
|
|
6
7
|
/** @internal */
|
|
7
8
|
export const defaults = Object.freeze({
|
|
8
9
|
maxEntries: undefined,
|
|
@@ -1,88 +1,18 @@
|
|
|
1
|
-
import * as Brand from "effect/Brand";
|
|
2
1
|
import * as Effect from "effect/Effect";
|
|
3
|
-
import
|
|
4
|
-
import type { Metadata } from "../Metadata.js";
|
|
5
|
-
import * as InodeTable from "./inodeTable.js";
|
|
2
|
+
import { State } from "./engine.js";
|
|
6
3
|
import type { StoredMetadata } from "./metadata.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare const ROOT_INO: Ino;
|
|
13
|
-
/** @internal */
|
|
14
|
-
export declare const MAX_INO: number;
|
|
15
|
-
/** @internal */
|
|
16
|
-
export declare const MAX_FILE_BYTES = 4294967295;
|
|
17
|
-
/** @internal */
|
|
18
|
-
export declare const WALK_YIELD_INTERVAL = 128;
|
|
19
|
-
/** @internal */
|
|
20
|
-
export interface Link {
|
|
21
|
-
readonly parent: Ino;
|
|
22
|
-
readonly name: string;
|
|
23
|
-
}
|
|
24
|
-
/** @internal */
|
|
25
|
-
export type NodeMetadata = Omit<Metadata, "revision">;
|
|
26
|
-
/** @internal */
|
|
27
|
-
export interface Directory {
|
|
28
|
-
readonly kind: "directory";
|
|
29
|
-
readonly ino: Ino;
|
|
30
|
-
readonly parent: Ino;
|
|
31
|
-
readonly name: string;
|
|
32
|
-
readonly entries: ReadonlyMap<string, Ino>;
|
|
33
|
-
readonly metadata: NodeMetadata;
|
|
34
|
-
readonly revision: bigint;
|
|
35
|
-
}
|
|
36
|
-
/** @internal */
|
|
37
|
-
export interface RegularFile {
|
|
38
|
-
readonly kind: "file";
|
|
39
|
-
readonly ino: Ino;
|
|
40
|
-
readonly data: Uint8Array;
|
|
41
|
-
readonly links: ReadonlyArray<Link>;
|
|
42
|
-
readonly metadata: NodeMetadata;
|
|
43
|
-
readonly revision: bigint;
|
|
44
|
-
}
|
|
45
|
-
/** @internal */
|
|
46
|
-
export interface SymbolicLink {
|
|
47
|
-
readonly kind: "symlink";
|
|
48
|
-
readonly ino: Ino;
|
|
49
|
-
readonly target: Uint8Array;
|
|
50
|
-
readonly links: ReadonlyArray<Link>;
|
|
51
|
-
readonly metadata: NodeMetadata;
|
|
52
|
-
readonly revision: bigint;
|
|
53
|
-
}
|
|
54
|
-
/** @internal */
|
|
55
|
-
export type Node = Directory | RegularFile | SymbolicLink;
|
|
56
|
-
/** @internal */
|
|
57
|
-
export interface VolumeState {
|
|
58
|
-
readonly inodes: InodeTable.InodeTable<Node>;
|
|
59
|
-
readonly open: ReadonlyMap<Ino, number>;
|
|
60
|
-
readonly nextInode: Ino;
|
|
61
|
-
readonly revision: bigint;
|
|
62
|
-
readonly entries: number;
|
|
63
|
-
readonly usedBytes: bigint;
|
|
64
|
-
}
|
|
65
|
-
/** @internal */
|
|
66
|
-
export declare const getNode: (state: VolumeState, ino: Ino) => Node | undefined;
|
|
67
|
-
/** @internal */
|
|
68
|
-
export declare const byIno: Order.Order<Node>;
|
|
69
|
-
/** @internal */
|
|
70
|
-
export declare const byEntryName: Order.Order<readonly [string, Ino]>;
|
|
71
|
-
/** @internal */
|
|
72
|
-
export declare const payloadOf: (node: Node) => Uint8Array | undefined;
|
|
73
|
-
/** @internal */
|
|
74
|
-
export declare const directoryMetadata: (ino: bigint, uid: number, gid: number, mode: number, now: bigint) => NodeMetadata;
|
|
75
|
-
/** @internal */
|
|
76
|
-
export declare const emptyRoot: (now: bigint) => Directory;
|
|
77
|
-
/** @internal */
|
|
78
|
-
export declare const emptyState: (now: bigint) => VolumeState;
|
|
4
|
+
declare const Ino: import("effect/Brand").Constructor<State.Ino>;
|
|
5
|
+
type Ino = State.Ino;
|
|
6
|
+
type Link = State.Link;
|
|
7
|
+
type NodeMetadata = State.NodeMetadata;
|
|
8
|
+
type VolumeState = State.VolumeState;
|
|
79
9
|
/** @internal */
|
|
80
10
|
export declare const storedMetadata: (metadata: NodeMetadata) => StoredMetadata;
|
|
81
11
|
/** @internal */
|
|
82
|
-
export declare const reachableNodes: (state: VolumeState) => Effect.Effect<Node[], never, never>;
|
|
12
|
+
export declare const reachableNodes: (state: State.VolumeState) => Effect.Effect<State.Node[], never, never>;
|
|
83
13
|
/** @internal */
|
|
84
|
-
export declare const reachableValue: (source: VolumeState) => Effect.Effect<{
|
|
85
|
-
state: VolumeState;
|
|
14
|
+
export declare const reachableValue: (source: State.VolumeState) => Effect.Effect<{
|
|
15
|
+
state: State.VolumeState;
|
|
86
16
|
largestFile: number;
|
|
87
17
|
}, never, never>;
|
|
88
18
|
/** @internal */
|
|
@@ -110,4 +40,5 @@ export type NodeSpec = {
|
|
|
110
40
|
};
|
|
111
41
|
/** @internal */
|
|
112
42
|
export declare const assemble: (specs: ReadonlyArray<NodeSpec>) => VolumeState;
|
|
43
|
+
export {};
|
|
113
44
|
//# sourceMappingURL=volumeState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volumeState.d.ts","sourceRoot":"","sources":["../../src/internal/volumeState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"volumeState.d.ts","sourceRoot":"","sources":["../../src/internal/volumeState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,QAAA,MAAQ,GAAG,+CAAsF,CAAA;AAEjG,KAAK,GAAG,GAAG,KAAK,CAAC,GAAG,CAAA;AAEpB,KAAK,IAAI,GAAG,KAAK,CAAC,IAAI,CAAA;AAEtB,KAAK,YAAY,GAAG,KAAK,CAAC,YAAY,CAAA;AAUtC,KAAK,WAAW,GAAG,KAAK,CAAC,WAAW,CAAA;AAEpC,gBAAgB;AAChB,eAAO,MAAM,cAAc,aAAc,YAAY,KAAG,cAQtD,CAAA;AAEF,gBAAgB;AAChB,eAAO,MAAM,cAAc,yEAuBzB,CAAA;AAUF,gBAAgB;AAChB,eAAO,MAAM,cAAc;;;gBA4BzB,CAAA;AAEF,gBAAgB;AAChB,MAAM,MAAM,QAAQ,GAChB;IACA,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;IACjB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B,GACC;IACA,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;IACjB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IACnC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B,GACC;IACA,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;IACjB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IACnC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B,CAAA;AAMH,gBAAgB;AAChB,eAAO,MAAM,QAAQ,UAAW,aAAa,CAAC,QAAQ,CAAC,KAAG,WAsEzD,CAAA"}
|
|
@@ -1,76 +1,8 @@
|
|
|
1
|
-
import * as Brand from "effect/Brand";
|
|
2
1
|
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as HashMap from "effect/HashMap";
|
|
3
3
|
import * as Match from "effect/Match";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
/** @internal */
|
|
7
|
-
export const Ino = Brand.nominal();
|
|
8
|
-
/** @internal */
|
|
9
|
-
export const ROOT_INO = Ino(1);
|
|
10
|
-
// The largest inode number a value holds. The allocator resumes one above it and must stay exactly representable,
|
|
11
|
-
// since the inode table is keyed by a number.
|
|
12
|
-
/** @internal */
|
|
13
|
-
export const MAX_INO = Number.MAX_SAFE_INTEGER - 1;
|
|
14
|
-
// File sizes fit an unsigned 32-bit count in the volume and its public options.
|
|
15
|
-
/** @internal */
|
|
16
|
-
export const MAX_FILE_BYTES = 0xffffffff;
|
|
17
|
-
// Nodes walked between yields. Whole-tree reads are one synchronous tick otherwise, which
|
|
18
|
-
// starves the event loop and leaves nothing for interruption to act on.
|
|
19
|
-
/** @internal */
|
|
20
|
-
export const WALK_YIELD_INTERVAL = 128;
|
|
21
|
-
/** @internal */
|
|
22
|
-
export const getNode = (state, ino) => InodeTable.get(state.inodes, ino);
|
|
23
|
-
/** @internal */
|
|
24
|
-
export const byIno = Order.mapInput(Order.Number, (node) => node.ino);
|
|
25
|
-
/** @internal */
|
|
26
|
-
export const byEntryName = Order.mapInput(Order.String, ([name]) => name);
|
|
27
|
-
const inNameOrder = (entries) => {
|
|
28
|
-
let previous;
|
|
29
|
-
for (const name of entries.keys()) {
|
|
30
|
-
if (previous !== undefined && previous > name)
|
|
31
|
-
return false;
|
|
32
|
-
previous = name;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
};
|
|
36
|
-
const inEntryOrder = (directory) => inNameOrder(directory.entries)
|
|
37
|
-
? directory
|
|
38
|
-
: { ...directory, entries: new Map([...directory.entries].sort(byEntryName)) };
|
|
39
|
-
/** @internal */
|
|
40
|
-
export const payloadOf = (node) => node.kind === "file" ? node.data : node.kind === "symlink" ? node.target : undefined;
|
|
41
|
-
/** @internal */
|
|
42
|
-
export const directoryMetadata = (ino, uid, gid, mode, now) => ({
|
|
43
|
-
kind: "directory",
|
|
44
|
-
ino,
|
|
45
|
-
uid,
|
|
46
|
-
gid,
|
|
47
|
-
mode,
|
|
48
|
-
nlink: 2,
|
|
49
|
-
size: 0n,
|
|
50
|
-
atimeNs: now,
|
|
51
|
-
mtimeNs: now,
|
|
52
|
-
ctimeNs: now,
|
|
53
|
-
birthtimeNs: now
|
|
54
|
-
});
|
|
55
|
-
/** @internal */
|
|
56
|
-
export const emptyRoot = (now) => ({
|
|
57
|
-
kind: "directory",
|
|
58
|
-
ino: ROOT_INO,
|
|
59
|
-
parent: ROOT_INO,
|
|
60
|
-
name: "",
|
|
61
|
-
entries: new Map(),
|
|
62
|
-
metadata: directoryMetadata(BigInt(ROOT_INO), 0, 0, 0o755, now),
|
|
63
|
-
revision: 1n
|
|
64
|
-
});
|
|
65
|
-
/** @internal */
|
|
66
|
-
export const emptyState = (now) => ({
|
|
67
|
-
inodes: InodeTable.set(InodeTable.empty(), ROOT_INO, emptyRoot(now)),
|
|
68
|
-
open: new Map(),
|
|
69
|
-
nextInode: Ino(2),
|
|
70
|
-
revision: 1n,
|
|
71
|
-
entries: 0,
|
|
72
|
-
usedBytes: 0n
|
|
73
|
-
});
|
|
4
|
+
import { State } from "./engine.js";
|
|
5
|
+
const { Ino, ROOT_INO, WALK_YIELD_INTERVAL, getNode, setNode, byEntryName, inEntryOrder } = State;
|
|
74
6
|
/** @internal */
|
|
75
7
|
export const storedMetadata = (metadata) => ({
|
|
76
8
|
uid: metadata.uid,
|
|
@@ -115,13 +47,12 @@ const atFirstRevision = (node) => node.revision === 1n ? node : { ...node, revis
|
|
|
115
47
|
/** @internal */
|
|
116
48
|
export const reachableValue = Effect.fnUntraced(function* (source) {
|
|
117
49
|
const nodes = yield* reachableNodes(source);
|
|
118
|
-
const
|
|
119
|
-
let inodes = InodeTable.empty();
|
|
50
|
+
const inodes = HashMap.beginMutation(HashMap.empty());
|
|
120
51
|
let entries = 0;
|
|
121
52
|
let usedBytes = 0n;
|
|
122
53
|
let largestFile = 0;
|
|
123
54
|
for (const node of nodes) {
|
|
124
|
-
|
|
55
|
+
setNode(inodes, atFirstRevision(node.kind === "directory" ? inEntryOrder(node) : node));
|
|
125
56
|
if (node.kind === "directory")
|
|
126
57
|
entries += node.entries.size;
|
|
127
58
|
else if (node.kind === "symlink")
|
|
@@ -132,7 +63,7 @@ export const reachableValue = Effect.fnUntraced(function* (source) {
|
|
|
132
63
|
}
|
|
133
64
|
}
|
|
134
65
|
const state = {
|
|
135
|
-
inodes,
|
|
66
|
+
inodes: HashMap.endMutation(inodes),
|
|
136
67
|
open: new Map(),
|
|
137
68
|
nextInode: source.nextInode,
|
|
138
69
|
revision: 1n,
|
|
@@ -178,8 +109,7 @@ export const assemble = (specs) => {
|
|
|
178
109
|
attach(link.parent, link.name, spec.ino);
|
|
179
110
|
}
|
|
180
111
|
}
|
|
181
|
-
const
|
|
182
|
-
let inodes = InodeTable.empty();
|
|
112
|
+
const inodes = HashMap.beginMutation(HashMap.empty());
|
|
183
113
|
for (const spec of specs) {
|
|
184
114
|
const base = { ...spec.metadata, ino: BigInt(spec.ino) };
|
|
185
115
|
const node = Match.value(spec).pipe(Match.discriminator("kind")("directory", (directory) => ({
|
|
@@ -205,7 +135,7 @@ export const assemble = (specs) => {
|
|
|
205
135
|
metadata: { ...base, kind: "symlink", nlink: symlink.links.length, size: BigInt(symlink.target.length) },
|
|
206
136
|
revision: symlink.revision
|
|
207
137
|
})), Match.exhaustive);
|
|
208
|
-
|
|
138
|
+
setNode(inodes, node);
|
|
209
139
|
}
|
|
210
|
-
return { inodes, open: new Map(), nextInode, revision, entries, usedBytes };
|
|
140
|
+
return { inodes: HashMap.endMutation(inodes), open: new Map(), nextInode, revision, entries, usedBytes };
|
|
211
141
|
};
|
|
@@ -2,24 +2,28 @@ import * as Effect from "effect/Effect";
|
|
|
2
2
|
import * as Scope from "effect/Scope";
|
|
3
3
|
import * as Stream from "effect/Stream";
|
|
4
4
|
/** @internal */
|
|
5
|
-
export interface Coordinator {
|
|
6
|
-
<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>;
|
|
5
|
+
export interface Coordinator<Failure> {
|
|
6
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E | Failure, R>;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Selection callbacks share the context of their publication.
|
|
10
10
|
*
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
export interface Selection<A, C> {
|
|
13
|
+
export interface Selection<A, C, E = never> {
|
|
14
14
|
readonly includes: (event: A, context: C) => boolean;
|
|
15
|
+
readonly prepare?: (context: C) => void;
|
|
16
|
+
readonly project?: (event: A, context: C) => A | undefined;
|
|
17
|
+
readonly failure?: (context: C) => E | undefined;
|
|
18
|
+
readonly boundedTerminal?: boolean;
|
|
15
19
|
readonly rescan: (context: C) => A;
|
|
16
20
|
readonly settle?: (context: C) => Iterable<A> | undefined;
|
|
17
21
|
}
|
|
18
22
|
/** @internal */
|
|
19
23
|
export interface WatchHub<A, C, E = never> {
|
|
20
24
|
readonly publishUnsafe: (events: () => Iterable<A>, context: C) => void;
|
|
21
|
-
readonly subscribe: (select: Effect.Effect<Selection<A, C>, E>, afterSubscribe: Effect.Effect<void>) => Effect.Effect<Stream.Stream<A>, E, Scope.Scope>;
|
|
25
|
+
readonly subscribe: <F extends E = never>(select: Effect.Effect<Selection<A, C, F>, E>, afterSubscribe: Effect.Effect<void>) => Effect.Effect<Stream.Stream<A, F>, E, Scope.Scope>;
|
|
22
26
|
}
|
|
23
27
|
/** @internal */
|
|
24
|
-
export declare const make: <A, C, E = never>(coordinate: Coordinator
|
|
28
|
+
export declare const make: <A, C, E = never>(coordinate: Coordinator<E>, capacity: number, synchronous?: boolean | undefined) => Effect.Effect<WatchHub<A, C, E>, never, never>;
|
|
25
29
|
//# sourceMappingURL=watchHub.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchHub.d.ts","sourceRoot":"","sources":["../../src/internal/watchHub.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK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,SAAS,CAAA;CAC1D;AAED,gBAAgB;AAChB,MAAM,WAAW,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK;IACvC,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,IAAI,CAAA;IACvE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,KAAK,EACtC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAC5C,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAChC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;CACxD;AAQD,gBAAgB;AAChB,eAAO,MAAM,IAAI,GAA+B,CAAC,EAAE,CAAC,EAAE,CAAC,4IAwHrD,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import * as Cause from "effect/Cause";
|
|
1
2
|
import * as Effect from "effect/Effect";
|
|
2
3
|
import * as Predicate from "effect/Predicate";
|
|
3
4
|
import * as Queue from "effect/Queue";
|
|
4
5
|
import * as Scope from "effect/Scope";
|
|
5
6
|
import * as Stream from "effect/Stream";
|
|
6
7
|
/** @internal */
|
|
7
|
-
export const make = Effect.fnUntraced(function* (coordinate, capacity) {
|
|
8
|
+
export const make = Effect.fnUntraced(function* (coordinate, capacity, synchronous = false) {
|
|
8
9
|
const subscribers = new Set();
|
|
9
10
|
const offer = (subscriber, event, context) => {
|
|
10
11
|
const size = Queue.sizeUnsafe(subscriber.queue);
|
|
@@ -17,20 +18,43 @@ export const make = Effect.fnUntraced(function* (coordinate, capacity) {
|
|
|
17
18
|
const publishUnsafe = (events, context) => {
|
|
18
19
|
if (subscribers.size === 0)
|
|
19
20
|
return;
|
|
21
|
+
for (const subscriber of subscribers)
|
|
22
|
+
subscriber.selection.prepare?.(context);
|
|
20
23
|
for (const event of events()) {
|
|
21
24
|
for (const subscriber of subscribers) {
|
|
22
|
-
if (subscriber.selection.includes(event, context))
|
|
23
|
-
|
|
25
|
+
if (subscriber.selection.includes(event, context)) {
|
|
26
|
+
const projected = subscriber.selection.project === undefined
|
|
27
|
+
? event
|
|
28
|
+
: subscriber.selection.project(event, context);
|
|
29
|
+
if (projected !== undefined)
|
|
30
|
+
offer(subscriber, projected, context);
|
|
31
|
+
}
|
|
24
32
|
}
|
|
25
33
|
}
|
|
26
34
|
for (const subscriber of subscribers) {
|
|
27
35
|
const last = subscriber.selection.settle?.(context);
|
|
28
|
-
|
|
36
|
+
const failure = subscriber.selection.failure?.(context);
|
|
37
|
+
if (last === undefined && failure === undefined)
|
|
29
38
|
continue;
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
if (last !== undefined) {
|
|
40
|
+
if (subscriber.selection.boundedTerminal) {
|
|
41
|
+
for (const event of last)
|
|
42
|
+
offer(subscriber, event, context);
|
|
43
|
+
if (subscriber.overflowed) {
|
|
44
|
+
while (Queue.takeUnsafe(subscriber.queue) !== undefined) { /* Drain before replacing with Rescan. */ }
|
|
45
|
+
Queue.offerUnsafe(subscriber.queue, subscriber.selection.rescan(context));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
for (const event of last)
|
|
50
|
+
Queue.offerUnsafe(subscriber.queue, event);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
32
53
|
subscribers.delete(subscriber);
|
|
33
|
-
|
|
54
|
+
if (failure === undefined)
|
|
55
|
+
Queue.endUnsafe(subscriber.queue);
|
|
56
|
+
else
|
|
57
|
+
Queue.failCauseUnsafe(subscriber.queue, Cause.fail(failure));
|
|
34
58
|
}
|
|
35
59
|
};
|
|
36
60
|
// Register cleanup before waiting for the volume, including when the scope closes during registration.
|
|
@@ -41,7 +65,9 @@ export const make = Effect.fnUntraced(function* (coordinate, capacity) {
|
|
|
41
65
|
const subscriber = registered;
|
|
42
66
|
if (subscriber === undefined)
|
|
43
67
|
return Effect.void;
|
|
44
|
-
|
|
68
|
+
const remove = Effect.sync(() => subscribers.delete(subscriber));
|
|
69
|
+
// Sync teardown is a known release action: it cannot wait on an active namespace operation.
|
|
70
|
+
return Effect.ensuring(synchronous ? remove : coordinate(remove), Queue.shutdown(subscriber.queue)).pipe(Effect.orDie);
|
|
45
71
|
}));
|
|
46
72
|
const closed = () => Predicate.isTagged(scope.state, "Closed");
|
|
47
73
|
const subscriber = yield* coordinate(Effect.gen(function* () {
|
|
@@ -62,6 +88,7 @@ export const make = Effect.fnUntraced(function* (coordinate, capacity) {
|
|
|
62
88
|
registered = created;
|
|
63
89
|
return created;
|
|
64
90
|
}));
|
|
91
|
+
// SAFETY: A subscription queue only receives failures from its own Selection<F>.
|
|
65
92
|
return subscriber === undefined ? Stream.empty : Stream.fromEffectRepeat(Queue.take(subscriber.queue));
|
|
66
93
|
});
|
|
67
94
|
return { publishUnsafe, subscribe };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-vfs/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A runtime-neutral virtual filesystem core for Effect.",
|
|
5
5
|
"homepage": "https://github.com/lloydrichards/effect-virtual-fs#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -19,20 +19,23 @@
|
|
|
19
19
|
"module": "./dist/index.js",
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "tsc --project tsconfig.build.json && tsc --project compatibility/node-next/tsconfig.json",
|
|
22
|
+
"build": "bun run check:engine-imports && tsc --project tsconfig.build.json && tsc --project compatibility/node-next/tsconfig.json",
|
|
23
|
+
"check:engine-imports": "bun compatibility/engine-imports/check.mjs",
|
|
23
24
|
"clean": "git clean -xdf .cache .turbo dist docs node_modules tsconfig.tsbuildinfo",
|
|
24
25
|
"test": "bun --bun run vitest run --config ../../vitest.config.ts --project core",
|
|
25
|
-
"type-check": "tsc --noEmit && tsc --project contracts/tsconfig.json"
|
|
26
|
+
"type-check": "tsc --noEmit && tsc --project contracts/tsconfig.json && tsc --project tsconfig.benchmarks.json",
|
|
27
|
+
"benchmark": "bun --bun run vitest bench --run --config ../../vitest.config.ts --project 'core (bench)'"
|
|
26
28
|
},
|
|
27
29
|
"peerDependencies": {
|
|
28
|
-
"effect": "
|
|
30
|
+
"effect": "~4.0.7"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"@effect/platform-bun": "4.0.
|
|
32
|
-
"@effect/platform-node-shared": "4.0.
|
|
33
|
-
"@effect/vitest": "4.0.
|
|
33
|
+
"@effect/platform-bun": "4.0.7",
|
|
34
|
+
"@effect/platform-node-shared": "4.0.7",
|
|
35
|
+
"@effect/vitest": "4.0.7",
|
|
34
36
|
"@repo/config-typescript": "workspace:*",
|
|
35
|
-
"effect": "4.0.
|
|
37
|
+
"effect": "4.0.7",
|
|
38
|
+
"@types/node": "26.6.6"
|
|
36
39
|
},
|
|
37
40
|
"exports": {
|
|
38
41
|
".": {
|
|
@@ -102,7 +105,11 @@
|
|
|
102
105
|
"./internal/*": null,
|
|
103
106
|
"./index": null,
|
|
104
107
|
"./*/index": null,
|
|
105
|
-
"./package.json": "./package.json"
|
|
108
|
+
"./package.json": "./package.json",
|
|
109
|
+
"./SynchronousAdapter": {
|
|
110
|
+
"types": "./dist/SynchronousAdapter.d.ts",
|
|
111
|
+
"import": "./dist/SynchronousAdapter.js"
|
|
112
|
+
}
|
|
106
113
|
},
|
|
107
114
|
"files": [
|
|
108
115
|
"dist/**",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** @internal */
|
|
2
|
-
export type Owner = symbol;
|
|
3
|
-
interface Slots<A> {
|
|
4
|
-
readonly owner: Owner | undefined;
|
|
5
|
-
readonly items: Array<Slots<A> | A | undefined>;
|
|
6
|
-
}
|
|
7
|
-
/** @internal */
|
|
8
|
-
export interface InodeTable<A> {
|
|
9
|
-
readonly root: Slots<A>;
|
|
10
|
-
readonly levels: number;
|
|
11
|
-
readonly capacity: number;
|
|
12
|
-
}
|
|
13
|
-
/** @internal */
|
|
14
|
-
export declare const empty: <A>() => InodeTable<A>;
|
|
15
|
-
/** @internal */
|
|
16
|
-
export declare const get: <A>(table: InodeTable<A>, key: number) => A | undefined;
|
|
17
|
-
/** @internal */
|
|
18
|
-
export declare const set: <A>(table: InodeTable<A>, key: number, value: A | undefined, owner?: Owner) => InodeTable<A>;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=inodeTable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inodeTable.d.ts","sourceRoot":"","sources":["../../src/internal/inodeTable.ts"],"names":[],"mappings":"AAQA,gBAAgB;AAChB,MAAM,MAAM,KAAK,GAAG,MAAM,CAAA;AAE1B,UAAU,KAAK,CAAC,CAAC;IACf,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;IACjC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,CAAA;CAChD;AAED,gBAAgB;AAChB,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED,gBAAgB;AAChB,eAAO,MAAM,KAAK,GAAI,CAAC,OAAK,UAAU,CAAC,CAAC,CAA4E,CAAA;AAKpH,gBAAgB;AAChB,eAAO,MAAM,GAAG,GAAI,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,OAAO,MAAM,KAAG,CAAC,GAAG,SAgB9D,CAAA;AAsBD,gBAAgB;AAChB,eAAO,MAAM,GAAG,GAAI,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,OAAO,MAAM,SAAS,CAAC,GAAG,SAAS,UAAU,KAAK,KAAG,UAAU,CAAC,CAAC,CAU3G,CAAA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// A 32-way persistent trie. One owner may mutate paths it has already copied within a batch.
|
|
2
|
-
const BITS = 5;
|
|
3
|
-
const WIDTH = 1 << BITS;
|
|
4
|
-
const MASK = WIDTH - 1;
|
|
5
|
-
const SHIFTABLE = 0x100000000; // Shifts wrap keys at 2^32 and shift counts at 32.
|
|
6
|
-
const MAX_SHIFT = 32;
|
|
7
|
-
/** @internal */
|
|
8
|
-
export const empty = () => ({ root: { owner: undefined, items: [] }, levels: 1, capacity: WIDTH });
|
|
9
|
-
const index = (key, shift) => key < SHIFTABLE && shift < MAX_SHIFT ? (key >>> shift) & MASK : Math.floor(key / 2 ** shift) % WIDTH;
|
|
10
|
-
/** @internal */
|
|
11
|
-
export const get = (table, key) => {
|
|
12
|
-
if (key >= table.capacity)
|
|
13
|
-
return undefined;
|
|
14
|
-
let node = table.root;
|
|
15
|
-
let shift = (table.levels - 1) * BITS;
|
|
16
|
-
while (shift > 0) {
|
|
17
|
-
const next = node.items[index(key, shift)];
|
|
18
|
-
if (next === undefined)
|
|
19
|
-
return undefined;
|
|
20
|
-
// SAFETY: every slot above the leaf level holds a Slots value or nothing.
|
|
21
|
-
node = next;
|
|
22
|
-
shift -= BITS;
|
|
23
|
-
}
|
|
24
|
-
// SAFETY: leaf level slots hold values or nothing.
|
|
25
|
-
return node.items[key & MASK];
|
|
26
|
-
};
|
|
27
|
-
const setIn = (node, key, value, shift, owner) => {
|
|
28
|
-
const target = owner !== undefined && node.owner === owner ? node : { owner, items: node.items.slice() };
|
|
29
|
-
if (shift === 0)
|
|
30
|
-
target.items[key & MASK] = value;
|
|
31
|
-
else {
|
|
32
|
-
const at = index(key, shift);
|
|
33
|
-
// SAFETY: every slot above the leaf level holds a Slots value or nothing.
|
|
34
|
-
const child = node.items[at] ?? { owner: undefined, items: [] };
|
|
35
|
-
target.items[at] = setIn(child, key, value, shift - BITS, owner);
|
|
36
|
-
}
|
|
37
|
-
return target;
|
|
38
|
-
};
|
|
39
|
-
/** @internal */
|
|
40
|
-
export const set = (table, key, value, owner) => {
|
|
41
|
-
let { capacity, levels, root } = table;
|
|
42
|
-
while (key >= capacity) {
|
|
43
|
-
root = { owner, items: [root] };
|
|
44
|
-
levels += 1;
|
|
45
|
-
capacity *= WIDTH;
|
|
46
|
-
}
|
|
47
|
-
return { root: setIn(root, key, value, (levels - 1) * BITS, owner), levels, capacity };
|
|
48
|
-
};
|
package/dist/internal/path.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as ByteSize from "effect/ByteSize";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as Result from "effect/Result";
|
|
4
|
-
import type { BytePath } from "../BytePath.js";
|
|
5
|
-
import type { FsFailure } from "../VfsError.js";
|
|
6
|
-
import type { PathInput } from "../VirtualFileSystem.js";
|
|
7
|
-
/** @internal */
|
|
8
|
-
export declare const SLASH_HEX = "2f";
|
|
9
|
-
/** @internal */
|
|
10
|
-
export declare const DOT_HEX = "2e";
|
|
11
|
-
/** @internal */
|
|
12
|
-
export declare const DOT_DOT_HEX = "2e2e";
|
|
13
|
-
/** @internal */
|
|
14
|
-
export declare const SLASH_BYTE = 47;
|
|
15
|
-
/** @internal */
|
|
16
|
-
export declare const NUL_BYTE = 0;
|
|
17
|
-
/** @internal */
|
|
18
|
-
export declare const MAX_SYMLINK_TRAVERSALS = 40;
|
|
19
|
-
/** @internal */
|
|
20
|
-
export declare const MAX_NAME_BYTES = 255;
|
|
21
|
-
/** @internal */
|
|
22
|
-
export declare const isNameBytes: (name: Uint8Array) => boolean;
|
|
23
|
-
/** @internal */
|
|
24
|
-
export declare const ROOT_PATH: Uint8Array<ArrayBuffer>;
|
|
25
|
-
/** @internal */
|
|
26
|
-
export declare const joinPath: (prefix: Uint8Array, name: Uint8Array) => Uint8Array;
|
|
27
|
-
/** @internal */
|
|
28
|
-
export declare const isDotComponent: (name: string | undefined) => name is undefined | typeof DOT_HEX | typeof DOT_DOT_HEX;
|
|
29
|
-
/** @internal */
|
|
30
|
-
export declare const ownedPath: (bytes: Uint8Array) => BytePath;
|
|
31
|
-
/** @internal */
|
|
32
|
-
export declare const strictString: (bytes: Uint8Array, operation: string) => Effect.Effect<string, FsFailure, never>;
|
|
33
|
-
/** @internal */
|
|
34
|
-
export declare const nameBytes: (name: string) => Uint8Array;
|
|
35
|
-
/** @internal */
|
|
36
|
-
export declare const isAttachedBytes: (bytes: Uint8Array) => boolean;
|
|
37
|
-
/** @internal */
|
|
38
|
-
export declare const pathFromBytes: (bytes: Uint8Array<ArrayBufferLike>) => Effect.Effect<BytePath, FsFailure, never>;
|
|
39
|
-
/** @internal */
|
|
40
|
-
export declare const pathToBytes: (path: BytePath) => Effect.Effect<Uint8Array<ArrayBuffer>, FsFailure, never>;
|
|
41
|
-
/** @internal */
|
|
42
|
-
export interface PreparedPath {
|
|
43
|
-
readonly input: PathInput;
|
|
44
|
-
readonly absolute: boolean;
|
|
45
|
-
readonly trailingSlash: boolean;
|
|
46
|
-
readonly bytes: Uint8Array;
|
|
47
|
-
readonly suffixes: ReadonlyArray<Uint8Array>;
|
|
48
|
-
readonly components: ReadonlyArray<string>;
|
|
49
|
-
}
|
|
50
|
-
/** @internal */
|
|
51
|
-
export declare const isWellFormed: (value: string) => boolean;
|
|
52
|
-
/** @internal */
|
|
53
|
-
export declare const inputBytes: (input: PathInput) => Result.Result<Uint8Array, "InvalidPathEncoding" | "InvalidArgument">;
|
|
54
|
-
/** @internal */
|
|
55
|
-
export declare const preparePath: (input: PathInput, operation: string, maxPathBytes: ByteSize.ByteSize | undefined) => Result.Result<PreparedPath, FsFailure>;
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