55e1c2e74b
Move monitor-task scheduling authority onto the client with a durable file-backed queue that survives restart, drops stale cross-day tasks, enforces per-platform serialism, and adapts global concurrency from Electron process metrics. Publish tasks keep their existing FIFO. Add a hidden Playwright CDP manager that attaches to Electron Chromium on account session partitions, lets adapters opt into `executionMode: "playwright"`, and leaves the existing hidden WebContentsView path in place for current adapters. Introduce an account-health subsystem with silent probes, projected health/auth states, and IPC invalidation events so the renderer can show accurate auth/probe status and verification timestamps. Server-side, derive and forward title/business_date/scheduler_group_key/ question_text metadata on desktop task events so the local scheduler can defer same-question fan-out before leasing.
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
import type {
|
|
CreatePublishJobResponse,
|
|
DesktopAccountInfo,
|
|
DesktopPublishTaskListResponse,
|
|
DesktopRuntimeSessionSyncRequest,
|
|
ListDesktopPublishTasksParams,
|
|
} from "@geo/shared-types";
|
|
import type { DesktopRuntimeSnapshot } from "./types";
|
|
|
|
export {};
|
|
|
|
declare global {
|
|
interface Window {
|
|
desktopBridge: {
|
|
app: {
|
|
ping(): Promise<string>;
|
|
deviceInfo(): Promise<{ device_name: string; os: string; cpu_arch: string }>;
|
|
runtimeSnapshot(): Promise<DesktopRuntimeSnapshot>;
|
|
bindPublishAccount(platformId: string): Promise<DesktopAccountInfo>;
|
|
refreshRuntimeAccounts(): Promise<null>;
|
|
openPublishAccountConsole(account: {
|
|
id: string;
|
|
platform: string;
|
|
platformUid: string;
|
|
displayName: string;
|
|
}): Promise<null>;
|
|
unbindPublishAccount(accountId: string, syncVersion: number): Promise<null>;
|
|
listPublishTasks(params?: ListDesktopPublishTasksParams): Promise<DesktopPublishTaskListResponse>;
|
|
retryPublishTask(taskId: string): Promise<CreatePublishJobResponse>;
|
|
syncRuntimeSession(session: DesktopRuntimeSessionSyncRequest | null): Promise<null>;
|
|
releaseRuntimeSession(revoke?: boolean): Promise<null>;
|
|
onRuntimeInvalidated(
|
|
listener: (event: { reason: "account-health"; at: number }) => void,
|
|
): () => void;
|
|
};
|
|
};
|
|
}
|
|
}
|