@codemcp/workflows 5.0.1 → 5.1.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.
Files changed (77) hide show
  1. package/SKILL.md +23 -0
  2. package/package.json +6 -2
  3. package/.prettierignore +0 -2
  4. package/.turbo/turbo-build.log +0 -4
  5. package/.vibe/conversation-state.sqlite +0 -0
  6. package/src/components/beads/beads-instruction-generator.ts +0 -230
  7. package/src/components/beads/beads-plan-manager.ts +0 -333
  8. package/src/components/beads/beads-task-backend-client.ts +0 -229
  9. package/src/index.ts +0 -93
  10. package/src/notification-service.ts +0 -23
  11. package/src/plugin-system/beads-plugin.ts +0 -649
  12. package/src/plugin-system/commit-plugin.ts +0 -252
  13. package/src/plugin-system/index.ts +0 -20
  14. package/src/plugin-system/plugin-interfaces.ts +0 -153
  15. package/src/plugin-system/plugin-registry.ts +0 -190
  16. package/src/resource-handlers/conversation-state.ts +0 -55
  17. package/src/resource-handlers/development-plan.ts +0 -48
  18. package/src/resource-handlers/index.ts +0 -73
  19. package/src/resource-handlers/system-prompt.ts +0 -55
  20. package/src/resource-handlers/workflow-resource.ts +0 -132
  21. package/src/response-renderer.ts +0 -116
  22. package/src/server-config.ts +0 -760
  23. package/src/server-helpers.ts +0 -245
  24. package/src/server-implementation.ts +0 -277
  25. package/src/server.ts +0 -9
  26. package/src/tool-handlers/base-tool-handler.ts +0 -151
  27. package/src/tool-handlers/conduct-review.ts +0 -190
  28. package/src/tool-handlers/get-tool-info.ts +0 -273
  29. package/src/tool-handlers/index.ts +0 -115
  30. package/src/tool-handlers/list-workflows.ts +0 -78
  31. package/src/tool-handlers/no-idea.ts +0 -47
  32. package/src/tool-handlers/proceed-to-phase.ts +0 -296
  33. package/src/tool-handlers/reset-development.ts +0 -90
  34. package/src/tool-handlers/resume-workflow.ts +0 -378
  35. package/src/tool-handlers/setup-project-docs.ts +0 -232
  36. package/src/tool-handlers/start-development.ts +0 -746
  37. package/src/tool-handlers/whats-next.ts +0 -246
  38. package/src/types.ts +0 -135
  39. package/src/version-info.ts +0 -213
  40. package/test/e2e/beads-plugin-integration.test.ts +0 -1623
  41. package/test/e2e/commit-plugin-integration.test.ts +0 -222
  42. package/test/e2e/core-functionality.test.ts +0 -167
  43. package/test/e2e/git-branch-detection.test.ts +0 -351
  44. package/test/e2e/mcp-contract.test.ts +0 -509
  45. package/test/e2e/plan-management.test.ts +0 -334
  46. package/test/e2e/plugin-system-integration.test.ts +0 -1410
  47. package/test/e2e/state-management.test.ts +0 -387
  48. package/test/e2e/workflow-integration.test.ts +0 -498
  49. package/test/unit/beads-instruction-generator.test.ts +0 -979
  50. package/test/unit/beads-phase-task-id-integration.test.ts +0 -535
  51. package/test/unit/beads-plugin-behavioral.test.ts +0 -545
  52. package/test/unit/beads-plugin.test.ts +0 -117
  53. package/test/unit/commit-plugin.test.ts +0 -196
  54. package/test/unit/conduct-review.test.ts +0 -151
  55. package/test/unit/conversation-not-found-error.test.ts +0 -120
  56. package/test/unit/plugin-error-handling.test.ts +0 -240
  57. package/test/unit/proceed-to-phase-plugin-integration.test.ts +0 -150
  58. package/test/unit/reset-functionality.test.ts +0 -72
  59. package/test/unit/resume-workflow.test.ts +0 -193
  60. package/test/unit/server-config-plugin-registry.test.ts +0 -99
  61. package/test/unit/server-tools.test.ts +0 -310
  62. package/test/unit/setup-project-docs-handler.test.ts +0 -268
  63. package/test/unit/start-development-artifact-detection.test.ts +0 -387
  64. package/test/unit/start-development-gitignore.test.ts +0 -178
  65. package/test/unit/start-development-goal-extraction.test.ts +0 -226
  66. package/test/unit/system-prompt-resource.test.ts +0 -102
  67. package/test/unit/tool-handlers/no-idea.test.ts +0 -40
  68. package/test/utils/e2e-test-setup.ts +0 -451
  69. package/test/utils/run-server-in-dir.sh +0 -27
  70. package/test/utils/temp-files.ts +0 -320
  71. package/test/utils/test-access.ts +0 -79
  72. package/test/utils/test-helpers.ts +0 -288
  73. package/test/utils/test-setup.ts +0 -77
  74. package/tsconfig.build.json +0 -10
  75. package/tsconfig.build.tsbuildinfo +0 -1
  76. package/tsconfig.json +0 -12
  77. package/vitest.config.ts +0 -19
@@ -1,226 +0,0 @@
1
- /**
2
- * Unit tests for BeadsPlugin Goal extraction functionality
3
- *
4
- * Tests the extractGoalFromPlan method that extracts meaningful goal content
5
- * from development plan files for use in beads integration
6
- */
7
-
8
- import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
9
- import { TestAccess } from '../utils/test-access.js';
10
- import { BeadsPlugin } from '../../src/plugin-system/beads-plugin.js';
11
-
12
- describe('BeadsPlugin - Goal Extraction', () => {
13
- let plugin: BeadsPlugin;
14
-
15
- beforeEach(() => {
16
- // Mock environment variable for plugin enablement
17
- vi.stubEnv('TASK_BACKEND', 'beads');
18
- plugin = new BeadsPlugin({ projectPath: '/test/project' });
19
- });
20
-
21
- afterEach(() => {
22
- vi.unstubAllEnvs();
23
- });
24
-
25
- describe('extractGoalFromPlan', () => {
26
- it('should extract meaningful goal content', () => {
27
- const planContent = `# Development Plan: Test Project
28
-
29
- ## Goal
30
- Build a user authentication system with JWT tokens and password reset functionality.
31
-
32
- ## Explore
33
- ### Tasks
34
- - [ ] Analyze requirements
35
- `;
36
-
37
- const result = TestAccess.callMethod(
38
- plugin,
39
- 'extractGoalFromPlan',
40
- planContent
41
- );
42
-
43
- expect(result).toBe(
44
- 'Build a user authentication system with JWT tokens and password reset functionality.'
45
- );
46
- });
47
-
48
- it('should return undefined for placeholder goal content', () => {
49
- const planContent = `# Development Plan: Test Project
50
-
51
- ## Goal
52
- *Define what you're building or fixing - this will be updated as requirements are gathered*
53
-
54
- ## Explore
55
- ### Tasks
56
- - [ ] Analyze requirements
57
- `;
58
-
59
- const result = TestAccess.callMethod(
60
- plugin,
61
- 'extractGoalFromPlan',
62
- planContent
63
- );
64
-
65
- expect(result).toBeUndefined();
66
- });
67
-
68
- it('should return undefined for "To be defined" content', () => {
69
- const planContent = `# Development Plan: Test Project
70
-
71
- ## Goal
72
- To be defined during exploration
73
-
74
- ## Explore
75
- ### Tasks
76
- - [ ] Analyze requirements
77
- `;
78
-
79
- const result = TestAccess.callMethod(
80
- plugin,
81
- 'extractGoalFromPlan',
82
- planContent
83
- );
84
-
85
- expect(result).toBeUndefined();
86
- });
87
-
88
- it('should return undefined for very short content', () => {
89
- const planContent = `# Development Plan: Test Project
90
-
91
- ## Goal
92
- Fix bug
93
-
94
- ## Explore
95
- ### Tasks
96
- - [ ] Analyze requirements
97
- `;
98
-
99
- const result = TestAccess.callMethod(
100
- plugin,
101
- 'extractGoalFromPlan',
102
- planContent
103
- );
104
-
105
- expect(result).toBeUndefined();
106
- });
107
-
108
- it('should handle multiline goal content correctly', () => {
109
- const planContent = `# Development Plan: Test Project
110
-
111
- ## Goal
112
- Implement a comprehensive logging system that captures:
113
- - User actions and authentication events
114
- - API request/response cycles
115
- - System errors with stack traces
116
- - Performance metrics
117
-
118
- The system should support different log levels and output formats.
119
-
120
- ## Explore
121
- ### Tasks
122
- - [ ] Analyze requirements
123
- `;
124
-
125
- const result = TestAccess.callMethod(
126
- plugin,
127
- 'extractGoalFromPlan',
128
- planContent
129
- );
130
-
131
- expect(result)
132
- .toBe(`Implement a comprehensive logging system that captures:
133
- - User actions and authentication events
134
- - API request/response cycles
135
- - System errors with stack traces
136
- - Performance metrics
137
-
138
- The system should support different log levels and output formats.`);
139
- });
140
-
141
- it('should return undefined when no Goal section exists', () => {
142
- const planContent = `# Development Plan: Test Project
143
-
144
- ## Explore
145
- ### Tasks
146
- - [ ] Analyze requirements
147
- `;
148
-
149
- const result = TestAccess.callMethod(
150
- plugin,
151
- 'extractGoalFromPlan',
152
- planContent
153
- );
154
-
155
- expect(result).toBeUndefined();
156
- });
157
-
158
- it('should return undefined for empty or null input', () => {
159
- expect(
160
- TestAccess.callMethod(plugin, 'extractGoalFromPlan', '')
161
- ).toBeUndefined();
162
-
163
- expect(
164
- TestAccess.callMethod(plugin, 'extractGoalFromPlan', null)
165
- ).toBeUndefined();
166
-
167
- expect(
168
- TestAccess.callMethod(plugin, 'extractGoalFromPlan', undefined)
169
- ).toBeUndefined();
170
- });
171
-
172
- it('should stop at the next section boundary', () => {
173
- const planContent = `# Development Plan: Test Project
174
-
175
- ## Goal
176
- Build a user authentication system with secure login and registration.
177
-
178
- ## Key Decisions
179
- - Using JWT for token-based authentication
180
- - Password hashing with bcrypt
181
- `;
182
-
183
- const result = TestAccess.callMethod(
184
- plugin,
185
- 'extractGoalFromPlan',
186
- planContent
187
- );
188
-
189
- expect(result).toBe(
190
- 'Build a user authentication system with secure login and registration.'
191
- );
192
- });
193
- });
194
-
195
- describe('plan filename extraction', () => {
196
- it('should extract filename from plan file path correctly', () => {
197
- // Test the logic used in setupBeadsIntegration
198
- const planFilePath = '/project/.vibe/development-plan-feature-auth.md';
199
- const planFilename = planFilePath.split('/').pop();
200
-
201
- expect(planFilename).toBe('development-plan-feature-auth.md');
202
- });
203
-
204
- it('should handle various plan file path formats', () => {
205
- const testCases = [
206
- {
207
- path: '/Users/dev/my-project/.vibe/development-plan-main.md',
208
- expected: 'development-plan-main.md',
209
- },
210
- {
211
- path: 'development-plan-bugfix.md',
212
- expected: 'development-plan-bugfix.md',
213
- },
214
- {
215
- path: '/deep/nested/path/to/.vibe/development-plan-feature-dashboard.md',
216
- expected: 'development-plan-feature-dashboard.md',
217
- },
218
- ];
219
-
220
- for (const { path, expected } of testCases) {
221
- const filename = path.split('/').pop();
222
- expect(filename).toBe(expected);
223
- }
224
- });
225
- });
226
- });
@@ -1,102 +0,0 @@
1
- /**
2
- * System Prompt Resource Tests
3
- *
4
- * Tests for the system-prompt resource handler to ensure it properly
5
- * exposes the system prompt through the MCP protocol.
6
- */
7
-
8
- import { describe, it, expect } from 'vitest';
9
- import { SystemPromptResourceHandler } from '../../src/resource-handlers/system-prompt.js';
10
- import type { ServerContext } from '../../src/types.js';
11
-
12
- describe('System Prompt Resource', () => {
13
- it('should expose system prompt as MCP resource', async () => {
14
- const handler = new SystemPromptResourceHandler();
15
-
16
- // Call the handler directly
17
- const result = await handler.handle(
18
- new URL('system-prompt://'),
19
- {} as ServerContext
20
- );
21
-
22
- // Verify the safeExecute wrapper structure
23
- expect(result).toBeDefined();
24
- expect(result.success).toBe(true);
25
- expect(result.data).toBeDefined();
26
-
27
- const data = result.data!;
28
- expect(data.uri).toBe('system-prompt://');
29
- expect(data.mimeType).toBe('text/plain');
30
- expect(data.text).toBeDefined();
31
- expect(typeof data.text).toBe('string');
32
-
33
- // Verify content contains expected system prompt elements (streamlined version)
34
- expect(data.text).toContain(
35
- 'You are an AI assistant that helps users develop software features'
36
- );
37
- expect(data.text).toContain('responsible-vibe-mcp');
38
- expect(data.text).toContain('whats_next()');
39
- expect(data.text).toContain('instructions');
40
- expect(data.text).toContain('development plan');
41
-
42
- // Verify it's concise but not empty (streamlined prompt is ~400 chars)
43
- expect(data.text.length).toBeGreaterThan(200);
44
- expect(data.text.length).toBeLessThan(1000);
45
- });
46
-
47
- it('should be workflow-independent and consistent', async () => {
48
- const handler = new SystemPromptResourceHandler();
49
-
50
- // Get system prompt multiple times
51
- const result1 = await handler.handle(
52
- new URL('system-prompt://'),
53
- {} as ServerContext
54
- );
55
- const result2 = await handler.handle(
56
- new URL('system-prompt://'),
57
- {} as ServerContext
58
- );
59
- const result3 = await handler.handle(
60
- new URL('system-prompt://'),
61
- {} as ServerContext
62
- );
63
-
64
- // All should be successful
65
- expect(result1.success).toBe(true);
66
- expect(result2.success).toBe(true);
67
- expect(result3.success).toBe(true);
68
-
69
- // All should be identical
70
- expect(result1.data!.text).toBe(result2.data!.text);
71
- expect(result2.data!.text).toBe(result3.data!.text);
72
-
73
- // Verify the prompt contains standard elements (streamlined version)
74
- expect(result1.data!.text).toContain('You are an AI assistant');
75
- expect(result1.data!.text).toContain('whats_next()');
76
- expect(result1.data!.text).toContain('development');
77
- expect(result1.data!.text).toContain('instructions');
78
- });
79
-
80
- it('should use streamlined system prompt', async () => {
81
- const handler = new SystemPromptResourceHandler();
82
-
83
- const result = await handler.handle(
84
- new URL('system-prompt://'),
85
- {} as ServerContext
86
- );
87
-
88
- expect(result.success).toBe(true);
89
-
90
- // The streamlined system prompt should be concise and focused
91
- // It relies on tool responses for detailed phase instructions
92
- expect(result.data!.text).toContain(
93
- 'You are an AI assistant that helps users develop software features'
94
- );
95
- expect(result.data!.text).toContain('whats_next()');
96
- expect(result.data!.text).toContain('instructions');
97
- expect(result.data!.text).toContain('development plan');
98
-
99
- // Streamlined prompt should be concise (~400 chars vs old 2000+)
100
- expect(result.data!.text.length).toBeLessThan(1000);
101
- });
102
- });
@@ -1,40 +0,0 @@
1
- /**
2
- * Tests for NoIdeaHandler
3
- */
4
-
5
- import { describe, it, expect } from 'vitest';
6
- import { NoIdeaHandler } from '../../../src/tool-handlers/no-idea.js';
7
- import { MockContextFactory } from '../../utils/test-helpers.js';
8
-
9
- describe('NoIdeaHandler', () => {
10
- const handler = new NoIdeaHandler();
11
- const mockContext = MockContextFactory.createBasicContext('/tmp/test');
12
-
13
- it('should return instructions with key terms', async () => {
14
- const result = await handler.handle({}, mockContext);
15
-
16
- expect(result.success).toBe(true);
17
- const instructions = result.data?.instructions || '';
18
- expect(instructions.toLowerCase()).toContain('you have no');
19
- expect(instructions.toLowerCase()).toContain('admit');
20
- expect(instructions.toLowerCase()).toContain('clarify');
21
- });
22
-
23
- it('should include provided context', async () => {
24
- const result = await handler.handle(
25
- { context: 'quantum physics' },
26
- mockContext
27
- );
28
-
29
- expect(result.success).toBe(true);
30
- const instructions = result.data?.instructions || '';
31
- expect(instructions).toContain('quantum physics');
32
- });
33
-
34
- it('should handle empty context', async () => {
35
- const result = await handler.handle({ context: '' }, mockContext);
36
-
37
- expect(result.success).toBe(true);
38
- expect(result.data?.instructions).toBeDefined();
39
- });
40
- });