Add support assistant via Ollama: chat panel in terminal tabs with the latest terminal output as context, 'explain last error', copy/insert suggested commands (never auto-executed), Ollama server/model in settings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ const { SshManager } = require('../main/ssh');
|
||||
const { DockerManager } = require('../main/docker');
|
||||
const { FirewallManager } = require('../main/firewall');
|
||||
const { NetworkConfigManager } = require('../main/network');
|
||||
const { AiAssistant } = require('../main/ai');
|
||||
const i18n = require('../i18n');
|
||||
const backup = require('./backup');
|
||||
const composeTemplates = require('../main/compose-templates');
|
||||
@@ -34,6 +35,7 @@ function createBackend({ store, send, platform, version = '0.0.0', withSync = fa
|
||||
const docker = new DockerManager(ssh);
|
||||
const firewall = new FirewallManager(ssh);
|
||||
const network = new NetworkConfigManager(ssh);
|
||||
const ai = new AiAssistant(store, send);
|
||||
let sync = null;
|
||||
if (withSync) {
|
||||
const { SyncService } = require('../main/sync');
|
||||
@@ -206,6 +208,11 @@ function createBackend({ store, send, platform, version = '0.0.0', withSync = fa
|
||||
handle('network:writeFile', (id, path, content, verify) => network.writeFile(id, path, content, verify));
|
||||
handle('network:close', (id) => network.close(id));
|
||||
|
||||
// ---------- Support-Assistent (Ollama) ----------
|
||||
handle('ai:models', (url) => ai.models(url));
|
||||
handle('ai:chat', (id, messages, context) => ai.chat(id, messages, context));
|
||||
handle('ai:stop', (id) => ai.stop(id));
|
||||
|
||||
// ---------- Synchronisation ----------
|
||||
if (sync) {
|
||||
handle('sync:status', () => sync.status());
|
||||
@@ -221,6 +228,7 @@ function createBackend({ store, send, platform, version = '0.0.0', withSync = fa
|
||||
|
||||
function close() {
|
||||
ssh.closeAll?.();
|
||||
ai.stopAll();
|
||||
sync?.stop();
|
||||
for (const r of pending.values()) r(null);
|
||||
pending.clear();
|
||||
|
||||
Reference in New Issue
Block a user