@vibescope/mcp-server 0.2.0 → 0.2.1

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.
Files changed (65) hide show
  1. package/dist/api-client.d.ts +64 -1
  2. package/dist/api-client.js +34 -3
  3. package/dist/handlers/bodies-of-work.js +82 -49
  4. package/dist/handlers/cost.js +62 -54
  5. package/dist/handlers/decisions.js +29 -16
  6. package/dist/handlers/deployment.js +112 -106
  7. package/dist/handlers/discovery.js +35 -5
  8. package/dist/handlers/fallback.js +24 -19
  9. package/dist/handlers/file-checkouts.d.ts +18 -0
  10. package/dist/handlers/file-checkouts.js +101 -0
  11. package/dist/handlers/findings.d.ts +6 -0
  12. package/dist/handlers/findings.js +85 -30
  13. package/dist/handlers/git-issues.js +36 -32
  14. package/dist/handlers/ideas.js +44 -26
  15. package/dist/handlers/index.d.ts +2 -0
  16. package/dist/handlers/index.js +6 -0
  17. package/dist/handlers/milestones.js +34 -27
  18. package/dist/handlers/organizations.js +86 -78
  19. package/dist/handlers/progress.js +22 -11
  20. package/dist/handlers/project.js +62 -22
  21. package/dist/handlers/requests.js +15 -11
  22. package/dist/handlers/roles.d.ts +18 -0
  23. package/dist/handlers/roles.js +130 -0
  24. package/dist/handlers/session.js +30 -8
  25. package/dist/handlers/sprints.js +76 -64
  26. package/dist/handlers/tasks.js +113 -73
  27. package/dist/handlers/validation.js +18 -14
  28. package/dist/tools.js +387 -0
  29. package/package.json +1 -1
  30. package/src/api-client.ts +89 -6
  31. package/src/handlers/__test-setup__.ts +7 -0
  32. package/src/handlers/bodies-of-work.ts +101 -101
  33. package/src/handlers/cost.test.ts +34 -44
  34. package/src/handlers/cost.ts +77 -92
  35. package/src/handlers/decisions.test.ts +3 -2
  36. package/src/handlers/decisions.ts +32 -27
  37. package/src/handlers/deployment.ts +142 -190
  38. package/src/handlers/discovery.test.ts +4 -5
  39. package/src/handlers/discovery.ts +37 -6
  40. package/src/handlers/fallback.ts +31 -29
  41. package/src/handlers/file-checkouts.test.ts +477 -0
  42. package/src/handlers/file-checkouts.ts +127 -0
  43. package/src/handlers/findings.test.ts +145 -0
  44. package/src/handlers/findings.ts +101 -64
  45. package/src/handlers/git-issues.ts +40 -80
  46. package/src/handlers/ideas.ts +56 -54
  47. package/src/handlers/index.ts +6 -0
  48. package/src/handlers/milestones.test.ts +1 -1
  49. package/src/handlers/milestones.ts +47 -45
  50. package/src/handlers/organizations.ts +104 -129
  51. package/src/handlers/progress.ts +24 -22
  52. package/src/handlers/project.ts +89 -57
  53. package/src/handlers/requests.ts +18 -14
  54. package/src/handlers/roles.test.ts +303 -0
  55. package/src/handlers/roles.ts +208 -0
  56. package/src/handlers/session.ts +39 -17
  57. package/src/handlers/sprints.ts +96 -129
  58. package/src/handlers/tasks.ts +144 -138
  59. package/src/handlers/validation.test.ts +1 -1
  60. package/src/handlers/validation.ts +20 -22
  61. package/src/tools.ts +387 -0
  62. package/dist/config/tool-categories.d.ts +0 -31
  63. package/dist/config/tool-categories.js +0 -253
  64. package/dist/knowledge.d.ts +0 -6
  65. package/dist/knowledge.js +0 -218
@@ -16,18 +16,92 @@
16
16
  */
17
17
 
18
18
  import type { Handler, HandlerRegistry } from './types.js';
19
- import { validateRequired, validateUUID, validateEnum } from '../validators.js';
19
+ import { parseArgs, uuidValidator, createEnumValidator } from '../validators.js';
20
20
  import { getApiClient } from '../api-client.js';
21
21
 
