import type { DesktopArticleContent, JsonValue } from "@geo/shared-types"; import type { Session, WebContentsView } from "electron"; import type { Browser as PlaywrightBrowser, Page as PlaywrightPage } from "playwright-core"; export type AdapterTaskPhase = "initial" | "resume"; export type AdapterCompletionStatus = "succeeded" | "failed" | "unknown"; export type AdapterExecutionMode = "session" | "view" | "playwright"; export interface AdapterContext { taskId: string; accountId: string; session: Session; view: WebContentsView | null; playwright: { browser: PlaywrightBrowser; page: PlaywrightPage; } | null; signal: AbortSignal; phase: AdapterTaskPhase; reportProgress(stage: string): void; } export interface PublishAdapterContext extends AdapterContext { article: DesktopArticleContent; } export interface AdapterExecutionResult { status: AdapterCompletionStatus; summary: string; payload?: Record; error?: Record; } export interface PublishAdapter { platform: string; executionMode?: AdapterExecutionMode; publish(context: PublishAdapterContext, payload: Record): Promise; } export interface MonitorAdapter { provider: string; executionMode?: AdapterExecutionMode; query(context: AdapterContext, payload: Record): Promise; }