Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 45 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ DevBuddy brings your tickets into a single sidebar so you can browse, create, up
| Feature | Description | Platforms |
|---------|-------------|-----------|
| **Unified Issue Explorer** | View and manage all tickets from VS Code | Linear, Jira Cloud, Jira Server (beta) |
| **AI Agents Know Your Tickets** | Let `@workspace` and Copilot help you with your work | Linear, Jira Cloud |
| **TODO Converter** | Convert TODOs to tickets with automatic code permalinks | Linear, Jira Cloud |
| **AI Workflows** | Generate PR summaries and standups automatically | Linear, Jira Cloud |
| **Branch Integration** | Create and manage branches directly from tickets | Linear, Jira Cloud |
| **Chat Participant** | Ask `@devbuddy` questions in natural language | Linear |
| **Chat Participant** | Ask `@devbuddy` questions in natural language | Linear, Jira Cloud |
| **Monorepo Support** | Intelligent package detection and validation | All platforms |

## Example Workflows
Expand Down Expand Up @@ -96,13 +97,49 @@ Connect GitHub Copilot or another LLM provider to unlock:
- ✅ Only Jira/Linear APIs you configure are contacted
- ✅ Privacy-first: AI is completely optional

## What's New in v0.5.0
## What's New in v0.8.0 🎉

- **Jira Server/Data Center Support (Beta)** - Connect to self-hosted Jira instances
- **Enhanced TODO Converter** - Better permalink generation and multi-file workflows
- **Improved AI Models** - Support for GPT-4o, GPT-4.1, and Gemini 2.0 Flash
- **Better Error Handling** - Clearer error messages and debugging support
- **Runtime Validation** - Production-grade API validation with Zod v4
### 🤖 AI Agents Now Understand Your Tickets
**Teach VS Code's AI assistants about your work—automatically.**

DevBuddy extends `@workspace`, GitHub Copilot, and other AI agents with real-time access to your Linear and Jira tickets. No more hallucinations, no more guessing—your AI assistants finally know what you're working on.

**Just ask naturally:**
```
@workspace what ticket am I working on?
→ Based on your branch feat/eng-125-oauth, you're working on ENG-125: Implement OAuth2 Authentication

@workspace what should I work on next?
→ Your highest priority ticket is ENG-126: Fix payment timeout (Priority: High, Estimate: 3 points)

@workspace help me implement this ticket
→ [AI generates implementation plan with full ticket context]
```

**How it works:**
- DevBuddy provides **3 powerful tools** that AI agents automatically discover
- 🎫 **Get Ticket Details** - Fetch any ticket by ID
- 📋 **List My Tickets** - See all your active work
- 🌿 **Get Current Ticket** - Detect ticket from your branch name

**The magic:** When you ask `@workspace` or Copilot questions about your tickets, they automatically invoke DevBuddy's tools to provide accurate, real-time information—no hallucinations, just facts from your Linear or Jira workspace.

**You can also reference tools directly:**
```
@workspace #getCurrentTicket
@workspace #listMyTickets
@workspace #getTicket ENG-125
```

**Configure:** Settings → Search "language model tools" to enable/disable individual tools.

