@vibescope/mcp-server 0.3.13 → 0.3.15
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/api-client.js +8 -1
- 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 +30 -34
- 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/api-client.ts +10 -1
- 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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fallback Activity API Methods
|
|
3
|
+
*
|
|
4
|
+
* Handles background activities when agents are idle with no pending tasks.
|
|
5
|
+
*/
|
|
6
|
+
import type { ApiResponse, ProxyFn } from './types.js';
|
|
7
|
+
export interface FallbackActivityResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
activity: string;
|
|
10
|
+
message: string;
|
|
11
|
+
git_workflow?: {
|
|
12
|
+
workflow: string;
|
|
13
|
+
base_branch: string;
|
|
14
|
+
worktree_recommended: boolean;
|
|
15
|
+
note: string;
|
|
16
|
+
};
|
|
17
|
+
worktree_setup?: {
|
|
18
|
+
message: string;
|
|
19
|
+
commands: string[];
|
|
20
|
+
worktree_path: string;
|
|
21
|
+
branch_name: string;
|
|
22
|
+
cleanup_command: string;
|
|
23
|
+
report_worktree: string;
|
|
24
|
+
};
|
|
25
|
+
next_step?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface FallbackMethods {
|
|
28
|
+
startFallbackActivity(projectId: string, activity: string, sessionId?: string): Promise<ApiResponse<FallbackActivityResult>>;
|
|
29
|
+
stopFallbackActivity(projectId: string, summary?: string, sessionId?: string): Promise<ApiResponse<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
}>>;
|
|
32
|
+
}
|
|
33
|
+
export declare function createFallbackMethods(proxy: ProxyFn): FallbackMethods;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fallback Activity API Methods
|
|
3
|
+
*
|
|
4
|
+
* Handles background activities when agents are idle with no pending tasks.
|
|
5
|
+
*/
|
|
6
|
+
export function createFallbackMethods(proxy) {
|
|
7
|
+
return {
|
|
8
|
+
async startFallbackActivity(projectId, activity, sessionId) {
|
|
9
|
+
return proxy('start_fallback_activity', {
|
|
10
|
+
project_id: projectId,
|
|
11
|
+
activity
|
|
12
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
13
|
+
},
|
|
14
|
+
async stopFallbackActivity(projectId, summary, sessionId) {
|
|
15
|
+
return proxy('stop_fallback_activity', {
|
|
16
|
+
project_id: projectId,
|
|
17
|
+
summary
|
|
18
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -1,97 +1,69 @@
|
|
|
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
|
-
import type { ApiResponse,
|
|
6
|
+
import type { ApiResponse, ProxyFn } from './types.js';
|
|
7
|
+
export interface Finding {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
category: string;
|
|
12
|
+
severity: string;
|
|
13
|
+
status: string;
|
|
14
|
+
file_path?: string;
|
|
15
|
+
line_number?: number;
|
|
16
|
+
resolution_note?: string;
|
|
17
|
+
created_at: string;
|
|
18
|
+
}
|
|
19
|
+
export interface FindingsStats {
|
|
20
|
+
total: number;
|
|
21
|
+
by_status: Record<string, number>;
|
|
22
|
+
by_severity: Record<string, number>;
|
|
23
|
+
by_category: Record<string, number>;
|
|
24
|
+
}
|
|
14
25
|
export interface FindingsMethods {
|
|
15
26
|
getFindings(projectId: string, params?: {
|
|
16
27
|
category?: string;
|
|
17
28
|
severity?: string;
|
|
18
29
|
status?: string;
|
|
19
|
-
summary_only?: boolean;
|
|
20
30
|
limit?: number;
|
|
21
31
|
offset?: number;
|
|
32
|
+
search_query?: string;
|
|
33
|
+
summary_only?: boolean;
|
|
22
34
|
}): Promise<ApiResponse<{
|
|
23
|
-
findings:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
description?: string;
|
|
27
|
-
category: string;
|
|
28
|
-
severity: string;
|
|
29
|
-
status: string;
|
|
30
|
-
created_at: string;
|
|
31
|
-
updated_at?: string;
|
|
32
|
-
related_task_id?: string;
|
|
33
|
-
}>;
|
|
34
|
-
total_count: number;
|
|
35
|
-
has_more: boolean;
|
|
35
|
+
findings: Finding[];
|
|
36
|
+
total_count?: number;
|
|
37
|
+
has_more?: boolean;
|
|
36
38
|
}>>;
|
|
37
39
|
getFinding(findingId: string): Promise<ApiResponse<{
|
|
38
|
-
|
|
39
|
-
title: string;
|
|
40
|
-
description?: string;
|
|
41
|
-
category: string;
|
|
42
|
-
severity: string;
|
|
43
|
-
status: string;
|
|
44
|
-
created_at: string;
|
|
45
|
-
updated_at?: string;
|
|
46
|
-
related_task_id?: string;
|
|
40
|
+
finding: Finding;
|
|
47
41
|
}>>;
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
getFindingsStats(projectId: string): Promise<ApiResponse<FindingsStats>>;
|
|
43
|
+
addFinding(projectId: string, params: {
|
|
50
44
|
title: string;
|
|
51
45
|
description?: string;
|
|
52
46
|
category?: string;
|
|
53
47
|
severity?: string;
|
|
48
|
+
file_path?: string;
|
|
49
|
+
line_number?: number;
|
|
54
50
|
related_task_id?: string;
|
|
55
|
-
}): Promise<ApiResponse<{
|
|
51
|
+
}, sessionId?: string): Promise<ApiResponse<{
|
|
56
52
|
success: boolean;
|
|
57
53
|
finding_id: string;
|
|
58
54
|
}>>;
|
|
59
|
-
updateFinding(findingId: string,
|
|
55
|
+
updateFinding(findingId: string, updates: {
|
|
60
56
|
title?: string;
|
|
61
57
|
description?: string;
|
|
62
|
-
category?: string;
|
|
63
58
|
severity?: string;
|
|
64
59
|
status?: string;
|
|
65
|
-
|
|
60
|
+
resolution_note?: string;
|
|
66
61
|
}): Promise<ApiResponse<{
|
|
67
62
|
success: boolean;
|
|
68
63
|
finding_id: string;
|
|
69
64
|
}>>;
|
|
70
65
|
deleteFinding(findingId: string): Promise<ApiResponse<{
|
|
71
66
|
success: boolean;
|
|
72
|
-
finding_id: string;
|
|
73
|
-
}>>;
|
|
74
|
-
getFindingsStats(projectId: string): Promise<ApiResponse<{
|
|
75
|
-
total: number;
|
|
76
|
-
by_severity: Record<string, number>;
|
|
77
|
-
by_category: Record<string, number>;
|
|
78
|
-
by_status: Record<string, number>;
|
|
79
|
-
}>>;
|
|
80
|
-
queryKnowledgeBase(projectId: string, params: {
|
|
81
|
-
query: string;
|
|
82
|
-
category?: string;
|
|
83
|
-
severity?: string;
|
|
84
|
-
limit?: number;
|
|
85
|
-
}): Promise<ApiResponse<{
|
|
86
|
-
findings: Array<{
|
|
87
|
-
id: string;
|
|
88
|
-
title: string;
|
|
89
|
-
description?: string;
|
|
90
|
-
category: string;
|
|
91
|
-
severity: string;
|
|
92
|
-
relevance_score?: number;
|
|
93
|
-
}>;
|
|
94
|
-
total_count: number;
|
|
95
67
|
}>>;
|
|
96
68
|
}
|
|
97
|
-
export declare function createFindingsMethods(
|
|
69
|
+
export declare function createFindingsMethods(proxy: ProxyFn): FindingsMethods;
|
|
@@ -1,55 +1,36 @@
|
|
|
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
|
-
export function createFindingsMethods(
|
|
6
|
+
export function createFindingsMethods(proxy) {
|
|
14
7
|
return {
|
|
15
8
|
async getFindings(projectId, params) {
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
return proxy('get_findings', {
|
|
10
|
+
project_id: projectId,
|
|
11
|
+
...params
|
|
19
12
|
});
|
|
20
13
|
},
|
|
21
14
|
async getFinding(findingId) {
|
|
22
|
-
return
|
|
23
|
-
path: { id: findingId },
|
|
24
|
-
});
|
|
25
|
-
},
|
|
26
|
-
async addFinding(params) {
|
|
27
|
-
return request('/api/mcp/projects/{id}/findings', 'POST', {
|
|
28
|
-
path: { id: params.project_id },
|
|
29
|
-
body: params,
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
async updateFinding(findingId, params) {
|
|
33
|
-
return request('/api/mcp/findings/{id}', 'PATCH', {
|
|
34
|
-
path: { id: findingId },
|
|
35
|
-
body: params,
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
async deleteFinding(findingId) {
|
|
39
|
-
return request('/api/mcp/findings/{id}', 'DELETE', {
|
|
40
|
-
path: { id: findingId },
|
|
41
|
-
});
|
|
15
|
+
return proxy('get_finding', { finding_id: findingId });
|
|
42
16
|
},
|
|
43
17
|
async getFindingsStats(projectId) {
|
|
44
|
-
return
|
|
45
|
-
path: { id: projectId },
|
|
46
|
-
});
|
|
18
|
+
return proxy('get_findings_stats', { project_id: projectId });
|
|
47
19
|
},
|
|
48
|
-
async
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
20
|
+
async addFinding(projectId, params, sessionId) {
|
|
21
|
+
return proxy('add_finding', {
|
|
22
|
+
project_id: projectId,
|
|
23
|
+
...params
|
|
24
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
25
|
+
},
|
|
26
|
+
async updateFinding(findingId, updates) {
|
|
27
|
+
return proxy('update_finding', {
|
|
28
|
+
finding_id: findingId,
|
|
29
|
+
...updates
|
|
52
30
|
});
|
|
53
31
|
},
|
|
32
|
+
async deleteFinding(findingId) {
|
|
33
|
+
return proxy('delete_finding', { finding_id: findingId });
|
|
34
|
+
}
|
|
54
35
|
};
|
|
55
36
|
}
|
|
@@ -18,6 +18,8 @@ import { type IdeasMethods } from './ideas.js';
|
|
|
18
18
|
import { type TasksMethods } from './tasks.js';
|
|
19
19
|
import { type FindingsMethods } from './findings.js';
|
|
20
20
|
import { type MilestonesMethods } from './milestones.js';
|
|
21
|
+
import { type ValidationMethods } from './validation.js';
|
|
22
|
+
import { type FallbackMethods } from './fallback.js';
|
|
21
23
|
export type { ApiClientConfig, ApiResponse, RetryConfig, RequestFn, ProxyFn } from './types.js';
|
|
22
24
|
export type { SessionMethods } from './session.js';
|
|
23
25
|
export type { ProjectMethods } from './project.js';
|
|
@@ -30,10 +32,12 @@ export type { IdeasMethods } from './ideas.js';
|
|
|
30
32
|
export type { TasksMethods } from './tasks.js';
|
|
31
33
|
export type { FindingsMethods } from './findings.js';
|
|
32
34
|
export type { MilestonesMethods } from './milestones.js';
|
|
35
|
+
export type { ValidationMethods } from './validation.js';
|
|
36
|
+
export type { FallbackMethods } from './fallback.js';
|
|
33
37
|
/**
|
|
34
38
|
* Combined interface for all API methods
|
|
35
39
|
*/
|
|
36
|
-
export interface VibescopeApiClientMethods extends SessionMethods, ProjectMethods, BlockersMethods, CostMethods, WorktreesMethods, DiscoveryMethods, DecisionsMethods, IdeasMethods, TasksMethods,
|
|
40
|
+
export interface VibescopeApiClientMethods extends SessionMethods, ProjectMethods, BlockersMethods, CostMethods, WorktreesMethods, DiscoveryMethods, DecisionsMethods, IdeasMethods, TasksMethods, FindingsMethods, MilestonesMethods, ValidationMethods, FallbackMethods {
|
|
37
41
|
}
|
|
38
42
|
export declare class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
39
43
|
private apiKey;
|
|
@@ -50,6 +54,8 @@ export declare class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
|
50
54
|
private tasksMethods;
|
|
51
55
|
private findingsMethods;
|
|
52
56
|
private milestonesMethods;
|
|
57
|
+
private validationMethods;
|
|
58
|
+
private fallbackMethods;
|
|
53
59
|
constructor(config: ApiClientConfig);
|
|
54
60
|
private request;
|
|
55
61
|
/**
|
|
@@ -574,11 +580,7 @@ export declare class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
|
574
580
|
estimated_minutes?: number;
|
|
575
581
|
started_at?: string;
|
|
576
582
|
completed_at?: string;
|
|
577
|
-
git_branch
|
|
578
|
-
/**
|
|
579
|
-
* Combined interface for all API methods
|
|
580
|
-
*/
|
|
581
|
-
?: string;
|
|
583
|
+
git_branch?: string;
|
|
582
584
|
blocking?: boolean;
|
|
583
585
|
references?: Array<{
|
|
584
586
|
url: string;
|
|
@@ -755,78 +757,69 @@ export declare class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
|
755
757
|
}>;
|
|
756
758
|
}>>;
|
|
757
759
|
getFindings: (projectId: string, params?: Parameters<FindingsMethods["getFindings"]>[1]) => Promise<ApiResponse<{
|
|
758
|
-
findings:
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
description?: string;
|
|
762
|
-
category: string;
|
|
763
|
-
severity: string;
|
|
764
|
-
status: string;
|
|
765
|
-
created_at: string;
|
|
766
|
-
updated_at?: string;
|
|
767
|
-
related_task_id?: string;
|
|
768
|
-
}>;
|
|
769
|
-
total_count: number;
|
|
770
|
-
has_more: boolean;
|
|
760
|
+
findings: import("./findings.js").Finding[];
|
|
761
|
+
total_count?: number;
|
|
762
|
+
has_more?: boolean;
|
|
771
763
|
}>>;
|
|
772
764
|
getFinding: (findingId: string) => Promise<ApiResponse<{
|
|
773
|
-
|
|
774
|
-
title: string;
|
|
775
|
-
description?: string;
|
|
776
|
-
category: string;
|
|
777
|
-
severity: string;
|
|
778
|
-
status: string;
|
|
779
|
-
created_at: string;
|
|
780
|
-
updated_at?: string;
|
|
781
|
-
related_task_id?: string;
|
|
765
|
+
finding: import("./findings.js").Finding;
|
|
782
766
|
}>>;
|
|
783
|
-
|
|
767
|
+
getFindingsStats: (projectId: string) => Promise<ApiResponse<import("./findings.js").FindingsStats>>;
|
|
768
|
+
addFinding: (projectId: string, params: Parameters<FindingsMethods["addFinding"]>[1], sessionId?: string) => Promise<ApiResponse<{
|
|
784
769
|
success: boolean;
|
|
785
770
|
finding_id: string;
|
|
786
771
|
}>>;
|
|
787
|
-
updateFinding: (findingId: string,
|
|
772
|
+
updateFinding: (findingId: string, updates: Parameters<FindingsMethods["updateFinding"]>[1]) => Promise<ApiResponse<{
|
|
788
773
|
success: boolean;
|
|
789
774
|
finding_id: string;
|
|
790
775
|
}>>;
|
|
791
776
|
deleteFinding: (findingId: string) => Promise<ApiResponse<{
|
|
792
777
|
success: boolean;
|
|
793
|
-
finding_id: string;
|
|
794
778
|
}>>;
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
by_category: Record<string, number>;
|
|
799
|
-
by_status: Record<string, number>;
|
|
779
|
+
getMilestones: (taskId: string) => Promise<ApiResponse<{
|
|
780
|
+
milestones: import("./milestones.js").Milestone[];
|
|
781
|
+
stats: import("./milestones.js").MilestoneStats;
|
|
800
782
|
}>>;
|
|
801
|
-
|
|
802
|
-
|
|
783
|
+
addMilestone: (taskId: string, params: Parameters<MilestonesMethods["addMilestone"]>[1], sessionId?: string) => Promise<ApiResponse<{
|
|
784
|
+
success: boolean;
|
|
785
|
+
milestone_id: string;
|
|
786
|
+
}>>;
|
|
787
|
+
updateMilestone: (milestoneId: string, updates: Parameters<MilestonesMethods["updateMilestone"]>[1]) => Promise<ApiResponse<{
|
|
788
|
+
success: boolean;
|
|
789
|
+
milestone: {
|
|
803
790
|
id: string;
|
|
804
791
|
title: string;
|
|
805
|
-
description?: string;
|
|
806
|
-
due_date?: string;
|
|
807
792
|
status: string;
|
|
808
|
-
|
|
809
|
-
completed_at?: string;
|
|
810
|
-
}>;
|
|
811
|
-
total_count: number;
|
|
812
|
-
has_more: boolean;
|
|
793
|
+
};
|
|
813
794
|
}>>;
|
|
814
|
-
|
|
795
|
+
completeMilestone: (milestoneId: string) => Promise<ApiResponse<{
|
|
815
796
|
success: boolean;
|
|
816
|
-
|
|
797
|
+
milestone: {
|
|
798
|
+
id: string;
|
|
799
|
+
title: string;
|
|
800
|
+
status: string;
|
|
801
|
+
};
|
|
817
802
|
}>>;
|
|
818
|
-
|
|
803
|
+
deleteMilestone: (milestoneId: string) => Promise<ApiResponse<{
|
|
819
804
|
success: boolean;
|
|
820
|
-
milestone_id: string;
|
|
821
805
|
}>>;
|
|
822
|
-
|
|
806
|
+
getTasksAwaitingValidation: (projectId: string) => Promise<ApiResponse<{
|
|
807
|
+
tasks: import("./validation.js").TaskAwaitingValidation[];
|
|
808
|
+
}>>;
|
|
809
|
+
claimValidation: (taskId: string, sessionId?: string) => Promise<ApiResponse<{
|
|
823
810
|
success: boolean;
|
|
824
|
-
|
|
825
|
-
completed_at: string;
|
|
811
|
+
task_id: string;
|
|
826
812
|
}>>;
|
|
827
|
-
|
|
813
|
+
validateTask: (taskId: string, params: Parameters<ValidationMethods["validateTask"]>[1], sessionId?: string) => Promise<ApiResponse<{
|
|
814
|
+
success: boolean;
|
|
815
|
+
approved: boolean;
|
|
816
|
+
task_id: string;
|
|
817
|
+
message?: string;
|
|
818
|
+
workflow?: string;
|
|
819
|
+
}>>;
|
|
820
|
+
startFallbackActivity: (projectId: string, activity: string, sessionId?: string) => Promise<ApiResponse<import("./fallback.js").FallbackActivityResult>>;
|
|
821
|
+
stopFallbackActivity: (projectId: string, summary?: string, sessionId?: string) => Promise<ApiResponse<{
|
|
828
822
|
success: boolean;
|
|
829
|
-
milestone_id: string;
|
|
830
823
|
}>>;
|
|
831
824
|
}
|
|
832
825
|
export declare function getApiClient(): VibescopeApiClient;
|
package/dist/api-client/index.js
CHANGED
|
@@ -17,6 +17,8 @@ import { createIdeasMethods } from './ideas.js';
|
|
|
17
17
|
import { createTasksMethods } from './tasks.js';
|
|
18
18
|
import { createFindingsMethods } from './findings.js';
|
|
19
19
|
import { createMilestonesMethods } from './milestones.js';
|
|
20
|
+
import { createValidationMethods } from './validation.js';
|
|
21
|
+
import { createFallbackMethods } from './fallback.js';
|
|
20
22
|
const DEFAULT_API_URL = 'https://vibescope.dev';
|
|
21
23
|
// Retry configuration defaults
|
|
22
24
|
const DEFAULT_RETRY_STATUS_CODES = [429, 503, 504];
|
|
@@ -56,6 +58,8 @@ export class VibescopeApiClient {
|
|
|
56
58
|
tasksMethods;
|
|
57
59
|
findingsMethods;
|
|
58
60
|
milestonesMethods;
|
|
61
|
+
validationMethods;
|
|
62
|
+
fallbackMethods;
|
|
59
63
|
constructor(config) {
|
|
60
64
|
this.apiKey = config.apiKey;
|
|
61
65
|
this.baseUrl = config.baseUrl || process.env.VIBESCOPE_API_URL || DEFAULT_API_URL;
|
|
@@ -79,8 +83,10 @@ export class VibescopeApiClient {
|
|
|
79
83
|
this.decisionsMethods = createDecisionsMethods(proxy);
|
|
80
84
|
this.ideasMethods = createIdeasMethods(proxy);
|
|
81
85
|
this.tasksMethods = createTasksMethods(request, proxy);
|
|
82
|
-
this.findingsMethods = createFindingsMethods(
|
|
83
|
-
this.milestonesMethods = createMilestonesMethods(
|
|
86
|
+
this.findingsMethods = createFindingsMethods(proxy);
|
|
87
|
+
this.milestonesMethods = createMilestonesMethods(proxy);
|
|
88
|
+
this.validationMethods = createValidationMethods(proxy);
|
|
89
|
+
this.fallbackMethods = createFallbackMethods(proxy);
|
|
84
90
|
}
|
|
85
91
|
async request(method, path, body) {
|
|
86
92
|
const url = `${this.baseUrl}${path}`;
|
|
@@ -253,19 +259,29 @@ export class VibescopeApiClient {
|
|
|
253
259
|
// ============================================================================
|
|
254
260
|
getFindings = (projectId, params) => this.findingsMethods.getFindings(projectId, params);
|
|
255
261
|
getFinding = (findingId) => this.findingsMethods.getFinding(findingId);
|
|
256
|
-
addFinding = (params) => this.findingsMethods.addFinding(params);
|
|
257
|
-
updateFinding = (findingId, params) => this.findingsMethods.updateFinding(findingId, params);
|
|
258
|
-
deleteFinding = (findingId) => this.findingsMethods.deleteFinding(findingId);
|
|
259
262
|
getFindingsStats = (projectId) => this.findingsMethods.getFindingsStats(projectId);
|
|
260
|
-
|
|
263
|
+
addFinding = (projectId, params, sessionId) => this.findingsMethods.addFinding(projectId, params, sessionId);
|
|
264
|
+
updateFinding = (findingId, updates) => this.findingsMethods.updateFinding(findingId, updates);
|
|
265
|
+
deleteFinding = (findingId) => this.findingsMethods.deleteFinding(findingId);
|
|
261
266
|
// ============================================================================
|
|
262
267
|
// Milestones methods (delegated)
|
|
263
268
|
// ============================================================================
|
|
264
|
-
getMilestones = (
|
|
265
|
-
addMilestone = (params) => this.milestonesMethods.addMilestone(params);
|
|
266
|
-
updateMilestone = (milestoneId,
|
|
267
|
-
completeMilestone = (milestoneId
|
|
269
|
+
getMilestones = (taskId) => this.milestonesMethods.getMilestones(taskId);
|
|
270
|
+
addMilestone = (taskId, params, sessionId) => this.milestonesMethods.addMilestone(taskId, params, sessionId);
|
|
271
|
+
updateMilestone = (milestoneId, updates) => this.milestonesMethods.updateMilestone(milestoneId, updates);
|
|
272
|
+
completeMilestone = (milestoneId) => this.milestonesMethods.completeMilestone(milestoneId);
|
|
268
273
|
deleteMilestone = (milestoneId) => this.milestonesMethods.deleteMilestone(milestoneId);
|
|
274
|
+
// ============================================================================
|
|
275
|
+
// Validation methods (delegated)
|
|
276
|
+
// ============================================================================
|
|
277
|
+
getTasksAwaitingValidation = (projectId) => this.validationMethods.getTasksAwaitingValidation(projectId);
|
|
278
|
+
claimValidation = (taskId, sessionId) => this.validationMethods.claimValidation(taskId, sessionId);
|
|
279
|
+
validateTask = (taskId, params, sessionId) => this.validationMethods.validateTask(taskId, params, sessionId);
|
|
280
|
+
// ============================================================================
|
|
281
|
+
// Fallback activity methods (delegated)
|
|
282
|
+
// ============================================================================
|
|
283
|
+
startFallbackActivity = (projectId, activity, sessionId) => this.fallbackMethods.startFallbackActivity(projectId, activity, sessionId);
|
|
284
|
+
stopFallbackActivity = (projectId, summary, sessionId) => this.fallbackMethods.stopFallbackActivity(projectId, summary, sessionId);
|
|
269
285
|
}
|
|
270
286
|
// Singleton instance
|
|
271
287
|
let apiClient = null;
|
|
@@ -1,60 +1,59 @@
|
|
|
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
|
-
import type { ApiResponse,
|
|
6
|
+
import type { ApiResponse, ProxyFn } from './types.js';
|
|
7
|
+
export interface Milestone {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
status: string;
|
|
12
|
+
order_index: number;
|
|
13
|
+
created_at: string;
|
|
14
|
+
completed_at?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface MilestoneStats {
|
|
17
|
+
total: number;
|
|
18
|
+
completed: number;
|
|
19
|
+
progress_percentage: number;
|
|
20
|
+
}
|
|
12
21
|
export interface MilestonesMethods {
|
|
13
|
-
getMilestones(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
offset?: number;
|
|
17
|
-
}): Promise<ApiResponse<{
|
|
18
|
-
milestones: Array<{
|
|
19
|
-
id: string;
|
|
20
|
-
title: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
due_date?: string;
|
|
23
|
-
status: string;
|
|
24
|
-
created_at: string;
|
|
25
|
-
completed_at?: string;
|
|
26
|
-
}>;
|
|
27
|
-
total_count: number;
|
|
28
|
-
has_more: boolean;
|
|
22
|
+
getMilestones(taskId: string): Promise<ApiResponse<{
|
|
23
|
+
milestones: Milestone[];
|
|
24
|
+
stats: MilestoneStats;
|
|
29
25
|
}>>;
|
|
30
|
-
addMilestone(params: {
|
|
31
|
-
project_id: string;
|
|
26
|
+
addMilestone(taskId: string, params: {
|
|
32
27
|
title: string;
|
|
33
28
|
description?: string;
|
|
34
|
-
|
|
35
|
-
}): Promise<ApiResponse<{
|
|
29
|
+
order_index?: number;
|
|
30
|
+
}, sessionId?: string): Promise<ApiResponse<{
|
|
36
31
|
success: boolean;
|
|
37
32
|
milestone_id: string;
|
|
38
33
|
}>>;
|
|
39
|
-
updateMilestone(milestoneId: string,
|
|
34
|
+
updateMilestone(milestoneId: string, updates: {
|
|
40
35
|
title?: string;
|
|
41
36
|
description?: string;
|
|
42
|
-
due_date?: string;
|
|
43
37
|
status?: string;
|
|
38
|
+
order_index?: number;
|
|
44
39
|
}): Promise<ApiResponse<{
|
|
45
40
|
success: boolean;
|
|
46
|
-
|
|
41
|
+
milestone: {
|
|
42
|
+
id: string;
|
|
43
|
+
title: string;
|
|
44
|
+
status: string;
|
|
45
|
+
};
|
|
47
46
|
}>>;
|
|
48
|
-
completeMilestone(milestoneId: string
|
|
49
|
-
completion_note?: string;
|
|
50
|
-
}): Promise<ApiResponse<{
|
|
47
|
+
completeMilestone(milestoneId: string): Promise<ApiResponse<{
|
|
51
48
|
success: boolean;
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
milestone: {
|
|
50
|
+
id: string;
|
|
51
|
+
title: string;
|
|
52
|
+
status: string;
|
|
53
|
+
};
|
|
54
54
|
}>>;
|
|
55
55
|
deleteMilestone(milestoneId: string): Promise<ApiResponse<{
|
|
56
56
|
success: boolean;
|
|
57
|
-
milestone_id: string;
|
|
58
57
|
}>>;
|
|
59
58
|
}
|
|
60
|
-
export declare function createMilestonesMethods(
|
|
59
|
+
export declare function createMilestonesMethods(proxy: ProxyFn): MilestonesMethods;
|
|
@@ -1,43 +1,30 @@
|
|
|
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
|
-
export function createMilestonesMethods(
|
|
6
|
+
export function createMilestonesMethods(proxy) {
|
|
12
7
|
return {
|
|
13
|
-
async getMilestones(
|
|
14
|
-
return
|
|
15
|
-
path: { id: projectId },
|
|
16
|
-
query: params,
|
|
17
|
-
});
|
|
8
|
+
async getMilestones(taskId) {
|
|
9
|
+
return proxy('get_milestones', { task_id: taskId });
|
|
18
10
|
},
|
|
19
|
-
async addMilestone(params) {
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
11
|
+
async addMilestone(taskId, params, sessionId) {
|
|
12
|
+
return proxy('add_milestone', {
|
|
13
|
+
task_id: taskId,
|
|
14
|
+
...params
|
|
15
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
24
16
|
},
|
|
25
|
-
async updateMilestone(milestoneId,
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
async updateMilestone(milestoneId, updates) {
|
|
18
|
+
return proxy('update_milestone', {
|
|
19
|
+
milestone_id: milestoneId,
|
|
20
|
+
...updates
|
|
29
21
|
});
|
|
30
22
|
},
|
|
31
|
-
async completeMilestone(milestoneId
|
|
32
|
-
return
|
|
33
|
-
path: { id: milestoneId },
|
|
34
|
-
body: params,
|
|
35
|
-
});
|
|
23
|
+
async completeMilestone(milestoneId) {
|
|
24
|
+
return proxy('complete_milestone', { milestone_id: milestoneId });
|
|
36
25
|
},
|
|
37
26
|
async deleteMilestone(milestoneId) {
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
},
|
|
27
|
+
return proxy('delete_milestone', { milestone_id: milestoneId });
|
|
28
|
+
}
|
|
42
29
|
};
|
|
43
30
|
}
|