Skip to content

Commit fd42b15

Browse files
committed
feat: Rename project to "Zen Coder" and enhance tool functionality with Vercel AI SDK integration
1 parent 091c84c commit fd42b15

File tree

10 files changed

+231
-119
lines changed

10 files changed

+231
-119
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# minicoder README
1+
# Zen Coder README
22

3-
This is the README for your extension "minicoder". After writing up a brief description, we recommend including the following sections.
3+
This is the README for your extension "Zen Coder". After writing up a brief description, we recommend including the following sections.
44

55
## Features
66

memory-bank/.clinerules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Cline Rules for Simplified AI Coder VS Code Extension
1+
# Cline Rules for Zen Coder VS Code Extension
22

33
## Project-Specific Patterns
44
- (To be populated as patterns emerge)

memory-bank/activeContext.md

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
11
# Active Context
22

33
## Current Focus
4-
Finalizing documentation and preparing for task completion after implementing development mode support for webview loading.
4+
Renaming project to "Zen Coder" and enhancing tool functionality based on Vercel AI SDK documentation (tool activation, multi-step, error handling, repair).
55

66
## Recent Changes
7-
- Completed core MVP functionality.
8-
- Refactored Webview UI to Vite + Preact.
9-
- Implemented Model Selection UI and logic.
10-
- Updated relevant files (`package.json`, `src/extension.ts`, `webview-ui/*`) for Vite + Preact.
11-
- Fixed Webview Loading Issue for production builds.
12-
- **Implemented Development Mode Support:**
13-
- Updated `.vscode/launch.json` to use `npm: watch` as `preLaunchTask`.
14-
- Modified `getWebviewContent` in `src/extension.ts` to detect `extensionMode` and load from Vite dev server (`http://localhost:5173`) in development or from `dist/webview` in production.
15-
- Adjusted CSP policies for both modes.
16-
- **Fixed Preact Mount Point:** Corrected the target element ID in `webview-ui/src/main.tsx` from `#app` to `#root` to match the development HTML structure in `src/extension.ts`, resolving the "無野睇" issue in dev mode.
17-
- **Fixed TypeScript RootDir Issue (TS6059):** Modified the main `tsconfig.json` to explicitly include only the `src/**/*` directory, preventing the compiler from trying to process files in the separate `webview-ui` project.
18-
- **Fixed TypeScript DOM Type Errors (TS2304):** Added `"DOM"` to the `compilerOptions.lib` array in the main `tsconfig.json` to resolve type errors originating from `@ai-sdk/ui-utils` dependency.
19-
- **Fixed CORS Issue in Dev Mode:** Updated `webview-ui/vite.config.ts` to include `server: { cors: true }`, allowing the VS Code webview (`vscode-webview://`) to fetch resources from the Vite dev server (`http://localhost:5173`).
7+
- **Project Renamed to Zen Coder:** Updated `package.json`, `src/extension.ts`, `README.md`, and Memory Bank files (`projectbrief.md`, `productContext.md`, `.clinerules`). Updated `webview-ui/index.html` title and root element ID. Updated secret keys prefix in `aiService.ts`.
8+
- **Tool Enhancement (Vercel AI SDK):**
9+
- Added configuration options in `package.json` for enabling/disabling individual tools (`zencoder.tools.*.enabled`).
10+
- Modified `AiService` (`_getActiveToolNames`, `getAiResponseStream`) to read configuration and pass active tools via `experimental_activeTools` to `streamText`.
11+
- Added `maxSteps: 5` to `streamText` call in `AiService` to enable multi-step tool execution.
12+
- Added experimental tool error handling (`NoSuchToolError`, `InvalidToolArgumentsError`, `ToolExecutionError`) in `getAiResponseStream`.
13+
- Added experimental tool repair (`experimental_repairToolCall` with re-ask strategy) to `streamText` call in `AiService`.
14+
- Removed placeholder MCP executor logic from `src/extension.ts` and `AiService`. Updated `executeSearch` in `AiService` to reflect dependency on future MCP integration.
2015

2116
## Next Steps
22-
- Update `memory-bank/progress.md` to reflect all recent fixes (dev mode, mount point, tsconfig include, tsconfig lib, vite cors).
23-
- Commit the latest changes.
17+
- Update `memory-bank/progress.md` to reflect project renaming and tool enhancements.
18+
- Commit changes.
2419
- Attempt completion.
2520
- Attempt completion.
2621

2722
## Active Decisions
28-
- Webview UI successfully refactored and loading correctly in both development (with HMR via Vite dev server) and production modes.
29-
- Model selection functionality implemented.
30-
- Core logic remains stable.
23+
- Project successfully renamed across relevant files.
24+
- Tool functionality enhanced with activation controls, multi-step capability, and basic error/repair handling based on Vercel AI SDK features.
25+
- Code prepared for potential future MCP integration.

