feat: MCP-Tools ask_user_choice + memory_read/write/list, Text-Marker entfernt
MCP-Server erweitert um ask_user_choice (Long-Poll), memory_read, memory_write und memory_list Tools. MCP-Config wird jetzt immer generiert (nicht nur bei Remote-Verbindung). InternalEndpoint um PendingChoices + choice-respond Endpoint ergänzt. Frontend differenziert CLI-Modus (choice-respond API) vs. API-Modus. Gesamter :::ASK_USER_CHOICE::: Text-Marker-Mechanismus aus ClaudeCliService, AnthropicService, markdown.js und stream-ui.js entfernt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
3b068a7866
commit
3e0a69e7a4
10 files changed
+493
-319
No files matched your search
@@ -6,18 +6,6 @@ function renderMarkdown(text) {
|
||||
if (!text) return '';
|
||||
var src = text.trim();
|
||||
|
||||
// 0) :::ASK_USER_CHOICE::: Blöcke erkennen und als Platzhalter speichern (vor Markdown-Parsing)
|
||||
var choiceBlocks = [];
|
||||
src = src.replace(/:::ASK_USER_CHOICE:::\s*\n?([\s\S]*?)\n?\s*:::END_ASK_USER_CHOICE:::/g, function(match, jsonStr) {
|
||||
try {
|
||||
var data = JSON.parse(jsonStr.trim());
|
||||
choiceBlocks.push(data);
|
||||
return '%%CHOICE' + (choiceBlocks.length - 1) + '%%';
|
||||
} catch(e) {
|
||||
return match; // JSON-Fehler → als Text belassen
|
||||
}
|
||||
});
|
||||
|
||||
// 1) LaTeX-Ausdrücke VOR dem Markdown-Parsing schützen
|
||||
// Reihenfolge: zuerst Block ($$...$$), dann Inline ($...$)
|
||||
var mathBlocks = [];
|
||||
@@ -107,22 +95,6 @@ function renderMarkdown(text) {
|
||||
}
|
||||
});
|
||||
|
||||
// 8) Choice-Platzhalter durch interaktive Buttons ersetzen
|
||||
html = html.replace(/%%CHOICE(\d+)%%/g, function(m, idx) {
|
||||
var data = choiceBlocks[parseInt(idx)];
|
||||
var q = data.question || '';
|
||||
var choices = data.choices || [];
|
||||
var jsonAttr = esc(JSON.stringify(data));
|
||||
var out = '<div class="inline-choice-block" data-choice-json="' + jsonAttr + '">';
|
||||
out += '<div class="choice-question">' + esc(q) + '</div>';
|
||||
out += '<div class="choice-buttons">';
|
||||
for (var i = 0; i < choices.length; i++) {
|
||||
out += '<button class="choice-btn inline-choice-btn" data-choice="' + esc(choices[i]) + '">' + esc(choices[i]) + '</button>';
|
||||
}
|
||||
out += '</div></div>';
|
||||
return out;
|
||||
});
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user