feat(desktop): implement workspace foundation + desktop-client skeleton

Plan 0 (workspaces): add workspaces + workspace_memberships schema, extend
JWT/Actor/claims with primary_workspace_id, seed default workspace per tenant,
thread workspace_id through tenant monitoring quota.

Plan A (desktop skeleton): new Electron app (apps/desktop-client) with main/
preload/renderer, shared Vue component package (packages/ui-shared), and server
surface — desktop client registration + token rotation + heartbeat, SSE task
event stream, desktop accounts/tasks/content handlers, publish job endpoint,
and supporting repositories, services, sqlc queries, and migrations.

Hard cutover per plan: remove browser-extension monitoring callback endpoints,
stub legacy media API in admin-web, and delete monitoring_callback_handler.go.
This commit is contained in:
2026-04-19 14:18:20 +08:00
parent 98f9e95875
commit b16e9f0bd1
141 changed files with 21533 additions and 357 deletions
+28
View File
@@ -0,0 +1,28 @@
import { contextBridge, ipcRenderer } from "electron/renderer";
import type { DesktopAccountInfo, DesktopRuntimeSessionSyncRequest } from "@geo/shared-types";
import type { DesktopRuntimeSnapshot } from "../renderer/types";
const desktopBridge = {
app: {
ping: () => ipcRenderer.invoke("desktop:ping") as Promise<string>,
runtimeSnapshot: () =>
ipcRenderer.invoke("desktop:runtime-snapshot") as Promise<DesktopRuntimeSnapshot>,
bindPublishAccount: (platformId: string) =>
ipcRenderer.invoke("desktop:bind-publish-account", platformId) as Promise<DesktopAccountInfo>,
openPublishAccountConsole: (account: {
id: string;
platform: string;
platformUid: string;
displayName: string;
}) =>
ipcRenderer.invoke("desktop:open-publish-account-console", account) as Promise<null>,
openTaskReview: (taskId: string) =>
ipcRenderer.invoke("desktop:task-open-review", taskId) as Promise<null>,
resolveParkedTask: (taskId: string, status: "succeeded" | "failed" | "unknown") =>
ipcRenderer.invoke("desktop:task-resolve-parked", taskId, status) as Promise<null>,
syncRuntimeSession: (session: DesktopRuntimeSessionSyncRequest | null) =>
ipcRenderer.invoke("desktop:runtime-session-sync", session) as Promise<null>,
},
};
contextBridge.exposeInMainWorld("desktopBridge", desktopBridge);