22
- type SprintStatus = 'planning' | 'active' | 'in_review' | 'retrospective' | 'completed' | 'cancelled';
23
- type TaskPhase = 'pre' | 'core' | 'post';
24
- type DeployEnvironment = 'development' | 'staging' | 'production';
25
- type VersionBump = 'patch' | 'minor' | 'major';
22
+ const SPRINT_STATUSES = ['planning', 'active', 'in_review', 'retrospective', 'completed', 'cancelled'] as const;
23
+ const TASK_PHASES = ['pre', 'core', 'post'] as const;
24
+ const DEPLOY_ENVIRONMENTS = ['development', 'staging', 'production'] as const;
25
+ const VERSION_BUMPS = ['patch', 'minor', 'major'] as const;
26
+
27
+ type SprintStatus = typeof SPRINT_STATUSES[number];
28
+ type TaskPhase = typeof TASK_PHASES[number];
29
+ type DeployEnvironment = typeof DEPLOY_ENVIRONMENTS[number];
30
+ type VersionBump = typeof VERSION_BUMPS[number];
31
+
32
+ // ============================================================================
33
+ // Argument Schemas
34
+ // ============================================================================
35
+
36
+ const createSprintSchema = {
37
+ project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
38
+ title: { type: 'string' as const, required: true as const },
39
+ goal: { type: 'string' as const },
40
+ start_date: { type: 'string' as const, required: true as const },
41
+ end_date: { type: 'string' as const, required: true as const },
42
+ auto_deploy_on_completion: { type: 'boolean' as const },
43
+ deploy_environment: { type: 'string' as const, validate: createEnumValidator(DEPLOY_ENVIRONMENTS) },
44
+ deploy_version_bump: { type: 'string' as const, validate: createEnumValidator(VERSION_BUMPS) },
45
+ };
46
+
47
+ const updateSprintSchema = {
48
+ sprint_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
49
+ title: { type: 'string' as const },
50
+ goal: { type: 'string' as const },
51
+ start_date: { type: 'string' as const },
52
+ end_date: { type: 'string' as const },
53
+ auto_deploy_on_completion: { type: 'boolean' as const },
54
+ deploy_environment: { type: 'string' as const, validate: createEnumValidator(DEPLOY_ENVIRONMENTS) },
55
+ deploy_version_bump: { type: 'string' as const, validate: createEnumValidator(VERSION_BUMPS) },
56
+ };
57
+
58
+ const getSprintSchema = {
59
+ sprint_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
60
+ summary_only: { type: 'boolean' as const, default: false },
61
+ };
62
+
63
+ const getSprintsSchema = {
64
+ project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
65
+ status: { type: 'string' as const, validate: createEnumValidator(SPRINT_STATUSES) },
66
+ limit: { type: 'number' as const, default: 20 },
67
+ offset: { type: 'number' as const, default: 0 },
68
+ };
69
+
70
+ const deleteSprintSchema = {
71
+ sprint_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
72
+ };
73
+
74
+ const startSprintSchema = {
75
+ sprint_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
76
+ };
77
+
78
+ const completeSprintSchema = {
79
+ sprint_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
80
+ retrospective_notes: { type: 'string' as const },
81
+ skip_retrospective: { type: 'boolean' as const },
82
+ };
83
+
84
+ const addTaskToSprintSchema = {
85
+ sprint_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
86
+ task_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
87
+ story_points: { type: 'number' as const },
88
+ phase: { type: 'string' as const, validate: createEnumValidator(TASK_PHASES) },
89
+ };
90
+
91
+ const removeTaskFromSprintSchema = {
92
+ sprint_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
93
+ task_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
94
+ };
95
+
96
+ const getSprintBacklogSchema = {
97
+ project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
98
+ sprint_id: { type: 'string' as const, validate: uuidValidator },
99
+ };
26
100
 
27
- const SPRINT_STATUSES: SprintStatus[] = ['planning', 'active', 'in_review', 'retrospective', 'completed', 'cancelled'];
28
- const TASK_PHASES: TaskPhase[] = ['pre', 'core', 'post'];
29
- const DEPLOY_ENVIRONMENTS: DeployEnvironment[] = ['development', 'staging', 'production'];
30
- const VERSION_BUMPS: VersionBump[] = ['patch', 'minor', 'major'];
101
+ const getSprintVelocitySchema = {
102
+ project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
103
+ limit: { type: 'number' as const, default: 10 },
104
+ };
31
105
 
