diff options
| author | Agando <roduccomm@gmail.com> | 2026-11-09 15:36:23 +0100 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-11-09 15:36:23 +0100 |
| commit | a065a4c30be748b0c8fc6dd0b5ee1dc4d3de4b1c (patch) | |
| tree | 8a84adabfccee9994937cd71888170ab205b9361 /.bkp-fix-20261023_143429/main.html | |
| parent | a46ebee30cfbbac86abb45068411bc28e1c65503 (diff) | |
The daily collector and the feedback pipeline had left 57 modified files uncommitted (skills,
modules-index, CHANGELOG, feedback decisions, debug counters). The public mirror publishes git
HEAD, so without this the published repo stayed behind the tree - and it blocked the publisher
outright once uncommitted subtrees started failing loudly.
Diffstat (limited to '.bkp-fix-20261023_143429/main.html')
| -rw-r--r-- | .bkp-fix-20261023_143429/main.html | 1484 |
1 files changed, 1484 insertions, 0 deletions
diff --git a/.bkp-fix-20261023_143429/main.html b/.bkp-fix-20261023_143429/main.html new file mode 100644 index 0000000..f41b12d --- /dev/null +++ b/.bkp-fix-20261023_143429/main.html @@ -0,0 +1,1484 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <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</title> + <style> + :root { + --bg-color: #000000; + --bg-secondary: #0a0a0a; + --bg-tertiary: #111111; + --text-color: #00ff00; + --text-muted: #888888; + --accent-color: #00aa00; + --border-color: #005500; + --error-color: #ff5555; + --warning-color: #ffaa00; + --info-color: #00aaff; + --success-color: #00ff00; + --ai-text-color: #aaddff; + --ai-bg-color: #001a26; + --font-primary: 'Courier New', Courier, monospace; + } + * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; } + body { + background-color: var(--bg-color); + color: var(--text-color); + font-family: var(--font-primary); + font-size: var(--term-font-size, 16px); + height: 100vh; + display: flex; + flex-direction: column; + overflow: hidden; + } + @media (max-width: 600px) { body { font-size: var(--term-font-size, 12px); } } + header { + border-bottom: 1px solid var(--border-color); + padding: 10px; + display: flex; + justify-content: space-between; + align-items: center; + background: var(--bg-secondary); + flex-shrink: 0; + } + .header-title { font-weight: bold; font-size: 1.1em; } + .header-version { font-size: 0.7em; color: var(--text-muted); } + .status-pill { + font-size: 0.8em; + padding: 2px 6px; + border: 1px solid var(--border-color); + border-radius: 4px; + background: var(--bg-tertiary); + } + #terminal-container { + flex-grow: 1; + overflow-y: auto; + padding: 10px; + scroll-behavior: smooth; + -webkit-overflow-scrolling: touch; + transition: padding 0.2s; + } + #terminal-container.terminal-expanded { + position: fixed; + left: 0; + top: 0; + width: 100vw; + height: 100vh; + z-index: 1000; + background: var(--bg-color); + padding: 16px; + } + #terminal-container.terminal-expanded + #input-area, + #terminal-container.terminal-expanded ~ #input-area { + display: none; + } + .line-copy-btn { + float: right; + font-size: 0.7em; + padding: 2px 6px; + margin-left: 6px; + border: 1px solid var(--border-color); + background: var(--bg-tertiary); + color: var(--text-muted); + border-radius: 4px; + cursor: pointer; + opacity: 0; + transition: opacity 0.15s; + } + .output-line:hover .line-copy-btn { opacity: 1; } + .line-copy-btn:active { background: var(--accent-color); color: #000; } + #ai-confirm-area { + display: none; + flex-shrink: 0; + padding: 10px; + margin: 0 8px 4px; + border: 1px solid var(--warning-color); + border-radius: 6px; + background: var(--bg-secondary); + z-index: 200; + font-size: 0.95em; + min-height: 48px; + align-items: center; + gap: 8px; + flex-wrap: wrap; + justify-content: center; + pointer-events: auto; + } + #ai-confirm-area.visible { display: flex; } + #ai-confirm-area.hidden { display: none !important; } + #ai-confirm-area .confirm-desc { + flex: 1; + min-width: 120px; + color: var(--warning-color); + word-break: break-word; + } + #ai-confirm-area .confirm-btn { + padding: 12px 24px; + border: 1px solid var(--success-color); + color: var(--success-color); + background: transparent; + border-radius: 6px; + cursor: pointer; + font-family: inherit; + font-size: 1.1em; + font-weight: bold; + touch-action: manipulation; + min-height: 48px; + min-width: 90px; + user-select: none; + -webkit-user-select: none; + transition: background 0.15s; + } + #ai-confirm-area .confirm-btn:active { + background: rgba(0, 255, 0, 0.15); + } + #ai-confirm-area .confirm-btn.deny { + border-color: var(--error-color); + color: var(--error-color); + } + #ai-confirm-area .confirm-timer { + font-size: 0.8em; + color: var(--warning-color); + flex-shrink: 0; + } + #ai-confirm-area .confirm-timer.urgent { + color: var(--error-color); + font-weight: bold; + } + #ai-confirm-area .confirm-timer.critical { + color: #ff0000; + font-weight: bold; + animation: pulse 1s infinite; + } + /* ── Startup Modules Modal ── */ + .output-line { white-space: pre-wrap; word-break: break-word; line-height: 1.4; } + .output-line.command-prompt { color: var(--text-color); font-weight: bold; } + .output-line.error { color: var(--error-color); } + .output-line.warning { color: var(--warning-color); } + .output-line.info { color: var(--info-color); } + .output-line.success { color: var(--success-color); } + .output-line.text-muted { color: var(--text-muted); } + .output-line.ollama { + color: var(--ai-text-color); + background: var(--ai-bg-color); + padding: 8px; + border-radius: 4px; + border: 1px solid #003344; + margin-bottom: 10px; + position: relative; + } + .output-line.user-prompt-line { + display: flex; + align-items: flex-start; + gap: 6px; + flex-wrap: wrap; + padding: 4px 0; + } + .output-line.user-prompt-line .prompt-prefix { + color: var(--accent-color); + white-space: nowrap; + flex-shrink: 0; + } + .output-line.user-prompt-line .prompt-text { + color: var(--text-color); + word-break: break-word; + flex: 1; + min-width: 0; + } + .copy-btn, .edit-btn { + font-size: 0.7em; + padding: 2px 8px; + cursor: pointer; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 4px; + color: var(--text-muted); + touch-action: manipulation; + flex-shrink: 0; + transition: background 0.15s; + } + .copy-btn:hover, .edit-btn:hover, + .copy-btn:active, .edit-btn:active { background: var(--accent-color); color: var(--bg-color); } + #input-area { + border-top: 1px solid var(--border-color); + padding: 8px 10px; + background: var(--bg-secondary); + display: flex; + align-items: flex-start; + flex-shrink: 0; + position: relative; + } + .prompt-label { margin-right: 8px; color: var(--accent-color); white-space: nowrap; margin-top: 6px; } + #command-input { + flex-grow: 1; + background: transparent; + border: none; + color: var(--text-color); + font-family: var(--font-primary); + font-size: inherit; + outline: none; + resize: none; + overflow-y: auto; + max-height: 120px; + line-height: 1.4; + padding: 4px 0; + } + #send-btn { + flex-shrink: 0; + min-width: 48px; + min-height: 48px; + padding: 8px 16px; + font-size: 1em; + touch-action: manipulation; + margin-top: 2px; + } + #quick-actions { scrollbar-width: none; -ms-overflow-style: none; } + #quick-actions::-webkit-scrollbar { display: none; } + @media (max-width: 480px) { + #input-area { padding: 6px; } + #command-input { font-size: 0.9em; } + .prompt-label { font-size: 0.8em; max-width: 80px; overflow: hidden; text-overflow: ellipsis; } + } + #autocomplete-dropdown { + position: absolute; + bottom: 100%; + left: 0; + right: 0; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-top: none; + max-height: 200px; + overflow-y: auto; + display: none; + z-index: 1001; + } + @media (min-height: 700px) { + #autocomplete-dropdown { + bottom: auto; + top: 100%; + border-top: 1px solid var(--border-color); + border-bottom: none; + } + } + .autocomplete-item { + padding: 8px 12px; + cursor: pointer; + border-bottom: 1px solid #111; + } + .autocomplete-item:hover, .autocomplete-item.selected { + background: var(--bg-tertiary); + color: var(--success-color); + } + .autocomplete-item .cmd-name { color: var(--text-color); font-weight: bold; } + .autocomplete-item .cmd-desc { color: var(--text-muted); font-size: 0.85em; } + #quick-actions { + display: flex; + gap: 8px; + padding: 8px 10px; + overflow-x: auto; + border-top: 1px solid #111; + background: var(--bg-tertiary); + flex-shrink: 0; + } + .qa-btn { + background: var(--bg-secondary); + border: 1px solid var(--border-color); + color: var(--text-color); + padding: 8px 12px; + border-radius: 4px; + font-family: inherit; + font-size: 0.9em; + cursor: pointer; + white-space: nowrap; + touch-action: manipulation; + } + .qa-btn:active { background: var(--border-color); } + @keyframes confetti-fall { + 0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; } + 100% { transform: translateY(110vh) rotate(720deg); opacity: 0; } + } + .confetti-piece { + position: fixed; top: -5vh; z-index: 9999; + font-size: 24px; pointer-events: none; user-select: none; + animation: confetti-fall 3s ease-in forwards; + } + #status-bar { + border-top: 1px solid var(--border-color); + padding: 4px 10px; + font-size: 0.8em; + display: flex; + justify-content: space-between; + color: var(--text-muted); + flex-shrink: 0; + } + .modal-overlay { + position: fixed; + top: 0; left: 0; right: 0; bottom: 0; + background: rgba(0,0,0,0.85); + display: none; + justify-content: center; + align-items: center; + z-index: 1000; + } + .modal-content { + background: var(--bg-color); + border: 1px solid var(--border-color); + width: 90%; + max-width: 500px; + max-height: 80vh; + display: flex; + flex-direction: column; + border-radius: 4px; + } + .modal-header { + padding: 10px; + border-bottom: 1px solid var(--border-color); + display: flex; + justify-content: space-between; + font-weight: bold; + } + .modal-body { padding: 10px; overflow-y: auto; flex-grow: 1; } + .modal-footer { + padding: 10px; + border-top: 1px solid var(--border-color); + display: flex; + justify-content: flex-end; + gap: 8px; + } + .btn { + padding: 6px 12px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + color: var(--text-color); + cursor: pointer; + border-radius: 3px; + } + .btn:hover { background: var(--bg-tertiary); } + .btn-danger { border-color: var(--error-color); color: var(--error-color); } + .file-item, .module-item, .model-item { + padding: 8px; + border-bottom: 1px solid #111; + cursor: pointer; + display: flex; + justify-content: space-between; + align-items: center; + } + .file-item:hover, .module-item:hover, .model-item:hover { background: var(--bg-tertiary); } + .file-item.dir { color: var(--info-color); } + .module-item.active { border-left: 3px solid var(--success-color); } + .module-item.disabled { opacity: 0.5; } + .model-item.connected { color: var(--success-color); } + .hidden { display: none !important; } + .text-center { text-align: center; } + .clickable-file, .clickable-dir { + cursor: pointer; + display: inline-block; + padding: 1px 3px; + border: 1px solid transparent; + border-radius: 2px; + margin: 1px 0; + } + .clickable-file:hover { background: rgba(0,255,0,0.1); border-color: var(--border-color); } + .module-url-input { + width: 100%; + padding: 8px; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + color: var(--text-color); + font-family: var(--font-primary); + margin-bottom: 10px; + } + .ollama-status { + padding: 10px; + margin-bottom: 10px; + border-radius: 4px; + } + .ollama-status.connected { background: rgba(0, 255, 0, 0.1); border: 1px solid var(--success-color); } + .ollama-status.disconnected { background: rgba(255, 85, 85, 0.1); border: 1px solid var(--error-color); } + /* Toggle slider styles */ + #ollama-optimization-slider::before, #ollama-validator-slider::before, #ollama-stream-slider::before { + content: ""; + position: absolute; + height: 20px; + width: 20px; + left: 2px; + bottom: 2px; + background: var(--text-color); + border-radius: 50%; + transition: 0.3s; + } + #ollama-optimization-toggle:checked + #ollama-optimization-slider::before, + #ollama-validator-toggle:checked + #ollama-validator-slider::before, + #ollama-stream-toggle:checked + #ollama-stream-slider::before { + transform: translateX(22px); + } + #ollama-optimization-toggle:checked + #ollama-optimization-slider, + #ollama-validator-toggle:checked + #ollama-validator-slider, + #ollama-stream-toggle:checked + #ollama-stream-slider { + border-color: var(--success-color); + } + /* ── Card Layout Styles ── */ + .msg-card { + margin-bottom: 8px; + border: 1px solid var(--border-color); + border-radius: 6px; + overflow: hidden; + background: var(--bg-secondary); + } + .msg-card.user { border-left: 3px solid var(--success-color); } + .msg-card.ai { border-left: 3px solid var(--ai-text-color); background: var(--ai-bg-color); } + .msg-card.system { border-left: 3px solid var(--text-muted); } + .msg-card-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 6px 10px; + border-bottom: 1px solid var(--border-color); + background: var(--bg-tertiary); + } + .msg-role { font-weight: bold; font-size: 0.85em; white-space: nowrap; } + .msg-buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; } + .msg-card-body { + padding: 10px; + white-space: pre-wrap; + word-break: break-word; + line-height: 1.4; + font-size: 0.9em; + } + .card-btn { + display: inline-flex; + padding: 4px 12px; + font-size: 0.75em; + font-family: inherit; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + color: var(--text-muted); + border-radius: 4px; + cursor: pointer; + touch-action: manipulation; + transition: background 0.15s; + white-space: nowrap; + line-height: 1.4; + } + .card-btn:hover, .card-btn:active { background: var(--accent-color); color: var(--bg-color); } + .msg-card.ai .ai-render-container { + margin: 0; + border: 1px solid var(--border-color); + } + .msg-card.ai .ai-content { + display: inline; + } + .msg-card.system .msg-card-body { + color: inherit; + } + /* ── End Card Layout ── */ + .ai-render-container { + margin: 10px 0; + border-radius: 6px; + overflow: hidden; + border: 1px solid var(--border-color); + background: #000; + } + .ai-render-iframe { + width: 100%; + border: none; + display: block; + background: #000; + min-height: 200px; + } + .module-badge { + display: inline-block; + padding: 2px 6px; + border-radius: 3px; + font-size: 0.75em; + margin-left: 5px; + } + .module-badge.builtin { background: var(--bg-tertiary); border: 1px solid var(--border-color); } + .fetch-content { + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + padding: 10px; + margin: 5px 0; + border-radius: 4px; + max-height: 300px; + overflow-y: auto; + font-size: 0.85em; + } + .search-result { + margin-bottom: 10px; + padding: 8px; + background: var(--bg-tertiary); + border-radius: 4px; + border-left: 3px solid var(--info-color); + } + .search-result a { + color: var(--info-color); + text-decoration: none; + } + .search-result a:hover { + text-decoration: underline; + } + .search-result-image, .search-result-video { + margin-bottom: 10px; + padding: 8px; + background: var(--bg-tertiary); + border-radius: 4px; + } + .search-result-image img, .search-result-video img { + max-width: 200px; + max-height: 150px; + border-radius: 4px; + object-fit: cover; + } + + /* ── Splash Screen ── */ + #splash-overlay { + position: fixed; + top: 0; left: 0; right: 0; bottom: 0; + background: var(--bg-color); + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 2000; + transition: opacity 0.3s ease; + } + #splash-overlay.hidden { + opacity: 0; + pointer-events: none; + } + #splash-title { + font-size: 1.8em; + font-weight: bold; + margin-bottom: 4px; + } + #splash-version { + font-size: 0.8em; + color: var(--text-muted); + margin-bottom: 24px; + } + #splash-progress-track { + width: 260px; + max-width: 70vw; + height: 8px; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 4px; + overflow: hidden; + margin-bottom: 12px; + } + #splash-progress-fill { + height: 100%; + width: 0%; + background: var(--accent-color); + transition: width 0.15s ease; + border-radius: 3px; + } + #splash-phase { + font-size: 0.75em; + color: var(--text-muted); + margin-bottom: 4px; + } + #splash-filename { + font-size: 0.85em; + color: var(--info-color); + margin-bottom: 16px; + } + #splash-cursor { + display: inline-block; + width: 8px; + height: 14px; + background: var(--text-color); + animation: blink 1s step-end infinite; + } + @keyframes blink { + 0%, 100% { opacity: 1; } + 50% { opacity: 0; } + } + #splash-gear { + position: absolute; + top: 12px; + right: 12px; + font-size: 1.4em; + cursor: pointer; + opacity: 0.5; + transition: opacity 0.2s; + touch-action: manipulation; + padding: 8px; + } + #splash-gear:hover { opacity: 1; } + #splash-error { + color: var(--error-color); + font-size: 0.85em; + margin-top: 12px; + text-align: center; + display: none; + } + #splash-error.show { display: block; } + + /* ── Startup Modules Modal ── */ + .mod-card { + display: flex; + align-items: center; + padding: 10px 8px; + border-bottom: 1px solid #111; + min-height: 44px; + touch-action: manipulation; + } + .mod-card:last-child { border-bottom: none; } + .mod-card.disabled { opacity: 0.4; pointer-events: none; } + .mod-card label { + display: flex; + align-items: center; + gap: 10px; + flex-grow: 1; + cursor: pointer; + } + .mod-card input[type="checkbox"] { + width: 18px; + height: 18px; + accent-color: var(--accent-color); + flex-shrink: 0; + } + .mod-card .mod-name { + font-size: 0.9em; + flex-shrink: 0; + } + .mod-card .mod-badge { + font-size: 0.7em; + padding: 2px 6px; + border-radius: 3px; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + color: var(--text-muted); + margin-left: auto; + } + .mod-card .mod-badge.foundation { + background: #001a00; + border-color: var(--accent-color); + color: var(--accent-color); + } + .mod-card .mod-badge.ext { + background: #1a001a; + border-color: #550055; + color: #aa55ff; + } + .mod-section-header { + padding: 8px 8px 4px; + font-size: 0.75em; + color: var(--text-muted); + text-transform: uppercase; + letter-spacing: 1px; + border-bottom: 1px solid var(--border-color); + background: var(--bg-secondary); + } + @media (max-width: 400px) { + .mod-card { padding: 10px 6px; } + .mod-card .mod-name { font-size: 0.82em; } + } + /* ── Command Cards Panel ── */ + #cmd-cards { + position: fixed; right: 0; top: 48px; bottom: 0; width: 280px; + background: var(--bg-secondary); border-left: 1px solid var(--border-color); + z-index: 999; display: none; flex-direction: column; + backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); + overflow-y: auto; + } + #cmd-cards.visible { display: flex; } + #cmd-cards-header { + display: flex; justify-content: space-between; align-items: center; + padding: 12px 14px; border-bottom: 1px solid var(--border-color); + font-weight: bold; font-size: 0.9em; + position: sticky; top: 0; background: var(--bg-secondary); + } + .cmd-card-section { padding: 10px 14px; } + .cmd-card-section + .cmd-card-section { border-top: 1px solid var(--border-color); } + .cmd-card-section-title { font-size: 0.75em; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; } + .cmd-card { + display: flex; align-items: center; gap: 10px; + padding: 10px 12px; margin-bottom: 4px; + background: var(--bg-tertiary); border: 1px solid var(--border-color); + border-radius: 6px; cursor: pointer; transition: border-color .15s; + min-height: 44px; touch-action: manipulation; + } + .cmd-card:hover { border-color: var(--accent-color); } + .cmd-card .cmd { font-family: var(--font-primary); font-weight: bold; font-size: 0.85em; color: var(--accent-color); flex-shrink: 0; min-width: 60px; } + .cmd-card .desc { font-size: 0.78em; color: var(--text-muted); } + #cmd-cards-toggle { cursor: pointer; font-size: 1.1em; line-height: 1; } + + /* ── Floating UI Module ── */ + #floating-container { + position: fixed; + bottom: calc(56px + 36px + 12px); + right: 12px; + z-index: 500; + display: flex; + flex-direction: column-reverse; + align-items: flex-end; + gap: 6px; + pointer-events: none; + max-width: 280px; + } + .floating-btn { + pointer-events: auto; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + color: var(--text-color); + padding: 8px 14px; + border-radius: 8px; + font-family: inherit; + font-size: 0.9em; + cursor: grab; + display: flex; + align-items: center; + gap: 6px; + white-space: nowrap; + touch-action: manipulation; + min-height: 44px; + box-shadow: 0 2px 8px rgba(0,0,0,0.4); + transition: border-color 0.15s, background 0.15s; + user-select: none; + } + .floating-btn:hover, + .floating-btn:active { + border-color: var(--accent-color); + background: #0a1a0a; + } + .floating-btn:active { + cursor: grabbing; + } + .floating-menu { + pointer-events: auto; + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 8px; + overflow: hidden; + min-width: 140px; + box-shadow: 0 2px 12px rgba(0,0,0,0.5); + } + .floating-menu-header { + padding: 8px 14px; + cursor: grab; + display: flex; + align-items: center; + gap: 8px; + font-size: 0.9em; + min-height: 44px; + touch-action: none; + user-select: none; + border-bottom: 1px solid var(--border-color); + } + .floating-menu-header:active { + cursor: grabbing; + } + .floating-menu-header:hover { + background: #0a1a0a; + } + .floating-menu-header .arrow { + transition: transform 0.2s; + font-size: 0.7em; + } + .floating-menu-header .arrow.collapsed { + transform: rotate(-90deg); + } + .floating-menu-body { + overflow: hidden; + transition: max-height 0.2s ease-out; + max-height: 0; + } + .floating-menu-body.expanded { + max-height: 300px; + } + .floating-menu-btn { + display: block; + width: 100%; + text-align: left; + padding: 8px 14px 8px 24px; + background: transparent; + border: none; + color: var(--text-muted); + font-family: inherit; + font-size: 0.85em; + cursor: pointer; + touch-action: manipulation; + min-height: 40px; + } + .floating-menu-btn:hover, + .floating-menu-btn:active { + background: #0a1a0a; + color: var(--text-color); + } + .floating-panel { + pointer-events: auto; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 8px; + font-size: 0.8em; + min-width: 120px; + box-shadow: 0 2px 8px rgba(0,0,0,0.4); + overflow: hidden; + } + .floating-panel-title { + padding: 6px 10px; + font-weight: bold; + color: var(--text-muted); + font-size: 0.9em; + cursor: grab; + touch-action: none; + user-select: none; + border-bottom: 1px solid var(--border-color); + background: rgba(0,0,0,0.15); + } + .floating-panel-title:active { + cursor: grabbing; + } + .floating-panel-content { + padding: 6px 10px; + color: var(--text-color); + line-height: 1.4; + } + @keyframes float-in { + from { opacity: 0; transform: translateY(8px) scale(0.95); } + to { opacity: 1; transform: translateY(0) scale(1); } + } + .floating-btn, + .floating-menu, + .floating-panel { + animation: float-in 0.15s ease-out; + } + </style> + <!-- Early persistence restore — apply saved theme + font-size BEFORE bundle loads to prevent FOUC --> + <script> + (function() { + try { + // Restore font size + var fs = localStorage.getItem('webx11_font_size'); + if (fs) { document.documentElement.style.fontSize = fs + 'px'; } + // Restore theme + var theme = localStorage.getItem('webx11_active_theme'); + if (theme) { + var themesRaw = localStorage.getItem('webx11_themes'); + var 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) { try { Object.assign(defaults, JSON.parse(themesRaw)); } catch(e){} } + var t = defaults[theme]; + if (t) { for (var k in t) { document.documentElement.style.setProperty(k, t[k]); } } + } + } catch(e) {} + })(); + </script> +</head> +<body> + <header> + <div> + <span class="header-title">WebX11</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> + </header> + + <!-- Command Cards Panel --> + <div id="cmd-cards"> + <div id="cmd-cards-header"> + <span>📋 Quick Commands</span> + <span onclick="if(webx11)webx11.toggleCmdCards()" style="cursor:pointer;font-size:1.2em;">✕</span> + </div> + <div class="cmd-card-section"> + <div class="cmd-card-section-title">🟢 Beginners</div> + <div class="cmd-card" onclick="webx11?.executeCommand('help')"><span class="cmd">help</span><span class="desc">Show all commands</span></div> + <div class="cmd-card" onclick="webx11?.executeCommand('ls')"><span class="cmd">ls</span><span class="desc">List files</span></div> + <div class="cmd-card" onclick="webx11?.executeCommand('clear')"><span class="cmd">clear</span><span class="desc">Clear terminal</span></div> + <div class="cmd-card" onclick="webx11?.executeCommand('status')"><span class="cmd">status</span><span class="desc">System health</span></div> + </div> + <div class="cmd-card-section"> + <div class="cmd-card-section-title">🤖 AI</div> + <div class="cmd-card" onclick="webx11?.executeCommand('ai \"what can you do?\"')"><span class="cmd">ai "..."</span><span class="desc">Ask AI assistant</span></div> + <div class="cmd-card" onclick="webx11?.executeCommand('ai-model')"><span class="cmd">ai-model</span><span class="desc">Set AI model</span></div> + </div> + <div class="cmd-card-section"> + <div class="cmd-card-section-title">🔍 Explore</div> + <div class="cmd-card" onclick="webx11?.executeCommand('modules')"><span class="cmd">modules</span><span class="desc">List loaded modules</span></div> + <div class="cmd-card" onclick="webx11?.executeCommand('tutorial')"><span class="cmd">tutorial</span><span class="desc">Interactive tour</span></div> + </div> + <div class="cmd-card-section"> + <div class="cmd-card-section-title">🚀 Advanced</div> + <div class="cmd-card" onclick="webx11?.executeCommand('cron-every 60 echo hello')"><span class="cmd">cron</span><span class="desc">Schedule tasks</span></div> + <div class="cmd-card" onclick="webx11?.executeCommand('webdav-status')"><span class="cmd">webdav</span><span class="desc">Cloud sync</span></div> + <div class="cmd-card" onclick="webx11?.executeCommand('help.html')"><span class="cmd">help</span><span class="desc">Full reference</span></div> + </div> + </div> + + <!-- Terminal Container --> + <div id="terminal-container"> + <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> + <div class="output-line info loading" id="loading-indicator">Loading modules...</div> + </div> + + <!-- Floating UI Container — populated by FloatingModule --> + <div id="floating-container"></div> + + <!-- AI Confirm Area — fixed outside scrollable output, always visible --> + <div id="ai-confirm-area" class="hidden"></div> + + <div id="quick-actions"> + <button class="qa-btn" onclick="webx11.executeCommand('ls')">📁 Files</button> + <button class="qa-btn" onclick="webx11.executeCommand('help')">📖 Help</button> + <button class="qa-btn" onclick="webx11.executeCommand('modules')">🧩 Modules</button> + <button class="qa-btn" onclick="webx11.openOllamaManager()">🤖 Ollama</button> + <button class="qa-btn" onclick="webx11.openSkillsManager()">📚 Skills</button> + <button class="qa-btn" onclick="webx11.openConfigManager()">⚙ Config</button> + <button class="qa-btn" onclick="webx11.executeCommand('clear')">🧹 Clear</button> + <button class="qa-btn" id="voice-toggle-btn" onclick="webx11.toggleMicVisibility()">🎤 Mic</button> + <button class="qa-btn" onclick="webx11.toggleDebugPanel()">🐞 Debug</button> + <button class="qa-btn" id="sound-toggle-btn">🔊 Sound</button> + </div> + + <div id="input-area"> + <span class="prompt-label">$</span> + <textarea id="command-input" rows="1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="Type a command..." style="resize:none; overflow-y:auto; max-height:120px;"></textarea> + <button id="send-btn" onclick="var i=document.getElementById('command-input');webx11.executeCommand(i.value);i.value='';i.style.height='auto'" style="background:var(--bg-tertiary); border:1px solid var(--border-color); color:var(--success-color); padding:6px 12px; border-radius:4px; cursor:pointer; font-family:inherit; font-size:0.9em; margin-left:6px; white-space:nowrap; flex-shrink:0;">⏎ Send</button> + <div id="autocomplete-dropdown"></div> + </div> + + <div id="status-bar"> + <span id="status-text">Ready</span> + <span id="network-status">📶 Online</span> + <span id="stream-status" style="font-size:0.75em; margin-left:4px; color:var(--success-color);">▶ Stream</span> + <button id="ai-cancel-btn" style="display:none; background:var(--error-color); color:#fff; border:none; border-radius:4px; padding:2px 10px; cursor:pointer; font-family:inherit; font-size:0.8em; touch-action:manipulation; min-height:28px;" onclick="webx11.executeCommand('ai-stop')">⏹ Stop</button> + </div> + + <!-- File Browser Modal --> + <div id="file-browser" class="modal-overlay"> + <div class="modal-content"> + <div class="modal-header"> + <span>File Browser</span> + <span style="cursor:pointer" onclick="webx11.closeFileBrowser()">✕</span> + </div> + <div class="modal-body" id="fb-content"></div> + <div class="modal-footer"> + <button class="btn" onclick="document.getElementById('file-upload-input').click()">⬆️ Upload</button> + <button class="btn" onclick="webx11.closeFileBrowser()">Close</button> + </div> + </div> + </div> + + <!-- Module Manager Modal --> + <div id="module-manager" class="modal-overlay"> + <div class="modal-content" style="max-width: 600px;"> + <div class="modal-header"> + <span>Module Manager</span> + <span style="cursor:pointer" onclick="webx11.closeModuleManager()">✕</span> + </div> + <div class="modal-body"> + <div style="margin-bottom: 15px;"> + <input type="text" id="module-url-input" class="module-url-input" placeholder="Enter module URL (https://example.com/module.js)"> + <button class="btn" onclick="webx11.loadModuleFromURL()" style="width: 100%;">Load Module from URL</button> + </div> + <h4 style="color: var(--info-color); margin-bottom: 10px;">Loaded Modules</h4> + <div id="module-list"></div> + </div> + <div class="modal-footer"> + <button class="btn btn-danger" onclick="webx11.clearAllModules()">Clear All</button> + <button class="btn" onclick="webx11.closeModuleManager()">Close</button> + </div> + </div> + </div> + + <!-- Ollama Manager Modal --> + <div id="ollama-manager" class="modal-overlay"> + <div class="modal-content" style="max-width: 600px;"> + <div class="modal-header"> + <span>Ollama AI Manager</span> + <span style="cursor:pointer" onclick="webx11.closeOllamaManager()">✕</span> + </div> + <div class="modal-body"> + <div id="ollama-status" class="ollama-status disconnected"> + <strong>Status:</strong> <span id="ollama-status-text">Disconnected</span> + </div> + <div style="margin-bottom: 15px;"> + <label style="display: block; margin-bottom: 5px; color: var(--text-muted);">Ollama Endpoint:</label> + <input type="text" id="ollama-endpoint" class="module-url-input" value="http://localhost:11434" placeholder="http://localhost:11434"> + <button class="btn" onclick="webx11.connectOllama()" style="width: 100%;">Connect</button> + </div> + <h4 style="color: var(--info-color); margin-bottom: 10px;">Available Models</h4> + <input type="text" id="ollama-search" class="module-url-input" placeholder="Search models..." oninput="webx11.renderOllamaModels()" style="margin-bottom: 8px;"> + <div id="ollama-model-count" style="font-size: 0.8em; color: var(--text-muted); margin-bottom: 6px;"></div> + <div id="ollama-models" style="max-height: 300px; overflow-y: auto;"></div> + <div style="margin-top: 15px;"> + <label style="display: block; margin-bottom: 5px; color: var(--text-muted);">Current Model:</label> + <select id="ollama-current-model" class="module-url-input"> + <option value="">Select a model</option> + </select> + <button class="btn" onclick="webx11.setOllamaModel()" style="width: 100%;">Set Model</button> + </div> + <hr style="border-color:var(--border-color); margin: 15px 0;"> + <h4 style="color: var(--accent-color); margin-bottom: 10px;">⚡ AI Agent Optimization</h4> + <div style="display:flex; align-items:center; gap:10px; margin-bottom: 12px;"> + <span style="color:var(--text-muted); font-size:0.85em;">Agent Loop Optimizations:</span> + <label style="position:relative; display:inline-block; width:48px; height:26px;"> + <input type="checkbox" id="ollama-optimization-toggle" onchange="webx11.toggleOptimization()" style="opacity:0; width:0; height:0;"> + <span id="ollama-optimization-slider" style="position:absolute; cursor:pointer; inset:0; background:var(--bg-tertiary); border:1px solid var(--border-color); border-radius:26px; transition:0.3s;"></span> + </label> + <span id="ollama-optimization-label" style="font-size:0.85em; color:var(--success-color);">Enabled</span> + </div> + <div style="font-size:0.8em; color:var(--text-muted); margin-bottom: 10px;"> + ⚡ Tool def caching, trivial query skip, parallel safe tools, debounced reflection<br> + <span style="color:var(--warning-color);">Disable for debugging or if model behaves unexpectedly. Reload after toggle.</span> + </div> + <hr style="border-color:var(--border-color); margin: 15px 0;"> + <h4 style="color: var(--accent-color); margin-bottom: 10px;">⚡ Response Streaming</h4> + <div style="display:flex; align-items:center; gap:10px; margin-bottom: 6px;"> + <span style="color:var(--text-muted); font-size:0.85em;">Stream Tokens:</span> + <label style="position:relative; display:inline-block; width:48px; height:26px;"> + <input type="checkbox" id="ollama-stream-toggle" onchange="webx11.toggleStream()" style="opacity:0; width:0; height:0;"> + <span id="ollama-stream-slider" style="position:absolute; cursor:pointer; inset:0; background:var(--bg-tertiary); border:1px solid var(--border-color); border-radius:26px; transition:0.3s;"></span> + </label> + <span id="ollama-stream-label" style="font-size:0.85em; color:var(--success-color);">Enabled</span> + </div> + <div style="font-size:0.8em; color:var(--text-muted); margin-bottom: 10px;"> + Show AI responses token-by-token. Disable for instant full responses and reduced crash risk.<br> + <span style="color:var(--warning-color);">Disable on slow connections or when browser becomes unresponsive during long outputs.</span> + </div> + <hr style="border-color:var(--border-color); margin: 15px 0;"> + <h4 style="color: var(--info-color); margin-bottom: 10px;">🔍 Validator Agent</h4> + <div style="font-size:0.85em; color:var(--text-muted); margin-bottom: 10px;"> + A separate lightweight AI that validates the main agent's tool results. Has its own + endpoint and model — independent from your active AI model.<br> + <span style="color:var(--success-color);">⚡ Best validator model: <strong>qwen2.5:0.5b</strong> (1.94s, 352MB)</span> + </div> + <div style="display:flex; align-items:center; gap:10px; margin-bottom: 10px;"> + <span style="color:var(--text-muted); font-size:0.85em;">Enable Validator:</span> + <label style="position:relative; display:inline-block; width:48px; height:26px;"> + <input type="checkbox" id="ollama-validator-toggle" onchange="webx11.toggleValidator()" style="opacity:0; width:0; height:0;"> + <span id="ollama-validator-slider" style="position:absolute; cursor:pointer; inset:0; background:var(--bg-tertiary); border:1px solid var(--border-color); border-radius:26px; transition:0.3s;"></span> + </label> + <span id="ollama-validator-label" style="font-size:0.85em; color:var(--text-muted);">Disabled</span> + </div> + <div style="margin-bottom: 8px;"> + <label style="display: block; margin-bottom: 3px; color: var(--text-muted); font-size:0.85em;">Validator Endpoint:</label> + <input type="text" id="validator-endpoint-input" class="module-url-input" value="http://localhost:11434" placeholder="http://localhost:11434" style="margin-bottom:6px;"> + <button class="btn" onclick="webx11.connectValidatorEndpoint()" style="width:100%; border-color:var(--info-color); color:var(--info-color);">🔌 Connect & Load Models</button> + <div id="validator-connection-status" style="font-size:0.8em; margin-top:4px;"></div> + </div> + <div style="margin-bottom: 10px;"> + <label style="display: block; margin-bottom: 3px; color: var(--text-muted); font-size:0.85em;">Validator Model:</label> + <select id="validator-model-select" class="module-url-input" style="margin-bottom:6px;" disabled> + <option value="">Connect to load models</option> + </select> + <button class="btn" onclick="webx11.saveValidatorConfig()" style="width:100%; border-color:var(--info-color); color:var(--info-color);">Save Validator Config</button> + </div> + <div style="font-size:0.8em; color:var(--warning-color); border:1px solid var(--border-color); border-radius:4px; padding:10px; margin-top:10px;"> + <strong>⚠️ Connection Notes</strong><br> + • Cloud models (deepseek-v4*, gemma4:*b-cloud) via Ollama proxy often <strong>ignore tool calls</strong> + and answer from training data instead. Use local models for tool calling.<br> + • To connect to local Ollama from a web page: set <code>OLLAMA_ORIGINS</code> on the server: + <code>export OLLAMA_ORIGINS="https://webx11.duckdns.org"</code> then restart Ollama.<br> + • Test local connection: open a terminal and run <code>curl http://localhost:11434/api/tags</code><br> + • If you see <strong>403</strong> errors in console: the <code>OLLAMA_ORIGINS</code> env var isn't matching your page URL. + </div> + </div> + <div class="modal-footer"> + <button class="btn" onclick="webx11.closeOllamaManager()">Close</button> + </div> + </div> + </div> + + <!-- Splash Screen --> + <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"></div> + <div id="splash-progress-track"><div id="splash-progress-fill"></div></div> + <div id="splash-phase">Initializing...</div> + <div id="splash-filename"></div> + <div><span id="splash-cursor"></span></div> + <div id="splash-error"></div> + </div> + + <!-- Skills Manager Modal --> + <div id="skills-manager" class="modal-overlay"> + <div class="modal-content" style="max-width: 750px; max-height: 90vh;"> + <div class="modal-header"> + <span>📚 Skills Manager</span> + <span style="cursor:pointer" onclick="webx11.closeSkillsManager()">✕</span> + </div> + <div class="modal-body" style="display:flex; flex-direction:column; gap:8px;"> + <!-- Stats header --> + <div id="skills-stats" style="display:flex; gap:12px; flex-wrap:wrap; font-size:0.85em; color:var(--text-muted); padding-bottom:6px; border-bottom:1px solid var(--border-color);"></div> + <!-- Search + action bar --> + <div style="display:flex; gap:6px; align-items:center; flex-shrink:0;"> + <input type="text" id="skills-search-input" class="module-url-input" placeholder="🔍 Search skills..." style="flex:1;" oninput="webx11.refreshSkillsList()"> + <button class="btn" onclick="webx11.exportAllSkillsUI()" style="padding:4px 10px; font-size:0.8em">📤 Export All</button> + <button class="btn" onclick="document.getElementById('skills-import-input').click()" style="padding:4px 10px; font-size:0.8em">📥 Import</button> + <input type="file" id="skills-import-input" accept=".json" style="display:none" onchange="webx11.importSkillsUI(event)"> + <button class="btn" onclick="webx11.syncSkillsToWebdavUI()" style="padding:4px 10px; font-size:0.8em">☁️ Sync</button> + </div> + <!-- Skills list with category groups --> + <div id="skills-list" style="max-height:300px;overflow-y:auto; flex-shrink:0;"></div> + <!-- Preview (collapsible) --> + <div id="skill-preview" style="display:none; flex-shrink:0; background:var(--bg-tertiary); border:1px solid var(--border-color); border-radius:4px; padding:10px; overflow-y:auto; white-space:pre-wrap; font-family:var(--font-primary); font-size:0.85em; color:var(--text-color);"> + <div style="display:flex; justify-content:space-between; margin-bottom:6px;"> + <span id="skill-preview-title" style="color:var(--success-color); font-weight:bold;"></span> + <div style="display:flex; gap:6px;"> + <button class="btn" id="skill-preview-expand-btn" onclick="webx11.toggleSkillPreviewSize()" style="padding:2px 6px; font-size:0.75em">⛶ Expand</button> + <span style="cursor:pointer; color:var(--text-muted); font-size:1.2em;" onclick="webx11.closeSkillPreview()">✕</span> + </div> + </div> + <div id="skill-preview-content"></div> + </div> + <!-- Create form --> + <div style="flex-shrink:0; border-top:1px solid var(--border-color); padding-top:8px;"> + <h4 style="color: var(--info-color); margin-bottom: 6px;">Create New Skill</h4> + <div style="display:flex; gap:6px; flex-wrap:wrap;"> + <input type="text" id="skill-name-input" class="module-url-input" placeholder="Name (kebab-case)" style="flex:2; min-width:140px;"> + <input type="text" id="skill-desc-input" class="module-url-input" placeholder="Description" style="flex:3; min-width:180px;"> + <select id="skill-category-input" class="module-url-input" style="flex:1; min-width:100px;"> + <option value="general">general</option> + <option value="system">system</option> + <option value="research">research</option> + <option value="dev">dev</option> + <option value="productivity">productivity</option> + <option value="ui">ui</option> + <option value="security">security</option> + </select> + </div> + <div style="display:flex; gap:6px; margin-top:6px;"> + <input type="text" id="skill-tags-input" class="module-url-input" placeholder="Tags (comma-separated)" style="flex:1;"> + <button class="btn" onclick="webx11.createSkillFromUI()" style="border-color:var(--success-color);color:var(--success-color); flex-shrink:0;">Create</button> + </div> + <textarea id="skill-content-input" class="module-url-input" style="margin-top:6px; height:80px; resize:vertical; font-family:var(--font-primary)" placeholder="Markdown content (optional — will use template)"></textarea> + </div> + </div> + <div class="modal-footer"> + <button class="btn" onclick="webx11.refreshSkillsList()">🔄 Refresh</button> + <button class="btn" onclick="webx11.closeSkillsManager()">Close</button> + </div> + </div> + </div> + + <!-- Preview Modal --> + <div id="preview-modal" class="modal-overlay"> + <div class="modal-content" style="max-width: 95%; max-height: 90vh; width: 95%;"> + <div class="modal-header"> + <span id="preview-title">📄 Preview</span> + <span style="display:flex;gap:10px;align-items:center"> + <button class="btn btn-sm" onclick="var f=document.getElementById('preview-iframe');if(f&&f.srcdoc){var w=window.open('','_blank');if(w){w.document.open();w.document.write(f.srcdoc);w.document.close();}}" title="Open in new tab">⛶</button> + <span style="cursor:pointer" onclick="webx11.closePreview()">✕</span> + </span> + </div> + <div class="modal-body" style="padding:0; overflow:hidden; height:75vh;"> + <iframe id="preview-iframe" style="width:100%; height:100%; border:none; background:var(--bg-color);" sandbox="allow-same-origin allow-scripts"></iframe> + </div> + <div class="modal-footer"> + <button class="btn" onclick="webx11.closePreview()">Close</button> + </div> + </div> + </div> + + <!-- Config Manager Modal --> + <div id="config-manager" class="modal-overlay"> + <div class="modal-content" style="max-width: 550px; max-height: 80vh;"> + <div class="modal-header"> + <span>⚙ Configuration</span> + <span style="cursor:pointer" onclick="webx11.closeConfigManager()">✕</span> + </div> + <div class="modal-body" id="config-manager-body"> + <div id="config-list" style="margin-bottom:16px;"></div> + <div style="border-top:1px solid var(--border-color); padding-top:12px;"> + <h4 style="color:var(--info-color); margin-bottom:8px;">Add / Update Config</h4> + <div style="display:flex; gap:6px; flex-wrap:wrap;"> + <input type="text" id="config-key-input" class="module-url-input" placeholder="Key" style="flex:1; min-width:100px;"> + <input type="text" id="config-value-input" class="module-url-input" placeholder="Value" style="flex:3; min-width:150px;"> + <button class="btn" onclick="webx11.addConfigFromUI()" style="border-color:var(--success-color);color:var(--success-color); padding:6px 14px;">Add</button> + </div> + </div> + </div> + <div class="modal-footer"> + <button class="btn" onclick="webx11.exportConfigFromUI()">📤 Export</button> + <button class="btn btn-danger" onclick="webx11.resetConfigFromUI()">🗑 Reset All</button> + <button class="btn" onclick="webx11.closeConfigManager()">Close</button> + </div> + </div> + </div> + + <!-- Welcome Tour Modal --> + <div id="welcome-modal" class="modal-overlay"> + <div class="modal-content" style="max-width:500px;text-align:center;"> + <div class="modal-header"> + <span>🚀 Welcome to newOS4</span> + </div> + <div class="modal-body" style="padding:24px;"> + <div style="font-size:3em;margin-bottom:12px;">🖥️</div> + <h2 style="margin:0 0 8px;color:var(--accent-color);">Let's Get Started</h2> + <p style="color:var(--text-muted);margin-bottom:16px;line-height:1.6;"> + newOS4 is a terminal-centric browser OS with AI, filesystem, and modules. + Take the <strong>2-minute guided tour</strong> to learn the basics. + </p> + <div style="display:flex;gap:12px;justify-content:center;flex-wrap:wrap;"> + <button class="btn" onclick="var m=document.getElementById('welcome-modal');if(m)m.style.display='none';if(webx11&&webx11.tutorialModule)webx11.tutorialModule.startTutorial()" + style="border-color:var(--success-color);color:var(--success-color);padding:12px 28px;font-size:1em;"> + 🎮 Start Tutorial + </button> + <button class="btn" onclick="var m=document.getElementById('welcome-modal');if(m)m.style.display='none';location.href='course.html'" + style="border-color:var(--info-color);color:var(--info-color);padding:12px 28px;font-size:1em;"> + 📚 Full Course + </button> + <button class="btn" onclick="if(webx11)webx11.dismissWelcome()" + style="border-color:var(--text-muted);color:var(--text-muted);padding:12px 28px;font-size:1em;"> + Skip — I'll explore + </button> + </div> + <label style="display:flex;align-items:center;justify-content:center;gap:6px;margin-top:14px;font-size:0.78em;color:var(--text-muted);cursor:pointer;"> + <input type="checkbox" id="welcome-dont-show" onchange="if(this.checked)localStorage.setItem('webx11_welcome_dismissed','1');else localStorage.removeItem('webx11_welcome_dismissed')"> + Don't show this again + </label> + <p style="font-size:0.78em;color:var(--text-muted);margin-top:16px;"> + Your progress is saved. Type <code>tutorial</code> anytime to resume. + </p> + </div> + </div> + </div> + + <!-- Startup Modules Modal --> + <div id="startup-modules" class="modal-overlay"> + <div class="modal-content" style="max-width: 500px;"> + <div class="modal-header"> + <span>⚙ Startup Modules</span> + <span style="cursor:pointer" onclick="var w=window.webx11;if(w&&typeof w.closeStartupModules==='function')w.closeStartupModules();else document.getElementById('startup-modules').style.display='none'">✕</span> + </div> + <div class="modal-body" id="startup-modules-body"></div> + <div class="modal-footer"> + <button class="btn btn-danger" onclick="webx11.closeStartupModules()">Cancel</button> + <button class="btn" onclick="webx11.saveStartupModules()" style="border-color:var(--info-color);color:var(--info-color)">Save & Reload</button> + </div> + </div> + </div> + + <!-- Code Editor Modal --> + <div id="code-editor" class="modal-overlay"> + <div class="modal-content" style="max-width: 90vw; max-height: 90vh; width: 900px; height: 80vh;"> + <div class="modal-header"> + <span id="code-editor-title">📝 Edit Module</span> + <span style="cursor:pointer" onclick="if(webx11) webx11.closeCodeEditor()">✕</span> + </div> + <div class="modal-body" style="padding:0; display:flex; flex-direction:column; height:calc(100% - 100px);"> + <div id="code-editor-info" style="padding:6px 10px; font-size:0.8em; color:var(--text-muted); border-bottom:1px solid var(--border-color); flex-shrink:0; display:flex; justify-content:space-between; align-items:center;"> + <span id="code-editor-status">Ready</span> + <span><button class="btn" style="font-size:0.7em;padding:2px 8px" onclick="window._editorToggleFullscreen()">⤢ Fullscreen</button></span> + </div> + <div id="code-editor-wrapper" style="flex:1; display:flex; overflow:hidden; position:relative;"> + <div id="code-editor-gutter" style="flex-shrink:0; width:40px; background:var(--bg-secondary); color:var(--text-muted); font-family:monospace; font-size:13px; line-height:20px; padding:10px 4px; text-align:right; overflow:hidden; user-select:none; border-right:1px solid var(--border-color);"></div> + <textarea id="code-editor-textarea" style="flex:1; border:none; background:var(--bg-tertiary); color:var(--text-color); font-family:monospace; font-size:13px; line-height:20px; padding:10px; resize:none; outline:none; tab-size:2; white-space:pre; overflow:auto; display:block;" spellcheck="false"></textarea> + </div> + </div> + <div class="modal-footer"> + <button class="btn btn-danger" onclick="if(webx11) webx11.closeCodeEditor()">Cancel</button> + <button class="btn" onclick="(async()=>{if(webx11)await webx11.saveCodeEditor()})()" style="border-color:var(--info-color);color:var(--info-color)">💾 Save & Test</button> + </div> + </div> + </div> + + <input type="file" id="file-upload-input" style="display:none"> + + + <!-- Gear splash function — works before webx11 initializes --> + <script> + function openStartupModulesSplash(event) { + event.stopPropagation(); + var w = window.webx11; + if (w && typeof w.openStartupModules === 'function') { + w.openStartupModules(); + } else { + var overlay = document.getElementById('startup-modules'); + if (!overlay) return; + // Bare-bones render for when webx11 isn't ready yet + var body = document.getElementById('startup-modules-body'); + if (body && !body.children.length) { + var mods = [ + ['Foundation (always loaded)', ['virtual-fs.js','module-manager.js','ollama-manager.js','terminal.js'], true], + ['Built-in modules', ['module-system.js','module-fs.js','module-ollama.js','module-my.js','module-searxng.js','module-servermon.js','module-ollamamodels.js','module-config.js','module-simplegui.js','module-io.js','module-dynamicprompts.js','module-aiassist.js','module-aiasm.js','module-smartctx.js','module-duckduckgo.js','module-fetcher.js','module-chatstudio.js'], false], + ['Extensions', ['calc.js','voice.js','cron.js','theme.js','wpm.js','mindmap.js','webdav.js','skill-pack-core.js','editor.js','diff.js','alias.js','finder.js','filemgr.js','cryptogzip.js','tutorial.js','shell.js','busybox.js','floating.js','console.js','kanban.js','course.js'], false] + ]; + var isSel = function(name) { return true; }; // default: all selected + mods.forEach(function(section) { + var h = document.createElement('div'); + h.className = 'mod-section-header'; + h.textContent = section[0]; + body.appendChild(h); + section[1].forEach(function(name) { + var card = document.createElement('div'); + card.className = 'mod-card' + (section[2] ? ' disabled' : ''); + var label = document.createElement('label'); + var cb = document.createElement('input'); + cb.type = 'checkbox'; + cb.checked = section[2] || isSel(name); + cb.disabled = section[2]; + cb.dataset.name = name; + var nameSpan = document.createElement('span'); + nameSpan.className = 'mod-name'; + nameSpan.textContent = name; + var badgeSpan = document.createElement('span'); + badgeSpan.className = 'mod-badge' + (section[2] ? ' foundation' : ''); + badgeSpan.textContent = section[2] ? 'foundation' : 'built-in'; + label.appendChild(cb); + label.appendChild(nameSpan); + card.appendChild(label); + card.appendChild(badgeSpan); + body.appendChild(card); + }); + }); + } + overlay.style.display = 'flex'; + } + } + </script> + + <!-- v4.5.63: A2A scratchpad fixes + agent-register arg fix --> +<script src="modules/core/core-bundle.js?v=v4.6.51"></script> + + <!-- Async dependency-ordered module loader now only initializes terminal and loads optional ext modules --> +<script src="modules/core/module-loader.js?v=v4.6.51"></script> + + <!-- Critical ext bundle loads AFTER webx11 exists so registerModule calls work --> +<script src="modules/ext/critical-ext-bundle.js?v=v4.6.51"></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=([v\d\.]+)/); + if (m) { version = 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> + +<!-- Phase 6: Boot Watchdog — auto-revert if recent commit broke the system --> +<script> +(function() { + // Wait for modules to load, then check health + var watchdogTimer = null; + var watchdogStarted = false; + + function checkBoot() { + if (watchdogStarted) return; + watchdogStarted = true; + + // Check if core modules loaded + if (typeof webx11 === 'undefined' || !webx11.moduleManager) { + // Critical: webx11 object doesn't exist — system is broken + handleBootFailure('webx11 object not found'); + return; + } + + var mm = webx11.moduleManager; + var loadedModules = Object.keys(mm.modules).length; + + // If less than 50% of expected modules loaded, boot failed + // Expected: ~19 modules at full load + if (loadedModules < 10) { + handleBootFailure('Only ' + loadedModules + ' modules loaded (expected ≥10)'); + return; + } + + // Boot OK — save current state as last-good + try { + var lastGood = { + version: window.NEWOS4_VERSION || 'unknown', + moduleCount: loadedModules, + timestamp: Date.now() + }; + localStorage.setItem('newos4_last_good_boot', JSON.stringify(lastGood)); + } catch (e) {} + } + + function handleBootFailure(reason) { + console.error('[Boot Watchdog] Boot failure detected: ' + reason); + + // Check if there was a recent commit (within last 30 min) + var commitLog = null; + try { + // Check localStorage for recent commit info + var lastCommit = localStorage.getItem('newos4_last_commit'); + if (lastCommit) { + var commit = JSON.parse(lastCommit); + if (commit && commit.timestamp && (Date.now() - commit.timestamp < 1800000)) { + console.warn('[Boot Watchdog] Recent commit detected (version ' + commit.version + '), attempting auto-revert...'); + attemptRevert(commit); + return; + } + } + } catch (e) {} + + // No recent commit or no revert info — just alert + console.error('[Boot Watchdog] No recent commit to revert. System may need manual intervention.'); + var banner = document.createElement('div'); + banner.style.cssText = 'position:fixed;top:0;left:0;right:0;background:#ff4444;color:#fff;padding:10px;font-family:monospace;font-size:12px;z-index:99999;text-align:center;'; + banner.textContent = '⚠️ Boot Watchdog: System failed to load (' + reason + '). Try hard refresh or clear localStorage.'; + document.body.insertBefore(banner, document.body.firstChild); + } + + function attemptRevert(commit) { + // Try to restore the previous version by setting the version back + if (commit.previousVersion) { + console.warn('[Boot Watchdog] Reverting to version ' + commit.previousVersion); + // Replace all ?v= in script tags with previous version + var scripts = document.getElementsByTagName('script'); + var reverted = 0; + for (var i = 0; i < scripts.length; i++) { + var src = scripts[i].src || ''; + if (src.indexOf('?v=') !== -1) { + scripts[i].src = src.replace(/\?v=[^&"']*/, '?v=' + commit.previousVersion); + reverted++; + } + } + console.log('[Boot Watchdog] Reverted ' + reverted + ' script tags to ' + commit.previousVersion); + + // Show warning banner + var banner = document.createElement('div'); + banner.style.cssText = 'position:fixed;top:0;left:0;right:0;background:#ffaa00;color:#000;padding:10px;font-family:monospace;font-size:12px;z-index:99999;text-align:center;'; + banner.textContent = '⚠️ Boot Watchdog: Auto-reverted from ' + commit.version + ' to ' + commit.previousVersion + '. Refresh page to load reverted version.'; + document.body.insertBefore(banner, document.body.firstChild); + + // Force reload after 3 seconds + setTimeout(function() { + // Update URL with previous version to force cache bypass + window.location.href = window.location.pathname + '?v=' + commit.previousVersion + '&watchdog=1'; + }, 3000); + } else { + console.error('[Boot Watchdog] No previous version stored. Manual intervention required.'); + } + } + + // Start watchdog after a delay to allow modules to load + watchdogTimer = setTimeout(checkBoot, 8000); +})(); +</script> + +</body> +</html> |