MCPcopy Create free account
hub / github.com/different-ai/opencode-browser / withTab

Function withTab

src/agent-backend.ts:509–513  ·  view source on GitHub ↗
(tabId: number | undefined, action: () => Promise<T>)

Source from the content-addressed store, hash-verified

507 }
508
509 async function withTab<T>(tabId: number | undefined, action: () => Promise<T>): Promise<T> {
510 if (!Number.isFinite(tabId)) return await action();
511 await agentCommand("tab_switch", { index: tabId });
512 return await action();
513 }
514
515 async function agentEvaluate(script: string): Promise<any> {
516 const data = await agentCommand("evaluate", { script });

Callers 1

requestToolFunction · 0.85

Calls 1

agentCommandFunction · 0.85

Tested by

no test coverage detected