@vibescope/mcp-server 0.0.1 → 0.2.0
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 +113 -98
- package/dist/api-client.d.ts +1169 -0
- package/dist/api-client.js +713 -0
- package/dist/cli.d.ts +1 -6
- package/dist/cli.js +39 -240
- package/dist/config/tool-categories.d.ts +31 -0
- package/dist/config/tool-categories.js +253 -0
- package/dist/handlers/blockers.js +57 -58
- package/dist/handlers/bodies-of-work.d.ts +2 -0
- package/dist/handlers/bodies-of-work.js +108 -477
- package/dist/handlers/cost.d.ts +1 -0
- package/dist/handlers/cost.js +35 -113
- package/dist/handlers/decisions.d.ts +2 -0
- package/dist/handlers/decisions.js +28 -27
- package/dist/handlers/deployment.js +113 -828
- package/dist/handlers/discovery.d.ts +3 -0
- package/dist/handlers/discovery.js +26 -627
- package/dist/handlers/fallback.d.ts +2 -0
- package/dist/handlers/fallback.js +56 -142
- package/dist/handlers/findings.d.ts +8 -1
- package/dist/handlers/findings.js +65 -68
- package/dist/handlers/git-issues.d.ts +9 -13
- package/dist/handlers/git-issues.js +80 -225
- package/dist/handlers/ideas.d.ts +3 -0
- package/dist/handlers/ideas.js +53 -134
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/index.js +6 -0
- package/dist/handlers/milestones.d.ts +2 -0
- package/dist/handlers/milestones.js +51 -98
- package/dist/handlers/organizations.js +79 -275
- package/dist/handlers/progress.d.ts +2 -0
- package/dist/handlers/progress.js +25 -123
- package/dist/handlers/project.js +42 -221
- package/dist/handlers/requests.d.ts +2 -0
- package/dist/handlers/requests.js +23 -83
- package/dist/handlers/session.js +119 -590
- package/dist/handlers/sprints.d.ts +32 -0
- package/dist/handlers/sprints.js +275 -0
- package/dist/handlers/tasks.d.ts +7 -10
- package/dist/handlers/tasks.js +245 -894
- package/dist/handlers/tool-docs.d.ts +9 -0
- package/dist/handlers/tool-docs.js +904 -0
- package/dist/handlers/types.d.ts +11 -3
- package/dist/handlers/validation.d.ts +1 -1
- package/dist/handlers/validation.js +38 -153
- package/dist/index.js +493 -162
- package/dist/knowledge.js +106 -9
- package/dist/tools.js +34 -4
- package/dist/validators.d.ts +21 -0
- package/dist/validators.js +91 -0
- package/package.json +2 -3
- package/src/api-client.ts +1822 -0
- package/src/cli.test.ts +128 -302
- package/src/cli.ts +41 -285
- package/src/handlers/__test-setup__.ts +215 -0
- package/src/handlers/__test-utils__.ts +4 -134
- package/src/handlers/blockers.test.ts +114 -124
- package/src/handlers/blockers.ts +68 -70
- package/src/handlers/bodies-of-work.test.ts +236 -831
- package/src/handlers/bodies-of-work.ts +210 -525
- package/src/handlers/cost.test.ts +149 -113
- package/src/handlers/cost.ts +44 -132
- package/src/handlers/decisions.test.ts +111 -209
- package/src/handlers/decisions.ts +35 -27
- package/src/handlers/deployment.test.ts +193 -239
- package/src/handlers/deployment.ts +143 -896
- package/src/handlers/discovery.test.ts +20 -67
- package/src/handlers/discovery.ts +29 -714
- package/src/handlers/fallback.test.ts +206 -361
- package/src/handlers/fallback.ts +81 -156
- package/src/handlers/findings.test.ts +229 -320
- package/src/handlers/findings.ts +76 -64
- package/src/handlers/git-issues.test.ts +623 -0
- package/src/handlers/git-issues.ts +174 -0
- package/src/handlers/ideas.test.ts +229 -343
- package/src/handlers/ideas.ts +69 -143
- package/src/handlers/index.ts +6 -0
- package/src/handlers/milestones.test.ts +167 -281
- package/src/handlers/milestones.ts +54 -93
- package/src/handlers/organizations.test.ts +275 -467
- package/src/handlers/organizations.ts +84 -294
- package/src/handlers/progress.test.ts +112 -218
- package/src/handlers/progress.ts +29 -142
- package/src/handlers/project.test.ts +203 -226
- package/src/handlers/project.ts +48 -238
- package/src/handlers/requests.test.ts +74 -342
- package/src/handlers/requests.ts +25 -83
- package/src/handlers/session.test.ts +276 -206
- package/src/handlers/session.ts +136 -662
- package/src/handlers/sprints.test.ts +711 -0
- package/src/handlers/sprints.ts +510 -0
- package/src/handlers/tasks.test.ts +669 -353
- package/src/handlers/tasks.ts +263 -1015
- package/src/handlers/tool-docs.ts +1024 -0
- package/src/handlers/types.ts +12 -4
- package/src/handlers/validation.test.ts +237 -568
- package/src/handlers/validation.ts +43 -167
- package/src/index.ts +493 -186
- package/src/tools.ts +2532 -0
- package/src/validators.test.ts +223 -223
- package/src/validators.ts +127 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +14 -13
- package/dist/cli.test.d.ts +0 -1
- package/dist/cli.test.js +0 -367
- package/dist/handlers/__test-utils__.d.ts +0 -72
- package/dist/handlers/__test-utils__.js +0 -176
- package/dist/handlers/checkouts.d.ts +0 -37
- package/dist/handlers/checkouts.js +0 -377
- package/dist/handlers/knowledge-query.d.ts +0 -22
- package/dist/handlers/knowledge-query.js +0 -253
- package/dist/handlers/knowledge.d.ts +0 -12
- package/dist/handlers/knowledge.js +0 -108
- package/dist/handlers/roles.d.ts +0 -30
- package/dist/handlers/roles.js +0 -281
- package/dist/handlers/tasks.test.d.ts +0 -1
- package/dist/handlers/tasks.test.js +0 -431
- package/dist/utils.test.d.ts +0 -1
- package/dist/utils.test.js +0 -532
- package/dist/validators.test.d.ts +0 -1
- package/dist/validators.test.js +0 -176
- package/src/knowledge.ts +0 -132
- package/src/tmpclaude-0078-cwd +0 -1
- package/src/tmpclaude-0ee1-cwd +0 -1
- package/src/tmpclaude-2dd5-cwd +0 -1
- package/src/tmpclaude-344c-cwd +0 -1
- package/src/tmpclaude-3860-cwd +0 -1
- package/src/tmpclaude-4b63-cwd +0 -1
- package/src/tmpclaude-5c73-cwd +0 -1
- package/src/tmpclaude-5ee3-cwd +0 -1
- package/src/tmpclaude-6795-cwd +0 -1
- package/src/tmpclaude-709e-cwd +0 -1
- package/src/tmpclaude-9839-cwd +0 -1
- package/src/tmpclaude-d829-cwd +0 -1
- package/src/tmpclaude-e072-cwd +0 -1
- package/src/tmpclaude-f6ee-cwd +0 -1
- package/tmpclaude-0439-cwd +0 -1
- package/tmpclaude-132f-cwd +0 -1
- package/tmpclaude-15bb-cwd +0 -1
- package/tmpclaude-165a-cwd +0 -1
- package/tmpclaude-1ba9-cwd +0 -1
- package/tmpclaude-21a3-cwd +0 -1
- package/tmpclaude-2a38-cwd +0 -1
- package/tmpclaude-2adf-cwd +0 -1
- package/tmpclaude-2f56-cwd +0 -1
- package/tmpclaude-3626-cwd +0 -1
- package/tmpclaude-3727-cwd +0 -1
- package/tmpclaude-40bc-cwd +0 -1
- package/tmpclaude-436f-cwd +0 -1
- package/tmpclaude-4783-cwd +0 -1
- package/tmpclaude-4b6d-cwd +0 -1
- package/tmpclaude-4ba4-cwd +0 -1
- package/tmpclaude-51e6-cwd +0 -1
- package/tmpclaude-5ecf-cwd +0 -1
- package/tmpclaude-6f97-cwd +0 -1
- package/tmpclaude-7fb2-cwd +0 -1
- package/tmpclaude-825c-cwd +0 -1
- package/tmpclaude-8baf-cwd +0 -1
- package/tmpclaude-8d9f-cwd +0 -1
- package/tmpclaude-975c-cwd +0 -1
- package/tmpclaude-9983-cwd +0 -1
- package/tmpclaude-a045-cwd +0 -1
- package/tmpclaude-ac4a-cwd +0 -1
- package/tmpclaude-b593-cwd +0 -1
- package/tmpclaude-b891-cwd +0 -1
- package/tmpclaude-c032-cwd +0 -1
- package/tmpclaude-cf43-cwd +0 -1
- package/tmpclaude-d040-cwd +0 -1
- package/tmpclaude-dcdd-cwd +0 -1
- package/tmpclaude-dcee-cwd +0 -1
- package/tmpclaude-e16b-cwd +0 -1
- package/tmpclaude-ecd2-cwd +0 -1
- package/tmpclaude-f48d-cwd +0 -1
package/src/handlers/ideas.ts
CHANGED
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
* - update_idea
|
|
7
7
|
* - get_ideas
|
|
8
8
|
* - delete_idea
|
|
9
|
+
* - convert_idea_to_task
|
|
10
|
+
*
|
|
11
|
+
* MIGRATED: Uses Vibescope API client instead of direct Supabase
|
|
9
12
|
*/
|
|
10
13
|
|
|
11
14
|
import type { Handler, HandlerRegistry } from './types.js';
|
|
12
15
|
import { validateRequired, validateUUID, validatePriority, validateEstimatedMinutes } from '../validators.js';
|
|
16
|
+
import { getApiClient } from '../api-client.js';
|
|
13
17
|
|
|
14
18
|
type IdeaStatus = 'raw' | 'exploring' | 'planned' | 'in_development' | 'shipped';
|
|
15
19
|
|
|
@@ -25,24 +29,20 @@ export const addIdea: Handler = async (args, ctx) => {
|
|
|
25
29
|
validateUUID(project_id, 'project_id');
|
|
26
30
|
validateRequired(title, 'title');
|
|
27
31
|
|
|
28
|
-
const {
|
|
32
|
+
const { session } = ctx;
|
|
33
|
+
const apiClient = getApiClient();
|
|
29
34
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
description: description || null,
|
|
36
|
-
status: status || 'raw',
|
|
37
|
-
created_by: 'agent',
|
|
38
|
-
created_by_session_id: session.currentSessionId,
|
|
39
|
-
})
|
|
40
|
-
.select('id')
|
|
41
|
-
.single();
|
|
35
|
+
const response = await apiClient.addIdea(project_id, {
|
|
36
|
+
title,
|
|
37
|
+
description,
|
|
38
|
+
status
|
|
39
|
+
}, session.currentSessionId || undefined);
|
|
42
40
|
|
|
43
|
-
if (
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
throw new Error(`Failed to add idea: ${response.error}`);
|
|
43
|
+
}
|
|
44
44
|
|
|
45
|
-
return { result: { success: true, idea_id: data
|
|
45
|
+
return { result: { success: true, idea_id: response.data?.idea_id, title } };
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export const updateIdea: Handler = async (args, ctx) => {
|
|
@@ -57,67 +57,52 @@ export const updateIdea: Handler = async (args, ctx) => {
|
|
|
57
57
|
validateRequired(idea_id, 'idea_id');
|
|
58
58
|
validateUUID(idea_id, 'idea_id');
|
|
59
59
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
// Get current idea status
|
|
63
|
-
const { data: existingIdea } = await supabase
|
|
64
|
-
.from('ideas')
|
|
65
|
-
.select('status')
|
|
66
|
-
.eq('id', idea_id)
|
|
67
|
-
.single();
|
|
60
|
+
const apiClient = getApiClient();
|
|
68
61
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
const response = await apiClient.updateIdea(idea_id, {
|
|
63
|
+
title,
|
|
64
|
+
description,
|
|
65
|
+
status,
|
|
66
|
+
doc_url
|
|
67
|
+
});
|
|
72
68
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (title !== undefined) updates.title = title;
|
|
76
|
-
if (description !== undefined) updates.description = description;
|
|
77
|
-
if (doc_url !== undefined) updates.doc_url = doc_url;
|
|
78
|
-
if (status !== undefined) {
|
|
79
|
-
updates.status = status;
|
|
80
|
-
// Set planned_at when transitioning to planned status
|
|
81
|
-
if (status === 'planned' && existingIdea.status !== 'planned') {
|
|
82
|
-
updates.planned_at = new Date().toISOString();
|
|
83
|
-
}
|
|
69
|
+
if (!response.ok) {
|
|
70
|
+
throw new Error(`Failed to update idea: ${response.error}`);
|
|
84
71
|
}
|
|
85
72
|
|
|
86
|
-
const { error } = await supabase
|
|
87
|
-
.from('ideas')
|
|
88
|
-
.update(updates)
|
|
89
|
-
.eq('id', idea_id);
|
|
90
|
-
|
|
91
|
-
if (error) throw new Error(`Failed to update idea: ${error.message}`);
|
|
92
|
-
|
|
93
73
|
return { result: { success: true, idea_id } };
|
|
94
74
|
};
|
|
95
75
|
|
|
96
76
|
export const getIdeas: Handler = async (args, ctx) => {
|
|
97
|
-
const { project_id, status } = args as {
|
|
77
|
+
const { project_id, status, limit = 50, offset = 0, search_query } = args as {
|
|
98
78
|
project_id: string;
|
|
99
79
|
status?: IdeaStatus;
|
|
80
|
+
limit?: number;
|
|
81
|
+
offset?: number;
|
|
82
|
+
search_query?: string;
|
|
100
83
|
};
|
|
101
84
|
|
|
102
85
|
validateRequired(project_id, 'project_id');
|
|
103
86
|
validateUUID(project_id, 'project_id');
|
|
104
87
|
|
|
105
|
-
const
|
|
88
|
+
const apiClient = getApiClient();
|
|
106
89
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
90
|
+
const response = await apiClient.getIdeas(project_id, {
|
|
91
|
+
status,
|
|
92
|
+
limit,
|
|
93
|
+
offset,
|
|
94
|
+
search_query
|
|
95
|
+
});
|
|
111
96
|
|
|
112
|
-
if (
|
|
113
|
-
|
|
97
|
+
if (!response.ok) {
|
|
98
|
+
throw new Error(`Failed to fetch ideas: ${response.error}`);
|
|
114
99
|
}
|
|
115
100
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
101
|
+
return {
|
|
102
|
+
result: {
|
|
103
|
+
ideas: response.data?.ideas || [],
|
|
104
|
+
},
|
|
105
|
+
};
|
|
121
106
|
};
|
|
122
107
|
|
|
123
108
|
export const deleteIdea: Handler = async (args, ctx) => {
|
|
@@ -126,12 +111,13 @@ export const deleteIdea: Handler = async (args, ctx) => {
|
|
|
126
111
|
validateRequired(idea_id, 'idea_id');
|
|
127
112
|
validateUUID(idea_id, 'idea_id');
|
|
128
113
|
|
|
129
|
-
const
|
|
130
|
-
.from('ideas')
|
|
131
|
-
.delete()
|
|
132
|
-
.eq('id', idea_id);
|
|
114
|
+
const apiClient = getApiClient();
|
|
133
115
|
|
|
134
|
-
|
|
116
|
+
const response = await apiClient.deleteIdea(idea_id);
|
|
117
|
+
|
|
118
|
+
if (!response.ok) {
|
|
119
|
+
throw new Error(`Failed to delete idea: ${response.error}`);
|
|
120
|
+
}
|
|
135
121
|
|
|
136
122
|
return { result: { success: true } };
|
|
137
123
|
};
|
|
@@ -149,90 +135,30 @@ export const convertIdeaToTask: Handler = async (args, ctx) => {
|
|
|
149
135
|
validatePriority(priority);
|
|
150
136
|
validateEstimatedMinutes(estimated_minutes);
|
|
151
137
|
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
success: false,
|
|
171
|
-
error: 'Idea has already been converted to a task',
|
|
172
|
-
existing_task_id: idea.converted_to_task_id,
|
|
173
|
-
hint: 'Use get_tasks to find the existing task',
|
|
174
|
-
},
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// Create the task
|
|
179
|
-
const { data: task, error: taskError } = await supabase
|
|
180
|
-
.from('tasks')
|
|
181
|
-
.insert({
|
|
182
|
-
project_id: idea.project_id,
|
|
183
|
-
title: idea.title,
|
|
184
|
-
description: idea.description || `Converted from idea: ${idea.title}`,
|
|
185
|
-
priority,
|
|
186
|
-
estimated_minutes: estimated_minutes || null,
|
|
187
|
-
created_by: 'agent',
|
|
188
|
-
created_by_session_id: currentSessionId,
|
|
189
|
-
})
|
|
190
|
-
.select('id, title')
|
|
191
|
-
.single();
|
|
192
|
-
|
|
193
|
-
if (taskError || !task) {
|
|
194
|
-
throw new Error(`Failed to create task: ${taskError?.message}`);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Update the idea with the task reference and optionally update status
|
|
198
|
-
const ideaUpdates: Record<string, unknown> = {
|
|
199
|
-
converted_to_task_id: task.id,
|
|
200
|
-
updated_at: new Date().toISOString(),
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
if (update_status && idea.status !== 'shipped') {
|
|
204
|
-
ideaUpdates.status = 'in_development';
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const { error: updateError } = await supabase
|
|
208
|
-
.from('ideas')
|
|
209
|
-
.update(ideaUpdates)
|
|
210
|
-
.eq('id', idea_id);
|
|
138
|
+
const apiClient = getApiClient();
|
|
139
|
+
|
|
140
|
+
// Use proxy for convert_idea_to_task operation
|
|
141
|
+
const response = await apiClient.proxy<{
|
|
142
|
+
success: boolean;
|
|
143
|
+
task_id?: string;
|
|
144
|
+
task_title?: string;
|
|
145
|
+
idea_id?: string;
|
|
146
|
+
idea_status?: string;
|
|
147
|
+
message?: string;
|
|
148
|
+
error?: string;
|
|
149
|
+
existing_task_id?: string;
|
|
150
|
+
}>('convert_idea_to_task', {
|
|
151
|
+
idea_id,
|
|
152
|
+
priority,
|
|
153
|
+
estimated_minutes,
|
|
154
|
+
update_status
|
|
155
|
+
});
|
|
211
156
|
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
console.error(`Failed to update idea after conversion: ${updateError.message}`);
|
|
157
|
+
if (!response.ok) {
|
|
158
|
+
throw new Error(`Failed to convert idea: ${response.error}`);
|
|
215
159
|
}
|
|
216
160
|
|
|
217
|
-
|
|
218
|
-
await supabase.from('progress_logs').insert({
|
|
219
|
-
project_id: idea.project_id,
|
|
220
|
-
task_id: task.id,
|
|
221
|
-
summary: `Converted idea "${idea.title}" to task`,
|
|
222
|
-
created_by: 'agent',
|
|
223
|
-
created_by_session_id: currentSessionId,
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
return {
|
|
227
|
-
result: {
|
|
228
|
-
success: true,
|
|
229
|
-
task_id: task.id,
|
|
230
|
-
task_title: task.title,
|
|
231
|
-
idea_id: idea.id,
|
|
232
|
-
idea_status: update_status ? 'in_development' : idea.status,
|
|
233
|
-
message: `Created task from idea. Start with: update_task(task_id: "${task.id}", status: "in_progress")`,
|
|
234
|
-
},
|
|
235
|
-
};
|
|
161
|
+
return { result: response.data };
|
|
236
162
|
};
|
|
237
163
|
|
|
238
164
|
/**
|
package/src/handlers/index.ts
CHANGED
|
@@ -23,6 +23,8 @@ export * from './bodies-of-work.js';
|
|
|
23
23
|
export * from './discovery.js';
|
|
24
24
|
export * from './organizations.js';
|
|
25
25
|
export * from './cost.js';
|
|
26
|
+
export * from './git-issues.js';
|
|
27
|
+
export * from './sprints.js';
|
|
26
28
|
|
|
27
29
|
import type { HandlerRegistry } from './types.js';
|
|
28
30
|
import { milestoneHandlers } from './milestones.js';
|
|
@@ -42,6 +44,8 @@ import { bodiesOfWorkHandlers } from './bodies-of-work.js';
|
|
|
42
44
|
import { discoveryHandlers } from './discovery.js';
|
|
43
45
|
import { organizationHandlers } from './organizations.js';
|
|
44
46
|
import { costHandlers } from './cost.js';
|
|
47
|
+
import { gitIssueHandlers } from './git-issues.js';
|
|
48
|
+
import { sprintHandlers } from './sprints.js';
|
|
45
49
|
|
|
46
50
|
/**
|
|
47
51
|
* Build the complete handler registry from all modules
|
|
@@ -65,5 +69,7 @@ export function buildHandlerRegistry(): HandlerRegistry {
|
|
|
65
69
|
...discoveryHandlers,
|
|
66
70
|
...organizationHandlers,
|
|
67
71
|
...costHandlers,
|
|
72
|
+
...gitIssueHandlers,
|
|
73
|
+
...sprintHandlers,
|
|
68
74
|
};
|
|
69
75
|
}
|