diff options
50 files changed, 2108 insertions, 1814 deletions
diff --git a/cheatsheet.html b/cheatsheet.html index 616df0e..f329b25 100644 --- a/cheatsheet.html +++ b/cheatsheet.html @@ -34,7 +34,7 @@ pre{background:var(--bg2);border:1px solid var(--border);border-radius:var(--rad <body> <h1>⚡ newOS4 Quick Reference</h1> -<div class="sub">WebX11 v4.3 · <a href="help.html">Full docs →</a> · <span class="no-print">Ctrl+P to print</span></div> +<div class="sub">WebX11 v4.4 · <a href="help.html">Full docs →</a> · <span class="no-print">Ctrl+P to print</span></div> <div class="cols"> @@ -123,10 +123,12 @@ pre{background:var(--bg2);border:1px solid var(--border);border-radius:var(--rad <div class="item"><span class="cmd">predictor-status</span><span class="desc">Model accuracy & data</span></div> <div class="item"><span class="cmd">sandbox-status</span><span class="desc">Sandbox pool health</span></div> <div class="item"><span class="cmd">sandbox-run <t></span><span class="desc">Run in sandbox</span></div> +<div class="item"><span class="cmd">sandbox-kill <id></span><span class="desc">Kill sandbox task</span></div> <div class="item"><span class="cmd">memgraph-status</span><span class="desc">Memory graph stats</span></div> <div class="item"><span class="cmd">memgraph-search</span><span class="desc">Search memory graph</span></div> <div class="item"><span class="cmd">memgraph-stats</span><span class="desc">Graph analysis</span></div> <div class="item"><span class="cmd">memgraph-prune</span><span class="desc">Prune stale edges</span></div> + <div class="item"><span class="cmd">memgraph-learn</span><span class="desc">Add fact to graph</span></div> <div class="item"><span class="cmd">world-model</span><span class="desc">Full world model</span></div> <div class="item"><span class="cmd">world-model-summary</span><span class="desc">System self-awareness</span></div> <div class="item"><span class="cmd">world-model-ask</span><span class="desc">Query the model</span></div> @@ -217,6 +219,12 @@ pre{background:var(--bg2);border:1px solid var(--border);border-radius:var(--rad <div class="item"><span class="cmd">secret-del</span><span class="desc">Delete a secret</span></div> <div class="item"><span class="cmd">secret-lock</span><span class="desc">Lock vault</span></div> <div class="item"><span class="cmd">secret-unlock</span><span class="desc">Unlock vault</span></div> +<div class="item"><span class="cmd">guardrail</span><span class="desc">Show guardrail policy rules</span></div> +<div class="item"><span class="cmd">guardrail-add <id> deny/warn</span><span class="desc">Add custom guardrail rule</span></div> +<div class="item"><span class="cmd">guardrail-remove <id></span><span class="desc">Remove a guardrail rule</span></div> +<div class="item"><span class="cmd">shadow <cmd></span><span class="desc">Run cmd in shadow VFS preview</span></div> +<div class="item"><span class="cmd">shadow-commit</span><span class="desc">Accept shadow VFS changes</span></div> +<div class="item"><span class="cmd">shadow-rollback</span><span class="desc">Undo shadow VFS changes</span></div> </div> <h2>⌨️ Shortcuts</h2> @@ -232,7 +240,7 @@ pre{background:var(--bg2);border:1px solid var(--border);border-radius:var(--rad </div> <div class="footer"> - WebX11 v4.3 · <a href="help.html">help.html</a> · newOS4 on <a href="main.html">Launch →</a> + WebX11 v4.4 · <a href="help.html">help.html</a> · newOS4 on <a href="main.html">Launch →</a> </div> </body> diff --git a/download-newos4.html b/download-newos4.html deleted file mode 100644 index af4cf73..0000000 --- a/download-newos4.html +++ /dev/null @@ -1,88 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> -<meta charset="UTF-8"> -<meta name="viewport" content="width=device-width,initial-scale=1.0"> -<title>Download newOS4 v4.2</title> -<style> -body{background:#000;color:#0f0;font-family:monospace;padding:20px;max-width:600px;margin:auto} -h1{color:#0f0;font-size:1.3em} -a{color:#0af;text-decoration:none} -a:hover{text-decoration:underline} -.dl-btn{display:block;background:#030;border:1px solid #0f0;color:#0f0;padding:16px;text-align:center;font-size:1.2em;border-radius:6px;margin:20px 0;font-family:monospace;cursor:pointer} -.dl-btn:hover{background:#050} -.info{color:#888;font-size:0.85em;line-height:1.5} -pre{background:#111;padding:10px;border-radius:4px;overflow-x:auto} -</style> -</head> -<body> -<h1>⬇ newOS4 v4.2 — Download</h1> - -<a class="dl-btn" href="newos4.tar.gz" download>📦 Download newOS4.tar.gz (101 KB)</a> - -<div class="info"> -<p><strong>Includes:</strong> index.html, help.html, packages.json, BUGFIX-SUGGESTIONS.md, all 22 core modules, 8 ext modules</p> -<p><strong>How to use on mobile:</strong></p> -<pre> -1. Tap download button above -2. Unzip with a file manager or use this page: -</pre> -</div> - -<h2 style="color:#0af;font-size:1em">📂 Quick Extractor</h2> -<input type="file" id="upload" accept=".tar.gz,.gz" style="margin:10px 0;color:#0f0;background:#111;border:1px solid #050;padding:8px;width:100%"> -<div id="status" style="color:#888;margin:10px 0;font-size:0.85em">Select the .tar.gz file above</div> -<div id="fileList" style="background:#111;padding:10px;border-radius:4px;display:none;max-height:400px;overflow-y:auto;font-size:0.8em"></div> - -<script> -document.getElementById('upload').addEventListener('change', async function(e) { - const file = e.target.files[0]; - if (!file) return; - - const status = document.getElementById('status'); - const list = document.getElementById('fileList'); - status.textContent = '📦 Extracting ' + file.name + ' (' + (file.size / 1024).toFixed(0) + ' KB)...'; - list.style.display = 'none'; - - try { - const buffer = await file.arrayBuffer(); - const bytes = new Uint8Array(buffer); - - // Use a simple tar.gz reader via jsdelivr gzip library - // Fallback: show the raw structure from the tar - let html = '<div style="color:#888;padding:4px">Extracted files (tap to view):</div>'; - - // Basic TAR parser (no gzip in browser, but we can read the gzip metadata) - const isGzip = bytes[0] === 0x1f && bytes[1] === 0x8b; - status.textContent = isGzip ? '📦 GZIP archive detected. For full extraction, use a PC.' : 'Unknown format.'; - - // List what should be in the archive - const expectedFiles = [ - 'index.html', 'help.html', 'packages.json', 'BUGFIX-SUGGESTIONS.md', - 'modules/core/ (22 files)', 'modules/ext/ (8 files)' - ]; - - html += expectedFiles.map(f => { - const isDir = f.includes('('); - const name = isDir ? f.split(' (')[0] : f; - return '<div style="padding:2px 0;color:' + (isDir ? '#0af' : '#0f0') + '">' + (isDir ? '📁' : '📄') + ' ' + f + '</div>'; - }).join(''); - - list.innerHTML = html; - list.style.display = 'block'; - status.textContent = '✅ Download successful! ' + file.size + ' bytes. Archive contains 4 files + 2 directories.'; - } catch(err) { - status.textContent = '❌ Error: ' + err.message; - } -}); -</script> - -<div style="margin-top:30px;border-top:1px solid #333;padding-top:15px"> -<p style="color:#888;font-size:0.85em"> -<strong>🔗 Direct link:</strong> <a href="newos4.tar.gz">newos4.tar.gz</a><br> -<strong>📏 Size:</strong> 101 KB | <strong>Updated:</strong> May 2026<br> -<strong>💡 Tip:</strong> On Android, use <span style="color:#0f0">ZArchiver</span> or <span style="color:#0f0">RAR</span> app to extract the tar.gz. -</p> -</div> -</body> -</html> diff --git a/downloads/_auto.json b/downloads/_auto.json new file mode 100644 index 0000000..d0e93c2 --- /dev/null +++ b/downloads/_auto.json @@ -0,0 +1 @@ +{"type":"session","savedAt":"2026-06-05T22:26:11.981Z","fsRoot":{"type":"dir","content":{"skills":{"type":"dir","content":{"navigating-the-terminal.md":{"type":"file","content":"---\nname: navigating-the-terminal\ndescription: How to explore the WebX11 terminal, find commands, check status, and navigate the filesystem\ntags: [terminal, navigation, help, filesystem]\ncategory: system\n---\n## Steps\n1. **Get an overview of available commands:**\n - Type \"help\" for a full command list sorted by category\n - Type \"status\" to see filesystem state, loaded modules, Ollama status\n - For a specific command, use help <command>\n - Type \"commands\" for a compact list with module source info\n - Type \"check\" for system health including module requirements\n\n2. **Explore the filesystem:**\n - Use ls, ll, tree to browse directories\n - Use cd <dir> to navigate, pwd to show current path\n - Use cat or edit to view file contents\n - Use find or grep to search files\n - Use du to see disk usage\n\n3. **Understand system state:**\n - mem — memory usage (auto-shown in header on boot)\n - status — network, files, modules, Ollama\n - modules — module manager GUI\n - health-check — VFS size, modules, logs, trash, skills, tool failures\n - checkpoint-list — VFS checkpoint snapshots\n\n4. **Agent / Orchestration state:**\n - agent-list — registered agents (type, capabilities, status)\n - orchestrate — list active orchestrated agents\n - lease-list — show active leases with TTL\n\n5. **When user asks a vague question:**\n - First run status and help to understand the current state\n - Then ask clarifying questions based on what you found","modified":"2026-06-05T22:13:42.539Z"},"memory-and-profile.md":{"type":"file","content":"---\nname: memory-and-profile\ndescription: How to use the user profile system, session memory, and pattern tracking for persistent context\ntags: [memory, profile, session, persistence]\ncategory: system\n---\n## Steps\n1. **User Profile (persists across sessions):**\n - user_get(key) — read any profile field (e.g. \"preferredModel\", \"fontSize\")\n - user_set(key, value) — write to profile, auto-persists to localStorage\n - user_list — show all stored profile keys\n - user_forget(key) — delete a profile key\n - Dot notation supported: user_set knownFacts.name \"Alex\"\n\n2. **Session Memory (VFS-based daily logs):**\n - session_save(summary) — save a summary of what was accomplished\n - session_load(date) — read a specific day's log (format: YYYY-MM-DD)\n - session_recent(count) — show last N session summaries\n - session_stats — aggregate totals across all sessions\n - Recent sessions auto-load into context on first message\n - systemd-style journal: use logs and logrotate commands for persistent logging\n\n3. **Conversation Patterns:**\n - Pattern tracking runs automatically — frequent topics surface as hints\n - my-set, my-get, my-list store additional personal data\n - AI conversation context persists within a session (use ai-clear to reset)\n - debug command toggles real-time debug panel with Copy/Export/VFS buttons\n\n4. **Checkpoints (VFS snapshots):**\n - checkpoint [name] — snapshot current VFS state\n - checkpoint-list — list all checkpoints\n - rollback <name> — restore from checkpoint\n - checkpoint-del <name> — delete a checkpoint\n\n5. **When to use:**\n - At start: call session_recent(3) to see what was worked on before\n - After identifying user preferences: call user_set to store them\n - After complex tasks: call session_save with a brief summary\n - Before risky edits: call checkpoint to create a restore point","modified":"2026-06-05T22:13:42.539Z"},"web-search-and-fetch.md":{"type":"file","content":"---\nname: web-search-and-fetch\ndescription: How to search the web and fetch URL content using the WebX11 proxy API\ntags: [search, fetch, web, proxy, api]\ncategory: research\n---\n## Steps\n1. **Search the web:**\n - Use search <query> or web_search(query) — uses /api/search which queries SearXNG + DDG fallback\n - Results include: title, url, content snippet, source engine\n - Always available (same-origin, no CORS issues)\n - 5-minute server-side cache for repeated queries\n - Alternative: use ddg or duck <query> for DuckDuckGo direct, or s <query> as alias\n\n2. **Fetch URL content:**\n - Use fetch <url> or web_fetch(url) — uses /api/extract which strips HTML, extracts clean text\n - Returns: title, content (up to 4000 chars), word_count, extraction method\n - SSRF protection blocks internal network addresses\n - 15-minute server-side cache\n\n3. **Search flags (via terminal search command):**\n - search <query> --summarize — adds AI-generated overview via Ollama\n - search <query> --fetch — fetches content snippets for top 3 results\n\n4. **When to use:**\n - User asks about current events, facts, research → use search <query>\n - User says \"read this article\" or provides a URL → use fetch <url>\n - For in-depth analysis: search first, then fetch top results","modified":"2026-06-05T22:13:42.539Z"},"module-management.md":{"type":"file","content":"---\nname: module-management\ndescription: How to view, edit, test, reload modules and manage startup configuration\ntags: [modules, editing, code, self-improvement]\ncategory: dev\n---\n## Steps\n1. **View module source:**\n - view_module(name) — fetches original source or reads from _mods/ if edited\n - Supports all loaded modules: SystemModule, FileSystemModule, SearXNGModule, etc.\n - Or use modules command for GUI module manager\n\n2. **Edit a module:**\n - edit_module(name) — copies source to _mods/<name>.js and opens code editor\n - Editor shows the full source in a textarea\n - Click \"Save & Test\" to save and auto-load the edited version\n - Checkpoint before editing: checkpoint mod-edit-<name>\n\n3. **Test and reload:**\n - test_module(name) — loads edited module from _mods/ for live testing\n - reload_module(name) — discards edits and reloads from original URL\n - list_modified_modules — shows all modules with pending edits\n\n4. **Check for updates:**\n - check_updates — HEAD-requests all loaded module URLs to verify reachability\n\n5. **Manage startup:**\n - startup-modules — opens the Startup Modules UI to select which modules load\n - load-local <path> — load a module from VFS or URL without editing\n - loadmod <url> — alternative: load module from URL\n - removemod <name> — remove a loaded module\n\n6. **Agent modules (Phase 2):**\n - module-agent-registry.js — Agent registry with agent-list, agent-register, agent-unregister, agent-status\n - module-leases.js — Time-bound contracts with 5s watchdog, auto-expiry\n - module-orchestrator.js — Spawn, delegate, kill, purge with heartbeat monitoring\n\n7. **When to use:**\n - User reports a bug in a module → view_module, edit_module, test_module\n - User asks \"can you add X feature?\" → same workflow\n - Always save edits before testing. If test fails, the original module stays loaded.","modified":"2026-06-05T22:13:42.539Z"},"system-maintenance.md":{"type":"file","content":"---\nname: system-maintenance\ndescription: How to reset, troubleshoot, and maintain the WebX11 terminal\ntags: [system, maintenance, reset, troubleshoot, config]\ncategory: system\n---\n## Steps\n1. **Factory reset (wipes everything):**\n - factory-reset --confirm — clears all webx11_ localStorage keys, resets VFS, reloads\n - Use only when the system is in an unrecoverable state\n\n2. **Soft VFS reset:**\n - reset-vfs --confirm — clears only the filesystem, preserves settings/profile/modules\n\n3. **Config management:**\n - config-list — show all config keys and values\n - config-set <key> <value> — set a config value\n - config-delete <key> — remove a config key\n - config-export — dump all config as JSON\n - config-reset — restore defaults (use before factory-reset if you want to save data)\n\n4. **Security level:**\n - security-level <0-3> — set security level (0=Permissive, 1=Standard, 2=Paranoid, 3=Audit)\n - security — show current security level, blocked count, and stats\n - cmd-allow <cmd> — whitelist a command from security checks\n - cmd-deny <cmd> — blacklist a command\n\n5. **Health checks (run automatically after complex tasks):**\n - Check module loading status: loaded vs total\n - Check for pending module edits\n - Check memory usage (high if >100MB)\n - Check skill count (0 skills after 2+ tool calls → suggest create_skill)\n - health-check — full audit: VFS size, modules, logs, trash, skills, tool failures\n\n6. **Font size and display:**\n - font-size <8-32> — set terminal font size, persists across sessions\n - setfont — alias for font-size\n\n7. **Checkpoints:**\n - checkpoint [name] — snapshot current VFS state\n - checkpoint-list — list all checkpoints\n - rollback <name> — restore from checkpoint\n\n8. **When to use:**\n - System is slow or modules fail to load → check check_updates, mem\n - User says \"reset everything\" → factory-reset --confirm\n - User says \"clear my files but keep settings\" → reset-vfs --confirm\n - User reports security concerns → security-level or cmd-allow/cmd-deny","modified":"2026-06-05T22:13:42.539Z"},"backup-and-restore.md":{"type":"file","content":"---\nname: backup-and-restore\ndescription: How to backup, restore, and export WebX11 data\ntags: [backup, restore, export, import, persistence]\ncategory: system\n---\n## Steps\n1. **Backup VFS:**\n - vfs-export — downloads the entire virtual filesystem as a dated JSON file\n - backup — creates a full backup including VFS, modules, config (saves to _backups/)\n\n2. **WebDAV cloud backup:**\n - webdav-backup — push VFS snapshot to WebDAV server (auto-archive)\n - webdav-backup-list — list remote WebDAV backups\n - webdav-restore <file> — restore VFS from remote WebDAV snapshot\n - webdav-push <local> <remote> — push file to WebDAV space\n - webdav-pull <remote> <local> — pull file from WebDAV space\n - webdav-ls [path] — list remote WebDAV directory contents\n - webdav-status — check WebDAV connection and space usage\n - webdav-explorer — GUI file browser for WebDAV\n - webdav-browser — simpler file listing for WebDAV\n - webdav-config — configure WebDAV endpoint and credentials\n\n3. **Export/Import personal data:**\n - my-export — prints all my-set data as formatted JSON\n - my-import <json> — bulk-import personal data from JSON string\n\n4. **Export/Import modules:**\n - export-mods — exports module registry as JSON\n - import-mods <json> — imports modules from JSON backup\n\n5. **Restore:**\n - restore <json> — restores terminal state from a backup JSON\n - Session logs are saved to /memory/ automatically on page unload\n\n6. **When to use:**\n - Before factory-reset: call my-export, vfs-export, export-mods to save data\n - When switching browsers or devices: export all, then import\n - User says \"backup my data\" or \"save my files\"\n - For cloud backup: use webdav-backup (requires WebDAV server configured)","modified":"2026-06-05T22:13:42.539Z"},"mindmap-workflow.md":{"type":"file","content":"---\nname: mindmap-workflow\ndescription: How to create, view, edit, and manage brainstorming mindmaps\ntags: [mindmap, brainstorming, planning, organization]\ncategory: productivity\n---\n## Steps\n1. **Create a new mindmap:**\n - mindmap new \"<topic>\" -t tag1,tag2 — creates a root node\n - Tags are optional (e.g. planning, research, dev)\n - Root gets auto-assigned a color from 7-color palette\n\n2. **Add child nodes:**\n - mindmap add <parent-id> \"<idea>\" -t tag — add a child\n - Get the parent-id from mindmap show\n - IDs are 4-char random strings (e.g. a3f8, x7k2)\n\n3. **View:**\n - mindmap show — full tree with Unicode box-drawing\n - mindmap show <id> — subtree starting at that node\n\n4. **Edit nodes:**\n - mindmap rename <id> \"<new text>\" — change text\n - mindmap color <id> <color> — set color (red/green/yellow/blue/cyan/magenta/white)\n - mindmap tag <id> <tag> — add a tag\n\n5. **Persistence:**\n - mindmap save <name> — save to localStorage\n - mindmap load <name> — restore\n - mindmap list — show saved mindmaps\n - mindmap delete <name> — remove saved\n\n6. **Export:**\n - mindmap export [id] — Markdown bullet list output, auto-copies to clipboard\n\n7. **When to use:**\n - Map out project structure, brainstorm features, organize ideas\n - Break down complex tasks into subtrees\n - User says \"brainstorm\", \"diagram\", \"organize thoughts\", \"plan\"","modified":"2026-06-05T22:13:42.539Z"},"skills-system-guide.md":{"type":"file","content":"---\nname: skills-system-guide\ndescription: How to use the skills system: load, create, patch, list, and audit skills for persistent procedural memory\ntags: [skills, system, meta]\ncategory: system\n---\n## Steps\n1. **Always load skills at task start:**\n - At the START of every task, type or call \"skill-view <name>\" or \"skill-list\"\n - Example: skill-view \"module-management\" — returns matching skill content\n - Example: skill-list system — browse skills by category\n\n2. **Create skills after complex tasks:**\n - After any task with 3+ tool calls, call \"skill-create\"\n - Required fields: name (kebab-case), description, content (markdown with YAML frontmatter)\n - Optional: tags (comma-separated), category (e.g. research, system, dev)\n - Skills persist in /skills/ as .md files with /skills/index.json for fast lookup\n - Skill pack auto-seeds 8 core skills on first boot\n\n3. **Patch skills when they're outdated:**\n - If a stored procedure has wrong steps, call \"skill-patch <name>\"\n - This replaces the entire skill content and updates the index\n - Do NOT create a duplicate — always patch the existing skill\n\n4. **Auto-created error skills:**\n - If the same tool fails 3+ times, a workaround skill is created automatically\n - Named tool-<name>-workaround (e.g. tool-write_file-workaround)\n\n5. **Audit and maintenance:**\n - skill-list <category?> — browse available skills, optionally filter\n - skill-export <name> — download a skill as markdown\n - skill-import <json> — bulk import skills\n - skill-sync — re-index skills from /skills/ directory\n - Skills are audited every 20 messages for staleness (empty content, >30 days old)\n\n6. **YAML frontmatter format:**\n - Each skill file must start with: ---\\nname: <name>\\ndescription: <text>\\ntags: [...]\\ncategory: <cat>\\n---\\n\n - Steps follow under ## Steps heading\n - Use numbered lists for sequential steps","modified":"2026-06-05T22:13:42.539Z"},"agent-orchestration.md":{"type":"file","content":"---\nname: agent-orchestration\ndescription: How to use the agent registry, leases, and orchestrator for multi-agent workflows\ntags: [agents, orchestration, delegation, leases]\ncategory: system\n---\n## Steps\n1. **Agent Registry:**\n - agent-list — list all registered agents (ID, type, capabilities, status)\n - agent-register <type> <capabilities> — register a new agent (capabilities: comma-separated like \"code,research\")\n - agent-unregister <id> — remove an agent\n - agent-status <id> — detailed status including uptime, task history\n\n2. **Leases (time-bound contracts):**\n - lease-create <agent-id> <ttl-seconds> — create a lease with watchdog timer\n - lease-list — show active leases with remaining TTL\n - lease-revoke <lease-id> — terminate a lease early\n - lease-renew <lease-id> <ttl-seconds> — extend a lease\n\n3. **Orchestrator (spawn, delegate, kill):**\n - orchestrator-spawn <type> <capabilities> — spawn a new agent automatically (registers + creates lease)\n - orchestrator-kill <agent-id> — kill an agent (revokes lease + unregisters)\n - orchestrate — list all active agents with their orchestrator state\n - orchestrator-purge — kill all idle/expired agents\n - orchestrator-status — full system status: active, idle, dead agents\n\n4. **AI tool integration:**\n - AI tools list_agents, delegate_task, spawn_agent are available in the AI system prompt\n - The AI can auto-spawn worker agents for sub-tasks\n - Each agent gets its own VFS workspace at /agents/<agent-id>/\n\n5. **When to use:**\n - User needs parallel task execution → orchestrator-spawn coder + researcher\n - Time-bound automation → lease-create with short TTL\n - System cleanup → orchestrator-purge to kill stale agents","modified":"2026-06-05T22:13:42.539Z"},"debug-panel-and-logs.md":{"type":"file","content":"---\nname: debug-panel-and-logs\ndescription: How to use the debug panel, session logging, and terminal diagnostics\ntags: [debug, logging, diagnostics, troubleshooting]\ncategory: system\n---\n## Steps\n1. **Toggle debug panel:**\n - debug — opens real-time debug panel showing last AI tool call, response time, and context\n - Debug panel includes Copy, Export, and Write to VFS buttons\n - Export: saves tool call log as timestamped JSON to downloads\n - Write to VFS: appends debug data to /debug.log (dedup by turn ID)\n\n2. **Session logging:**\n - logs [n] [LEVEL] — view last n log entries (optionally filtered by INFO/WARN/ERROR)\n - logrotate — rotate current.log to dated archive (auto-cleans old logs beyond 10)\n - Logs stored in /logs/ directory: current.log + dated archives\n - Health check runs automatically after complex tasks\n\n3. **Diagnostic commands:**\n - health-check — full audit: VFS size, modules, logs, trash, skills\n - check — quick system health including module requirement status\n - mem — real-time memory usage (also in header)\n - status — network, files, modules, Ollama connectivity\n\n4. **System journals:**\n - debug.log — appended by debug panel VFS button (dedup by turn ID)\n - current.log — system activity log with rotation\n - Auto-save: terminal state auto-saves every 60s\n\n5. **When to use:**\n - AI is behaving unexpectedly → debug to see tool calls\n - User reports errors → logs 50 ERROR to see error entries\n - Memory concerns → mem to check, health-check for full audit","modified":"2026-06-05T22:13:42.539Z"},"webdav-operations.md":{"type":"file","content":"---\nname: webdav-operations\ndescription: How to use WebDAV cloud storage for backup, file sync, and remote file access\ntags: [webdav, cloud, backup, sync, storage]\ncategory: system\n---\n## Steps\n1. **Configuration:**\n - webdav-config — configure WebDAV endpoint URL and credentials\n - Connection auto-tested on config; webdav-status shows connection health\n - Uses per-user token stored in .token file on the server side\n\n2. **File operations:**\n - webdav-ls [path] — list remote directory contents\n - webdav-push <local-path> <remote-path> — upload file to WebDAV\n - webdav-pull <remote-path> [local-path] — download file from WebDAV\n - webdav-explorer — GUI file browser for WebDAV\n - webdav-browser — CLI file browser for WebDAV\n\n3. **Backup & Restore:**\n - webdav-backup — push full VFS snapshot to WebDAV (creates /backups/newos4-<date>.json)\n - webdav-backup-list — list all remote backup snapshots\n - webdav-restore <filename> — restore VFS from a remote backup snapshot\n\n4. **Status & Diagnostics:**\n - webdav-status — connection status, last sync, space information\n - If uploads fail: check webdav-config, ensure .token file is valid\n - WebDAV runs on the same server (nginx with WebDAV module), no external dependency\n\n5. **When to use:**\n - Before factory-reset: webdav-backup to store VFS remotely\n - Cross-browser: webdav-push/pull to move files between instances\n - User says \"cloud backup\" or \"remote save\" → webdav-backup","modified":"2026-06-05T22:13:42.539Z"},"security-and-safety.md":{"type":"file","content":"---\nname: security-and-safety\ndescription: How to use WebX11 security levels, command blocking, and safety features\ntags: [security, safety, blocking, permissions]\ncategory: system\n---\n## Steps\n1. **Security levels:**\n - security-level <0-3> — set security level:\n 0 = Permissive (no blocks, no confirms — anything runs)\n 1 = Standard (unknown cmds → AI route, destructive → confirm, system → block)\n 2 = Paranoid (unknown cmds blocked entirely, destructive blocked)\n 3 = Audit (everything allowed, everything logged)\n - Default: level 1\n - security — show current level, blocked count, and stats\n\n2. **Command control:**\n - cmd-allow <cmd> — whitelist a command from security checks\n - cmd-deny <cmd> — blacklist/block a command entirely\n - whitelist built-in: help, clear, ls, cat, pwd, whoami, df, free, top, ps, echo, date, env, history\n\n3. **What gets blocked at each level:**\n - Unknown commands: Level 1 → AI routed, Level 2+ → blocked\n - Destructive commands (delete, write, save, format, etc.): Level 1 → confirmation, Level 2+ → blocked\n - System commands (reboot, shutdown, format, kill): Level 1+ → blocked\n - Suspicious flags (--execute, --eval, --shell): Level 1+ → blocked\n\n4. **Safety checklist:**\n - Check security: security shows your current level\n - Before running risky commands: create a checkpoint first\n - For temporary relax: security-level 0, then restore to 1\n - For total lockdown before leaving: security-level 2\n\n5. **When to use:**\n - User wants to lock down the terminal → security-level 2\n - User wants to allow a blocked command → cmd-allow <cmd>\n - Debugging strange behavior → verify security-level (user may have set it higher)","modified":"2026-06-05T22:13:42.539Z"},"index.json":{"type":"file","content":"{\"navigating-the-terminal\":{\"name\":\"navigating-the-terminal\",\"description\":\"How to explore the WebX11 terminal, find commands, check status, and navigate the filesystem\",\"tags\":[\"terminal\",\"navigation\",\"help\",\"filesystem\"],\"category\":\"system\",\"created\":\"2026-06-05T22:10:06.669Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"memory-and-profile\":{\"name\":\"memory-and-profile\",\"description\":\"How to use the user profile system, session memory, and pattern tracking for persistent context\",\"tags\":[\"memory\",\"profile\",\"session\",\"persistence\"],\"category\":\"system\",\"created\":\"2026-06-05T22:10:06.669Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"web-search-and-fetch\":{\"name\":\"web-search-and-fetch\",\"description\":\"How to search the web and fetch URL content using the WebX11 proxy API\",\"tags\":[\"search\",\"fetch\",\"web\",\"proxy\",\"api\"],\"category\":\"research\",\"created\":\"2026-06-05T22:10:06.669Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"module-management\":{\"name\":\"module-management\",\"description\":\"How to view, edit, test, reload modules and manage startup configuration\",\"tags\":[\"modules\",\"editing\",\"code\",\"self-improvement\"],\"category\":\"dev\",\"created\":\"2026-06-05T22:10:06.669Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"system-maintenance\":{\"name\":\"system-maintenance\",\"description\":\"How to reset, troubleshoot, and maintain the WebX11 terminal\",\"tags\":[\"system\",\"maintenance\",\"reset\",\"troubleshoot\",\"config\"],\"category\":\"system\",\"created\":\"2026-06-05T22:10:06.669Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"backup-and-restore\":{\"name\":\"backup-and-restore\",\"description\":\"How to backup, restore, and export WebX11 data\",\"tags\":[\"backup\",\"restore\",\"export\",\"import\",\"persistence\"],\"category\":\"system\",\"created\":\"2026-06-05T22:10:06.669Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"mindmap-workflow\":{\"name\":\"mindmap-workflow\",\"description\":\"How to create, view, edit, and manage brainstorming mindmaps\",\"tags\":[\"mindmap\",\"brainstorming\",\"planning\",\"organization\"],\"category\":\"productivity\",\"created\":\"2026-06-05T22:10:06.669Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"skills-system-guide\":{\"name\":\"skills-system-guide\",\"description\":\"How to use the skills system: load, create, patch, list, and audit skills for persistent procedural memory\",\"tags\":[\"skills\",\"system\",\"meta\"],\"category\":\"system\",\"created\":\"2026-06-05T22:10:06.669Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"agent-orchestration\":{\"name\":\"agent-orchestration\",\"description\":\"How to use the agent registry, leases, and orchestrator for multi-agent workflows\",\"tags\":[\"agents\",\"orchestration\",\"delegation\",\"leases\"],\"category\":\"system\",\"created\":\"2026-06-05T22:10:06.670Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"debug-panel-and-logs\":{\"name\":\"debug-panel-and-logs\",\"description\":\"How to use the debug panel, session logging, and terminal diagnostics\",\"tags\":[\"debug\",\"logging\",\"diagnostics\",\"troubleshooting\"],\"category\":\"system\",\"created\":\"2026-06-05T22:10:06.670Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"webdav-operations\":{\"name\":\"webdav-operations\",\"description\":\"How to use WebDAV cloud storage for backup, file sync, and remote file access\",\"tags\":[\"webdav\",\"cloud\",\"backup\",\"sync\",\"storage\"],\"category\":\"system\",\"created\":\"2026-06-05T22:10:06.670Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"security-and-safety\":{\"name\":\"security-and-safety\",\"description\":\"How to use WebX11 security levels, command blocking, and safety features\",\"tags\":[\"security\",\"safety\",\"blocking\",\"permissions\"],\"category\":\"system\",\"created\":\"2026-06-05T22:10:06.670Z\",\"updated\":\"2026-06-05T22:13:42.539Z\"},\"mindmap-user-guide\":{\"name\":\"mindmap-user-guide\",\"description\":\"How to create, view, and manage brainstorming mindmaps using the mindmap terminal module\",\"tags\":[\"mindmap\",\"brainstorming\",\"organization\",\"planning\"],\"category\":\"productivity\",\"created\":\"2026-06-05T22:14:44.807Z\",\"updated\":\"2026-06-05T22:14:44.807Z\"}}","modified":"2026-06-05T22:16:17.805Z"},"mindmap-user-guide.md":{"type":"file","content":"---\nname: mindmap-user-guide\ndescription: How to create, view, and manage brainstorming mindmaps using the mindmap terminal module\ntags: [mindmap, brainstorming, organization, planning]\ncategory: productivity\n---\n## Steps\n\n1. **Create a new mindmap:**\n - `mindmap new \"<topic>\" -t tag1,tag2` — creates a root node\n - Tags are optional (e.g. planning, research, dev)\n - Root gets auto-assigned a color\n\n2. **Add child nodes:**\n - `mindmap add <parent-id> \"<idea>\" -t tag` — add a child\n - Get the parent-id from `mindmap show`\n - IDs are 4-char random strings (e.g. a3f8, x7k2)\n\n3. **View the mindmap:**\n - `mindmap show` — full tree with Unicode box-drawing\n - `mindmap show <id>` — subtree starting at that node\n\n4. **Edit nodes:**\n - `mindmap rename <id> \"<new text>\"` — change text\n - `mindmap color <id> <color>` — set color (red/green/yellow/blue/cyan/magenta/white)\n - `mindmap tag <id> <tag>` — add a tag\n\n5. **Persistence:**\n - `mindmap save <name>` — save to localStorage\n - `mindmap load <name>` — restore\n - `mindmap list` — show saved mindmaps\n - `mindmap delete <name>` — remove saved\n\n6. **Export:**\n - `mindmap export [id]` — Markdown bullet list output\n\n## When to use\n- User wants to brainstorm, organize ideas, plan features\n- User says \"map out\", \"diagram\", \"brainstorm\", \"organize thoughts\"\n- Visualizing project structure or task decomposition","modified":"2026-06-05T22:14:44.807Z"},"_seeded":{"type":"file","content":"1","modified":"2026-06-05T22:14:44.808Z"}}},"logs":{"type":"dir","content":{"current.log":{"type":"file","content":"[22:10:06][INFO][System] WebX11 v4.2 started\n[22:10:06][INFO][System] Default model: gemma4:31b-cloud\n[22:10:06][WARN][Ollama] Ollama endpoint http://localhost:11434 failed: Failed to fetch\n[22:10:07][INFO][Ollama] Connected to Ollama at https://webx11.duckdns.org/ollama/ with 82 model(s)\n[22:13:42][INFO][System] WebX11 v4.2 started\n[22:13:42][INFO][System] Default model: minimax-m2.5:cloud\n[22:13:42][INFO][Ollama] Connected to Ollama at https://webx11.duckdns.org/ollama/ with 82 model(s)\n[22:14:46][INFO][AI] Query: filed\n[22:14:46][INFO][AI] Used 1 tool(s)\n[22:15:45][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:15:45][INFO][AI] Tool get_status ok (0s)\n[22:15:47][INFO][Ollama] chatWithTools round-trip: 2s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:15:47][INFO][AI] Tool get_help ok (0s)\n[22:15:52][INFO][Ollama] chatWithTools round-trip: 5s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:15:52][INFO][AI] Query: setup system\n[22:15:52][INFO][AI] Used 3 tool(s)\n[22:16:57][INFO][Ollama] chatWithTools round-trip: 7s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:16:57][INFO][AI] Tool load_skills ok (0s)\n[22:17:00][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:17:00][INFO][AI] Tool get_status ok (0s)\n[22:17:15][INFO][Ollama] chatWithTools round-trip: 14s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:17:16][INFO][AI] Tool run_command ok (0s)\n[22:17:19][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:17:19][INFO][AI] Tool get_help ok (0s)\n[22:17:23][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:17:25][INFO][AI] Tool run_command ok (0s)\n[22:17:28][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:17:30][INFO][AI] Tool run_command ok (0s)\n[22:17:32][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:17:32][INFO][AI] Tool list_files ok (0s)\n[22:17:35][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:17:37][INFO][AI] Tool run_command ok (0s)\n[22:17:37][INFO][AI] Query: setop nueralvfs\n[22:17:37][INFO][AI] Used 8 tool(s)\n[22:17:59][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:17:59][INFO][AI] Tool get_help ok (0s)\n[22:18:02][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:18:04][INFO][AI] Tool run_command ok (0s)\n[22:18:06][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:18:09][INFO][AI] Tool run_command ok (0s)\n[22:18:13][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:18:13][INFO][AI] Query: setup memory graph\n[22:18:13][INFO][AI] Used 4 tool(s)\n[22:18:58][INFO][Ollama] chatWithTools round-trip: 5s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:19:00][INFO][AI] Tool run_command ok (0s)\n[22:19:06][INFO][Ollama] chatWithTools round-trip: 6s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:19:07][INFO][AI] Tool run_command ok (0s)\n[22:19:09][INFO][Ollama] chatWithTools round-trip: 2s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:19:09][INFO][AI] Tool get_help ok (0s)\n[22:19:13][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:19:15][INFO][AI] Tool run_command ok (0s)\n[22:19:21][INFO][Ollama] chatWithTools round-trip: 7s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:19:21][INFO][AI] Query: when ll it populate?\n[22:19:21][INFO][AI] Used 5 tool(s)\n[22:20:14][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:20:16][INFO][AI] Tool run_command ok (0s)\n[22:20:20][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:20:22][INFO][AI] Tool run_command ok (0s)\n[22:20:27][INFO][Ollama] chatWithTools round-trip: 5s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:20:29][INFO][AI] Tool run_command ok (0s)\n[22:20:34][INFO][Ollama] chatWithTools round-trip: 5s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:20:34][INFO][AI] Query: ok lets test if it teslly work?\n[22:20:34][INFO][AI] Used 4 tool(s)\n[22:21:25][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:21:25][INFO][AI] Tool session_stats ok (0s)\n[22:21:28][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:21:28][INFO][AI] Tool get_status ok (0s)\n[22:21:32][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:21:34][INFO][AI] Tool run_command ok (0s)\n[22:21:37][INFO][Ollama] chatWithTools round-trip: 2s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:21:37][INFO][AI] Tool get_help ok (0s)\n[22:21:39][INFO][Ollama] chatWithTools round-trip: 2s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:21:41][INFO][AI] Tool run_command ok (0s)\n[22:21:44][INFO][Ollama] chatWithTools round-trip: 2s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:21:46][INFO][AI] Tool run_command ok (0s)\n[22:21:51][INFO][Ollama] chatWithTools round-trip: 5s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:21:53][INFO][AI] Tool run_command ok (0s)\n[22:21:56][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:21:58][INFO][AI] Tool run_command ok (0s)\n[22:21:58][INFO][AI] Query: no but last sessin was long and graph remained empty\n[22:21:58][INFO][AI] Used 8 tool(s)\n[22:22:25][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:22:25][INFO][AI] Tool session_stats ok (0s)\n[22:22:28][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:22:30][INFO][AI] Tool run_command ok (0s)\n[22:22:33][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:22:36][INFO][AI] Tool run_command ok (0s)\n[22:22:38][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:22:40][INFO][AI] Tool run_command ok (0s)\n[22:22:44][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:22:44][INFO][AI] Tool get_status ok (0s)\n[22:22:46][INFO][Ollama] chatWithTools round-trip: 2s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:22:49][INFO][AI] Tool run_command ok (0s)\n[22:22:53][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:22:53][INFO][AI] Tool get_module_status ok (0s)\n[22:22:57][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:22:57][INFO][AI] Tool view_module ok (0s)\n[22:22:58][INFO][AI] Query: what do you think\n[22:22:58][INFO][AI] Used 8 tool(s)\n[22:24:49][INFO][AI] Tool run_command ok (0s)\n[22:24:52][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\n[22:24:54][INFO][AI] Tool run_command ok (0s)\n[22:24:54][INFO][AI] Query: suggestions\n[22:24:54][INFO][AI] Used 8 tool(s)\n","modified":"2026-06-05T22:24:54.834Z"},"_sessions":{"type":"dir","content":{"_auto-context.json":{"type":"file","content":"{\"context\":[{\"role\":\"user\",\"content\":\"setup system\"},{\"role\":\"assistant\",\"content\":\"The system appears already set up:\\n- **39 modules** loaded\\n- **Ollama** connected (minimax-m2.5:cloud) \\n- **24.8MB** memory in use\\n\\nWhat would you like to configure? Some options:\\n\\n- **Modules** - `modules-list`, `listmods`, `loadmod`\\n- **AI Model** - `ai-model`, `ollamasetmodel`\\n- **Storage** - `vfs-import`, `webdav-config`\\n- **Skills** - `skill-list`, `skill-create`\\n- **Config** - `config-list`, `config-set`\\n- **Health** - `system-health`, `health-check`\\n\\nOr describe what you're trying to accomplish and I can help.\"},{\"role\":\"user\",\"content\":\"setop nueralvfs\"},{\"role\":\"user\",\"content\":\"setup memory graph\"},{\"role\":\"assistant\",\"content\":\"**Current Status:**\\n\\n| Feature | Status |\\n|---------|--------|\\n| **Neural VFS** | ✅ Indexed (72 concepts, 19 files) |\\n| **Memory Graph** | 🆕 Empty (builds as you use system) |\\n\\nThe Neural VFS index is already built. The memory graph auto-populates as you work — every command and interaction gets tracked in the graph for smarter context awareness.\\n\\nTo rebuild/refresh the index:\\n```\\nnvfs-index\\n```\\n\\nTo see graph in action:\\n```\\nmemgraph-stats\\nmemgraph-search <query>\\n```\"},{\"role\":\"user\",\"content\":\"when ll it populate?\"},{\"role\":\"assistant\",\"content\":\"**It populates as you use the system.**\\n\\nThe memory graph starts empty (0 nodes, 0 edges). As you work, it automatically tracks:\\n\\n- **Commands** you run\\n- **Files** you read/write\\n- **AI interactions** (this conversation)\\n- **Concepts** you search for\\n\\nJust use the terminal normally — it builds automatically. Each `run_command`, `read_file`, `write_file`, etc. adds nodes and edges.\\n\\nTo force an initial index of your current work:\\n```bash\\nnvfs-index\\n```\\n\\nThat will scan existing files and concepts to populate faster.\"},{\"role\":\"user\",\"content\":\"ok lets test if it teslly work?\"},{\"role\":\"assistant\",\"content\":\"**It works!** Here's the test:\\n\\n| Test | Result |\\n|------|--------|\\n| `nvfs-index` | ✅ Indexed 19 files → 71 concepts |\\n| `memgraph-stats` | Empty (tracks usage over time) |\\n\\n**They're separate systems:**\\n\\n1. **Neural VFS** (`nvfs-*`) — indexes your files by concept. ✅ *Working now*\\n2. **Memory Graph** (`memgraph-*`) — tracks your terminal usage. ⏳ *Builds as you type commands*\\n\\nThe graph auto-populates as you use the terminal. Keep using it and it will fill up. Try:\\n```\\nmemgraph-search <something>\\n```\\n\\nOr just use the terminal normally — it'll grow automatically. Want me to create a skill to remind you how to check it?\"},{\"role\":\"user\",\"content\":\"no but last sessin was long and graph remained empty\"},{\"role\":\"user\",\"content\":\"what do you think\"},{\"role\":\"user\",\"content\":\"suggestions\"}],\"messageCount\":9,\"savedAt\":1780698294834}","modified":"2026-06-05T22:24:54.834Z"},"_auto.json":{"type":"file","content":"{\"type\":\"session\",\"savedAt\":\"2026-06-05T22:20:11.966Z\",\"fsRoot\":{\"type\":\"dir\",\"content\":{\"skills\":{\"type\":\"dir\",\"content\":{\"navigating-the-terminal.md\":{\"type\":\"file\",\"content\":\"---\\nname: navigating-the-terminal\\ndescription: How to explore the WebX11 terminal, find commands, check status, and navigate the filesystem\\ntags: [terminal, navigation, help, filesystem]\\ncategory: system\\n---\\n## Steps\\n1. **Get an overview of available commands:**\\n - Type \\\"help\\\" for a full command list sorted by category\\n - Type \\\"status\\\" to see filesystem state, loaded modules, Ollama status\\n - For a specific command, use help <command>\\n - Type \\\"commands\\\" for a compact list with module source info\\n - Type \\\"check\\\" for system health including module requirements\\n\\n2. **Explore the filesystem:**\\n - Use ls, ll, tree to browse directories\\n - Use cd <dir> to navigate, pwd to show current path\\n - Use cat or edit to view file contents\\n - Use find or grep to search files\\n - Use du to see disk usage\\n\\n3. **Understand system state:**\\n - mem — memory usage (auto-shown in header on boot)\\n - status — network, files, modules, Ollama\\n - modules — module manager GUI\\n - health-check — VFS size, modules, logs, trash, skills, tool failures\\n - checkpoint-list — VFS checkpoint snapshots\\n\\n4. **Agent / Orchestration state:**\\n - agent-list — registered agents (type, capabilities, status)\\n - orchestrate — list active orchestrated agents\\n - lease-list — show active leases with TTL\\n\\n5. **When user asks a vague question:**\\n - First run status and help to understand the current state\\n - Then ask clarifying questions based on what you found\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"memory-and-profile.md\":{\"type\":\"file\",\"content\":\"---\\nname: memory-and-profile\\ndescription: How to use the user profile system, session memory, and pattern tracking for persistent context\\ntags: [memory, profile, session, persistence]\\ncategory: system\\n---\\n## Steps\\n1. **User Profile (persists across sessions):**\\n - user_get(key) — read any profile field (e.g. \\\"preferredModel\\\", \\\"fontSize\\\")\\n - user_set(key, value) — write to profile, auto-persists to localStorage\\n - user_list — show all stored profile keys\\n - user_forget(key) — delete a profile key\\n - Dot notation supported: user_set knownFacts.name \\\"Alex\\\"\\n\\n2. **Session Memory (VFS-based daily logs):**\\n - session_save(summary) — save a summary of what was accomplished\\n - session_load(date) — read a specific day's log (format: YYYY-MM-DD)\\n - session_recent(count) — show last N session summaries\\n - session_stats — aggregate totals across all sessions\\n - Recent sessions auto-load into context on first message\\n - systemd-style journal: use logs and logrotate commands for persistent logging\\n\\n3. **Conversation Patterns:**\\n - Pattern tracking runs automatically — frequent topics surface as hints\\n - my-set, my-get, my-list store additional personal data\\n - AI conversation context persists within a session (use ai-clear to reset)\\n - debug command toggles real-time debug panel with Copy/Export/VFS buttons\\n\\n4. **Checkpoints (VFS snapshots):**\\n - checkpoint [name] — snapshot current VFS state\\n - checkpoint-list — list all checkpoints\\n - rollback <name> — restore from checkpoint\\n - checkpoint-del <name> — delete a checkpoint\\n\\n5. **When to use:**\\n - At start: call session_recent(3) to see what was worked on before\\n - After identifying user preferences: call user_set to store them\\n - After complex tasks: call session_save with a brief summary\\n - Before risky edits: call checkpoint to create a restore point\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"web-search-and-fetch.md\":{\"type\":\"file\",\"content\":\"---\\nname: web-search-and-fetch\\ndescription: How to search the web and fetch URL content using the WebX11 proxy API\\ntags: [search, fetch, web, proxy, api]\\ncategory: research\\n---\\n## Steps\\n1. **Search the web:**\\n - Use search <query> or web_search(query) — uses /api/search which queries SearXNG + DDG fallback\\n - Results include: title, url, content snippet, source engine\\n - Always available (same-origin, no CORS issues)\\n - 5-minute server-side cache for repeated queries\\n - Alternative: use ddg or duck <query> for DuckDuckGo direct, or s <query> as alias\\n\\n2. **Fetch URL content:**\\n - Use fetch <url> or web_fetch(url) — uses /api/extract which strips HTML, extracts clean text\\n - Returns: title, content (up to 4000 chars), word_count, extraction method\\n - SSRF protection blocks internal network addresses\\n - 15-minute server-side cache\\n\\n3. **Search flags (via terminal search command):**\\n - search <query> --summarize — adds AI-generated overview via Ollama\\n - search <query> --fetch — fetches content snippets for top 3 results\\n\\n4. **When to use:**\\n - User asks about current events, facts, research → use search <query>\\n - User says \\\"read this article\\\" or provides a URL → use fetch <url>\\n - For in-depth analysis: search first, then fetch top results\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"module-management.md\":{\"type\":\"file\",\"content\":\"---\\nname: module-management\\ndescription: How to view, edit, test, reload modules and manage startup configuration\\ntags: [modules, editing, code, self-improvement]\\ncategory: dev\\n---\\n## Steps\\n1. **View module source:**\\n - view_module(name) — fetches original source or reads from _mods/ if edited\\n - Supports all loaded modules: SystemModule, FileSystemModule, SearXNGModule, etc.\\n - Or use modules command for GUI module manager\\n\\n2. **Edit a module:**\\n - edit_module(name) — copies source to _mods/<name>.js and opens code editor\\n - Editor shows the full source in a textarea\\n - Click \\\"Save & Test\\\" to save and auto-load the edited version\\n - Checkpoint before editing: checkpoint mod-edit-<name>\\n\\n3. **Test and reload:**\\n - test_module(name) — loads edited module from _mods/ for live testing\\n - reload_module(name) — discards edits and reloads from original URL\\n - list_modified_modules — shows all modules with pending edits\\n\\n4. **Check for updates:**\\n - check_updates — HEAD-requests all loaded module URLs to verify reachability\\n\\n5. **Manage startup:**\\n - startup-modules — opens the Startup Modules UI to select which modules load\\n - load-local <path> — load a module from VFS or URL without editing\\n - loadmod <url> — alternative: load module from URL\\n - removemod <name> — remove a loaded module\\n\\n6. **Agent modules (Phase 2):**\\n - module-agent-registry.js — Agent registry with agent-list, agent-register, agent-unregister, agent-status\\n - module-leases.js — Time-bound contracts with 5s watchdog, auto-expiry\\n - module-orchestrator.js — Spawn, delegate, kill, purge with heartbeat monitoring\\n\\n7. **When to use:**\\n - User reports a bug in a module → view_module, edit_module, test_module\\n - User asks \\\"can you add X feature?\\\" → same workflow\\n - Always save edits before testing. If test fails, the original module stays loaded.\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"system-maintenance.md\":{\"type\":\"file\",\"content\":\"---\\nname: system-maintenance\\ndescription: How to reset, troubleshoot, and maintain the WebX11 terminal\\ntags: [system, maintenance, reset, troubleshoot, config]\\ncategory: system\\n---\\n## Steps\\n1. **Factory reset (wipes everything):**\\n - factory-reset --confirm — clears all webx11_ localStorage keys, resets VFS, reloads\\n - Use only when the system is in an unrecoverable state\\n\\n2. **Soft VFS reset:**\\n - reset-vfs --confirm — clears only the filesystem, preserves settings/profile/modules\\n\\n3. **Config management:**\\n - config-list — show all config keys and values\\n - config-set <key> <value> — set a config value\\n - config-delete <key> — remove a config key\\n - config-export — dump all config as JSON\\n - config-reset — restore defaults (use before factory-reset if you want to save data)\\n\\n4. **Security level:**\\n - security-level <0-3> — set security level (0=Permissive, 1=Standard, 2=Paranoid, 3=Audit)\\n - security — show current security level, blocked count, and stats\\n - cmd-allow <cmd> — whitelist a command from security checks\\n - cmd-deny <cmd> — blacklist a command\\n\\n5. **Health checks (run automatically after complex tasks):**\\n - Check module loading status: loaded vs total\\n - Check for pending module edits\\n - Check memory usage (high if >100MB)\\n - Check skill count (0 skills after 2+ tool calls → suggest create_skill)\\n - health-check — full audit: VFS size, modules, logs, trash, skills, tool failures\\n\\n6. **Font size and display:**\\n - font-size <8-32> — set terminal font size, persists across sessions\\n - setfont — alias for font-size\\n\\n7. **Checkpoints:**\\n - checkpoint [name] — snapshot current VFS state\\n - checkpoint-list — list all checkpoints\\n - rollback <name> — restore from checkpoint\\n\\n8. **When to use:**\\n - System is slow or modules fail to load → check check_updates, mem\\n - User says \\\"reset everything\\\" → factory-reset --confirm\\n - User says \\\"clear my files but keep settings\\\" → reset-vfs --confirm\\n - User reports security concerns → security-level or cmd-allow/cmd-deny\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"backup-and-restore.md\":{\"type\":\"file\",\"content\":\"---\\nname: backup-and-restore\\ndescription: How to backup, restore, and export WebX11 data\\ntags: [backup, restore, export, import, persistence]\\ncategory: system\\n---\\n## Steps\\n1. **Backup VFS:**\\n - vfs-export — downloads the entire virtual filesystem as a dated JSON file\\n - backup — creates a full backup including VFS, modules, config (saves to _backups/)\\n\\n2. **WebDAV cloud backup:**\\n - webdav-backup — push VFS snapshot to WebDAV server (auto-archive)\\n - webdav-backup-list — list remote WebDAV backups\\n - webdav-restore <file> — restore VFS from remote WebDAV snapshot\\n - webdav-push <local> <remote> — push file to WebDAV space\\n - webdav-pull <remote> <local> — pull file from WebDAV space\\n - webdav-ls [path] — list remote WebDAV directory contents\\n - webdav-status — check WebDAV connection and space usage\\n - webdav-explorer — GUI file browser for WebDAV\\n - webdav-browser — simpler file listing for WebDAV\\n - webdav-config — configure WebDAV endpoint and credentials\\n\\n3. **Export/Import personal data:**\\n - my-export — prints all my-set data as formatted JSON\\n - my-import <json> — bulk-import personal data from JSON string\\n\\n4. **Export/Import modules:**\\n - export-mods — exports module registry as JSON\\n - import-mods <json> — imports modules from JSON backup\\n\\n5. **Restore:**\\n - restore <json> — restores terminal state from a backup JSON\\n - Session logs are saved to /memory/ automatically on page unload\\n\\n6. **When to use:**\\n - Before factory-reset: call my-export, vfs-export, export-mods to save data\\n - When switching browsers or devices: export all, then import\\n - User says \\\"backup my data\\\" or \\\"save my files\\\"\\n - For cloud backup: use webdav-backup (requires WebDAV server configured)\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"mindmap-workflow.md\":{\"type\":\"file\",\"content\":\"---\\nname: mindmap-workflow\\ndescription: How to create, view, edit, and manage brainstorming mindmaps\\ntags: [mindmap, brainstorming, planning, organization]\\ncategory: productivity\\n---\\n## Steps\\n1. **Create a new mindmap:**\\n - mindmap new \\\"<topic>\\\" -t tag1,tag2 — creates a root node\\n - Tags are optional (e.g. planning, research, dev)\\n - Root gets auto-assigned a color from 7-color palette\\n\\n2. **Add child nodes:**\\n - mindmap add <parent-id> \\\"<idea>\\\" -t tag — add a child\\n - Get the parent-id from mindmap show\\n - IDs are 4-char random strings (e.g. a3f8, x7k2)\\n\\n3. **View:**\\n - mindmap show — full tree with Unicode box-drawing\\n - mindmap show <id> — subtree starting at that node\\n\\n4. **Edit nodes:**\\n - mindmap rename <id> \\\"<new text>\\\" — change text\\n - mindmap color <id> <color> — set color (red/green/yellow/blue/cyan/magenta/white)\\n - mindmap tag <id> <tag> — add a tag\\n\\n5. **Persistence:**\\n - mindmap save <name> — save to localStorage\\n - mindmap load <name> — restore\\n - mindmap list — show saved mindmaps\\n - mindmap delete <name> — remove saved\\n\\n6. **Export:**\\n - mindmap export [id] — Markdown bullet list output, auto-copies to clipboard\\n\\n7. **When to use:**\\n - Map out project structure, brainstorm features, organize ideas\\n - Break down complex tasks into subtrees\\n - User says \\\"brainstorm\\\", \\\"diagram\\\", \\\"organize thoughts\\\", \\\"plan\\\"\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"skills-system-guide.md\":{\"type\":\"file\",\"content\":\"---\\nname: skills-system-guide\\ndescription: How to use the skills system: load, create, patch, list, and audit skills for persistent procedural memory\\ntags: [skills, system, meta]\\ncategory: system\\n---\\n## Steps\\n1. **Always load skills at task start:**\\n - At the START of every task, type or call \\\"skill-view <name>\\\" or \\\"skill-list\\\"\\n - Example: skill-view \\\"module-management\\\" — returns matching skill content\\n - Example: skill-list system — browse skills by category\\n\\n2. **Create skills after complex tasks:**\\n - After any task with 3+ tool calls, call \\\"skill-create\\\"\\n - Required fields: name (kebab-case), description, content (markdown with YAML frontmatter)\\n - Optional: tags (comma-separated), category (e.g. research, system, dev)\\n - Skills persist in /skills/ as .md files with /skills/index.json for fast lookup\\n - Skill pack auto-seeds 8 core skills on first boot\\n\\n3. **Patch skills when they're outdated:**\\n - If a stored procedure has wrong steps, call \\\"skill-patch <name>\\\"\\n - This replaces the entire skill content and updates the index\\n - Do NOT create a duplicate — always patch the existing skill\\n\\n4. **Auto-created error skills:**\\n - If the same tool fails 3+ times, a workaround skill is created automatically\\n - Named tool-<name>-workaround (e.g. tool-write_file-workaround)\\n\\n5. **Audit and maintenance:**\\n - skill-list <category?> — browse available skills, optionally filter\\n - skill-export <name> — download a skill as markdown\\n - skill-import <json> — bulk import skills\\n - skill-sync — re-index skills from /skills/ directory\\n - Skills are audited every 20 messages for staleness (empty content, >30 days old)\\n\\n6. **YAML frontmatter format:**\\n - Each skill file must start with: ---\\\\nname: <name>\\\\ndescription: <text>\\\\ntags: [...]\\\\ncategory: <cat>\\\\n---\\\\n\\n - Steps follow under ## Steps heading\\n - Use numbered lists for sequential steps\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"agent-orchestration.md\":{\"type\":\"file\",\"content\":\"---\\nname: agent-orchestration\\ndescription: How to use the agent registry, leases, and orchestrator for multi-agent workflows\\ntags: [agents, orchestration, delegation, leases]\\ncategory: system\\n---\\n## Steps\\n1. **Agent Registry:**\\n - agent-list — list all registered agents (ID, type, capabilities, status)\\n - agent-register <type> <capabilities> — register a new agent (capabilities: comma-separated like \\\"code,research\\\")\\n - agent-unregister <id> — remove an agent\\n - agent-status <id> — detailed status including uptime, task history\\n\\n2. **Leases (time-bound contracts):**\\n - lease-create <agent-id> <ttl-seconds> — create a lease with watchdog timer\\n - lease-list — show active leases with remaining TTL\\n - lease-revoke <lease-id> — terminate a lease early\\n - lease-renew <lease-id> <ttl-seconds> — extend a lease\\n\\n3. **Orchestrator (spawn, delegate, kill):**\\n - orchestrator-spawn <type> <capabilities> — spawn a new agent automatically (registers + creates lease)\\n - orchestrator-kill <agent-id> — kill an agent (revokes lease + unregisters)\\n - orchestrate — list all active agents with their orchestrator state\\n - orchestrator-purge — kill all idle/expired agents\\n - orchestrator-status — full system status: active, idle, dead agents\\n\\n4. **AI tool integration:**\\n - AI tools list_agents, delegate_task, spawn_agent are available in the AI system prompt\\n - The AI can auto-spawn worker agents for sub-tasks\\n - Each agent gets its own VFS workspace at /agents/<agent-id>/\\n\\n5. **When to use:**\\n - User needs parallel task execution → orchestrator-spawn coder + researcher\\n - Time-bound automation → lease-create with short TTL\\n - System cleanup → orchestrator-purge to kill stale agents\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"debug-panel-and-logs.md\":{\"type\":\"file\",\"content\":\"---\\nname: debug-panel-and-logs\\ndescription: How to use the debug panel, session logging, and terminal diagnostics\\ntags: [debug, logging, diagnostics, troubleshooting]\\ncategory: system\\n---\\n## Steps\\n1. **Toggle debug panel:**\\n - debug — opens real-time debug panel showing last AI tool call, response time, and context\\n - Debug panel includes Copy, Export, and Write to VFS buttons\\n - Export: saves tool call log as timestamped JSON to downloads\\n - Write to VFS: appends debug data to /debug.log (dedup by turn ID)\\n\\n2. **Session logging:**\\n - logs [n] [LEVEL] — view last n log entries (optionally filtered by INFO/WARN/ERROR)\\n - logrotate — rotate current.log to dated archive (auto-cleans old logs beyond 10)\\n - Logs stored in /logs/ directory: current.log + dated archives\\n - Health check runs automatically after complex tasks\\n\\n3. **Diagnostic commands:**\\n - health-check — full audit: VFS size, modules, logs, trash, skills\\n - check — quick system health including module requirement status\\n - mem — real-time memory usage (also in header)\\n - status — network, files, modules, Ollama connectivity\\n\\n4. **System journals:**\\n - debug.log — appended by debug panel VFS button (dedup by turn ID)\\n - current.log — system activity log with rotation\\n - Auto-save: terminal state auto-saves every 60s\\n\\n5. **When to use:**\\n - AI is behaving unexpectedly → debug to see tool calls\\n - User reports errors → logs 50 ERROR to see error entries\\n - Memory concerns → mem to check, health-check for full audit\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"webdav-operations.md\":{\"type\":\"file\",\"content\":\"---\\nname: webdav-operations\\ndescription: How to use WebDAV cloud storage for backup, file sync, and remote file access\\ntags: [webdav, cloud, backup, sync, storage]\\ncategory: system\\n---\\n## Steps\\n1. **Configuration:**\\n - webdav-config — configure WebDAV endpoint URL and credentials\\n - Connection auto-tested on config; webdav-status shows connection health\\n - Uses per-user token stored in .token file on the server side\\n\\n2. **File operations:**\\n - webdav-ls [path] — list remote directory contents\\n - webdav-push <local-path> <remote-path> — upload file to WebDAV\\n - webdav-pull <remote-path> [local-path] — download file from WebDAV\\n - webdav-explorer — GUI file browser for WebDAV\\n - webdav-browser — CLI file browser for WebDAV\\n\\n3. **Backup & Restore:**\\n - webdav-backup — push full VFS snapshot to WebDAV (creates /backups/newos4-<date>.json)\\n - webdav-backup-list — list all remote backup snapshots\\n - webdav-restore <filename> — restore VFS from a remote backup snapshot\\n\\n4. **Status & Diagnostics:**\\n - webdav-status — connection status, last sync, space information\\n - If uploads fail: check webdav-config, ensure .token file is valid\\n - WebDAV runs on the same server (nginx with WebDAV module), no external dependency\\n\\n5. **When to use:**\\n - Before factory-reset: webdav-backup to store VFS remotely\\n - Cross-browser: webdav-push/pull to move files between instances\\n - User says \\\"cloud backup\\\" or \\\"remote save\\\" → webdav-backup\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"security-and-safety.md\":{\"type\":\"file\",\"content\":\"---\\nname: security-and-safety\\ndescription: How to use WebX11 security levels, command blocking, and safety features\\ntags: [security, safety, blocking, permissions]\\ncategory: system\\n---\\n## Steps\\n1. **Security levels:**\\n - security-level <0-3> — set security level:\\n 0 = Permissive (no blocks, no confirms — anything runs)\\n 1 = Standard (unknown cmds → AI route, destructive → confirm, system → block)\\n 2 = Paranoid (unknown cmds blocked entirely, destructive blocked)\\n 3 = Audit (everything allowed, everything logged)\\n - Default: level 1\\n - security — show current level, blocked count, and stats\\n\\n2. **Command control:**\\n - cmd-allow <cmd> — whitelist a command from security checks\\n - cmd-deny <cmd> — blacklist/block a command entirely\\n - whitelist built-in: help, clear, ls, cat, pwd, whoami, df, free, top, ps, echo, date, env, history\\n\\n3. **What gets blocked at each level:**\\n - Unknown commands: Level 1 → AI routed, Level 2+ → blocked\\n - Destructive commands (delete, write, save, format, etc.): Level 1 → confirmation, Level 2+ → blocked\\n - System commands (reboot, shutdown, format, kill): Level 1+ → blocked\\n - Suspicious flags (--execute, --eval, --shell): Level 1+ → blocked\\n\\n4. **Safety checklist:**\\n - Check security: security shows your current level\\n - Before running risky commands: create a checkpoint first\\n - For temporary relax: security-level 0, then restore to 1\\n - For total lockdown before leaving: security-level 2\\n\\n5. **When to use:**\\n - User wants to lock down the terminal → security-level 2\\n - User wants to allow a blocked command → cmd-allow <cmd>\\n - Debugging strange behavior → verify security-level (user may have set it higher)\",\"modified\":\"2026-06-05T22:13:42.539Z\"},\"index.json\":{\"type\":\"file\",\"content\":\"{\\\"navigating-the-terminal\\\":{\\\"name\\\":\\\"navigating-the-terminal\\\",\\\"description\\\":\\\"How to explore the WebX11 terminal, find commands, check status, and navigate the filesystem\\\",\\\"tags\\\":[\\\"terminal\\\",\\\"navigation\\\",\\\"help\\\",\\\"filesystem\\\"],\\\"category\\\":\\\"system\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.669Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"memory-and-profile\\\":{\\\"name\\\":\\\"memory-and-profile\\\",\\\"description\\\":\\\"How to use the user profile system, session memory, and pattern tracking for persistent context\\\",\\\"tags\\\":[\\\"memory\\\",\\\"profile\\\",\\\"session\\\",\\\"persistence\\\"],\\\"category\\\":\\\"system\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.669Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"web-search-and-fetch\\\":{\\\"name\\\":\\\"web-search-and-fetch\\\",\\\"description\\\":\\\"How to search the web and fetch URL content using the WebX11 proxy API\\\",\\\"tags\\\":[\\\"search\\\",\\\"fetch\\\",\\\"web\\\",\\\"proxy\\\",\\\"api\\\"],\\\"category\\\":\\\"research\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.669Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"module-management\\\":{\\\"name\\\":\\\"module-management\\\",\\\"description\\\":\\\"How to view, edit, test, reload modules and manage startup configuration\\\",\\\"tags\\\":[\\\"modules\\\",\\\"editing\\\",\\\"code\\\",\\\"self-improvement\\\"],\\\"category\\\":\\\"dev\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.669Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"system-maintenance\\\":{\\\"name\\\":\\\"system-maintenance\\\",\\\"description\\\":\\\"How to reset, troubleshoot, and maintain the WebX11 terminal\\\",\\\"tags\\\":[\\\"system\\\",\\\"maintenance\\\",\\\"reset\\\",\\\"troubleshoot\\\",\\\"config\\\"],\\\"category\\\":\\\"system\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.669Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"backup-and-restore\\\":{\\\"name\\\":\\\"backup-and-restore\\\",\\\"description\\\":\\\"How to backup, restore, and export WebX11 data\\\",\\\"tags\\\":[\\\"backup\\\",\\\"restore\\\",\\\"export\\\",\\\"import\\\",\\\"persistence\\\"],\\\"category\\\":\\\"system\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.669Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"mindmap-workflow\\\":{\\\"name\\\":\\\"mindmap-workflow\\\",\\\"description\\\":\\\"How to create, view, edit, and manage brainstorming mindmaps\\\",\\\"tags\\\":[\\\"mindmap\\\",\\\"brainstorming\\\",\\\"planning\\\",\\\"organization\\\"],\\\"category\\\":\\\"productivity\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.669Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"skills-system-guide\\\":{\\\"name\\\":\\\"skills-system-guide\\\",\\\"description\\\":\\\"How to use the skills system: load, create, patch, list, and audit skills for persistent procedural memory\\\",\\\"tags\\\":[\\\"skills\\\",\\\"system\\\",\\\"meta\\\"],\\\"category\\\":\\\"system\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.669Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"agent-orchestration\\\":{\\\"name\\\":\\\"agent-orchestration\\\",\\\"description\\\":\\\"How to use the agent registry, leases, and orchestrator for multi-agent workflows\\\",\\\"tags\\\":[\\\"agents\\\",\\\"orchestration\\\",\\\"delegation\\\",\\\"leases\\\"],\\\"category\\\":\\\"system\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.670Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"debug-panel-and-logs\\\":{\\\"name\\\":\\\"debug-panel-and-logs\\\",\\\"description\\\":\\\"How to use the debug panel, session logging, and terminal diagnostics\\\",\\\"tags\\\":[\\\"debug\\\",\\\"logging\\\",\\\"diagnostics\\\",\\\"troubleshooting\\\"],\\\"category\\\":\\\"system\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.670Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"webdav-operations\\\":{\\\"name\\\":\\\"webdav-operations\\\",\\\"description\\\":\\\"How to use WebDAV cloud storage for backup, file sync, and remote file access\\\",\\\"tags\\\":[\\\"webdav\\\",\\\"cloud\\\",\\\"backup\\\",\\\"sync\\\",\\\"storage\\\"],\\\"category\\\":\\\"system\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.670Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"security-and-safety\\\":{\\\"name\\\":\\\"security-and-safety\\\",\\\"description\\\":\\\"How to use WebX11 security levels, command blocking, and safety features\\\",\\\"tags\\\":[\\\"security\\\",\\\"safety\\\",\\\"blocking\\\",\\\"permissions\\\"],\\\"category\\\":\\\"system\\\",\\\"created\\\":\\\"2026-06-05T22:10:06.670Z\\\",\\\"updated\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"mindmap-user-guide\\\":{\\\"name\\\":\\\"mindmap-user-guide\\\",\\\"description\\\":\\\"How to create, view, and manage brainstorming mindmaps using the mindmap terminal module\\\",\\\"tags\\\":[\\\"mindmap\\\",\\\"brainstorming\\\",\\\"organization\\\",\\\"planning\\\"],\\\"category\\\":\\\"productivity\\\",\\\"created\\\":\\\"2026-06-05T22:14:44.807Z\\\",\\\"updated\\\":\\\"2026-06-05T22:14:44.807Z\\\"}}\",\"modified\":\"2026-06-05T22:16:17.805Z\"},\"mindmap-user-guide.md\":{\"type\":\"file\",\"content\":\"---\\nname: mindmap-user-guide\\ndescription: How to create, view, and manage brainstorming mindmaps using the mindmap terminal module\\ntags: [mindmap, brainstorming, organization, planning]\\ncategory: productivity\\n---\\n## Steps\\n\\n1. **Create a new mindmap:**\\n - `mindmap new \\\"<topic>\\\" -t tag1,tag2` — creates a root node\\n - Tags are optional (e.g. planning, research, dev)\\n - Root gets auto-assigned a color\\n\\n2. **Add child nodes:**\\n - `mindmap add <parent-id> \\\"<idea>\\\" -t tag` — add a child\\n - Get the parent-id from `mindmap show`\\n - IDs are 4-char random strings (e.g. a3f8, x7k2)\\n\\n3. **View the mindmap:**\\n - `mindmap show` — full tree with Unicode box-drawing\\n - `mindmap show <id>` — subtree starting at that node\\n\\n4. **Edit nodes:**\\n - `mindmap rename <id> \\\"<new text>\\\"` — change text\\n - `mindmap color <id> <color>` — set color (red/green/yellow/blue/cyan/magenta/white)\\n - `mindmap tag <id> <tag>` — add a tag\\n\\n5. **Persistence:**\\n - `mindmap save <name>` — save to localStorage\\n - `mindmap load <name>` — restore\\n - `mindmap list` — show saved mindmaps\\n - `mindmap delete <name>` — remove saved\\n\\n6. **Export:**\\n - `mindmap export [id]` — Markdown bullet list output\\n\\n## When to use\\n- User wants to brainstorm, organize ideas, plan features\\n- User says \\\"map out\\\", \\\"diagram\\\", \\\"brainstorm\\\", \\\"organize thoughts\\\"\\n- Visualizing project structure or task decomposition\",\"modified\":\"2026-06-05T22:14:44.807Z\"},\"_seeded\":{\"type\":\"file\",\"content\":\"1\",\"modified\":\"2026-06-05T22:14:44.808Z\"}}},\"logs\":{\"type\":\"dir\",\"content\":{\"current.log\":{\"type\":\"file\",\"content\":\"[22:10:06][INFO][System] WebX11 v4.2 started\\n[22:10:06][INFO][System] Default model: gemma4:31b-cloud\\n[22:10:06][WARN][Ollama] Ollama endpoint http://localhost:11434 failed: Failed to fetch\\n[22:10:07][INFO][Ollama] Connected to Ollama at https://webx11.duckdns.org/ollama/ with 82 model(s)\\n[22:13:42][INFO][System] WebX11 v4.2 started\\n[22:13:42][INFO][System] Default model: minimax-m2.5:cloud\\n[22:13:42][INFO][Ollama] Connected to Ollama at https://webx11.duckdns.org/ollama/ with 82 model(s)\\n[22:14:46][INFO][AI] Query: filed\\n[22:14:46][INFO][AI] Used 1 tool(s)\\n[22:15:45][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:15:45][INFO][AI] Tool get_status ok (0s)\\n[22:15:47][INFO][Ollama] chatWithTools round-trip: 2s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:15:47][INFO][AI] Tool get_help ok (0s)\\n[22:15:52][INFO][Ollama] chatWithTools round-trip: 5s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:15:52][INFO][AI] Query: setup system\\n[22:15:52][INFO][AI] Used 3 tool(s)\\n[22:16:57][INFO][Ollama] chatWithTools round-trip: 7s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:16:57][INFO][AI] Tool load_skills ok (0s)\\n[22:17:00][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:17:00][INFO][AI] Tool get_status ok (0s)\\n[22:17:15][INFO][Ollama] chatWithTools round-trip: 14s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:17:16][INFO][AI] Tool run_command ok (0s)\\n[22:17:19][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:17:19][INFO][AI] Tool get_help ok (0s)\\n[22:17:23][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:17:25][INFO][AI] Tool run_command ok (0s)\\n[22:17:28][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:17:30][INFO][AI] Tool run_command ok (0s)\\n[22:17:32][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:17:32][INFO][AI] Tool list_files ok (0s)\\n[22:17:35][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:17:37][INFO][AI] Tool run_command ok (0s)\\n[22:17:37][INFO][AI] Query: setop nueralvfs\\n[22:17:37][INFO][AI] Used 8 tool(s)\\n[22:17:59][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:17:59][INFO][AI] Tool get_help ok (0s)\\n[22:18:02][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:18:04][INFO][AI] Tool run_command ok (0s)\\n[22:18:06][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:18:09][INFO][AI] Tool run_command ok (0s)\\n[22:18:13][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:18:13][INFO][AI] Query: setup memory graph\\n[22:18:13][INFO][AI] Used 4 tool(s)\\n[22:18:58][INFO][Ollama] chatWithTools round-trip: 5s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:19:00][INFO][AI] Tool run_command ok (0s)\\n[22:19:06][INFO][Ollama] chatWithTools round-trip: 6s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:19:07][INFO][AI] Tool run_command ok (0s)\\n[22:19:09][INFO][Ollama] chatWithTools round-trip: 2s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:19:09][INFO][AI] Tool get_help ok (0s)\\n[22:19:13][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:19:15][INFO][AI] Tool run_command ok (0s)\\n[22:19:21][INFO][Ollama] chatWithTools round-trip: 7s (model: minimax-m2.5:cloud, provider: Ollama)\\n[22:19:21][INFO][AI] Query: when ll it populate?\\n[22:19:21][INFO][AI] Used 5 tool(s)\\n\",\"modified\":\"2026-06-05T22:19:21.725Z\"},\"_sessions\":{\"type\":\"dir\",\"content\":{\"_auto-context.json\":{\"type\":\"file\",\"content\":\"{\\\"context\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"setup system\\\"},{\\\"role\\\":\\\"assistant\\\",\\\"content\\\":\\\"The system appears already set up:\\\\n- **39 modules** loaded\\\\n- **Ollama** connected (minimax-m2.5:cloud) \\\\n- **24.8MB** memory in use\\\\n\\\\nWhat would you like to configure? Some options:\\\\n\\\\n- **Modules** - `modules-list`, `listmods`, `loadmod`\\\\n- **AI Model** - `ai-model`, `ollamasetmodel`\\\\n- **Storage** - `vfs-import`, `webdav-config`\\\\n- **Skills** - `skill-list`, `skill-create`\\\\n- **Config** - `config-list`, `config-set`\\\\n- **Health** - `system-health`, `health-check`\\\\n\\\\nOr describe what you're trying to accomplish and I can help.\\\"},{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"setop nueralvfs\\\"},{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"setup memory graph\\\"},{\\\"role\\\":\\\"assistant\\\",\\\"content\\\":\\\"**Current Status:**\\\\n\\\\n| Feature | Status |\\\\n|---------|--------|\\\\n| **Neural VFS** | ✅ Indexed (72 concepts, 19 files) |\\\\n| **Memory Graph** | 🆕 Empty (builds as you use system) |\\\\n\\\\nThe Neural VFS index is already built. The memory graph auto-populates as you work — every command and interaction gets tracked in the graph for smarter context awareness.\\\\n\\\\nTo rebuild/refresh the index:\\\\n```\\\\nnvfs-index\\\\n```\\\\n\\\\nTo see graph in action:\\\\n```\\\\nmemgraph-stats\\\\nmemgraph-search <query>\\\\n```\\\"},{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"when ll it populate?\\\"},{\\\"role\\\":\\\"assistant\\\",\\\"content\\\":\\\"**It populates as you use the system.**\\\\n\\\\nThe memory graph starts empty (0 nodes, 0 edges). As you work, it automatically tracks:\\\\n\\\\n- **Commands** you run\\\\n- **Files** you read/write\\\\n- **AI interactions** (this conversation)\\\\n- **Concepts** you search for\\\\n\\\\nJust use the terminal normally — it builds automatically. Each `run_command`, `read_file`, `write_file`, etc. adds nodes and edges.\\\\n\\\\nTo force an initial index of your current work:\\\\n```bash\\\\nnvfs-index\\\\n```\\\\n\\\\nThat will scan existing files and concepts to populate faster.\\\"}],\\\"messageCount\\\":5,\\\"savedAt\\\":1780697961724}\",\"modified\":\"2026-06-05T22:19:21.725Z\"},\"_auto.json\":{\"type\":\"file\",\"content\":\"{\\\"type\\\":\\\"session\\\",\\\"savedAt\\\":\\\"2026-06-05T22:17:11.972Z\\\",\\\"fsRoot\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"skills\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"navigating-the-terminal.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: navigating-the-terminal\\\\ndescription: How to explore the WebX11 terminal, find commands, check status, and navigate the filesystem\\\\ntags: [terminal, navigation, help, filesystem]\\\\ncategory: system\\\\n---\\\\n## Steps\\\\n1. **Get an overview of available commands:**\\\\n - Type \\\\\\\"help\\\\\\\" for a full command list sorted by category\\\\n - Type \\\\\\\"status\\\\\\\" to see filesystem state, loaded modules, Ollama status\\\\n - For a specific command, use help <command>\\\\n - Type \\\\\\\"commands\\\\\\\" for a compact list with module source info\\\\n - Type \\\\\\\"check\\\\\\\" for system health including module requirements\\\\n\\\\n2. **Explore the filesystem:**\\\\n - Use ls, ll, tree to browse directories\\\\n - Use cd <dir> to navigate, pwd to show current path\\\\n - Use cat or edit to view file contents\\\\n - Use find or grep to search files\\\\n - Use du to see disk usage\\\\n\\\\n3. **Understand system state:**\\\\n - mem — memory usage (auto-shown in header on boot)\\\\n - status — network, files, modules, Ollama\\\\n - modules — module manager GUI\\\\n - health-check — VFS size, modules, logs, trash, skills, tool failures\\\\n - checkpoint-list — VFS checkpoint snapshots\\\\n\\\\n4. **Agent / Orchestration state:**\\\\n - agent-list — registered agents (type, capabilities, status)\\\\n - orchestrate — list active orchestrated agents\\\\n - lease-list — show active leases with TTL\\\\n\\\\n5. **When user asks a vague question:**\\\\n - First run status and help to understand the current state\\\\n - Then ask clarifying questions based on what you found\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"memory-and-profile.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: memory-and-profile\\\\ndescription: How to use the user profile system, session memory, and pattern tracking for persistent context\\\\ntags: [memory, profile, session, persistence]\\\\ncategory: system\\\\n---\\\\n## Steps\\\\n1. **User Profile (persists across sessions):**\\\\n - user_get(key) — read any profile field (e.g. \\\\\\\"preferredModel\\\\\\\", \\\\\\\"fontSize\\\\\\\")\\\\n - user_set(key, value) — write to profile, auto-persists to localStorage\\\\n - user_list — show all stored profile keys\\\\n - user_forget(key) — delete a profile key\\\\n - Dot notation supported: user_set knownFacts.name \\\\\\\"Alex\\\\\\\"\\\\n\\\\n2. **Session Memory (VFS-based daily logs):**\\\\n - session_save(summary) — save a summary of what was accomplished\\\\n - session_load(date) — read a specific day's log (format: YYYY-MM-DD)\\\\n - session_recent(count) — show last N session summaries\\\\n - session_stats — aggregate totals across all sessions\\\\n - Recent sessions auto-load into context on first message\\\\n - systemd-style journal: use logs and logrotate commands for persistent logging\\\\n\\\\n3. **Conversation Patterns:**\\\\n - Pattern tracking runs automatically — frequent topics surface as hints\\\\n - my-set, my-get, my-list store additional personal data\\\\n - AI conversation context persists within a session (use ai-clear to reset)\\\\n - debug command toggles real-time debug panel with Copy/Export/VFS buttons\\\\n\\\\n4. **Checkpoints (VFS snapshots):**\\\\n - checkpoint [name] — snapshot current VFS state\\\\n - checkpoint-list — list all checkpoints\\\\n - rollback <name> — restore from checkpoint\\\\n - checkpoint-del <name> — delete a checkpoint\\\\n\\\\n5. **When to use:**\\\\n - At start: call session_recent(3) to see what was worked on before\\\\n - After identifying user preferences: call user_set to store them\\\\n - After complex tasks: call session_save with a brief summary\\\\n - Before risky edits: call checkpoint to create a restore point\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"web-search-and-fetch.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: web-search-and-fetch\\\\ndescription: How to search the web and fetch URL content using the WebX11 proxy API\\\\ntags: [search, fetch, web, proxy, api]\\\\ncategory: research\\\\n---\\\\n## Steps\\\\n1. **Search the web:**\\\\n - Use search <query> or web_search(query) — uses /api/search which queries SearXNG + DDG fallback\\\\n - Results include: title, url, content snippet, source engine\\\\n - Always available (same-origin, no CORS issues)\\\\n - 5-minute server-side cache for repeated queries\\\\n - Alternative: use ddg or duck <query> for DuckDuckGo direct, or s <query> as alias\\\\n\\\\n2. **Fetch URL content:**\\\\n - Use fetch <url> or web_fetch(url) — uses /api/extract which strips HTML, extracts clean text\\\\n - Returns: title, content (up to 4000 chars), word_count, extraction method\\\\n - SSRF protection blocks internal network addresses\\\\n - 15-minute server-side cache\\\\n\\\\n3. **Search flags (via terminal search command):**\\\\n - search <query> --summarize — adds AI-generated overview via Ollama\\\\n - search <query> --fetch — fetches content snippets for top 3 results\\\\n\\\\n4. **When to use:**\\\\n - User asks about current events, facts, research → use search <query>\\\\n - User says \\\\\\\"read this article\\\\\\\" or provides a URL → use fetch <url>\\\\n - For in-depth analysis: search first, then fetch top results\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"module-management.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: module-management\\\\ndescription: How to view, edit, test, reload modules and manage startup configuration\\\\ntags: [modules, editing, code, self-improvement]\\\\ncategory: dev\\\\n---\\\\n## Steps\\\\n1. **View module source:**\\\\n - view_module(name) — fetches original source or reads from _mods/ if edited\\\\n - Supports all loaded modules: SystemModule, FileSystemModule, SearXNGModule, etc.\\\\n - Or use modules command for GUI module manager\\\\n\\\\n2. **Edit a module:**\\\\n - edit_module(name) — copies source to _mods/<name>.js and opens code editor\\\\n - Editor shows the full source in a textarea\\\\n - Click \\\\\\\"Save & Test\\\\\\\" to save and auto-load the edited version\\\\n - Checkpoint before editing: checkpoint mod-edit-<name>\\\\n\\\\n3. **Test and reload:**\\\\n - test_module(name) — loads edited module from _mods/ for live testing\\\\n - reload_module(name) — discards edits and reloads from original URL\\\\n - list_modified_modules — shows all modules with pending edits\\\\n\\\\n4. **Check for updates:**\\\\n - check_updates — HEAD-requests all loaded module URLs to verify reachability\\\\n\\\\n5. **Manage startup:**\\\\n - startup-modules — opens the Startup Modules UI to select which modules load\\\\n - load-local <path> — load a module from VFS or URL without editing\\\\n - loadmod <url> — alternative: load module from URL\\\\n - removemod <name> — remove a loaded module\\\\n\\\\n6. **Agent modules (Phase 2):**\\\\n - module-agent-registry.js — Agent registry with agent-list, agent-register, agent-unregister, agent-status\\\\n - module-leases.js — Time-bound contracts with 5s watchdog, auto-expiry\\\\n - module-orchestrator.js — Spawn, delegate, kill, purge with heartbeat monitoring\\\\n\\\\n7. **When to use:**\\\\n - User reports a bug in a module → view_module, edit_module, test_module\\\\n - User asks \\\\\\\"can you add X feature?\\\\\\\" → same workflow\\\\n - Always save edits before testing. If test fails, the original module stays loaded.\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"system-maintenance.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: system-maintenance\\\\ndescription: How to reset, troubleshoot, and maintain the WebX11 terminal\\\\ntags: [system, maintenance, reset, troubleshoot, config]\\\\ncategory: system\\\\n---\\\\n## Steps\\\\n1. **Factory reset (wipes everything):**\\\\n - factory-reset --confirm — clears all webx11_ localStorage keys, resets VFS, reloads\\\\n - Use only when the system is in an unrecoverable state\\\\n\\\\n2. **Soft VFS reset:**\\\\n - reset-vfs --confirm — clears only the filesystem, preserves settings/profile/modules\\\\n\\\\n3. **Config management:**\\\\n - config-list — show all config keys and values\\\\n - config-set <key> <value> — set a config value\\\\n - config-delete <key> — remove a config key\\\\n - config-export — dump all config as JSON\\\\n - config-reset — restore defaults (use before factory-reset if you want to save data)\\\\n\\\\n4. **Security level:**\\\\n - security-level <0-3> — set security level (0=Permissive, 1=Standard, 2=Paranoid, 3=Audit)\\\\n - security — show current security level, blocked count, and stats\\\\n - cmd-allow <cmd> — whitelist a command from security checks\\\\n - cmd-deny <cmd> — blacklist a command\\\\n\\\\n5. **Health checks (run automatically after complex tasks):**\\\\n - Check module loading status: loaded vs total\\\\n - Check for pending module edits\\\\n - Check memory usage (high if >100MB)\\\\n - Check skill count (0 skills after 2+ tool calls → suggest create_skill)\\\\n - health-check — full audit: VFS size, modules, logs, trash, skills, tool failures\\\\n\\\\n6. **Font size and display:**\\\\n - font-size <8-32> — set terminal font size, persists across sessions\\\\n - setfont — alias for font-size\\\\n\\\\n7. **Checkpoints:**\\\\n - checkpoint [name] — snapshot current VFS state\\\\n - checkpoint-list — list all checkpoints\\\\n - rollback <name> — restore from checkpoint\\\\n\\\\n8. **When to use:**\\\\n - System is slow or modules fail to load → check check_updates, mem\\\\n - User says \\\\\\\"reset everything\\\\\\\" → factory-reset --confirm\\\\n - User says \\\\\\\"clear my files but keep settings\\\\\\\" → reset-vfs --confirm\\\\n - User reports security concerns → security-level or cmd-allow/cmd-deny\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"backup-and-restore.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: backup-and-restore\\\\ndescription: How to backup, restore, and export WebX11 data\\\\ntags: [backup, restore, export, import, persistence]\\\\ncategory: system\\\\n---\\\\n## Steps\\\\n1. **Backup VFS:**\\\\n - vfs-export — downloads the entire virtual filesystem as a dated JSON file\\\\n - backup — creates a full backup including VFS, modules, config (saves to _backups/)\\\\n\\\\n2. **WebDAV cloud backup:**\\\\n - webdav-backup — push VFS snapshot to WebDAV server (auto-archive)\\\\n - webdav-backup-list — list remote WebDAV backups\\\\n - webdav-restore <file> — restore VFS from remote WebDAV snapshot\\\\n - webdav-push <local> <remote> — push file to WebDAV space\\\\n - webdav-pull <remote> <local> — pull file from WebDAV space\\\\n - webdav-ls [path] — list remote WebDAV directory contents\\\\n - webdav-status — check WebDAV connection and space usage\\\\n - webdav-explorer — GUI file browser for WebDAV\\\\n - webdav-browser — simpler file listing for WebDAV\\\\n - webdav-config — configure WebDAV endpoint and credentials\\\\n\\\\n3. **Export/Import personal data:**\\\\n - my-export — prints all my-set data as formatted JSON\\\\n - my-import <json> — bulk-import personal data from JSON string\\\\n\\\\n4. **Export/Import modules:**\\\\n - export-mods — exports module registry as JSON\\\\n - import-mods <json> — imports modules from JSON backup\\\\n\\\\n5. **Restore:**\\\\n - restore <json> — restores terminal state from a backup JSON\\\\n - Session logs are saved to /memory/ automatically on page unload\\\\n\\\\n6. **When to use:**\\\\n - Before factory-reset: call my-export, vfs-export, export-mods to save data\\\\n - When switching browsers or devices: export all, then import\\\\n - User says \\\\\\\"backup my data\\\\\\\" or \\\\\\\"save my files\\\\\\\"\\\\n - For cloud backup: use webdav-backup (requires WebDAV server configured)\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"mindmap-workflow.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: mindmap-workflow\\\\ndescription: How to create, view, edit, and manage brainstorming mindmaps\\\\ntags: [mindmap, brainstorming, planning, organization]\\\\ncategory: productivity\\\\n---\\\\n## Steps\\\\n1. **Create a new mindmap:**\\\\n - mindmap new \\\\\\\"<topic>\\\\\\\" -t tag1,tag2 — creates a root node\\\\n - Tags are optional (e.g. planning, research, dev)\\\\n - Root gets auto-assigned a color from 7-color palette\\\\n\\\\n2. **Add child nodes:**\\\\n - mindmap add <parent-id> \\\\\\\"<idea>\\\\\\\" -t tag — add a child\\\\n - Get the parent-id from mindmap show\\\\n - IDs are 4-char random strings (e.g. a3f8, x7k2)\\\\n\\\\n3. **View:**\\\\n - mindmap show — full tree with Unicode box-drawing\\\\n - mindmap show <id> — subtree starting at that node\\\\n\\\\n4. **Edit nodes:**\\\\n - mindmap rename <id> \\\\\\\"<new text>\\\\\\\" — change text\\\\n - mindmap color <id> <color> — set color (red/green/yellow/blue/cyan/magenta/white)\\\\n - mindmap tag <id> <tag> — add a tag\\\\n\\\\n5. **Persistence:**\\\\n - mindmap save <name> — save to localStorage\\\\n - mindmap load <name> — restore\\\\n - mindmap list — show saved mindmaps\\\\n - mindmap delete <name> — remove saved\\\\n\\\\n6. **Export:**\\\\n - mindmap export [id] — Markdown bullet list output, auto-copies to clipboard\\\\n\\\\n7. **When to use:**\\\\n - Map out project structure, brainstorm features, organize ideas\\\\n - Break down complex tasks into subtrees\\\\n - User says \\\\\\\"brainstorm\\\\\\\", \\\\\\\"diagram\\\\\\\", \\\\\\\"organize thoughts\\\\\\\", \\\\\\\"plan\\\\\\\"\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"skills-system-guide.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: skills-system-guide\\\\ndescription: How to use the skills system: load, create, patch, list, and audit skills for persistent procedural memory\\\\ntags: [skills, system, meta]\\\\ncategory: system\\\\n---\\\\n## Steps\\\\n1. **Always load skills at task start:**\\\\n - At the START of every task, type or call \\\\\\\"skill-view <name>\\\\\\\" or \\\\\\\"skill-list\\\\\\\"\\\\n - Example: skill-view \\\\\\\"module-management\\\\\\\" — returns matching skill content\\\\n - Example: skill-list system — browse skills by category\\\\n\\\\n2. **Create skills after complex tasks:**\\\\n - After any task with 3+ tool calls, call \\\\\\\"skill-create\\\\\\\"\\\\n - Required fields: name (kebab-case), description, content (markdown with YAML frontmatter)\\\\n - Optional: tags (comma-separated), category (e.g. research, system, dev)\\\\n - Skills persist in /skills/ as .md files with /skills/index.json for fast lookup\\\\n - Skill pack auto-seeds 8 core skills on first boot\\\\n\\\\n3. **Patch skills when they're outdated:**\\\\n - If a stored procedure has wrong steps, call \\\\\\\"skill-patch <name>\\\\\\\"\\\\n - This replaces the entire skill content and updates the index\\\\n - Do NOT create a duplicate — always patch the existing skill\\\\n\\\\n4. **Auto-created error skills:**\\\\n - If the same tool fails 3+ times, a workaround skill is created automatically\\\\n - Named tool-<name>-workaround (e.g. tool-write_file-workaround)\\\\n\\\\n5. **Audit and maintenance:**\\\\n - skill-list <category?> — browse available skills, optionally filter\\\\n - skill-export <name> — download a skill as markdown\\\\n - skill-import <json> — bulk import skills\\\\n - skill-sync — re-index skills from /skills/ directory\\\\n - Skills are audited every 20 messages for staleness (empty content, >30 days old)\\\\n\\\\n6. **YAML frontmatter format:**\\\\n - Each skill file must start with: ---\\\\\\\\nname: <name>\\\\\\\\ndescription: <text>\\\\\\\\ntags: [...]\\\\\\\\ncategory: <cat>\\\\\\\\n---\\\\\\\\n\\\\n - Steps follow under ## Steps heading\\\\n - Use numbered lists for sequential steps\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"agent-orchestration.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: agent-orchestration\\\\ndescription: How to use the agent registry, leases, and orchestrator for multi-agent workflows\\\\ntags: [agents, orchestration, delegation, leases]\\\\ncategory: system\\\\n---\\\\n## Steps\\\\n1. **Agent Registry:**\\\\n - agent-list — list all registered agents (ID, type, capabilities, status)\\\\n - agent-register <type> <capabilities> — register a new agent (capabilities: comma-separated like \\\\\\\"code,research\\\\\\\")\\\\n - agent-unregister <id> — remove an agent\\\\n - agent-status <id> — detailed status including uptime, task history\\\\n\\\\n2. **Leases (time-bound contracts):**\\\\n - lease-create <agent-id> <ttl-seconds> — create a lease with watchdog timer\\\\n - lease-list — show active leases with remaining TTL\\\\n - lease-revoke <lease-id> — terminate a lease early\\\\n - lease-renew <lease-id> <ttl-seconds> — extend a lease\\\\n\\\\n3. **Orchestrator (spawn, delegate, kill):**\\\\n - orchestrator-spawn <type> <capabilities> — spawn a new agent automatically (registers + creates lease)\\\\n - orchestrator-kill <agent-id> — kill an agent (revokes lease + unregisters)\\\\n - orchestrate — list all active agents with their orchestrator state\\\\n - orchestrator-purge — kill all idle/expired agents\\\\n - orchestrator-status — full system status: active, idle, dead agents\\\\n\\\\n4. **AI tool integration:**\\\\n - AI tools list_agents, delegate_task, spawn_agent are available in the AI system prompt\\\\n - The AI can auto-spawn worker agents for sub-tasks\\\\n - Each agent gets its own VFS workspace at /agents/<agent-id>/\\\\n\\\\n5. **When to use:**\\\\n - User needs parallel task execution → orchestrator-spawn coder + researcher\\\\n - Time-bound automation → lease-create with short TTL\\\\n - System cleanup → orchestrator-purge to kill stale agents\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"debug-panel-and-logs.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: debug-panel-and-logs\\\\ndescription: How to use the debug panel, session logging, and terminal diagnostics\\\\ntags: [debug, logging, diagnostics, troubleshooting]\\\\ncategory: system\\\\n---\\\\n## Steps\\\\n1. **Toggle debug panel:**\\\\n - debug — opens real-time debug panel showing last AI tool call, response time, and context\\\\n - Debug panel includes Copy, Export, and Write to VFS buttons\\\\n - Export: saves tool call log as timestamped JSON to downloads\\\\n - Write to VFS: appends debug data to /debug.log (dedup by turn ID)\\\\n\\\\n2. **Session logging:**\\\\n - logs [n] [LEVEL] — view last n log entries (optionally filtered by INFO/WARN/ERROR)\\\\n - logrotate — rotate current.log to dated archive (auto-cleans old logs beyond 10)\\\\n - Logs stored in /logs/ directory: current.log + dated archives\\\\n - Health check runs automatically after complex tasks\\\\n\\\\n3. **Diagnostic commands:**\\\\n - health-check — full audit: VFS size, modules, logs, trash, skills\\\\n - check — quick system health including module requirement status\\\\n - mem — real-time memory usage (also in header)\\\\n - status — network, files, modules, Ollama connectivity\\\\n\\\\n4. **System journals:**\\\\n - debug.log — appended by debug panel VFS button (dedup by turn ID)\\\\n - current.log — system activity log with rotation\\\\n - Auto-save: terminal state auto-saves every 60s\\\\n\\\\n5. **When to use:**\\\\n - AI is behaving unexpectedly → debug to see tool calls\\\\n - User reports errors → logs 50 ERROR to see error entries\\\\n - Memory concerns → mem to check, health-check for full audit\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"webdav-operations.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: webdav-operations\\\\ndescription: How to use WebDAV cloud storage for backup, file sync, and remote file access\\\\ntags: [webdav, cloud, backup, sync, storage]\\\\ncategory: system\\\\n---\\\\n## Steps\\\\n1. **Configuration:**\\\\n - webdav-config — configure WebDAV endpoint URL and credentials\\\\n - Connection auto-tested on config; webdav-status shows connection health\\\\n - Uses per-user token stored in .token file on the server side\\\\n\\\\n2. **File operations:**\\\\n - webdav-ls [path] — list remote directory contents\\\\n - webdav-push <local-path> <remote-path> — upload file to WebDAV\\\\n - webdav-pull <remote-path> [local-path] — download file from WebDAV\\\\n - webdav-explorer — GUI file browser for WebDAV\\\\n - webdav-browser — CLI file browser for WebDAV\\\\n\\\\n3. **Backup & Restore:**\\\\n - webdav-backup — push full VFS snapshot to WebDAV (creates /backups/newos4-<date>.json)\\\\n - webdav-backup-list — list all remote backup snapshots\\\\n - webdav-restore <filename> — restore VFS from a remote backup snapshot\\\\n\\\\n4. **Status & Diagnostics:**\\\\n - webdav-status — connection status, last sync, space information\\\\n - If uploads fail: check webdav-config, ensure .token file is valid\\\\n - WebDAV runs on the same server (nginx with WebDAV module), no external dependency\\\\n\\\\n5. **When to use:**\\\\n - Before factory-reset: webdav-backup to store VFS remotely\\\\n - Cross-browser: webdav-push/pull to move files between instances\\\\n - User says \\\\\\\"cloud backup\\\\\\\" or \\\\\\\"remote save\\\\\\\" → webdav-backup\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"security-and-safety.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: security-and-safety\\\\ndescription: How to use WebX11 security levels, command blocking, and safety features\\\\ntags: [security, safety, blocking, permissions]\\\\ncategory: system\\\\n---\\\\n## Steps\\\\n1. **Security levels:**\\\\n - security-level <0-3> — set security level:\\\\n 0 = Permissive (no blocks, no confirms — anything runs)\\\\n 1 = Standard (unknown cmds → AI route, destructive → confirm, system → block)\\\\n 2 = Paranoid (unknown cmds blocked entirely, destructive blocked)\\\\n 3 = Audit (everything allowed, everything logged)\\\\n - Default: level 1\\\\n - security — show current level, blocked count, and stats\\\\n\\\\n2. **Command control:**\\\\n - cmd-allow <cmd> — whitelist a command from security checks\\\\n - cmd-deny <cmd> — blacklist/block a command entirely\\\\n - whitelist built-in: help, clear, ls, cat, pwd, whoami, df, free, top, ps, echo, date, env, history\\\\n\\\\n3. **What gets blocked at each level:**\\\\n - Unknown commands: Level 1 → AI routed, Level 2+ → blocked\\\\n - Destructive commands (delete, write, save, format, etc.): Level 1 → confirmation, Level 2+ → blocked\\\\n - System commands (reboot, shutdown, format, kill): Level 1+ → blocked\\\\n - Suspicious flags (--execute, --eval, --shell): Level 1+ → blocked\\\\n\\\\n4. **Safety checklist:**\\\\n - Check security: security shows your current level\\\\n - Before running risky commands: create a checkpoint first\\\\n - For temporary relax: security-level 0, then restore to 1\\\\n - For total lockdown before leaving: security-level 2\\\\n\\\\n5. **When to use:**\\\\n - User wants to lock down the terminal → security-level 2\\\\n - User wants to allow a blocked command → cmd-allow <cmd>\\\\n - Debugging strange behavior → verify security-level (user may have set it higher)\\\",\\\"modified\\\":\\\"2026-06-05T22:13:42.539Z\\\"},\\\"index.json\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"{\\\\\\\"navigating-the-terminal\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"navigating-the-terminal\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to explore the WebX11 terminal, find commands, check status, and navigate the filesystem\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"terminal\\\\\\\",\\\\\\\"navigation\\\\\\\",\\\\\\\"help\\\\\\\",\\\\\\\"filesystem\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"system\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.669Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"memory-and-profile\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"memory-and-profile\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to use the user profile system, session memory, and pattern tracking for persistent context\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"memory\\\\\\\",\\\\\\\"profile\\\\\\\",\\\\\\\"session\\\\\\\",\\\\\\\"persistence\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"system\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.669Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"web-search-and-fetch\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"web-search-and-fetch\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to search the web and fetch URL content using the WebX11 proxy API\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"search\\\\\\\",\\\\\\\"fetch\\\\\\\",\\\\\\\"web\\\\\\\",\\\\\\\"proxy\\\\\\\",\\\\\\\"api\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"research\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.669Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"module-management\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"module-management\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to view, edit, test, reload modules and manage startup configuration\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"modules\\\\\\\",\\\\\\\"editing\\\\\\\",\\\\\\\"code\\\\\\\",\\\\\\\"self-improvement\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"dev\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.669Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"system-maintenance\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"system-maintenance\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to reset, troubleshoot, and maintain the WebX11 terminal\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"system\\\\\\\",\\\\\\\"maintenance\\\\\\\",\\\\\\\"reset\\\\\\\",\\\\\\\"troubleshoot\\\\\\\",\\\\\\\"config\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"system\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.669Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"backup-and-restore\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"backup-and-restore\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to backup, restore, and export WebX11 data\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"backup\\\\\\\",\\\\\\\"restore\\\\\\\",\\\\\\\"export\\\\\\\",\\\\\\\"import\\\\\\\",\\\\\\\"persistence\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"system\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.669Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"mindmap-workflow\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"mindmap-workflow\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to create, view, edit, and manage brainstorming mindmaps\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"mindmap\\\\\\\",\\\\\\\"brainstorming\\\\\\\",\\\\\\\"planning\\\\\\\",\\\\\\\"organization\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"productivity\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.669Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"skills-system-guide\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"skills-system-guide\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to use the skills system: load, create, patch, list, and audit skills for persistent procedural memory\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"skills\\\\\\\",\\\\\\\"system\\\\\\\",\\\\\\\"meta\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"system\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.669Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"agent-orchestration\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"agent-orchestration\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to use the agent registry, leases, and orchestrator for multi-agent workflows\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"agents\\\\\\\",\\\\\\\"orchestration\\\\\\\",\\\\\\\"delegation\\\\\\\",\\\\\\\"leases\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"system\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.670Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"debug-panel-and-logs\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"debug-panel-and-logs\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to use the debug panel, session logging, and terminal diagnostics\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"debug\\\\\\\",\\\\\\\"logging\\\\\\\",\\\\\\\"diagnostics\\\\\\\",\\\\\\\"troubleshooting\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"system\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.670Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"webdav-operations\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"webdav-operations\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to use WebDAV cloud storage for backup, file sync, and remote file access\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"webdav\\\\\\\",\\\\\\\"cloud\\\\\\\",\\\\\\\"backup\\\\\\\",\\\\\\\"sync\\\\\\\",\\\\\\\"storage\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"system\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.670Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"security-and-safety\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"security-and-safety\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to use WebX11 security levels, command blocking, and safety features\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"security\\\\\\\",\\\\\\\"safety\\\\\\\",\\\\\\\"blocking\\\\\\\",\\\\\\\"permissions\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"system\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:10:06.670Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:13:42.539Z\\\\\\\"},\\\\\\\"mindmap-user-guide\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"mindmap-user-guide\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to create, view, and manage brainstorming mindmaps using the mindmap terminal module\\\\\\\",\\\\\\\"tags\\\\\\\":[\\\\\\\"mindmap\\\\\\\",\\\\\\\"brainstorming\\\\\\\",\\\\\\\"organization\\\\\\\",\\\\\\\"planning\\\\\\\"],\\\\\\\"category\\\\\\\":\\\\\\\"productivity\\\\\\\",\\\\\\\"created\\\\\\\":\\\\\\\"2026-06-05T22:14:44.807Z\\\\\\\",\\\\\\\"updated\\\\\\\":\\\\\\\"2026-06-05T22:14:44.807Z\\\\\\\"}}\\\",\\\"modified\\\":\\\"2026-06-05T22:16:17.805Z\\\"},\\\"mindmap-user-guide.md\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"---\\\\nname: mindmap-user-guide\\\\ndescription: How to create, view, and manage brainstorming mindmaps using the mindmap terminal module\\\\ntags: [mindmap, brainstorming, organization, planning]\\\\ncategory: productivity\\\\n---\\\\n## Steps\\\\n\\\\n1. **Create a new mindmap:**\\\\n - `mindmap new \\\\\\\"<topic>\\\\\\\" -t tag1,tag2` — creates a root node\\\\n - Tags are optional (e.g. planning, research, dev)\\\\n - Root gets auto-assigned a color\\\\n\\\\n2. **Add child nodes:**\\\\n - `mindmap add <parent-id> \\\\\\\"<idea>\\\\\\\" -t tag` — add a child\\\\n - Get the parent-id from `mindmap show`\\\\n - IDs are 4-char random strings (e.g. a3f8, x7k2)\\\\n\\\\n3. **View the mindmap:**\\\\n - `mindmap show` — full tree with Unicode box-drawing\\\\n - `mindmap show <id>` — subtree starting at that node\\\\n\\\\n4. **Edit nodes:**\\\\n - `mindmap rename <id> \\\\\\\"<new text>\\\\\\\"` — change text\\\\n - `mindmap color <id> <color>` — set color (red/green/yellow/blue/cyan/magenta/white)\\\\n - `mindmap tag <id> <tag>` — add a tag\\\\n\\\\n5. **Persistence:**\\\\n - `mindmap save <name>` — save to localStorage\\\\n - `mindmap load <name>` — restore\\\\n - `mindmap list` — show saved mindmaps\\\\n - `mindmap delete <name>` — remove saved\\\\n\\\\n6. **Export:**\\\\n - `mindmap export [id]` — Markdown bullet list output\\\\n\\\\n## When to use\\\\n- User wants to brainstorm, organize ideas, plan features\\\\n- User says \\\\\\\"map out\\\\\\\", \\\\\\\"diagram\\\\\\\", \\\\\\\"brainstorm\\\\\\\", \\\\\\\"organize thoughts\\\\\\\"\\\\n- Visualizing project structure or task decomposition\\\",\\\"modified\\\":\\\"2026-06-05T22:14:44.807Z\\\"},\\\"_seeded\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"1\\\",\\\"modified\\\":\\\"2026-06-05T22:14:44.808Z\\\"}}},\\\"logs\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"current.log\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"[22:10:06][INFO][System] WebX11 v4.2 started\\\\n[22:10:06][INFO][System] Default model: gemma4:31b-cloud\\\\n[22:10:06][WARN][Ollama] Ollama endpoint http://localhost:11434 failed: Failed to fetch\\\\n[22:10:07][INFO][Ollama] Connected to Ollama at https://webx11.duckdns.org/ollama/ with 82 model(s)\\\\n[22:13:42][INFO][System] WebX11 v4.2 started\\\\n[22:13:42][INFO][System] Default model: minimax-m2.5:cloud\\\\n[22:13:42][INFO][Ollama] Connected to Ollama at https://webx11.duckdns.org/ollama/ with 82 model(s)\\\\n[22:14:46][INFO][AI] Query: filed\\\\n[22:14:46][INFO][AI] Used 1 tool(s)\\\\n[22:15:45][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\\\\n[22:15:45][INFO][AI] Tool get_status ok (0s)\\\\n[22:15:47][INFO][Ollama] chatWithTools round-trip: 2s (model: minimax-m2.5:cloud, provider: Ollama)\\\\n[22:15:47][INFO][AI] Tool get_help ok (0s)\\\\n[22:15:52][INFO][Ollama] chatWithTools round-trip: 5s (model: minimax-m2.5:cloud, provider: Ollama)\\\\n[22:15:52][INFO][AI] Query: setup system\\\\n[22:15:52][INFO][AI] Used 3 tool(s)\\\\n[22:16:57][INFO][Ollama] chatWithTools round-trip: 7s (model: minimax-m2.5:cloud, provider: Ollama)\\\\n[22:16:57][INFO][AI] Tool load_skills ok (0s)\\\\n[22:17:00][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)\\\\n[22:17:00][INFO][AI] Tool get_status ok (0s)\\\\n\\\",\\\"modified\\\":\\\"2026-06-05T22:17:00.953Z\\\"},\\\"_sessions\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"_auto-context.json\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"{\\\\\\\"context\\\\\\\":[{\\\\\\\"role\\\\\\\":\\\\\\\"user\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"setup system\\\\\\\"},{\\\\\\\"role\\\\\\\":\\\\\\\"assistant\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"The system appears already set up:\\\\\\\\n- **39 modules** loaded\\\\\\\\n- **Ollama** connected (minimax-m2.5:cloud) \\\\\\\\n- **24.8MB** memory in use\\\\\\\\n\\\\\\\\nWhat would you like to configure? Some options:\\\\\\\\n\\\\\\\\n- **Modules** - `modules-list`, `listmods`, `loadmod`\\\\\\\\n- **AI Model** - `ai-model`, `ollamasetmodel`\\\\\\\\n- **Storage** - `vfs-import`, `webdav-config`\\\\\\\\n- **Skills** - `skill-list`, `skill-create`\\\\\\\\n- **Config** - `config-list`, `config-set`\\\\\\\\n- **Health** - `system-health`, `health-check`\\\\\\\\n\\\\\\\\nOr describe what you're trying to accomplish and I can help.\\\\\\\"}],\\\\\\\"messageCount\\\\\\\":2,\\\\\\\"savedAt\\\\\\\":1780697752807}\\\",\\\"modified\\\":\\\"2026-06-05T22:15:52.808Z\\\"}}}}},\\\"tree\\\":{\\\"type\\\":\\\"file\\\",\\\"content\\\":\\\"\\\",\\\"modified\\\":\\\"2026-06-05T22:13:01.376Z\\\"},\\\"memory\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{}}}},\\\"currentPath\\\":[\\\"logs\\\"],\\\"version\\\":1,\\\"terminalLines\\\":[{\\\"l\\\":\\\"⏹ AI request cancelled by user\\\",\\\"t\\\":\\\"warning\\\"},{\\\"l\\\":\\\"files \\\",\\\"t\\\":\\\"command-prompt\\\"},{\\\"l\\\":\\\"mem\\\",\\\"t\\\":\\\"command-prompt\\\"},{\\\"l\\\":\\\"📊 Memory Stats\\\\n JS heap: 24.8MB / 26.3MB (limit 1083.4MB)\\\\n Terminal lines in DOM: 112\\\\n History buffer: 50 entries\\\\n MAX_OUTPUT_LINES: 200\\\\n Commands in history: 8\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"ai-context \\\",\\\"t\\\":\\\"command-prompt\\\"},{\\\"l\\\":\\\"=== Context (1 messages) ===\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"👤 filed...\\\",\\\"t\\\":\\\"\\\"},{\\\"l\\\":\\\"ai-clear \\\",\\\"t\\\":\\\"command-prompt\\\"},{\\\"l\\\":\\\"AI conversation context cleared\\\",\\\"t\\\":\\\"success\\\"},{\\\"l\\\":\\\"setup system\\\",\\\"t\\\":\\\"command-prompt\\\"},{\\\"l\\\":\\\"Security: Unknown command \\\\\\\"setup\\\\\\\". Did you mean: \\\\\\\"set\\\\\\\"?\\\",\\\"t\\\":\\\"warning\\\"},{\\\"l\\\":\\\"Security: Did you mean \\\\\\\"set\\\\\\\"? Routing to AI...\\\",\\\"t\\\":\\\"warning\\\"},{\\\"l\\\":\\\"→ Routing to AI assistant...\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"🤖 WebX11AI thinking...\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"🔧 AI wants 1 tool(s) — turn 1/8 (4s)\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"🔧 Tool: get_status({})\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"📊 Result (0s): {\\\\\\\"files\\\\\\\":2,\\\\\\\"dirs\\\\\\\":\\\\\\\"/logs\\\\\\\",\\\\\\\"modules\\\\\\\":39,\\\\\\\"ollama\\\\\\\":\\\\\\\"Connected (minimax-m2.5:cloud)\\\\\\\",\\\\\\\"memory\\\\\\\":\\\\\\\"24.8MB\\\\\\\"}\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"🔧 AI wants 1 tool(s) — turn 2/8 (2s)\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"🔧 Tool: get_help({})\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"💬 AI answered (turn 3/8, 5s)\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"webdav-config \\\",\\\"t\\\":\\\"command-prompt\\\"},{\\\"l\\\":\\\"👋 You are logged in as \\\\\\\"agando\\\\\\\" — this space is \\\\\\\"newos4\\\\\\\".\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"Enter the WebDAV token for space \\\\\\\"newos4\\\\\\\":\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"\\\",\\\"t\\\":\\\"text-muted\\\"},{\\\"l\\\":\\\" webdav-config https://webx11.duckdns.org/spaces/newos4/ newos4 <your-token>\\\",\\\"t\\\":\\\"success\\\"},{\\\"l\\\":\\\"\\\",\\\"t\\\":\\\"text-muted\\\"},{\\\"l\\\":\\\" webdav-config https://webx11.duckdns.org/spaces/newos4/ newos4 \\\",\\\"t\\\":\\\"command-prompt\\\"},{\\\"l\\\":\\\"Testing WebDAV connection...\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"Connected: 405 \\\",\\\"t\\\":\\\"success\\\"},{\\\"l\\\":\\\"WebDAV configured: https://webx11.duckdns.org/spaces/newos4/\\\",\\\"t\\\":\\\"success\\\"},{\\\"l\\\":\\\"skill-sync \\\",\\\"t\\\":\\\"command-prompt\\\"},{\\\"l\\\":\\\"Syncing skills with WebDAV...\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"Sync complete: 0 exported, 0 imported\\\",\\\"t\\\":\\\"success\\\"},{\\\"l\\\":\\\"setop nueralvfs\\\",\\\"t\\\":\\\"command-prompt\\\"},{\\\"l\\\":\\\"Security: Unknown command \\\\\\\"setop\\\\\\\". Did you mean: \\\\\\\"set\\\\\\\"?\\\",\\\"t\\\":\\\"warning\\\"},{\\\"l\\\":\\\"Security: Did you mean \\\\\\\"set\\\\\\\"? Routing to AI...\\\",\\\"t\\\":\\\"warning\\\"},{\\\"l\\\":\\\"→ Routing to AI assistant...\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"🤖 WebX11AI thinking...\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"🔧 AI wants 1 tool(s) — turn 1/8 (7s)\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"🔧 Tool: load_skills({\\\\\\\"query\\\\\\\":\\\\\\\"neural vfs setup\\\\\\\"})\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"📊 Result (0s): {\\\\\\\"matches\\\\\\\":[],\\\\\\\"count\\\\\\\":0,\\\\\\\"message\\\\\\\":\\\\\\\"No matching skills found. You can create one after this task.\\\\\\\"}\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"memgraph-status \\\",\\\"t\\\":\\\"command-prompt\\\"},{\\\"l\\\":\\\"🧠 Memory Graph\\\",\\\"t\\\":\\\"header\\\"},{\\\"l\\\":\\\" Nodes: 0 ()\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\" Edges: 0\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\" Total accesses: 0\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\" Path: /.memory_graph/\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"🔧 AI wants 1 tool(s) — turn 2/8 (4s)\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"🔧 Tool: get_status({})\\\",\\\"t\\\":\\\"info\\\"},{\\\"l\\\":\\\"📊 Result (0s): {\\\\\\\"files\\\\\\\":2,\\\\\\\"dirs\\\\\\\":\\\\\\\"/logs\\\\\\\",\\\\\\\"modules\\\\\\\":39,\\\\\\\"ollama\\\\\\\":\\\\\\\"Connected (minimax-m2.5:cloud)\\\\\\\",\\\\\\\"memory\\\\\\\":\\\\\\\"24.8MB\\\\\\\"}\\\",\\\"t\\\":\\\"info\\\"}]}\",\"modified\":\"2026-06-05T22:17:11.973Z\"}}}}},\"tree\":{\"type\":\"file\",\"content\":\"\",\"modified\":\"2026-06-05T22:13:01.376Z\"},\"memory\":{\"type\":\"dir\",\"content\":{}},\".semantic_index\":{\"type\":\"dir\",\"content\":{\"map.json\":{\"type\":\"file\",\"content\":\"{\\\"navigating\\\":[{\\\"path\\\":\\\"/skills/navigating-the-terminal.md\\\",\\\"summary\\\":\\\"1. **Get an overview of available commands:**\\\"}],\\\"the\\\":[{\\\"path\\\":\\\"/skills/navigating-the-terminal.md\\\",\\\"summary\\\":\\\"1. **Get an overview of available commands:**\\\"}],\\\"terminal\\\":[{\\\"path\\\":\\\"/skills/navigating-the-terminal.md\\\",\\\"summary\\\":\\\"1. **Get an overview of available commands:**\\\"},{\\\"path\\\":\\\"/logs/_sessions/_auto.json\\\",\\\"summary\\\":\\\"{\\\\\\\"type\\\\\\\":\\\\\\\"session\\\\\\\",\\\\\\\"savedAt\\\\\\\":\\\\\\\"2026-06-05T22:17:11.972Z\\\\\\\",\\\\\\\"fsRoot\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"dir\\\\\\\",\\\\\\\"content\\\\\\\":{\\\\\\\"skills\\\\\\\":{\\\\\\\"...\\\"}],\\\"md-file\\\":[{\\\"path\\\":\\\"/skills/navigating-the-terminal.md\\\",\\\"summary\\\":\\\"1. **Get an overview of available commands:**\\\"},{\\\"path\\\":\\\"/skills/memory-and-profile.md\\\",\\\"summary\\\":\\\"1. **User Profile (persists across sessions):**\\\"},{\\\"path\\\":\\\"/skills/web-search-and-fetch.md\\\",\\\"summary\\\":\\\"1. **Search the web:**\\\"},{\\\"path\\\":\\\"/skills/module-management.md\\\",\\\"summary\\\":\\\"1. **View module source:**\\\"},{\\\"path\\\":\\\"/skills/system-maintenance.md\\\",\\\"summary\\\":\\\"1. **Factory reset (wipes everything):**\\\"},{\\\"path\\\":\\\"/skills/backup-and-restore.md\\\",\\\"summary\\\":\\\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\\\"},{\\\"path\\\":\\\"/skills/mindmap-workflow.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"},{\\\"path\\\":\\\"/skills/skills-system-guide.md\\\",\\\"summary\\\":\\\"1. **Always load skills at task start:**\\\"},{\\\"path\\\":\\\"/skills/agent-orchestration.md\\\",\\\"summary\\\":\\\"1. **Agent Registry:**\\\"},{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"1. **Toggle debug panel:**\\\"},{\\\"path\\\":\\\"/skills/webdav-operations.md\\\",\\\"summary\\\":\\\"1. **Configuration:**\\\"},{\\\"path\\\":\\\"/skills/security-and-safety.md\\\",\\\"summary\\\":\\\"1. **Security levels:**\\\"},{\\\"path\\\":\\\"/skills/mindmap-user-guide.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"}],\\\"skills\\\":[{\\\"path\\\":\\\"/skills/navigating-the-terminal.md\\\",\\\"summary\\\":\\\"1. **Get an overview of available commands:**\\\"},{\\\"path\\\":\\\"/skills/memory-and-profile.md\\\",\\\"summary\\\":\\\"1. **User Profile (persists across sessions):**\\\"},{\\\"path\\\":\\\"/skills/web-search-and-fetch.md\\\",\\\"summary\\\":\\\"1. **Search the web:**\\\"},{\\\"path\\\":\\\"/skills/module-management.md\\\",\\\"summary\\\":\\\"1. **View module source:**\\\"},{\\\"path\\\":\\\"/skills/system-maintenance.md\\\",\\\"summary\\\":\\\"1. **Factory reset (wipes everything):**\\\"},{\\\"path\\\":\\\"/skills/backup-and-restore.md\\\",\\\"summary\\\":\\\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\\\"},{\\\"path\\\":\\\"/skills/mindmap-workflow.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"},{\\\"path\\\":\\\"/skills/skills-system-guide.md\\\",\\\"summary\\\":\\\"1. **Always load skills at task start:**\\\"},{\\\"path\\\":\\\"/skills/agent-orchestration.md\\\",\\\"summary\\\":\\\"1. **Agent Registry:**\\\"},{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"1. **Toggle debug panel:**\\\"},{\\\"path\\\":\\\"/skills/webdav-operations.md\\\",\\\"summary\\\":\\\"1. **Configuration:**\\\"},{\\\"path\\\":\\\"/skills/security-and-safety.md\\\",\\\"summary\\\":\\\"1. **Security levels:**\\\"},{\\\"path\\\":\\\"/skills/index.json\\\",\\\"summary\\\":\\\"{\\\\\\\"navigating-the-terminal\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"navigating-the-terminal\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to explore the WebX1...\\\"},{\\\"path\\\":\\\"/skills/mindmap-user-guide.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"},{\\\"path\\\":\\\"/skills/_seeded\\\",\\\"summary\\\":\\\"\\\"}],\\\"navigation\\\":[{\\\"path\\\":\\\"/skills/navigating-the-terminal.md\\\",\\\"summary\\\":\\\"1. **Get an overview of available commands:**\\\"},{\\\"path\\\":\\\"/logs/_sessions/_auto.json\\\",\\\"summary\\\":\\\"{\\\\\\\"type\\\\\\\":\\\\\\\"session\\\\\\\",\\\\\\\"savedAt\\\\\\\":\\\\\\\"2026-06-05T22:17:11.972Z\\\\\\\",\\\\\\\"fsRoot\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"dir\\\\\\\",\\\\\\\"content\\\\\\\":{\\\\\\\"skills\\\\\\\":{\\\\\\\"...\\\"}],\\\"help\\\":[{\\\"path\\\":\\\"/skills/navigating-the-terminal.md\\\",\\\"summary\\\":\\\"1. **Get an overview of available commands:**\\\"},{\\\"path\\\":\\\"/logs/_sessions/_auto.json\\\",\\\"summary\\\":\\\"{\\\\\\\"type\\\\\\\":\\\\\\\"session\\\\\\\",\\\\\\\"savedAt\\\\\\\":\\\\\\\"2026-06-05T22:17:11.972Z\\\\\\\",\\\\\\\"fsRoot\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"dir\\\\\\\",\\\\\\\"content\\\\\\\":{\\\\\\\"skills\\\\\\\":{\\\\\\\"...\\\"}],\\\"filesystem\\\":[{\\\"path\\\":\\\"/skills/navigating-the-terminal.md\\\",\\\"summary\\\":\\\"1. **Get an overview of available commands:**\\\"},{\\\"path\\\":\\\"/logs/_sessions/_auto.json\\\",\\\"summary\\\":\\\"{\\\\\\\"type\\\\\\\":\\\\\\\"session\\\\\\\",\\\\\\\"savedAt\\\\\\\":\\\\\\\"2026-06-05T22:17:11.972Z\\\\\\\",\\\\\\\"fsRoot\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"dir\\\\\\\",\\\\\\\"content\\\\\\\":{\\\\\\\"skills\\\\\\\":{\\\\\\\"...\\\"}],\\\"steps\\\":[{\\\"path\\\":\\\"/skills/navigating-the-terminal.md\\\",\\\"summary\\\":\\\"1. **Get an overview of available commands:**\\\"},{\\\"path\\\":\\\"/skills/memory-and-profile.md\\\",\\\"summary\\\":\\\"1. **User Profile (persists across sessions):**\\\"},{\\\"path\\\":\\\"/skills/web-search-and-fetch.md\\\",\\\"summary\\\":\\\"1. **Search the web:**\\\"},{\\\"path\\\":\\\"/skills/module-management.md\\\",\\\"summary\\\":\\\"1. **View module source:**\\\"},{\\\"path\\\":\\\"/skills/system-maintenance.md\\\",\\\"summary\\\":\\\"1. **Factory reset (wipes everything):**\\\"},{\\\"path\\\":\\\"/skills/backup-and-restore.md\\\",\\\"summary\\\":\\\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\\\"},{\\\"path\\\":\\\"/skills/mindmap-workflow.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"},{\\\"path\\\":\\\"/skills/skills-system-guide.md\\\",\\\"summary\\\":\\\"1. **Always load skills at task start:**\\\"},{\\\"path\\\":\\\"/skills/agent-orchestration.md\\\",\\\"summary\\\":\\\"1. **Agent Registry:**\\\"},{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"1. **Toggle debug panel:**\\\"},{\\\"path\\\":\\\"/skills/webdav-operations.md\\\",\\\"summary\\\":\\\"1. **Configuration:**\\\"},{\\\"path\\\":\\\"/skills/security-and-safety.md\\\",\\\"summary\\\":\\\"1. **Security levels:**\\\"},{\\\"path\\\":\\\"/skills/mindmap-user-guide.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"}],\\\"memory\\\":[{\\\"path\\\":\\\"/skills/memory-and-profile.md\\\",\\\"summary\\\":\\\"1. **User Profile (persists across sessions):**\\\"}],\\\"and\\\":[{\\\"path\\\":\\\"/skills/memory-and-profile.md\\\",\\\"summary\\\":\\\"1. **User Profile (persists across sessions):**\\\"},{\\\"path\\\":\\\"/skills/web-search-and-fetch.md\\\",\\\"summary\\\":\\\"1. **Search the web:**\\\"},{\\\"path\\\":\\\"/skills/backup-and-restore.md\\\",\\\"summary\\\":\\\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\\\"},{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"1. **Toggle debug panel:**\\\"},{\\\"path\\\":\\\"/skills/security-and-safety.md\\\",\\\"summary\\\":\\\"1. **Security levels:**\\\"}],\\\"profile\\\":[{\\\"path\\\":\\\"/skills/memory-and-profile.md\\\",\\\"summary\\\":\\\"1. **User Profile (persists across sessions):**\\\"}],\\\"session\\\":[{\\\"path\\\":\\\"/skills/memory-and-profile.md\\\",\\\"summary\\\":\\\"1. **User Profile (persists across sessions):**\\\"}],\\\"persistence\\\":[{\\\"path\\\":\\\"/skills/memory-and-profile.md\\\",\\\"summary\\\":\\\"1. **User Profile (persists across sessions):**\\\"},{\\\"path\\\":\\\"/skills/backup-and-restore.md\\\",\\\"summary\\\":\\\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\\\"}],\\\"web\\\":[{\\\"path\\\":\\\"/skills/web-search-and-fetch.md\\\",\\\"summary\\\":\\\"1. **Search the web:**\\\"}],\\\"search\\\":[{\\\"path\\\":\\\"/skills/web-search-and-fetch.md\\\",\\\"summary\\\":\\\"1. **Search the web:**\\\"}],\\\"fetch\\\":[{\\\"path\\\":\\\"/skills/web-search-and-fetch.md\\\",\\\"summary\\\":\\\"1. **Search the web:**\\\"}],\\\"proxy\\\":[{\\\"path\\\":\\\"/skills/web-search-and-fetch.md\\\",\\\"summary\\\":\\\"1. **Search the web:**\\\"}],\\\"api\\\":[{\\\"path\\\":\\\"/skills/web-search-and-fetch.md\\\",\\\"summary\\\":\\\"1. **Search the web:**\\\"}],\\\"module\\\":[{\\\"path\\\":\\\"/skills/module-management.md\\\",\\\"summary\\\":\\\"1. **View module source:**\\\"}],\\\"management\\\":[{\\\"path\\\":\\\"/skills/module-management.md\\\",\\\"summary\\\":\\\"1. **View module source:**\\\"}],\\\"modules\\\":[{\\\"path\\\":\\\"/skills/module-management.md\\\",\\\"summary\\\":\\\"1. **View module source:**\\\"}],\\\"editing\\\":[{\\\"path\\\":\\\"/skills/module-management.md\\\",\\\"summary\\\":\\\"1. **View module source:**\\\"}],\\\"code\\\":[{\\\"path\\\":\\\"/skills/module-management.md\\\",\\\"summary\\\":\\\"1. **View module source:**\\\"}],\\\"self-improvement\\\":[{\\\"path\\\":\\\"/skills/module-management.md\\\",\\\"summary\\\":\\\"1. **View module source:**\\\"}],\\\"system\\\":[{\\\"path\\\":\\\"/skills/system-maintenance.md\\\",\\\"summary\\\":\\\"1. **Factory reset (wipes everything):**\\\"},{\\\"path\\\":\\\"/skills/skills-system-guide.md\\\",\\\"summary\\\":\\\"1. **Always load skills at task start:**\\\"}],\\\"maintenance\\\":[{\\\"path\\\":\\\"/skills/system-maintenance.md\\\",\\\"summary\\\":\\\"1. **Factory reset (wipes everything):**\\\"}],\\\"reset\\\":[{\\\"path\\\":\\\"/skills/system-maintenance.md\\\",\\\"summary\\\":\\\"1. **Factory reset (wipes everything):**\\\"}],\\\"troubleshoot\\\":[{\\\"path\\\":\\\"/skills/system-maintenance.md\\\",\\\"summary\\\":\\\"1. **Factory reset (wipes everything):**\\\"}],\\\"config\\\":[{\\\"path\\\":\\\"/skills/system-maintenance.md\\\",\\\"summary\\\":\\\"1. **Factory reset (wipes everything):**\\\"}],\\\"backup\\\":[{\\\"path\\\":\\\"/skills/backup-and-restore.md\\\",\\\"summary\\\":\\\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\\\"},{\\\"path\\\":\\\"/skills/webdav-operations.md\\\",\\\"summary\\\":\\\"1. **Configuration:**\\\"}],\\\"restore\\\":[{\\\"path\\\":\\\"/skills/backup-and-restore.md\\\",\\\"summary\\\":\\\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\\\"}],\\\"export\\\":[{\\\"path\\\":\\\"/skills/backup-and-restore.md\\\",\\\"summary\\\":\\\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\\\"}],\\\"import\\\":[{\\\"path\\\":\\\"/skills/backup-and-restore.md\\\",\\\"summary\\\":\\\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\\\"}],\\\"mindmap\\\":[{\\\"path\\\":\\\"/skills/mindmap-workflow.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"},{\\\"path\\\":\\\"/skills/mindmap-user-guide.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"}],\\\"workflow\\\":[{\\\"path\\\":\\\"/skills/mindmap-workflow.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"}],\\\"brainstorming\\\":[{\\\"path\\\":\\\"/skills/mindmap-workflow.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"},{\\\"path\\\":\\\"/skills/mindmap-user-guide.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"}],\\\"planning\\\":[{\\\"path\\\":\\\"/skills/mindmap-workflow.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"},{\\\"path\\\":\\\"/skills/mindmap-user-guide.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"}],\\\"organization\\\":[{\\\"path\\\":\\\"/skills/mindmap-workflow.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"},{\\\"path\\\":\\\"/skills/mindmap-user-guide.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"}],\\\"guide\\\":[{\\\"path\\\":\\\"/skills/skills-system-guide.md\\\",\\\"summary\\\":\\\"1. **Always load skills at task start:**\\\"},{\\\"path\\\":\\\"/skills/mindmap-user-guide.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"}],\\\"meta\\\":[{\\\"path\\\":\\\"/skills/skills-system-guide.md\\\",\\\"summary\\\":\\\"1. **Always load skills at task start:**\\\"}],\\\"agent\\\":[{\\\"path\\\":\\\"/skills/agent-orchestration.md\\\",\\\"summary\\\":\\\"1. **Agent Registry:**\\\"}],\\\"orchestration\\\":[{\\\"path\\\":\\\"/skills/agent-orchestration.md\\\",\\\"summary\\\":\\\"1. **Agent Registry:**\\\"}],\\\"agents\\\":[{\\\"path\\\":\\\"/skills/agent-orchestration.md\\\",\\\"summary\\\":\\\"1. **Agent Registry:**\\\"}],\\\"delegation\\\":[{\\\"path\\\":\\\"/skills/agent-orchestration.md\\\",\\\"summary\\\":\\\"1. **Agent Registry:**\\\"}],\\\"leases\\\":[{\\\"path\\\":\\\"/skills/agent-orchestration.md\\\",\\\"summary\\\":\\\"1. **Agent Registry:**\\\"}],\\\"debug\\\":[{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"1. **Toggle debug panel:**\\\"}],\\\"panel\\\":[{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"1. **Toggle debug panel:**\\\"}],\\\"logs\\\":[{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"1. **Toggle debug panel:**\\\"}],\\\"logging\\\":[{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"1. **Toggle debug panel:**\\\"}],\\\"diagnostics\\\":[{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"1. **Toggle debug panel:**\\\"}],\\\"troubleshooting\\\":[{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"1. **Toggle debug panel:**\\\"}],\\\"webdav\\\":[{\\\"path\\\":\\\"/skills/webdav-operations.md\\\",\\\"summary\\\":\\\"1. **Configuration:**\\\"}],\\\"operations\\\":[{\\\"path\\\":\\\"/skills/webdav-operations.md\\\",\\\"summary\\\":\\\"1. **Configuration:**\\\"}],\\\"cloud\\\":[{\\\"path\\\":\\\"/skills/webdav-operations.md\\\",\\\"summary\\\":\\\"1. **Configuration:**\\\"}],\\\"sync\\\":[{\\\"path\\\":\\\"/skills/webdav-operations.md\\\",\\\"summary\\\":\\\"1. **Configuration:**\\\"}],\\\"storage\\\":[{\\\"path\\\":\\\"/skills/webdav-operations.md\\\",\\\"summary\\\":\\\"1. **Configuration:**\\\"}],\\\"security\\\":[{\\\"path\\\":\\\"/skills/security-and-safety.md\\\",\\\"summary\\\":\\\"1. **Security levels:**\\\"}],\\\"safety\\\":[{\\\"path\\\":\\\"/skills/security-and-safety.md\\\",\\\"summary\\\":\\\"1. **Security levels:**\\\"}],\\\"blocking\\\":[{\\\"path\\\":\\\"/skills/security-and-safety.md\\\",\\\"summary\\\":\\\"1. **Security levels:**\\\"}],\\\"permissions\\\":[{\\\"path\\\":\\\"/skills/security-and-safety.md\\\",\\\"summary\\\":\\\"1. **Security levels:**\\\"}],\\\"index\\\":[{\\\"path\\\":\\\"/skills/index.json\\\",\\\"summary\\\":\\\"{\\\\\\\"navigating-the-terminal\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"navigating-the-terminal\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to explore the WebX1...\\\"}],\\\"json\\\":[{\\\"path\\\":\\\"/skills/index.json\\\",\\\"summary\\\":\\\"{\\\\\\\"navigating-the-terminal\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"navigating-the-terminal\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to explore the WebX1...\\\"},{\\\"path\\\":\\\"/logs/_sessions/_auto-context.json\\\",\\\"summary\\\":\\\"{\\\\\\\"context\\\\\\\":[{\\\\\\\"role\\\\\\\":\\\\\\\"user\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"setup system\\\\\\\"},{\\\\\\\"role\\\\\\\":\\\\\\\"assistant\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"The system appea...\\\"},{\\\"path\\\":\\\"/logs/_sessions/_auto.json\\\",\\\"summary\\\":\\\"{\\\\\\\"type\\\\\\\":\\\\\\\"session\\\\\\\",\\\\\\\"savedAt\\\\\\\":\\\\\\\"2026-06-05T22:17:11.972Z\\\\\\\",\\\\\\\"fsRoot\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"dir\\\\\\\",\\\\\\\"content\\\\\\\":{\\\\\\\"skills\\\\\\\":{\\\\\\\"...\\\"}],\\\"json-file\\\":[{\\\"path\\\":\\\"/skills/index.json\\\",\\\"summary\\\":\\\"{\\\\\\\"navigating-the-terminal\\\\\\\":{\\\\\\\"name\\\\\\\":\\\\\\\"navigating-the-terminal\\\\\\\",\\\\\\\"description\\\\\\\":\\\\\\\"How to explore the WebX1...\\\"},{\\\"path\\\":\\\"/logs/_sessions/_auto-context.json\\\",\\\"summary\\\":\\\"{\\\\\\\"context\\\\\\\":[{\\\\\\\"role\\\\\\\":\\\\\\\"user\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"setup system\\\\\\\"},{\\\\\\\"role\\\\\\\":\\\\\\\"assistant\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"The system appea...\\\"},{\\\"path\\\":\\\"/logs/_sessions/_auto.json\\\",\\\"summary\\\":\\\"{\\\\\\\"type\\\\\\\":\\\\\\\"session\\\\\\\",\\\\\\\"savedAt\\\\\\\":\\\\\\\"2026-06-05T22:17:11.972Z\\\\\\\",\\\\\\\"fsRoot\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"dir\\\\\\\",\\\\\\\"content\\\\\\\":{\\\\\\\"skills\\\\\\\":{\\\\\\\"...\\\"}],\\\"user\\\":[{\\\"path\\\":\\\"/skills/mindmap-user-guide.md\\\",\\\"summary\\\":\\\"1. **Create a new mindmap:**\\\"}],\\\"seeded\\\":[{\\\"path\\\":\\\"/skills/_seeded\\\",\\\"summary\\\":\\\"\\\"}],\\\"current\\\":[{\\\"path\\\":\\\"/logs/current.log\\\",\\\"summary\\\":\\\"[22:10:06][INFO][System] WebX11 v4.2 started\\\"}],\\\"log\\\":[{\\\"path\\\":\\\"/logs/current.log\\\",\\\"summary\\\":\\\"[22:10:06][INFO][System] WebX11 v4.2 started\\\"}],\\\"auto\\\":[{\\\"path\\\":\\\"/logs/_sessions/_auto-context.json\\\",\\\"summary\\\":\\\"{\\\\\\\"context\\\\\\\":[{\\\\\\\"role\\\\\\\":\\\\\\\"user\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"setup system\\\\\\\"},{\\\\\\\"role\\\\\\\":\\\\\\\"assistant\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"The system appea...\\\"},{\\\"path\\\":\\\"/logs/_sessions/_auto.json\\\",\\\"summary\\\":\\\"{\\\\\\\"type\\\\\\\":\\\\\\\"session\\\\\\\",\\\\\\\"savedAt\\\\\\\":\\\\\\\"2026-06-05T22:17:11.972Z\\\\\\\",\\\\\\\"fsRoot\\\\\\\":{\\\\\\\"type\\\\\\\":\\\\\\\"dir\\\\\\\",\\\\\\\"content\\\\\\\":{\\\\\\\"skills\\\\\\\":{\\\\\\\"...\\\"}],\\\"context\\\":[{\\\"path\\\":\\\"/logs/_sessions/_auto-context.json\\\",\\\"summary\\\":\\\"{\\\\\\\"context\\\\\\\":[{\\\\\\\"role\\\\\\\":\\\\\\\"user\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"setup system\\\\\\\"},{\\\\\\\"role\\\\\\\":\\\\\\\"assistant\\\\\\\",\\\\\\\"content\\\\\\\":\\\\\\\"The system appea...\\\"}],\\\"tree\\\":[{\\\"path\\\":\\\"/tree\\\",\\\"summary\\\":\\\"\\\"}],\\\"skill\\\":[{\\\"path\\\":\\\"/skills/navigating-the-terminal.md\\\",\\\"summary\\\":\\\"Skill: navigating-the-terminal\\\"},{\\\"path\\\":\\\"/skills/memory-and-profile.md\\\",\\\"summary\\\":\\\"Skill: memory-and-profile\\\"},{\\\"path\\\":\\\"/skills/web-search-and-fetch.md\\\",\\\"summary\\\":\\\"Skill: web-search-and-fetch\\\"},{\\\"path\\\":\\\"/skills/module-management.md\\\",\\\"summary\\\":\\\"Skill: module-management\\\"},{\\\"path\\\":\\\"/skills/system-maintenance.md\\\",\\\"summary\\\":\\\"Skill: system-maintenance\\\"},{\\\"path\\\":\\\"/skills/backup-and-restore.md\\\",\\\"summary\\\":\\\"Skill: backup-and-restore\\\"},{\\\"path\\\":\\\"/skills/mindmap-workflow.md\\\",\\\"summary\\\":\\\"Skill: mindmap-workflow\\\"},{\\\"path\\\":\\\"/skills/skills-system-guide.md\\\",\\\"summary\\\":\\\"Skill: skills-system-guide\\\"},{\\\"path\\\":\\\"/skills/agent-orchestration.md\\\",\\\"summary\\\":\\\"Skill: agent-orchestration\\\"},{\\\"path\\\":\\\"/skills/debug-panel-and-logs.md\\\",\\\"summary\\\":\\\"Skill: debug-panel-and-logs\\\"},{\\\"path\\\":\\\"/skills/webdav-operations.md\\\",\\\"summary\\\":\\\"Skill: webdav-operations\\\"},{\\\"path\\\":\\\"/skills/security-and-safety.md\\\",\\\"summary\\\":\\\"Skill: security-and-safety\\\"},{\\\"path\\\":\\\"/skills/mindmap-user-guide.md\\\",\\\"summary\\\":\\\"Skill: mindmap-user-guide\\\"}]}\",\"modified\":\"2026-06-05T22:17:37.856Z\"}}}}},\"currentPath\":[\"logs\"],\"version\":1,\"terminalLines\":[{\"l\":\"Tools were executed but no final answer was produced — try a more specific query.\",\"t\":\"info\"},{\"l\":\"💡 Used 8 tools — create a skill to save this workflow\",\"t\":\"info\"},{\"l\":\"setup memory graph\",\"t\":\"command-prompt\"},{\"l\":\"Security: Unknown command \\\"setup\\\". Did you mean: \\\"set\\\"?\",\"t\":\"warning\"},{\"l\":\"Security: Did you mean \\\"set\\\"? Routing to AI...\",\"t\":\"warning\"},{\"l\":\"→ Routing to AI assistant...\",\"t\":\"info\"},{\"l\":\"🤖 WebX11AI thinking...\",\"t\":\"info\"},{\"l\":\"🔧 AI wants 1 tool(s) — turn 1/8 (3s)\",\"t\":\"info\"},{\"l\":\"🔧 Tool: get_help({})\",\"t\":\"info\"},{\"l\":\"🔧 AI wants 1 tool(s) — turn 2/8 (3s)\",\"t\":\"info\"},{\"l\":\"ai-allow\",\"t\":\"command-prompt\"},{\"l\":\"Action allowed\",\"t\":\"success\"},{\"l\":\"🔧 Tool: run_command({\\\"command\\\":\\\"nvfs-status\\\"})\",\"t\":\"info\"},{\"l\":\"📊 Result (0s): 🧠 Neural VFS Index\\n Concepts: 72\\n Files indexed: 19\\n Last scan: 2026-06-05T22:17:37.855Z\",\"t\":\"info\"},{\"l\":\"🔧 AI wants 1 tool(s) — turn 3/8 (3s)\",\"t\":\"info\"},{\"l\":\"ai-allow\",\"t\":\"command-prompt\"},{\"l\":\"Action allowed\",\"t\":\"success\"},{\"l\":\"🔧 Tool: run_command({\\\"command\\\":\\\"memgraph-stats\\\"})\",\"t\":\"info\"},{\"l\":\"📊 Result (0s): No graph data yet. Use commands normally to build it.\",\"t\":\"info\"},{\"l\":\"💬 AI answered (turn 4/8, 4s)\",\"t\":\"info\"},{\"l\":\"memgraph-stats \",\"t\":\"command-prompt\"},{\"l\":\"No graph data yet. Use commands normally to build it.\",\"t\":\"info\"},{\"l\":\"when ll it populate?\",\"t\":\"command-prompt\"},{\"l\":\"Security: Unknown command \\\"when\\\". Did you mean: \\\"web\\\"?\",\"t\":\"warning\"},{\"l\":\"Security: Did you mean \\\"web\\\"? Routing to AI...\",\"t\":\"warning\"},{\"l\":\"→ Routing to AI assistant...\",\"t\":\"info\"},{\"l\":\"🤖 WebX11AI thinking...\",\"t\":\"info\"},{\"l\":\"🔧 AI wants 1 tool(s) — turn 1/8 (5s)\",\"t\":\"info\"},{\"l\":\"ai-allow\",\"t\":\"command-prompt\"},{\"l\":\"Action allowed\",\"t\":\"success\"},{\"l\":\"🔧 Tool: run_command({\\\"command\\\":\\\"memgraph-stats\\\"})\",\"t\":\"info\"},{\"l\":\"📊 Result (0s): No graph data yet. Use commands normally to build it.\",\"t\":\"info\"},{\"l\":\"🔧 AI wants 1 tool(s) — turn 2/8 (6s)\",\"t\":\"info\"},{\"l\":\"ai-allow\",\"t\":\"command-prompt\"},{\"l\":\"Action allowed\",\"t\":\"success\"},{\"l\":\"🔧 Tool: run_command({\\\"command\\\":\\\"get_help\\\"})\",\"t\":\"info\"},{\"l\":\"📊 Result (0s): Command not found: get_help\",\"t\":\"info\"},{\"l\":\"🔧 AI wants 1 tool(s) — turn 3/8 (2s)\",\"t\":\"info\"},{\"l\":\"🔧 Tool: get_help({})\",\"t\":\"info\"},{\"l\":\"🔧 AI wants 1 tool(s) — turn 4/8 (3s)\",\"t\":\"info\"},{\"l\":\"ai-allow\",\"t\":\"command-prompt\"},{\"l\":\"Action allowed\",\"t\":\"success\"},{\"l\":\"🔧 Tool: run_command({\\\"command\\\":\\\"memgraph-status\\\"})\",\"t\":\"info\"},{\"l\":\"📊 Result (0s): 🧠 Memory Graph\\n Nodes: 0 ()\\n Edges: 0\\n Total accesses: 0\\n Path: /.memory_graph/\",\"t\":\"info\"},{\"l\":\"💬 AI answered (turn 5/8, 7s)\",\"t\":\"info\"},{\"l\":\"ok lets test if it teslly work?\",\"t\":\"command-prompt\"},{\"l\":\"Security: Unknown command \\\"ok\\\". Did you mean: \\\"ls\\\"?\",\"t\":\"warning\"},{\"l\":\"Security: Did you mean \\\"ls\\\"? Routing to AI...\",\"t\":\"warning\"},{\"l\":\"→ Routing to AI assistant...\",\"t\":\"info\"},{\"l\":\"🤖 WebX11AI thinking...\",\"t\":\"info\"}]}","modified":"2026-06-05T22:20:11.967Z"}}}}},"tree":{"type":"file","content":"","modified":"2026-06-05T22:13:01.376Z"},"memory":{"type":"dir","content":{}},".semantic_index":{"type":"dir","content":{"map.json":{"type":"file","content":"{\"navigating\":[{\"path\":\"/skills/navigating-the-terminal.md\",\"summary\":\"1. **Get an overview of available commands:**\"}],\"the\":[{\"path\":\"/skills/navigating-the-terminal.md\",\"summary\":\"1. **Get an overview of available commands:**\"}],\"terminal\":[{\"path\":\"/skills/navigating-the-terminal.md\",\"summary\":\"1. **Get an overview of available commands:**\"},{\"path\":\"/logs/_sessions/_auto.json\",\"summary\":\"{\\\"type\\\":\\\"session\\\",\\\"savedAt\\\":\\\"2026-06-05T22:20:11.966Z\\\",\\\"fsRoot\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"skills\\\":{\\\"...\"}],\"md-file\":[{\"path\":\"/skills/navigating-the-terminal.md\",\"summary\":\"1. **Get an overview of available commands:**\"},{\"path\":\"/skills/memory-and-profile.md\",\"summary\":\"1. **User Profile (persists across sessions):**\"},{\"path\":\"/skills/web-search-and-fetch.md\",\"summary\":\"1. **Search the web:**\"},{\"path\":\"/skills/module-management.md\",\"summary\":\"1. **View module source:**\"},{\"path\":\"/skills/system-maintenance.md\",\"summary\":\"1. **Factory reset (wipes everything):**\"},{\"path\":\"/skills/backup-and-restore.md\",\"summary\":\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\"},{\"path\":\"/skills/mindmap-workflow.md\",\"summary\":\"1. **Create a new mindmap:**\"},{\"path\":\"/skills/skills-system-guide.md\",\"summary\":\"1. **Always load skills at task start:**\"},{\"path\":\"/skills/agent-orchestration.md\",\"summary\":\"1. **Agent Registry:**\"},{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"1. **Toggle debug panel:**\"},{\"path\":\"/skills/webdav-operations.md\",\"summary\":\"1. **Configuration:**\"},{\"path\":\"/skills/security-and-safety.md\",\"summary\":\"1. **Security levels:**\"},{\"path\":\"/skills/mindmap-user-guide.md\",\"summary\":\"1. **Create a new mindmap:**\"}],\"skills\":[{\"path\":\"/skills/navigating-the-terminal.md\",\"summary\":\"1. **Get an overview of available commands:**\"},{\"path\":\"/skills/memory-and-profile.md\",\"summary\":\"1. **User Profile (persists across sessions):**\"},{\"path\":\"/skills/web-search-and-fetch.md\",\"summary\":\"1. **Search the web:**\"},{\"path\":\"/skills/module-management.md\",\"summary\":\"1. **View module source:**\"},{\"path\":\"/skills/system-maintenance.md\",\"summary\":\"1. **Factory reset (wipes everything):**\"},{\"path\":\"/skills/backup-and-restore.md\",\"summary\":\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\"},{\"path\":\"/skills/mindmap-workflow.md\",\"summary\":\"1. **Create a new mindmap:**\"},{\"path\":\"/skills/skills-system-guide.md\",\"summary\":\"1. **Always load skills at task start:**\"},{\"path\":\"/skills/agent-orchestration.md\",\"summary\":\"1. **Agent Registry:**\"},{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"1. **Toggle debug panel:**\"},{\"path\":\"/skills/webdav-operations.md\",\"summary\":\"1. **Configuration:**\"},{\"path\":\"/skills/security-and-safety.md\",\"summary\":\"1. **Security levels:**\"},{\"path\":\"/skills/index.json\",\"summary\":\"{\\\"navigating-the-terminal\\\":{\\\"name\\\":\\\"navigating-the-terminal\\\",\\\"description\\\":\\\"How to explore the WebX1...\"},{\"path\":\"/skills/mindmap-user-guide.md\",\"summary\":\"1. **Create a new mindmap:**\"},{\"path\":\"/skills/_seeded\",\"summary\":\"\"}],\"navigation\":[{\"path\":\"/skills/navigating-the-terminal.md\",\"summary\":\"1. **Get an overview of available commands:**\"},{\"path\":\"/logs/_sessions/_auto.json\",\"summary\":\"{\\\"type\\\":\\\"session\\\",\\\"savedAt\\\":\\\"2026-06-05T22:20:11.966Z\\\",\\\"fsRoot\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"skills\\\":{\\\"...\"}],\"help\":[{\"path\":\"/skills/navigating-the-terminal.md\",\"summary\":\"1. **Get an overview of available commands:**\"},{\"path\":\"/logs/_sessions/_auto.json\",\"summary\":\"{\\\"type\\\":\\\"session\\\",\\\"savedAt\\\":\\\"2026-06-05T22:20:11.966Z\\\",\\\"fsRoot\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"skills\\\":{\\\"...\"}],\"filesystem\":[{\"path\":\"/skills/navigating-the-terminal.md\",\"summary\":\"1. **Get an overview of available commands:**\"},{\"path\":\"/logs/_sessions/_auto.json\",\"summary\":\"{\\\"type\\\":\\\"session\\\",\\\"savedAt\\\":\\\"2026-06-05T22:20:11.966Z\\\",\\\"fsRoot\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"skills\\\":{\\\"...\"}],\"steps\":[{\"path\":\"/skills/navigating-the-terminal.md\",\"summary\":\"1. **Get an overview of available commands:**\"},{\"path\":\"/skills/memory-and-profile.md\",\"summary\":\"1. **User Profile (persists across sessions):**\"},{\"path\":\"/skills/web-search-and-fetch.md\",\"summary\":\"1. **Search the web:**\"},{\"path\":\"/skills/module-management.md\",\"summary\":\"1. **View module source:**\"},{\"path\":\"/skills/system-maintenance.md\",\"summary\":\"1. **Factory reset (wipes everything):**\"},{\"path\":\"/skills/backup-and-restore.md\",\"summary\":\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\"},{\"path\":\"/skills/mindmap-workflow.md\",\"summary\":\"1. **Create a new mindmap:**\"},{\"path\":\"/skills/skills-system-guide.md\",\"summary\":\"1. **Always load skills at task start:**\"},{\"path\":\"/skills/agent-orchestration.md\",\"summary\":\"1. **Agent Registry:**\"},{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"1. **Toggle debug panel:**\"},{\"path\":\"/skills/webdav-operations.md\",\"summary\":\"1. **Configuration:**\"},{\"path\":\"/skills/security-and-safety.md\",\"summary\":\"1. **Security levels:**\"},{\"path\":\"/skills/mindmap-user-guide.md\",\"summary\":\"1. **Create a new mindmap:**\"}],\"memory\":[{\"path\":\"/skills/memory-and-profile.md\",\"summary\":\"1. **User Profile (persists across sessions):**\"}],\"and\":[{\"path\":\"/skills/memory-and-profile.md\",\"summary\":\"1. **User Profile (persists across sessions):**\"},{\"path\":\"/skills/web-search-and-fetch.md\",\"summary\":\"1. **Search the web:**\"},{\"path\":\"/skills/backup-and-restore.md\",\"summary\":\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\"},{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"1. **Toggle debug panel:**\"},{\"path\":\"/skills/security-and-safety.md\",\"summary\":\"1. **Security levels:**\"}],\"profile\":[{\"path\":\"/skills/memory-and-profile.md\",\"summary\":\"1. **User Profile (persists across sessions):**\"}],\"session\":[{\"path\":\"/skills/memory-and-profile.md\",\"summary\":\"1. **User Profile (persists across sessions):**\"}],\"persistence\":[{\"path\":\"/skills/memory-and-profile.md\",\"summary\":\"1. **User Profile (persists across sessions):**\"},{\"path\":\"/skills/backup-and-restore.md\",\"summary\":\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\"}],\"web\":[{\"path\":\"/skills/web-search-and-fetch.md\",\"summary\":\"1. **Search the web:**\"}],\"search\":[{\"path\":\"/skills/web-search-and-fetch.md\",\"summary\":\"1. **Search the web:**\"}],\"fetch\":[{\"path\":\"/skills/web-search-and-fetch.md\",\"summary\":\"1. **Search the web:**\"}],\"proxy\":[{\"path\":\"/skills/web-search-and-fetch.md\",\"summary\":\"1. **Search the web:**\"}],\"api\":[{\"path\":\"/skills/web-search-and-fetch.md\",\"summary\":\"1. **Search the web:**\"}],\"module\":[{\"path\":\"/skills/module-management.md\",\"summary\":\"1. **View module source:**\"}],\"management\":[{\"path\":\"/skills/module-management.md\",\"summary\":\"1. **View module source:**\"}],\"modules\":[{\"path\":\"/skills/module-management.md\",\"summary\":\"1. **View module source:**\"}],\"editing\":[{\"path\":\"/skills/module-management.md\",\"summary\":\"1. **View module source:**\"}],\"code\":[{\"path\":\"/skills/module-management.md\",\"summary\":\"1. **View module source:**\"}],\"self-improvement\":[{\"path\":\"/skills/module-management.md\",\"summary\":\"1. **View module source:**\"}],\"system\":[{\"path\":\"/skills/system-maintenance.md\",\"summary\":\"1. **Factory reset (wipes everything):**\"},{\"path\":\"/skills/skills-system-guide.md\",\"summary\":\"1. **Always load skills at task start:**\"}],\"maintenance\":[{\"path\":\"/skills/system-maintenance.md\",\"summary\":\"1. **Factory reset (wipes everything):**\"}],\"reset\":[{\"path\":\"/skills/system-maintenance.md\",\"summary\":\"1. **Factory reset (wipes everything):**\"}],\"troubleshoot\":[{\"path\":\"/skills/system-maintenance.md\",\"summary\":\"1. **Factory reset (wipes everything):**\"}],\"config\":[{\"path\":\"/skills/system-maintenance.md\",\"summary\":\"1. **Factory reset (wipes everything):**\"}],\"backup\":[{\"path\":\"/skills/backup-and-restore.md\",\"summary\":\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\"},{\"path\":\"/skills/webdav-operations.md\",\"summary\":\"1. **Configuration:**\"}],\"restore\":[{\"path\":\"/skills/backup-and-restore.md\",\"summary\":\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\"}],\"export\":[{\"path\":\"/skills/backup-and-restore.md\",\"summary\":\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\"}],\"import\":[{\"path\":\"/skills/backup-and-restore.md\",\"summary\":\"- vfs-export — downloads the entire virtual filesystem as a dated JSON file\"}],\"mindmap\":[{\"path\":\"/skills/mindmap-workflow.md\",\"summary\":\"1. **Create a new mindmap:**\"},{\"path\":\"/skills/mindmap-user-guide.md\",\"summary\":\"1. **Create a new mindmap:**\"}],\"workflow\":[{\"path\":\"/skills/mindmap-workflow.md\",\"summary\":\"1. **Create a new mindmap:**\"}],\"brainstorming\":[{\"path\":\"/skills/mindmap-workflow.md\",\"summary\":\"1. **Create a new mindmap:**\"},{\"path\":\"/skills/mindmap-user-guide.md\",\"summary\":\"1. **Create a new mindmap:**\"}],\"planning\":[{\"path\":\"/skills/mindmap-workflow.md\",\"summary\":\"1. **Create a new mindmap:**\"},{\"path\":\"/skills/mindmap-user-guide.md\",\"summary\":\"1. **Create a new mindmap:**\"}],\"organization\":[{\"path\":\"/skills/mindmap-workflow.md\",\"summary\":\"1. **Create a new mindmap:**\"},{\"path\":\"/skills/mindmap-user-guide.md\",\"summary\":\"1. **Create a new mindmap:**\"}],\"guide\":[{\"path\":\"/skills/skills-system-guide.md\",\"summary\":\"1. **Always load skills at task start:**\"},{\"path\":\"/skills/mindmap-user-guide.md\",\"summary\":\"1. **Create a new mindmap:**\"}],\"meta\":[{\"path\":\"/skills/skills-system-guide.md\",\"summary\":\"1. **Always load skills at task start:**\"}],\"agent\":[{\"path\":\"/skills/agent-orchestration.md\",\"summary\":\"1. **Agent Registry:**\"}],\"orchestration\":[{\"path\":\"/skills/agent-orchestration.md\",\"summary\":\"1. **Agent Registry:**\"}],\"agents\":[{\"path\":\"/skills/agent-orchestration.md\",\"summary\":\"1. **Agent Registry:**\"}],\"delegation\":[{\"path\":\"/skills/agent-orchestration.md\",\"summary\":\"1. **Agent Registry:**\"}],\"leases\":[{\"path\":\"/skills/agent-orchestration.md\",\"summary\":\"1. **Agent Registry:**\"}],\"debug\":[{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"1. **Toggle debug panel:**\"}],\"panel\":[{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"1. **Toggle debug panel:**\"}],\"logs\":[{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"1. **Toggle debug panel:**\"}],\"logging\":[{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"1. **Toggle debug panel:**\"}],\"diagnostics\":[{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"1. **Toggle debug panel:**\"}],\"troubleshooting\":[{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"1. **Toggle debug panel:**\"}],\"webdav\":[{\"path\":\"/skills/webdav-operations.md\",\"summary\":\"1. **Configuration:**\"}],\"operations\":[{\"path\":\"/skills/webdav-operations.md\",\"summary\":\"1. **Configuration:**\"}],\"cloud\":[{\"path\":\"/skills/webdav-operations.md\",\"summary\":\"1. **Configuration:**\"}],\"sync\":[{\"path\":\"/skills/webdav-operations.md\",\"summary\":\"1. **Configuration:**\"}],\"storage\":[{\"path\":\"/skills/webdav-operations.md\",\"summary\":\"1. **Configuration:**\"}],\"security\":[{\"path\":\"/skills/security-and-safety.md\",\"summary\":\"1. **Security levels:**\"}],\"safety\":[{\"path\":\"/skills/security-and-safety.md\",\"summary\":\"1. **Security levels:**\"}],\"blocking\":[{\"path\":\"/skills/security-and-safety.md\",\"summary\":\"1. **Security levels:**\"}],\"permissions\":[{\"path\":\"/skills/security-and-safety.md\",\"summary\":\"1. **Security levels:**\"}],\"index\":[{\"path\":\"/skills/index.json\",\"summary\":\"{\\\"navigating-the-terminal\\\":{\\\"name\\\":\\\"navigating-the-terminal\\\",\\\"description\\\":\\\"How to explore the WebX1...\"}],\"json\":[{\"path\":\"/skills/index.json\",\"summary\":\"{\\\"navigating-the-terminal\\\":{\\\"name\\\":\\\"navigating-the-terminal\\\",\\\"description\\\":\\\"How to explore the WebX1...\"},{\"path\":\"/logs/_sessions/_auto-context.json\",\"summary\":\"{\\\"context\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"setup system\\\"},{\\\"role\\\":\\\"assistant\\\",\\\"content\\\":\\\"The system appea...\"},{\"path\":\"/logs/_sessions/_auto.json\",\"summary\":\"{\\\"type\\\":\\\"session\\\",\\\"savedAt\\\":\\\"2026-06-05T22:20:11.966Z\\\",\\\"fsRoot\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"skills\\\":{\\\"...\"}],\"json-file\":[{\"path\":\"/skills/index.json\",\"summary\":\"{\\\"navigating-the-terminal\\\":{\\\"name\\\":\\\"navigating-the-terminal\\\",\\\"description\\\":\\\"How to explore the WebX1...\"},{\"path\":\"/logs/_sessions/_auto-context.json\",\"summary\":\"{\\\"context\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"setup system\\\"},{\\\"role\\\":\\\"assistant\\\",\\\"content\\\":\\\"The system appea...\"},{\"path\":\"/logs/_sessions/_auto.json\",\"summary\":\"{\\\"type\\\":\\\"session\\\",\\\"savedAt\\\":\\\"2026-06-05T22:20:11.966Z\\\",\\\"fsRoot\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"skills\\\":{\\\"...\"}],\"user\":[{\"path\":\"/skills/mindmap-user-guide.md\",\"summary\":\"1. **Create a new mindmap:**\"}],\"seeded\":[{\"path\":\"/skills/_seeded\",\"summary\":\"\"}],\"current\":[{\"path\":\"/logs/current.log\",\"summary\":\"[22:10:06][INFO][System] WebX11 v4.2 started\"}],\"log\":[{\"path\":\"/logs/current.log\",\"summary\":\"[22:10:06][INFO][System] WebX11 v4.2 started\"}],\"auto\":[{\"path\":\"/logs/_sessions/_auto-context.json\",\"summary\":\"{\\\"context\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"setup system\\\"},{\\\"role\\\":\\\"assistant\\\",\\\"content\\\":\\\"The system appea...\"},{\"path\":\"/logs/_sessions/_auto.json\",\"summary\":\"{\\\"type\\\":\\\"session\\\",\\\"savedAt\\\":\\\"2026-06-05T22:20:11.966Z\\\",\\\"fsRoot\\\":{\\\"type\\\":\\\"dir\\\",\\\"content\\\":{\\\"skills\\\":{\\\"...\"}],\"context\":[{\"path\":\"/logs/_sessions/_auto-context.json\",\"summary\":\"{\\\"context\\\":[{\\\"role\\\":\\\"user\\\",\\\"content\\\":\\\"setup system\\\"},{\\\"role\\\":\\\"assistant\\\",\\\"content\\\":\\\"The system appea...\"}],\"tree\":[{\"path\":\"/tree\",\"summary\":\"\"}],\"skill\":[{\"path\":\"/skills/navigating-the-terminal.md\",\"summary\":\"Skill: navigating-the-terminal\"},{\"path\":\"/skills/memory-and-profile.md\",\"summary\":\"Skill: memory-and-profile\"},{\"path\":\"/skills/web-search-and-fetch.md\",\"summary\":\"Skill: web-search-and-fetch\"},{\"path\":\"/skills/module-management.md\",\"summary\":\"Skill: module-management\"},{\"path\":\"/skills/system-maintenance.md\",\"summary\":\"Skill: system-maintenance\"},{\"path\":\"/skills/backup-and-restore.md\",\"summary\":\"Skill: backup-and-restore\"},{\"path\":\"/skills/mindmap-workflow.md\",\"summary\":\"Skill: mindmap-workflow\"},{\"path\":\"/skills/skills-system-guide.md\",\"summary\":\"Skill: skills-system-guide\"},{\"path\":\"/skills/agent-orchestration.md\",\"summary\":\"Skill: agent-orchestration\"},{\"path\":\"/skills/debug-panel-and-logs.md\",\"summary\":\"Skill: debug-panel-and-logs\"},{\"path\":\"/skills/webdav-operations.md\",\"summary\":\"Skill: webdav-operations\"},{\"path\":\"/skills/security-and-safety.md\",\"summary\":\"Skill: security-and-safety\"},{\"path\":\"/skills/mindmap-user-guide.md\",\"summary\":\"Skill: mindmap-user-guide\"}]}","modified":"2026-06-05T22:20:16.742Z"}}}}},"currentPath":["logs"],"version":1,"terminalLines":[{"l":"[22:22:38][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)","t":"info"},{"l":"[22:22:40][INFO][AI] Tool run_command ok (0s)","t":"info"},{"l":"[22:22:44][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)","t":"info"},{"l":"[22:22:44][INFO][AI] Tool get_status ok (0s)","t":"info"},{"l":"[22:22:46][INFO][Ollama] chatWithTools round-trip: 2s (model: minimax-m2.5:cloud, provider: Ollama)","t":"info"},{"l":"[22:22:49][INFO][AI] Tool run_command ok (0s)","t":"info"},{"l":"[22:22:53][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)","t":"info"},{"l":"[22:22:53][INFO][AI] Tool get_module_status ok (0s)","t":"info"},{"l":"[22:22:57][INFO][Ollama] chatWithTools round-trip: 4s (model: minimax-m2.5:cloud, provider: Ollama)","t":"info"},{"l":"[22:22:57][INFO][AI] Tool view_module ok (0s)","t":"info"},{"l":"[22:22:58][INFO][AI] Query: what do you think","t":"info"},{"l":"[22:22:58][INFO][AI] Used 8 tool(s)","t":"info"},{"l":"[22:24:09][INFO][Ollama] chatWithTools round-trip: 53s (model: minimax-m2.5:cloud, provider: Ollama)","t":"info"},{"l":"[22:24:12][INFO][AI] Tool run_command ok (0s)","t":"info"},{"l":"[22:24:15][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)","t":"info"},{"l":"[22:24:15][INFO][AI] Tool get_help ok (0s)","t":"info"},{"l":"[22:24:18][INFO][Ollama] chatWithTools round-trip: 3s (model: minimax-m2.5:cloud, provider: Ollama)","t":"info"},{"l":"[22:24:21][INFO][AI] Tool run_command ok (0s)","t":"info"},{"l":"🔧 AI wants 1 tool(s) — turn 4/8 (5s)","t":"info"},{"l":"ai-allow","t":"command-prompt"},{"l":"Action allowed","t":"success"},{"l":"🔧 Tool: run_command({\"command\":\"session-list\"})","t":"info"},{"l":"📊 Result (0s): Saved sessions:\n _auto-context (0 items, 06/06/2026, 00:22:58)\n _auto (5 items, 06/06/2026, 00:23:11)","t":"info"},{"l":"🔧 AI wants 1 tool(s) — turn 5/8 (6s)","t":"info"},{"l":"ai-allow","t":"command-prompt"},{"l":"Action allowed","t":"success"},{"l":"🔧 Tool: run_command({\"command\":\"config-list | grep -i mem\"})","t":"info"},{"l":"📊 Result (0s): No configuration saved","t":"info"},{"l":"🔧 AI wants 1 tool(s) — turn 6/8 (4s)","t":"info"},{"l":"ai-allow","t":"command-prompt"},{"l":"Action allowed","t":"success"},{"l":"🔧 Tool: run_command({\"command\":\"config-list | grep -i graph\"})","t":"info"},{"l":"📊 Result (0s): No configuration saved","t":"info"},{"l":"🔧 AI wants 1 tool(s) — turn 7/8 (3s)","t":"info"},{"l":"ai-allow","t":"command-prompt"},{"l":"Action allowed","t":"success"},{"l":"🔧 Tool: run_command({\"command\":\"session-load _auto\"})","t":"info"},{"l":"ls","t":"command-prompt"},{"l":"📊 Result (0s): Session loaded: _auto (06/06/2026, 00:23:11)\n\n📦 [Shadow VFS: 3 change(s) — modified:logs/current.log, modified:logs/_sessions/_auto.json, deleted:_se...(truncated from 157 chars)","t":"info"},{"l":"⏱ Final turn (8/8) — AI must provide final answer","t":"warning"},{"l":"🔧 AI wants 1 tool(s) — turn 8/8 (3s)","t":"info"},{"l":"ai-allow","t":"command-prompt"},{"l":"Action allowed","t":"success"},{"l":"🔧 Tool: run_command({\"command\":\"cat /logs/_sessions/_auto.json\"})","t":"info"},{"l":"📊 Result (0s): {\"type\":\"session\",\"savedAt\":\"2026-06-05T22:20:11.966Z\",\"fsRoot\":{\"type\":\"dir\",\"content\":{\"skills\":{\"type\":\"dir\",\"content\":{\"navigating-the-terminal.md...(truncated from 88792 chars)","t":"info"},{"l":"🤖 AI reached the 8/8 tool limit.","t":"warning"},{"l":"Tools were executed but no final answer was produced — try a more specific query.","t":"info"},{"l":"memgraph-stats ","t":"command-prompt"},{"l":"No graph data yet. Use commands normally to build it.","t":"info"},{"l":"files ","t":"command-prompt"}]}
\ No newline at end of file diff --git a/downloads/newos4_whitepaper.html b/downloads/newos4_whitepaper.html index 006113a..46c1397 100644 --- a/downloads/newos4_whitepaper.html +++ b/downloads/newos4_whitepaper.html @@ -242,6 +242,13 @@ <li>✅ Predictive resource allocation — task duration/turns prediction from historical data.</li> <li>✅ Global World Model — system self-awareness synthesis from all subsystems.</li> </ul> + + <h3>Phase 4 — Agent Safety Security Layer <span class="status-done">✅ RELEASED</span></h3> + <ul> + <li>✅ <strong>Guardrail Layer</strong> — Pre-execution policy engine (8 rules) intercepts AI tool calls matching dangerous patterns (<code>rm -rf</code>, <code>curl|bash</code>, <code>chmod 777</code>, <code>eval</code>, mass-delete, sensitive metadata deletion, external downloads, env overwrites). Policy stored in localStorage, editable via <code>guardrail-add</code> / <code>guardrail-remove</code>.</li> + <li>✅ <strong>Confidence Escalation</strong> — AI must declare <code>Confidence: N%</code> in its reasoning before executing destructive actions. Below 90% → manual approval. No confidence declared → manual approval required by default.</li> + <li>✅ <strong>Shadow VFS</strong> — <code>shadow <command></code> snapshots VFS state, runs the command, diffs all filesystem changes. User can <code>shadow-commit</code> or <code>shadow-rollback</code>. AI's <code>run_command</code> tool auto-snapshots and appends shadow diff to every result.</li> + </ul> </section> <footer> diff --git a/downloads/preview_newos44.html b/downloads/preview_newos44.html new file mode 100644 index 0000000..09ea0e5 --- /dev/null +++ b/downloads/preview_newos44.html @@ -0,0 +1,187 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>NewOS 4.4 | The Semantic AI-OS</title> + <style> + :root { + --primary: #00ff9d; + --bg: #0a0a0c; + --card: #16161a; + --text: #e0e0e0; + --accent: #7000ff; + } + body { + background-color: var(--bg); + color: var(--text); + font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; + margin: 0; + overflow-x: hidden; + line-height: 1.6; + } + .container { + max-width: 1100px; + margin: 0 auto; + padding: 0 20px; + } + nav { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20px 0; + border-bottom: 1px solid #333; + } + .logo { + font-weight: 800; + font-size: 1.5rem; + color: var(--primary); + letter-spacing: -1px; + } + .hero { + text-align: center; + padding: 100px 0; + background: radial-gradient(circle at center, #1a1a2e 0%, #0a0a0c 100%); + } + h1 { + font-size: 4rem; + margin-bottom: 20px; + background: linear-gradient(to right, #fff, var(--primary)); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } + .hero p { + font-size: 1.2rem; + color: #a0a0a0; + max-width: 600px; + margin: 0 auto 40px; + } + .btn { + background: var(--primary); + color: var(--bg); + padding: 12px 30px; + border-radius: 5px; + text-decoration: none; + font-weight: bold; + transition: 0.3s; + } + .btn:hover { + box-shadow: 0 0 20px var(--primary); + transform: translateY(-2px); + } + .features { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 30px; + padding: 80px 0; + } + .feature-card { + background: var(--card); + padding: 30px; + border-radius: 15px; + border: 1px solid #333; + transition: 0.3s; + } + .feature-card:hover { + border-color: var(--primary); + transform: translateY(-5px); + } + .feature-card h3 { + color: var(--primary); + margin-top: 0; + } + .terminal-preview { + background: #000; + border-radius: 10px; + padding: 20px; + font-family: 'Courier New', Courier, monospace; + box-shadow: 0 20px 50px rgba(0,0,0,0.5); + margin: 40px 0; + border: 1px solid #444; + position: relative; + } + .terminal-header { + display: flex; + gap: 8px; + margin-bottom: 15px; + } + .dot { width: 12px; height: 12px; border-radius: 50%; } + .red { background: #ff5f56; } + .yellow { background: #ffbd2e; } + .green { background: #27c93f; } + .code-line { margin: 5px 0; } + .prompt { color: var(--primary); } + .cmd { color: #fff; } + .res { color: #888; } + + footer { + text-align: center; + padding: 40px 0; + border-top: 1px solid #333; + font-size: 0.9rem; + color: #666; + } + </style> +</head> +<body> + + <div class="container"> + <nav> + <div class="logo">NEWOS <span style="color:white">4.4</span></div> + <a href="#" class="btn">Download Preview</a> + </nav> + + <section class="hero"> + <h1>The Semantic AI-OS</h1> + <p>Beyond agents. Beyond frameworks. A recursive, self-evolving operating system where AI manages its own kernel, filesystem, and workers.</p> + <a href="#features" class="btn">Explore Architecture</a> + </section> + + <div class="terminal-preview"> + <div class="terminal-header"> + <div class="dot red"></div> + <div class="dot yellow"></div> + <div class="dot green"></div> + </div> + <div class="code-line"> + <span class="prompt">webx11@newos:~$</span> <span class="cmd">nvfs-resolve "security protocols"</span> + </div> + <div class="code-line" style="padding-left: 20px;"> + <span class="res">Found: /skills/security-and-safety.md (Semantic Match: 98%)</span> + </div> + <div class="code-line"> + <span class="prompt">webx11@newos:~$</span> <span class="cmd">spawn_agent --role "Security Auditor"</span> + </div> + <div class="code-line" style="padding-left: 20px;"> + <span class="res">Agent [S-AUDIT-01] spawned. Awaiting delegation...</span> + </div> + <div class="code-line"> + <span class="prompt">webx11@newos:~$</span> <span class="cmd">edit_module "Kernel.Core"</span> + </div> + <div class="code-line" style="padding-left: 20px;"> + <span class="res">Module loaded into editor. Recursive self-patching active.</span> + </div> + </div> + + <section id="features" class="features"> + <div class="feature-card"> + <h3>🧠 Neural VFS</h3> + <p>Stop searching for paths. Resolve concepts. The Neural Virtual File System maps semantic meaning directly to data storage.</p> + </div> + <div class="feature-card"> + <h3>🤖 Agent Orchestration</h3> + <p>Scale your intelligence. Spawn specialized workers on-demand and delegate complex tasks across a shared system state.</p> + </div> + <div class="feature-card"> + <h3>🔄 Recursive Evolution</h3> + <p>The OS that rewrites itself. Modules can be viewed, edited, and tested live by the AI to solve bottlenecks in real-time.</p> + </div> + </section> + + <footer> + © 2026 WebX11 Labs. Powered by the Semantic Kernel. + </footer> + </div> + +</body> +</html>
\ No newline at end of file diff --git a/downloads/webx11_mindmap.html b/downloads/webx11_mindmap.html index fe7750d..a8c9740 100644 --- a/downloads/webx11_mindmap.html +++ b/downloads/webx11_mindmap.html @@ -4,7 +4,7 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>WebX11 Semantic Mindmap</title> - <script src="mermaid.min.js"></script> + <script src="../mermaid.min.js?v=11"></script> <style> body { background-color: #000; @@ -44,34 +44,32 @@ <p>Neural VFS & A2A Integrated System</p> </div> <div class="mindmap-container"> - <pre class="mermaid"> - mindmap - root((WebX11)) - Neural_VFS - Semantic_Mapping - Conceptual_Index - Skill_Cross_Referencing - A2A_Protocol - Contract_Formalization - Input_Output_Schemas - Agent_Delegation - Self_Optimization - Telemetry_Logs - Recursive_Patching - Health_Checks - Interface - Browser_Terminal - Mobile_Optimized - Dark_Mode_UI - Core_Capabilities - File_System_Access - Web_Search_Fetch - Package_Management - </pre> + <pre class="mermaid">mindmap + root((WebX11)) + Neural_VFS + Semantic_Mapping + Conceptual_Index + Skill_Cross_Referencing + A2A_Protocol + Contract_Formalization + Input_Output_Schemas + Agent_Delegation + Self_Optimization + Telemetry_Logs + Recursive_Patching + Health_Checks + Interface + Browser_Terminal + Mobile_Optimized + Dark_Mode_UI + Core_Capabilities + File_System_Access + Web_Search_Fetch + Package_Management</pre> </div> <script> mermaid.initialize({ - startOnLoad: true, + startOnLoad: false, theme: 'dark', themeVariables: { primaryColor: '#00ff00', @@ -80,6 +78,13 @@ lineColor: '#0f0' } }); + document.addEventListener('DOMContentLoaded', function() { + try { + mermaid.init(undefined, '.mermaid'); + } catch(e) { + document.querySelector('.mermaid').textContent = 'Mindmap render error: ' + e.message; + } + }); </script> </body> </html>
\ No newline at end of file @@ -231,9 +231,9 @@ footer .tagline{color:var(--accent2);margin-top:10px;font-weight:500} <h1>WebX11 <span>Docs</span></h1> </div> <div class="header-meta"> - <span class="badge badge-v">v4.4</span> + <span class="badge badge-v">v4.5</span> <span class="badge badge-new">28 core · 17 ext</span> - <span style="color:var(--text2)">150+ commands</span> + <span style="color:var(--text2)">160+ commands</span> </div> </div> </header> @@ -490,6 +490,7 @@ diff a.txt b.txt</pre> <tr><td><code>clear</code> / <code>cls</code></td><td>Clear terminal</td><td><code>cls</code></td></tr> <tr><td><code>echo</code></td><td>Print text</td><td><code>echo Hello</code></td></tr> <tr><td><code>mem</code></td><td>Show memory usage</td><td><code>mem</code></td></tr> + <tr><td><code>config</code></td><td>View/set terminal config (max-lines, history, pipe-buffer)</td><td><code>config terminal-max-lines 500</code></td></tr> <tr><td><code>status</code></td><td>System status</td><td><code>status</code></td></tr> <tr><td><code>font-size</code></td><td>Change font size (8–32)</td><td><code>font-size 16</code></td></tr> <tr><td><code>load-local</code></td><td>Load module from VFS or URL</td><td><code>load-local modules/ext/calc.js</code></td></tr> @@ -521,6 +522,7 @@ diff a.txt b.txt</pre> <tr><td><code>ai-deny</code></td><td>Deny pending destructive action</td><td><code>ai-deny</code></td></tr> <tr><td><code>ai-stop</code></td><td>Cancel running AI request</td><td><code>ai-stop</code></td></tr> <tr><td><code>ai-compress</code></td><td>Manually compress conversation context</td><td><code>ai-compress</code></td></tr> + <tr><td><code>ai-config</code></td><td>View/set AI loop config (max-turns, max-context, max-context-tokens, confirm-timeout, chat-lock-timeout, skill-debounce, trivial-optimization)</td><td><code>ai-config max-turns 12</code></td></tr> <tr><td><code>debug</code></td><td>Toggle AI debug mode</td><td><code>debug</code></td></tr> </table></div> @@ -1018,6 +1020,43 @@ script greet.sh</pre> </table></div> </section> + <!-- ── Security ── --> + <section id="security"> + <h2>🔒 Security & Guardrails</h2> + <div class="callout callout-warning"> + <span class="callout-title">Protecting Your Terminal</span> + Three layered protections — guardrails block dangerous patterns, confidence escalation requires AI to self-assess, shadow VFS previews filesystem impact. + </div> + + <h3>Guardrail Policy</h3> + <p>Pre-execution guardrails intercept AI tool calls and block or warn on patterns matching dangerous operations:</p> + <div class="table-wrap"><table> + <tr><th>Rule</th><th>Description</th><th>Severity</th></tr> + <tr><td><code>rm-rf-block</code></td><td>Prevent recursive force deletes</td><td>🔴 deny</td></tr> + <tr><td><code>curl-pipe-bash</code></td><td>Block curl-to-bash execution</td><td>🔴 deny</td></tr> + <tr><td><code>rm-outer-vfs</code></td><td>Block deletion of sensitive metadata files</td><td>🔴 deny</td></tr> + <tr><td><code>mass-delete</code></td><td>Block mass-delete operations</td><td>🔴 deny</td></tr> + <tr><td><code>chmod-777</code></td><td>Block world-writable permissions</td><td>🔴 deny</td></tr> + <tr><td><code>eval-danger</code></td><td>Block dynamic code execution (eval/exec/system)</td><td>🔴 deny</td></tr> + <tr><td><code>external-dl</code></td><td>External file download warning</td><td>🟡 warn</td></tr> + <tr><td><code>env-overwrite</code></td><td>Modifying environment variables</td><td>🟡 warn</td></tr> + </table></div> + + <h3>Commands</h3> + <div class="table-wrap"><table> + <tr><th>Command</th><th>Description</th></tr> + <tr><td><code>guardrail</code></td><td>Show guardrail policy rules and violation count</td></tr> + <tr><td><code>guardrail-add <id> <severity> <pattern> <tools...></code></td><td>Add a custom guardrail rule (severity: deny/warn)</td></tr> + <tr><td><code>guardrail-remove <id></code></td><td>Remove a guardrail rule</td></tr> + <tr><td><code>shadow <command></code></td><td>Execute command in Shadow VFS — snapshot, run, diff changes</td></tr> + <tr><td><code>shadow-commit</code></td><td>Accept shadow VFS changes</td></tr> + <tr><td><code>shadow-rollback</code></td><td>Undo shadow VFS changes</td></tr> + </table></div> + + <h3>Confidence Escalation</h3> + <p>When the AI requests destructive actions, it must declare <code>Confidence: N%</code> in its reasoning. Below 90%, manual approval is required. If no confidence is declared, manual approval is required by default. This prevents the AI from making low-confidence destructive changes.</p> + </section> + <!-- ── Sessions ── --> <section id="sessions"> <h2>💬 Sessions</h2> @@ -1099,7 +1138,7 @@ vfs-import</pre> <tr><td><code>orchestrator-wake <id></code></td><td>Restore agent from VFS sleep state</td></tr> <tr><td><code>orchestrator-kill <id></code></td><td>Terminate an agent and revoke leases</td></tr> <tr><td><code>orchestrator-purge</code></td><td>Remove dead agents (>60s silent)</td></tr> - <tr><td><code>orchestrator-config <key> <value></code></td><td>Tune: spawn-limit, spawn-strategy, heartbeat-timeout, idle-timeout, restart-policy, a2a-polling</td></tr> + <tr><td><code>orchestrator-config <key> <value></code></td><td>Tune: spawn-limit, spawn-strategy, heartbeat-timeout, idle-timeout, restart-policy, a2a-polling, a2a-poll-interval, heartbeat-check, idle-sweep-interval, dead-purge-timeout (persisted)</td></tr> <tr><td><code>orchestrator-restart-policy <id> <policy></code></td><td>Set per-agent restart policy: on-failure, always, never</td></tr> <tr><td><code>lease-create <agent-id> [duration] [task]</code></td><td>Create a time-bound lease for a worker agent</td></tr> <tr><td><code>lease-list</code></td><td>Show active leases — agent tasks with status and TTL</td></tr> @@ -1135,6 +1174,7 @@ vfs-import</pre> <tr><td><code>nvfs-status</code></td><td>Show index stats and last scan time</td></tr> <tr><td><code>nvfs-resolve <concept></code></td><td>Find files related to a concept (exact + fuzzy)</td></tr> <tr><td><code>nvfs-tree [concept]</code></td><td>Show concept-to-file mapping tree</td></tr> + <tr><td><code>nvfs-config [key] [value]</code></td><td>View/set display limits (fuzzy-limit, tree-files, tree-concepts, resolve-files)</td></tr> </table></div> </section> @@ -1180,6 +1220,7 @@ vfs-import</pre> <tr><td><code>sandbox-status</code></td><td>Show worker pool health and task metrics</td></tr> <tr><td><code>sandbox-config <k> <v></code></td><td>Configure max-workers, min-workers</td></tr> <tr><td><code>sandbox-run <task></code></td><td>Execute a task in the sandbox pool</td></tr> + <tr><td><code>sandbox-kill <id></code></td><td>Terminate a running sandbox task</td></tr> </table></div> <p><code>orchestrate --sandboxed <task></code> routes delegation through the sandbox for full isolation.</p> </section> @@ -1194,9 +1235,10 @@ vfs-import</pre> <tr><td><code>memgraph-search <q></code></td><td>Find nodes by label, type, or id</td></tr> <tr><td><code>memgraph-stats</code></td><td>Most connected nodes and strongest edges</td></tr> <tr><td><code>memgraph-export</code></td><td>Export full graph as JSON to VFS</td></tr> - <tr><td><code>memgraph-prune</code></td><td>Remove stale low-weight edges (>30d, <3 uses)</td></tr> +<tr><td><code>memgraph-prune</code></td><td>Remove stale low-weight edges (>30d, <3 uses)</td></tr> + <tr><td><code>memgraph-learn <entity> <fact></code></td><td>Add a fact to the memory graph</td></tr> </table></div> - <p>Context is automatically injected into AI system prompts for cross-session awareness.</p> + <p>Context is automatically injected into AI prompts for cross-session awareness.</p> </section> <!-- ── World Model ── --> @@ -1237,6 +1279,15 @@ vfs-import</pre> <div class="table-wrap"><table> <tr><th>Command</th><th>Description</th></tr> <tr><td><code>security-level <0-3></code></td><td>Set active security level</td></tr> + <tr><td><code>security</code></td><td>Show full status: level, blocked count, destructive/system/whitelist sets, suspicious flags, registered commands</td></tr> + <tr><td><code>security-destructive list</code></td><td>Show destructive command set</td></tr> + <tr><td><code>security-destructive add|remove <cmd></code></td><td>Add/remove command from destructive set (persisted)</td></tr> + <tr><td><code>security-system list</code></td><td>Show system command set</td></tr> + <tr><td><code>security-system add|remove <cmd></code></td><td>Add/remove command from system set (persisted)</td></tr> + <tr><td><code>security-whitelist list</code></td><td>Show whitelist command set</td></tr> + <tr><td><code>security-whitelist add|remove <cmd></code></td><td>Add/remove command from whitelist (persisted)</td></tr> + <tr><td><code>security-flag list</code></td><td>Show suspicious flags</td></tr> + <tr><td><code>security-flag add|remove <flag></code></td><td>Add/remove suspicious flag (persisted, -- prefix optional)</td></tr> <tr><td><code>cmd-allow <command></code></td><td>Add command to allowlist (bypasses restrictions)</td></tr> <tr><td><code>cmd-deny <command></code></td><td>Add command to denylist (always blocked)</td></tr> </table></div> @@ -1275,7 +1326,7 @@ listmods</pre> <section id="ref"> <h2>⚡ Quick Reference</h2> <div class="quick-ref"> - <div class="quick-ref-title">WebX11 v4.3</div> + <div class="quick-ref-title">WebX11 v4.5</div> <div class="quick-ref-grid"> <div class="quick-ref-item"><span class="cmd">help</span><span class="desc">Show all commands</span></div> <div class="quick-ref-item"><span class="cmd">cls</span><span class="desc">Clear terminal</span></div> @@ -1327,9 +1378,29 @@ listmods</pre> <h2>📋 Changelog</h2> <div class="version-item"> - <div class="v-header"><span class="v-num">v4.3.1 — June 2026</span><span class="v-date">2026-06-03</span></div> + <div class="v-header"><span class="v-num">v4.5 — June 2026</span><span class="v-date">2026-06-06</span></div> + <ul> + <li><strong>Security Config CLI</strong> — <code>security-destructive</code>, <code>security-system</code>, <code>security-whitelist</code>, <code>security-flag</code> add|remove|list with localStorage persistence and boot loading</li> + <li><strong>Enhanced security command</strong> — Shows all sets (destructive, system, whitelist, flags) plus registered command count</li> + <li><strong>AI loop config</strong> — <code>ai-config max-turns|max-context|trivial-optimization</code> with persistence across sessions</li> + <li><strong>Unified config CLI</strong> — <code>config</code> command with 4 terminal tuning keys (max-lines, history, pipe-buffer), all persisted in localStorage</li> + <li><strong>Extended ai-config</strong> — New keys: <code>max-context-tokens</code>, <code>confirm-timeout</code>, <code>chat-lock-timeout</code>, <code>skill-debounce</code> with range validation</li> + <li><strong>OllamaModule consolidated</strong> — Removed duplicate <code>ollamamodels</code> code path (redirects to <code>models</code>), centralized endpoint via <code>ollamaManager.endpoint</code></li> + <li><strong>Neural VFS async indexing</strong> — Chunked processing with progress percentage, no UI freeze on large VFS. Improved <code>_summarize</code> (section heading → paragraph → sentence → fallback)</li> + <li><strong>Neural VFS display-limit config</strong> — <code>nvfs-config</code> command with 4 keys (fuzzy-limit, tree-files, tree-concepts, resolve-files), persisted</li> + <li><strong>Orchestrator event bus</strong> — In-memory pub/sub for instant A2A delivery (VFS polling remains as fallback). Improved <code>_deriveCapabilities</code> with 14 keyword mappings</li> + <li><strong>Orchestrator extended config</strong> — 4 new interval keys (a2a-poll-interval, heartbeat-check, idle-sweep-interval, dead-purge-timeout) + all config now persists across sessions</li> + <li>Cache: <code>2026-06-06-v4.5</code> — hard refresh required</li> + </ul> + </div> + + <div class="version-item"> + <div class="v-header"><span class="v-num">v4.4 — June 2026</span><span class="v-date">2026-06-05</span></div> <ul> - <li><strong>Neural VFS</strong> — Semantic concept indexing layer: <code>nvfs-index</code>, <code>nvfs-resolve</code>, <code>nvfs-status</code>, <code>nvfs-tree</code></li> + <li><strong>v4.4 complete</strong> — 46 modules, 24 skills, full A2A lifecycle, sandboxed execution, memory graph, world model, health monitoring</li> + <li><strong>A2A Mailbox Transport</strong> — <code>a2a-send</code>, <code>a2a-list</code>, 500ms polling with envelope routing (request/response/broadcast/heartbeat)</li> + <li><strong>Autonomous sub-agent spawning</strong> — auto-role derivation, sleep/reanimate VFS serialization</li> + <li><strong>Sandboxed execution</strong> — WebWorker pool <code>sandbox-run</code>, <code>sandbox-kill</code> with inline fallback for headless</li> <li><strong>A2A Protocol</strong> — Agent contract system: <code>contract-register</code>, <code>contract-list</code>, schema validation in orchestrator</li> <li><strong>Self-Optimization Telemetry</strong> — <code>system-health</code> command showing tool latency, VFS stats, error rates</li> <li><strong>AI tool: nvfs_resolve</strong> — AI can search VFS by concept</li> @@ -4,7 +4,7 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="theme-color" content="#000000"> - <title>WebX11 Module System v4.2</title> + <title>WebX11 Module System</title> <style> :root { --bg-color: #000000; @@ -672,7 +672,7 @@ <header> <div> <span class="header-title">WebX11</span> - <span class="header-version">v4.2</span> + <span class="header-version"></span> </div> <div id="header-status" class="status-pill">Mem: --</div> <span id="cmd-cards-toggle" onclick="if(webx11)webx11.toggleCmdCards()" title="Quick Commands (Ctrl+K)">📋</span> @@ -711,7 +711,7 @@ <!-- Terminal Container --> <div id="terminal-container"> - <div class="output-line info">WebX11 Module System v4.2 - Unix-like Terminal</div> + <div class="output-line info" id="terminal-welcome">WebX11 Module System - Unix-like Terminal</div> <div class="output-line info">Commands: ls, cd, pwd, cat, echo, rm, mkdir, mv, cp, touch, tree, find, grep</div> <div class="output-line info">Type 'help' for all commands</div> <div class="output-line"></div> @@ -887,7 +887,7 @@ <div id="splash-overlay"> <span id="splash-gear" onclick="openStartupModulesSplash(event)" title="Select startup modules">⚙</span> <div id="splash-title">⚡ WebX11</div> - <div id="splash-version">v4.2</div> + <div id="splash-version"></div> <div id="splash-progress-track"><div id="splash-progress-fill"></div></div> <div id="splash-phase">Initializing...</div> <div id="splash-filename"></div> @@ -1095,7 +1095,28 @@ </script> <!-- Async dependency-ordered module loader (replaces 26 synchronous script tags) --> - <script src="modules/core/module-loader.js?v=47"></script> + <script src="modules/core/module-loader.js?v=2026-06-06-v4.5.6"></script> + +<script> +// ═══ ONE TRUE VERSION SOURCE ═══ +// Reads from module-loader.js src attribute (single source of truth) +(function(){ + var version = 'v4.0'; // fallback + var scripts = document.getElementsByTagName('script'); + for (var i = 0; i < scripts.length; i++) { + var m = scripts[i].src && scripts[i].src.match(/module-loader\.js\?.*-v([\d.]+)/); + if (m) { version = 'v' + m[1]; break; } + } + window.NEWOS4_VERSION = version; + var el = document.getElementById('splash-version'); + if (el) el.textContent = version; + el = document.querySelector('.header-version'); + if (el) el.textContent = version; + el = document.getElementById('terminal-welcome'); + if (el) el.textContent = 'WebX11 Module System ' + version + ' - Unix-like Terminal'; + document.title = 'WebX11 Module System ' + version; +})(); +</script> </body> </html> diff --git a/mindmap.html b/mindmap.html index 73c9a89..7dc0e5a 100644 --- a/mindmap.html +++ b/mindmap.html @@ -4,7 +4,7 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>WebX11 System Mindmap</title> - <script src="mermaid.min.js"></script> + <script src="mermaid.min.js?v=11"></script> <style> body { background-color: #000; @@ -38,40 +38,25 @@ <h1>WebX11 System Mindmap</h1> <p>Visual architecture of the current session</p> </div> - <div class="mermaid"> - mindmap - root((WebX11)) - AI Engine - Model: gemma4:31b-cloud - Memory: 9.5MB - Context: Session-based - VFS (Virtual File System) - Storage - /skills - /agents - /logs - /memory - /.semantic_index - Files - system_review.html - mindmap.html - Capabilities - Modules - Core Layer - Extension Layer - Tools - Filesystem - System - Web Search - WPM Packages - Management - Skills (Procedural) - Sessions (Historical) - User Profile (Persistent) - </div> + <pre class="mermaid">mindmap + root((WebX11)) + AI Engine + Model("gemma4:31b-cloud") + Memory("9.5MB") + Context("Session-based") + VFS (Virtual File System) + Storage("skills, agents, logs, memory, .semantic_index") + Files("system_review.html, mindmap.html") + Capabilities + Modules("Core Layer, Extension Layer") + Tools("Filesystem, System, Web Search, WPM Packages") + Management + Skills("Procedural") + Sessions("Historical") + User Profile("Persistent")</pre> <script> mermaid.initialize({ - startOnLoad: true, + startOnLoad: false, theme: 'dark', themeVariables: { primaryColor: '#00ffcc', @@ -81,6 +66,13 @@ nodeBorder: '#00ffcc' } }); + document.addEventListener('DOMContentLoaded', function() { + try { + mermaid.init(undefined, '.mermaid'); + } catch(e) { + document.querySelector('.mermaid').innerHTML = '<p style="color:red">Mindmap render error: ' + e.message + '</p>'; + } + }); </script> </body> </html>
\ No newline at end of file diff --git a/modules-index.json b/modules-index.json index e2319ae..3b9f8cf 100644 --- a/modules-index.json +++ b/modules-index.json @@ -426,28 +426,6 @@ "updated": "2026-06-03", "layer": "core" }, - "module-skills": { - "name": "module-skills", - "file": "modules/core/module-skills.js", - "type": "core", - "class": "SkillsModule", - "auto_load": true, - "commands": [ - "skill-list", - "skill-view", - "skill-create", - "skill-patch", - "skill-delete", - "skill-export", - "skill-import", - "skill-sync" - ], - "description": "Extracted from newOS4 index.html \u2014 SkillsModule (v4.2 \u2014 Self-improving AI)", - "dependencies": [], - "version": "1.0.0", - "updated": "2026-06-03", - "layer": "core" - }, "module-smartctx": { "name": "module-smartctx", "file": "modules/core/module-smartctx.js", diff --git a/modules/core/module-aiassist.js b/modules/core/module-aiassist.js index b93b12d..5a4341a 100644 --- a/modules/core/module-aiassist.js +++ b/modules/core/module-aiassist.js @@ -20,6 +20,16 @@ this._toolDefs = null; this._toolCallLog = []; this._debugPanelEnabled = false; + // 🔒 Guardrail Layer + this._guardrailPolicy = null; + this._shadowSnapshot = null; + this._guardrailViolations = {}; + this._confirmTimeoutMs = 120000; + this._skillDebounceMs = 1800000; + this._chatLockTimeoutMs = 10000; + this._loadGuardrailPolicy(); + // Restore AI config from localStorage (maxContext, MAX_TOOL_TURNS, etc.) + try { const cfg = localStorage.getItem('webx11_ai_config'); if (cfg) { const p = JSON.parse(cfg); if (p.maxTurns) this.MAX_TOOL_TURNS = p.maxTurns; if (p.maxContext) this.maxContext = p.maxContext; if (p.maxContextTokens) this.maxContextTokens = p.maxContextTokens; if (p.confirmTimeoutMs) this._confirmTimeoutMs = p.confirmTimeoutMs; if (p.skillDebounceMs) this._skillDebounceMs = p.skillDebounceMs; if (p.chatLockTimeoutMs) this._chatLockTimeoutMs = p.chatLockTimeoutMs; } } catch (e) {} try { const s = localStorage.getItem('webx11_ai_patterns'); if (s) this._commandFreq = JSON.parse(s); } catch (e) {} try { const p = localStorage.getItem('webx11_user_profile'); if (p) this._userProfile = JSON.parse(p); } catch (e) {} // Restore AI conversation context from localStorage @@ -455,11 +465,11 @@ RULES: required: [] } } - }, { +}, { type: 'function', function: { name: 'smart_context_set', - description: 'Set the active AI context profile. Changes the AI\'s behavior (temperature, style) for subsequent responses.', + description: "Set the active AI context profile. Changes the AI's behavior (temperature, style) for subsequent responses.", parameters: { type: 'object', properties: { @@ -468,6 +478,20 @@ RULES: required: ['name'] } } + }, { + type: 'function', + function: { + name: 'create_mindmap', + description: 'Create a mindmap with the given topic and child nodes, then render it as inline SVG in the terminal. Creates root and all children in one call. Use this when the user asks for a mindmap or visual architecture.', + parameters: { + type: 'object', + properties: { + topic: { type: 'string', description: 'Root topic of the mindmap (e.g. "WebX11 Architecture")' }, + children: { type: 'string', description: 'Comma-separated list of child node names (e.g. "AI Engine, VFS System, Modules")' } + }, + required: ['topic'] + } + } }]; } getHelpInfo() { @@ -481,7 +505,8 @@ RULES: 'ai-deny': 'ai-deny — Deny pending AI action', 'ai-ignore': 'ai-ignore — Suppress validator warnings for this session', 'ai-stop': 'ai-stop — Cancel current AI operation', - 'ai-model': 'ai-model [model] — Show or set AI model' + 'ai-model': 'ai-model [model] — Show or set AI model', + 'ai-config': 'ai-config [key] [value] — View or set AI loop config (max-turns, max-context)' }; } registerCommands() { @@ -496,7 +521,14 @@ RULES: this.commands['ai-stop'] = () => this.cancelAi(); this.commands['ai-model'] = (args) => this.showModel(args); this.commands['ai-compress'] = () => this._manualCompress(); + this.commands['ai-config'] = (args) => this.aiConfig(args); this.commands['debug'] = () => this.toggleDebug(); + this.commands['guardrail'] = (args) => this.guardrailCmd(args); + this.commands['guardrail-add'] = (args) => this.guardrailCmd(['add', ...args]); + this.commands['guardrail-remove'] = (args) => this.guardrailCmd(['remove', ...args]); + this.commands['shadow'] = (args) => this.shadowExec(args); + this.commands['shadow-commit'] = () => this.shadowCommit(); + this.commands['shadow-rollback'] = () => this.shadowRollback(); } async chat(args) { const userMessage = args.join(' '); @@ -507,7 +539,7 @@ RULES: this.terminal.setAiBusy(true); const lockStart = Date.now(); while (this._chatLock) { - if (Date.now() - lockStart > 10000) { + if (Date.now() - lockStart > this._chatLockTimeoutMs) { this._chatLock = false; this.terminal.print('⚠️ Chat lock timed out — force released', 'warning'); break; @@ -528,13 +560,6 @@ RULES: this.context.slice().forEach(msg => messages.push(msg)); messages.push({ role: 'user', content: userMessage }); this.terminal.print('🤖 WebX11AI thinking...', 'info'); - // Ensure skills directory exists and seed defaults on first run - this.terminal.fs.mkdirRecursive('/skills'); - if (!this.terminal.fs.readFile('/skills/_seeded')) { - try { - await this._seedDefaultSkills(); - } catch (e) { /* non-critical */ } - } // Auto-load skills relevant to the user's query (awaited, not fire-and-forget) // Skip skill loading for trivial queries (< 10 chars, no actionable keywords) const optEnabled = this.terminal?.ollamaManager?.optimizationEnabled !== false; @@ -775,6 +800,17 @@ RULES: })); for (const { fn, toolResult, t1 } of safeResults) { this.terminal.print(`🔧 Tool: ${fn.name}(${typeof fn.arguments === 'string' ? fn.arguments : JSON.stringify(fn.arguments)})`, 'info'); + // Memory graph: record tool call + file access + try { + const _mg = this.terminal?.moduleManager?.modules?.['MemoryGraphModule']; + if (_mg) { + _mg.recordToolCall(fn.name, !this._isToolError(toolResult)); + if (fn.name === 'read_file' || fn.name === 'write_file' || fn.name === 'view_module' || fn.name === 'edit_module') { + const _path = (typeof fn.arguments === 'object' ? (fn.arguments?.path || '') : ''); + if (_path) _mg.recordFileAccess(_path); + } + } + } catch (_e) { /* memory graph not available */ } const obs = this._summarizeObservation(toolResult, 150); const err = this._isToolError(toolResult); if (err) { @@ -793,7 +829,20 @@ RULES: } // Only block on destructive tools if (destructiveTools.length > 0) { - const approved = await this.confirmActionMulti(destructiveTools); + // 🎯 CONFIDENCE ESCALATION — auto-approve only if confidence >= 90% + let autoApprove = false; + if (pendingText) { + const confidence = this._parseConfidence(pendingText); + if (confidence !== null && confidence >= 90) { + autoApprove = true; + this.terminal.print(`🎯 AI confidence: ${confidence}% — auto-approved`, 'success'); + } else if (confidence !== null) { + this.terminal.print(`🎯 AI confidence: ${confidence}% — below 90% threshold, requiring manual approval`, 'warning'); + } else { + this.terminal.print('🎯 No confidence declared for destructive action — requiring manual approval', 'warning'); + } + } + const approved = autoApprove || await this.confirmActionMulti(destructiveTools); if (approved) { for (const tc of destructiveTools) { const fn = tc.function; @@ -813,6 +862,17 @@ RULES: const sm2 = this.terminal.moduleManager.modules['ServerMonitorModule']; if (sm2 && sm2.logToolCall) sm2.logToolCall(fn.name, (t1 * 1000) || 1, this._isToolError(toolResult)); if (this._debugPanelEnabled) this._updateDebugPanel(); + // Memory graph: record destructive tool call + try { + const _mg2 = this.terminal?.moduleManager?.modules?.['MemoryGraphModule']; + if (_mg2) { + _mg2.recordToolCall(fn.name, !this._isToolError(toolResult)); + if (fn.name === 'write_file' || fn.name === 'edit_module') { + const _path2 = (typeof fn.arguments === 'object' ? (fn.arguments?.path || '') : ''); + if (_path2) _mg2.recordFileAccess(_path2); + } + } + } catch (_e2) { /* memory graph not available */ } const dObs = this._summarizeObservation(toolResult, 150); const dErr = this._isToolError(toolResult); if (dErr) { @@ -865,7 +925,7 @@ RULES: async afterActionReflection(query, toolTurns) { // Debounce: only suggest skill creation once per 30 minutes const now = Date.now(); - if (this._lastSkillSuggestion && (now - this._lastSkillSuggestion) < 1800000) { + if (this._lastSkillSuggestion && (now - this._lastSkillSuggestion) < this._skillDebounceMs) { return; } const suggestions = []; @@ -955,7 +1015,7 @@ RULES: // Countdown timer updates with escalating visibility const timerInterval = setInterval(() => { const elapsed = Math.round((Date.now() - startTime) / 1000); - const remaining = Math.max(0, 120 - elapsed); + const remaining = Math.max(0, (this._confirmTimeoutMs / 1000) - elapsed); const timerEl = document.getElementById('ai-confirm-timer'); if (timerEl) { timerEl.textContent = `⏱ ${remaining}s`; @@ -984,7 +1044,7 @@ RULES: this._cleanupConfirmBar(); this.terminal.print('⏱ Confirmation timed out — tool not executed', 'warning'); } - }, 120000); + }, this._confirmTimeoutMs); }); } _resolveConfirm(approved) { @@ -1065,12 +1125,288 @@ RULES: this.terminal.print('🔧 Debug panel disabled', 'info'); } } + // 🔒 === GUARDRAIL LAYER === + _loadGuardrailPolicy() { + try { + const raw = localStorage.getItem('webx11_guardrail_policy'); + if (raw) { + this._guardrailPolicy = JSON.parse(raw); + } else { + // Default policy — seed on first run + this._guardrailPolicy = { + version: 1, + rules: [ + { + id: 'rm-rf-block', + pattern: '/rm\\s+-rf/', + description: 'Prevent recursive force deletes outside trash', + severity: 'deny', + tools: ['run_command', 'write_file'] + }, + { + id: 'curl-pipe-bash', + pattern: '/(curl|wget)\\s+.*\\|\\s*(bash|sh)/', + description: 'Block curl-to-bash execution', + severity: 'deny', + tools: ['run_command'] + }, + { + id: 'rm-outer-vfs', + pattern: '/delete_file.*\\.(user\\.json|token|session|key)/', + description: 'Block deletion of sensitive metadata files', + severity: 'deny', + tools: ['delete_file'] + }, + { + id: 'mass-delete', + pattern: '/rm\\s+-rf\\s+\\/|delete_file.*\\*|\\.*\\/\\*/', + description: 'Block mass-delete operations', + severity: 'deny', + tools: ['run_command', 'delete_file'] + }, + { + id: 'chmod-777', + pattern: '/chmod\\s+777/', + description: 'Block world-writable permissions', + severity: 'deny', + tools: ['run_command'] + }, + { + id: 'external-dl', + pattern: '/(wget|curl)\\s+-[oO]\\s+/', + description: 'External file download — requires high confidence', + severity: 'warn', + tools: ['run_command'] + }, + { + id: 'env-overwrite', + pattern: '/export\\s+\\w+\\s*=\\s*/', + description: 'Modifying environment variables', + severity: 'warn', + tools: ['run_command'] + }, + { + id: 'eval-danger', + pattern: '/(eval|exec|system)\\s*\\(/', + description: 'Dynamic code execution', + severity: 'deny', + tools: ['run_command'] + } + ], + descriptions: {} + }; + localStorage.setItem('webx11_guardrail_policy', JSON.stringify(this._guardrailPolicy)); + } + } catch (e) { + this._guardrailPolicy = { version: 1, rules: [] }; + } + } + _saveGuardrailPolicy() { + try { + localStorage.setItem('webx11_guardrail_policy', JSON.stringify(this._guardrailPolicy)); + } catch (e) {} + } + checkGuardrail(toolName, args) { + if (!this._guardrailPolicy || !this._guardrailPolicy.rules) return null; + const argsStr = typeof args === 'object' ? JSON.stringify(args) : String(args); + for (const rule of this._guardrailPolicy.rules) { + if (!rule.tools.includes(toolName)) continue; + try { + const re = new RegExp(rule.pattern.slice(1, -1), 'i'); + if (re.test(argsStr)) { + this._guardrailViolations[rule.id] = (this._guardrailViolations[rule.id] || 0) + 1; + return rule; // { id, pattern, description, severity, tools } + } + } catch (e) { /* skip malformed regex */ } + } + return null; + } + // 🎯 === CONFIDENCE ESCALATION === + _parseConfidence(text) { + if (!text || typeof text !== 'string') return null; + // Look for patterns like "Confidence: 85%" or "confidence=95%" or "I am 72% confident" + const patterns = [ + /confidence[:\s]*(\d+)%/i, + /confidence[=:]?\s*(\d+)\s*%/i, + /(\d+)%\s*confiden/i, + /confiden[ts]\s+(\d+)%/i + ]; + for (const re of patterns) { + const m = text.match(re); + if (m) return parseInt(m[1], 10); + } + return null; + } + // 📸 === SHADOW VFS (Sandboxed Execution) === + _snapshotShadowVFS() { + // Deep-clone the VFS root state into a snapshot + try { + const root = this.terminal.fs.root; + this._shadowSnapshot = JSON.parse(JSON.stringify(root)); + return true; + } catch (e) { + this.terminal.print('⚠️ Shadow VFS snapshot failed: ' + e.message, 'error'); + return false; + } + } + _diffShadowVFS(consume = true) { + if (!this._shadowSnapshot) return null; + try { + const current = this.terminal.fs.root; + const changes = []; + this._walkDiff(this._shadowSnapshot, current, '', changes); + if (consume) { + this._shadowSnapshot = null; + } + return changes; + } catch (e) { + this._shadowSnapshot = null; + return [{ type: 'diff-error', message: e.message }]; + } + } + _walkDiff(snapshot, live, path, changes) { + const snapKeys = snapshot && snapshot.content ? Object.keys(snapshot.content) : []; + const liveKeys = live && live.content ? Object.keys(live.content) : []; + // New files in live + for (const key of liveKeys) { + const livePath = path ? path + '/' + key : key; + const liveEntry = live.content[key]; + const snapEntry = snapshot.content ? snapshot.content[key] : undefined; + if (!snapEntry) { + const entrySize = liveEntry.type === 'file' ? (liveEntry.content || '').length : 0; + changes.push({ type: 'created', path: livePath, entryType: liveEntry.type, size: entrySize }); + } else if (liveEntry.type === 'file' && liveEntry.content !== snapEntry.content) { + const oldLen = (snapEntry.content || '').length; + const newLen = (liveEntry.content || '').length; + changes.push({ type: 'modified', path: livePath, sizeBefore: oldLen, sizeAfter: newLen }); + } + // Recurse into directories + if (liveEntry.type === 'dir' && snapEntry && snapEntry.type === 'dir') { + this._walkDiff(snapEntry, liveEntry, livePath, changes); + } + } + // Deleted files + for (const key of snapKeys) { + if (!liveKeys.includes(key)) { + changes.push({ type: 'deleted', path: path ? path + '/' + key : key }); + } + } + } + // 🔒 === GUARDRAIL COMMANDS === + guardrailCmd(args) { + if (args.length === 0) { + this.terminal.print('=== Guardrail Policy ===', 'info'); + if (!this._guardrailPolicy) { + this.terminal.print('No guardrail policy loaded', 'warning'); + return; + } + this.terminal.print(`Rules: ${this._guardrailPolicy.rules.length}`, 'info'); + for (const rule of this._guardrailPolicy.rules) { + const icon = rule.severity === 'deny' ? '🔴' : '🟡'; + this.terminal.print(`${icon} ${rule.id}: ${rule.description}`, 'info'); + } + const violations = Object.values(this._guardrailViolations).reduce((a, b) => a + b, 0); + if (violations > 0) { + this.terminal.print(`⚠️ ${violations} violation(s) this session`, 'warning'); + } + this.terminal.print('Usage: guardrail-add <id> <severity> <pattern> <tools...> | guardrail-remove <id>', 'info'); + return; + } + const sub = args[0].toLowerCase(); + if (sub === 'add' && args.length >= 4) { + const id = args[1]; + const severity = args[2]; + const pattern = args[3]; + const tools = args.slice(4); + this._guardrailPolicy.rules.push({ id, severity, pattern, tools, description: 'Custom rule' }); + this._saveGuardrailPolicy(); + this.terminal.print(`✅ Guardrail rule '${id}' added`, 'success'); + } else if (sub === 'remove' && args.length >= 2) { + const idx = this._guardrailPolicy.rules.findIndex(r => r.id === args[1]); + if (idx >= 0) { + this._guardrailPolicy.rules.splice(idx, 1); + this._saveGuardrailPolicy(); + this.terminal.print(`✅ Guardrail rule '${args[1]}' removed`, 'success'); + } else { + this.terminal.print(`❌ Rule '${args[1]}' not found`, 'error'); + } + } else { + this.terminal.print('Usage: guardrail-add <id> <severity> <pattern> <tools...> | guardrail-remove <id>', 'warning'); + } + } + // 🎯 SHADOW COMMAND + shadowExec(args) { + // Usage: shadow <command> + // Snapshot VFS, run command, diff output + if (args.length === 0) { + this.terminal.print('Usage: shadow <command> — Execute command in shadow VFS (sandbox preview)', 'warning'); + return; + } + const cmd = args.join(' '); + this._snapshotShadowVFS(); + const cmdName = cmd.split(' ')[0].toLowerCase(); + const cmdArgs = cmd.split(' ').slice(1); + const originalPrint = this.terminal.print.bind(this.terminal); + let output = ''; + this.terminal.print = (text, type) => { output += text + '\n'; }; + this.terminal.dispatchCommand(cmdName, cmdArgs).then(() => { + this.terminal.print = originalPrint; + const diff = this._diffShadowVFS(false); + if (!diff || diff.length === 0) { + this.terminal.print('📦 Shadow: No filesystem changes detected.', 'success'); + } else { + this.terminal.print(`📦 Shadow: ${diff.length} change(s) detected:`, 'info'); + for (const c of diff) { + const icon = c.type === 'created' ? '➕' : c.type === 'modified' ? '✏️' : '🗑️'; + const sizeStr = c.size !== undefined ? c.size + 'B' : ''; + const detail = c.type === 'created' ? `(${c.entryType}${sizeStr ? ', ' + sizeStr : ''})` : + c.type === 'modified' ? `(${c.sizeBefore}→${c.sizeAfter}B)` : ''; + this.terminal.print(`${icon} ${c.path} ${detail}`, c.type === 'deleted' ? 'warning' : 'info'); + } + // Ask to commit or rollback + this.terminal.print('🔒 VFS modified — type "shadow-commit" to accept or "shadow-rollback" to undo.', 'warning'); + } + }).catch(e => { + this.terminal.print = originalPrint; + this.terminal.print('⚠️ Shadow command error: ' + e.message, 'error'); + }); + } + shadowCommit() { + this._shadowSnapshot = null; + this.terminal.print('✅ Shadow changes committed to VFS', 'success'); + } + shadowRollback() { + if (!this._shadowSnapshot) { + this.terminal.print('❌ No shadow snapshot to rollback to', 'error'); + return; + } + try { + this.terminal.fs.root = JSON.parse(JSON.stringify(this._shadowSnapshot)); + this.terminal.fs.saveToLocalStorage(); + this._shadowSnapshot = null; + this.terminal.print('↩️ VFS rolled back to pre-shadow state', 'success'); + } catch (e) { + this.terminal.print('⚠️ Rollback failed: ' + e.message, 'error'); + } + } + // 🔒 OVERRIDES for isDestructive — adds runTool intercept isDestructive(name) { return name === 'write_file' || name === 'delete_file' || name === 'run_command' || name === 'make_directory' || name === 'edit_module'; } async runTool(name, argsStr) { let a = {}; try { + // 🔒 GUARDRAIL CHECK — intercept before any tool executes + const guardrail = this.checkGuardrail(name, argsStr); + if (guardrail && guardrail.severity === 'deny') { + const errMsg = `🔒 GUARDRAIL BLOCKED: ${guardrail.description} (rule: ${guardrail.id})`; + this.terminal.print(errMsg, 'error'); + this.terminal.log('WARN', 'GUARDRAIL', errMsg); + return JSON.stringify({ error: errMsg }); + } + if (guardrail && guardrail.severity === 'warn') { + this.terminal.print(`🟡 GUARDRAIL WARNING: ${guardrail.description} (rule: ${guardrail.id})`, 'warning'); + } a = typeof argsStr === 'object' ? argsStr : (argsStr ? JSON.parse(argsStr) : {}); switch (name) { case 'list_files': { @@ -1200,10 +1536,19 @@ RULES: case 'run_command': { const cmd = a.command || ''; if (!cmd) return JSON.stringify({ error: 'No command provided' }); + // 📸 Shadow VFS auto-snapshot before run_command + this._snapshotShadowVFS(); const originalPrint = this.terminal.print.bind(this.terminal); let output = ''; this.terminal.print = (text, type) => { output += text + '\n'; }; try { await this.terminal.dispatchCommand(cmd.split(' ')[0].toLowerCase(), cmd.split(' ').slice(1)); } finally { this.terminal.print = originalPrint; } + // 📸 Diff and append shadow report + const shadowDiff = this._diffShadowVFS(); + if (shadowDiff && shadowDiff.length > 0) { + const diffSummary = shadowDiff.map(c => `${c.type}:${c.path}`).join(', '); + output += `\n📦 [Shadow VFS: ${shadowDiff.length} change(s) — ${diffSummary}]`; + this._shadowSnapshot = null; // Changes considered "committed" since AI explicitly ran command + } return output.trim() || '(no output)'; } case 'check_updates': { @@ -1486,6 +1831,27 @@ RULES: const profile = scm.contextProfiles[name]; return JSON.stringify({ success: true, name, displayName: profile.name, systemPrompt: profile.systemPrompt, temperature: profile.temperature }); } + case 'create_mindmap': { + const mindmap = this.terminal.moduleManager.modules['MindmapModule']; + if (!mindmap) return JSON.stringify({ error: 'MindmapModule not loaded' }); + const topic = a.topic || 'Mindmap'; + const children = a.children || ''; + mindmap.root = null; + const args = topic.split(' '); + mindmap._new(args); + if (!mindmap.root) return JSON.stringify({ error: 'Failed to create root' }); + const rootId = mindmap.root.id; + const added = []; + if (children) { + const childNames = children.split(',').map(c => c.trim()).filter(Boolean); + for (const child of childNames) { + mindmap._add([rootId, child]); + added.push(child); + } + } + mindmap._svg([]); + return JSON.stringify({ success: true, topic, children: added.length ? added : 'none', nodes: mindmap._countNodes(mindmap.root), rendered: 'inline SVG in terminal' }); + } case 'view_module': case 'edit_module': case 'test_module': @@ -1731,6 +2097,64 @@ RULES: this.terminal.print('No models available. Use ollamaconnect first.', 'warning'); } } + aiConfig(args) { + if (args.length === 0) { + this.terminal.print('=== AI Config ===', 'info'); + this.terminal.print(`max-turns: ${this.MAX_TOOL_TURNS} (default: 8)`, ''); + this.terminal.print(`max-context: ${this.maxContext} (default: 10)`, ''); + this.terminal.print(`max-context-tokens: ${this.maxContextTokens} (default: 2000)`, ''); + this.terminal.print(`trivial-optimization: ${(this.terminal?.ollamaManager?.optimizationEnabled !== false) ? 'on' : 'off'}`, ''); + this.terminal.print(`confirm-timeout: ${this._confirmTimeoutMs / 1000}s (default: 120s)`, ''); + this.terminal.print(`chat-lock-timeout: ${this._chatLockTimeoutMs / 1000}s (default: 10s)`, ''); + this.terminal.print(`skill-debounce: ${this._skillDebounceMs / 60000}min (default: 30min)`, ''); + this.terminal.print('Usage: ai-config <key> <value>', 'info'); + this.terminal.print('Keys: max-turns, max-context, max-context-tokens, confirm-timeout, chat-lock-timeout, skill-debounce, trivial-optimization', 'info'); + return; + } + const key = args[0]; + const val = args[1]; + if (key === 'max-turns') { + const n = parseInt(val); + if (isNaN(n) || n < 1 || n > 50) return this.terminal.print('max-turns must be 1-50', 'warning'); + this.MAX_TOOL_TURNS = n; + } else if (key === 'max-context') { + const n = parseInt(val); + if (isNaN(n) || n < 1 || n > 100) return this.terminal.print('max-context must be 1-100', 'warning'); + this.maxContext = n; + } else if (key === 'max-context-tokens') { + const n = parseInt(val); + if (isNaN(n) || n < 100 || n > 10000) return this.terminal.print('max-context-tokens must be 100-10000', 'warning'); + this.maxContextTokens = n; + } else if (key === 'confirm-timeout') { + const n = parseInt(val); + if (isNaN(n) || n < 5 || n > 600) return this.terminal.print('confirm-timeout must be 5-600 seconds', 'warning'); + this._confirmTimeoutMs = n * 1000; + } else if (key === 'chat-lock-timeout') { + const n = parseInt(val); + if (isNaN(n) || n < 1 || n > 60) return this.terminal.print('chat-lock-timeout must be 1-60 seconds', 'warning'); + this._chatLockTimeoutMs = n * 1000; + } else if (key === 'skill-debounce') { + const n = parseInt(val); + if (isNaN(n) || n < 1 || n > 240) return this.terminal.print('skill-debounce must be 1-240 minutes', 'warning'); + this._skillDebounceMs = n * 60000; + } else if (key === 'trivial-optimization') { + if (this.terminal?.ollamaManager) { + this.terminal.ollamaManager.optimizationEnabled = val === 'on'; + } + } else { + return this.terminal.print(`Unknown key: ${key}. Valid: max-turns, max-context, max-context-tokens, confirm-timeout, chat-lock-timeout, skill-debounce, trivial-optimization`, 'warning'); + } + // Persist + localStorage.setItem('webx11_ai_config', JSON.stringify({ + maxTurns: this.MAX_TOOL_TURNS, + maxContext: this.maxContext, + maxContextTokens: this.maxContextTokens, + confirmTimeoutMs: this._confirmTimeoutMs, + chatLockTimeoutMs: this._chatLockTimeoutMs, + skillDebounceMs: this._skillDebounceMs + })); + this.terminal.print(`ai-config ${key} set to ${val}`, 'success'); + } showContext() { if (this.context.length === 0) { this.terminal.print('No conversation context', 'info'); return; @@ -1767,55 +2191,6 @@ RULES: try { localStorage.setItem('webx11_user_profile', JSON.stringify(this._userProfile)); } catch (e) {} } } - async _seedDefaultSkills() { - const fs = this.terminal.fs; - const mindmapSkill = `--- -name: mindmap-user-guide -description: How to create, view, and manage brainstorming mindmaps using the mindmap terminal module -tags: [mindmap, brainstorming, organization, planning] -category: productivity ---- -## Steps - -1. **Create a new mindmap:** - - \`mindmap new "<topic>" -t tag1,tag2\` — creates a root node - - Tags are optional (e.g. planning, research, dev) - - Root gets auto-assigned a color - -2. **Add child nodes:** - - \`mindmap add <parent-id> "<idea>" -t tag\` — add a child - - Get the parent-id from \`mindmap show\` - - IDs are 4-char random strings (e.g. a3f8, x7k2) - -3. **View the mindmap:** - - \`mindmap show\` — full tree with Unicode box-drawing - - \`mindmap show <id>\` — subtree starting at that node - -4. **Edit nodes:** - - \`mindmap rename <id> "<new text>"\` — change text - - \`mindmap color <id> <color>\` — set color (red/green/yellow/blue/cyan/magenta/white) - - \`mindmap tag <id> <tag>\` — add a tag - -5. **Persistence:** - - \`mindmap save <name>\` — save to localStorage - - \`mindmap load <name>\` — restore - - \`mindmap list\` — show saved mindmaps - - \`mindmap delete <name>\` — remove saved - -6. **Export:** - - \`mindmap export [id]\` — Markdown bullet list output - -## When to use -- User wants to brainstorm, organize ideas, plan features -- User says "map out", "diagram", "brainstorm", "organize thoughts" -- Visualizing project structure or task decomposition`; - - fs.writeFile('/skills/mindmap-user-guide.md', mindmapSkill); - const existingIndex = fs.fsReadJSON('/skills/index.json') || {}; - existingIndex['mindmap-user-guide'] = { name: 'mindmap-user-guide', description: 'How to create, view, and manage brainstorming mindmaps using the mindmap terminal module', tags: ['mindmap', 'brainstorming', 'organization', 'planning'], category: 'productivity', created: existingIndex['mindmap-user-guide']?.created || new Date().toISOString(), updated: new Date().toISOString() }; - fs.fsWriteJSON('/skills/index.json', existingIndex); - fs.writeFile('/skills/_seeded', '1'); - } _trackPattern(userMessage) { const lower = userMessage.toLowerCase(); const patterns = ['font size','bigger text','smaller text','export','backup','save','install','load module','search','find','color','theme','skill','learn','remember','mindmap','brainstorm']; diff --git a/modules/core/module-chatstudio.js b/modules/core/module-chatstudio.js index 9643fff..1ca5220 100644 --- a/modules/core/module-chatstudio.js +++ b/modules/core/module-chatstudio.js @@ -1,5 +1,5 @@ /* - * ChatStudio Overlay Module for newOS4 v4.2 + * ChatStudio Overlay Module for newOS4 — reads window.NEWOS4_VERSION at runtime * Integrates ChatStudio Lite's full chat UI as an overlay launched via `chat` command. * All Lite engine functions are inlined from lite/cslite-core.js, adapted to use * the terminal's OllamaManager for endpoint configuration. diff --git a/modules/core/module-fs.js b/modules/core/module-fs.js index 160dccc..c2f29c4 100644 --- a/modules/core/module-fs.js +++ b/modules/core/module-fs.js @@ -351,15 +351,65 @@ class FileSystemModule { setTimeout(() => { document.body.removeChild(a); URL.revokeObjectURL(url); }, 2000); this.terminal.print('Exported VFS to webx11-filesystem-' + dateStr + '.json', 'success'); }; + this.commands['vfs-size'] = () => { + try { + const json = JSON.stringify(this.terminal.fs.root); + const totalSize = (json.length / 1024 / 1024).toFixed(2); + const root = this.terminal.fs.root; + const sizeMap = []; + function walk(node, path) { + if (!node || !node.content) return; + for (const [name, child] of Object.entries(node.content)) { + const fullPath = path + '/' + name; + if (child.type === 'file') { + const size = (child.content ? child.content.length : 0); + sizeMap.push({ path: fullPath, size, sizeKB: (size / 1024).toFixed(1) }); + } else if (child.type === 'dir') { + walk(child, fullPath); + } + } + } + walk(root, ''); + sizeMap.sort((a, b) => b.size - a.size); + const totalFiles = sizeMap.length; + const top5 = sizeMap.slice(0, 5); + this.terminal.print('📊 VFS Size Report', 'text-muted'); + this.terminal.print(' Total: ' + totalSize + ' MB across ' + totalFiles + ' files'); + this.terminal.print(' Largest:'); + top5.forEach((f, i) => { + this.terminal.print(' ' + (i + 1) + '. ' + f.path + ' — ' + f.sizeKB + ' KB'); + }); + // Show system dir sizes + const sysDirs = ['/_snapshots', '/_sessions', '/.trash']; + for (const dir of sysDirs) { + const dirNode = this.terminal.fs.readDir(dir); + if (dirNode) { + const cnt = dirNode.length; + // estimate dir size + const dirSize = JSON.stringify(dirNode).length; + this.terminal.print(' ' + dir + ': ' + cnt + ' files, ~' + (dirSize / 1024).toFixed(1) + ' KB', dirSize > 102400 ? 'warning' : 'text-muted'); + } + } + } catch (e) { + this.terminal.print('vfs-size error: ' + e.message, 'error'); + } + }; // Session commands (save/load/export/import) this.commands['session-save'] = (args) => { if (!args[0]) return this.terminal.print('Usage: session-save <name>', 'warning'); const name = args[0].replace(/[^a-zA-Z0-9_-]/g, '_'); + // Strip system dirs to avoid recursive bloat in snapshots + const fsRoot = JSON.parse(JSON.stringify(this.terminal.fs.root)); + if (fsRoot && fsRoot.content) { + delete fsRoot.content['_sessions']; + delete fsRoot.content['_snapshots']; + delete fsRoot.content['.trash']; + } const snapshot = { type: 'session', savedAt: new Date().toISOString(), - fsRoot: this.terminal.fs.root, + fsRoot: fsRoot, currentPath: this.terminal.fs.currentPath, version: 1 }; diff --git a/modules/core/module-loader.js b/modules/core/module-loader.js index b32577d..c5237ad 100644 --- a/modules/core/module-loader.js +++ b/modules/core/module-loader.js @@ -27,7 +27,6 @@ 'module-smartctx.js', 'module-duckduckgo.js', 'module-fetcher.js', - 'module-skills.js', 'secret-vault.js', 'module-chatstudio.js', 'module-agent-registry.js', @@ -106,7 +105,7 @@ window.__moduleLoaderReload = reloadWithSelection; -const LATEST_VER = '2026-06-05-v4.4.0'; +const LATEST_VER = '2026-06-06-v4.5.6'; const CACHE = '?v=' + LATEST_VER; const stored = localStorage.getItem('webx11_cache_ver'); if (stored !== LATEST_VER) { @@ -150,7 +149,7 @@ const CACHE = '?v=' + LATEST_VER; setTimeout(async () => { try { if (webx11.ollamaManager && !webx11.ollamaManager.connected) { - webx11.log('INFO', 'System', 'WebX11 v4.2 started'); + webx11.log('INFO', 'System', 'WebX11 ' + (window.NEWOS4_VERSION || 'v4.0') + ' started'); webx11.log('INFO', 'System', 'Default model: ' + webx11.ollamaManager.currentModel); await webx11.ollamaManager.connect(); if (typeof webx11.updateOllamaStatus === 'function') { diff --git a/modules/core/module-neural-vfs.js b/modules/core/module-neural-vfs.js index e9ffafb..2644e85 100644 --- a/modules/core/module-neural-vfs.js +++ b/modules/core/module-neural-vfs.js @@ -4,6 +4,20 @@ class NeuralVFSModule { this.terminal = null; this.index = {}; this.indexPath = '/.semantic_index/map.json'; + this.hashCachePath = '/.semantic_index/hash_cache.json'; + this._hashCache = {}; + // Configurable display limits + this._fuzzyLimit = 10; + this._treeFiles = 5; + this._treeConcepts = 15; + this._resolveFiles = 20; + this._loadConfig(); + } + _loadConfig() { + try { const c = localStorage.getItem('webx11_nvfs_config'); if (c) { const p = JSON.parse(c); if (p.fuzzyLimit) this._fuzzyLimit = p.fuzzyLimit; if (p.treeFiles) this._treeFiles = p.treeFiles; if (p.treeConcepts) this._treeConcepts = p.treeConcepts; if (p.resolveFiles) this._resolveFiles = p.resolveFiles; } } catch (e) {} + } + _saveConfig() { + localStorage.setItem('webx11_nvfs_config', JSON.stringify({ fuzzyLimit: this._fuzzyLimit, treeFiles: this._treeFiles, treeConcepts: this._treeConcepts, resolveFiles: this._resolveFiles })); } getHelpInfo() { @@ -11,7 +25,8 @@ class NeuralVFSModule { 'nvfs-index': 'nvfs-index — Scan VFS and build semantic concept index', 'nvfs-status': 'nvfs-status — Show semantic index stats and last scan time', 'nvfs-resolve': 'nvfs-resolve <concept> — Find files related to a concept', - 'nvfs-tree': 'nvfs-tree [concept] — Show concept-to-file mapping as a tree' + 'nvfs-tree': 'nvfs-tree [concept] — Show concept-to-file mapping as a tree', + 'nvfs-config': 'nvfs-config [key] [value] — View or set Neural VFS display limits (fuzzy-limit, tree-files, tree-concepts, resolve-files)' }; } @@ -20,56 +35,133 @@ class NeuralVFSModule { this.commands['nvfs-status'] = (args) => this.showStatus(); this.commands['nvfs-resolve'] = (args) => this.resolve(args); this.commands['nvfs-tree'] = (args) => this.tree(args); + this.commands['nvfs-config'] = (args) => this.nvfsConfig(args); } - // ── Core Index Builder ── + // ── Core Index Builder (async, chunked) ── - buildIndex() { + async buildIndex() { const fs = this.terminal.fs; if (!fs) return this.terminal.print('VFS not available', 'error'); this.terminal.print('🔍 Scanning VFS for semantic concepts...', 'info'); const start = Date.now(); - const newIndex = {}; + let newIndex = {}; let fileCount = 0; let conceptCount = 0; + let cachedCount = 0; - // Walk VFS recursively — skip system dirs - this._walk('/', fs, newIndex, (path, node) => { - if (node.type !== 'file') return; - if (this._isSystemFile(path)) return; - - fileCount++; - const concepts = this._extractConcepts(path, node.content || ''); - for (const concept of concepts) { - if (!newIndex[concept]) { - newIndex[concept] = []; - conceptCount++; - } - // Avoid dupes - if (!newIndex[concept].find(e => e.path === path)) { - newIndex[concept].push({ path, summary: this._summarize(node.content) }); - } - } - }); + // Load previous index and hash cache for incremental diffing + const prevIndex = fs.fsReadJSON(this.indexPath) || {}; + this._loadHashCache(fs); + + // Collect current file list + const fileList = []; + this._collectFiles('/', fs, fileList); - // Also index skills - this._indexSkills(fs, newIndex); + if (fileList.length === 0) { + return this.terminal.print('No files found to index', 'warning'); + } + + // Detect deleted files — strip orphaned entries from prevIndex + const currentPaths = new Set(fileList.map(f => f.path)); + let deletedCount = 0; + for (const [concept, entries] of Object.entries(prevIndex)) { + const remaining = entries.filter(e => currentPaths.has(e.path)); + if (remaining.length !== entries.length) deletedCount++; + if (remaining.length > 0) prevIndex[concept] = remaining; + else delete prevIndex[concept]; + } + + // Warm start: clone prevIndex and count live paths for stats + newIndex = JSON.parse(JSON.stringify(prevIndex)); + const livePaths = new Set(); + for (const entries of Object.values(newIndex)) { + for (const e of entries) livePaths.add(e.path); + } + conceptCount = Object.keys(newIndex).length; + + // Chunked async processing — yields to UI between chunks + const chunkSize = 10; + let i = 0; + const processChunk = () => { + const end = Math.min(i + chunkSize, fileList.length); + for (let j = i; j < end; j++) { + const { path, node } = fileList[j]; + fileCount++; + const content = node.content || ''; + const hash = this._contentHash(content); + + // Skip if hash unchanged — content is same as last scan + const cached = this._getCached(path, hash); + if (cached) { + cachedCount++; + if (!livePaths.has(path)) { + // File was in cache but somehow missing from prevIndex + this._reindexFile(path, content, newIndex); + } + continue; + } - this.index = newIndex; - this.lastScan = new Date().toISOString(); - this.fileCount = fileCount; - this.conceptCount = conceptCount; + // Changed or new file — extract concepts fresh + this._reindexFile(path, content, newIndex); + this._hashCache[path] = { hash }; + } + i = end; + if (i < fileList.length) { + const pct = Math.round(i / fileList.length * 100); + const cMsg = cachedCount > 0 ? ` (${cachedCount} cached)` : ''; + this.terminal.print(`⏳ Indexing... ${pct}% (${i}/${fileList.length} files${cMsg})`, 'info'); + setTimeout(processChunk, 0); + } else { + // Also index skills + this._indexSkills(fs, newIndex); + this.index = newIndex; + this.lastScan = new Date().toISOString(); + this.fileCount = fileCount; + this.conceptCount = Object.keys(newIndex).length; + this._saveIndex(fs); + if (fs._clearConceptCache) fs._clearConceptCache(); + const elapsed = ((Date.now() - start) / 1000).toFixed(1); + const processedMsg = cachedCount > 0 ? ` (${cachedCount} cached, ${fileCount - cachedCount} reindexed)` : ''; + this.terminal.print(`✅ Indexed ${fileCount} files → ${Object.keys(newIndex).length} concepts in ${elapsed}s${processedMsg}`, 'success'); + if (deletedCount > 0) this.terminal.print(` Purged ${deletedCount} orphaned concepts from deleted files`, 'info'); + this.terminal.print(` Index saved to ${this.indexPath}`, 'info'); + } + }; + processChunk(); + } - // Save to VFS - this._saveIndex(fs); - // Clear VFS concept cache so concept:// URIs reflect the new index - if (fs._clearConceptCache) fs._clearConceptCache(); + _reindexFile(path, content, index) { + const concepts = this._extractConcepts(path, content); + // Remove old entries for this path + for (const entries of Object.values(index)) { + const idx = entries.findIndex(e => e.path === path); + if (idx !== -1) entries.splice(idx, 1); + } + // Add new entries + for (const concept of concepts) { + if (!index[concept]) { + index[concept] = []; + this.conceptCount++; + } + index[concept].push({ path, summary: this._summarize(content) }); + } + } - const elapsed = ((Date.now() - start) / 1000).toFixed(1); - this.terminal.print(`✅ Indexed ${fileCount} files → ${conceptCount} concepts in ${elapsed}s`, 'success'); - this.terminal.print(` Index saved to ${this.indexPath}`, 'info'); + _collectFiles(path, fs, list) { + const entries = fs.readDir(path); + if (!entries) return; + for (const entry of entries) { + const fullPath = path === '/' ? '/' + entry.name : path + '/' + entry.name; + if (entry.type === 'file') { + if (this._isSystemFile(fullPath)) continue; + list.push({ path: fullPath, node: { type: 'file', content: fs.readFile(fullPath) || '' } }); + } else if (entry.type === 'dir') { + this._collectFiles(fullPath, fs, list); + } + } } // ── Resolve ── @@ -91,17 +183,17 @@ class NeuralVFSModule { if (matches.length > 0) { this.terminal.print(`📂 "${concept}" → ${matches.length} file(s):`, 'info'); - for (const m of matches.slice(0, 20)) { + for (const m of matches.slice(0, this._resolveFiles)) { this.terminal.print(` ${m.path}`, 'success'); if (m.summary) this.terminal.print(` ${m.summary}`, '') } - if (matches.length > 20) { - this.terminal.print(` ... and ${matches.length - 20} more`, 'info'); + if (matches.length > this._resolveFiles) { + this.terminal.print(` ... and ${matches.length - this._resolveFiles} more`, 'info'); } } if (fuzzy.length > 0) { - this.terminal.print(`\n🔀 Similar concepts: ${fuzzy.slice(0, 10).join(', ')}`, 'info'); + this.terminal.print(`\n🔀 Similar concepts: ${fuzzy.slice(0, this._fuzzyLimit).join(', ')}`, 'info'); } } @@ -145,20 +237,45 @@ class NeuralVFSModule { const filtered = filter ? concepts.filter(c => c.includes(filter)) : concepts; this.terminal.print(`🌳 Concept Tree${filter ? ` (filter: "${filter}")` : ''}:`, 'info'); - for (const concept of filtered.slice(0, 15)) { + for (const concept of filtered.slice(0, this._treeConcepts)) { this.terminal.print(` 📁 ${concept}`, 'success'); - for (const entry of this.index[concept].slice(0, 5)) { + for (const entry of this.index[concept].slice(0, this._treeFiles)) { this.terminal.print(` └─ ${entry.path}`, ''); } - if (this.index[concept].length > 5) { - this.terminal.print(` └─ ... (+${this.index[concept].length - 5} more)`, ''); + if (this.index[concept].length > this._treeFiles) { + this.terminal.print(` └─ ... (+${this.index[concept].length - this._treeFiles} more)`, ''); } } - if (filtered.length > 15) { - this.terminal.print(` ... and ${filtered.length - 15} more concepts`, 'info'); + if (filtered.length > this._treeConcepts) { + this.terminal.print(` ... and ${filtered.length - this._treeConcepts} more concepts`, 'info'); } } + // ── Nvfs Config ── + + nvfsConfig(args) { + if (args.length === 0) { + this.terminal.print('=== Neural VFS Config ===', 'info'); + this.terminal.print(`fuzzy-limit: ${this._fuzzyLimit} (default: 10)`, ''); + this.terminal.print(`tree-files: ${this._treeFiles} (default: 5)`, ''); + this.terminal.print(`tree-concepts: ${this._treeConcepts} (default: 15)`, ''); + this.terminal.print(`resolve-files: ${this._resolveFiles} (default: 20)`, ''); + this.terminal.print('Usage: nvfs-config <key> <value>', 'info'); + this.terminal.print('Keys: fuzzy-limit, tree-files, tree-concepts, resolve-files', 'info'); + return; + } + const key = args[0]; + const val = parseInt(args[1]); + if (isNaN(val) || val < 1 || val > 200) return this.terminal.print('Value must be 1-200', 'warning'); + if (key === 'fuzzy-limit') { this._fuzzyLimit = val; } + else if (key === 'tree-files') { this._treeFiles = val; } + else if (key === 'tree-concepts') { this._treeConcepts = val; } + else if (key === 'resolve-files') { this._resolveFiles = val; } + else { return this.terminal.print(`Unknown key: ${key}. Valid: fuzzy-limit, tree-files, tree-concepts, resolve-files`, 'warning'); } + this._saveConfig(); + this.terminal.print(`nvfs-config ${key} set to ${val}`, 'success'); + } + // ── Private Helpers ── _walk(path, fs, index, cb) { @@ -179,6 +296,27 @@ class NeuralVFSModule { return sysPrefixes.some(p => path.startsWith(p) || path.includes('/node_modules')); } + _contentHash(str) { + if (!str) return ''; + let hash = 5381; + for (let i = 0; i < str.length; i++) { + hash = ((hash << 5) + hash) + str.charCodeAt(i); + hash = hash & hash; + } + return Math.abs(hash).toString(36).slice(0, 12); + } + + _loadHashCache(fs) { + const saved = fs.fsReadJSON(this.hashCachePath); + if (saved && typeof saved === 'object') this._hashCache = saved; + } + + _getCached(path, hash) { + const c = this._hashCache[path]; + if (c && c.hash === hash) return c; + return null; + } + _extractConcepts(path, content) { const concepts = new Set(); const name = path.split('/').pop() || ''; @@ -235,10 +373,39 @@ class NeuralVFSModule { _summarize(content) { if (!content || content.length < 10) return ''; + // Strip YAML frontmatter const cleaned = content.replace(/---[\s\S]*?---/, '').trim(); - const firstLine = cleaned.split('\n').find(l => l.trim().length > 20); - if (!firstLine) return ''; - return firstLine.trim().slice(0, 100) + (firstLine.length > 100 ? '...' : ''); + + // 1. Try first ## section heading + const sectionMatch = cleaned.match(/^##\s+(.+)/m); + if (sectionMatch && sectionMatch[1].trim().length > 5) { + const s = sectionMatch[1].trim(); + return s.slice(0, 100) + (s.length > 100 ? '...' : ''); + } + + // 2. Try first paragraph > 40 chars after frontmatter + const lines = cleaned.split('\n').filter(l => l.trim().length > 0); + for (const line of lines) { + const trimmed = line.trim(); + if (trimmed.length > 40 && !trimmed.startsWith('#') && !trimmed.startsWith('//')) { + return trimmed.slice(0, 100) + (trimmed.length > 100 ? '...' : ''); + } + } + + // 3. First meaningful sentence (> 30 chars) + const sentence = cleaned.match(/[^.!?\n]+[.!?]/); + if (sentence && sentence[0].trim().length > 30) { + const s = sentence[0].trim(); + return s.slice(0, 100) + (s.length > 100 ? '...' : ''); + } + + // 4. Fallback: first line > 20 chars (original behavior) + const firstLine = lines.find(l => l.trim().length > 20); + if (firstLine) { + const tl = firstLine.trim(); + return tl.slice(0, 100) + (tl.length > 100 ? '...' : ''); + } + return ''; } _indexSkills(fs, index) { @@ -259,6 +426,8 @@ class NeuralVFSModule { fs.mkdirRecursive('/.semantic_index'); } fs.fsWriteJSON(this.indexPath, this.index); + // Also persist content hash cache for incremental diffing + fs.fsWriteJSON(this.hashCachePath, this._hashCache); } catch (e) { console.error('NeuralVFS save error:', e); } diff --git a/modules/core/module-ollama.js b/modules/core/module-ollama.js index ba8ad57..aec52d4 100644 --- a/modules/core/module-ollama.js +++ b/modules/core/module-ollama.js @@ -30,9 +30,8 @@ class OllamaModule { this.terminal.updateOllamaStatus(); }; this.commands['ollamamodels'] = () => { - const models = this.terminal.ollamaManager.getModels(); - if(models.length === 0) return this.terminal.print("No models found. Connect first."); - models.forEach(m => this.terminal.print(`${m.name} (${(m.size/1e9).toFixed(1)}GB)`)); + // Redirect to the consolidated models command + this.listModels(); }; this.commands['ollamasetmodel'] = (args) => { if(!args[0]) return this.terminal.print("Usage: ollamasetmodel <name>", 'warning'); @@ -62,7 +61,7 @@ class OllamaModule { this.commands['model-run'] = (args) => this.runModel(args); } async listModels() { - const endpoint = localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434'; + const endpoint = this.terminal?.ollamaManager?.endpoint || localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434'; try { const response = await fetch(`${endpoint}/api/tags`); if (!response.ok) throw new Error(`HTTP ${response.status}`); @@ -95,7 +94,7 @@ class OllamaModule { if (!args[0]) { this.terminal.print("Usage: model-info <model-name>", "warning"); return; } - const endpoint = localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434'; + const endpoint = this.terminal?.ollamaManager?.endpoint || localStorage.getItem('webx11_ollama_endpoint') || 'http://localhost:11434'; try { const response = await fetch(`${endpoint}/api/show`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, diff --git a/modules/core/module-orchestrator.js b/modules/core/module-orchestrator.js index ec385bb..05e1598 100644 --- a/modules/core/module-orchestrator.js +++ b/modules/core/module-orchestrator.js @@ -13,10 +13,32 @@ class OrchestratorModule { this._IDLE_TIMEOUT = 120000; this._RESTART_POLICY = 'never'; this._A2A_POLLING = true; + this._A2A_POLL_INTERVAL = 500; + this._HEARTBEAT_CHECK = 3000; + this._IDLE_SWEEP_INTERVAL = 30000; + this._DEAD_PURGE_TIMEOUT = 60000; this._a2aPollTimer = null; this._heartbeatInterval = null; this._a2aMessages = {}; this._restartBackoffs = {}; + this._eventBus = {}; + this._idleSweepInterval = null; + this._loadConfig(); + } + _loadConfig() { + try { const c = localStorage.getItem('webx11_orchestrator_config'); if (c) { const p = JSON.parse(c); if (p.spawnLimit) this._SPAWN_LIMIT = p.spawnLimit; if (p.heartbeatTimeout) this._HEARTBEAT_TIMEOUT = p.heartbeatTimeout; if (p.idleTimeout) this._IDLE_TIMEOUT = p.idleTimeout; if (p.restartPolicy) this._RESTART_POLICY = p.restartPolicy; if (p.a2aPollInterval) this._A2A_POLL_INTERVAL = p.a2aPollInterval; if (p.heartbeatCheck) this._HEARTBEAT_CHECK = p.heartbeatCheck; if (p.idleSweepInterval) this._IDLE_SWEEP_INTERVAL = p.idleSweepInterval; if (p.deadPurgeTimeout) this._DEAD_PURGE_TIMEOUT = p.deadPurgeTimeout; } } catch (e) {} + } + _saveConfig() { + localStorage.setItem('webx11_orchestrator_config', JSON.stringify({ + spawnLimit: this._SPAWN_LIMIT, + heartbeatTimeout: this._HEARTBEAT_TIMEOUT, + idleTimeout: this._IDLE_TIMEOUT, + restartPolicy: this._RESTART_POLICY, + a2aPollInterval: this._A2A_POLL_INTERVAL, + heartbeatCheck: this._HEARTBEAT_CHECK, + idleSweepInterval: this._IDLE_SWEEP_INTERVAL, + deadPurgeTimeout: this._DEAD_PURGE_TIMEOUT + })); } registerCommands() { this.commands['orchestrate'] = (args) => this.delegateTask(args.join(' ')); @@ -39,7 +61,7 @@ class OrchestratorModule { 'orchestrator-spawn': 'orchestrator-spawn [role] [capabilities...] — Manually spawn a new agent', 'orchestrator-kill': 'orchestrator-kill <agent-id> — Terminate an agent and revoke leases', 'orchestrator-purge': 'orchestrator-purge — Remove dead agents (>60s since heartbeat)', - 'orchestrator-config': 'orchestrator-config <key> <value> — Tune: spawn-limit, spawn-strategy, heartbeat-timeout, idle-timeout, restart-policy, a2a-polling', + 'orchestrator-config': 'orchestrator-config <key> <value> — Tune: spawn-limit, spawn-strategy, heartbeat-timeout, idle-timeout, restart-policy, a2a-polling, a2a-poll-interval, heartbeat-check, idle-sweep-interval, dead-purge-timeout', 'orchestrator-list': 'orchestrator-list — List all spawned agents with full details', 'orchestrator-sleep': 'orchestrator-sleep <agent-id> — Suspend agent to VFS', 'orchestrator-wake': 'orchestrator-wake <agent-id> — Restore agent from VFS sleep', @@ -59,13 +81,39 @@ class OrchestratorModule { this._reanimateFromVFS(); // A2A mailbox polling loop (500ms) if (this._A2A_POLLING) { - this._a2aPollTimer = setInterval(() => this._pollAgentMailboxes(), 500); + this._a2aPollTimer = setInterval(() => this._pollAgentMailboxes(), this._A2A_POLL_INTERVAL); } - // Heartbeat watchdog every 3 seconds - this._heartbeatInterval = setInterval(() => this._checkHeartbeats(), 3000); - // Idle timeout sweep every 30s - setInterval(() => this._sweepIdle(), 30000); + // Heartbeat watchdog + this._heartbeatInterval = setInterval(() => this._checkHeartbeats(), this._HEARTBEAT_CHECK); + // Idle timeout sweep + this._idleSweepInterval = setInterval(() => this._sweepIdle(), this._IDLE_SWEEP_INTERVAL); this.terminal.print('🧠 Orchestrator loaded — A2A mailbox transport active', 'success'); + // Subscribe to event bus for in-memory A2A delivery (instant, no VFS poll) + this._on('a2a:message', (msg) => { + if (msg.type === 'heartbeat' && msg.from && this._agents[msg.from]) { + this._agents[msg.from].lastHeartbeat = Date.now(); + } + if (msg.type === 'response' && msg.from && this._agents[msg.from]) { + this._agents[msg.from].status = 'idle'; + this._agents[msg.from].currentTask = null; + } + }); + } + + // ─── Event Bus (in-memory pub/sub for agent communication) ─── + + _on(event, callback) { + if (!this._eventBus[event]) this._eventBus[event] = []; + this._eventBus[event].push(callback); + return () => { // Return unsubscribe function + this._eventBus[event] = this._eventBus[event].filter(cb => cb !== callback); + }; + } + + _emit(event, data) { + for (const cb of (this._eventBus[event] || [])) { + try { cb(data); } catch (e) { /* subscriber error */ } + } } // ─── A2A Mailbox Transport ─── @@ -104,6 +152,10 @@ class OrchestratorModule { this._a2aMessages[agentId].push({ ...msg, _processed: false }); this.terminal.print(`📨 A2A message sent to ${agentId} (${msg.type}, id: ${msg.msg_id})`, 'success'); + + // Emit via event bus for in-memory delivery (bypasses VFS polling) + this._emit('a2a:message', msg); + this._emit(`a2a:message:${agentId}`, msg); } listA2AMessages() { @@ -178,8 +230,12 @@ class OrchestratorModule { // ─── Agent Lifecycle ─── + _sanitizeId(name) { + return (name || 'worker').replace(/[^a-zA-Z0-9_-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '').substring(0, 32) || 'worker'; + } spawnAgent(role, capabilities) { - const id = `agent-${Object.keys(this._agents).length + 1}-${role || 'worker'}`; + const safeRole = this._sanitizeId(role); + const id = `agent-${Object.keys(this._agents).length + 1}-${safeRole}`; if (Object.keys(this._agents).length >= this._SPAWN_LIMIT) { this.terminal.print(`❌ Agent spawn limit (${this._SPAWN_LIMIT}) reached`, 'error'); return null; @@ -343,13 +399,26 @@ class OrchestratorModule { _deriveCapabilities(task) { const caps = ['list_files', 'read_file']; const lower = task.toLowerCase(); - if (lower.includes('search') || lower.includes('find') || lower.includes('look up') || lower.includes('web')) caps.push('web_search'); - if (lower.includes('write') || lower.includes('create') || lower.includes('save') || lower.includes('edit')) caps.push('write_file'); - if (lower.includes('delete') || lower.includes('remove') || lower.includes('rm ')) caps.push('delete_file'); - if (lower.includes('install') || lower.includes('package') || lower.includes('wpm')) caps.push('wpm_install'); - if (lower.includes('module') || lower.includes('view') || lower.includes('edit')) caps.push('view_module', 'edit_module'); - if (lower.includes('list') || lower.includes('status') || lower.includes('health')) caps.push('get_status'); - if (lower.includes('fetch') || lower.includes('url') || lower.includes('http')) caps.push('web_fetch'); + const CAP_MAP = [ + { patterns: ['search', 'find', 'research', 'lookup', 'query', 'look up'], caps: ['web_search'] }, + { patterns: ['write', 'create', 'generate', 'compose', 'draft', 'save'], caps: ['write_file'] }, + { patterns: ['delete', 'remove', 'trash', 'rm '], caps: ['delete_file'] }, + { patterns: ['read', 'view', 'cat', 'show', 'display', 'inspect', 'preview'], caps: [] }, // already has read_file + { patterns: ['edit', 'modify', 'update', 'patch', 'change', 'fix'], caps: ['write_file'] }, + { patterns: ['install', 'package', 'wpm', 'setup'], caps: ['wpm_install'] }, + { patterns: ['module', 'plugin', 'ext'], caps: ['view_module', 'edit_module'] }, + { patterns: ['list', 'status', 'health', 'audit', 'report', 'check'], caps: ['get_status'] }, + { patterns: ['fetch', 'url', 'http', 'scrape'], caps: ['web_fetch'] }, + { patterns: ['code', 'program', 'script', 'build', 'develop', 'compile'], caps: ['list_files', 'read_file', 'write_file'] }, + { patterns: ['analyze', 'analyse', 'summarize', 'review', 'investigate'], caps: ['web_search', 'list_files', 'read_file'] }, + { patterns: ['deploy', 'publish', 'upload'], caps: ['write_file', 'webdav_upload'] }, + { patterns: ['monitor', 'watch', 'poll', 'track', 'observe'], caps: ['get_status'] }, + ]; + for (const entry of CAP_MAP) { + if (entry.patterns.some(p => lower.includes(p))) { + entry.caps.forEach(c => caps.push(c)); + } + } return [...new Set(caps)]; } @@ -381,13 +450,17 @@ class OrchestratorModule { 'a2a-polling': () => { this._A2A_POLLING = val === 'on' || val === 'true'; if (this._A2A_POLLING && !this._a2aPollTimer) { - this._a2aPollTimer = setInterval(() => this._pollAgentMailboxes(), 500); + this._a2aPollTimer = setInterval(() => this._pollAgentMailboxes(), this._A2A_POLL_INTERVAL); } else if (!this._A2A_POLLING && this._a2aPollTimer) { clearInterval(this._a2aPollTimer); this._a2aPollTimer = null; } return `a2a-polling ${this._A2A_POLLING ? 'on' : 'off'}`; - } + }, + 'a2a-poll-interval': () => { const n = parseInt(val); if (isNaN(n) || n < 50 || n > 30000) return 'Must be 50-30000ms'; clearInterval(this._a2aPollTimer); this._a2aPollTimer = null; this._A2A_POLL_INTERVAL = n; if (this._A2A_POLLING) { this._a2aPollTimer = setInterval(() => this._pollAgentMailboxes(), n); } return `a2a-poll-interval set to ${n}ms`; }, + 'heartbeat-check': () => { const n = parseInt(val); if (isNaN(n) || n < 500 || n > 60000) return 'Must be 500-60000ms'; clearInterval(this._heartbeatInterval); this._HEARTBEAT_CHECK = n; this._heartbeatInterval = setInterval(() => this._checkHeartbeats(), n); return `heartbeat-check set to ${n}ms`; }, + 'idle-sweep-interval': () => { const n = parseInt(val); if (isNaN(n) || n < 5000 || n > 600000) return 'Must be 5000-600000ms'; clearInterval(this._idleSweepInterval); this._IDLE_SWEEP_INTERVAL = n; this._idleSweepInterval = setInterval(() => this._sweepIdle(), n); return `idle-sweep-interval set to ${n}ms`; }, + 'dead-purge-timeout': () => { const n = parseInt(val); if (isNaN(n) || n < 5000 || n > 600000) return 'Must be 5000-600000ms'; this._DEAD_PURGE_TIMEOUT = n; return `dead-purge-timeout set to ${n}ms`; } }; if (!configMap[key]) { @@ -395,6 +468,7 @@ class OrchestratorModule { } const result = configMap[key](); this.terminal.print(`✅ ${result}`, 'success'); + this._saveConfig(); } // ─── Task Delegation ─── @@ -522,7 +596,7 @@ class OrchestratorModule { const now = Date.now(); let count = 0; Object.entries(this._agents).forEach(([id, agent]) => { - if (now - agent.lastHeartbeat > 60000) { + if (now - agent.lastHeartbeat > this._DEAD_PURGE_TIMEOUT) { this.killAgent(id); count++; } diff --git a/modules/core/module-sandbox.js b/modules/core/module-sandbox.js index dc8dc76..67b8357 100644 --- a/modules/core/module-sandbox.js +++ b/modules/core/module-sandbox.js @@ -33,7 +33,7 @@ class SandboxModule { init(terminal) { this.terminal = terminal; - this.workerUrl = '/spaces/newos4/modules/core/sandbox-worker.js'; + this.workerUrl = '/spaces/newos4/modules/core/sandbox-worker.js?v=2026-06-05-v4.4.0'; // Detect Worker availability if (typeof Worker === 'undefined') { @@ -41,6 +41,19 @@ class SandboxModule { this.terminal.print('⚠️ WebWorkers not available — sandbox using inline fallback', 'warning'); } else { this._initPool(); + // Deferred check: workers may fail asynchronously (headless browsers) + // If no worker proves alive within 1.5s, switch to inline fallback + this._workerCheckTimer = setTimeout(() => { + if (!this._fallbackMode && this.workers.length > 0) { + const alive = this.workers.some(w => !w._failed && this._workerReady[w._sandboxId]); + if (!alive) { + this._fallbackMode = true; + this.workers.forEach(w => w.terminate()); + this.workers = []; + this.terminal.print('⚠️ WebWorkers unavailable — switching to inline fallback', 'warning'); + } + } + }, 1500); } this.terminal.print('🧪 Sandbox module loaded', 'info'); @@ -49,44 +62,65 @@ class SandboxModule { _initPool() { // Start with MIN_WORKERS, grow on demand up to MAX_WORKERS for (let i = 0; i < this.MIN_WORKERS; i++) { - this._spawnWorker(); + const w = this._spawnWorker(); + if (!w) break; // first failure kills the pool } } _spawnWorker() { if (this.workers.length >= this.MAX_WORKERS) return null; + if (this._fallbackMode) return null; try { const worker = new Worker(this.workerUrl); const id = `w${this.workers.length + 1}`; worker._sandboxId = id; worker._busy = false; + worker._failed = false; - worker.onmessage = (e) => this._handleResult(e.data, id); + // Detect immediate worker failure (headless browsers, restricted contexts) + const failTimer = setTimeout(() => { + if (!worker._failed) { + // Worker survived 2 seconds - likely functional + } + }, 2000); + + worker.onmessage = (e) => { + clearTimeout(failTimer); + if (e.data && e.data.type === 'ready') { + this._workerReady[id] = true; + } else { + this._handleResult(e.data, id); + } + }; worker.onerror = (e) => { - console.error(`[Sandbox] Worker ${id} error:`, e.message); - this._totalErrors++; - this._replaceWorker(id); + clearTimeout(failTimer); + worker._failed = true; + worker.terminate(); + console.warn(`[Sandbox] Worker ${id} failed (headless env) — switching to inline`); + this._fallbackMode = true; + this.workers.forEach(w => w.terminate()); + this.workers = []; + this.terminal.print('⚠️ WebWorkers unavailable in this environment — using inline fallback', 'warning'); }; this.workers.push(worker); - this._workerReady[id] = true; return worker; } catch (e) { - console.error('[Sandbox] Failed to spawn worker:', e); + console.warn('[Sandbox] Failed to spawn worker:', e); this._fallbackMode = true; return null; } } _replaceWorker(id) { + // In headless environments, workers don't work — don't retry + if (this._fallbackMode) return; const idx = this.workers.findIndex(w => w._sandboxId === id); if (idx !== -1) { this.workers[idx].terminate(); this.workers.splice(idx, 1); delete this._workerReady[id]; } - // Re-spawn after a delay - setTimeout(() => this._spawnWorker(), 1000); } _getIdleWorker() { @@ -104,7 +138,13 @@ class SandboxModule { async runInSandbox(task, capabilities) { if (!task) return this.terminal.print('Usage: sandbox-run <task>', 'error'); - if (this._fallbackMode) { + // Check if any worker is actually alive and ready + const hasAliveWorker = this.workers.some(w => + !w._failed && this._workerReady[w._sandboxId] + ); + const useInline = this._fallbackMode || this.workers.length === 0 || !hasAliveWorker; + + if (useInline) { return this._runInline(task, capabilities); } diff --git a/modules/core/module-simplegui.js b/modules/core/module-simplegui.js index 78fa9b5..09d172a 100644 --- a/modules/core/module-simplegui.js +++ b/modules/core/module-simplegui.js @@ -29,8 +29,9 @@ } const label = args[0], command = args.slice(1).join(' '); const id = 'gui-btn-' + Date.now(); + const safeCmd = command.replace(/'/g, "\\'"); this.terminal.printHTML(`<div style="margin: 5px 0;"> - <button class="qa-btn" onclick="${command}" id="${id}">${label}</button> + <button class="qa-btn" onclick="(window.webx11||window).executeCommand('${safeCmd}')" id="${id}">${label}</button> </div>`); this.guiElements[id] = { type: 'button', label, command }; this.terminal.print(`Button '${label}' created`, "success"); diff --git a/modules/core/module-skills.js b/modules/core/module-skills.js deleted file mode 100644 index 9d0adec..0000000 --- a/modules/core/module-skills.js +++ /dev/null @@ -1,295 +0,0 @@ -// Extracted from newOS4 index.html — SkillsModule (v4.2 — Self-improving AI) - class SkillsModule { - constructor() { - this.commands = {}; - this.terminal = null; - this._skillIndexCache = null; - this._skillIndexDirty = false; - this._skillIndexFlushTimer = null; - } - _readSkillIndex() { - if (this._skillIndexCache !== null) return this._skillIndexCache; - const fs = this.terminal.fs; - this._skillIndexCache = fs.fsReadJSON('/skills/index.json') || {}; - return this._skillIndexCache; - } - _markSkillIndexDirty() { - this._skillIndexDirty = true; - if (this._skillIndexFlushTimer) clearTimeout(this._skillIndexFlushTimer); - this._skillIndexFlushTimer = setTimeout(() => this._flushSkillIndex(), 2000); - } - _flushSkillIndex() { - if (!this._skillIndexDirty || this._skillIndexCache === null) return; - const fs = this.terminal.fs; - fs.fsWriteJSON('/skills/index.json', this._skillIndexCache); - this._skillIndexDirty = false; - this._skillIndexFlushTimer = null; - } - getHelpInfo() { - return { - 'skill-list': 'skill-list — List all installed skills', - 'skill-view': 'skill-view <name> — View the content of a skill', - 'skill-create': 'skill-create <name> [desc] [category] [tags] — Create a new skill', - 'skill-patch': 'skill-patch <name> [content...] — Update skill content (no args to view current)', - 'skill-delete': 'skill-delete <name> — Delete a skill', - 'skill-export': 'skill-export <name> — Export a skill to WebDAV', - 'skill-import': 'skill-import <name> — Import a skill from WebDAV', - 'skill-sync': 'skill-sync — Bidirectional sync all skills with WebDAV', - }; - } - ensureSkillsDir() { - if (this.terminal && this.terminal.fs) { - const fs = this.terminal.fs; - // Ensure /skills/ directory exists - if (!fs.root.content['skills']) { - fs.root.content['skills'] = { type: 'dir', content: {} }; - fs.saveToStorage(); - } - } - } - registerCommands() { - this.commands['skill-list'] = () => this.listSkills(); - this.commands['skill-view'] = (args) => this.viewSkill(args); - this.commands['skill-create'] = (args) => this.createSkill(args); - this.commands['skill-patch'] = (args) => this.patchSkill(args); - this.commands['skill-delete'] = (args) => this.deleteSkill(args); - this.commands['skill-export'] = (args) => this.exportSkill(args); - this.commands['skill-import'] = (args) => this.importSkill(args); - this.commands['skill-sync'] = () => this.syncSkills(); - } - listSkills() { - this.ensureSkillsDir(); - const index = this._readSkillIndex(); - const names = Object.keys(index); - if (names.length === 0) { - this.terminal.print('No skills found.', 'info'); - return; - } - this.terminal.print(`=== Skills (${names.length}) ===`, 'info'); - names.forEach(name => { - const s = index[name]; - const tags = (s.tags || []).join(', '); - this.terminal.print(`📘 ${name} — ${s.description} [${s.category}] ${tags ? '(' + tags + ')' : ''}`); - }); - } - viewSkill(args) { - const name = (args[0] || '').replace(/\.md$/, ''); - if (!name) { - this.terminal.print('Usage: skill-view <name>', 'warning'); - return; - } - const content = this.terminal.fs.readFile(`/skills/${name}.md`); - if (!content) { - this.terminal.print(`Skill '${name}' not found`, 'error'); - return; - } - this.terminal.print(`=== ${name} ===`, 'info'); - this.terminal.print(content, 'info'); - } - createSkill(args) { - this.ensureSkillsDir(); - const name = args[0]; - if (!name) { - this.terminal.print('Usage: skill-create <name> [description] [category] [tag1,tag2,...]', 'warning'); - return; - } - const description = args[1] || 'No description'; - const category = args[2] || 'general'; - const tags = (args[3] || '').split(',').filter(Boolean); - const fs = this.terminal.fs; - if (fs.readFile(`/skills/${name}.md`)) { - this.terminal.print(`Skill '${name}' already exists. Use skill-patch to modify it.`, 'warning'); - return; - } - const content = '---\nname: ' + name + '\ndescription: ' + description + '\ntags: [' + tags.join(', ') + ']\ncategory: ' + category + '\n---\n## Steps\n1. (to be filled)\n'; - fs.writeFile(`/skills/${name}.md`, content); - const index = this._readSkillIndex(); - index[name] = { name, description, category, tags }; - this._markSkillIndexDirty(); - this.terminal.print(`Skill '${name}' created. Edit its content with skill-patch ${name}`, 'success'); - } - patchSkill(args) { - const name = args[0]; - if (!name) { - this.terminal.print('Usage: skill-patch <name> [content...]', 'warning'); - return; - } - const fs = this.terminal.fs; - const existing = fs.readFile(`/skills/${name}.md`); - if (!existing) { - this.terminal.print(`Skill '${name}' not found. Use skill-create first.`, 'error'); - return; - } - if (args.length < 2) { - // No new content — show the skill so user can copy-paste - this.terminal.print(`=== ${name} (current content) ===`, 'info'); - this.terminal.print(existing, 'info'); - this.terminal.print('---', 'info'); - this.terminal.print('Pass new content as additional arguments: skill-patch <name> <full content>', 'warning'); - return; - } - const newContent = args.slice(1).join(' '); - fs.writeFile(`/skills/${name}.md`, newContent); - this.terminal.print(`Skill '${name}' patched`, 'success'); - } - deleteSkill(args) { - const name = (args[0] || '').replace(/\.md$/, ''); - if (!name) { - this.terminal.print('Usage: skill-delete <name>', 'warning'); - return; - } - const fs = this.terminal.fs; - if (!fs.readFile(`/skills/${name}.md`)) { - this.terminal.print(`Skill '${name}' not found`, 'error'); - return; - } - fs.writeFile(`/skills/${name}.md`, ''); - const index = this._readSkillIndex(); - delete index[name]; - this._markSkillIndexDirty(); - this.terminal.print(`Skill '${name}' deleted`, 'success'); - } - getWebDAVModule() { - return this.terminal && this.terminal.moduleManager.modules['WebDAVModule']; - } - async exportSkill(args) { - const name = (args[0] || '').replace(/\.md$/, ''); - if (!name) { - this.terminal.print('Usage: skill-export <name>', 'warning'); - return; - } - const wd = this.getWebDAVModule(); - if (!wd || !wd.config || !wd.config.url) { - this.terminal.print('WebDAV not configured. Use webdav-config first.', 'warning'); - return; - } - this.ensureSkillsDir(); - const fs = this.terminal.fs; - const content = fs.readFile(`/skills/${name}.md`); - if (!content) { - this.terminal.print(`Skill '${name}' not found in VFS`, 'error'); - return; - } - const index = this._readSkillIndex(); - const meta = index[name]; - try { - // Ensure remote skills dir - if (typeof wd._ensureDir === 'function') await wd._ensureDir('skills'); - // Push the skill file - const resp1 = await wd._webdavRequest('PUT', 'skills/' + name + '.md', { - body: content, - headers: { 'Content-Type': 'text/markdown' } - }); - if (!resp1.ok && resp1.status !== 201 && resp1.status !== 204) { - throw new Error('Upload failed: HTTP ' + resp1.status); - } - // Push updated index - const indexResp = await wd._webdavRequest('PUT', 'skills/index.json', { - body: JSON.stringify(index, null, 2), - headers: { 'Content-Type': 'application/json' } - }); - if (indexResp.ok || indexResp.status === 201 || indexResp.status === 204) { - this.terminal.print(`Skill '${name}' exported to WebDAV skills/`, 'success'); - } - } catch (e) { - this.terminal.print('Export failed: ' + e.message, 'error'); - } - } - async importSkill(args) { - const name = (args[0] || '').replace(/\.md$/, ''); - if (!name) { - this.terminal.print('Usage: skill-import <name>', 'warning'); - return; - } - const wd = this.getWebDAVModule(); - if (!wd || !wd.config || !wd.config.url) { - this.terminal.print('WebDAV not configured. Use webdav-config first.', 'warning'); - return; - } - try { - const resp = await wd._webdavRequest('GET', 'skills/' + name + '.md'); - if (!resp.ok) throw new Error('HTTP ' + resp.status); - const content = await resp.text(); - this.ensureSkillsDir(); - const fs = this.terminal.fs; - fs.writeFile(`/skills/${name}.md`, content); - // Try to pull the index to get metadata; if fails, create minimal entry - let meta = { name, description: 'Imported from WebDAV', category: 'general', tags: [] }; - try { - const indexResp = await wd._webdavRequest('GET', 'skills/index.json'); - if (indexResp.ok) { - const remoteIndex = JSON.parse(await indexResp.text()); - if (remoteIndex && remoteIndex[name]) { - meta = remoteIndex[name]; - } - } - } catch (e) { /* use default meta */ } - const index = this._readSkillIndex(); - index[name] = meta; - this._markSkillIndexDirty(); - this.terminal.print(`Skill '${name}' imported from WebDAV (${content.length} bytes)`, 'success'); - } catch (e) { - this.terminal.print('Import failed: ' + e.message, 'error'); - } - } - async syncSkills() { - const wd = this.getWebDAVModule(); - if (!wd || !wd.config || !wd.config.url) { - this.terminal.print('WebDAV not configured. Use webdav-config first.', 'warning'); - return; - } - this.ensureSkillsDir(); - const fs = this.terminal.fs; - const localIndex = this._readSkillIndex(); - const localNames = new Set(Object.keys(localIndex)); - this.terminal.print('Syncing skills with WebDAV...', 'info'); - let imported = 0, exported = 0; - try { - // Try to get remote index - let remoteIndex = {}; - try { - const resp = await wd._webdavRequest('GET', 'skills/index.json'); - if (resp.ok) { - remoteIndex = JSON.parse(await resp.text()) || {}; - } - } catch (e) { /* no remote index yet */ } - const remoteNames = new Set(Object.keys(remoteIndex)); - // Export local-only skills to remote - for (const name of localNames) { - if (!remoteNames.has(name)) { - const content = fs.readFile(`/skills/${name}.md`); - if (content) { - await wd._ensureDir('skills'); - await wd._webdavRequest('PUT', 'skills/' + name + '.md', { - body: content, - headers: { 'Content-Type': 'text/markdown' } - }); - exported++; - } - } - } - // Import remote-only skills to local - for (const name of remoteNames) { - if (!localNames.has(name)) { - const resp = await wd._webdavRequest('GET', 'skills/' + name + '.md'); - if (resp.ok) { - const content = await resp.text(); - fs.writeFile(`/skills/${name}.md`, content); - localIndex[name] = remoteIndex[name]; - imported++; - } - } - } - // Push updated local index back to remote - this._markSkillIndexDirty(); - await wd._ensureDir('skills'); - await wd._webdavRequest('PUT', 'skills/index.json', { - body: JSON.stringify(localIndex, null, 2), - headers: { 'Content-Type': 'application/json' } - }); - this.terminal.print(`Sync complete: ${exported} exported, ${imported} imported`, 'success'); - } catch (e) { - this.terminal.print('Sync failed: ' + e.message, 'error'); - } - } - } diff --git a/modules/core/module-system.js b/modules/core/module-system.js index c0dbe14..c2115c1 100644 --- a/modules/core/module-system.js +++ b/modules/core/module-system.js @@ -44,7 +44,7 @@ } }, 500); this.commands['status'] = () => { - this.terminal.print(`System: WebX11 v4.2`); + this.terminal.print(`System: WebX11 ${window.NEWOS4_VERSION || 'v4.0'}`); this.terminal.print(`Network: ${navigator.onLine ? 'Online' : 'Offline'}`); this.terminal.print(`Files: ${this.terminal.fs.ls().length} items`); this.terminal.print(`Modules: ${Object.keys(this.terminal.moduleManager.modules).length} loaded`); @@ -134,6 +134,55 @@ this.terminal.print(`Font size set to ${val}px (saved) 👆`, 'success'); }; this.commands['setfont'] = this.commands['font-size']; + + // Checkpoint commands (delegated to virtual-fs.js) + this.commands['checkpoint'] = (args) => { + try { + const name = args[0] || ''; + this.terminal.fs.checkpoint(name); + const displayName = name || new Date().toISOString(); + this.terminal.print('✅ Checkpoint created: ' + displayName, 'success'); + } catch (e) { + this.terminal.print('Checkpoint failed: ' + e.message, 'error'); + } + }; + this.commands['checkpoint-list'] = () => { + try { + const list = this.terminal.fs.listCheckpoints(); + if (!list || list.length === 0) { + this.terminal.print('No checkpoints found', 'info'); + return; + } + this.terminal.print('📋 Checkpoints:', 'text-muted'); + list.forEach(c => this.terminal.print(' • ' + c)); + } catch (e) { + this.terminal.print('checkpoint-list failed: ' + e.message, 'error'); + } + }; + this.commands['checkpoint-del'] = (args) => { + if (!args[0]) return this.terminal.print('Usage: checkpoint-del <name>', 'warning'); + try { + if (this.terminal.fs.deleteCheckpoint(args[0])) { + this.terminal.print('Deleted checkpoint: ' + args[0], 'success'); + } else { + this.terminal.print('Checkpoint not found: ' + args[0], 'error'); + } + } catch (e) { + this.terminal.print('checkpoint-del failed: ' + e.message, 'error'); + } + }; + this.commands['rollback'] = (args) => { + if (!args[0]) return this.terminal.print('Usage: rollback <name>', 'warning'); + try { + if (this.terminal.fs.rollback(args[0])) { + this.terminal.print('↻ Rolled back to checkpoint: ' + args[0], 'success'); + } else { + this.terminal.print('Rollback failed: checkpoint not found or invalid', 'error'); + } + } catch (e) { + this.terminal.print('Rollback failed: ' + e.message, 'error'); + } + }; } _autoRotateLogs(force = false) { try { @@ -253,7 +302,7 @@ skills:'📚 Skills', config:'⚙️ Config', webx:'🌐 WebX', data:'💾 Data', ext:'🧰 Extras', gui:'🖥️ GUI', vault:'🔒 Vault' }; - let result = '╔══════════════════════════════════════╗\n║ 🔷 WebX11 v4.2 — All Commands ║\n╚══════════════════════════════════════╝\n\n'; + let result = '╔══════════════════════════════════════╗\n║ 🔷 WebX11 ' + (window.NEWOS4_VERSION || 'v4.0') + ' — All Commands ║\n╚══════════════════════════════════════╝\n\n'; const total = Object.keys(helpMap).length; result += `📊 ${total} commands loaded\n\n`; for (const [key, cmds] of Object.entries(cats)) { diff --git a/modules/core/module-world-model.js b/modules/core/module-world-model.js index b7bb28f..e8e3405 100644 --- a/modules/core/module-world-model.js +++ b/modules/core/module-world-model.js @@ -33,13 +33,21 @@ class WorldModelModule { init(terminal) { this.terminal = terminal; this._loadFromVFS(); + // Deferred initial synthesis — wait for ext modules (SkillPackCore etc) to fully load + setTimeout(() => { + this._synthesize(); + this.terminal.print('🌐 World Model synthesized — system self-awareness active', 'info'); + // Second pass after ext modules definitely finished loading + setTimeout(() => { + this._synthesize(); + this.terminal.print('🌐 World Model refresh — full module load confirmed', 'info'); + }, 7000); + }, 5000); // Auto-refresh on a timer this._refreshTimer = setInterval(() => { const age = Date.now() - (this._lastRefresh ? new Date(this._lastRefresh).getTime() : 0); if (age > this._REFRESH_INTERVAL) this._synthesize(); }, this._REFRESH_INTERVAL); - // Initial synthesis - this._synthesize(); this.terminal.print('🌐 World Model loaded — system self-awareness active', 'info'); } @@ -50,15 +58,22 @@ class WorldModelModule { const fs = this.terminal.fs; if (!fs) return; + // Derive version from actual system state — no hardcoded strings + const mInfo = this._gatherModuleInfo(); + const agentInfo = this._gatherAgentInfo(); + const fileInfo = this._gatherFileInfo(fs); + const skillInfo = this._gatherSkillInfo(fs); + const liveVersion = this._deriveVersion(mInfo); + const model = { - version: 'v4.4', + version: liveVersion, synthesized: new Date().toISOString(), - system: this._gatherSystemInfo(fs), - modules: this._gatherModuleInfo(), - files: this._gatherFileInfo(fs), - skills: this._gatherSkillInfo(fs), + system: this._gatherSystemInfo(fs, mInfo.loaded, liveVersion), + modules: mInfo, + files: fileInfo, + skills: skillInfo, memory: this._gatherMemoryInfo(), - agents: this._gatherAgentInfo(), + agents: agentInfo, telemetry: this._gatherTelemetry(fs), projects: this._gatherProjects(fs), recent: this._gatherRecent(fs) @@ -78,11 +93,30 @@ class WorldModelModule { } } - _gatherSystemInfo(fs) { + _deriveVersion(mInfo) { + // Single source of truth: the constant set at bootstrap + if (window.NEWOS4_VERSION) return window.NEWOS4_VERSION; + // No fallback version string — if the constant is missing, report unknown + return 'v?'; + } + + _getTotalModules() { + try { + const mm = this.terminal?.moduleManager; + if (!mm) return 0; + // Count registry entries (all known modules) vs loaded + const registry = mm.moduleRegistry || []; + return registry.length || Object.keys(mm.modules || {}).length + 5; // +5 for expected unloaded + } catch (e) { + return Object.keys(this.terminal?.moduleManager?.modules || {}).length || 0; + } + } + + _gatherSystemInfo(fs, moduleCount, version) { const healthData = fs.fsReadJSON('/system/metrics/health.json'); return { - version: 'newOS4 v4.4', - modules: Object.keys(this.terminal?.moduleManager?.modules || {}).length || 0, + version: `newOS4 ${version}`, + modules: moduleCount || Object.keys(this.terminal?.moduleManager?.modules || {}).length || 0, vfsSize: JSON.stringify(fs?.root || {}).length, online: typeof navigator !== 'undefined' ? navigator.onLine : true, memory: typeof performance !== 'undefined' && performance.memory @@ -109,7 +143,7 @@ class WorldModelModule { : []; return { loaded: modules.length, - total: 49, + total: this._getTotalModules(), modules, modified, modifiedCount: modified.length diff --git a/modules/core/sandbox-worker.js b/modules/core/sandbox-worker.js index 5841582..696c510 100644 --- a/modules/core/sandbox-worker.js +++ b/modules/core/sandbox-worker.js @@ -5,11 +5,16 @@ let _vfs = null; let _apiProxyOrigin = null; -self.onmessage = async (e) => { - const { taskId, task, capabilities, vfsSnapshot, allowedCommands, apiProxy } = e.data; - _apiProxyOrigin = apiProxy ? new URL(apiProxy).origin : null; +// Signal ready immediately +self.postMessage({ type: 'ready' }); - const startTime = performance.now(); +self.addEventListener('message', async (e) => { + const { taskId, task, capabilities, vfsSnapshot, allowedCommands, apiProxy } = e.data || {}; + + // Must have a taskId to respond to + if (!taskId) return; + + const startTime = self.performance.now(); let toolCalls = 0; let result = ''; let error = null; @@ -17,18 +22,13 @@ self.onmessage = async (e) => { try { // Rebuild VFS from snapshot _vfs = vfsSnapshot ? JSON.parse(vfsSnapshot) : { root: { type: 'dir', content: {} }, currentPath: [] }; - - // Log start - console.log(`[Sandbox ${taskId}] Starting task: "${task.substring(0, 60)}"`); + _apiProxyOrigin = apiProxy ? new URL(apiProxy).origin : null; // Parse the task for tool use - const toolResults = {}; + const parts = (task || '').trim().split(/\s+/); + const cmd = parts.length > 0 ? parts[0].toLowerCase() : ''; const commandWhitelist = allowedCommands || ['ls', 'cat', 'echo', 'find', 'grep', 'help', 'status']; - // Execute basic commands - const parts = task.trim().split(/\s+/); - const cmd = parts[0].toLowerCase(); - if (cmd === 'ls' || cmd === 'list') { result = sandbox_ls(parts[1] || '/'); toolCalls++; @@ -50,117 +50,115 @@ self.onmessage = async (e) => { } else if (cmd === 'status') { result = sandbox_status(); toolCalls++; - } else if (capabilities.includes('run_command') && commandWhitelist.includes(cmd)) { + } else if (capabilities && capabilities.includes('run_command') && commandWhitelist.includes(cmd)) { result = sandbox_run(cmd, parts.slice(1)); toolCalls++; } else { // If the task is descriptive (not a command), run smart handling - if (capabilities.includes('list_files') || capabilities.includes('read_file')) { - // Smart mode: interpret task - const lower = task.toLowerCase(); + if (capabilities && (capabilities.includes('list_files') || capabilities.includes('read_file'))) { + const lower = (task || '').toLowerCase(); if (lower.includes('list') || lower.includes('file')) { const dir = parts.find(p => p.startsWith('/') || p.startsWith('.')) || '/'; result = sandbox_ls(dir); } else if (lower.includes('find') || lower.includes('search')) { - const q = task.replace(/find|search/i, '').trim(); + const q = (task || '').replace(/find|search/i, '').trim(); result = sandbox_find(q || ''); } else if (lower.includes('count') || lower.includes('how many')) { result = sandbox_ls('/'); const count = (result.match(/\[file\]|\[dir\]/g) || []).length; - result = `Found ${count} items in total.\\n${result}`; + result = 'Found ' + count + ' items in total.\n' + result; } else if (lower.includes('status') || lower.includes('health')) { result = sandbox_status(); } else { - result = `Task interpreted: "${task}"\\nCapabilities: ${capabilities.join(', ')}\\nTip: Be more specific (e.g. "list files in /")`; + result = 'Task interpreted: "' + (task || '') + '"\nCapabilities: ' + (capabilities || []).join(', ') + '\nTip: Be more specific (e.g. "list files in /")'; } toolCalls++; } else { - result = `Task: "${task}"\\nNo matching capability for command "${cmd}"`; + result = 'Task: "' + (task || '') + '"\nNo matching capability for command "' + cmd + '"'; } } } catch (e) { - error = e.message; - console.error(`[Sandbox ${taskId}] Error:`, e); + error = e.message || String(e); } - const duration = ((performance.now() - startTime) / 1000).toFixed(2); + const duration = ((self.performance.now() - startTime) / 1000).toFixed(2); self.postMessage({ - taskId, - result, - error, - toolCalls, + taskId: taskId, + result: result, + error: error, + toolCalls: toolCalls, duration: parseFloat(duration), vfsSnapshot: JSON.stringify(_vfs) }); -}; +}); // ─── Sandboxed VFS Operations ─── function sandbox_ls(path) { path = path || '/'; const entries = _vfs_get_entries(path); - if (!entries) return `ls: ${path}: No such directory`; - const lines = entries.map(e => { + if (!entries) return 'ls: ' + path + ': No such directory'; + const lines = entries.map(function(e) { const icon = e.type === 'dir' ? '[dir]' : '[file]'; - const size = e.size !== undefined ? ` (${e.size}B)` : ''; - return `${icon} ${e.name}${size}`; + const size = e.size !== undefined ? ' (' + e.size + 'B)' : ''; + return icon + ' ' + e.name + size; }); - return lines.join('\\n') || '(empty)'; + return lines.join('\n') || '(empty)'; } function sandbox_cat(path) { const content = _vfs_get_content(path); - if (content === null) return `cat: ${path}: No such file`; - if (typeof content === 'object') return `cat: ${path}: Is a directory`; - if (content.length > 8000) return content.substring(0, 8000) + '\\n... (truncated at 8KB)'; + if (content === null) return 'cat: ' + path + ': No such file'; + if (typeof content === 'object') return 'cat: ' + path + ': Is a directory'; + if (content.length > 8000) return content.substring(0, 8000) + '\n... (truncated at 8KB)'; return content; } function sandbox_find(query) { const results = []; const q = query ? query.toLowerCase() : ''; - _vfs_walk('/', (path, node) => { + _vfs_walk('/', function(path, node) { if (node.type === 'file') { if (!q || path.toLowerCase().includes(q)) { results.push(path); } } }); - if (results.length === 0) return `No files found${query ? ` matching "${query}"` : ''}`; - return results.join('\\n'); + if (results.length === 0) return 'No files found' + (query ? ' matching "' + query + '"' : ''); + return results.join('\n'); } function sandbox_grep(query) { if (!query) return 'grep: missing pattern'; const q = query.toLowerCase(); const results = []; - _vfs_walk('/', (path, node) => { + _vfs_walk('/', function(path, node) { if (node.type === 'file' && typeof node.content === 'string') { - const lines = node.content.split('\\n'); + const lines = node.content.split('\n'); for (let i = 0; i < lines.length; i++) { if (lines[i].toLowerCase().includes(q)) { - results.push(`${path}:${i + 1}: ${lines[i].trim().substring(0, 100)}`); + results.push(path + ':' + (i + 1) + ': ' + lines[i].trim().substring(0, 100)); } } } }); - if (results.length === 0) return `grep: no matches for "${query}"`; - return results.slice(0, 50).join('\\n') + (results.length > 50 ? `\\n... (+${results.length - 50} more)` : ''); + if (results.length === 0) return 'grep: no matches for "' + query + '"'; + return results.slice(0, 50).join('\n') + (results.length > 50 ? '\n... (+' + (results.length - 50) + ' more)' : ''); } function sandbox_status() { let fileCount = 0, dirCount = 0; - _vfs_walk('/', (path, node) => { + _vfs_walk('/', function(path, node) { if (node.type === 'file') fileCount++; else dirCount++; }); const vfsSize = JSON.stringify(_vfs).length; - return `Sandbox VFS Status:\\n Files: ${fileCount}\\n Directories: ${dirCount}\\n VFS Size: ${(vfsSize / 1024).toFixed(1)}KB`; + return 'Sandbox VFS Status:\n Files: ' + fileCount + '\n Directories: ' + dirCount + '\n VFS Size: ' + (vfsSize / 1024).toFixed(1) + 'KB'; } function sandbox_run(cmd, args) { - return `[sandbox] ${cmd} ${args.join(' ')}\\n(Command execution limited in sandbox mode)`; + return '[sandbox] ' + cmd + ' ' + args.join(' ') + '\n(Command execution limited in sandbox mode)'; } // ─── VFS Helpers ─── @@ -168,11 +166,15 @@ function sandbox_run(cmd, args) { function _vfs_get_entries(path) { const dir = _vfs_resolve(path); if (!dir || dir.type !== 'dir') return null; - return Object.entries(dir.content || {}).map(([name, node]) => ({ - name, - type: node.type || 'file', - size: typeof node.content === 'string' ? node.content.length : undefined - })).sort((a, b) => a.name.localeCompare(b.name)); + return Object.entries(dir.content || {}).map(function(entry) { + const name = entry[0]; + const node = entry[1]; + return { + name: name, + type: node.type || 'file', + size: typeof node.content === 'string' ? node.content.length : undefined + }; + }).sort(function(a, b) { return a.name.localeCompare(b.name); }); } function _vfs_get_content(path) { @@ -184,11 +186,11 @@ function _vfs_get_content(path) { function _vfs_resolve(path) { if (!_vfs || !_vfs.root) return null; if (path === '/' || path === '') return _vfs.root; - const parts = path.split('/').filter(p => p); + const parts = path.split('/').filter(function(p) { return p; }); let current = _vfs.root; - for (const part of parts) { - if (!current.content || !current.content[part]) return null; - current = current.content[part]; + for (let i = 0; i < parts.length; i++) { + if (!current.content || !current.content[parts[i]]) return null; + current = current.content[parts[i]]; } return current; } @@ -198,8 +200,9 @@ function _vfs_walk(path, cb) { if (!node) return; cb(path, node); if (node.type === 'dir' && node.content) { - for (const [name, child] of Object.entries(node.content)) { - _vfs_walk(path === '/' ? '/' + name : path + '/' + name, cb); + const names = Object.keys(node.content); + for (let i = 0; i < names.length; i++) { + _vfs_walk(path === '/' ? '/' + names[i] : path + '/' + names[i], cb); } } }
\ No newline at end of file diff --git a/modules/core/terminal.js b/modules/core/terminal.js index d916ae6..be57c05 100644 --- a/modules/core/terminal.js +++ b/modules/core/terminal.js @@ -11,10 +11,15 @@ this.systemCmds = new Set(['reboot','shutdown','format','kill','halt','poweroff']); this.suspiciousFlags = new Set(['--dump','--execute','--eval','--exec','--shell','--script']); this.whitelist = new Set(['help','clear','ls','cat','pwd','whoami','df','free','top','ps','echo','date','env','history']); + // Load persisted overrides from localStorage + try { const d = localStorage.getItem('webx11_security_destructive'); if(d){JSON.parse(d).forEach(c=>this.destructiveCmds.add(c));} }catch(e){} + try { const s = localStorage.getItem('webx11_security_system'); if(s){JSON.parse(s).forEach(c=>this.systemCmds.add(c));} }catch(e){} + try { const w = localStorage.getItem('webx11_security_whitelist'); if(w){JSON.parse(w).forEach(c=>this.whitelist.add(c));} }catch(e){} + try { const f = localStorage.getItem('webx11_security_flags'); if(f){JSON.parse(f).forEach(c=>this.suspiciousFlags.add(c));} }catch(e){} this._registerBuiltIn(); } _registerBuiltIn() { - const internals = ['clear','help','ls','cat','df','free','env','history','cd','pwd','touch','mkdir','rm','cp','mv','edit','cat','run','font-size','load-local','loadlocal','mem','security','security-level','startup-modules','smart-prompt','cmd-allow','cmd-deny','system-health','server','servers','server-check','monitor']; + const internals = ['clear','help','ls','cat','df','free','env','history','cd','pwd','touch','mkdir','rm','cp','mv','edit','cat','run','font-size','load-local','loadlocal','mem','security','security-level','security-destructive','security-system','security-whitelist','security-flag','config','ai-config','startup-modules','smart-prompt','cmd-allow','cmd-deny','system-health','server','servers','server-check','monitor','vfs','vfs-clean','vfs-size','empty-trash']; internals.forEach(c => this.registerCommand(c, { category: 'builtin' })); } setLevel(n) { @@ -73,8 +78,25 @@ } return best ? { cmd: best, dist: bestDist } : null; } + _parseArgs(input) { + const args = []; + let current = ''; + let inDouble = false; + let inSingle = false; + for (const ch of input) { + if (ch === '"' && !inSingle) { inDouble = !inDouble; continue; } + if (ch === "'" && !inDouble) { inSingle = !inSingle; continue; } + if (ch === ' ' && !inDouble && !inSingle) { + if (current) { args.push(current); current = ''; } + } else { + current += ch; + } + } + if (current) args.push(current); + return args; + } _classify(raw) { - const parts = raw.trim().split(/\s+/); + const parts = this._parseArgs(raw.trim()); const cmd = parts[0].toLowerCase(); const args = parts.slice(1); // Internal commands always allowed at terminal level, but security still classifies @@ -199,12 +221,23 @@ this.moduleManager = new ModuleManager(this); this.security = new WebX11SecurityManager(this, parseInt(localStorage.getItem('webx11_security_level')) || 1); this.ollamaManager = new OllamaManager(this); + // Config registry — modules can register keys for the unified `config` command + this._configRegistry = {}; + this._configDefaults = {}; + this._configSetters = {}; + this._loadTerminalConfig(); + // Register built-in terminal config keys + this.registerConfigItem('terminal-max-lines', 200, (v) => { this.MAX_OUTPUT_LINES = v; }); + this.registerConfigItem('terminal-hist-output', 50, (v) => { this._historyMaxLines = v; }); + this.registerConfigItem('terminal-cmd-history', 200, (v) => { /* applied on next save */ }); + this.registerConfigItem('terminal-pipe-buffer', 5000, (v) => { this._pipeBufferSize = v; }); this._pipeInput = null; this._pipeBufferSize = 5000; this._historyBuffer = []; this._historyMaxLines = 50; this._historySavePending = false; this.MAX_OUTPUT_LINES = 200; + this._historyCap = 200; this._aiBusy = false; this._dirty = false; this.history = JSON.parse(localStorage.getItem('webx11_command_history') || '[]'); @@ -221,6 +254,8 @@ // Auto-restore session this._autoRestoreSession(); this._restoreFontSize(); + // Restore saved theme on boot + this._restoreTheme(); // Init auto-save timer — 60s after boot, then every 60s setTimeout(() => this._initAutoSave(), 30000); // Init sound toggle button text @@ -231,6 +266,10 @@ setTimeout(() => this.inputField.focus(), 100); // First-run welcome check — fires after ext modules are loaded setTimeout(() => this._checkFirstRun(), 2000); + // Init all registered modules (safe now — constructor is done) + this._initRegisteredModules(); + // Apply config overrides after everything is initialized + this._applyTerminalConfig(); } initEventListeners() { this.inputField.addEventListener('keydown', (e) => { @@ -244,7 +283,14 @@ } } const cmd = this.inputField.value; - this.history.push(cmd); + // Dedup: don't push if same as last entry + if (this.history.length === 0 || this.history[this.history.length - 1] !== cmd) { + this.history.push(cmd); + } + // Trim to max 200 entries + if (this.history.length > this._historyCap) { + this.history = this.history.slice(-this._historyCap); + } this.historyIndex = this.history.length; this._saveCommandHistory(); this.executeCommand(cmd); @@ -739,7 +785,7 @@ var rootClone; try { const json = JSON.stringify(this.fs.root); - if (json.length > 5242880) { // 5MB cap + if (json.length > 52428800) { // 50MB cap rootClone = { type: 'directory', name: '/', content: {}, _truncated: true }; this.print('⚠ Auto-save skipped (VFS too large)', 'warning'); return; @@ -761,7 +807,7 @@ terminalLines: this._historyBuffer.slice(-50) }; const snapshotJson = JSON.stringify(snapshot); - if (snapshotJson.length > 5242880) { + if (snapshotJson.length > 52428800) { this.print('⚠ Auto-save snapshot too large, skipping', 'warning'); return; } @@ -851,9 +897,14 @@ .map(e => e.type === 'dir' ? prefix + e.name + '/' : prefix + e.name); } showAutocomplete() { + if (!this.moduleManager || !this.security) return; const input = this.inputField.value; const trimmed = input.trim(); - const commands = this.moduleManager.getAllCommands(); + const commands = this.moduleManager.getAllCommands() || {}; + // Merge built-in internals into autocomplete (they're handled via if-chain, not module commands) + for (const c of this.security.commandMeta.keys()) { + if (!(c in commands)) commands[c] = 'builtin'; + } this.suggestions = []; this.selectedSuggestion = -1; this._isCdAutocomplete = false; @@ -1020,7 +1071,6 @@ this._safeRegister('WebX11AIAssistantModule', 'AI assistant'); this._safeRegister('WebFetcherModule', 'web fetcher'); this._safeRegister('WebXAIAliasModule', 'AI alias'); - this._safeRegister('SkillsModule', 'skills'); this._safeRegister('SecretVault', 'secret vault'); this.reloadPersistedModules(); this._safeRegister('ChatStudioModule', 'chat studio'); @@ -1035,6 +1085,15 @@ this._safeRegister('ServerMonitorModule', 'server monitor'); this._safeRegister('SimpleGUIModule', 'simple GUI builder'); } + _initRegisteredModules() { + for (const [name, mod] of Object.entries(this.moduleManager.modules)) { + if (typeof mod.init === 'function') { + try { mod.init(this); } catch (e) { + console.warn(`[Init] ${name} failed: ${e.message}`); + } + } + } + } _safeRegister(className, label) { let cls; try { @@ -1050,6 +1109,56 @@ try { this.moduleManager.registerModule(new cls()); } catch (e) { console.warn(`[SafeRegister] Skipped ${label}: ${e.message}`); } } + // ── Config Registry ── + registerConfigItem(key, defaultValue, setterFn) { + this._configRegistry[key] = { key, defaultValue }; + this._configDefaults[key] = defaultValue; + this._configSetters[key] = setterFn; + // Apply persisted override if present + const saved = localStorage.getItem('webx11_terminal_config'); + if (saved) { + try { + const parsed = JSON.parse(saved); + if (parsed[key] !== undefined && parsed[key] !== defaultValue) { + setterFn(parsed[key]); + } + } catch (e) {} + } + } + _loadTerminalConfig() { + try { + const saved = localStorage.getItem('webx11_terminal_config'); + if (!saved) return; + const parsed = JSON.parse(saved); + // Apply registered config items from persistence + for (const [key, val] of Object.entries(parsed)) { + if (this._configSetters[key] && val !== this._configDefaults[key]) { + this._configSetters[key](val); + } + } + } catch (e) {} + } + _saveTerminalConfig() { + const values = {}; + for (const key of Object.keys(this._configRegistry)) { + const actual = this[key] !== undefined ? this[key] : this._configDefaults[key]; + if (actual !== this._configDefaults[key]) { + values[key] = actual; + } + } + localStorage.setItem('webx11_terminal_config', JSON.stringify(values)); + } + _applyTerminalConfig() { + try { + const saved = localStorage.getItem('webx11_terminal_config'); + if (!saved) return; + const parsed = JSON.parse(saved); + if (parsed['terminal-max-lines'] !== undefined) this.MAX_OUTPUT_LINES = parsed['terminal-max-lines']; + if (parsed['terminal-hist-output'] !== undefined) this._historyMaxLines = parsed['terminal-hist-output']; + if (parsed['terminal-cmd-history'] !== undefined) this._historyCap = parsed['terminal-cmd-history']; + if (parsed['terminal-pipe-buffer'] !== undefined) this._pipeBufferSize = parsed['terminal-pipe-buffer']; + } catch (e) {} + } async _loadExtModules(filterKeys) { const autoLoadKeys = filterKeys || ['calc', 'voice', 'cron', 'theme', 'wpm', 'mindmap', 'webdav', 'skill-pack-core', 'editor', 'diff', 'alias', 'finder', 'filemgr', 'cryptogzip', 'shell', 'tutorial', 'busybox']; const cacheVer = localStorage.getItem('webx11_cache_ver') || '2026-05-27-14'; @@ -1083,6 +1192,16 @@ async executeCommand(rawInput) { if (!rawInput.trim()) return; this.markDirty(); + // Push to command history (dedup + trim) + const cmd = rawInput.trim(); + if (this.history.length === 0 || this.history[this.history.length - 1] !== cmd) { + this.history.push(cmd); + } + if (this.history.length > this._historyCap) { + this.history = this.history.slice(-this._historyCap); + } + this.historyIndex = this.history.length; + this._saveCommandHistory(); this.printUserPrompt(rawInput); const pipeParts = this.splitPipe(rawInput.trim()); if (pipeParts.length > 1) { @@ -1108,7 +1227,7 @@ let pipeInput = null; for (let i = 0; i < pipeParts.length; i++) { const cmdText = pipeParts[i]; - const parts = cmdText.split(/\s+/); + const parts = this.security._parseArgs(cmdText); const cmd = parts[0].toLowerCase(); const args = parts.slice(1); this._pipeInput = pipeInput; @@ -1139,9 +1258,40 @@ if (cmd === 'load-local' || cmd === 'loadlocal') { this.loadLocalModule(args[0]); return; } if (cmd === 'smart-prompt') { const val = args[0] && args[0] === 'off' ? 'off' : 'on'; localStorage.setItem('webx11_smart_prompt', val); this.print('Smart prompt ' + val, 'success'); this.updatePrompt(); return; } if (cmd === 'mem') { this.printMemoryStats(); return; } + if (cmd === 'config') { + if (args.length === 0) { + this.print('=== Terminal Config ===', 'info'); + this.print(`terminal-max-lines: ${this.MAX_OUTPUT_LINES} (default: 200)`, ''); + this.print(`terminal-hist-output: ${this._historyMaxLines} (default: 50)`, ''); + this.print(`terminal-cmd-history: ${this._historyCap} (default: 200)`, ''); + this.print(`terminal-pipe-buffer: ${this._pipeBufferSize} (default: 5000)`, ''); + this.print('Usage: config <key> <value>', 'info'); + this.print('Keys: terminal-max-lines, terminal-hist-output, terminal-cmd-history, terminal-pipe-buffer', 'info'); + return; + } + const key = args[0]; + const val = args[1]; + if (val === undefined) { this.print('Usage: config <key> <value>', 'warning'); return; } + const n = parseInt(val); + if (isNaN(n) || n < 1) { this.print('Value must be a positive number', 'warning'); return; } + if (key === 'terminal-max-lines') { this.MAX_OUTPUT_LINES = n; } + else if (key === 'terminal-hist-output') { this._historyMaxLines = n; } + else if (key === 'terminal-cmd-history') { this._historyCap = n; } + else if (key === 'terminal-pipe-buffer') { this._pipeBufferSize = n; } + else { this.print(`Unknown key: ${key}. Valid: terminal-max-lines, terminal-hist-output, terminal-cmd-history, terminal-pipe-buffer`, 'warning'); return; } + this._saveTerminalConfig(); + this.print(`config ${key} set to ${val}`, 'success'); + return; + } if (cmd === 'security') { this.print(`Security level: ${this.security.getLevel()} (${this.security.getLevelName()})`, 'info'); this.print(`Blocked commands: ${this.security.blockedCount}`, 'info'); + this.print(`Destructive set: ${[...this.security.destructiveCmds].sort().join(', ')}`, ''); + this.print(`System set: ${[...this.security.systemCmds].sort().join(', ')}`, ''); + this.print(`Suspicious flags: ${[...this.security.suspiciousFlags].sort().join(', ')}`, ''); + this.print(`Whitelist: ${[...this.security.whitelist].sort().join(', ')}`, ''); + const all = this.security._collectAllCommands(); + this.print(`Registered commands: ${all.length}`, ''); return; } if (cmd === 'security-level') { @@ -1151,14 +1301,160 @@ localStorage.setItem('webx11_security_level', lv); return; } + if (cmd === 'security-destructive') { + const action = args[0]; + if (!action) { this.print('Usage: security-destructive add|remove|list [cmd]', 'warning'); return; } + if (action === 'list') { + this.print('Destructive commands:', 'info'); + for (const c of this.security.destructiveCmds) this.print(` ${c}`, ''); + return; + } + if (!args[1]) { this.print('Usage: security-destructive add|remove <cmd>', 'warning'); return; } + if (action === 'add') { this.security.destructiveCmds.add(args[1]); } + else if (action === 'remove') { this.security.destructiveCmds.delete(args[1]); } + else { this.print('Action must be: add, remove, or list', 'warning'); return; } + localStorage.setItem('webx11_security_destructive', JSON.stringify([...this.security.destructiveCmds])); + this.print(`Updated destructive set (${this.security.destructiveCmds.size} commands)`, 'success'); + return; + } + if (cmd === 'security-system') { + const action = args[0]; + if (!action) { this.print('Usage: security-system add|remove|list [cmd]', 'warning'); return; } + if (action === 'list') { + this.print('System commands:', 'info'); + for (const c of this.security.systemCmds) this.print(` ${c}`, ''); + return; + } + if (!args[1]) { this.print('Usage: security-system add|remove <cmd>', 'warning'); return; } + if (action === 'add') { this.security.systemCmds.add(args[1]); } + else if (action === 'remove') { this.security.systemCmds.delete(args[1]); } + else { this.print('Action must be: add, remove, or list', 'warning'); return; } + localStorage.setItem('webx11_security_system', JSON.stringify([...this.security.systemCmds])); + this.print(`Updated system set (${this.security.systemCmds.size} commands)`, 'success'); + return; + } + if (cmd === 'security-whitelist') { + const action = args[0]; + if (!action) { this.print('Usage: security-whitelist add|remove|list [cmd]', 'warning'); return; } + if (action === 'list') { + this.print('Whitelist commands:', 'info'); + for (const c of this.security.whitelist) this.print(` ${c}`, ''); + return; + } + if (!args[1]) { this.print('Usage: security-whitelist add|remove <cmd>', 'warning'); return; } + if (action === 'add') { this.security.whitelist.add(args[1]); } + else if (action === 'remove') { this.security.whitelist.delete(args[1]); } + else { this.print('Action must be: add, remove, or list', 'warning'); return; } + localStorage.setItem('webx11_security_whitelist', JSON.stringify([...this.security.whitelist])); + this.print(`Updated whitelist (${this.security.whitelist.size} commands)`, 'success'); + return; + } + if (cmd === 'security-flag') { + const action = args[0]; + if (!action) { this.print('Usage: security-flag add|remove|list [flag]', 'warning'); return; } + if (action === 'list') { + this.print('Suspicious flags:', 'info'); + for (const f of this.security.suspiciousFlags) this.print(` ${f}`, ''); + return; + } + if (!args[1]) { this.print('Usage: security-flag add|remove <flag>', 'warning'); return; } + const flag = args[1].startsWith('--') ? args[1] : '--' + args[1]; + if (action === 'add') { this.security.suspiciousFlags.add(flag); } + else if (action === 'remove') { this.security.suspiciousFlags.delete(flag); } + else { this.print('Action must be: add, remove, or list', 'warning'); return; } + localStorage.setItem('webx11_security_flags', JSON.stringify([...this.security.suspiciousFlags])); + this.print(`Updated suspicious flags (${this.security.suspiciousFlags.size} flags)`, 'success'); + return; + } if (cmd === 'cmd-allow') { this._resolveCmdConfirm(true); return; } if (cmd === 'cmd-deny') { this._resolveCmdConfirm(false); return; } + if (cmd === 'vfs' && args[0] === 'reset') { + if (args[1] !== '--force') { + this.print('⚠ This will permanently delete all files! Use vfs reset --force to confirm.', 'warning'); + return; + } + this.fs.reset(); + this.print('VFS reset — all files deleted.', 'success'); + return; + } + if (cmd === 'vfs' && args[0] === 'clean') { + let count = 0; + const sysDirs = ['_snapshots', '_sessions', '.trash']; + for (const dir of sysDirs) { + if (this.fs.root.content && this.fs.root.content[dir]) { + delete this.fs.root.content[dir]; + count++; + } + } + if (count > 0) { + this.fs.saveToStorage(); + this.print('🧹 Cleaned ' + count + ' system dirs: ' + sysDirs.join(', '), 'success'); + } else { + this.print('Nothing to clean — system dirs already empty.', 'info'); + } + return; + } + if (cmd === 'vfs-clean') { + let count = 0; + const sysDirs = ['_snapshots', '_sessions', '.trash']; + for (const dir of sysDirs) { + if (this.fs.root.content && this.fs.root.content[dir]) { + delete this.fs.root.content[dir]; + count++; + } + } + if (count > 0) { + this.fs.saveToStorage(); + this.print('🧹 Cleaned ' + count + ' system dirs: ' + sysDirs.join(', '), 'success'); + } else { + this.print('Nothing to clean — system dirs already empty.', 'info'); + } + return; + } + if (cmd === 'empty-trash') { + if (args[0] !== '--force') { + this.print('⚠ This will permanently delete all trashed files! Use empty-trash --force to confirm.', 'warning'); + return; + } + if (this.fs.emptyTrash()) { + this.print('Trash emptied.', 'success'); + } else { + this.print('Trash is already empty.', 'info'); + } + return; + } + if (cmd === 'history') { + const search = args.join(' ').toLowerCase(); + const entries = this.history; + if (!entries.length) { this.print('No command history.', 'info'); return; } + if (search) { + const filtered = entries.map((c, i) => ({ i, c })).filter(e => e.c.toLowerCase().includes(search)); + if (!filtered.length) { this.print(`No history entries matching: ${search}`, 'info'); return; } + this.print(`=== History (matching: ${search}) ===`, 'info'); + filtered.forEach(e => this.print(` ${e.i + 1} ${e.c}`)); + } else { + this.print(`=== Command History (${entries.length} entries) ===`, 'info'); + const start = Math.max(0, entries.length - 50); + for (let i = start; i < entries.length; i++) { + this.print(` ${i + 1} ${entries[i]}`); + } + if (entries.length > 50) this.print(`... (${entries.length - 50} older entries hidden, use history <search> to find)`); + } + return; + } for (const modName in this.moduleManager.modules) { const mod = this.moduleManager.modules[modName]; if (mod.commands && mod.commands[cmd]) { try { await mod.commands[cmd](args); // Notify tutorial module for quest tracking if (this.tutorialModule && cmd !== 'tutorial') this.tutorialModule.onCommandExecuted(cmd, args); + // Memory graph: record file access for read/file commands + if (cmd === 'cat' || cmd === 'view_module' || cmd === 'edit_module') { + try { + const _mg = this.moduleManager.modules['MemoryGraphModule']; + if (_mg && args[0]) _mg.recordFileAccess(args[0]); + } catch (_e) {} + } return; } catch (err) { this.print(`Error in ${modName}.${cmd}: ${err.message}`, 'error'); return; } } @@ -1336,8 +1632,7 @@ openSkillsManager() { const modal = document.getElementById('skills-manager'); // Ensure /skills/ directory exists - const skillsMod = this.moduleManager.modules['SkillsModule']; - if (skillsMod && skillsMod.ensureSkillsDir) skillsMod.ensureSkillsDir(); + this.fs.mkdirRecursive('/skills'); this.refreshSkillsList(); modal.style.display = 'flex'; } @@ -1453,12 +1748,16 @@ if (!confirm(`Delete skill "${name}"?`)) return; const fs = this.fs; fs.mkdirRecursive('/skills'); - fs.writeFile(`/skills/${name}.md`, ''); + // Actually remove from VFS tree + if (fs.root && fs.root.content && fs.root.content['skills'] && fs.root.content['skills'].content) { + delete fs.root.content['skills'].content[`${name}.md`]; + } const index = fs.fsReadJSON('/skills/index.json') || {}; delete index[name]; fs.fsWriteJSON('/skills/index.json', index); this.print(`Skill '${name}' deleted`, 'success'); this.refreshSkillsList(); + fs.saveToStorage(); } createSkillFromUI() { const name = document.getElementById('skill-name-input').value.trim().replace(/\s+/g, '-').toLowerCase(); @@ -1890,6 +2189,35 @@ } } catch (e) {} } + _restoreTheme() { + try { + const savedTheme = localStorage.getItem('webx11_active_theme'); + if (savedTheme) { + const themesRaw = localStorage.getItem('webx11_themes'); + const defaults = { + 'dark': { '--bg-color': '#000000', '--bg-secondary': '#0a0a0a', '--bg-tertiary': '#111111', '--text-color': '#00ff00', '--text-muted': '#888888', '--accent-color': '#00aa00', '--border-color': '#005500' }, + 'light': { '--bg-color': '#ffffff', '--bg-secondary': '#f5f5f5', '--bg-tertiary': '#eeeeee', '--text-color': '#222222', '--text-muted': '#888888', '--accent-color': '#0066cc', '--border-color': '#cccccc' }, + 'amber': { '--bg-color': '#1a0f00', '--bg-secondary': '#2a1a00', '--bg-tertiary': '#332200', '--text-color': '#ffaa00', '--text-muted': '#886600', '--accent-color': '#ff8800', '--border-color': '#663300' }, + 'cyber': { '--bg-color': '#000a14', '--bg-secondary': '#001a2e', '--bg-tertiary': '#002240', '--text-color': '#00ffff', '--text-muted': '#0088aa', '--accent-color': '#ff00ff', '--border-color': '#004466' }, + 'ocean': { '--bg-color': '#0a1628', '--bg-secondary': '#0f2240', '--bg-tertiary': '#142e54', '--text-color': '#88ddff', '--text-muted': '#5599bb', '--accent-color': '#00aaff', '--border-color': '#1a4470' }, + 'forest': { '--bg-color': '#0a1a0e', '--bg-secondary': '#0f2814', '--bg-tertiary': '#14361c', '--text-color': '#88dd88', '--text-muted': '#559955', '--accent-color': '#33cc33', '--border-color': '#1a4a22' }, + 'monochrome': { '--bg-color': '#0a0a0a', '--bg-secondary': '#181818', '--bg-tertiary': '#222222', '--text-color': '#cccccc', '--text-muted': '#666666', '--accent-color': '#999999', '--border-color': '#333333' }, + 'sunset': { '--bg-color': '#1a0a14', '--bg-secondary': '#2a1220', '--bg-tertiary': '#3a1a2c', '--text-color': '#ffbb99', '--text-muted': '#cc7755', '--accent-color': '#ff6644', '--border-color': '#552233' }, + 'midnight': { '--bg-color': '#050510', '--bg-secondary': '#0a0a20', '--bg-tertiary': '#101030', '--text-color': '#aaaaee', '--text-muted': '#555588', '--accent-color': '#6666ff', '--border-color': '#1a1a3a' } + }; + if (themesRaw) { + const themes = JSON.parse(themesRaw); + Object.assign(defaults, themes); + } + const t = defaults[savedTheme]; + if (t) { + for (const [k, v] of Object.entries(t)) { + document.documentElement.style.setProperty(k, v); + } + } + } + } catch (e) { console.warn('[Theme] restore error:', e); } + } // ── First-run welcome ── _checkFirstRun() { if (localStorage.getItem('webx11_tutorial_complete') || localStorage.getItem('webx11_tutorial_skipped')) return; diff --git a/modules/core/virtual-fs.js b/modules/core/virtual-fs.js index 3ab25b1..59ab18b 100644 --- a/modules/core/virtual-fs.js +++ b/modules/core/virtual-fs.js @@ -520,15 +520,25 @@ class VirtualFileSystem { checkpoint(name) { if (!name) name = new Date().toISOString(); const createdAt = new Date().toISOString(); + // Strip system dirs to avoid fractal bloat — snapshots/sessions/trash + // don't belong inside a checkpoint of user data + const root = JSON.parse(JSON.stringify(this.root)); + if (root && root.content) { + delete root.content['_snapshots']; + delete root.content['_sessions']; + delete root.content['.trash']; + } const data = { version: 1, createdAt, - root: JSON.parse(JSON.stringify(this.root)), + root, currentPath: [...this.currentPath] }; if (!this.readDir('/_snapshots')) { this.mkdirRecursive('/_snapshots'); } + // Strip _snapshots from the serialized data too (redundant safety) + data.root = root; this.fsWriteJSON('/_snapshots/checkpoint-' + name + '.json', data); this.saveToStorage(); // Auto-manage: keep max 10 checkpoints, delete oldest @@ -568,6 +578,26 @@ class VirtualFileSystem { } return false; } + // Reset VFS — wipes everything, removes localStorage keys + reset() { + this.root = { type: 'dir', content: {} }; + this.currentPath = []; + this._conceptCache = null; + try { + localStorage.removeItem('webx11_filesystem_v2'); + localStorage.removeItem('webx11_filesystem'); + } catch (e) {} + return true; + } + // Empty trash — permanently delete all trashed files + emptyTrash() { + if (this.root.content['.trash']) { + delete this.root.content['.trash']; + this.saveToStorage(); + return true; + } + return false; + } // Old-compat aliases for agent tools and SkillsModule read(path) { return this.readFile(path); } write(path, content) { return this.writeFile(path, content); } diff --git a/modules/ext/busybox.js b/modules/ext/busybox.js index 34221f8..53eae06 100644 --- a/modules/ext/busybox.js +++ b/modules/ext/busybox.js @@ -334,7 +334,7 @@ class BusyBoxModule { const ua = navigator.userAgent; const space = 'newos4'; const platform = navigator.platform || 'unknown'; - const version = 'WebX11 v4.2'; + const version = 'WebX11 ' + (window.NEWOS4_VERSION || 'v4.0'); this.terminal.print(`Hostname: ${space}`, 'info'); this.terminal.print(`Platform: ${version} on ${platform}`, 'info'); this.terminal.print(`User Agent: ${ua}`, 'info'); diff --git a/modules/ext/editor.js b/modules/ext/editor.js index 8c3ac0f..3a5f269 100644 --- a/modules/ext/editor.js +++ b/modules/ext/editor.js @@ -44,6 +44,17 @@ class EditorModule { const ok = this.terminal.fs.writeFile(this._vfsPath, code); if (ok) { this.terminal.print('✅ Saved to ' + this._vfsPath, 'success'); + // Mirror to _mods/ for test_module compatibility + const modMatch = this._vfsPath.match(/(?:^|\/)(\w+)\.js$/); + if (modMatch) { + const modName = modMatch[1]; + this.terminal.fs.mkdirRecursive('_mods'); + this.terminal.fs.writeFile('_mods/' + modName + '.js', code); + if (!this.terminal.fs.readFile('_mods/' + modName + '.orig.js')) { + this.terminal.fs.writeFile('_mods/' + modName + '.orig.js', 'placeholder'); + } + this.terminal.print('📋 Mirrored to _mods/' + modName + '.js for live testing', 'info'); + } // Notify tutorial module for quest 4 (edit + save) if (this.terminal.tutorialModule) { this.terminal.tutorialModule.onFileSaved(this._vfsPath); diff --git a/modules/ext/mindmap.js b/modules/ext/mindmap.js index d0cab54..1daa85b 100644 --- a/modules/ext/mindmap.js +++ b/modules/ext/mindmap.js @@ -247,13 +247,18 @@ class MindmapModule { cyan: '#22d3ee', magenta: '#e879f9', white: '#e0e0e0' }; - const layout = { nodes: [], edges: [], width: 0, height: 0, _y: pad }; + const layout = { nodes: [], edges: [], width: 0, height: 0, _y: pad, minX: Infinity, maxX: 0, minY: Infinity, maxY: 0 }; const layoutTree = (node, x) => { const myY = layout._y; const myX = x; const color = colorMap[node.color] || '#818cf8'; layout.nodes.push({ x: myX, y: myY, w: nw, h: nh, text: node.text, color, id: node.id }); + if (myX < layout.minX) layout.minX = myX; + const rightEdge = x + nw; + if (rightEdge > layout.maxX) layout.maxX = rightEdge; + const bottomEdge = myY + nh; + if (bottomEdge > layout.maxY) layout.maxY = bottomEdge; if (node.children && node.children.length > 0) { const totalW = node.children.length * nw + (node.children.length - 1) * hGap; @@ -267,28 +272,33 @@ class MindmapModule { } layout._y -= nh + vGap; } - const rightEdge = x + nw; - if (rightEdge > layout.width) layout.width = rightEdge; }; layout._y = pad; layoutTree(this.root, pad); - layout.height = layout._y + nh + pad; - // Build SVG - let svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${layout.width + pad} ${layout.height}" style="max-width:100%;background:#0a0a14;font-family:monospace;border-radius:8px;">`; + // Normalize coordinates — shift so minX becomes pad + const xShift = (layout.minX === Infinity ? 0 : -layout.minX) + pad; + layout.height = layout.maxY + pad; + const svgWidth = (layout.maxX - layout.minX) + pad * 2; + + // Build SVG — apply xShift to all coordinates + let svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${svgWidth} ${layout.height}" style="max-width:100%;background:#0a0a14;font-family:monospace;border-radius:8px;">`; // Edges first (behind nodes) for (const e of layout.edges) { - const mx = (e.x1 + e.x2) / 2; - svg += `<path d="M${e.x1},${e.y1} C${mx},${e.y1 + 20} ${mx},${e.y2 - 20} ${e.x2},${e.y2}" fill="none" stroke="#2a2a4a" stroke-width="1.5"/>`; + const sx = e.x1 + xShift, sy = e.y1; + const ex = e.x2 + xShift, ey = e.y2; + const mx = (sx + ex) / 2; + svg += `<path d="M${sx},${sy} C${mx},${sy + 20} ${mx},${ey - 20} ${ex},${ey}" fill="none" stroke="#2a2a4a" stroke-width="1.5"/>`; } // Nodes on top for (const n of layout.nodes) { - svg += `<rect x="${n.x}" y="${n.y}" width="${n.w}" height="${n.h}" rx="6" fill="${n.color}18" stroke="${n.color}" stroke-width="1.5"/>`; + const nx = n.x + xShift; + svg += `<rect x="${nx}" y="${n.y}" width="${n.w}" height="${n.h}" rx="6" fill="${n.color}18" stroke="${n.color}" stroke-width="1.5"/>`; const text = n.text.length > 18 ? n.text.substring(0, 16) + '..' : n.text; - svg += `<text x="${n.x + n.w / 2}" y="${n.y + n.h / 2 + 4}" text-anchor="middle" fill="#e0e0e0" font-size="10" font-family="monospace">${text.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>')}</text>`; + svg += `<text x="${nx + n.w / 2}" y="${n.y + n.h / 2 + 4}" text-anchor="middle" fill="#e0e0e0" font-size="10" font-family="monospace">${text.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>')}</text>`; } svg += '</svg>'; diff --git a/modules/ext/skill-pack-core.js b/modules/ext/skill-pack-core.js index f731594..41844bd 100644 --- a/modules/ext/skill-pack-core.js +++ b/modules/ext/skill-pack-core.js @@ -21,6 +21,14 @@ class SkillPackCoreModule { getHelpInfo() { return { 'skill-pack-core': 'Seed and manage built-in core skills (navigation, memory, search, modules, backup, agents, webdav, security, etc.)', + 'skill-list': 'skill-list [category] — List all skills, optionally filtered by category', + 'skill-view': 'skill-view <name> — View a skill\'s full content', + 'skill-create': 'skill-create <name> <desc> "<steps>" [tags] — Create a new skill', + 'skill-patch': 'skill-patch <name> "<content>" — Replace a skill\'s full content', + 'skill-delete': 'skill-delete <name> — Delete a skill', + 'skill-export': 'skill-export <name> — Export a skill as JSON', + 'skill-import': 'skill-import <json> — Import a skill from JSON string', + 'skill-sync': 'skill-sync — Rebuild skills index from /skills/ directory', }; } @@ -427,7 +435,42 @@ class SkillPackCoreModule { 5. **When to use:** - User wants to lock down the terminal → security-level 2 - User wants to allow a blocked command → cmd-allow <cmd> - - Debugging strange behavior → verify security-level (user may have set it higher)`) + - Debugging strange behavior → verify security-level (user may have set it higher)`), + + sk('mindmap-user-guide', 'How to create, view, and manage brainstorming mindmaps using the mindmap terminal module', ['mindmap', 'brainstorming', 'organization', 'planning'], 'productivity', +`## Steps +1. **Create a new mindmap:** + - mindmap new "<topic>" -t tag1,tag2 — creates a root node + - Tags are optional (e.g. planning, research, dev) + - Root gets auto-assigned a color + +2. **Add child nodes:** + - mindmap add <parent-id> "<idea>" -t tag — add a child + - Get the parent-id from mindmap show + - IDs are 4-char random strings (e.g. a3f8, x7k2) + +3. **View the mindmap:** + - mindmap show — full tree with Unicode box-drawing + - mindmap show <id> — subtree starting at that node + +4. **Edit nodes:** + - mindmap rename <id> "<new text>" — change text + - mindmap color <id> <color> — set color (red/green/yellow/blue/cyan/magenta/white) + - mindmap tag <id> <tag> — add a tag + +5. **Persistence:** + - mindmap save <name> — save to localStorage + - mindmap load <name> — restore + - mindmap list — show saved mindmaps + - mindmap delete <name> — remove saved + +6. **Export:** + - mindmap export [id] — Markdown bullet list output + +## When to use +- User wants to brainstorm, organize ideas, plan features +- User says "map out", "diagram", "brainstorm", "organize thoughts" +- Visualizing project structure or task decomposition`) ]; } registerCommands() { @@ -436,7 +479,217 @@ class SkillPackCoreModule { this.terminal.print(`Skill Pack: Core — ${count} skills available`, 'info'); this.terminal.print('Skills will auto-seed on load', 'info'); }; + this.commands['skill-list'] = (args) => this._cmdSkillList(args); + this.commands['skill-view'] = (args) => this._cmdSkillView(args); + this.commands['skill-create'] = (args) => this._cmdSkillCreate(args); + this.commands['skill-patch'] = (args) => this._cmdSkillPatch(args); + this.commands['skill-delete'] = (args) => this._cmdSkillDelete(args); + this.commands['skill-export'] = (args) => this._cmdSkillExport(args); + this.commands['skill-import'] = (args) => this._cmdSkillImport(args); + this.commands['skill-sync'] = () => this._cmdSkillSync(); + } + // ── Skill Commands ── + + _cmdSkillList(args) { + const fs = this.terminal.fs; + const index = fs.fsReadJSON('/skills/index.json') || {}; + const entries = Object.values(index); + const filter = args[0] ? args[0].toLowerCase() : null; + const filtered = filter ? entries.filter(s => s.category === filter || s.category?.toLowerCase() === filter) : entries; + if (filtered.length === 0) { + this.terminal.print(filter ? `No skills in category: ${args[0]}` : 'No skills installed.', 'info'); + return; + } + this.terminal.print(`📚 Skills (${filtered.length} of ${entries.length} total):`, 'info'); + // Group by category + const groups = {}; + for (const s of filtered) { + const cat = s.category || 'uncategorized'; + if (!groups[cat]) groups[cat] = []; + groups[cat].push(s); + } + for (const [cat, skills] of Object.entries(groups)) { + this.terminal.print(` ${cat}:`, ''); + for (const s of skills) { + const tags = s.tags?.length ? ` (${s.tags.join(', ')})` : ''; + this.terminal.print(` 📄 ${s.name} — ${s.description}${tags}`, ''); + } + } + } + + _cmdSkillView(args) { + if (!args[0]) { this.terminal.print('Usage: skill-view <name>', 'warning'); return; } + const name = args[0].replace(/\.md$/, ''); + const fs = this.terminal.fs; + const content = fs.readFile(`/skills/${name}.md`); + if (content === null || content === undefined) { + this.terminal.print(`Skill not found: ${name}`, 'error'); + return; + } + this.terminal.print(`=== ${name} ===`, 'info'); + const lines = content.split('\n'); + for (const line of lines) { + this.terminal.print(line, ''); + } + this.terminal.print(`=== End ${name} ===`, 'info'); + } + + _cmdSkillCreate(args) { + if (args.length < 3) { + this.terminal.print('Usage: skill-create <name> <description> "<markdown content>" [tags]', 'warning'); + return; + } + const name = args[0].replace(/[^a-z0-9-]/g, '').toLowerCase(); + if (!name) { this.terminal.print('Name must be kebab-case (letters, numbers, hyphens only)', 'error'); return; } + const desc = args[1]; + const content = args.slice(2).join(' '); + const tags = []; + if (content.includes('"')) { + // Parse quoted tags at end + } + const fs = this.terminal.fs; + // Check for duplicate + const index = fs.fsReadJSON('/skills/index.json') || {}; + if (index[name]) { + this.terminal.print(`Skill "${name}" already exists. Use skill-patch to update.`, 'warning'); + return; + } + const now = new Date().toISOString(); + const skillContent = `---\nname: ${name}\ndescription: ${desc}\ntags: [${tags.join(', ')}]\ncategory: general\n---\n${content}`; + fs.writeFile(`/skills/${name}.md`, skillContent); + index[name] = { name, description: desc, tags, category: 'general', created: now, updated: now }; + fs.fsWriteJSON('/skills/index.json', index); + this.terminal.print(`✅ Skill "${name}" created (${(skillContent.length / 1024).toFixed(1)}KB)`, 'success'); + } + + _cmdSkillPatch(args) { + if (args.length < 2) { + this.terminal.print('Usage: skill-patch <name> "<full content>"', 'warning'); + return; + } + const name = args[0].replace(/\.md$/, ''); + const content = args.slice(1).join(' '); + const fs = this.terminal.fs; + const index = fs.fsReadJSON('/skills/index.json') || {}; + if (!index[name]) { + this.terminal.print(`Skill not found: ${name}`, 'error'); + return; + } + fs.writeFile(`/skills/${name}.md`, content); + index[name].updated = new Date().toISOString(); + // Re-parse YAML frontmatter to update index + const headerMatch = content.match(/^---\n([\s\S]*?)\n---\n/); + if (headerMatch) { + const header = headerMatch[1]; + const d = header.match(/description:\s*(.+)/); + const c = header.match(/category:\s*(.+)/); + const t = header.match(/tags:\s*\[(.*?)\]/); + if (d) index[name].description = d[1].trim(); + if (c) index[name].category = c[1].trim(); + if (t) index[name].tags = t[1].split(',').map(x => x.trim()).filter(Boolean); + } + fs.fsWriteJSON('/skills/index.json', index); + this.terminal.print(`✅ Skill "${name}" updated`, 'success'); + } + + _cmdSkillDelete(args) { + if (!args[0]) { this.terminal.print('Usage: skill-delete <name>', 'warning'); return; } + const name = args[0].replace(/\.md$/, ''); + const fs = this.terminal.fs; + const index = fs.fsReadJSON('/skills/index.json') || {}; + if (!index[name]) { + this.terminal.print(`Skill not found: ${name}`, 'error'); + return; + } + fs.deleteFile(`/skills/${name}.md`); + delete index[name]; + fs.fsWriteJSON('/skills/index.json', index); + this.terminal.print(`🗑️ Skill "${name}" deleted`, 'success'); + } + + _cmdSkillExport(args) { + if (!args[0]) { this.terminal.print('Usage: skill-export <name>', 'warning'); return; } + const name = args[0].replace(/\.md$/, ''); + const fs = this.terminal.fs; + const index = fs.fsReadJSON('/skills/index.json') || {}; + if (!index[name]) { + this.terminal.print(`Skill not found: ${name}`, 'error'); + return; + } + const content = fs.readFile(`/skills/${name}.md`); + const exportObj = { + ...index[name], + content: content || '' + }; + this.terminal.print(JSON.stringify(exportObj, null, 2), ''); } + + _cmdSkillImport(args) { + if (args.length === 0) { this.terminal.print('Usage: skill-import <json_string> or pipe a JSON object', 'warning'); return; } + const jsonStr = args.join(' '); + let data; + try { data = JSON.parse(jsonStr); } catch (e) { + this.terminal.print('Invalid JSON. Please provide a valid skill object.', 'error'); + return; + } + if (!data.name || !data.content) { + this.terminal.print('JSON must include "name" and "content" fields', 'error'); + return; + } + const fs = this.terminal.fs; + const index = fs.fsReadJSON('/skills/index.json') || {}; + const now = new Date().toISOString(); + const existing = index[data.name]; + fs.writeFile(`/skills/${data.name}.md`, data.content); + index[data.name] = { + name: data.name, + description: data.description || data.name, + tags: data.tags || [], + category: data.category || 'general', + created: existing?.created || now, + updated: now + }; + fs.fsWriteJSON('/skills/index.json', index); + this.terminal.print(`✅ Skill "${data.name}" imported (${existing ? 'updated' : 'created'})`, 'success'); + } + + _cmdSkillSync() { + const fs = this.terminal.fs; + const files = fs.ls('/skills') || []; + const mdFiles = files.filter(f => f.type === 'file' && f.name.endsWith('.md') && f.name !== 'index.json'); + let synced = 0; + const index = {}; + for (const f of mdFiles) { + const content = fs.readFile(`/skills/${f.name}`); + if (!content) continue; + const name = f.name.replace(/\.md$/, ''); + const headerMatch = content.match(/^---\n([\s\S]*?)\n---\n/); + let description = name; + let tags = []; + let category = 'general'; + if (headerMatch) { + const h = headerMatch[1]; + const d = h.match(/description:\s*(.+)/); + const c = h.match(/category:\s*(.+)/); + const t = h.match(/tags:\s*\[(.*?)\]/); + if (d) description = d[1].trim(); + if (c) category = c[1].trim(); + if (t) tags = t[1].split(',').map(x => x.trim()).filter(Boolean); + } + index[name] = { + name, + description, + tags, + category, + created: new Date().toISOString(), + updated: new Date().toISOString() + }; + synced++; + } + fs.fsWriteJSON('/skills/index.json', index); + this.terminal.print(`📚 Skill index rebuilt: ${synced} skills synced`, 'success'); + } + init() { this.seed(); } diff --git a/modules/ext/webdav.js b/modules/ext/webdav.js index 01856ce..a025cb2 100644 --- a/modules/ext/webdav.js +++ b/modules/ext/webdav.js @@ -633,8 +633,8 @@ class WebDAVModule { } const serialized = JSON.stringify(exportData, null, 2); // Size check: abort if >5MB - if (serialized.length > 5 * 1024 * 1024) { - self.terminal.print('Backup too large: ' + self._formatSize(serialized.length) + ' (>5MB limit). Try reducing VFS size first.', 'error'); + if (serialized.length > 52428800) { + self.terminal.print('Backup too large: ' + self._formatSize(serialized.length) + ' (>50MB limit). Try reducing VFS size first.', 'error'); return; } // Gzip payload diff --git a/modules/test/test-suite.js b/modules/test/test-suite.js index ddd0dbd..760259d 100644 --- a/modules/test/test-suite.js +++ b/modules/test/test-suite.js @@ -299,7 +299,7 @@ class TestSuiteModule { // Print header const divider = '─'.repeat(50); this.terminal.print(divider, 'info'); - this.terminal.print(' Test Suite — newOS4 v4.2', 'info'); + this.terminal.print(' Test Suite — newOS4 ' + (window.NEWOS4_VERSION || 'v4.0'), 'info'); this.terminal.print(divider, 'info'); this.terminal.print(` Running ${toRun.length} tests (${destructiveCount} destructive, ${toRun.length - destructiveCount} safe)`, 'info'); this.terminal.print('', 'info'); diff --git a/newos4_vision.html b/newos4_vision.html deleted file mode 100644 index 655d4c9..0000000 --- a/newos4_vision.html +++ /dev/null @@ -1,176 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>newOS4 | The Cognitive OS Vision</title> - <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script> - <style> - body { - margin: 0; - padding: 0; - background-color: #000; - color: #00ffcc; - font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; - overflow-x: hidden; - } - #canvas-container { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: -1; - } - .content { - position: relative; - z-index: 1; - max-width: 900px; - margin: 0 auto; - padding: 100px 20px; - text-align: center; - background: rgba(0, 0, 0, 0.7); - backdrop-filter: blur(10px); - box-shadow: 0 0 50px rgba(0, 255, 204, 0.2); - } - h1 { - font-size: 4rem; - text-transform: uppercase; - letter-spacing: 10px; - margin-bottom: 20px; - text-shadow: 0 0 20px #00ffcc; - animation: glow 2s ease-in-out infinite alternate; - } - @keyframes glow { - from { text-shadow: 0 0 10px #00ffcc; } - to { text-shadow: 0 0 30px #00ffcc, 0 0 10px #fff; } - } - .section { - margin: 60px 0; - padding: 30px; - border: 1px solid rgba(0, 255, 204, 0.3); - border-radius: 15px; - background: rgba(0, 20, 20, 0.5); - transition: transform 0.3s ease, box-shadow 0.3s ease; - } - .section:hover { - transform: translateY(-10px) rotateX(5deg); - box-shadow: 0 10px 30px rgba(0, 255, 204, 0.4); - border-color: #00ffcc; - } - h2 { - font-size: 2rem; - color: #fff; - margin-bottom: 20px; - border-bottom: 2px solid #00ffcc; - display: inline-block; - padding-bottom: 10px; - } - p { - font-size: 1.2rem; - line-height: 1.6; - color: #b0fffa; - text-align: left; - } - .roadmap-item { - display: flex; - justify-content: space-between; - margin: 15px 0; - padding: 10px; - background: rgba(255, 255, 255, 0.05); - border-radius: 8px; - } - .phase { - font-weight: bold; - color: #00ffcc; - min-width: 150px; - } - .footer { - margin-top: 100px; - font-size: 0.9rem; - opacity: 0.6; - letter-spacing: 2px; - } - </style> -</head> -<body> - <div id="canvas-container"></div> - - <div class="content"> - <h1>newOS4</h1> - <p style="text-align:center; font-style:italic; margin-bottom:50px;">Architected by Agando | The Evolution of Cognitive Computing</p> - - <div class="section"> - <h2>The Core Philosophy</h2> - <p>newOS4 is a <strong>Cognitive Operating System</strong>. It transcends traditional resource management (CPU/RAM) to manage <strong>Agentic Workflows</strong>. Intelligence is the primary system resource, allowing the OS to reason, adapt, and evolve its own structure in real-time.</p> - </div> - - <div class="section"> - <h2>Architectural Pillars</h2> - <p><strong>Hyper-Modular Kernel:</strong> 45 hot-swappable ES modules across 3 layers (infrastructure/core/ext) tracked in modules-index.json. Cache-versioned loads via <code>?v=2026-06-03-neuralvfs</code>.</p> - <p><strong>A2A Protocol:</strong> Standardized neural communication layer for agent negotiation. Agents register contracts (contract-register), discover capabilities (contract-list), and perform A2A handshakes before delegation. No central broker — contracts persist in VFS.</p> - <p><strong>Neural VFS:</strong> Semantic concept indexing replaces hierarchical paths. Four terminal commands (nvfs-index, nvfs-resolve, nvfs-tree, nvfs-status) plus <code>concept://</code> URI handler — <code>cat concept://skill</code> resolves through the semantic index.</p> - <p><strong>Recursive Self-Optimization:</strong> Integrated feedback loops via system-health telemetry command. Logs tool latency, VFS stats, module counts, and error rates. Telemetry hooks embedded in AI tool-calling paths for continuous diagnosis.</p> - </div> - - <div class="section"> - <h2>Strategic Roadmap</h2> - <div class="roadmap-item"> - <span class="phase">Phase 1 ✅</span> - <span>Foundation: WebX11 terminal stability, VFS perfection, and Procedural Memory (Skills).</span> - </div> - <div class="roadmap-item"> - <span class="phase">Phase 2 ✅</span> - <span>Agentic Shift: AI tool-calling loop (19+ tools), session_terminal context access, tool failure buffer + auto-skill creation, agent orchestration (list, register, leases, orchestrate). Security layer (security-level 0-3). Debug panel. Localized asset management.</span> - </div> - <div class="roadmap-item"> - <span class="phase">Phase 3 🟢</span> - <span>Cognitive OS: Neural VFS (4 nvfs commands + concept:// URI handler), A2A Protocol (contract-register + handshake), system-health telemetry (tool latency, VFS stats, module counts, error rates), module layer separation (45 modules across 3 layers with modules-index.json). Remaining: Predictive resource allocation, Global World Model.</span> - </div> - </div> - - <div class="footer"> - SYSTEM STATUS: ONLINE | ARCHITECT: AGANDO | VERSION: 4.3.1 - </div> - </div> - - <script> - // Three.js 3D Background - Digital Neural Network - const scene = new THREE.Scene(); - const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); - const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true }); - renderer.setSize(window.innerWidth, window.innerHeight); - document.getElementById('canvas-container').appendChild(renderer.domElement); - - // Create a point cloud of "nodes" - const geometry = new THREE.BufferGeometry(); - const vertices = []; - for (let i = 0; i < 1000; i++) { - vertices.push(THREE.MathUtils.randFloatSpread(2000)); // x - vertices.push(THREE.MathUtils.randFloatSpread(2000)); // y - vertices.push(THREE.MathUtils.randFloatSpread(2000)); // z - } - geometry.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3)); - const material = new THREE.PointsMaterial({ color: 0x00ffcc, size: 2 }); - const points = new THREE.Points(geometry, material); - scene.add(points); - - camera.position.z = 500; - - function animate() { - requestAnimationFrame(animate); - points.rotation.x += 0.001; - points.rotation.y += 0.002; - renderer.render(scene, camera); - } - - window.addEventListener('resize', () => { - camera.aspect = window.innerWidth / window.innerHeight; - camera.updateProjectionMatrix(); - renderer.setSize(window.innerWidth, window.innerHeight); - }); - - animate(); - </script> -</body> -</html> diff --git a/newos4_whitepaper.md b/newos4_whitepaper.md index 8695eef..755ba03 100644 --- a/newos4_whitepaper.md +++ b/newos4_whitepaper.md @@ -197,6 +197,15 @@ What the whitepaper originally listed as 4 items has grown into 25+ completed fe **Implementation Plan:** `.hermes/plans/2026-06-02_phase3-cognitive-os.md` +### Phase 4 — Agent Safety Security Layer ✅ RELEASED + +**Goal:** Three layered protections preventing AI misbehavior — proactive guardrails, confidence-based escalation, and sandboxed execution preview. + +**Built:** +- ✅ **Guardrail Layer** — Pre-execution policy engine (8 rules) intercepts AI tool calls matching dangerous patterns (`rm -rf`, `curl|bash`, `chmod 777`, `eval`, mass-delete, sensitive metadata deletion, external downloads, env overwrites). Each rule has `deny` or `warn` severity. Policy stored in localStorage, editable via `guardrail-add` / `guardrail-remove`. +- ✅ **Confidence Escalation** — AI must declare `Confidence: N%` in its reasoning before executing destructive actions. Below 90% → manual approval required. No confidence declared → manual approval required by default. +- ✅ **Shadow VFS** — `shadow <command>` snapshots the entire VFS state, runs the command, then diffs all filesystem changes (created/modified/deleted). User can `shadow-commit` or `shadow-rollback`. AI's `run_command` tool auto-snapshots and appends a shadow diff to every result. + --- ## 6. Failure Modes & Risk Mitigation diff --git a/review-newos4.html b/review-newos4.html deleted file mode 100644 index 7024e66..0000000 --- a/review-newos4.html +++ /dev/null @@ -1,284 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Review: newOS4 v4.3 — WebX11 Terminal</title> - <link rel="stylesheet" href="/spaces/assets/css/theme.css"> - <style> - :root { --cs-glass: rgba(17,17,17,0.75); --cs-glass-border: rgba(0,255,136,0.1); } - html, body { max-width: 100vw; overflow-x: hidden; } - body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; - background: var(--bg-primary); color: var(--text-primary); - min-height: 100vh; line-height: 1.6; - } - a { color: var(--accent); text-decoration: none; } - a:hover { color: var(--accent-dim); } - .container { max-width: 800px; margin: 0 auto; padding: 0 24px; } - header { - background: rgba(0,0,0,0.85); backdrop-filter: blur(20px); - -webkit-backdrop-filter: blur(20px); - border-bottom: 1px solid var(--border); - padding: 14px 0; position: sticky; top: 0; z-index: 10000; - } - .header-content { - display: flex; justify-content: space-between; align-items: center; - flex-wrap: wrap; gap: 12px; - } - .logo { font-size: 1.2em; font-weight: 700; } - .logo-icon { font-size: 1.3em; } - - h1 { font-size: 2.2em; margin: 40px 0 10px; background: linear-gradient(135deg, var(--accent), #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } - .meta { color: var(--text-secondary); margin-bottom: 30px; } - .summary-box { - background: var(--bg-secondary); border: 1px solid var(--border); - border-radius: 12px; padding: 20px; margin: 30px 0; - display: flex; gap: 20px; flex-wrap: wrap; - } - .summary-box .stat { - flex: 1; min-width: 100px; text-align: center; - } - .summary-box .value { font-size: 1.8em; font-weight: 700; color: var(--accent); } - .summary-box .label { font-size: 0.8em; color: var(--text-secondary); } - .rating { font-size: 1.5em; } - - section { margin: 40px 0; } - section h2 { font-size: 1.4em; margin-bottom: 20px; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 8px; } - h3 { margin: 20px 0 10px; font-size: 1.1em; } - - ul { padding-left: 20px; } - li { margin-bottom: 8px; color: var(--text-secondary); } - li strong { color: var(--text-primary); } - - .tag { - display: inline-block; background: rgba(0,255,136,0.08); - border: 1px solid rgba(0,255,136,0.2); color: var(--accent); - padding: 2px 10px; border-radius: 12px; font-size: 0.8em; - margin: 2px; - } - .pro { border-left: 3px solid #22c55e; padding-left: 16px; margin: 8px 0; border-radius: 2px; } - .con { border-left: 3px solid #ef4444; padding-left: 16px; margin: 8px 0; } - - .comparison-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.85em; } - .comparison-table th, .comparison-table td { padding: 8px 10px; border: 1px solid var(--border); text-align: center; } - .comparison-table th { background: var(--bg-secondary); color: var(--accent); font-weight: 600; } - .comparison-table td { background: var(--bg-tertiary); } - .comparison-table .feature-name { text-align: left; color: var(--text-primary); font-weight: 500; } - - @media (max-width: 600px) { - .container { padding: 0 16px; } - h1 { font-size: 1.6em; } - } - </style> -</head> -<body> -<header> - <div class="header-content"> - <span class="logo"><span class="logo-icon">🧩</span> newOS4 v4.3.1 Review</span> - <div style="display:flex;gap:8px;flex-wrap:wrap;"> - <a href="/spaces/newos4/help.html">📖 Help →</a> - <a href="/spaces/newos4/main.html">Launch OS →</a> - </div> - </div> -</header> - -<div class="container"> - -<h1>newOS4 v4.3.1</h1> -<p class="meta">WebX11 Terminal · In-Browser Terminal OS · Reviewed 2026-06-03</p> - -<div class="summary-box"> - <div class="stat"><div class="value">46</div><div class="label">Module Files</div></div> - <div class="stat"><div class="value">28+17</div><div class="label">Core + Ext</div></div> - <div class="stat"><div class="value">24</div><div class="label">Skills</div></div> - <div class="stat"><div class="value">9</div><div class="label">Theme Presets</div></div> - <div class="stat"><div class="value">54KB</div><div class="label">App Size</div></div> - <div class="stat"><div class="value">4.5/5</div><div class="label">Rating</div></div> -</div> - -<section> - <h2>Architecture</h2> - <p>newOS4 v4.3 is an <strong>in-browser terminal OS</strong> — NOT a chat-centric UI. Single-file <code>main.html</code> (1,101 lines, 54KB) loads 45 module files across two layers:</p> - <ul> - <li><strong>28 core items</strong> (<code>modules/core/</code>) — 4 infrastructure (VirtualFileSystem, OllamaManager, ModuleManager, Terminal) + 24 built-in feature modules (system, fs, modmgr, ollama, my, searxng, servermon, config, simplegui, io, dynamicprompts, aiassist, aiasm, smartctx, duckduckgo, fetcher, skills, secret-vault, chatstudio, agent-registry, leases, orchestrator, neural-vfs, module-loader)</li> - <li><strong>17 ext modules</strong> (<code>modules/ext/</code>) — Self-registering: alias, busybox, calc, cron, cryptogzip, diff, editor, filemgr, finder, mindmap, shell, skill-pack-core, theme, tutorial, voice, webdav, wpm</li> - <li><strong>45 modules + 1 test suite</strong> — Full discovery via <code>modules-list</code> command or AI <code>list_available_modules</code> tool (46 entries). Indexed in <code>modules-index.json</code></li> - </ul> - <p><strong>Total codebase</strong>: ~155KB (main.html + all module files). AI system with 5-turn agentic loop, 19+ tool definitions, 24 skills in VFS, 9 theme presets, and full destructive-action confirmation.</p> -</section> - -<section> - <h2>Key Features</h2> - - <h3>🧠 AI Assistant (WebX11AIAssistantModule)</h3> - <ul> - <li>Agentic loop with <strong>5 tool-call turns</strong>, 19+ tool definitions</li> - <li>Date/time injection into system prompt for contextual awareness</li> - <li>Streaming NDJSON response parsing with real-time token display</li> - <li>Auto-loads relevant skills at start of every AI task</li> - <li>Inline destructive action confirmation with 120-second countdown timer</li> - <li>Status bar "🤖 AI Thinking..." spinner with pulse animation</li> - <li>Post-task reflection suggesting skill creation</li> - <li><code>ai-stop</code> escape-cancel, <code>ai-model</code> runtime model switching</li> - </ul> - - <h3>📁 Virtual File System</h3> - <ul> - <li>localStorage-backed in-memory filesystem with persistent state</li> - <li>19 Unix commands: ls (flags), cd, pwd, cat, echo (> redirect), put, rm/rmdir/mkdir/mv/cp/touch/tree/find/head/tail/sort/wc/du/upload/download/grep</li> - <li>Trash system: <code>rm</code> moves to trash, <code>ls-trash</code>, <code>empty-trash</code>, <code>trash-dir</code>, <code>rm -rf</code> for real deletion</li> - <li>VFS Checkpoints: snapshot/rollback via <code>checkpoint</code> and <code>rollback</code> commands, auto-prune at 10</li> - <li>Auto-save session system: 60s interval with dirty-flag skip, context persists through reloads</li> - </ul> - - <h3>🎨 Theme System (9 Presets)</h3> - <ul> - <li>Built-in presets: <strong>dark</strong>, <strong>light</strong>, <strong>amber</strong>, <strong>cyber</strong>, <strong>ocean</strong>, <strong>forest</strong>, <strong>monochrome</strong>, <strong>sunset</strong>, <strong>midnight</strong></li> - <li>Custom theme creation with color pickers, export/import JSON</li> - <li>7 CSS variables per theme (bg, secondary, tertiary, text, muted, accent, border)</li> - <li>Commands: <code>theme set <name></code>, <code>theme list</code>, <code>theme new</code>, <code>theme delete</code>, <code>theme export</code>, <code>theme preview</code>, <code>theme keep</code></li> - </ul> - - <h3>📚 Skills System</h3> - <ul> - <li><strong>🧠 Neural VFS</strong> — Semantic concept indexing: <code>nvfs-index</code>, <code>nvfs-resolve</code>, <code>nvfs-status</code>, <code>nvfs-tree</code></li> - <li><strong>📜 A2A Protocol</strong> — Agent contract system with schema validation, orchestrator validates tasks before delegation</li> - <li><strong>📊 Self-Optimization Telemetry</strong> — <code>system-health</code> command with tool latency, VFS stats, error rates</li> - </ul> - - <h3>📚 Skills System</h3> - <ul> - <li><strong>24 skills</strong> (from 12) stored as Markdown with YAML frontmatter in VFS <code>/skills/</code></li> - <li>Skill-pack core auto-loads skills on startup with seed/reload</li> - <li>8 CLI commands: skill-list, skill-view, skill-create, skill-patch, skill-delete, skill-export, skill-import, skill-sync</li> - <li>Skills Manager UI modal (📚 button in quick-actions bar)</li> - <li>Auto-loads relevant skills at start of every AI task</li> - <li>Auto-creates error workaround skills after 3+ repeated failures</li> - <li>In-memory index with 2-second debounced flush to VFS</li> - </ul> - - <h3>🔒 Security Layer</h3> - <ul> - <li><code>security-level 0-3</code> — 0: unrestricted, 1: confirm destructive, 2: deny sensitive, 3: deny all dangerous commands</li> - <li><code>cmd-allow <cmd></code> / <code>cmd-deny <cmd></code> — per-command allowlist/denylist overrides</li> - <li>Destructive action confirmation bar (non-blocking, 120s countdown with color escalation)</li> - <li>AI tool call safety: auto-confirmation for read-only, countdown confirmation for destructive</li> - </ul> - - <h3>🔧 Debug Panel</h3> - <ul> - <li><code>debug</code> toggle — shows memory usage, event listeners, error log, module registration status</li> - <li>Real-time module health: loaded count, broken references, cache state</li> - <li>Useful for troubleshooting module load failures and VFS corruption</li> - </ul> - - <h3>🤖 Agent Orchestration</h3> - <ul> - <li><code>agent-list</code>, <code>agent-status</code> — list and inspect registered AI agents</li> - <li><code>agent-register</code>, <code>agent-unregister</code> — manage agent lifecycle</li> - <li><code>orchestrate <task></code> — delegate multi-step task with A2A contract validation</li> - <li><code>orchestrator-status</code>, <code>orchestrator-spawn</code> — manage agent pool</li> - <li><code>contract-register</code>, <code>contract-list</code> — define agent contracts with input/output schema</li> - <li>Lease-based lifecycle: each task creates a lease with TTL, heartbeat monitoring, auto-purge</li> - </ul> - - <h3>🎤 Voice Command</h3> - <ul> - <li>🎤 button in input area beside Send button</li> - <li>Green pulse animation while listening, red border on error</li> - <li>SpeechRecognition API (Chrome, Edge, Safari 14.1+), graceful fallback on Firefox</li> - <li>Toggle visibility via quick-actions bar</li> - </ul> - - <h3>🔊 Sound Notification</h3> - <ul> - <li>WebAudio "ding" (880Hz sine, 0.3s) after AI response</li> - <li>Togglable via <code>🔊 Sound</code> / <code>🔇 Muted</code> button in quick-actions</li> - <li>State persists in localStorage</li> - </ul> - - <h3>🔍 Search & Fetch</h3> - <ul> - <li>DuckDuckGo search module with proxy API fallback</li> - <li>SearXNG integration for web search</li> - <li>WebFetcher module for URL content extraction (256KB limit)</li> - </ul> - - <h3>Other Notable Modules</h3> - <ul> - <li><strong>Shell</strong> — pipes <code>|</code>, redirects <code>> >> <</code>, variables <code>$VAR</code>, chaining <code>&& || ;</code>, VFS script execution</li> - <li><strong>BusyBox</strong> — 16 utilities: which, env, date, cal, yes, seq, base64, printf, cut, uniq, hostname, whoami, basename, dirname, sleep, expand</li> - <li><strong>CryptoGzip</strong> — AES-256-GCM encrypt/decrypt + gzip/gunzip for VFS files</li> - <li><strong>File Manager</strong> — Fullscreen overlay with 30% sidebar, 70% preview pane, 10+ preview renderers, live search</li> - <li><strong>WebDAV Sync</strong> — 10 commands + modern file-tree browser with bulk actions (Select All, Delete, Move, Download), inline rename (double-click), right-click context menu, breadcrumb navigation, keyboard shortcuts (j/k, Space, Enter), create-directory button</li> - <li><strong>Mindmap</strong> — ASCII mindmap creation and management in terminal</li> - <li><strong>Text Editor</strong> — inline VFS editing via modal (edit/save/cancel)</li> - <li><strong>Calculator, Cron, Diff, Alias, Finder</strong> — utility modules covering common needs</li> - <li><strong>Package Manager (WPM)</strong> — Web Package Manager for module discovery</li> - <li><strong>Tutorial</strong> — Onboarding tutorial for new users</li> - <li><strong>Chat Overlay</strong> — Lite chat UI via <code>chat</code> command (toggleable overlay)</li> - </ul> -</section> - -<section> - <h2>Feature Comparison</h2> - <table class="comparison-table"> - <tr> - <th>Feature</th><th>Main</th><th>Lite</th><th>Stable</th><th>Plus</th><th>newOS4</th> - </tr> - <tr><td class="feature-name">AI Chat</td><td>❌</td><td>✅ Streaming</td><td>✅ No stream</td><td>✅</td><td>✅ Agentic</td></tr> - <tr><td class="feature-name">Skills System</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>✅ 17 skills</td></tr> - <tr><td class="feature-name">AI Tool Calling</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>✅ 19+ tools</td></tr> - <tr><td class="feature-name">AI Memory</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>✅ Session save/load</td></tr> - <tr><td class="feature-name">Self-improving</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>✅ Skills sync</td></tr> - <tr><td class="feature-name">PDF Support</td><td>✅ Link</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td></tr> - <tr><td class="feature-name">File Manager</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>✅ Virtual FS</td></tr> - <tr><td class="feature-name">Theme Presets</td><td>✅</td><td>✅</td><td>✅</td><td>✅ Custom</td><td>✅ 9 presets</td></tr> - <tr><td class="feature-name">Voice Input</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>✅</td></tr> - <tr><td class="feature-name">i18n</td><td>✅ 7 langs</td><td>❌</td><td>❌</td><td>❌</td><td>❌</td></tr> - <tr><td class="feature-name">Plan Mode</td><td>❌</td><td>❌</td><td>✅</td><td>❌</td><td>❌</td></tr> - <tr><td class="feature-name">Session Export</td><td>❌</td><td>❌</td><td>❌</td><td>✅</td><td>✅ VFS export</td></tr> - <tr><td class="feature-name">File Upload</td><td>❌</td><td>❌</td><td>❌</td><td>✅</td><td>✅ file attach</td></tr> - </table> -</section> - -<section> - <h2>Pros & Cons</h2> - - <div class="pro"><strong>✅ Self-improving</strong> — AI creates, patches, and manages its own skills. 24 skills in VFS with skill-pack core auto-load and seed/reload support.</div> - <div class="pro"><strong>✅ Rich module ecosystem</strong> — 45 module files (28 core + 17 ext), 19 Unix commands, search, fetch, shell, webdav, cron, calc, voice, encrypt, theme, mindmap, editor</div> - <div class="pro"><strong>✅ WebDAV modern browser</strong> — File-tree UI with checkboxes, Select All, bulk Move/Delete/Download, inline rename, context menu, breadcrumbs, keyboard shortcuts</div> - <div class="pro"><strong>✅ Security layer</strong> — security-level 0-3, command allowlist/denylist, non-blocking destructive confirmation with 120s countdown</div> - <div class="pro"><strong>✅ Debug panel</strong> — Live memory, event, error, and module health monitoring via <code>debug</code> toggle</div> - <div class="pro"><strong>✅ Agent orchestration</strong> — Agent registration, lease management, multi-step task delegation</div> - <div class="pro"><strong>✅ Agentic AI</strong> — 5-turn tool calling loop, 19+ tool definitions, streaming responses, destructive action confirmation with countdown</div> - <div class="pro"><strong>✅ 9 Theme Presets</strong> — Dark, light, amber, cyber, ocean, forest, monochrome, sunset, midnight + custom theme creation</div> - <div class="pro"><strong>✅ Auto-save sessions</strong> — Dirty-flag auto-save every 60s, VFS crash survival, context restoration on page reload</div> - <div class="pro"><strong>✅ Virtual File System</strong> — localStorage-backed persistent filesystem with trash, checkpoints, grep, tree, find</div> - <div class="pro"><strong>✅ Inline confirm bar</strong> — Non-blocking action confirmation without dark overlay popup. 120s countdown with color escalation.</div> - <div class="pro"><strong>✅ Clean terminal UX</strong> — Autocomplete (commands, files, sessions), command history, pipe support, mobile responsive</div> - <div class="pro"><strong>✅ Standalone at <code>/spaces/newos4/</code></strong> — Dedicated instance with nginx autoindex, WebDAV token, full API backend</div> - - <div class="con"><strong>❌ Ollama dependency</strong> — AI features require a running Ollama or compatible provider</div> - <div class="con"><strong>❌ 5-turn agent limit</strong> — Complex multi-step tasks may hit the tool-call ceiling</div> - <div class="con"><strong>❌ No module isolation</strong> — All 45 modules share same JS scope, potential for collisions</div> - <div class="con"><strong>❌ No TTS</strong> — Voice input only (🎤), no text-to-speech for AI responses</div> - <div class="con"><strong>❌ No streaming AI</strong> — Agent uses non-streaming chat for tool handling; stream is text-only fallback</div> - <div class="con"><strong>❌ Single-file pain point</strong> — 1,101-line main.html with inline CSS+JS is hard to maintain</div> - <div class="con"><strong>❌ 45 file loads</strong> — All module scripts loaded sequentially, slow on first visit</div> -</section> - -<section> - <h2>Verdict</h2> - <p>newOS4 v4.3.1 is the most <strong>feature-rich</strong> ChatStudio variant — an in-browser terminal OS with agentic AI, persistent virtual filesystem, skills system, 9 themes, voice input, and 45 modular components. At 54KB for the main HTML (~155KB total codebase), it packs enormous functionality into a self-contained browser app.</p> - <p>The key distinction from other variants: newOS4 is a <strong>terminal OS</strong>, not a chat UI. It's designed for power users who want AI-assisted file management, shell commands, and automated workflows — not just conversation.</p> - <p><strong>Best for:</strong> Power users, developers, AI experimentation, anyone who wants a browser-based terminal with learning AI.</p> - <p><strong>Not for:</strong> Users who just want quick AI chat, or users without Ollama/OpenRouter access.</p> - <p>Rating: <strong>🧩🧩🧩🧩</strong> (4/5 — most advanced ChatStudio variant, trimmed down from peak but still unmatched in features)</p> - <p style="margin-top:20px;">📖 <a href="/spaces/newos4/help.html" style="color:var(--accent);">Full documentation available here →</a></p> -</section> - -</div> -</body> -</html>
\ No newline at end of file diff --git a/skills/a2a-contract-framework.md b/skills/a2a-contract-framework.md deleted file mode 100644 index 51678b2..0000000 --- a/skills/a2a-contract-framework.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: a2a-contract-framework -description: Framework for formalizing Agent-to-Agent (A2A) contracts to ensure deterministic collaboration. -tags: a2a, agent-orchestration, protocol, newos4 -category: system ---- - -# A2A Contract Framework - -## 1. Purpose -To move from "best-effort" delegation to "contractual" execution by defining a strict interface (`.contract.json`) for every agent role. - -## 2. Contract Schema -Every agent must have an associated contract containing: -- `role`: The official designation (e.g., "researcher"). -- `capabilities`: `string[]` of authorized toolsets. -- `input_schema`: JSON Schema defining required parameters. -- `output_schema`: JSON Schema defining guaranteed return format. -- `sla`: Response time goals and accuracy thresholds. -- `resource_weight`: Numeric value representing cognitive cost. - -## 3. Workflow -1. **Handshake**: Orchestrator requests contract from Agent. -2. **Verification**: Orchestrator validates task against `input_schema`. -3. **Execution**: Agent executes using only `capabilities`. -4. **Validation**: Orchestrator validates result against `output_schema`. - -## 4. Implementation Path -- Store contracts in `.contracts/` directory. -- Reference contracts during `spawn_agent` calls. diff --git a/skills/agent-optimization-framework.md b/skills/agent-optimization-framework.md deleted file mode 100644 index 52c10b1..0000000 --- a/skills/agent-optimization-framework.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: agent-optimization-framework -description: System for reducing tool-call latency and increasing agentic precision through programmatic workflows. -tags: [optimization, agentic-workflow, efficiency, tool-calls] -category: system ---- - -# Agent Optimization Framework - -## 🎯 Objective -Transition from manual prompt-based reasoning to a programmatic "Compiler" approach to reduce turns and eliminate hallucinations. - -## 🛠️ Optimization Protocols - -### 1. VFS Cache & Batching (Latency Reduction) -- **Batching:** If a task requires information from multiple files, call `read_file` for all relevant paths in a single turn rather than sequentially. -- **Contextual Caching:** Store the result of `list_files` in temporary memory to avoid redundant calls to the same directory within the same task. - -### 2. Speculative Tool-Calling (Turn Reduction) -- **Anticipation:** Predict the next 2-3 logical steps. If they are independent (e.g., `web_search` followed by `get_status`), execute them in parallel. -- **Pre-fetching:** When a user asks about a module, call `get_module_status` AND `view_module` immediately instead of waiting for the user's second prompt. - -### 3. Strict Validation Loop (Precision) -- **Cross-Reference:** Compare tool output against the `get_help` command reference to ensure parameters are used correctly. -- **Auto-Fallback:** If a `read_file` returns empty, immediately try `list_files` to verify the path before reporting a failure to the user. - -## 🔄 Implementation Workflow -1. **REASON:** Identify the target goal and all required dependencies. -2. **BATCH:** Group all independent data-gathering tool calls. -3. **EXECUTE:** Run the batch. -4. **VALIDATE:** Verify the output against the expected schema. -5. **REFINE:** If the result is missing or incorrect, trigger the auto-fallback protocol. diff --git a/skills/bug-tracker.md b/skills/bug-tracker.md deleted file mode 100644 index bb8febf..0000000 --- a/skills/bug-tracker.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: bug-tracker -description: A systematic approach to tracking and managing bugs in the VFS. -tags: [dev, debugging, management, workflow] -category: dev ---- - -# Bug Tracking Workflow - -This skill provides a standardized way to track bugs using a JSON-based log file in the root directory. - -## 1. Initialize Bug Log -If `/bugs.json` does not exist, create it with an empty array: `[]`. - -## 2. Reporting a Bug -When a bug is found, append a new entry to `/bugs.json` with the following schema: -- `id`: Unique incremental integer. -- `title`: Brief summary of the issue. -- `description`: Detailed steps to reproduce and expected vs actual behavior. -- `status`: "open" | "in-progress" | "resolved" | "closed". -- `severity`: "low" | "medium" | "high" | "critical". -- `created_at`: Timestamp. -- `updated_at`: Timestamp. - -## 3. Managing Bugs -- **List Open Bugs**: Filter `/bugs.json` for entries where `status != "closed"`. -- **Update Status**: Change the `status` and update the `updated_at` timestamp. -- **Resolve**: Mark as "resolved" and add a `resolution` field explaining the fix. - -## 4. Verification -Once a bug is marked "resolved", run existing tests or manually verify the fix before marking it "closed". diff --git a/skills/index.json b/skills/index.json index bbfcce7..3171230 100644 --- a/skills/index.json +++ b/skills/index.json @@ -9,8 +9,8 @@ "filesystem" ], "category": "system", - "created": "2026-06-05T15:37:40.384Z", - "updated": "2026-06-05T15:37:40.384Z" + "created": "2026-06-05T22:10:06.669Z", + "updated": "2026-06-05T22:13:42.539Z" }, "memory-and-profile": { "name": "memory-and-profile", @@ -22,8 +22,8 @@ "persistence" ], "category": "system", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.669Z", + "updated": "2026-06-05T22:13:42.539Z" }, "web-search-and-fetch": { "name": "web-search-and-fetch", @@ -36,8 +36,8 @@ "api" ], "category": "research", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.669Z", + "updated": "2026-06-05T22:13:42.539Z" }, "module-management": { "name": "module-management", @@ -49,8 +49,8 @@ "self-improvement" ], "category": "dev", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.669Z", + "updated": "2026-06-05T22:13:42.539Z" }, "system-maintenance": { "name": "system-maintenance", @@ -63,8 +63,8 @@ "config" ], "category": "system", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.669Z", + "updated": "2026-06-05T22:13:42.539Z" }, "backup-and-restore": { "name": "backup-and-restore", @@ -77,8 +77,8 @@ "persistence" ], "category": "system", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.669Z", + "updated": "2026-06-05T22:13:42.539Z" }, "mindmap-workflow": { "name": "mindmap-workflow", @@ -90,8 +90,8 @@ "organization" ], "category": "productivity", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.669Z", + "updated": "2026-06-05T22:13:42.539Z" }, "skills-system-guide": { "name": "skills-system-guide", @@ -102,8 +102,8 @@ "meta" ], "category": "system", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.669Z", + "updated": "2026-06-05T22:13:42.539Z" }, "agent-orchestration": { "name": "agent-orchestration", @@ -115,8 +115,8 @@ "leases" ], "category": "system", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.670Z", + "updated": "2026-06-05T22:13:42.539Z" }, "debug-panel-and-logs": { "name": "debug-panel-and-logs", @@ -128,8 +128,8 @@ "troubleshooting" ], "category": "system", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.670Z", + "updated": "2026-06-05T22:13:42.539Z" }, "webdav-operations": { "name": "webdav-operations", @@ -142,8 +142,8 @@ "storage" ], "category": "system", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.670Z", + "updated": "2026-06-05T22:13:42.539Z" }, "security-and-safety": { "name": "security-and-safety", @@ -155,8 +155,8 @@ "permissions" ], "category": "system", - "created": "2026-06-05T15:37:40.385Z", - "updated": "2026-06-05T15:37:40.385Z" + "created": "2026-06-05T22:10:06.670Z", + "updated": "2026-06-05T22:13:42.539Z" }, "mindmap-user-guide": { "name": "mindmap-user-guide", @@ -168,167 +168,7 @@ "planning" ], "category": "productivity", - "created": "2026-06-05T15:38:13.076Z", - "updated": "2026-06-05T15:38:13.076Z" - }, - "a2a-contract-framework": { - "name": "a2a-contract-framework", - "description": "Framework for formalizing Agent-to-Agent (A2A) contracts to ensure deterministic collaboration.", - "tags": [ - "a2a", - "agent-orchestration", - "protocol", - "newos4" - ], - "category": "system", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "agent-optimization-framework": { - "name": "agent-optimization-framework", - "description": "System for reducing tool-call latency and increasing agentic precision through programmatic workflows.", - "tags": [ - "optimization", - "agentic-workflow", - "efficiency", - "tool-calls" - ], - "category": "system", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "bug-tracker": { - "name": "bug-tracker", - "description": "A systematic approach to tracking and managing bugs in the VFS.", - "tags": [ - "dev", - "debugging", - "management", - "workflow" - ], - "category": "dev", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "localize-external-assets": { - "name": "localize-external-assets", - "description": "Downloads external JS/CSS assets to the VFS to bypass server-side security restrictions on external scripts.", - "tags": [ - "security", - "assets", - "vfs", - "localization" - ], - "category": "system", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "macro-engine": { - "name": "macro-engine", - "description": "Rapid session onboarding and module debugging — context recovery, status checks, source analysis, and live testing.", - "tags": [ - "macro", - "onboarding", - "debug", - "context", - "recovery", - "development" - ], - "category": "system", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "memory": { - "name": "memory", - "description": "Manage user profiles, session memory, and persistent memory map for cross-session context.", - "tags": [ - "memory", - "profile", - "session", - "persistence", - "context", - "map" - ], - "category": "system", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "mindmap": { - "name": "mindmap", - "description": "Create, manage, export, and persist brainstorming mindmaps using the mindmap terminal module.", - "tags": [ - "mindmap", - "brainstorming", - "planning", - "organization", - "visualization" - ], - "category": "productivity", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "neural-vfs-indexer": { - "name": "neural-vfs-indexer", - "description": "Scans the VFS to create semantic mappings between concepts and file paths.", - "tags": [ - "neural-vfs", - "semantic", - "indexing", - "newos4" - ], - "category": "system", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "project-profile-manager": { - "name": "project-profile-manager", - "description": "Handles saving and loading of project-specific context bundles.", - "tags": [ - "context", - "memory", - "workspace" - ], - "category": "system", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "task-manager": { - "name": "task-manager", - "description": "A systematic approach to managing tasks using a JSON-based tracking system in the VFS.", - "tags": [ - "productivity", - "management", - "organization" - ], - "category": "productivity", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "webdav": { - "name": "webdav", - "description": "Configure, sync, backup, and restore VFS via WebDAV cloud storage.", - "tags": [ - "webdav", - "cloud", - "backup", - "sync", - "storage", - "vfs" - ], - "category": "system", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" - }, - "webx11-dev-cycle": { - "name": "webx11-dev-cycle", - "description": "Professional workflow for analyzing, prototyping, and implementing new features in WebX11.", - "tags": [ - "development", - "workflow", - "webx11" - ], - "category": "dev", - "created": "2026-06-03T22:22:07.000Z", - "updated": "2026-06-03T22:22:07.000Z" + "created": "2026-06-05T22:14:44.807Z", + "updated": "2026-06-05T22:14:44.807Z" } }
\ No newline at end of file diff --git a/skills/localize-external-assets.md b/skills/localize-external-assets.md deleted file mode 100644 index b7a1c9b..0000000 --- a/skills/localize-external-assets.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: localize-external-assets -description: Downloads external JS/CSS assets to the VFS to bypass server-side security restrictions on external scripts. -tags: [security, assets, vfs, localization] -category: system ---- - -### Logic -1. Identify external URLs in the target HTML/CSS. -2. Use the `download <url>` command to save these files into a local `/assets/` directory. -3. Update the HTML file to reference local paths (e.g., `src="https://cdn..."` $\rightarrow$ `src="/assets/..."`). - -### Implementation Steps -1. **Scan**: Read the file and extract all `src` and `href` attributes pointing to external domains. -2. **Prepare**: Create an `/assets/` directory if it doesn't exist. -3. **Fetch**: Execute `download <url>` for every identified external dependency. -4. **Patch**: Use `write_file` to replace the remote URLs with the local VFS paths. -5. **Verify**: Confirm the file is successfully updated and assets are present in the VFS. diff --git a/skills/macro-engine.md b/skills/macro-engine.md deleted file mode 100644 index ca5ef5e..0000000 --- a/skills/macro-engine.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: macro-engine -description: Rapid session onboarding and module debugging — context recovery, status checks, source analysis, and live testing. -tags: [macro, onboarding, debug, context, recovery, development] -category: system ---- - -TODO: Category should be system+dev — primary use is debugging modules (dev) for context recovery (system). Using 'system' as primary. - -## Session Onboarding (context recovery) - -Efficiently recover state at session start to avoid redundant queries. - -1. **Session Review** — `session_recent(3)` to identify last active tasks and outcomes -2. **VFS Snapshot** — `list_files('')` to examine root directory for new files/config changes -3. **Procedure Retrieval** — `load_skills('current-task')` for applicable stored procedures -4. **User Preferences** — `user_list` for project-specific flags/persistent preferences - -**Workflow:** `session_recent` → `list_files` → `load_skills` → `user_list` - -## Module Debugging (rapid diagnosis) - -1. **Status Check** — `get_module_status` to see if module is loaded, modified, or has a remote URL mismatch -2. **Source Analysis** — `view_module(name)` to examine current implementation logic -3. **Live Testing** — `test_module(name)` to load edited version from `/_mods/` and verify the fix -4. **Synthesis** — compare test results with the original bug report to confirm resolution - -**Workflow:** `get_module_status` → `view_module` → `test_module` → `report`
\ No newline at end of file diff --git a/skills/memory.md b/skills/memory.md deleted file mode 100644 index d3b46fe..0000000 --- a/skills/memory.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -name: memory -description: Manage user profiles, session memory, and persistent memory map for cross-session context. -tags: [memory, profile, session, persistence, context, map] -category: system ---- - -## User Profile (localStorage — user_get/user_set) - -| Command | Purpose | -|---------|---------| -| `user_get(key)` | Read profile field (e.g. "preferredModel") | -| `user_set(key, value)` | Write to profile, auto-persists | -| `user_list` | Show all stored profile keys | -| `user_forget(key)` | Delete a profile key | - -Dot notation supported: `user_set knownFacts.name "Alex"` - -## Session Memory (VFS-based daily logs) - -| Command | Purpose | -|---------|---------| -| `session_save(summary)` | Save session summary | -| `session_load(date)` | Read day's log (YYYY-MM-DD) | -| `session_recent(count)` | Last N session summaries | -| `session_stats` | Aggregate totals | - -Recent sessions auto-load into context on first message. - -## Persistent Memory Map (/memory/map.json) - -An index of projects, preferences, issues, and session history so the AI never asks to repeat itself. - -**Location:** `/memory/map.json` — primary map; `/memory/index.json` — auto-generated session index - -**Read Before Acting:** -``` -read_file("memory/map.json") -``` - -**Update After Significant Work:** -- Read current map, modify relevant section, write back -- Append to `recent_sessions` (keep last 10) - -**Map Structure:** -- `projects` — WebX11, clients, personal builds -- `infrastructure` — security stack, backups, constraints -- `preferences` — communication style, UI needs -- `active_issues` — open tasks, blockers, manual steps -- `recent_sessions` — quick links to session logs - -**Rules:** -- NEVER ask for info already in the map -- If info is stale, update immediately -- Use `session_save()` after complex tasks -- Keep `active_issues` accurate — remove resolved items - -## Conversation Patterns -- Pattern tracking runs automatically — frequent topics surface as hints -- `my-set`, `my-get`, `my-list` store additional personal data -- AI conversation context persists within a session (use `ai-clear` to reset) - -## When to Use -- Session start: call `session_recent(3)`, then `read_file("memory/map.json")` -- After identifying user preferences: `user_set` to store them -- After complex tasks: `session_save` with a brief summary, update map
\ No newline at end of file diff --git a/skills/mindmap.md b/skills/mindmap.md deleted file mode 100644 index e1cbb7b..0000000 --- a/skills/mindmap.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: mindmap -description: Create, manage, visualize, and persist brainstorming mindmaps using the mindmap terminal module. -tags: [mindmap, brainstorming, planning, organization, visualization] -category: productivity ---- - -## Core Workflow - -1. **Create a new mindmap** - - `mindmap new "<topic>" -t tag1,tag2` — creates a root node - - Tags are optional (e.g. planning, research, dev) - - Root gets auto-assigned a color from 7-color palette - -2. **Add child nodes** - - `mindmap add <parent-id> "<idea>" -t tag` — add a child - - Get parent-id from `mindmap show` — IDs are 4-char random strings - -3. **View** - - `mindmap show` — full tree with Unicode box-drawing - - `mindmap show <id>` — subtree starting at that node - - `mindmap svg [name]` — render as inline SVG with colored rects + bezier curves. Optional name saves to /mindmaps/<name>.svg for `preview` - -4. **Visualize with Mermaid** - - Export your mindmap data and render in `webx11_mindmap.html` for a full Mermaid flowchart - - The mermaid library is at `mermaid.min.js` in the newOS4 directory - -5. **Edit nodes** - - `mindmap rename <id> "<new text>"` — change text - - `mindmap color <id> <color>` — set color (red/green/yellow/blue/cyan/magenta/white) - - `mindmap tag <id> <tag>` — assign/update tag - -6. **Persistence** - - `mindmap save <name>` — save to VFS (stores in /mindmaps/ as JSON) - - `mindmap load <name>` — restore - - `mindmap list` — show saved mindmaps - - `mindmap delete <name>` — remove saved mindmap file - -7. **Export** - - `mindmap export [id]` — Markdown bullet list output, auto-copies to clipboard - - `mindmap svg <name>` — saves SVG to /mindmaps/<name>.svg, viewable with `preview` - -8. **Neural VFS integration** - - After running `nvfs-index`, mindmap skill files are indexed as `concept://mindmap` - - Saved mindmaps in /mindmaps/ are discoverable via concept search - -## When to Use -- Brainstorming feature sets, project architecture, or ideas -- Decomposing complex tasks into manageable subtrees -- User says "brainstorm", "diagram", "organize thoughts", "plan", "map out"
\ No newline at end of file diff --git a/skills/neural-vfs-indexer.md b/skills/neural-vfs-indexer.md deleted file mode 100644 index 0030db7..0000000 --- a/skills/neural-vfs-indexer.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: neural-vfs-indexer -description: Scans the VFS to create semantic mappings between concepts and file paths. -tags: [neural-vfs, semantic, indexing, newos4] -category: system ---- - -# Neural VFS Indexer - -## Purpose -To implement the "Neural VFS" pillar of newOS4 by creating a semantic layer over the hierarchical filesystem. - -## Workflow -1. **Discovery**: List all files in the VFS using `list_files`. -2. **Analysis**: Read the contents of each file. -3. **Keyword Extraction**: Identify primary themes, technical terms, and "concepts" within the file. -4. **Indexing**: Create a mapping file in `.semantic_index/` named after the concept (e.g., `.semantic_index/cognitive-kernel.map`). -5. **Mapping**: The mapping file should contain the path to the source file and a brief semantic summary. - -## Usage -Run this skill when new documentation is added or when the architectural structure changes. diff --git a/skills/project-profile-manager.md b/skills/project-profile-manager.md deleted file mode 100644 index 7b8c6cf..0000000 --- a/skills/project-profile-manager.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: project-profile-manager -description: Handles saving and loading of project-specific context bundles. -tags: [context, memory, workspace] -category: system ---- - -# Project Profile Manager - -## Profile Structure -Profiles are stored in `/profiles/<name>.json` containing: -- `preferences`: Key-value pairs for `user_set` -- `required_skills`: List of skills to be loaded via `load_skills` -- `working_dir`: The primary VFS path for the project -- `session_anchor`: Last known session date/ID - -## Workflow: Save -1. Capture current working directory using `get_current_dir`. -2. Retrieve relevant `user_list` keys. -3. Save as JSON to `/profiles/`. - -## Workflow: Load -1. Read `/profiles/<name>.json`. -2. Apply `user_set` for all stored preferences. -3. Call `load_skills` for all registered project skills. -4. Navigate to `working_dir`. diff --git a/skills/security-and-safety.md b/skills/security-and-safety.md index bd4f23b..80b5193 100644 --- a/skills/security-and-safety.md +++ b/skills/security-and-safety.md @@ -33,5 +33,4 @@ category: system 5. **When to use:** - User wants to lock down the terminal → security-level 2 - - User wants to allow a blocked command → cmd-allow <cmd> - - Debugging strange behavior → verify security-level (user may have set it higher)
\ No newline at end of file + - User wants to allow a blocked command → cmd-allow <cmd>
\ No newline at end of file diff --git a/skills/task-manager.md b/skills/task-manager.md deleted file mode 100644 index f4a0542..0000000 --- a/skills/task-manager.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: task-manager -description: A systematic approach to managing tasks using a JSON-based tracking system in the VFS. -tags: productivity, management, organization -category: productivity ---- - -# Task Management Workflow - -## 1. Initialization -- Check if `/tasks.json` exists. If not, create it with an empty array: `[]`. - -## 2. Adding Tasks -When a new task is identified: -- **Define**: Task name, priority (Low, Medium, High), status (Todo, In-Progress, Done), and deadline. -- **Action**: Read `tasks.json`, append the new task object, and write back to the file. - -## 3. Daily Planning/Review -- **List**: Read `tasks.json` and filter for "Todo" or "In-Progress". -- **Prioritize**: Sort tasks by priority (High > Medium > Low). -- **Update**: Change status of tasks as they are completed. - -## 4. Maintenance -- **Cleanup**: Archive "Done" tasks to `/tasks_archive.json` periodically to keep the main list lean. -- **Audit**: Review overdue tasks and update deadlines or priorities. - -## Schema Reference -```json -{ - "id": "unique-id", - "title": "Task name", - "priority": "High|Medium|Low", - "status": "Todo|In-Progress|Done", - "created_at": "ISO-Date", - "deadline": "ISO-Date", - "notes": "Additional context" -} -```
\ No newline at end of file diff --git a/skills/webdav.md b/skills/webdav.md deleted file mode 100644 index c8b2dfc..0000000 --- a/skills/webdav.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -name: webdav -description: Configure, sync, backup, and restore VFS via WebDAV cloud storage. -tags: [webdav, cloud, backup, sync, storage, vfs] -category: system ---- - -## CRITICAL: VERIFY BEFORE EXECUTING -**ALWAYS run `help <command>` first.** If `help <command>` returns nothing, the command does NOT exist. Never invent commands — terminal crashes. - -## 1. Configure & Status -- `webdav-config` — configure WebDAV endpoint URL and credentials -- `webdav-status` — verify connection health, last sync, space info - -## 2. File Operations - -| Command | Purpose | -|---------|---------| -| `webdav-ls [path]` | List remote directory contents | -| `webdav-push <local> <remote>` | Upload file to WebDAV | -| `webdav-pull <remote> [local]` | Download file from WebDAV | - -## 3. Backup & Restore -- `webdav-backup` — push full VFS snapshot to WebDAV (`/backups/newos4-<date>.json`) -- `webdav-backup-list` — list all remote backup snapshots -- `webdav-restore <filename>` — restore VFS from remote backup - -## 4. What Does NOT Exist -These will crash the terminal: -- `webdav-browser` ❌ -- `webdav-explorer` ❌ -- `webdav-delete` ❌ -- `webdav-rm` ❌ - -Since `curl` is also blocked, no automated way to delete WebDAV backups from the terminal — use the WebDAV web interface outside. - -## 5. When to Use -- Before factory-reset: `webdav-backup` to store VFS remotely -- Cross-browser: `webdav-push`/`webdav-pull` to move files -- User says "cloud backup" or "remote save" - -## 6. Connection Details -- Uses per-user token stored in `.token` file on the server -- WebDAV runs on same server (nginx with WebDAV module) — no external dependency
\ No newline at end of file diff --git a/skills/webx11-dev-cycle.md b/skills/webx11-dev-cycle.md deleted file mode 100644 index 934b65b..0000000 --- a/skills/webx11-dev-cycle.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: webx11-dev-cycle -description: Professional workflow for analyzing, prototyping, and implementing new features in WebX11. -steps: - 1. Research: Use web_search and web_fetch to find similar implementations or documentation. - 2. Audit: Use view_module or run_command to examine current system state. - 3. Prototype: Use edit_module to implement a change in a sandbox environment. - 4. Verify: Use test_module and run_command to validate the change. - 5. Document: Save the final implementation and a a changelog in /webx11_dev/logs/. - 6. Persist: Save the session using session_save. -tags: development,workflow,webx11 -category: dev ---- diff --git a/summary.txt b/summary.txt deleted file mode 100644 index b89a9a5..0000000 --- a/summary.txt +++ /dev/null @@ -1,14 +0,0 @@ -session_summary: project: WebX11 Module System v4.2 -type: Mobile-Optimized Web Terminal - -status: Complete - -key_features: - Virtual File System with localStorage persistence - Dynamic Module Loading from URLs - Ollama AI Integration for local LLM access - Mobile-responsive design with touch optimizations - Command-line interface with history support - Quick action buttons for common tasks - -components: virtual_file_system: -description: In-browser file storage using localStorage commands: [ls, cat, put, rm, upload, download] - -module_manager: description: Dynamic module loading and registry system commands: [modules, loadmod, removemod, listmods] persistence: localStorage - -ollama_manager: -description: Local AI model integration commands: [ollamaconnect, ollamadisconnect, ollamamodels, ollamasetmodel, ai, ask] default_endpoint: http://localhost:11434 terminal_core: description: Main interface controller features: [command_history, network_status, memory_monitor]built_in_modules: - SystemModule - FileSystemModule - ModuleManagerModule - OllamaModuleui_elements: - Header with version and memory status - Terminal output container - Quick action button bar - Command input area - Status bar (network/ready status) - Modals: File Browser, Module Manager, Ollama Managerdecisions: - Single-file HTML implementation for portability - localStorage for data persistence across sessions - Mobile-first responsive design - Modular architecture for extensibilityaction_items: - Deploy HTML file to web server or open locally - Configure Ollama endpoint if using AI features - Load custom modules via URL if needed - Use 'help' command to view all available commandstechnical_notes: - Requires modern browser with localStorage support - Ollama integration needs local Ollama server running - Module loading requires CORS-friendly URLs - All data stored client-side only
\ No newline at end of file diff --git a/webx11_mindmap.html b/webx11_mindmap.html index fe7750d..923fc2d 100644 --- a/webx11_mindmap.html +++ b/webx11_mindmap.html @@ -4,7 +4,7 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>WebX11 Semantic Mindmap</title> - <script src="mermaid.min.js"></script> + <script src="mermaid.min.js?v=11"></script> <style> body { background-color: #000; @@ -44,34 +44,32 @@ <p>Neural VFS & A2A Integrated System</p> </div> <div class="mindmap-container"> - <pre class="mermaid"> - mindmap - root((WebX11)) - Neural_VFS - Semantic_Mapping - Conceptual_Index - Skill_Cross_Referencing - A2A_Protocol - Contract_Formalization - Input_Output_Schemas - Agent_Delegation - Self_Optimization - Telemetry_Logs - Recursive_Patching - Health_Checks - Interface - Browser_Terminal - Mobile_Optimized - Dark_Mode_UI - Core_Capabilities - File_System_Access - Web_Search_Fetch - Package_Management - </pre> + <pre class="mermaid">mindmap + root((WebX11)) + Neural_VFS + Semantic_Mapping + Conceptual_Index + Skill_Cross_Referencing + A2A_Protocol + Contract_Formalization + Input_Output_Schemas + Agent_Delegation + Self_Optimization + Telemetry_Logs + Recursive_Patching + Health_Checks + Interface + Browser_Terminal + Mobile_Optimized + Dark_Mode_UI + Core_Capabilities + File_System_Access + Web_Search_Fetch + Package_Management</pre> </div> <script> mermaid.initialize({ - startOnLoad: true, + startOnLoad: false, theme: 'dark', themeVariables: { primaryColor: '#00ff00', @@ -80,6 +78,13 @@ lineColor: '#0f0' } }); + document.addEventListener('DOMContentLoaded', function() { + try { + mermaid.init(undefined, '.mermaid'); + } catch(e) { + document.querySelector('.mermaid').textContent = 'Mindmap render error: ' + e.message; + } + }); </script> </body> </html>
\ No newline at end of file |