A lightweight code assistant with a message-passing architecture between a core service, UI, and IDE integration. Inspired by the Continue.dev project.
Note: This project currently only implements the foundational message-passing architecture and infrastructure. No actual code assistant features have been implemented yet. The focus is on establishing the communication framework between components.
CAT is a code assistant tool designed to help developers with coding tasks. It features a modular architecture with three main components:
- Core Service: A TypeScript Node.js application that processes messages from the IDE and returns responses
- GUI: A React application that provides a user interface for interacting with the core service
- IDE Integration: Extensions for VS Code and JetBrains IDEs that integrate the GUI and core service
The project uses a message-passing architecture to enable communication between components:
IDE Extension <---> Core Service <---> GUI
- The IDE extension hosts the GUI in a webview
- The GUI communicates with the core service through the IDE extension
- The core service processes requests and returns responses
The core service is a TypeScript Node.js application that:
- Processes messages from the IDE
- Sends responses back to the IDE
- Handles basic commands like ping/pong
- Runs as a TCP server in development mode
- Can be built as a binary executable file using IPC in production
- Protocol definitions are located in core/src/protocol/
The GUI is a React application with Redux for state management that:
- Provides a user interface for interacting with the core service
- Sends requests to the core service through the IDE extension
- Displays responses from the core service
- Designed to work with both VS Code and IntelliJ plugins
- Uses Vite 6.3.4 for development and Vitest for testing
A VS Code extension that:
- Hosts the GUI in a webview
- Provides commands for interacting with the core service
- Passes messages between the GUI and core service
- Uses esbuild for bundling TypeScript code
A JetBrains plugin written in Kotlin that:
- Hosts the GUI using JCEF
- Provides actions for interacting with the core service
- Passes messages between the GUI and core service
- Uses port 9876 for core service communication
The binary
directory is a crucial component of the project that:
- Contains the core service executable builds
- Supports both VS Code and IntelliJ plugins
- Runs as a TCP server in development mode
- Provides a Node.js-based implementation (not a JAR)
- Has a VS Code run configuration called 'Core binary' for development
- Requires the esbuild module for building
- Can be built as a standalone executable for production use
The .vscode
directory at the project root contains important configuration files:
-
launch.json: Defines VS Code launch configurations
- Contains 'Run Extension' configuration for debugging the VS Code extension
- Includes 'Core binary' configuration for running the TCP process in the binary directory
- Uses esbuild task as preLaunchTask for the 'Run Extension' configuration
-
tasks.json: Defines VS Code tasks
- Contains the esbuild task that runs
extensions\vscode\scripts\esbuild.js
- Bundles TypeScript source code into a single JavaScript file
- Used as a prerequisite for launching the extension
- Contains the esbuild task that runs
- Run Extension.run.xml: Located in
extensions\intellij\.run\
- Defines the run configuration for the IntelliJ plugin
- Configures how the IntelliJ plugin is launched and debugged
- Integrates with the core service running on port 9876
- Node.js 14 or higher
- npm 6 or higher
- VS Code 1.70.0 or higher (for VS Code extension)
- JetBrains IDE (for JetBrains plugin)
- Windows environment (primary development platform)
-
Clone the repository
-
Build the extension:
cd extensions/vscode npm install npm run esbuild
-
Install the extension in VS Code:
- Press F5 to open a new window with the extension loaded
- Or package the extension with
vsce package
and install the .vsix file
The VS Code extension provides the following commands:
- Cat: Hello World - Displays a simple hello world message
- Cat: Count Files in Workspace - Counts all files in your workspace
- Cat: Ping Core Service - Pings the core service (valid part of the messaging protocol)
- Cat: Open GUI - Opens the GUI in a webview
To use the extension:
- Open the command palette (Ctrl+Shift+P)
- Type "Cat:" to see available commands
- Select a command to execute it
cat/
├── core/ # Core service
│ ├── src/ # Source code
│ │ └── protocol/ # Protocol definitions
│ └── README.md # Core service documentation
├── extensions/ # IDE integrations
│ ├── vscode/ # VS Code extension
│ │ └── scripts/ # Build scripts including esbuild.js
│ └── jetbrains/ # JetBrains plugin
├── gui/ # React user interface
│ ├── src/ # Source code
│ │ ├── redux/ # Redux state management (renamed from store)
│ │ ├── hooks/ # React hooks
│ │ └── context/ # Context providers (renamed from messaging)
│ └── public/ # Static assets
├── binary/ # Binary executable builds
├── .vscode/ # VS Code configuration (at project root)
├── docs/ # Documentation
└── README.md # Project documentation
cd core
npm install
npm run build
cd gui
npm install
npm run build # Runs TypeScript compilation before Vite build
The build script in package.json runs TypeScript compilation before Vite build with tsc && vite build
.
cd extensions/vscode
npm install
npm run esbuild # Uses esbuild.js script to bundle TypeScript code
- Open the project in VS Code
- Press F5 to start debugging (uses esbuild task as preLaunchTask)
- A new VS Code window will open with the extension loaded
The core service can be run in two modes:
-
Development Mode (TCP):
- Use the VS Code run configuration 'Core binary'
- Runs the TCP server from the binary directory
-
Production Mode (IPC):
- Built as a binary executable file
- Uses IPC for communication
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.