Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

fix: computer use host type hints

ogsamrat0d787540bc5e
diff --git a/apps/desktop/electron/computer-use-answers.mjs b/apps/desktop/electron/computer-use-answers.mjs
index f7e5ec41..6e06d1e2 100644
--- a/apps/desktop/electron/computer-use-answers.mjs
+++ b/apps/desktop/electron/computer-use-answers.mjs
@@ -1,6 +1,11 @@
// Whether a rig may answer computer use questions without a physical press (remote-debugging clicks).
// Only in a build run from source: a packaged app ignores OMNIRUSH_COMPUTER_USE_TEST_ANSWERS, so relaunching
// it with that environment can never approve on the person's behalf.
+/**
+ * @param {Record<string, string | undefined> | undefined} env
+ * @param {boolean} isPackaged
+ * @param {(message: string) => void} [warn]
+ */
export function testAnswersAllowed(env, isPackaged, warn = () => {}) {
if (env?.OMNIRUSH_COMPUTER_USE_TEST_ANSWERS !== "1") return false;
if (isPackaged) { warn("OMNIRUSH_COMPUTER_USE_TEST_ANSWERS is ignored in a packaged app."); return false; }
diff --git a/apps/desktop/electron/computer-use-host.mjs b/apps/desktop/electron/computer-use-host.mjs
index c9e0a1ee..212a5ac7 100644
--- a/apps/desktop/electron/computer-use-host.mjs
+++ b/apps/desktop/electron/computer-use-host.mjs
@@ -163,7 +163,7 @@ export function createMacNativeWorker({ executable, args = ["worker"], captureLo
* supply the shared modules ({ portable, policy, contract, image }) when they are
* bundled elsewhere.
*/
-export async function createComputerUseHost({ executable, spool = null, settings, context, approve, onEvent, onState, onFrame, shared = {} }) {
+export async function createComputerUseHost({ executable, spool = null, settings, context, approve, onEvent, onState, onFrame, shared = /** @type {{ portable?: any, policy?: any, contract?: any, image?: any }} */ ({}) }) {
if (!executable) throw new Error("Computer Use helper unavailable.");
const portable = shared.portable ?? await import(new URL("portable-host.mjs", SHARED).href);
const policy = shared.policy ?? await import(new URL("policy.mjs", SHARED).href);