@effect-vfs/core 0.1.0 → 0.2.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 +97 -8
- package/dist/BytePath.d.ts +21 -0
- package/dist/BytePath.d.ts.map +1 -0
- package/dist/BytePath.js +16 -0
- package/dist/Snapshot.d.ts +2 -2
- package/dist/Snapshot.js +2 -2
- package/dist/SnapshotDelta.d.ts +126 -0
- package/dist/SnapshotDelta.d.ts.map +1 -0
- package/dist/SnapshotDelta.js +112 -0
- package/dist/VirtualFileSystem.d.ts +105 -32
- package/dist/VirtualFileSystem.d.ts.map +1 -1
- package/dist/VirtualFileSystem.js +95 -45
- package/dist/internal/canonicalBase64.d.ts +7 -0
- package/dist/internal/canonicalBase64.d.ts.map +1 -0
- package/dist/internal/canonicalBase64.js +11 -0
- package/dist/internal/image.d.ts +7 -5
- package/dist/internal/image.d.ts.map +1 -1
- package/dist/internal/image.js +10 -14
- package/dist/internal/overlayChanges.d.ts.map +1 -1
- package/dist/internal/overlayChanges.js +4 -15
- package/dist/internal/snapshotDelta.d.ts +88 -0
- package/dist/internal/snapshotDelta.d.ts.map +1 -0
- package/dist/internal/snapshotDelta.js +589 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -16,10 +16,10 @@ for the exact permission, path, timestamp, quota, and atomicity rules.
|
|
|
16
16
|
## Install
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
npm install @effect-vfs/core effect@4.0.0-rc.
|
|
19
|
+
npm install @effect-vfs/core effect@4.0.0-rc.114
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
Version `0.1.0` targets the exact peer version `effect@4.0.0-rc.
|
|
22
|
+
Version `0.1.0` targets the exact peer version `effect@4.0.0-rc.114`.
|
|
23
23
|
|
|
24
24
|
## The mental model
|
|
25
25
|
|
|
@@ -40,15 +40,15 @@ lifetime are explicit values that can be composed in one Effect program.
|
|
|
40
40
|
|
|
41
41
|
```ts
|
|
42
42
|
import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
|
|
43
|
-
import { Effect } from "effect"
|
|
43
|
+
import { ByteSize, Effect } from "effect"
|
|
44
44
|
|
|
45
45
|
const utf8 = new TextEncoder()
|
|
46
46
|
|
|
47
47
|
const program = Effect.scoped(Effect.gen(function*() {
|
|
48
48
|
const volume = yield* Vfs.make({
|
|
49
49
|
maxEntries: 100,
|
|
50
|
-
maxBytes:
|
|
51
|
-
maxFileBytes:
|
|
50
|
+
maxBytes: ByteSize.megabytes(1),
|
|
51
|
+
maxFileBytes: ByteSize.kilobytes(100)
|
|
52
52
|
})
|
|
53
53
|
|
|
54
54
|
const admin = yield* volume.caller()
|
|
@@ -129,12 +129,13 @@ resettable sandboxes.
|
|
|
129
129
|
```ts
|
|
130
130
|
import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
|
|
131
131
|
import { Effect } from "effect"
|
|
132
|
+
import * as ByteSize from "effect/ByteSize"
|
|
132
133
|
|
|
133
134
|
const decodeLimits = {
|
|
134
|
-
maxEncodedBytes:
|
|
135
|
+
maxEncodedBytes: ByteSize.megabytes(1),
|
|
135
136
|
maxRecords: 1_000,
|
|
136
137
|
maxEntries: 1_000,
|
|
137
|
-
maxDecodedBytes:
|
|
138
|
+
maxDecodedBytes: ByteSize.megabytes(1)
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
const program = Effect.gen(function*() {
|
|
@@ -184,6 +185,7 @@ contents.
|
|
|
184
185
|
```ts
|
|
185
186
|
import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
|
|
186
187
|
import { Effect } from "effect"
|
|
188
|
+
import * as ByteSize from "effect/ByteSize"
|
|
187
189
|
|
|
188
190
|
const branch = Effect.gen(function*() {
|
|
189
191
|
const template = yield* Vfs.fromFixture({
|
|
@@ -193,7 +195,7 @@ const branch = Effect.gen(function*() {
|
|
|
193
195
|
]
|
|
194
196
|
})
|
|
195
197
|
const base = yield* template.snapshot
|
|
196
|
-
const workspace = yield* Vfs.makeOverlay(base, { maxBytes:
|
|
198
|
+
const workspace = yield* Vfs.makeOverlay(base, { maxBytes: ByteSize.megabytes(1) })
|
|
197
199
|
const fs = yield* workspace.caller()
|
|
198
200
|
|
|
199
201
|
yield* fs.rename("/project/settings.json", "/project/preferences.json")
|
|
@@ -221,6 +223,93 @@ The Effects returned by `changes(options)` and `capture(options)` are also reusa
|
|
|
221
223
|
workspace again. Invalid summary options fail with `ConfigurationError`; failure to construct the complete observed
|
|
222
224
|
snapshot fails with `ImageError`. Reusing a previously completed `capture()` result does not observe later writes.
|
|
223
225
|
|
|
226
|
+
## Store and apply exact snapshot deltas
|
|
227
|
+
|
|
228
|
+
Use `diffSnapshots` when you need a portable description of the exact difference between two immutable snapshots.
|
|
229
|
+
The result is an opaque `SnapshotDelta`: inspect it for a path-oriented summary, encode it with Effect Schema, or apply
|
|
230
|
+
it to a semantically identical base to reconstruct the target snapshot.
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
|
|
234
|
+
import * as NodeCrypto from "@effect/platform-node/NodeCrypto"
|
|
235
|
+
import { Effect, Schema } from "effect"
|
|
236
|
+
import * as ByteSize from "effect/ByteSize"
|
|
237
|
+
|
|
238
|
+
const Delta = Vfs.SnapshotDeltaFromBytes()
|
|
239
|
+
|
|
240
|
+
const program = Effect.gen(function*() {
|
|
241
|
+
const baseVolume = yield* Vfs.fromFixture({
|
|
242
|
+
entries: [{ kind: "file", path: "/old.txt", bytes: new TextEncoder().encode("before") }]
|
|
243
|
+
})
|
|
244
|
+
const targetVolume = yield* Vfs.fromFixture({
|
|
245
|
+
entries: [{ kind: "file", path: "/new.txt", bytes: new TextEncoder().encode("after") }]
|
|
246
|
+
})
|
|
247
|
+
const base = yield* baseVolume.snapshot
|
|
248
|
+
const target = yield* targetVolume.snapshot
|
|
249
|
+
|
|
250
|
+
const delta = yield* Vfs.diffSnapshots(base, target)
|
|
251
|
+
const changes = yield* Vfs.inspectSnapshotDelta(base, delta)
|
|
252
|
+
const bytes = yield* Schema.encodeEffect(Delta)(delta)
|
|
253
|
+
const decoded = yield* Schema.decodeEffect(Delta)(bytes)
|
|
254
|
+
const restored = yield* Vfs.applySnapshotDelta(base, decoded)
|
|
255
|
+
|
|
256
|
+
return { changes, restored }
|
|
257
|
+
})
|
|
258
|
+
|
|
259
|
+
await Effect.runPromise(program.pipe(Effect.provide(NodeCrypto.layer)))
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Inspection verifies the delta against its semantic base before reporting what the two snapshots prove. It does not guess renames from equal contents or paths: a move is a
|
|
263
|
+
`Removed` change followed by an `Added` change. `Updated` records identify changed semantic fields, including content,
|
|
264
|
+
metadata, symbolic-link targets, and hard-link topology. Summaries do not contain replay payloads; the opaque delta does.
|
|
265
|
+
|
|
266
|
+
Each delta records the semantic identity of its required base. Inspecting or applying it against a different valid snapshot fails with a
|
|
267
|
+
`SnapshotDeltaError` whose `code` is `BaseMismatch`. Equivalent snapshots are accepted even if their encoded bytes or
|
|
268
|
+
internal record identifiers differ. Applying a delta returns another immutable `Snapshot`; call `fromSnapshot` when
|
|
269
|
+
you need a writable volume.
|
|
270
|
+
|
|
271
|
+
Creation, inspection, encoding, decoding, and application use finite `SnapshotDeltaLimits.default` limits when none are supplied.
|
|
272
|
+
Delta creation, inspection, and application require Effect's platform-neutral `Crypto.Crypto` service for SHA-256 base identity.
|
|
273
|
+
Provide the official Node, Bun, browser, or Deno crypto layer at the application edge; the core never imports a host
|
|
274
|
+
crypto implementation. Memory-sensitive applications can use one policy throughout the workflow:
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
const limits = Vfs.SnapshotDeltaLimits.constrained
|
|
278
|
+
const Delta = Vfs.SnapshotDeltaFromBytes(limits)
|
|
279
|
+
|
|
280
|
+
const constrained = Effect.gen(function*() {
|
|
281
|
+
const delta = yield* Vfs.diffSnapshots(base, target, limits)
|
|
282
|
+
const bytes = yield* Schema.encodeEffect(Delta)(delta)
|
|
283
|
+
const decoded = yield* Schema.decodeEffect(Delta)(bytes)
|
|
284
|
+
return yield* Vfs.applySnapshotDelta(base, decoded, limits)
|
|
285
|
+
})
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Both presets are frozen complete policies. The shipped values are:
|
|
289
|
+
|
|
290
|
+
| limit | `constrained` | `default` |
|
|
291
|
+
| ----------------------------------- | ------------: | --------: |
|
|
292
|
+
| encoded bytes | 2 MiB | 16 MiB |
|
|
293
|
+
| canonical identity bytes | 4 MiB | 32 MiB |
|
|
294
|
+
| stored records plus summary changes | 6,500 | 50,000 |
|
|
295
|
+
| decoded delta bytes | 512 KiB | 8 MiB |
|
|
296
|
+
| base records | 6,500 | 50,000 |
|
|
297
|
+
| target records | 6,500 | 50,000 |
|
|
298
|
+
| namespace entries | 6,500 | 100,000 |
|
|
299
|
+
| output records | 6,500 | 50,000 |
|
|
300
|
+
| output payload bytes | 256 KiB | 4 MiB |
|
|
301
|
+
| inherited records | 6,500 | 50,000 |
|
|
302
|
+
|
|
303
|
+
These are conservative finite defaults, not universal workspace-size or memory guarantees. To tune one dimension,
|
|
304
|
+
spread a preset into a complete `SnapshotDeltaLimits` value and replace that field.
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
const limits = {
|
|
308
|
+
...Vfs.SnapshotDeltaLimits.default,
|
|
309
|
+
maxOutputBytes: ByteSize.mebibytes(8)
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
224
313
|
## Use scoped handles for incremental I/O
|
|
225
314
|
|
|
226
315
|
Whole-file operations are convenient, but handles give each open file an independent `bigint` cursor and support
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
export declare const BytePathId: unique symbol;
|
|
3
|
+
/**
|
|
4
|
+
* An opaque path that preserves arbitrary non-NUL bytes without UTF-8 conversion.
|
|
5
|
+
*
|
|
6
|
+
* @category models
|
|
7
|
+
* @since 0.1.0
|
|
8
|
+
*/
|
|
9
|
+
export interface BytePath {
|
|
10
|
+
readonly [BytePathId]: true;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Schema for an opaque byte-preserving filesystem path.
|
|
14
|
+
*
|
|
15
|
+
* @category schemas
|
|
16
|
+
* @since 0.1.0
|
|
17
|
+
*/
|
|
18
|
+
export declare const BytePath: Schema.declare<BytePath, BytePath>;
|
|
19
|
+
export declare const make: (bytes: Uint8Array) => BytePath;
|
|
20
|
+
export declare const getBytes: (path: BytePath) => Uint8Array | undefined;
|
|
21
|
+
//# sourceMappingURL=BytePath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BytePath.d.ts","sourceRoot":"","sources":["../src/BytePath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,eAAO,MAAM,UAAU,eAAsC,CAAA;AAI7D;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAA;CAC5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,oCAEpB,CAAA;AAED,eAAO,MAAM,IAAI,UAAW,UAAU,KAAG,QAIxC,CAAA;AAED,eAAO,MAAM,QAAQ,SAAU,QAAQ,KAAG,UAAU,GAAG,SAAgC,CAAA"}
|
package/dist/BytePath.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
export const BytePathId = Symbol("@effect-vfs/core/BytePath");
|
|
3
|
+
const bytePaths = new WeakMap();
|
|
4
|
+
/**
|
|
5
|
+
* Schema for an opaque byte-preserving filesystem path.
|
|
6
|
+
*
|
|
7
|
+
* @category schemas
|
|
8
|
+
* @since 0.1.0
|
|
9
|
+
*/
|
|
10
|
+
export const BytePath = Schema.declare((value) => typeof value === "object" && value !== null && bytePaths.has(value));
|
|
11
|
+
export const make = (bytes) => {
|
|
12
|
+
const path = Object.freeze({ [BytePathId]: true });
|
|
13
|
+
bytePaths.set(path, bytes);
|
|
14
|
+
return path;
|
|
15
|
+
};
|
|
16
|
+
export const getBytes = (path) => bytePaths.get(path);
|
package/dist/Snapshot.d.ts
CHANGED
|
@@ -46,13 +46,13 @@ export declare class ImageError extends ImageError_base<{
|
|
|
46
46
|
*/
|
|
47
47
|
export declare const DecodeLimits: Schema.Struct<{
|
|
48
48
|
/** Maximum accepted encoded input length in bytes. */
|
|
49
|
-
readonly maxEncodedBytes: Schema.
|
|
49
|
+
readonly maxEncodedBytes: Schema.ByteSize;
|
|
50
50
|
/** Maximum number of stored metadata and content records. */
|
|
51
51
|
readonly maxRecords: Schema.Finite;
|
|
52
52
|
/** Maximum number of namespace entries. */
|
|
53
53
|
readonly maxEntries: Schema.Finite;
|
|
54
54
|
/** Maximum combined decoded byte content. */
|
|
55
|
-
readonly maxDecodedBytes: Schema.
|
|
55
|
+
readonly maxDecodedBytes: Schema.ByteSize;
|
|
56
56
|
}>;
|
|
57
57
|
/**
|
|
58
58
|
* Resource limits applied while decoding a snapshot.
|
package/dist/Snapshot.js
CHANGED
|
@@ -33,11 +33,11 @@ export class ImageError extends Data.TaggedError("ImageError") {
|
|
|
33
33
|
*/
|
|
34
34
|
export const DecodeLimits = Schema.Struct({
|
|
35
35
|
/** Maximum accepted encoded input length in bytes. */
|
|
36
|
-
maxEncodedBytes:
|
|
36
|
+
maxEncodedBytes: Schema.ByteSize,
|
|
37
37
|
/** Maximum number of stored metadata and content records. */
|
|
38
38
|
maxRecords: Natural,
|
|
39
39
|
/** Maximum number of namespace entries. */
|
|
40
40
|
maxEntries: Natural,
|
|
41
41
|
/** Maximum combined decoded byte content. */
|
|
42
|
-
maxDecodedBytes:
|
|
42
|
+
maxDecodedBytes: Schema.ByteSize
|
|
43
43
|
});
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opaque portable snapshot deltas and their public inspection models.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.1.0
|
|
5
|
+
*/
|
|
6
|
+
import * as ByteSize from "effect/ByteSize";
|
|
7
|
+
import * as Schema from "effect/Schema";
|
|
8
|
+
import { BytePath } from "./BytePath.js";
|
|
9
|
+
/** Type identifier for opaque snapshot deltas. */
|
|
10
|
+
export declare const SnapshotDeltaTypeId: unique symbol;
|
|
11
|
+
/** Type identifier for opaque snapshot deltas. */
|
|
12
|
+
export type SnapshotDeltaTypeId = typeof SnapshotDeltaTypeId;
|
|
13
|
+
/** An immutable, opaque description of the exact difference between two snapshots. */
|
|
14
|
+
export interface SnapshotDelta {
|
|
15
|
+
readonly [SnapshotDeltaTypeId]: SnapshotDeltaTypeId;
|
|
16
|
+
}
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const makeSnapshotDelta: (value: object) => SnapshotDelta;
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const snapshotDeltaValue: (delta: SnapshotDelta) => object | undefined;
|
|
21
|
+
/** Schema for an already validated opaque snapshot delta. */
|
|
22
|
+
export declare const SnapshotDelta: Schema.declare<SnapshotDelta, SnapshotDelta>;
|
|
23
|
+
/** Schema for filesystem entry kinds reported by snapshot inspection. */
|
|
24
|
+
export declare const SnapshotNodeKind: Schema.Literals<readonly ["directory", "file", "symlink"]>;
|
|
25
|
+
/** A filesystem entry kind reported by snapshot inspection. */
|
|
26
|
+
export type SnapshotNodeKind = typeof SnapshotNodeKind.Type;
|
|
27
|
+
/** Schema for semantic fields that can differ between snapshots. */
|
|
28
|
+
export declare const SnapshotDifference: Schema.Literals<readonly ["kind", "content", "target", "hardLinks", "mode", "uid", "gid", "atimeNs", "mtimeNs", "ctimeNs", "birthtimeNs"]>;
|
|
29
|
+
/** A semantic field that differs between two snapshots. */
|
|
30
|
+
export type SnapshotDifference = typeof SnapshotDifference.Type;
|
|
31
|
+
/**
|
|
32
|
+
* Schema for a path-oriented difference between two snapshots.
|
|
33
|
+
*
|
|
34
|
+
* Independent snapshots do not preserve shared lineage, so moves are reported
|
|
35
|
+
* as a removal and an addition rather than an inferred rename.
|
|
36
|
+
*/
|
|
37
|
+
export declare const SnapshotChange: Schema.Union<readonly [Schema.TaggedStruct<"Added", {
|
|
38
|
+
readonly path: Schema.declare<BytePath, BytePath>;
|
|
39
|
+
readonly kind: Schema.Literals<readonly ["directory", "file", "symlink"]>;
|
|
40
|
+
}>, Schema.TaggedStruct<"Removed", {
|
|
41
|
+
readonly path: Schema.declare<BytePath, BytePath>;
|
|
42
|
+
readonly kind: Schema.Literals<readonly ["directory", "file", "symlink"]>;
|
|
43
|
+
}>, Schema.TaggedStruct<"Updated", {
|
|
44
|
+
readonly path: Schema.declare<BytePath, BytePath>;
|
|
45
|
+
readonly beforeKind: Schema.Literals<readonly ["directory", "file", "symlink"]>;
|
|
46
|
+
readonly afterKind: Schema.Literals<readonly ["directory", "file", "symlink"]>;
|
|
47
|
+
readonly differences: Schema.$Array<Schema.Literals<readonly ["kind", "content", "target", "hardLinks", "mode", "uid", "gid", "atimeNs", "mtimeNs", "ctimeNs", "birthtimeNs"]>>;
|
|
48
|
+
}>]>;
|
|
49
|
+
/** A path-oriented semantic difference between two snapshots. */
|
|
50
|
+
export type SnapshotChange = typeof SnapshotChange.Type;
|
|
51
|
+
/** Schema for snapshot-delta inspection options. */
|
|
52
|
+
export declare const SnapshotChangesOptions: Schema.Struct<{
|
|
53
|
+
/** Include access, modification, change, and birth-time differences. Defaults to `false`. */
|
|
54
|
+
readonly includeTimestamps: Schema.optionalKey<Schema.Boolean>;
|
|
55
|
+
}>;
|
|
56
|
+
/** Filtering options for snapshot-delta inspection. */
|
|
57
|
+
export type SnapshotChangesOptions = typeof SnapshotChangesOptions.Type;
|
|
58
|
+
declare const SnapshotDeltaError_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 & {
|
|
59
|
+
readonly _tag: "SnapshotDeltaError";
|
|
60
|
+
} & Readonly<A>;
|
|
61
|
+
/** A valid snapshot delta was inspected or applied against a valid but semantically different base. */
|
|
62
|
+
export declare class SnapshotDeltaError extends SnapshotDeltaError_base<{
|
|
63
|
+
readonly code: "BaseMismatch";
|
|
64
|
+
}> {
|
|
65
|
+
}
|
|
66
|
+
declare const SnapshotDeltaLimitsSchema: Schema.Struct<{
|
|
67
|
+
readonly maxEncodedBytes: Schema.ByteSize;
|
|
68
|
+
readonly maxIdentityBytes: Schema.ByteSize;
|
|
69
|
+
readonly maxDeltaRecords: Schema.Finite;
|
|
70
|
+
readonly maxDecodedDeltaBytes: Schema.ByteSize;
|
|
71
|
+
readonly maxBaseRecords: Schema.Finite;
|
|
72
|
+
readonly maxTargetRecords: Schema.Finite;
|
|
73
|
+
readonly maxEntries: Schema.Finite;
|
|
74
|
+
readonly maxOutputRecords: Schema.Finite;
|
|
75
|
+
readonly maxOutputBytes: Schema.ByteSize;
|
|
76
|
+
readonly maxInheritedRecords: Schema.Finite;
|
|
77
|
+
}>;
|
|
78
|
+
/** Resource limits shared by delta creation, inspection, encoding, decoding, and application. */
|
|
79
|
+
export type SnapshotDeltaLimits = typeof SnapshotDeltaLimitsSchema.Type;
|
|
80
|
+
/** Constructs and freezes a complete snapshot-delta resource policy. @internal */
|
|
81
|
+
export declare const makeSnapshotDeltaLimits: (limits: SnapshotDeltaLimits) => SnapshotDeltaLimits;
|
|
82
|
+
/**
|
|
83
|
+
* Schema for a complete snapshot-delta resource policy, with frozen presets.
|
|
84
|
+
*
|
|
85
|
+
* The constrained preset is intended for memory-sensitive environments. The
|
|
86
|
+
* default preset permits larger snapshots and payloads while remaining finite.
|
|
87
|
+
*/
|
|
88
|
+
export declare const SnapshotDeltaLimits: Schema.Struct<{
|
|
89
|
+
readonly maxEncodedBytes: Schema.ByteSize;
|
|
90
|
+
readonly maxIdentityBytes: Schema.ByteSize;
|
|
91
|
+
readonly maxDeltaRecords: Schema.Finite;
|
|
92
|
+
readonly maxDecodedDeltaBytes: Schema.ByteSize;
|
|
93
|
+
readonly maxBaseRecords: Schema.Finite;
|
|
94
|
+
readonly maxTargetRecords: Schema.Finite;
|
|
95
|
+
readonly maxEntries: Schema.Finite;
|
|
96
|
+
readonly maxOutputRecords: Schema.Finite;
|
|
97
|
+
readonly maxOutputBytes: Schema.ByteSize;
|
|
98
|
+
readonly maxInheritedRecords: Schema.Finite;
|
|
99
|
+
}> & {
|
|
100
|
+
constrained: {
|
|
101
|
+
readonly maxEncodedBytes: ByteSize.ByteSize;
|
|
102
|
+
readonly maxIdentityBytes: ByteSize.ByteSize;
|
|
103
|
+
readonly maxDeltaRecords: number;
|
|
104
|
+
readonly maxDecodedDeltaBytes: ByteSize.ByteSize;
|
|
105
|
+
readonly maxBaseRecords: number;
|
|
106
|
+
readonly maxTargetRecords: number;
|
|
107
|
+
readonly maxEntries: number;
|
|
108
|
+
readonly maxOutputRecords: number;
|
|
109
|
+
readonly maxOutputBytes: ByteSize.ByteSize;
|
|
110
|
+
readonly maxInheritedRecords: number;
|
|
111
|
+
};
|
|
112
|
+
default: {
|
|
113
|
+
readonly maxEncodedBytes: ByteSize.ByteSize;
|
|
114
|
+
readonly maxIdentityBytes: ByteSize.ByteSize;
|
|
115
|
+
readonly maxDeltaRecords: number;
|
|
116
|
+
readonly maxDecodedDeltaBytes: ByteSize.ByteSize;
|
|
117
|
+
readonly maxBaseRecords: number;
|
|
118
|
+
readonly maxTargetRecords: number;
|
|
119
|
+
readonly maxEntries: number;
|
|
120
|
+
readonly maxOutputRecords: number;
|
|
121
|
+
readonly maxOutputBytes: ByteSize.ByteSize;
|
|
122
|
+
readonly maxInheritedRecords: number;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=SnapshotDelta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnapshotDelta.d.ts","sourceRoot":"","sources":["../src/SnapshotDelta.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAE3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAQxC,kDAAkD;AAClD,eAAO,MAAM,mBAAmB,eAA2C,CAAA;AAC3E,kDAAkD;AAClD,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA;AAE5D,sFAAsF;AACtF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;CACpD;AAID,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,UAAW,MAAM,KAAG,aAIjD,CAAA;AAED,gBAAgB;AAChB,eAAO,MAAM,kBAAkB,UAAW,aAAa,KAAG,MAAM,GAAG,SAAsC,CAAA;AAEzG,6DAA6D;AAC7D,eAAO,MAAM,aAAa,8CAEzB,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,4DAAoD,CAAA;AACjF,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAA;AAE3D,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,4IAY7B,CAAA;AACF,2DAA2D;AAC3D,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAA;AAI/D;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;IASzB,CAAA;AACF,iEAAiE;AACjE,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEvD,oDAAoD;AACpD,eAAO,MAAM,sBAAsB;IACjC,6FAA6F;;EAE7F,CAAA;AACF,uDAAuD;AACvD,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAC,IAAI,CAAA;;;;AAEvE,uGAAuG;AACvG,qBAAa,kBAAmB,SAAQ,wBAAuC;IAC7E,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAC9B,CAAC;CAAG;AAEL,QAAA,MAAM,yBAAyB;;;;;;;;;;;EAW7B,CAAA;AACF,iGAAiG;AACjG,MAAM,MAAM,mBAAmB,GAAG,OAAO,yBAAyB,CAAC,IAAI,CAAA;AAEvE,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,WAAY,mBAAmB,KAAG,mBACxC,CAAA;AA2B9B;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAG9B,CAAA"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opaque portable snapshot deltas and their public inspection models.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.1.0
|
|
5
|
+
*/
|
|
6
|
+
import * as ByteSize from "effect/ByteSize";
|
|
7
|
+
import * as Data from "effect/Data";
|
|
8
|
+
import * as Schema from "effect/Schema";
|
|
9
|
+
import { BytePath } from "./BytePath.js";
|
|
10
|
+
const Natural = Schema.Finite.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));
|
|
11
|
+
/** Type identifier for opaque snapshot deltas. */
|
|
12
|
+
export const SnapshotDeltaTypeId = Symbol("@effect-vfs/core/SnapshotDelta");
|
|
13
|
+
const snapshotDeltas = new WeakMap();
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const makeSnapshotDelta = (value) => {
|
|
16
|
+
const delta = Object.freeze({ [SnapshotDeltaTypeId]: SnapshotDeltaTypeId });
|
|
17
|
+
snapshotDeltas.set(delta, value);
|
|
18
|
+
return delta;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const snapshotDeltaValue = (delta) => snapshotDeltas.get(delta);
|
|
22
|
+
/** Schema for an already validated opaque snapshot delta. */
|
|
23
|
+
export const SnapshotDelta = Schema.declare((value) => typeof value === "object" && value !== null && snapshotDeltas.has(value));
|
|
24
|
+
/** Schema for filesystem entry kinds reported by snapshot inspection. */
|
|
25
|
+
export const SnapshotNodeKind = Schema.Literals(["directory", "file", "symlink"]);
|
|
26
|
+
/** Schema for semantic fields that can differ between snapshots. */
|
|
27
|
+
export const SnapshotDifference = Schema.Literals([
|
|
28
|
+
"kind",
|
|
29
|
+
"content",
|
|
30
|
+
"target",
|
|
31
|
+
"hardLinks",
|
|
32
|
+
"mode",
|
|
33
|
+
"uid",
|
|
34
|
+
"gid",
|
|
35
|
+
"atimeNs",
|
|
36
|
+
"mtimeNs",
|
|
37
|
+
"ctimeNs",
|
|
38
|
+
"birthtimeNs"
|
|
39
|
+
]);
|
|
40
|
+
const SnapshotDifferences = Schema.Array(SnapshotDifference).check(Schema.isMinLength(1));
|
|
41
|
+
/**
|
|
42
|
+
* Schema for a path-oriented difference between two snapshots.
|
|
43
|
+
*
|
|
44
|
+
* Independent snapshots do not preserve shared lineage, so moves are reported
|
|
45
|
+
* as a removal and an addition rather than an inferred rename.
|
|
46
|
+
*/
|
|
47
|
+
export const SnapshotChange = Schema.Union([
|
|
48
|
+
Schema.TaggedStruct("Added", { path: BytePath, kind: SnapshotNodeKind }),
|
|
49
|
+
Schema.TaggedStruct("Removed", { path: BytePath, kind: SnapshotNodeKind }),
|
|
50
|
+
Schema.TaggedStruct("Updated", {
|
|
51
|
+
path: BytePath,
|
|
52
|
+
beforeKind: SnapshotNodeKind,
|
|
53
|
+
afterKind: SnapshotNodeKind,
|
|
54
|
+
differences: SnapshotDifferences
|
|
55
|
+
})
|
|
56
|
+
]);
|
|
57
|
+
/** Schema for snapshot-delta inspection options. */
|
|
58
|
+
export const SnapshotChangesOptions = Schema.Struct({
|
|
59
|
+
/** Include access, modification, change, and birth-time differences. Defaults to `false`. */
|
|
60
|
+
includeTimestamps: Schema.optionalKey(Schema.Boolean)
|
|
61
|
+
});
|
|
62
|
+
/** A valid snapshot delta was inspected or applied against a valid but semantically different base. */
|
|
63
|
+
export class SnapshotDeltaError extends Data.TaggedError("SnapshotDeltaError") {
|
|
64
|
+
}
|
|
65
|
+
const SnapshotDeltaLimitsSchema = Schema.Struct({
|
|
66
|
+
maxEncodedBytes: Schema.ByteSize,
|
|
67
|
+
maxIdentityBytes: Schema.ByteSize,
|
|
68
|
+
maxDeltaRecords: Natural,
|
|
69
|
+
maxDecodedDeltaBytes: Schema.ByteSize,
|
|
70
|
+
maxBaseRecords: Natural,
|
|
71
|
+
maxTargetRecords: Natural,
|
|
72
|
+
maxEntries: Natural,
|
|
73
|
+
maxOutputRecords: Natural,
|
|
74
|
+
maxOutputBytes: Schema.ByteSize,
|
|
75
|
+
maxInheritedRecords: Natural
|
|
76
|
+
});
|
|
77
|
+
/** Constructs and freezes a complete snapshot-delta resource policy. @internal */
|
|
78
|
+
export const makeSnapshotDeltaLimits = (limits) => Object.freeze({ ...limits });
|
|
79
|
+
const constrained = makeSnapshotDeltaLimits({
|
|
80
|
+
maxEncodedBytes: ByteSize.mebibytes(2),
|
|
81
|
+
maxIdentityBytes: ByteSize.mebibytes(4),
|
|
82
|
+
maxDeltaRecords: 6_500,
|
|
83
|
+
maxDecodedDeltaBytes: ByteSize.kibibytes(512),
|
|
84
|
+
maxBaseRecords: 6_500,
|
|
85
|
+
maxTargetRecords: 6_500,
|
|
86
|
+
maxEntries: 6_500,
|
|
87
|
+
maxOutputRecords: 6_500,
|
|
88
|
+
maxOutputBytes: ByteSize.kibibytes(256),
|
|
89
|
+
maxInheritedRecords: 6_500
|
|
90
|
+
});
|
|
91
|
+
const defaultLimits = makeSnapshotDeltaLimits({
|
|
92
|
+
maxEncodedBytes: ByteSize.mebibytes(16),
|
|
93
|
+
maxIdentityBytes: ByteSize.mebibytes(32),
|
|
94
|
+
maxDeltaRecords: 50_000,
|
|
95
|
+
maxDecodedDeltaBytes: ByteSize.mebibytes(8),
|
|
96
|
+
maxBaseRecords: 50_000,
|
|
97
|
+
maxTargetRecords: 50_000,
|
|
98
|
+
maxEntries: 100_000,
|
|
99
|
+
maxOutputRecords: 50_000,
|
|
100
|
+
maxOutputBytes: ByteSize.mebibytes(4),
|
|
101
|
+
maxInheritedRecords: 50_000
|
|
102
|
+
});
|
|
103
|
+
/**
|
|
104
|
+
* Schema for a complete snapshot-delta resource policy, with frozen presets.
|
|
105
|
+
*
|
|
106
|
+
* The constrained preset is intended for memory-sensitive environments. The
|
|
107
|
+
* default preset permits larger snapshots and payloads while remaining finite.
|
|
108
|
+
*/
|
|
109
|
+
export const SnapshotDeltaLimits = Object.assign(SnapshotDeltaLimitsSchema, {
|
|
110
|
+
constrained,
|
|
111
|
+
default: defaultLimits
|
|
112
|
+
});
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime-neutral virtual filesystem contracts and constructors.
|
|
3
|
+
*
|
|
4
|
+
* **Details**
|
|
5
|
+
*
|
|
6
|
+
* Volumes own isolated namespaces. Callers carry path context and credentials,
|
|
7
|
+
* while file and directory handles use `Scope` for deterministic release.
|
|
8
|
+
*
|
|
9
|
+
* @since 0.1.0
|
|
10
|
+
*/
|
|
11
|
+
import * as ByteSize from "effect/ByteSize";
|
|
1
12
|
import * as Context from "effect/Context";
|
|
2
13
|
import { DecodeLimits, ImageError, type Snapshot } from "./Snapshot.js";
|
|
3
14
|
export { DecodeLimits, ImageError, type Snapshot, SnapshotTypeId } from "./Snapshot.js";
|
|
@@ -5,27 +16,14 @@ import * as Effect from "effect/Effect";
|
|
|
5
16
|
import * as Schema from "effect/Schema";
|
|
6
17
|
import * as Scope from "effect/Scope";
|
|
7
18
|
import * as Stream from "effect/Stream";
|
|
8
|
-
|
|
19
|
+
import { BytePath } from "./BytePath.js";
|
|
20
|
+
export { BytePath } from "./BytePath.js";
|
|
21
|
+
import * as SnapshotDeltaModel from "./SnapshotDelta.js";
|
|
22
|
+
export { SnapshotChange, SnapshotChangesOptions, type SnapshotDelta, SnapshotDeltaError, SnapshotDeltaLimits, SnapshotDeltaTypeId, SnapshotDifference, SnapshotNodeKind } from "./SnapshotDelta.js";
|
|
9
23
|
declare const VolumeId: unique symbol;
|
|
10
24
|
declare const CallerId: unique symbol;
|
|
11
25
|
declare const FileHandleId: unique symbol;
|
|
12
26
|
declare const DirectoryHandleId: unique symbol;
|
|
13
|
-
/**
|
|
14
|
-
* An opaque path that preserves arbitrary non-NUL bytes without UTF-8 conversion.
|
|
15
|
-
*
|
|
16
|
-
* @category models
|
|
17
|
-
* @since 0.1.0
|
|
18
|
-
*/
|
|
19
|
-
export interface BytePath {
|
|
20
|
-
readonly [BytePathId]: true;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Schema for an opaque byte-preserving filesystem path.
|
|
24
|
-
*
|
|
25
|
-
* @category schemas
|
|
26
|
-
* @since 0.1.0
|
|
27
|
-
*/
|
|
28
|
-
export declare const BytePath: Schema.declare<BytePath, BytePath>;
|
|
29
27
|
/**
|
|
30
28
|
* A UTF-8 string path or an opaque byte-preserving path.
|
|
31
29
|
*
|
|
@@ -140,11 +138,11 @@ export declare const VolumeOptions: Schema.Struct<{
|
|
|
140
138
|
/** Maximum number of filesystem nodes. Omission leaves the count unbounded. */
|
|
141
139
|
readonly maxEntries: Schema.optionalKey<Schema.Finite>;
|
|
142
140
|
/** Maximum combined regular-file content in bytes. */
|
|
143
|
-
readonly maxBytes: Schema.optionalKey<Schema.
|
|
141
|
+
readonly maxBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
144
142
|
/** Maximum content size of one regular file in bytes. */
|
|
145
|
-
readonly maxFileBytes: Schema.optionalKey<Schema.
|
|
143
|
+
readonly maxFileBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
146
144
|
/** Maximum encoded byte length of an absolute or relative path. */
|
|
147
|
-
readonly maxPathBytes: Schema.optionalKey<Schema.
|
|
145
|
+
readonly maxPathBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
148
146
|
}>;
|
|
149
147
|
/**
|
|
150
148
|
* Capacity and path limits for a volume.
|
|
@@ -603,6 +601,81 @@ export declare const encodeSnapshot: (snapshot: Snapshot) => Effect.Effect<Uint8
|
|
|
603
601
|
* @since 0.1.0
|
|
604
602
|
*/
|
|
605
603
|
export declare const decodeSnapshot: (input: Uint8Array, limits: DecodeLimits) => Effect.Effect<Snapshot, ImageError>;
|
|
604
|
+
/**
|
|
605
|
+
* Computes an exact portable delta between two immutable snapshots.
|
|
606
|
+
* Requires the platform-neutral `Crypto.Crypto` service for base identity.
|
|
607
|
+
*
|
|
608
|
+
* @category snapshots
|
|
609
|
+
* @since 0.1.0
|
|
610
|
+
*/
|
|
611
|
+
export declare const diffSnapshots: (base: Snapshot, target: Snapshot, limits?: {
|
|
612
|
+
readonly maxEncodedBytes: ByteSize.ByteSize;
|
|
613
|
+
readonly maxIdentityBytes: ByteSize.ByteSize;
|
|
614
|
+
readonly maxDeltaRecords: number;
|
|
615
|
+
readonly maxDecodedDeltaBytes: ByteSize.ByteSize;
|
|
616
|
+
readonly maxBaseRecords: number;
|
|
617
|
+
readonly maxTargetRecords: number;
|
|
618
|
+
readonly maxEntries: number;
|
|
619
|
+
readonly maxOutputRecords: number;
|
|
620
|
+
readonly maxOutputBytes: ByteSize.ByteSize;
|
|
621
|
+
readonly maxInheritedRecords: number;
|
|
622
|
+
} | undefined) => Effect.Effect<SnapshotDeltaModel.SnapshotDelta, ConfigurationError | ImageError | import("effect/PlatformError").PlatformError, import("effect/Crypto").Crypto>;
|
|
623
|
+
/**
|
|
624
|
+
* Verifies an exact snapshot delta against its base and derives an owned path-oriented summary.
|
|
625
|
+
* Requires the platform-neutral `Crypto.Crypto` service for base identity.
|
|
626
|
+
*/
|
|
627
|
+
export declare const inspectSnapshotDelta: (base: Snapshot, delta: SnapshotDeltaModel.SnapshotDelta, options?: {
|
|
628
|
+
readonly includeTimestamps?: boolean;
|
|
629
|
+
} | undefined, limits?: {
|
|
630
|
+
readonly maxEncodedBytes: ByteSize.ByteSize;
|
|
631
|
+
readonly maxIdentityBytes: ByteSize.ByteSize;
|
|
632
|
+
readonly maxDeltaRecords: number;
|
|
633
|
+
readonly maxDecodedDeltaBytes: ByteSize.ByteSize;
|
|
634
|
+
readonly maxBaseRecords: number;
|
|
635
|
+
readonly maxTargetRecords: number;
|
|
636
|
+
readonly maxEntries: number;
|
|
637
|
+
readonly maxOutputRecords: number;
|
|
638
|
+
readonly maxOutputBytes: ByteSize.ByteSize;
|
|
639
|
+
readonly maxInheritedRecords: number;
|
|
640
|
+
} | undefined) => Effect.Effect<readonly ({
|
|
641
|
+
readonly _tag: "Added";
|
|
642
|
+
readonly path: BytePath;
|
|
643
|
+
readonly kind: "directory" | "file" | "symlink";
|
|
644
|
+
} | {
|
|
645
|
+
readonly _tag: "Removed";
|
|
646
|
+
readonly path: BytePath;
|
|
647
|
+
readonly kind: "directory" | "file" | "symlink";
|
|
648
|
+
} | {
|
|
649
|
+
readonly _tag: "Updated";
|
|
650
|
+
readonly path: BytePath;
|
|
651
|
+
readonly beforeKind: "directory" | "file" | "symlink";
|
|
652
|
+
readonly afterKind: "directory" | "file" | "symlink";
|
|
653
|
+
readonly differences: readonly ("atimeNs" | "birthtimeNs" | "content" | "ctimeNs" | "gid" | "hardLinks" | "kind" | "mode" | "mtimeNs" | "target" | "uid")[];
|
|
654
|
+
})[], ConfigurationError | ImageError | import("effect/PlatformError").PlatformError | SnapshotDeltaModel.SnapshotDeltaError, import("effect/Crypto").Crypto>;
|
|
655
|
+
/**
|
|
656
|
+
* Applies an exact delta to its semantically matching base and returns a new snapshot.
|
|
657
|
+
* Requires the platform-neutral `Crypto.Crypto` service for base identity.
|
|
658
|
+
*
|
|
659
|
+
* @category snapshots
|
|
660
|
+
* @since 0.1.0
|
|
661
|
+
*/
|
|
662
|
+
export declare const applySnapshotDelta: (base: Snapshot, delta: SnapshotDeltaModel.SnapshotDelta, limits?: {
|
|
663
|
+
readonly maxEncodedBytes: ByteSize.ByteSize;
|
|
664
|
+
readonly maxIdentityBytes: ByteSize.ByteSize;
|
|
665
|
+
readonly maxDeltaRecords: number;
|
|
666
|
+
readonly maxDecodedDeltaBytes: ByteSize.ByteSize;
|
|
667
|
+
readonly maxBaseRecords: number;
|
|
668
|
+
readonly maxTargetRecords: number;
|
|
669
|
+
readonly maxEntries: number;
|
|
670
|
+
readonly maxOutputRecords: number;
|
|
671
|
+
readonly maxOutputBytes: ByteSize.ByteSize;
|
|
672
|
+
readonly maxInheritedRecords: number;
|
|
673
|
+
} | undefined) => Effect.Effect<Snapshot, ConfigurationError | ImageError | import("effect/PlatformError").PlatformError | SnapshotDeltaModel.SnapshotDeltaError, import("effect/Crypto").Crypto>;
|
|
674
|
+
/**
|
|
675
|
+
* Creates an Effect Schema codec between owned bytes and opaque snapshot deltas.
|
|
676
|
+
* Omission uses `SnapshotDeltaLimits.default`.
|
|
677
|
+
*/
|
|
678
|
+
export declare const SnapshotDeltaFromBytes: (limits?: SnapshotDeltaModel.SnapshotDeltaLimits) => Schema.decodeTo<Schema.declare<SnapshotDeltaModel.SnapshotDelta, SnapshotDeltaModel.SnapshotDelta>, Schema.Uint8Array, never, never>;
|
|
606
679
|
/**
|
|
607
680
|
* Creates an opaque byte path by copying the input when the Effect executes.
|
|
608
681
|
*
|
|
@@ -634,9 +707,9 @@ export declare const pathToBytes: (path: BytePath) => Effect.Effect<Uint8Array<A
|
|
|
634
707
|
*/
|
|
635
708
|
export declare const make: (options?: {
|
|
636
709
|
readonly maxEntries?: number;
|
|
637
|
-
readonly maxBytes?:
|
|
638
|
-
readonly maxFileBytes?:
|
|
639
|
-
readonly maxPathBytes?:
|
|
710
|
+
readonly maxBytes?: ByteSize.ByteSize;
|
|
711
|
+
readonly maxFileBytes?: ByteSize.ByteSize;
|
|
712
|
+
readonly maxPathBytes?: ByteSize.ByteSize;
|
|
640
713
|
} | undefined) => Effect.Effect<Volume, ConfigurationError, never>;
|
|
641
714
|
/**
|
|
642
715
|
* Restores a fresh volume from an opaque snapshot under the supplied destination limits.
|
|
@@ -646,9 +719,9 @@ export declare const make: (options?: {
|
|
|
646
719
|
*/
|
|
647
720
|
export declare const fromSnapshot: (snapshot: Snapshot, options?: {
|
|
648
721
|
readonly maxEntries?: number;
|
|
649
|
-
readonly maxBytes?:
|
|
650
|
-
readonly maxFileBytes?:
|
|
651
|
-
readonly maxPathBytes?:
|
|
722
|
+
readonly maxBytes?: ByteSize.ByteSize;
|
|
723
|
+
readonly maxFileBytes?: ByteSize.ByteSize;
|
|
724
|
+
readonly maxPathBytes?: ByteSize.ByteSize;
|
|
652
725
|
} | undefined) => Effect.Effect<Volume, ConfigurationError | ImageError, never>;
|
|
653
726
|
/**
|
|
654
727
|
* Creates an isolated writable volume relative to one immutable snapshot base.
|
|
@@ -668,9 +741,9 @@ export declare const fromSnapshot: (snapshot: Snapshot, options?: {
|
|
|
668
741
|
*/
|
|
669
742
|
export declare const makeOverlay: (base: Snapshot, options?: {
|
|
670
743
|
readonly maxEntries?: number;
|
|
671
|
-
readonly maxBytes?:
|
|
672
|
-
readonly maxFileBytes?:
|
|
673
|
-
readonly maxPathBytes?:
|
|
744
|
+
readonly maxBytes?: ByteSize.ByteSize;
|
|
745
|
+
readonly maxFileBytes?: ByteSize.ByteSize;
|
|
746
|
+
readonly maxPathBytes?: ByteSize.ByteSize;
|
|
674
747
|
} | undefined) => Effect.Effect<OverlayVolume, ConfigurationError | ImageError, never>;
|
|
675
748
|
/**
|
|
676
749
|
* Schema for a complete fixture namespace with optional metadata and forward hard links.
|
|
@@ -804,8 +877,8 @@ export declare const fromFixture: (fixture: {
|
|
|
804
877
|
})[];
|
|
805
878
|
}, options?: {
|
|
806
879
|
readonly maxEntries?: number;
|
|
807
|
-
readonly maxBytes?:
|
|
808
|
-
readonly maxFileBytes?:
|
|
809
|
-
readonly maxPathBytes?:
|
|
880
|
+
readonly maxBytes?: ByteSize.ByteSize;
|
|
881
|
+
readonly maxFileBytes?: ByteSize.ByteSize;
|
|
882
|
+
readonly maxPathBytes?: ByteSize.ByteSize;
|
|
810
883
|
} | undefined) => Effect.Effect<Volume, ConfigurationError | ImageError, never>;
|
|
811
884
|
//# sourceMappingURL=VirtualFileSystem.d.ts.map
|