@xynogen/pix-models 0.2.6 → 0.2.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-models",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Pi extension — enhanced /models picker with BenchLM ranks",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@xynogen/pix-data": "^0.5.0",
47
47
  "@xynogen/pix-pretty": "^1.11.2",
48
- "@xynogen/pix-runtime": "^0.8.0"
48
+ "@xynogen/pix-runtime": "^0.10.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@earendil-works/pi-coding-agent": "*",
@@ -19,30 +19,21 @@
19
19
  * 3. createRequire against the extension's own node_modules.
20
20
  */
21
21
 
22
- import {
23
- accessSync,
24
- constants,
25
- existsSync,
26
- readdirSync,
27
- readFileSync,
28
- realpathSync,
29
- writeFileSync,
30
- } from "node:fs";
22
+ import { existsSync, readdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
31
23
  import { createRequire } from "node:module";
32
24
  import { homedir } from "node:os";
33
- import { delimiter, join, sep } from "node:path";
25
+ import { join, sep } from "node:path";
26
+ import { findExecutableSync } from "@xynogen/pix-runtime/which";
34
27
 
35
- /** Locate `pi` on PATH (a pure-JS `which`), returning its real (symlink-resolved) path. */
28
+ /** Locate `pi` on PATH, returning its real (symlink-resolved) path. */
36
29
  function resolvePiBinary(): string | undefined {
37
- for (const dir of (process.env.PATH ?? "").split(delimiter)) {
38
- if (!dir) continue;
39
- const candidate = join(dir, "pi");
40
- try {
41
- accessSync(candidate, constants.X_OK);
42
- return realpathSync(candidate);
43
- } catch {}
30
+ const found = findExecutableSync("pi");
31
+ if (!found) return undefined;
32
+ try {
33
+ return realpathSync(found);
34
+ } catch {
35
+ return found;
44
36
  }
45
- return undefined;
46
37
  }
47
38
 
48
39
  // The assignment appears once per build. `\s*=\s*\[` avoids the `.map(...)`