refactor: remove legacy Tauri desktop support
Electron updater now uses Electron release metadata only Removed legacy Tauri package and migration workflow Replaced Tauri shim usage with the desktop bridge
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
import { isTauriShell } from '@/lib/desktop';
|
||||
import { hasDesktopInvoke, invokeDesktop } from '@/lib/desktop';
|
||||
|
||||
type TauriInvoke = (cmd: string, args?: Record<string, unknown>) => Promise<unknown>;
|
||||
type DesktopInvoke = (cmd: string, args?: Record<string, unknown>) => Promise<unknown>;
|
||||
|
||||
type TauriGlobal = {
|
||||
core?: {
|
||||
invoke?: TauriInvoke;
|
||||
};
|
||||
event?: {
|
||||
listen?: (
|
||||
event: string,
|
||||
handler: (evt: { payload?: unknown }) => void,
|
||||
) => Promise<() => void>;
|
||||
};
|
||||
type DesktopBridgeGlobal = {
|
||||
listen?: (
|
||||
event: string,
|
||||
handler: (evt: { payload?: unknown }) => void,
|
||||
) => Promise<() => void>;
|
||||
};
|
||||
|
||||
export type DesktopSshRemoteMode = 'managed' | 'external';
|
||||
@@ -126,10 +121,9 @@ const asStringArray = (value: unknown): string[] => {
|
||||
return value.filter((item): item is string => typeof item === 'string');
|
||||
};
|
||||
|
||||
const getInvoke = (): TauriInvoke | null => {
|
||||
if (!isTauriShell()) return null;
|
||||
const tauri = (window as unknown as { __TAURI__?: TauriGlobal }).__TAURI__;
|
||||
return typeof tauri?.core?.invoke === 'function' ? tauri.core.invoke : null;
|
||||
const getInvoke = (): DesktopInvoke | null => {
|
||||
if (!hasDesktopInvoke()) return null;
|
||||
return (command, args) => invokeDesktop(command, args) as Promise<unknown>;
|
||||
};
|
||||
|
||||
const parseStoredSecret = (value: unknown): DesktopSshStoredSecret | undefined => {
|
||||
@@ -432,12 +426,12 @@ export const desktopSshLogsClear = async (id: string): Promise<void> => {
|
||||
export const listenDesktopSshStatus = async (
|
||||
listener: (status: DesktopSshInstanceStatus) => void,
|
||||
): Promise<() => Promise<void>> => {
|
||||
if (!isTauriShell()) {
|
||||
if (!hasDesktopInvoke()) {
|
||||
return async () => {};
|
||||
}
|
||||
|
||||
const tauri = (window as unknown as { __TAURI__?: TauriGlobal }).__TAURI__;
|
||||
const listen = tauri?.event?.listen;
|
||||
const desktop = (window as unknown as { __OPENCHAMBER_DESKTOP__?: DesktopBridgeGlobal }).__OPENCHAMBER_DESKTOP__;
|
||||
const listen = desktop?.listen;
|
||||
if (typeof listen !== 'function') {
|
||||
return async () => {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user