feat: Remote Access, MCP Server, and Architecture Refactor#60
Open
sgaabdu4 wants to merge 7 commits into4regab:mainfrom
Open
feat: Remote Access, MCP Server, and Architecture Refactor#60sgaabdu4 wants to merge 7 commits into4regab:mainfrom
sgaabdu4 wants to merge 7 commits into4regab:mainfrom
Conversation
- Implemented webview utilities in `webviewUtils.ts` for handling queue management, logging, and file link parsing. - Added Vitest configuration for testing in `vitest.config.ts`. - Created SVG icons for the application in `icon-192.svg` and `icon-512.svg`. - Developed the login page structure in `index.html` with associated styles in `login.css`. - Implemented login functionality in `login.js`, including WebSocket authentication and session management. - Added a manifest file for PWA support in `manifest.json`. - Created an offline page in `offline.html` to handle network disconnections. - Introduced shared constants in `shared-constants.js` for consistent usage across the frontend. - Implemented a service worker in `sw.js` for caching and offline capabilities.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces LAN Remote Access + MCP server support and refactors the TaskSync extension into smaller modules with shared utilities and expanded test infrastructure.
Changes:
- Added remote server utilities/handlers (auth, git, settings) and a remote-friendly web UI/PWA.
- Refactored the webview provider into focused handler modules (queue/session/lifecycle/message routing/persistence).
- Added/expanded Vitest + Playwright scaffolding; updated shared constants and build tooling.
Reviewed changes
Copilot reviewed 64 out of 85 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tasksync-chat/src/webview/sessionManager.ts | Extracted session timer/human-delay/system-sound logic into its own module. |
| tasksync-chat/src/webview/remoteApiHandlers.ts | Added remote server-facing API surface for queue/settings/state and file/tool search. |
| tasksync-chat/src/webview/queueHandlers.ts | Centralized queue operations + auto-respond behavior for pending tool calls. |
| tasksync-chat/src/webview/queueHandlers.test.ts | Added unit tests for queue edit/remove/reorder/clear. |
| tasksync-chat/src/webview/queueHandlers.comprehensive.test.ts | Added broader behavior tests including auto-respond paths and history helpers. |
| tasksync-chat/src/webview/persistence.ts | Added workspace-aware persistence for queue + persisted history. |
| tasksync-chat/src/webview/messageRouter.ts | Added webview message dispatcher + submit/webviewReady logic. |
| tasksync-chat/src/webview/lifecycleHandlers.ts | Added webview HTML generation + lifecycle/dispose/new-session logic. |
| tasksync-chat/src/webview-ui/state.js | Added/normalized UI state and shared-constant fallbacks for remote mode. |
| tasksync-chat/src/webview-ui/slashCommands.js | Added client-side slash command expansion + dropdown interactions. |
| tasksync-chat/src/webview-ui/queue.js | Added queue UI editing + attachment badges + approval modal actions. |
| tasksync-chat/src/webview-ui/messageHandler.js | Added webview message handling for queue/session/settings/attachments + pending tool call rendering. |
| tasksync-chat/src/webview-ui/markdownUtils.js | Added table/list markdown processing with safety/perf limits. |
| tasksync-chat/src/webview-ui/history.js | Added history modal controls and mode card selection behavior. |
| tasksync-chat/src/webview-ui/events.js | Added UI event wiring (copy/contextmenu, settings toggles, dropdowns). |
| tasksync-chat/src/webview-ui/constants.js | Added shared-constant fallbacks for remote mode (WS protocol, session keys, reconnect). |
| tasksync-chat/src/webview-ui/approval.js | Added multi-choice toolbar + approval modal behavior. |
| tasksync-chat/src/utils/imageUtils.ts | Normalized MIME detection formatting and string style. |
| tasksync-chat/src/utils/imageUtils.test.ts | Added tests for getImageMimeType behavior. |
| tasksync-chat/src/utils/generateId.ts | Added shared ID generator utility. |
| tasksync-chat/src/utils/generateId.test.ts | Added tests for generateId format/uniqueness. |
| tasksync-chat/src/tools.ts | Extended ask_user to accept summary + improved logging/result parts handling. |
| tasksync-chat/src/server/serverUtils.ts | Added security headers, origin checks, attachment normalization, TLS helpers/port utilities. |
| tasksync-chat/src/server/remoteSettingsHandler.ts | Added WS settings message router for remote clients. |
| tasksync-chat/src/server/remoteGitHandlers.ts | Added WS git handlers with validation + broadcast hooks. |
| tasksync-chat/src/server/remoteAuthService.ts | Added PIN/session-token auth with lockouts/timing-safe comparison + cleanup timers. |
| tasksync-chat/src/server/gitService.ts | Added VS Code Git extension integration + safe path validation + basic git operations. |
| tasksync-chat/src/server/gitService.test.ts | Added tests for isValidFilePath validation behavior. |
| tasksync-chat/src/context/terminalContext.ts | Improved terminal execution tracking + output size limiting + ID generation. |
| tasksync-chat/src/context/problemsContext.ts | Added problem IDs via generateId + normalized string types/formatting. |
| tasksync-chat/src/context/index.ts | Added shared ContextManager improvements + generateId usage. |
| tasksync-chat/src/constants/remoteConstants.ts | Added remote/MCP constants, limits, error codes, queue ID validation, diff truncation. |
| tasksync-chat/src/constants/remoteConstants.test.ts | Added unit tests for remote constants + helpers. |
| tasksync-chat/src/constants/fileExclusions.ts | Normalized exclusion glob constants and formatter. |
| tasksync-chat/src/constants/fileExclusions.test.ts | Added tests for file exclusion constants and formatter output. |
| tasksync-chat/src/mocks/vscode.ts | Added minimal VS Code API mock for unit tests. |
| tasksync-chat/package.json | Updated engine requirement, added remote settings/commands, and added deps/scripts. |
| tasksync-chat/media/webview-body.html | Added shared HTML body template for faster/single-source webview rendering. |
| tasksync-chat/media/remote-fallback.css | Added CSS variable fallback theme for standalone remote browser mode. |
| tasksync-chat/media/main.css | Added UI styles for remote chat stream + summary rendering + session/idle notices. |
| tasksync-chat/esbuild.js | Added shared-constants generation + webview JS concatenation + watch support. |
| tasksync-chat/e2e/tests/remote-auth.spec.mjs | Added Playwright smoke tests for remote auth/login behavior. |
| tasksync-chat/e2e/playwright.config.mjs | Added Playwright config for remote E2E scaffolding. |
| tasksync-chat/e2e/.env.example | Added example env vars for remote E2E runs. |
| tasksync-chat/README.md | Documented remote access, MCP, and updated feature descriptions/settings. |
| tasksync-chat/.gitignore | Ignored Playwright artifacts and test outputs. |
| README.md | Updated top-level feature list to include remote/MCP/context references. |
| AGENTS.md | Updated architecture/module tree + conventions + testing/build notes. |
Files not reviewed (1)
- tasksync-chat/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
@4regab sorry for the behemoth! |
- Remove leftover console.log statements from webview-ui messageHandler - Fix queue.json backward compat (enabled defaults to true when missing) - Fix queueHandlers: missing resolver falls through to queue instead of dropping the prompt; set _aiTurnActive after auto-respond resolve - Fix serverUtils cert SAN: detect IP vs DNS hostname for correct type - Fix gitService: normalize backslashes for Windows path validation - Fix messageRouter: preserve attachments in queue fallback path - Fix remoteAuthService: implement query-param PIN support (matches docs) - Fix incomplete test in queueHandlers.test.ts (add assertion) - Update tests to match new behavior
- Install mermaid@10.9.3 as a dependency - Copy mermaid.min.js to media/ during build (esbuild.js) - Load mermaid from local webview URI instead of CDN - Remove cdn.jsdelivr.net from all CSP directives (both webview and remote) - Inject mermaid source path via window.__MERMAID_SRC__ global - Add media/mermaid.min.js to .gitignore (build artifact)
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 68 out of 85 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- handleSubmit: queue user input when no pending tool call (prevent silent drop) - gitService: reject absolute paths outside workspace root (security hardening) - serverUtils: import AttachmentInfo from webviewTypes (reduce coupling) - remoteSettingsHandler: use named WebSocket import for consistency - sessionManager: route sound errors through debugLog (reduce noise) - package.json: align engines.vscode with @types/vscode (^1.90.0)
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
This PR adds Remote Access, an MCP server, and a full architecture refactor to TaskSync.
Remote Access
MCP Server Integration
/ssebackward-compatible routingask_userandget_responsetoolsArchitecture Refactor
webviewProvider.ts(3,800+ lines) into 13 focused handler modulesdebugLog()utility gated behindtasksync.debugLoggingconfigmergeAndDedup()for history merge deduplicationsatisfies ToWebviewMessageused consistently for compile-time type safetyconsole.logreplaced withdebugLog()— zero console.log in productionTesting
Other Improvements
#autocomplete now searches tools, terminal output, and VS Code problemsautopilotPromptsarray)ask_userDocumentation
Code Quality
node esbuild.js→dist/extension.js+media/webview.js+web/shared-constants.js85 files changed | ~32K insertions | ~13K deletions