mirror of
https://github.com/stablyai/orca.git
synced 2026-10-25 00:03:59 +00:00
* fix(computer): report unasserted accessibility actions * fix(computer): fail closed on missing action metadata * Fix merged tab search test fixture
27 lines
746 B
TypeScript
27 lines
746 B
TypeScript
import type { ComputerActionResult } from '../../shared/runtime-types'
|
|
|
|
export function normalizeComputerActionResult(result: ComputerActionResult): ComputerActionResult {
|
|
const action = result.action
|
|
if (!action) {
|
|
return result
|
|
}
|
|
const verificationReason =
|
|
action.path === 'synthetic'
|
|
? ('synthetic_input' as const)
|
|
: action.path === 'clipboard'
|
|
? ('clipboard_paste' as const)
|
|
: action.path === 'accessibility'
|
|
? ('accessibility_action_unasserted' as const)
|
|
: null
|
|
if (!verificationReason || action.verification) {
|
|
return result
|
|
}
|
|
return {
|
|
...result,
|
|
action: {
|
|
...action,
|
|
verification: { state: 'unverified', reason: verificationReason }
|
|
}
|
|
}
|
|
}
|