feat(desktop): drop parked review flow, add publish management

SaaS 侧人工审核后才创建 publish job,desktop 不再做二次审核:移除
manual/waiting_user/parked/from_parked 状态机与 LeaseFromParked 查询,
desktop client 只执行发布并新增"发布管理"页(待发布队列 / 历史 / 再次
发送)。同时抽离 @geo/publisher-platforms 共享适配器包、新增 Redis-based
desktop_presence 与 publish_record_support,刷新 admin-web 发布弹窗与
媒体库;plan A / spec 文档同步口径。
This commit is contained in:
2026-04-20 09:52:48 +08:00
parent b16e9f0bd1
commit a617d39a4a
93 changed files with 5519 additions and 3594 deletions
+43 -9
View File
@@ -8,12 +8,18 @@ import type {
import type { DesktopAccountInfo, DesktopRuntimeSessionSyncRequest } from "@geo/shared-types";
import { bindPublishAccount, openPublishAccountConsole } from "./account-binder";
import { openTaskReview, refreshRuntimeAccounts, resolveParkedTask, syncRuntimeSession } from "./runtime-controller";
import { registerRendererDevtoolsProxyTarget } from "./renderer-devtools-proxy";
import {
refreshRuntimeAccounts,
releaseRuntimeSession,
syncRuntimeSession,
unbindRuntimeAccount,
} from "./runtime-controller";
import { createRuntimeSnapshot } from "./runtime-snapshot";
import { initScheduler } from "./scheduler";
import { initSessionRegistry } from "./session-registry";
import { initSingleInstance } from "./single-instance";
import { initTransport } from "./transport/api-client";
import { initTransport, listDesktopPublishTasks, retryDesktopPublishTask } from "./transport/api-client";
import { initTray } from "./tray";
import { STANDARD_USER_AGENT } from "./user-agent";
@@ -41,6 +47,7 @@ process.on("uncaughtException", (error) => {
});
let mainWindow: ElectronBrowserWindow | null = null;
let quitReleaseInFlight = false;
function rendererURL(): string | null {
return process.env.ELECTRON_RENDERER_URL ?? null;
@@ -66,6 +73,7 @@ async function mountRendererView(window: ElectronBrowserWindow): Promise<void> {
});
view.webContents.setWindowOpenHandler(() => ({ action: "deny" }));
registerRendererDevtoolsProxyTarget(view.webContents);
window.contentView.addChildView(view);
syncViewBounds(window, view);
window.on("resize", () => syncViewBounds(window, view));
@@ -121,6 +129,10 @@ function registerBridgeHandlers(): void {
await refreshRuntimeAccounts();
return account;
});
safeHandle("desktop:refresh-runtime-accounts", async () => {
await refreshRuntimeAccounts();
return null;
});
safeHandle(
"desktop:open-publish-account-console",
async (
@@ -131,17 +143,19 @@ function registerBridgeHandlers(): void {
return null;
},
);
safeHandle("desktop:task-open-review", async (_event, taskId: string) => {
await openTaskReview(taskId);
return null;
});
safeHandle(
"desktop:task-resolve-parked",
async (_event, taskId: string, status: "succeeded" | "failed" | "unknown") => {
await resolveParkedTask(taskId, status);
"desktop:unbind-publish-account",
async (_event, accountId: string, syncVersion: number) => {
await unbindRuntimeAccount(accountId, syncVersion);
return null;
},
);
safeHandle("desktop:list-publish-tasks", async (_event, params?: { page?: number; page_size?: number; title?: string }) => {
return listDesktopPublishTasks(params);
});
safeHandle("desktop:retry-publish-task", async (_event, taskId: string) => {
return retryDesktopPublishTask(taskId);
});
ipcMain.handle(
"desktop:runtime-session-sync",
(_event, session: DesktopRuntimeSessionSyncRequest | null) => {
@@ -149,6 +163,10 @@ function registerBridgeHandlers(): void {
return null;
},
);
safeHandle("desktop:runtime-session-release", async (_event, revoke?: boolean) => {
await releaseRuntimeSession({ revoke: Boolean(revoke) });
return null;
});
}
if (!initSingleInstance(() => {
@@ -191,3 +209,19 @@ app.on("window-all-closed", () => {
app.quit();
}
});
app.on("before-quit", (event) => {
if (quitReleaseInFlight) {
return;
}
quitReleaseInFlight = true;
event.preventDefault();
void Promise.race([
releaseRuntimeSession(),
new Promise<void>((resolve) => setTimeout(resolve, 1500)),
]).finally(() => {
app.quit();
});
});