LearnNewsExamplesServices
Frontmatter
id8281
title[Neural Link] Feature: Tool get_computed_styles
stateClosed
labels
enhancementai
assigneestobiu
createdAtJan 1, 2026, 8:17 PM
updatedAtJan 1, 2026, 8:34 PM
githubUrlhttps://github.com/neomjs/neo/issues/8281
authortobiu
commentsCount1
parentIssue8169
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 1, 2026, 8:34 PM

[Neural Link] Feature: Tool get_computed_styles

Closed v11.18.0 enhancementai
tobiu
tobiu commented on Jan 1, 2026, 8:17 PM

Implement get_computed_styles to allow AI agents to inspect the actual rendered CSS values of a component.

Requirements:

  1. Main Thread (src/main/DomAccess.mjs):

    • Implement getComputedStyle({ id, style }) (or similar signature).
    • Support requesting specific style properties or arrays of properties (e.g., ['color', '--button-bg']).
    • Expose via remote: { app: [...] }.
  2. Client Service (src/ai/client/ComponentService.mjs):

    • Implement getComputedStyles({ componentId, variables }).
    • Resolve componentId to a DOM ID.
    • Call the remote Neo.main.DomAccess.getComputedStyle.

Why: To verify visual state and theming (The "Visual Gap"). Since getComputedStyle lives in the Main Thread, the App Worker (and the AI) are blind to the actual rendered colors, especially with CSS variables and theme switching.

tobiu added the enhancement label on Jan 1, 2026, 8:17 PM
tobiu added the ai label on Jan 1, 2026, 8:17 PM
tobiu assigned to @tobiu on Jan 1, 2026, 8:18 PM
tobiu added parent issue #8169 on Jan 1, 2026, 8:19 PM
tobiu referenced in commit 9eac33d - "feat(ai): Implement Neural Link tool get_computed_styles (#8281)" on Jan 1, 2026, 8:33 PM
tobiu
tobiu Jan 1, 2026, 8:33 PM

Input from Gemini:

✦ Implemented full round-trip for get_computed_styles:

  1. Main Thread: Added getComputedStyle to src/main/DomAccess.mjs (using window.getComputedStyle).
  2. App Worker: Added getComputedStyles to src/ai/client/ComponentService.mjs.
  3. MCP Server:
    • Updated ai/mcp/server/neural-link/services/ComponentService.mjs to expose the method.
    • Updated ai/mcp/server/neural-link/services/toolService.mjs mapping.
    • Updated openapi.yaml with the new tool definition.
tobiu closed this issue on Jan 1, 2026, 8:34 PM