@vibescope/mcp-server 0.2.5 → 0.2.6
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/CHANGELOG.md +84 -84
- package/README.md +194 -194
- package/dist/cli.js +26 -26
- package/dist/handlers/tool-docs.js +828 -828
- package/dist/index.js +73 -73
- package/dist/templates/agent-guidelines.js +185 -185
- package/dist/token-tracking.js +4 -2
- package/dist/tools.js +65 -65
- package/dist/utils.js +11 -11
- package/docs/TOOLS.md +2053 -2053
- package/package.json +1 -1
- package/scripts/generate-docs.ts +212 -212
- package/scripts/version-bump.ts +203 -203
- package/src/api-client.test.ts +723 -723
- package/src/api-client.ts +2499 -2499
- package/src/cli.ts +212 -212
- package/src/handlers/__test-setup__.ts +236 -236
- package/src/handlers/__test-utils__.ts +87 -87
- package/src/handlers/blockers.test.ts +468 -468
- package/src/handlers/blockers.ts +163 -163
- package/src/handlers/bodies-of-work.test.ts +704 -704
- package/src/handlers/bodies-of-work.ts +526 -526
- package/src/handlers/connectors.test.ts +834 -834
- package/src/handlers/connectors.ts +229 -229
- package/src/handlers/cost.test.ts +462 -462
- package/src/handlers/cost.ts +285 -285
- package/src/handlers/decisions.test.ts +382 -382
- package/src/handlers/decisions.ts +153 -153
- package/src/handlers/deployment.test.ts +551 -551
- package/src/handlers/deployment.ts +541 -541
- package/src/handlers/discovery.test.ts +206 -206
- package/src/handlers/discovery.ts +390 -390
- package/src/handlers/fallback.test.ts +537 -537
- package/src/handlers/fallback.ts +194 -194
- package/src/handlers/file-checkouts.test.ts +750 -750
- package/src/handlers/file-checkouts.ts +185 -185
- package/src/handlers/findings.test.ts +633 -633
- package/src/handlers/findings.ts +239 -239
- package/src/handlers/git-issues.test.ts +631 -631
- package/src/handlers/git-issues.ts +136 -136
- package/src/handlers/ideas.test.ts +644 -644
- package/src/handlers/ideas.ts +207 -207
- package/src/handlers/index.ts +84 -84
- package/src/handlers/milestones.test.ts +475 -475
- package/src/handlers/milestones.ts +180 -180
- package/src/handlers/organizations.test.ts +826 -826
- package/src/handlers/organizations.ts +315 -315
- package/src/handlers/progress.test.ts +269 -269
- package/src/handlers/progress.ts +77 -77
- package/src/handlers/project.test.ts +546 -546
- package/src/handlers/project.ts +239 -239
- package/src/handlers/requests.test.ts +303 -303
- package/src/handlers/requests.ts +99 -99
- package/src/handlers/roles.test.ts +303 -303
- package/src/handlers/roles.ts +226 -226
- package/src/handlers/session.test.ts +875 -875
- package/src/handlers/session.ts +738 -738
- package/src/handlers/sprints.test.ts +732 -732
- package/src/handlers/sprints.ts +537 -537
- package/src/handlers/tasks.test.ts +907 -907
- package/src/handlers/tasks.ts +945 -945
- package/src/handlers/tool-categories.test.ts +66 -66
- package/src/handlers/tool-docs.ts +1096 -1096
- package/src/handlers/types.test.ts +259 -259
- package/src/handlers/types.ts +175 -175
- package/src/handlers/validation.test.ts +582 -582
- package/src/handlers/validation.ts +97 -97
- package/src/index.ts +792 -792
- package/src/setup.test.ts +233 -231
- package/src/setup.ts +370 -370
- package/src/templates/agent-guidelines.ts +210 -210
- package/src/token-tracking.test.ts +463 -453
- package/src/token-tracking.ts +166 -164
- package/src/tools.ts +3562 -3562
- package/src/utils.test.ts +683 -683
- package/src/utils.ts +436 -436
- package/src/validators.test.ts +223 -223
- package/src/validators.ts +249 -249
- package/tsconfig.json +16 -16
- package/vitest.config.ts +14 -14
- package/dist/knowledge.d.ts +0 -6
- package/dist/knowledge.js +0 -218
package/src/handlers/project.ts
CHANGED
|
@@ -1,239 +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
|
-
// 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
|
-
};
|
|
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
|
+
};
|