memory-bank/productContext.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Product Context: Simplified AI Coder VS Code Extension
1+
# Product Context: Zen Coder VS Code Extension
22

33
## Problem Solved
44
Provides a simple, integrated way for a developer to leverage various AI models (Anthropic, Google, OpenRouter, DeepSeek) directly within VS Code for coding assistance, without needing complex setups or switching contexts. Enables AI to interact with the workspace via defined tools.

memory-bank/progress.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Basic Preact chat UI structure implemented.
99
- Model selection dropdown implemented and functional.
1010
- Communication between Preact UI and extension host updated.
11-
- `minicoder.startChat` command registered and activated.
11+
- `zencoder.startChat` command registered and activated (project renamed).
1212
- **Webview panel creation logic loads correctly in both Development (Vite Dev Server for HMR) and Production (Vite build output) modes.** (Fixed Preact mount point to `#root` in `webview-ui/src/main.tsx` for dev mode).
1313
- CSP nonce handling adapted for both modes.
1414
- `AiService` class created (`src/ai/aiService.ts`) with:
@@ -17,10 +17,10 @@
1717
- `getAiResponseStream` method.
1818
- Tool definitions for all required tools.
1919
- Basic tool execution logic implemented for most tools.
20-
- `executeSearch` updated to use an MCP tool executor bridge.
20+
- `executeSearch` updated to indicate requirement for MCP integration (placeholder removed).
2121
- Conversation history update methods.
2222
- `AiService` integrated into `src/extension.ts`.
23-
- Placeholder MCP tool executor defined and passed to `AiService`.
23+
- Placeholder MCP tool executor removed from `src/extension.ts` and `AiService` constructor.
2424
- Streaming logic adapted for Preact UI.
2525
- API Key Setting Commands and handlers implemented.
2626
- Vite build configuration updated.
@@ -29,23 +29,29 @@
2929
- **TypeScript RootDir Issue (TS6059) Fixed:** Main `tsconfig.json` updated with `include: ["src/**/*"]` to prevent conflicts with the separate `webview-ui` project.
3030
- **TypeScript DOM Type Errors (TS2304) Fixed:** Added `"DOM"` to `compilerOptions.lib` in main `tsconfig.json` to resolve type issues from `@ai-sdk/ui-utils`.
3131
- **Vite Dev Server CORS Issue Fixed:** Updated `webview-ui/vite.config.ts` with `server: { cors: true }` to allow webview access.
32+
- **Project Renamed to "Zen Coder":** All relevant files (`package.json`, `src/extension.ts`, `README.md`, Memory Bank files, `webview-ui/index.html`, `aiService.ts` secret keys) updated.
33+
- **Tool Functionality Enhanced:**
34+
- Added VS Code settings (`zencoder.tools.*.enabled`) to enable/disable tools.
35+
- `AiService` now reads settings and uses `experimental_activeTools` in `streamText`.
36+
- `streamText` call updated with `maxSteps: 5` for multi-step tool use.
37+
- Added experimental tool error handling and repair (`experimental_repairToolCall`) in `AiService`.
3238

3339
## What's Left (Potential Future Enhancements)
3440
- Refine Preact component structure.
3541
- Refine tool execution logic (error handling, robustness, e.g., `fetch`).
3642
- Implement conversation history persistence.
3743
- Thorough testing and debugging.
3844
- Remove unused `@vscode/webview-ui-toolkit` dependency.
39-
- Replace placeholder MCP tool executor with actual implementation if available/needed.
45+
- Implement actual MCP client integration for tools like `search`.
4046
- Improve Markdown rendering in Preact UI.
4147
- Improve error handling in Preact UI.
4248

4349
## Current Status
44-
- **MVP + Model Selection + Dev Mode Complete & Functional:** Core functionality, API key management, model selection UI (Vite + Preact), and webview loading (supporting dev HMR) are implemented and working.
45-
- Project is in a stable, functional state meeting the extended requirements.
50+
- **Core Functionality Enhanced:** Project renamed to Zen Coder. Tool functionality improved with activation controls, multi-step capability, and experimental error handling/repair. Core chat, API key management, model selection, and dev/prod webview loading remain functional.
51+
- Project is stable with enhanced tool features based on Vercel AI SDK.
4652

4753
## Known Issues
4854
- `@vscode/webview-ui-toolkit` dependency is unused after refactor but still listed in `package.json`.
49-
- Search tool currently uses a placeholder MCP executor.
55+
- Search tool requires MCP integration to function.
5056
- Other tool implementations might need more robust error handling.
5157
- Conversation history is not persisted.

