feat(ccw): Add count-based memory update strategy and fix MCP card click

- Add count-based update strategy for memory hooks (threshold-based triggering)
- Add threshold config field (default: 10, range: 3-50)
- Add i18n translations for count-based strategy (EN/ZH)
- Fix MCP card click not responding due to HTML entity encoding in JSON
- Add unescapeHtml() utility function for decoding HTML entities
- Move stopPropagation from container div to individual buttons
- Change CCW MCP install to use cmd /c npx -y format for Windows

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-19 11:41:21 +08:00
parent 69049e3f45
commit c7ced2bfbb
6 changed files with 95 additions and 13 deletions

View File

@@ -20,6 +20,21 @@ function escapeHtml(str) {
.replace(/'/g, '&#039;');
}
/**
* Unescape HTML entities back to original characters
* @param {string} str - String with HTML entities
* @returns {string} String with entities decoded
*/
function unescapeHtml(str) {
if (typeof str !== 'string') return str;
return str
.replace(/&quot;/g, '"')
.replace(/&#039;/g, "'")
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&amp;/g, '&');
}
/**
* Truncate text to specified maximum length
* @param {string} text - Text to truncate