fix: eval command displays result instead of undefined

Agent-browser returns { origin, result } for eval but the type declared
{ value } and the CLI formatter read v.value. Updated type and formatter
to match the actual response shape.
This commit is contained in:
Jinwoo-H 2026-04-20 01:09:47 -04:00
parent e3d1b9e549
commit c8b98a1908
2 changed files with 3 additions and 2 deletions

View file

@ -954,7 +954,7 @@ export async function main(argv = process.argv.slice(2), cwd = process.cwd()): P
const expression = getRequiredStringFlag(parsed.flags, 'expression')
const worktree = await getBrowserWorktreeSelector(parsed.flags, cwd, client)
const result = await client.call<BrowserEvalResult>('browser.eval', { expression, worktree })
return printResult(result, json, (v) => v.value)
return printResult(result, json, (v) => v.result)
}
if (matches(commandPath, ['tab', 'list'])) {

View file

@ -210,7 +210,8 @@ export type BrowserScreenshotResult = {
}
export type BrowserEvalResult = {
value: string
result: string
origin: string
}
export type BrowserTabInfo = {