@effect-vfs/core 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +9 -0
  2. package/dist/BytePath.d.ts +4 -1
  3. package/dist/BytePath.d.ts.map +1 -1
  4. package/dist/BytePath.js +6 -4
  5. package/dist/Caller.d.ts +107 -66
  6. package/dist/Caller.d.ts.map +1 -1
  7. package/dist/Caller.js +16 -86
  8. package/dist/LiveVolume.d.ts +75 -2
  9. package/dist/LiveVolume.d.ts.map +1 -1
  10. package/dist/LiveVolume.js +87 -3
  11. package/dist/Search.d.ts +32 -8
  12. package/dist/Search.d.ts.map +1 -1
  13. package/dist/Search.js +19 -10
  14. package/dist/SynchronousAdapter.d.ts +58 -0
  15. package/dist/SynchronousAdapter.d.ts.map +1 -0
  16. package/dist/SynchronousAdapter.js +116 -0
  17. package/dist/Target.d.ts +7 -91
  18. package/dist/Target.d.ts.map +1 -1
  19. package/dist/Target.js +7 -47
  20. package/dist/Testing.d.ts +5 -2
  21. package/dist/Testing.d.ts.map +1 -1
  22. package/dist/Testing.js +2 -1
  23. package/dist/VfsError.d.ts +4 -2
  24. package/dist/VfsError.d.ts.map +1 -1
  25. package/dist/VfsError.js +3 -1
  26. package/dist/VirtualFileSystem.d.ts +151 -44
  27. package/dist/VirtualFileSystem.d.ts.map +1 -1
  28. package/dist/VirtualFileSystem.js +31 -21
  29. package/dist/Volume.d.ts +6 -1
  30. package/dist/Volume.d.ts.map +1 -1
  31. package/dist/Volume.js +6 -2
  32. package/dist/Watch.d.ts +18 -0
  33. package/dist/Watch.d.ts.map +1 -1
  34. package/dist/Watch.js +12 -0
  35. package/dist/internal/adapterBinding.d.ts +13 -0
  36. package/dist/internal/adapterBinding.d.ts.map +1 -0
  37. package/dist/internal/adapterBinding.js +13 -0
  38. package/dist/internal/bytePath.d.ts +6 -1
  39. package/dist/internal/bytePath.d.ts.map +1 -1
  40. package/dist/internal/callerWatch.d.ts +36 -0
  41. package/dist/internal/callerWatch.d.ts.map +1 -0
  42. package/dist/internal/callerWatch.js +185 -0
  43. package/dist/internal/engine.d.ts +1305 -0
  44. package/dist/internal/engine.d.ts.map +1 -0
  45. package/dist/internal/engine.js +3458 -0
  46. package/dist/internal/errors.d.ts +1 -33
  47. package/dist/internal/errors.d.ts.map +1 -1
  48. package/dist/internal/errors.js +1 -45
  49. package/dist/internal/fixture.d.ts +2 -1
  50. package/dist/internal/fixture.d.ts.map +1 -1
  51. package/dist/internal/fixture.js +8 -4
  52. package/dist/internal/image.d.ts +4 -1
  53. package/dist/internal/image.d.ts.map +1 -1
  54. package/dist/internal/image.js +6 -3
  55. package/dist/internal/lines.d.ts.map +1 -1
  56. package/dist/internal/lines.js +3 -2
  57. package/dist/internal/liveImage.d.ts +4 -2
  58. package/dist/internal/liveImage.d.ts.map +1 -1
  59. package/dist/internal/liveImage.js +3 -1
  60. package/dist/internal/merkle.d.ts +7 -4
  61. package/dist/internal/merkle.d.ts.map +1 -1
  62. package/dist/internal/merkle.js +6 -4
  63. package/dist/internal/search.d.ts +3 -1
  64. package/dist/internal/search.d.ts.map +1 -1
  65. package/dist/internal/search.js +4 -3
  66. package/dist/internal/snapshotDelta.d.ts +11 -7
  67. package/dist/internal/snapshotDelta.d.ts.map +1 -1
  68. package/dist/internal/snapshotDelta.js +15 -9
  69. package/dist/internal/snapshotMerge.d.ts +1 -1
  70. package/dist/internal/snapshotMerge.d.ts.map +1 -1
  71. package/dist/internal/snapshotMerge.js +5 -2
  72. package/dist/internal/tree.d.ts +4 -2
  73. package/dist/internal/tree.d.ts.map +1 -1
  74. package/dist/internal/tree.js +4 -2
  75. package/dist/internal/virtualFileSystem.d.ts +20 -49
  76. package/dist/internal/virtualFileSystem.d.ts.map +1 -1
  77. package/dist/internal/virtualFileSystem.js +85 -1927
  78. package/dist/internal/volumeLimits.d.ts +1 -0
  79. package/dist/internal/volumeLimits.d.ts.map +1 -1
  80. package/dist/internal/volumeLimits.js +3 -2
  81. package/dist/internal/volumeState.d.ts +10 -79
  82. package/dist/internal/volumeState.d.ts.map +1 -1
  83. package/dist/internal/volumeState.js +9 -79
  84. package/dist/internal/watchHub.d.ts +9 -5
  85. package/dist/internal/watchHub.d.ts.map +1 -1
  86. package/dist/internal/watchHub.js +35 -8
  87. package/package.json +16 -9
  88. package/dist/internal/inodeTable.d.ts +0 -20
  89. package/dist/internal/inodeTable.d.ts.map +0 -1
  90. package/dist/internal/inodeTable.js +0 -48
  91. package/dist/internal/path.d.ts +0 -56
  92. package/dist/internal/path.d.ts.map +0 -1
  93. package/dist/internal/path.js +0 -141
  94. package/dist/internal/resolution.d.ts +0 -135
  95. package/dist/internal/resolution.d.ts.map +0 -1
  96. package/dist/internal/resolution.js +0 -277
  97. package/dist/internal/testSeams.d.ts +0 -17
  98. package/dist/internal/testSeams.d.ts.map +0 -1
  99. package/dist/internal/testSeams.js +0 -20
  100. package/dist/internal/tokenRegistry.d.ts +0 -77
  101. package/dist/internal/tokenRegistry.d.ts.map +0 -1
  102. package/dist/internal/tokenRegistry.js +0 -128
  103. package/dist/internal/turnstile.d.ts +0 -8
  104. package/dist/internal/turnstile.d.ts.map +0 -1
  105. package/dist/internal/turnstile.js +0 -43
