Skip to main content
Glama
DetectIntentChooser.ts1.74 kB
import { logger } from "../../utils/logger"; import { DeepLinkManager } from "../../utils/deepLinkManager"; import { BootedDevice, IntentChooserResult, ObserveResult } from "../../models"; import { BaseVisualChange } from "../action/BaseVisualChange"; import { AdbUtils } from "../../utils/android-cmdline-tools/adb"; export class DetectIntentChooser extends BaseVisualChange { private deepLinkManager: DeepLinkManager; constructor(device: BootedDevice, adb: AdbUtils | null = null) { super(device, adb); this.deepLinkManager = new DeepLinkManager(device); } /** * Execute intent chooser detection * @returns Promise with intent chooser detection results */ async execute(): Promise<IntentChooserResult> { return this.observedInteraction( async (observeResult: ObserveResult) => { try { const viewHierarchy = observeResult.viewHierarchy; if (!viewHierarchy) { return { success: false, error: "View hierarchy not found" }; } logger.info("[DetectIntentChooser] Starting intent chooser detection"); const detected = this.deepLinkManager.detectIntentChooser(viewHierarchy); logger.info(`[DetectIntentChooser] Intent chooser detection completed. Detected: ${detected}`); return { success: true, detected }; } catch (error) { logger.error(`[DetectIntentChooser] Failed to detect intent chooser: ${error}`); return { success: false, detected: false, error: error instanceof Error ? error.message : String(error) }; } }, { changeExpected: false } ); } }

Implementation Reference

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zillow/auto-mobile'

If you have feedback or need assistance with the MCP directory API, please join our Discord server