import type { IpcMainInvokeEvent } from "electron"; import { z } from "zod"; import type { DesktopResult } from "@shared/contracts"; import type { bootstrapOnboardingSchema } from "@shared/contracts"; import type { DesktopEvent, SectionId } from "@shared/types"; import type { AppDatabase } from "./database"; import type { createSkillService } from "./skill-service"; import type { createBudgetEnforcementService } from "./budget-enforcement-service"; interface BrowserActionControl { clearSocialAccountData: (socialAccountId: string, screenshotPaths?: string[]) => Promise; cancelAction: (actionId: string) => boolean; launchLoginBrowser: (socialAccountId: string, platform: string, loginUrl?: string) => Promise<{ success: boolean; cancelled: boolean; summary: string; screenshotPath: string | null; error: string | null; }>; extractProfileFromSession: (socialAccountId: string, platform: string) => Promise<{ accountName: string; displayName: string; }>; } export interface RegisterDomainHandlersDependencies { registerHandle: ( channel: string, handler: (event: IpcMainInvokeEvent, ...args: unknown[]) => Promise> | DesktopResult, ) => void; db: AppDatabase; logger: { error: (...args: unknown[]) => void; }; ensureCompanyExists: (companyId: string) => DesktopResult | null; findInvalidReference: ( companyId: string, refs: Array<{ id: string | null | undefined; table: string; label: string }>, ) => { id: string | null | undefined; table: string; label: string } | null; publishDomainChanged: () => void; emitEvent: (event: DesktopEvent) => void; notify: (options: { title: string; body: string; urgency: "critical" | "informational"; navigation?: { section: SectionId; entityId?: string }; batchKey?: string }) => void; wakeAgentIfPossible: (agentId: string | null | undefined, companyId: string, trigger: string) => string | null; dispatchAutomation: (trigger: string, ctx: { companyId: string; [key: string]: unknown }) => void; runWorkflowPipeline: (workflowId: string, companyId: string) => Promise; bootstrapOnboarding: (input: z.infer) => unknown; getBrowserActions: () => BrowserActionControl | null; randomFallbackCompanyId: () => string; skillService: ReturnType | null; budgetService: ReturnType | null; /** Called when a human sends a message to resolve thread wait states. */ onHumanMessage?: (companyId: string, toAgentId?: string | null, threadId?: string | null, waitStateId?: string | null) => void; } export { ok, fail } from "./ipc-core-common";