* The action minus any target the host has not confirmed. * * `app` and `window_id` may accompany an element action as redundant hints. * They are accepted so a careful model is not rejected for supplying them, but * until the observation they name is the active frame they are unverified * clai
(input: T)
| 475 | * reads before allowing the action. |
| 476 | */ |
| 477 | function stripUnverifiedTargetHints<T extends ComputerParams>(input: T): T { |
| 478 | if (!('observation_id' in input)) return input; |
| 479 | if (!('app' in input) && !('window_id' in input)) return input; |
| 480 | const { |
| 481 | app: _app, |
| 482 | window_id: _windowId, |
| 483 | ...rest |
| 484 | } = input as T & { |
| 485 | app?: string; |
| 486 | window_id?: number; |
| 487 | }; |
| 488 | return rest as T; |
| 489 | } |
| 490 | |
| 491 | /** |
| 492 | * Says so when a redundant target hint disagrees with the frame the action is |
no outgoing calls
no test coverage detected