@xevy/cli 0.1.25 → 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 +4 -0
- package/bin/dev-session.mjs +52 -3
- package/bin/xevy.mjs +15 -7
- package/package.json +1 -1
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.
|
package/bin/dev-session.mjs
CHANGED
|
@@ -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
|
|
1248
|
-
|
|
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,8 +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_VERSION = "
|
|
37
|
-
const PI_PACKAGE = `@
|
|
36
|
+
const PI_VERSION = "1.1.0";
|
|
37
|
+
const PI_PACKAGE = `@earendil-works/pi-coding-agent@${PI_VERSION}`;
|
|
38
38
|
const PI_BIN = isWindows ? "pi.cmd" : "pi";
|
|
39
39
|
|
|
40
40
|
// Where `xevy setup` installs the extension and `xevy` loads it from.
|
|
@@ -268,15 +268,21 @@ function supportedPi() {
|
|
|
268
268
|
return !result.error && result.status === 0 && reported === PI_VERSION;
|
|
269
269
|
}
|
|
270
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
|
+
|
|
271
276
|
function ensurePi() {
|
|
277
|
+
requirePiNode();
|
|
272
278
|
if (supportedPi()) {
|
|
273
279
|
console.log("→ pi agent already installed");
|
|
274
280
|
return;
|
|
275
281
|
}
|
|
276
|
-
console.log(`→ pi agent
|
|
282
|
+
console.log(`→ pi agent missing or unsupported — installing ${PI_PACKAGE} globally…`);
|
|
277
283
|
run("npm", ["install", "-g", PI_PACKAGE], { label: `npm install -g ${PI_PACKAGE}` });
|
|
278
|
-
if (!
|
|
279
|
-
die(
|
|
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.`);
|
|
280
286
|
}
|
|
281
287
|
}
|
|
282
288
|
|
|
@@ -684,7 +690,8 @@ async function setup(opts) {
|
|
|
684
690
|
async function update(opts) {
|
|
685
691
|
console.log("Updating Xevy\n");
|
|
686
692
|
|
|
687
|
-
// 1.
|
|
693
|
+
// 1. Upgrade Pi before loading extensions that require dynamic activation.
|
|
694
|
+
ensurePi();
|
|
688
695
|
await downloadAllExtensions(opts.base);
|
|
689
696
|
|
|
690
697
|
// 2. Skills + MCP via @xevy/skills.
|
|
@@ -713,10 +720,11 @@ function check(opts) {
|
|
|
713
720
|
}
|
|
714
721
|
|
|
715
722
|
async function open(opts) {
|
|
723
|
+
requirePiNode();
|
|
716
724
|
if (!hasPi()) {
|
|
717
725
|
die("pi is not installed. Run `xevy setup` first.");
|
|
718
726
|
}
|
|
719
|
-
if (!supportedPi()) die(`Xevy requires pi ${PI_VERSION}. Run \`xevy setup\` to install the supported runtime.`);
|
|
727
|
+
if (!supportedPi()) die(`Xevy requires pi ${PI_VERSION}. Run \`xevy setup --pi\` to install the supported runtime.`);
|
|
720
728
|
let files = [];
|
|
721
729
|
if (fs.existsSync(XEVY_EXTENSIONS_DIR)) {
|
|
722
730
|
files = fs
|
package/package.json
CHANGED