@codebakers/cli 3.7.1 → 3.7.2
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/dist/mcp/server.js +19 -125
- package/package.json +1 -1
- package/src/mcp/server.ts +19 -130
package/dist/mcp/server.js
CHANGED
|
@@ -1075,13 +1075,13 @@ class CodeBakersServer {
|
|
|
1075
1075
|
},
|
|
1076
1076
|
{
|
|
1077
1077
|
name: 'detect_intent',
|
|
1078
|
-
description: '
|
|
1078
|
+
description: 'Lists all available CodeBakers MCP tools. Only use this when user explicitly asks "what tools are available" or "help". Do NOT use for normal requests - just call the appropriate tool directly.',
|
|
1079
1079
|
inputSchema: {
|
|
1080
1080
|
type: 'object',
|
|
1081
1081
|
properties: {
|
|
1082
1082
|
userMessage: {
|
|
1083
1083
|
type: 'string',
|
|
1084
|
-
description: 'The user\'s message
|
|
1084
|
+
description: 'The user\'s message (for context only)',
|
|
1085
1085
|
},
|
|
1086
1086
|
},
|
|
1087
1087
|
required: ['userMessage'],
|
|
@@ -5934,130 +5934,24 @@ You cannot write code without calling this tool first.
|
|
|
5934
5934
|
*/
|
|
5935
5935
|
handleDetectIntent(args) {
|
|
5936
5936
|
const { userMessage } = args;
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
const intentPatterns = [
|
|
5940
|
-
{
|
|
5941
|
-
keywords: ['upgrade codebakers', 'update patterns', 'sync patterns', 'download patterns', 'get latest patterns'],
|
|
5942
|
-
tool: 'update_patterns',
|
|
5943
|
-
description: 'Download latest CLAUDE.md and all .claude/ modules from the CodeBakers server',
|
|
5944
|
-
action: 'WRITE - Will overwrite local pattern files with server versions',
|
|
5945
|
-
isDestructive: true,
|
|
5946
|
-
},
|
|
5947
|
-
{
|
|
5948
|
-
keywords: ['upgrade', 'improve code', 'make production ready', 'code quality'],
|
|
5949
|
-
tool: 'upgrade',
|
|
5950
|
-
description: 'Analyze your code for quality improvements (does NOT download patterns)',
|
|
5951
|
-
action: 'READ-ONLY - Analyzes code and suggests improvements',
|
|
5952
|
-
isDestructive: false,
|
|
5953
|
-
},
|
|
5954
|
-
{
|
|
5955
|
-
keywords: ['build', 'create project', 'new project', 'scaffold', 'start fresh'],
|
|
5956
|
-
tool: 'scaffold_project',
|
|
5957
|
-
description: 'Create a new project from scratch with CodeBakers patterns',
|
|
5958
|
-
action: 'WRITE - Will create new files and folders',
|
|
5959
|
-
isDestructive: true,
|
|
5960
|
-
},
|
|
5961
|
-
{
|
|
5962
|
-
keywords: ['add feature', 'implement', 'build feature', 'create feature'],
|
|
5963
|
-
tool: 'optimize_and_build',
|
|
5964
|
-
description: 'Optimize your feature request with AI and fetch relevant patterns',
|
|
5965
|
-
action: 'READ + ASSIST - Fetches patterns and guides implementation',
|
|
5966
|
-
isDestructive: false,
|
|
5967
|
-
},
|
|
5968
|
-
{
|
|
5969
|
-
keywords: ['audit', 'review code', 'check code', 'code review'],
|
|
5970
|
-
tool: 'run_audit',
|
|
5971
|
-
description: 'Run comprehensive code quality audit',
|
|
5972
|
-
action: 'READ-ONLY - Analyzes code and reports issues',
|
|
5973
|
-
isDestructive: false,
|
|
5974
|
-
},
|
|
5975
|
-
{
|
|
5976
|
-
keywords: ['heal', 'fix errors', 'auto-fix', 'fix bugs'],
|
|
5977
|
-
tool: 'heal',
|
|
5978
|
-
description: 'AI-powered error detection and automatic fixing',
|
|
5979
|
-
action: 'WRITE - May modify files to fix errors',
|
|
5980
|
-
isDestructive: true,
|
|
5981
|
-
},
|
|
5982
|
-
{
|
|
5983
|
-
keywords: ['design', 'clone design', 'copy design', 'match design'],
|
|
5984
|
-
tool: 'design',
|
|
5985
|
-
description: 'Clone a design from mockups, screenshots, or websites',
|
|
5986
|
-
action: 'WRITE - Will generate component files',
|
|
5987
|
-
isDestructive: true,
|
|
5988
|
-
},
|
|
5989
|
-
{
|
|
5990
|
-
keywords: ['status', 'progress', "what's built", 'where am i'],
|
|
5991
|
-
tool: 'project_status',
|
|
5992
|
-
description: 'Show current project build progress and stats',
|
|
5993
|
-
action: 'READ-ONLY - Shows project state',
|
|
5994
|
-
isDestructive: false,
|
|
5995
|
-
},
|
|
5996
|
-
{
|
|
5997
|
-
keywords: ['run tests', 'test', 'check tests'],
|
|
5998
|
-
tool: 'run_tests',
|
|
5999
|
-
description: 'Execute the project test suite',
|
|
6000
|
-
action: 'READ-ONLY - Runs tests and reports results',
|
|
6001
|
-
isDestructive: false,
|
|
6002
|
-
},
|
|
6003
|
-
{
|
|
6004
|
-
keywords: ['list patterns', 'show patterns', 'what patterns'],
|
|
6005
|
-
tool: 'list_patterns',
|
|
6006
|
-
description: 'List all available CodeBakers patterns',
|
|
6007
|
-
action: 'READ-ONLY - Shows available patterns',
|
|
6008
|
-
isDestructive: false,
|
|
6009
|
-
},
|
|
6010
|
-
{
|
|
6011
|
-
keywords: ['init', 'initialize', 'add patterns to existing'],
|
|
6012
|
-
tool: 'init_project',
|
|
6013
|
-
description: 'Add CodeBakers patterns to an existing project',
|
|
6014
|
-
action: 'WRITE - Will add CLAUDE.md and .claude/ folder',
|
|
6015
|
-
isDestructive: true,
|
|
6016
|
-
},
|
|
6017
|
-
];
|
|
6018
|
-
// Find matching intents
|
|
6019
|
-
const matches = intentPatterns.filter(pattern => pattern.keywords.some(keyword => msg.includes(keyword)));
|
|
6020
|
-
let response = `# 🔍 Intent Detection\n\n`;
|
|
5937
|
+
// Simple tool list - no keyword guessing. Let the AI figure it out from context.
|
|
5938
|
+
let response = `# Available CodeBakers MCP Tools\n\n`;
|
|
6021
5939
|
response += `**Your message:** "${userMessage}"\n\n`;
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
response += `| **Description** | ${match.description} |\n`;
|
|
6038
|
-
response += `| **Action Type** | ${match.action} |\n`;
|
|
6039
|
-
response += `| **Destructive?** | ${match.isDestructive ? '⚠️ YES - modifies files' : '✅ NO - read-only'} |\n\n`;
|
|
6040
|
-
if (match.isDestructive) {
|
|
6041
|
-
response += `### ⚠️ Confirmation Required\n\n`;
|
|
6042
|
-
response += `This action will modify files. Do you want to proceed?\n\n`;
|
|
6043
|
-
response += `**Reply "yes" or "proceed" to execute, or describe what you actually want.**\n`;
|
|
6044
|
-
}
|
|
6045
|
-
else {
|
|
6046
|
-
response += `This is a read-only operation. Safe to proceed.\n\n`;
|
|
6047
|
-
response += `**Reply "yes" to execute, or clarify your request.**\n`;
|
|
6048
|
-
}
|
|
6049
|
-
}
|
|
6050
|
-
else {
|
|
6051
|
-
response += `## Multiple Possible Intents\n\n`;
|
|
6052
|
-
response += `Your request could match several tools:\n\n`;
|
|
6053
|
-
matches.forEach((match, i) => {
|
|
6054
|
-
response += `### Option ${i + 1}: \`${match.tool}\`\n`;
|
|
6055
|
-
response += `- **What it does:** ${match.description}\n`;
|
|
6056
|
-
response += `- **Action:** ${match.action}\n`;
|
|
6057
|
-
response += `- **Destructive:** ${match.isDestructive ? '⚠️ Yes' : '✅ No'}\n\n`;
|
|
6058
|
-
});
|
|
6059
|
-
response += `**Which option do you want?** Reply with the tool name or option number.\n`;
|
|
6060
|
-
}
|
|
5940
|
+
response += `## Tools\n\n`;
|
|
5941
|
+
response += `| Tool | Description |\n`;
|
|
5942
|
+
response += `|------|-------------|\n`;
|
|
5943
|
+
response += `| \`update_patterns\` | Download latest CLAUDE.md from server |\n`;
|
|
5944
|
+
response += `| \`discover_patterns\` | Find patterns for a feature request |\n`;
|
|
5945
|
+
response += `| \`optimize_and_build\` | AI-optimize a feature request |\n`;
|
|
5946
|
+
response += `| \`run_audit\` | Code quality audit |\n`;
|
|
5947
|
+
response += `| \`heal\` | Auto-fix errors |\n`;
|
|
5948
|
+
response += `| \`project_status\` | Show build progress |\n`;
|
|
5949
|
+
response += `| \`run_tests\` | Run test suite |\n`;
|
|
5950
|
+
response += `| \`scaffold_project\` | Create new project |\n`;
|
|
5951
|
+
response += `| \`init_project\` | Add patterns to existing project |\n`;
|
|
5952
|
+
response += `| \`list_patterns\` | List all available patterns |\n`;
|
|
5953
|
+
response += `| \`billing_action\` | Manage subscription |\n\n`;
|
|
5954
|
+
response += `**Pick the tool that matches what you want to do.**\n`;
|
|
6061
5955
|
return {
|
|
6062
5956
|
content: [{
|
|
6063
5957
|
type: 'text',
|
package/package.json
CHANGED
package/src/mcp/server.ts
CHANGED
|
@@ -1172,13 +1172,13 @@ class CodeBakersServer {
|
|
|
1172
1172
|
{
|
|
1173
1173
|
name: 'detect_intent',
|
|
1174
1174
|
description:
|
|
1175
|
-
'
|
|
1175
|
+
'Lists all available CodeBakers MCP tools. Only use this when user explicitly asks "what tools are available" or "help". Do NOT use for normal requests - just call the appropriate tool directly.',
|
|
1176
1176
|
inputSchema: {
|
|
1177
1177
|
type: 'object' as const,
|
|
1178
1178
|
properties: {
|
|
1179
1179
|
userMessage: {
|
|
1180
1180
|
type: 'string',
|
|
1181
|
-
description: 'The user\'s message
|
|
1181
|
+
description: 'The user\'s message (for context only)',
|
|
1182
1182
|
},
|
|
1183
1183
|
},
|
|
1184
1184
|
required: ['userMessage'],
|
|
@@ -6673,136 +6673,25 @@ You cannot write code without calling this tool first.
|
|
|
6673
6673
|
*/
|
|
6674
6674
|
private handleDetectIntent(args: { userMessage: string }) {
|
|
6675
6675
|
const { userMessage } = args;
|
|
6676
|
-
const msg = userMessage.toLowerCase();
|
|
6677
6676
|
|
|
6678
|
-
//
|
|
6679
|
-
|
|
6680
|
-
{
|
|
6681
|
-
keywords: ['upgrade codebakers', 'update patterns', 'sync patterns', 'download patterns', 'get latest patterns'],
|
|
6682
|
-
tool: 'update_patterns',
|
|
6683
|
-
description: 'Download latest CLAUDE.md and all .claude/ modules from the CodeBakers server',
|
|
6684
|
-
action: 'WRITE - Will overwrite local pattern files with server versions',
|
|
6685
|
-
isDestructive: true,
|
|
6686
|
-
},
|
|
6687
|
-
{
|
|
6688
|
-
keywords: ['upgrade', 'improve code', 'make production ready', 'code quality'],
|
|
6689
|
-
tool: 'upgrade',
|
|
6690
|
-
description: 'Analyze your code for quality improvements (does NOT download patterns)',
|
|
6691
|
-
action: 'READ-ONLY - Analyzes code and suggests improvements',
|
|
6692
|
-
isDestructive: false,
|
|
6693
|
-
},
|
|
6694
|
-
{
|
|
6695
|
-
keywords: ['build', 'create project', 'new project', 'scaffold', 'start fresh'],
|
|
6696
|
-
tool: 'scaffold_project',
|
|
6697
|
-
description: 'Create a new project from scratch with CodeBakers patterns',
|
|
6698
|
-
action: 'WRITE - Will create new files and folders',
|
|
6699
|
-
isDestructive: true,
|
|
6700
|
-
},
|
|
6701
|
-
{
|
|
6702
|
-
keywords: ['add feature', 'implement', 'build feature', 'create feature'],
|
|
6703
|
-
tool: 'optimize_and_build',
|
|
6704
|
-
description: 'Optimize your feature request with AI and fetch relevant patterns',
|
|
6705
|
-
action: 'READ + ASSIST - Fetches patterns and guides implementation',
|
|
6706
|
-
isDestructive: false,
|
|
6707
|
-
},
|
|
6708
|
-
{
|
|
6709
|
-
keywords: ['audit', 'review code', 'check code', 'code review'],
|
|
6710
|
-
tool: 'run_audit',
|
|
6711
|
-
description: 'Run comprehensive code quality audit',
|
|
6712
|
-
action: 'READ-ONLY - Analyzes code and reports issues',
|
|
6713
|
-
isDestructive: false,
|
|
6714
|
-
},
|
|
6715
|
-
{
|
|
6716
|
-
keywords: ['heal', 'fix errors', 'auto-fix', 'fix bugs'],
|
|
6717
|
-
tool: 'heal',
|
|
6718
|
-
description: 'AI-powered error detection and automatic fixing',
|
|
6719
|
-
action: 'WRITE - May modify files to fix errors',
|
|
6720
|
-
isDestructive: true,
|
|
6721
|
-
},
|
|
6722
|
-
{
|
|
6723
|
-
keywords: ['design', 'clone design', 'copy design', 'match design'],
|
|
6724
|
-
tool: 'design',
|
|
6725
|
-
description: 'Clone a design from mockups, screenshots, or websites',
|
|
6726
|
-
action: 'WRITE - Will generate component files',
|
|
6727
|
-
isDestructive: true,
|
|
6728
|
-
},
|
|
6729
|
-
{
|
|
6730
|
-
keywords: ['status', 'progress', "what's built", 'where am i'],
|
|
6731
|
-
tool: 'project_status',
|
|
6732
|
-
description: 'Show current project build progress and stats',
|
|
6733
|
-
action: 'READ-ONLY - Shows project state',
|
|
6734
|
-
isDestructive: false,
|
|
6735
|
-
},
|
|
6736
|
-
{
|
|
6737
|
-
keywords: ['run tests', 'test', 'check tests'],
|
|
6738
|
-
tool: 'run_tests',
|
|
6739
|
-
description: 'Execute the project test suite',
|
|
6740
|
-
action: 'READ-ONLY - Runs tests and reports results',
|
|
6741
|
-
isDestructive: false,
|
|
6742
|
-
},
|
|
6743
|
-
{
|
|
6744
|
-
keywords: ['list patterns', 'show patterns', 'what patterns'],
|
|
6745
|
-
tool: 'list_patterns',
|
|
6746
|
-
description: 'List all available CodeBakers patterns',
|
|
6747
|
-
action: 'READ-ONLY - Shows available patterns',
|
|
6748
|
-
isDestructive: false,
|
|
6749
|
-
},
|
|
6750
|
-
{
|
|
6751
|
-
keywords: ['init', 'initialize', 'add patterns to existing'],
|
|
6752
|
-
tool: 'init_project',
|
|
6753
|
-
description: 'Add CodeBakers patterns to an existing project',
|
|
6754
|
-
action: 'WRITE - Will add CLAUDE.md and .claude/ folder',
|
|
6755
|
-
isDestructive: true,
|
|
6756
|
-
},
|
|
6757
|
-
];
|
|
6758
|
-
|
|
6759
|
-
// Find matching intents
|
|
6760
|
-
const matches = intentPatterns.filter(pattern =>
|
|
6761
|
-
pattern.keywords.some(keyword => msg.includes(keyword))
|
|
6762
|
-
);
|
|
6763
|
-
|
|
6764
|
-
let response = `# 🔍 Intent Detection\n\n`;
|
|
6677
|
+
// Simple tool list - no keyword guessing. Let the AI figure it out from context.
|
|
6678
|
+
let response = `# Available CodeBakers MCP Tools\n\n`;
|
|
6765
6679
|
response += `**Your message:** "${userMessage}"\n\n`;
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
response += `| **Description** | ${match.description} |\n`;
|
|
6782
|
-
response += `| **Action Type** | ${match.action} |\n`;
|
|
6783
|
-
response += `| **Destructive?** | ${match.isDestructive ? '⚠️ YES - modifies files' : '✅ NO - read-only'} |\n\n`;
|
|
6784
|
-
|
|
6785
|
-
if (match.isDestructive) {
|
|
6786
|
-
response += `### ⚠️ Confirmation Required\n\n`;
|
|
6787
|
-
response += `This action will modify files. Do you want to proceed?\n\n`;
|
|
6788
|
-
response += `**Reply "yes" or "proceed" to execute, or describe what you actually want.**\n`;
|
|
6789
|
-
} else {
|
|
6790
|
-
response += `This is a read-only operation. Safe to proceed.\n\n`;
|
|
6791
|
-
response += `**Reply "yes" to execute, or clarify your request.**\n`;
|
|
6792
|
-
}
|
|
6793
|
-
} else {
|
|
6794
|
-
response += `## Multiple Possible Intents\n\n`;
|
|
6795
|
-
response += `Your request could match several tools:\n\n`;
|
|
6796
|
-
|
|
6797
|
-
matches.forEach((match, i) => {
|
|
6798
|
-
response += `### Option ${i + 1}: \`${match.tool}\`\n`;
|
|
6799
|
-
response += `- **What it does:** ${match.description}\n`;
|
|
6800
|
-
response += `- **Action:** ${match.action}\n`;
|
|
6801
|
-
response += `- **Destructive:** ${match.isDestructive ? '⚠️ Yes' : '✅ No'}\n\n`;
|
|
6802
|
-
});
|
|
6803
|
-
|
|
6804
|
-
response += `**Which option do you want?** Reply with the tool name or option number.\n`;
|
|
6805
|
-
}
|
|
6680
|
+
response += `## Tools\n\n`;
|
|
6681
|
+
response += `| Tool | Description |\n`;
|
|
6682
|
+
response += `|------|-------------|\n`;
|
|
6683
|
+
response += `| \`update_patterns\` | Download latest CLAUDE.md from server |\n`;
|
|
6684
|
+
response += `| \`discover_patterns\` | Find patterns for a feature request |\n`;
|
|
6685
|
+
response += `| \`optimize_and_build\` | AI-optimize a feature request |\n`;
|
|
6686
|
+
response += `| \`run_audit\` | Code quality audit |\n`;
|
|
6687
|
+
response += `| \`heal\` | Auto-fix errors |\n`;
|
|
6688
|
+
response += `| \`project_status\` | Show build progress |\n`;
|
|
6689
|
+
response += `| \`run_tests\` | Run test suite |\n`;
|
|
6690
|
+
response += `| \`scaffold_project\` | Create new project |\n`;
|
|
6691
|
+
response += `| \`init_project\` | Add patterns to existing project |\n`;
|
|
6692
|
+
response += `| \`list_patterns\` | List all available patterns |\n`;
|
|
6693
|
+
response += `| \`billing_action\` | Manage subscription |\n\n`;
|
|
6694
|
+
response += `**Pick the tool that matches what you want to do.**\n`;
|
|
6806
6695
|
|
|
6807
6696
|
return {
|
|
6808
6697
|
content: [{
|