feat: add beta release channel

This commit is contained in:
Mohamed Boudra
2026-04-20 20:38:56 +07:00
parent 831d990ef7
commit dfc814147a
32 changed files with 442 additions and 256 deletions
+18 -7
View File
@@ -11,7 +11,11 @@ import {
readManagedFileBase64,
writeAttachmentBase64,
} from "../features/attachments.js";
import { checkForAppUpdate, downloadAndInstallUpdate } from "../features/auto-updater.js";
import {
checkForAppUpdate,
downloadAndInstallUpdate,
type AppReleaseChannel,
} from "../features/auto-updater.js";
import {
installCli,
getCliInstallStatus,
@@ -65,6 +69,10 @@ type DesktopPairingOffer = {
type DesktopCommandHandler = (args?: Record<string, unknown>) => Promise<unknown> | unknown;
function parseReleaseChannel(args: Record<string, unknown> | undefined): AppReleaseChannel {
return args?.releaseChannel === "beta" ? "beta" : "stable";
}
// ---------------------------------------------------------------------------
// Utilities
// ---------------------------------------------------------------------------
@@ -483,15 +491,18 @@ export function createDaemonCommandHandlers(): Record<string, DesktopCommandHand
: "";
if (sessionId) closeLocalTransportSession(sessionId);
},
check_app_update: async () => {
check_app_update: async (args) => {
const currentVersion = await resolveCurrentUpdateVersion();
return checkForAppUpdate(currentVersion);
return checkForAppUpdate({ currentVersion, releaseChannel: parseReleaseChannel(args) });
},
install_app_update: async () => {
install_app_update: async (args) => {
const currentVersion = await resolveCurrentUpdateVersion();
return downloadAndInstallUpdate(currentVersion, async () => {
await stopDaemon();
});
return downloadAndInstallUpdate(
{ currentVersion, releaseChannel: parseReleaseChannel(args) },
async () => {
await stopDaemon();
},
);
},
get_local_daemon_version: () => getLocalDaemonVersion(),
install_cli: () => installCli(),