memory-bank/projectbrief.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Project Brief: Simplified AI Coder VS Code Extension (MVP)
1+
# Project Brief: Zen Coder VS Code Extension (MVP)
22

33
## Objective
44
Build a lightweight VS Code extension that provides a simple chat interface to interact with selected AI models for coding assistance. Focus on core functionality, ease of use for a single developer, and direct integration with essential VS Code actions via AI tools.

package.json

+68-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "minicoder",
3-
"displayName": "MiniCoder",
2+
"name": "zencoder",
3+
"displayName": "Zen Coder",
44
"description": "",
55
"version": "0.0.1",
66
"engines": {
@@ -10,40 +10,90 @@
1010
"Other"
1111
],
1212
"activationEvents": [
13-
"onCommand:minicoder.startChat",
14-
"onCommand:minicoder.setAnthropicKey",
15-
"onCommand:minicoder.setGoogleKey",
16-
"onCommand:minicoder.setOpenRouterKey",
17-
"onCommand:minicoder.setDeepseekKey"
13+
"onCommand:zencoder.startChat",
14+
"onCommand:zencoder.setAnthropicKey",
15+
"onCommand:zencoder.setGoogleKey",
16+
"onCommand:zencoder.setOpenRouterKey",
17+
"onCommand:zencoder.setDeepseekKey"
1818
],
1919
"main": "./dist/extension.js",
2020
"contributes": {
2121
"commands": [
2222
{
23-
"command": "minicoder.startChat",
24-
"title": "Start AI Coder Chat"
23+
"command": "zencoder.startChat",
24+
"title": "Start Zen Coder Chat"
2525
},
2626
{
27-
"command": "minicoder.setAnthropicKey",
27+
"command": "zencoder.setAnthropicKey",
2828
"title": "Set Anthropic API Key",
29-
"category": "AI Coder"
29+
"category": "Zen Coder"
3030
},
3131
{
32-
"command": "minicoder.setGoogleKey",
32+
"command": "zencoder.setGoogleKey",
3333
"title": "Set Google API Key",
34-
"category": "AI Coder"
34+
"category": "Zen Coder"
3535
},
3636
{
37-
"command": "minicoder.setOpenRouterKey",
37+
"command": "zencoder.setOpenRouterKey",
3838
"title": "Set OpenRouter API Key",
39-
"category": "AI Coder"
39+
"category": "Zen Coder"
4040
},
4141
{
42-
"command": "minicoder.setDeepseekKey",
42+
"command": "zencoder.setDeepseekKey",
4343
"title": "Set Deepseek API Key",
44-
"category": "AI Coder"
44+
"category": "Zen Coder"
4545
}
46-
]
46+
],
47+
"configuration": {
48+
"title": "Zen Coder Settings",
49+
"properties": {
50+
"zencoder.tools.readFile.enabled": {
51+
"type": "boolean",
52+
"default": true,
53+
"description": "Enable the 'readFile' tool."
54+
},
55+
"zencoder.tools.writeFile.enabled": {
56+
"type": "boolean",
57+
"default": true,
58+
"description": "Enable the 'writeFile' tool."
59+
},
60+
"zencoder.tools.listFiles.enabled": {
61+
"type": "boolean",
62+
"default": true,
63+
"description": "Enable the 'listFiles' tool."
64+
},
65+
"zencoder.tools.runCommand.enabled": {
66+
"type": "boolean",
67+
"default": true,
68+
"description": "Enable the 'runCommand' tool (requires user confirmation)."
69+
},
70+
"zencoder.tools.search.enabled": {
71+
"type": "boolean",
72+
"default": true,
73+
"description": "Enable the 'search' tool (requires MCP integration)."
74+
},
75+
"zencoder.tools.fetch.enabled": {
76+
"type": "boolean",
77+
"default": true,
78+
"description": "Enable the 'fetch' tool."
79+
},
80+
"zencoder.tools.getOpenTabs.enabled": {
81+
"type": "boolean",
82+
"default": true,
83+
"description": "Enable the 'getOpenTabs' tool."
84+
},
85+
"zencoder.tools.getActiveTerminals.enabled": {
86+
"type": "boolean",
87+
"default": true,
88+
"description": "Enable the 'getActiveTerminals' tool."
89+
},
90+
"zencoder.tools.getCurrentTime.enabled": {
91+
"type": "boolean",
92+
"default": true,
93+
"description": "Enable the 'getCurrentTime' tool."
94+
}
95+
}
96+
}
4797
},
4898
"scripts": {
4999
"vscode:prepublish": "pnpm run package",

0 commit comments

Comments
 (0)