A personal assistant that lives on your desktop, remembers what matters, and can use your Mac for you.
TypeScript
fix(computer): give helper calls time for native dialogs
Alan Buscaglia3ebfe5cbce4f
diff --git a/packages/daemon/src/connectors.ts b/packages/daemon/src/connectors.tsindex 8dc8545..7daf3bd 100644--- a/packages/daemon/src/connectors.ts+++ b/packages/daemon/src/connectors.ts@@ -308,6 +308,8 @@ export interface ComputerEndpoint {/** The built-in server's name in `mcp.json`; no connector can take it. */export const COMPUTER_ID = "computer";+/** Seconds the engine waits for one helper call: enough to answer its grant or confirmation dialog. */+const COMPUTER_TIMEOUT_SECONDS = 300;const COMPUTER_INFO = {id: COMPUTER_ID,@@ -470,11 +472,13 @@ export function renderMcpJson(state: ConnectorsState, computer?: ComputerEndpoin};}// The helper checks its own key and asks the user itself, so all of its tools are direct.+ // Its calls wait while the user answers a native dialog, so the engine's 30 s default would cut them.if (computer)servers[COMPUTER_ID] = {url: computer.url,headers: { Authorization: `Bearer ${literal(computer.token)}` },exposure: "direct",+ timeout: COMPUTER_TIMEOUT_SECONDS,};return `${JSON.stringify({ mcpServers: servers }, null, 2)}\n`;}diff --git a/packages/daemon/test/computer.test.ts b/packages/daemon/test/computer.test.tsindex 411461f..e38b60b 100644--- a/packages/daemon/test/computer.test.ts+++ b/packages/daemon/test/computer.test.ts@@ -154,10 +154,12 @@ describe("computer control registration (S24.7)", () => {builtin: true,});// Direct exposure, nothing hidden, and the key only in the header the engine sends.+ // The timeout leaves the user five minutes to answer the helper's native dialogs.expect(servers().computer).toEqual({url: HELPER,headers: { Authorization: `Bearer ${KEY}` },exposure: "direct",+ timeout: 300,});expect(statSync(mcpFile).mode & 0o777).toBe(0o600);// The engine restarts to read it, and its guard lets the computer's tools run without cards.@@ -282,6 +284,7 @@ describe("computer control registration (S24.7)", () => {url: HELPER,headers: { Authorization: `Bearer ${KEY}` },exposure: "direct",+ timeout: 300,});});