@vibescope/mcp-server 0.2.3 → 0.2.5

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 (117) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +194 -138
  3. package/dist/api-client.d.ts +276 -8
  4. package/dist/api-client.js +123 -8
  5. package/dist/cli.d.ts +6 -3
  6. package/dist/cli.js +28 -10
  7. package/dist/handlers/blockers.d.ts +11 -0
  8. package/dist/handlers/blockers.js +37 -2
  9. package/dist/handlers/bodies-of-work.d.ts +2 -0
  10. package/dist/handlers/bodies-of-work.js +30 -1
  11. package/dist/handlers/connectors.js +2 -2
  12. package/dist/handlers/decisions.d.ts +11 -0
  13. package/dist/handlers/decisions.js +37 -2
  14. package/dist/handlers/deployment.d.ts +6 -0
  15. package/dist/handlers/deployment.js +33 -5
  16. package/dist/handlers/discovery.js +27 -11
  17. package/dist/handlers/fallback.js +12 -6
  18. package/dist/handlers/file-checkouts.d.ts +1 -0
  19. package/dist/handlers/file-checkouts.js +17 -2
  20. package/dist/handlers/findings.d.ts +5 -0
  21. package/dist/handlers/findings.js +19 -2
  22. package/dist/handlers/git-issues.js +4 -2
  23. package/dist/handlers/ideas.d.ts +5 -0
  24. package/dist/handlers/ideas.js +19 -2
  25. package/dist/handlers/progress.js +2 -2
  26. package/dist/handlers/project.d.ts +1 -0
  27. package/dist/handlers/project.js +35 -2
  28. package/dist/handlers/requests.js +6 -3
  29. package/dist/handlers/roles.js +13 -2
  30. package/dist/handlers/session.d.ts +12 -0
  31. package/dist/handlers/session.js +288 -25
  32. package/dist/handlers/sprints.d.ts +2 -0
  33. package/dist/handlers/sprints.js +30 -1
  34. package/dist/handlers/tasks.d.ts +25 -2
  35. package/dist/handlers/tasks.js +228 -35
  36. package/dist/handlers/tool-docs.js +834 -767
  37. package/dist/index.js +73 -73
  38. package/dist/knowledge.d.ts +6 -0
  39. package/dist/knowledge.js +218 -0
  40. package/dist/setup.d.ts +22 -0
  41. package/dist/setup.js +313 -0
  42. package/dist/templates/agent-guidelines.d.ts +18 -0
  43. package/dist/templates/agent-guidelines.js +207 -0
  44. package/dist/tools.js +527 -174
  45. package/dist/utils.d.ts +5 -2
  46. package/dist/utils.js +101 -62
  47. package/docs/TOOLS.md +2053 -2053
  48. package/package.json +51 -46
  49. package/scripts/generate-docs.ts +212 -212
  50. package/scripts/version-bump.ts +203 -0
  51. package/src/api-client.test.ts +723 -723
  52. package/src/api-client.ts +2499 -2140
  53. package/src/cli.ts +27 -10
  54. package/src/handlers/__test-setup__.ts +236 -231
  55. package/src/handlers/__test-utils__.ts +87 -87
  56. package/src/handlers/blockers.test.ts +468 -392
  57. package/src/handlers/blockers.ts +163 -109
  58. package/src/handlers/bodies-of-work.test.ts +704 -704
  59. package/src/handlers/bodies-of-work.ts +526 -468
  60. package/src/handlers/connectors.test.ts +834 -834
  61. package/src/handlers/connectors.ts +229 -229
  62. package/src/handlers/cost.test.ts +462 -462
  63. package/src/handlers/cost.ts +285 -285
  64. package/src/handlers/decisions.test.ts +382 -313
  65. package/src/handlers/decisions.ts +153 -99
  66. package/src/handlers/deployment.test.ts +551 -470
  67. package/src/handlers/deployment.ts +541 -508
  68. package/src/handlers/discovery.test.ts +206 -206
  69. package/src/handlers/discovery.ts +390 -374
  70. package/src/handlers/fallback.test.ts +537 -536
  71. package/src/handlers/fallback.ts +194 -188
  72. package/src/handlers/file-checkouts.test.ts +750 -670
  73. package/src/handlers/file-checkouts.ts +185 -165
  74. package/src/handlers/findings.test.ts +633 -633
  75. package/src/handlers/findings.ts +239 -203
  76. package/src/handlers/git-issues.test.ts +631 -631
  77. package/src/handlers/git-issues.ts +136 -134
  78. package/src/handlers/ideas.test.ts +644 -644
  79. package/src/handlers/ideas.ts +207 -175
  80. package/src/handlers/index.ts +84 -84
  81. package/src/handlers/milestones.test.ts +475 -475
  82. package/src/handlers/milestones.ts +180 -180
  83. package/src/handlers/organizations.test.ts +826 -826
  84. package/src/handlers/organizations.ts +315 -315
  85. package/src/handlers/progress.test.ts +269 -269
  86. package/src/handlers/progress.ts +77 -77
  87. package/src/handlers/project.test.ts +546 -546
  88. package/src/handlers/project.ts +239 -194
  89. package/src/handlers/requests.test.ts +303 -272
  90. package/src/handlers/requests.ts +99 -96
  91. package/src/handlers/roles.test.ts +303 -303
  92. package/src/handlers/roles.ts +226 -208
  93. package/src/handlers/session.test.ts +875 -576
  94. package/src/handlers/session.ts +738 -425
  95. package/src/handlers/sprints.test.ts +732 -732
  96. package/src/handlers/sprints.ts +537 -477
  97. package/src/handlers/tasks.test.ts +907 -980
  98. package/src/handlers/tasks.ts +945 -716
  99. package/src/handlers/tool-categories.test.ts +66 -66
  100. package/src/handlers/tool-docs.ts +1096 -1024
  101. package/src/handlers/types.test.ts +259 -0
  102. package/src/handlers/types.ts +175 -175
  103. package/src/handlers/validation.test.ts +582 -582
  104. package/src/handlers/validation.ts +97 -97
  105. package/src/index.ts +792 -792
  106. package/src/setup.test.ts +231 -0
  107. package/src/setup.ts +370 -0
  108. package/src/templates/agent-guidelines.ts +210 -0
  109. package/src/token-tracking.test.ts +453 -453
  110. package/src/token-tracking.ts +164 -164
  111. package/src/tools.ts +3562 -3208
  112. package/src/utils.test.ts +683 -681
  113. package/src/utils.ts +436 -392
  114. package/src/validators.test.ts +223 -223
  115. package/src/validators.ts +249 -249
  116. package/tsconfig.json +16 -16
  117. package/vitest.config.ts +14 -14
