@effect-vfs/core 0.4.0 → 0.6.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.
Files changed (143) hide show
  1. package/README.md +39 -32
  2. package/dist/BytePath.d.ts +114 -4
  3. package/dist/BytePath.d.ts.map +1 -1
  4. package/dist/BytePath.js +155 -0
  5. package/dist/Caller.d.ts +391 -0
  6. package/dist/Caller.d.ts.map +1 -0
  7. package/dist/Caller.js +199 -0
  8. package/dist/FileHandle.d.ts +50 -0
  9. package/dist/FileHandle.d.ts.map +1 -0
  10. package/dist/FileHandle.js +28 -0
  11. package/dist/Fixture.d.ts +155 -0
  12. package/dist/Fixture.d.ts.map +1 -0
  13. package/dist/Fixture.js +65 -0
  14. package/dist/LiveVolume.d.ts +15 -22
  15. package/dist/LiveVolume.d.ts.map +1 -1
  16. package/dist/LiveVolume.js +19 -15
  17. package/dist/Metadata.d.ts +186 -0
  18. package/dist/Metadata.d.ts.map +1 -0
  19. package/dist/Metadata.js +125 -0
  20. package/dist/Snapshot.d.ts +31 -53
  21. package/dist/Snapshot.d.ts.map +1 -1
  22. package/dist/Snapshot.js +26 -49
  23. package/dist/SnapshotDelta.d.ts +24 -39
  24. package/dist/SnapshotDelta.d.ts.map +1 -1
  25. package/dist/SnapshotDelta.js +14 -35
  26. package/dist/Target.d.ts +225 -0
  27. package/dist/Target.d.ts.map +1 -0
  28. package/dist/Target.js +92 -0
  29. package/dist/Testing.d.ts +128 -0
  30. package/dist/Testing.d.ts.map +1 -0
  31. package/dist/Testing.js +111 -0
  32. package/dist/VfsError.d.ts +199 -0
  33. package/dist/VfsError.d.ts.map +1 -0
  34. package/dist/VfsError.js +164 -0
  35. package/dist/VirtualFileSystem.d.ts +628 -347
  36. package/dist/VirtualFileSystem.d.ts.map +1 -1
  37. package/dist/VirtualFileSystem.js +450 -117
  38. package/dist/Volume.d.ts +211 -0
  39. package/dist/Volume.d.ts.map +1 -0
  40. package/dist/Volume.js +172 -0
  41. package/dist/Watch.d.ts +68 -0
  42. package/dist/Watch.d.ts.map +1 -0
  43. package/dist/Watch.js +46 -0
  44. package/dist/index.d.ts +56 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +56 -1
  47. package/dist/internal/budget.d.ts +90 -0
  48. package/dist/internal/budget.d.ts.map +1 -0
  49. package/dist/internal/budget.js +70 -0
  50. package/dist/internal/bytePath.d.ts +2 -0
  51. package/dist/internal/bytePath.d.ts.map +1 -1
  52. package/dist/internal/bytePath.js +3 -2
  53. package/dist/internal/bytes.d.ts +3 -0
  54. package/dist/internal/bytes.d.ts.map +1 -1
  55. package/dist/internal/bytes.js +4 -2
  56. package/dist/internal/canonicalBase64.d.ts +1 -4
  57. package/dist/internal/canonicalBase64.d.ts.map +1 -1
  58. package/dist/internal/canonicalBase64.js +9 -13
  59. package/dist/internal/errors.d.ts +54 -0
  60. package/dist/internal/errors.d.ts.map +1 -0
  61. package/dist/internal/errors.js +91 -0
  62. package/dist/internal/{virtualFileSystem/fixture.d.ts → fixture.d.ts} +8 -8
  63. package/dist/internal/fixture.d.ts.map +1 -0
  64. package/dist/internal/fixture.js +133 -0
  65. package/dist/internal/hex128.d.ts +12 -0
  66. package/dist/internal/hex128.d.ts.map +1 -0
  67. package/dist/internal/hex128.js +7 -0
  68. package/dist/internal/hmac.d.ts +5 -0
  69. package/dist/internal/hmac.d.ts.map +1 -0
  70. package/dist/internal/hmac.js +150 -0
  71. package/dist/internal/image.d.ts +14 -117
  72. package/dist/internal/image.d.ts.map +1 -1
  73. package/dist/internal/image.js +137 -167
  74. package/dist/internal/inodeTable.d.ts +20 -0
  75. package/dist/internal/inodeTable.d.ts.map +1 -0
  76. package/dist/internal/inodeTable.js +48 -0
  77. package/dist/internal/lines.d.ts +36 -0
  78. package/dist/internal/lines.d.ts.map +1 -0
  79. package/dist/internal/lines.js +115 -0
  80. package/dist/internal/liveImage.d.ts +19 -278
  81. package/dist/internal/liveImage.d.ts.map +1 -1
  82. package/dist/internal/liveImage.js +75 -166
  83. package/dist/internal/merkle.d.ts +45 -0
  84. package/dist/internal/merkle.d.ts.map +1 -0
  85. package/dist/internal/merkle.js +179 -0
  86. package/dist/internal/metadata.d.ts +2 -13
  87. package/dist/internal/metadata.d.ts.map +1 -1
  88. package/dist/internal/metadata.js +5 -15
  89. package/dist/internal/{virtualFileSystem/overlayDiff.d.ts → overlayDiff.d.ts} +3 -3
  90. package/dist/internal/overlayDiff.d.ts.map +1 -0
  91. package/dist/internal/{virtualFileSystem/overlayDiff.js → overlayDiff.js} +1 -4
  92. package/dist/internal/{virtualFileSystem/path.d.ts → path.d.ts} +19 -7
  93. package/dist/internal/path.d.ts.map +1 -0
  94. package/dist/internal/{virtualFileSystem/path.js → path.js} +39 -25
  95. package/dist/internal/snapshotDelta.d.ts +61 -60
  96. package/dist/internal/snapshotDelta.d.ts.map +1 -1
  97. package/dist/internal/snapshotDelta.js +612 -504
  98. package/dist/internal/snapshotDeltaModel.d.ts.map +1 -1
  99. package/dist/internal/snapshotDeltaModel.js +0 -1
  100. package/dist/internal/stagedState.d.ts +18 -0
  101. package/dist/internal/stagedState.d.ts.map +1 -0
  102. package/dist/internal/stagedState.js +18 -0
  103. package/dist/internal/testSeams.d.ts +17 -0
  104. package/dist/internal/testSeams.d.ts.map +1 -0
  105. package/dist/internal/testSeams.js +20 -0
  106. package/dist/internal/tree.d.ts +225 -0
  107. package/dist/internal/tree.d.ts.map +1 -0
  108. package/dist/internal/tree.js +385 -0
  109. package/dist/internal/turnstile.d.ts +8 -0
  110. package/dist/internal/turnstile.d.ts.map +1 -0
  111. package/dist/internal/turnstile.js +43 -0
  112. package/dist/internal/virtualFileSystem.d.ts +41 -491
  113. package/dist/internal/virtualFileSystem.d.ts.map +1 -1
  114. package/dist/internal/virtualFileSystem.js +2118 -2471
  115. package/dist/internal/volumeState.d.ts +110 -0
  116. package/dist/internal/volumeState.d.ts.map +1 -0
  117. package/dist/internal/volumeState.js +204 -0
  118. package/dist/internal/watchHub.d.ts +25 -0
  119. package/dist/internal/watchHub.d.ts.map +1 -0
  120. package/dist/internal/watchHub.js +68 -0
  121. package/package.json +53 -9
  122. package/dist/VirtualFileSystemError.d.ts +0 -54
  123. package/dist/VirtualFileSystemError.d.ts.map +0 -1
  124. package/dist/VirtualFileSystemError.js +0 -49
  125. package/dist/internal/virtualFileSystem/errors.d.ts +0 -12
  126. package/dist/internal/virtualFileSystem/errors.d.ts.map +0 -1
  127. package/dist/internal/virtualFileSystem/errors.js +0 -47
  128. package/dist/internal/virtualFileSystem/fixture.d.ts.map +0 -1
  129. package/dist/internal/virtualFileSystem/fixture.js +0 -150
  130. package/dist/internal/virtualFileSystem/overlayContent.d.ts +0 -15
  131. package/dist/internal/virtualFileSystem/overlayContent.d.ts.map +0 -1
  132. package/dist/internal/virtualFileSystem/overlayContent.js +0 -29
  133. package/dist/internal/virtualFileSystem/overlayDiff.d.ts.map +0 -1
  134. package/dist/internal/virtualFileSystem/path.d.ts.map +0 -1
  135. package/dist/internal/virtualFileSystem/stagedState.d.ts +0 -22
  136. package/dist/internal/virtualFileSystem/stagedState.d.ts.map +0 -1
  137. package/dist/internal/virtualFileSystem/stagedState.js +0 -62
  138. package/dist/internal/virtualFileSystem/testHooks.d.ts +0 -20
  139. package/dist/internal/virtualFileSystem/testHooks.d.ts.map +0 -1
  140. package/dist/internal/virtualFileSystem/testHooks.js +0 -23
  141. package/dist/internal/virtualFileSystem/watchHub.d.ts +0 -16
  142. package/dist/internal/virtualFileSystem/watchHub.d.ts.map +0 -1
  143. package/dist/internal/virtualFileSystem/watchHub.js +0 -54
