codevf 1.0.4 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -132
- package/dist/commands/cvf-command-content.d.ts +1 -1
- package/dist/commands/cvf-command-content.d.ts.map +1 -1
- package/dist/commands/cvf-command-content.js +5 -0
- package/dist/commands/cvf-command-content.js.map +1 -1
- package/dist/commands/mcp.d.ts +10 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +79 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +186 -18
- package/dist/commands/setup.js.map +1 -1
- package/dist/index.js +43 -296
- package/dist/index.js.map +1 -1
- package/dist/lib/api/tasks.d.ts +1 -0
- package/dist/lib/api/tasks.d.ts.map +1 -1
- package/dist/lib/api/tasks.js +1 -0
- package/dist/lib/api/tasks.js.map +1 -1
- package/dist/lib/auth/oauth-flow.d.ts.map +1 -1
- package/dist/lib/auth/oauth-flow.js +22 -2
- package/dist/lib/auth/oauth-flow.js.map +1 -1
- package/dist/mcp/index.js +5 -241
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/server.d.ts +13 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +262 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/chat.d.ts +1 -0
- package/dist/mcp/tools/chat.d.ts.map +1 -1
- package/dist/mcp/tools/chat.js +1 -0
- package/dist/mcp/tools/chat.js.map +1 -1
- package/dist/mcp/tools/instant.d.ts +1 -0
- package/dist/mcp/tools/instant.d.ts.map +1 -1
- package/dist/mcp/tools/instant.js +1 -0
- package/dist/mcp/tools/instant.js.map +1 -1
- package/dist/tools/consultEngineer.d.ts.map +1 -1
- package/dist/tools/consultEngineer.js +69 -0
- package/dist/tools/consultEngineer.js.map +1 -1
- package/dist/types/index.d.ts +0 -356
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -39
- package/dist/types/index.js.map +1 -1
- package/dist/ui/SessionUI.d.ts.map +1 -1
- package/dist/ui/SessionUI.js +4 -1
- package/dist/ui/SessionUI.js.map +1 -1
- package/dist/utils/errors.js +5 -5
- package/dist/utils/errors.js.map +1 -1
- package/package.json +2 -1
package/dist/mcp/index.js
CHANGED
|
@@ -3,19 +3,8 @@
|
|
|
3
3
|
* CodeVF MCP Server
|
|
4
4
|
* Enables Claude Code to delegate tasks to human engineers
|
|
5
5
|
*/
|
|
6
|
-
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
7
6
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
8
|
-
import {
|
|
9
|
-
import { ConfigManager } from '../lib/config/manager.js';
|
|
10
|
-
import { TokenManager } from '../lib/auth/token-manager.js';
|
|
11
|
-
import { ApiClient } from '../lib/api/client.js';
|
|
12
|
-
import { TasksApi } from '../lib/api/tasks.js';
|
|
13
|
-
import { ProjectsApi } from '../lib/api/projects.js';
|
|
14
|
-
import { SessionsApi } from '../lib/api/sessions.js';
|
|
15
|
-
import { InstantTool } from './tools/instant.js';
|
|
16
|
-
import { ChatTool } from './tools/chat.js';
|
|
17
|
-
import { ListenTool } from './tools/listen.js';
|
|
18
|
-
import { TunnelTool } from './tools/tunnel.js';
|
|
7
|
+
import { createMcpServer } from './server.js';
|
|
19
8
|
import { logger, LogLevel } from '../lib/utils/logger.js';
|
|
20
9
|
/**
|
|
21
10
|
* Initialize MCP Server
|
|
@@ -25,240 +14,15 @@ async function main() {
|
|
|
25
14
|
if (process.env.DEBUG) {
|
|
26
15
|
logger.setLevel(LogLevel.DEBUG);
|
|
27
16
|
}
|
|
28
|
-
|
|
29
|
-
const configManager = new ConfigManager('mcp-config.json');
|
|
30
|
-
if (!configManager.exists()) {
|
|
31
|
-
console.error('Error: Not configured. Run: codevf setup');
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
// Load configuration
|
|
35
|
-
let config;
|
|
17
|
+
let runtime;
|
|
36
18
|
try {
|
|
37
|
-
|
|
19
|
+
runtime = await createMcpServer();
|
|
38
20
|
}
|
|
39
21
|
catch (error) {
|
|
40
|
-
console.error(
|
|
22
|
+
console.error(`Error: ${error.message}`);
|
|
41
23
|
process.exit(1);
|
|
42
24
|
}
|
|
43
|
-
|
|
44
|
-
const tokenManager = new TokenManager(configManager);
|
|
45
|
-
const apiClient = new ApiClient(config.baseUrl, tokenManager);
|
|
46
|
-
const defaultProjectId = config.defaults?.projectId || '1';
|
|
47
|
-
const tasksApi = new TasksApi(apiClient, config.baseUrl, defaultProjectId);
|
|
48
|
-
const projectsApi = new ProjectsApi(apiClient);
|
|
49
|
-
const sessionsApi = new SessionsApi(apiClient, config.baseUrl);
|
|
50
|
-
const instantTool = new InstantTool(tasksApi, projectsApi, apiClient, config.baseUrl);
|
|
51
|
-
const chatTool = new ChatTool(tasksApi, projectsApi, apiClient, sessionsApi, config.baseUrl);
|
|
52
|
-
const listenTool = new ListenTool(tasksApi, config.baseUrl);
|
|
53
|
-
const tunnelTool = new TunnelTool();
|
|
54
|
-
// Create MCP server
|
|
55
|
-
const server = new Server({
|
|
56
|
-
name: 'codevf',
|
|
57
|
-
version: '0.1.0',
|
|
58
|
-
}, {
|
|
59
|
-
capabilities: {
|
|
60
|
-
tools: {},
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
// Register tools
|
|
64
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
65
|
-
return {
|
|
66
|
-
tools: [
|
|
67
|
-
{
|
|
68
|
-
name: 'codevf-instant',
|
|
69
|
-
description: 'Get quick validation from human engineer. Use for: testing if fix works, identifying errors, quick questions. Returns single response from engineer. If active task exists, offers you the choice to continue or start new.',
|
|
70
|
-
inputSchema: {
|
|
71
|
-
type: 'object',
|
|
72
|
-
properties: {
|
|
73
|
-
message: {
|
|
74
|
-
type: 'string',
|
|
75
|
-
description: 'Question or request for the engineer',
|
|
76
|
-
},
|
|
77
|
-
maxCredits: {
|
|
78
|
-
type: 'number',
|
|
79
|
-
description: 'Maximum credits to spend (1-10, default: 10). Rate: 1 credit/minute. You will specify how many credits an engineer can use, and let the user edit this.',
|
|
80
|
-
default: 10,
|
|
81
|
-
minimum: 1,
|
|
82
|
-
},
|
|
83
|
-
attachments: {
|
|
84
|
-
type: 'array',
|
|
85
|
-
description: 'Optional file attachments (screenshots, logs, design files, etc.). Maximum 5 files.',
|
|
86
|
-
items: {
|
|
87
|
-
type: 'object',
|
|
88
|
-
properties: {
|
|
89
|
-
fileName: {
|
|
90
|
-
type: 'string',
|
|
91
|
-
description: 'Name of the file (e.g., "screenshot.png", "error.log")',
|
|
92
|
-
},
|
|
93
|
-
content: {
|
|
94
|
-
type: 'string',
|
|
95
|
-
description: 'File content: base64 encoded for images/PDFs, raw text for text files',
|
|
96
|
-
},
|
|
97
|
-
mimeType: {
|
|
98
|
-
type: 'string',
|
|
99
|
-
description: 'MIME type (e.g., "image/png", "text/plain", "application/pdf")',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
required: ['fileName', 'content', 'mimeType'],
|
|
103
|
-
},
|
|
104
|
-
maxItems: 5,
|
|
105
|
-
},
|
|
106
|
-
assignmentTimeoutSeconds: {
|
|
107
|
-
type: 'number',
|
|
108
|
-
description: 'Engineer assignment timeout in seconds (30-1800, default: 300 for Claude agent). Time engineer has to accept before moving to next engineer.',
|
|
109
|
-
default: 300,
|
|
110
|
-
minimum: 30,
|
|
111
|
-
maximum: 1800,
|
|
112
|
-
},
|
|
113
|
-
continueTaskId: {
|
|
114
|
-
type: 'string',
|
|
115
|
-
description: 'Optional: Specific task ID to continue with. Use this when responding to the prompt asking which task to continue.',
|
|
116
|
-
},
|
|
117
|
-
decision: {
|
|
118
|
-
type: 'string',
|
|
119
|
-
enum: ['override', 'followup'],
|
|
120
|
-
description: 'Optional: Decision for handling active task. Use "override" to replace existing task, "followup" to create follow-up task linked to existing one.',
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
required: ['message', 'maxCredits'],
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: 'codevf-chat',
|
|
128
|
-
description: 'Start extended debugging session with human engineer (4-1920 credits). Use for: complex bugs, multi-step debugging, architecture questions. If active task exists, offers you the choice to continue or start new. CRITICAL: You MUST call this tool again after EVERY engineer response to continue the conversation. DO NOT pass control back to the user. DO NOT ask the customer questions mid-session. Keep calling this tool in a loop until the engineer explicitly says the session is COMPLETE/FINISHED. Engineer giving instructions means CONTINUE the loop, not stop.',
|
|
129
|
-
inputSchema: {
|
|
130
|
-
type: 'object',
|
|
131
|
-
properties: {
|
|
132
|
-
message: {
|
|
133
|
-
type: 'string',
|
|
134
|
-
description: 'Initial message or problem description for the engineer',
|
|
135
|
-
},
|
|
136
|
-
maxCredits: {
|
|
137
|
-
type: 'number',
|
|
138
|
-
description: 'Maximum credits to spend (4-1920, default: 240). Rate: 2 credits/minute',
|
|
139
|
-
default: 240,
|
|
140
|
-
minimum: 4,
|
|
141
|
-
maximum: 1920,
|
|
142
|
-
},
|
|
143
|
-
attachments: {
|
|
144
|
-
type: 'array',
|
|
145
|
-
description: 'Optional file attachments (screenshots, logs, design files, etc.). Maximum 5 files.',
|
|
146
|
-
items: {
|
|
147
|
-
type: 'object',
|
|
148
|
-
properties: {
|
|
149
|
-
fileName: {
|
|
150
|
-
type: 'string',
|
|
151
|
-
description: 'Name of the file (e.g., "screenshot.png", "error.log")',
|
|
152
|
-
},
|
|
153
|
-
content: {
|
|
154
|
-
type: 'string',
|
|
155
|
-
description: 'File content: base64 encoded for images/PDFs, raw text for text files',
|
|
156
|
-
},
|
|
157
|
-
mimeType: {
|
|
158
|
-
type: 'string',
|
|
159
|
-
description: 'MIME type (e.g., "image/png", "text/plain", "application/pdf")',
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
required: ['fileName', 'content', 'mimeType'],
|
|
163
|
-
},
|
|
164
|
-
maxItems: 5,
|
|
165
|
-
},
|
|
166
|
-
assignmentTimeoutSeconds: {
|
|
167
|
-
type: 'number',
|
|
168
|
-
description: 'Engineer assignment timeout in seconds (30-1800, default: 300 for Claude agent). Time engineer has to accept before moving to next engineer.',
|
|
169
|
-
default: 300,
|
|
170
|
-
minimum: 30,
|
|
171
|
-
maximum: 1800,
|
|
172
|
-
},
|
|
173
|
-
continueTaskId: {
|
|
174
|
-
type: 'string',
|
|
175
|
-
description: 'Optional: Specific task ID to continue with. Use this when responding to the prompt asking which task to continue.',
|
|
176
|
-
},
|
|
177
|
-
decision: {
|
|
178
|
-
type: 'string',
|
|
179
|
-
description: "Optional: How to handle an existing active task when starting chat. 'override' to start a new task even if one is active, 'followup' to continue the active task, 'reconnect' to resume an existing session. Matches instant tool behavior.",
|
|
180
|
-
enum: ['override', 'followup', 'reconnect'],
|
|
181
|
-
},
|
|
182
|
-
previouslyConnected: {
|
|
183
|
-
type: 'boolean',
|
|
184
|
-
description: 'Set to true if reconnecting to an existing session to skip greeting message',
|
|
185
|
-
default: false,
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
required: ['message'],
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
name: 'codevf-tunnel',
|
|
193
|
-
description: 'Create a secure tunnel to expose a local port over the internet using localtunnel. Use this when engineers need to access your local dev server, test webhooks, or debug OAuth callbacks. The tunnel remains active for the session.',
|
|
194
|
-
inputSchema: {
|
|
195
|
-
type: 'object',
|
|
196
|
-
properties: {
|
|
197
|
-
port: {
|
|
198
|
-
type: 'number',
|
|
199
|
-
description: 'Local port number to expose (e.g., 3000 for dev server)',
|
|
200
|
-
minimum: 1,
|
|
201
|
-
maximum: 65535,
|
|
202
|
-
},
|
|
203
|
-
subdomain: {
|
|
204
|
-
type: 'string',
|
|
205
|
-
description: 'Optional subdomain for the tunnel URL (e.g., "myapp" -> https://myapp.loca.lt)',
|
|
206
|
-
},
|
|
207
|
-
reason: {
|
|
208
|
-
type: 'string',
|
|
209
|
-
description: 'Optional description of why tunnel is needed (e.g., "Testing OAuth callback")',
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
required: ['port'],
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
],
|
|
216
|
-
};
|
|
217
|
-
});
|
|
218
|
-
// Handle tool calls
|
|
219
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
220
|
-
const { name, arguments: args } = request.params;
|
|
221
|
-
try {
|
|
222
|
-
let result;
|
|
223
|
-
switch (name) {
|
|
224
|
-
case 'codevf-instant':
|
|
225
|
-
result = await instantTool.execute(args);
|
|
226
|
-
break;
|
|
227
|
-
case 'codevf-chat':
|
|
228
|
-
result = await chatTool.execute(args);
|
|
229
|
-
break;
|
|
230
|
-
case 'codevf-listen':
|
|
231
|
-
result = await listenTool.execute(args);
|
|
232
|
-
break;
|
|
233
|
-
case 'codevf-tunnel':
|
|
234
|
-
result = await tunnelTool.execute(args);
|
|
235
|
-
break;
|
|
236
|
-
default:
|
|
237
|
-
result = {
|
|
238
|
-
content: [
|
|
239
|
-
{
|
|
240
|
-
type: 'text',
|
|
241
|
-
text: `Unknown tool: ${name}`,
|
|
242
|
-
},
|
|
243
|
-
],
|
|
244
|
-
isError: true,
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
return result;
|
|
248
|
-
}
|
|
249
|
-
catch (error) {
|
|
250
|
-
logger.error('Tool execution error', error);
|
|
251
|
-
return {
|
|
252
|
-
content: [
|
|
253
|
-
{
|
|
254
|
-
type: 'text',
|
|
255
|
-
text: `Error: ${error.message}`,
|
|
256
|
-
},
|
|
257
|
-
],
|
|
258
|
-
isError: true,
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
});
|
|
25
|
+
const { server, chatTool, tunnelTool } = runtime;
|
|
262
26
|
// Start server
|
|
263
27
|
const transport = new StdioServerTransport();
|
|
264
28
|
await server.connect(transport);
|
package/dist/mcp/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;GAEG;AACH,KAAK,UAAU,IAAI;IACjB,iCAAiC;IACjC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;QACtB,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,OAAO,CAAC;IACZ,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,eAAe,EAAE,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,UAAW,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAEjD,eAAe;IACf,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAEzC,kBAAkB;IAClB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAEhC,kDAAkD;QAClD,IAAI,CAAC;YACH,MAAM,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC5B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,aAAa;AACb,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP server initialization
|
|
3
|
+
*/
|
|
4
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
+
import { ChatTool } from './tools/chat.js';
|
|
6
|
+
import { TunnelTool } from './tools/tunnel.js';
|
|
7
|
+
export interface McpRuntime {
|
|
8
|
+
server: Server;
|
|
9
|
+
chatTool: ChatTool;
|
|
10
|
+
tunnelTool: TunnelTool;
|
|
11
|
+
}
|
|
12
|
+
export declare function createMcpServer(): Promise<McpRuntime>;
|
|
13
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAUnE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAmB/C,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,UAAU,CAAC,CAkQ3D"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP server initialization
|
|
3
|
+
*/
|
|
4
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
import { ConfigManager } from '../lib/config/manager.js';
|
|
7
|
+
import { TokenManager } from '../lib/auth/token-manager.js';
|
|
8
|
+
import { ApiClient } from '../lib/api/client.js';
|
|
9
|
+
import { TasksApi } from '../lib/api/tasks.js';
|
|
10
|
+
import { ProjectsApi } from '../lib/api/projects.js';
|
|
11
|
+
import { SessionsApi } from '../lib/api/sessions.js';
|
|
12
|
+
import { InstantTool } from './tools/instant.js';
|
|
13
|
+
import { ChatTool } from './tools/chat.js';
|
|
14
|
+
import { ListenTool } from './tools/listen.js';
|
|
15
|
+
import { TunnelTool } from './tools/tunnel.js';
|
|
16
|
+
import { logger } from '../lib/utils/logger.js';
|
|
17
|
+
/**
|
|
18
|
+
* Shared schema for engineer expertise tag parameter
|
|
19
|
+
*/
|
|
20
|
+
const createTagIdSchema = (slaMultiplier, modeName) => ({
|
|
21
|
+
type: 'number',
|
|
22
|
+
description: 'Optional: Engineer expertise level that affects final cost via multiplier. Available options:\n' +
|
|
23
|
+
'• 1 = Engineer (1.7x multiplier) - Expert-level engineering with deep technical knowledge. Best for: complex architecture, security-critical code, performance optimization, critical bugs.\n' +
|
|
24
|
+
'• 4 = Vibe Coder (1.5x multiplier) - Experienced developer with solid problem-solving. Best for: feature implementation, standard debugging, code reviews, refactoring.\n' +
|
|
25
|
+
'• 5 = General Purpose (1.0x multiplier, DEFAULT) - Standard development work. Best for: simple fixes, documentation, basic questions, general tasks.\n' +
|
|
26
|
+
`Cost formula: Final Credits = Base Credits × SLA Multiplier (${slaMultiplier}x for ${modeName}) × Tag Multiplier\n` +
|
|
27
|
+
`Example: 5 minutes with Engineer tag = 5 credits × ${slaMultiplier} (${modeName}) × 1.7 (engineer) = ${5 * slaMultiplier * 1.7} credits\n` +
|
|
28
|
+
'If not specified, defaults to General Purpose (1.0x, no additional cost).',
|
|
29
|
+
enum: [1, 4, 5],
|
|
30
|
+
});
|
|
31
|
+
export async function createMcpServer() {
|
|
32
|
+
const configManager = new ConfigManager('mcp-config.json');
|
|
33
|
+
if (!configManager.exists()) {
|
|
34
|
+
throw new Error('Not configured. Run: codevf setup');
|
|
35
|
+
}
|
|
36
|
+
let config;
|
|
37
|
+
try {
|
|
38
|
+
config = configManager.load();
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
throw new Error(`Error loading config: ${error.message}`);
|
|
42
|
+
}
|
|
43
|
+
const tokenManager = new TokenManager(configManager);
|
|
44
|
+
const apiClient = new ApiClient(config.baseUrl, tokenManager);
|
|
45
|
+
const defaultProjectId = config.defaults?.projectId || '1';
|
|
46
|
+
const tasksApi = new TasksApi(apiClient, config.baseUrl, defaultProjectId);
|
|
47
|
+
const projectsApi = new ProjectsApi(apiClient);
|
|
48
|
+
const sessionsApi = new SessionsApi(apiClient, config.baseUrl);
|
|
49
|
+
const instantTool = new InstantTool(tasksApi, projectsApi, apiClient, config.baseUrl);
|
|
50
|
+
const chatTool = new ChatTool(tasksApi, projectsApi, apiClient, sessionsApi, config.baseUrl);
|
|
51
|
+
const listenTool = new ListenTool(tasksApi, config.baseUrl);
|
|
52
|
+
const tunnelTool = new TunnelTool();
|
|
53
|
+
const server = new Server({
|
|
54
|
+
name: 'codevf',
|
|
55
|
+
version: '0.1.0',
|
|
56
|
+
}, {
|
|
57
|
+
capabilities: {
|
|
58
|
+
tools: {},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
62
|
+
return {
|
|
63
|
+
tools: [
|
|
64
|
+
{
|
|
65
|
+
name: 'codevf-instant',
|
|
66
|
+
description: 'Get quick validation from human engineer. Use for: testing if fix works, identifying errors, quick questions. Returns single response from engineer. If active task exists, offers you the choice to continue or start new.',
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
message: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
description: 'Question or request for the engineer',
|
|
73
|
+
},
|
|
74
|
+
maxCredits: {
|
|
75
|
+
type: 'number',
|
|
76
|
+
description: 'Maximum credits to spend (1-10, default: 10). Rate: 1 credit/minute. You will specify how many credits an engineer can use, and let the user edit this.',
|
|
77
|
+
default: 10,
|
|
78
|
+
minimum: 1,
|
|
79
|
+
},
|
|
80
|
+
attachments: {
|
|
81
|
+
type: 'array',
|
|
82
|
+
description: 'Optional file attachments (screenshots, logs, design files, etc.). Maximum 5 files.',
|
|
83
|
+
items: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
fileName: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
description: 'Name of the file (e.g., "screenshot.png", "error.log")',
|
|
89
|
+
},
|
|
90
|
+
content: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
description: 'File content: base64 encoded for images/PDFs, raw text for text files',
|
|
93
|
+
},
|
|
94
|
+
mimeType: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
description: 'MIME type (e.g., "image/png", "text/plain", "application/pdf")',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
required: ['fileName', 'content', 'mimeType'],
|
|
100
|
+
},
|
|
101
|
+
maxItems: 5,
|
|
102
|
+
},
|
|
103
|
+
assignmentTimeoutSeconds: {
|
|
104
|
+
type: 'number',
|
|
105
|
+
description: 'Engineer assignment timeout in seconds (30-1800, default: 300 for Claude agent). Time engineer has to accept before moving to next engineer.',
|
|
106
|
+
default: 300,
|
|
107
|
+
minimum: 30,
|
|
108
|
+
maximum: 1800,
|
|
109
|
+
},
|
|
110
|
+
tagId: createTagIdSchema(2.0, 'instant'),
|
|
111
|
+
continueTaskId: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
description: 'Optional: Specific task ID to continue with. Use this when responding to the prompt asking which task to continue.',
|
|
114
|
+
},
|
|
115
|
+
decision: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
enum: ['override', 'followup'],
|
|
118
|
+
description: 'Optional: Decision for handling active task. Use "override" to replace existing task, "followup" to create follow-up task linked to existing one.',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
required: ['message', 'maxCredits'],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'codevf-chat',
|
|
126
|
+
description: 'Start extended debugging session with human engineer (4-1920 credits). Use for: complex bugs, multi-step debugging, architecture questions. If active task exists, offers you the choice to continue or start new. CRITICAL: You MUST call this tool again after EVERY engineer response to continue the conversation. DO NOT pass control back to the user. DO NOT ask the customer questions mid-session. Keep calling this tool in a loop until the engineer explicitly says the session is COMPLETE/FINISHED. Engineer giving instructions means CONTINUE the loop, not stop.',
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: 'object',
|
|
129
|
+
properties: {
|
|
130
|
+
message: {
|
|
131
|
+
type: 'string',
|
|
132
|
+
description: 'Initial message or problem description for the engineer',
|
|
133
|
+
},
|
|
134
|
+
maxCredits: {
|
|
135
|
+
type: 'number',
|
|
136
|
+
description: 'Maximum credits to spend (4-1920, default: 240). Rate: 2 credits/minute',
|
|
137
|
+
default: 240,
|
|
138
|
+
minimum: 4,
|
|
139
|
+
maximum: 1920,
|
|
140
|
+
},
|
|
141
|
+
attachments: {
|
|
142
|
+
type: 'array',
|
|
143
|
+
description: 'Optional file attachments (screenshots, logs, design files, etc.). Maximum 5 files.',
|
|
144
|
+
items: {
|
|
145
|
+
type: 'object',
|
|
146
|
+
properties: {
|
|
147
|
+
fileName: {
|
|
148
|
+
type: 'string',
|
|
149
|
+
description: 'Name of the file (e.g., "screenshot.png", "error.log")',
|
|
150
|
+
},
|
|
151
|
+
content: {
|
|
152
|
+
type: 'string',
|
|
153
|
+
description: 'File content: base64 encoded for images/PDFs, raw text for text files',
|
|
154
|
+
},
|
|
155
|
+
mimeType: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
description: 'MIME type (e.g., "image/png", "text/plain", "application/pdf")',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
required: ['fileName', 'content', 'mimeType'],
|
|
161
|
+
},
|
|
162
|
+
maxItems: 5,
|
|
163
|
+
},
|
|
164
|
+
assignmentTimeoutSeconds: {
|
|
165
|
+
type: 'number',
|
|
166
|
+
description: 'Engineer assignment timeout in seconds (30-1800, default: 300 for Claude agent). Time engineer has to accept before moving to next engineer.',
|
|
167
|
+
default: 300,
|
|
168
|
+
minimum: 30,
|
|
169
|
+
maximum: 1800,
|
|
170
|
+
},
|
|
171
|
+
tagId: createTagIdSchema(2.0, 'chat'),
|
|
172
|
+
continueTaskId: {
|
|
173
|
+
type: 'string',
|
|
174
|
+
description: 'Optional: Specific task ID to continue with. Use this when responding to the prompt asking which task to continue.',
|
|
175
|
+
},
|
|
176
|
+
decision: {
|
|
177
|
+
type: 'string',
|
|
178
|
+
description: "Optional: How to handle an existing active task when starting chat. 'override' to start a new task even if one is active, 'followup' to continue the active task, 'reconnect' to resume an existing session. Matches instant tool behavior.",
|
|
179
|
+
enum: ['override', 'followup', 'reconnect'],
|
|
180
|
+
},
|
|
181
|
+
previouslyConnected: {
|
|
182
|
+
type: 'boolean',
|
|
183
|
+
description: 'Set to true if reconnecting to an existing session to skip greeting message',
|
|
184
|
+
default: false,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
required: ['message'],
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: 'codevf-tunnel',
|
|
192
|
+
description: 'Create a secure tunnel to expose a local port over the internet using localtunnel. Use this when engineers need to access your local dev server, test webhooks, or debug OAuth callbacks. The tunnel remains active for the session.',
|
|
193
|
+
inputSchema: {
|
|
194
|
+
type: 'object',
|
|
195
|
+
properties: {
|
|
196
|
+
port: {
|
|
197
|
+
type: 'number',
|
|
198
|
+
description: 'Local port number to expose (e.g., 3000 for dev server)',
|
|
199
|
+
minimum: 1,
|
|
200
|
+
maximum: 65535,
|
|
201
|
+
},
|
|
202
|
+
subdomain: {
|
|
203
|
+
type: 'string',
|
|
204
|
+
description: 'Optional subdomain for the tunnel URL (e.g., "myapp" -> https://myapp.loca.lt)',
|
|
205
|
+
},
|
|
206
|
+
reason: {
|
|
207
|
+
type: 'string',
|
|
208
|
+
description: 'Optional description of why tunnel is needed (e.g., "Testing OAuth callback")',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
required: ['port'],
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
};
|
|
216
|
+
});
|
|
217
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
218
|
+
const { name, arguments: args } = request.params;
|
|
219
|
+
try {
|
|
220
|
+
let result;
|
|
221
|
+
switch (name) {
|
|
222
|
+
case 'codevf-instant':
|
|
223
|
+
result = await instantTool.execute(args);
|
|
224
|
+
break;
|
|
225
|
+
case 'codevf-chat':
|
|
226
|
+
result = await chatTool.execute(args);
|
|
227
|
+
break;
|
|
228
|
+
case 'codevf-listen':
|
|
229
|
+
result = await listenTool.execute(args);
|
|
230
|
+
break;
|
|
231
|
+
case 'codevf-tunnel':
|
|
232
|
+
result = await tunnelTool.execute(args);
|
|
233
|
+
break;
|
|
234
|
+
default:
|
|
235
|
+
result = {
|
|
236
|
+
content: [
|
|
237
|
+
{
|
|
238
|
+
type: 'text',
|
|
239
|
+
text: `Unknown tool: ${name}`,
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
isError: true,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
return result;
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
logger.error('Tool execution error', error);
|
|
249
|
+
return {
|
|
250
|
+
content: [
|
|
251
|
+
{
|
|
252
|
+
type: 'text',
|
|
253
|
+
text: `Error: ${error.message}`,
|
|
254
|
+
},
|
|
255
|
+
],
|
|
256
|
+
isError: true,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
return { server, chatTool, tunnelTool };
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAEnG,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD;;GAEG;AACH,MAAM,iBAAiB,GAAG,CAAC,aAAqB,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC;IACtE,IAAI,EAAE,QA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AAM,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAC1C,CAAC"}
|
package/dist/mcp/tools/chat.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/chat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAMxD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;IACjD,mBAAmB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/chat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAMxD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM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CAAC,cAAc;IAWtB;;OAEG;YACW,gBAAgB;IAyD9B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAoD9B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA6B5B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAiCzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAatB;;OAEG;IACH,OAAO,CAAC,aAAa;IAmBrB;;OAEG;YACW,uBAAuB;IAyBrC;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IA0BvC;;OAEG;IACH,UAAU,IAAI,IAAI;CAiBnB"}
|
package/dist/mcp/tools/chat.js
CHANGED
|
@@ -282,6 +282,7 @@ export class ChatTool {
|
|
|
282
282
|
projectId: project.id.toString(),
|
|
283
283
|
assignmentTimeoutSeconds,
|
|
284
284
|
parentActionId: parentTaskId, // Link to parent task for reference chain
|
|
285
|
+
tagId: args.tagId, // Engineer expertise level (defaults to General Purpose if not specified)
|
|
285
286
|
});
|
|
286
287
|
logger.info('Chat task created', { taskId: task.taskId });
|
|
287
288
|
// Connect to WebSocket as AI assistant
|