@effect-vfs/core 0.9.0 → 0.11.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/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 +105 -66
- package/dist/Caller.d.ts.map +1 -1
- package/dist/Caller.js +15 -87
- package/dist/LiveVolume.d.ts +14 -8
- package/dist/LiveVolume.d.ts.map +1 -1
- package/dist/LiveVolume.js +10 -3
- package/dist/Search.d.ts +32 -8
- package/dist/Search.d.ts.map +1 -1
- package/dist/Search.js +14 -13
- 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 +9 -5
- package/dist/Testing.d.ts.map +1 -1
- package/dist/Testing.js +3 -2
- package/dist/VfsError.d.ts +1 -1
- package/dist/VfsError.d.ts.map +1 -1
- package/dist/VirtualFileSystem.d.ts +143 -59
- package/dist/VirtualFileSystem.d.ts.map +1 -1
- package/dist/VirtualFileSystem.js +37 -33
- package/dist/Volume.d.ts +6 -1
- package/dist/Volume.d.ts.map +1 -1
- package/dist/Volume.js +6 -2
- 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 +5 -1
- package/dist/internal/callerWatch.d.ts.map +1 -1
- package/dist/internal/callerWatch.js +4 -3
- 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 +3 -2
- package/dist/internal/fixture.d.ts.map +1 -1
- package/dist/internal/fixture.js +7 -3
- 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 +8 -5
- package/dist/internal/merkle.d.ts.map +1 -1
- package/dist/internal/merkle.js +8 -7
- 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 +14 -10
- 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 +27 -56
- package/dist/internal/virtualFileSystem.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem.js +77 -2085
- 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 +3 -3
- package/dist/internal/watchHub.d.ts.map +1 -1
- package/dist/internal/watchHub.js +4 -2
- package/package.json +14 -9
- package/dist/internal/confinement.d.ts +0 -16
- package/dist/internal/confinement.d.ts.map +0 -1
- package/dist/internal/confinement.js +0 -79
- package/dist/internal/directoryEntries.d.ts +0 -6
- package/dist/internal/directoryEntries.d.ts.map +0 -1
- package/dist/internal/directoryEntries.js +0 -79
- 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 -139
- package/dist/internal/resolution.d.ts.map +0 -1
- package/dist/internal/resolution.js +0 -332
- 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 -83
- package/dist/internal/tokenRegistry.d.ts.map +0 -1
- package/dist/internal/tokenRegistry.js +0 -146
- package/dist/internal/turnstile.d.ts +0 -8
- package/dist/internal/turnstile.d.ts.map +0 -1
- package/dist/internal/turnstile.js +0 -43
package/dist/Testing.d.ts
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @since 0.6.0
|
|
14
14
|
*/
|
|
15
|
-
import type * as
|
|
15
|
+
import type * as Digest from "effect/crypto/Digest";
|
|
16
|
+
import type * as SecureRandom from "effect/crypto/SecureRandom";
|
|
16
17
|
import * as Effect from "effect/Effect";
|
|
17
18
|
import * as Layer from "effect/Layer";
|
|
18
19
|
import type * as Scope from "effect/Scope";
|
|
@@ -31,7 +32,7 @@ import type { VolumeOptions } from "./Volume.js";
|
|
|
31
32
|
export interface LayerOptions {
|
|
32
33
|
/** Entries the volume starts with; without one the volume starts empty. */
|
|
33
34
|
readonly fixture?: Fixture;
|
|
34
|
-
/**
|
|
35
|
+
/** Execution mode, limits and identity of the volume. */
|
|
35
36
|
readonly volume?: VolumeOptions;
|
|
36
37
|
/** Credentials and umask of the root caller the layer provides. */
|
|
37
38
|
readonly caller?: RootCallerOptions;
|
|
@@ -43,7 +44,7 @@ export interface LayerOptions {
|
|
|
43
44
|
*
|
|
44
45
|
* Every build constructs a new volume, from `fixture` when one is given. The
|
|
45
46
|
* layer fails with the `VfsError` the constructor or the caller reports for
|
|
46
|
-
* invalid options. Provide `
|
|
47
|
+
* invalid options. Provide the `Digest` and `SecureRandom` services to build the volume.
|
|
47
48
|
*
|
|
48
49
|
* @example
|
|
49
50
|
* ```ts
|
|
@@ -67,7 +68,7 @@ export interface LayerOptions {
|
|
|
67
68
|
* @category layers
|
|
68
69
|
* @since 0.6.0
|
|
69
70
|
*/
|
|
70
|
-
export declare const layer: (options?: LayerOptions) => Layer.Layer<Volume | Caller, VfsError,
|
|
71
|
+
export declare const layer: (options?: LayerOptions) => Layer.Layer<Volume | Caller, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
71
72
|
/**
|
|
72
73
|
* A root caller with `identity` on the volume in context.
|
|
73
74
|
*
|
|
@@ -128,5 +129,8 @@ export declare const callerAs: (identity: Identity, options?: Omit<RootCallerOpt
|
|
|
128
129
|
* @category combinators
|
|
129
130
|
* @since 0.6.0
|
|
130
131
|
*/
|
|
131
|
-
export declare const collectChanges:
|
|
132
|
+
export declare const collectChanges: {
|
|
133
|
+
(n: number): <A, E, R>(stream: Stream.Stream<A, E, R>) => Effect.Effect<Effect.Effect<Array<A>, E>, never, R | Scope.Scope>;
|
|
134
|
+
<A, E, R>(stream: Stream.Stream<A, E, R>, n: number): Effect.Effect<Effect.Effect<Array<A>, E>, never, R | Scope.Scope>;
|
|
135
|
+
};
|
|
132
136
|
//# sourceMappingURL=Testing.d.ts.map
|
package/dist/Testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Testing.d.ts","sourceRoot":"","sources":["../src/Testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Testing.d.ts","sourceRoot":"","sources":["../src/Testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,KAAK,YAAY,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAA;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,KAAK,aACN,YAAY,KACrB,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,GAAG,YAAY,CAAC,YAAY,CAOhF,CAAA;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,QAAQ,aACT,QAAQ,YACR,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAC5C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CACoC,CAAA;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,cAAc,EAAE;IAC3B,CACE,CAAC,EAAE,MAAM,GACR,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;IACjH,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EACN,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC9B,CAAC,EAAE,MAAM,GACR,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;CAQlE,CAAA"}
|
package/dist/Testing.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
2
|
import * as Fiber from "effect/Fiber";
|
|
3
|
+
import { dual } from "effect/Function";
|
|
3
4
|
import * as Layer from "effect/Layer";
|
|
4
5
|
import * as Stream from "effect/Stream";
|
|
5
6
|
import { Caller, Volume } from "./VirtualFileSystem.js";
|
|
@@ -10,7 +11,7 @@ import { Caller, Volume } from "./VirtualFileSystem.js";
|
|
|
10
11
|
*
|
|
11
12
|
* Every build constructs a new volume, from `fixture` when one is given. The
|
|
12
13
|
* layer fails with the `VfsError` the constructor or the caller reports for
|
|
13
|
-
* invalid options. Provide `
|
|
14
|
+
* invalid options. Provide the `Digest` and `SecureRandom` services to build the volume.
|
|
14
15
|
*
|
|
15
16
|
* @example
|
|
16
17
|
* ```ts
|
|
@@ -97,4 +98,4 @@ export const callerAs = (identity, options) => Effect.flatMap(Volume, (volume) =
|
|
|
97
98
|
* @category combinators
|
|
98
99
|
* @since 0.6.0
|
|
99
100
|
*/
|
|
100
|
-
export const collectChanges = (stream, n) => Stream.runCollect(Stream.take(stream, n)).pipe(Effect.forkScoped({ startImmediately: true }), Effect.map(Fiber.join));
|
|
101
|
+
export const collectChanges = dual(2, (stream, n) => Stream.runCollect(Stream.take(stream, n)).pipe(Effect.forkScoped({ startImmediately: true }), Effect.map(Fiber.join)));
|
package/dist/VfsError.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @since 0.6.0
|
|
11
11
|
*/
|
|
12
12
|
import * as Schema from "effect/Schema";
|
|
13
|
-
import type { BytePath } from "./
|
|
13
|
+
import type { BytePath } from "./internal/bytePath.js";
|
|
14
14
|
/**
|
|
15
15
|
* Schema for the codes an operation on a volume, caller, or handle reports.
|
|
16
16
|
*
|
package/dist/VfsError.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VfsError.d.ts","sourceRoot":"","sources":["../src/VfsError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"VfsError.d.ts","sourceRoot":"","sources":["../src/VfsError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAMtD;;;;;GAKG;AACH,eAAO,MAAM,MAAM,4bA+BjB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,SAAS,0GAAkG,CAAA;AAExH;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,4CAAoC,CAAA;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,yFAAiF,CAAA;AAEvG;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,OAAO,ulBAKlB,CAAA;AAEF;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,gGAUrB,CAAA;;IA2BC,uBAAuB;;IAEvB,2CAA2C;;IAE3C,wEAAwE;;IAExE,gEAAgE;;IAEhE,qEAAqE;;;AAjCvE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,QAAS,SAAQ,aAW5B;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;AAED;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAAA;AAElE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAAA;AAElE;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAA;AAE7E;;;;;;GAMG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC,SAAS,OAAO;IACtC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;IAChB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CACzB;AAUD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,OAAO,SAAS,KAAK,CAAC,CAAC,CAAC,KAAG,QAAQ,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;CAYtF,CAAA"}
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type * as ByteSize from "effect/ByteSize";
|
|
12
12
|
import * as Context from "effect/Context";
|
|
13
|
-
import type * as
|
|
13
|
+
import type * as Digest from "effect/crypto/Digest";
|
|
14
|
+
import type * as SecureRandom from "effect/crypto/SecureRandom";
|
|
14
15
|
import * as Effect from "effect/Effect";
|
|
15
16
|
import * as Layer from "effect/Layer";
|
|
16
17
|
import type * as Order from "effect/Order";
|
|
@@ -34,8 +35,9 @@ import * as VolumeModule from "./Volume.js";
|
|
|
34
35
|
import * as WatchModule from "./Watch.js";
|
|
35
36
|
export { Entry, type EntryInput, isEntry, isTarget, Name, type NameInput, type PathTarget, Target, type TargetInput } from "./Target.js";
|
|
36
37
|
export { BytePath } from "./BytePath.js";
|
|
37
|
-
import type
|
|
38
|
+
import { type DecodeLimits, type Snapshot } from "./Snapshot.js";
|
|
38
39
|
export { DecodeLimits, type Snapshot, SnapshotTypeId } from "./Snapshot.js";
|
|
40
|
+
import type * as Engine from "./internal/engine.js";
|
|
39
41
|
import { type LiveImageStore, type Options as LiveVolumeOptions } from "./LiveVolume.js";
|
|
40
42
|
import * as SnapshotDeltaModel from "./SnapshotDelta.js";
|
|
41
43
|
export { MergeConflict, MergeConflictReason, MergeOptions, MergeResolution, MergeResult, MergeSideChange, MergeTake, SnapshotChange, SnapshotChangesOptions, type SnapshotDelta, SnapshotDeltaLimits, SnapshotDeltaTypeId, SnapshotDifference, SnapshotNodeKind } from "./SnapshotDelta.js";
|
|
@@ -235,7 +237,7 @@ export declare const VolumeDurabilityOrder: Order.Order<VolumeDurability>;
|
|
|
235
237
|
* @category predicates
|
|
236
238
|
* @since 0.1.0
|
|
237
239
|
*/
|
|
238
|
-
export declare const isVolumeDurabilityAtLeast:
|
|
240
|
+
export declare const isVolumeDurabilityAtLeast: typeof VolumeModule.isVolumeDurabilityAtLeast;
|
|
239
241
|
/**
|
|
240
242
|
* Schema for the stable logical identity of a volume.
|
|
241
243
|
*
|
|
@@ -337,7 +339,8 @@ export type ReferenceKey = typeof ReferenceKey.Type;
|
|
|
337
339
|
*/
|
|
338
340
|
export declare const VolumeOptions: typeof VolumeModule.VolumeOptions;
|
|
339
341
|
/**
|
|
340
|
-
*
|
|
342
|
+
* Execution policy, capacity, admission, watch retention, and path limits for a volume.
|
|
343
|
+
* `execution` defaults to `"cooperative"`; `"sync"` opts memory operations into non-yielding coordination.
|
|
341
344
|
* `maxPendingOperations` defaults to 64 and `maxWatchEvents` defaults to 256.
|
|
342
345
|
*
|
|
343
346
|
* @category models
|
|
@@ -351,7 +354,7 @@ export type VolumeOptions = typeof VolumeOptions.Type;
|
|
|
351
354
|
* @category models
|
|
352
355
|
* @since 0.1.0
|
|
353
356
|
*/
|
|
354
|
-
export interface VolumeLimits {
|
|
357
|
+
export interface VolumeLimits extends Engine.EngineLimits {
|
|
355
358
|
readonly maxBytes: ByteSize.ByteSize | undefined;
|
|
356
359
|
readonly maxFileBytes: ByteSize.ByteSize;
|
|
357
360
|
readonly maxEntries: number | undefined;
|
|
@@ -368,7 +371,7 @@ export interface VolumeLimits {
|
|
|
368
371
|
* @category models
|
|
369
372
|
* @since 0.1.0
|
|
370
373
|
*/
|
|
371
|
-
export interface VolumeUsage {
|
|
374
|
+
export interface VolumeUsage extends Engine.VolumeUsage {
|
|
372
375
|
readonly usedBytes: bigint;
|
|
373
376
|
readonly entries: number;
|
|
374
377
|
}
|
|
@@ -416,7 +419,7 @@ export type Metadata = typeof Metadata.Type;
|
|
|
416
419
|
* @category models
|
|
417
420
|
* @since 0.1.0
|
|
418
421
|
*/
|
|
419
|
-
export interface ObjectReference {
|
|
422
|
+
export interface ObjectReference extends Engine.ObjectReference {
|
|
420
423
|
readonly [ObjectReferenceId]: true;
|
|
421
424
|
}
|
|
422
425
|
/**
|
|
@@ -454,7 +457,7 @@ export interface ObjectReference {
|
|
|
454
457
|
* @category models
|
|
455
458
|
* @since 0.1.0
|
|
456
459
|
*/
|
|
457
|
-
export interface ObjectObservation<A> {
|
|
460
|
+
export interface ObjectObservation<A> extends Engine.ObjectObservation<A> {
|
|
458
461
|
readonly value: A;
|
|
459
462
|
readonly revision: bigint;
|
|
460
463
|
}
|
|
@@ -464,7 +467,7 @@ export interface ObjectObservation<A> {
|
|
|
464
467
|
* @category models
|
|
465
468
|
* @since 0.1.0
|
|
466
469
|
*/
|
|
467
|
-
export interface DirectoryEntry {
|
|
470
|
+
export interface DirectoryEntry extends Engine.DirectoryEntry {
|
|
468
471
|
readonly name: Uint8Array;
|
|
469
472
|
readonly reference: ObjectReference;
|
|
470
473
|
}
|
|
@@ -482,7 +485,7 @@ export interface DirectoryEntry {
|
|
|
482
485
|
* @category models
|
|
483
486
|
* @since 0.6.0
|
|
484
487
|
*/
|
|
485
|
-
export interface WalkEntry {
|
|
488
|
+
export interface WalkEntry extends Engine.WalkEntry {
|
|
486
489
|
readonly path: BytePath;
|
|
487
490
|
readonly name: Uint8Array;
|
|
488
491
|
readonly reference: ObjectReference;
|
|
@@ -535,7 +538,7 @@ export type DirectoryChange = typeof DirectoryChange.Type;
|
|
|
535
538
|
* @category models
|
|
536
539
|
* @since 0.4.0
|
|
537
540
|
*/
|
|
538
|
-
export interface ReferenceEntryResult {
|
|
541
|
+
export interface ReferenceEntryResult extends Engine.ReferenceEntryResult {
|
|
539
542
|
readonly reference: ObjectReference;
|
|
540
543
|
readonly directory: DirectoryChange;
|
|
541
544
|
}
|
|
@@ -651,7 +654,7 @@ export type Times = typeof Times.Type;
|
|
|
651
654
|
* @category models
|
|
652
655
|
* @since 0.1.0
|
|
653
656
|
*/
|
|
654
|
-
export interface DirectoryHandle {
|
|
657
|
+
export interface DirectoryHandle extends Engine.DirectoryHandle {
|
|
655
658
|
readonly [DirectoryHandleId]: true;
|
|
656
659
|
readonly stat: Effect.Effect<Metadata, FsFailure>;
|
|
657
660
|
readonly close: Effect.Effect<void, FsFailure>;
|
|
@@ -801,7 +804,7 @@ export type OpenEntryOptions = typeof OpenEntryOptions.Type;
|
|
|
801
804
|
* @category models
|
|
802
805
|
* @since 0.4.0
|
|
803
806
|
*/
|
|
804
|
-
export interface OpenEntryResult {
|
|
807
|
+
export interface OpenEntryResult extends Engine.OpenEntryResult {
|
|
805
808
|
readonly handle: FileHandle;
|
|
806
809
|
readonly reference: ObjectReference;
|
|
807
810
|
readonly created: boolean;
|
|
@@ -862,7 +865,7 @@ export type WriteFileOptions = typeof WriteFileOptions.Type;
|
|
|
862
865
|
* @category models
|
|
863
866
|
* @since 0.6.0
|
|
864
867
|
*/
|
|
865
|
-
export interface ReadResult {
|
|
868
|
+
export interface ReadResult extends Engine.ReadResult {
|
|
866
869
|
readonly bytes: Uint8Array;
|
|
867
870
|
readonly eof: boolean;
|
|
868
871
|
}
|
|
@@ -898,7 +901,7 @@ export interface ReadResult {
|
|
|
898
901
|
* @category models
|
|
899
902
|
* @since 0.1.0
|
|
900
903
|
*/
|
|
901
|
-
export interface FileHandle {
|
|
904
|
+
export interface FileHandle extends Engine.FileHandle {
|
|
902
905
|
readonly [FileHandleId]: true;
|
|
903
906
|
/** Reads up to `maximumBytes` from the cursor and advances it by the returned length. */
|
|
904
907
|
readonly read: (maximumBytes: number) => Effect.Effect<Uint8Array, FsFailure>;
|
|
@@ -906,10 +909,22 @@ export interface FileHandle {
|
|
|
906
909
|
readonly pread: (maximumBytes: number, offset: bigint) => Effect.Effect<ReadResult, FsFailure>;
|
|
907
910
|
/** Writes at the cursor and advances it, or writes at end of file when opened for append. */
|
|
908
911
|
readonly write: (bytes: Uint8Array) => Effect.Effect<number, FsFailure>;
|
|
909
|
-
/**
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
912
|
+
/**
|
|
913
|
+
* Writes at `offset` without changing the cursor. Append mode does not affect positional writes.
|
|
914
|
+
* The curried form is `pwrite(offset)(bytes)`.
|
|
915
|
+
*/
|
|
916
|
+
readonly pwrite: {
|
|
917
|
+
(offset: bigint): (bytes: Uint8Array) => Effect.Effect<number, FsFailure>;
|
|
918
|
+
(bytes: Uint8Array, offset: bigint): Effect.Effect<number, FsFailure>;
|
|
919
|
+
};
|
|
920
|
+
/**
|
|
921
|
+
* Moves the cursor and returns its new offset. `data` finds content and `hole` finds end of file.
|
|
922
|
+
* The curried form is `seek(mode)(offset)`.
|
|
923
|
+
*/
|
|
924
|
+
readonly seek: {
|
|
925
|
+
(mode: SeekMode): (offset: bigint) => Effect.Effect<bigint, FsFailure>;
|
|
926
|
+
(offset: bigint, mode: SeekMode): Effect.Effect<bigint, FsFailure>;
|
|
927
|
+
};
|
|
913
928
|
/** Sets the file length without changing the cursor. */
|
|
914
929
|
readonly truncate: (length: bigint) => Effect.Effect<void, FsFailure>;
|
|
915
930
|
/** Reads metadata for the open file. */
|
|
@@ -1006,7 +1021,7 @@ export interface FileHandle {
|
|
|
1006
1021
|
* @category models
|
|
1007
1022
|
* @since 0.1.0
|
|
1008
1023
|
*/
|
|
1009
|
-
export interface Caller {
|
|
1024
|
+
export interface Caller extends Engine.EngineOperations {
|
|
1010
1025
|
readonly [CallerId]: true;
|
|
1011
1026
|
/** Backing volume configuration; these are not subtree quotas. */
|
|
1012
1027
|
readonly limits: VolumeLimits;
|
|
@@ -1048,8 +1063,14 @@ export interface Caller {
|
|
|
1048
1063
|
readonly access: (target: TargetInput, bits?: number) => Effect.Effect<number, FsFailure>;
|
|
1049
1064
|
/** The whole content of a regular file. */
|
|
1050
1065
|
readonly readFile: (target: TargetInput) => Effect.Effect<Uint8Array, FsFailure>;
|
|
1051
|
-
/**
|
|
1052
|
-
|
|
1066
|
+
/**
|
|
1067
|
+
* Writes a whole file in one operation and returns its object reference, creating or replacing it as the options say.
|
|
1068
|
+
* The curried form is `writeFile(bytes, options)(entry)`; the caller remains bound.
|
|
1069
|
+
*/
|
|
1070
|
+
readonly writeFile: {
|
|
1071
|
+
(bytes: Uint8Array, options: WriteFileOptions): (entry: EntryInput) => Effect.Effect<ObjectReference, FsFailure>;
|
|
1072
|
+
(entry: EntryInput, bytes: Uint8Array, options: WriteFileOptions): Effect.Effect<ObjectReference, FsFailure>;
|
|
1073
|
+
};
|
|
1053
1074
|
/**
|
|
1054
1075
|
* Opens a file. On a target, the file must exist and `create` is rejected. On an entry, the name is looked up
|
|
1055
1076
|
* and created in one gate hold, and the result reports whether it was created.
|
|
@@ -1071,7 +1092,10 @@ export interface Caller {
|
|
|
1071
1092
|
/** Creates a symbolic link to `target`, stored as given. */
|
|
1072
1093
|
readonly symlink: (target: PathInput, entry: EntryInput, options?: SymlinkOptions) => Effect.Effect<ReferenceEntryResult, FsFailure>;
|
|
1073
1094
|
/** Adds a name for an existing file or symbolic link. A path source follows a final symbolic link only when its target says so. */
|
|
1074
|
-
readonly link:
|
|
1095
|
+
readonly link: {
|
|
1096
|
+
(entry: EntryInput): (source: TargetInput) => Effect.Effect<ReferenceEntryResult, FsFailure>;
|
|
1097
|
+
(source: TargetInput, entry: EntryInput): Effect.Effect<ReferenceEntryResult, FsFailure>;
|
|
1098
|
+
};
|
|
1075
1099
|
/** Removes a file or symbolic link. */
|
|
1076
1100
|
readonly unlink: (entry: EntryInput) => Effect.Effect<DirectoryChange, FsFailure>;
|
|
1077
1101
|
/** Removes an empty directory. */
|
|
@@ -1091,15 +1115,30 @@ export interface Caller {
|
|
|
1091
1115
|
(entry: EntryInput, options: RemoveOptions): Effect.Effect<DirectoryChange | undefined, FsFailure>;
|
|
1092
1116
|
};
|
|
1093
1117
|
/** Moves an entry, replacing a compatible destination. */
|
|
1094
|
-
readonly rename:
|
|
1118
|
+
readonly rename: {
|
|
1119
|
+
(to: EntryInput): (from: EntryInput) => Effect.Effect<RenameReferenceResult, FsFailure>;
|
|
1120
|
+
(from: EntryInput, to: EntryInput): Effect.Effect<RenameReferenceResult, FsFailure>;
|
|
1121
|
+
};
|
|
1095
1122
|
/** Sets the permission bits of a target. */
|
|
1096
|
-
readonly chmod:
|
|
1123
|
+
readonly chmod: {
|
|
1124
|
+
(mode: number): (target: TargetInput) => Effect.Effect<void, FsFailure>;
|
|
1125
|
+
(target: TargetInput, mode: number): Effect.Effect<void, FsFailure>;
|
|
1126
|
+
};
|
|
1097
1127
|
/** Changes the owner or group of a target. */
|
|
1098
|
-
readonly chown:
|
|
1128
|
+
readonly chown: {
|
|
1129
|
+
(owner: OwnerUpdate): (target: TargetInput) => Effect.Effect<void, FsFailure>;
|
|
1130
|
+
(target: TargetInput, owner: OwnerUpdate): Effect.Effect<void, FsFailure>;
|
|
1131
|
+
};
|
|
1099
1132
|
/** Sets the access and modification times of a target. */
|
|
1100
|
-
readonly utimes:
|
|
1133
|
+
readonly utimes: {
|
|
1134
|
+
(times: Times): (target: TargetInput) => Effect.Effect<void, FsFailure>;
|
|
1135
|
+
(target: TargetInput, times: Times): Effect.Effect<void, FsFailure>;
|
|
1136
|
+
};
|
|
1101
1137
|
/** Sets the size of a regular file. */
|
|
1102
|
-
readonly truncate:
|
|
1138
|
+
readonly truncate: {
|
|
1139
|
+
(length: bigint): (target: TargetInput) => Effect.Effect<void, FsFailure>;
|
|
1140
|
+
(target: TargetInput, length: bigint): Effect.Effect<void, FsFailure>;
|
|
1141
|
+
};
|
|
1103
1142
|
/**
|
|
1104
1143
|
* Changes a target's size, owner, mode and times as one change. Every check passes before any attribute
|
|
1105
1144
|
* applies, so a failure changes nothing. The attributes apply as size, owner, mode, then times, the POSIX
|
|
@@ -1108,7 +1147,10 @@ export interface Caller {
|
|
|
1108
1147
|
* does so before it calls setattr, and passes the revision it read as `expected` so the change refuses a
|
|
1109
1148
|
* target another change has moved.
|
|
1110
1149
|
*/
|
|
1111
|
-
readonly setattr:
|
|
1150
|
+
readonly setattr: {
|
|
1151
|
+
(attributes: SetattrOptions): (target: TargetInput) => Effect.Effect<void, FsFailure>;
|
|
1152
|
+
(target: TargetInput, attributes: SetattrOptions): Effect.Effect<void, FsFailure>;
|
|
1153
|
+
};
|
|
1112
1154
|
/** A caller whose working directory is the target, released with the scope. */
|
|
1113
1155
|
readonly withDirectory: (directory: TargetInput) => Effect.Effect<Caller, FsFailure, Scope.Scope>;
|
|
1114
1156
|
/** A handle on a directory, released with the scope. */
|
|
@@ -1486,15 +1528,24 @@ export interface OverlayVolume extends Volume {
|
|
|
1486
1528
|
*/
|
|
1487
1529
|
export declare const Volume: Context.Service<Volume, Volume> & {
|
|
1488
1530
|
/** A fresh empty volume. */
|
|
1489
|
-
readonly layer: (options?: VolumeOptions) => Layer.Layer<Volume, VfsError,
|
|
1531
|
+
readonly layer: (options?: VolumeOptions) => Layer.Layer<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1490
1532
|
/** A fresh volume restored from a snapshot. */
|
|
1491
|
-
readonly layerFromSnapshot:
|
|
1533
|
+
readonly layerFromSnapshot: {
|
|
1534
|
+
(options?: VolumeOptions): (snapshot: Snapshot) => Layer.Layer<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1535
|
+
(snapshot: Snapshot, options?: VolumeOptions): Layer.Layer<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1536
|
+
};
|
|
1492
1537
|
/** A fresh volume built from a fixture. */
|
|
1493
|
-
readonly layerFromFixture:
|
|
1538
|
+
readonly layerFromFixture: {
|
|
1539
|
+
(options?: VolumeOptions): (fixture: Fixture) => Layer.Layer<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1540
|
+
(fixture: Fixture, options?: VolumeOptions): Layer.Layer<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1541
|
+
};
|
|
1494
1542
|
/** A writable overlay over a snapshot base. */
|
|
1495
|
-
readonly layerOverlay:
|
|
1543
|
+
readonly layerOverlay: {
|
|
1544
|
+
(options?: VolumeOptions): (base: Snapshot) => Layer.Layer<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1545
|
+
(base: Snapshot, options?: VolumeOptions): Layer.Layer<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1546
|
+
};
|
|
1496
1547
|
/** A durable volume opened through the `LiveImageStore` in context; it shuts down with the layer's scope. */
|
|
1497
|
-
readonly layerLive: (options: LiveVolumeOptions) => Layer.Layer<Volume, VfsError, LiveImageStore |
|
|
1548
|
+
readonly layerLive: (options: LiveVolumeOptions) => Layer.Layer<Volume, VfsError, LiveImageStore | Digest.Digest | SecureRandom.SecureRandom>;
|
|
1498
1549
|
};
|
|
1499
1550
|
/**
|
|
1500
1551
|
* The caller an application operates through, as an Effect service. A caller
|
|
@@ -1554,7 +1605,10 @@ export declare const Caller: Context.Service<Caller, Caller> & {
|
|
|
1554
1605
|
* @category serialization
|
|
1555
1606
|
* @since 0.6.0
|
|
1556
1607
|
*/
|
|
1557
|
-
export declare const encodeSnapshotStream:
|
|
1608
|
+
export declare const encodeSnapshotStream: {
|
|
1609
|
+
(limits?: DecodeLimits): (snapshot: Snapshot) => Stream.Stream<Uint8Array, ImageFailure | ArgumentFailure>;
|
|
1610
|
+
(snapshot: Snapshot, limits?: DecodeLimits): Stream.Stream<Uint8Array, ImageFailure | ArgumentFailure>;
|
|
1611
|
+
};
|
|
1558
1612
|
/**
|
|
1559
1613
|
* Encodes a snapshot as owned UTF-8 bytes in the version 1 snapshot format.
|
|
1560
1614
|
*
|
|
@@ -1595,7 +1649,10 @@ export declare const encodeSnapshotStream: (snapshot: Snapshot, limits?: DecodeL
|
|
|
1595
1649
|
* @category serialization
|
|
1596
1650
|
* @since 0.1.0
|
|
1597
1651
|
*/
|
|
1598
|
-
export declare const encodeSnapshot:
|
|
1652
|
+
export declare const encodeSnapshot: {
|
|
1653
|
+
(limits?: DecodeLimits): (snapshot: Snapshot) => Effect.Effect<Uint8Array, ImageFailure | ArgumentFailure>;
|
|
1654
|
+
(snapshot: Snapshot, limits?: DecodeLimits): Effect.Effect<Uint8Array, ImageFailure | ArgumentFailure>;
|
|
1655
|
+
};
|
|
1599
1656
|
/**
|
|
1600
1657
|
* A sink that decodes a stream of version 1 snapshot chunks while enforcing
|
|
1601
1658
|
* explicit input and payload limits.
|
|
@@ -1689,11 +1746,14 @@ export declare const decodeSnapshotSink: (limits: DecodeLimits) => Sink.Sink<Sna
|
|
|
1689
1746
|
* @category serialization
|
|
1690
1747
|
* @since 0.1.0
|
|
1691
1748
|
*/
|
|
1692
|
-
export declare const decodeSnapshot:
|
|
1749
|
+
export declare const decodeSnapshot: {
|
|
1750
|
+
(limits: DecodeLimits): (input: Uint8Array) => Effect.Effect<Snapshot, ImageFailure | ArgumentFailure>;
|
|
1751
|
+
(input: Uint8Array, limits: DecodeLimits): Effect.Effect<Snapshot, ImageFailure | ArgumentFailure>;
|
|
1752
|
+
};
|
|
1693
1753
|
/**
|
|
1694
1754
|
* Computes an exact portable delta between two immutable snapshots.
|
|
1695
|
-
* Requires
|
|
1696
|
-
* `NodeCrypto.layer`, `BunCrypto.layer`, or
|
|
1755
|
+
* Requires Effect's platform-neutral `Digest` and `SecureRandom` services; base identity is a `Digest` hash. Provide
|
|
1756
|
+
* `NodeCrypto.layer`, `BunCrypto.layer`, or `Digest.layerWebCrypto` with `SecureRandom.layerWebCrypto`.
|
|
1697
1757
|
*
|
|
1698
1758
|
* @example
|
|
1699
1759
|
* ```ts
|
|
@@ -1728,11 +1788,14 @@ export declare const decodeSnapshot: (input: Uint8Array, limits: DecodeLimits) =
|
|
|
1728
1788
|
* @category snapshots
|
|
1729
1789
|
* @since 0.1.0
|
|
1730
1790
|
*/
|
|
1731
|
-
export declare const diffSnapshots:
|
|
1791
|
+
export declare const diffSnapshots: {
|
|
1792
|
+
(target: Snapshot, limits?: SnapshotDeltaModel.SnapshotDeltaLimits): (base: Snapshot) => Effect.Effect<SnapshotDeltaModel.SnapshotDelta, VfsError | PlatformError.PlatformError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1793
|
+
(base: Snapshot, target: Snapshot, limits?: SnapshotDeltaModel.SnapshotDeltaLimits): Effect.Effect<SnapshotDeltaModel.SnapshotDelta, VfsError | PlatformError.PlatformError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1794
|
+
};
|
|
1732
1795
|
/**
|
|
1733
1796
|
* Verifies an exact snapshot delta against its base and derives an owned path-oriented summary.
|
|
1734
|
-
* Requires
|
|
1735
|
-
* `NodeCrypto.layer`, `BunCrypto.layer`, or
|
|
1797
|
+
* Requires Effect's platform-neutral `Digest` and `SecureRandom` services; base identity is a `Digest` hash. Provide
|
|
1798
|
+
* `NodeCrypto.layer`, `BunCrypto.layer`, or `Digest.layerWebCrypto` with `SecureRandom.layerWebCrypto`.
|
|
1736
1799
|
*
|
|
1737
1800
|
* @example
|
|
1738
1801
|
* ```ts
|
|
@@ -1764,11 +1827,14 @@ export declare const diffSnapshots: (base: Snapshot, target: Snapshot, limits?:
|
|
|
1764
1827
|
* @category snapshots
|
|
1765
1828
|
* @since 0.1.0
|
|
1766
1829
|
*/
|
|
1767
|
-
export declare const inspectSnapshotDelta:
|
|
1830
|
+
export declare const inspectSnapshotDelta: {
|
|
1831
|
+
(delta: SnapshotDeltaModel.SnapshotDelta, options?: SnapshotDeltaModel.SnapshotChangesOptions, limits?: SnapshotDeltaModel.SnapshotDeltaLimits): (base: Snapshot) => Effect.Effect<ReadonlyArray<SnapshotDeltaModel.SnapshotChange>, VfsError | PlatformError.PlatformError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1832
|
+
(base: Snapshot, delta: SnapshotDeltaModel.SnapshotDelta, options?: SnapshotDeltaModel.SnapshotChangesOptions, limits?: SnapshotDeltaModel.SnapshotDeltaLimits): Effect.Effect<ReadonlyArray<SnapshotDeltaModel.SnapshotChange>, VfsError | PlatformError.PlatformError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1833
|
+
};
|
|
1768
1834
|
/**
|
|
1769
1835
|
* Applies an exact delta to its semantically matching base and returns a new snapshot.
|
|
1770
|
-
* Requires
|
|
1771
|
-
* `NodeCrypto.layer`, `BunCrypto.layer`, or
|
|
1836
|
+
* Requires Effect's platform-neutral `Digest` and `SecureRandom` services; base identity is a `Digest` hash. Provide
|
|
1837
|
+
* `NodeCrypto.layer`, `BunCrypto.layer`, or `Digest.layerWebCrypto` with `SecureRandom.layerWebCrypto`.
|
|
1772
1838
|
*
|
|
1773
1839
|
* @example
|
|
1774
1840
|
* ```ts
|
|
@@ -1805,7 +1871,10 @@ export declare const inspectSnapshotDelta: (base: Snapshot, delta: SnapshotDelta
|
|
|
1805
1871
|
* @category snapshots
|
|
1806
1872
|
* @since 0.1.0
|
|
1807
1873
|
*/
|
|
1808
|
-
export declare const applySnapshotDelta:
|
|
1874
|
+
export declare const applySnapshotDelta: {
|
|
1875
|
+
(delta: SnapshotDeltaModel.SnapshotDelta, limits?: SnapshotDeltaModel.SnapshotDeltaLimits): (base: Snapshot) => Effect.Effect<Snapshot, VfsError | PlatformError.PlatformError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1876
|
+
(base: Snapshot, delta: SnapshotDeltaModel.SnapshotDelta, limits?: SnapshotDeltaModel.SnapshotDeltaLimits): Effect.Effect<Snapshot, VfsError | PlatformError.PlatformError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1877
|
+
};
|
|
1809
1878
|
/**
|
|
1810
1879
|
* Merges two snapshot deltas that share one base into a single delta, reporting path-level conflicts as data.
|
|
1811
1880
|
*
|
|
@@ -1813,8 +1882,8 @@ export declare const applySnapshotDelta: (base: Snapshot, delta: SnapshotDeltaMo
|
|
|
1813
1882
|
* when both agree, combines metadata fields that only one side changed, and otherwise reports a conflict and leaves
|
|
1814
1883
|
* the base node in place. Timestamps never conflict. The merged delta is bound to the same base as its inputs and
|
|
1815
1884
|
* applies with {@link applySnapshotDelta}. Pass `resolutions` to take one side at paths an earlier merge reported.
|
|
1816
|
-
* Requires
|
|
1817
|
-
* `NodeCrypto.layer`, `BunCrypto.layer`, or
|
|
1885
|
+
* Requires Effect's platform-neutral `Digest` and `SecureRandom` services; base identity is a `Digest` hash. Provide
|
|
1886
|
+
* `NodeCrypto.layer`, `BunCrypto.layer`, or `Digest.layerWebCrypto` with `SecureRandom.layerWebCrypto`.
|
|
1818
1887
|
*
|
|
1819
1888
|
* @example
|
|
1820
1889
|
* ```ts
|
|
@@ -1843,7 +1912,7 @@ export declare const applySnapshotDelta: (base: Snapshot, delta: SnapshotDeltaMo
|
|
|
1843
1912
|
* )
|
|
1844
1913
|
*
|
|
1845
1914
|
* // Disjoint changes merge without conflicts; the delta applies to the shared base.
|
|
1846
|
-
* const merged = yield* Vfs.
|
|
1915
|
+
* const merged = yield* Vfs.applySnapshotDelta(base, result.delta).pipe(Effect.flatMap(Vfs.fromSnapshot()))
|
|
1847
1916
|
* const reader = yield* merged.caller()
|
|
1848
1917
|
*
|
|
1849
1918
|
* return [result.conflicts.length, new TextDecoder().decode(yield* reader.readFile("/shared.txt"))]
|
|
@@ -1857,7 +1926,10 @@ export declare const applySnapshotDelta: (base: Snapshot, delta: SnapshotDeltaMo
|
|
|
1857
1926
|
* @category snapshots
|
|
1858
1927
|
* @since 0.8.0
|
|
1859
1928
|
*/
|
|
1860
|
-
export declare const mergeSnapshotDeltas:
|
|
1929
|
+
export declare const mergeSnapshotDeltas: {
|
|
1930
|
+
(ours: SnapshotDeltaModel.SnapshotDelta, theirs: SnapshotDeltaModel.SnapshotDelta, options?: SnapshotDeltaModel.MergeOptions): (base: Snapshot) => Effect.Effect<SnapshotDeltaModel.MergeResult, VfsError | PlatformError.PlatformError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1931
|
+
(base: Snapshot, ours: SnapshotDeltaModel.SnapshotDelta, theirs: SnapshotDeltaModel.SnapshotDelta, options?: SnapshotDeltaModel.MergeOptions): Effect.Effect<SnapshotDeltaModel.MergeResult, VfsError | PlatformError.PlatformError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
1932
|
+
};
|
|
1861
1933
|
/**
|
|
1862
1934
|
* Creates an Effect Schema codec between owned bytes and opaque snapshot deltas.
|
|
1863
1935
|
* Omission uses `SnapshotDeltaLimits.default`.
|
|
@@ -1982,7 +2054,7 @@ export type Fixture = typeof Fixture.Type;
|
|
|
1982
2054
|
*
|
|
1983
2055
|
* Each execution creates independent storage. Snapshot image failures cannot
|
|
1984
2056
|
* arise because this constructor does not accept persisted input.
|
|
1985
|
-
* Provide `
|
|
2057
|
+
* Provide the `Digest` and `SecureRandom` services to generate the volume identity and reference-key secret.
|
|
1986
2058
|
*
|
|
1987
2059
|
* @example
|
|
1988
2060
|
* ```ts
|
|
@@ -2008,7 +2080,7 @@ export type Fixture = typeof Fixture.Type;
|
|
|
2008
2080
|
* @category constructors
|
|
2009
2081
|
* @since 0.1.0
|
|
2010
2082
|
*/
|
|
2011
|
-
export declare const make: (options?: VolumeOptions) => Effect.Effect<Volume, VfsError,
|
|
2083
|
+
export declare const make: (options?: VolumeOptions) => Effect.Effect<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
2012
2084
|
/**
|
|
2013
2085
|
* Streams the tree at `root` in a snapshot as fixture entries, read from the
|
|
2014
2086
|
* snapshot itself without restoring a volume.
|
|
@@ -2055,7 +2127,10 @@ export declare const make: (options?: VolumeOptions) => Effect.Effect<Volume, Vf
|
|
|
2055
2127
|
* @category snapshots
|
|
2056
2128
|
* @since 0.6.0
|
|
2057
2129
|
*/
|
|
2058
|
-
export declare const snapshotEntries:
|
|
2130
|
+
export declare const snapshotEntries: {
|
|
2131
|
+
(root: PathInput): (snapshot: Snapshot) => Stream.Stream<Fixture["entries"][number], FsFailure | ImageFailure>;
|
|
2132
|
+
(snapshot: Snapshot, root: PathInput): Stream.Stream<Fixture["entries"][number], FsFailure | ImageFailure>;
|
|
2133
|
+
};
|
|
2059
2134
|
/**
|
|
2060
2135
|
* Restores a fresh volume from an opaque snapshot under the supplied destination limits.
|
|
2061
2136
|
*
|
|
@@ -2094,11 +2169,14 @@ export declare const snapshotEntries: (snapshot: Snapshot, root: PathInput) => S
|
|
|
2094
2169
|
* ```
|
|
2095
2170
|
*
|
|
2096
2171
|
* @see {@link makeOverlay} for a copy-on-write workspace over the same base.
|
|
2097
|
-
* @see `
|
|
2172
|
+
* @see `Digest.Digest` and `SecureRandom.SecureRandom` for the required crypto services.
|
|
2098
2173
|
* @category constructors
|
|
2099
2174
|
* @since 0.1.0
|
|
2100
2175
|
*/
|
|
2101
|
-
export declare const fromSnapshot:
|
|
2176
|
+
export declare const fromSnapshot: {
|
|
2177
|
+
(options?: VolumeOptions): (snapshot: Snapshot) => Effect.Effect<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
2178
|
+
(snapshot: Snapshot, options?: VolumeOptions): Effect.Effect<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
2179
|
+
};
|
|
2102
2180
|
/**
|
|
2103
2181
|
* Creates an isolated writable volume relative to one immutable snapshot base.
|
|
2104
2182
|
*
|
|
@@ -2146,11 +2224,14 @@ export declare const fromSnapshot: (snapshot: Snapshot, options?: VolumeOptions)
|
|
|
2146
2224
|
* ```
|
|
2147
2225
|
*
|
|
2148
2226
|
* @see The overlay guide at `/guides/overlay-filesystems`.
|
|
2149
|
-
* @see `
|
|
2227
|
+
* @see `Digest.Digest` and `SecureRandom.SecureRandom` for the required crypto services.
|
|
2150
2228
|
* @category constructors
|
|
2151
2229
|
* @since 0.1.0
|
|
2152
2230
|
*/
|
|
2153
|
-
export declare const makeOverlay:
|
|
2231
|
+
export declare const makeOverlay: {
|
|
2232
|
+
(options?: VolumeOptions): (base: Snapshot) => Effect.Effect<OverlayVolume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
2233
|
+
(base: Snapshot, options?: VolumeOptions): Effect.Effect<OverlayVolume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
2234
|
+
};
|
|
2154
2235
|
/**
|
|
2155
2236
|
* Builds a fresh volume from a validated final-state fixture.
|
|
2156
2237
|
*
|
|
@@ -2187,9 +2268,12 @@ export declare const makeOverlay: (base: Snapshot, options?: VolumeOptions) => E
|
|
|
2187
2268
|
* ```
|
|
2188
2269
|
*
|
|
2189
2270
|
* @see The fixtures guide at `/guides/fixtures-and-snapshots`.
|
|
2190
|
-
* @see `
|
|
2271
|
+
* @see `Digest.Digest` and `SecureRandom.SecureRandom` for the required crypto services.
|
|
2191
2272
|
* @category constructors
|
|
2192
2273
|
* @since 0.1.0
|
|
2193
2274
|
*/
|
|
2194
|
-
export declare const fromFixture:
|
|
2275
|
+
export declare const fromFixture: {
|
|
2276
|
+
(options?: VolumeOptions): (fixture: Fixture) => Effect.Effect<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
2277
|
+
(fixture: Fixture, options?: VolumeOptions): Effect.Effect<Volume, VfsError, Digest.Digest | SecureRandom.SecureRandom>;
|
|
2278
|
+
};
|
|
2195
2279
|
//# sourceMappingURL=VirtualFileSystem.d.ts.map
|