@xevy/cli 0.1.30 → 0.1.31

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 (2) hide show
  1. package/bin/xevy.mjs +20 -7
  2. package/package.json +1 -1
package/bin/xevy.mjs CHANGED
@@ -36,8 +36,9 @@ const DEFAULT_AGENTS = ["cursor", "claude-code", "codex"];
36
36
  const SETUP_COMPONENTS = ["credentials", "pi", "skills", "mcp"];
37
37
  const isWindows = process.platform === "win32";
38
38
 
39
- const PI_VERSION = "1.1.0";
40
- const PI_PACKAGE = `@earendil-works/pi-coding-agent@${PI_VERSION}`;
39
+ // Oldest pi Xevy runs on; setup installs the latest release.
40
+ const PI_MIN_VERSION = "1.1.0";
41
+ const PI_PACKAGE = "@earendil-works/pi-coding-agent@latest";
41
42
  const PI_BIN = isWindows ? "pi.cmd" : "pi";
42
43
 
43
44
  // Where `xevy setup` installs the extension and `xevy` loads it from.
@@ -321,8 +322,20 @@ function hasPi() {
321
322
  function supportedPi() {
322
323
  const result = spawnSync(PI_BIN, ["--version"], { encoding: "utf8", shell: isWindows });
323
324
  const reported = [result.stdout, result.stderr].map(value => String(value ?? "")).join("\n")
324
- .split(/\r?\n/).map(line => line.trim()).find(line => /^\d+\.\d+\.\d+$/.test(line));
325
- return !result.error && result.status === 0 && reported === PI_VERSION;
325
+ .split(/\r?\n/).map(line => line.trim()).find(line => /^\d+\.\d+\.\d+(?:[-+]\S*)?$/.test(line));
326
+ return !result.error && result.status === 0 && Boolean(reported) && piVersionAtLeast(reported, PI_MIN_VERSION);
327
+ }
328
+
329
+ /** Semver order on major.minor.patch; a prerelease sorts below its own release. */
330
+ function piVersionAtLeast(version, minimum) {
331
+ const parse = (value) => /^(\d+)\.(\d+)\.(\d+)(-[^+\s]+)?(?:\+\S*)?$/.exec(value);
332
+ const actual = parse(version);
333
+ const floor = parse(minimum);
334
+ if (!actual || !floor) return false;
335
+ for (let i = 1; i <= 3; i++) {
336
+ if (Number(actual[i]) !== Number(floor[i])) return Number(actual[i]) > Number(floor[i]);
337
+ }
338
+ return !actual[4] || Boolean(floor[4]);
326
339
  }
327
340
 
328
341
  function requirePiNode() {
@@ -339,7 +352,7 @@ function ensurePi() {
339
352
  console.log(`→ pi agent missing or unsupported — installing ${PI_PACKAGE} globally…`);
340
353
  run("npm", ["install", "-g", PI_PACKAGE], { label: `npm install -g ${PI_PACKAGE}` });
341
354
  if (!supportedPi()) {
342
- die(`pi ${PI_VERSION} is still not on PATH after install. Ensure your npm global bin dir is on PATH, then re-run.`);
355
+ die(`pi ${PI_MIN_VERSION} or newer is still not on PATH after install. Ensure your npm global bin dir is on PATH, then re-run.`);
343
356
  }
344
357
  }
345
358
 
@@ -780,9 +793,9 @@ function check(opts) {
780
793
  function requireXevyPi() {
781
794
  requirePiNode();
782
795
  if (!hasPi()) {
783
- die("pi is not installed. Run `xevy setup` first.");
796
+ die("pi is not installed. Run `xevy setup --pi` to install the latest pi.");
784
797
  }
785
- if (!supportedPi()) die(`Xevy requires pi ${PI_VERSION}. Run \`xevy setup --pi\` to install the supported runtime.`);
798
+ if (!supportedPi()) die(`Xevy needs pi ${PI_MIN_VERSION} or newer. Run \`xevy setup --pi\` to install the latest pi.`);
786
799
  let files = [];
787
800
  if (fs.existsSync(XEVY_EXTENSIONS_DIR)) {
788
801
  files = fs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xevy/cli",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "description": "Xevy CLI \u2014 connect to remote Dev Sessions, configure credentials, pi, coding-agent skills, and MCP, and keep integrations current.",
5
5
  "type": "module",
6
6
  "keywords": [