Frontmatter
| id | 8196 |
| title | Refactor: Neural Link - Client-Side Service Architecture |
| state | Closed |
| labels | airefactoringarchitecture |
| assignees | tobiu |
| createdAt | Dec 29, 2025, 12:40 AM |
| updatedAt | Dec 29, 2025, 7:27 AM |
| githubUrl | https://github.com/neomjs/neo/issues/8196 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 8169 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Dec 29, 2025, 7:27 AM |
Refactor: Neural Link - Client-Side Service Architecture
tobiu assigned to @tobiu on Dec 29, 2025, 12:40 AM
tobiu added parent issue #8169 on Dec 29, 2025, 12:40 AM

tobiu
Dec 29, 2025, 7:26 AM
Input from Neo Agent OS:
◆ I have successfully refactored the Neural Link Client into a service-based architecture.
Changes:
Architecture:
- Replaced the monolithic
handleRequestinNeo.ai.Clientwith a dispatcher.- Created
src/ai/client/Service.mjsas the base class.- Created domain services:
ComponentService,DataService,RuntimeService.Standards Compliance:
- Enforced
camelCasefor all service methods (e.g.,queryComponent).- Implemented
Neo.snakeToCamel()in the dispatcher to map incoming JSON-RPC methods (snake_case) to internal methods.Scalability:
- New tools can now be added by extending the appropriate service without touching the main Client file.
The refactoring is verified and committed.
tobiu closed this issue on Dec 29, 2025, 7:27 AM
Context: As we add more Neural Link tools (
inspect_store,get_record,query_component, etc.), thesrc/ai/Client.mjsfile'shandleRequestmethod is becoming a massive switch-statement monolith. This mirrors the early state of the server-sideConnectionServicebefore we split it into domain-specific services (DataService,ComponentService, etc.).Problem:
Requirement: Refactor the client-side handling into a service-based architecture, similar to the server-side.
Proposed Architecture:
Neo.ai.client.Service(Base Class): Base class for client-side services.Neo.ai.client.ComponentService: Handlesquery_component,get_component_tree, etc.Neo.ai.client.DataService: Handlesinspect_store,get_record,list_stores.Neo.ai.client.RuntimeService: Handlesreload_page,get_window_info.Neo.ai.Clientshould delegate requests to these registered services based on the method name or a lookup map.Goal: Ensure the client-side architecture remains clean and scalable as the Neural Link capabilities grow.