refactor(web-ui): route business invokes through adapter layer and dr… - #2428
Open
zvzuola wants to merge 1 commit into
Open
refactor(web-ui): route business invokes through adapter layer and dr…#2428zvzuola wants to merge 1 commit into
zvzuola wants to merge 1 commit into
Conversation
…op dead AgentService - Add eslint no-restricted-imports fence: business code must reach the platform only via api.invoke (ApiClient); direct invoke from '@tauri-apps/api/core' is reserved for adapters/** and the intentional PeerHostInvokeBridge exception. - Reroute 8 A-class modules (insights, i18n, companion pet, announcement, file/image context, ide-control event bus) from direct invoke to api.invoke. - Delete the dead legacy agent-service.ts wrapper (no consumers) and its FlowChatManager field/import/initialization, the orphaned getAvailableAgents() method, and its test mock. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Route Web UI business-layer Tauri commands through the shared
ApiClientadapter layer and remove the unused legacyAgentService.This keeps platform invocation behind the frontend adapter boundary and allows the existing transport routing, including peer-device scenarios, to remain centralized.
Type and Areas
Type: Refactor / architecture boundary / cleanup
Areas: Web UI, frontend API adapters, Peer Device Mode integration
Motivation / Impact
Several Web UI business modules imported
invokedirectly from@tauri-apps/api/core. This bypassed the sharedApiClientrouting layer and made it possible for new business code to bypass transport-aware behavior.This PR:
no-restricted-importsrule that blocks directinvokeimports from@tauri-apps/api/corein business code.src/infrastructure/api/adapters/**and the intentionalPeerHostInvokeBridgeexception.api.invoke:src/web-ui/src/shared/services/agent-service.tslegacy wrapper.AgentServicefield, initialization, andgetAvailableAgents()method fromFlowChatManager.There is no intended direct user-facing behavior change. The main impact is improved architectural enforcement and consistent routing through the adapter layer.
Verification
GitHub checks for head commit
433f601122f6fac24630e1c6d5e9df7af213c3b5:Rust / CLI Validation— passed.Rust / CLI Impact— passed.Shell Deploy Scripts— passed.DSH Profile Packaging (windows-latest)— passed.Frontend Build— in progress at the time this description was prepared.Rust Build Check— skipped because this PR does not modify Rust sources.CLI Tests— skipped because this PR does not modify CLI behavior.The changed frontend tests and the new ESLint boundary rule should be covered by the frontend validation workflow.
Reviewer Notes
ApiClient.PeerHostInvokeBridgeexecutes dynamic commands on the host side of Peer Device Mode and remains the documented exception.AgentServicehad no remaining consumers. Active agent and tool operations are already exposed through the existing service APIs andFlowChatManager.Checklist