Module OS v4.2
WebX11 Terminal ยท Self-improving Modular OS ยท Reviewed 2026-05-28 ยท โ
Live QA Passed
โ
Live Test Results (2026-05-28)
Boot/Init: โ
41 modules loaded, splash hidden, 0 JS errors
Core Terminal: โ
help, ls, put, cat, clear, mem all working
File Persistence: โ
VFS survives page reload, _dirty flag skips idle saves
UI Modals: โ
Skills Manager, File Browser, Config, WebDAV Browser, File Manager
Autocomplete: โ
Tab cycle, Enter/click accept, Escape hide
All 16 ext modules: calc, voice, cron, theme, wpm, mindmap, webdav, skill-pack-core, editor, diff, alias, finder, filemgr, cryptogzip, busybox, shell โ load without errors
AI Streaming: โ
NDJSON stream parsing, real-time token display
WebDAV Browser: โ
Modal file explorer, clickable dirs, preview, upload/download, breadcrumbs
Session Nesting: โ
Fixed โ deep clone + strip _sessions, no recursive growth
Terminal History: โ
Persists across page reload
SecretVault: โ
AES-GCM encrypted credential storage via Web Crypto API
Context Compression: โ
Auto-compresses AI history when >2000 tokens
Trash System: โ
rm moves to trash, 4 dedicated trash commands
VFS Checkpoints: โ
snapshot/rollback via checkpoint command
Requirements Check: โ
all modules report prerequisites via check command
Architecture
newOS4 v4.2 uses a modular class-based architecture with async dependency loading:
- module-loader.js โ 4-phase async loader: VFS โ ModuleManager โ OllamaManager/Terminal โ Ext modules. Cache-busting via localStorage version key + per-load timestamps.
- VirtualFileSystem โ localStorage-backed in-browser filesystem with VFS checkpoints (snapshot/rollback), trash system (rm โ trash, ls-trash, empty-trash), and dirty-flag auto-save.
- ModuleManager โ Central registry with load/unload/reload, ASI-safe comment-stripped class parsing,
loadModuleFromCode() for runtime module loading.
- OllamaManager โ LLMRouter โ Multi-provider router with auto-fallback chain. Supports Ollama (native) + any OpenAI-compatible API (OpenRouter). SSE streaming parsing. Provider priority-based failover.
- SecretVault โ AES-256-GCM encrypted credential manager via Web Crypto API. PBKDF2 key derivation (100K iterations). PIN or open mode.
- Terminal โ Full terminal with autocomplete, command history, pipe support, clickable output, dirty-flag auto-save, output trimming (200-line cap with memory-pressure auto-reduction).
Module System
25 core modules (foundation + built-in) + 16 ext modules = 41 total. All ES6 classes registered via webx11.moduleManager.registerModule(). Ext modules are togglable via the startup gear on splash. Modules report requirements via requirements() method โ checked by the check command.
Dynamic help system: Every module implements getHelpInfo() returning a command โ description map. ModuleManager.getAllHelp() collects all entries at runtime. No more hardcoded 195-line help map. New modules appear in help immediately.
Key Features
๐ง AI Assistant (WebX11AIAssistantModule)
- Agentic loop with up to 8 tool-call turns (was 5)
- 27 tool definitions: all standard tools +
session_terminal for reading last 50 lines of terminal history
- Tool failure tracking โ after 3 failures on the same tool, warns user to create a workaround skill
- Per-tool timing logs โ every tool call logged with duration in terminal console
- Streaming responses โ NDJSON stream parsing shows tokens in real-time
- Context compression โ auto-compresses when conversation exceeds 2000 tokens (summarizes old messages, keeps last 3 exchanges)
- Manual compression via
ai-compress command
- Auto-loads relevant skills and recent session memory at start
- Inline destructive action confirmation with 120-second countdown
- Status bar "๐ค AI Thinking..." spinner while processing
- Post-task reflection suggesting skill creation
- LLMRouter-backed โ auto-falls to next provider on failure
๐ SecretVault (Core Module)
- AES-256-GCM encrypted credential storage via Web Crypto API
- PBKDF2 key derivation: 100,000 iterations, SHA-256, 256-bit key
- Two modes: PIN mode (password-derived) or open mode (random hex key)
- 7 CLI commands:
secret-set, secret-get, secret-list, secret-del, secret-lock, secret-unlock, secret-setpin
- Auto-redaction:
redactSecret() scans output for stored secrets and replaces with [REDACTED]
- Integration:
ollama-manager stores API keys via SecretVault; modules check window.webx11_secretVault
๐ LLMRouter (OllamaManager)
- Multi-provider router: supports Ollama (native
/api/chat + /api/generate) and any OpenAI-compatible API (OpenRouter, etc.)
- Provider priority chain โ falls to next on failure, tracks
fallbackCount per provider
- SSE streaming for OpenAI-compatible endpoints: parses
data: {"choices":[{"delta":{"content":"..."}}]} format
- Auto-probes provider on
connect() via /api/tags (Ollama) or /v1/models (OpenAI)
- API keys stored via SecretVault when available
๐ Skills System (SkillsModule)
- 8 CLI commands:
skill-list, skill-view, skill-create, skill-patch, skill-delete, skill-export, skill-import, skill-sync
- Skill index caching โ in-memory index with 2-second debounced flush to VFS, eliminates repeated
fsReadJSON calls
- Skills Manager UI modal (๐ button in quick-actions)
- Stored as Markdown with YAML frontmatter in VFS
/skills/
- Auto-loads relevant skills at the start of every AI task
- Auto-creates error workaround skills after 3+ repeated errors
- Auto-audits skills for staleness every 20 messages
๐๏ธ Trash System
rm moves files to trash instead of permanent deletion (safer)
- 5 dedicated commands:
trash, trash-dir, ls-trash, empty-trash, rm -rf for real deletion
- Trash persists in VFS across page reloads
๐ธ VFS Checkpoints
- Snapshots:
checkpoint [name] โ saves full VFS state to /_snapshots/
- Rollback:
rollback <name> โ restores VFS from snapshot
- Management:
checkpoint-list, checkpoint-del
- Auto-prunes oldest checkpoints when exceeding 10
๐ File Manager (Ext Module)
- Fullscreen overlay with 30% sidebar + 70% preview pane
- Commands:
files, preview <path>
- Preview types: Markdown (regex render), images (data URI), video/audio, code (line-numbered table), JSON (highlighted), CSV, PDF (embed)
- Live search filter (Ctrl+F), action bar (delete, download, edit via editor.js)
- Breadcrumb navigation, Raw/Rendered toggle
- 50KB file truncation warning, empty dir indicator, binary fallback
๐งฐ Tool Registry โ requirements()
- Every module implements
requirements() returning { met, missing }
check command runs all requirements and reports overall health
commands command shows module source + requirements per module
๐ค Voice (VoiceModule)
- ๐ค button in input area next to โ Send
- Green pulse animation while listening, red on error
- SpeechRecognition API (Chrome, Edge, Safari 14.1+), graceful fallback on Firefox
- Visibility state persists in localStorage
๐พ Session Persistence
- Auto-saves every 3 minutes โ but only when
_dirty flag is set (idle = 0 writes)
- Nesting bug fixed: deep clones VFS, strips
_sessions before serialization
- Terminal command history persists across page reloads
- Output trimming: 200-line cap with memory-pressure auto-trim to 100/50 when heap >80MB/120MB
Other Key Modules
- SearXNG + DuckDuckGo โ Web search with fallback
- Web Fetcher โ Fetch and extract clean content from any URL
- WebDAV Sync โ 8 commands + browser modal for cloud sync (config, push, pull, backup, restore, del)
- Shell Module โ Full shell: pipe
|, redirects > >> <, variables $VAR, chaining && || ;, VFS script execution
- BusyBox โ 16 utility commands: which, env, date, cal, yes, seq, base64, printf, cut, uniq, hostname, whoami, basename, dirname, sleep, expand
- CryptoGzip โ AES-256-GCM encrypt/decrypt and gzip/gunzip for VFS files
- Session System โ save/load/list/delete/export/import via AI tools
- My Data โ Persistent user profile with 7 CLI commands
- Ollama Model Manager โ models, model-info, model-pull, model-delete, model-run
- Cron Scheduler โ schedule commands at intervals (min 5s), localStorage persistence
- Alias Module โ define/manage command aliases (ll, h, cls defaults) with localStorage persistence
- Text Editor โ inline VFS file editing via modal (edit, save, cancel)
- Theme Switcher โ dark, light, amber, cyber + custom
- Command Aliases โ ll, h, cls defaults with localStorage persistence
All Modules (41 total)
Foundation (5): virtual-fs.js, module-manager.js, secret-vault.js, ollama-manager.js, terminal.js
Core (20): module-system.js, module-fs.js, module-modmgr.js, module-ollama.js, module-my.js, module-searxng.js, module-servermon.js, module-ollamamodels.js, module-config.js, module-simplegui.js, module-io.js, module-dynamicprompts.js, module-aiassist.js, module-aiasm.js, module-smartctx.js, module-duckduckgo.js, module-fetcher.js, module-skills.js, module-chatstudio.js, module-fs.js
Ext (16): calc.js, voice.js, cron.js, theme.js, wpm.js, mindmap.js, webdav.js, skill-pack-core.js, editor.js, diff.js, alias.js, finder.js, filemgr.js, cryptogzip.js, busybox.js, shell.js
Recent Improvements
๐ SecretVault (2026-05-25)
AES-256-GCM encrypted credential manager using Web Crypto API. PBKDF2 key derivation (100K iterations) with salt. PIN mode or open mode. 7 CLI commands. Auto-redacts stored secrets from output. Integrated with LLMRouter for API key storage.
๐ LLMRouter (2026-05-25)
Refactored from single-endpoint OllamaManager into a multi-provider router with priority-based fallback. Supports Ollama and any OpenAI-compatible API (OpenRouter, etc.). SSE streaming parsing. Provider auto-fallback on failure with per-provider stats tracking.
๐ฆ Context Compression (2026-05-25)
When AI conversation exceeds 2000 tokens, _compressContext() keeps last 3 exchanges, summarizes the rest into one system message via AI summarization or fallback truncation. Also available as ai-compress command. Max tool turns increased from 5 to 8.
๐ธ VFS Checkpoints + Trash (2026-05-25)
Snapshot/rollback system (checkpoint, rollback, checkpoint-list, checkpoint-del) plus trash system (rm โ trash, trash-dir, ls-trash, empty-trash). Auto-prunes to max 10 checkpoints.
๐งฐ Tool Registry + File Manager (2026-05-25)
Tool Registry: every module implements requirements(). File Manager: 704-line fullscreen overlay with sidebar, preview pane, search, edit, download, delete commands.
๐งฐ Dynamic Help System & Module Loading Fixes (2026-05-25)
Replaced _buildHelpMap() (195 lines) with ModuleManager.getAllHelp(). Fixed double-loading of ext modules (skip list + relative URL guard in registerModule()). Fixed ASI comment-stripping bug in class parsing. Added loadModuleFromCode() for runtime module loading. Fixed check_updates returning empty.
๐ง AI Session Terminal Tool + Error Tracking (2026-05-25)
Added session_terminal tool: reads last 50 lines of terminal auto-save for context when user references past terminal work. Added _trackToolFailure(): after 3 failures on the same tool, warns user and suggests creating a workaround skill. Per-tool timing logs with duration.
๐ WebDAV Browser UI + File Manager (2026-05-25)
Full modal file explorer for the dedicated WebDAV space, with clickable directory navigation, breadcrumbs, file preview (HTML in iframe, text inline), upload button, download on double-click, and refresh. New File Manager ext module adds files and preview commands with fullscreen overlay.
๐ฆ 4 New Ext Modules (2026-05-25)
- BusyBox โ 16 utility commands: which, env, date, cal, yes, seq, base64, printf, cut, uniq, hostname, whoami, basename, dirname, sleep, expand
- Shell โ Full shell: pipes, redirects, variables, chaining, .sh script execution
- CryptoGzip โ AES-256-GCM encrypt/decrypt and gzip/gunzip for VFS files
- File Manager โ Fullscreen file browser with 10+ preview renderers
๐พ Terminal Performance
- Output trimming: 200-line cap with memory-pressure auto-reduction (100/50 lines when >80MB/120MB heap)
- Auto-save interval: 60s โ 180s, dirty-flag skip
- History lazy-loads via
requestAnimationFrame
- localStorage quota warning when approaching limit
mem command: shows JS heap size, terminal lines, history buffer count
Pros & Cons
โ
Self-improving โ AI can create, patch, and manage its own skills
โ
Rich tool ecosystem โ 41 modules, 130+ commands, search, fetch, webdav, cron, theming, calc, voice, encrypt, shell
โ
AI streaming + auto-compression โ NDJSON stream parsing + context auto-compress at 2000 tokens
โ
SecretVault โ AES-GCM encrypted credential storage, auto-redaction
โ
LLMRouter โ multi-provider with auto-fallback, supports Ollama + any OpenAI-compatible API
โ
Dynamic help system โ no hardcoded help map, new modules appear automatically
โ
VFS Checkpoints + Trash โ snapshot/rollback and safe deletion with trash commands
โ
Tool Registry โ every module reports requirements via requirements()
โ
Clean terminal UX โ autocomplete, command history, pipe support, clickable output, mobile responsive
โ
Efficient auto-save โ dirty-flag check skips saves when idle, nesting bug fixed
โ
WebDAV Browser UI โ modal file explorer with breadcrumb nav, preview, upload, download
โ
Self-contained โ no backend needed except Ollama/OpenRouter for AI features
โ
Standalone at /spaces/newos4/ โ removed duplicate chatstudio/newos4 instance, single source of truth
โ Ollama/OpenAI dependency โ AI features require a running provider
โ 8-turn limit โ agent loop max is 8 tool calls, complex tasks may still hit ceiling
โ No module isolation โ all modules share same JS scope
โ No TTS โ voice input only, no text-to-speech for AI responses
โ No nginx token validation โ WebDAV token is decorative; auth via API port 8896
Verdict
newOS4 v4.2 is the most feature-rich version of the WebX11 Terminal. The refactored modular architecture (41 modules with dynamic help, SecretVault, LLMRouter, context compression, VFS checkpoints, trash system, tool registry, and file manager) makes it uniquely capable โ while keeping the main.html at just 36KB.
The dedicated instance at /spaces/newos4/ with nginx autoindex, WebDAV token authentication, and a proper API backend gives it real cloud-backed persistence. Session nesting is fixed, auto-save only fires on actual changes, the mem command gives live heap visibility, and output trimming prevents browser crashes under memory pressure.
Best for: Power users, developers, and anyone who wants a browser-based terminal with AI that can learn, grow, and securely store credentials.
Not for: Users who just want quick AI chat, or users without Ollama/OpenRouter access.
Rating: ๐งฉ๐งฉ๐งฉ๐งฉ๐งฉ (5/5 โ most advanced WebX11 Terminal variant)
๐ Full documentation available here โ