LearnNewsExamplesServices
Frontmatter
id8178
titleRefactor: Extract ComponentService from ConnectionService
stateClosed
labels
airefactoringarchitecture
assigneestobiu
createdAtDec 28, 2025, 7:41 PM
updatedAtDec 28, 2025, 7:53 PM
githubUrlhttps://github.com/neomjs/neo/issues/8178
authortobiu
commentsCount1
parentIssue8169
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 28, 2025, 7:53 PM

Refactor: Extract ComponentService from ConnectionService

Closed v11.18.0 airefactoringarchitecture
tobiu
tobiu commented on Dec 28, 2025, 7:41 PM

Refactor the Neural Link architecture by extracting component-related logic from ConnectionService into a dedicated ComponentService.

Scope:

  1. Create ai/mcp/server/neural-link/services/ComponentService.mjs.
  2. Move the following logic from ConnectionService:
    • getComponentTree
    • getComponentProperty
    • setComponentProperty
    • getVdomTree
    • getVnodeTree
  3. Update toolService.mjs to use the new service.
  4. Ensure ComponentService uses ConnectionService for transport (RPC calls).

Goal: Reduce the responsibility of ConnectionService and prepare for more complex component operations.

tobiu added the ai label on Dec 28, 2025, 7:41 PM
tobiu added the refactoring label on Dec 28, 2025, 7:41 PM
tobiu added the architecture label on Dec 28, 2025, 7:41 PM
tobiu added parent issue #8169 on Dec 28, 2025, 7:42 PM
tobiu assigned to @tobiu on Dec 28, 2025, 7:51 PM
tobiu referenced in commit b8f54bf - "refactor(ai): Extract ComponentService from ConnectionService (#8178) on Dec 28, 2025, 7:53 PM
tobiu
tobiu Dec 28, 2025, 7:53 PM

Input from Gemini 3.0:

✦ I have completed the refactoring to extract ComponentService.

Key Architectural Changes:

  1. ComponentService Creation:

    • Created ai/mcp/server/neural-link/services/ComponentService.mjs.
    • This service now owns all component-related logic: getComponentTree, getVdomTree, getVnodeTree, getComponentProperty, and setComponentProperty.
  2. ConnectionService Refactoring:

    • Critical Change: The internal #call method has been renamed to call and made public. This transforms ConnectionService into a pure transport layer that other services can utilize to send RPC messages to the App Worker.
    • Removed the component logic, significantly reducing the "God Object" complexity.
  3. Tool Routing:

    • Updated toolService.mjs to route the component-related tool calls to the new ComponentService.

This establishes the pattern for the upcoming RuntimeService and InteractionService extractions.

tobiu closed this issue on Dec 28, 2025, 7:53 PM