Files
orca/src/main/computer/macos-native-provider-paths.ts
T
NeilandOrca 73c5009b82 chore(dead-code): drop ~2k lines of unreachable exports and orphan modules (#12077)
* chore(dead-code): drop 2k lines of unreachable exports and orphan modules

Ran knip across every build entry (main, preload, renderer, popout, web,
cli, relay, workers, forked sidecars, config scripts) and removed what no
entry graph can reach.

- 11 orphan modules nothing imported, plus one test that only covered them
- 159 unused exports/types, with their now-dead helpers, imports and tests

Each candidate was verified against dynamic references before deletion.
42 knip hits were false positives and are kept: shared modules consumed by
the mobile/ workspace, the src/shared/plugins/** public API, vendored
shadcn primitives, and relay wire-protocol constants held for compatibility.

Adds knip.json + `pnpm audit:dead-code` so this stays measurable.

Verified: pnpm typecheck, pnpm lint, and 2081 tests across the 73 affected
test files all pass.

* chore(dead-code): move knip config under config/

Root-level additions are blocked by the root directory guard.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
2026-08-02 00:33:57 -07:00

28 lines
1.0 KiB
TypeScript

import { existsSync } from 'node:fs'
import { join, resolve } from 'node:path'
export function resolveMacOSComputerUseAppPath(): string | null {
const override = process.env.ORCA_COMPUTER_MACOS_HELPER_APP_PATH
if (override && existsSync(override)) {
return override
}
const packaged = [join(process.resourcesPath ?? '', 'Orca Computer Use.app')]
const dev = [
join(process.cwd(), 'native/computer-use-macos/.build/release/Orca Computer Use.app'),
resolve(__dirname, '../../native/computer-use-macos/.build/release/Orca Computer Use.app')
]
const candidates = process.resourcesPath ? [...packaged, ...dev] : dev
return candidates.find((candidate) => candidate && existsSync(candidate)) ?? null
}
export function resolveMacOSComputerUseExecutablePath(): string | null {
const appPath = resolveMacOSComputerUseAppPath()
if (!appPath) {
return null
}
const executablePath = join(appPath, 'Contents', 'MacOS', 'orca-computer-use-macos')
return existsSync(executablePath) ? executablePath : null
}