@xevy/cli 0.1.24 → 0.1.26

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/README.md CHANGED
@@ -240,3 +240,7 @@ per-agent flags, and manual install steps.
240
240
  Docs: <https://xevy.ai/docs/mcp>
241
241
 
242
242
  New workspaces open the editor and terminal first. Start repository runtimes when you need a preview. Each new task-free session has a separate branch. The CLI prints a request UUID before creation; repeat it with `--request-key` if the response is lost.
243
+
244
+ ## Ended workspace cleanup
245
+
246
+ Ended Dev Sessions retain their workspace for 30 minutes. The session status shows the confirmed deletion time when files are retained. Workspace files, including uncommitted and unpushed changes, are permanently deleted at that deadline. Save work to GitHub before leaving a session. Saved conversations remain available under their separate retention policy.
@@ -645,6 +645,16 @@ export function createTerminalStatus({ output, writeLine, animate }) {
645
645
  };
646
646
  }
647
647
 
648
+ export function printWorkspaceRetention(session, writeLine) {
649
+ const preserved = typeof session?.workspacePreserved === "boolean" ? session.workspacePreserved : session?.config?.workspacePreserved === true;
650
+ if (!preserved) return;
651
+ const deadline = session.workspaceDeleteAt !== undefined ? session.workspaceDeleteAt : session.config?.workspaceDeleteAt;
652
+ if (typeof deadline === "string" && Number.isFinite(Date.parse(deadline))) {
653
+ writeLine(` Delete workspace at ${new Date(deadline).toISOString()}`);
654
+ writeLine(session.workspaceDeletionWarning || "Workspace files, including uncommitted and unpushed changes, are permanently deleted 30 minutes after the session ends.");
655
+ } else writeLine("Workspace deletion deadline unavailable. Save local work to GitHub.");
656
+ }
657
+
648
658
  function sessionSummary(context, session, base, writeLine) {
649
659
  const task = context.kind === "task" ? context.task : null;
650
660
  const url = task
@@ -663,6 +673,7 @@ function sessionSummary(context, session, base, writeLine) {
663
673
  writeLine(` Status ${session.status}`);
664
674
  if (session.runtimeHealth) writeLine(` Runtime ${session.runtimeHealth.status}${session.runtimeHealth.error ? ` · ${session.runtimeHealth.error.message}` : ""}`);
665
675
  writeLine(` Expires ${session.expiresAt || "server-managed"}`);
676
+ printWorkspaceRetention(session, writeLine);
666
677
  writeLine("\nXevy terminal · press Ctrl+] to detach and leave it running\n");
667
678
  }
668
679
 
@@ -879,6 +890,37 @@ async function confirmAction({ interactive, ask, action }) {
879
890
  return answer === "y" || answer === "yes";
880
891
  }
881
892
 
893
+ /** Offer publication separately for every registered worktree. Unanswered means skip. */
894
+ export async function chooseDevSessionBranches({ api, sessionId, interactive, ask, writeLine, signal }) {
895
+ if (!interactive) throw new Error("Branch publication choices require an interactive session.");
896
+ const snapshot = await api.request(`/api/agent/dev-sessions/${encodeURIComponent(sessionId)}/branches`, { signal });
897
+ if (!Array.isArray(snapshot?.branches)) throw new Error("Could not list registered branches. The session remains open.");
898
+ const choices = [];
899
+ for (const branch of snapshot.branches) {
900
+ writeLine(`Repository: ${branch.repositoryName} · branch: ${branch.branch} · task: ${branch.taskCode || branch.taskTitle || "Task-free"} · base: ${branch.baseBranch}`);
901
+ if (branch.headSha !== branch.pushedSha) writeLine(" Unpushed commits; skipped work stays local.");
902
+ const answer = String(await ask(`Save & push ${branch.branch}? [y/N]: `)).trim().toLowerCase();
903
+ const action = answer === "y" || answer === "yes" ? "push" : "skip";
904
+ choices.push({ branchId: branch.id, action, generation: branch.generation });
905
+ if (action === "skip") writeLine(` Skipped ${branch.branch}; local commits retained.`);
906
+ }
907
+ return choices;
908
+ }
909
+ export function printDevSessionBranchResults(result, writeLine) {
910
+ for (const item of result?.branchResults || []) {
911
+ writeLine(`${item.branch || item.branchId}: ${item.status}${item.error ? ` · ${item.error}` : ""}`);
912
+ }
913
+ for (const branch of result?.branches || []) {
914
+ writeLine(`${branch.branch}: ${branch.status}${branch.pushedSha ? ` · pushed ${branch.pushedSha}` : ""}`);
915
+ if (branch.pullRequest?.url) writeLine(` PR #${branch.pullRequest.number}: ${branch.pullRequest.url}`);
916
+ else {
917
+ if (branch.prUnavailableReason) writeLine(` PR unavailable: ${branch.prUnavailableReason}`);
918
+ if (branch.compareUrl) writeLine(` Compare: ${branch.compareUrl}`);
919
+ }
920
+ if (branch.error) writeLine(` ${branch.error} Local work is retained.`);
921
+ }
922
+ }
923
+
882
924
  async function launchBrowser({ api, sessionPath, platform, spawnImpl, writeLaunchLine }) {
883
925
  const result = await api.request(`${sessionPath}/open`, { method: "POST", body: {} });
884
926
  const launchUrl = result?.launchUrl;
@@ -1244,8 +1286,12 @@ export async function runDevSession(options) {
1244
1286
  writeLine("Stop cancelled.");
1245
1287
  continue;
1246
1288
  }
1247
- await api.request(`${sessionPath}/stop`, { method: "POST", body: {}, signal: detachController.signal });
1248
- writeLine("Dev Session stopped. The pushed task branch is preserved for a safe resume.");
1289
+ const branches = await chooseDevSessionBranches({ api, sessionId: session.id, interactive, ask, writeLine, signal: detachController.signal });
1290
+ const result = await api.request(`${sessionPath}/stop`, { method: "POST", body: { branches }, signal: detachController.signal, timeoutMs: 220_000 });
1291
+ printDevSessionBranchResults(result, writeLine);
1292
+ printDevSessionBranchResults(await api.request(`/api/agent/dev-sessions/${encodeURIComponent(session.id)}/branches`, { signal: detachController.signal }), writeLine);
1293
+ writeLine("Dev Session stop completed. Branch save results are shown above.");
1294
+ printWorkspaceRetention(result.session, writeLine);
1249
1295
  detached = true;
1250
1296
  break;
1251
1297
  }
@@ -1254,11 +1300,13 @@ export async function runDevSession(options) {
1254
1300
  writeLine("Finish cancelled.");
1255
1301
  continue;
1256
1302
  }
1303
+ const branches = await chooseDevSessionBranches({ api, sessionId: session.id, interactive, ask, writeLine, signal: detachController.signal });
1257
1304
  const result = await api.request(`${sessionPath}/finish`, {
1258
1305
  method: "POST",
1259
- body: {},
1306
+ body: { branches },
1260
1307
  signal: detachController.signal,
1261
1308
  });
1309
+ printDevSessionBranchResults(result, writeLine);
1262
1310
  writeLine(`Finishing through agent execution ${result.executionId}…`);
1263
1311
  const completed = await followExecution({
1264
1312
  api,
@@ -1273,6 +1321,7 @@ export async function runDevSession(options) {
1273
1321
  if (completed.status !== "succeeded") {
1274
1322
  throw new Error(completed.errorMessage || `Finish ${completed.status}.`);
1275
1323
  }
1324
+ printDevSessionBranchResults(await api.request(`/api/agent/dev-sessions/${encodeURIComponent(session.id)}/branches`, { signal: detachController.signal }), writeLine);
1276
1325
  writeLine("Finished: the task branch was saved and the workspace was stopped.");
1277
1326
  detached = true;
1278
1327
  break;
package/bin/xevy.mjs CHANGED
@@ -33,7 +33,8 @@ const DEFAULT_AGENTS = ["cursor", "claude-code", "codex"];
33
33
  const SETUP_COMPONENTS = ["credentials", "pi", "skills", "mcp"];
34
34
  const isWindows = process.platform === "win32";
35
35
 
36
- const PI_PACKAGE = "@mariozechner/pi-coding-agent";
36
+ const PI_VERSION = "1.1.0";
37
+ const PI_PACKAGE = `@earendil-works/pi-coding-agent@${PI_VERSION}`;
37
38
  const PI_BIN = isWindows ? "pi.cmd" : "pi";
38
39
 
39
40
  // Where `xevy setup` installs the extension and `xevy` loads it from.
@@ -260,15 +261,28 @@ function hasPi() {
260
261
  return !r.error && r.status === 0;
261
262
  }
262
263
 
264
+ function supportedPi() {
265
+ const result = spawnSync(PI_BIN, ["--version"], { encoding: "utf8", shell: isWindows });
266
+ const reported = [result.stdout, result.stderr].map(value => String(value ?? "")).join("\n")
267
+ .split(/\r?\n/).map(line => line.trim()).find(line => /^\d+\.\d+\.\d+$/.test(line));
268
+ return !result.error && result.status === 0 && reported === PI_VERSION;
269
+ }
270
+
271
+ function requirePiNode() {
272
+ const [major, minor] = process.versions.node.split(".").map(Number);
273
+ if (major < 22 || major === 22 && minor < 19) die("Xevy Pi requires Node.js >=22.19.0. Upgrade Node.js before installing or opening Xevy.");
274
+ }
275
+
263
276
  function ensurePi() {
264
- if (hasPi()) {
277
+ requirePiNode();
278
+ if (supportedPi()) {
265
279
  console.log("→ pi agent already installed");
266
280
  return;
267
281
  }
268
- console.log(`→ pi agent not found — installing ${PI_PACKAGE} globally…`);
282
+ console.log(`→ pi agent missing or unsupported — installing ${PI_PACKAGE} globally…`);
269
283
  run("npm", ["install", "-g", PI_PACKAGE], { label: `npm install -g ${PI_PACKAGE}` });
270
- if (!hasPi()) {
271
- die("pi is still not on PATH after install. Ensure your npm global bin dir is on PATH, then re-run.");
284
+ if (!supportedPi()) {
285
+ die(`pi ${PI_VERSION} is still not on PATH after install. Ensure your npm global bin dir is on PATH, then re-run.`);
272
286
  }
273
287
  }
274
288
 
@@ -676,7 +690,8 @@ async function setup(opts) {
676
690
  async function update(opts) {
677
691
  console.log("Updating Xevy\n");
678
692
 
679
- // 1. Re-download the pi extensions (they carry the date-stamped versions).
693
+ // 1. Upgrade Pi before loading extensions that require dynamic activation.
694
+ ensurePi();
680
695
  await downloadAllExtensions(opts.base);
681
696
 
682
697
  // 2. Skills + MCP via @xevy/skills.
@@ -705,9 +720,11 @@ function check(opts) {
705
720
  }
706
721
 
707
722
  async function open(opts) {
723
+ requirePiNode();
708
724
  if (!hasPi()) {
709
725
  die("pi is not installed. Run `xevy setup` first.");
710
726
  }
727
+ if (!supportedPi()) die(`Xevy requires pi ${PI_VERSION}. Run \`xevy setup --pi\` to install the supported runtime.`);
711
728
  let files = [];
712
729
  if (fs.existsSync(XEVY_EXTENSIONS_DIR)) {
713
730
  files = fs
@@ -727,7 +744,9 @@ async function open(opts) {
727
744
 
728
745
  const piArgs = [];
729
746
  for (const f of files) piArgs.push("-e", f);
730
- piArgs.push(...opts.piArgs);
747
+ const overrides = opts.piArgs.some((arg) => /^(?:--model|--provider|--thinking|-m)(?:=|$)/.test(arg));
748
+ if (overrides) die("Xevy selects models and reasoning automatically. Remove model/provider/thinking options and try again.");
749
+ piArgs.push(...opts.piArgs, "--provider", "xevy", "--model", "auto");
731
750
 
732
751
  const r = spawnSync(PI_BIN, piArgs, { stdio: "inherit", shell: isWindows, env: process.env });
733
752
  if (r.error) die(r.error.message);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xevy/cli",
3
- "version": "0.1.24",
4
- "description": "Xevy CLI — connect to remote Dev Sessions, configure credentials, pi, coding-agent skills, and MCP, and keep integrations current.",
3
+ "version": "0.1.26",
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": [
7
7
  "xevy",