MCPcopy Create free account
hub / github.com/apache/maka / stripUnverifiedTargetHints

Function stripUnverifiedTargetHints

packages/runtime/src/computer-use-tools.ts:477–489  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

475 * reads before allowing the action.
476 */
477function 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

Callers 1

buildComputerUseToolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected