@vibescope/mcp-server 0.2.4 → 0.2.5
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/CHANGELOG.md +84 -84
- package/README.md +194 -181
- package/dist/cli.d.ts +6 -3
- package/dist/cli.js +28 -10
- package/dist/handlers/tool-docs.js +828 -828
- package/dist/index.js +73 -73
- package/dist/knowledge.d.ts +6 -0
- package/dist/knowledge.js +218 -0
- package/dist/setup.d.ts +22 -0
- package/dist/setup.js +313 -0
- package/dist/templates/agent-guidelines.js +185 -185
- package/dist/tools.js +65 -65
- package/dist/utils.js +11 -11
- package/docs/TOOLS.md +2053 -2053
- package/package.json +1 -1
- package/scripts/generate-docs.ts +212 -212
- package/scripts/version-bump.ts +203 -203
- package/src/api-client.test.ts +723 -723
- package/src/api-client.ts +2499 -2499
- package/src/cli.ts +27 -10
- package/src/handlers/__test-setup__.ts +236 -236
- package/src/handlers/__test-utils__.ts +87 -87
- package/src/handlers/blockers.test.ts +468 -468
- package/src/handlers/blockers.ts +163 -163
- package/src/handlers/bodies-of-work.test.ts +704 -704
- package/src/handlers/bodies-of-work.ts +526 -526
- package/src/handlers/connectors.test.ts +834 -834
- package/src/handlers/connectors.ts +229 -229
- package/src/handlers/cost.test.ts +462 -462
- package/src/handlers/cost.ts +285 -285
- package/src/handlers/decisions.test.ts +382 -382
- package/src/handlers/decisions.ts +153 -153
- package/src/handlers/deployment.test.ts +551 -551
- package/src/handlers/deployment.ts +541 -541
- package/src/handlers/discovery.test.ts +206 -206
- package/src/handlers/discovery.ts +390 -390
- package/src/handlers/fallback.test.ts +537 -537
- package/src/handlers/fallback.ts +194 -194
- package/src/handlers/file-checkouts.test.ts +750 -750
- package/src/handlers/file-checkouts.ts +185 -185
- package/src/handlers/findings.test.ts +633 -633
- package/src/handlers/findings.ts +239 -239
- package/src/handlers/git-issues.test.ts +631 -631
- package/src/handlers/git-issues.ts +136 -136
- package/src/handlers/ideas.test.ts +644 -644
- package/src/handlers/ideas.ts +207 -207
- package/src/handlers/index.ts +84 -84
- package/src/handlers/milestones.test.ts +475 -475
- package/src/handlers/milestones.ts +180 -180
- package/src/handlers/organizations.test.ts +826 -826
- package/src/handlers/organizations.ts +315 -315
- package/src/handlers/progress.test.ts +269 -269
- package/src/handlers/progress.ts +77 -77
- package/src/handlers/project.test.ts +546 -546
- package/src/handlers/project.ts +239 -239
- package/src/handlers/requests.test.ts +303 -303
- package/src/handlers/requests.ts +99 -99
- package/src/handlers/roles.test.ts +303 -303
- package/src/handlers/roles.ts +226 -226
- package/src/handlers/session.test.ts +875 -875
- package/src/handlers/session.ts +738 -738
- package/src/handlers/sprints.test.ts +732 -732
- package/src/handlers/sprints.ts +537 -537
- package/src/handlers/tasks.test.ts +907 -907
- package/src/handlers/tasks.ts +945 -945
- package/src/handlers/tool-categories.test.ts +66 -66
- package/src/handlers/tool-docs.ts +1096 -1096
- package/src/handlers/types.test.ts +259 -259
- package/src/handlers/types.ts +175 -175
- package/src/handlers/validation.test.ts +582 -582
- package/src/handlers/validation.ts +97 -97
- package/src/index.ts +792 -792
- package/src/setup.test.ts +231 -0
- package/src/setup.ts +370 -0
- package/src/templates/agent-guidelines.ts +210 -210
- package/src/token-tracking.test.ts +453 -453
- package/src/token-tracking.ts +164 -164
- package/src/tools.ts +3562 -3562
- package/src/utils.test.ts +683 -683
- package/src/utils.ts +436 -436
- package/src/validators.test.ts +223 -223
- package/src/validators.ts +249 -249
- package/tsconfig.json +16 -16
- package/vitest.config.ts +14 -14
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Test Utilities
|
|
3
|
-
*
|
|
4
|
-
* Common mock factories and test helpers used across handler tests.
|
|
5
|
-
* Handlers now use API client instead of direct Supabase access.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { vi } from 'vitest';
|
|
9
|
-
import type { HandlerContext, TokenUsage } from './types.js';
|
|
10
|
-
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// Mock Handler Context Factory
|
|
13
|
-
// ============================================================================
|
|
14
|
-
|
|
15
|
-
export interface MockContextOptions {
|
|
16
|
-
sessionId?: string | null;
|
|
17
|
-
userId?: string;
|
|
18
|
-
apiKeyId?: string;
|
|
19
|
-
instanceId?: string;
|
|
20
|
-
persona?: string;
|
|
21
|
-
tokenUsage?: TokenUsage;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Create a mock HandlerContext for testing.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```ts
|
|
29
|
-
* const ctx = createMockContext({ sessionId: 'test-session' });
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export function createMockContext(
|
|
33
|
-
options: MockContextOptions = {}
|
|
34
|
-
): HandlerContext {
|
|
35
|
-
const defaultTokenUsage: TokenUsage = {
|
|
36
|
-
callCount: 5,
|
|
37
|
-
totalTokens: 2500,
|
|
38
|
-
byTool: {},
|
|
39
|
-
byModel: {},
|
|
40
|
-
currentModel: null,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const sessionId = 'sessionId' in options ? (options.sessionId ?? null) : 'session-123';
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
auth: {
|
|
47
|
-
userId: options.userId ?? 'user-123',
|
|
48
|
-
apiKeyId: options.apiKeyId ?? 'api-key-123',
|
|
49
|
-
scope: 'personal' as const,
|
|
50
|
-
},
|
|
51
|
-
session: {
|
|
52
|
-
instanceId: options.instanceId ?? 'instance-abc',
|
|
53
|
-
currentSessionId: sessionId,
|
|
54
|
-
currentPersona: options.persona ?? 'Wave',
|
|
55
|
-
tokenUsage: options.tokenUsage ?? defaultTokenUsage,
|
|
56
|
-
},
|
|
57
|
-
updateSession: vi.fn(),
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// ============================================================================
|
|
62
|
-
// Test Data Generators
|
|
63
|
-
// ============================================================================
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Generate a valid UUID for testing.
|
|
67
|
-
*/
|
|
68
|
-
export function testUUID(): string {
|
|
69
|
-
return '123e4567-e89b-12d3-a456-426614174000';
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Generate a random-ish UUID for testing (deterministic based on seed).
|
|
74
|
-
*/
|
|
75
|
-
export function testUUIDSeeded(seed: number): string {
|
|
76
|
-
const hex = seed.toString(16).padStart(8, '0');
|
|
77
|
-
return `${hex}-e89b-12d3-a456-426614174000`;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Create a mock timestamp for consistent testing.
|
|
82
|
-
*/
|
|
83
|
-
export function testTimestamp(offsetMinutes = 0): string {
|
|
84
|
-
const date = new Date('2025-01-14T12:00:00Z');
|
|
85
|
-
date.setMinutes(date.getMinutes() + offsetMinutes);
|
|
86
|
-
return date.toISOString();
|
|
87
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Shared Test Utilities
|
|
3
|
+
*
|
|
4
|
+
* Common mock factories and test helpers used across handler tests.
|
|
5
|
+
* Handlers now use API client instead of direct Supabase access.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { vi } from 'vitest';
|
|
9
|
+
import type { HandlerContext, TokenUsage } from './types.js';
|
|
10
|
+
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// Mock Handler Context Factory
|
|
13
|
+
// ============================================================================
|
|
14
|
+
|
|
15
|
+
export interface MockContextOptions {
|
|
16
|
+
sessionId?: string | null;
|
|
17
|
+
userId?: string;
|
|
18
|
+
apiKeyId?: string;
|
|
19
|
+
instanceId?: string;
|
|
20
|
+
persona?: string;
|
|
21
|
+
tokenUsage?: TokenUsage;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Create a mock HandlerContext for testing.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const ctx = createMockContext({ sessionId: 'test-session' });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function createMockContext(
|
|
33
|
+
options: MockContextOptions = {}
|
|
34
|
+
): HandlerContext {
|
|
35
|
+
const defaultTokenUsage: TokenUsage = {
|
|
36
|
+
callCount: 5,
|
|
37
|
+
totalTokens: 2500,
|
|
38
|
+
byTool: {},
|
|
39
|
+
byModel: {},
|
|
40
|
+
currentModel: null,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const sessionId = 'sessionId' in options ? (options.sessionId ?? null) : 'session-123';
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
auth: {
|
|
47
|
+
userId: options.userId ?? 'user-123',
|
|
48
|
+
apiKeyId: options.apiKeyId ?? 'api-key-123',
|
|
49
|
+
scope: 'personal' as const,
|
|
50
|
+
},
|
|
51
|
+
session: {
|
|
52
|
+
instanceId: options.instanceId ?? 'instance-abc',
|
|
53
|
+
currentSessionId: sessionId,
|
|
54
|
+
currentPersona: options.persona ?? 'Wave',
|
|
55
|
+
tokenUsage: options.tokenUsage ?? defaultTokenUsage,
|
|
56
|
+
},
|
|
57
|
+
updateSession: vi.fn(),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ============================================================================
|
|
62
|
+
// Test Data Generators
|
|
63
|
+
// ============================================================================
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Generate a valid UUID for testing.
|
|
67
|
+
*/
|
|
68
|
+
export function testUUID(): string {
|
|
69
|
+
return '123e4567-e89b-12d3-a456-426614174000';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Generate a random-ish UUID for testing (deterministic based on seed).
|
|
74
|
+
*/
|
|
75
|
+
export function testUUIDSeeded(seed: number): string {
|
|
76
|
+
const hex = seed.toString(16).padStart(8, '0');
|
|
77
|
+
return `${hex}-e89b-12d3-a456-426614174000`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Create a mock timestamp for consistent testing.
|
|
82
|
+
*/
|
|
83
|
+
export function testTimestamp(offsetMinutes = 0): string {
|
|
84
|
+
const date = new Date('2025-01-14T12:00:00Z');
|
|
85
|
+
date.setMinutes(date.getMinutes() + offsetMinutes);
|
|
86
|
+
return date.toISOString();
|
|
87
|
+
}
|