@xevy/cli 0.1.17 → 0.1.18
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 +9 -7
- package/bin/dev-session.mjs +14 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -150,9 +150,9 @@ xevy dev VI22-07 --base https://xevy.example.com
|
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
The command stays attached across normal Pi exits and transient terminal
|
|
153
|
-
disconnects.
|
|
154
|
-
|
|
155
|
-
running.
|
|
153
|
+
disconnects. After Pi exits, it waits three seconds before restarting and shows
|
|
154
|
+
a `Ctrl+C` detach hint; press `Ctrl+]` while attached to leave the Dev Session
|
|
155
|
+
running immediately.
|
|
156
156
|
|
|
157
157
|
The CLI resolves an exact task ID or task code, attaches to its existing Dev
|
|
158
158
|
Session, or starts one from a linked repository. It then renders Pi's native TUI
|
|
@@ -165,8 +165,9 @@ repositories, the CLI presents a numbered selector first.
|
|
|
165
165
|
and Docker remain on the server. Press `Ctrl+]` to detach without stopping Pi;
|
|
166
166
|
run the same command again to reattach. Pi conversation history is stored in the
|
|
167
167
|
bounded Dev Session volume. The controller periodically commits work and pushes
|
|
168
|
-
the
|
|
169
|
-
|
|
168
|
+
the canonical task branch; exiting Pi also commits and pushes any final edits.
|
|
169
|
+
You do not need to ask the agent to commit after every prompt or merge a second
|
|
170
|
+
Dev Session branch when finishing.
|
|
170
171
|
|
|
171
172
|
Terminal control:
|
|
172
173
|
|
|
@@ -175,8 +176,9 @@ Ctrl+] Disconnect this terminal without stopping Pi or the Dev Session
|
|
|
175
176
|
```
|
|
176
177
|
|
|
177
178
|
Use the task's Dev Session panel in Xevy to open the live site, stop the session,
|
|
178
|
-
or finish
|
|
179
|
-
while the CLI is attached, within the
|
|
179
|
+
or finish it after exiting Pi. Preview redeploy remains a separate action. A
|
|
180
|
+
heartbeat keeps the session active while the CLI is attached, within the
|
|
181
|
+
server's hard expiry limit.
|
|
180
182
|
|
|
181
183
|
Host precedence is `--base`, `XEVY_BASE`, the saved credentials `baseUrl`, then
|
|
182
184
|
`https://xevy.ai`. API-key precedence is `XEVY_API_KEY`, then the saved key in
|
package/bin/dev-session.mjs
CHANGED
|
@@ -15,6 +15,7 @@ const SESSION_START_TIMEOUT_MS = 10 * 60_000;
|
|
|
15
15
|
const EXECUTION_RECONNECT_LIMIT = 8;
|
|
16
16
|
const TERMINAL_RECONNECT_LIMIT = 8;
|
|
17
17
|
const TERMINAL_RECONNECT_MAX_DELAY_MS = 5_000;
|
|
18
|
+
const TERMINAL_RESTART_GRACE_MS = 3_000;
|
|
18
19
|
const TERMINAL_STABLE_RUNTIME_MS = 10_000;
|
|
19
20
|
const TERMINAL_SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
20
21
|
|
|
@@ -740,6 +741,7 @@ async function attachNativeTerminalPersistently({
|
|
|
740
741
|
let consecutiveFailures = 0;
|
|
741
742
|
try {
|
|
742
743
|
while (!signal?.aborted) {
|
|
744
|
+
let reconnectDelayMs = null;
|
|
743
745
|
status.update(reconnecting ? "Restarting remote Pi terminal…" : "Starting remote Pi terminal…");
|
|
744
746
|
try {
|
|
745
747
|
const result = await attachNativeTerminal({
|
|
@@ -757,9 +759,12 @@ async function attachNativeTerminalPersistently({
|
|
|
757
759
|
consecutiveFailures = result?.durationMs >= TERMINAL_STABLE_RUNTIME_MS
|
|
758
760
|
? 0
|
|
759
761
|
: consecutiveFailures + 1;
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
762
|
+
if (result?.reason === "transport-lost") {
|
|
763
|
+
status.update("Terminal connection lost · reconnecting…");
|
|
764
|
+
} else {
|
|
765
|
+
reconnectDelayMs = TERMINAL_RESTART_GRACE_MS;
|
|
766
|
+
status.update("Pi exited · restarting in 3 seconds · Ctrl+C to detach");
|
|
767
|
+
}
|
|
763
768
|
} catch (error) {
|
|
764
769
|
if (signal?.aborted) throw error;
|
|
765
770
|
if (error instanceof DevSessionApiError && ![409, 502, 503, 504].includes(error.status)) throw error;
|
|
@@ -772,7 +777,8 @@ async function attachNativeTerminalPersistently({
|
|
|
772
777
|
throw new Error("The remote Pi terminal repeatedly exited before stabilizing. The Dev Session remains active; check its logs and rerun `xevy dev` after correcting the startup error.");
|
|
773
778
|
}
|
|
774
779
|
await sleep(
|
|
775
|
-
|
|
780
|
+
reconnectDelayMs
|
|
781
|
+
?? Math.min(500 * 2 ** Math.max(0, consecutiveFailures - 1), TERMINAL_RECONNECT_MAX_DELAY_MS),
|
|
776
782
|
signal,
|
|
777
783
|
);
|
|
778
784
|
let current = null;
|
|
@@ -798,7 +804,7 @@ function commandHelp(writeLine) {
|
|
|
798
804
|
writeLine(" /status Refresh session status");
|
|
799
805
|
writeLine(" /logs Show the latest Dev Session logs");
|
|
800
806
|
writeLine(" /open Open a fresh one-use Dev Session URL");
|
|
801
|
-
writeLine(" /finish
|
|
807
|
+
writeLine(" /finish Save the task branch and stop");
|
|
802
808
|
writeLine(" /stop Stop the Dev Session without finishing");
|
|
803
809
|
writeLine(" /detach Leave it running and exit this CLI");
|
|
804
810
|
writeLine(" /help Show these commands");
|
|
@@ -806,7 +812,7 @@ function commandHelp(writeLine) {
|
|
|
806
812
|
|
|
807
813
|
async function confirmAction({ interactive, ask, action }) {
|
|
808
814
|
if (!interactive) throw new Error(`/${action} requires an interactive confirmation.`);
|
|
809
|
-
const answer = (await ask(`${action === "finish" ? "
|
|
815
|
+
const answer = (await ask(`${action === "finish" ? "Save the task branch and finish this Dev Session" : "Stop this Dev Session"}? [y/N]: `)).toLowerCase();
|
|
810
816
|
return answer === "y" || answer === "yes";
|
|
811
817
|
}
|
|
812
818
|
|
|
@@ -1076,7 +1082,7 @@ export async function runDevSession(options) {
|
|
|
1076
1082
|
continue;
|
|
1077
1083
|
}
|
|
1078
1084
|
await api.request(`${sessionPath}/stop`, { method: "POST", body: {}, signal: detachController.signal });
|
|
1079
|
-
writeLine("Dev Session stopped.
|
|
1085
|
+
writeLine("Dev Session stopped. The pushed task branch is preserved for a safe resume.");
|
|
1080
1086
|
detached = true;
|
|
1081
1087
|
break;
|
|
1082
1088
|
}
|
|
@@ -1104,7 +1110,7 @@ export async function runDevSession(options) {
|
|
|
1104
1110
|
if (completed.status !== "succeeded") {
|
|
1105
1111
|
throw new Error(completed.errorMessage || `Finish ${completed.status}.`);
|
|
1106
1112
|
}
|
|
1107
|
-
writeLine("Finished: the
|
|
1113
|
+
writeLine("Finished: the task branch was saved and the workspace was stopped.");
|
|
1108
1114
|
detached = true;
|
|
1109
1115
|
break;
|
|
1110
1116
|
}
|
package/package.json
CHANGED