import { createDesktop } from "@githubnext/desktop-tools";
const desktop = createDesktop({
client: "/Applications/Example.app/Contents/MacOS/desktop-tools-client",
socket: "/path/to/desktop.sock",
name: "Example",
// Optional: names the agent in the host's window highlight, such as "Claude is using TextEdit".
agent: "Claude",
});
const apps = await desktop({ op: "apps" }, AbortSignal.timeout(30_000));
Each result has:
text: bounded JSON written for a model.data: the same final object, parsed.image: a base64 JPEG or PNG, when the result has one.outcome, for actions: completed, refused, or unknown.Before using an observation or receipt, check its target_receipt and the inventory completeness fields. Image bytes appear only in image.