@@ -0,0 +1,110 @@
1
+ import * as Brand from "effect/Brand";
2
+ import * as Effect from "effect/Effect";
3
+ import type { Metadata } from "../Metadata.js";
4
+ import * as InodeTable from "./inodeTable.js";
5
+ import type { StoredMetadata } from "./metadata.js";
6
+ /** @internal */
7
+ export type Ino = number & Brand.Brand<"@effect-vfs/core/Ino">;
8
+ /** @internal */
9
+ export declare const Ino: Brand.Constructor<Ino>;
10
+ /** @internal */
11
+ export declare const ROOT_INO: Ino;
12
+ /** @internal */
13
+ export declare const MAX_INO: number;
14
+ /** @internal */
15
+ export declare const MAX_FILE_BYTES = 4294967295;
16
+ /** @internal */
17
+ export declare const WALK_YIELD_INTERVAL = 128;
18
+ /** @internal */
19
+ export interface Link {
20
+ readonly parent: Ino;
21
+ readonly name: string;
22
+ }
23
+ /** @internal */
24
+ export type NodeMetadata = Omit<Metadata, "revision">;
25
+ /** @internal */
26
+ export interface Directory {
27
+ readonly kind: "directory";
28
+ readonly ino: Ino;
29
+ readonly parent: Ino;
30
+ readonly name: string;
31
+ readonly entries: ReadonlyMap<string, Ino>;
32
+ readonly metadata: NodeMetadata;
33
+ readonly revision: bigint;
34
+ }
35
+ /** @internal */
36
+ export interface RegularFile {
37
+ readonly kind: "file";
38
+ readonly ino: Ino;
39
+ readonly data: Uint8Array;
40
+ readonly links: ReadonlyArray<Link>;
41
+ readonly metadata: NodeMetadata;
42
+ readonly revision: bigint;
43
+ }
44
+ /** @internal */
45
+ export interface SymbolicLink {
46
+ readonly kind: "symlink";
47
+ readonly ino: Ino;
48
+ readonly target: Uint8Array;
49
+ readonly links: ReadonlyArray<Link>;
50
+ readonly metadata: NodeMetadata;
51
+ readonly revision: bigint;
52
+ }
53
+ /** @internal */
54
+ export type Node = Directory | RegularFile | SymbolicLink;
55
+ /** @internal */
56
+ export interface VolumeState {
57
+ readonly inodes: InodeTable.InodeTable<Node>;
58
+ readonly open: ReadonlyMap<Ino, number>;
59
+ readonly nextInode: Ino;
60
+ readonly revision: bigint;
61
+ readonly entries: number;
62
+ readonly usedBytes: bigint;
63
+ }
64
+ /** @internal */
65
+ export declare const getNode: (state: VolumeState, ino: Ino) => Node | undefined;
66
+ /** @internal */
67
+ export declare const byIno: (a: Node, b: Node) => number;
68
+ /** @internal */
69
+ export declare const byEntryName: ([a]: readonly [string, Ino], [b]: readonly [string, Ino]) => -1 | 0 | 1;
70
+ /** @internal */
71
+ export declare const payloadOf: (node: Node) => Uint8Array | undefined;
72
+ /** @internal */
73
+ export declare const directoryMetadata: (ino: bigint, uid: number, gid: number, mode: number, now: bigint) => NodeMetadata;
74
+ /** @internal */
75
+ export declare const emptyRoot: (now: bigint) => Directory;
76
+ /** @internal */
77
+ export declare const storedMetadata: (metadata: NodeMetadata) => StoredMetadata;
78
+ /** @internal */
79
+ export declare const reachableNodes: (state: VolumeState) => Effect.Effect<Node[], never, never>;
80
+ /** @internal */
81
+ export declare const reachableValue: (source: VolumeState) => Effect.Effect<{
82
+ state: VolumeState;
83
+ largestFile: number;
84
+ }, never, never>;
85
+ /** @internal */
86
+ export type NodeSpec = {
87
+ readonly kind: "directory";
88
+ readonly ino: Ino;
89
+ readonly parent: Ino;
90
+ readonly name: string;
91
+ readonly metadata: StoredMetadata;
92
+ readonly revision: bigint;
93
+ } | {
94
+ readonly kind: "file";
95
+ readonly ino: Ino;
96
+ readonly links: ReadonlyArray<Link>;
97
+ readonly data: Uint8Array;
98
+ readonly metadata: StoredMetadata;
99
+ readonly revision: bigint;
100
+ } | {
101
+ readonly kind: "symlink";
102
+ readonly ino: Ino;
103
+ readonly links: ReadonlyArray<Link>;
104
+ readonly target: Uint8Array;
105
+ readonly metadata: StoredMetadata;
106
+ readonly revision: bigint;
107
+ };
108
+ /** @internal */
109
+ export declare const assemble: (specs: ReadonlyArray<NodeSpec>) => VolumeState;
110
+ //# sourceMappingURL=volumeState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volumeState.d.ts","sourceRoot":"","sources":["../../src/internal/volumeState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,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,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B,CAAA;AAMH,gBAAgB;AAChB,eAAO,MAAM,QAAQ,UAAW,aAAa,CAAC,QAAQ,CAAC,KAAG,WAsEzD,CAAA"}
@@ -0,0 +1,204 @@
1
+ import * as Brand from "effect/Brand";
2
+ import * as Effect from "effect/Effect";
3
+ import * as InodeTable from "./inodeTable.js";
4
+ /** @internal */
5
+ export const Ino = Brand.nominal();
6
+ /** @internal */
7
+ export const ROOT_INO = Ino(1);
8
+ // The largest inode number a value holds. The allocator resumes one above it and must stay exactly representable,
9
+ // since the inode table is keyed by a number.
10
+ /** @internal */
11
+ export const MAX_INO = Number.MAX_SAFE_INTEGER - 1;
12
+ // File sizes fit an unsigned 32-bit count in the volume and its public options.
13
+ /** @internal */
14
+ export const MAX_FILE_BYTES = 0xffffffff;
15
+ // Nodes walked between yields. Whole-tree reads are one synchronous tick otherwise, which
16
+ // starves the event loop and leaves nothing for interruption to act on.
17
+ /** @internal */
18
+ export const WALK_YIELD_INTERVAL = 128;
19
+ /** @internal */
20
+ export const getNode = (state, ino) => InodeTable.get(state.inodes, ino);
21
+ /** @internal */
22
+ export const byIno = (a, b) => a.ino - b.ino;
23
+ /** @internal */
24
+ export const byEntryName = ([a], [b]) => (a < b ? -1 : a > b ? 1 : 0);
25
+ const inNameOrder = (entries) => {
26
+ let previous;
27
+ for (const name of entries.keys()) {
28
+ if (previous !== undefined && previous > name)
29
+ return false;
30
+ previous = name;
31
+ }
32
+ return true;
33
+ };
34
+ const inEntryOrder = (directory) => inNameOrder(directory.entries)
35
+ ? directory
36
+ : { ...directory, entries: new Map([...directory.entries].sort(byEntryName)) };
37
+ /** @internal */
38
+ export const payloadOf = (node) => node.kind === "file" ? node.data : node.kind === "symlink" ? node.target : undefined;
39
+ /** @internal */
40
+ export const directoryMetadata = (ino, uid, gid, mode, now) => ({
41
+ kind: "directory",
42
+ ino,
43
+ uid,
44
+ gid,
45
+ mode,
46
+ nlink: 2,
47
+ size: 0n,
48
+ atimeNs: now,
49
+ mtimeNs: now,
50
+ ctimeNs: now,
51
+ birthtimeNs: now
52
+ });
53
+ /** @internal */
54
+ export const emptyRoot = (now) => ({
55
+ kind: "directory",
56
+ ino: ROOT_INO,
57
+ parent: ROOT_INO,
58
+ name: "",
59
+ entries: new Map(),
60
+ metadata: directoryMetadata(BigInt(ROOT_INO), 0, 0, 0o755, now),
61
+ revision: 1n
62
+ });
63
+ /** @internal */
64
+ export const storedMetadata = (metadata) => ({
65
+ uid: metadata.uid,
66
+ gid: metadata.gid,
67
+ mode: metadata.mode,
68
+ atimeNs: metadata.atimeNs,
69
+ mtimeNs: metadata.mtimeNs,
70
+ ctimeNs: metadata.ctimeNs,
71
+ birthtimeNs: metadata.birthtimeNs
72
+ });
73
+ /** @internal */
74
+ export const reachableNodes = Effect.fnUntraced(function* (state) {
75
+ const nodes = [];
76
+ const seen = new Set([ROOT_INO]);
77
+ const pending = [ROOT_INO];
78
+ for (let index = 0; index < pending.length; index++) {
79
+ if (index % WALK_YIELD_INTERVAL === 0)
80
+ yield* Effect.yieldNow;
81
+ const ino = pending[index];
82
+ const node = ino === undefined ? undefined : getNode(state, ino);
83
+ if (node === undefined)
84
+ continue;
85
+ nodes.push(node);
86
+ if (node.kind !== "directory")
87
+ continue;
88
+ for (const child of node.entries.values()) {
89
+ if (seen.has(child))
90
+ continue;
91
+ seen.add(child);
92
+ pending.push(child);
93
+ }
94
+ }
95
+ return nodes;
96
+ });
97
+ const atFirstRevision = (node) => node.revision === 1n ? node : { ...node, revision: 1n };
98
+ // A value holding only what a name reaches, and the size of its largest file. A captured value keeps unlinked
99
+ // open files and detached directories a handle holds; a volume started from it has neither handle, so it starts
100
+ // without them. Each directory lists its entries in the byte order of their names, as a decoded tree's do, so a
101
+ // volume lists the same whether it was restored from a snapshot or from that snapshot's bytes. Its revisions start
102
+ // afresh at the first one, as a decoded tree's do, since a snapshot holds none. Every payload stays shared with the
103
+ // source; only a node whose revision is not the first, or a directory whose entries were in another order, is copied.
104
+ /** @internal */
105
+ export const reachableValue = Effect.fnUntraced(function* (source) {
106
+ const nodes = yield* reachableNodes(source);
107
+ const owner = Symbol();
108
+ let inodes = InodeTable.empty();
109
+ let entries = 0;
110
+ let usedBytes = 0n;
111
+ let largestFile = 0;
112
+ for (const node of nodes) {
113
+ inodes = InodeTable.set(inodes, node.ino, atFirstRevision(node.kind === "directory" ? inEntryOrder(node) : node), owner);
114
+ if (node.kind === "directory")
115
+ entries += node.entries.size;
116
+ else if (node.kind === "symlink")
117
+ usedBytes += BigInt(node.target.length);
118
+ else {
119
+ usedBytes += BigInt(node.data.length);
120
+ largestFile = Math.max(largestFile, node.data.length);
121
+ }
122
+ }
123
+ const state = {
124
+ inodes,
125
+ open: new Map(),
126
+ nextInode: source.nextInode,
127
+ revision: 1n,
128
+ entries,
129
+ usedBytes
130
+ };
131
+ return { state, largestFile };
132
+ });
133
+ // Builds the value a set of nodes describes. The caller has checked that the nodes form a tree under the root:
134
+ // every parent is a directory among them, no directory holds a name twice, and every directory reaches the root.
135
+ // Each directory lists its entries in the byte order of their names, so the value does not depend on the order
136
+ // the nodes arrive in. Link counts and sizes come from the nodes, and the allocator resumes past the largest inode.
137
+ /** @internal */
138
+ export const assemble = (specs) => {
139
+ const edges = new Map();
140
+ const subdirectories = new Map();
141
+ let entries = 0;
142
+ let usedBytes = 0n;
143
+ let nextInode = Ino(ROOT_INO + 1);
144
+ let revision = 1n;
145
+ const attach = (parent, name, child) => {
146
+ const listed = edges.get(parent);
147
+ if (listed === undefined)
148
+ edges.set(parent, [[name, child]]);
149
+ else
150
+ listed.push([name, child]);
151
+ entries++;
152
+ };
153
+ for (const spec of specs) {
154
+ if (spec.ino >= nextInode)
155
+ nextInode = Ino(spec.ino + 1);
156
+ if (spec.revision > revision)
157
+ revision = spec.revision;
158
+ if (spec.kind === "directory") {
159
+ if (spec.ino === ROOT_INO)
160
+ continue;
161
+ attach(spec.parent, spec.name, spec.ino);
162
+ subdirectories.set(spec.parent, (subdirectories.get(spec.parent) ?? 0) + 1);
163
+ }
164
+ else {
165
+ usedBytes += BigInt(spec.kind === "file" ? spec.data.length : spec.target.length);
166
+ for (const link of spec.links)
167
+ attach(link.parent, link.name, spec.ino);
168
+ }
169
+ }
170
+ const owner = Symbol();
171
+ let inodes = InodeTable.empty();
172
+ for (const spec of specs) {
173
+ const base = { ...spec.metadata, kind: spec.kind, ino: BigInt(spec.ino) };
174
+ const node = spec.kind === "directory"
175
+ ? {
176
+ kind: "directory",
177
+ ino: spec.ino,
178
+ parent: spec.parent,
179
+ name: spec.name,
180
+ entries: new Map((edges.get(spec.ino) ?? []).sort(byEntryName)),
181
+ metadata: { ...base, nlink: 2 + (subdirectories.get(spec.ino) ?? 0), size: 0n },
182
+ revision: spec.revision
183
+ }
184
+ : spec.kind === "file"
185
+ ? {
186
+ kind: "file",
187
+ ino: spec.ino,
188
+ data: spec.data,
189
+ links: spec.links,
190
+ metadata: { ...base, nlink: spec.links.length, size: BigInt(spec.data.length) },
191
+ revision: spec.revision
192
+ }
193
+ : {
194
+ kind: "symlink",
195
+ ino: spec.ino,
196
+ target: spec.target,
197
+ links: spec.links,
198
+ metadata: { ...base, nlink: spec.links.length, size: BigInt(spec.target.length) },
199
+ revision: spec.revision
200
+ };
201
+ inodes = InodeTable.set(inodes, spec.ino, node, owner);
202
+ }
203
+ return { inodes, open: new Map(), nextInode, revision, entries, usedBytes };
204
+ };
@@ -0,0 +1,25 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Scope from "effect/Scope";
3
+ import * as Stream from "effect/Stream";
4
+ /** @internal */
5
+ export interface Coordinator {
6
+ <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>;
7
+ }
8
+ /**
9
+ * Selection callbacks share the context of their publication.
10
+ *
11
+ * @internal
12
+ */
13
+ export interface Selection<A, C> {
14
+ readonly includes: (event: A, context: C) => boolean;
15
+ readonly rescan: (context: C) => A;
16
+ readonly settle?: (context: C) => Iterable<A> | undefined;
17
+ }
18
+ /** @internal */
19
+ export interface WatchHub<A, C, E = never> {
20
+ 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>;
22
+ }
23
+ /** @internal */
24
+ export declare const make: <A, C, E = never>(coordinate: Coordinator, capacity: number) => Effect.Effect<WatchHub<A, C, E>, never, never>;
25
+ //# sourceMappingURL=watchHub.d.ts.map
@@ -0,0 +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,MAAM,MAAM,eAAe,CAAA;AAEvC,gBAAgB;AAChB,MAAM,WAAW,WAAW;IAC1B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;CAClE;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,EAAE,CAAC;IAE7B,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,OAAO,CAAA;IACpD,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAA;IAElC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,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,CAClB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EACzC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAChC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;CACrD;AAQD,gBAAgB;AAChB,eAAO,MAAM,IAAI,GAA+B,CAAC,EAAE,CAAC,EAAE,CAAC,sGAwFrD,CAAA"}
@@ -0,0 +1,68 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Predicate from "effect/Predicate";
3
+ import * as Queue from "effect/Queue";
4
+ import * as Scope from "effect/Scope";
5
+ import * as Stream from "effect/Stream";
6
+ /** @internal */
7
+ export const make = Effect.fnUntraced(function* (coordinate, capacity) {
8
+ const subscribers = new Set();
9
+ const offer = (subscriber, event, context) => {
10
+ const size = Queue.sizeUnsafe(subscriber.queue);
11
+ // An empty queue means the consumer has taken the rescan marker.
12
+ if (subscriber.overflowed && size > 0)
13
+ return;
14
+ subscriber.overflowed = size >= capacity - 1;
15
+ Queue.offerUnsafe(subscriber.queue, subscriber.overflowed ? subscriber.selection.rescan(context) : event);
16
+ };
17
+ const publishUnsafe = (events, context) => {
18
+ if (subscribers.size === 0)
19
+ return;
20
+ for (const event of events()) {
21
+ for (const subscriber of subscribers) {
22
+ if (subscriber.selection.includes(event, context))
23
+ offer(subscriber, event, context);
24
+ }
25
+ }
26
+ for (const subscriber of subscribers) {
27
+ const last = subscriber.selection.settle?.(context);
28
+ if (last === undefined)
29
+ continue;
30
+ for (const event of last)
31
+ Queue.offerUnsafe(subscriber.queue, event);
32
+ subscribers.delete(subscriber);
33
+ Queue.endUnsafe(subscriber.queue);
34
+ }
35
+ };
36
+ // Register cleanup before waiting for the volume, including when the scope closes during registration.
37
+ const subscribe = Effect.fnUntraced(function* (select, afterSubscribe) {
38
+ const scope = yield* Effect.scope;
39
+ let registered;
40
+ yield* Scope.addFinalizer(scope, Effect.suspend(() => {
41
+ const subscriber = registered;
42
+ if (subscriber === undefined)
43
+ return Effect.void;
44
+ return coordinate(Effect.sync(() => subscribers.delete(subscriber))).pipe(Effect.andThen(Queue.shutdown(subscriber.queue)));
45
+ }));
46
+ const closed = () => Predicate.isTagged(scope.state, "Closed");
47
+ const subscriber = yield* coordinate(Effect.gen(function* () {
48
+ const selection = yield* select;
49
+ const created = {
50
+ // Reserve one slot for a final event behind a rescan marker.
51
+ queue: yield* Queue.bounded(capacity + 1),
52
+ selection,
53
+ overflowed: false
54
+ };
55
+ yield* afterSubscribe;
56
+ // Cleanup may have run before registration; discard the subscriber if the scope closed.
57
+ if (closed()) {
58
+ yield* Queue.shutdown(created.queue);
59
+ return undefined;
60
+ }
61
+ subscribers.add(created);
62
+ registered = created;
63
+ return created;
64
+ }));
65
+ return subscriber === undefined ? Stream.empty : Stream.fromEffectRepeat(Queue.take(subscriber.queue));
66
+ });
67
+ return { publishUnsafe, subscribe };
68
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-vfs/core",
3
- "version": "0.4.0",
3
+ "version": "0.6.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": {
@@ -25,14 +25,14 @@
25
25
  "type-check": "tsc --noEmit && tsc --project contracts/tsconfig.json"
26
26
  },
27
27
  "peerDependencies": {
28
- "effect": "4.0.0-rc.114"
28
+ "effect": "4.0.0-rc.115"
29
29
  },
30
30
  "devDependencies": {
31
- "@effect/platform-bun": "4.0.0-rc.114",
32
- "@effect/platform-node-shared": "4.0.0-rc.114",
33
- "@effect/vitest": "4.0.0-rc.114",
31
+ "@effect/platform-bun": "4.0.0-rc.115",
32
+ "@effect/platform-node-shared": "4.0.0-rc.115",
33
+ "@effect/vitest": "4.0.0-rc.115",
34
34
  "@repo/config-typescript": "workspace:*",
35
- "effect": "4.0.0-rc.114"
35
+ "effect": "4.0.0-rc.115"
36
36
  },
37
37
  "exports": {
38
38
  ".": {
@@ -43,14 +43,58 @@
43
43
  "types": "./dist/VirtualFileSystem.d.ts",
44
44
  "import": "./dist/VirtualFileSystem.js"
45
45
  },
46
- "./VirtualFileSystemError": {
47
- "types": "./dist/VirtualFileSystemError.d.ts",
48
- "import": "./dist/VirtualFileSystemError.js"
46
+ "./VfsError": {
47
+ "types": "./dist/VfsError.d.ts",
48
+ "import": "./dist/VfsError.js"
49
49
  },
50
50
  "./LiveVolume": {
51
51
  "types": "./dist/LiveVolume.d.ts",
52
52
  "import": "./dist/LiveVolume.js"
53
53
  },
54
+ "./Caller": {
55
+ "types": "./dist/Caller.d.ts",
56
+ "import": "./dist/Caller.js"
57
+ },
58
+ "./FileHandle": {
59
+ "types": "./dist/FileHandle.d.ts",
60
+ "import": "./dist/FileHandle.js"
61
+ },
62
+ "./Fixture": {
63
+ "types": "./dist/Fixture.d.ts",
64
+ "import": "./dist/Fixture.js"
65
+ },
66
+ "./Metadata": {
67
+ "types": "./dist/Metadata.d.ts",
68
+ "import": "./dist/Metadata.js"
69
+ },
70
+ "./Target": {
71
+ "types": "./dist/Target.d.ts",
72
+ "import": "./dist/Target.js"
73
+ },
74
+ "./Volume": {
75
+ "types": "./dist/Volume.d.ts",
76
+ "import": "./dist/Volume.js"
77
+ },
78
+ "./Watch": {
79
+ "types": "./dist/Watch.d.ts",
80
+ "import": "./dist/Watch.js"
81
+ },
82
+ "./BytePath": {
83
+ "types": "./dist/BytePath.d.ts",
84
+ "import": "./dist/BytePath.js"
85
+ },
86
+ "./Snapshot": {
87
+ "types": "./dist/Snapshot.d.ts",
88
+ "import": "./dist/Snapshot.js"
89
+ },
90
+ "./SnapshotDelta": {
91
+ "types": "./dist/SnapshotDelta.d.ts",
92
+ "import": "./dist/SnapshotDelta.js"
93
+ },
94
+ "./Testing": {
95
+ "types": "./dist/Testing.d.ts",
96
+ "import": "./dist/Testing.js"
97
+ },
54
98
  "./internal/*": null,
55
99
  "./index": null,
56
100
  "./*/index": null,
@@ -1,54 +0,0 @@
1
- import type { FsCode, PathInput } from "./VirtualFileSystem.js";
2
- declare const FsError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
3
- readonly _tag: "FsError";
4
- } & Readonly<A>;
5
- /**
6
- * An expected filesystem operation failure.
7
- *
8
- * The `code` distinguishes portable failures while `operation` names the action.
9
- * Byte paths are intentionally omitted from the formatted message.
10
- *
11
- * @example
12
- * ```ts
13
- * import { VirtualFileSystemError } from "@effect-vfs/core"
14
- *
15
- * const error = new VirtualFileSystemError.FsError({ code: "NotFound", operation: "readFile" })
16
- * console.log(error.code, error.message)
17
- * // NotFound readFile failed with NotFound
18
- * ```
19
- *
20
- * @category errors
21
- * @since 0.1.0
22
- */
23
- export declare class FsError extends FsError_base<{
24
- readonly code: FsCode;
25
- readonly operation: string;
26
- readonly path?: PathInput;
27
- }> {
28
- get message(): string;
29
- }
30
- declare const ConfigurationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
31
- readonly _tag: "ConfigurationError";
32
- } & Readonly<A>;
33
- /**
34
- * An invalid volume or caller option, identified by its field name.
35
- *
36
- * @example
37
- * ```ts
38
- * import { VirtualFileSystemError } from "@effect-vfs/core"
39
- *
40
- * const error = new VirtualFileSystemError.ConfigurationError({ field: "maxEntries" })
41
- * console.log(error.field, error.message)
42
- * // maxEntries Invalid option: maxEntries
43
- * ```
44
- *
45
- * @category errors
46
- * @since 0.1.0
47
- */
48
- export declare class ConfigurationError extends ConfigurationError_base<{
49
- readonly field: string;
50
- }> {
51
- get message(): string;
52
- }
53
- export {};
54
- //# sourceMappingURL=VirtualFileSystemError.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VirtualFileSystemError.d.ts","sourceRoot":"","sources":["../src/VirtualFileSystemError.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;;;;AAE/D;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,OAAQ,SAAQ,aAA4B;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;CAC1B,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,kBAAmB,SAAQ,wBAAuC;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF"}
@@ -1,49 +0,0 @@
1
- /**
2
- * Tagged errors shared by the public filesystem API and its implementation.
3
- *
4
- * @since 0.1.0
5
- */
6
- import * as Data from "effect/Data";
7
- /**
8
- * An expected filesystem operation failure.
9
- *
10
- * The `code` distinguishes portable failures while `operation` names the action.
11
- * Byte paths are intentionally omitted from the formatted message.
12
- *
13
- * @example
14
- * ```ts
15
- * import { VirtualFileSystemError } from "@effect-vfs/core"
16
- *
17
- * const error = new VirtualFileSystemError.FsError({ code: "NotFound", operation: "readFile" })
18
- * console.log(error.code, error.message)
19
- * // NotFound readFile failed with NotFound
20
- * ```
21
- *
22
- * @category errors
23
- * @since 0.1.0
24
- */
25
- export class FsError extends Data.TaggedError("FsError") {
26
- get message() {
27
- return `${this.operation} failed with ${this.code}`;
28
- }
29
- }
30
- /**
31
- * An invalid volume or caller option, identified by its field name.
32
- *
33
- * @example
34
- * ```ts
35
- * import { VirtualFileSystemError } from "@effect-vfs/core"
36
- *
37
- * const error = new VirtualFileSystemError.ConfigurationError({ field: "maxEntries" })
38
- * console.log(error.field, error.message)
39
- * // maxEntries Invalid option: maxEntries
40
- * ```
41
- *
42
- * @category errors
43
- * @since 0.1.0
44
- */
45
- export class ConfigurationError extends Data.TaggedError("ConfigurationError") {
46
- get message() {
47
- return `Invalid option: ${this.field}`;
48
- }
49
- }
@@ -1,12 +0,0 @@
1
- import * as Result from "effect/Result";
2
- import * as Schema from "effect/Schema";
3
- import { ConfigurationError, FsError } from "../../VirtualFileSystemError.js";
4
- /** @internal */
5
- export { ConfigurationError, FsError };
6
- /** @internal */
7
- export declare const FsCode: Schema.Literals<readonly ["NotFound", "AlreadyExists", "NotEmpty", "NotDirectory", "AccessDenied", "InvalidHandle", "ForeignHandle", "InvalidReference", "ForeignReference", "StaleReference", "ClosedCaller", "InvalidArgument", "InvalidPathEncoding", "PathTooLong", "NoSpace", "IsDirectory", "FileTooLarge", "NoData", "SymlinkLoop", "UnrepresentableName", "StorageRejected", "OutcomeUnknown", "VolumeUnavailable", "VolumeBusy"]>;
8
- /** @internal */
9
- export type FsCode = typeof FsCode.Type;
10
- /** @internal */
11
- export declare const decodeConfiguration: <A>(schema: Schema.Codec<A>, value: typeof Schema.Unknown.Type) => Result.Result<A, ConfigurationError>;
12
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/internal/virtualFileSystem/errors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAE7E,gBAAgB;AAChB,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAA;AAEtC,gBAAgB;AAChB,eAAO,MAAM,MAAM,4aA4BjB,CAAA;AAEF,gBAAgB;AAChB,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAWvC,gBAAgB;AAChB,eAAO,MAAM,mBAAmB,GAAI,CAAC,UAAU,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,yCAG9F,CAAA"}