import type { MessageAnnotations, OutlineNode } from '../../protocol.js'; export type DescribeVisibleArgs = Record; export type DescribeVisibleResult = { /** * The user's current URL — `window.location.href`, or `null` when * running outside a browser (SSR / Node test harness). * * Why this is on the visible-content tool: the agent has no other * way to verify "did my dispatch actually navigate the user?" Apps * that bundle navigation into a Msg's effect chain (the canonical * pattern) update the URL on commit; the agent reads it back here * to confirm the user's view tracked the state change. When the URL * doesn't move after a state-creating dispatch, the agent learns * the dispatch landed but the navigation didn't — common when the * Msg returned partial effects. */ url: string | null; outline: OutlineNode[]; /** * `'data-agent'` when the outline was scoped to author-tagged zones. * `'fallback'` when the app has no `data-agent` attributes and the * walker fell back to a generic semantic-element pass over the root. * `'truncated'` when the fallback outline hit the node-count cap and * stopped early; the caller can ask follow-up questions through * `query_dom` or by inspecting state directly. */ source: 'data-agent' | 'fallback' | 'truncated'; }; export type DescribeVisibleHost = { getRootElement(): Element | null; getBindingDescriptors(): Array<{ variant: string; }> | null; getMsgAnnotations(): Record | null; }; /** * Walk data-agent-tagged subtrees and produce a structured outline. * Buttons cross-reference __bindingDescriptors so Claude can tie * visible text to variant names. * * If the app has no `data-agent` tags, fall back to a depth-limited * walk of the entire root element. This makes the tool useful for apps * that haven't (yet) tagged their views — typical first-pass dogfood * targets — instead of returning an empty outline that conveys * nothing. The fallback path sets `source: 'fallback'` so the caller * can tell the outline is best-effort. */ export declare function handleDescribeVisibleContent(host: DescribeVisibleHost): DescribeVisibleResult; //# sourceMappingURL=describe-visible-content.d.ts.map