donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
21 lines • 1.02 kB
TypeScript
import type { Page } from 'playwright';
import type { WebTargetInspector } from '../managers/WebTargetInspector';
import type { WebTarget } from '../models/FocusedTarget';
import type { ToolCallContext } from '../models/ToolCallContext';
/**
* Extract the Playwright {@link Page} from a web-mode {@link ToolCallContext}.
* Throws if the target is not a web target or the page is closed.
*/
export declare function webPage(context: ToolCallContext): Page;
/**
* Narrow the context's {@link TargetInspector} to a {@link WebTargetInspector}.
* Use this when you need access to the underlying {@link PageInspector} for
* web-specific operations (e.g. getHtmlSnippet).
*/
export declare function webInspector(context: ToolCallContext): WebTargetInspector;
/**
* Narrow the context's target to a mutable {@link WebTarget}.
* Used by tools that need to reassign the current page (e.g. tab switching).
*/
export declare function webTarget(context: ToolCallContext): WebTarget;
//# sourceMappingURL=TargetUtils.d.ts.map