[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1450":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":14,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":16,"rankGlobal":8,"rankLanguage":8,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":8,"pushedAt":8,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":13,"starSnapshotCount":13,"syncStatus":25,"lastSyncTime":26,"discoverSource":27},1450,"background-computer-use","actuallyepic\u002Fbackground-computer-use","actuallyepic",null,"Swift",231,25,216,0,1,14,4.24,"MIT License",false,"main",true,[],"2026-06-12 02:00:28","# BackgroundComputerUse\n\nLocal macOS computer-use API for controlling native apps, browser windows, and multi-window desktop workflows without taking over the user's pointer.\n\nThe runtime exposes a loopback HTTP API, reads window screenshots and Accessibility state, and dispatches clicks, scrolling, text, key presses, secondary actions, and window motion against target windows. It uses macOS Accessibility, Screen Recording, and native\u002Fprivate window-event APIs.\n\nAt rough parity with OpenAI Codex Computer Use plugin \n\n[![BackgroundComputerUse demo](cover.png)](https:\u002F\u002Fyoutu.be\u002FRmB5Ontqb3Y)\n\n[Watch the demo](https:\u002F\u002Fyoutu.be\u002FRmB5Ontqb3Y)\n\n## Start\n\n```bash\n.\u002Fscript\u002Fstart.sh\n```\n\nThe script builds the Swift package, creates\u002Fsigns a `.app` bundle, installs it to `~\u002FApplications\u002FBackgroundComputerUse.app`, launches it, waits for the runtime manifest, prints the active local URL, and calls `\u002Fv1\u002Fbootstrap`.\n\nRuntime metadata is written to:\n\n```text\n$TMPDIR\u002Fbackground-computer-use\u002Fruntime-manifest.json\n```\n\nThe manifest includes `baseURL`, permission status, bootstrap instructions, and route summaries. Agents should read this file instead of assuming a fixed port.\n\n## Signing And Permissions\n\nSince the app requires accessibility + screenshot permissions, you need to sign (self-sign ok) the app after building \n\nmacOS permissions attach to the signed app bundle, not to an arbitrary command-line binary. Launch development builds through:\n\n```bash\n.\u002Fscript\u002Fstart.sh\n```\n\nor:\n\n```bash\n.\u002Fscript\u002Fbuild_and_run.sh run\n```\n\nIf no signing identity is configured, `script\u002Fbuild_and_run.sh` calls `script\u002Fbootstrap_signing_identity.sh` to create a local development code-signing identity in:\n\n```text\n~\u002FLibrary\u002FKeychains\u002Fbackground-computer-use-dev.keychain-db\n```\n\nYou can override signing with:\n\n```bash\nBACKGROUND_COMPUTER_USE_SIGNING_IDENTITY=\"Developer ID Application: ...\"\n.\u002Fscript\u002Fstart.sh\n```\n\nIf `\u002Fv1\u002Fbootstrap` reports missing permissions, grant them in System Settings and relaunch the app through the script.\n\n## Swift Package Usage\n\nThe package also exposes a direct Swift API for callers that do not need the loopback server:\n\nDepend on the `BackgroundComputerUseKit` library product, then import the `BackgroundComputerUse` module:\n\n```swift\nimport BackgroundComputerUse\n\nlet runtime = BackgroundComputerUseRuntime()\nlet apps = runtime.listApps()\nlet windows = try runtime.listWindows(.init(app: \"Safari\"))\n```\n\nDirect package calls default to `visualCursor: .disabled`, so action methods do not start the virtual cursor overlay or wait for cursor animation before dispatching. Existing action verification and post-action rereads still run.\n\nTarget factories validate the same shape as the HTTP JSON decoder and throw for invalid display indexes or empty node identifiers.\n\nEnable the visual cursor explicitly when you want the same cursor choreography used by the app runtime:\n\n```swift\nlet runtime = BackgroundComputerUseRuntime(\n    options: .init(visualCursor: .enabled)\n)\n```\n\nmacOS permissions attach to the signed host application. The bundled HTTP runtime keeps using the stable `xyz.dubdub.backgroundcomputeruse` app identity from `script\u002Fbuild_and_run.sh`; direct package consumers should use their own stable signed app identity if they need Accessibility or Screen Recording permissions.\n\n## API Flow\n\n1. `GET \u002Fv1\u002Fbootstrap`\n2. Check `permissions` and `instructions.ready`.\n3. `GET \u002Fv1\u002Froutes`\n4. `POST \u002Fv1\u002Flist_apps`\n5. `POST \u002Fv1\u002Flist_windows`\n6. `POST \u002Fv1\u002Fget_window_state`\n7. Act with `\u002Fv1\u002Fclick`, `\u002Fv1\u002Fscroll`, `\u002Fv1\u002Ftype_text`, `\u002Fv1\u002Fpress_key`, `\u002Fv1\u002Fset_value`, `\u002Fv1\u002Fperform_secondary_action`, `\u002Fv1\u002Fdrag`, `\u002Fv1\u002Fresize`, or `\u002Fv1\u002Fset_window_frame`.\n8. Read state again.\n\nFor visual work, request screenshots with `imageMode: \"path\"` or `imageMode: \"base64\"` and inspect them whenever possible. The AX tree is useful for semantic targeting, but screenshots are the visual ground truth; AX state and verifier summaries can lag, omit visual-only state, or be incomplete in some apps.\n\n## Routes\n\n`GET \u002Fv1\u002Froutes` is the self-documenting API catalog. It returns each route's method, path, summary, request schema, and response schema.\n\nAction responses omit verbose implementation `notes` by default. Add `\"debug\": true` to action requests when you want transport\u002Fplanner notes for debugging.\n\nCore routes:\n\n- `GET \u002Fhealth`\n- `GET \u002Fv1\u002Fbootstrap`\n- `GET \u002Fv1\u002Froutes`\n- `POST \u002Fv1\u002Flist_apps`\n- `POST \u002Fv1\u002Flist_windows`\n- `POST \u002Fv1\u002Fget_window_state`\n- `POST \u002Fv1\u002Fclick`\n- `POST \u002Fv1\u002Fscroll`\n- `POST \u002Fv1\u002Fperform_secondary_action`\n- `POST \u002Fv1\u002Fdrag`\n- `POST \u002Fv1\u002Fresize`\n- `POST \u002Fv1\u002Fset_window_frame`\n- `POST \u002Fv1\u002Ftype_text`\n- `POST \u002Fv1\u002Fpress_key`\n- `POST \u002Fv1\u002Fset_value`\n\n## Minimal Curl\n\n```bash\nBASE=\"$(python3 - \u003C\u003C'PY'\nimport json, os\npath = os.path.join(os.environ[\"TMPDIR\"], \"background-computer-use\", \"runtime-manifest.json\")\nprint(json.load(open(path))[\"baseURL\"])\nPY\n)\"\n\ncurl -s \"$BASE\u002Fv1\u002Fbootstrap\" | python3 -m json.tool\ncurl -s \"$BASE\u002Fv1\u002Froutes\" | python3 -m json.tool\ncurl -s -X POST \"$BASE\u002Fv1\u002Flist_apps\" -H 'content-type: application\u002Fjson' -d '{}' | python3 -m json.tool\n```\n\n## State And Actions\n\nRead a window:\n\n```bash\ncurl -s -X POST \"$BASE\u002Fv1\u002Flist_windows\" \\\n  -H 'content-type: application\u002Fjson' \\\n  -d '{\"app\":\"Safari\"}' | python3 -m json.tool\n\ncurl -s -X POST \"$BASE\u002Fv1\u002Fget_window_state\" \\\n  -H 'content-type: application\u002Fjson' \\\n  -d '{\"window\":\"WINDOW_ID\",\"imageMode\":\"path\",\"maxNodes\":6500}' | python3 -m json.tool\n```\n\nClick by semantic target:\n\n```bash\ncurl -s -X POST \"$BASE\u002Fv1\u002Fclick\" \\\n  -H 'content-type: application\u002Fjson' \\\n  -d '{\"window\":\"WINDOW_ID\",\"target\":{\"kind\":\"display_index\",\"value\":12},\"clickCount\":1,\"imageMode\":\"path\"}' | python3 -m json.tool\n```\n\nClick by screenshot coordinate:\n\n```bash\ncurl -s -X POST \"$BASE\u002Fv1\u002Fclick\" \\\n  -H 'content-type: application\u002Fjson' \\\n  -d '{\"window\":\"WINDOW_ID\",\"x\":240,\"y\":180,\"clickCount\":2,\"imageMode\":\"path\"}' | python3 -m json.tool\n```\n\nType into a text target:\n\n```bash\ncurl -s -X POST \"$BASE\u002Fv1\u002Ftype_text\" \\\n  -H 'content-type: application\u002Fjson' \\\n  -d '{\"window\":\"WINDOW_ID\",\"target\":{\"kind\":\"display_index\",\"value\":4},\"text\":\"hello\",\"focusAssistMode\":\"focus_and_caret_end\",\"imageMode\":\"path\"}' | python3 -m json.tool\n```\n\nUse the optional `cursor` object on action routes to show an on-screen agent cursor:\n\n```json\n{\"id\":\"agent-1\",\"name\":\"Agent\",\"color\":\"#20C46B\"}\n```\n\nCursors are session-based. Reuse the same `cursor.id` across related actions to move the same on-screen cursor continuously; use different IDs for independent agents or lanes.\n\n## License\n\nMIT\n\n---\n\ncrafted by [cam](https:\u002F\u002Fx.com\u002Ffinancialvice) and [anupam](https:\u002F\u002Fx.com\u002Fanupambatra_) | [dubdubdub labs](https:\u002F\u002Fwww.dubdubdub.xyz\u002F)\n","BackgroundComputerUse 是一个本地 macOS 计算机使用 API，用于控制原生应用程序、浏览器窗口和多窗口桌面工作流，而不会接管用户的指针。该项目通过暴露环回 HTTP API 读取窗口截图和可访问性状态，并针对目标窗口执行点击、滚动、文本输入、按键、次级操作和窗口移动等操作。它利用了 macOS 的可访问性、屏幕录制以及本地\u002F私有窗口事件 API。适合需要在后台自动化或控制 macOS 应用程序的场景，如自动化测试、用户界面交互脚本等。项目以 Swift 编写，支持直接 Swift API 调用，也提供了命令行工具方便启动和调试。",2,"2026-06-11 02:43:50","CREATED_QUERY"]