@effect-vfs/core 0.6.0 → 0.7.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.
@@ -57,6 +57,7 @@ export type PathInput = string | BytePath;
57
57
  *
58
58
  * @example
59
59
  * ```ts
60
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
60
61
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
61
62
  * import { Effect, Schema } from "effect"
62
63
  *
@@ -75,7 +76,7 @@ export type PathInput = string | BytePath;
75
76
  * return [known, unknown]
76
77
  * })
77
78
  *
78
- * Effect.runPromise(program).then(console.log)
79
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
79
80
  * // [ 'NotFound', 'not a code' ]
80
81
  * ```
81
82
  *
@@ -99,6 +100,7 @@ export type FsCode = typeof FsCode.Type;
99
100
  *
100
101
  * @example
101
102
  * ```ts
103
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
102
104
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
103
105
  * import { Effect } from "effect"
104
106
  *
@@ -115,7 +117,7 @@ export type FsCode = typeof FsCode.Type;
115
117
  * )
116
118
  * })
117
119
  *
118
- * Effect.runPromise(program).then(console.log)
120
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
119
121
  * // Uint8Array(0) []
120
122
  * ```
121
123
  *
@@ -127,6 +129,7 @@ export type FsCode = typeof FsCode.Type;
127
129
  *
128
130
  * @example
129
131
  * ```ts
132
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
130
133
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
131
134
  * import { Effect } from "effect"
132
135
  *
@@ -141,7 +144,7 @@ export type FsCode = typeof FsCode.Type;
141
144
  * )
142
145
  * })
143
146
  *
144
- * Effect.runPromise(program).then(console.log)
147
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
145
148
  * // rejected maxEntries
146
149
  * ```
147
150
  *
@@ -168,6 +171,7 @@ export type Identity = typeof Identity.Type;
168
171
  *
169
172
  * @example
170
173
  * ```ts
174
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
171
175
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
172
176
  * import { Effect } from "effect"
173
177
  *
@@ -189,7 +193,7 @@ export type Identity = typeof Identity.Type;
189
193
  * return ((yield* user.stat("/home/user")).mode & 0o777).toString(8)
190
194
  * })
191
195
  *
192
- * Effect.runPromise(program).then(console.log)
196
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
193
197
  * // 755
194
198
  * ```
195
199
  *
@@ -267,6 +271,7 @@ export type VolumeIncarnation = typeof VolumeIncarnation.Type;
267
271
  *
268
272
  * @example
269
273
  * ```ts
274
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
270
275
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
271
276
  * import { Effect, Schema } from "effect"
272
277
  *
@@ -285,7 +290,7 @@ export type VolumeIncarnation = typeof VolumeIncarnation.Type;
285
290
  * return (yield* volume.resolveReferenceKey(key)) === reference
286
291
  * })
287
292
  *
288
- * Effect.runPromise(program).then(console.log)
293
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
289
294
  * // true
290
295
  * ```
291
296
  *
@@ -305,6 +310,7 @@ export type ReferenceKey = typeof ReferenceKey.Type;
305
310
  *
306
311
  * @example
307
312
  * ```ts
313
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
308
314
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
309
315
  * import { ByteSize, Effect } from "effect"
310
316
  *
@@ -322,7 +328,7 @@ export type ReferenceKey = typeof ReferenceKey.Type;
322
328
  * )
323
329
  * })
324
330
  *
325
- * Effect.runPromise(program).then(console.log)
331
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
326
332
  * // FileTooLarge
327
333
  * ```
328
334
  *
