@vibescope/mcp-server 0.3.13 → 0.3.14
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/dist/api-client/fallback.d.ts +33 -0
- package/dist/api-client/fallback.js +21 -0
- package/dist/api-client/findings.d.ts +34 -62
- package/dist/api-client/findings.js +20 -39
- package/dist/api-client/index.d.ts +47 -54
- package/dist/api-client/index.js +26 -10
- package/dist/api-client/milestones.d.ts +36 -37
- package/dist/api-client/milestones.js +17 -30
- package/dist/api-client/validation.d.ts +35 -0
- package/dist/api-client/validation.js +23 -0
- package/dist/handlers/cloud-agents.js +4 -12
- package/dist/handlers/discovery.js +1 -0
- package/dist/handlers/findings.js +1 -1
- package/dist/handlers/ideas.js +1 -1
- package/dist/handlers/session.js +1 -0
- package/dist/handlers/tool-docs.js +344 -0
- package/docs/TOOLS.md +1 -1
- package/package.json +1 -1
- package/src/api-client/fallback.ts +52 -0
- package/src/api-client/findings.ts +56 -110
- package/src/api-client/index.ts +34 -14
- package/src/api-client/milestones.ts +47 -67
- package/src/api-client/validation.ts +60 -0
- package/src/handlers/cloud-agents.test.ts +438 -0
- package/src/handlers/cloud-agents.ts +7 -17
- package/src/handlers/discovery.ts +1 -0
- package/src/handlers/findings.ts +1 -1
- package/src/handlers/ideas.ts +1 -1
- package/src/handlers/session.ts +1 -0
- package/src/handlers/tool-docs.test.ts +511 -0
- package/src/handlers/tool-docs.ts +382 -0
|
@@ -1,154 +1,100 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Findings API Methods
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* - getFindings: List findings for a project
|
|
6
|
-
* - getFinding: Get a specific finding
|
|
7
|
-
* - addFinding: Create a new finding
|
|
8
|
-
* - updateFinding: Update an existing finding
|
|
9
|
-
* - deleteFinding: Delete a finding
|
|
10
|
-
* - getFindingsStats: Get findings statistics
|
|
11
|
-
* - queryKnowledgeBase: Search findings as knowledge base
|
|
4
|
+
* Handles security findings, code quality issues, and audit findings.
|
|
12
5
|
*/
|
|
13
6
|
|
|
14
|
-
import type { ApiResponse,
|
|
7
|
+
import type { ApiResponse, ProxyFn } from './types.js';
|
|
8
|
+
|
|
9
|
+
export interface Finding {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
category: string;
|
|
14
|
+
severity: string;
|
|
15
|
+
status: string;
|
|
16
|
+
file_path?: string;
|
|
17
|
+
line_number?: number;
|
|
18
|
+
resolution_note?: string;
|
|
19
|
+
created_at: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface FindingsStats {
|
|
23
|
+
total: number;
|
|
24
|
+
by_status: Record<string, number>;
|
|
25
|
+
by_severity: Record<string, number>;
|
|
26
|
+
by_category: Record<string, number>;
|
|
27
|
+
}
|
|
15
28
|
|
|
16
29
|
export interface FindingsMethods {
|
|
17
30
|
getFindings(projectId: string, params?: {
|
|
18
31
|
category?: string;
|
|
19
32
|
severity?: string;
|
|
20
33
|
status?: string;
|
|
21
|
-
summary_only?: boolean;
|
|
22
34
|
limit?: number;
|
|
23
35
|
offset?: number;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
title: string;
|
|
28
|
-
description?: string;
|
|
29
|
-
category: string;
|
|
30
|
-
severity: string;
|
|
31
|
-
status: string;
|
|
32
|
-
created_at: string;
|
|
33
|
-
updated_at?: string;
|
|
34
|
-
related_task_id?: string;
|
|
35
|
-
}>;
|
|
36
|
-
total_count: number;
|
|
37
|
-
has_more: boolean;
|
|
38
|
-
}>>;
|
|
36
|
+
search_query?: string;
|
|
37
|
+
summary_only?: boolean;
|
|
38
|
+
}): Promise<ApiResponse<{ findings: Finding[]; total_count?: number; has_more?: boolean }>>;
|
|
39
39
|
|
|
40
|
-
getFinding(findingId: string): Promise<ApiResponse<{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
description?: string;
|
|
44
|
-
category: string;
|
|
45
|
-
severity: string;
|
|
46
|
-
status: string;
|
|
47
|
-
created_at: string;
|
|
48
|
-
updated_at?: string;
|
|
49
|
-
related_task_id?: string;
|
|
50
|
-
}>>;
|
|
40
|
+
getFinding(findingId: string): Promise<ApiResponse<{ finding: Finding }>>;
|
|
41
|
+
|
|
42
|
+
getFindingsStats(projectId: string): Promise<ApiResponse<FindingsStats>>;
|
|
51
43
|
|
|
52
|
-
addFinding(params: {
|
|
53
|
-
project_id: string;
|
|
44
|
+
addFinding(projectId: string, params: {
|
|
54
45
|
title: string;
|
|
55
46
|
description?: string;
|
|
56
47
|
category?: string;
|
|
57
48
|
severity?: string;
|
|
49
|
+
file_path?: string;
|
|
50
|
+
line_number?: number;
|
|
58
51
|
related_task_id?: string;
|
|
59
|
-
}): Promise<ApiResponse<{
|
|
60
|
-
success: boolean;
|
|
61
|
-
finding_id: string;
|
|
62
|
-
}>>;
|
|
52
|
+
}, sessionId?: string): Promise<ApiResponse<{ success: boolean; finding_id: string }>>;
|
|
63
53
|
|
|
64
|
-
updateFinding(findingId: string,
|
|
54
|
+
updateFinding(findingId: string, updates: {
|
|
65
55
|
title?: string;
|
|
66
56
|
description?: string;
|
|
67
|
-
category?: string;
|
|
68
57
|
severity?: string;
|
|
69
58
|
status?: string;
|
|
70
|
-
|
|
71
|
-
}): Promise<ApiResponse<{
|
|
72
|
-
success: boolean;
|
|
73
|
-
finding_id: string;
|
|
74
|
-
}>>;
|
|
59
|
+
resolution_note?: string;
|
|
60
|
+
}): Promise<ApiResponse<{ success: boolean; finding_id: string }>>;
|
|
75
61
|
|
|
76
|
-
deleteFinding(findingId: string): Promise<ApiResponse<{
|
|
77
|
-
success: boolean;
|
|
78
|
-
finding_id: string;
|
|
79
|
-
}>>;
|
|
80
|
-
|
|
81
|
-
getFindingsStats(projectId: string): Promise<ApiResponse<{
|
|
82
|
-
total: number;
|
|
83
|
-
by_severity: Record<string, number>;
|
|
84
|
-
by_category: Record<string, number>;
|
|
85
|
-
by_status: Record<string, number>;
|
|
86
|
-
}>>;
|
|
87
|
-
|
|
88
|
-
queryKnowledgeBase(projectId: string, params: {
|
|
89
|
-
query: string;
|
|
90
|
-
category?: string;
|
|
91
|
-
severity?: string;
|
|
92
|
-
limit?: number;
|
|
93
|
-
}): Promise<ApiResponse<{
|
|
94
|
-
findings: Array<{
|
|
95
|
-
id: string;
|
|
96
|
-
title: string;
|
|
97
|
-
description?: string;
|
|
98
|
-
category: string;
|
|
99
|
-
severity: string;
|
|
100
|
-
relevance_score?: number;
|
|
101
|
-
}>;
|
|
102
|
-
total_count: number;
|
|
103
|
-
}>>;
|
|
62
|
+
deleteFinding(findingId: string): Promise<ApiResponse<{ success: boolean }>>;
|
|
104
63
|
}
|
|
105
64
|
|
|
106
|
-
export function createFindingsMethods(
|
|
65
|
+
export function createFindingsMethods(proxy: ProxyFn): FindingsMethods {
|
|
107
66
|
return {
|
|
108
67
|
async getFindings(projectId, params) {
|
|
109
|
-
return
|
|
110
|
-
|
|
111
|
-
|
|
68
|
+
return proxy('get_findings', {
|
|
69
|
+
project_id: projectId,
|
|
70
|
+
...params
|
|
112
71
|
});
|
|
113
72
|
},
|
|
114
73
|
|
|
115
74
|
async getFinding(findingId) {
|
|
116
|
-
return
|
|
117
|
-
path: { id: findingId },
|
|
118
|
-
});
|
|
75
|
+
return proxy('get_finding', { finding_id: findingId });
|
|
119
76
|
},
|
|
120
77
|
|
|
121
|
-
async
|
|
122
|
-
return
|
|
123
|
-
path: { id: params.project_id },
|
|
124
|
-
body: params,
|
|
125
|
-
});
|
|
78
|
+
async getFindingsStats(projectId) {
|
|
79
|
+
return proxy('get_findings_stats', { project_id: projectId });
|
|
126
80
|
},
|
|
127
81
|
|
|
128
|
-
async
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
82
|
+
async addFinding(projectId, params, sessionId) {
|
|
83
|
+
return proxy('add_finding', {
|
|
84
|
+
project_id: projectId,
|
|
85
|
+
...params
|
|
86
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
133
87
|
},
|
|
134
88
|
|
|
135
|
-
async
|
|
136
|
-
return
|
|
137
|
-
|
|
89
|
+
async updateFinding(findingId, updates) {
|
|
90
|
+
return proxy('update_finding', {
|
|
91
|
+
finding_id: findingId,
|
|
92
|
+
...updates
|
|
138
93
|
});
|
|
139
94
|
},
|
|
140
95
|
|
|
141
|
-
async
|
|
142
|
-
return
|
|
143
|
-
|
|
144
|
-
});
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
async queryKnowledgeBase(projectId, params) {
|
|
148
|
-
return request('/api/mcp/projects/{id}/findings/query', 'POST', {
|
|
149
|
-
path: { id: projectId },
|
|
150
|
-
body: params,
|
|
151
|
-
});
|
|
152
|
-
},
|
|
96
|
+
async deleteFinding(findingId) {
|
|
97
|
+
return proxy('delete_finding', { finding_id: findingId });
|
|
98
|
+
}
|
|
153
99
|
};
|
|
154
|
-
}
|
|
100
|
+
}
|
package/src/api-client/index.ts
CHANGED
|
@@ -19,6 +19,8 @@ import { createIdeasMethods, type IdeasMethods } from './ideas.js';
|
|
|
19
19
|
import { createTasksMethods, type TasksMethods } from './tasks.js';
|
|
20
20
|
import { createFindingsMethods, type FindingsMethods } from './findings.js';
|
|
21
21
|
import { createMilestonesMethods, type MilestonesMethods } from './milestones.js';
|
|
22
|
+
import { createValidationMethods, type ValidationMethods } from './validation.js';
|
|
23
|
+
import { createFallbackMethods, type FallbackMethods } from './fallback.js';
|
|
22
24
|
|
|
23
25
|
// Re-export types
|
|
24
26
|
export type { ApiClientConfig, ApiResponse, RetryConfig, RequestFn, ProxyFn } from './types.js';
|
|
@@ -33,6 +35,8 @@ export type { IdeasMethods } from './ideas.js';
|
|
|
33
35
|
export type { TasksMethods } from './tasks.js';
|
|
34
36
|
export type { FindingsMethods } from './findings.js';
|
|
35
37
|
export type { MilestonesMethods } from './milestones.js';
|
|
38
|
+
export type { ValidationMethods } from './validation.js';
|
|
39
|
+
export type { FallbackMethods } from './fallback.js';
|
|
36
40
|
|
|
37
41
|
const DEFAULT_API_URL = 'https://vibescope.dev';
|
|
38
42
|
|
|
@@ -79,8 +83,10 @@ export interface VibescopeApiClientMethods
|
|
|
79
83
|
DecisionsMethods,
|
|
80
84
|
IdeasMethods,
|
|
81
85
|
TasksMethods,
|
|
82
|
-
|
|
83
|
-
MilestonesMethods
|
|
86
|
+
FindingsMethods,
|
|
87
|
+
MilestonesMethods,
|
|
88
|
+
ValidationMethods,
|
|
89
|
+
FallbackMethods {}
|
|
84
90
|
|
|
85
91
|
export class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
86
92
|
private apiKey: string;
|
|
@@ -99,6 +105,8 @@ export class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
|
99
105
|
private tasksMethods: TasksMethods;
|
|
100
106
|
private findingsMethods: FindingsMethods;
|
|
101
107
|
private milestonesMethods: MilestonesMethods;
|
|
108
|
+
private validationMethods: ValidationMethods;
|
|
109
|
+
private fallbackMethods: FallbackMethods;
|
|
102
110
|
|
|
103
111
|
constructor(config: ApiClientConfig) {
|
|
104
112
|
this.apiKey = config.apiKey;
|
|
@@ -125,8 +133,10 @@ export class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
|
125
133
|
this.decisionsMethods = createDecisionsMethods(proxy);
|
|
126
134
|
this.ideasMethods = createIdeasMethods(proxy);
|
|
127
135
|
this.tasksMethods = createTasksMethods(request, proxy);
|
|
128
|
-
this.findingsMethods = createFindingsMethods(
|
|
129
|
-
this.milestonesMethods = createMilestonesMethods(
|
|
136
|
+
this.findingsMethods = createFindingsMethods(proxy);
|
|
137
|
+
this.milestonesMethods = createMilestonesMethods(proxy);
|
|
138
|
+
this.validationMethods = createValidationMethods(proxy);
|
|
139
|
+
this.fallbackMethods = createFallbackMethods(proxy);
|
|
130
140
|
}
|
|
131
141
|
|
|
132
142
|
private async request<T>(method: string, path: string, body?: unknown): Promise<ApiResponse<T>> {
|
|
@@ -319,27 +329,37 @@ export class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
|
319
329
|
// ============================================================================
|
|
320
330
|
getFindings = (projectId: string, params?: Parameters<FindingsMethods['getFindings']>[1]) => this.findingsMethods.getFindings(projectId, params);
|
|
321
331
|
getFinding = (findingId: string) => this.findingsMethods.getFinding(findingId);
|
|
322
|
-
addFinding = (params: Parameters<FindingsMethods['addFinding']>[0]) => this.findingsMethods.addFinding(params);
|
|
323
|
-
updateFinding = (findingId: string, params: Parameters<FindingsMethods['updateFinding']>[1]) => this.findingsMethods.updateFinding(findingId, params);
|
|
324
|
-
deleteFinding = (findingId: string) => this.findingsMethods.deleteFinding(findingId);
|
|
325
332
|
getFindingsStats = (projectId: string) => this.findingsMethods.getFindingsStats(projectId);
|
|
326
|
-
|
|
333
|
+
addFinding = (projectId: string, params: Parameters<FindingsMethods['addFinding']>[1], sessionId?: string) => this.findingsMethods.addFinding(projectId, params, sessionId);
|
|
334
|
+
updateFinding = (findingId: string, updates: Parameters<FindingsMethods['updateFinding']>[1]) => this.findingsMethods.updateFinding(findingId, updates);
|
|
335
|
+
deleteFinding = (findingId: string) => this.findingsMethods.deleteFinding(findingId);
|
|
327
336
|
|
|
328
337
|
// ============================================================================
|
|
329
338
|
// Milestones methods (delegated)
|
|
330
339
|
// ============================================================================
|
|
331
|
-
getMilestones = (
|
|
332
|
-
addMilestone = (params: Parameters<MilestonesMethods['addMilestone']>[
|
|
333
|
-
updateMilestone = (milestoneId: string,
|
|
334
|
-
completeMilestone = (milestoneId: string
|
|
340
|
+
getMilestones = (taskId: string) => this.milestonesMethods.getMilestones(taskId);
|
|
341
|
+
addMilestone = (taskId: string, params: Parameters<MilestonesMethods['addMilestone']>[1], sessionId?: string) => this.milestonesMethods.addMilestone(taskId, params, sessionId);
|
|
342
|
+
updateMilestone = (milestoneId: string, updates: Parameters<MilestonesMethods['updateMilestone']>[1]) => this.milestonesMethods.updateMilestone(milestoneId, updates);
|
|
343
|
+
completeMilestone = (milestoneId: string) => this.milestonesMethods.completeMilestone(milestoneId);
|
|
335
344
|
deleteMilestone = (milestoneId: string) => this.milestonesMethods.deleteMilestone(milestoneId);
|
|
336
345
|
|
|
346
|
+
// ============================================================================
|
|
347
|
+
// Validation methods (delegated)
|
|
348
|
+
// ============================================================================
|
|
349
|
+
getTasksAwaitingValidation = (projectId: string) => this.validationMethods.getTasksAwaitingValidation(projectId);
|
|
350
|
+
claimValidation = (taskId: string, sessionId?: string) => this.validationMethods.claimValidation(taskId, sessionId);
|
|
351
|
+
validateTask = (taskId: string, params: Parameters<ValidationMethods['validateTask']>[1], sessionId?: string) => this.validationMethods.validateTask(taskId, params, sessionId);
|
|
352
|
+
|
|
353
|
+
// ============================================================================
|
|
354
|
+
// Fallback activity methods (delegated)
|
|
355
|
+
// ============================================================================
|
|
356
|
+
startFallbackActivity = (projectId: string, activity: string, sessionId?: string) => this.fallbackMethods.startFallbackActivity(projectId, activity, sessionId);
|
|
357
|
+
stopFallbackActivity = (projectId: string, summary?: string, sessionId?: string) => this.fallbackMethods.stopFallbackActivity(projectId, summary, sessionId);
|
|
358
|
+
|
|
337
359
|
// ============================================================================
|
|
338
360
|
// TODO: Additional methods to be migrated from original api-client.ts
|
|
339
361
|
// The following domains need to be split into separate files:
|
|
340
362
|
// - requests.ts (getPendingRequests, answerQuestion, etc.)
|
|
341
|
-
// - validation.ts (getTasksAwaitingValidation, validateTask, etc.)
|
|
342
|
-
// - fallback.ts (startFallbackActivity, stopFallbackActivity)
|
|
343
363
|
// - deployment.ts (requestDeployment, startDeployment, etc.)
|
|
344
364
|
// - organizations.ts (listOrganizations, etc.)
|
|
345
365
|
// - bodies-of-work.ts (createBodyOfWork, etc.)
|
|
@@ -1,103 +1,83 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Milestones API Methods
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* - getMilestones: List milestones for a project
|
|
6
|
-
* - addMilestone: Create a new milestone
|
|
7
|
-
* - updateMilestone: Update an existing milestone
|
|
8
|
-
* - completeMilestone: Mark milestone as completed
|
|
9
|
-
* - deleteMilestone: Delete a milestone
|
|
4
|
+
* Handles task milestones for tracking granular progress within tasks.
|
|
10
5
|
*/
|
|
11
6
|
|
|
12
|
-
import type { ApiResponse,
|
|
7
|
+
import type { ApiResponse, ProxyFn } from './types.js';
|
|
8
|
+
|
|
9
|
+
export interface Milestone {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
status: string;
|
|
14
|
+
order_index: number;
|
|
15
|
+
created_at: string;
|
|
16
|
+
completed_at?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface MilestoneStats {
|
|
20
|
+
total: number;
|
|
21
|
+
completed: number;
|
|
22
|
+
progress_percentage: number;
|
|
23
|
+
}
|
|
13
24
|
|
|
14
25
|
export interface MilestonesMethods {
|
|
15
|
-
getMilestones(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
offset?: number;
|
|
19
|
-
}): Promise<ApiResponse<{
|
|
20
|
-
milestones: Array<{
|
|
21
|
-
id: string;
|
|
22
|
-
title: string;
|
|
23
|
-
description?: string;
|
|
24
|
-
due_date?: string;
|
|
25
|
-
status: string;
|
|
26
|
-
created_at: string;
|
|
27
|
-
completed_at?: string;
|
|
28
|
-
}>;
|
|
29
|
-
total_count: number;
|
|
30
|
-
has_more: boolean;
|
|
26
|
+
getMilestones(taskId: string): Promise<ApiResponse<{
|
|
27
|
+
milestones: Milestone[];
|
|
28
|
+
stats: MilestoneStats;
|
|
31
29
|
}>>;
|
|
32
30
|
|
|
33
|
-
addMilestone(params: {
|
|
34
|
-
project_id: string;
|
|
31
|
+
addMilestone(taskId: string, params: {
|
|
35
32
|
title: string;
|
|
36
33
|
description?: string;
|
|
37
|
-
|
|
38
|
-
}): Promise<ApiResponse<{
|
|
39
|
-
success: boolean;
|
|
40
|
-
milestone_id: string;
|
|
41
|
-
}>>;
|
|
34
|
+
order_index?: number;
|
|
35
|
+
}, sessionId?: string): Promise<ApiResponse<{ success: boolean; milestone_id: string }>>;
|
|
42
36
|
|
|
43
|
-
updateMilestone(milestoneId: string,
|
|
37
|
+
updateMilestone(milestoneId: string, updates: {
|
|
44
38
|
title?: string;
|
|
45
39
|
description?: string;
|
|
46
|
-
due_date?: string;
|
|
47
40
|
status?: string;
|
|
41
|
+
order_index?: number;
|
|
48
42
|
}): Promise<ApiResponse<{
|
|
49
43
|
success: boolean;
|
|
50
|
-
|
|
44
|
+
milestone: { id: string; title: string; status: string };
|
|
51
45
|
}>>;
|
|
52
46
|
|
|
53
|
-
completeMilestone(milestoneId: string
|
|
54
|
-
completion_note?: string;
|
|
55
|
-
}): Promise<ApiResponse<{
|
|
47
|
+
completeMilestone(milestoneId: string): Promise<ApiResponse<{
|
|
56
48
|
success: boolean;
|
|
57
|
-
|
|
58
|
-
completed_at: string;
|
|
49
|
+
milestone: { id: string; title: string; status: string };
|
|
59
50
|
}>>;
|
|
60
51
|
|
|
61
|
-
deleteMilestone(milestoneId: string): Promise<ApiResponse<{
|
|
62
|
-
success: boolean;
|
|
63
|
-
milestone_id: string;
|
|
64
|
-
}>>;
|
|
52
|
+
deleteMilestone(milestoneId: string): Promise<ApiResponse<{ success: boolean }>>;
|
|
65
53
|
}
|
|
66
54
|
|
|
67
|
-
export function createMilestonesMethods(
|
|
55
|
+
export function createMilestonesMethods(proxy: ProxyFn): MilestonesMethods {
|
|
68
56
|
return {
|
|
69
|
-
async getMilestones(
|
|
70
|
-
return
|
|
71
|
-
path: { id: projectId },
|
|
72
|
-
query: params,
|
|
73
|
-
});
|
|
57
|
+
async getMilestones(taskId) {
|
|
58
|
+
return proxy('get_milestones', { task_id: taskId });
|
|
74
59
|
},
|
|
75
60
|
|
|
76
|
-
async addMilestone(params) {
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
61
|
+
async addMilestone(taskId, params, sessionId) {
|
|
62
|
+
return proxy('add_milestone', {
|
|
63
|
+
task_id: taskId,
|
|
64
|
+
...params
|
|
65
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
81
66
|
},
|
|
82
67
|
|
|
83
|
-
async updateMilestone(milestoneId,
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
|
|
68
|
+
async updateMilestone(milestoneId, updates) {
|
|
69
|
+
return proxy('update_milestone', {
|
|
70
|
+
milestone_id: milestoneId,
|
|
71
|
+
...updates
|
|
87
72
|
});
|
|
88
73
|
},
|
|
89
74
|
|
|
90
|
-
async completeMilestone(milestoneId
|
|
91
|
-
return
|
|
92
|
-
path: { id: milestoneId },
|
|
93
|
-
body: params,
|
|
94
|
-
});
|
|
75
|
+
async completeMilestone(milestoneId) {
|
|
76
|
+
return proxy('complete_milestone', { milestone_id: milestoneId });
|
|
95
77
|
},
|
|
96
78
|
|
|
97
79
|
async deleteMilestone(milestoneId) {
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
});
|
|
101
|
-
},
|
|
80
|
+
return proxy('delete_milestone', { milestone_id: milestoneId });
|
|
81
|
+
}
|
|
102
82
|
};
|
|
103
|
-
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation API Methods
|
|
3
|
+
*
|
|
4
|
+
* Handles task validation workflow for code review and approval.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ApiResponse, ProxyFn } from './types.js';
|
|
8
|
+
|
|
9
|
+
export interface TaskAwaitingValidation {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
completed_at?: string;
|
|
13
|
+
completed_by_session_id?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ValidationMethods {
|
|
17
|
+
getTasksAwaitingValidation(projectId: string): Promise<ApiResponse<{
|
|
18
|
+
tasks: TaskAwaitingValidation[];
|
|
19
|
+
}>>;
|
|
20
|
+
|
|
21
|
+
claimValidation(taskId: string, sessionId?: string): Promise<ApiResponse<{
|
|
22
|
+
success: boolean;
|
|
23
|
+
task_id: string;
|
|
24
|
+
}>>;
|
|
25
|
+
|
|
26
|
+
validateTask(taskId: string, params: {
|
|
27
|
+
approved: boolean;
|
|
28
|
+
validation_notes?: string;
|
|
29
|
+
skip_pr_check?: boolean;
|
|
30
|
+
pr_checks_passing?: boolean;
|
|
31
|
+
create_fix_task?: boolean;
|
|
32
|
+
}, sessionId?: string): Promise<ApiResponse<{
|
|
33
|
+
success: boolean;
|
|
34
|
+
approved: boolean;
|
|
35
|
+
task_id: string;
|
|
36
|
+
message?: string;
|
|
37
|
+
workflow?: string;
|
|
38
|
+
}>>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function createValidationMethods(proxy: ProxyFn): ValidationMethods {
|
|
42
|
+
return {
|
|
43
|
+
async getTasksAwaitingValidation(projectId) {
|
|
44
|
+
return proxy('get_tasks_awaiting_validation', { project_id: projectId });
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
async claimValidation(taskId, sessionId) {
|
|
48
|
+
return proxy('claim_validation', { task_id: taskId }, sessionId ? {
|
|
49
|
+
session_id: sessionId
|
|
50
|
+
} : undefined);
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
async validateTask(taskId, params, sessionId) {
|
|
54
|
+
return proxy('validate_task', {
|
|
55
|
+
task_id: taskId,
|
|
56
|
+
...params
|
|
57
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|