claude-flow 2.7.7 → 2.7.8
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 +37 -0
- package/bin/claude-flow +1 -1
- package/dist/src/cli/help-formatter.js +3 -5
- package/dist/src/cli/help-formatter.js.map +1 -1
- package/dist/src/cli/simple-cli.js.map +1 -1
- package/dist/src/cli/simple-commands/mcp.js +0 -8
- package/dist/src/cli/simple-commands/mcp.js.map +1 -1
- package/dist/src/core/version.js +2 -2
- package/dist/src/mcp/mcp-server.js +5 -5
- package/dist/src/mcp/mcp-server.js.map +1 -1
- package/dist/src/memory/swarm-memory.js +421 -340
- package/dist/src/utils/error-handler.js +1 -3
- package/dist/src/utils/error-handler.js.map +1 -1
- package/dist/src/utils/key-redactor.js.map +1 -1
- package/dist/src/utils/metrics-reader.js +10 -0
- package/package.json +1 -1
- package/src/cli/simple-commands/mcp.js +3 -10
- package/src/mcp/mcp-server.js +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,43 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.7.8] - 2025-10-24
|
|
9
|
+
|
|
10
|
+
> **🐛 Critical Bug Fix**: MCP Server Stdio Mode - FULLY FIXED stdout corruption (Issue #835)
|
|
11
|
+
|
|
12
|
+
### Summary
|
|
13
|
+
This release COMPLETELY resolves the MCP stdio mode stdout corruption issue. The server now outputs ONLY clean JSON-RPC messages on stdout, with all diagnostic logs going to stderr as required by the MCP protocol specification.
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug Fixes
|
|
16
|
+
|
|
17
|
+
#### **Complete Stdio Mode Fix** - Issue #835
|
|
18
|
+
- **Fixed remaining stdout pollution sources**:
|
|
19
|
+
1. Removed startup message that appeared before spawning MCP server
|
|
20
|
+
2. Changed `console.log()` to `console.error()` in initialization error handlers
|
|
21
|
+
3. Fixed object output by stringifying JSON in server startup logs
|
|
22
|
+
|
|
23
|
+
- **Files Changed**:
|
|
24
|
+
- `src/cli/simple-commands/mcp.js` - Removed all output before server spawn
|
|
25
|
+
- `src/mcp/mcp-server.js` - Fixed initialization logs and stringified JSON output
|
|
26
|
+
|
|
27
|
+
### ✅ Verification
|
|
28
|
+
- **Local testing**: ✅ stdout contains ONLY JSON-RPC, stderr contains all logs
|
|
29
|
+
- **Clean protocol stream**: ✅ No console messages pollute stdout
|
|
30
|
+
- **Docker test ready**: Ready for clean environment verification
|
|
31
|
+
|
|
32
|
+
### 📝 Technical Details
|
|
33
|
+
```bash
|
|
34
|
+
# Before v2.7.8 - stdout was corrupted:
|
|
35
|
+
$ npx claude-flow@2.7.7 mcp start
|
|
36
|
+
✅ Starting Claude Flow MCP server... # <- ON STDOUT (BAD!)
|
|
37
|
+
{"jsonrpc":"2.0",...}
|
|
38
|
+
|
|
39
|
+
# After v2.7.8 - stdout is clean:
|
|
40
|
+
$ npx claude-flow@2.7.8 mcp start
|
|
41
|
+
{"jsonrpc":"2.0",...} # <- ONLY JSON-RPC (GOOD!)
|
|
42
|
+
# All startup messages go to stderr
|
|
43
|
+
```
|
|
44
|
+
|
|
8
45
|
## [2.7.7] - 2025-10-24
|
|
9
46
|
|
|
10
47
|
> **🐛 Critical Bug Fix**: MCP Server Stdio Mode - Fixed stdout corruption + Updated version banner
|
package/bin/claude-flow
CHANGED
|
@@ -24,6 +24,9 @@ export class HelpFormatter {
|
|
|
24
24
|
if (info.examples && info.examples.length > 0) {
|
|
25
25
|
sections.push(this.formatSection('EXAMPLES', info.examples));
|
|
26
26
|
}
|
|
27
|
+
if (info.details) {
|
|
28
|
+
sections.push('\n' + info.details);
|
|
29
|
+
}
|
|
27
30
|
if (info.commands && info.commands.length > 0) {
|
|
28
31
|
sections.push(`Run '${info.name} <command> --help' for more information on a command.`);
|
|
29
32
|
}
|
|
@@ -85,9 +88,4 @@ export class HelpFormatter {
|
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
|
|
88
|
-
//# sourceMappingURL=help-formatter.js.map/\s+/g, ' ');
|
|
89
|
-
return text;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
91
|
//# sourceMappingURL=help-formatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/help-formatter.
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/help-formatter.js"],"sourcesContent":["/**\n * Standardized CLI Help Formatter\n * Follows Unix/Linux conventions for help output\n */\n\nexport class HelpFormatter {\n static INDENT = ' ';\n static COLUMN_GAP = 2;\n static MIN_DESCRIPTION_COLUMN = 25;\n\n /**\n * Format main command help\n */\n static formatHelp(info) {\n const sections = [];\n\n // NAME section\n sections.push(this.formatSection('NAME', [`${info.name} - ${info.description}`]));\n\n // SYNOPSIS section\n if (info.usage) {\n sections.push(this.formatSection('SYNOPSIS', [info.usage]));\n }\n\n // COMMANDS section\n if (info.commands && info.commands.length > 0) {\n sections.push(this.formatSection('COMMANDS', this.formatCommands(info.commands)));\n }\n\n // OPTIONS section\n if (info.options && info.options.length > 0) {\n sections.push(this.formatSection('OPTIONS', this.formatOptions(info.options)));\n }\n\n // GLOBAL OPTIONS section\n if (info.globalOptions && info.globalOptions.length > 0) {\n sections.push(this.formatSection('GLOBAL OPTIONS', this.formatOptions(info.globalOptions)));\n }\n\n // EXAMPLES section\n if (info.examples && info.examples.length > 0) {\n sections.push(this.formatSection('EXAMPLES', info.examples));\n }\n\n // DETAILS section (additional information)\n if (info.details) {\n sections.push('\\n' + info.details);\n }\n\n // Footer\n if (info.commands && info.commands.length > 0) {\n sections.push(`Run '${info.name} <command> --help' for more information on a command.`);\n }\n\n return sections.join('\\n\\n');\n }\n\n /**\n * Format error message with usage hint\n */\n static formatError(error, command, usage) {\n const lines = [`Error: ${error}`, ''];\n\n if (usage) {\n lines.push(`Usage: ${usage}`);\n }\n\n lines.push(`Try '${command} --help' for more information.`);\n\n return lines.join('\\n');\n }\n\n /**\n * Format validation error with valid options\n */\n static formatValidationError(value, paramName, validOptions, command) {\n return this.formatError(\n `'${value}' is not a valid ${paramName}. Valid options are: ${validOptions.join(', ')}.`,\n command,\n );\n }\n\n static formatSection(title, content) {\n return `${title}\\n${content.map((line) => `${this.INDENT}${line}`).join('\\n')}`;\n }\n\n static formatCommands(commands) {\n const maxNameLength = Math.max(\n this.MIN_DESCRIPTION_COLUMN,\n ...commands.map((cmd) => {\n const nameLength = cmd.name.length;\n const aliasLength = cmd.aliases ? ` (${cmd.aliases.join(', ')})`.length : 0;\n return nameLength + aliasLength;\n }),\n );\n\n return commands.map((cmd) => {\n let name = cmd.name;\n if (cmd.aliases && cmd.aliases.length > 0) {\n name += ` (${cmd.aliases.join(', ')})`;\n }\n const padding = ' '.repeat(maxNameLength - name.length + this.COLUMN_GAP);\n return `${name}${padding}${cmd.description}`;\n });\n }\n\n static formatOptions(options) {\n const maxFlagsLength = Math.max(\n this.MIN_DESCRIPTION_COLUMN,\n ...options.map((opt) => opt.flags.length),\n );\n\n return options.map((opt) => {\n const padding = ' '.repeat(maxFlagsLength - opt.flags.length + this.COLUMN_GAP);\n let description = opt.description;\n\n // Add default value\n if (opt.defaultValue !== undefined) {\n description += ` [default: ${opt.defaultValue}]`;\n }\n\n // Add valid values on next line if present\n if (opt.validValues && opt.validValues.length > 0) {\n const validValuesLine =\n ' '.repeat(maxFlagsLength + this.COLUMN_GAP) + `Valid: ${opt.validValues.join(', ')}`;\n return `${opt.flags}${padding}${description}\\n${this.INDENT}${validValuesLine}`;\n }\n\n return `${opt.flags}${padding}${description}`;\n });\n }\n\n /**\n * Strip ANSI color codes and emojis from text\n */\n static stripFormatting(text) {\n // Remove ANSI color codes\n text = text.replace(/\\x1b\\[[0-9;]*m/g, '');\n\n // Remove common emojis used in the CLI\n const emojiPattern =\n /[\\u{1F300}-\\u{1F9FF}]|[\\u{2600}-\\u{27BF}]|[\\u{1F000}-\\u{1F6FF}]|[\\u{1F680}-\\u{1F6FF}]/gu;\n text = text.replace(emojiPattern, '').trim();\n\n // Remove multiple spaces\n text = text.replace(/\\s+/g, ' ');\n\n return text;\n }\n}\n"],"names":["HelpFormatter","INDENT","COLUMN_GAP","MIN_DESCRIPTION_COLUMN","formatHelp","info","sections","push","formatSection","name","description","usage","commands","length","formatCommands","options","formatOptions","globalOptions","examples","details","join","formatError","error","command","lines","formatValidationError","value","paramName","validOptions","title","content","map","line","maxNameLength","Math","max","cmd","nameLength","aliasLength","aliases","padding","repeat","maxFlagsLength","opt","flags","defaultValue","undefined","validValues","validValuesLine","stripFormatting","text","replace","emojiPattern","trim"],"mappings":"AAKA,OAAO,MAAMA;IACX,OAAOC,SAAS,OAAO;IACvB,OAAOC,aAAa,EAAE;IACtB,OAAOC,yBAAyB,GAAG;IAKnC,OAAOC,WAAWC,IAAI,EAAE;QACtB,MAAMC,WAAW,EAAE;QAGnBA,SAASC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAC,QAAQ;YAAC,GAAGH,KAAKI,IAAI,CAAC,GAAG,EAAEJ,KAAKK,WAAW,EAAE;SAAC;QAG/E,IAAIL,KAAKM,KAAK,EAAE;YACdL,SAASC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAC,YAAY;gBAACH,KAAKM,KAAK;aAAC;QAC3D;QAGA,IAAIN,KAAKO,QAAQ,IAAIP,KAAKO,QAAQ,CAACC,MAAM,GAAG,GAAG;YAC7CP,SAASC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAC,YAAY,IAAI,CAACM,cAAc,CAACT,KAAKO,QAAQ;QAChF;QAGA,IAAIP,KAAKU,OAAO,IAAIV,KAAKU,OAAO,CAACF,MAAM,GAAG,GAAG;YAC3CP,SAASC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAC,WAAW,IAAI,CAACQ,aAAa,CAACX,KAAKU,OAAO;QAC7E;QAGA,IAAIV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