Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
cua #
the cua extension (requires python, installed and off by default) drives
native desktop GUI applications through cua-driver
from the Python kernel (priv/python/albedo_plugins/cua.py).
- binary resolution: resolved lazily on the first
cua.*call (orcua.configure(executable=..., socket=...)) in order:cua.configure(executable=...)$ALBEDO_CUA_DRIVER$CUA_DRIVER_PATHextensions.jsonunder"cua": {"executable": "...", "socket": "..."}cua-driveronPATH- standard install paths (
~/.local/bin/cua-driver,/Applications/CuaDriver.app/Contents/MacOS/cua-driver,~/Applications/CuaDriver.app/Contents/MacOS/cua-driver,%LOCALAPPDATA%\Programs\Cua\cua-driver\bin\cua-driver.exe)
- transport and lifecycle: one persistent
cua-driver mcpstdio subprocess per kernel (DO_NOT_TRACK=1,CUA_TELEMETRY=0), initialized with a fresh kernel-scopedsessionlabel (albedo-<hex>) whenever the subprocess starts so snapshotelement_tokenhandles remain valid across cells and acrossawait cua.close()restarts.await cua.close()and kernel shutdown callend_sessionand terminate the stdio subprocess. - window handles and observations:
await cua.windows(pid=None)returns boundWindowhandles (Recordsubclasses carryingpidandwindow_id),await cua.window(target=None, window_id=None, app=None, title=None)resolves a singleWindowhandle by app/title substring or(pid, window_id), andawait cua.launch(...)returns a boundWindowhandle when the launched app exposes a single window.await win.observe()(orawait cua.observe(window_or_pid, window_id=None)andawait cua.desktop()) captures the screenshot into a temporary PNG (screenshot_out_file), attaches its bytes to the running cell viaapi.attach_image, and returns anObservation(Recordsubclass with.render(),.find(...), and.one(...)alongsidecua.render(snap),cua.find(snap, ...), andcua.one(snap, ...)).await win.zoom(x1, y1, x2, y2)(orawait cua.zoom(target, x1, y1, x2, y2)) crops a full-resolution region and attaches the cropped image to the cell. - actions: bound on
Window(await win.click(...),await win.double_click(...),await win.right_click(...),await win.move(x, y),await win.drag(...),await win.scroll(...),await win.type_text(...),await win.set_value(...),await win.press_key(...),await win.hotkey(...),await win.menu(...),await win.frame(...),await win.focus(),await win.kill(),await win.verify(...)) and top-level oncua.*(target, ...). Window targets default todelivery_mode="background"and"desktop"defaults todelivery_mode="foreground", raisingCuaError(witherror.codeanderror.details) on tool refusals such asbackground_unavailableorstale_element_token. - clipboard, permissions, health, and recording:
await cua.clipboard(text=None, file_path=None, image_path=None)reads (clipboard_read) or writes (clipboard_write) the system clipboard;await cua.permissions(prompt=False)andawait cua.health()wrapcheck_permissionsandhealth_report;await cua.start_recording(output_dir, record_video=False),await cua.stop_recording(), andawait cua.recording_state()wrap per-turn trajectory and ScreenCaptureKit MP4 recording. - escape hatch:
await cua.tools()lists the livecua-drivertool schemas andawait cua.call(tool, arguments=None, **kwargs)invokes any tool directly. - tests:
test/e2e/cua_test.pydrives the real daemon and kernel against a hermetic fakecua-driverMCP script;test/harness/api_docs_test.pychecks that every publiccuamethod is documented in the model prompt.