@vibescope/mcp-server 0.4.0 → 0.4.2
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 +69 -0
- package/dist/api-client/findings.js +36 -0
- package/dist/api-client/index.d.ts +78 -1
- package/dist/api-client/index.js +74 -4
- package/dist/api-client/milestones.d.ts +59 -0
- package/dist/api-client/milestones.js +30 -0
- package/dist/api-client/validation.d.ts +35 -0
- package/dist/api-client/validation.js +23 -0
- package/dist/api-client.d.ts +4 -0
- package/dist/cli-init.d.ts +17 -0
- package/dist/cli-init.js +497 -0
- package/dist/handlers/cloud-agents.d.ts +4 -0
- package/dist/handlers/cloud-agents.js +26 -12
- package/dist/handlers/discovery.js +15 -0
- package/dist/handlers/findings.js +1 -1
- package/dist/handlers/ideas.js +1 -1
- package/dist/handlers/index.d.ts +1 -0
- package/dist/handlers/index.js +3 -0
- package/dist/handlers/session.js +115 -2
- package/dist/handlers/tasks.js +7 -5
- package/dist/handlers/tool-docs.js +344 -0
- package/dist/handlers/version.d.ts +5 -0
- package/dist/handlers/version.js +53 -0
- package/dist/index.js +7 -0
- package/dist/templates/agent-guidelines.d.ts +3 -1
- package/dist/templates/agent-guidelines.js +5 -1
- package/dist/templates/help-content.js +2 -2
- package/dist/tools/chat.d.ts +7 -0
- package/dist/tools/chat.js +43 -0
- package/dist/tools/cloud-agents.js +31 -0
- package/dist/tools/index.d.ts +3 -1
- package/dist/tools/index.js +6 -1
- package/dist/tools/project.js +1 -1
- package/dist/tools/tasks.js +8 -0
- package/dist/tools/version.d.ts +5 -0
- package/dist/tools/version.js +28 -0
- package/dist/version.d.ts +28 -0
- package/dist/version.js +91 -0
- package/docs/TOOLS.md +93 -3
- package/package.json +4 -2
- package/src/api-client/fallback.ts +52 -0
- package/src/api-client/findings.ts +100 -0
- package/src/api-client/index.ts +91 -9
- package/src/api-client/milestones.ts +83 -0
- package/src/api-client/validation.ts +60 -0
- package/src/api-client.ts +4 -0
- package/src/cli-init.ts +557 -0
- package/src/handlers/cloud-agents.test.ts +438 -0
- package/src/handlers/cloud-agents.ts +35 -17
- package/src/handlers/discovery.ts +15 -0
- package/src/handlers/findings.ts +1 -1
- package/src/handlers/ideas.ts +1 -1
- package/src/handlers/index.ts +3 -0
- package/src/handlers/session.ts +128 -2
- package/src/handlers/tasks.ts +7 -5
- package/src/handlers/tool-docs.test.ts +511 -0
- package/src/handlers/tool-docs.ts +382 -0
- package/src/handlers/version.ts +63 -0
- package/src/index.ts +9 -0
- package/src/templates/agent-guidelines.ts +6 -1
- package/src/templates/help-content.ts +2 -2
- package/src/tools/chat.ts +46 -0
- package/src/tools/cloud-agents.ts +31 -0
- package/src/tools/index.ts +6 -0
- package/src/tools/project.ts +1 -1
- package/src/tools/tasks.ts +8 -0
- package/src/tools/version.ts +34 -0
- package/src/version.ts +109 -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
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Findings API Methods
|
|
3
|
+
*
|
|
4
|
+
* Handles security findings, code quality issues, and audit findings.
|
|
5
|
+
*/
|
|
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
|
+
}
|
|
25
|
+
export interface FindingsMethods {
|
|
26
|
+
getFindings(projectId: string, params?: {
|
|
27
|
+
category?: string;
|
|
28
|
+
severity?: string;
|
|
29
|
+
status?: string;
|
|
30
|
+
limit?: number;
|
|
31
|
+
offset?: number;
|
|
32
|
+
search_query?: string;
|
|
33
|
+
summary_only?: boolean;
|
|
34
|
+
}): Promise<ApiResponse<{
|
|
35
|
+
findings: Finding[];
|
|
36
|
+
total_count?: number;
|
|
37
|
+
has_more?: boolean;
|
|
38
|
+
}>>;
|
|
39
|
+
getFinding(findingId: string): Promise<ApiResponse<{
|
|
40
|
+
finding: Finding;
|
|
41
|
+
}>>;
|
|
42
|
+
getFindingsStats(projectId: string): Promise<ApiResponse<FindingsStats>>;
|
|
43
|
+
addFinding(projectId: string, params: {
|
|
44
|
+
title: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
category?: string;
|
|
47
|
+
severity?: string;
|
|
48
|
+
file_path?: string;
|
|
49
|
+
line_number?: number;
|
|
50
|
+
related_task_id?: string;
|
|
51
|
+
}, sessionId?: string): Promise<ApiResponse<{
|
|
52
|
+
success: boolean;
|
|
53
|
+
finding_id: string;
|
|
54
|
+
}>>;
|
|
55
|
+
updateFinding(findingId: string, updates: {
|
|
56
|
+
title?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
severity?: string;
|
|
59
|
+
status?: string;
|
|
60
|
+
resolution_note?: string;
|
|
61
|
+
}): Promise<ApiResponse<{
|
|
62
|
+
success: boolean;
|
|
63
|
+
finding_id: string;
|
|
64
|
+
}>>;
|
|
65
|
+
deleteFinding(findingId: string): Promise<ApiResponse<{
|
|
66
|
+
success: boolean;
|
|
67
|
+
}>>;
|
|
68
|
+
}
|
|
69
|
+
export declare function createFindingsMethods(proxy: ProxyFn): FindingsMethods;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Findings API Methods
|
|
3
|
+
*
|
|
4
|
+
* Handles security findings, code quality issues, and audit findings.
|
|
5
|
+
*/
|
|
6
|
+
export function createFindingsMethods(proxy) {
|
|
7
|
+
return {
|
|
8
|
+
async getFindings(projectId, params) {
|
|
9
|
+
return proxy('get_findings', {
|
|
10
|
+
project_id: projectId,
|
|
11
|
+
...params
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
async getFinding(findingId) {
|
|
15
|
+
return proxy('get_finding', { finding_id: findingId });
|
|
16
|
+
},
|
|
17
|
+
async getFindingsStats(projectId) {
|
|
18
|
+
return proxy('get_findings_stats', { project_id: projectId });
|
|
19
|
+
},
|
|
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
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
async deleteFinding(findingId) {
|
|
33
|
+
return proxy('delete_finding', { finding_id: findingId });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -16,6 +16,10 @@ import { type DiscoveryMethods } from './discovery.js';
|
|
|
16
16
|
import { type DecisionsMethods } from './decisions.js';
|
|
17
17
|
import { type IdeasMethods } from './ideas.js';
|
|
18
18
|
import { type TasksMethods } from './tasks.js';
|
|
19
|
+
import { type FindingsMethods } from './findings.js';
|
|
20
|
+
import { type MilestonesMethods } from './milestones.js';
|
|
21
|
+
import { type ValidationMethods } from './validation.js';
|
|
22
|
+
import { type FallbackMethods } from './fallback.js';
|
|
19
23
|
export type { ApiClientConfig, ApiResponse, RetryConfig, RequestFn, ProxyFn } from './types.js';
|
|
20
24
|
export type { SessionMethods } from './session.js';
|
|
21
25
|
export type { ProjectMethods } from './project.js';
|
|
@@ -26,10 +30,14 @@ export type { DiscoveryMethods } from './discovery.js';
|
|
|
26
30
|
export type { DecisionsMethods } from './decisions.js';
|
|
27
31
|
export type { IdeasMethods } from './ideas.js';
|
|
28
32
|
export type { TasksMethods } from './tasks.js';
|
|
33
|
+
export type { FindingsMethods } from './findings.js';
|
|
34
|
+
export type { MilestonesMethods } from './milestones.js';
|
|
35
|
+
export type { ValidationMethods } from './validation.js';
|
|
36
|
+
export type { FallbackMethods } from './fallback.js';
|
|
29
37
|
/**
|
|
30
38
|
* Combined interface for all API methods
|
|
31
39
|
*/
|
|
32
|
-
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 {
|
|
33
41
|
}
|
|
34
42
|
export declare class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
35
43
|
private apiKey;
|
|
@@ -44,6 +52,10 @@ export declare class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
|
44
52
|
private decisionsMethods;
|
|
45
53
|
private ideasMethods;
|
|
46
54
|
private tasksMethods;
|
|
55
|
+
private findingsMethods;
|
|
56
|
+
private milestonesMethods;
|
|
57
|
+
private validationMethods;
|
|
58
|
+
private fallbackMethods;
|
|
47
59
|
constructor(config: ApiClientConfig);
|
|
48
60
|
private request;
|
|
49
61
|
/**
|
|
@@ -744,6 +756,71 @@ export declare class VibescopeApiClient implements VibescopeApiClientMethods {
|
|
|
744
756
|
error?: string;
|
|
745
757
|
}>;
|
|
746
758
|
}>>;
|
|
759
|
+
getFindings: (projectId: string, params?: Parameters<FindingsMethods["getFindings"]>[1]) => Promise<ApiResponse<{
|
|
760
|
+
findings: import("./findings.js").Finding[];
|
|
761
|
+
total_count?: number;
|
|
762
|
+
has_more?: boolean;
|
|
763
|
+
}>>;
|
|
764
|
+
getFinding: (findingId: string) => Promise<ApiResponse<{
|
|
765
|
+
finding: import("./findings.js").Finding;
|
|
766
|
+
}>>;
|
|
767
|
+
getFindingsStats: (projectId: string) => Promise<ApiResponse<import("./findings.js").FindingsStats>>;
|
|
768
|
+
addFinding: (projectId: string, params: Parameters<FindingsMethods["addFinding"]>[1], sessionId?: string) => Promise<ApiResponse<{
|
|
769
|
+
success: boolean;
|
|
770
|
+
finding_id: string;
|
|
771
|
+
}>>;
|
|
772
|
+
updateFinding: (findingId: string, updates: Parameters<FindingsMethods["updateFinding"]>[1]) => Promise<ApiResponse<{
|
|
773
|
+
success: boolean;
|
|
774
|
+
finding_id: string;
|
|
775
|
+
}>>;
|
|
776
|
+
deleteFinding: (findingId: string) => Promise<ApiResponse<{
|
|
777
|
+
success: boolean;
|
|
778
|
+
}>>;
|
|
779
|
+
getMilestones: (taskId: string) => Promise<ApiResponse<{
|
|
780
|
+
milestones: import("./milestones.js").Milestone[];
|
|
781
|
+
stats: import("./milestones.js").MilestoneStats;
|
|
782
|
+
}>>;
|
|
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: {
|
|
790
|
+
id: string;
|
|
791
|
+
title: string;
|
|
792
|
+
status: string;
|
|
793
|
+
};
|
|
794
|
+
}>>;
|
|
795
|
+
completeMilestone: (milestoneId: string) => Promise<ApiResponse<{
|
|
796
|
+
success: boolean;
|
|
797
|
+
milestone: {
|
|
798
|
+
id: string;
|
|
799
|
+
title: string;
|
|
800
|
+
status: string;
|
|
801
|
+
};
|
|
802
|
+
}>>;
|
|
803
|
+
deleteMilestone: (milestoneId: string) => Promise<ApiResponse<{
|
|
804
|
+
success: boolean;
|
|
805
|
+
}>>;
|
|
806
|
+
getTasksAwaitingValidation: (projectId: string) => Promise<ApiResponse<{
|
|
807
|
+
tasks: import("./validation.js").TaskAwaitingValidation[];
|
|
808
|
+
}>>;
|
|
809
|
+
claimValidation: (taskId: string, sessionId?: string) => Promise<ApiResponse<{
|
|
810
|
+
success: boolean;
|
|
811
|
+
task_id: string;
|
|
812
|
+
}>>;
|
|
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<{
|
|
822
|
+
success: boolean;
|
|
823
|
+
}>>;
|
|
747
824
|
}
|
|
748
825
|
export declare function getApiClient(): VibescopeApiClient;
|
|
749
826
|
export declare function initApiClient(config: ApiClientConfig): VibescopeApiClient;
|
package/dist/api-client/index.js
CHANGED
|
@@ -15,6 +15,10 @@ import { createDiscoveryMethods } from './discovery.js';
|
|
|
15
15
|
import { createDecisionsMethods } from './decisions.js';
|
|
16
16
|
import { createIdeasMethods } from './ideas.js';
|
|
17
17
|
import { createTasksMethods } from './tasks.js';
|
|
18
|
+
import { createFindingsMethods } from './findings.js';
|
|
19
|
+
import { createMilestonesMethods } from './milestones.js';
|
|
20
|
+
import { createValidationMethods } from './validation.js';
|
|
21
|
+
import { createFallbackMethods } from './fallback.js';
|
|
18
22
|
const DEFAULT_API_URL = 'https://vibescope.dev';
|
|
19
23
|
// Retry configuration defaults
|
|
20
24
|
const DEFAULT_RETRY_STATUS_CODES = [429, 503, 504];
|
|
@@ -52,6 +56,10 @@ export class VibescopeApiClient {
|
|
|
52
56
|
decisionsMethods;
|
|
53
57
|
ideasMethods;
|
|
54
58
|
tasksMethods;
|
|
59
|
+
findingsMethods;
|
|
60
|
+
milestonesMethods;
|
|
61
|
+
validationMethods;
|
|
62
|
+
fallbackMethods;
|
|
55
63
|
constructor(config) {
|
|
56
64
|
this.apiKey = config.apiKey;
|
|
57
65
|
this.baseUrl = config.baseUrl || process.env.VIBESCOPE_API_URL || DEFAULT_API_URL;
|
|
@@ -75,6 +83,10 @@ export class VibescopeApiClient {
|
|
|
75
83
|
this.decisionsMethods = createDecisionsMethods(proxy);
|
|
76
84
|
this.ideasMethods = createIdeasMethods(proxy);
|
|
77
85
|
this.tasksMethods = createTasksMethods(request, proxy);
|
|
86
|
+
this.findingsMethods = createFindingsMethods(proxy);
|
|
87
|
+
this.milestonesMethods = createMilestonesMethods(proxy);
|
|
88
|
+
this.validationMethods = createValidationMethods(proxy);
|
|
89
|
+
this.fallbackMethods = createFallbackMethods(proxy);
|
|
78
90
|
}
|
|
79
91
|
async request(method, path, body) {
|
|
80
92
|
const url = `${this.baseUrl}${path}`;
|
|
@@ -242,19 +254,77 @@ export class VibescopeApiClient {
|
|
|
242
254
|
removeTaskReference = (taskId, url) => this.tasksMethods.removeTaskReference(taskId, url);
|
|
243
255
|
batchUpdateTasks = (updates) => this.tasksMethods.batchUpdateTasks(updates);
|
|
244
256
|
batchCompleteTasks = (completions) => this.tasksMethods.batchCompleteTasks(completions);
|
|
257
|
+
// ============================================================================
|
|
258
|
+
// Findings methods (delegated)
|
|
259
|
+
// ============================================================================
|
|
260
|
+
getFindings = (projectId, params) => this.findingsMethods.getFindings(projectId, params);
|
|
261
|
+
getFinding = (findingId) => this.findingsMethods.getFinding(findingId);
|
|
262
|
+
getFindingsStats = (projectId) => this.findingsMethods.getFindingsStats(projectId);
|
|
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);
|
|
266
|
+
// ============================================================================
|
|
267
|
+
// Milestones methods (delegated)
|
|
268
|
+
// ============================================================================
|
|
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);
|
|
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);
|
|
245
285
|
}
|
|
246
286
|
// Singleton instance
|
|
247
287
|
let apiClient = null;
|
|
248
288
|
export function getApiClient() {
|
|
249
289
|
if (!apiClient) {
|
|
250
|
-
const apiKey =
|
|
251
|
-
if (!apiKey) {
|
|
252
|
-
throw new Error('VIBESCOPE_API_KEY environment variable is required');
|
|
253
|
-
}
|
|
290
|
+
const apiKey = resolveApiKeyFromSources();
|
|
254
291
|
apiClient = new VibescopeApiClient({ apiKey });
|
|
255
292
|
}
|
|
256
293
|
return apiClient;
|
|
257
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
* Resolve API key from multiple sources in priority order:
|
|
297
|
+
* 1. VIBESCOPE_API_KEY env var (CI/cloud agents)
|
|
298
|
+
* 2. ~/.vibescope/credentials.json (local dev)
|
|
299
|
+
* 3. Error with helpful message
|
|
300
|
+
*/
|
|
301
|
+
function resolveApiKeyFromSources() {
|
|
302
|
+
// 1. Environment variable
|
|
303
|
+
if (process.env.VIBESCOPE_API_KEY) {
|
|
304
|
+
return process.env.VIBESCOPE_API_KEY;
|
|
305
|
+
}
|
|
306
|
+
// 2. Credentials file
|
|
307
|
+
try {
|
|
308
|
+
const { existsSync, readFileSync } = require('node:fs');
|
|
309
|
+
const { homedir } = require('node:os');
|
|
310
|
+
const { join } = require('node:path');
|
|
311
|
+
const credPath = join(homedir(), '.vibescope', 'credentials.json');
|
|
312
|
+
if (existsSync(credPath)) {
|
|
313
|
+
const data = JSON.parse(readFileSync(credPath, 'utf-8'));
|
|
314
|
+
if (data.apiKey) {
|
|
315
|
+
return data.apiKey;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
// ignore read errors
|
|
321
|
+
}
|
|
322
|
+
// 3. Not found
|
|
323
|
+
throw new Error('Vibescope API key not found.\n\n' +
|
|
324
|
+
'Set it up with:\n' +
|
|
325
|
+
' npx vibescope init\n\n' +
|
|
326
|
+
'Or set the VIBESCOPE_API_KEY environment variable.');
|
|
327
|
+
}
|
|
258
328
|
export function initApiClient(config) {
|
|
259
329
|
apiClient = new VibescopeApiClient(config);
|
|
260
330
|
return apiClient;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Milestones API Methods
|
|
3
|
+
*
|
|
4
|
+
* Handles task milestones for tracking granular progress within tasks.
|
|
5
|
+
*/
|
|
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
|
+
}
|
|
21
|
+
export interface MilestonesMethods {
|
|
22
|
+
getMilestones(taskId: string): Promise<ApiResponse<{
|
|
23
|
+
milestones: Milestone[];
|
|
24
|
+
stats: MilestoneStats;
|
|
25
|
+
}>>;
|
|
26
|
+
addMilestone(taskId: string, params: {
|
|
27
|
+
title: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
order_index?: number;
|
|
30
|
+
}, sessionId?: string): Promise<ApiResponse<{
|
|
31
|
+
success: boolean;
|
|
32
|
+
milestone_id: string;
|
|
33
|
+
}>>;
|
|
34
|
+
updateMilestone(milestoneId: string, updates: {
|
|
35
|
+
title?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
status?: string;
|
|
38
|
+
order_index?: number;
|
|
39
|
+
}): Promise<ApiResponse<{
|
|
40
|
+
success: boolean;
|
|
41
|
+
milestone: {
|
|
42
|
+
id: string;
|
|
43
|
+
title: string;
|
|
44
|
+
status: string;
|
|
45
|
+
};
|
|
46
|
+
}>>;
|
|
47
|
+
completeMilestone(milestoneId: string): Promise<ApiResponse<{
|
|
48
|
+
success: boolean;
|
|
49
|
+
milestone: {
|
|
50
|
+
id: string;
|
|
51
|
+
title: string;
|
|
52
|
+
status: string;
|
|
53
|
+
};
|
|
54
|
+
}>>;
|
|
55
|
+
deleteMilestone(milestoneId: string): Promise<ApiResponse<{
|
|
56
|
+
success: boolean;
|
|
57
|
+
}>>;
|
|
58
|
+
}
|
|
59
|
+
export declare function createMilestonesMethods(proxy: ProxyFn): MilestonesMethods;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Milestones API Methods
|
|
3
|
+
*
|
|
4
|
+
* Handles task milestones for tracking granular progress within tasks.
|
|
5
|
+
*/
|
|
6
|
+
export function createMilestonesMethods(proxy) {
|
|
7
|
+
return {
|
|
8
|
+
async getMilestones(taskId) {
|
|
9
|
+
return proxy('get_milestones', { task_id: taskId });
|
|
10
|
+
},
|
|
11
|
+
async addMilestone(taskId, params, sessionId) {
|
|
12
|
+
return proxy('add_milestone', {
|
|
13
|
+
task_id: taskId,
|
|
14
|
+
...params
|
|
15
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
16
|
+
},
|
|
17
|
+
async updateMilestone(milestoneId, updates) {
|
|
18
|
+
return proxy('update_milestone', {
|
|
19
|
+
milestone_id: milestoneId,
|
|
20
|
+
...updates
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
async completeMilestone(milestoneId) {
|
|
24
|
+
return proxy('complete_milestone', { milestone_id: milestoneId });
|
|
25
|
+
},
|
|
26
|
+
async deleteMilestone(milestoneId) {
|
|
27
|
+
return proxy('delete_milestone', { milestone_id: milestoneId });
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation API Methods
|
|
3
|
+
*
|
|
4
|
+
* Handles task validation workflow for code review and approval.
|
|
5
|
+
*/
|
|
6
|
+
import type { ApiResponse, ProxyFn } from './types.js';
|
|
7
|
+
export interface TaskAwaitingValidation {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
completed_at?: string;
|
|
11
|
+
completed_by_session_id?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ValidationMethods {
|
|
14
|
+
getTasksAwaitingValidation(projectId: string): Promise<ApiResponse<{
|
|
15
|
+
tasks: TaskAwaitingValidation[];
|
|
16
|
+
}>>;
|
|
17
|
+
claimValidation(taskId: string, sessionId?: string): Promise<ApiResponse<{
|
|
18
|
+
success: boolean;
|
|
19
|
+
task_id: string;
|
|
20
|
+
}>>;
|
|
21
|
+
validateTask(taskId: string, params: {
|
|
22
|
+
approved: boolean;
|
|
23
|
+
validation_notes?: string;
|
|
24
|
+
skip_pr_check?: boolean;
|
|
25
|
+
pr_checks_passing?: boolean;
|
|
26
|
+
create_fix_task?: boolean;
|
|
27
|
+
}, sessionId?: string): Promise<ApiResponse<{
|
|
28
|
+
success: boolean;
|
|
29
|
+
approved: boolean;
|
|
30
|
+
task_id: string;
|
|
31
|
+
message?: string;
|
|
32
|
+
workflow?: string;
|
|
33
|
+
}>>;
|
|
34
|
+
}
|
|
35
|
+
export declare function createValidationMethods(proxy: ProxyFn): ValidationMethods;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation API Methods
|
|
3
|
+
*
|
|
4
|
+
* Handles task validation workflow for code review and approval.
|
|
5
|
+
*/
|
|
6
|
+
export function createValidationMethods(proxy) {
|
|
7
|
+
return {
|
|
8
|
+
async getTasksAwaitingValidation(projectId) {
|
|
9
|
+
return proxy('get_tasks_awaiting_validation', { project_id: projectId });
|
|
10
|
+
},
|
|
11
|
+
async claimValidation(taskId, sessionId) {
|
|
12
|
+
return proxy('claim_validation', { task_id: taskId }, sessionId ? {
|
|
13
|
+
session_id: sessionId
|
|
14
|
+
} : undefined);
|
|
15
|
+
},
|
|
16
|
+
async validateTask(taskId, params, sessionId) {
|
|
17
|
+
return proxy('validate_task', {
|
|
18
|
+
task_id: taskId,
|
|
19
|
+
...params
|
|
20
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
package/dist/api-client.d.ts
CHANGED
|
@@ -60,6 +60,10 @@ export declare class VibescopeApiClient {
|
|
|
60
60
|
git_main_branch?: string;
|
|
61
61
|
git_develop_branch?: string;
|
|
62
62
|
git_auto_branch?: boolean;
|
|
63
|
+
validation_required?: boolean;
|
|
64
|
+
auto_merge_on_approval?: boolean;
|
|
65
|
+
fallback_activities_enabled?: boolean;
|
|
66
|
+
require_pr_for_validation?: boolean;
|
|
63
67
|
};
|
|
64
68
|
active_tasks?: Array<{
|
|
65
69
|
id: string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Vibescope Init CLI
|
|
4
|
+
*
|
|
5
|
+
* Usage: npx vibescope init
|
|
6
|
+
*
|
|
7
|
+
* Detects installed AI agents, configures MCP, and stores credentials.
|
|
8
|
+
*/
|
|
9
|
+
export declare function readCredentials(): {
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function writeCredentials(apiKey: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Resolve API key from env var or credentials file.
|
|
15
|
+
* Used by the MCP server at startup.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveApiKey(): string | null;
|