@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,334 +0,0 @@
1
- import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
2
- import {
3
- TempProject,
4
- createTempProjectWithDefaultStateMachine,
5
- } from '../utils/temp-files';
6
- import {
7
- DirectServerInterface,
8
- createSuiteIsolatedE2EScenario,
9
- assertToolSuccess,
10
- initializeDevelopment,
11
- } from '../utils/e2e-test-setup';
12
- import { promises as fs } from 'node:fs';
13
- import path from 'node:path';
14
-
15
- vi.unmock('fs');
16
- vi.unmock('fs/promises');
17
-
18
- /**
19
- * Plan Management Tests
20
- *
21
- * Tests plan file functionality including:
22
- * - Plan file creation and structure
23
- * - Content management and updates
24
- * - File path handling and organization
25
- * - Integration with development phases
26
- */
27
- describe('Plan Management', () => {
28
- let client: DirectServerInterface;
29
- let tempProject: TempProject;
30
- let cleanup: () => Promise<void>;
31
-
32
- beforeEach(async () => {
33
- // Explicitly disable beads auto-detection to test markdown format
34
- vi.stubEnv('TASK_BACKEND', 'markdown');
35
-
36
- const scenario = await createSuiteIsolatedE2EScenario({
37
- suiteName: 'plan-management',
38
- tempProjectFactory: createTempProjectWithDefaultStateMachine,
39
- });
40
- client = scenario.client;
41
- tempProject = scenario.tempProject;
42
- cleanup = scenario.cleanup;
43
-
44
- // Initialize development with default workflow before each test
45
- await initializeDevelopment(client);
46
- });
47
-
48
- afterEach(async () => {
49
- if (cleanup) {
50
- await cleanup();
51
- }
52
- });
53
-
54
- describe('Plan File Creation', () => {
55
- it('should create plan file on first conversation', async () => {
56
- const result = await client.callTool('whats_next', {
57
- user_input: 'implement new feature',
58
- });
59
- const response = assertToolSuccess(result);
60
-
61
- expect(response.plan_file_path).toBeTruthy();
62
- expect(response.plan_file_path).toMatch(/\.md$/);
63
-
64
- // Verify file exists
65
- const planExists = await fs
66
- .access(response.plan_file_path)
67
- .then(() => true)
68
- .catch(() => false);
69
- expect(planExists).toBe(true);
70
- });
71
-
72
- it('should use absolute paths for plan files', async () => {
73
- const result = await client.callTool('whats_next', {
74
- user_input: 'test absolute paths',
75
- });
76
- const response = assertToolSuccess(result);
77
-
78
- expect(path.isAbsolute(response.plan_file_path)).toBe(true);
79
- expect(response.plan_file_path).toContain(tempProject.projectPath);
80
- });
81
-
82
- it('should create plan files in .vibe directory', async () => {
83
- const result = await client.callTool('whats_next', {
84
- user_input: 'test vibe directory',
85
- });
86
- const response = assertToolSuccess(result);
87
-
88
- expect(response.plan_file_path).toContain('.vibe');
89
-
90
- // Verify .vibe directory exists
91
- const vibeDir = path.dirname(response.plan_file_path);
92
- const vibeDirExists = await fs
93
- .access(vibeDir)
94
- .then(() => true)
95
- .catch(() => false);
96
- expect(vibeDirExists).toBe(true);
97
- });
98
- });
99
-
100
- describe('Plan File Structure', () => {
101
- it('should create well-structured markdown plan', async () => {
102
- await client.callTool('whats_next', {
103
- user_input: 'create structured plan',
104
- });
105
-
106
- const planResource = await client.readResource('plan://current');
107
- const planContent = planResource.contents[0].text;
108
-
109
- expect(planContent).toContain('# Development Plan');
110
- expect(planContent).toContain('## Goal');
111
- expect(planContent).toContain('## Requirements');
112
- expect(planContent).toContain('## Key Decisions');
113
- });
114
-
115
- it('should include phase-specific sections', async () => {
116
- // Start in requirements phase
117
- await client.callTool('whats_next', {
118
- user_input: 'requirements phase test',
119
- });
120
-
121
- // Move to design phase
122
- await client.callTool('proceed_to_phase', {
123
- target_phase: 'design',
124
- reason: 'test design section',
125
- review_state: 'not-required',
126
- });
127
-
128
- const planResource = await client.readResource('plan://current');
129
- const planContent = planResource.contents[0].text;
130
-
131
- expect(planContent).toContain('## Design');
132
- expect(planContent).toContain('## Requirements');
133
- });
134
-
135
- it('should maintain consistent markdown formatting', async () => {
136
- await client.callTool('whats_next', {
137
- user_input: 'test formatting',
138
- });
139
-
140
- const planResource = await client.readResource('plan://current');
141
- const planContent = planResource.contents[0].text;
142
-
143
- // Check for proper markdown structure
144
- expect(planContent).toMatch(/^# /m); // H1 headers
145
- expect(planContent).toMatch(/^## /m); // H2 headers
146
- expect(planContent).toMatch(/^- \[ \]/m); // Task checkboxes
147
- });
148
- });
149
-
150
- describe('Plan File Updates', () => {
151
- it('should update plan file across phase transitions', async () => {
152
- // Get initial plan content
153
- const initialPlan = await client.readResource('plan://current');
154
- const initialContent = initialPlan.contents[0].text;
155
-
156
- // Transition to design
157
- await client.callTool('proceed_to_phase', {
158
- target_phase: 'design',
159
- reason: 'move to design',
160
- review_state: 'not-required',
161
- });
162
-
163
- // Get updated plan content
164
- const updatedPlan = await client.readResource('plan://current');
165
- const updatedContent = updatedPlan.contents[0].text;
166
-
167
- // Plan should be updated with design phase information
168
- expect(updatedContent).toContain('## Design');
169
- expect(updatedContent.length).toBeGreaterThanOrEqual(
170
- initialContent.length
171
- );
172
- });
173
-
174
- it('should preserve existing plan content when updating', async () => {
175
- const result = await client.callTool('whats_next', {
176
- user_input: 'preserve content test',
177
- });
178
- const response = assertToolSuccess(result);
179
-
180
- // Manually add content to plan file
181
- const customContent = '\n\n## Custom Section\n- Custom task\n';
182
- await fs.appendFile(response.plan_file_path, customContent);
183
-
184
- // Make another call that would update the plan
185
- await client.callTool('proceed_to_phase', {
186
- target_phase: 'implementation',
187
- reason: 'test preservation',
188
- review_state: 'not-required',
189
- });
190
-
191
- const planResource = await client.readResource('plan://current');
192
- const planContent = planResource.contents[0].text;
193
-
194
- // Custom content should still be present
195
- expect(planContent).toContain('## Custom Section');
196
- expect(planContent).toContain('- Custom task');
197
- });
198
-
199
- it('should handle concurrent plan file access', async () => {
200
- await client.callTool('whats_next', { user_input: 'concurrent test' });
201
-
202
- // Make multiple rapid calls that would update the plan
203
- const promises = [
204
- client.callTool('proceed_to_phase', {
205
- target_phase: 'design',
206
- reason: 'test1',
207
- review_state: 'not-required',
208
- }),
209
- client.callTool('proceed_to_phase', {
210
- target_phase: 'implementation',
211
- reason: 'test2',
212
- review_state: 'not-required',
213
- }),
214
- client.callTool('whats_next', { user_input: 'update plan' }),
215
- ];
216
-
217
- const results = await Promise.all(promises);
218
-
219
- // All operations should succeed
220
- for (const result of results) {
221
- expect(result).toBeTruthy();
222
- }
223
-
224
- // Plan file should still be accessible and valid
225
- const planResource = await client.readResource('plan://current');
226
- expect(planResource.contents[0].text).toContain('# Development Plan');
227
- });
228
- });
229
-
230
- describe('Plan File Organization', () => {
231
- it('should organize plan files by branch when applicable', async () => {
232
- const result = await client.callTool('whats_next', {
233
- user_input: 'branch organization test',
234
- });
235
- const response = assertToolSuccess(result);
236
-
237
- // Plan file path should reflect current branch context
238
- expect(response.plan_file_path).toContain('development-plan');
239
- expect(response.plan_file_path).toMatch(/\.md$/);
240
- });
241
-
242
- it('should handle special characters in project paths', async () => {
243
- // This test verifies the system handles various path scenarios
244
- const result = await client.callTool('whats_next', {
245
- user_input: 'special characters test',
246
- });
247
- const response = assertToolSuccess(result);
248
-
249
- expect(path.isAbsolute(response.plan_file_path)).toBe(true);
250
-
251
- // File should be creatable and accessible
252
- const planExists = await fs
253
- .access(response.plan_file_path)
254
- .then(() => true)
255
- .catch(() => false);
256
- expect(planExists).toBe(true);
257
- });
258
-
259
- it('should maintain plan file consistency across sessions', async () => {
260
- // First session
261
- const first = await client.callTool('whats_next', {
262
- user_input: 'session consistency test',
263
- });
264
- const firstResponse = assertToolSuccess(first);
265
- const firstPlanPath = firstResponse.plan_file_path;
266
-
267
- // Second call in same session
268
- const second = await client.callTool('whats_next', {
269
- user_input: 'continue session',
270
- });
271
- const secondResponse = assertToolSuccess(second);
272
-
273
- // Should use same plan file
274
- expect(secondResponse.plan_file_path).toBe(firstPlanPath);
275
- });
276
- });
277
-
278
- describe('Plan Content Integration', () => {
279
- it('should integrate plan content with phase instructions', async () => {
280
- let result = await client.callTool('whats_next', {
281
- user_input: 'integration test',
282
- });
283
- let response = assertToolSuccess(result);
284
-
285
- // Instructions should reference plan file updates
286
- expect(response.instructions).toContain('plan');
287
- expect(response.plan_file_path).toBeTruthy();
288
-
289
- const planResource = await client.readResource('plan://current');
290
- const planContent = planResource.contents[0].text;
291
-
292
- // Plan should contain relevant phase information of all but the initial phase
293
- result = await client.callTool('proceed_to_phase', {
294
- target_phase: 'requirements',
295
- reason: 'Starting specification',
296
- review_state: 'not-required',
297
- });
298
- response = assertToolSuccess(result);
299
-
300
- expect(planContent).toContain(response.phase);
301
- });
302
-
303
- it('should provide contextual plan guidance', async () => {
304
- await client.callTool('whats_next', {
305
- user_input: 'contextual guidance test',
306
- });
307
-
308
- await client.callTool('proceed_to_phase', {
309
- target_phase: 'qa',
310
- reason: 'test qa guidance',
311
- review_state: 'not-required',
312
- });
313
-
314
- const planResource = await client.readResource('plan://current');
315
- const planContent = planResource.contents[0].text;
316
-
317
- // Plan should contain QA-specific content
318
- expect(planContent).toContain('## Qa');
319
- });
320
-
321
- it('should track task completion in plan file', async () => {
322
- await client.callTool('whats_next', {
323
- user_input: 'task tracking test',
324
- });
325
-
326
- const planResource = await client.readResource('plan://current');
327
- const planContent = planResource.contents[0].text;
328
-
329
- // Should contain task checkboxes
330
- expect(planContent).toMatch(/- \[ \]/); // Uncompleted tasks
331
- // May contain completed tasks depending on phase logic
332
- });
333
- });
334
- });