From 4baa484b84c5184286cac2743575251454a5ee2b Mon Sep 17 00:00:00 2001 From: Agando Date: Mon, 25 May 2026 18:02:02 +0200 Subject: auto: 2026-05-25_18:02 changes --- modules/core/module-aiasm.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 modules/core/module-aiasm.js (limited to 'modules/core/module-aiasm.js') diff --git a/modules/core/module-aiasm.js b/modules/core/module-aiasm.js new file mode 100644 index 0000000..60e1757 --- /dev/null +++ b/modules/core/module-aiasm.js @@ -0,0 +1,26 @@ +// Extracted from newOS4 index.html — WebXAIAliasModule + class WebXAIAliasModule { + constructor() { this.commands = {}; this.terminal = null; } + getHelpInfo() { + return { + 'webxai': 'webxai — Send a question to the AI assistant', + 'wx': 'wx — Alias for webxai', + 'webx': 'webx — Alias for webxai' + }; + } + registerCommands() { + this.commands['webxai'] = (args) => this.forwardToAI(args); + this.commands['wx'] = (args) => this.forwardToAI(args); + this.commands['webx'] = (args) => this.forwardToAI(args); + } + forwardToAI(args) { + if (!args[0]) { + this.terminal.print("Usage: webxai ", "warning"); return; + } + if (this.terminal.moduleManager.modules['WebX11AIAssistantModule']) { + this.terminal.moduleManager.modules['WebX11AIAssistantModule'].chat(args); + } else { + this.terminal.ollamaManager.chat(args.join(' ')); + } + } + } -- cgit v1.2.3