diff options
Diffstat (limited to 'modules/core/module-fs.js')
| -rw-r--r-- | modules/core/module-fs.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/core/module-fs.js b/modules/core/module-fs.js index ab8fd99..25442eb 100644 --- a/modules/core/module-fs.js +++ b/modules/core/module-fs.js @@ -33,6 +33,11 @@ class FileSystemModule { 'download': 'download <file> — Download a file to your device', 'vfs-export': 'vfs-export — Export the entire virtual filesystem as JSON', 'vfs-import': 'vfs-import — Import a previously exported VFS JSON file', + 'session-save': 'session-save <name> — Save current session (path + terminal history)', + 'session-load': 'session-load <name> — Load a saved session', + 'session-list': 'session-list — List all saved sessions', + 'session-new': 'session-new — Start a fresh session (auto-saves current, clears AI context)', + 'session-delete': 'session-delete <name> — Delete a saved session', }; } registerCommands() { @@ -486,6 +491,18 @@ class FileSystemModule { this.terminal.print('Session not found: ' + args[0], 'error'); } }; + this.commands['session-new'] = () => { + // Auto-save current session, clear AI context, fresh terminal + this.terminal._autoSaveSession(); + try { localStorage.removeItem('webx11_ai_context'); } catch(e) {} + // Clear terminal output + if (this.terminal.outputContainer) this.terminal.outputContainer.innerHTML = ''; + if (this.terminal._historyBuffer) this.terminal._historyBuffer = []; + // Clear AI conversation context + const aiMod = this.terminal.moduleManager.modules['WebX11AIAssistantModule']; + if (aiMod && aiMod.clearContext) aiMod.clearContext(); + this.terminal.print('✨ New session started — context cleared', 'success'); + }; this.commands['session-export'] = (args) => { if (!args[0]) return this.terminal.print('Usage: session-export <name>', 'warning'); const filePath = '_sessions/' + args[0] + '.json'; |