@vibescope/mcp-server 0.0.1 → 0.2.0
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/README.md +113 -98
- package/dist/api-client.d.ts +1169 -0
- package/dist/api-client.js +713 -0
- package/dist/cli.d.ts +1 -6
- package/dist/cli.js +39 -240
- package/dist/config/tool-categories.d.ts +31 -0
- package/dist/config/tool-categories.js +253 -0
- package/dist/handlers/blockers.js +57 -58
- package/dist/handlers/bodies-of-work.d.ts +2 -0
- package/dist/handlers/bodies-of-work.js +108 -477
- package/dist/handlers/cost.d.ts +1 -0
- package/dist/handlers/cost.js +35 -113
- package/dist/handlers/decisions.d.ts +2 -0
- package/dist/handlers/decisions.js +28 -27
- package/dist/handlers/deployment.js +113 -828
- package/dist/handlers/discovery.d.ts +3 -0
- package/dist/handlers/discovery.js +26 -627
- package/dist/handlers/fallback.d.ts +2 -0
- package/dist/handlers/fallback.js +56 -142
- package/dist/handlers/findings.d.ts +8 -1
- package/dist/handlers/findings.js +65 -68
- package/dist/handlers/git-issues.d.ts +9 -13
- package/dist/handlers/git-issues.js +80 -225
- package/dist/handlers/ideas.d.ts +3 -0
- package/dist/handlers/ideas.js +53 -134
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/index.js +6 -0
- package/dist/handlers/milestones.d.ts +2 -0
- package/dist/handlers/milestones.js +51 -98
- package/dist/handlers/organizations.js +79 -275
- package/dist/handlers/progress.d.ts +2 -0
- package/dist/handlers/progress.js +25 -123
- package/dist/handlers/project.js +42 -221
- package/dist/handlers/requests.d.ts +2 -0
- package/dist/handlers/requests.js +23 -83
- package/dist/handlers/session.js +119 -590
- package/dist/handlers/sprints.d.ts +32 -0
- package/dist/handlers/sprints.js +275 -0
- package/dist/handlers/tasks.d.ts +7 -10
- package/dist/handlers/tasks.js +245 -894
- package/dist/handlers/tool-docs.d.ts +9 -0
- package/dist/handlers/tool-docs.js +904 -0
- package/dist/handlers/types.d.ts +11 -3
- package/dist/handlers/validation.d.ts +1 -1
- package/dist/handlers/validation.js +38 -153
- package/dist/index.js +493 -162
- package/dist/knowledge.js +106 -9
- package/dist/tools.js +34 -4
- package/dist/validators.d.ts +21 -0
- package/dist/validators.js +91 -0
- package/package.json +2 -3
- package/src/api-client.ts +1822 -0
- package/src/cli.test.ts +128 -302
- package/src/cli.ts +41 -285
- package/src/handlers/__test-setup__.ts +215 -0
- package/src/handlers/__test-utils__.ts +4 -134
- package/src/handlers/blockers.test.ts +114 -124
- package/src/handlers/blockers.ts +68 -70
- package/src/handlers/bodies-of-work.test.ts +236 -831
- package/src/handlers/bodies-of-work.ts +210 -525
- package/src/handlers/cost.test.ts +149 -113
- package/src/handlers/cost.ts +44 -132
- package/src/handlers/decisions.test.ts +111 -209
- package/src/handlers/decisions.ts +35 -27
- package/src/handlers/deployment.test.ts +193 -239
- package/src/handlers/deployment.ts +143 -896
- package/src/handlers/discovery.test.ts +20 -67
- package/src/handlers/discovery.ts +29 -714
- package/src/handlers/fallback.test.ts +206 -361
- package/src/handlers/fallback.ts +81 -156
- package/src/handlers/findings.test.ts +229 -320
- package/src/handlers/findings.ts +76 -64
- package/src/handlers/git-issues.test.ts +623 -0
- package/src/handlers/git-issues.ts +174 -0
- package/src/handlers/ideas.test.ts +229 -343
- package/src/handlers/ideas.ts +69 -143
- package/src/handlers/index.ts +6 -0
- package/src/handlers/milestones.test.ts +167 -281
- package/src/handlers/milestones.ts +54 -93
- package/src/handlers/organizations.test.ts +275 -467
- package/src/handlers/organizations.ts +84 -294
- package/src/handlers/progress.test.ts +112 -218
- package/src/handlers/progress.ts +29 -142
- package/src/handlers/project.test.ts +203 -226
- package/src/handlers/project.ts +48 -238
- package/src/handlers/requests.test.ts +74 -342
- package/src/handlers/requests.ts +25 -83
- package/src/handlers/session.test.ts +276 -206
- package/src/handlers/session.ts +136 -662
- package/src/handlers/sprints.test.ts +711 -0
- package/src/handlers/sprints.ts +510 -0
- package/src/handlers/tasks.test.ts +669 -353
- package/src/handlers/tasks.ts +263 -1015
- package/src/handlers/tool-docs.ts +1024 -0
- package/src/handlers/types.ts +12 -4
- package/src/handlers/validation.test.ts +237 -568
- package/src/handlers/validation.ts +43 -167
- package/src/index.ts +493 -186
- package/src/tools.ts +2532 -0
- package/src/validators.test.ts +223 -223
- package/src/validators.ts +127 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +14 -13
- package/dist/cli.test.d.ts +0 -1
- package/dist/cli.test.js +0 -367
- package/dist/handlers/__test-utils__.d.ts +0 -72
- package/dist/handlers/__test-utils__.js +0 -176
- package/dist/handlers/checkouts.d.ts +0 -37
- package/dist/handlers/checkouts.js +0 -377
- package/dist/handlers/knowledge-query.d.ts +0 -22
- package/dist/handlers/knowledge-query.js +0 -253
- package/dist/handlers/knowledge.d.ts +0 -12
- package/dist/handlers/knowledge.js +0 -108
- package/dist/handlers/roles.d.ts +0 -30
- package/dist/handlers/roles.js +0 -281
- package/dist/handlers/tasks.test.d.ts +0 -1
- package/dist/handlers/tasks.test.js +0 -431
- package/dist/utils.test.d.ts +0 -1
- package/dist/utils.test.js +0 -532
- package/dist/validators.test.d.ts +0 -1
- package/dist/validators.test.js +0 -176
- package/src/knowledge.ts +0 -132
- package/src/tmpclaude-0078-cwd +0 -1
- package/src/tmpclaude-0ee1-cwd +0 -1
- package/src/tmpclaude-2dd5-cwd +0 -1
- package/src/tmpclaude-344c-cwd +0 -1
- package/src/tmpclaude-3860-cwd +0 -1
- package/src/tmpclaude-4b63-cwd +0 -1
- package/src/tmpclaude-5c73-cwd +0 -1
- package/src/tmpclaude-5ee3-cwd +0 -1
- package/src/tmpclaude-6795-cwd +0 -1
- package/src/tmpclaude-709e-cwd +0 -1
- package/src/tmpclaude-9839-cwd +0 -1
- package/src/tmpclaude-d829-cwd +0 -1
- package/src/tmpclaude-e072-cwd +0 -1
- package/src/tmpclaude-f6ee-cwd +0 -1
- package/tmpclaude-0439-cwd +0 -1
- package/tmpclaude-132f-cwd +0 -1
- package/tmpclaude-15bb-cwd +0 -1
- package/tmpclaude-165a-cwd +0 -1
- package/tmpclaude-1ba9-cwd +0 -1
- package/tmpclaude-21a3-cwd +0 -1
- package/tmpclaude-2a38-cwd +0 -1
- package/tmpclaude-2adf-cwd +0 -1
- package/tmpclaude-2f56-cwd +0 -1
- package/tmpclaude-3626-cwd +0 -1
- package/tmpclaude-3727-cwd +0 -1
- package/tmpclaude-40bc-cwd +0 -1
- package/tmpclaude-436f-cwd +0 -1
- package/tmpclaude-4783-cwd +0 -1
- package/tmpclaude-4b6d-cwd +0 -1
- package/tmpclaude-4ba4-cwd +0 -1
- package/tmpclaude-51e6-cwd +0 -1
- package/tmpclaude-5ecf-cwd +0 -1
- package/tmpclaude-6f97-cwd +0 -1
- package/tmpclaude-7fb2-cwd +0 -1
- package/tmpclaude-825c-cwd +0 -1
- package/tmpclaude-8baf-cwd +0 -1
- package/tmpclaude-8d9f-cwd +0 -1
- package/tmpclaude-975c-cwd +0 -1
- package/tmpclaude-9983-cwd +0 -1
- package/tmpclaude-a045-cwd +0 -1
- package/tmpclaude-ac4a-cwd +0 -1
- package/tmpclaude-b593-cwd +0 -1
- package/tmpclaude-b891-cwd +0 -1
- package/tmpclaude-c032-cwd +0 -1
- package/tmpclaude-cf43-cwd +0 -1
- package/tmpclaude-d040-cwd +0 -1
- package/tmpclaude-dcdd-cwd +0 -1
- package/tmpclaude-dcee-cwd +0 -1
- package/tmpclaude-e16b-cwd +0 -1
- package/tmpclaude-ecd2-cwd +0 -1
- package/tmpclaude-f48d-cwd +0 -1
|
@@ -1,35 +1,6 @@
|
|
|
1
|
-
import { describe, it, expect
|
|
2
|
-
import type { SupabaseClient } from '@supabase/supabase-js';
|
|
3
|
-
import type { HandlerContext, TokenUsage } from './types.js';
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
4
2
|
import { discoverTools, getToolInfo } from './discovery.js';
|
|
5
|
-
|
|
6
|
-
// ============================================================================
|
|
7
|
-
// Test Utilities
|
|
8
|
-
// ============================================================================
|
|
9
|
-
|
|
10
|
-
function createMockSupabase() {
|
|
11
|
-
return {} as unknown as SupabaseClient;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function createMockContext(supabase: SupabaseClient): HandlerContext {
|
|
15
|
-
const defaultTokenUsage: TokenUsage = {
|
|
16
|
-
callCount: 5,
|
|
17
|
-
totalTokens: 2500,
|
|
18
|
-
byTool: {},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
supabase,
|
|
23
|
-
auth: { userId: 'user-123', apiKeyId: 'api-key-123' },
|
|
24
|
-
session: {
|
|
25
|
-
instanceId: 'instance-abc',
|
|
26
|
-
currentSessionId: 'session-123',
|
|
27
|
-
currentPersona: 'Wave',
|
|
28
|
-
tokenUsage: defaultTokenUsage,
|
|
29
|
-
},
|
|
30
|
-
updateSession: vi.fn(),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
3
|
+
import { createMockContext } from './__test-utils__.js';
|
|
33
4
|
|
|
34
5
|
// ============================================================================
|
|
35
6
|
// discoverTools Tests
|
|
@@ -37,8 +8,7 @@ function createMockContext(supabase: SupabaseClient): HandlerContext {
|
|
|
37
8
|
|
|
38
9
|
describe('discoverTools', () => {
|
|
39
10
|
it('should return all categories when no category specified', async () => {
|
|
40
|
-
const
|
|
41
|
-
const ctx = createMockContext(supabase);
|
|
11
|
+
const ctx = createMockContext();
|
|
42
12
|
|
|
43
13
|
const result = await discoverTools({}, ctx);
|
|
44
14
|
const res = result.result as { categories: unknown[]; total_tools: number };
|
|
@@ -50,8 +20,7 @@ describe('discoverTools', () => {
|
|
|
50
20
|
});
|
|
51
21
|
|
|
52
22
|
it('should return category info with tool counts', async () => {
|
|
53
|
-
const
|
|
54
|
-
const ctx = createMockContext(supabase);
|
|
23
|
+
const ctx = createMockContext();
|
|
55
24
|
|
|
56
25
|
const result = await discoverTools({}, ctx);
|
|
57
26
|
const res = result.result as { categories: { name: string; description: string; tool_count: number }[] };
|
|
@@ -63,8 +32,7 @@ describe('discoverTools', () => {
|
|
|
63
32
|
});
|
|
64
33
|
|
|
65
34
|
it('should return tools for specific category', async () => {
|
|
66
|
-
const
|
|
67
|
-
const ctx = createMockContext(supabase);
|
|
35
|
+
const ctx = createMockContext();
|
|
68
36
|
|
|
69
37
|
const result = await discoverTools({ category: 'session' }, ctx);
|
|
70
38
|
const res = result.result as { category: string; description: string; tools: unknown[] };
|
|
@@ -76,8 +44,7 @@ describe('discoverTools', () => {
|
|
|
76
44
|
});
|
|
77
45
|
|
|
78
46
|
it('should return tools with name and brief for specific category', async () => {
|
|
79
|
-
const
|
|
80
|
-
const ctx = createMockContext(supabase);
|
|
47
|
+
const ctx = createMockContext();
|
|
81
48
|
|
|
82
49
|
const result = await discoverTools({ category: 'tasks' }, ctx);
|
|
83
50
|
const res = result.result as { tools: { name: string; brief: string }[] };
|
|
@@ -89,8 +56,7 @@ describe('discoverTools', () => {
|
|
|
89
56
|
});
|
|
90
57
|
|
|
91
58
|
it('should return error for unknown category', async () => {
|
|
92
|
-
const
|
|
93
|
-
const ctx = createMockContext(supabase);
|
|
59
|
+
const ctx = createMockContext();
|
|
94
60
|
|
|
95
61
|
const result = await discoverTools({ category: 'nonexistent' }, ctx);
|
|
96
62
|
const res = result.result as { error: string; available: string[] };
|
|
@@ -101,8 +67,7 @@ describe('discoverTools', () => {
|
|
|
101
67
|
});
|
|
102
68
|
|
|
103
69
|
it('should include session category', async () => {
|
|
104
|
-
const
|
|
105
|
-
const ctx = createMockContext(supabase);
|
|
70
|
+
const ctx = createMockContext();
|
|
106
71
|
|
|
107
72
|
const result = await discoverTools({}, ctx);
|
|
108
73
|
const res = result.result as { categories: { name: string }[] };
|
|
@@ -112,8 +77,7 @@ describe('discoverTools', () => {
|
|
|
112
77
|
});
|
|
113
78
|
|
|
114
79
|
it('should include tasks category', async () => {
|
|
115
|
-
const
|
|
116
|
-
const ctx = createMockContext(supabase);
|
|
80
|
+
const ctx = createMockContext();
|
|
117
81
|
|
|
118
82
|
const result = await discoverTools({}, ctx);
|
|
119
83
|
const res = result.result as { categories: { name: string }[] };
|
|
@@ -123,8 +87,7 @@ describe('discoverTools', () => {
|
|
|
123
87
|
});
|
|
124
88
|
|
|
125
89
|
it('should include deployment category', async () => {
|
|
126
|
-
const
|
|
127
|
-
const ctx = createMockContext(supabase);
|
|
90
|
+
const ctx = createMockContext();
|
|
128
91
|
|
|
129
92
|
const result = await discoverTools({}, ctx);
|
|
130
93
|
const res = result.result as { categories: { name: string }[] };
|
|
@@ -134,8 +97,7 @@ describe('discoverTools', () => {
|
|
|
134
97
|
});
|
|
135
98
|
|
|
136
99
|
it('should include usage hint in response', async () => {
|
|
137
|
-
const
|
|
138
|
-
const ctx = createMockContext(supabase);
|
|
100
|
+
const ctx = createMockContext();
|
|
139
101
|
|
|
140
102
|
const result = await discoverTools({}, ctx);
|
|
141
103
|
const res = result.result as { usage: string };
|
|
@@ -152,8 +114,7 @@ describe('discoverTools', () => {
|
|
|
152
114
|
|
|
153
115
|
describe('getToolInfo', () => {
|
|
154
116
|
it('should return error for missing tool_name', async () => {
|
|
155
|
-
const
|
|
156
|
-
const ctx = createMockContext(supabase);
|
|
117
|
+
const ctx = createMockContext();
|
|
157
118
|
|
|
158
119
|
const result = await getToolInfo({}, ctx);
|
|
159
120
|
const res = result.result as { error: string };
|
|
@@ -162,8 +123,7 @@ describe('getToolInfo', () => {
|
|
|
162
123
|
});
|
|
163
124
|
|
|
164
125
|
it('should return error for unknown tool', async () => {
|
|
165
|
-
const
|
|
166
|
-
const ctx = createMockContext(supabase);
|
|
126
|
+
const ctx = createMockContext();
|
|
167
127
|
|
|
168
128
|
const result = await getToolInfo({ tool_name: 'nonexistent_tool' }, ctx);
|
|
169
129
|
const res = result.result as { error: string; hint: string };
|
|
@@ -173,8 +133,7 @@ describe('getToolInfo', () => {
|
|
|
173
133
|
});
|
|
174
134
|
|
|
175
135
|
it('should return info for start_work_session', async () => {
|
|
176
|
-
const
|
|
177
|
-
const ctx = createMockContext(supabase);
|
|
136
|
+
const ctx = createMockContext();
|
|
178
137
|
|
|
179
138
|
const result = await getToolInfo({ tool_name: 'start_work_session' }, ctx);
|
|
180
139
|
const res = result.result as { tool: string; info: string };
|
|
@@ -185,8 +144,7 @@ describe('getToolInfo', () => {
|
|
|
185
144
|
});
|
|
186
145
|
|
|
187
146
|
it('should return info for add_task', async () => {
|
|
188
|
-
const
|
|
189
|
-
const ctx = createMockContext(supabase);
|
|
147
|
+
const ctx = createMockContext();
|
|
190
148
|
|
|
191
149
|
const result = await getToolInfo({ tool_name: 'add_task' }, ctx);
|
|
192
150
|
const res = result.result as { tool: string; info: string };
|
|
@@ -197,8 +155,7 @@ describe('getToolInfo', () => {
|
|
|
197
155
|
});
|
|
198
156
|
|
|
199
157
|
it('should return info for complete_task', async () => {
|
|
200
|
-
const
|
|
201
|
-
const ctx = createMockContext(supabase);
|
|
158
|
+
const ctx = createMockContext();
|
|
202
159
|
|
|
203
160
|
const result = await getToolInfo({ tool_name: 'complete_task' }, ctx);
|
|
204
161
|
const res = result.result as { tool: string; info: string };
|
|
@@ -208,8 +165,7 @@ describe('getToolInfo', () => {
|
|
|
208
165
|
});
|
|
209
166
|
|
|
210
167
|
it('should return info for request_deployment', async () => {
|
|
211
|
-
const
|
|
212
|
-
const ctx = createMockContext(supabase);
|
|
168
|
+
const ctx = createMockContext();
|
|
213
169
|
|
|
214
170
|
const result = await getToolInfo({ tool_name: 'request_deployment' }, ctx);
|
|
215
171
|
const res = result.result as { tool: string; info: string };
|
|
@@ -220,8 +176,7 @@ describe('getToolInfo', () => {
|
|
|
220
176
|
});
|
|
221
177
|
|
|
222
178
|
it('should return info with parameters section', async () => {
|
|
223
|
-
const
|
|
224
|
-
const ctx = createMockContext(supabase);
|
|
179
|
+
const ctx = createMockContext();
|
|
225
180
|
|
|
226
181
|
const result = await getToolInfo({ tool_name: 'add_task' }, ctx);
|
|
227
182
|
const res = result.result as { info: string };
|
|
@@ -230,8 +185,7 @@ describe('getToolInfo', () => {
|
|
|
230
185
|
});
|
|
231
186
|
|
|
232
187
|
it('should return info for get_help', async () => {
|
|
233
|
-
const
|
|
234
|
-
const ctx = createMockContext(supabase);
|
|
188
|
+
const ctx = createMockContext();
|
|
235
189
|
|
|
236
190
|
const result = await getToolInfo({ tool_name: 'get_help' }, ctx);
|
|
237
191
|
const res = result.result as { tool: string; info: string };
|
|
@@ -242,8 +196,7 @@ describe('getToolInfo', () => {
|
|
|
242
196
|
});
|
|
243
197
|
|
|
244
198
|
it('should return info for discover_tools', async () => {
|
|
245
|
-
const
|
|
246
|
-
const ctx = createMockContext(supabase);
|
|
199
|
+
const ctx = createMockContext();
|
|
247
200
|
|
|
248
201
|
const result = await getToolInfo({ tool_name: 'discover_tools' }, ctx);
|
|
249
202
|
const res = result.result as { tool: string; info: string };
|