How suhailult777/ai-vscode-extension works
Main Components
• VS Code Host Environment – This is where the extension is installed and activated (via the Command Palette using the “Chat with Jarvis” command).
• Jarvis Extension Core – Represented by the primary source file (src/extension.ts) that contains the extension’s activation logic, event handlers, and interaction hooks with the VS Code API.
• Testing Suite – Located under src/test (e.g., extension.test.ts) that contains unit/integration tests for the extension.
• Ollama Service – An external dependency that must be installed and run locally. This component is responsible for AI model interactions (with the deepseek-r1 model) and streaming responses.
• Configuration & Metadata – Files like package.json, tsconfig.json, and others which define activation events, command contributions, and build settings.
Relationships and Interactions
• When a user triggers the “Chat with Jarvis” command in VS Code, the extension’s activationEvent is fired, and the main extension file (extension.ts) is executed.
• The extension then communicates with the locally running Ollama instance (via the Ollama Node.js dependency) for processing AI chat requests.
• Ollama processes the request (using the pulled deepseek-r1 model) and streams responses back to the extension.
• Responses and chat UI updates are shown within the VS Code window.
• Additionally, errors (such as issues with model availability) and developer logs are handled (and visible via the Developer Tools or the Output panel).
Architectural Patterns and Technologies
• The project adheres to the modular architecture typical of VS Code extensions, separating core logic (activation/command handling) from testing.
• The dependency on Ollama introduces an external service integration pattern, where the extension acts as a client sending requests and handling streaming responses.
• Use of Node.js, TypeScript, and npm as package management/build system are key technology choices.
• The setup in package.json (activationEvents and contributes.commands) demonstrates a clear separation of extension declaration and execution logic.
Detail
• That every major component—VS Code integration, AI communication, configuration settings, and testing—is clearly represented.
• Depending on your audience’s preference, you could further annotate components with technologies (e.g., Node.js, TypeScript, Ollama) to provide context on the technology stack.