LearnNewsExamplesServices
Frontmatter
id8185
titleFeat: Neural Link - Visual Inspection (DomRect)
stateClosed
labels
enhancementai
assigneestobiu
createdAtDec 28, 2025, 10:03 PM
updatedAtDec 29, 2025, 10:12 PM
githubUrlhttps://github.com/neomjs/neo/issues/8185
authortobiu
commentsCount1
parentIssue8169
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 29, 2025, 10:12 PM

Feat: Neural Link - Visual Inspection (DomRect)

Closed v11.18.0 enhancementai
tobiu
tobiu commented on Dec 28, 2025, 10:03 PM

Context: Agents need to understand the physical layout of components to debug visibility and interaction issues. component.Base provides a powerful getDomRect method that can fetch one or many rects.

Scope:

  1. Enhance ComponentService:

    • Add getDomRect(sessionId, componentIds).
    • Implementation: Trigger Neo.getComponent(id).getDomRect(componentIds).
    • Ensure the response is always normalized to an array of DOMRect objects.
  2. Tools:

    • get_dom_rect: Accepts componentId (string) OR componentIds (array of strings). Always returns an array of DOMRect objects.

Goal: Provide bulk physical layout inspection capabilities.

tobiu added the enhancement label on Dec 28, 2025, 10:03 PM
tobiu added the ai label on Dec 28, 2025, 10:03 PM
tobiu added parent issue #8169 on Dec 28, 2025, 10:03 PM
tobiu assigned to @tobiu on Dec 29, 2025, 10:06 PM
tobiu referenced in commit 6bad751 - "feat(ai): Implement Visual Inspection (DomRect) (#8185) on Dec 29, 2025, 10:10 PM
tobiu
tobiu Dec 29, 2025, 10:11 PM

Input from Gemini 3:

✦ I have implemented the Visual Inspection (DomRect) feature.

Changes:

  1. Client-Side (src/ai/client/ComponentService.mjs):

    • Implemented getDomRect which accepts componentIds (array).
    • It uses the first component ID to resolve the windowId context.
    • Calls Neo.component.Base#getDomRect to fetch rects from the main thread.
    • Updated src/ai/Client.mjs to map get_dom_rect.
  2. Server-Side (ai/mcp/server/neural-link/):

    • Updated ComponentService.mjs to expose getDomRect.
    • Updated toolService.mjs to register the tool.
    • Updated openapi.yaml to define /component/rect/get and the GetDomRectRequest schema.

Note: The implementation strictly requires componentIds to be an array of strings, ensuring a consistent tool shape as requested.

tobiu closed this issue on Dec 29, 2025, 10:12 PM