👾 Open Computer Use – Open-Source Alternative to Codex Computer Use
Swift accessibilityai-agentai-agentsclaude-codecodexcodex-computer-usecomputer-usecomputer-use-agentcross-platformcuadesktop-automationgemini-cligui-automationmacosmcpmodel-context-protocolopen-computer-useopen-computer-use-mcpopenai-codexopencode
fix: distinguish dev and release open computer use apps
Leobf5cbd984e5e
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex fe9b24e..6a3fda9 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -35,50 +35,9 @@ jobs:with:node-version: "22"- - name: Prepare Open Computer Use signing config- env:- OPEN_COMPUTER_USE_CODESIGN_P12_BASE64: ${{ secrets.OPEN_COMPUTER_USE_CODESIGN_P12_BASE64 }}- OPEN_COMPUTER_USE_CODESIGN_P12_PASSWORD: ${{ secrets.OPEN_COMPUTER_USE_CODESIGN_P12_PASSWORD }}- OPEN_COMPUTER_USE_CODESIGN_KEYCHAIN_PASSWORD: ${{ secrets.OPEN_COMPUTER_USE_CODESIGN_KEYCHAIN_PASSWORD }}- OPEN_COMPUTER_USE_CODESIGN_IDENTITY: ${{ secrets.OPEN_COMPUTER_USE_CODESIGN_IDENTITY }}- run: |- echo "OPEN_COMPUTER_USE_CODESIGN_MODE=adhoc" >> "${GITHUB_ENV}"-- if [ -z "${OPEN_COMPUTER_USE_CODESIGN_P12_BASE64}" ] || [ -z "${OPEN_COMPUTER_USE_CODESIGN_P12_PASSWORD}" ]; then- echo "No Open Computer Use signing certificate configured; release artifacts will fall back to ad-hoc signing and may create install-specific macOS permission identities."- exit 0- fi-- keychain_password="${OPEN_COMPUTER_USE_CODESIGN_KEYCHAIN_PASSWORD:-${RUNNER_TEMP}-open-computer-use-keychain}"- cert_path="${RUNNER_TEMP}/open-computer-use-signing.p12"- keychain_path="${RUNNER_TEMP}/open-computer-use-signing.keychain-db"-- CERT_PATH="${cert_path}" python3 -c 'import base64, os, pathlib; pathlib.Path(os.environ["CERT_PATH"]).write_bytes(base64.b64decode(os.environ["OPEN_COMPUTER_USE_CODESIGN_P12_BASE64"]))'-- security create-keychain -p "${keychain_password}" "${keychain_path}"- security set-keychain-settings -lut 21600 "${keychain_path}"- security unlock-keychain -p "${keychain_password}" "${keychain_path}"- security import "${cert_path}" -k "${keychain_path}" -P "${OPEN_COMPUTER_USE_CODESIGN_P12_PASSWORD}" -T /usr/bin/codesign -T /usr/bin/security- security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${keychain_password}" "${keychain_path}"- existing_keychains="$(security list-keychains -d user | tr -d '"')"- # shellcheck disable=SC2086- security list-keychains -d user -s "${keychain_path}" ${existing_keychains}- security default-keychain -d user -s "${keychain_path}"-- resolved_identity="$(security find-identity -v -p codesigning | sed -n 's/.*\"\\(.*\\)\"/\\1/p' | head -n 1)"- if [ -z "${resolved_identity}" ]; then- echo "Imported signing certificate, but no usable codesigning identity was found in ${keychain_path}." >&2- exit 1- fi-- echo "Resolved Open Computer Use signing identity: ${resolved_identity}"-- {- echo "OPEN_COMPUTER_USE_CODESIGN_MODE=identity"- echo "OPEN_COMPUTER_USE_CODESIGN_IDENTITY=${resolved_identity}"- } >> "${GITHUB_ENV}"-- name: Build npm release artifacts+ env:+ OPEN_COMPUTER_USE_CODESIGN_MODE: adhocrun: npm run npm:pack- name: Upload npm release artifactsdiff --git a/README.md b/README.mdindex 0a27ab4..d56922f 100644--- a/README.md+++ b/README.md@@ -18,7 +18,7 @@ Install it globally first:npm i -g open-computer-use```-Before first use, grant macOS `Accessibility` and `Screen Recording` permission to the `Open Computer Use.app` you actually plan to keep installed. Official npm / Homebrew / DMG builds should share the same bundle identifier and signing identity so macOS treats them as the same app; unsigned local debug builds can still appear as separate permission entries. If you are not sure about the current state, run:+Before first use, grant macOS `Accessibility` and `Screen Recording` permission to the `Open Computer Use.app` you actually plan to keep installed. The CI-built release package remains the stable identity for distribution. Local debug/dev builds are intentionally packaged as `Open Computer Use (Dev).app`, so System Settings shows them as a separate development app instead of another indistinguishable `Open Computer Use`. If you are not sure about the current state, run:```bashopen-computer-usediff --git a/README.zh-CN.md b/README.zh-CN.mdindex 245f228..65a5c93 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -18,7 +18,7 @@npm i -g open-computer-use```-第一次使用前,给你实际准备长期保留的那个 `Open Computer Use.app` 授予 macOS 的 `Accessibility` 和 `Screen Recording` 权限。正式发布的 npm / Homebrew / DMG 构建应共享同一个 bundle identifier 和签名身份,这样 macOS 才会把它们识别成同一个 app;未正式签名的本地调试构建仍可能单独占一个权限条目。+第一次使用前,给你实际准备长期保留的那个 `Open Computer Use.app` 授予 macOS 的 `Accessibility` 和 `Screen Recording` 权限。CI 产出的 release 包继续作为正式分发身份;本地 debug/dev 构建会故意打成 `Open Computer Use (Dev).app`,这样系统设置里会明确显示成一个开发版 app,而不是再出现两个同名的 `Open Computer Use`。```bashopen-computer-usediff --git a/apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift b/apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swiftindex d018cff..7cb61cc 100644--- a/apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift+++ b/apps/OpenComputerUse/Sources/OpenComputerUse/PermissionOnboardingApp.swift@@ -56,7 +56,7 @@ final class PermissionWindowController: NSWindowController {defer: false)- window.title = PermissionSupport.bundleDisplayName+ window.title = PermissionSupport.currentBundleDisplayName()window.titleVisibility = .hiddenwindow.titlebarAppearsTransparent = truewindow.isReleasedWhenClosed = false@@ -1113,7 +1113,9 @@ final class DraggableAppTileView: NSView, NSDraggingSource {private func currentIcon() -> NSImage {if let bundleURL = PermissionSupport.currentAppBundleURL() {- if let bundle = Bundle(url: bundleURL), bundle.bundleIdentifier == PermissionSupport.bundleIdentifier {+ if let bundle = Bundle(url: bundleURL),+ PermissionSupport.isOpenComputerUseBundleIdentifier(bundle.bundleIdentifier)+ {return Branding.makeAppIconImage(size: 128)}diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex a214dca..9ee2476 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -35,7 +35,7 @@- app bundle 以 `LSUIElement` agent-style 形态运行,默认不在 Dock 暴露常驻图标,但仍可按需显示权限窗口。- 主窗口负责渲染 `Accessibility` / `Screen & System Audio Recording` 两类权限卡片、`Allow` / `Done` 状态和 relaunch 后的状态收敛;当两项权限都已完成时会自动关闭,不再要求用户手动退出。- 辅助 drag panel 会跳转到对应的 `System Settings` 页面;点击 `Allow` 后,panel 会从主窗口里的按钮位置做一段 spring + curved frame 的入场,再落到 `System Settings` 内容区下沿。panel 默认保持在窗口右侧内容区下方居中并固定贴近窗口底边,不再依赖实时扫描权限页内部 `+ / -` 控件行;窗口层级上会显式排在当前 `System Settings` 窗口之上,避免被权限列表内容盖住,同时尽量减少对系统设置自身滚动区域的干扰。panel 内也补了显式返回按钮,允许用户中断当前 guidance、回到 onboarding 主窗口重新选择权限步骤。-- 权限状态优先基于 TCC 持久授权记录判断,避免 CLI 子进程与 GUI app 对授权状态看到不一致的结果;同时会兼容 bundle-id 和路径型授权记录,并按统一 bundle identity 去发现当前运行副本、`/Applications`、npm、Homebrew 等渠道的已安装 `.app`。源码态 `dist/` 产物只作为开发兜底;如果没有统一的正式 codesign identity,不同渠道或不同构建产物仍可能在 TCC 里分裂成多个授权条目。+- 权限状态优先基于 TCC 持久授权记录判断,避免 CLI 子进程与 GUI app 对授权状态看到不一致的结果;正式 release 仍以 CI 打出来的 `Open Computer Use.app` 为准,而本地 debug/dev 打包现在显式命名为 `Open Computer Use (Dev).app`,并在 dev bundle 运行时优先认当前 dev 副本,避免系统设置里出现两个完全同名的条目。### 2. MCP 层diff --git a/docs/CICD.md b/docs/CICD.mdindex a68e6e7..311ae69 100644--- a/docs/CICD.md+++ b/docs/CICD.md@@ -4,9 +4,9 @@## 当前 release 入口-- `scripts/release-package.sh`:构建 universal `Open Computer Use.app`,stage 三个 npm 包目录,并产出 `dist/release/npm/*.tgz` 与 `dist/release/release-manifest.json`。如果提供统一的 Apple codesign identity,npm 包里的 `.app` 会按同一签名链封装;否则会回退到 ad-hoc signing。+- `scripts/release-package.sh`:构建 universal `Open Computer Use.app`,stage 三个 npm 包目录,并产出 `dist/release/npm/*.tgz` 与 `dist/release/release-manifest.json`。当前 CI 继续显式使用 ad-hoc signing,保持和此前发布链路一致;本地 debug/dev 构建则允许使用开发机自己的签名身份。- `scripts/build-cursor-motion-dmg.sh`:本地构建 `Cursor Motion.app` 并封装 `dist/release/cursor-motion/CursorMotion-<version>.dmg`,支持 `native` / `arm64` / `x86_64` / `universal`。-- `.github/workflows/release.yml`:支持 push semver tag 自动发布,也支持手动触发;tag push 时会同时跑 npm release 打包逻辑与 `Cursor Motion` 的 DMG 打包,并把 `.dmg` 上传到对应的 GitHub Releases 页面。`Open Computer Use` 的 npm 产物会优先使用仓库 secrets 里提供的 codesign 证书导入临时 keychain 后统一签名;若未配置证书则仍回退到 ad-hoc signing。当前 `Cursor Motion` 这条链路仍只做 ad-hoc codesign,不包含 notarization。+- `.github/workflows/release.yml`:支持 push semver tag 自动发布,也支持手动触发;tag push 时会同时跑 npm release 打包逻辑与 `Cursor Motion` 的 DMG 打包,并把 `.dmg` 上传到对应的 GitHub Releases 页面。`Open Computer Use` 的 npm 产物当前固定走 ad-hoc signing,后续如果要接入正式 Apple 分发证书,再在这条流水线上补回统一签名逻辑。当前 `Cursor Motion` 这条链路仍只做 ad-hoc codesign,不包含 notarization。## 设计原则diff --git a/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/Permissions.swift b/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/Permissions.swiftindex cde0971..f8c3cc4 100644--- a/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/Permissions.swift+++ b/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/Permissions.swift@@ -35,11 +35,12 @@ public enum SystemPermissionKind: String, CaseIterable, Sendable {}public var dragInstruction: String {+ let appName = PermissionSupport.currentBundleDisplayName()switch self {case .accessibility:- return "Drag Open Computer Use above to allow Accessibility"+ return "Drag \(appName) above to allow Accessibility"case .screenRecording:- return "Drag Open Computer Use above to allow Screenshots"+ return "Drag \(appName) above to allow Screenshots"}}@@ -100,26 +101,46 @@ public struct PermissionDiagnostics: Sendable {public enum PermissionSupport {public static let bundleDisplayName = "Open Computer Use"public static let bundleIdentifier = "com.ifuryst.opencomputeruse"- private static let appBundleName = "\(bundleDisplayName).app"+ public static let developmentBundleDisplayName = "Open Computer Use (Dev)"+ public static let developmentBundleIdentifier = "com.ifuryst.opencomputeruse.dev"+ private static let releaseAppBundleName = "\(bundleDisplayName).app"+ private static let developmentAppBundleName = "\(developmentBundleDisplayName).app"+ private static let appVariantInfoKey = "OpenComputerUseAppVariant"private static let npmPackageNames = ["open-computer-use","open-computer-use-mcp","open-codex-computer-use-mcp",]+ public static func currentBundleDisplayName(bundle: Bundle = .main) -> String {+ let displayName = bundle.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String+ let bundleName = bundle.object(forInfoDictionaryKey: kCFBundleNameKey as String) as? String++ return displayName ?? bundleName ?? (isDevelopmentBundleIdentifier(bundle.bundleIdentifier) ? developmentBundleDisplayName : bundleDisplayName)+ }++ public static func isOpenComputerUseBundleIdentifier(_ bundleIdentifier: String?) -> Bool {+ bundleIdentifier == Self.bundleIdentifier || bundleIdentifier == developmentBundleIdentifier+ }+public static func currentAppBundleURL() -> URL? {- preferredPermissionAppBundleURL(+ let runningBundleURL = resolvedMainAppBundleURL()+ return preferredPermissionAppBundleURL(preferredInstalledBundleURL: preferredInstalledAppBundleURL(),- runningBundleURL: resolvedMainAppBundleURL(),- fallbackDevelopmentBundleURL: fallbackDevelopmentAppBundleURL()+ runningBundleURL: runningBundleURL,+ fallbackDevelopmentBundleURL: fallbackDevelopmentAppBundleURL(),+ preferRunningBundle: isDevelopmentAppBundle(runningBundleURL))}public static func currentPermissionClients() -> [PermissionClientRecord] {- permissionClients(+ let runningBundleURL = resolvedMainAppBundleURL()+ let mainBundleIdentifier = resolvedBundleIdentifier(for: runningBundleURL) ?? Bundle.main.bundleIdentifier+ return permissionClients(primaryBundleURL: currentAppBundleURL(),- runningBundleURL: resolvedMainAppBundleURL(),- mainBundleIdentifier: Bundle.main.bundleIdentifier+ runningBundleURL: runningBundleURL,+ mainBundleIdentifier: mainBundleIdentifier,+ includeCanonicalBundleIdentifier: !isDevelopmentBundleIdentifier(mainBundleIdentifier))}@@ -135,15 +156,21 @@ public enum PermissionSupport {static func preferredPermissionAppBundleURL(preferredInstalledBundleURL: URL?,runningBundleURL: URL?,- fallbackDevelopmentBundleURL: URL?+ fallbackDevelopmentBundleURL: URL?,+ preferRunningBundle: Bool = false) -> URL? {- preferredInstalledBundleURL ?? runningBundleURL ?? fallbackDevelopmentBundleURL+ if preferRunningBundle {+ return runningBundleURL ?? preferredInstalledBundleURL ?? fallbackDevelopmentBundleURL+ }++ return preferredInstalledBundleURL ?? runningBundleURL ?? fallbackDevelopmentBundleURL}static func permissionClients(primaryBundleURL: URL?,runningBundleURL: URL?,mainBundleIdentifier: String?,+ includeCanonicalBundleIdentifier: Bool = true,canonicalBundleIdentifier: String = bundleIdentifier) -> [PermissionClientRecord] {var records: [PermissionClientRecord] = []@@ -156,9 +183,13 @@ public enum PermissionSupport {records.append(record)}- append(PermissionClientRecord(identifier: canonicalBundleIdentifier, type: 0))+ if includeCanonicalBundleIdentifier {+ append(PermissionClientRecord(identifier: canonicalBundleIdentifier, type: 0))+ }- if let mainBundleIdentifier, mainBundleIdentifier != canonicalBundleIdentifier {+ if let mainBundleIdentifier,+ (!includeCanonicalBundleIdentifier || mainBundleIdentifier != canonicalBundleIdentifier)+ {append(PermissionClientRecord(identifier: mainBundleIdentifier, type: 0))}@@ -211,7 +242,7 @@ public enum PermissionSupport {appendCandidate(NSWorkspace.shared.urlForApplication(withBundleIdentifier: bundleIdentifier))for directory in standardApplicationDirectories() {- appendCandidate(directory.appendingPathComponent(appBundleName, isDirectory: true))+ appendCandidate(directory.appendingPathComponent(releaseAppBundleName, isDirectory: true))}for nodeModulesRoot in npmGlobalNodeModulesRoots() {@@ -220,7 +251,7 @@ public enum PermissionSupport {nodeModulesRoot.appendingPathComponent(packageName, isDirectory: true).appendingPathComponent("dist", isDirectory: true)- .appendingPathComponent(appBundleName, isDirectory: true)+ .appendingPathComponent(releaseAppBundleName, isDirectory: true))}}@@ -229,7 +260,7 @@ public enum PermissionSupport {appendCandidate(prefix.appendingPathComponent("Caskroom", isDirectory: true).appendingPathComponent("open-computer-use", isDirectory: true)- .appendingPathComponent(appBundleName, isDirectory: true)+ .appendingPathComponent(releaseAppBundleName, isDirectory: true))let caskroomRoot = prefix@@ -237,7 +268,7 @@ public enum PermissionSupport {.appendingPathComponent("open-computer-use", isDirectory: true)if let versionDirectories = try? fileManager.contentsOfDirectory(at: caskroomRoot, includingPropertiesForKeys: nil, options: [.skipsHiddenFiles]) {for versionDirectory in versionDirectories {- appendCandidate(versionDirectory.appendingPathComponent(appBundleName, isDirectory: true))+ appendCandidate(versionDirectory.appendingPathComponent(releaseAppBundleName, isDirectory: true))}}@@ -248,7 +279,7 @@ public enum PermissionSupport {for versionDirectory in versionDirectories {appendCandidate(versionDirectory.appendingPathComponent("dist", isDirectory: true)- .appendingPathComponent(appBundleName, isDirectory: true)+ .appendingPathComponent(releaseAppBundleName, isDirectory: true))}}@@ -265,12 +296,17 @@ public enum PermissionSupport {var directoryURL = executableURL.deletingLastPathComponent()while directoryURL.path != "/" {- let candidate = directoryURL- .appendingPathComponent("dist", isDirectory: true)- .appendingPathComponent(appBundleName, isDirectory: true)+ for (bundleName, acceptedBundleIdentifiers) in [+ (developmentAppBundleName, Set([developmentBundleIdentifier])),+ (releaseAppBundleName, Set([bundleIdentifier])),+ ] {+ let candidate = directoryURL+ .appendingPathComponent("dist", isDirectory: true)+ .appendingPathComponent(bundleName, isDirectory: true)- if isValidAppBundle(candidate) {- return candidate+ if isValidAppBundle(candidate, acceptedBundleIdentifiers: acceptedBundleIdentifiers) {+ return candidate+ }}let parentURL = directoryURL.deletingLastPathComponent()@@ -352,21 +388,56 @@ public enum PermissionSupport {private static func resolvedMainAppBundleURL() -> URL? {let bundleURL = Bundle.main.bundleURL.standardizedFileURL- guard bundleURL.pathExtension == "app", isValidAppBundle(bundleURL) else {+ guard bundleURL.pathExtension == "app",+ isValidAppBundle(bundleURL, acceptedBundleIdentifiers: [bundleIdentifier, developmentBundleIdentifier])+ else {return nil}return bundleURL}- private static func isValidAppBundle(_ bundleURL: URL) -> Bool {+ private static func resolvedBundleIdentifier(for bundleURL: URL?) -> String? {+ guard let bundleURL, let bundle = Bundle(url: bundleURL) else {+ return nil+ }++ return bundle.bundleIdentifier+ }++ private static func isDevelopmentBundleIdentifier(_ bundleIdentifier: String?) -> Bool {+ bundleIdentifier == developmentBundleIdentifier+ }++ private static func isDevelopmentAppBundle(_ bundleURL: URL?) -> Bool {+ guard let bundleURL, let bundle = Bundle(url: bundleURL) else {+ return false+ }++ if let variant = bundle.object(forInfoDictionaryKey: appVariantInfoKey) as? String,+ variant.caseInsensitiveCompare("dev") == .orderedSame+ {+ return true+ }++ if isDevelopmentBundleIdentifier(bundle.bundleIdentifier) {+ return true+ }++ return bundleURL.lastPathComponent == developmentAppBundleName+ }++ private static func isValidAppBundle(+ _ bundleURL: URL,+ acceptedBundleIdentifiers: Set<String> = [bundleIdentifier]+ ) -> Bool {let fileManager = FileManager.defaultlet infoPlistURL = bundleURL.appendingPathComponent("Contents/Info.plist")guard fileManager.fileExists(atPath: infoPlistURL.path),let bundle = Bundle(url: bundleURL),let executableName = bundle.object(forInfoDictionaryKey: kCFBundleExecutableKey as String) as? String,!executableName.isEmpty,- bundle.bundleIdentifier == bundleIdentifier+ acceptedBundleIdentifiers.contains(bundle.bundleIdentifier ?? "")else {return false}diff --git a/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift b/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swiftindex cddb5b7..799a19c 100644--- a/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift+++ b/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift@@ -89,6 +89,21 @@ final class OpenComputerUseKitTests: XCTestCase {XCTAssertEqual(resolved, installed)}+ func testPreferredPermissionAppBundleURLPrefersRunningDevelopmentCopy() {+ let installed = URL(fileURLWithPath: "/Applications/Open Computer Use.app")+ let running = URL(fileURLWithPath: "/Users/example/projects/open-codex-computer-use/dist/Open Computer Use (Dev).app")+ let fallback = URL(fileURLWithPath: "/Users/example/projects/open-codex-computer-use-debug/dist/Open Computer Use (Dev).app")++ let resolved = PermissionSupport.preferredPermissionAppBundleURL(+ preferredInstalledBundleURL: installed,+ runningBundleURL: running,+ fallbackDevelopmentBundleURL: fallback,+ preferRunningBundle: true+ )++ XCTAssertEqual(resolved, running)+ }+func testPreferredInstalledAppBundleURLUsesFirstDiscoveredInstalledCopy() {let applications = URL(fileURLWithPath: "/Applications/Open Computer Use.app")let npm = URL(fileURLWithPath: "/opt/homebrew/lib/node_modules/open-computer-use/dist/Open Computer Use.app")@@ -121,6 +136,25 @@ final class OpenComputerUseKitTests: XCTestCase {)}+ func testPermissionClientsKeepDevelopmentBundleIdentitySeparateFromRelease() {+ let running = URL(fileURLWithPath: "/Users/example/projects/open-codex-computer-use/dist/Open Computer Use (Dev).app")++ let clients = PermissionSupport.permissionClients(+ primaryBundleURL: running,+ runningBundleURL: running,+ mainBundleIdentifier: PermissionSupport.developmentBundleIdentifier,+ includeCanonicalBundleIdentifier: false+ )++ XCTAssertEqual(+ clients,+ [+ PermissionClientRecord(identifier: PermissionSupport.developmentBundleIdentifier, type: 0),+ PermissionClientRecord(identifier: running.path, type: 1),+ ]+ )+ }+func testTCCAuthorizationGrantedTreatsAnyGrantedCandidateAsGranted() {XCTAssertTrue(tccAuthorizationGranted(authValues: [0, 2]))XCTAssertFalse(tccAuthorizationGranted(authValues: [0, nil]))diff --git a/plugins/open-computer-use/scripts/launch-open-computer-use.sh b/plugins/open-computer-use/scripts/launch-open-computer-use.shindex 178a4e5..686c2dd 100755--- a/plugins/open-computer-use/scripts/launch-open-computer-use.sh+++ b/plugins/open-computer-use/scripts/launch-open-computer-use.sh@@ -6,7 +6,9 @@ plugin_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"repo_root="$(cd "${plugin_root}/../.." && pwd)"candidate_binaries=("${plugin_root}/Open Computer Use.app/Contents/MacOS/OpenComputerUse"+ "${plugin_root}/Open Computer Use (Dev).app/Contents/MacOS/OpenComputerUse""${plugin_root}/OpenComputerUse.app/Contents/MacOS/OpenComputerUse"+ "${repo_root}/dist/Open Computer Use (Dev).app/Contents/MacOS/OpenComputerUse""${repo_root}/dist/Open Computer Use.app/Contents/MacOS/OpenComputerUse""${repo_root}/dist/OpenComputerUse.app/Contents/MacOS/OpenComputerUse")diff --git a/scripts/build-open-computer-use-app.sh b/scripts/build-open-computer-use-app.shindex 58c85a3..6e720a7 100755--- a/scripts/build-open-computer-use-app.sh+++ b/scripts/build-open-computer-use-app.sh@@ -187,18 +187,38 @@ cd "${repo_root}"package_version="$(read_package_version)"bundle_version="${OPEN_COMPUTER_USE_BUNDLE_VERSION:-$(git -C "${repo_root}" rev-list --count HEAD 2>/dev/null || echo 1)}"-app_bundle_name="Open Computer Use.app"+release_app_bundle_name="Open Computer Use.app"+development_app_bundle_name="Open Computer Use (Dev).app"legacy_app_bundle_name="OpenComputerUse.app"bundle_icon_name="OpenComputerUse.icns"icon_render_script="${repo_root}/scripts/render-open-computer-use-icon.swift"+bundle_display_name="Open Computer Use"+bundle_identifier="com.ifuryst.opencomputeruse"+app_variant="release"+app_bundle_name="${release_app_bundle_name}"++if [[ "${configuration}" != "release" ]]; then+ bundle_display_name="Open Computer Use (Dev)"+ bundle_identifier="com.ifuryst.opencomputeruse.dev"+ app_variant="dev"+ app_bundle_name="${development_app_bundle_name}"+fi+app_root="${repo_root}/dist/${app_bundle_name}"+release_app_root="${repo_root}/dist/${release_app_bundle_name}"+development_app_root="${repo_root}/dist/${development_app_bundle_name}"legacy_app_root="${repo_root}/dist/${legacy_app_bundle_name}"contents_dir="${app_root}/Contents"macos_dir="${contents_dir}/MacOS"resources_dir="${contents_dir}/Resources"rm -rf "${app_root}" "${legacy_app_root}"+if [[ "${app_variant}" == "release" ]]; then+ rm -rf "${development_app_root}"+else+ rm -rf "${release_app_root}"+fimkdir -p "${macos_dir}" "${resources_dir}"case "${arch_mode}" in@@ -244,13 +264,15 @@ cat > "${contents_dir}/Info.plist" <<PLIST<key>CFBundleIconFile</key><string>${bundle_icon_name}</string><key>CFBundleIdentifier</key>- <string>com.ifuryst.opencomputeruse</string>+ <string>${bundle_identifier}</string><key>CFBundleInfoDictionaryVersion</key><string>6.0</string><key>CFBundleName</key>- <string>Open Computer Use</string>+ <string>${bundle_display_name}</string><key>CFBundleDisplayName</key>- <string>Open Computer Use</string>+ <string>${bundle_display_name}</string>+ <key>OpenComputerUseAppVariant</key>+ <string>${app_variant}</string><key>CFBundlePackageType</key><string>APPL</string><key>CFBundleShortVersionString</key>diff --git a/scripts/install-codex-plugin.sh b/scripts/install-codex-plugin.shindex a8b4e1d..613964c 100755--- a/scripts/install-codex-plugin.sh+++ b/scripts/install-codex-plugin.sh@@ -13,6 +13,26 @@ build_script="${repo_root}/scripts/build-open-computer-use-app.sh"configuration="debug"rebuild="false"+resolve_app_bundle() {+ local -a candidates++ if [[ "${configuration}" == "release" ]]; then+ candidates=("Open Computer Use.app")+ else+ candidates=("Open Computer Use (Dev).app" "Open Computer Use.app")+ fi++ for bundle_name in "${candidates[@]}"; do+ local candidate="${repo_root}/dist/${bundle_name}"+ if [[ -d "${candidate}" ]]; then+ printf '%s\n' "${candidate}"+ return 0+ fi+ done++ return 1+}+while [[ $# -gt 0 ]]; docase "$1" in--rebuild)@@ -35,12 +55,14 @@ while [[ $# -gt 0 ]]; doesacdone-app_bundle="${repo_root}/dist/Open Computer Use.app"-app_binary="${app_bundle}/Contents/MacOS/OpenComputerUse"+app_bundle="$(resolve_app_bundle || true)"+app_binary="${app_bundle:+${app_bundle}/Contents/MacOS/OpenComputerUse}"-if [[ "${rebuild}" == "true" || ! -x "${app_binary}" ]]; then+if [[ "${rebuild}" == "true" || -z "${app_binary}" || ! -x "${app_binary}" ]]; thenif [[ -x "${build_script}" ]]; then"${build_script}" "${configuration}"+ app_bundle="$(resolve_app_bundle || true)"+ app_binary="${app_bundle:+${app_bundle}/Contents/MacOS/OpenComputerUse}"elseecho "Missing runnable app bundle at ${app_binary} and no local build script is available." >&2exit 1@@ -57,7 +79,7 @@ if [[ ! -f "${plugin_manifest}" ]]; thenexit 1fi-if [[ ! -x "${app_binary}" ]]; then+if [[ -z "${app_bundle}" || ! -x "${app_binary}" ]]; thenecho "Missing runnable app binary at ${app_binary}" >&2exit 1fi