32
106
  export const createSprint: Handler = async (args, ctx) => {
33
107
  const {
@@ -39,29 +113,7 @@ export const createSprint: Handler = async (args, ctx) => {
39
113
  auto_deploy_on_completion,
40
114
  deploy_environment,
41
115
  deploy_version_bump,
42
- } = args as {
43
- project_id: string;
44
- title: string;
45
- goal?: string;
46
- start_date: string;
47
- end_date: string;
48
- auto_deploy_on_completion?: boolean;
49
- deploy_environment?: DeployEnvironment;
50
- deploy_version_bump?: VersionBump;
51
- };
52
-
53
- validateRequired(project_id, 'project_id');
54
- validateUUID(project_id, 'project_id');
55
- validateRequired(title, 'title');
56
- validateRequired(start_date, 'start_date');
57
- validateRequired(end_date, 'end_date');
58
-
59
- if (deploy_environment) {
60
- validateEnum(deploy_environment, DEPLOY_ENVIRONMENTS, 'deploy_environment');
61
- }
62
- if (deploy_version_bump) {
63
- validateEnum(deploy_version_bump, VERSION_BUMPS, 'deploy_version_bump');
64
- }
116
+ } = parseArgs(args, createSprintSchema);
65
117
 
66
118
  // Validate date format and order
67
119
  const startDateObj = new Date(start_date);
@@ -126,26 +178,7 @@ export const updateSprint: Handler = async (args, ctx) => {
126
178
  auto_deploy_on_completion,
127
179
  deploy_environment,
128
180
  deploy_version_bump,
129
- } = args as {
130
- sprint_id: string;
131
- title?: string;
132
- goal?: string;
133
- start_date?: string;
134
- end_date?: string;
135
- auto_deploy_on_completion?: boolean;
136
- deploy_environment?: DeployEnvironment;
137
- deploy_version_bump?: VersionBump;
138
- };
139
-
140
- validateRequired(sprint_id, 'sprint_id');
141
- validateUUID(sprint_id, 'sprint_id');
142
-
143
- if (deploy_environment) {
144
- validateEnum(deploy_environment, DEPLOY_ENVIRONMENTS, 'deploy_environment');
145
- }
146
- if (deploy_version_bump) {
147
- validateEnum(deploy_version_bump, VERSION_BUMPS, 'deploy_version_bump');
148
- }
181
+ } = parseArgs(args, updateSprintSchema);
149
182
 
150
183
  // Validate dates if provided
