import type { BrowserWindow } from 'electron'; import type { OpencodeManager } from '../opencode/manager'; import type { OpencodeProjectStore } from '../opencode/project-store'; import type { HostEventBus } from './event-bus'; import type { createWorksCloudDeployment } from '../services/works-cloud-deployment'; import type { DesignWorkspaceModule } from '../image-workspace/module'; import type { AgentBrowserBounds, AgentBrowserCdpEventPage, AgentBrowserCdpResult, AgentBrowserPayloadChunk, AgentBrowserSnapshot, } from '../../shared/agent-browser'; export type WorksCloudDeploymentCoordinator = ReturnType; export interface AgentBrowserService { getSnapshot(projectPath?: string): Promise | AgentBrowserSnapshot; open(input: { projectId: string; projectPath: string; url: string; bounds?: AgentBrowserBounds; visible?: boolean; }): Promise; present(input: { projectPath: string; visible: boolean; bounds?: AgentBrowserBounds; }): Promise; navigate(input: { projectPath: string; action: 'url' | 'back' | 'forward' | 'reload'; url?: string; }): Promise; sendCdp(input: { projectPath: string; method: string; params?: Record; sessionRef?: string; timeoutMs?: number; }): Promise; readEvents(input: { projectPath: string; after?: number; methods?: string[]; limit?: number; waitMs?: number; }): Promise; readPayload(input: { projectPath: string; handle: string; offset?: number; maxBytes?: number; }): Promise; close(projectPath?: string): Promise; resetProfile(projectPath: string): Promise; dispose(): Promise; } export interface HostApiContext { opencodeManager: OpencodeManager; opencodeProjectStore: OpencodeProjectStore; eventBus: HostEventBus; mainWindow: BrowserWindow | null; agentBrowser?: AgentBrowserService; worksCloudDeployment?: WorksCloudDeploymentCoordinator; imageWorkspace?: DesignWorkspaceModule; }