@codemcp/workflows 3.1.21

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 (159) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/.vibe/conversation-state.sqlite +0 -0
  3. package/LICENSE +674 -0
  4. package/dist/index.d.ts +9 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +74 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/notification-service.d.ts +14 -0
  9. package/dist/notification-service.d.ts.map +1 -0
  10. package/dist/notification-service.js +18 -0
  11. package/dist/notification-service.js.map +1 -0
  12. package/dist/resource-handlers/conversation-state.d.ts +15 -0
  13. package/dist/resource-handlers/conversation-state.d.ts.map +1 -0
  14. package/dist/resource-handlers/conversation-state.js +40 -0
  15. package/dist/resource-handlers/conversation-state.js.map +1 -0
  16. package/dist/resource-handlers/development-plan.d.ts +14 -0
  17. package/dist/resource-handlers/development-plan.d.ts.map +1 -0
  18. package/dist/resource-handlers/development-plan.js +31 -0
  19. package/dist/resource-handlers/development-plan.js.map +1 -0
  20. package/dist/resource-handlers/index.d.ts +24 -0
  21. package/dist/resource-handlers/index.d.ts.map +1 -0
  22. package/dist/resource-handlers/index.js +62 -0
  23. package/dist/resource-handlers/index.js.map +1 -0
  24. package/dist/resource-handlers/system-prompt.d.ts +15 -0
  25. package/dist/resource-handlers/system-prompt.d.ts.map +1 -0
  26. package/dist/resource-handlers/system-prompt.js +40 -0
  27. package/dist/resource-handlers/system-prompt.js.map +1 -0
  28. package/dist/resource-handlers/workflow-resource.d.ts +15 -0
  29. package/dist/resource-handlers/workflow-resource.d.ts.map +1 -0
  30. package/dist/resource-handlers/workflow-resource.js +85 -0
  31. package/dist/resource-handlers/workflow-resource.js.map +1 -0
  32. package/dist/response-renderer.d.ts +30 -0
  33. package/dist/response-renderer.d.ts.map +1 -0
  34. package/dist/response-renderer.js +94 -0
  35. package/dist/response-renderer.js.map +1 -0
  36. package/dist/server-config.d.ts +34 -0
  37. package/dist/server-config.d.ts.map +1 -0
  38. package/dist/server-config.js +486 -0
  39. package/dist/server-config.js.map +1 -0
  40. package/dist/server-helpers.d.ts +62 -0
  41. package/dist/server-helpers.d.ts.map +1 -0
  42. package/dist/server-helpers.js +156 -0
  43. package/dist/server-helpers.js.map +1 -0
  44. package/dist/server-implementation.d.ts +74 -0
  45. package/dist/server-implementation.d.ts.map +1 -0
  46. package/dist/server-implementation.js +201 -0
  47. package/dist/server-implementation.js.map +1 -0
  48. package/dist/server.d.ts +6 -0
  49. package/dist/server.d.ts.map +1 -0
  50. package/dist/server.js +5 -0
  51. package/dist/server.js.map +1 -0
  52. package/dist/tool-handlers/base-tool-handler.d.ts +50 -0
  53. package/dist/tool-handlers/base-tool-handler.d.ts.map +1 -0
  54. package/dist/tool-handlers/base-tool-handler.js +74 -0
  55. package/dist/tool-handlers/base-tool-handler.js.map +1 -0
  56. package/dist/tool-handlers/conduct-review.d.ts +49 -0
  57. package/dist/tool-handlers/conduct-review.d.ts.map +1 -0
  58. package/dist/tool-handlers/conduct-review.js +105 -0
  59. package/dist/tool-handlers/conduct-review.js.map +1 -0
  60. package/dist/tool-handlers/get-tool-info.d.ts +76 -0
  61. package/dist/tool-handlers/get-tool-info.d.ts.map +1 -0
  62. package/dist/tool-handlers/get-tool-info.js +168 -0
  63. package/dist/tool-handlers/get-tool-info.js.map +1 -0
  64. package/dist/tool-handlers/index.d.ts +42 -0
  65. package/dist/tool-handlers/index.d.ts.map +1 -0
  66. package/dist/tool-handlers/index.js +74 -0
  67. package/dist/tool-handlers/index.js.map +1 -0
  68. package/dist/tool-handlers/install-workflow.d.ts +48 -0
  69. package/dist/tool-handlers/install-workflow.d.ts.map +1 -0
  70. package/dist/tool-handlers/install-workflow.js +131 -0
  71. package/dist/tool-handlers/install-workflow.js.map +1 -0
  72. package/dist/tool-handlers/list-workflows.d.ts +47 -0
  73. package/dist/tool-handlers/list-workflows.d.ts.map +1 -0
  74. package/dist/tool-handlers/list-workflows.js +58 -0
  75. package/dist/tool-handlers/list-workflows.js.map +1 -0
  76. package/dist/tool-handlers/no-idea.d.ts +41 -0
  77. package/dist/tool-handlers/no-idea.d.ts.map +1 -0
  78. package/dist/tool-handlers/no-idea.js +29 -0
  79. package/dist/tool-handlers/no-idea.js.map +1 -0
  80. package/dist/tool-handlers/proceed-to-phase.d.ts +39 -0
  81. package/dist/tool-handlers/proceed-to-phase.d.ts.map +1 -0
  82. package/dist/tool-handlers/proceed-to-phase.js +109 -0
  83. package/dist/tool-handlers/proceed-to-phase.js.map +1 -0
  84. package/dist/tool-handlers/reset-development.d.ts +31 -0
  85. package/dist/tool-handlers/reset-development.d.ts.map +1 -0
  86. package/dist/tool-handlers/reset-development.js +48 -0
  87. package/dist/tool-handlers/reset-development.js.map +1 -0
  88. package/dist/tool-handlers/resume-workflow.d.ts +88 -0
  89. package/dist/tool-handlers/resume-workflow.d.ts.map +1 -0
  90. package/dist/tool-handlers/resume-workflow.js +213 -0
  91. package/dist/tool-handlers/resume-workflow.js.map +1 -0
  92. package/dist/tool-handlers/setup-project-docs.d.ts +36 -0
  93. package/dist/tool-handlers/setup-project-docs.d.ts.map +1 -0
  94. package/dist/tool-handlers/setup-project-docs.js +136 -0
  95. package/dist/tool-handlers/setup-project-docs.js.map +1 -0
  96. package/dist/tool-handlers/start-development.d.ts +82 -0
  97. package/dist/tool-handlers/start-development.d.ts.map +1 -0
  98. package/dist/tool-handlers/start-development.js +448 -0
  99. package/dist/tool-handlers/start-development.js.map +1 -0
  100. package/dist/tool-handlers/whats-next.d.ts +42 -0
  101. package/dist/tool-handlers/whats-next.d.ts.map +1 -0
  102. package/dist/tool-handlers/whats-next.js +118 -0
  103. package/dist/tool-handlers/whats-next.js.map +1 -0
  104. package/dist/types.d.ts +114 -0
  105. package/dist/types.d.ts.map +1 -0
  106. package/dist/types.js +5 -0
  107. package/dist/types.js.map +1 -0
  108. package/package.json +29 -0
  109. package/src/index.ts +93 -0
  110. package/src/notification-service.ts +23 -0
  111. package/src/resource-handlers/conversation-state.ts +55 -0
  112. package/src/resource-handlers/development-plan.ts +48 -0
  113. package/src/resource-handlers/index.ts +73 -0
  114. package/src/resource-handlers/system-prompt.ts +55 -0
  115. package/src/resource-handlers/workflow-resource.ts +126 -0
  116. package/src/response-renderer.ts +116 -0
  117. package/src/server-config.ts +744 -0
  118. package/src/server-helpers.ts +225 -0
  119. package/src/server-implementation.ts +277 -0
  120. package/src/server.ts +9 -0
  121. package/src/tool-handlers/base-tool-handler.ts +141 -0
  122. package/src/tool-handlers/conduct-review.ts +191 -0
  123. package/src/tool-handlers/get-tool-info.ts +274 -0
  124. package/src/tool-handlers/index.ts +117 -0
  125. package/src/tool-handlers/install-workflow.ts +185 -0
  126. package/src/tool-handlers/list-workflows.ts +94 -0
  127. package/src/tool-handlers/no-idea.ts +47 -0
  128. package/src/tool-handlers/proceed-to-phase.ts +205 -0
  129. package/src/tool-handlers/reset-development.ts +90 -0
  130. package/src/tool-handlers/resume-workflow.ts +380 -0
  131. package/src/tool-handlers/setup-project-docs.ts +226 -0
  132. package/src/tool-handlers/start-development.ts +685 -0
  133. package/src/tool-handlers/whats-next.ts +235 -0
  134. package/src/types.ts +130 -0
  135. package/test/e2e/core-functionality.test.ts +176 -0
  136. package/test/e2e/mcp-contract.test.ts +540 -0
  137. package/test/e2e/plan-management.test.ts +331 -0
  138. package/test/e2e/state-management.test.ts +392 -0
  139. package/test/e2e/workflow-integration.test.ts +506 -0
  140. package/test/unit/commit-behaviour-interface.test.ts +244 -0
  141. package/test/unit/conduct-review.test.ts +151 -0
  142. package/test/unit/reset-functionality.test.ts +72 -0
  143. package/test/unit/resume-workflow.test.ts +192 -0
  144. package/test/unit/server-tools.test.ts +311 -0
  145. package/test/unit/setup-project-docs-handler.test.ts +267 -0
  146. package/test/unit/start-development-artifact-detection.test.ts +387 -0
  147. package/test/unit/start-development-gitignore.test.ts +178 -0
  148. package/test/unit/system-prompt-resource.test.ts +101 -0
  149. package/test/unit/tool-handlers/no-idea.test.ts +40 -0
  150. package/test/utils/e2e-test-setup.ts +453 -0
  151. package/test/utils/run-server-in-dir.sh +27 -0
  152. package/test/utils/temp-files.ts +308 -0
  153. package/test/utils/test-access.ts +79 -0
  154. package/test/utils/test-helpers.ts +286 -0
  155. package/test/utils/test-setup.ts +78 -0
  156. package/tsconfig.build.json +9 -0
  157. package/tsconfig.build.tsbuildinfo +1 -0
  158. package/tsconfig.json +12 -0
  159. package/vitest.config.ts +17 -0
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Base Tool Handler
3
+ *
4
+ * Provides common functionality for all tool handlers including
5
+ * error handling, logging, and conversation state management.
6
+ */
7
+ import { createLogger } from '@codemcp/workflows-core';
8
+ import { safeExecute, logHandlerExecution, logHandlerCompletion, } from '../server-helpers.js';
9
+ /**
10
+ * Abstract base class for tool handlers
11
+ * Provides common functionality and enforces consistent patterns
12
+ */
13
+ export class BaseToolHandler {
14
+ logger;
15
+ constructor() {
16
+ this.logger = createLogger(this.constructor.name);
17
+ }
18
+ /**
19
+ * Main handler method - implements consistent error handling and logging
20
+ */
21
+ async handle(args, context) {
22
+ const handlerName = this.constructor.name;
23
+ logHandlerExecution(handlerName, args);
24
+ const result = await safeExecute(() => this.executeHandler(args, context), `${handlerName} execution failed`);
25
+ logHandlerCompletion(handlerName, result);
26
+ return result;
27
+ }
28
+ /**
29
+ * Helper method to get conversation context with proper error handling
30
+ */
31
+ async getConversationContext(context) {
32
+ try {
33
+ return await context.conversationManager.getConversationContext();
34
+ }
35
+ catch (error) {
36
+ this.logger.info('Conversation not found', { error });
37
+ throw new Error('CONVERSATION_NOT_FOUND');
38
+ }
39
+ }
40
+ /**
41
+ * Helper method to ensure state machine is loaded for a project
42
+ */
43
+ ensureStateMachineForProject(context, projectPath, workflowName) {
44
+ const stateMachine = context.transitionEngine.getStateMachine(projectPath, workflowName);
45
+ context.planManager.setStateMachine(stateMachine);
46
+ context.instructionGenerator.setStateMachine(stateMachine);
47
+ }
48
+ /**
49
+ * Helper method to log interactions if logger is available
50
+ */
51
+ async logInteraction(context, conversationId, toolName, args, response, phase) {
52
+ if (context.interactionLogger) {
53
+ await context.interactionLogger.logInteraction(conversationId, toolName, args, response, phase);
54
+ }
55
+ }
56
+ }
57
+ /**
58
+ * Base class for tool handlers that require an existing conversation
59
+ * Automatically handles the conversation-not-found case
60
+ */
61
+ export class ConversationRequiredToolHandler extends BaseToolHandler {
62
+ async executeHandler(args, context) {
63
+ let conversationContext;
64
+ try {
65
+ conversationContext = await this.getConversationContext(context);
66
+ }
67
+ catch (_error) {
68
+ // Return a special error result that the response renderer can handle
69
+ throw new Error('CONVERSATION_NOT_FOUND');
70
+ }
71
+ return this.executeWithConversation(args, context, conversationContext);
72
+ }
73
+ }
74
+ //# sourceMappingURL=base-tool-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-tool-handler.js","sourceRoot":"","sources":["../../src/tool-handlers/base-tool-handler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,MAAM,OAAgB,eAAe;IAGhB,MAAM,CAAkC;IAE3D;QACE,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,IAAW,EACX,OAAsB;QAEtB,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAC1C,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAEvC,MAAM,MAAM,GAAG,MAAM,WAAW,CAC9B,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,EACxC,GAAG,WAAW,mBAAmB,CAClC,CA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C,CAAC;QACnE,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,sEAAsE;YACtE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,IAAI,CAAC,uBAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC;IAC1E,CAAC;CAUF"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * ConductReview Tool Handler
3
+ *
4
+ * Handles review requests before phase transitions. Adapts to MCP environment
5
+ * capabilities - returns automated review results if sampling available,
6
+ * otherwise returns instructions for LLM to conduct guided review.
7
+ */
8
+ import { ConversationRequiredToolHandler } from './base-tool-handler.js';
9
+ import type { ConversationContext } from '@codemcp/workflows-core';
10
+ import { ServerContext } from '../types.js';
11
+ /**
12
+ * Arguments for the conduct_review tool
13
+ */
14
+ export interface ConductReviewArgs {
15
+ target_phase: string;
16
+ }
17
+ /**
18
+ * Response from the conduct_review tool
19
+ */
20
+ export interface ConductReviewResult {
21
+ instructions: string;
22
+ perspectives: Array<{
23
+ name: string;
24
+ prompt: string;
25
+ }>;
26
+ }
27
+ /**
28
+ * ConductReview tool handler implementation
29
+ */
30
+ export declare class ConductReviewHandler extends ConversationRequiredToolHandler<ConductReviewArgs, ConductReviewResult> {
31
+ protected executeWithConversation(args: ConductReviewArgs, context: ServerContext, conversationContext: ConversationContext): Promise<ConductReviewResult>;
32
+ /**
33
+ * Get transition configuration from workflow
34
+ */
35
+ private getTransitionConfig;
36
+ /**
37
+ * Check if MCP environment supports sampling capabilities
38
+ */
39
+ private checkSamplingCapability;
40
+ /**
41
+ * Conduct automated review using LLM tools (when sampling is available)
42
+ */
43
+ private conductAutomatedReview;
44
+ /**
45
+ * Generate instructions for LLM to conduct guided review
46
+ */
47
+ private generateReviewInstructions;
48
+ }
49
+ //# sourceMappingURL=conduct-review.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conduct-review.d.ts","sourceRoot":"","sources":["../../src/tool-handlers/conduct-review.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAEzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,KAAK,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,+BAA+B,CACvE,iBAAiB,EACjB,mBAAmB,CACpB;cACiB,uBAAuB,CACrC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,aAAa,EACtB,mBAAmB,EAAE,mBAAmB,GACvC,OAAO,CAAC,mBAAmB,CAAC;IAqD/B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA4B3B;;OAEG;YACW,uBAAuB;IAQrC;;OAEG;YACW,sBAAsB;IAapC;;OAEG;YACW,0BAA0B;CAiCzC"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * ConductReview Tool Handler
3
+ *
4
+ * Handles review requests before phase transitions. Adapts to MCP environment
5
+ * capabilities - returns automated review results if sampling available,
6
+ * otherwise returns instructions for LLM to conduct guided review.
7
+ */
8
+ import { ConversationRequiredToolHandler } from './base-tool-handler.js';
9
+ import { validateRequiredArgs } from '../server-helpers.js';
10
+ /**
11
+ * ConductReview tool handler implementation
12
+ */
13
+ export class ConductReviewHandler extends ConversationRequiredToolHandler {
14
+ async executeWithConversation(args, context, conversationContext) {
15
+ // Validate required arguments
16
+ validateRequiredArgs(args, ['target_phase']);
17
+ const { target_phase } = args;
18
+ const currentPhase = conversationContext.currentPhase;
19
+ const conversationId = conversationContext.conversationId;
20
+ this.logger.debug('Processing conduct_review request', {
21
+ conversationId,
22
+ currentPhase,
23
+ targetPhase: target_phase,
24
+ });
25
+ // Ensure state machine is loaded for this project
26
+ this.ensureStateMachineForProject(context, conversationContext.projectPath);
27
+ // Get transition configuration from workflow
28
+ const transition = this.getTransitionConfig(currentPhase, target_phase, conversationContext.workflowName, context);
29
+ if (!transition.review_perspectives ||
30
+ transition.review_perspectives.length === 0) {
31
+ throw new Error(`No review perspectives defined for transition from ${currentPhase} to ${target_phase}`);
32
+ }
33
+ // Check if MCP environment supports sampling (LLM interaction tools)
34
+ const hasSamplingCapability = await this.checkSamplingCapability(context);
35
+ if (hasSamplingCapability) {
36
+ // Conduct automated review using available LLM tools
37
+ return await this.conductAutomatedReview(transition.review_perspectives, conversationContext);
38
+ }
39
+ else {
40
+ // Generate instructions for LLM to conduct review
41
+ return await this.generateReviewInstructions(transition.review_perspectives, currentPhase, target_phase);
42
+ }
43
+ }
44
+ /**
45
+ * Get transition configuration from workflow
46
+ */
47
+ getTransitionConfig(currentPhase, targetPhase, workflowName, context) {
48
+ const stateMachine = context.workflowManager.loadWorkflowForProject(context.projectPath, workflowName);
49
+ const currentState = stateMachine.states[currentPhase];
50
+ if (!currentState) {
51
+ throw new Error(`Invalid current phase: ${currentPhase}`);
52
+ }
53
+ const transition = currentState.transitions.find((t) => t.to === targetPhase);
54
+ if (!transition) {
55
+ throw new Error(`No transition found from ${currentPhase} to ${targetPhase}`);
56
+ }
57
+ return transition;
58
+ }
59
+ /**
60
+ * Check if MCP environment supports sampling capabilities
61
+ */
62
+ async checkSamplingCapability(_context) {
63
+ // For now, assume non-sampling (most common case)
64
+ // In the future, this could check for specific LLM interaction tools
65
+ return false;
66
+ }
67
+ /**
68
+ * Conduct automated review using LLM tools (when sampling is available)
69
+ */
70
+ async conductAutomatedReview(perspectives, conversationContext) {
71
+ // TODO: Implement automated review when sampling tools are available
72
+ // For now, fall back to guided instructions
73
+ return this.generateReviewInstructions(perspectives, conversationContext.currentPhase, 'target');
74
+ }
75
+ /**
76
+ * Generate instructions for LLM to conduct guided review
77
+ */
78
+ async generateReviewInstructions(perspectives, currentPhase, targetPhase) {
79
+ const instructions = `Conduct a review of the ${currentPhase} phase before proceeding to ${targetPhase}.
80
+
81
+ First, identify the artifacts and decisions from the ${currentPhase} phase by:
82
+ 1. Reviewing the plan file to see completed tasks and key decisions
83
+ 2. Using git status/diff to see what files were changed (if in a git repository)
84
+ 3. Analyzing recent conversation history for important decisions
85
+
86
+ Then, for each perspective below, analyze these artifacts and provide feedback:
87
+
88
+ ${perspectives
89
+ .map((p, i) => `**${i + 1}. ${p.perspective.toUpperCase()} PERSPECTIVE:**
90
+ ${p.prompt}
91
+
92
+ `)
93
+ .join('')}
94
+
95
+ After completing all perspective reviews, summarize your findings and ask the user if they're ready to proceed to the ${targetPhase} phase.`;
96
+ return {
97
+ instructions,
98
+ perspectives: perspectives.map(p => ({
99
+ name: p.perspective,
100
+ prompt: p.prompt,
101
+ })),
102
+ };
103
+ }
104
+ }
105
+ //# sourceMappingURL=conduct-review.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conduct-review.js","sourceRoot":"","sources":["../../src/tool-handlers/conduct-review.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAuB5D;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,+BAGzC;IACW,KAAK,CAAC,uBAAuB,CACrC,IAAuB,EACvB,OAAsB,EACtB,mBAAwC;QAExC,8BAA8B;QAC9B,oBAAoB,CAAC,IAAI,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QAE7C,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;QAC9B,MAAM,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC;QACtD,MAAM,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,MAAM,EAAE,CAAC,CAAC,MAAM;aACjB,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Get Tool Info Handler
3
+ *
4
+ * Provides comprehensive information about the responsible-vibe-mcp development
5
+ * workflow tools for better tool discoverability and AI integration.
6
+ */
7
+ import { z } from 'zod';
8
+ import { BaseToolHandler } from './base-tool-handler.js';
9
+ import { ServerContext } from '../types.js';
10
+ /**
11
+ * Schema for get_tool_info tool arguments
12
+ */
13
+ declare const GetToolInfoArgsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
14
+ type GetToolInfoArgs = z.infer<typeof GetToolInfoArgsSchema>;
15
+ /**
16
+ * Tool information structure
17
+ */
18
+ interface ToolInfo {
19
+ name: string;
20
+ description: string;
21
+ parameters: string[];
22
+ schema?: {
23
+ required: string[];
24
+ optional: string[];
25
+ };
26
+ }
27
+ /**
28
+ * Workflow information structure
29
+ */
30
+ interface WorkflowInfo {
31
+ name: string;
32
+ displayName: string;
33
+ description: string;
34
+ phases?: string[];
35
+ }
36
+ /**
37
+ * Complete tool information response
38
+ */
39
+ interface GetToolInfoResponse {
40
+ tool_name: string;
41
+ version: string;
42
+ purpose: string;
43
+ description: string;
44
+ available_tools: ToolInfo[];
45
+ available_workflows: WorkflowInfo[];
46
+ core_concepts: {
47
+ phase_management: string;
48
+ plan_file_tracking: string;
49
+ conversation_context: string;
50
+ workflow_guidance: string;
51
+ };
52
+ usage_guidelines: {
53
+ required_pattern: string;
54
+ phase_transitions: string;
55
+ context_requirements: string;
56
+ plan_file_management: string;
57
+ };
58
+ workflow_states?: {
59
+ current_phase?: string;
60
+ conversation_id?: string;
61
+ plan_file_path?: string;
62
+ };
63
+ }
64
+ /**
65
+ * Tool handler for providing comprehensive tool information
66
+ */
67
+ export declare class GetToolInfoHandler extends BaseToolHandler<GetToolInfoArgs, GetToolInfoResponse> {
68
+ protected readonly argsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
69
+ executeHandler(_args: GetToolInfoArgs, context: ServerContext): Promise<GetToolInfoResponse>;
70
+ /**
71
+ * Extract phase names from a workflow configuration
72
+ */
73
+ private extractWorkflowPhases;
74
+ }
75
+ export type { GetToolInfoArgs, GetToolInfoResponse };
76
+ //# sourceMappingURL=get-tool-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-tool-info.d.ts","sourceRoot":"","sources":["../../src/tool-handlers/get-tool-info.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C;;GAEG;AACH,QAAA,MAAM,qBAAqB,gDAEzB,CAAC;AAEH,KAAK,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE7D;;GAEG;AACH,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE;QACP,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH;AAED;;GAEG;AACH,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IAEpB,eAAe,EAAE,QAAQ,EAAE,CAAC;IAC5B,mBAAmB,EAAE,YAAY,EAAE,CAAC;IAEpC,aAAa,EAAE;QACb,gBAAgB,EAAE,MAAM,CAAC;QACzB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,oBAAoB,EAAE,MAAM,CAAC;QAC7B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;IAEF,gBAAgB,EAAE;QAChB,gBAAgB,EAAE,MAAM,CAAC;QACzB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,oBAAoB,EAAE,MAAM,CAAC;QAC7B,oBAAoB,EAAE,MAAM,CAAC;KAC9B,CAAC;IAEF,eAAe,CAAC,EAAE;QAChB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe,CACrD,eAAe,EACf,mBAAmB,CACpB;IACC,SAAS,CAAC,QAAQ,CAAC,UAAU,iDAAyB;IAEhD,cAAc,CAClB,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,mBAAmB,CAAC;IAoK/B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAY9B;AAGD,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Get Tool Info Handler
3
+ *
4
+ * Provides comprehensive information about the responsible-vibe-mcp development
5
+ * workflow tools for better tool discoverability and AI integration.
6
+ */
7
+ import { z } from 'zod';
8
+ import { BaseToolHandler } from './base-tool-handler.js';
9
+ import { createLogger } from '@codemcp/workflows-core';
10
+ const logger = createLogger('GetToolInfoHandler');
11
+ /**
12
+ * Schema for get_tool_info tool arguments
13
+ */
14
+ const GetToolInfoArgsSchema = z.object({
15
+ // No input parameters needed
16
+ });
17
+ /**
18
+ * Tool handler for providing comprehensive tool information
19
+ */
20
+ export class GetToolInfoHandler extends BaseToolHandler {
21
+ argsSchema = GetToolInfoArgsSchema;
22
+ async executeHandler(_args, context) {
23
+ logger.info('Generating comprehensive tool information', {
24
+ projectPath: context.projectPath,
25
+ });
26
+ // Get available workflows
27
+ const availableWorkflows = context.workflowManager.getAvailableWorkflowsForProject(context.projectPath);
28
+ // Transform workflows to response format
29
+ const workflows = availableWorkflows.map(workflow => ({
30
+ name: workflow.name,
31
+ displayName: workflow.displayName,
32
+ description: workflow.description,
33
+ phases: this.extractWorkflowPhases(workflow),
34
+ }));
35
+ // Define available tools with their information
36
+ const tools = [
37
+ {
38
+ name: 'start_development',
39
+ description: 'Initialize new development project with structured workflow',
40
+ parameters: ['workflow', 'commit_behaviour'],
41
+ schema: {
42
+ required: ['commit_behaviour'],
43
+ optional: ['workflow'],
44
+ },
45
+ },
46
+ {
47
+ name: 'whats_next',
48
+ description: 'Get phase-specific instructions and guidance for current development state',
49
+ parameters: [
50
+ 'context',
51
+ 'user_input',
52
+ 'conversation_summary',
53
+ 'recent_messages',
54
+ ],
55
+ schema: {
56
+ required: ['context', 'user_input'],
57
+ optional: ['conversation_summary', 'recent_messages'],
58
+ },
59
+ },
60
+ {
61
+ name: 'proceed_to_phase',
62
+ description: 'Transition to the next development phase when current phase is complete',
63
+ parameters: ['target_phase', 'reason'],
64
+ schema: {
65
+ required: ['target_phase'],
66
+ optional: ['reason'],
67
+ },
68
+ },
69
+ {
70
+ name: 'resume_workflow',
71
+ description: 'Continue development after a break or conversation restart',
72
+ parameters: ['include_system_prompt'],
73
+ schema: {
74
+ required: [],
75
+ optional: ['include_system_prompt'],
76
+ },
77
+ },
78
+ {
79
+ name: 'reset_development',
80
+ description: 'Start over with a clean slate by deleting all development progress',
81
+ parameters: ['confirm', 'reason'],
82
+ schema: {
83
+ required: ['confirm'],
84
+ optional: ['reason'],
85
+ },
86
+ },
87
+ {
88
+ name: 'list_workflows',
89
+ description: 'Get an overview of all available workflows with descriptions',
90
+ parameters: [],
91
+ schema: {
92
+ required: [],
93
+ optional: [],
94
+ },
95
+ },
96
+ {
97
+ name: 'get_tool_info',
98
+ description: 'Get comprehensive information about all available tools and workflows',
99
+ parameters: [],
100
+ schema: {
101
+ required: [],
102
+ optional: [],
103
+ },
104
+ },
105
+ ];
106
+ // Try to get current workflow state if available
107
+ let workflowState = undefined;
108
+ try {
109
+ const conversationContext = await context.conversationManager.getConversationContext();
110
+ workflowState = {
111
+ current_phase: conversationContext.currentPhase,
112
+ conversation_id: conversationContext.conversationId,
113
+ plan_file_path: conversationContext.planFilePath,
114
+ };
115
+ }
116
+ catch (error) {
117
+ // No active conversation - this is fine
118
+ logger.debug('No active conversation found for workflow state', {
119
+ error,
120
+ });
121
+ }
122
+ // Build the complete response
123
+ const response = {
124
+ tool_name: 'Responsible Vibe MCP - Development Workflow Management',
125
+ version: '3.1.6-monorepo', // This should ideally come from package.json
126
+ purpose: 'Structured development workflows with guided phase transitions and conversation state management',
127
+ description: 'A Model Context Protocol server that acts as an intelligent conversation state manager and development guide for LLMs, providing structured workflows for various development tasks including bug fixes, features, architecture documentation, and more.',
128
+ available_tools: tools,
129
+ available_workflows: workflows,
130
+ core_concepts: {
131
+ phase_management: 'Structured progression through development phases with entrance criteria and transition conditions',
132
+ plan_file_tracking: 'Maintains development state and progress in .vibe/development-plan-*.md files with task tracking',
133
+ conversation_context: 'Stateless operation requiring context in each whats_next() call for proper guidance',
134
+ workflow_guidance: 'Provides phase-specific instructions and recommendations based on current development state',
135
+ },
136
+ usage_guidelines: {
137
+ required_pattern: 'Always call whats_next() after user interactions to get context-appropriate guidance',
138
+ phase_transitions: 'Only proceed to next phase when entrance criteria are met and current phase tasks are complete',
139
+ context_requirements: 'Provide conversation history and context in whats_next() calls for optimal guidance',
140
+ plan_file_management: 'Update plan file with completed tasks [x] and add new tasks as they are identified',
141
+ },
142
+ };
143
+ // Add workflow state if available
144
+ if (workflowState) {
145
+ response.workflow_states = workflowState;
146
+ }
147
+ logger.info('Successfully generated tool information', {
148
+ toolCount: tools.length,
149
+ workflowCount: workflows.length,
150
+ hasWorkflowState: !!workflowState,
151
+ });
152
+ return response;
153
+ }
154
+ /**
155
+ * Extract phase names from a workflow configuration
156
+ */
157
+ extractWorkflowPhases(workflowInfo) {
158
+ if (workflowInfo &&
159
+ typeof workflowInfo === 'object' &&
160
+ 'states' in workflowInfo &&
161
+ workflowInfo.states &&
162
+ typeof workflowInfo.states === 'object') {
163
+ return Object.keys(workflowInfo.states);
164
+ }
165
+ return undefined;
166
+ }
167
+ }
168
+ //# sourceMappingURL=get-tool-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-tool-info.js","sourceRoot":"","sources":["../../src/tool-handlers/get-tool-info.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,MAAM,MAAM,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAC;AAElD;;GAEG;AACH,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;AACrC,6BAA6B;CAC9B,CAAC,CAAC;AA4DH;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAGvC;IACoB,UAAU,GAAG,qBAAqB,CAAC;IAEtD,KAAK,CAAC,cAAc,CAClB,KAAsB,EACtB,OAAsB;QAEtB,MAAM,CAAC,IAAI,CAAC,2CAA2C,EAAE;YACvD,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC,CAAC;QAEH,0BAA0B;QAC1B,MAAM,kBAAkB,GACtB,OAAO,CAAC,eAAe,CAAC,+BAA+B,CACrD,OAAO,CAAC,WAAW,CACpB,CAAC;QAEJ,yCAAyC;QACzC,MAAM,SAAS,GAAmB,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YACpE,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,WA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;gBAChB,gBAAgB,EACd,sFAAsF;gBACxF,iBAAiB,EACf,gGAAgG;gBAClG,oBAAoB,EAClB,qFAAqF;gBACvF,oBAAoB,EAClB,oFAAoF;aACvF;SACF,CAAC;QAEF,kCAAkC;QAClC,IAAI,aAAa,EAAE,CAAC;YAClB,QAAQ,CAAC,eAAe,GAAG,aAAa,CAAC;QAC3C,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,yCAAyC,EAAE;YACrD,SAAS,EAAE,KAAK,CAAC,MAAM;YACvB,aAAa,EAAE,SAAS,CAAC,MAAM;YAC/B,gBAAgB,EAAE,CAAC,CAAC,aAAa;SAClC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,YAAqB;QACjD,IACE,YAAY;YACZ,OAAO,YAAY,KAAK,QAAQ;YAChC,QAAQ,IAAI,YAAY;YACxB,YAAY,CAAC,MAAM;YACnB,OAAO,YAAY,CAAC,MAAM,KAAK,QAAQ,EACvC,CAAC;YACD,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Tool Handler Registry
3
+ *
4
+ * Central registry for all tool handlers. Provides registration and lookup
5
+ * functionality for tool handlers used by the MCP server.
6
+ */
7
+ import { ToolHandler, ToolRegistry } from '../types.js';
8
+ /**
9
+ * Default implementation of ToolRegistry
10
+ */
11
+ export declare class DefaultToolRegistry implements ToolRegistry {
12
+ private handlers;
13
+ register<T extends ToolHandler>(name: string, handler: T): void;
14
+ get(name: string): ToolHandler | undefined;
15
+ list(): string[];
16
+ }
17
+ /**
18
+ * Create and configure the default tool registry with all standard handlers
19
+ */
20
+ export declare function createToolRegistry(): ToolRegistry;
21
+ export { WhatsNextHandler } from './whats-next.js';
22
+ export { ProceedToPhaseHandler } from './proceed-to-phase.js';
23
+ export { ConductReviewHandler } from './conduct-review.js';
24
+ export { StartDevelopmentHandler } from './start-development.js';
25
+ export { ResumeWorkflowHandler } from './resume-workflow.js';
26
+ export { ResetDevelopmentHandler } from './reset-development.js';
27
+ export { InstallWorkflowHandler } from './install-workflow.js';
28
+ export { ListWorkflowsHandler } from './list-workflows.js';
29
+ export { GetToolInfoHandler } from './get-tool-info.js';
30
+ export { SetupProjectDocsHandler } from './setup-project-docs.js';
31
+ export { NoIdeaHandler } from './no-idea.js';
32
+ export { BaseToolHandler, ConversationRequiredToolHandler, } from './base-tool-handler.js';
33
+ export type { WhatsNextArgs, WhatsNextResult } from './whats-next.js';
34
+ export type { ProceedToPhaseArgs, ProceedToPhaseResult, } from './proceed-to-phase.js';
35
+ export type { ConductReviewArgs, ConductReviewResult, } from './conduct-review.js';
36
+ export type { StartDevelopmentArgs, StartDevelopmentResult, } from './start-development.js';
37
+ export type { ResumeWorkflowArgs, ResumeWorkflowResult, } from './resume-workflow.js';
38
+ export type { ResetDevelopmentArgs, ResetDevelopmentResult, } from './reset-development.js';
39
+ export type { GetToolInfoArgs, GetToolInfoResponse } from './get-tool-info.js';
40
+ export type { SetupProjectDocsArgs, SetupProjectDocsResult, } from './setup-project-docs.js';
41
+ export type { NoIdeaArgs, NoIdeaResponse } from './no-idea.js';
42
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-handlers/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIxD;;GAEG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IACtD,OAAO,CAAC,QAAQ,CAAkC;IAElD,QAAQ,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI;IAQ/D,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW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V,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Tool Handler Registry
3
+ *
4
+ * Central registry for all tool handlers. Provides registration and lookup
5
+ * functionality for tool handlers used by the MCP server.
6
+ */
7
+ import { createLogger } from '@codemcp/workflows-core';
8
+ import { WhatsNextHandler } from './whats-next.js';
9
+ import { ProceedToPhaseHandler } from './proceed-to-phase.js';
10
+ import { ConductReviewHandler } from './conduct-review.js';
11
+ import { StartDevelopmentHandler } from './start-development.js';
12
+ import { ResumeWorkflowHandler } from './resume-workflow.js';
13
+ import { ResetDevelopmentHandler } from './reset-development.js';
14
+ import { InstallWorkflowHandler } from './install-workflow.js';
15
+ import { ListWorkflowsHandler } from './list-workflows.js';
16
+ import { GetToolInfoHandler } from './get-tool-info.js';
17
+ import { SetupProjectDocsHandler } from './setup-project-docs.js';
18
+ import { NoIdeaHandler } from './no-idea.js';
19
+ const logger = createLogger('ToolRegistry');
20
+ /**
21
+ * Default implementation of ToolRegistry
22
+ */
23
+ export class DefaultToolRegistry {
24
+ handlers = new Map();
25
+ register(name, handler) {
26
+ logger.debug('Registering tool handler', {
27
+ name,
28
+ handlerType: handler.constructor.name,
29
+ });
30
+ this.handlers.set(name, handler);
31
+ }
32
+ get(name) {
33
+ return this.handlers.get(name);
34
+ }
35
+ list() {
36
+ return Array.from(this.handlers.keys());
37
+ }
38
+ }
39
+ /**
40
+ * Create and configure the default tool registry with all standard handlers
41
+ */
42
+ export function createToolRegistry() {
43
+ const registry = new DefaultToolRegistry();
44
+ // Register all standard tool handlers
45
+ registry.register('whats_next', new WhatsNextHandler());
46
+ registry.register('proceed_to_phase', new ProceedToPhaseHandler());
47
+ registry.register('conduct_review', new ConductReviewHandler());
48
+ registry.register('start_development', new StartDevelopmentHandler());
49
+ registry.register('resume_workflow', new ResumeWorkflowHandler());
50
+ registry.register('reset_development', new ResetDevelopmentHandler());
51
+ registry.register('install_workflow', new InstallWorkflowHandler());
52
+ registry.register('list_workflows', new ListWorkflowsHandler());
53
+ registry.register('get_tool_info', new GetToolInfoHandler());
54
+ registry.register('setup_project_docs', new SetupProjectDocsHandler());
55
+ registry.register('no_idea', new NoIdeaHandler());
56
+ logger.info('Tool registry created with handlers', {
57
+ handlers: registry.list(),
58
+ });
59
+ return registry;
60
+ }
61
+ // Export all handler types for external use
62
+ export { WhatsNextHandler } from './whats-next.js';
63
+ export { ProceedToPhaseHandler } from './proceed-to-phase.js';
64
+ export { ConductReviewHandler } from './conduct-review.js';
65
+ export { StartDevelopmentHandler } from './start-development.js';
66
+ export { ResumeWorkflowHandler } from './resume-workflow.js';
67
+ export { ResetDevelopmentHandler } from './reset-development.js';
68
+ export { InstallWorkflowHandler } from './install-workflow.js';
69
+ export { ListWorkflowsHandler } from './list-workflows.js';
70
+ export { GetToolInfoHandler } from './get-tool-info.js';
71
+ export { SetupProjectDocsHandler } from './setup-project-docs.js';
72
+ export { NoIdeaHandler } from './no-idea.js';
73
+ export { BaseToolHandler, ConversationRequiredToolHandler, } from './base-tool-handler.js';
74
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tool-handlers/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE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