Daten
diff --git a/wwwroot/js/chat.js b/wwwroot/js/chat.js
index 8860c9d..d3bb3df 100644
--- a/wwwroot/js/chat.js
+++ b/wwwroot/js/chat.js
@@ -156,11 +156,17 @@ async function sendMessage() {
case 'tool_start':
endStreamBubble();
- currentToolBox = addToolBoxLoading(data.name);
+ if (isToolVisible(data.name)) {
+ currentToolBox = addToolBoxLoading(data.name);
+ } else {
+ currentToolBox = null;
+ }
break;
case 'tool_end':
- finishToolBox(currentToolBox, data);
+ if (currentToolBox) {
+ finishToolBox(currentToolBox, data);
+ }
currentToolBox = null;
break;
diff --git a/wwwroot/js/history.js b/wwwroot/js/history.js
index 55aa223..998bc90 100644
--- a/wwwroot/js/history.js
+++ b/wwwroot/js/history.js
@@ -53,7 +53,9 @@ function renderMessages(msgs, addToConversation) {
break;
case 'tool_use':
- addToolBoxStatic(msg.toolName, msg.content, null, false);
+ if (isToolVisible(msg.toolName)) {
+ addToolBoxStatic(msg.toolName, msg.content, null, false);
+ }
break;
case 'tool_result':
@@ -141,6 +143,7 @@ async function loadLatestArchive() {
}
break;
case 'tool_use':
+ if (!isToolVisible(msg.toolName)) continue;
div.className = 'tool-box archived';
renderToolBoxContent(div, msg.toolName, msg.content, null, false);
break;
diff --git a/wwwroot/js/pages/settings-page.js b/wwwroot/js/pages/settings-page.js
index 06b823e..3964cad 100644
--- a/wwwroot/js/pages/settings-page.js
+++ b/wwwroot/js/pages/settings-page.js
@@ -3,7 +3,8 @@
const SETTINGS_KEY = 'settings';
const SETTINGS_DEFAULTS = {
- pageWidth: 900
+ pageWidth: 900,
+ toolCallDisplay: 'modifications' // 'all' | 'modifications' | 'hidden'
};
function loadSettings() {
@@ -34,11 +35,13 @@ registerPage('settings', {
init() {
const slider = document.getElementById('settingPageWidth');
const display = document.getElementById('settingPageWidthValue');
+ const toolCallSelect = document.getElementById('settingToolCallDisplay');
const resetBtn = document.getElementById('settingsResetBtn');
const s = loadSettings();
slider.value = s.pageWidth;
display.textContent = s.pageWidth + 'px';
+ toolCallSelect.value = s.toolCallDisplay;
slider.addEventListener('input', () => {
display.textContent = slider.value + 'px';
@@ -51,6 +54,12 @@ registerPage('settings', {
applySettings();
});
+ toolCallSelect.addEventListener('change', () => {
+ const s = loadSettings();
+ s.toolCallDisplay = toolCallSelect.value;
+ saveSettings(s);
+ });
+
const backupBtn = document.getElementById('settingsBackupBtn');
if (backupBtn) backupBtn.addEventListener('click', async () => {
backupBtn.disabled = true;
@@ -72,6 +81,7 @@ registerPage('settings', {
// Update UI
slider.value = SETTINGS_DEFAULTS.pageWidth;
display.textContent = SETTINGS_DEFAULTS.pageWidth + 'px';
+ toolCallSelect.value = SETTINGS_DEFAULTS.toolCallDisplay;
});
},
destroy() {}
diff --git a/wwwroot/js/ui.js b/wwwroot/js/ui.js
index 76f76f6..dfd4bef 100644
--- a/wwwroot/js/ui.js
+++ b/wwwroot/js/ui.js
@@ -245,6 +245,18 @@ function endStreamBubble() {
_streamText = '';
}
+// ── Tool Call Visibility ──
+
+const MODIFICATION_TOOLS = ['write_file', 'edit_file', 'delete_file', 'memory_write'];
+
+function isToolVisible(toolName) {
+ const mode = loadSettings().toolCallDisplay;
+ if (mode === 'all') return true;
+ if (mode === 'hidden') return false;
+ // 'modifications' – nur modifizierende Tools anzeigen
+ return MODIFICATION_TOOLS.includes(toolName);
+}
+
// ── Tool Boxes ──
function addToolBoxLoading(name) {