interface AccessibilityQualityCheckArgs { udid?: string; screenContext?: string; } /** * Quick accessibility tree quality assessment - decide accessibility vs screenshot approach * * **What it does:** * Rapidly queries the accessibility tree and assesses data richness without returning * full element details. Returns a quality score and recommendation (accessibility-ready * or screenshot-fallback) in ~80ms with minimal token cost. Prevents agents from wasting * tokens on expensive screenshots when accessibility data is sufficient. * * **Why you'd use it:** * - Quick check before deciding whether to query accessibility tree or take screenshot * - Assess data richness without loading full element tree (saves ~40 tokens vs full describe) * - Guide automation approach based on actual UI complexity * - Prevent unnecessary screenshot operations (costs 3-4x more tokens) * * **Parameters:** * - udid (optional): Target identifier - auto-detects if omitted * - screenContext (optional): Screen name for semantic tracking (e.g., "LoginScreen") * * **Returns:** * Quality score (rich/moderate/minimal), element counts, recommendation (accessibility or * screenshot), and guidance for next steps. * * **Example:** * ```typescript * // Quick check of current screen * const check = await accessibilityQualityCheckTool({ * screenContext: 'LoginScreen' * }); * * if (check.quality === 'rich') { * // Use accessibility: idb-ui-describe --operation all * } else { * // Fall back to screenshot: screenshot * } * ``` * * **Full documentation:** See idb/accessibility-quality-check.md * * @param args Tool arguments with optional UDID and screen context * @returns Tool result with quality score and recommendation */ export declare const ACCESSIBILITY_QUALITY_CHECK_DOCS = "\n# accessibility-quality-check\n\nQuick assessment of accessibility tree richness - decide whether to use accessibility or screenshots.\n\n## Overview\n\nRapidly queries the accessibility tree and assesses data richness without returning full element details. Returns a quality score and recommendation (accessibility-ready or screenshot-fallback) in ~80ms with minimal token cost. Prevents agents from wasting tokens on expensive screenshots when accessibility data is sufficient.\n\n## Parameters\n\n### Optional\n- **udid** (string): Target identifier - auto-detects if omitted\n- **screenContext** (string): Screen name for semantic tracking (e.g., \"LoginScreen\")\n\n## Returns\n\n- **quality**: \"rich\" | \"moderate\" | \"minimal\"\n- **recommendation**: \"accessibility-ready\" | \"consider-screenshot\"\n- **elementCounts**: Total elements, tappable elements, text fields, element types\n- **queryTime**: Query execution time in milliseconds\n- **queryGuidance**: Next steps based on quality assessment\n\n## Examples\n\n### Quick check of current screen\n```typescript\nconst check = await accessibilityQualityCheckTool({\n screenContext: 'LoginScreen'\n});\n\nif (check.quality === 'rich') {\n // Use accessibility: idb-ui-describe\n} else {\n // Fall back to screenshot\n}\n```\n\n### Check before deciding automation approach\n```typescript\nconst assessment = await accessibilityQualityCheckTool({\n udid: 'DEVICE-UDID'\n});\n\n// Workflow guided by quality\n```\n\n## Quality Levels\n\n### Rich (\u2705 Use accessibility)\n- >3 tappable elements, OR\n- Text input fields detected\n- **Recommendation**: Use idb-ui-describe and accessibility-based navigation\n\n### Moderate (\u26A0\uFE0F Try accessibility first)\n- 2-3 tappable elements\n- Some custom UI that may not be recognized\n- **Recommendation**: Try accessibility tree first, fall back to screenshot if needed\n\n### Minimal (\uD83D\uDCF8 Use screenshot)\n- \u22641 element, OR\n- No tappable elements found\n- **Recommendation**: Take screenshot for visual analysis\n\n## How It Works\n\n1. **Quick query**: Calls `idb ui describe-all` (~80ms)\n2. **Assess richness**: Counts tappable elements, text fields\n3. **Return score**: Quality assessment + recommendation\n4. **No elements returned**: Just the counts and guidance\n\n## Cost Comparison\n\n- **accessibility-quality-check**: ~80ms, 30 tokens\n- **Full idb-ui-describe**: ~120ms, 50 tokens\n- **screenshot**: ~2000ms, 170 tokens\n\n## Related Tools\n\n- `idb-ui-describe`: Full accessibility tree with element details\n- `idb-ui-find-element`: Search for specific element by name\n- `screenshot`: Visual fallback when accessibility insufficient\n\n## Notes\n\n- Returns quality assessment only (not full element tree)\n- Recommended as first step before choosing automation approach\n- Saves tokens by preventing unnecessary screenshots\n- Identifies when UI has minimal accessibility support\n"; export declare const ACCESSIBILITY_QUALITY_CHECK_DOCS_MINI = "Assess accessibility tree quality. Use rtfm({ toolName: \"accessibility-quality-check\" }) for docs."; export declare function accessibilityQualityCheckTool(args: AccessibilityQualityCheckArgs): Promise<{ content: { type: "text"; text: string; }[]; structuredContent: { success: boolean; quality: "moderate" | "rich" | "minimal"; recommendation: string; totalElements: number; tappableElements: number; textFields: number; }; isError: boolean; }>; export {}; //# sourceMappingURL=accessibility-quality-check.d.ts.map