YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
update terminator docs
Louis Beaumont3ff9774e0607
diff --git a/content/docs-mintlify-mig-tmp/terminator/getting-started.mdx b/content/docs-mintlify-mig-tmp/terminator/getting-started.mdxindex 90e65259a..da507332b 100644--- a/content/docs-mintlify-mig-tmp/terminator/getting-started.mdx+++ b/content/docs-mintlify-mig-tmp/terminator/getting-started.mdx@@ -2,7 +2,9 @@title: 'Terminator: Getting Started'----## installation+## ⚡ hello world — quick start++> skip the boilerplate. this is the fastest way to feel the magic.first, clone the terminator repository:@@ -11,28 +13,36 @@ git clone https://github.com/mediar-ai/terminatorcd terminator```-## running the server--**terminator** works with a client-server architecture. you need to run the rust server first. this server listens for commands from the sdk (typescript, python) and interacts with the operating system's accessibility apis.+### 🐍 python```bash-powershell -ExecutionPolicy Bypass -File .\setup_windows.ps1-./server_release/server.exe --debug+pip install maturin+cd bindings/python+maturin develop```-the `--debug` flag enables verbose logging, which is helpful when starting out.+```python+import terminator+desktop = terminator.Desktop()+print(desktop.hello()) # → "Hello from Terminator"+```-**run an example client (in another terminal):**+### 🟦 typescript / node.js```bash-cd examples/hello-world-npm i-npm run dev-# open http://localhost:3000+cd bindings/nodejs+npm install+npm run build+```++```typescript+const { Desktop } = require('./bindings/nodejs/index.js');+const desktop = new Desktop();+console.log(desktop.hello()); // → "Hello from Terminator"```## next steps* explore the sdk references ([TypeScript](/terminator/js-sdk-reference), [Python](/terminator/python-sdk-reference)) to understand all available commands.-* look at the `examples/` directory for more usage patterns.+* check out the [pdf-to-form example](https://github.com/mediar-ai/terminator/tree/main/examples/pdf-to-form) to see terminator with ai.* start building your own automation scripts!diff --git a/content/docs-mintlify-mig-tmp/terminator/introduction.mdx b/content/docs-mintlify-mig-tmp/terminator/introduction.mdxindex aae7c55f3..eafbf07ed 100644--- a/content/docs-mintlify-mig-tmp/terminator/introduction.mdx+++ b/content/docs-mintlify-mig-tmp/terminator/introduction.mdx@@ -6,80 +6,52 @@ import { Card, CardGroup } from '@mintlify/components';## overview-**terminator** is an ai-first cross-platform ui automation library for rust, designed to interact with native gui applications on windows and macos using a playwright-like api via **python** or **typescript** sdks.+**terminator** is an ai-native gui automation sdk that lets ai agents see and control native desktop apps like they were web pages. automate desktop apps like a browser with fast, reliable, agent-ready automation for windows.-it provides a unified api to find and control ui elements like buttons, text fields, windows, and more, enabling the creation of automation scripts, testing tools, and assistive technologies.+because it uses accessibility apis, it is **100x faster and more reliable** for ai computer use than vision-based approaches like openai operator or anthropic computer use.-because it's using os level apis, it is **100x faster and more reliable** for ai computer use than vision-based approaches like openai operator or anthropic computer use. acting at a lower level than a browser, it can easily drop-in replace browser automation tools like playwright for native application tasks.+> **Note:** built for windows with partial macos support.-> **Note:** while we support macos and windows, we are currently focusing development efforts on windows. macos support is functional but may require more investigation for complex scenarios.+## benchmarks++the [benchmark test](https://github.com/mediar-ai/terminator/blob/main/terminator/src/tests/e2e_tests.rs) illustrates how fast terminator can query the ui. it finds all edit elements in about **80 ms**, showcasing a big speed advantage over vision-based tools.++this [form-filling app](https://www.mediar.ai/) can read & fill forms as soon as you see them in <1s end-to-end using gemini.## features<CardGroup cols={2}>- <Card title="Cross-Platform">- Experimentally supports **Windows** and **macOS** with a consistent api.+ <Card title="AI-Native">+ Built for **Windows** with playwright-style api for python, typescript, and rust.</Card>- <Card title="Application Control">- Find running applications (by name, pid), open new applications, open URLs.+ <Card title="Fast & Reliable">+ Uses accessibility apis for 100x faster automation vs vision-based tools.</Card><Card title="Element Discovery">- Locate UI elements using various strategies (`Selector` enum):- - Role (e.g., "button", "textfield", "AXButton")- - Name (accessibility label/title)- - Value- - Description- - AutomationId (Windows)- - Id (internal unique id)- - Text content (partial matches)- </Card>- <Card title="Element Interaction">- - Click, double-click, right-click- - Type text, set value, press keys (e.g., `{Enter}`, `{Cmd}`, `{Alt}`)- - Focus, hover- - Scroll (up, down, left, right)- - Retrieve text content, attributes (value, role, description, bounds, properties)- - Check state (enabled, visible, focused)- </Card>- <Card title="Element Hierarchy">- Traverse the accessibility tree (children, parent).+ Find ui elements by role, name, value, description, automationid, or text content.</Card>- <Card title="Debugging">- Optional verbose logging and accessibility inspector integration (like [Accessibility Insights](https://accessibilityinsights.io/downloads/)) for easier debugging.+ <Card title="Full Interaction">+ Click, type, scroll, press keys, get text, check state - everything you need.</Card></CardGroup>-## platform support--* ✅ **windows** (using ui automation)-* ✅ **macos** (using accessibility api)-* 🐧 **linux** (planned/experimental)--## use cases & potential experiments--* **ai-driven automation loop:** an ai agent observes an application's state using terminator, generates sdk code to interact, executes it, and observes the result, enabling complex, adaptive automation (e.g., data entry, testing, user support).-* **pdf to legacy form filler:** extract data from pdfs and use terminator to fill it into legacy applications lacking modern apis.-* **javascript/typescript integration:** integrate terminator into web tools or electron apps using the [TypeScript SDK](/terminator/sdk-reference).-* **python scripting:** build powerful automation scripts and integrate with other python libraries using the [Python SDK](/terminator/python-sdk-reference).-* **replacing vision models:** achieve significantly faster and more reliable ui automation compared to slower, error-prone vision-based models for tasks where accessibility apis are available.-## demos-high level demo:--<video controls src="https://github.com/user-attachments/assets/024c06fa-19f2-4fc9-b52d-329768ee52d0"></video>--dev demo 1:--<video controls src="https://github.com/user-attachments/assets/890d6842-782c-4b2b-8920-224bd63c4545"></video>+check out terminator in action:-dev demo 2:--<video controls src="https://github.com/user-attachments/assets/c9f472f7-79ed-49c6-a4d0-93608fa1ce55"></video>+- [📹 desktop copilot that autocompletes your work in real time](https://www.youtube.com/watch?v=FGywvWJY7wc)+- [📹 ai agent that process 100 insurance claims in 5 minutes](https://www.youtube.com/watch?v=6wMNNQFj_dw)+- [📹 technical overview video](https://youtu.be/ycS9G_jpl04)+- [📹 technical overview: pdf to windows legacy app form](https://www.youtube.com/watch?v=CMw3iexyCMI)## next stepsready to start? head over to the [Getting Started](/terminator/getting-started) guide, then dive into the sdk references:* [Python SDK Reference](/terminator/python-sdk-reference)-* [TypeScript SDK Reference](/terminator/sdk-reference)+* [TypeScript SDK Reference](/terminator/js-sdk-reference)++## explore further++* **vercel ai sdk example:** learn how to use terminator with ai in the [pdf-to-form example](https://github.com/mediar-ai/terminator/tree/main/examples/pdf-to-form).+* **mcp:** discover [how to vibe work using mcp](https://github.com/mediar-ai/terminator/tree/main/mcp).diff --git a/content/docs-mintlify-mig-tmp/terminator/js-sdk-reference.mdx b/content/docs-mintlify-mig-tmp/terminator/js-sdk-reference.mdxindex b4be79ad6..83752b171 100644--- a/content/docs-mintlify-mig-tmp/terminator/js-sdk-reference.mdx+++ b/content/docs-mintlify-mig-tmp/terminator/js-sdk-reference.mdx@@ -3,261 +3,94 @@ title: "Typescript SDK Reference"icon: "js"----this page details the typescript sdk for interacting with the **terminator** server. it provides examples for common ui automation tasks, primarily focusing on windows applications.+## quick start-## setup--first, ensure the terminator server is running (see [Getting Started](/terminator/getting-started)). then, install the necessary dependencies if you haven't already:+### hello world```bash-npm i # or bun install / yarn install+cd bindings/nodejs+npm install+npm run build```-get the client and locator:-```typescript-import { DesktopUseClient } from 'desktop-use';--const client = new DesktopUseClient(); // Connects to default 127.0.0.1:3000-// const client = new DesktopUseClient('127.0.0.1:3001'); // Or specify host:port+const { Desktop } = require('./bindings/nodejs/index.js');+const desktop = new Desktop();```-## basic operations-### opening applications and urls+## basic usage-you can open applications by their name or path, and open urls in the default (or specified) browser.+### opening applications```typescript-async function launchApps() {- try {- // open windows calculator- console.log('opening calculator...');- await client.openApplication('calc');- console.log('calculator opened.');-- // wait a bit for the app to load (optional)- await sleep(1000);+// open calculator+await client.openApplication('calc');- // open notepad- console.log('opening notepad...');- await client.openApplication('notepad');- console.log('notepad opened.');-- // open a url- console.log('opening url...');- await client.openUrl('https://github.com/mediar-ai/terminator');- console.log('url opened.');-- } catch (error) {- if (error instanceof ApiError) {- console.error(`api error (${error.status}): ${error.message}`);- } else {- console.error('an unexpected error occurred:', error);- }- }-}+// open notepad+await client.openApplication('notepad');-launchApps();--// Utility function for delays-function sleep(ms: number): Promise<void> {- return new Promise(resolve => setTimeout(resolve, ms));-}+// open url+await client.openUrl('https://github.com/mediar-ai/terminator');```-### locating elements--the `locator` method starts a chain to find elements. you can chain multiple locators to narrow down the search.--selectors use the format `Strategy:Value`, e.g., `name:Calc`, `role:button`, `id:myButtonId`.+### locating and interacting with elements```typescript-// --- basic locators -----// locate the calculator window (windows 11 example)+// locate calculator window and buttonsconst calcWindow = client.locator('name:Calc');--// locate the 'seven' button within the calculator windowconst sevenButton = calcWindow.locator('name:Seven');+const plusButton = calcWindow.locator('name:Plus');-// locate the main text area in notepad-const notepadWindow = client.locator('window:Notepad'); // might differ-const editor = notepadWindow.locator('name:RichEditD2DPT'); // use accessibility insights tool to find correct class/id--// --- chaining locators -----// directly locate the 'eight' button-const eightButton = client.locator('name:Calc').locator('name:Eight');--// locate the file menu item within notepad-const fileMenu = client.locator('window:Notepad').locator('name:File');-```--### interacting with elements--once you have a `Locator`, you can perform actions like clicking, typing, or getting text.--```typescript-async function interactWithCalc() {- try {- console.log('opening calculator...');- await client.openApplication('calc');- await sleep(1500); // give calc time to open-- // locate buttons by name (windows 11 calculator)- const seven = client.locator('name:Calc').locator('name:Seven');- const plus = client.locator('name:Calc').locator('name:Plus');- const eight = client.locator('name:Calc').locator('name:Eight');- const equals = client.locator('name:Calc').locator('name:Equals');- const display = client.locator('name:Calc').locator('name:CalculatorResults'); // find result display-- console.log('clicking 7...');- await seven.click();- await sleep(200);-- console.log('clicking +...');- await plus.click();- await sleep(200);-- console.log('clicking 8...');- await eight.click();- await sleep(200);-- console.log('clicking =...');- await equals.click();- await sleep(500);-- // get the result- const result = await display.getText();- console.log(`calculation result: ${result.text}`); // should output something like "display is 15"-- } catch (error) {- console.error('error interacting with calculator:', error);- }-}--interactWithCalc();--async function interactWithNotepad() {- try {- console.log('opening notepad...');- await client.openApplication('notepad');- await sleep(1000);-- const notepadWindow = client.locator('window:Notepad');- const editor = notepadWindow.locator('name:RichEditD2DPT'); // adjust if necessary-- console.log('typing text...');- await editor.typeText('hello from terminator!\nthis is a test.');- await sleep(500);-- // press enter- console.log('pressing enter...');- await editor.pressKey('{enter}');- await sleep(200);-- await editor.typeText('done.');+// click buttons+await sevenButton.click();+await plusButton.click();- const content = await editor.getText();- console.log('notepad content retrieved:', content.text);+// type text in notepad+const notepadEditor = client.locator('window:Notepad').locator('name:RichEditD2DPT');+await notepadEditor.typeText('hello from terminator!');- } catch (error) {- console.error('error interacting with notepad:', error);- }-}--// interactWithNotepad(); // uncomment to run+// get text content+const result = await notepadEditor.getText();+console.log(result.text);```-*note: element selectors (like `name`, `id`, `role`) can vary between os versions and application updates. use tools like windows' accessibility insights to find the correct selectors for your target application or let AI figure it out.*--### getting element state and attributes--you can check properties like visibility or retrieve detailed attributes.+### element state and attributes```typescript-async function checkElementState() {- try {- await client.openApplication('calc');- await sleep(1000);- const equalsButton = client.locator('button:Calculator').locator('name:Equals');-- const visible = await equalsButton.isVisible();- console.log(`is equals button visible? ${visible}`);-- const attributes = await equalsButton.getAttributes();- console.log('equals button attributes:', JSON.stringify(attributes, null, 2));+// check if element is visible+const isVisible = await sevenButton.isVisible();- const bounds = await equalsButton.getBounds();- console.log(`equals button bounds: x=${bounds.x}, y=${bounds.y}, width=${bounds.width}, height=${bounds.height}`);+// get element bounds+const bounds = await sevenButton.getBounds();- } catch (error) {- console.error('error checking element state:', error);- }-}--// checkElementState(); // uncomment to run+// get all attributes+const attributes = await sevenButton.getAttributes();```-## expectations--**terminator** can wait for certain conditions to be met before proceeding or timing out.+### expectations (waiting for conditions)```typescript-async function useExpectations() {- try {- console.log('opening notepad...');- await client.openApplication('notepad.exe');-- const editorLocator = client.locator('window:Notepad').locator('name:RichEditD2DPT');-- // wait for the editor element to be visible (default timeout)- console.log('waiting for editor to be visible...');- const editorElement = await editorLocator.expectVisible();- console.log(`editor is visible! id: ${editorElement.id}`);-- // wait for it to be enabled (with a 5-second timeout)- console.log('waiting for editor to be enabled...');- await editorLocator.expectEnabled(5000);- console.log('editor is enabled!');+// wait for element to be visible+const element = await editorLocator.expectVisible();- await editorLocator.typeText('initial text.');- await sleep(1000);+// wait for element to be enabled with timeout+await editorLocator.expectEnabled(5000);- // wait for the text to exactly match 'initial text.'- console.log('waiting for text to match...');- await editorLocator.expectTextEquals('initial text.', { timeout: 3000 });- console.log('text matched!');-- // this would likely fail and throw an error after the timeout- // console.log('waiting for incorrect text (will timeout)...');- // await editorLocator.expectTextEquals('wrong text', { timeout: 2000 });-- } catch (error) {- console.error('expectation error:', error);- }-}--// useExpectations(); // uncomment to run+// wait for specific text+await editorLocator.expectTextEquals('expected text', { timeout: 3000 });```-## error handling--the sdk methods return promises that reject on failure. use `try...catch` blocks and check for `ApiError` instances.+### error handling```typescripttry {- // attempt to find a non-existent element- const nonExistent = client.locator('Name:DoesNotExist');- await nonExistent.click();+ await client.locator('name:DoesNotExist').click();} catch (error) {if (error instanceof ApiError) {- // handle specific api errors (e.g., element not found, timeout)- console.error(`terminator api error (status: ${error.status}): ${error.message}`);+ console.error(`api error (${error.status}): ${error.message}`);} else {- // handle other unexpected errors- console.error('an unexpected javascript error occurred:', error);+ console.error('unexpected error:', error);}}-```+```diff --git a/content/docs-mintlify-mig-tmp/terminator/python-sdk-reference.mdx b/content/docs-mintlify-mig-tmp/terminator/python-sdk-reference.mdxindex 0d6f200bb..86ff7c32c 100644--- a/content/docs-mintlify-mig-tmp/terminator/python-sdk-reference.mdx+++ b/content/docs-mintlify-mig-tmp/terminator/python-sdk-reference.mdx@@ -3,237 +3,90 @@ title: "Python SDK Reference"icon: "python"----this page details the python sdk for interacting with the **terminator** server. it provides examples for common ui automation tasks, primarily focusing on windows applications.+## quick start-## setup--first, ensure the terminator server is running (see [Getting Started](/terminator/getting-started)).--### installation+### hello world```bash-pip install desktop-use+pip install maturin+cd bindings/python+maturin develop```-### importing-```python-from desktop_use import DesktopUseClient, Locator, ApiError, sleep, ElementResponse-# import other response models or exceptions as needed--client = DesktopUseClient() # connects to default 127.0.0.1:3000-# client = DesktopUseClient(base_url='127.0.0.1:3001') # or specify host:port+import terminator+desktop = terminator.Desktop()```-## basic operations+## basic usage-### opening applications and urls+### opening applications```python-def launch_apps():- try:- # open windows calculator- print('opening calculator...')- client.open_application('calc')- print('calculator opened.')-- # wait a bit- sleep(1000)-- # open notepad- print('opening notepad...')- client.open_application('notepad')- print('notepad opened.')-- # open a url- print('opening url...')- client.open_url('https://github.com/mediar-ai/terminator')- print('url opened.')-- except ApiError as e:- print(f'api error (status: {e.status}): {e}')- except Exception as e:- print(f'an unexpected error occurred: {e}')--# launch_apps()-```+# open calculator+client.open_application('calc')++# open notepad+client.open_application('notepad')-### locating elements+# open url+client.open_url('https://github.com/mediar-ai/terminator')+```-the `locator()` method starts a chain. selectors use the format `Strategy:Value`.+### locating and interacting with elements```python-# locate the calculator window (windows 11 example)+# locate calculator window and buttonscalc_window = client.locator('window:Calculator')+seven = calc_window.locator('role:Button').locator('name:Seven')+plus = calc_window.locator('role:Button').locator('name:Plus')-# locate the 'seven' button within the calculator window-seven_button = calc_window.locator('role:button').locator('name:Seven')--# locate the main text area in notepad (use accessibility insights tool to find correct class/id)-notepad_editor = client.locator('window:Notepad').locator('role:richedit')--# directly locate the 'eight' button-eight_button = client.locator('window:Calculator').locator('role:button').locator('name:Eight')-```+# click buttons+seven.click()+plus.click()-### interacting with elements+# type text in notepad+editor = client.locator('window:Notepad').locator('role:RichEdit')+editor.type_text('hello from terminator!')-```python-def interact_with_calc():- try:- print('opening calculator...')- client.open_application('calc')- sleep(1500) # give calc time to open-- # locate elements- calc_window = client.locator('window:Calculator')- seven = calc_window.locator('role:Button').locator('name:Seven')- plus = calc_window.locator('role:Button').locator('name:Plus')- eight = calc_window.locator('role:Button').locator('name:Eight')- equals = calc_window.locator('role:Button').locator('name:Equals')- display = calc_window.locator('name:CalculatorResults')-- print('clicking 7...')- seven.click()- sleep(200)-- print('clicking +...')- plus.click()- sleep(200)-- print('clicking 8...')- eight.click()- sleep(200)-- print('clicking =...')- equals.click()- sleep(500)-- # get the result- result = display.get_text()- print(f'calculation result: {result.text}') # e.g., "display is 15"-- except ApiError as e:- print(f'api error interacting with calculator: {e}')- except Exception as e:- print(f'an unexpected error occurred: {e}')--# interact_with_calc()--def interact_with_notepad():- try:- print('opening notepad...')- client.open_application('notepad')- sleep(1000)-- editor = client.locator('window:Notepad').locator('role:RichEdit')-- print('typing text...')- editor.type_text('hello from terminator!\nthis is a python test.')- sleep(500)-- print('pressing enter...')- editor.press_key('{Enter}')- sleep(200)-- editor.type_text('done.')-- content = editor.get_text()- print(f'notepad content retrieved: {content.text}')-- except ApiError as e:- print(f'api error interacting with notepad: {e}')- except Exception as e:- print(f'an unexpected error occurred: {e}')--# interact_with_notepad()+# get text content+result = editor.get_text()+print(result.text)```-*note: element selectors can vary. use tools like windows' accessibility insights to find correct selectors.*--### getting element state and attributes+### element state and attributes```python-def check_element_state():- try:- client.open_application('calc')- sleep(1000)- equals_button = client.locator('window:Calculator').locator('role:Button').locator('Name:Equals')+# check if element is visible+is_visible = seven.is_visible()- visible = equals_button.is_visible()- print(f'is equals button visible? {visible}')+# get element bounds+bounds = seven.get_bounds()- attributes = equals_button.get_attributes()- print(f'equals button attributes: {attributes}') # attributes is a dataclass-- bounds = equals_button.get_bounds()- print(f'equals button bounds: x={bounds.x}, y={bounds.y}, width={bounds.width}, height={bounds.height}')-- except ApiError as e:- print(f'api error checking element state: {e}')- except Exception as e:- print(f'an unexpected error occurred: {e}')--# check_element_state()+# get all attributes+attributes = seven.get_attributes()```-## expectations--use `expect_*` methods to wait for conditions.+### expectations (waiting for conditions)```python-def use_expectations():- try:- print('opening notepad...')- client.open_application('notepad')-- editor_locator = client.locator('window:Notepad').locator('role:RichEdit')-- # wait for the editor element to be visible (default timeout)- print('waiting for editor to be visible...')- editor_element: ElementResponse = editor_locator.expect_visible()- print(f'editor is visible! id: {editor_element.id}')+# wait for element to be visible+element = editor_locator.expect_visible()- # wait for it to be enabled (with a 5-second timeout)- print('waiting for editor to be enabled...')- editor_locator.expect_enabled(timeout=5000)- print('editor is enabled!')+# wait for element to be enabled with timeout+editor_locator.expect_enabled(timeout=5000)- editor_locator.type_text('initial text.')- sleep(1000)-- # wait for the text to exactly match 'initial text.'- print('waiting for text to match...')- editor_locator.expect_text_equals('initial text.', timeout=3000)- print('text matched!')-- # this would likely fail and raise ApiError after the timeout- # print('waiting for incorrect text (will timeout)...')- # editor_locator.expect_text_equals('wrong text', timeout=2000)-- except ApiError as e:- print(f'expectation error: {e}')- except Exception as e:- print(f'an unexpected error occurred: {e}')--# use_expectations()+# wait for specific text+editor_locator.expect_text_equals('expected text', timeout=3000)```-## error handling--use `try...except` blocks, catching `ApiError` for server/automation issues and potentially `ConnectionError` for network problems.+### error handling```pythontry:- # attempt to find a non-existent element- non_existent = client.locator('name:DoesNotExist')- non_existent.click()+ client.locator('name:DoesNotExist').click()except ApiError as e:- # handle specific api errors (e.g., element not found, timeout)- print(f'terminator api error (status: {e.status}): {e}')-except ConnectionError as e:- print(f'connection error: {e}. is the server running?')+ print(f'api error (status: {e.status}): {e}')except Exception as e:- # handle other unexpected errors- print(f'an unexpected python error occurred: {e}')-```+ print(f'unexpected error: {e}')+```