@@ -1,194 +1,239 @@
1
- /**
2
- * Project Handlers
3
- *
4
- * Handles project CRUD and configuration:
5
- * - get_project_context
6
- * - get_git_workflow
7
- * - create_project
8
- * - update_project
9
- * - update_project_readme
10
- */
11
-
12
- import type { Handler, HandlerRegistry } from './types.js';
13
- import {
14
- parseArgs,
15
- uuidValidator,
16
- projectStatusValidator,
17
- createEnumValidator,
18
- VALID_PROJECT_STATUSES,
19
- } from '../validators.js';
20
- import { getApiClient } from '../api-client.js';
21
-
22
- const VALID_GIT_WORKFLOWS = ['none', 'trunk-based', 'github-flow', 'git-flow'] as const;
23
- type GitWorkflow = typeof VALID_GIT_WORKFLOWS[number];
24
-
25
- // Argument schemas for type-safe parsing
26
- const getProjectContextSchema = {
27
- project_id: { type: 'string' as const, validate: uuidValidator },
28
- git_url: { type: 'string' as const },
29
- };
30
-
31
- const getGitWorkflowSchema = {
32
- project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
33
- task_id: { type: 'string' as const, validate: uuidValidator },
34
- };
35
-
36
- const createProjectSchema = {
37
- name: { type: 'string' as const, required: true as const },
38
- description: { type: 'string' as const },
39
- goal: { type: 'string' as const },
40
- git_url: { type: 'string' as const },
41
- tech_stack: { type: 'array' as const },
42
- };
43
-
44
- const updateProjectSchema = {
45
- project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
46
- name: { type: 'string' as const },
47
- description: { type: 'string' as const },
48
- goal: { type: 'string' as const },
49
- git_url: { type: 'string' as const },
50
- tech_stack: { type: 'array' as const },
51
- status: { type: 'string' as const, validate: projectStatusValidator },
52
- git_workflow: { type: 'string' as const, validate: createEnumValidator(VALID_GIT_WORKFLOWS) },
53
- git_main_branch: { type: 'string' as const },
54
- git_develop_branch: { type: 'string' as const },
55
- git_auto_branch: { type: 'boolean' as const },
56
- git_auto_tag: { type: 'boolean' as const },
57
- deployment_instructions: { type: 'string' as const },
58
- };
59
-
60
- const updateProjectReadmeSchema = {
61
- project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
62
- readme_content: { type: 'string' as const, required: true as const },
63
- };
64
-
65
- export const getProjectContext: Handler = async (args, _ctx) => {
66
- const { project_id, git_url } = parseArgs(args, getProjectContextSchema);
67
-
68
- const apiClient = getApiClient();
69
-
70
- // If no project_id or git_url, list all projects
71
- if (!project_id && !git_url) {
72
- const response = await apiClient.listProjects();
73
-
74
- if (!response.ok) {
75
- return { result: { error: response.error || 'Failed to fetch projects' }, isError: true };
76
- }
77
-
78
- return { result: { projects: response.data?.projects || [] } };
79
- }
80
-
81
- // Find project by ID or git_url
82
- const response = await apiClient.getProject(project_id || 'by-git-url', git_url);
83
-
84
- if (!response.ok) {
85
- return { result: { error: response.error || 'Failed to fetch project' }, isError: true };
86
- }
87
-
88
- if (!response.data?.found) {
89
- return {
90
- result: {
91
- found: false,
92
- message: response.data?.message || 'Project not found. Use create_project to create one.',
93
- },
94
- };
95
- }
96
-
97
- return { result: response.data };
98
- };
99
-
100
- export const getGitWorkflow: Handler = async (args, _ctx) => {
101
- const { project_id, task_id } = parseArgs(args, getGitWorkflowSchema);
102
-
103
- const apiClient = getApiClient();
104
- const response = await apiClient.getGitWorkflow(project_id, task_id);
105
-
106
- if (!response.ok) {
107
- return { result: { error: response.error || 'Failed to get git workflow' }, isError: true };
108
- }
109
-
110
- return { result: response.data };
111
- };
112
-
113
- export const createProject: Handler = async (args, _ctx) => {
114
- const { name, description, goal, git_url, tech_stack } = parseArgs(args, createProjectSchema);
115
-
116
- const apiClient = getApiClient();
117
- const response = await apiClient.createProject({
118
- name,
119
- description,
120
- goal,
121
- git_url,
122
- tech_stack: tech_stack as string[] | undefined
123
- });
124
-
125
- if (!response.ok) {
126
- return { result: { error: response.error || 'Failed to create project' }, isError: true };
127
- }
128
-
129
- return { result: response.data };
130
- };
131
-
132
- export const updateProject: Handler = async (args, _ctx) => {
133
- const {
134
- project_id,
135
- name,
136
- description,
137
- goal,
138
- git_url,
139
- tech_stack,
140
- status,
141
- git_workflow,
142
- git_main_branch,
143
- git_develop_branch,
144
- git_auto_branch,
145
- git_auto_tag,
146
- deployment_instructions
147
- } = parseArgs(args, updateProjectSchema);
148
-
149
- const apiClient = getApiClient();
150
- const response = await apiClient.updateProject(project_id, {
151
- name,
152
- description,
153
- goal,
154
- git_url,
155
- tech_stack: tech_stack as string[] | undefined,
156
- status: status as typeof VALID_PROJECT_STATUSES[number] | undefined,
157
- git_workflow: git_workflow as GitWorkflow | undefined,
158
- git_main_branch,
159
- git_develop_branch,
160
- git_auto_branch,
161
- git_auto_tag,
162
- deployment_instructions
163
- });
164
-
165
- if (!response.ok) {
166
- return { result: { error: response.error || 'Failed to update project' }, isError: true };
167
- }
168
-
169
- return { result: response.data };
170
- };
171
-
172
- export const updateProjectReadme: Handler = async (args, _ctx) => {
173
- const { project_id, readme_content } = parseArgs(args, updateProjectReadmeSchema);
174
-
175
- const apiClient = getApiClient();
176
- const response = await apiClient.updateProjectReadme(project_id, readme_content);
177
-
178
- if (!response.ok) {
179
- return { result: { error: response.error || 'Failed to update README' }, isError: true };
180
- }
181
-
182
- return { result: response.data };
183
- };
184
-
185
- /**
186
- * Project handlers registry
187
- */
188
- export const projectHandlers: HandlerRegistry = {
189
- get_project_context: getProjectContext,
190
- get_git_workflow: getGitWorkflow,
191
- create_project: createProject,
192
- update_project: updateProject,
193
- update_project_readme: updateProjectReadme,
194
- };
1
+ /**
2
+ * Project Handlers
3
+ *
4
+ * Handles project CRUD and configuration:
5
+ * - get_project_context
6
+ * - get_git_workflow
7
+ * - create_project
8
+ * - update_project
9
+ * - update_project_readme
10
+ */
11
+
12
+ import type { Handler, HandlerRegistry } from './types.js';
13
+ import {
14
+ parseArgs,
15
+ uuidValidator,
16
+ projectStatusValidator,
17
+ createEnumValidator,
18
+ VALID_PROJECT_STATUSES,
19
+ } from '../validators.js';
20
+ import { getApiClient } from '../api-client.js';
21
+
22
+ const VALID_GIT_WORKFLOWS = ['none', 'trunk-based', 'github-flow', 'git-flow'] as const;
23
+ type GitWorkflow = typeof VALID_GIT_WORKFLOWS[number];
24
+
25
+ // Argument schemas for type-safe parsing
26
+ const getProjectContextSchema = {
27
+ project_id: { type: 'string' as const, validate: uuidValidator },
28
+ git_url: { type: 'string' as const },
29
+ };
30
+
31
+ const getGitWorkflowSchema = {
32
+ project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
33
+ task_id: { type: 'string' as const, validate: uuidValidator },
34
+ };
35
+
36
+ const createProjectSchema = {
37
+ name: { type: 'string' as const, required: true as const },
38
+ description: { type: 'string' as const },
39
+ goal: { type: 'string' as const },
40
+ git_url: { type: 'string' as const },
41
+ tech_stack: { type: 'array' as const },
42
+ };
43
+
44
+ const updateProjectSchema = {
45
+ project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
46
+ name: { type: 'string' as const },
47
+ description: { type: 'string' as const },
48
+ goal: { type: 'string' as const },
49
+ git_url: { type: 'string' as const },
50
+ tech_stack: { type: 'array' as const },
51
+ status: { type: 'string' as const, validate: projectStatusValidator },
52
+ git_workflow: { type: 'string' as const, validate: createEnumValidator(VALID_GIT_WORKFLOWS) },
53
+ git_main_branch: { type: 'string' as const },
54
+ git_develop_branch: { type: 'string' as const },
55
+ git_auto_branch: { type: 'boolean' as const },
56
+ git_auto_tag: { type: 'boolean' as const },
57
+ deployment_instructions: { type: 'string' as const },
58
+ // New project settings
59
+ git_delete_branch_on_merge: { type: 'boolean' as const },
60
+ require_pr_for_validation: { type: 'boolean' as const },
61
+ auto_merge_on_approval: { type: 'boolean' as const },
62
+ validation_required: { type: 'boolean' as const },
63
+ default_task_priority: { type: 'number' as const },
64
+ require_time_estimates: { type: 'boolean' as const },
65
+ fallback_activities_enabled: { type: 'boolean' as const },
66
+ preferred_fallback_activities: { type: 'array' as const },
67
+ };
68
+
69
+ const updateProjectReadmeSchema = {
70
+ project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
71
+ readme_content: { type: 'string' as const, required: true as const },
72
+ };
73
+
74
+ const getProjectSummarySchema = {
75
+ project_id: { type: 'string' as const, required: true as const, validate: uuidValidator },
76
+ };
77
+
78
+ export const getProjectContext: Handler = async (args, _ctx) => {
79
+ const { project_id, git_url } = parseArgs(args, getProjectContextSchema);
80
+
81
+ const apiClient = getApiClient();
82
+
83
+ // If no project_id or git_url, list all projects
84
+ if (!project_id && !git_url) {
85
+ const response = await apiClient.listProjects();
86
+
87
+ if (!response.ok) {
88
+ return { result: { error: response.error || 'Failed to fetch projects' }, isError: true };
89
+ }
90
+
91
+ return { result: { projects: response.data?.projects || [] } };
92
+ }
93
+
94
+ // Find project by ID or git_url
95
+ const response = await apiClient.getProject(project_id || 'by-git-url', git_url);
96
+
97
+ if (!response.ok) {
98
+ return { result: { error: response.error || 'Failed to fetch project' }, isError: true };
99
+ }
100
+
101
+ if (!response.data?.found) {
102
+ return {
103
+ result: {
104
+ found: false,
105
+ message: response.data?.message || 'Project not found. Use create_project to create one.',
106
+ },
107
+ };
108
+ }
109
+
110
+ return { result: response.data };
111
+ };
112
+
113
+ export const getGitWorkflow: Handler = async (args, _ctx) => {
114
+ const { project_id, task_id } = parseArgs(args, getGitWorkflowSchema);
115
+
116
+ const apiClient = getApiClient();
117
+ const response = await apiClient.getGitWorkflow(project_id, task_id);
118
+
119
+ if (!response.ok) {
120
+ return { result: { error: response.error || 'Failed to get git workflow' }, isError: true };
121
+ }
122
+
123
+ return { result: response.data };
124
+ };
125
+
126
+ export const createProject: Handler = async (args, _ctx) => {
127
+ const { name, description, goal, git_url, tech_stack } = parseArgs(args, createProjectSchema);
128
+
129
+ const apiClient = getApiClient();
130
+ const response = await apiClient.createProject({
131
+ name,
132
+ description,
133
+ goal,
134
+ git_url,
135
+ tech_stack: tech_stack as string[] | undefined
136
+ });
137
+
138
+ if (!response.ok) {
139
+ return { result: { error: response.error || 'Failed to create project' }, isError: true };
140
+ }
141
+
142
+ return { result: response.data };
143
+ };
144
+
145
+ export const updateProject: Handler = async (args, _ctx) => {
146
+ const {
147
+ project_id,
148
+ name,
149
+ description,
150
+ goal,
151
+ git_url,
152
+ tech_stack,
153
+ status,
154
+ git_workflow,
155
+ git_main_branch,
156
+ git_develop_branch,
157
+ git_auto_branch,
158
+ git_auto_tag,
159
+ deployment_instructions,
160
+ // New project settings
161
+ git_delete_branch_on_merge,
162
+ require_pr_for_validation,
163
+ auto_merge_on_approval,
164
+ validation_required,
165
+ default_task_priority,
166
+ require_time_estimates,
167
+ fallback_activities_enabled,
168
+ preferred_fallback_activities
169
+ } = parseArgs(args, updateProjectSchema);
170
+
171
+ const apiClient = getApiClient();
172
+ const response = await apiClient.updateProject(project_id, {
173
+ name,
174
+ description,
175
+ goal,
176
+ git_url,
177
+ tech_stack: tech_stack as string[] | undefined,
178
+ status: status as typeof VALID_PROJECT_STATUSES[number] | undefined,
179
+ git_workflow: git_workflow as GitWorkflow | undefined,
180
+ git_main_branch,
181
+ git_develop_branch,
182
+ git_auto_branch,
183
+ git_auto_tag,
184
+ deployment_instructions,
185
+ // New project settings
186
+ git_delete_branch_on_merge,
187
+ require_pr_for_validation,
188
+ auto_merge_on_approval,
189
+ validation_required,
190
+ default_task_priority,
191
+ require_time_estimates,
192
+ fallback_activities_enabled,
193
+ preferred_fallback_activities: preferred_fallback_activities as string[] | undefined
194
+ });
195
+
196
+ if (!response.ok) {
197
+ return { result: { error: response.error || 'Failed to update project' }, isError: true };
198
+ }
199
+
200
+ return { result: response.data };
201
+ };
202
+
203
+ export const updateProjectReadme: Handler = async (args, _ctx) => {
204
+ const { project_id, readme_content } = parseArgs(args, updateProjectReadmeSchema);
205
+
206
+ const apiClient = getApiClient();
207
+ const response = await apiClient.updateProjectReadme(project_id, readme_content);
208
+
209
+ if (!response.ok) {
210
+ return { result: { error: response.error || 'Failed to update README' }, isError: true };
211
+ }
212
+
213
+ return { result: response.data };
214
+ };
215
+
216
+ export const getProjectSummary: Handler = async (args, _ctx) => {
217
+ const { project_id } = parseArgs(args, getProjectSummarySchema);
218
+
219
+ const apiClient = getApiClient();
220
+ const response = await apiClient.getProjectSummary(project_id);
221
+
222
+ if (!response.ok) {
223
+ return { result: { error: response.error || 'Failed to get project summary' }, isError: true };
224
+ }
225
+
226
+ return { result: response.data };
227
+ };
228
+
229
+ /**
230
+ * Project handlers registry
231
+ */
232
+ export const projectHandlers: HandlerRegistry = {
233
+ get_project_context: getProjectContext,
234
+ get_git_workflow: getGitWorkflow,
235
+ create_project: createProject,
236
+ update_project: updateProject,
237
+ update_project_readme: updateProjectReadme,
238
+ get_project_summary: getProjectSummary,
239
+ };