# Computers ## List `client.computers.list(ComputerListParamsquery?, RequestOptionsoptions?): ComputerListResponse` **get** `/computers` List all active computers for the user's organization. Use type=persistent to list persistent sessions instead. ### Parameters - `query: ComputerListParams` - `type?: "live" | "persistent"` Session type filter - `"live"` - `"persistent"` ### Returns - `ComputerListResponse = Array` - `id?: string` - `auto_kill?: boolean` - `created_at?: string` - `endpoints?: Record` - `expires_at?: string` - `idle_expires_at?: string` - `inactivity_timeout_seconds?: number` - `kind?: string` - `last_activity_at?: string` - `max_lifetime_seconds?: number` - `status?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const computerResponses = await client.computers.list(); console.log(computerResponses); ``` ## Create `client.computers.create(ComputerCreateParamsbody?, RequestOptionsoptions?): ComputerResponse` **post** `/computers` Create a new automation session. Set kind to "browser" for web automation or "desktop" for OS-level automation. Defaults to "browser" if not specified. timeout_seconds controls max lifetime, inactivity_timeout_seconds controls idle timeout, and auto_kill disables only the idle timeout (max lifetime still applies). ### Parameters - `body: ComputerCreateParams` - `auto_kill?: boolean` If true (default), kill session after inactivity - `context_id?: string` - `display?: Display` - `height?: number` - `scale?: number` - `width?: number` - `environment_id?: string` - `inactivity_timeout_seconds?: number` Idle timeout before auto-kill - `kind?: string` "browser" (default) or "desktop" - `persistent?: boolean` Persist cookies/storage state to DB on session teardown only if true - `stealth?: unknown` - `timeout_seconds?: number` - `use_advanced_proxy?: boolean` If true (browser sessions), use ADVANCED_PROXY_URL on session start ### Returns - `ComputerResponse` - `id?: string` - `auto_kill?: boolean` - `created_at?: string` - `endpoints?: Record` - `expires_at?: string` - `idle_expires_at?: string` - `inactivity_timeout_seconds?: number` - `kind?: string` - `last_activity_at?: string` - `max_lifetime_seconds?: number` - `status?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const computerResponse = await client.computers.create(); console.log(computerResponse.id); ``` ## Retrieve `client.computers.retrieve(stringid, RequestOptionsoptions?): ComputerResponse` **get** `/computers/{id}` Get the current status and metadata of a computer instance ### Parameters - `id: string` ### Returns - `ComputerResponse` - `id?: string` - `auto_kill?: boolean` - `created_at?: string` - `endpoints?: Record` - `expires_at?: string` - `idle_expires_at?: string` - `inactivity_timeout_seconds?: number` - `kind?: string` - `last_activity_at?: string` - `max_lifetime_seconds?: number` - `status?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const computerResponse = await client.computers.retrieve('id'); console.log(computerResponse.id); ``` ## Delete `client.computers.delete(stringid, RequestOptionsoptions?): void` **delete** `/computers/{id}` Terminate and clean up a computer instance, stopping the session and recording metrics ### Parameters - `id: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); await client.computers.delete('id'); ``` ## Batch `client.computers.batch(stringid, ComputerBatchParamsbody, RequestOptionsoptions?): ComputerBatchResponse` **post** `/computers/{id}/batch` Execute a batch of actions in sequence, stopping on first error ### Parameters - `id: string` - `body: ComputerBatchParams` - `actions?: Array` - `auto_detect_encoding?: boolean` For get_html_content - `base64?: boolean` For screenshot - `button?: string` - `debug?: Debug` - `command?: string` - `cwd?: string` - `env?: Record` - `max_output_length?: number` - `request_id?: string` - `stream?: boolean` - `timeout_seconds?: number` - `dx?: number` For scrolling - `dy?: number` - `height?: number` - `include_context?: boolean` Include page context in response - `key?: string` For key_down/key_up - `keys?: Array` - `ms?: number` - `proxy_url?: string` - `request_id?: string` RequestId is used for correlating streaming output to the originating request. Set on ActionRequest, not individual action types. - `scale_factor?: number` - `tab_id?: string` For tab management (browser sessions only) - `text?: string` - `type?: string` click|double_click|right_click|drag|type|keypress|scroll|wait|screenshot|go_to_url|debug|get_html_content|set_viewport|list_tabs|new_tab|switch_tab|close_tab|key_down|key_up|mouse_down|mouse_up - `url?: string` - `width?: number` For set_viewport - `x?: number` - `x1?: number` For dragging/scrolling - `x2?: number` For dragging - `y?: number` - `y1?: number` - `y2?: number` ### Returns - `ComputerBatchResponse = Record` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const response = await client.computers.batch('id'); console.log(response); ``` ## Change Proxy `client.computers.changeProxy(stringid, ComputerChangeProxyParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/change-proxy` Change the proxy settings for the browser session ### Parameters - `id: string` - `body: ComputerChangeProxyParams` - `proxy_url?: string` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.changeProxy('id'); console.log(actionResult.executed_tab_id); ``` ## Click `client.computers.click(stringid, ComputerClickParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/click` Perform a left mouse click at the specified x,y coordinates. Coordinates are screenshot pixel positions - send exactly what you see in the screenshot/screencast image. If target is at pixel (500, 300) in the image, send x=500, y=300. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerClickParams` - `tab_id?: string` - `x?: number` - `y?: number` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.click('id'); console.log(actionResult.executed_tab_id); ``` ## Debug `client.computers.debug(stringid, ComputerDebugParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/debug` Execute a shell command with optional timeout and output length limits. Optionally specify tab_id (browser sessions only). Deprecated: use /exec or /exec/sync instead. ### Parameters - `id: string` - `body: ComputerDebugParams` - `command?: string` - `max_output_length?: number` - `tab_id?: string` - `timeout_seconds?: number` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.debug('id'); console.log(actionResult.executed_tab_id); ``` ## Double Click `client.computers.doubleClick(stringid, ComputerDoubleClickParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/double-click` Perform a double mouse click at the specified x,y coordinates. Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerDoubleClickParams` - `tab_id?: string` - `x?: number` - `y?: number` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.doubleClick('id'); console.log(actionResult.executed_tab_id); ``` ## Drag `client.computers.drag(stringid, ComputerDragParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/drag` Perform a click-and-drag action from (x1,y1) to (x2,y2). Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerDragParams` - `tab_id?: string` - `x1?: number` - `x2?: number` - `y1?: number` - `y2?: number` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.drag('id'); console.log(actionResult.executed_tab_id); ``` ## Retrieve Events `client.computers.retrieveEvents(stringid, RequestOptionsoptions?): void` **get** `/computers/{id}/events` Stream real-time events using Server-Sent Events (SSE) ### Parameters - `id: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); await client.computers.retrieveEvents('id'); ``` ## Execute `client.computers.execute(stringid, ComputerExecuteParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/execute` Execute a single action such as screenshot, click, type, navigate, scroll, debug, set_viewport, get_html_content or other computer use actions ### Parameters - `id: string` - `body: ComputerExecuteParams` - `action?: ComputerAction` - `auto_detect_encoding?: boolean` For get_html_content - `base64?: boolean` For screenshot - `button?: string` - `debug?: Debug` - `command?: string` - `cwd?: string` - `env?: Record` - `max_output_length?: number` - `request_id?: string` - `stream?: boolean` - `timeout_seconds?: number` - `dx?: number` For scrolling - `dy?: number` - `height?: number` - `include_context?: boolean` Include page context in response - `key?: string` For key_down/key_up - `keys?: Array` - `ms?: number` - `proxy_url?: string` - `request_id?: string` RequestId is used for correlating streaming output to the originating request. Set on ActionRequest, not individual action types. - `scale_factor?: number` - `tab_id?: string` For tab management (browser sessions only) - `text?: string` - `type?: string` click|double_click|right_click|drag|type|keypress|scroll|wait|screenshot|go_to_url|debug|get_html_content|set_viewport|list_tabs|new_tab|switch_tab|close_tab|key_down|key_up|mouse_down|mouse_up - `url?: string` - `width?: number` For set_viewport - `x?: number` - `x1?: number` For dragging/scrolling - `x2?: number` For dragging - `y?: number` - `y1?: number` - `y2?: number` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.execute('id'); console.log(actionResult.executed_tab_id); ``` ## Hotkey `client.computers.hotkey(stringid, ComputerHotkeyParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/hotkey` Press a combination of keys (e.g., ["Control", "c"] for copy). Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerHotkeyParams` - `keys?: Array` - `tab_id?: string` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.hotkey('id'); console.log(actionResult.executed_tab_id); ``` ## HTML `client.computers.html(stringid, ComputerHTMLParamsbody?, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/html` Get the HTML content of the current browser page. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerHTMLParams` - `auto_detect_encoding?: boolean` - `tab_id?: string` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.html('id'); console.log(actionResult.executed_tab_id); ``` ## Keepalive `client.computers.keepalive(stringid, RequestOptionsoptions?): ComputerKeepaliveResponse` **post** `/computers/{id}/keepalive` Extend the timeout for a computer session and verify it is still running ### Parameters - `id: string` ### Returns - `ComputerKeepaliveResponse = Record` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const response = await client.computers.keepalive('id'); console.log(response); ``` ## Key Down `client.computers.keyDown(stringid, ComputerKeyDownParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/key-down` Press and hold a keyboard key. Use with key_up to release. Supports modifier keys (shift, ctrl, alt, meta) for complex interactions like Shift+Click. **Supported keys:** Modifier keys (shift, ctrl, alt, meta), special keys (enter, escape, tab, backspace, delete, space), arrow keys (arrowup, arrowdown, arrowleft, arrowright), navigation (home, end, pageup, pagedown), function keys (f1-f24), and any single character (a-z, 0-9). **Key names are case-insensitive:** "shift", "Shift", and "SHIFT" all work. **Example Shift+Click:** 1) key_down "shift", 2) click at coordinates, 3) key_up "shift" ### Parameters - `id: string` - `body: ComputerKeyDownParams` - `key?: string` Key name to press. Case-insensitive. Examples: "shift", "ctrl", "a", "Enter" - `tab_id?: string` Optional tab ID for browser sessions (ignored for desktop sessions) ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.keyDown('id'); console.log(actionResult.executed_tab_id); ``` ## Key Up `client.computers.keyUp(stringid, ComputerKeyUpParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/key-up` Release a keyboard key that was previously pressed with key_down. The key name should match the corresponding key_down call. **Key names are case-insensitive:** "shift", "Shift", and "SHIFT" all work. **Important:** Always release modifier keys after use to prevent them from affecting subsequent actions. ### Parameters - `id: string` - `body: ComputerKeyUpParams` - `key?: string` Key name to release. Case-insensitive. Examples: "shift", "ctrl", "a", "Enter" - `tab_id?: string` Optional tab ID for browser sessions (ignored for desktop sessions) ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.keyUp('id'); console.log(actionResult.executed_tab_id); ``` ## Mouse Down `client.computers.mouseDown(stringid, ComputerMouseDownParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/mouse-down` Press and hold the left mouse button at the specified x,y coordinates. Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerMouseDownParams` - `tab_id?: string` - `x?: number` - `y?: number` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.mouseDown('id'); console.log(actionResult.executed_tab_id); ``` ## Mouse Up `client.computers.mouseUp(stringid, ComputerMouseUpParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/mouse-up` Release the left mouse button at the specified x,y coordinates. Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerMouseUpParams` - `tab_id?: string` - `x?: number` - `y?: number` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.mouseUp('id'); console.log(actionResult.executed_tab_id); ``` ## Navigate `client.computers.navigate(stringid, ComputerNavigateParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/navigate` Navigate the browser to a specified URL. Optionally specify tab_id to navigate a specific tab (browser sessions only) ### Parameters - `id: string` - `body: ComputerNavigateParams` - `tab_id?: string` - `url?: string` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.navigate('id'); console.log(actionResult.executed_tab_id); ``` ## Right Click `client.computers.rightClick(stringid, ComputerRightClickParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/right-click` Perform a right mouse click at the specified x,y coordinates. Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerRightClickParams` - `tab_id?: string` - `x?: number` - `y?: number` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.rightClick('id'); console.log(actionResult.executed_tab_id); ``` ## Retrieve Screencast `client.computers.retrieveScreencast(stringid, RequestOptionsoptions?): void` **get** `/computers/{id}/screencast` Stream only screencast frames (base64 JPEG images) using Server-Sent Events (SSE) for live browser viewing ### Parameters - `id: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); await client.computers.retrieveScreencast('id'); ``` ## Screenshot `client.computers.screenshot(stringid, ComputerScreenshotParamsbody?, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/screenshot` Take a screenshot of the current browser viewport, optionally as base64. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerScreenshotParams` - `base64?: boolean` - `tab_id?: string` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.screenshot('id'); console.log(actionResult.executed_tab_id); ``` ## Scroll `client.computers.scroll(stringid, ComputerScrollParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/scroll` Scroll at the specified x,y position by delta dx,dy. Coordinates are screenshot pixel positions. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerScrollParams` - `dx?: number` - `dy?: number` - `tab_id?: string` - `x?: number` - `y?: number` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.scroll('id'); console.log(actionResult.executed_tab_id); ``` ## Retrieve Status `client.computers.retrieveStatus(stringid, RequestOptionsoptions?): ComputerRetrieveStatusResponse` **get** `/computers/{id}/status` Get current TTLs and last activity metadata for a computer session ### Parameters - `id: string` ### Returns - `ComputerRetrieveStatusResponse` - `id?: string` - `auto_kill?: boolean` - `created_at?: string` - `expires_at?: string` - `idle_expires_at?: string` - `inactivity_timeout_seconds?: number` - `last_activity_at?: string` - `max_lifetime_seconds?: number` - `status?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const response = await client.computers.retrieveStatus('id'); console.log(response.id); ``` ## Type `client.computers.type(stringid, ComputerTypeParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/type` Type text into the currently focused element in the browser. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerTypeParams` - `tab_id?: string` - `text?: string` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.type('id'); console.log(actionResult.executed_tab_id); ``` ## Viewport `client.computers.viewport(stringid, ComputerViewportParamsbody, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/viewport` Change the browser viewport dimensions and scale factor. Optionally specify tab_id (browser sessions only) ### Parameters - `id: string` - `body: ComputerViewportParams` - `height?: number` - `scale_factor?: number` - `tab_id?: string` - `width?: number` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.viewport('id'); console.log(actionResult.executed_tab_id); ``` ## Retrieve Ws `client.computers.retrieveWs(stringid, RequestOptionsoptions?): void` **get** `/computers/{id}/ws` Establish WebSocket for real-time bidirectional communication ### Parameters - `id: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); await client.computers.retrieveWs('id'); ``` ## Domain Types ### Action Result - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Computer Action - `ComputerAction` - `auto_detect_encoding?: boolean` For get_html_content - `base64?: boolean` For screenshot - `button?: string` - `debug?: Debug` - `command?: string` - `cwd?: string` - `env?: Record` - `max_output_length?: number` - `request_id?: string` - `stream?: boolean` - `timeout_seconds?: number` - `dx?: number` For scrolling - `dy?: number` - `height?: number` - `include_context?: boolean` Include page context in response - `key?: string` For key_down/key_up - `keys?: Array` - `ms?: number` - `proxy_url?: string` - `request_id?: string` RequestId is used for correlating streaming output to the originating request. Set on ActionRequest, not individual action types. - `scale_factor?: number` - `tab_id?: string` For tab management (browser sessions only) - `text?: string` - `type?: string` click|double_click|right_click|drag|type|keypress|scroll|wait|screenshot|go_to_url|debug|get_html_content|set_viewport|list_tabs|new_tab|switch_tab|close_tab|key_down|key_up|mouse_down|mouse_up - `url?: string` - `width?: number` For set_viewport - `x?: number` - `x1?: number` For dragging/scrolling - `x2?: number` For dragging - `y?: number` - `y1?: number` - `y2?: number` ### Computer Response - `ComputerResponse` - `id?: string` - `auto_kill?: boolean` - `created_at?: string` - `endpoints?: Record` - `expires_at?: string` - `idle_expires_at?: string` - `inactivity_timeout_seconds?: number` - `kind?: string` - `last_activity_at?: string` - `max_lifetime_seconds?: number` - `status?: string` ### V2 Go Backend Internal Types Page Context - `V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` # Exec ## Create `client.computers.exec.create(stringid, ExecCreateParamsbody, RequestOptionsoptions?): ExecCreateResponse | Stream` **post** `/computers/{id}/exec` Execute a shell command with real-time streaming output as NDJSON. Each line is a JSON object with type (stdout/stderr/exit/error). ### Parameters - `id: string` - `body: ExecCreateParams` - `command?: string` - `cwd?: string` - `env?: Record` - `timeout_seconds?: number` ### Returns - `ExecCreateResponse` - `code?: number` for exit - `data?: string` for stdout/stderr - `message?: string` for error - `type?: string` "stdout", "stderr", "exit", "error" ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const exec = await client.computers.exec.create('id'); console.log(exec.code); ``` ## Sync `client.computers.exec.sync(stringid, ExecSyncParamsbody, RequestOptionsoptions?): ExecSyncResponse` **post** `/computers/{id}/exec/sync` Execute a shell command and wait for completion, returning buffered stdout/stderr. ### Parameters - `id: string` - `body: ExecSyncParams` - `command?: string` - `cwd?: string` - `env?: Record` - `timeout_seconds?: number` ### Returns - `ExecSyncResponse` - `exit_code?: number` - `stderr?: string` - `stdout?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const response = await client.computers.exec.sync('id'); console.log(response.exit_code); ``` # Tabs ## List `client.computers.tabs.list(stringid, RequestOptionsoptions?): ActionResult` **get** `/computers/{id}/tabs` Get a list of open tabs with IDs, URLs, titles, and main tab status (browser sessions only). Includes external CDP pages (e.g., Playwright). Excludes devtools:// and chrome:// tabs. Results may be eventually consistent for newly created tabs. ### Parameters - `id: string` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.tabs.list('id'); console.log(actionResult.executed_tab_id); ``` ## Create `client.computers.tabs.create(stringid, TabCreateParamsbody?, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/tabs` Create a new tab, optionally navigating to a URL. The new tab becomes the main tab (browser sessions only). ### Parameters - `id: string` - `body: TabCreateParams` - `url?: string` ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.tabs.create('id'); console.log(actionResult.executed_tab_id); ``` ## Delete `client.computers.tabs.delete(stringtabID, TabDeleteParamsparams, RequestOptionsoptions?): ActionResult` **delete** `/computers/{id}/tabs/{tab_id}` Close a specific tab by ID. Cannot close the last remaining tab (browser sessions only). Tab IDs come from ListTabs. ### Parameters - `tabID: string` - `params: TabDeleteParams` - `id: string` Computer ID ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.tabs.delete('tab_id', { id: 'id' }); console.log(actionResult.executed_tab_id); ``` ## Switch `client.computers.tabs.switch(stringtabID, TabSwitchParamsparams, RequestOptionsoptions?): ActionResult` **post** `/computers/{id}/tabs/{tab_id}/switch` Switch the main/active tab to a different tab by ID (browser sessions only). Tab IDs come from ListTabs. ### Parameters - `tabID: string` - `params: TabSwitchParams` - `id: string` Computer ID ### Returns - `ActionResult` - `error_message?: string` - `executed_tab_id?: string` - `page_context?: V2GoBackendInternalTypesPageContext` - `device_scale_factor?: number` - `is_main_tab?: boolean` - `page_height?: number` - `page_width?: number` - `scroll_x?: number` - `scroll_y?: number` - `tab_id?: string` - `title?: string` - `url?: string` - `viewport_height?: number` - `viewport_width?: number` - `request_id?: string` - `result?: Record` - `status?: string` - `timestamp?: string` ### Example ```typescript import Lightcone from '@tzafon/lightcone'; const client = new Lightcone({ apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted }); const actionResult = await client.computers.tabs.switch('tab_id', { id: 'id' }); console.log(actionResult.executed_tab_id); ```