[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-932":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},932,"pi-computer-use","injaneity\u002Fpi-computer-use","injaneity","control your applications using pi-coding-agent. fully invisible.","",null,"TypeScript",585,45,4,1,0,7,13,48,21,8.99,"MIT License",false,"main",true,[],"2026-06-12 02:00:20","# pi-computer-use\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\".\u002Fassets\u002Flogo\u002Flogo3.png\" width=\"50%\" alt=\"pi-computer-use\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@injaneity\u002Fpi-computer-use\">\u003Cimg alt=\"npm\" src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002F@injaneity\u002Fpi-computer-use?style=flat-square\">\u003C\u002Fa>\n  \u003Ca href=\".\u002FLICENSE\">\u003Cimg alt=\"license\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Finjaneity\u002Fpi-computer-use?style=flat-square\">\u003C\u002Fa>\n  \u003Cimg alt=\"platform\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-macOS-lightgrey?style=flat-square\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Finjaneity\u002Fpi-computer-use\u002Factions\u002Fworkflows\u002Fci.yml\">\u003Cimg alt=\"ci\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Finjaneity\u002Fpi-computer-use\u002Fci.yml?branch=main&style=flat-square\">\u003C\u002Fa>\n\u003C\u002Fp>\n\nCodex-style computer use for [Pi](https:\u002F\u002Fpi.dev\u002F) on macOS.\n\n`pi-computer-use` gives Pi agents a semantic computer-use surface for visible macOS windows. It prefers Accessibility (AX) targets such as `@e1`, returns semantic state after every action, and attaches screenshots only when AX coverage is too weak for reliable operation.\n\n## Table of Contents\n\n- [Quick Start](#quick-start)\n- [What It Adds to Pi](#what-it-adds-to-pi)\n- [Examples](#examples)\n- [How It Works](#how-it-works)\n- [Documentation](#documentation)\n- [Development & Benchmarks](#development--benchmarks)\n- [Release & Install Notes](#release--install-notes)\n- [License](#license)\n- [See Also](#see-also)\n\n## Quick Start\n\nInstall the Pi package:\n\n```bash\npi install git:github.com\u002Finjaneity\u002Fpi-computer-use@v0.2.1\n```\n\nStart Pi in interactive mode. On the first session, grant macOS permissions to:\n\n```text\n~\u002F.pi\u002Fagent\u002Fhelpers\u002Fpi-computer-use\u002Fbridge\n```\n\nRequired permissions:\n\n- Accessibility\n- Screen Recording\n\nSome browser automation paths use JavaScript from Apple Events. If the browser blocks that, Pi surfaces a model-readable hint asking the user to enable **Allow JavaScript from Apple Events** in the browser's developer menu, then retry.\n\nThen call `screenshot` first in a Pi session. It selects the controlled window and returns the latest semantic state, including AX refs such as `@e1` when available. If the target app\u002Fwindow is ambiguous, use `list_apps` and `list_windows` first.\n\n```ts\nlist_apps()\nlist_windows({ app: \"Safari\" })\nscreenshot({ window: \"@w1\" })\nclick({ window: \"@w1\", ref: \"@e1\" })\nset_text({ ref: \"@e2\", text: \"hello\" })\n```\n\nUse `\u002Fcomputer-use` in Pi to inspect the effective config and config sources.\n\n## What It Adds to Pi\n\n- Public tools: `list_apps`, `list_windows`, `screenshot`, `click`, `double_click`, `move_mouse`, `drag`, `scroll`, `keypress`, `type_text`, `set_text`, `wait`, `arrange_window`, `navigate_browser`, `computer_actions`.\n- AX target refs in tool results, with capabilities such as `canSetValue`, `canPress`, `canFocus`, `canScroll`, and `adjust`.\n- Stable window refs from `list_windows`, with explicit targeting such as `screenshot({ window: \"@w1\" })` and `click({ window: \"@w1\", ref: \"@eN\" })`.\n- State IDs for stale-action detection.\n- Deterministic window layout through `arrange_window` presets or explicit frames.\n- Optional screenshot attachment mode with `image: \"auto\" | \"always\" | \"never\"`.\n- Ref-first actions such as `click({ ref: \"@eN\" })`, `scroll({ ref: \"@eN\" })`, and `set_text({ ref: \"@eN\", text })`.\n- Batched actions through `computer_actions`, with one post-action semantic state update plus per-action execution metadata.\n- Execution metadata that reports `stealth` for background-safe AX paths and `default` for focus\u002Fraw-event fallbacks.\n- Full pointer and keyboard primitive coverage for common GUI flows, with AX-first equivalents where available.\n- Browser-aware targeting, including isolated browser window preference where appropriate.\n- Optional strict AX mode for background-safe operation without foreground focus, raw pointer events, raw keyboard events, or cursor takeover.\n- Official QA benchmark harness in [`benchmarks\u002F`](.\u002Fbenchmarks\u002FREADME.md).\n\n## Examples\n\nPrefer AX refs over coordinates when a matching target exists:\n\n```ts\nclick({ ref: \"@e1\" })\nscroll({ ref: \"@e3\", scrollY: 600 })\n```\n\nUse coordinates from the latest screenshot only when there is no suitable AX target:\n\n```ts\nclick({ x: 320, y: 180, stateId: \"...\" })\n```\n\nReplace text through AX value semantics:\n\n```ts\nset_text({ ref: \"@e2\", text: \"https:\u002F\u002Fexample.com\" })\nkeypress({ keys: [\"Enter\"] })\n```\n\nBatch obvious actions when no intermediate inspection is needed:\n\n```ts\ncomputer_actions({\n  stateId: \"...\",\n  actions: [\n    { type: \"click\", ref: \"@e1\" },\n    { type: \"set_text\", ref: \"@e2\", text: \"https:\u002F\u002Fexample.com\" },\n    { type: \"keypress\", keys: [\"Enter\"] }\n  ]\n})\n```\n\nSee [docs\u002Fusage.md](.\u002Fdocs\u002Fusage.md) for the full workflow and tool patterns.\n\n## How It Works\n\n`pi-computer-use` has three pieces:\n\n1. The Pi extension in [`extensions\u002Fcomputer-use.ts`](.\u002Fextensions\u002Fcomputer-use.ts) registers the public tools and `\u002Fcomputer-use` command.\n2. The TypeScript bridge in [`src\u002Fbridge.ts`](.\u002Fsrc\u002Fbridge.ts) manages the current window, capture IDs, AX refs, fallback policy, batching, and execution metadata.\n3. The native Swift helper in [`native\u002Fmacos\u002Fbridge.swift`](.\u002Fnative\u002Fmacos\u002Fbridge.swift) talks to macOS Accessibility, ScreenCaptureKit, AppKit, and CoreGraphics.\n\nThe result is semantic-first GUI control: Pi sees useful AX targets first, falls back to screenshots only when needed, and reports whether each action stayed background-safe.\n\n## Documentation\n\n- [Usage guide](.\u002Fdocs\u002Fusage.md): tool workflow, AX refs, text input, browser flows, batching, and strict AX mode.\n- [Configuration](.\u002Fdocs\u002Fconfiguration.md): config files, environment overrides, browser control, and stealth mode.\n- [Development](.\u002Fdocs\u002Fdevelopment.md): local setup, helper builds, validation, release signing notes, and PR workflow.\n- [Troubleshooting](.\u002Fdocs\u002Ftroubleshooting.md): permissions, helper setup, stale refs, browser refusal, and strict mode errors.\n- [Benchmarks](.\u002Fbenchmarks\u002FREADME.md): benchmark commands, metrics, regression policy, and local comparison workflow.\n- [Contributing](.\u002FCONTRIBUTING.md): issue-first contribution rules and PR checklist.\n\n## Development & Benchmarks\n\nInstall dependencies:\n\n```bash\nnpm install\n```\n\nRun checks:\n\n```bash\nnpm test\n```\n\nRun the local checkout in Pi without loading another installed copy:\n\n```bash\npi --no-extensions -e .\n```\n\nRun the default QA benchmark:\n\n```bash\nnpm run benchmark:qa\n```\n\nRun the wider benchmark that may open apps:\n\n```bash\nnpm run benchmark:qa:full\n```\n\n## Release & Install Notes\n\nThe package is published on npm as `@injaneity\u002Fpi-computer-use`.\n\n```bash\nnpm install @injaneity\u002Fpi-computer-use\nnpm install @injaneity\u002Fpi-computer-use@0.2.1\n```\n\nPi installs should pin a GitHub release tag:\n\n```bash\npi install git:github.com\u002Finjaneity\u002Fpi-computer-use@v0.2.1\npi install -l git:github.com\u002Finjaneity\u002Fpi-computer-use@v0.2.1\npi install \u002Fabsolute\u002Fpath\u002Fto\u002Fpi-computer-use\n```\n\nRemove:\n\n```bash\npi remove git:github.com\u002Finjaneity\u002Fpi-computer-use@v0.2.1\nnpm remove @injaneity\u002Fpi-computer-use\n```\n\nFor a different release, replace `v0.2.1` or `0.2.1` with the version you want to pin.\n\n## Screenshots\n\n![pi-computer-use screenshot](.\u002Fassets\u002Freference\u002Fimg.jpg)\n\n## License\n\nMIT\n\n## See Also\n\n- [Pi](https:\u002F\u002Fpi.dev\u002F)\n- [`@mariozechner\u002Fpi-coding-agent`](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@mariozechner\u002Fpi-coding-agent)\n- [`@mariozechner\u002Fpi-ai`](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@mariozechner\u002Fpi-ai)\n","pi-computer-use 是一个用于通过 Pi 编码代理控制 macOS 应用程序的工具，完全无感操作。它主要使用 TypeScript 开发，提供了如列表应用程序、截图、点击等丰富的交互功能，并且优先采用 Accessibility (AX) 目标进行精准控制，在每次动作后返回语义状态信息，仅在 AX 覆盖不足时附加屏幕截图以确保可靠性。该项目非常适合需要对 macOS 系统上的应用进行自动化测试或远程控制的场景，比如软件开发中的自动化流程构建、UI 测试等，同时要求用户授予必要的系统权限以支持无障碍访问和屏幕录制等功能。",2,"2026-06-11 02:40:19","CREATED_QUERY"]