Juvo AI Assistant Extension
An intelligent AI-powered coding assistant for VS Code with advanced memory capabilities, code context awareness, and support for multiple AI providers.
Features
🤖 Intelligent AI Agent
- Memory System: Persistent short-term and long-term memory across sessions
- Workspace Learning: Automatically learns and remembers your codebase patterns
- Context-Aware Responses: Understands your project structure and coding style
- Conversation History: Maintains conversation context with smart summarization
🔌 Multiple AI Provider Support
- OpenRouter: Access to 100+ models (Claude, GPT-4, Llama, etc.)
- Custom Endpoints: Support for local LLMs and custom AI services
- Flexible Configuration: Easy switching between providers and models
💻 Code Integration & Editing
- File Context Awareness: Automatically includes relevant file context
- Multi-file Support: Select and include multiple files in conversations
- Real-time Code Analysis: Understands your current workspace state
- Smart Context Management: Optimizes context size for better responses
- File Editing: AI can create and modify files with your approval
- Precise Edits: Apply targeted changes to specific code sections
- Safety Controls: Configurable permissions and path restrictions
🧠 Advanced Memory Features
- Persistent Memory: Remembers important information across VS Code sessions
- Workspace Isolation: Separate memory contexts for different projects
- Auto-learning: Continuously learns from your interactions
Quick Start
Configuration
- Open VS Code Settings (
Cmd+P
/ Ctrl+P
), search for settings
- In the extensions tab, search for "Juvo"
- Configure:
- Endpoint: Your AI provider's endpoint URL
- API Key: Your API key
- Model: Your preferred model name
Supported Providers
OpenRouter (Recommended)
- Endpoint:
https://openrouter.ai/api/v1/chat/completions
- Models:
anthropic/claude-3.5-sonnet
, openai/gpt-4
, meta-llama/llama-3.1-8b-instruct
, and 100+ more
- Get API Key: openrouter.ai/keys
Local/Custom LLMs
- LM Studio:
http://localhost:1234/v1/chat/completions
- Ollama:
http://localhost:11434/v1/chat/completions
- Any OpenAI-compatible endpoint
📝 File Editing Capabilities
Juvo proactively creates and modifies code files during conversations. Just describe what you want, and Juvo implements it automatically.
How It Works
Juvo understands your intent and takes action immediately - no need to explicitly ask it to edit files:
Create New Files
"Create a new utility file at src/utils/dateFormatter.ts for date formatting"
"Write a logger service in src/services/logger.ts"
"Add a new component at src/components/Button.tsx"
Modify Existing Code
"Refactor the authentication function to use async/await"
"Update the API endpoint in config.ts to use the new URL"
"Add error handling to the login function"
"Fix the bug in the calculateTotal function"
"Rewrite this file to use TypeScript"
"Add JSDoc comments to this file"
The AI understands when you're referring to the currently open file and will automatically apply changes to it.
Precise Edits
The AI automatically applies targeted changes to specific lines without rewriting entire files.
Natural File Editing
Juvo's AI agent is trained to:
- Understand when to edit files based on your requests
- Choose the right editing method (create new file vs. modify existing)
- Apply precise edits to minimize changes and preserve your code
- Explain changes clearly before and after execution
- Request permission based on your security settings
Behavior Configuration (.juvo/agent.json
)
Control how Juvo interacts with your files:
{
"name": "Juvo Project Agent",
"writePermissions": "ask",
"allowedPaths": ["src/**", "tests/**"],
"blockedPaths": ["node_modules/**", ".git/**"],
"patchPreview": true
}
Create behavior file:
- Ask in chat: "Create a Juvo behavior configuration file"
- Or manually create
.juvo/agent.json
in your project root
Permission Modes:
"ask"
- Prompt for each file operation (recommended)
"always"
- Allow all operations automatically
"never"
- Block all file modifications
Development
Prerequisites
- Node.js 16.x or higher
- VS Code 1.74.0 or higher
- Git
Setup
Clone the repository
git clone <repository-url>
cd juvo-extension
Install dependencies
npm install
Install webview dependencies (if needed)
npm run install:webview
Running in Development
Option 1: Quick Start (F5)
- Open the project in VS Code
- Press
F5
to launch the Extension Development Host
- The extension will be automatically loaded in the new window
Option 2: Manual Build & Run
Build the extension
npm run compile # Compile TypeScript
npm run build:webview # Build React webview
Launch Extension Development Host
- Press
F5
in VS Code, or
- Go to Run and Debug panel (
Ctrl+Shift+D
) and click "Run Extension"
Development Workflow
For Extension Code Changes (TypeScript)
npm run watch # Watches and auto-compiles TypeScript files
- Make changes to files in
src/
- TypeScript will auto-compile to
out/
- Reload the Extension Development Host (
Ctrl+R
in the extension window)
For Webview Changes (React)
npm run dev:webview # Watches and auto-builds React components
- Make changes to files in
src/webview/
- Webpack will auto-build the webview bundle
- Reload the Extension Development Host to see changes
Full Development Setup
Run both watchers simultaneously for complete development:
npm run dev:webview
Testing the Extension
- Open Extension Development Host (F5)
- Activate the extension:
- Open Command Palette (
Cmd+Shift+P
/ Ctrl+Shift+P
)
- Run "Juvo: Open AI Chat"
- Or click the Juvo icon in the Activity Bar
- Configure API Key:
- Go to VS Code Settings
- Search for "Juvo"
- Add your OpenAI or Anthropic API key
Project Structure
juvo-extension/
├── src/ # Extension source code
│ ├── extension.ts # Main extension entry point
│ ├── agent/ # AI Agent system
│ │ ├── Agent.ts # Core agent logic
│ │ ├── Memory.ts # Memory management
│ │ └── index.ts # Agent exports
│ ├── commands/ # VS Code commands
│ │ └── chatCommands.ts # Chat-related commands
│ ├── providers/ # VS Code providers
│ │ └── reactChatProvider.ts # Chat webview provider
│ ├── services/ # Core services
│ │ ├── aiService.ts # AI API integration
│ │ ├── configService.ts # Configuration management
│ │ └── fileService.ts # File operations
│ ├── types/ # TypeScript type definitions
│ │ ├── agent.ts # Agent-related types
│ │ ├── chat.ts # Chat-related types
│ │ └── index.ts # Type exports
│ ├── utils/ # Utility functions
│ │ └── logger.ts # Logging utility
│ └── webview/ # React webview components
│ ├── components/ # React components
│ │ ├── ChatApp.tsx # Main chat interface
│ │ ├── ChatMessage.tsx # Message component
│ │ ├── MessageInput.tsx # Input component
│ │ └── FileSelector.tsx # File selection
│ ├── styles/ # CSS styles
│ ├── icons/ # Icon components
│ └── index.tsx # Webview entry point
├── out/ # Compiled TypeScript output
├── media/ # Built webview assets
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
└── webpack.config.js # Webview build configuration
Available Scripts
npm run compile
- Compile TypeScript once
npm run watch
- Watch and auto-compile TypeScript
npm run build:webview
- Build React webview (production)
npm run dev:webview
- Build and watch React webview (development)
npm run vscode:prepublish
- Full production build
Debugging
- Extension Code: Use VS Code's built-in debugger (F5)
- Webview Code:
- Right-click in the webview → "Inspect Element"
- Use Chrome DevTools for React debugging
Common Issues
- Extension not loading: Check the Output panel for errors
- Webview not updating: Ensure
npm run dev:webview
is running
- TypeScript errors: Run
npm run compile
to see compilation errors
- Missing dependencies: Run
npm install
and npm run install:webview
Building for Production
To create a production build of the extension:
npm run vscode:prepublish
This will:
- Compile all TypeScript files
- Build the React webview in production mode
- Optimize all assets for distribution
Packaging the Extension
To package the extension as a .vsix
file for distribution:
Install vsce (VS Code Extension Manager):
npm install -g vsce
Package the extension:
vsce package
Install the packaged extension:
code --install-extension juvo-0.0.1.vsix
Configuration Options
All settings can be found in VS Code Settings under "Juvo":
- juvo.endpoint: AI endpoint URL
- juvo.apiKey: API key for your AI service
- juvo.model: Model name (e.g.,
anthropic/claude-3.5-sonnet
)
- juvo.temperature: Response creativity (0-2, default: 0.7)
- juvo.maxTokens: Maximum response length (default: 2000)
- juvo.maxContextLines: Maximum code lines to include (default: 500)
- juvo.autoIncludeOpenFiles: Auto-include open files as context
- juvo.memory.maxShortTermMessages: Short-term memory size (default: 20)
- juvo.memory.maxLongTermItems: Long-term memory size (default: 1000)
- juvo.memory.retentionDays: Memory retention period (default: 30)
Troubleshooting
"No auth credentials found"
- Manually set your API key in VS Code settings (search for "Juvo")
- Reload VS Code window after configuration
Extension not responding
- Check "Juvo: Show Status" for configuration issues
- Verify your API key is valid
- Check VS Code Output panel for errors
Requirements
- VS Code 1.74.0 or higher
- API key for your chosen AI service (OpenRouter, OpenAI, etc.)
- Internet connection (unless using local LLM)
License
MIT