151
184
  if (start_date) {
@@ -182,10 +215,7 @@ export const updateSprint: Handler = async (args, ctx) => {
182
215
  };
183
216
 
184
217
  export const getSprint: Handler = async (args, ctx) => {
185
- const { sprint_id, summary_only = false } = args as { sprint_id: string; summary_only?: boolean };
186
-
187
- validateRequired(sprint_id, 'sprint_id');
188
- validateUUID(sprint_id, 'sprint_id');
218
+ const { sprint_id, summary_only } = parseArgs(args, getSprintSchema);
189
219
 
190
220
  const apiClient = getApiClient();
191
221
 
@@ -227,19 +257,7 @@ export const getSprint: Handler = async (args, ctx) => {
227
257
  };
228
258
 
229
259
  export const getSprints: Handler = async (args, ctx) => {
230
- const { project_id, status, limit = 20, offset = 0 } = args as {
231
- project_id: string;
232
- status?: SprintStatus;
233
- limit?: number;
234
- offset?: number;
235
- };
236
-
237
- validateRequired(project_id, 'project_id');
238
- validateUUID(project_id, 'project_id');
239
-
240
- if (status) {
241
- validateEnum(status, SPRINT_STATUSES, 'status');
242
- }
260
+ const { project_id, status, limit, offset } = parseArgs(args, getSprintsSchema);
243
261
 
244
262
  const apiClient = getApiClient();
245
263
 
@@ -261,7 +279,7 @@ export const getSprints: Handler = async (args, ctx) => {
261
279
  }>('get_sprints', {
262
280
  project_id,
263
281
  status,
264
- limit: Math.min(limit, 100),
282
+ limit: Math.min(limit ?? 20, 100),
265
283
  offset,
266
284
  });
267
285
 
@@ -273,10 +291,7 @@ export const getSprints: Handler = async (args, ctx) => {
273
291
  };
274
292
 
275
293
  export const deleteSprint: Handler = async (args, ctx) => {
276
- const { sprint_id } = args as { sprint_id: string };
277
-
278
- validateRequired(sprint_id, 'sprint_id');
279
- validateUUID(sprint_id, 'sprint_id');
294
+ const { sprint_id } = parseArgs(args, deleteSprintSchema);
280
295
 
281
296
  const apiClient = getApiClient();
282
297
 
@@ -292,10 +307,7 @@ export const deleteSprint: Handler = async (args, ctx) => {
292
307
  };
293
308
 
294
309
  export const startSprint: Handler = async (args, ctx) => {
295
- const { sprint_id } = args as { sprint_id: string };
296
-
297
- validateRequired(sprint_id, 'sprint_id');
298
- validateUUID(sprint_id, 'sprint_id');
310
+ const { sprint_id } = parseArgs(args, startSprintSchema);
299
311
 
300
312
  const apiClient = getApiClient();
301
313
 
@@ -315,14 +327,7 @@ export const startSprint: Handler = async (args, ctx) => {
315
327
  };
316
328
 
317
329
  export const completeSprint: Handler = async (args, ctx) => {
318
- const { sprint_id, retrospective_notes, skip_retrospective } = args as {
319
- sprint_id: string;
320
- retrospective_notes?: string;
321
- skip_retrospective?: boolean;
322
- };
323
-
324
- validateRequired(sprint_id, 'sprint_id');
325
- validateUUID(sprint_id, 'sprint_id');
330
+ const { sprint_id, retrospective_notes, skip_retrospective } = parseArgs(args, completeSprintSchema);
326
331
 
327
332
  const apiClient = getApiClient();
328
333
 
@@ -348,21 +353,7 @@ export const completeSprint: Handler = async (args, ctx) => {
348
353
  };
349
354
 
350
355
  export const addTaskToSprint: Handler = async (args, ctx) => {
351
- const { sprint_id, task_id, story_points, phase } = args as {
352
- sprint_id: string;
353
- task_id: string;
354
- story_points?: number;
355
- phase?: TaskPhase;
356
- };
357
-
358
- validateRequired(sprint_id, 'sprint_id');
359
- validateUUID(sprint_id, 'sprint_id');
360
- validateRequired(task_id, 'task_id');
361
- validateUUID(task_id, 'task_id');
362
-
363
- if (phase) {
364
- validateEnum(phase, TASK_PHASES, 'phase');
365
- }
356
+ const { sprint_id, task_id, story_points, phase } = parseArgs(args, addTaskToSprintSchema);
366
357
 
367
358
  if (story_points !== undefined && (story_points < 0 || !Number.isInteger(story_points))) {
368
359
  throw new Error('story_points must be a non-negative integer');
@@ -392,15 +383,7 @@ export const addTaskToSprint: Handler = async (args, ctx) => {
392
383
  };
393
384
 
394
385
  export const removeTaskFromSprint: Handler = async (args, ctx) => {
395
- const { sprint_id, task_id } = args as {
396
- sprint_id: string;
397
- task_id: string;
398
- };
399
-
400
- validateRequired(sprint_id, 'sprint_id');
401
- validateUUID(sprint_id, 'sprint_id');
402
- validateRequired(task_id, 'task_id');
403
- validateUUID(task_id, 'task_id');
386
+ const { sprint_id, task_id } = parseArgs(args, removeTaskFromSprintSchema);
404
387
 
405
388
  const apiClient = getApiClient();
406
389
 
@@ -423,17 +406,7 @@ export const removeTaskFromSprint: Handler = async (args, ctx) => {
423
406
  };
424
407
 
425
408
  export const getSprintBacklog: Handler = async (args, ctx) => {
426
- const { project_id, sprint_id } = args as {
427
- project_id: string;
428
- sprint_id?: string;
429
- };
430
-
431
- validateRequired(project_id, 'project_id');
432
- validateUUID(project_id, 'project_id');
433
-
434
- if (sprint_id) {
435
- validateUUID(sprint_id, 'sprint_id');
436
- }
409
+ const { project_id, sprint_id } = parseArgs(args, getSprintBacklogSchema);
437
410
 
438
411
  const apiClient = getApiClient();
439
412
 
@@ -460,13 +433,7 @@ export const getSprintBacklog: Handler = async (args, ctx) => {
460
433
  };
461
434
 
462
435
  export const getSprintVelocity: Handler = async (args, ctx) => {
463
- const { project_id, limit = 10 } = args as {
464
- project_id: string;
465
- limit?: number;
466
- };
467
-
468
- validateRequired(project_id, 'project_id');
469
- validateUUID(project_id, 'project_id');
436
+ const { project_id, limit } = parseArgs(args, getSprintVelocitySchema);
470
437
 
471
438
  const apiClient = getApiClient();
472
439
 
@@ -482,7 +449,7 @@ export const getSprintVelocity: Handler = async (args, ctx) => {
482
449
  total_sprints: number;
483
450
  }>('get_sprint_velocity', {
484
451
  project_id,
485
- limit: Math.min(limit, 50),
452
+ limit: Math.min(limit ?? 10, 50),
486
453
  });
487
454
 
488
455
  if (!response.ok) {