@orkestrel/probe 0.0.8 → 0.0.9
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.
|
@@ -448,6 +448,15 @@ export declare function normalizeValue(workspace: string, value: unknown): unkno
|
|
|
448
448
|
* is what makes a resident tool re-read a path this overlay holds, so two inspections that supply
|
|
449
449
|
* different text for one path never share a cached answer.
|
|
450
450
|
*
|
|
451
|
+
* This overlay matches a lookup key the way the host its stage declares to its tool matches file
|
|
452
|
+
* names. A host that resolves two spellings of one file name to one file leaves the tool holding
|
|
453
|
+
* whichever spelling it met first — the disk one, where the file is on disk — and the tool asks
|
|
454
|
+
* under that, so an overlay matching keys exactly answers nothing and the tool reads the committed
|
|
455
|
+
* file instead. Mint the overlay with the sensitivity the stage declares, and one reading decides
|
|
456
|
+
* both. The recorded spelling is what `paths` reports and what `covers` matches a directory
|
|
457
|
+
* against, so a folded key never reaches the paths a tool is handed and containment stays an exact
|
|
458
|
+
* comparison.
|
|
459
|
+
*
|
|
451
460
|
* @example
|
|
452
461
|
* ```ts
|
|
453
462
|
* const overlay = new Overlay()
|
|
@@ -458,11 +467,21 @@ export declare function normalizeValue(workspace: string, value: unknown): unkno
|
|
|
458
467
|
*/
|
|
459
468
|
export declare class Overlay implements OverlayInterface {
|
|
460
469
|
#private;
|
|
470
|
+
/**
|
|
471
|
+
* Creates an empty candidate set under a fresh identity.
|
|
472
|
+
*
|
|
473
|
+
* @param options - Construction options
|
|
474
|
+
*/
|
|
475
|
+
constructor(options?: OverlayOptions);
|
|
461
476
|
get revision(): string;
|
|
462
477
|
get paths(): readonly string[];
|
|
463
478
|
/**
|
|
464
479
|
* Records one candidate's text against the absolute path it stands in for.
|
|
465
480
|
*
|
|
481
|
+
* @remarks
|
|
482
|
+
* Recording a candidate under a path this overlay's own matching reads as one already recorded
|
|
483
|
+
* replaces that candidate, the way one file holds one text.
|
|
484
|
+
*
|
|
466
485
|
* @param path - The absolute path the candidate replaces
|
|
467
486
|
* @param text - The candidate's full contents
|
|
468
487
|
* @returns Nothing
|
|
@@ -482,7 +501,9 @@ export declare class Overlay implements OverlayInterface {
|
|
|
482
501
|
* The answer is derived from the paths the overlay holds rather than stored, so it stops being
|
|
483
502
|
* true exactly when the inspection that declared those candidates clears them. Both sides pass
|
|
484
503
|
* through `normalizePath` first, because a tool that normalizes its own paths asks about a
|
|
485
|
-
* directory in a spelling the recorded path may not share.
|
|
504
|
+
* directory in a spelling the recorded path may not share. Case is never folded here: this is a
|
|
505
|
+
* containment comparison, and it reads the recorded spelling whatever an overlay minted for a
|
|
506
|
+
* case-folding host matches its lookup keys by.
|
|
486
507
|
*
|
|
487
508
|
* @param directory - The absolute directory path to check
|
|
488
509
|
* @returns True if a candidate path sits beneath the directory; false otherwise
|
|
@@ -561,6 +582,22 @@ export declare interface OverlayInterface {
|
|
|
561
582
|
clear(): void;
|
|
562
583
|
}
|
|
563
584
|
|
|
585
|
+
/**
|
|
586
|
+
* Carries the construction options `Overlay` accepts.
|
|
587
|
+
*
|
|
588
|
+
* @example
|
|
589
|
+
* ```ts
|
|
590
|
+
* const options: OverlayOptions = { sensitive: false }
|
|
591
|
+
* ```
|
|
592
|
+
*/
|
|
593
|
+
export declare interface OverlayOptions {
|
|
594
|
+
/**
|
|
595
|
+
* If `true`, a lookup key matches a recorded path exactly; if `false`, it matches with file-name
|
|
596
|
+
* case folded. Default: `true`
|
|
597
|
+
*/
|
|
598
|
+
readonly sensitive?: boolean;
|
|
599
|
+
}
|
|
600
|
+
|
|
564
601
|
/**
|
|
565
602
|
* Overwrites a file that already exists, through a descriptor that refuses a symbolic link at the
|
|
566
603
|
* final component.
|
|
@@ -448,6 +448,15 @@ export declare function normalizeValue(workspace: string, value: unknown): unkno
|
|
|
448
448
|
* is what makes a resident tool re-read a path this overlay holds, so two inspections that supply
|
|
449
449
|
* different text for one path never share a cached answer.
|
|
450
450
|
*
|
|
451
|
+
* This overlay matches a lookup key the way the host its stage declares to its tool matches file
|
|
452
|
+
* names. A host that resolves two spellings of one file name to one file leaves the tool holding
|
|
453
|
+
* whichever spelling it met first — the disk one, where the file is on disk — and the tool asks
|
|
454
|
+
* under that, so an overlay matching keys exactly answers nothing and the tool reads the committed
|
|
455
|
+
* file instead. Mint the overlay with the sensitivity the stage declares, and one reading decides
|
|
456
|
+
* both. The recorded spelling is what `paths` reports and what `covers` matches a directory
|
|
457
|
+
* against, so a folded key never reaches the paths a tool is handed and containment stays an exact
|
|
458
|
+
* comparison.
|
|
459
|
+
*
|
|
451
460
|
* @example
|
|
452
461
|
* ```ts
|
|
453
462
|
* const overlay = new Overlay()
|
|
@@ -458,11 +467,21 @@ export declare function normalizeValue(workspace: string, value: unknown): unkno
|
|
|
458
467
|
*/
|
|
459
468
|
export declare class Overlay implements OverlayInterface {
|
|
460
469
|
#private;
|
|
470
|
+
/**
|
|
471
|
+
* Creates an empty candidate set under a fresh identity.
|
|
472
|
+
*
|
|
473
|
+
* @param options - Construction options
|
|
474
|
+
*/
|
|
475
|
+
constructor(options?: OverlayOptions);
|
|
461
476
|
get revision(): string;
|
|
462
477
|
get paths(): readonly string[];
|
|
463
478
|
/**
|
|
464
479
|
* Records one candidate's text against the absolute path it stands in for.
|
|
465
480
|
*
|
|
481
|
+
* @remarks
|
|
482
|
+
* Recording a candidate under a path this overlay's own matching reads as one already recorded
|
|
483
|
+
* replaces that candidate, the way one file holds one text.
|
|
484
|
+
*
|
|
466
485
|
* @param path - The absolute path the candidate replaces
|
|
467
486
|
* @param text - The candidate's full contents
|
|
468
487
|
* @returns Nothing
|
|
@@ -482,7 +501,9 @@ export declare class Overlay implements OverlayInterface {
|
|
|
482
501
|
* The answer is derived from the paths the overlay holds rather than stored, so it stops being
|
|
483
502
|
* true exactly when the inspection that declared those candidates clears them. Both sides pass
|
|
484
503
|
* through `normalizePath` first, because a tool that normalizes its own paths asks about a
|
|
485
|
-
* directory in a spelling the recorded path may not share.
|
|
504
|
+
* directory in a spelling the recorded path may not share. Case is never folded here: this is a
|
|
505
|
+
* containment comparison, and it reads the recorded spelling whatever an overlay minted for a
|
|
506
|
+
* case-folding host matches its lookup keys by.
|
|
486
507
|
*
|
|
487
508
|
* @param directory - The absolute directory path to check
|
|
488
509
|
* @returns True if a candidate path sits beneath the directory; false otherwise
|
|
@@ -561,6 +582,22 @@ export declare interface OverlayInterface {
|
|
|
561
582
|
clear(): void;
|
|
562
583
|
}
|
|
563
584
|
|
|
585
|
+
/**
|
|
586
|
+
* Carries the construction options `Overlay` accepts.
|
|
587
|
+
*
|
|
588
|
+
* @example
|
|
589
|
+
* ```ts
|
|
590
|
+
* const options: OverlayOptions = { sensitive: false }
|
|
591
|
+
* ```
|
|
592
|
+
*/
|
|
593
|
+
export declare interface OverlayOptions {
|
|
594
|
+
/**
|
|
595
|
+
* If `true`, a lookup key matches a recorded path exactly; if `false`, it matches with file-name
|
|
596
|
+
* case folded. Default: `true`
|
|
597
|
+
*/
|
|
598
|
+
readonly sensitive?: boolean;
|
|
599
|
+
}
|
|
600
|
+
|
|
564
601
|
/**
|
|
565
602
|
* Overwrites a file that already exists, through a descriptor that refuses a symbolic link at the
|
|
566
603
|
* final component.
|
package/dist/src/server/index.js
CHANGED
|
@@ -731,6 +731,15 @@ function releaseListeners(emitter, capture) {
|
|
|
731
731
|
* is what makes a resident tool re-read a path this overlay holds, so two inspections that supply
|
|
732
732
|
* different text for one path never share a cached answer.
|
|
733
733
|
*
|
|
734
|
+
* This overlay matches a lookup key the way the host its stage declares to its tool matches file
|
|
735
|
+
* names. A host that resolves two spellings of one file name to one file leaves the tool holding
|
|
736
|
+
* whichever spelling it met first — the disk one, where the file is on disk — and the tool asks
|
|
737
|
+
* under that, so an overlay matching keys exactly answers nothing and the tool reads the committed
|
|
738
|
+
* file instead. Mint the overlay with the sensitivity the stage declares, and one reading decides
|
|
739
|
+
* both. The recorded spelling is what `paths` reports and what `covers` matches a directory
|
|
740
|
+
* against, so a folded key never reaches the paths a tool is handed and containment stays an exact
|
|
741
|
+
* comparison.
|
|
742
|
+
*
|
|
734
743
|
* @example
|
|
735
744
|
* ```ts
|
|
736
745
|
* const overlay = new Overlay()
|
|
@@ -741,22 +750,36 @@ function releaseListeners(emitter, capture) {
|
|
|
741
750
|
*/
|
|
742
751
|
var Overlay = class {
|
|
743
752
|
#revision = randomUUID();
|
|
753
|
+
#sensitive;
|
|
744
754
|
#candidates = /* @__PURE__ */ new Map();
|
|
755
|
+
/**
|
|
756
|
+
* Creates an empty candidate set under a fresh identity.
|
|
757
|
+
*
|
|
758
|
+
* @param options - Construction options
|
|
759
|
+
*/
|
|
760
|
+
constructor(options = {}) {
|
|
761
|
+
this.#sensitive = options.sensitive ?? true;
|
|
762
|
+
}
|
|
745
763
|
get revision() {
|
|
746
764
|
return this.#revision;
|
|
747
765
|
}
|
|
748
766
|
get paths() {
|
|
749
|
-
return [...this.#candidates.
|
|
767
|
+
return [...this.#candidates.values()].map(([path]) => path);
|
|
750
768
|
}
|
|
751
769
|
/**
|
|
752
770
|
* Records one candidate's text against the absolute path it stands in for.
|
|
753
771
|
*
|
|
772
|
+
* @remarks
|
|
773
|
+
* Recording a candidate under a path this overlay's own matching reads as one already recorded
|
|
774
|
+
* replaces that candidate, the way one file holds one text.
|
|
775
|
+
*
|
|
754
776
|
* @param path - The absolute path the candidate replaces
|
|
755
777
|
* @param text - The candidate's full contents
|
|
756
778
|
* @returns Nothing
|
|
757
779
|
*/
|
|
758
780
|
set(path, text) {
|
|
759
|
-
|
|
781
|
+
const recorded = normalizePath(path);
|
|
782
|
+
this.#candidates.set(this.#key(recorded), [recorded, text]);
|
|
760
783
|
}
|
|
761
784
|
/**
|
|
762
785
|
* Reads the candidate text recorded for one absolute path.
|
|
@@ -765,7 +788,7 @@ var Overlay = class {
|
|
|
765
788
|
* @returns The recorded text, or `undefined` when this overlay holds no candidate there
|
|
766
789
|
*/
|
|
767
790
|
text(path) {
|
|
768
|
-
return this.#candidates.get(normalizePath(path));
|
|
791
|
+
return this.#candidates.get(this.#key(normalizePath(path)))?.[1];
|
|
769
792
|
}
|
|
770
793
|
/**
|
|
771
794
|
* Checks whether a candidate sits beneath one directory.
|
|
@@ -774,14 +797,16 @@ var Overlay = class {
|
|
|
774
797
|
* The answer is derived from the paths the overlay holds rather than stored, so it stops being
|
|
775
798
|
* true exactly when the inspection that declared those candidates clears them. Both sides pass
|
|
776
799
|
* through `normalizePath` first, because a tool that normalizes its own paths asks about a
|
|
777
|
-
* directory in a spelling the recorded path may not share.
|
|
800
|
+
* directory in a spelling the recorded path may not share. Case is never folded here: this is a
|
|
801
|
+
* containment comparison, and it reads the recorded spelling whatever an overlay minted for a
|
|
802
|
+
* case-folding host matches its lookup keys by.
|
|
778
803
|
*
|
|
779
804
|
* @param directory - The absolute directory path to check
|
|
780
805
|
* @returns True if a candidate path sits beneath the directory; false otherwise
|
|
781
806
|
*/
|
|
782
807
|
covers(directory) {
|
|
783
808
|
const base = `${normalizePath(directory).replace(/\/+$/, "")}/`;
|
|
784
|
-
for (const path of this.#candidates.
|
|
809
|
+
for (const [path] of this.#candidates.values()) if (path.startsWith(base)) return true;
|
|
785
810
|
return false;
|
|
786
811
|
}
|
|
787
812
|
/**
|
|
@@ -792,6 +817,9 @@ var Overlay = class {
|
|
|
792
817
|
clear() {
|
|
793
818
|
this.#candidates.clear();
|
|
794
819
|
}
|
|
820
|
+
#key(path) {
|
|
821
|
+
return this.#sensitive ? path : path.toLowerCase();
|
|
822
|
+
}
|
|
795
823
|
};
|
|
796
824
|
//#endregion
|
|
797
825
|
//#region package.json
|
|
@@ -1769,7 +1797,7 @@ var TypeStage = class {
|
|
|
1769
1797
|
this.#configure(this.#service(typescript, selection.project), selection.project);
|
|
1770
1798
|
await this.#unblock();
|
|
1771
1799
|
}
|
|
1772
|
-
const overlay = new Overlay();
|
|
1800
|
+
const overlay = new Overlay({ sensitive: this.#caseSensitive(typescript) });
|
|
1773
1801
|
this.#overlay = overlay;
|
|
1774
1802
|
try {
|
|
1775
1803
|
this.#record(subject.test, overlay);
|