MCPcopy Create free account
hub / github.com/HELPMEEADICE/doge-code / getComputerUseHostAdapter

Function getComputerUseHostAdapter

src/utils/computerUse/hostAdapter.ts:38–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 * degraded mode.
37 */
38export function getComputerUseHostAdapter(): ComputerUseHostAdapter {
39 if (cached) return cached
40 cached = {
41 serverName: COMPUTER_USE_MCP_SERVER_NAME,
42 logger: new DebugLogger(),
43 executor: createCliExecutor({
44 getMouseAnimationEnabled: () => getChicagoSubGates().mouseAnimation,
45 getHideBeforeActionEnabled: () => getChicagoSubGates().hideBeforeAction,
46 }),
47 ensureOsPermissions: async () => {
48 if (process.platform !== 'darwin') return { granted: true }
49 const cu = requireComputerUseSwift()
50 const accessibility = (cu as any).tcc.checkAccessibility()
51 const screenRecording = (cu as any).tcc.checkScreenRecording()
52 return accessibility && screenRecording
53 ? { granted: true }
54 : { granted: false, accessibility, screenRecording }
55 },
56 isDisabled: () => !getChicagoEnabled(),
57 getSubGates: getChicagoSubGates,
58 // cleanup.ts always unhides at turn end — no user preference to disable it.
59 getAutoUnhideEnabled: () => true,
60
61 // Pixel-validation JPEG decode+crop. MUST be synchronous (the package
62 // does `patch1.equals(patch2)` directly on the return value). Cowork uses
63 // Electron's `nativeImage` (sync); our `image-processor-napi` is
64 // sharp-compatible and async-only. Returning null → validation skipped,
65 // click proceeds — the designed fallback per `PixelCompareResult.skipped`.
66 // The sub-gate defaults to false anyway.
67 cropRawPatch: () => null,
68 }
69 return cached
70}

Callers 3

tryGetInstalledAppNamesFunction · 0.85
getOrBindFunction · 0.85

Calls 4

createCliExecutorFunction · 0.85
getChicagoSubGatesFunction · 0.85
requireComputerUseSwiftFunction · 0.85
getChicagoEnabledFunction · 0.85

Tested by

no test coverage detected