mirror of
https://github.com/stablyai/orca
synced 2026-04-21 14:17:16 +00:00
fix: align CdpBridge.evaluate return shape with BrowserEvalResult type
This commit is contained in:
parent
c8b98a1908
commit
1f3fb3d4a8
1 changed files with 10 additions and 1 deletions
|
|
@ -908,8 +908,17 @@ export class CdpBridge {
|
|||
)
|
||||
}
|
||||
|
||||
const valueStr =
|
||||
result.value !== undefined ? String(result.value) : (result.description ?? '')
|
||||
// Why: agent-browser returns { result, origin } — match that shape so both
|
||||
// bridges satisfy the same BrowserEvalResult contract.
|
||||
const { result: urlResult } = (await sender('Runtime.evaluate', {
|
||||
expression: 'location.origin',
|
||||
returnByValue: true
|
||||
})) as { result: { value: string } }
|
||||
return {
|
||||
value: result.value !== undefined ? String(result.value) : (result.description ?? '')
|
||||
result: valueStr,
|
||||
origin: urlResult.value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue