@vibescope/mcp-server 0.3.1 → 0.3.4
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/blockers.d.ts +46 -0
- package/dist/api-client/blockers.js +43 -0
- package/dist/api-client/cost.d.ts +112 -0
- package/dist/api-client/cost.js +76 -0
- package/dist/api-client/decisions.d.ts +55 -0
- package/dist/api-client/decisions.js +32 -0
- package/dist/api-client/discovery.d.ts +62 -0
- package/dist/api-client/discovery.js +21 -0
- package/dist/api-client/ideas.d.ts +75 -0
- package/dist/api-client/ideas.js +36 -0
- package/dist/api-client/index.d.ts +749 -0
- package/dist/api-client/index.js +291 -0
- package/dist/api-client/project.d.ts +132 -0
- package/dist/api-client/project.js +45 -0
- package/dist/api-client/session.d.ts +163 -0
- package/dist/api-client/session.js +52 -0
- package/dist/api-client/tasks.d.ts +328 -0
- package/dist/api-client/tasks.js +132 -0
- package/dist/api-client/types.d.ts +25 -0
- package/dist/api-client/types.js +4 -0
- package/dist/api-client/worktrees.d.ts +33 -0
- package/dist/api-client/worktrees.js +26 -0
- package/dist/api-client.d.ts +9 -0
- package/dist/api-client.js +104 -25
- package/dist/cli-init.d.ts +17 -0
- package/dist/cli-init.js +445 -0
- package/dist/cli.js +0 -0
- package/dist/handlers/cloud-agents.d.ts +21 -0
- package/dist/handlers/cloud-agents.js +91 -0
- package/dist/handlers/discovery.js +7 -0
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/index.js +6 -0
- package/dist/handlers/session.js +3 -1
- package/dist/handlers/tasks.js +10 -12
- package/dist/handlers/types.d.ts +2 -1
- package/dist/handlers/version.d.ts +5 -0
- package/dist/handlers/version.js +53 -0
- package/dist/index.js +15 -3
- package/dist/token-tracking.js +2 -2
- package/dist/tools/blockers.d.ts +13 -0
- package/dist/tools/blockers.js +119 -0
- package/dist/tools/bodies-of-work.d.ts +19 -0
- package/dist/tools/bodies-of-work.js +280 -0
- package/dist/tools/cloud-agents.d.ts +9 -0
- package/dist/tools/cloud-agents.js +67 -0
- package/dist/tools/connectors.d.ts +14 -0
- package/dist/tools/connectors.js +188 -0
- package/dist/tools/cost.d.ts +11 -0
- package/dist/tools/cost.js +108 -0
- package/dist/tools/decisions.d.ts +12 -0
- package/dist/tools/decisions.js +108 -0
- package/dist/tools/deployment.d.ts +24 -0
- package/dist/tools/deployment.js +439 -0
- package/dist/tools/discovery.d.ts +10 -0
- package/dist/tools/discovery.js +73 -0
- package/dist/tools/fallback.d.ts +11 -0
- package/dist/tools/fallback.js +108 -0
- package/dist/tools/file-checkouts.d.ts +13 -0
- package/dist/tools/file-checkouts.js +141 -0
- package/dist/tools/findings.d.ts +13 -0
- package/dist/tools/findings.js +98 -0
- package/dist/tools/git-issues.d.ts +11 -0
- package/dist/tools/git-issues.js +127 -0
- package/dist/tools/ideas.d.ts +13 -0
- package/dist/tools/ideas.js +159 -0
- package/dist/tools/index.d.ts +73 -0
- package/dist/tools/index.js +101 -0
- package/dist/tools/milestones.d.ts +12 -0
- package/dist/tools/milestones.js +115 -0
- package/dist/tools/organizations.d.ts +17 -0
- package/dist/tools/organizations.js +221 -0
- package/dist/tools/progress.d.ts +9 -0
- package/dist/tools/progress.js +70 -0
- package/dist/tools/project.d.ts +13 -0
- package/dist/tools/project.js +199 -0
- package/dist/tools/requests.d.ts +10 -0
- package/dist/tools/requests.js +65 -0
- package/dist/tools/roles.d.ts +11 -0
- package/dist/tools/roles.js +109 -0
- package/dist/tools/session.d.ts +15 -0
- package/dist/tools/session.js +178 -0
- package/dist/tools/sprints.d.ts +18 -0
- package/dist/tools/sprints.js +295 -0
- package/dist/tools/tasks.d.ts +27 -0
- package/dist/tools/tasks.js +539 -0
- package/dist/tools/types.d.ts +7 -0
- package/dist/tools/types.js +6 -0
- package/dist/tools/validation.d.ts +10 -0
- package/dist/tools/validation.js +72 -0
- package/dist/tools/version.d.ts +5 -0
- package/dist/tools/version.js +28 -0
- package/dist/tools/worktrees.d.ts +9 -0
- package/dist/tools/worktrees.js +63 -0
- package/dist/utils.d.ts +66 -0
- package/dist/utils.js +102 -0
- package/dist/version.d.ts +28 -0
- package/dist/version.js +91 -0
- package/docs/TOOLS.md +54 -2
- package/package.json +4 -2
- package/scripts/generate-docs.ts +1 -1
- package/src/api-client/blockers.ts +86 -0
- package/src/api-client/cost.ts +185 -0
- package/src/api-client/decisions.ts +87 -0
- package/src/api-client/discovery.ts +81 -0
- package/src/api-client/ideas.ts +112 -0
- package/src/api-client/index.ts +378 -0
- package/src/api-client/project.ts +179 -0
- package/src/api-client/session.ts +220 -0
- package/src/api-client/tasks.ts +450 -0
- package/src/api-client/types.ts +32 -0
- package/src/api-client/worktrees.ts +53 -0
- package/src/api-client.test.ts +136 -9
- package/src/api-client.ts +125 -27
- package/src/cli-init.ts +504 -0
- package/src/handlers/__test-utils__.ts +2 -0
- package/src/handlers/cloud-agents.ts +138 -0
- package/src/handlers/discovery.ts +7 -0
- package/src/handlers/index.ts +6 -0
- package/src/handlers/session.ts +3 -1
- package/src/handlers/tasks.ts +10 -12
- package/src/handlers/tool-categories.test.ts +1 -1
- package/src/handlers/types.ts +2 -1
- package/src/handlers/version.ts +63 -0
- package/src/index.test.ts +2 -2
- package/src/index.ts +17 -2
- package/src/token-tracking.ts +3 -2
- package/src/tools/blockers.ts +122 -0
- package/src/tools/bodies-of-work.ts +283 -0
- package/src/tools/cloud-agents.ts +70 -0
- package/src/tools/connectors.ts +191 -0
- package/src/tools/cost.ts +111 -0
- package/src/tools/decisions.ts +111 -0
- package/src/tools/deployment.ts +442 -0
- package/src/tools/discovery.ts +76 -0
- package/src/tools/fallback.ts +111 -0
- package/src/tools/file-checkouts.ts +145 -0
- package/src/tools/findings.ts +101 -0
- package/src/tools/git-issues.ts +130 -0
- package/src/tools/ideas.ts +162 -0
- package/src/tools/index.ts +135 -0
- package/src/tools/milestones.ts +118 -0
- package/src/tools/organizations.ts +224 -0
- package/src/tools/progress.ts +73 -0
- package/src/tools/project.ts +202 -0
- package/src/tools/requests.ts +68 -0
- package/src/tools/roles.ts +112 -0
- package/src/tools/session.ts +181 -0
- package/src/tools/sprints.ts +298 -0
- package/src/tools/tasks.ts +542 -0
- package/src/tools/tools.test.ts +222 -0
- package/src/tools/types.ts +9 -0
- package/src/tools/validation.ts +75 -0
- package/src/tools/version.ts +34 -0
- package/src/tools/worktrees.ts +66 -0
- package/src/tools.test.ts +1 -1
- package/src/utils.test.ts +229 -0
- package/src/utils.ts +117 -0
- package/src/version.ts +109 -0
- package/dist/tools.d.ts +0 -2
- package/dist/tools.js +0 -3606
- package/src/tools.ts +0 -3611
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cost API Methods
|
|
3
|
+
*
|
|
4
|
+
* Methods for cost tracking and alerts:
|
|
5
|
+
* - getCostSummary: Get cost summary by period
|
|
6
|
+
* - getCostAlerts: List cost alerts
|
|
7
|
+
* - addCostAlert: Create a cost alert
|
|
8
|
+
* - updateCostAlert: Update a cost alert
|
|
9
|
+
* - deleteCostAlert: Delete a cost alert
|
|
10
|
+
* - getTaskCosts: Get costs by task
|
|
11
|
+
* - getBodyOfWorkCosts: Get costs by body of work
|
|
12
|
+
* - getSprintCosts: Get costs by sprint
|
|
13
|
+
* - getTokenUsage: Get token usage stats
|
|
14
|
+
* - reportTokenUsage: Report token usage
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { ApiResponse, RequestFn } from './types.js';
|
|
18
|
+
|
|
19
|
+
export interface CostMethods {
|
|
20
|
+
getCostSummary(projectId: string, params?: {
|
|
21
|
+
period?: 'daily' | 'weekly' | 'monthly';
|
|
22
|
+
limit?: number;
|
|
23
|
+
}): Promise<ApiResponse<{
|
|
24
|
+
summary: Array<{
|
|
25
|
+
period: string;
|
|
26
|
+
total_cost: number;
|
|
27
|
+
input_tokens: number;
|
|
28
|
+
output_tokens: number;
|
|
29
|
+
api_calls: number;
|
|
30
|
+
}>;
|
|
31
|
+
}>>;
|
|
32
|
+
|
|
33
|
+
getCostAlerts(): Promise<ApiResponse<{
|
|
34
|
+
alerts: Array<{
|
|
35
|
+
id: string;
|
|
36
|
+
project_id?: string;
|
|
37
|
+
threshold_amount: number;
|
|
38
|
+
threshold_period: string;
|
|
39
|
+
alert_type: string;
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
}>>;
|
|
43
|
+
|
|
44
|
+
addCostAlert(params: {
|
|
45
|
+
project_id?: string;
|
|
46
|
+
threshold_amount: number;
|
|
47
|
+
threshold_period: 'daily' | 'weekly' | 'monthly';
|
|
48
|
+
alert_type?: 'warning' | 'critical';
|
|
49
|
+
}): Promise<ApiResponse<{
|
|
50
|
+
success: boolean;
|
|
51
|
+
alert_id: string;
|
|
52
|
+
}>>;
|
|
53
|
+
|
|
54
|
+
updateCostAlert(alertId: string, updates: {
|
|
55
|
+
threshold_amount?: number;
|
|
56
|
+
threshold_period?: 'daily' | 'weekly' | 'monthly';
|
|
57
|
+
alert_type?: 'warning' | 'critical';
|
|
58
|
+
enabled?: boolean;
|
|
59
|
+
}): Promise<ApiResponse<{
|
|
60
|
+
success: boolean;
|
|
61
|
+
alert_id: string;
|
|
62
|
+
}>>;
|
|
63
|
+
|
|
64
|
+
deleteCostAlert(alertId: string): Promise<ApiResponse<{
|
|
65
|
+
success: boolean;
|
|
66
|
+
}>>;
|
|
67
|
+
|
|
68
|
+
getTaskCosts(projectId: string, limit?: number): Promise<ApiResponse<{
|
|
69
|
+
tasks: Array<{
|
|
70
|
+
task_id: string;
|
|
71
|
+
task_title: string;
|
|
72
|
+
total_cost: number;
|
|
73
|
+
input_tokens: number;
|
|
74
|
+
output_tokens: number;
|
|
75
|
+
}>;
|
|
76
|
+
}>>;
|
|
77
|
+
|
|
78
|
+
getBodyOfWorkCosts(params: {
|
|
79
|
+
body_of_work_id?: string;
|
|
80
|
+
project_id?: string;
|
|
81
|
+
limit?: number;
|
|
82
|
+
}): Promise<ApiResponse<{
|
|
83
|
+
bodies_of_work: Array<{
|
|
84
|
+
body_of_work_id: string;
|
|
85
|
+
title: string;
|
|
86
|
+
total_cost: number;
|
|
87
|
+
task_count: number;
|
|
88
|
+
}>;
|
|
89
|
+
}>>;
|
|
90
|
+
|
|
91
|
+
getSprintCosts(params: {
|
|
92
|
+
sprint_id?: string;
|
|
93
|
+
project_id?: string;
|
|
94
|
+
limit?: number;
|
|
95
|
+
}): Promise<ApiResponse<{
|
|
96
|
+
sprints: Array<{
|
|
97
|
+
sprint_id: string;
|
|
98
|
+
name: string;
|
|
99
|
+
total_cost: number;
|
|
100
|
+
task_count: number;
|
|
101
|
+
}>;
|
|
102
|
+
}>>;
|
|
103
|
+
|
|
104
|
+
getTokenUsage(): Promise<ApiResponse<{
|
|
105
|
+
session_tokens: {
|
|
106
|
+
input: number;
|
|
107
|
+
output: number;
|
|
108
|
+
};
|
|
109
|
+
estimated_cost: number;
|
|
110
|
+
}>>;
|
|
111
|
+
|
|
112
|
+
reportTokenUsage(sessionId: string, params: {
|
|
113
|
+
input_tokens: number;
|
|
114
|
+
output_tokens: number;
|
|
115
|
+
model?: string;
|
|
116
|
+
}): Promise<ApiResponse<{
|
|
117
|
+
success: boolean;
|
|
118
|
+
session_id: string;
|
|
119
|
+
total_input_tokens: number;
|
|
120
|
+
total_output_tokens: number;
|
|
121
|
+
}>>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function createCostMethods(request: RequestFn): CostMethods {
|
|
125
|
+
return {
|
|
126
|
+
async getCostSummary(projectId, params) {
|
|
127
|
+
const queryParams = new URLSearchParams();
|
|
128
|
+
if (params?.period) queryParams.set('period', params.period);
|
|
129
|
+
if (params?.limit) queryParams.set('limit', params.limit.toString());
|
|
130
|
+
const query = queryParams.toString();
|
|
131
|
+
const url = `/api/mcp/projects/${projectId}/cost-summary${query ? `?${query}` : ''}`;
|
|
132
|
+
return request('GET', url);
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
async getCostAlerts() {
|
|
136
|
+
return request('GET', '/api/mcp/cost-alerts');
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
async addCostAlert(params) {
|
|
140
|
+
return request('POST', '/api/mcp/cost-alerts', params);
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
async updateCostAlert(alertId, updates) {
|
|
144
|
+
return request('PATCH', `/api/mcp/cost-alerts/${alertId}`, updates);
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
async deleteCostAlert(alertId) {
|
|
148
|
+
return request('DELETE', `/api/mcp/cost-alerts/${alertId}`);
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
async getTaskCosts(projectId, limit) {
|
|
152
|
+
const url = limit
|
|
153
|
+
? `/api/mcp/projects/${projectId}/task-costs?limit=${limit}`
|
|
154
|
+
: `/api/mcp/projects/${projectId}/task-costs`;
|
|
155
|
+
return request('GET', url);
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
async getBodyOfWorkCosts(params) {
|
|
159
|
+
const queryParams = new URLSearchParams();
|
|
160
|
+
if (params.body_of_work_id) queryParams.set('body_of_work_id', params.body_of_work_id);
|
|
161
|
+
if (params.project_id) queryParams.set('project_id', params.project_id);
|
|
162
|
+
if (params.limit) queryParams.set('limit', params.limit.toString());
|
|
163
|
+
return request('GET', `/api/mcp/cost/bodies-of-work?${queryParams.toString()}`);
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
async getSprintCosts(params) {
|
|
167
|
+
const queryParams = new URLSearchParams();
|
|
168
|
+
if (params.sprint_id) queryParams.set('sprint_id', params.sprint_id);
|
|
169
|
+
if (params.project_id) queryParams.set('project_id', params.project_id);
|
|
170
|
+
if (params.limit) queryParams.set('limit', params.limit.toString());
|
|
171
|
+
return request('GET', `/api/mcp/cost/sprints?${queryParams.toString()}`);
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
async getTokenUsage() {
|
|
175
|
+
return request('GET', '/api/mcp/sessions/token-usage');
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
async reportTokenUsage(sessionId, params) {
|
|
179
|
+
return request('POST', '/api/mcp/sessions/token-usage', {
|
|
180
|
+
session_id: sessionId,
|
|
181
|
+
...params
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decisions API Methods
|
|
3
|
+
*
|
|
4
|
+
* Methods for decision tracking:
|
|
5
|
+
* - getDecisions: List decisions for a project
|
|
6
|
+
* - getDecision: Get a single decision
|
|
7
|
+
* - logDecision: Log a new decision
|
|
8
|
+
* - deleteDecision: Delete a decision
|
|
9
|
+
* - getDecisionsStats: Get decision statistics
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { ApiResponse, ProxyFn } from './types.js';
|
|
13
|
+
|
|
14
|
+
export interface DecisionsMethods {
|
|
15
|
+
getDecisions(projectId: string, options?: {
|
|
16
|
+
limit?: number;
|
|
17
|
+
offset?: number;
|
|
18
|
+
search_query?: string;
|
|
19
|
+
}): Promise<ApiResponse<{
|
|
20
|
+
decisions: Array<{
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
rationale?: string;
|
|
25
|
+
alternatives_considered?: string[];
|
|
26
|
+
created_at: string;
|
|
27
|
+
}>;
|
|
28
|
+
total_count?: number;
|
|
29
|
+
has_more?: boolean;
|
|
30
|
+
}>>;
|
|
31
|
+
|
|
32
|
+
getDecision(decisionId: string): Promise<ApiResponse<{
|
|
33
|
+
decision: {
|
|
34
|
+
id: string;
|
|
35
|
+
title: string;
|
|
36
|
+
description: string;
|
|
37
|
+
rationale?: string;
|
|
38
|
+
alternatives_considered?: string[];
|
|
39
|
+
created_at: string;
|
|
40
|
+
};
|
|
41
|
+
}>>;
|
|
42
|
+
|
|
43
|
+
logDecision(projectId: string, params: {
|
|
44
|
+
title: string;
|
|
45
|
+
description: string;
|
|
46
|
+
rationale?: string;
|
|
47
|
+
alternatives_considered?: string[];
|
|
48
|
+
}, sessionId?: string): Promise<ApiResponse<{
|
|
49
|
+
success: boolean;
|
|
50
|
+
decision_id: string;
|
|
51
|
+
}>>;
|
|
52
|
+
|
|
53
|
+
deleteDecision(decisionId: string): Promise<ApiResponse<{
|
|
54
|
+
success: boolean;
|
|
55
|
+
}>>;
|
|
56
|
+
|
|
57
|
+
getDecisionsStats(projectId: string): Promise<ApiResponse<{
|
|
58
|
+
total: number;
|
|
59
|
+
}>>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function createDecisionsMethods(proxy: ProxyFn): DecisionsMethods {
|
|
63
|
+
return {
|
|
64
|
+
async getDecisions(projectId, options) {
|
|
65
|
+
return proxy('get_decisions', { project_id: projectId, ...options });
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
async getDecision(decisionId) {
|
|
69
|
+
return proxy('get_decision', { decision_id: decisionId });
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
async logDecision(projectId, params, sessionId) {
|
|
73
|
+
return proxy('log_decision', {
|
|
74
|
+
project_id: projectId,
|
|
75
|
+
...params
|
|
76
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
async deleteDecision(decisionId) {
|
|
80
|
+
return proxy('delete_decision', { decision_id: decisionId });
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
async getDecisionsStats(projectId) {
|
|
84
|
+
return proxy('get_decisions_stats', { project_id: projectId });
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovery API Methods
|
|
3
|
+
*
|
|
4
|
+
* Methods for knowledge and help discovery:
|
|
5
|
+
* - queryKnowledgeBase: Query aggregated project knowledge
|
|
6
|
+
* - getHelpTopic: Get help for a specific topic
|
|
7
|
+
* - getHelpTopics: List all help topics
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { ApiResponse, RequestFn } from './types.js';
|
|
11
|
+
|
|
12
|
+
export interface DiscoveryMethods {
|
|
13
|
+
queryKnowledgeBase(projectId: string, params?: {
|
|
14
|
+
scope?: 'summary' | 'detailed';
|
|
15
|
+
categories?: Array<'findings' | 'qa' | 'decisions' | 'completed_tasks' | 'blockers' | 'progress'>;
|
|
16
|
+
limit?: number;
|
|
17
|
+
search_query?: string;
|
|
18
|
+
}): Promise<ApiResponse<{
|
|
19
|
+
findings?: Array<{
|
|
20
|
+
id: string;
|
|
21
|
+
title: string;
|
|
22
|
+
category: string;
|
|
23
|
+
severity: string;
|
|
24
|
+
}>;
|
|
25
|
+
qa?: Array<{
|
|
26
|
+
id: string;
|
|
27
|
+
question: string;
|
|
28
|
+
answer?: string;
|
|
29
|
+
}>;
|
|
30
|
+
decisions?: Array<{
|
|
31
|
+
id: string;
|
|
32
|
+
title: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
}>;
|
|
35
|
+
completed_tasks?: Array<{
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
completed_at: string;
|
|
39
|
+
}>;
|
|
40
|
+
blockers?: Array<{
|
|
41
|
+
id: string;
|
|
42
|
+
description: string;
|
|
43
|
+
status: string;
|
|
44
|
+
}>;
|
|
45
|
+
progress?: Array<{
|
|
46
|
+
id: string;
|
|
47
|
+
note: string;
|
|
48
|
+
created_at: string;
|
|
49
|
+
}>;
|
|
50
|
+
}>>;
|
|
51
|
+
|
|
52
|
+
getHelpTopic(slug: string): Promise<ApiResponse<{
|
|
53
|
+
topic: {
|
|
54
|
+
slug: string;
|
|
55
|
+
title: string;
|
|
56
|
+
content: string;
|
|
57
|
+
};
|
|
58
|
+
}>>;
|
|
59
|
+
|
|
60
|
+
getHelpTopics(): Promise<ApiResponse<Array<{
|
|
61
|
+
slug: string;
|
|
62
|
+
title: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
}>>>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function createDiscoveryMethods(request: RequestFn): DiscoveryMethods {
|
|
68
|
+
return {
|
|
69
|
+
async queryKnowledgeBase(projectId, params) {
|
|
70
|
+
return request('POST', `/api/mcp/projects/${projectId}/knowledge`, params || {});
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
async getHelpTopic(slug) {
|
|
74
|
+
return request('GET', `/api/mcp/help/${slug}`);
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
async getHelpTopics() {
|
|
78
|
+
return request('GET', '/api/mcp/help');
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ideas API Methods
|
|
3
|
+
*
|
|
4
|
+
* Methods for idea management:
|
|
5
|
+
* - getIdeas: List ideas for a project
|
|
6
|
+
* - getIdea: Get a single idea
|
|
7
|
+
* - addIdea: Create a new idea
|
|
8
|
+
* - updateIdea: Update an idea
|
|
9
|
+
* - deleteIdea: Delete an idea
|
|
10
|
+
* - convertIdeaToTask: Convert an idea to a task
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { ApiResponse, ProxyFn } from './types.js';
|
|
14
|
+
|
|
15
|
+
export interface IdeasMethods {
|
|
16
|
+
getIdeas(projectId: string, params?: {
|
|
17
|
+
status?: string;
|
|
18
|
+
limit?: number;
|
|
19
|
+
offset?: number;
|
|
20
|
+
search_query?: string;
|
|
21
|
+
}): Promise<ApiResponse<{
|
|
22
|
+
ideas: Array<{
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
status: string;
|
|
27
|
+
doc_url?: string;
|
|
28
|
+
created_at: string;
|
|
29
|
+
}>;
|
|
30
|
+
total_count?: number;
|
|
31
|
+
has_more?: boolean;
|
|
32
|
+
}>>;
|
|
33
|
+
|
|
34
|
+
getIdea(ideaId: string): Promise<ApiResponse<{
|
|
35
|
+
idea: {
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
status: string;
|
|
40
|
+
doc_url?: string;
|
|
41
|
+
created_at: string;
|
|
42
|
+
};
|
|
43
|
+
}>>;
|
|
44
|
+
|
|
45
|
+
addIdea(projectId: string, params: {
|
|
46
|
+
title: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
status?: string;
|
|
49
|
+
}, sessionId?: string): Promise<ApiResponse<{
|
|
50
|
+
success: boolean;
|
|
51
|
+
idea_id: string;
|
|
52
|
+
}>>;
|
|
53
|
+
|
|
54
|
+
updateIdea(ideaId: string, updates: {
|
|
55
|
+
title?: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
status?: string;
|
|
58
|
+
doc_url?: string;
|
|
59
|
+
}): Promise<ApiResponse<{
|
|
60
|
+
success: boolean;
|
|
61
|
+
idea_id: string;
|
|
62
|
+
}>>;
|
|
63
|
+
|
|
64
|
+
deleteIdea(ideaId: string): Promise<ApiResponse<{
|
|
65
|
+
success: boolean;
|
|
66
|
+
}>>;
|
|
67
|
+
|
|
68
|
+
convertIdeaToTask(ideaId: string, params?: {
|
|
69
|
+
priority?: number;
|
|
70
|
+
estimated_minutes?: number;
|
|
71
|
+
update_status?: boolean;
|
|
72
|
+
}): Promise<ApiResponse<{
|
|
73
|
+
success: boolean;
|
|
74
|
+
task_id?: string;
|
|
75
|
+
task_title?: string;
|
|
76
|
+
idea_id?: string;
|
|
77
|
+
idea_status?: string;
|
|
78
|
+
message?: string;
|
|
79
|
+
error?: string;
|
|
80
|
+
}>>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function createIdeasMethods(proxy: ProxyFn): IdeasMethods {
|
|
84
|
+
return {
|
|
85
|
+
async getIdeas(projectId, params) {
|
|
86
|
+
return proxy('get_ideas', { project_id: projectId, ...params });
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
async getIdea(ideaId) {
|
|
90
|
+
return proxy('get_idea', { idea_id: ideaId });
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
async addIdea(projectId, params, sessionId) {
|
|
94
|
+
return proxy('add_idea', {
|
|
95
|
+
project_id: projectId,
|
|
96
|
+
...params
|
|
97
|
+
}, sessionId ? { session_id: sessionId } : undefined);
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
async updateIdea(ideaId, updates) {
|
|
101
|
+
return proxy('update_idea', { idea_id: ideaId, ...updates });
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
async deleteIdea(ideaId) {
|
|
105
|
+
return proxy('delete_idea', { idea_id: ideaId });
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
async convertIdeaToTask(ideaId, params) {
|
|
109
|
+
return proxy('convert_idea_to_task', { idea_id: ideaId, ...params });
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|