/**
 * Browser Controller
 *
 * REST API handlers for Crewly in Chrome. Each handler translates an
 * HTTP request into a WebSocket command sent to the connected Chrome
 * Extension, waits for the response, and returns it as JSON.
 *
 * @module controllers/browser/browser.controller
 */
import type { Request, Response } from 'express';
/**
 * GET /api/browser/status
 * Returns the current Crewly in Chrome connection status,
 * including proxy relay state and available browser instances.
 *
 * @param _req - Express request (unused)
 * @param res - Express response
 */
export declare function getStatus(_req: Request, res: Response): void;
/**
 * GET /api/browser/instances
 * List all connected browser instances available for command routing.
 *
 * @param _req - Express request (unused)
 * @param res - Express response
 */
export declare function getInstances(_req: Request, res: Response): void;
/**
 * POST /api/browser/proxy/connect
 * Manually connect the BrowserProxyService to the Cloud Relay.
 * Uses the current CloudClientService token. Call this when the proxy
 * is disconnected but the cloud connection is active.
 *
 * @param _req - Express request (unused)
 * @param res - Express response
 */
export declare function connectProxy(_req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/navigate
 * Navigate the active tab to a URL.
 *
 * @param req - Express request with body { url: string }
 * @param res - Express response
 */
export declare function navigate(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/screenshot
 * Capture a screenshot of the active tab.
 *
 * @param _req - Express request
 * @param res - Express response
 */
export declare function screenshot(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/read-text
 * Read visible text from the active tab, optionally scoped to a selector.
 *
 * @param req - Express request with optional body { selector?: string }
 * @param res - Express response
 */
export declare function readText(req: Request, res: Response): Promise<void>;
/**
 * GET /api/browser/tabs
 * List all open Chrome tabs.
 *
 * @param _req - Express request
 * @param res - Express response
 */
export declare function getTabs(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/execute
 * Execute a safe predefined operation on the active tab.
 * Supports: querySelectorAll, getTitle, getUrl, getSelection, getScrollPosition.
 *
 * @param req - Express request with body { operation: string, selector?: string }
 * @param res - Express response
 */
export declare function execute(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/execute-js
 * Execute arbitrary JavaScript code on the active tab.
 * Returns the serialized result.
 *
 * @param req - Express request with body { code: string }
 * @param res - Express response
 */
export declare function executeJs(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/click
 * Click an element by selector or coordinates.
 *
 * @param req - Express request with body { selector?: string, x?: number, y?: number }
 * @param res - Express response
 */
export declare function click(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/fill
 * Fill a form field with a value.
 *
 * @param req - Express request with body { selector: string, value: string }
 * @param res - Express response
 */
export declare function fill(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/type
 * Type text into an element with optional delay.
 *
 * @param req - Express request with body { selector: string, text: string, delay?: number }
 * @param res - Express response
 */
export declare function type(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/scroll
 * Scroll the page by direction/amount or to coordinates.
 *
 * @param req - Express request with body { direction?: string, amount?: number, x?: number, y?: number, selector?: string }
 * @param res - Express response
 */
export declare function scroll(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/scroll-in-element
 * Scroll within a specific element.
 *
 * @param req - Express request with body { selector: string, direction?: string, amount?: number }
 * @param res - Express response
 */
export declare function scrollInElement(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/hover
 * Hover over an element.
 *
 * @param req - Express request with body { selector: string }
 * @param res - Express response
 */
export declare function hover(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/press-key
 * Press a keyboard key with optional modifiers.
 *
 * @param req - Express request with body { key: string, modifiers?: string[] }
 * @param res - Express response
 */
export declare function pressKey(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/get-element
 * Get element information by selector.
 *
 * @param req - Express request with body { selector: string }
 * @param res - Express response
 */
export declare function getElement(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/wait-for-selector
 * Wait for an element matching a selector to appear.
 *
 * @param req - Express request with body { selector: string, timeout?: number }
 * @param res - Express response
 */
export declare function waitForSelector(req: Request, res: Response): Promise<void>;
/**
 * GET /api/browser/cookies
 * Get cookies, optionally filtered by domain.
 *
 * @param req - Express request with optional query { domain?: string }
 * @param res - Express response
 */
export declare function getCookies(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/local-storage
 * Get local storage entries, optionally filtered by keys.
 *
 * @param req - Express request with optional body { keys?: string[] }
 * @param res - Express response
 */
export declare function getLocalStorage(req: Request, res: Response): Promise<void>;
/**
 * GET /api/browser/console
 * Get captured console messages, optionally clearing after read.
 *
 * @param req - Express request with optional query { clear?: string }
 * @param res - Express response
 */
export declare function getConsole(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/full-page-screenshot
 * Capture a full-page screenshot.
 *
 * @param _req - Express request
 * @param res - Express response
 */
export declare function fullPageScreenshot(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/get-interactive-elements
 * List interactive elements on the page.
 *
 * @param req - Express request with optional body { textContains?: string }
 * @param res - Express response
 */
export declare function getInteractiveElements(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/search-text
 * Search for text on the page.
 *
 * @param req - Express request with body { text: string, exact?: boolean }
 * @param res - Express response
 */
export declare function searchText(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/list-options
 * List options in a select element.
 *
 * @param req - Express request with body { selector: string }
 * @param res - Express response
 */
export declare function listOptions(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/set-file-input
 * Set files on a file input element using CDP, bypassing the OS file picker.
 *
 * @param req - Express request with body { selector: string, filePaths: string[] }
 * @param res - Express response
 */
export declare function setFileInput(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/select-option
 *
 * Select an option in a native HTML `<select>` element. CDP click on
 * a `<select>` does not open the dropdown (Chrome blocks synthetic
 * events on native form controls), and `<option>` children are rendered
 * by the OS rather than the DOM, so the existing `click` flow can't
 * reach them. This endpoint forwards to the extension's `selectOption`
 * tool, which sets `el.value` directly and dispatches `input` + `change`
 * events with `bubbles: true` so frameworks (React, Vue, etc.) pick the
 * change up via their controlled-component handlers.
 *
 * Selection precedence (one of these is required):
 *   - `value`  — match `<option>` by its `value` attribute
 *   - `label`  — match `<option>` by its visible text (`.text`)
 *   - `index`  — match `<option>` by zero-based position
 *
 * @param req - Express request with body
 *   `{ selector: string, value?: string, label?: string, index?: number,
 *      strategy?: "native" | "aria", tabId?: number }`
 * @param res - Express response — `{ success, selectedValue, selectedText }`
 *   on hit; `{ success: false, error }` on miss.
 */
export declare function selectOption(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/bind
 *
 * Explicitly bind a fresh Chrome tab for the calling agent. The agent is
 * identified via the `X-Agent-Session` header (or `body.agentSession`).
 * Idempotent: if the agent already has a bound tab, returns the existing
 * binding without creating a new one.
 *
 * Body (all optional):
 *   - `active` (boolean, default false) — when true, the new tab is created
 *     in the foreground. Off by default to avoid disturbing the user.
 *
 * Responses:
 *   - 200 `{ success: true, data: { tabId, windowId?, bindingCount } }`
 *   - 400 `{ success: false, error: 'agent_session_required' }` when no
 *     `X-Agent-Session` header is supplied.
 *   - 503 `{ success: false, error: 'tab_pool_full', retryAfterMs }` when
 *     the hard cap (`CREWLY_TAB_BIND_MAX`, default 50) has been reached.
 *   - 503 `NO_BROWSER_CLIENT` when no Extension is connected.
 */
export declare function bindTab(req: Request, res: Response): Promise<void>;
/**
 * POST /api/browser/unbind
 *
 * Release the calling agent's bound Chrome tab. Optionally tells the
 * Extension to close the tab (default true).
 *
 * Body (all optional):
 *   - `closeTab` (boolean, default true) — set to false to release the
 *     binding while leaving the tab alive (useful for handoff scenarios).
 *
 * Always returns 200 — `data.released:false` indicates "no binding existed",
 * which is not an error.
 */
export declare function unbindTab(req: Request, res: Response): Promise<void>;
/**
 * GET /api/browser/bindings
 *
 * Snapshot of all current agent→tab bindings. Used for diagnostics and
 * eventually for a UI panel showing which tab each running agent owns.
 *
 * Response: `{ success: true, data: { bindings: AgentTabBinding[], hardCap, softWarn } }`
 */
export declare function getBindings(_req: Request, res: Response): void;
//# sourceMappingURL=browser.controller.d.ts.map