diff --git a/src/i18n.js b/src/i18n.js
index 5e9310b..9d0ad18 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -152,6 +152,17 @@
'Command is missing.': 'Befehl fehlt.',
'No open terminal': 'Kein offenes Terminal',
// Support-Assistent
+ 'Delete chat': 'Chat löschen',
+ 'Delete chat?': 'Chat löschen?',
+ 'Saved chats': 'Gespeicherte Chats',
+ 'Context:': 'Kontext:',
+ 'Vault (no context)': 'Tresor (kein Kontext)',
+ 'Explain this tab': 'Diesen Tab erklären',
+ 'Look at the active tab, explain what you see and point out problems.': 'Sieh dir den aktiven Tab an, erkläre, was du siehst, und weise auf Probleme hin.',
+ 'The content of the active tab is sent to the Ollama server.': 'Der Inhalt des aktiven Tabs wird an den Ollama-Server gesendet.',
+ 'Ask about an error or let the assistant explain what you see. The content of the active tab is sent as context.': 'Frag nach einem Fehler oder lass dir erklären, was du siehst. Der Inhalt des aktiven Tabs wird als Kontext mitgesendet.',
+ 'Copied – no terminal tab is active': 'Kopiert – kein Terminal-Tab aktiv',
+ 'Helps with errors in the Linux console, Docker, firewall and network via a local Ollama instance. Open it with the chat button in the title bar or in a tab. The content of the active tab is sent to the Ollama server as context. Chats are stored in the vault.': 'Hilft bei Fehlern in Linux-Konsole, Docker, Firewall und Netzwerk über eine lokale Ollama-Instanz. Öffnen über den Chat-Button in der Titelleiste oder im Tab. Der Inhalt des aktiven Tabs wird als Kontext an den Ollama-Server gesendet. Chats werden im Tresor gespeichert.',
'Support assistant (Ollama)': 'Support-Assistent (Ollama)',
'Assistant': 'Assistent',
'Support assistant': 'Support-Assistent',
@@ -164,7 +175,6 @@
'Please select an Ollama model in the settings first.': 'Bitte zuerst in den Einstellungen ein Ollama-Modell auswählen.',
'Insert into terminal (not executed)': 'Ins Terminal einfügen (wird nicht ausgeführt)',
'Insert': 'Einfügen',
- 'Helps with errors in the Linux console via a local Ollama instance. Open it in a terminal tab with the Assistant button. The latest terminal output is sent to the Ollama server as context.': 'Hilft bei Fehlern in der Linux-Konsole über eine lokale Ollama-Instanz. Im Terminal-Tab über den Button Assistent öffnen. Die letzte Terminalausgabe wird als Kontext an den Ollama-Server gesendet.',
'Ollama server': 'Ollama-Server',
'Model': 'Modell',
'– select –': '– auswählen –',
diff --git a/src/main/ai.js b/src/main/ai.js
index c978971..1544e5d 100644
--- a/src/main/ai.js
+++ b/src/main/ai.js
@@ -4,8 +4,10 @@ const http = require('http');
const https = require('https');
const SYSTEM_PROMPT = `You are the MrTerm support assistant, an experienced Linux system administrator.
-The user works in an SSH terminal on a Linux server (typically Ubuntu, Debian or Proxmox).
-You may receive the latest terminal output as context. Your job:
+The user manages Linux servers (typically Ubuntu, Debian or Proxmox) with MrTerm: SSH terminals, Docker containers
+and compose stacks, firewall (UFW/iptables), network configuration and SFTP.
+You may receive the content of the user's active MrTerm tab as context (terminal output, container list, compose file,
+firewall rules, …). Your job:
- Explain errors briefly and clearly, name the most likely cause.
- Suggest concrete, copy-pasteable shell commands in \`\`\`bash code blocks, one step at a time.
- Warn explicitly before destructive commands (rm -rf, dd, mkfs, firewall changes that may lock out SSH, network changes).
@@ -56,7 +58,7 @@ class AiAssistant {
this.stop(chatId);
const ctrl = new AbortController();
this.running.set(chatId, ctrl);
- const sys = SYSTEM_PROMPT + (context ? `\n\nLatest terminal output:\n\`\`\`\n${context.slice(-12000)}\n\`\`\`` : '');
+ const sys = SYSTEM_PROMPT + (context ? `\n\nContent of the active tab:\n\`\`\`\n${context.slice(-12000)}\n\`\`\`` : '');
(async () => {
try {
const res = await request(url, 'api/chat', { method: 'POST', signal: ctrl.signal, body: { model, stream: true, messages: [{ role: 'system', content: sys }, ...messages] } });
diff --git a/src/main/store.js b/src/main/store.js
index 5d7711b..accaf63 100644
--- a/src/main/store.js
+++ b/src/main/store.js
@@ -16,6 +16,8 @@ const DEFAULTS = {
vpns: [],
knownHosts: {},
history: [],
+ // Chats des Support-Assistenten (nur lokal, nicht synchronisiert)
+ aiChats: [],
// Löschvermerke für die Synchronisation: { c: Collection, id, at }
tombstones: [],
// LAN-Synchronisation (gerätebezogen, wird selbst nicht synchronisiert)
diff --git a/src/renderer/app.js b/src/renderer/app.js
index f6f6101..396fd79 100644
--- a/src/renderer/app.js
+++ b/src/renderer/app.js
@@ -151,6 +151,7 @@ async function reload() {
S.vault = await call('vault:get');
I18N.setLanguage(settings().language, navigator.language);
applyStatic();
+ initAi();
const b = $('#vaultBadge');
b.innerHTML = S.vault.encrypted ? `${ICONS.lock}${T('Vault encrypted')}` : `${ICONS.unlock}${T('Vault not encrypted')}`;
b.title = S.vault.encrypted ? T('Data is encrypted with the system keyring.') : T('No system keyring available (e.g. install gnome-keyring/kwallet).');
@@ -1053,7 +1054,7 @@ async function viewSettings(page) {
});
// ---- Support-Assistent (Ollama)
- const aiCard = h(`
${T('Support assistant')}
${T('Helps with errors in the Linux console via a local Ollama instance. Open it in a terminal tab with the Assistant button. The latest terminal output is sent to the Ollama server as context.')}
`);
+ const aiCard = h(`
${T('Support assistant')}
${T('Helps with errors in the Linux console, Docker, firewall and network via a local Ollama instance. Open it with the chat button in the title bar or in a tab. The content of the active tab is sent to the Ollama server as context. Chats are stored in the vault.')}