@@ -371,6 +377,7 @@ export interface VolumeUsage {
371
377
  *
372
378
  * @example
373
379
  * ```ts
380
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
374
381
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
375
382
  * import { Effect } from "effect"
376
383
  *
@@ -388,7 +395,7 @@ export interface VolumeUsage {
388
395
  * return [metadata.kind, metadata.size, metadata.nlink]
389
396
  * })
390
397
  *
391
- * Effect.runPromise(program).then(console.log)
398
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
392
399
  * // [ 'file', 3n, 1 ]
393
400
  * ```
394
401
  *
@@ -417,6 +424,7 @@ export interface ObjectReference {
417
424
  *
418
425
  * @example
419
426
  * ```ts
427
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
420
428
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
421
429
  * import { Effect } from "effect"
422
430
  *
@@ -439,7 +447,7 @@ export interface ObjectReference {
439
447
  * return [before.kind, after.kind, after.revision > before.revision]
440
448
  * })
441
449
  *
442
- * Effect.runPromise(program).then(console.log)
450
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
443
451
  * // [ 'directory', 'directory', true ]
444
452
  * ```
445
453
  *
@@ -571,6 +579,7 @@ export declare const TimeUpdate: typeof MetadataModule.TimeUpdate;
571
579
  *
572
580
  * @example
573
581
  * ```ts
582
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
574
583
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
575
584
  * import { Effect } from "effect"
576
585
  *
@@ -593,7 +602,7 @@ export declare const TimeUpdate: typeof MetadataModule.TimeUpdate;
593
602
  * return [metadata.atimeNs, metadata.mtimeNs === 1_000n]
594
603
  * })
595
604
  *
596
- * Effect.runPromise(program).then(console.log)
605
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
597
606
  * // [ 1000n, false ]
598
607
  * ```
599
608
  *
@@ -613,6 +622,7 @@ export type Times = typeof Times.Type;
613
622
  *
614
623
  * @example
615
624
  * ```ts
625
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
616
626
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
617
627
  * import { Effect } from "effect"
618
628
  *
@@ -634,7 +644,7 @@ export type Times = typeof Times.Type;
634
644
  * return (yield* caller.readDirectory("/renamed")).value.map((entry) => new TextDecoder().decode(entry.name))
635
645
  * }).pipe(Effect.scoped)
636
646
  *
637
- * Effect.runPromise(program).then(console.log)
647
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
638
648
  * // [ 'notes.txt' ]
639
649
  * ```
640
650
  *
@@ -665,6 +675,7 @@ export type SeekMode = typeof SeekMode.Type;
665
675
  *
666
676
  * @example
667
677
  * ```ts
678
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
668
679
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
669
680
  * import { Effect } from "effect"
670
681
  *
@@ -683,7 +694,7 @@ export type SeekMode = typeof SeekMode.Type;
683
694
  * return (yield* handle.stat).size
684
695
  * }).pipe(Effect.scoped)
685
696
  *
686
- * Effect.runPromise(program).then(console.log)
697
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
687
698
  * // 2n
688
699
  * ```
689
700
  *
@@ -801,6 +812,7 @@ export interface OpenEntryResult {
801
812
  *
802
813
  * @example
803
814
  * ```ts
815
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
804
816
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
805
817
  * import { Effect } from "effect"
806
818
  *
@@ -829,7 +841,7 @@ export interface OpenEntryResult {
829
841
  * return [refused, new TextDecoder().decode(yield* caller.readFile("/app.conf"))]
830
842
  * })
831
843
  *
832
- * Effect.runPromise(program).then(console.log)
844
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
833
845
  * // [ 'AlreadyExists', 'v2' ]
834
846
  * ```
835
847
  *
@@ -859,6 +871,7 @@ export interface ReadResult {
859
871
  *
860
872
  * @example
861
873
  * ```ts
874
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
862
875
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
863
876
  * import { Effect } from "effect"
864
877
  *
@@ -878,7 +891,7 @@ export interface ReadResult {
878
891
  * return [slice.bytes, slice.eof, yield* handle.seek(0n, "current")]
879
892
  * }).pipe(Effect.scoped)
880
893
  *
881
- * Effect.runPromise(program).then(console.log)
894
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
882
895
  * // [ Uint8Array(2) [ 2, 3 ], false, 4n ]
883
896
  * ```
884
897
  *
@@ -911,6 +924,7 @@ export interface FileHandle {
911
924
  *
912
925
  * @example
913
926
  * ```ts
927
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
914
928
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
915
929
  * import { Effect } from "effect"
916
930
  *
@@ -929,12 +943,13 @@ export interface FileHandle {
929
943
  * return (yield* caller.readDirectory("/work")).value.map((entry) => new TextDecoder().decode(entry.name))
930
944
  * })
931
945
  *
932
- * Effect.runPromise(program).then(console.log)
946
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
933
947
  * // [ 'notes.txt' ]
934
948
  * ```
935
949
  *
936
950
  * @example
937
951
  * ```ts
952
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
938
953
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
939
954
  * import { Effect } from "effect"
940
955
  *
@@ -955,12 +970,13 @@ export interface FileHandle {
955
970
  * return new TextDecoder().decode(yield* handle.read(64))
956
971
  * }).pipe(Effect.scoped)
957
972
  *
958
- * Effect.runPromise(program).then(console.log)
973
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
959
974
  * // first second
960
975
  * ```
961
976
  *
962
977
  * @example
963
978
  * ```ts
979
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
964
980
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
965
981
  * import { Effect } from "effect"
966
982
  *
@@ -982,7 +998,7 @@ export interface FileHandle {
982
998
  * return (yield* caller.readDirectory("/dist")).value.map((entry) => new TextDecoder().decode(entry.name))
983
999
  * }).pipe(Effect.scoped)
984
1000
  *
985
- * Effect.runPromise(program).then(console.log)
1001
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
986
1002
  * // [ 'out.txt' ]
987
1003
  * ```
988
1004
  *
@@ -1091,6 +1107,7 @@ export interface Caller {
1091
1107
  *
1092
1108
  * @example
1093
1109
  * ```ts
1110
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1094
1111
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1095
1112
  * import { Effect, Fiber, Stream } from "effect"
1096
1113
  *
@@ -1116,7 +1133,7 @@ export interface Caller {
1116
1133
  * ))
1117
1134
  * }).pipe(Effect.scoped)
1118
1135
  *
1119
- * Effect.runPromise(program).then(console.log)
1136
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1120
1137
  * // [ 'Create /logs', 'Remove /logs' ]
1121
1138
  * ```
1122
1139
  *
@@ -1139,6 +1156,7 @@ export type Change = typeof Change.Type;
1139
1156
  *
1140
1157
  * @example
1141
1158
  * ```ts
1159
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1142
1160
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1143
1161
  * import { Effect, Fiber, Stream } from "effect"
1144
1162
  *
@@ -1168,7 +1186,7 @@ export type Change = typeof Change.Type;
1168
1186
  * ))
1169
1187
  * }).pipe(Effect.scoped)
1170
1188
  *
1171
- * Effect.runPromise(program).then(console.log)
1189
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1172
1190
  * // [ 'Remove /work', 'Create /renamed', 'Create /renamed/out' ]
1173
1191
  * ```
1174
1192
  *
@@ -1235,6 +1253,7 @@ export type OverlayChange = typeof OverlayChange.Type;
1235
1253
  *
1236
1254
  * @example
1237
1255
  * ```ts
1256
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1238
1257
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1239
1258
  * import { Effect } from "effect"
1240
1259
  *
@@ -1251,7 +1270,7 @@ export type OverlayChange = typeof OverlayChange.Type;
1251
1270
  * return [plain.length, timed.length]
1252
1271
  * })
1253
1272
  *
1254
- * Effect.runPromise(program).then(console.log)
1273
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1255
1274
  * // [ 1, 2 ]
1256
1275
  * ```
1257
1276
  *
@@ -1271,6 +1290,7 @@ export type OverlayChangesOptions = typeof OverlayChangesOptions.Type;
1271
1290
  *
1272
1291
  * @example
1273
1292
  * ```ts
1293
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1274
1294
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1275
1295
  * import { Effect } from "effect"
1276
1296
  *
@@ -1295,7 +1315,7 @@ export type OverlayChangesOptions = typeof OverlayChangesOptions.Type;
1295
1315
  * ]
1296
1316
  * })
1297
1317
  *
1298
- * Effect.runPromise(program).then(console.log)
1318
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1299
1319
  * // [ [ 'Added' ], 'built' ]
1300
1320
  * ```
1301
1321
  *
@@ -1313,6 +1333,7 @@ export interface OverlayCapture {
1313
1333
  *
1314
1334
  * @example
1315
1335
  * ```ts
1336
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1316
1337
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1317
1338
  * import { Effect, Fiber, Option, Stream } from "effect"
1318
1339
  *
@@ -1333,7 +1354,7 @@ export interface OverlayCapture {
1333
1354
  * return Option.getOrElse(Option.map(change, (event) => event._tag), () => "none")
1334
1355
  * }).pipe(Effect.scoped)
1335
1356
  *
1336
- * Effect.runPromise(program).then(console.log)
1357
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1337
1358
  * // Create
1338
1359
  * ```
1339
1360
  *
@@ -1381,6 +1402,7 @@ export interface Volume {
1381
1402
  *
1382
1403
  * @example
1383
1404
  * ```ts
1405
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1384
1406
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1385
1407
  * import { Effect } from "effect"
1386
1408
  *
@@ -1399,7 +1421,7 @@ export interface Volume {
1399
1421
  * return captured.changes.map((change) => change._tag)
1400
1422
  * })
1401
1423
  *
1402
- * Effect.runPromise(program).then(console.log)
1424
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1403
1425
  * // [ 'Added' ]
1404
1426
  * ```
1405
1427
  *
@@ -1419,6 +1441,7 @@ export interface OverlayVolume extends Volume {
1419
1441
  *
1420
1442
  * @example
1421
1443
  * ```ts
1444
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1422
1445
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1423
1446
  * import { Effect } from "effect"
1424
1447
  *
@@ -1429,7 +1452,7 @@ export interface OverlayVolume extends Volume {
1429
1452
  * return (yield* fs.readDirectory("/")).value.map((entry) => new TextDecoder().decode(entry.name))
1430
1453
  * })
1431
1454
  *
1432
- * Effect.runPromise(program.pipe(Effect.provide(Vfs.Caller.layer()), Effect.provide(Vfs.Volume.layer())))
1455
+ * Effect.runPromise(program.pipe(Effect.provide(Vfs.Caller.layer()), Effect.provide(Vfs.Volume.layer()), Effect.provide(BunCrypto.layer)))
1433
1456
  * .then(console.log)
1434
1457
  * // [ 'work' ]
1435
1458
  * ```
@@ -1439,15 +1462,15 @@ export interface OverlayVolume extends Volume {
1439
1462
  */
1440
1463
  export declare const Volume: Context.Service<Volume, Volume> & {
1441
1464
  /** A fresh empty volume. */
1442
- readonly layer: (options?: VolumeOptions) => Layer.Layer<Volume, VfsError>;
1465
+ readonly layer: (options?: VolumeOptions) => Layer.Layer<Volume, VfsError, Crypto.Crypto>;
1443
1466
  /** A fresh volume restored from a snapshot. */
1444
- readonly layerFromSnapshot: (snapshot: Snapshot, options?: VolumeOptions) => Layer.Layer<Volume, VfsError>;
1467
+ readonly layerFromSnapshot: (snapshot: Snapshot, options?: VolumeOptions) => Layer.Layer<Volume, VfsError, Crypto.Crypto>;
1445
1468
  /** A fresh volume built from a fixture. */
1446
- readonly layerFromFixture: (fixture: Fixture, options?: VolumeOptions) => Layer.Layer<Volume, VfsError>;
1469
+ readonly layerFromFixture: (fixture: Fixture, options?: VolumeOptions) => Layer.Layer<Volume, VfsError, Crypto.Crypto>;
1447
1470
  /** A writable overlay over a snapshot base. */
1448
- readonly layerOverlay: (base: Snapshot, options?: VolumeOptions) => Layer.Layer<Volume, VfsError>;
1471
+ readonly layerOverlay: (base: Snapshot, options?: VolumeOptions) => Layer.Layer<Volume, VfsError, Crypto.Crypto>;
1449
1472
  /** A durable volume opened through the `LiveImageStore` in context; it shuts down with the layer's scope. */
1450
- readonly layerLive: (options: LiveVolumeOptions) => Layer.Layer<Volume, VfsError, LiveImageStore>;
1473
+ readonly layerLive: (options: LiveVolumeOptions) => Layer.Layer<Volume, VfsError, LiveImageStore | Crypto.Crypto>;
1451
1474
  };
1452
1475
  /**
1453
1476
  * The caller an application operates through, as an Effect service. A caller
@@ -1480,6 +1503,7 @@ export declare const Caller: Context.Service<Caller, Caller> & {
1480
1503
  *
1481
1504
  * @example
1482
1505
  * ```ts
1506
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1483
1507
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1484
1508
  * import { Effect, Stream } from "effect"
1485
1509
  *
@@ -1497,7 +1521,7 @@ export declare const Caller: Context.Service<Caller, Caller> & {
1497
1521
  * return text.split("\n").map((line) => (line === "" ? "end" : JSON.parse(line)._tag ?? "header"))
1498
1522
  * })
1499
1523
  *
1500
- * Effect.runPromise(program).then(console.log)
1524
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1501
1525
  * // [ 'header', 'directory', 'file', 'end' ]
1502
1526
  * ```
1503
1527
  *
@@ -1519,6 +1543,7 @@ export declare const encodeSnapshotStream: (snapshot: Snapshot, limits?: DecodeL
1519
1543
  *
1520
1544
  * @example
1521
1545
  * ```ts
1546
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1522
1547
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1523
1548
  * import { Effect } from "effect"
1524
1549
  *
@@ -1538,7 +1563,7 @@ export declare const encodeSnapshotStream: (snapshot: Snapshot, limits?: DecodeL
1538
1563
  * return JSON.parse(new TextDecoder().decode(bytes).split("\n")[0]!).version
1539
1564
  * })
1540
1565
  *
1541
- * Effect.runPromise(program).then(console.log)
1566
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1542
1567
  * // 1
1543
1568
  * ```
1544
1569
  *
@@ -1565,6 +1590,7 @@ export declare const encodeSnapshot: (snapshot: Snapshot, limits?: DecodeLimits)
1565
1590
  *
1566
1591
  * @example
1567
1592
  * ```ts
1593
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1568
1594
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1569
1595
  * import { ByteSize, Effect, Stream } from "effect"
1570
1596
  *
@@ -1592,7 +1618,7 @@ export declare const encodeSnapshot: (snapshot: Snapshot, limits?: DecodeLimits)
1592
1618
  * return yield* (yield* (yield* Vfs.fromSnapshot(snapshot)).caller()).readFile("/f")
1593
1619
  * })
1594
1620
  *
1595
- * Effect.runPromise(program).then(console.log)
1621
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1596
1622
  * // Uint8Array(3) [ 1, 2, 3 ]
1597
1623
  * ```
1598
1624
  *
@@ -1611,6 +1637,7 @@ export declare const decodeSnapshotSink: (limits: DecodeLimits) => Sink.Sink<Sna
1611
1637
  *
1612
1638
  * @example
1613
1639
  * ```ts
1640
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1614
1641
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1615
1642
  * import { ByteSize, Effect } from "effect"
1616
1643
  *
@@ -1630,7 +1657,7 @@ export declare const decodeSnapshotSink: (limits: DecodeLimits) => Sink.Sink<Sna
1630
1657
  * )
1631
1658
  * })
1632
1659
  *
1633
- * Effect.runPromise(program).then(console.log)
1660
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1634
1661
  * // [ 'LimitExceeded', 'encodedBytes' ]
1635
1662
  * ```
1636
1663
  *
@@ -1646,6 +1673,7 @@ export declare const decodeSnapshot: (input: Uint8Array, limits: DecodeLimits) =
1646
1673
  *
1647
1674
  * @example
1648
1675
  * ```ts
1676
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1649
1677
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1650
1678
  * import * as NodeCrypto from "@effect/platform-node-shared/NodeCrypto"
1651
1679
  * import { Effect } from "effect"
@@ -1668,7 +1696,7 @@ export declare const decodeSnapshot: (input: Uint8Array, limits: DecodeLimits) =
1668
1696
  * return new TextDecoder().decode(yield* Vfs.pathToBytes(changes[0]!.path))
1669
1697
  * }).pipe(Effect.provide(NodeCrypto.layer))
1670
1698
  *
1671
- * Effect.runPromise(program).then(console.log)
1699
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1672
1700
  * // /added.txt
1673
1701
  * ```
1674
1702
  *
@@ -1684,6 +1712,7 @@ export declare const diffSnapshots: (base: Snapshot, target: Snapshot, limits?:
1684
1712
  *
1685
1713
  * @example
1686
1714
  * ```ts
1715
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1687
1716
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1688
1717
  * import * as NodeCrypto from "@effect/platform-node-shared/NodeCrypto"
1689
1718
  * import { Effect } from "effect"
@@ -1703,7 +1732,7 @@ export declare const diffSnapshots: (base: Snapshot, target: Snapshot, limits?:
1703
1732
  * change._tag === "Updated" ? change.afterKind : change.kind)
1704
1733
  * }).pipe(Effect.provide(NodeCrypto.layer))
1705
1734
  *
1706
- * Effect.runPromise(program).then(console.log)
1735
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1707
1736
  * // [ 'directory' ]
1708
1737
  * ```
1709
1738
  *
@@ -1719,6 +1748,7 @@ export declare const inspectSnapshotDelta: (base: Snapshot, delta: SnapshotDelta
1719
1748
  *
1720
1749
  * @example
1721
1750
  * ```ts
1751
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1722
1752
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1723
1753
  * import * as NodeCrypto from "@effect/platform-node-shared/NodeCrypto"
1724
1754
  * import { Effect } from "effect"
@@ -1743,7 +1773,7 @@ export declare const inspectSnapshotDelta: (base: Snapshot, delta: SnapshotDelta
1743
1773
  * return yield* reader.readFile("/f")
1744
1774
  * }).pipe(Effect.provide(NodeCrypto.layer))
1745
1775
  *
1746
- * Effect.runPromise(program).then(console.log)
1776
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1747
1777
  * // Uint8Array(1) [ 7 ]
1748
1778
  * ```
1749
1779
  *
@@ -1758,6 +1788,7 @@ export declare const applySnapshotDelta: (base: Snapshot, delta: SnapshotDeltaMo
1758
1788
  *
1759
1789
  * @example
1760
1790
  * ```ts
1791
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1761
1792
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1762
1793
  * import * as NodeCrypto from "@effect/platform-node-shared/NodeCrypto"
1763
1794
  * import { Effect, Schema } from "effect"
@@ -1780,7 +1811,7 @@ export declare const applySnapshotDelta: (base: Snapshot, delta: SnapshotDeltaMo
1780
1811
  * return (yield* Vfs.inspectSnapshotDelta(base, decoded)).map((change) => change._tag)
1781
1812
  * }).pipe(Effect.provide(NodeCrypto.layer))
1782
1813
  *
1783
- * Effect.runPromise(program).then(console.log)
1814
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1784
1815
  * // [ 'Added' ]
1785
1816
  * ```
1786
1817
  *
@@ -1797,6 +1828,7 @@ export declare const SnapshotDeltaFromBytes: (limits?: SnapshotDeltaModel.Snapsh
1797
1828
  *
1798
1829
  * @example
1799
1830
  * ```ts
1831
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1800
1832
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1801
1833
  * import { Effect } from "effect"
1802
1834
  *
@@ -1813,7 +1845,7 @@ export declare const SnapshotDeltaFromBytes: (limits?: SnapshotDeltaModel.Snapsh
1813
1845
  * return [yield* Vfs.pathToBytes(path), rejected]
1814
1846
  * })
1815
1847
  *
1816
- * Effect.runPromise(program).then(console.log)
1848
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1817
1849
  * // [ Uint8Array(4) [ 47, 116, 109, 112 ], 'InvalidArgument' ]
1818
1850
  * ```
1819
1851
  *
@@ -1837,6 +1869,7 @@ export declare const pathToBytes: (path: BytePath) => Effect.Effect<Uint8Array,
1837
1869
  *
1838
1870
  * @example
1839
1871
  * ```ts
1872
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1840
1873
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1841
1874
  * import { Effect, Schema } from "effect"
1842
1875
  *
@@ -1851,7 +1884,7 @@ export declare const pathToBytes: (path: BytePath) => Effect.Effect<Uint8Array,
1851
1884
  * Effect.catchTag("VfsError", (error) => Effect.succeed(`rejected: ${error.code}`))
1852
1885
  * )
1853
1886
  *
1854
- * Effect.runPromise(program).then(console.log)
1887
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1855
1888
  * // rejected: InvalidStructure
1856
1889
  * ```
1857
1890
  *
@@ -1873,9 +1906,11 @@ export type Fixture = typeof Fixture.Type;
1873
1906
  *
1874
1907
  * Each execution creates independent storage. Snapshot image failures cannot
1875
1908
  * arise because this constructor does not accept persisted input.
1909
+ * Provide `Crypto.Crypto` to generate the volume identity and reference-key secret.
1876
1910
  *
1877
1911
  * @example
1878
1912
  * ```ts
1913
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1879
1914
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1880
1915
  * import { Effect } from "effect"
1881
1916
  *
@@ -1889,7 +1924,7 @@ export type Fixture = typeof Fixture.Type;
1889
1924
  * return yield* caller.readFile("/work/notes.txt")
1890
1925
  * })
1891
1926
  *
1892
- * Effect.runPromise(program).then(console.log)
1927
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1893
1928
  * // Uint8Array(2) [ 104, 105 ]
1894
1929
  * ```
1895
1930
  *
@@ -1897,7 +1932,7 @@ export type Fixture = typeof Fixture.Type;
1897
1932
  * @category constructors
1898
1933
  * @since 0.1.0
1899
1934
  */
1900
- export declare const make: (options?: VolumeOptions) => Effect.Effect<Volume, VfsError>;
1935
+ export declare const make: (options?: VolumeOptions) => Effect.Effect<Volume, VfsError, Crypto.Crypto>;
1901
1936
  /**
1902
1937
  * Streams the tree at `root` in a snapshot as fixture entries, read from the
1903
1938
  * snapshot itself without restoring a volume.
@@ -1917,6 +1952,7 @@ export declare const make: (options?: VolumeOptions) => Effect.Effect<Volume, Vf
1917
1952
  *
1918
1953
  * @example
1919
1954
  * ```ts
1955
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1920
1956
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1921
1957
  * import { Effect, Stream } from "effect"
1922
1958
  *
@@ -1935,7 +1971,7 @@ export declare const make: (options?: VolumeOptions) => Effect.Effect<Volume, Vf
1935
1971
  * return entries.map((entry) => `${entry.kind} ${String(entry.path)}`)
1936
1972
  * })
1937
1973
  *
1938
- * Effect.runPromise(program).then(console.log)
1974
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1939
1975
  * // [ 'directory /', 'file /a.txt', 'file /b.txt', 'hardLink /c.txt' ]
1940
1976
  * ```
1941
1977
  *
@@ -1949,6 +1985,7 @@ export declare const snapshotEntries: (snapshot: Snapshot, root: PathInput) => S
1949
1985
  *
1950
1986
  * @example
1951
1987
  * ```ts
1988
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
1952
1989
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
1953
1990
  * import { Effect } from "effect"
1954
1991
  *
@@ -1976,15 +2013,16 @@ export declare const snapshotEntries: (snapshot: Snapshot, root: PathInput) => S
1976
2013
  * ]
1977
2014
  * })
1978
2015
  *
1979
- * Effect.runPromise(program).then(console.log)
2016
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
1980
2017
  * // [ 'one', 'two' ]
1981
2018
  * ```
1982
2019
  *
1983
2020
  * @see {@link makeOverlay} for a copy-on-write workspace over the same base.
2021
+ * @see `Crypto.Crypto` for the required secure random-byte service.
1984
2022
  * @category constructors
1985
2023
  * @since 0.1.0
1986
2024
  */
1987
- export declare const fromSnapshot: (snapshot: Snapshot, options?: VolumeOptions) => Effect.Effect<Volume, VfsError>;
2025
+ export declare const fromSnapshot: (snapshot: Snapshot, options?: VolumeOptions) => Effect.Effect<Volume, VfsError, Crypto.Crypto>;
1988
2026
  /**
1989
2027
  * Creates an isolated writable volume relative to one immutable snapshot base.
1990
2028
  *
@@ -2000,6 +2038,7 @@ export declare const fromSnapshot: (snapshot: Snapshot, options?: VolumeOptions)
2000
2038
  *
2001
2039
  * @example
2002
2040
  * ```ts
2041
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
2003
2042
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
2004
2043
  * import { Effect } from "effect"
2005
2044
  *
@@ -2026,20 +2065,22 @@ export declare const fromSnapshot: (snapshot: Snapshot, options?: VolumeOptions)
2026
2065
  * ]
2027
2066
  * })
2028
2067
  *
2029
- * Effect.runPromise(program).then(console.log)
2068
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
2030
2069
  * // [ '{}', [ 'Updated' ] ]
2031
2070
  * ```
2032
2071
  *
2033
2072
  * @see The overlay guide at `/guides/overlay-filesystems`.
2073
+ * @see `Crypto.Crypto` for the required secure random-byte service.
2034
2074
  * @category constructors
2035
2075
  * @since 0.1.0
2036
2076
  */
2037
- export declare const makeOverlay: (base: Snapshot, options?: VolumeOptions) => Effect.Effect<OverlayVolume, VfsError>;
2077
+ export declare const makeOverlay: (base: Snapshot, options?: VolumeOptions) => Effect.Effect<OverlayVolume, VfsError, Crypto.Crypto>;
2038
2078
  /**
2039
2079
  * Builds a fresh volume from a validated final-state fixture.
2040
2080
  *
2041
2081
  * @example
2042
2082
  * ```ts
2083
+ * import * as BunCrypto from "@effect/platform-bun/BunCrypto"
2043
2084
  * import { VirtualFileSystem as Vfs } from "@effect-vfs/core"
2044
2085
  * import { Effect } from "effect"
2045
2086
  *
@@ -2065,13 +2106,14 @@ export declare const makeOverlay: (base: Snapshot, options?: VolumeOptions) => E
2065
2106
  * return listing.value.map((entry) => new TextDecoder().decode(entry.name))
2066
2107
  * })
2067
2108
  *
2068
- * Effect.runPromise(program).then(console.log)
2109
+ * Effect.runPromise(program.pipe(Effect.provide(BunCrypto.layer))).then(console.log)
2069
2110
  * // [ 'latest', 'package.json' ]
2070
2111
  * ```
2071
2112
  *
2072
2113
  * @see The fixtures guide at `/guides/fixtures-and-snapshots`.
2114
+ * @see `Crypto.Crypto` for the required secure random-byte service.
2073
2115
  * @category constructors
2074
2116
  * @since 0.1.0
2075
2117
  */
2076
- export declare const fromFixture: (fixture: Fixture, options?: VolumeOptions) => Effect.Effect<Volume, VfsError>;
2118
+ export declare const fromFixture: (fixture: Fixture, options?: VolumeOptions) => Effect.Effect<Volume, VfsError, Crypto.Crypto>;
2077
2119
  //# sourceMappingURL=VirtualFileSystem.d.ts.map