@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.
- package/README.md +39 -32
- package/dist/BytePath.d.ts +114 -4
- package/dist/BytePath.d.ts.map +1 -1
- package/dist/BytePath.js +155 -0
- package/dist/Caller.d.ts +391 -0
- package/dist/Caller.d.ts.map +1 -0
- package/dist/Caller.js +199 -0
- package/dist/FileHandle.d.ts +50 -0
- package/dist/FileHandle.d.ts.map +1 -0
- package/dist/FileHandle.js +28 -0
- package/dist/Fixture.d.ts +155 -0
- package/dist/Fixture.d.ts.map +1 -0
- package/dist/Fixture.js +65 -0
- package/dist/LiveVolume.d.ts +15 -22
- package/dist/LiveVolume.d.ts.map +1 -1
- package/dist/LiveVolume.js +19 -15
- package/dist/Metadata.d.ts +186 -0
- package/dist/Metadata.d.ts.map +1 -0
- package/dist/Metadata.js +125 -0
- package/dist/Snapshot.d.ts +31 -53
- package/dist/Snapshot.d.ts.map +1 -1
- package/dist/Snapshot.js +26 -49
- package/dist/SnapshotDelta.d.ts +24 -39
- package/dist/SnapshotDelta.d.ts.map +1 -1
- package/dist/SnapshotDelta.js +14 -35
- package/dist/Target.d.ts +225 -0
- package/dist/Target.d.ts.map +1 -0
- package/dist/Target.js +92 -0
- package/dist/Testing.d.ts +128 -0
- package/dist/Testing.d.ts.map +1 -0
- package/dist/Testing.js +111 -0
- package/dist/VfsError.d.ts +199 -0
- package/dist/VfsError.d.ts.map +1 -0
- package/dist/VfsError.js +164 -0
- package/dist/VirtualFileSystem.d.ts +628 -347
- package/dist/VirtualFileSystem.d.ts.map +1 -1
- package/dist/VirtualFileSystem.js +450 -117
- package/dist/Volume.d.ts +211 -0
- package/dist/Volume.d.ts.map +1 -0
- package/dist/Volume.js +172 -0
- package/dist/Watch.d.ts +68 -0
- package/dist/Watch.d.ts.map +1 -0
- package/dist/Watch.js +46 -0
- package/dist/index.d.ts +56 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -1
- package/dist/internal/budget.d.ts +90 -0
- package/dist/internal/budget.d.ts.map +1 -0
- package/dist/internal/budget.js +70 -0
- package/dist/internal/bytePath.d.ts +2 -0
- package/dist/internal/bytePath.d.ts.map +1 -1
- package/dist/internal/bytePath.js +3 -2
- package/dist/internal/bytes.d.ts +3 -0
- package/dist/internal/bytes.d.ts.map +1 -1
- package/dist/internal/bytes.js +4 -2
- package/dist/internal/canonicalBase64.d.ts +1 -4
- package/dist/internal/canonicalBase64.d.ts.map +1 -1
- package/dist/internal/canonicalBase64.js +9 -13
- package/dist/internal/errors.d.ts +54 -0
- package/dist/internal/errors.d.ts.map +1 -0
- package/dist/internal/errors.js +91 -0
- package/dist/internal/{virtualFileSystem/fixture.d.ts → fixture.d.ts} +8 -8
- package/dist/internal/fixture.d.ts.map +1 -0
- package/dist/internal/fixture.js +133 -0
- package/dist/internal/hex128.d.ts +12 -0
- package/dist/internal/hex128.d.ts.map +1 -0
- package/dist/internal/hex128.js +7 -0
- package/dist/internal/hmac.d.ts +5 -0
- package/dist/internal/hmac.d.ts.map +1 -0
- package/dist/internal/hmac.js +150 -0
- package/dist/internal/image.d.ts +14 -117
- package/dist/internal/image.d.ts.map +1 -1
- package/dist/internal/image.js +137 -167
- package/dist/internal/inodeTable.d.ts +20 -0
- package/dist/internal/inodeTable.d.ts.map +1 -0
- package/dist/internal/inodeTable.js +48 -0
- package/dist/internal/lines.d.ts +36 -0
- package/dist/internal/lines.d.ts.map +1 -0
- package/dist/internal/lines.js +115 -0
- package/dist/internal/liveImage.d.ts +19 -278
- package/dist/internal/liveImage.d.ts.map +1 -1
- package/dist/internal/liveImage.js +75 -166
- package/dist/internal/merkle.d.ts +45 -0
- package/dist/internal/merkle.d.ts.map +1 -0
- package/dist/internal/merkle.js +179 -0
- package/dist/internal/metadata.d.ts +2 -13
- package/dist/internal/metadata.d.ts.map +1 -1
- package/dist/internal/metadata.js +5 -15
- package/dist/internal/{virtualFileSystem/overlayDiff.d.ts → overlayDiff.d.ts} +3 -3
- package/dist/internal/overlayDiff.d.ts.map +1 -0
- package/dist/internal/{virtualFileSystem/overlayDiff.js → overlayDiff.js} +1 -4
- package/dist/internal/{virtualFileSystem/path.d.ts → path.d.ts} +19 -7
- package/dist/internal/path.d.ts.map +1 -0
- package/dist/internal/{virtualFileSystem/path.js → path.js} +39 -25
- package/dist/internal/snapshotDelta.d.ts +61 -60
- package/dist/internal/snapshotDelta.d.ts.map +1 -1
- package/dist/internal/snapshotDelta.js +612 -504
- package/dist/internal/snapshotDeltaModel.d.ts.map +1 -1
- package/dist/internal/snapshotDeltaModel.js +0 -1
- package/dist/internal/stagedState.d.ts +18 -0
- package/dist/internal/stagedState.d.ts.map +1 -0
- package/dist/internal/stagedState.js +18 -0
- package/dist/internal/testSeams.d.ts +17 -0
- package/dist/internal/testSeams.d.ts.map +1 -0
- package/dist/internal/testSeams.js +20 -0
- package/dist/internal/tree.d.ts +225 -0
- package/dist/internal/tree.d.ts.map +1 -0
- package/dist/internal/tree.js +385 -0
- package/dist/internal/turnstile.d.ts +8 -0
- package/dist/internal/turnstile.d.ts.map +1 -0
- package/dist/internal/turnstile.js +43 -0
- package/dist/internal/virtualFileSystem.d.ts +41 -491
- package/dist/internal/virtualFileSystem.d.ts.map +1 -1
- package/dist/internal/virtualFileSystem.js +2118 -2471
- package/dist/internal/volumeState.d.ts +110 -0
- package/dist/internal/volumeState.d.ts.map +1 -0
- package/dist/internal/volumeState.js +204 -0
- package/dist/internal/watchHub.d.ts +25 -0
- package/dist/internal/watchHub.d.ts.map +1 -0
- package/dist/internal/watchHub.js +68 -0
- package/package.json +53 -9
- package/dist/VirtualFileSystemError.d.ts +0 -54
- package/dist/VirtualFileSystemError.d.ts.map +0 -1
- package/dist/VirtualFileSystemError.js +0 -49
- package/dist/internal/virtualFileSystem/errors.d.ts +0 -12
- package/dist/internal/virtualFileSystem/errors.d.ts.map +0 -1
- package/dist/internal/virtualFileSystem/errors.js +0 -47
- package/dist/internal/virtualFileSystem/fixture.d.ts.map +0 -1
- package/dist/internal/virtualFileSystem/fixture.js +0 -150
- package/dist/internal/virtualFileSystem/overlayContent.d.ts +0 -15
- package/dist/internal/virtualFileSystem/overlayContent.d.ts.map +0 -1
- package/dist/internal/virtualFileSystem/overlayContent.js +0 -29
- package/dist/internal/virtualFileSystem/overlayDiff.d.ts.map +0 -1
- package/dist/internal/virtualFileSystem/path.d.ts.map +0 -1
- package/dist/internal/virtualFileSystem/stagedState.d.ts +0 -22
- package/dist/internal/virtualFileSystem/stagedState.d.ts.map +0 -1
- package/dist/internal/virtualFileSystem/stagedState.js +0 -62
- package/dist/internal/virtualFileSystem/testHooks.d.ts +0 -20
- package/dist/internal/virtualFileSystem/testHooks.d.ts.map +0 -1
- package/dist/internal/virtualFileSystem/testHooks.js +0 -23
- package/dist/internal/virtualFileSystem/watchHub.d.ts +0 -16
- package/dist/internal/virtualFileSystem/watchHub.d.ts.map +0 -1
- package/dist/internal/virtualFileSystem/watchHub.js +0 -54
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotDeltaModel.d.ts","sourceRoot":"","sources":["../../src/internal/snapshotDeltaModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snapshotDeltaModel.d.ts","sourceRoot":"","sources":["../../src/internal/snapshotDeltaModel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,gBAAgB;AAChB,eAAO,MAAM,mBAAmB,EAAG,gCAAyC,CAAA;AAI5E,gBAAgB;AAChB,eAAO,MAAM,IAAI,UAAW,OAAO,KAAG,aAKrC,CAAA;AAED,gBAAgB;AAChB,eAAO,MAAM,KAAK,UAAW,aAAa,KAAG,OAAO,GAAG,SAAsC,CAAA;AAE7F,gBAAgB;AAChB,eAAO,MAAM,eAAe,UAAW,OAAO,KAAG,KAAK,IAAI,aACF,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import type { FsFailure } from "../VfsError.js";
|
|
3
|
+
type CommitOutcome = "committed" | "rejected" | "unknown";
|
|
4
|
+
/** @internal */
|
|
5
|
+
export interface CommitProvider<State> {
|
|
6
|
+
/** Preparation failures leave the volume available. */
|
|
7
|
+
readonly prepare?: (candidate: State) => Effect.Effect<void, FsFailure>;
|
|
8
|
+
readonly commit: (candidate: State) => Effect.Effect<CommitOutcome>;
|
|
9
|
+
}
|
|
10
|
+
/** @internal */
|
|
11
|
+
export interface Classified {
|
|
12
|
+
readonly available: boolean;
|
|
13
|
+
readonly failure: FsFailure | undefined;
|
|
14
|
+
}
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const offerCommit: <State>(provider: CommitProvider<State>, operation: string, candidate: State, cleanup: boolean) => Effect.Effect<Classified>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=stagedState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stagedState.d.ts","sourceRoot":"","sources":["../../src/internal/stagedState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG/C,KAAK,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAA;AAEzD,gBAAgB;AAChB,MAAM,WAAW,cAAc,CAAC,KAAK;IACnC,uDAAuD;IACvD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;IACvE,QAAQ,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;CACpE;AAED,gBAAgB;AAChB,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAA;CACxC;AAGD,gBAAgB;AAChB,eAAO,MAAM,WAAW,GAAI,KAAK,YACrB,cAAc,CAAC,KAAK,CAAC,aACpB,MAAM,aACN,KAAK,WACP,OAAO,KACf,MAAM,CAAC,MAAM,CAAC,UAAU,CAgBvB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Exit from "effect/Exit";
|
|
3
|
+
import { fsFailure } from "./errors.js";
|
|
4
|
+
// An unknown commit outcome stops the volume; definite rejection stops it only during cleanup.
|
|
5
|
+
/** @internal */
|
|
6
|
+
export const offerCommit = (provider, operation, candidate, cleanup) => Effect.map(Effect.exit(Effect.suspend(() => provider.commit(candidate))), (committed) => {
|
|
7
|
+
// TODO(#186): Preserve the cause of a provider defect or interruption.
|
|
8
|
+
if (Exit.isFailure(committed)) {
|
|
9
|
+
return { available: false, failure: fsFailure("OutcomeUnknown", operation) };
|
|
10
|
+
}
|
|
11
|
+
if (committed.value === "rejected") {
|
|
12
|
+
return { available: !cleanup, failure: fsFailure("StorageRejected", operation) };
|
|
13
|
+
}
|
|
14
|
+
if (committed.value === "unknown") {
|
|
15
|
+
return { available: false, failure: fsFailure("OutcomeUnknown", operation) };
|
|
16
|
+
}
|
|
17
|
+
return { available: true, failure: undefined };
|
|
18
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export interface VolumeTestSeams {
|
|
5
|
+
readonly afterSubscribe: Effect.Effect<void>;
|
|
6
|
+
readonly betweenSnapshotAndSummary: Effect.Effect<void>;
|
|
7
|
+
readonly beforeTreeRemoval: Effect.Effect<void>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Read in the caller's fiber, so a test supplies it with `withVolumeTestSeams` on the call under test.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const VolumeTestSeams: Context.Reference<VolumeTestSeams>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const withVolumeTestSeams: (seams: Partial<VolumeTestSeams>) => <XA, E, R>(self: Effect.Effect<XA, E, R>) => Effect.Effect<XA, E, R>;
|
|
17
|
+
//# sourceMappingURL=testSeams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testSeams.d.ts","sourceRoot":"","sources":["../../src/internal/testSeams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,gBAAgB;AAChB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC5C,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAEvD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CAChD;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,SAAS,CAAC,eAAe,CAS9D,CAAA;AAED,gBAAgB;AAChB,eAAO,MAAM,mBAAmB,UAAW,OAAO,CAAC,eAAe,CAAC,yEAK9D,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
/**
|
|
4
|
+
* Read in the caller's fiber, so a test supplies it with `withVolumeTestSeams` on the call under test.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export const VolumeTestSeams = Context.Reference("@effect-vfs/core/VolumeTestSeams", {
|
|
9
|
+
defaultValue: () => ({
|
|
10
|
+
afterSubscribe: Effect.void,
|
|
11
|
+
betweenSnapshotAndSummary: Effect.void,
|
|
12
|
+
beforeTreeRemoval: Effect.void
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const withVolumeTestSeams = (seams) => Effect.updateService(VolumeTestSeams, (current) => ({
|
|
17
|
+
afterSubscribe: seams.afterSubscribe ?? current.afterSubscribe,
|
|
18
|
+
betweenSnapshotAndSummary: seams.betweenSnapshotAndSummary ?? current.betweenSnapshotAndSummary,
|
|
19
|
+
beforeTreeRemoval: seams.beforeTreeRemoval ?? current.beforeTreeRemoval
|
|
20
|
+
}));
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Result from "effect/Result";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import * as Stream from "effect/Stream";
|
|
5
|
+
import type { ImageFailure } from "../VfsError.js";
|
|
6
|
+
import type { Budget } from "./budget.js";
|
|
7
|
+
import { type FrameMeter, type LineFold } from "./lines.js";
|
|
8
|
+
import { type Node, type NodeSpec, type VolumeState } from "./volumeState.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare const TreeNode: Schema.TaggedUnion<{
|
|
11
|
+
readonly directory: Schema.TaggedStruct<"directory", {
|
|
12
|
+
ino: Schema.Int;
|
|
13
|
+
parent: Schema.Int;
|
|
14
|
+
name: Schema.brand<Schema.refine<string, Schema.String>, "CanonicalBase64">;
|
|
15
|
+
metadata: Schema.Struct<{
|
|
16
|
+
readonly uid: Schema.Natural;
|
|
17
|
+
readonly gid: Schema.Natural;
|
|
18
|
+
readonly mode: Schema.Natural;
|
|
19
|
+
readonly atimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
20
|
+
readonly mtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
21
|
+
readonly ctimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
22
|
+
readonly birthtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
23
|
+
}>;
|
|
24
|
+
}>;
|
|
25
|
+
readonly file: Schema.TaggedStruct<"file", {
|
|
26
|
+
ino: Schema.Int;
|
|
27
|
+
links: Schema.$Array<Schema.Struct<{
|
|
28
|
+
readonly parent: Schema.Int;
|
|
29
|
+
readonly name: Schema.brand<Schema.refine<string, Schema.String>, "CanonicalBase64">;
|
|
30
|
+
}>>;
|
|
31
|
+
content: Schema.TaggedUnion<{
|
|
32
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
33
|
+
readonly bytes: Schema.brand<Schema.refine<string, Schema.String>, "CanonicalBase64">;
|
|
34
|
+
}>;
|
|
35
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
36
|
+
readonly hash: Schema.String;
|
|
37
|
+
readonly size: Schema.Natural;
|
|
38
|
+
}>;
|
|
39
|
+
}>;
|
|
40
|
+
metadata: Schema.Struct<{
|
|
41
|
+
readonly uid: Schema.Natural;
|
|
42
|
+
readonly gid: Schema.Natural;
|
|
43
|
+
readonly mode: Schema.Natural;
|
|
44
|
+
readonly atimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
45
|
+
readonly mtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
46
|
+
readonly ctimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
47
|
+
readonly birthtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
48
|
+
}>;
|
|
49
|
+
}>;
|
|
50
|
+
readonly symlink: Schema.TaggedStruct<"symlink", {
|
|
51
|
+
ino: Schema.Int;
|
|
52
|
+
links: Schema.$Array<Schema.Struct<{
|
|
53
|
+
readonly parent: Schema.Int;
|
|
54
|
+
readonly name: Schema.brand<Schema.refine<string, Schema.String>, "CanonicalBase64">;
|
|
55
|
+
}>>;
|
|
56
|
+
target: Schema.brand<Schema.refine<string, Schema.String>, "CanonicalBase64">;
|
|
57
|
+
metadata: Schema.Struct<{
|
|
58
|
+
readonly uid: Schema.Natural;
|
|
59
|
+
readonly gid: Schema.Natural;
|
|
60
|
+
readonly mode: Schema.Natural;
|
|
61
|
+
readonly atimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
62
|
+
readonly mtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
63
|
+
readonly ctimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
64
|
+
readonly birthtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
65
|
+
}>;
|
|
66
|
+
}>;
|
|
67
|
+
}>;
|
|
68
|
+
/** @internal */
|
|
69
|
+
export type TreeNode = typeof TreeNode.Type;
|
|
70
|
+
/** @internal */
|
|
71
|
+
export declare const LiveTreeNode: Schema.TaggedUnion<{
|
|
72
|
+
readonly directory: Schema.TaggedStruct<"directory", {
|
|
73
|
+
readonly ino: Schema.Int;
|
|
74
|
+
readonly parent: Schema.Int;
|
|
75
|
+
readonly name: Schema.brand<Schema.refine<string, Schema.String>, "CanonicalBase64">;
|
|
76
|
+
readonly metadata: Schema.Struct<{
|
|
77
|
+
readonly uid: Schema.Natural;
|
|
78
|
+
readonly gid: Schema.Natural;
|
|
79
|
+
readonly mode: Schema.Natural;
|
|
80
|
+
readonly atimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
81
|
+
readonly mtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
82
|
+
readonly ctimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
83
|
+
readonly birthtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
84
|
+
}>;
|
|
85
|
+
readonly rev: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
86
|
+
}>;
|
|
87
|
+
readonly file: Schema.TaggedStruct<"file", {
|
|
88
|
+
readonly ino: Schema.Int;
|
|
89
|
+
readonly links: Schema.$Array<Schema.Struct<{
|
|
90
|
+
readonly parent: Schema.Int;
|
|
91
|
+
readonly name: Schema.brand<Schema.refine<string, Schema.String>, "CanonicalBase64">;
|
|
92
|
+
}>>;
|
|
93
|
+
readonly content: Schema.TaggedUnion<{
|
|
94
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
95
|
+
readonly bytes: Schema.brand<Schema.refine<string, Schema.String>, "CanonicalBase64">;
|
|
96
|
+
}>;
|
|
97
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
98
|
+
readonly hash: Schema.String;
|
|
99
|
+
readonly size: Schema.Natural;
|
|
100
|
+
}>;
|
|
101
|
+
}>;
|
|
102
|
+
readonly metadata: Schema.Struct<{
|
|
103
|
+
readonly uid: Schema.Natural;
|
|
104
|
+
readonly gid: Schema.Natural;
|
|
105
|
+
readonly mode: Schema.Natural;
|
|
106
|
+
readonly atimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
107
|
+
readonly mtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
108
|
+
readonly ctimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
109
|
+
readonly birthtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
110
|
+
}>;
|
|
111
|
+
readonly rev: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
112
|
+
}>;
|
|
113
|
+
readonly symlink: Schema.TaggedStruct<"symlink", {
|
|
114
|
+
readonly ino: Schema.Int;
|
|
115
|
+
readonly links: Schema.$Array<Schema.Struct<{
|
|
116
|
+
readonly parent: Schema.Int;
|
|
117
|
+
readonly name: Schema.brand<Schema.refine<string, Schema.String>, "CanonicalBase64">;
|
|
118
|
+
}>>;
|
|
119
|
+
readonly target: Schema.brand<Schema.refine<string, Schema.String>, "CanonicalBase64">;
|
|
120
|
+
readonly metadata: Schema.Struct<{
|
|
121
|
+
readonly uid: Schema.Natural;
|
|
122
|
+
readonly gid: Schema.Natural;
|
|
123
|
+
readonly mode: Schema.Natural;
|
|
124
|
+
readonly atimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
125
|
+
readonly mtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
126
|
+
readonly ctimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
127
|
+
readonly birthtimeNs: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
128
|
+
}>;
|
|
129
|
+
readonly rev: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
130
|
+
}>;
|
|
131
|
+
}>;
|
|
132
|
+
/** @internal */
|
|
133
|
+
export type LiveTreeNode = typeof LiveTreeNode.Type;
|
|
134
|
+
/** @internal */
|
|
135
|
+
export declare const SnapshotHeader: Schema.Struct<{
|
|
136
|
+
readonly format: Schema.Literal<"effect-vfs">;
|
|
137
|
+
readonly version: Schema.Literal<1>;
|
|
138
|
+
}>;
|
|
139
|
+
declare const Runtime: Schema.Struct<{
|
|
140
|
+
readonly identity: Schema.brand<Schema.String, "@effect-vfs/core/VolumeIdentity">;
|
|
141
|
+
readonly epoch: Schema.brand<Schema.String, "@effect-vfs/core/VolumeEpoch">;
|
|
142
|
+
readonly keySecret: Schema.brand<Schema.String, "@effect-vfs/core/KeySecret">;
|
|
143
|
+
readonly nextInode: Schema.Int;
|
|
144
|
+
readonly revision: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
145
|
+
readonly limits: Schema.Struct<{
|
|
146
|
+
readonly maxEntries: Schema.optionalKey<Schema.Natural>;
|
|
147
|
+
readonly maxBytes: Schema.optionalKey<Schema.decodeTo<Schema.BigInt, Schema.String, never, never>>;
|
|
148
|
+
readonly maxFileBytes: Schema.optionalKey<Schema.decodeTo<Schema.BigInt, Schema.String, never, never>>;
|
|
149
|
+
readonly maxPathBytes: Schema.optionalKey<Schema.decodeTo<Schema.BigInt, Schema.String, never, never>>;
|
|
150
|
+
}>;
|
|
151
|
+
readonly usage: Schema.Struct<{
|
|
152
|
+
readonly entries: Schema.Natural;
|
|
153
|
+
readonly usedBytes: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
154
|
+
}>;
|
|
155
|
+
}>;
|
|
156
|
+
/** @internal */
|
|
157
|
+
export type Runtime = typeof Runtime.Type;
|
|
158
|
+
/** @internal */
|
|
159
|
+
export declare const LiveHeader: Schema.Struct<{
|
|
160
|
+
readonly format: Schema.Literal<"effect-vfs-live">;
|
|
161
|
+
readonly version: Schema.Literal<1>;
|
|
162
|
+
readonly runtime: Schema.Struct<{
|
|
163
|
+
readonly identity: Schema.brand<Schema.String, "@effect-vfs/core/VolumeIdentity">;
|
|
164
|
+
readonly epoch: Schema.brand<Schema.String, "@effect-vfs/core/VolumeEpoch">;
|
|
165
|
+
readonly keySecret: Schema.brand<Schema.String, "@effect-vfs/core/KeySecret">;
|
|
166
|
+
readonly nextInode: Schema.Int;
|
|
167
|
+
readonly revision: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
168
|
+
readonly limits: Schema.Struct<{
|
|
169
|
+
readonly maxEntries: Schema.optionalKey<Schema.Natural>;
|
|
170
|
+
readonly maxBytes: Schema.optionalKey<Schema.decodeTo<Schema.BigInt, Schema.String, never, never>>;
|
|
171
|
+
readonly maxFileBytes: Schema.optionalKey<Schema.decodeTo<Schema.BigInt, Schema.String, never, never>>;
|
|
172
|
+
readonly maxPathBytes: Schema.optionalKey<Schema.decodeTo<Schema.BigInt, Schema.String, never, never>>;
|
|
173
|
+
}>;
|
|
174
|
+
readonly usage: Schema.Struct<{
|
|
175
|
+
readonly entries: Schema.Natural;
|
|
176
|
+
readonly usedBytes: Schema.decodeTo<Schema.BigInt, Schema.String, never, never>;
|
|
177
|
+
}>;
|
|
178
|
+
}>;
|
|
179
|
+
}>;
|
|
180
|
+
/** @internal */
|
|
181
|
+
export interface Meter extends FrameMeter {
|
|
182
|
+
readonly node: (node: TreeNode) => Result.Result<void, ImageFailure>;
|
|
183
|
+
}
|
|
184
|
+
/** @internal */
|
|
185
|
+
export declare const meter: (budget: Budget, operation: string) => Meter;
|
|
186
|
+
/** @internal */
|
|
187
|
+
export interface ReaderOptions {
|
|
188
|
+
readonly operation: string;
|
|
189
|
+
readonly documentField: string;
|
|
190
|
+
readonly meter?: Meter;
|
|
191
|
+
}
|
|
192
|
+
/** @internal */
|
|
193
|
+
export interface Read<H> {
|
|
194
|
+
readonly header: H;
|
|
195
|
+
readonly specs: ReadonlyArray<NodeSpec>;
|
|
196
|
+
}
|
|
197
|
+
/** @internal */
|
|
198
|
+
export declare const snapshotReader: (options: ReaderOptions) => LineFold<Read<typeof SnapshotHeader.Type>>;
|
|
199
|
+
/** @internal */
|
|
200
|
+
export declare const liveReader: (options: ReaderOptions) => LineFold<Read<typeof LiveHeader.Type>>;
|
|
201
|
+
/** @internal */
|
|
202
|
+
export declare const UNCHECKED: {
|
|
203
|
+
disableChecks: boolean;
|
|
204
|
+
};
|
|
205
|
+
/** @internal */
|
|
206
|
+
export declare const treeNode: (node: Node) => TreeNode;
|
|
207
|
+
/** @internal */
|
|
208
|
+
export declare const treeNodes: (value: VolumeState, extra?: readonly Node[] | undefined) => Effect.Effect<Node[], never, never>;
|
|
209
|
+
/** @internal */
|
|
210
|
+
export interface Writer<N extends TreeNode> {
|
|
211
|
+
readonly operation: string;
|
|
212
|
+
readonly documentField: string;
|
|
213
|
+
readonly header: string;
|
|
214
|
+
readonly node: (node: Node) => N;
|
|
215
|
+
readonly text: (node: N) => Result.Result<string, Schema.SchemaError>;
|
|
216
|
+
readonly meter: Meter | undefined;
|
|
217
|
+
}
|
|
218
|
+
/** @internal */
|
|
219
|
+
export declare const ENCODED_CHUNK_BYTES: number;
|
|
220
|
+
/** @internal */
|
|
221
|
+
export declare const encodeFailure: (operation: string, field: string, cause: unknown) => ImageFailure;
|
|
222
|
+
/** @internal */
|
|
223
|
+
export declare const writeTree: <N extends TreeNode>(writer: Writer<N>, nodes: ReadonlyArray<Node>) => Stream.Stream<Uint8Array, ImageFailure>;
|
|
224
|
+
export {};
|
|
225
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/internal/tree.ts"],"names":[],"mappings":"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"}
|