Add cache support to coderWrapper with shared dispatcher#1843
Merged
Add cache support to coderWrapper with shared dispatcher#1843
Conversation
Introduces a new MCP (Model Context Protocol) server that enables Claude Code to execute TypeAgent commands for music playback, list management, calendar operations, and other natural language tasks. Key features: - Connects Claude Code to TypeAgent dispatcher via WebSocket - Automatic reconnection with 5-second retry interval - Comprehensive logging to temp files for debugging - Supports natural language commands (e.g., "play bohemian rhapsody", "add milk to grocery list") - Clean output formatting with HTML image tags stripped Includes example configuration for .mcp.json and detailed installation instructions in README. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add trademark section to README - Remove dist-test build outputs from git - Fix package.json field ordering (use exports instead of main) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Use exact trademark text format with proper line breaks - Sort package.json scripts alphabetically Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit enhances the split editor command in the Coda extension to support more flexible editor selection and improves TypeAgent schema disambiguation. **Bug Fixes:** - Fix off-by-one error when selecting "first" or "last" editor by sorting by viewColumn - Fix multiple split issue by adding conditionals to focus changes - Remove unnecessary focus restoration logic for voice command scenarios **Features:** - Add support for splitting editors by position: "first", "last", "active", or numeric index - Add support for splitting editors by file name: "split app.tsx to the right" - Search all open tabs using tabGroups API, not just visible editors - Automatically open and focus files found in background tabs before splitting **Schema Improvements:** - Add clear disambiguation between splitEditor and moveCursorInFile actions - Add "USE THIS for" and "DO NOT USE for" guidance in schema comments - Add concrete examples to help LLM choose correct action - Remove moveCursorInFile reference from main code schema (not useful for voice) **Documentation:** - Add VSCODE_CAPABILITIES.md documenting all VSCode automation features - Update split editor examples to show new position and file-based splitting Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This enhancement allows the player agent to create playlists with songs specified by title and artist, and to add lists of songs to existing playlists, eliminating the need to search and build a track list first. Changes: - Add SongSpecification interface for specifying songs by track name, optional artist, and optional album - Extend CreatePlaylistAction with optional songs parameter to support creating playlists with songs in one action - Add new AddSongsToPlaylistAction for bulk adding songs to existing playlists - Implement searchSongsAndGetUris helper function to search Spotify for songs and collect their URIs - Update createPlaylist handler to search for and add songs when creating playlists - Add addSongsToPlaylist handler for the new action - Add validation support for the new action in playerHandlers Benefits: - Users can create playlists with songs in a single request - Supports requests like "create a playlist with the top 10 songs" - Provides feedback on songs that couldn't be found - Maintains backward compatibility with existing createPlaylist usage Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This package provides a pseudo terminal wrapper for CLI coding assistants like Claude Code, with support for transparent I/O passthrough and future caching capabilities. Features: - PTY wrapper using node-pty for proper terminal emulation - Transparent passthrough of all stdin/stdout/stderr - Support for multiple CLI assistants (Claude Code, Node REPL, Python, etc.) - Windows compatibility with automatic .exe handling - Graceful exit handling (Ctrl+C, SIGTERM) - Terminal features: colors, cursor control, resizing - Configurable assistant system for extensibility Architecture: - assistantConfig.ts: Pluggable configuration for different assistants - ptyWrapper.ts: Core PTY wrapper with node-pty - cli.ts: Command-line interface entry point - index.ts: Public API exports Usage: coder-wrapper # Use Claude Code (default) coder-wrapper -a node # Use Node REPL coder-wrapper -a python # Use Python REPL Future enhancements: - Cache checking with TypeAgent dispatcher before forwarding requests - Request/response logging and performance metrics - Cache hit/miss statistics Testing requires a real terminal (TTY) - see TESTING.md for manual test procedures. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit adds optional caching functionality to the coderWrapper package, allowing it to check TypeAgent's cache before forwarding commands to the wrapped CLI agent. Key changes: **coderWrapper package:** - Add cacheClient.ts: MCP client for checking TypeAgent cache via command-executor - Add debugLogger.ts: Debug logging to ~/.tmp/typeagent-coder-wrapper/ - Update ptyWrapper.ts: - Add cache checking before forwarding commands to wrapped agent - Handle \r\n separately to prevent duplicate command execution on Windows - Add processing lock to prevent concurrent command handling - Add enableCache option (default: false) - Add debug option for detailed logging - Update CLI to support --enable-cache and --debug flags **commandExecutor MCP server:** - Add startup connection race handling (return cache miss instead of error) - Add CACHE_HIT prefix for detection by cacheClient - Improve error handling for disconnected dispatcher **dispatcher:** - Add checkCache RPC method to dispatcher interface - Implement checkCache in dispatcher client and server - Support multi-client cache sharing via AsyncLocalStorage routing **agentServer:** - Add AsyncLocalStorage-based request routing for multi-client support - Wrap checkCache calls with client context to route responses correctly - Each client gets isolated cache results despite shared dispatcher The cache is disabled by default and must be explicitly enabled with enableCache: true or --enable-cache flag. When enabled and cache hits occur, results are returned immediately without invoking the wrapped CLI agent. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…mcp-server # Conflicts: # ts/packages/coderWrapper/README.md # ts/packages/coderWrapper/package.json # ts/packages/coderWrapper/src/cli.ts # ts/packages/coderWrapper/src/index.ts # ts/packages/coderWrapper/src/ptyWrapper.ts # ts/pnpm-lock.yaml
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
Adds optional caching functionality to the coderWrapper package, allowing it to check TypeAgent's cache before forwarding commands to the wrapped CLI agent. The cache is disabled by default to ensure safe, predictable behavior.
Key Features
Cache Support (Optional)
cacheClient.tsconnects to command-executor MCP server to check cache(385ms)indicator--enable-cacheflagMulti-Client Cache Sharing
Input Handling Improvements
Debug Logging
~/.tmp/typeagent-coder-wrapper/--debugflagChanged Packages
coderWrapper
cacheClient.ts- MCP client for cache checkingdebugLogger.ts- Debug logging utilityptyWrapper.ts- Cache support, input handling fixes--enable-cacheand--debugflagscommandExecutor
CACHE_HITprefix for client detectiondispatcher (RPC)
checkCachemethod to RPC interfaceagentServer
Test Plan
--enable-cacheflagNotes
enableCache: trueor--enable-cache🤖 Generated with Claude Code