@@ -8,12 +8,14 @@
8
8
  *
9
9
  * @since 0.4.0
10
10
  */
11
- import { Context, Effect } from "effect";
11
+ import { Context, Deferred, Duration, Effect, Layer, MutableHashMap, Option, RcMap, Schema } from "effect";
12
12
  import * as ByteSize from "effect/ByteSize";
13
- import { argumentFailure, retargetFailure } from "./internal/errors.js";
13
+ import { Errors } from "./internal/engine.js";
14
+ import { retargetFailure } from "./internal/errors.js";
14
15
  import * as Model from "./internal/virtualFileSystem.js";
15
16
  import * as Limits from "./internal/volumeLimits.js";
16
17
  import { VfsError } from "./VfsError.js";
18
+ const { argumentFailure, decodeConfiguration } = Errors;
17
19
  /**
18
20
  * One exclusively owned store. Its Layer holds the storage resource until the
19
21
  * volume has shut down. Providers must atomically replace each image and
@@ -32,10 +34,12 @@ export class LiveImageStore extends Context.Service()("@effect-vfs/core/LiveImag
32
34
  * @category constructors
33
35
  * @since 0.4.0
34
36
  */
35
- export const open = Effect.fn("LiveVolume.open")(function* (options) {
37
+ export const open = Effect.fnUntraced(function* (options) {
36
38
  const store = yield* LiveImageStore;
37
39
  const { decoded, initial } = yield* Effect.gen(function* () {
38
40
  const decoded = yield* Effect.fromResult(Limits.configuration(options.volume, "LiveVolume.open"));
41
+ if (decoded.options.execution === "sync")
42
+ return yield* argumentFailure("LiveVolume.open", "execution");
39
43
  const initial = yield* prepareEmptyImage(decoded.options);
40
44
  return { decoded, initial };
41
45
  }).pipe(
@@ -57,6 +61,86 @@ export const open = Effect.fn("LiveVolume.open")(function* (options) {
57
61
  }
58
62
  return volume;
59
63
  });
64
+ const RegistryCapacity = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
65
+ /**
66
+ * Lazily share one live volume and its store per key through `RcMap`. Concurrent
67
+ * borrowers share acquisition. Reusing an idle entry avoids rebuilding its store
68
+ * and decoding its image, while retaining its memory and storage locks.
69
+ *
70
+ * The registry's owning scope must outlive all borrowers. Closing it shuts down
71
+ * every volume, including borrowed ones, before releasing their store Layers.
72
+ * Capacity exhaustion fails with `Cause.ExceededCapacityError`; it does not evict
73
+ * idle entries. Acquisition failures remain shared until the entry is released.
74
+ *
75
+ * Invalidation is intentionally unavailable: acquiring a replacement while an
76
+ * existing borrower remains would violate exclusive store ownership. Canonicalize
77
+ * keys before borrowing and use one registry for each set of backing stores.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * import { LiveVolume } from "@effect-vfs/core"
82
+ * import { ByteSize, Effect, Layer } from "effect"
83
+ *
84
+ * declare const storeFor: (key: string) => Layer.Layer<LiveVolume.LiveImageStore>
85
+ *
86
+ * const program = Effect.gen(function*() {
87
+ * const registry = yield* LiveVolume.makeRegistry({
88
+ * store: storeFor,
89
+ * volume: { maxImageBytes: ByteSize.megabytes(1), volume: {} },
90
+ * capacity: 8,
91
+ * idleTimeToLive: "5 seconds"
92
+ * })
93
+ * return yield* Effect.scoped(Effect.gen(function*() {
94
+ * const volume = yield* registry.get("workspace")
95
+ * return yield* (yield* volume.caller()).readFile("/plan.md")
96
+ * }))
97
+ * })
98
+ * ```
99
+ *
100
+ * @category constructors
101
+ * @since 0.9.0
102
+ */
103
+ export const makeRegistry = Effect.fnUntraced(function* (options) {
104
+ const capacity = options.capacity === undefined
105
+ ? Infinity
106
+ : yield* Effect.fromResult(decodeConfiguration(RegistryCapacity, options.capacity, "LiveVolume.makeRegistry")).pipe(Effect.mapError((cause) => argumentFailure("LiveVolume.makeRegistry", "capacity", cause)));
107
+ const idleTimeToLive = Duration.fromInput(options.idleTimeToLive ?? 0);
108
+ if (Option.isNone(idleTimeToLive))
109
+ return yield* argumentFailure("LiveVolume.makeRegistry", "idleTimeToLive");
110
+ if (options.volume.volume.execution === "sync") {
111
+ return yield* argumentFailure("LiveVolume.makeRegistry", "volume.volume.execution");
112
+ }
113
+ const store = options.store;
114
+ const volume = { maxImageBytes: options.volume.maxImageBytes, volume: { ...options.volume.volume } };
115
+ const retiring = MutableHashMap.empty();
116
+ const volumes = yield* RcMap.make({
117
+ lookup: Effect.fnUntraced(function* (key) {
118
+ // RcMap removes an entry before its asynchronous finalizers finish. Keep
119
+ // equal keys waiting until both the volume and its store have shut down.
120
+ yield* Effect.uninterruptibleMask((restore) => Effect.gen(function* () {
121
+ let previous = MutableHashMap.get(retiring, key);
122
+ while (Option.isSome(previous)) {
123
+ yield* restore(Deferred.await(previous.value));
124
+ previous = MutableHashMap.get(retiring, key);
125
+ }
126
+ const released = yield* Deferred.make();
127
+ MutableHashMap.set(retiring, key, released);
128
+ // Registered first, this runs after the store and volume finalizers.
129
+ yield* Effect.addFinalizer(() => Effect.gen(function* () {
130
+ MutableHashMap.remove(retiring, key);
131
+ yield* Deferred.succeed(released, undefined);
132
+ }));
133
+ }));
134
+ // A parent Layer memo must not keep a retired store alive or share its
135
+ // mutable ownership state with a different volume entry.
136
+ const services = yield* Layer.build(Layer.fresh(store(key)));
137
+ return yield* open(volume).pipe(Effect.provideService(LiveImageStore, Context.get(services, LiveImageStore)));
138
+ }),
139
+ capacity,
140
+ idleTimeToLive: idleTimeToLive.value
141
+ });
142
+ return { get: (key) => RcMap.get(volumes, key) };
143
+ });
60
144
  /**
61
145
  * Construct a versioned image for a new, empty volume.
62
146
  * Store this image before opening it for mutation.
package/dist/Search.d.ts CHANGED
@@ -602,7 +602,10 @@ export type ScanContentFailure = ContentFailure | BudgetExceeded;
602
602
  * @category operations
603
603
  * @since 0.8.0
604
604
  */
605
- export declare const scanGlob: (snapshot: Snapshot, query: GlobQuery) => Stream.Stream<string, ScanGlobFailure>;
605
+ export declare const scanGlob: {
606
+ (query: GlobQuery): (snapshot: Snapshot) => Stream.Stream<string, ScanGlobFailure>;
607
+ (snapshot: Snapshot, query: GlobQuery): Stream.Stream<string, ScanGlobFailure>;
608
+ };
606
609
  /**
607
610
  * Collect bounded matches and preserve preceding rows when a work or output
608
611
  * budget stops the query. Invalid queries, malformed patterns and snapshot
@@ -636,7 +639,10 @@ export declare const scanGlob: (snapshot: Snapshot, query: GlobQuery) => Stream.
636
639
  * @category operations
637
640
  * @since 0.8.0
638
641
  */
639
- export declare const glob: (snapshot: Snapshot, query: GlobQuery) => Effect.Effect<GlobReport, GlobFailure>;
642
+ export declare const glob: {
643
+ (query: GlobQuery): (snapshot: Snapshot) => Effect.Effect<GlobReport, GlobFailure>;
644
+ (snapshot: Snapshot, query: GlobQuery): Effect.Effect<GlobReport, GlobFailure>;
645
+ };
640
646
  /**
641
647
  * Stream one result per matching line after classifying the complete file for
642
648
  * strict UTF-8 and NUL. Each row contains the first whole-match byte range and
@@ -670,7 +676,10 @@ export declare const glob: (snapshot: Snapshot, query: GlobQuery) => Effect.Effe
670
676
  * @category operations
671
677
  * @since 0.8.0
672
678
  */
673
- export declare const scanLines: (snapshot: Snapshot, query: ContentQuery) => Stream.Stream<LineResult, ScanContentFailure>;
679
+ export declare const scanLines: {
680
+ (query: ContentQuery): (snapshot: Snapshot) => Stream.Stream<LineResult, ScanContentFailure>;
681
+ (snapshot: Snapshot, query: ContentQuery): Stream.Stream<LineResult, ScanContentFailure>;
682
+ };
674
683
  /**
675
684
  * Collect matching lines, preceding rows, skips, work and completion. Catch only
676
685
  * budget exhaustion; query, pattern and snapshot failures remain typed failures,
@@ -685,7 +694,10 @@ export declare const scanLines: (snapshot: Snapshot, query: ContentQuery) => Str
685
694
  * @category operations
686
695
  * @since 0.8.0
687
696
  */
688
- export declare const lines: (snapshot: Snapshot, query: ContentQuery) => Effect.Effect<LinesReport, ContentFailure>;
697
+ export declare const lines: {
698
+ (query: ContentQuery): (snapshot: Snapshot) => Effect.Effect<LinesReport, ContentFailure>;
699
+ (snapshot: Snapshot, query: ContentQuery): Effect.Effect<LinesReport, ContentFailure>;
700
+ };
689
701
  /**
690
702
  * Stream one root-relative filename per matching regular-file path. Classify
691
703
  * the complete file before testing lines and stop matching after the first hit.
@@ -695,7 +707,10 @@ export declare const lines: (snapshot: Snapshot, query: ContentQuery) => Effect.
695
707
  * @category operations
696
708
  * @since 0.8.0
697
709
  */
698
- export declare const scanFiles: (snapshot: Snapshot, query: ContentQuery) => Stream.Stream<string, ScanContentFailure>;
710
+ export declare const scanFiles: {
711
+ (query: ContentQuery): (snapshot: Snapshot) => Stream.Stream<string, ScanContentFailure>;
712
+ (snapshot: Snapshot, query: ContentQuery): Stream.Stream<string, ScanContentFailure>;
713
+ };
699
714
  /**
700
715
  * Collect matching filenames with preceding rows, work, skips and completion.
701
716
  * Shares text classification and matching with `lines`, but evaluates only as
@@ -705,7 +720,10 @@ export declare const scanFiles: (snapshot: Snapshot, query: ContentQuery) => Str
705
720
  * @category operations
706
721
  * @since 0.8.0
707
722
  */
708
- export declare const files: (snapshot: Snapshot, query: ContentQuery) => Effect.Effect<FilesReport, ContentFailure>;
723
+ export declare const files: {
724
+ (query: ContentQuery): (snapshot: Snapshot) => Effect.Effect<FilesReport, ContentFailure>;
725
+ (snapshot: Snapshot, query: ContentQuery): Effect.Effect<FilesReport, ContentFailure>;
726
+ };
709
727
  /**
710
728
  * Stream exact matching-line counts for completely scanned matching files.
711
729
  * Multiple occurrences on one line count once. A stopped file emits no partial
@@ -715,7 +733,10 @@ export declare const files: (snapshot: Snapshot, query: ContentQuery) => Effect.
715
733
  * @category operations
716
734
  * @since 0.8.0
717
735
  */
718
- export declare const scanCountLines: (snapshot: Snapshot, query: ContentQuery) => Stream.Stream<CountResult, ScanContentFailure>;
736
+ export declare const scanCountLines: {
737
+ (query: ContentQuery): (snapshot: Snapshot) => Stream.Stream<CountResult, ScanContentFailure>;
738
+ (snapshot: Snapshot, query: ContentQuery): Stream.Stream<CountResult, ScanContentFailure>;
739
+ };
719
740
  /**
720
741
  * Collect exact per-file matching-line counts with work, skips and completion.
721
742
  * A stopped or skipped query's summed counts are lower bounds for its original
@@ -725,6 +746,9 @@ export declare const scanCountLines: (snapshot: Snapshot, query: ContentQuery) =
725
746
  * @category operations
726
747
  * @since 0.8.0
727
748
  */
728
- export declare const countLines: (snapshot: Snapshot, query: ContentQuery) => Effect.Effect<CountLinesReport, ContentFailure>;
749
+ export declare const countLines: {
750
+ (query: ContentQuery): (snapshot: Snapshot) => Effect.Effect<CountLinesReport, ContentFailure>;
751
+ (snapshot: Snapshot, query: ContentQuery): Effect.Effect<CountLinesReport, ContentFailure>;
752
+ };
729
753
  export {};
730
754
  //# sourceMappingURL=Search.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../src/Search.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAKxC,OAAO,KAAK,EAAE,QAAQ,EAA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C,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;CAOtF,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,EAAE;IAC3B,CAAC,KAAK,EAAE,YAAY,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAA;IAC7F,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAA;CAIK,CAAA;AAEhG;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,EAAE;IACvB,CAAC,KAAK,EAAE,YAAY,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAA;IAC9F,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAA;CAQ3F,CAAA"}
package/dist/Search.js CHANGED
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import * as ByteSize from "effect/ByteSize";
12
12
  import * as Effect from "effect/Effect";
13
+ import { dual } from "effect/Function";
13
14
  import * as Schema from "effect/Schema";
14
15
  import * as Stream from "effect/Stream";
15
16
  import { BytePath } from "./BytePath.js";
@@ -400,10 +401,10 @@ const evaluate = Effect.fnUntraced(function* (snapshot, input) {
400
401
  * @category operations
401
402
  * @since 0.8.0
402
403
  */
403
- export const scanGlob = (snapshot, query) => Stream.unwrap(Effect.map(evaluate(snapshot, query), ({ next }) => Stream.unfold(undefined, Effect.fnUntraced(function* () {
404
+ export const scanGlob = dual(2, (snapshot, query) => Stream.unwrap(Effect.map(evaluate(snapshot, query), ({ next }) => Stream.unfold(undefined, Effect.fnUntraced(function* () {
404
405
  const row = yield* next();
405
406
  return row === undefined ? undefined : [row, undefined];
406
- }))));
407
+ })))));
407
408
  /**
408
409
  * Collect bounded matches and preserve preceding rows when a work or output
409
410
  * budget stops the query. Invalid queries, malformed patterns and snapshot
@@ -437,7 +438,7 @@ export const scanGlob = (snapshot, query) => Stream.unwrap(Effect.map(evaluate(s
437
438
  * @category operations
438
439
  * @since 0.8.0
439
440
  */
440
- export const glob = Effect.fn("Search.glob")(function* (snapshot, query) {
441
+ export const glob = dual(2, Effect.fnUntraced(function* (snapshot, query) {
441
442
  const evaluation = yield* evaluate(snapshot, query);
442
443
  const results = [];
443
444
  const completion = yield* Effect.gen(function* () {
@@ -454,7 +455,7 @@ export const glob = Effect.fn("Search.glob")(function* (snapshot, query) {
454
455
  skips: { ...evaluation.meter.skips },
455
456
  completion
456
457
  };
457
- });
458
+ }));
458
459
  const scanContent = (snapshot, query, mode) => Stream.unwrap(Effect.map(Content.evaluate(snapshot, query, mode), ({ next }) => Stream.unfold(undefined, Effect.fnUntraced(function* () {
459
460
  const row = yield* next();
460
461
  return row === undefined ? undefined : [row, undefined];
@@ -510,7 +511,7 @@ const collectContent = Effect.fnUntraced(function* (snapshot, query, mode) {
510
511
  * @category operations
511
512
  * @since 0.8.0
512
513
  */
513
- export const scanLines = (snapshot, query) => scanContent(snapshot, query, "lines");
514
+ export const scanLines = dual(2, (snapshot, query) => scanContent(snapshot, query, "lines"));
514
515
  /**
515
516
  * Collect matching lines, preceding rows, skips, work and completion. Catch only
516
517
  * budget exhaustion; query, pattern and snapshot failures remain typed failures,
@@ -525,7 +526,10 @@ export const scanLines = (snapshot, query) => scanContent(snapshot, query, "line
525
526
  * @category operations
526
527
  * @since 0.8.0
527
528
  */
528
- export const lines = Effect.fn("Search.lines")((snapshot, query) => collectContent(snapshot, query, "lines"));
529
+ export const lines = dual(2, Effect
530
+ .fnUntraced(function* (snapshot, query) {
531
+ return yield* collectContent(snapshot, query, "lines");
532
+ }));
529
533
  /**
530
534
  * Stream one root-relative filename per matching regular-file path. Classify
531
535
  * the complete file before testing lines and stop matching after the first hit.
@@ -535,7 +539,7 @@ export const lines = Effect.fn("Search.lines")((snapshot, query) => collectConte
535
539
  * @category operations
536
540
  * @since 0.8.0
537
541
  */
538
- export const scanFiles = (snapshot, query) => scanContent(snapshot, query, "files");
542
+ export const scanFiles = dual(2, (snapshot, query) => scanContent(snapshot, query, "files"));
539
543
  /**
540
544
  * Collect matching filenames with preceding rows, work, skips and completion.
541
545
  * Shares text classification and matching with `lines`, but evaluates only as
@@ -545,7 +549,10 @@ export const scanFiles = (snapshot, query) => scanContent(snapshot, query, "file
545
549
  * @category operations
546
550
  * @since 0.8.0
547
551
  */
548
- export const files = Effect.fn("Search.files")((snapshot, query) => collectContent(snapshot, query, "files"));
552
+ export const files = dual(2, Effect
553
+ .fnUntraced(function* (snapshot, query) {
554
+ return yield* collectContent(snapshot, query, "files");
555
+ }));
549
556
  /**
550
557
  * Stream exact matching-line counts for completely scanned matching files.
551
558
  * Multiple occurrences on one line count once. A stopped file emits no partial
@@ -555,7 +562,7 @@ export const files = Effect.fn("Search.files")((snapshot, query) => collectConte
555
562
  * @category operations
556
563
  * @since 0.8.0
557
564
  */
558
- export const scanCountLines = (snapshot, query) => scanContent(snapshot, query, "countLines");
565
+ export const scanCountLines = dual(2, (snapshot, query) => scanContent(snapshot, query, "countLines"));
559
566
  /**
560
567
  * Collect exact per-file matching-line counts with work, skips and completion.
561
568
  * A stopped or skipped query's summed counts are lower bounds for its original
@@ -565,4 +572,6 @@ export const scanCountLines = (snapshot, query) => scanContent(snapshot, query,
565
572
  * @category operations
566
573
  * @since 0.8.0
567
574
  */
568
- export const countLines = Effect.fn("Search.countLines")((snapshot, query) => collectContent(snapshot, query, "countLines"));
575
+ export const countLines = dual(2, Effect.fnUntraced(function* (snapshot, query) {
576
+ return yield* collectContent(snapshot, query, "countLines");
577
+ }));
@@ -0,0 +1,58 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Scope from "effect/Scope";
3
+ import type { MkdirOptions, OpenOptions } from "./Caller.js";
4
+ import type { Metadata, OwnerUpdate, Times } from "./Metadata.js";
5
+ import type { Caller, FsFailure, TargetInput, Volume } from "./VirtualFileSystem.js";
6
+ /**
7
+ * A private-scope handle. Explicit close checks reentry before touching its scope.
8
+ * @since 0.10.0
9
+ */
10
+ export interface Handle {
11
+ readonly closed: boolean;
12
+ readonly directory: boolean;
13
+ readonly stat: () => Metadata;
14
+ readonly read: (length: number, position: bigint) => Uint8Array;
15
+ readonly write: (bytes: Uint8Array, position: bigint, append: boolean) => number;
16
+ readonly truncate: (length: bigint) => void;
17
+ readonly chmod: (mode: number) => void;
18
+ readonly chown: (owner: OwnerUpdate) => void;
19
+ readonly utimes: (times: Times) => void;
20
+ readonly sync: () => void;
21
+ readonly close: () => void;
22
+ }
23
+ /**
24
+ * Synchronous filesystem operations. Failures throw the core FsFailure value.
25
+ * @since 0.10.0
26
+ */
27
+ export interface Binding {
28
+ readonly stat: (target: TargetInput) => Metadata;
29
+ readonly readDirectory: (path: string) => Effect.Success<ReturnType<Caller["readDirectory"]>>;
30
+ readonly readLink: (path: string) => Uint8Array;
31
+ readonly realPath: (path: string) => Uint8Array;
32
+ readonly access: (path: string, bits: number) => number;
33
+ readonly mkdir: (path: string, options?: MkdirOptions) => void;
34
+ readonly rmdir: (path: string) => void;
35
+ readonly unlink: (path: string) => void;
36
+ readonly rename: (from: string, to: string) => void;
37
+ readonly link: (from: TargetInput, to: string) => void;
38
+ readonly symlink: (target: string, path: string) => void;
39
+ readonly chmod: (target: TargetInput, mode: number) => void;
40
+ readonly chown: (target: TargetInput, owner: OwnerUpdate) => void;
41
+ readonly utimes: (target: TargetInput, times: Times) => void;
42
+ readonly open: (path: string, options: OpenOptions, noFollow: boolean, directory: boolean) => Handle;
43
+ }
44
+ /**
45
+ * Binds only constructor-qualified synchronous memory volumes. The scope owns all opened handles.
46
+ * No arbitrary Effect can be submitted to this binding.
47
+ * @since 0.10.0
48
+ */
49
+ export declare const bind: (volume: Volume, options?: {
50
+ readonly identity?: {
51
+ readonly uid: number;
52
+ readonly gid: number;
53
+ readonly groups: readonly number[];
54
+ readonly privileged: boolean;
55
+ };
56
+ readonly umask?: number;
57
+ } | undefined) => Effect.Effect<Binding, FsFailure, Scope.Scope>;
58
+ //# sourceMappingURL=SynchronousAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SynchronousAdapter.d.ts","sourceRoot":"","sources":["../src/SynchronousAdapter.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAIvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,aAAa,CAAA;AAG/E,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,KAAK,EAAE,MAAM,EAA+B,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEjH;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,QAAQ,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,UAAU,CAAA;IAC/D,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,MAAM,CAAA;IAChF,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3C,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;IAC5C,QAAQ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KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3D,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;IACjE,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IAC5D,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,KAAK,MAAM,CAAA;CACrG;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI;;;;;;;;gEAsHhB,CAAA"}
@@ -0,0 +1,116 @@
1
+ // These callbacks implement a checked native boundary with fresh synchronous fibers.
2
+ /* eslint-disable effecttsgo/run-effect-inside-effect */
3
+ /**
4
+ * Checked synchronous operations for native adapters over an existing memory volume.
5
+ * This adapter contract is versioned with core. Volumes from another package copy are rejected.
6
+ * @since 0.10.0
7
+ */
8
+ import * as Cause from "effect/Cause";
9
+ import * as Effect from "effect/Effect";
10
+ import * as Exit from "effect/Exit";
11
+ import * as Result from "effect/Result";
12
+ import * as Scheduler from "effect/Scheduler";
13
+ import * as Scope from "effect/Scope";
14
+ import { engineOf } from "./internal/adapterBinding.js";
15
+ import { Errors, Paths } from "./internal/engine.js";
16
+ /**
17
+ * Binds only constructor-qualified synchronous memory volumes. The scope owns all opened handles.
18
+ * No arbitrary Effect can be submitted to this binding.
19
+ * @since 0.10.0
20
+ */
21
+ export const bind = Effect.fnUntraced(function* (volume, options) {
22
+ const engine = engineOf(volume);
23
+ const checked = engine?.syncBinding;
24
+ if (engine === undefined || checked === undefined)
25
+ return yield* Errors.argumentFailure("bind", "volume");
26
+ yield* Effect.fromResult(checked.check("bind"));
27
+ const context = yield* engine.context(options);
28
+ const operations = context.operations;
29
+ const parent = yield* Effect.scope;
30
+ let closed = false;
31
+ yield* Scope.addFinalizer(parent, Effect.sync(() => {
32
+ closed = true;
33
+ }));
34
+ const run = (operation, effect) => {
35
+ if (closed)
36
+ throw Errors.fsFailure("ClosedCaller", operation);
37
+ const available = checked.check(operation);
38
+ if (Result.isFailure(available))
39
+ throw available.failure;
40
+ const exit = Effect.runSyncExit(Effect.provideService(effect, Scheduler.PreventSchedulerYield, true));
41
+ if (Exit.isFailure(exit))
42
+ throw Cause.squash(exit.cause);
43
+ return exit.value;
44
+ };
45
+ const open = (path, options, noFollow, directory) => {
46
+ // Preflight must precede even scope allocation. A rejected reentrant close/open owns no resources.
47
+ run("open", Effect.void);
48
+ const scope = Scope.forkUnsafe(parent);
49
+ const target = { _tag: "Path", path, followFinalSymlink: !noFollow };
50
+ const acquire = directory
51
+ ? operations.openDirectory(target)
52
+ : operations.open(target, options);
53
+ const acquired = Effect.runSyncExit(Effect.provideService(Effect.provideService(acquire, Scope.Scope, scope), Scheduler.PreventSchedulerYield, true));
54
+ if (Exit.isFailure(acquired)) {
55
+ Effect.runSync(Scope.close(scope, Exit.void));
56
+ throw Cause.squash(acquired.cause);
57
+ }
58
+ const handle = acquired.value;
59
+ let released = false;
60
+ Effect.runSync(Scope.addFinalizer(scope, Effect.sync(() => {
61
+ released = true;
62
+ })));
63
+ const file = () => {
64
+ if (!("pread" in handle))
65
+ throw Errors.fsFailure("IsDirectory", "read");
66
+ return handle;
67
+ };
68
+ return Object.freeze({
69
+ get closed() {
70
+ return released;
71
+ },
72
+ directory,
73
+ stat: () => run("fstat", handle.stat),
74
+ read: (length, position) => run("read", Effect.map(file().pread(length, position), (value) => value.bytes)),
75
+ write: (bytes, position, append) => run("write", append ? file().write(bytes) : file().pwrite(bytes, position)),
76
+ truncate: (length) => run("ftruncate", file().truncate(length)),
77
+ chmod: (mode) => run("fchmod", operations.chmod(handle, mode)),
78
+ chown: (owner) => run("fchown", operations.chown(handle, owner)),
79
+ utimes: (times) => run("futimes", operations.utimes(handle, times)),
80
+ sync: () => run("fsync", directory ? Effect.asVoid(handle.stat) : file().sync),
81
+ close: () => {
82
+ run("close", handle.close);
83
+ Effect.runSync(Scope.close(scope, Exit.void));
84
+ }
85
+ });
86
+ };
87
+ return Object.freeze({
88
+ stat: (target) => run("stat", operations.stat(target)),
89
+ readDirectory: (path) => run("readdir", operations.readDirectory(path)),
90
+ readLink: (path) => run("readlink", operations.readLink(path)),
91
+ realPath: (path) => run("realpath", Effect.flatMap(operations.realPath(path), Paths.pathToBytes)),
92
+ access: (path, bits) => run("access", operations.access(path, bits)),
93
+ mkdir: (path, options) => {
94
+ run("mkdir", operations.mkdir(path, options));
95
+ },
96
+ rmdir: (path) => {
97
+ run("rmdir", operations.rmdir(path));
98
+ },
99
+ unlink: (path) => {
100
+ run("unlink", operations.unlink(path));
101
+ },
102
+ rename: (from, to) => {
103
+ run("rename", operations.rename(from, to));
104
+ },
105
+ link: (from, to) => {
106
+ run("link", operations.link(from, to));
107
+ },
108
+ symlink: (target, path) => {
109
+ run("symlink", operations.symlink(target, path));
110
+ },
111
+ chmod: (target, mode) => run("chmod", operations.chmod(target, mode)),
112
+ chown: (target, owner) => run("chown", operations.chown(target, owner)),
113
+ utimes: (target, times) => run("utimes", operations.utimes(target, times)),
114
+ open
115
+ });
116
+ });
package/dist/Target.d.ts CHANGED
@@ -6,8 +6,8 @@
6
6
  *
7
7
  * @since 0.6.0
8
8
  */
9
- import * as Data from "effect/Data";
10
- import * as Schema from "effect/Schema";
9
+ import type * as Data from "effect/Data";
10
+ import type * as Schema from "effect/Schema";
11
11
  import type { DirectoryHandle, FileHandle, ObjectReference, PathInput } from "./VirtualFileSystem.js";
12
12
  /**
13
13
  * A target: a path resolved from the caller's working directory or a base
@@ -31,92 +31,6 @@ export type Target = Data.TaggedEnum<{
31
31
  readonly handle: FileHandle | DirectoryHandle;
32
32
  };
33
33
  }>;
34
- declare const enumeration: {
35
- readonly $is: <Tag extends "Handle" | "Path" | "Reference">(tag: Tag) => (u: unknown) => u is Extract<{
36
- readonly _tag: "Handle";
37
- readonly handle: FileHandle | DirectoryHandle;
38
- }, {
39
- readonly _tag: Tag;
40
- }> | Extract<{
41
- readonly _tag: "Path";
42
- readonly path: PathInput;
43
- readonly relativeTo?: DirectoryHandle;
44
- readonly followFinalSymlink?: boolean;
45
- }, {
46
- readonly _tag: Tag;
47
- }> | Extract<{
48
- readonly _tag: "Reference";
49
- readonly reference: ObjectReference;
50
- }, {
51
- readonly _tag: Tag;
52
- }>;
53
- readonly $match: {
54
- <Cases extends { readonly [Tag in "Handle" | "Path" | "Reference"]: (args: Extract<{
55
- readonly _tag: "Handle";
56
- readonly handle: FileHandle | DirectoryHandle;
57
- } | {
58
- readonly _tag: "Path";
59
- readonly path: PathInput;
60
- readonly relativeTo?: DirectoryHandle;
61
- readonly followFinalSymlink?: boolean;
62
- } | {
63
- readonly _tag: "Reference";
64
- readonly reference: ObjectReference;
65
- }, {
66
- readonly _tag: Tag;
67
- }>) => any; }>(cases: Cases): (value: {
68
- readonly _tag: "Handle";
69
- readonly handle: FileHandle | DirectoryHandle;
70
- } | {
71
- readonly _tag: "Path";
72
- readonly path: PathInput;
73
- readonly relativeTo?: DirectoryHandle;
74
- readonly followFinalSymlink?: boolean;
75
- } | {
76
- readonly _tag: "Reference";
77
- readonly reference: ObjectReference;
78
- }) => import("effect/Unify").Unify<ReturnType<Cases["Handle" | "Path" | "Reference"]>>;
79
- <Cases extends { readonly [Tag in "Handle" | "Path" | "Reference"]: (args: Extract<{
80
- readonly _tag: "Handle";
81
- readonly handle: FileHandle | DirectoryHandle;
82
- } | {
83
- readonly _tag: "Path";
84
- readonly path: PathInput;
85
- readonly relativeTo?: DirectoryHandle;
86
- readonly followFinalSymlink?: boolean;
87
- } | {
88
- readonly _tag: "Reference";
89
- readonly reference: ObjectReference;
90
- }, {
91
- readonly _tag: Tag;
92
- }>) => any; }>(value: {
93
- readonly _tag: "Handle";
94
- readonly handle: FileHandle | DirectoryHandle;
95
- } | {
96
- readonly _tag: "Path";
97
- readonly path: PathInput;
98
- readonly relativeTo?: DirectoryHandle;
99
- readonly followFinalSymlink?: boolean;
100
- } | {
101
- readonly _tag: "Reference";
102
- readonly reference: ObjectReference;
103
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Handle" | "Path" | "Reference"]>>;
104
- };
105
- readonly Handle: Data.TaggedEnum.ConstructorFrom<{
106
- readonly _tag: "Handle";
107
- readonly handle: FileHandle | DirectoryHandle;
108
- }, "_tag">;
109
- readonly Path: Data.TaggedEnum.ConstructorFrom<{
110
- readonly _tag: "Path";
111
- readonly path: PathInput;
112
- readonly relativeTo?: DirectoryHandle;
113
- readonly followFinalSymlink?: boolean;
114
- }, "_tag">;
115
- readonly Reference: Data.TaggedEnum.ConstructorFrom<{
116
- readonly _tag: "Reference";
117
- readonly reference: ObjectReference;
118
- }, "_tag">;
119
- };
120
34
  /**
121
35
  * Whether a value is a `Target`.
122
36
  *
@@ -139,7 +53,7 @@ export type TargetInput = Target | PathInput | ObjectReference | FileHandle | Di
139
53
  * @category constructors
140
54
  * @since 0.6.0
141
55
  */
142
- export declare const Target: typeof enumeration & {
56
+ export declare const Target: Data.TaggedEnum.Constructor<Target> & {
143
57
  readonly of: (input: TargetInput) => Target;
144
58
  };
145
59
  /**
@@ -213,7 +127,10 @@ export declare const isEntry: (value: unknown) => value is Entry;
213
127
  * @category constructors
214
128
  * @since 0.6.0
215
129
  */
216
- export declare const Entry: (directory: TargetInput, name: NameInput) => Entry;
130
+ export declare const Entry: {
131
+ (name: NameInput): (directory: TargetInput) => Entry;
132
+ (directory: TargetInput, name: NameInput): Entry;
133
+ };
217
134
  /**
218
135
  * Whether a path input is a byte path rather than a string.
219
136
  *
@@ -221,5 +138,4 @@ export declare const Entry: (directory: TargetInput, name: NameInput) => Entry;
221
138
  * @since 0.6.0
222
139
  */
223
140
  export declare const isBytePathInput: (input: PathInput) => boolean;
224
- export {};
225
141
  //# sourceMappingURL=Target.d.ts.map
@@ -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