pi-supernova 0.0.11 → 0.0.15

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/vfs.js CHANGED
@@ -129,11 +129,6 @@ export class CausalVfs {
129
129
  this.cache.clear();
130
130
  }
131
131
 
132
- clear() {
133
- this.invalidateCache();
134
- this.overlays.length = 0;
135
- }
136
-
137
132
  getCacheSize() {
138
133
  return this.cache.size;
139
134
  }
package/workspace.js CHANGED
@@ -41,6 +41,20 @@ async function realpathNearest(target) {
41
41
  }
42
42
  }
43
43
 
44
+ /** Workspace-relative path with "/" separators, the form every model-facing surface uses. */
45
+ export function relativeSlash(root, absolute) {
46
+ return (path.relative(root, absolute) || absolute).split(path.sep).join("/");
47
+ }
48
+
49
+ const TEST_SEGMENTS = new Set(["test", "tests", "__tests__", "spec"]);
50
+
51
+ /** One rule for "is this a test file" across snap, evidence, and outlines. */
52
+ export function isTestPath(filePath) {
53
+ const segments = filePath.split(/[\\/]/);
54
+ const base = segments[segments.length - 1];
55
+ return segments.some((s) => TEST_SEGMENTS.has(s)) || /\.(test|spec)\./.test(base);
56
+ }
57
+
44
58
  export async function resolveWorkspacePath(cwd, inputPath, opName, allowRoot = false) {
45
59
  if (inputPath == null || !isString(inputPath) || !inputPath.trim()) {
46
60
  throw new Error(`${opName} requires path`);