For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/ai/agent-lynx/connections.md.
AI logo
AI
  • English
  • Connections

    Start with “Are there any Lynx pages I can debug on my phone?” and follow the agent as it loads the instructions, discovers the app, and finds a page.

    Example conversation5 tool calls
    You

    I've connected my Android phone over adb. Can you check whether there are any Lynx pages I can debug?

    Agent

    Approach:First I will read the agent-lynx instructions to find out how to discover apps and pages on the device.

    agent-lynx skills listDebugging skill found
    Call
    # Discover the bundled skills and find lynx-devtool for device debugging.
    agent-lynx skills list
    Output
    <available_skills>
      <skill>
        <name>lynx-devtool</name>
        <description>Use when working with Lynx DevTool or debugging a Lynx app, page, or device…</description>
        <location>/workspace/node_modules/@lynx-js/skill-lynx-devtool/SKILL.md</location>
      </skill>
      <!-- Other skills omitted. -->
    </available_skills>
    agent-lynx skills get lynx-devtoolInstructions loaded
    Call
    # Load the instructions and get the skill directory and reference file list.
    agent-lynx skills get lynx-devtool
    Output
    <skill_content name="lynx-devtool">
    Use the `agent-lynx` CLI. The published package is `agent-lynx`.
    
    <!-- Instructions omitted. -->
    
    Skill directory: /workspace/node_modules/@lynx-js/skill-lynx-devtool
    Relative paths in this skill are relative to the skill directory.
    
    <skill_resources>
    
      <file>references/troubleshooting/index.md</file>
      <!-- Other resources omitted. -->
    </skill_resources>
    </skill_content>
    Read · troubleshooting/index.mdDiscovery guide
    Call
    // Read the discovery guide relative to the directory returned by skills get.
    Read("/workspace/node_modules/@lynx-js/skill-lynx-devtool/references/troubleshooting/index.md")
    Output
    ## Discovery Model
    
    In practice:
    
    - one client usually corresponds to one app process such as `LynxExplorer`
    - one session corresponds to one Lynx page inside that client
    - one device may have multiple clients
    - one client may have multiple sessions

    Approach:The guide distinguishes apps from pages. I will first discover the apps available for debugging on the phone.

    Approach:Lynx Explorer is running on the Android phone. Next I will check the Lynx pages inside that app.

    Found one. Lynx Explorer is running on your Android phone, with a debuggable Lynx page at https://example.com/settings.lynx.bundle.

    The app's client ID is android-phone:8901, and the page's session ID is 1. These identify the target for inspecting the page, reading logs, or taking a screenshot.

    From an App to a Page

    A device can run several Lynx apps, and an app can contain several pages. The conversation identifies the target in two steps:

    • Client: choose the app. list-clients returns app names, device information, and client IDs. This example finds Lynx Explorer on the Android phone.
    • Session: choose the page. list-sessions returns the app's debugging contexts and page URLs. Select a target with type set to lynx and keep its session_id.

    Use both returned IDs for subsequent page operations so the agent acts on the page you intend. Discover the targets again after restarting the app or reopening a page.

    Make Your App Discoverable

    Run Lynx Explorer or your own app with DevTool integrated, enable Lynx Debug and Lynx DevTool, and open a Lynx page. The example starts from this state. For other platforms, see device connection setup.

    If discovery is incomplete, continue the conversation:

    Your current stateWhat you can say next
    The app is still starting“Wait for Lynx Explorer to connect, then check its pages.”
    The app is connected but no page is open“Open the bundle URL from my development server, then check the page.”
    Several apps or pages are connected“Only inspect the Settings page on this Android phone.”

    The agent can wait for an app, open a bundle URL, and choose a target using the device, app name, and page URL. Run the project's development server separately and make sure the app can reach the bundle URL.

    How Calls Stay Connected

    Device commands automatically start the local agent-lynx daemon. It keeps device connections and snapshot refs across CLI calls, letting the agent continue from discovery to inspection, actions, and verification. See the architecture diagram in the introduction.

    Next, ask the agent to inspect and operate on the page or take a screenshot. Connection timeouts, daemon ports, and direct mode are documented in the CLI reference.

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.