Webhook Copilot Trigger — VS Code Extension
HTTP webhook server that triggers GitHub Copilot Chat from external tools like DevConsole, sticky notes, and log panels.
Features
- HTTP Webhook Server (port 9090) — accepts
POST /webhook with { prompt, context?, images? }
- WebSocket Terminal Stream (port 9091) — streams terminal output to connected clients
- @webhook Chat Participant — direct access to Copilot's language model
- Image/Vision Support — attach screenshots for multimodal analysis
- Queue System — processes tasks sequentially with status tracking
Quick Start (Local Development)
cd /Users/chinonsojohn/ripe-console/webhook-copilot-extension
npm install
npm run compile
Then press F5 in VS Code to launch the Extension Host.
Commands
| Command |
Description |
Webhook Copilot: Start Server |
Start HTTP webhook server |
Webhook Copilot: Stop Server |
Stop HTTP webhook server |
Webhook Copilot: Restart Server |
Restart HTTP webhook server |
Webhook Copilot: Start Terminal Stream |
Start WebSocket terminal server |
Webhook Copilot: Stop Terminal Stream |
Stop WebSocket terminal server |
Webhook Copilot: Terminal Stream Status |
Show terminal stream status |
API Endpoints
| Endpoint |
Method |
Description |
/health |
GET |
Health check with workspace status |
/test |
POST |
Echo test (validates connection) |
/webhook |
POST |
Main webhook endpoint |
/webhook/:requestId/status |
GET |
Poll request status |
/queue |
GET |
Get current queue status |
Webhook Payload
{
"prompt": "Explain this error and suggest a fix",
"context": {
"log": "TypeError: Cannot read property 'x' of undefined",
"file": "src/app.ts",
"line": 42,
"source": "logs"
},
"images": [
{
"data": "<base64>",
"mimeType": "image/png",
"description": "Screenshot of the error"
}
]
}
Integration with DevConsole
The extension integrates with the DevConsole Chrome extension's Code Actions Panel:
- DevConsole sends webhook to
http://localhost:9090/webhook
- Extension forwards prompt to Copilot Chat
- DevConsole tracks status via
requestId polling
- User sees Copilot response in VS Code
The webhookService.ts client and codeActions.ts store handle:
- Connection health checks (
GET /health)
- Queue position tracking
- Retry on failure
- Clipboard fallback when VS Code unavailable
Settings
| Setting |
Default |
Description |
webhookCopilot.serverPort |
9090 |
Webhook server port |
webhookCopilot.autoStart |
true |
Auto-start on VS Code launch |
webhookCopilot.requireApproval |
true |
Require approval for actions |
webhookCopilot.terminalStreamPort |
9091 |
Terminal stream port |
webhookCopilot.terminalStreamAutoStart |
true |
Auto-start terminal stream |
Publishing to VS Code Marketplace
Prerequisites
- Azure DevOps Account — Create one at https://dev.azure.com
- Personal Access Token (PAT) — Create with "Marketplace (Manage)" scope
Create Personal Access Token
- Go to https://dev.azure.com
- Click your profile → Personal access tokens
- Click New Token
- Set:
- Name:
vsce-publish
- Organization: All accessible organizations
- Scopes: Marketplace → Manage
- Copy the token (you won't see it again)
Create Publisher
npx vsce create-publisher chinonsojohn
# Enter your PAT when prompted
Or create at https://marketplace.visualstudio.com/manage
Package and Publish
cd webhook-copilot-extension
# Install dependencies
npm install
# Package as .vsix (for testing)
npm run package
# Creates: webhook-copilot-trigger-1.0.0.vsix
# Publish to marketplace
npm run publish
# Or: npx vsce publish -p <YOUR_PAT>
Install from VSIX (Local Testing)
- In VS Code: Extensions → ... → Install from VSIX
- Select
webhook-copilot-trigger-1.0.0.vsix
Troubleshooting
| Issue |
Solution |
| Port in use |
Change webhookCopilot.serverPort in settings |
| No workspace error |
Open a folder in VS Code before sending webhooks |
| Chat not responding |
Check Copilot is signed in and working |
| Terminal stream unavailable |
Requires VS Code Insiders or proposed APIs |
License
MIT