[Learn more about AI agent integration →](https://github.com/angelo-hub/devbuddy/blob/main/docs/features/ai/LANGUAGE_MODEL_TOOLS.md)

### 🎯 Also in v0.8.0
- **Enhanced Chat Participant** - Natural language ticket planning with `@devbuddy`
- **Smart Work Suggestions** - AI-powered recommendations on what to work on next
- **Debug Logging** - Comprehensive diagnostics for troubleshooting
- **Version Banner** - See your DevBuddy version and build type on startup

## Commands Overview

Expand Down Expand Up @@ -166,5 +203,5 @@ All current features are free to use. Future Pro features will require a subscri

---

**Version 0.5.0** | Made with ❤️ for developers who hate context switching
**Version 0.8.0** | Made with ❤️ for developers who hate context switching

286 changes: 286 additions & 0 deletions docs/features/ai/LANGUAGE_MODEL_TOOLS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
# Language Model Tools - Full Implementation ✅

Based on the [official VS Code Language Model Tools API documentation](https://code.visualstudio.com/api/extension-guides/ai/tools), I've updated DevBuddy's tool declarations to be fully compliant and visible in the VS Code UI.

## What Changed

### Added Required Properties for UI Visibility

According to the [VS Code docs](https://code.visualstudio.com/api/extension-guides/ai/tools#1-static-configuration-in-packagejson), to make tools **visible and referenceable in agent mode**, we need these properties:

| Property | Purpose | Example |
|----------|---------|---------|
| `canBeReferencedInPrompt` | Enables tool in agent mode and chat prompts with `#` | `true` |
| `toolReferenceName` | Name users type to reference the tool (e.g., `#getTicket`) | `"getTicket"` |
| `icon` | Icon displayed in the UI | `"$(file-text)"` |
| `userDescription` | User-facing description in the UI | `"Fetches ticket details..."` |
| `tags` | Categories for organizing tools | `["tickets", "devbuddy"]` |

### Before vs After

**Before:**
```json
{
"name": "devbuddy_get_ticket",
"displayName": "Get Ticket Details",
"description": "...", // ❌ Should be "userDescription"
"modelDescription": "...",
"inputSchema": { ... }
}
```

**After:**
```json
{
"name": "devbuddy_get_ticket",
"displayName": "Get Ticket Details",
"userDescription": "...", // ✅ Changed from "description"
"modelDescription": "...",
"icon": "$(file-text)", // ✅ Added icon
"tags": ["tickets", "devbuddy"], // ✅ Added tags
"canBeReferencedInPrompt": true, // ✅ Enable in agent mode
"toolReferenceName": "getTicket", // ✅ Reference name for users
"inputSchema": { ... }
}
```

## Updated Tool Declarations

### Tool 1: Get Ticket Details
```json
{
"name": "devbuddy_get_ticket",
"displayName": "Get Ticket Details",
"userDescription": "Fetches detailed information about a specific ticket from Linear or Jira",
"modelDescription": "Use this tool when you need details about a specific ticket...",
"icon": "$(file-text)",
"tags": ["tickets", "devbuddy"],
"canBeReferencedInPrompt": true,
"toolReferenceName": "getTicket",
"inputSchema": {
"type": "object",
"properties": {
"ticketId": {
"type": "string",
"description": "The ticket identifier (e.g., 'ENG-123', 'PROJ-456')"
}
},
"required": ["ticketId"]
}
}
```

**User can now use:** `#getTicket` in chat prompts!

### Tool 2: List My Tickets
```json
{
"name": "devbuddy_list_my_tickets",
"displayName": "List My Tickets",
"userDescription": "Lists all active tickets assigned to the current user",
"modelDescription": "Use this tool to get a list of all tickets...",
"icon": "$(checklist)",
"tags": ["tickets", "devbuddy"],
"canBeReferencedInPrompt": true,
"toolReferenceName": "listMyTickets",
"inputSchema": {
"type": "object",
"properties": {}
}
}
```

**User can now use:** `#listMyTickets` in chat prompts!

### Tool 3: Get Current Branch Ticket
```json
{
"name": "devbuddy_get_current_ticket",
"displayName": "Get Current Branch Ticket",
"userDescription": "Retrieves the ticket associated with the current Git branch",
"modelDescription": "Use this tool to find out which ticket is associated...",
"icon": "$(git-branch)",
"tags": ["git", "tickets", "devbuddy"],
"canBeReferencedInPrompt": true,
"toolReferenceName": "getCurrentTicket",
"inputSchema": {
"type": "object",
"properties": {}
}
}
```

**User can now use:** `#getCurrentTicket` in chat prompts!

## How to Test

### 1. Reload VS Code
Press **F5** (Extension Development Host) or reload your window.

### 2. Check Tool Registration
Open **Output** → **DevBuddy** channel. You should see:
```
🚀 DevBuddy v0.7.4 (Development Build)
✅ Registered tool: devbuddy_get_ticket
✅ Registered tool: devbuddy_list_my_tickets
✅ Registered tool: devbuddy_get_current_ticket
✨ Language Model Tools registered successfully
```

### 3. Find Tools in Settings UI

According to the [VS Code documentation](https://code.visualstudio.com/api/extension-guides/ai/tools#why-implement-a-language-model-tool-in-your-extension), tools should appear in:

**Settings → Chat → Language Models → Tools**

Or search for:
- `language model tools` in settings
- Look for a "Tools" section in GitHub Copilot Chat settings

You should see your DevBuddy tools listed with:
- ✅ **Icon** (file-text, checklist, git-branch)
- ✅ **Display Name** (Get Ticket Details, List My Tickets, etc.)
- ✅ **User Description**
- ✅ **Checkboxes to enable/disable** each tool

### 4. Use Tools in Chat

#### Option A: Let Agent Mode Auto-Invoke
```
@workspace what ticket am I working on?
```
Agent mode will automatically invoke `devbuddy_get_current_ticket`.

#### Option B: Reference Tools Explicitly with `#`
```
@workspace #getCurrentTicket

@workspace #getTicket ENG-123

@workspace #listMyTickets
```

### 5. Watch Debug Logs

Enable `devBuddy.debugMode` in settings, then check the DevBuddy Output panel:

```
🌿 [LM Tool] devbuddy_get_current_ticket invoked
[LM Tool] Workspace: /Users/you/project
[LM Tool] Current branch: feat/eng-125-oauth
[LM Tool] Detected ticket ID: ENG-125
✅ [LM Tool] Returned ticket details (300 chars)
```

## Tool-Calling Flow

Per the [VS Code documentation](https://code.visualstudio.com/api/extension-guides/ai/tools#tool-calling-flow):

```
User Prompt
Copilot determines available tools (based on user config)
LLM analyzes prompt + tool definitions
LLM requests tool invocation(s)
Copilot invokes tool(s) via vscode.lm.registerTool
Extension returns LanguageModelToolResult
Copilot sends results back to LLM
Final response to user
```

## Key Features Now Enabled

✅ **Tools appear in Settings UI** - Users can enable/disable them
✅ **Tools work in Agent Mode** - Automatically invoked when relevant
✅ **Tools can be referenced with `#`** - Explicit invocation in chat
✅ **Icons in UI** - Visual identification of tools
✅ **User-friendly descriptions** - Clear purpose in UI
✅ **Organized by tags** - Easy to find related tools

## Guidelines Followed

From the [VS Code guidelines](https://code.visualstudio.com/api/extension-guides/ai/tools#guidelines-and-conventions):

✅ **Naming Convention:** `{verb}_{noun}` format
- `devbuddy_get_ticket` ✓
- `devbuddy_list_my_tickets` ✓
- `devbuddy_get_current_ticket` ✓

✅ **Clear Descriptions:** Both user-facing and model-facing descriptions
✅ **Input Schema:** Detailed parameter descriptions
✅ **Error Handling:** Meaningful error messages in tool implementation
✅ **User Confirmation:** Implemented via `prepareInvocation` in extension code

## Files Changed

1. **`package.json`** - Updated `languageModelTools` contribution:
- Changed `description` → `userDescription`
- Added `icon` for each tool
- Added `tags` for categorization
- Added `canBeReferencedInPrompt: true`
- Added `toolReferenceName` for `#` references
- Kept `inputSchema` (was `parametersSchema`, already fixed)

2. **`src/extension.ts`** - Already correct:
- Tool registration with `vscode.lm.registerTool`
- Tool implementation with debug logging

## What Users Will See

### In Settings UI
```
Chat → Language Model Tools

☑ DevBuddy Tools
☑ 📄 Get Ticket Details
Fetches detailed information about a specific ticket...

☑ ✓ List My Tickets
Lists all active tickets assigned to the current user...

☑ 🌿 Get Current Branch Ticket
Retrieves the ticket associated with the current Git branch...
```

### In Chat
```
User: @workspace what ticket am I working on?

Copilot: Let me check your current branch...
[Invoking devbuddy_get_current_ticket]

Based on your branch (feat/eng-125-oauth), you're working on:

**ENG-125: Implement OAuth2 Authentication**
- Status: In Progress
- Priority: High
- Assignee: You
```

## References

- [VS Code Language Model Tools API](https://code.visualstudio.com/api/extension-guides/ai/tools)
- [OpenAI Function Calling](https://platform.openai.com/docs/guides/function-calling)
- [VS Code Extension Samples - Chat Tools](https://github.com/microsoft/vscode-extension-samples/tree/main/chat-sample)

## Next Steps

1. ✅ Reload VS Code
2. ✅ Check Settings UI for DevBuddy tools
3. ✅ Test with `@workspace` and `#toolName` references
4. ✅ Monitor debug logs for tool invocations
5. 🎯 Consider adding more tools (e.g., `update_ticket_status`, `create_ticket`, `add_comment`)

---

**Status:** FULLY IMPLEMENTED ✅
**Date:** 2025-11-24
**Version:** 0.7.4
**Spec:** VS Code Language Model Tools API v1.93+

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading