@xevy/cli 0.1.16 → 0.1.17
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/bin/dev-session.mjs +10 -11
- package/package.json +1 -1
package/bin/dev-session.mjs
CHANGED
|
@@ -244,13 +244,12 @@ export function createApiClient({ base, token, fetchImpl, registerController, se
|
|
|
244
244
|
return { request };
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
function
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
return parsed.toString().replace(/\/$/, "");
|
|
247
|
+
export function devSessionLaunchUrl(base, task) {
|
|
248
|
+
const origin = normalizeBaseUrl(base);
|
|
249
|
+
return new URL(
|
|
250
|
+
`/${encodeURIComponent(task.workspaceIdentifier)}/${encodeURIComponent(task.projectIdentifier)}/task/${encodeURIComponent(task.id)}/dev-session/open`,
|
|
251
|
+
`${origin}/`,
|
|
252
|
+
).toString();
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
function formatTask(task) {
|
|
@@ -600,8 +599,8 @@ export function createTerminalStatus({ output, writeLine, animate }) {
|
|
|
600
599
|
};
|
|
601
600
|
}
|
|
602
601
|
|
|
603
|
-
function sessionSummary(task, session, writeLine) {
|
|
604
|
-
const url =
|
|
602
|
+
function sessionSummary(task, session, base, writeLine) {
|
|
603
|
+
const url = devSessionLaunchUrl(base, task);
|
|
605
604
|
writeLine("\nDev Session");
|
|
606
605
|
writeLine(` Task ${formatTask(task)}`);
|
|
607
606
|
writeLine(` Site ${url || "not available yet"}`);
|
|
@@ -991,7 +990,7 @@ export async function runDevSession(options) {
|
|
|
991
990
|
sleep,
|
|
992
991
|
signal: detachController.signal,
|
|
993
992
|
});
|
|
994
|
-
sessionSummary(task, session, writeLine);
|
|
993
|
+
sessionSummary(task, session, base, writeLine);
|
|
995
994
|
|
|
996
995
|
const nativeTerminal = options.nativeTerminal
|
|
997
996
|
?? (input === process.stdin && output === process.stdout);
|
|
@@ -1058,7 +1057,7 @@ export async function runDevSession(options) {
|
|
|
1058
1057
|
const result = await api.request(`${sessionPath}/`, { signal: detachController.signal });
|
|
1059
1058
|
if (!result?.session) throw new Error("No active Dev Session remains for this task.");
|
|
1060
1059
|
session = result.session;
|
|
1061
|
-
sessionSummary(task, session, writeLine);
|
|
1060
|
+
sessionSummary(task, session, base, writeLine);
|
|
1062
1061
|
continue;
|
|
1063
1062
|
}
|
|
1064
1063
|
if (prompt === "/logs") {
|
package/package.json
CHANGED