import { type Browser, type BrowserContext, type Locator, type Page } from "@playwright/test"; import { type ChildProcess } from "node:child_process"; export declare const PKG: string; export declare const ROOT: string; export declare const SWITCHBOARD = "http://localhost:4001"; export declare const CONNECT: string; export declare function connectDev(): boolean; /** Starts whichever of switchboard / Connect is not already listening. */ export declare function ensureServers(): Promise; /** Builds Connect when it is missing or older than this package's dist. */ export declare function buildConnectIfStale(): void; export declare function buildCss(): Promise; /** * page.evaluate for a function that imports from Vite first: a re-optimise * fails that import, and nothing has run yet, so it is safe to try again. */ export declare function evaluateImporting(page: Page, fn: (arg: A) => Promise, arg: A): Promise; /** evaluateImporting for a function that needs Connect's reactor client. */ export declare function evaluateWithReactor(page: Page, fn: (arg: A) => Promise, arg: A): Promise; /** * Imports everything once so Vite's dep optimiser settles before the tests: * a re-optimise mid-run reloads every open page. Done once a round passes * without a reload. */ export declare function warmConnect(): Promise; /** Bundles the harnesses the build can't import from source. */ export declare function buildHarnesses(): Promise; /** * Opens a harness on a page styled like Connect and returns its mount. The * build's own page, minus its app, plus the harness bundle; dev imports source. */ export declare function openHarness(page: Page, name: string): Promise<(arg: A) => Promise>; declare const MODEL_SOURCES: { "powerhouse/workflow": string; "powerhouse/connection": string; }; export interface StepBlock { pieceName: string; pieceVersion: string; actionName: string; } export interface TriggerBlock { pieceName: string; pieceVersion: string; triggerName: string; } type AnyBlock = StepBlock | TriggerBlock; type Defaults = Record>; export declare function defaultsOf(defaults: Defaults, block: AnyBlock): Record; export declare function blockDefaults(blocks: AnyBlock[]): Promise; export declare function gql(path: string, query: string, variables?: {}): Promise; export declare function createSecret(value: string, label: string): Promise; /** A piece action pinned to the version the runtime lists. */ export declare function pieceAction(pkg: string, action: string): Promise; /** A piece trigger pinned to the version the runtime lists. */ export declare function pieceTrigger(pkg: string, trigger: string): Promise; /** A core piece action (branch, assert), pinned to the installed core piece. */ export declare function coreAction(name: string): Promise; /** A core piece trigger (manual, schedule, webhook). */ export declare function coreTrigger(name: string): Promise; export interface Seeded { digest: string; smoke: string; ping: string; connection: string; } export interface PhWindow { __uiModel?: (type: keyof typeof MODEL_SOURCES) => Promise; __uiDrives?: () => Promise<{ addRemoteDrive(url: string): Promise; deleteDrive(id: string): Promise; }>; ph?: { reactorClientModule?: { client: { drives: { addFile(drive: string, doc: unknown): Promise<{ header: { id: string; }; }>; addFolder(drive: string, name: string, parentFolder?: string): Promise<{ state: unknown; }>; }; execute(id: string, branch: string, actions: unknown[]): Promise; rename(id: string, name: string): Promise; get(id: string): Promise; }; reactorModule?: { syncModule?: { syncManager?: unknown; }; }; }; drives?: { header: { id: string; }; }[]; }; } /** Resolves once the switchboard serves the workflow for design-time calls. */ export declare function waitServed(workflowId: string, stepId: string): Promise; /** Fires a manual workflow once it has synced to the switchboard. */ export declare function fireWhenSynced(workflowId: string, payload?: unknown): Promise; export interface ConnectPage { context: BrowserContext; page: Page; } export interface SeededPage extends ConnectPage { seeded: Seeded; drive: string; } /** A fresh browser context with Connect booted, workflows on and no drives. */ export declare function openConnect(browser: Browser, options?: { colorScheme?: "light" | "dark"; viewport?: { width: number; height: number; }; }): Promise; /** Whether a reused page still runs Connect with its reactor. */ export declare function isHealthy(page: Page): Promise; /** * Back to Connect's home page, without a reload: no test routes, the default * viewport and no modal open. */ export declare function resetConnect(page: Page): Promise; /** * Removes a drive from Connect's reactor, so the next one is alone on home. * From the home page, so Connect has no open document to warn about. */ export declare function detachDrive(page: Page, id: string): Promise; /** * A new remote drive, added to an open Connect page and holding the demo * documents unless `seed` is false. */ export declare function addSeededDrive(page: Page, options?: { seed?: boolean; }): Promise<{ drive: string; seeded: Seeded; }>; /** A fresh browser context on a new remote drive holding the demo documents. */ export declare function openSeededPage(browser: Browser, options?: { colorScheme?: "light" | "dark"; viewport?: { width: number; height: number; }; seed?: boolean; }): Promise; export interface WorkflowSpec { name: string; trigger: TriggerBlock & { config: Record; }; steps: (StepBlock & { key: string; name: string; config: Record; connectionId?: string; })[]; enabled?: boolean; } /** Adds a workflow, enabled unless told otherwise, through Connect's reactor. */ export declare function createWorkflowInBrowser(page: Page, drive: string, input: WorkflowSpec): Promise; export interface ConnectionSpec { name: string; connectorId: string; authType: "SECRET_TEXT" | "BASIC_AUTH" | "CUSTOM_AUTH"; config: Record; secrets: Record; } /** Adds a configured connection to the drive through Connect's reactor. */ export declare function createConnectionInBrowser(page: Page, drive: string, spec: ConnectionSpec): Promise; export interface RunResult { id: string; status: string; error: string | null; steps: { stepKey: string; status: string; output: unknown; error: string | null; }[]; } /** Fires a workflow and waits for its run to finish. */ export declare function fireAndWait(workflowId: string, payload?: unknown): Promise; export declare function openDrive(page: Page): Promise; export declare function selectInSidebar(page: Page, name: string): Promise; export declare function openWorkflowEditor(page: Page, name?: string): Promise; export declare function shot(page: Page, name: string): Promise; export declare function workflowState>(page: Page, id: string): Promise; export declare function canvasNode(page: Page, title: string): Locator; /** Opens a canvas add button's block picker, clicking again only while shut. */ export declare function openPicker(page: Page, button: Locator): Promise; /** Fails if `read` ever stops matching over `ms`: for "nothing was written". */ export declare function expectSteady(read: () => Promise, check: (value: T) => void, ms?: number): Promise; export {}; //# sourceMappingURL=ui-stack.d.ts.map