Files
Z.AI-Chat-for-Android/www/index.html
admin 5125725ea7 v3.3.0: File Manager, SSH/Remote access, Approval gate
- File Manager: browse device files, open/preview, install APKs
- SSH/Remote: [SSH_EXEC], [SSH_UPLOAD], [SSH_DOWNLOAD], [REMOTE_EXEC], [CURL_EXEC]
- Approval gate: all sensitive actions require user approval
- New FileManagerPlugin native plugin
- Updated agentic system prompt with external access docs
- Cleaned up stale .idsig artifacts from releases/
2026-05-21 17:42:22 +04:00

650 lines
45 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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="#1a1a2e">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<title>Z.AI Chat</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div id="app">
<div id="setup-screen" class="screen active">
<div class="setup-container">
<div class="logo-area">
<div class="logo-icon">Z</div>
<h1>Z.AI Chat</h1>
<p class="subtitle">GLM Coding Plan &middot; Powered by GLM-5.1</p>
</div>
<div class="setup-form">
<div class="input-group">
<label for="api-token">Coding Plan Token</label>
<input type="password" id="api-token" placeholder="Enter your Z.AI coding plan API key" autocomplete="off">
<span class="input-hint">Get your key at <a href="https://z.ai/manage-apikey/apikey-list" target="_blank">z.ai/apikeys</a> &middot; <a href="https://z.ai/subscribe" target="_blank">Subscribe</a></span>
</div>
<div class="input-group">
<label for="base-url">Endpoint</label>
<select id="base-url">
<option value="https://api.z.ai/api/coding/paas/v4" selected>Coding Plan (api.z.ai/coding)</option>
<option value="https://api.z.ai/api/paas/v4">General API (api.z.ai)</option>
<option value="https://open.bigmodel.cn/api/paas/v4">China (bigmodel.cn)</option>
</select>
</div>
<button id="connect-btn" class="btn-primary">
<span class="btn-text">Connect</span>
<span class="btn-loader" style="display:none"></span>
</button>
<div id="setup-error" class="error-msg" style="display:none"></div>
</div>
<div class="setup-modes">
<h3>Modes Available</h3>
<div class="mode-cards">
<div class="mode-card">
<span class="mode-icon">&#128172;</span>
<span class="mode-name">Chat</span>
<span class="mode-desc">General conversation</span>
</div>
<div class="mode-card">
<span class="mode-icon">&#128187;</span>
<span class="mode-name">Coding</span>
<span class="mode-desc">Code assistant</span>
</div>
<div class="mode-card">
<span class="mode-icon">&#128161;</span>
<span class="mode-name">Brainstorm</span>
<span class="mode-desc">Ideation partner</span>
</div>
<div class="mode-card">
<span class="mode-icon">&#129302;</span>
<span class="mode-name">Agentic</span>
<span class="mode-desc">Autonomous coding</span>
</div>
</div>
</div>
</div>
</div>
<div id="chat-screen" class="screen">
<div class="chat-header">
<div class="header-left">
<button id="menu-btn" class="icon-btn" aria-label="Open sidebar menu">&#9776;</button>
<div class="header-title">
<h2 id="conversation-title">New Chat</h2>
<span id="current-mode-label" class="mode-label">Chat</span>
</div>
</div>
<div class="header-right">
<button id="file-tree-btn" class="icon-btn" title="Project Files" aria-label="Open project files" style="display:none">&#128193;</button>
<button id="theme-toggle-header" class="theme-toggle-btn" title="Toggle theme" aria-label="Toggle theme">&#9790;</button>
<button id="new-chat-btn" class="icon-btn" title="New chat" aria-label="Start new chat">+</button>
<button id="settings-btn" class="icon-btn" title="Settings" aria-label="Open settings">&#9881;</button>
</div>
</div>
<div id="sidebar" class="sidebar">
<div class="sidebar-header">
<h3>Conversations</h3>
<button id="sidebar-close" class="icon-btn" aria-label="Close sidebar">&times;</button>
</div>
<div id="conversation-list" class="conversation-list"></div>
<div class="sidebar-footer">
<button id="new-chat-sidebar" class="btn-secondary">+ New Chat</button>
</div>
</div>
<div id="sidebar-overlay" class="sidebar-overlay"></div>
<div id="file-tree-panel" class="file-tree-panel">
<div class="file-tree-header">
<h3>Project Files</h3>
<div style="display:flex;gap:8px;align-items:center;">
<button id="device-files-btn" class="icon-btn" aria-label="Open device files" title="Device files">&#128193;</button>
<button id="file-tree-close" class="icon-btn" aria-label="Close file tree">&times;</button>
</div>
</div>
<div id="file-tree-body" class="file-tree-body">
<div class="ftree-empty">No files yet.<br>AI-generated files appear here.</div>
</div>
<div class="file-tree-footer">
<span id="file-tree-count">0 files</span>
</div>
</div>
<div id="file-tree-overlay" class="file-tree-overlay"></div>
<div id="file-viewer" class="file-viewer">
<div class="file-viewer-header">
<div class="file-viewer-title">
<span id="file-viewer-name">file</span>
<span id="file-viewer-lang" class="fv-lang"></span>
</div>
<div class="file-viewer-actions">
<button id="file-viewer-edit" class="fv-btn">Edit</button>
<button id="file-viewer-save" class="fv-btn fv-btn-save" style="display:none">Save</button>
<button id="file-viewer-close" class="icon-btn" aria-label="Close file viewer">&times;</button>
</div>
</div>
<div id="file-viewer-body" class="file-viewer-body">
<pre id="file-viewer-content"></pre>
</div>
<div id="file-viewer-editor" class="file-viewer-editor" style="display:none">
<textarea id="file-viewer-textarea"></textarea>
</div>
</div>
<div id="messages" class="messages"></div>
<div id="terminal-panel" class="terminal-panel">
<div class="terminal-header">
<span class="terminal-title">&#9632; Terminal</span>
<span class="terminal-info" id="terminal-info"></span>
</div>
<div id="terminal-body" class="terminal-body"></div>
</div>
<button id="terminal-toggle" class="terminal-toggle-btn" style="display:none">
<span class="terminal-icon">&#9654;</span>
<span class="terminal-label">Show Terminal</span>
</button>
<div class="chat-input-area">
<div id="mode-selector" class="mode-selector">
<button class="mode-btn active" data-mode="chat">Chat</button>
<button class="mode-btn" data-mode="coding">Coding</button>
<button class="mode-btn" data-mode="brainstorm">Brainstorm</button>
<button class="mode-btn" data-mode="agentic">Agentic</button>
<button class="mode-btn mode-btn-term" data-mode="terminal" style="background:var(--success);border-color:var(--success);color:white">&#9642; Term</button>
</div>
<div class="input-row">
<textarea id="message-input" placeholder="Type your message..." rows="1"></textarea>
<button id="send-btn" class="send-btn" aria-label="Send message" disabled>
<svg viewBox="0 0 24 24" width="24" height="24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" fill="currentColor"/></svg>
</button>
<button id="stop-btn" class="stop-btn" aria-label="Stop generation" style="display:none">
<svg viewBox="0 0 24 24" width="24" height="24"><rect x="6" y="6" width="12" height="12" fill="currentColor" rx="2"/></svg>
</button>
</div>
</div>
</div>
<div id="terminal-screen" class="screen">
<div class="term-screen-container">
<div class="term-screen-header">
<button id="term-back-btn" class="icon-btn" aria-label="Back to chat">&larr;</button>
<h2>Terminal</h2>
<div class="term-screen-header-right">
<span id="term-cwd-display" class="term-cwd-display">~</span>
<button id="term-setup-tools-btn" class="icon-btn" title="Setup Dev Tools" aria-label="Setup development tools">&#128736;</button>
</div>
</div>
<div id="term-output" class="term-output"></div>
<div class="term-input-area">
<div class="term-quick-actions">
<button class="term-quick-btn" data-cmd="ls -la">ls</button>
<button class="term-quick-btn" data-cmd="pwd">pwd</button>
<button class="term-quick-btn" data-cmd="cat ">cat</button>
<button class="term-quick-btn" data-cmd="mkdir -p ">mkdir</button>
<button class="term-quick-btn" data-cmd="which aapt2 java ecj d8 2>/dev/null">tools</button>
<button class="term-quick-btn" data-cmd="df -h . && free -h 2>/dev/null">sys</button>
</div>
<div class="term-input-row">
<span class="term-prompt">$</span>
<input type="text" id="term-input" class="term-input" placeholder="Enter command..." autocomplete="off" spellcheck="false">
<button id="term-run-btn" class="term-run-btn" aria-label="Run terminal command">&#9654;</button>
<button id="term-stop-btn" class="term-stop-btn" aria-label="Stop terminal command" style="display:none">&#9632;</button>
</div>
</div>
</div>
</div>
<div id="devsetup-screen" class="screen">
<div class="setup-container">
<div class="logo-area">
<div class="logo-icon" style="background:linear-gradient(135deg, #2ed573, #6c63ff)">&#128736;</div>
<h1>Dev Environment</h1>
<p class="subtitle">Set up on-device build tools</p>
</div>
<div id="devsetup-status" class="devsetup-status">
<p>Downloads and sets up a complete <strong>Termux Linux environment</strong> inside the app.</p>
<p>No external apps needed — bash, coreutils, package manager all included.</p>
<p>Download size: ~30MB (one-time). Architecture auto-detected.</p>
<p>After install, use <code>pkg install aapt2 ecj dx apksigner</code> to add build tools.</p>
</div>
<div id="devsetup-progress" style="display:none">
<div class="devsetup-progress-bar">
<div id="devsetup-progress-fill" class="devsetup-progress-fill"></div>
</div>
<p id="devsetup-progress-text" class="devsetup-progress-text">Preparing...</p>
</div>
<button id="devsetup-install-btn" class="btn-primary">
<span class="btn-text">Install Dev Tools</span>
<span class="btn-loader" style="display:none"></span>
</button>
<div style="margin-top:20px; border-top:1px solid var(--border); padding-top:16px;">
<h3 style="margin-bottom:8px;">AutoGLM Device Control</h3>
<p style="font-size:13px; color:var(--text-secondary); margin-bottom:8px;">Enable accessibility service to allow AI to control your device (tap, swipe, type, read screen).</p>
<div id="autoglm-status" style="font-size:13px; margin-bottom:8px;"></div>
<button id="autoglm-enable-btn" class="btn-secondary" style="width:100%">Enable Device Control</button>
</div>
<div style="margin-top:16px; border-top:1px solid var(--border); padding-top:16px;">
<h3 style="margin-bottom:8px;">Hermes Agent</h3>
<p style="font-size:13px; color:var(--text-secondary); margin-bottom:8px;">Install Hermes agent for advanced AI capabilities: web search, terminal, skills, memory, browser automation.</p>
<button id="hermes-install-btn" class="btn-secondary" style="width:100%">Install Hermes</button>
</div>
<button id="devsetup-back-btn" class="btn-secondary" style="margin-top:12px">Back to Terminal</button>
</div>
</div>
<div id="settings-screen" class="screen">
<div class="settings-container">
<div class="settings-header">
<button id="settings-back" class="icon-btn" aria-label="Back to chat">&larr;</button>
<h2>Settings</h2>
</div>
<div class="settings-body">
<div class="settings-section">
<h3>API Configuration</h3>
<div class="input-group">
<label for="settings-token">API Token</label>
<input type="password" id="settings-token" placeholder="Your API token">
</div>
<div class="input-group">
<label for="settings-url">Base URL</label>
<input type="text" id="settings-url" placeholder="https://api.z.ai/api/coding/paas/v4">
</div>
</div>
<div class="settings-section">
<h3>Model Settings</h3>
<div class="input-group">
<label for="settings-model">Model</label>
<select id="settings-model">
<option value="glm-5.1" selected>GLM-5.1 (Flagship)</option>
<option value="glm-5-turbo">GLM-5 Turbo</option>
<option value="glm-4.7">GLM-4.7</option>
<option value="glm-4.5-air">GLM-4.5 Air (Fast)</option>
<option value="glm-5v-turbo">GLM-5V Turbo (Vision)</option>
</select>
</div>
<div class="input-group">
<label>Temperature: <span id="temp-value">0.7</span></label>
<input type="range" id="settings-temp" min="0" max="1" step="0.1" value="0.7">
</div>
<div class="input-group">
<label>Max Tokens: <span id="tokens-value">4096</span></label>
<input type="range" id="settings-tokens" min="256" max="16384" step="256" value="4096">
</div>
<div class="input-group toggle-group">
<label>Web Search</label>
<label class="toggle">
<input type="checkbox" id="settings-websearch">
<span class="toggle-slider"></span>
</label>
</div>
<div class="input-group toggle-group">
<label>Streaming</label>
<label class="toggle">
<input type="checkbox" id="settings-streaming" checked>
<span class="toggle-slider"></span>
</label>
</div>
</div>
<div class="settings-section">
<h3>Terminal &amp; Agent</h3>
<div class="input-group toggle-group">
<label>Auto-Deploy Files</label>
<label class="toggle">
<input type="checkbox" id="settings-autodeploy" checked>
<span class="toggle-slider"></span>
</label>
</div>
<span class="input-hint">AI-generated code auto-deploys to device in Coding/Agentic modes</span>
<div class="input-group toggle-group" style="margin-top:12px">
<label>Keep Screen On</label>
<label class="toggle">
<input type="checkbox" id="settings-keepawake">
<span class="toggle-slider"></span>
</label>
</div>
<span class="input-hint">Prevents screen sleep while agent is working</span>
<div class="input-group" style="margin-top:12px">
<label>Max Auto-Fix Retries: <span id="retries-value">10</span></label>
<input type="range" id="settings-maxretries" min="1" max="30" step="1" value="10">
</div>
<span class="input-hint">How many times AI will auto-retry after build failures</span>
<div class="input-group toggle-group" style="margin-top:12px">
<label>Auto-Continue</label>
<label class="toggle">
<input type="checkbox" id="settings-autocontinue" checked>
<span class="toggle-slider"></span>
</label>
</div>
<span class="input-hint">Auto-continues AI if task is incomplete or response cut off</span>
<div class="input-group" style="margin-top:12px">
<label>Max Auto-Continues: <span id="autocont-value">5</span></label>
<input type="range" id="settings-maxautocontinue" min="1" max="20" step="1" value="5">
</div>
<span class="input-hint">Max times AI will be asked to continue incomplete work</span>
</div>
<div class="settings-section">
<h3>Appearance</h3>
<div class="input-group toggle-group">
<label>Dark Mode</label>
<label class="toggle">
<input type="checkbox" id="settings-darkmode" checked>
<span class="toggle-slider"></span>
</label>
</div>
</div>
<div class="settings-section">
<h3>Data</h3>
<button id="export-btn" class="btn-secondary">Export Conversations</button>
<button id="clear-btn" class="btn-danger">Clear All Data</button>
</div>
<div class="settings-section">
<h3>About</h3>
<p class="about-text">Z.AI Chat v3.3.0</p>
<p class="about-text">Built with Z.AI SDK &amp; GLM-5.1</p>
<p class="about-text">Compatible with Android 15/16</p>
</div>
<div class="settings-section">
<h3>Changelog</h3>
<ul class="changelog-list">
<li>
<span class="changelog-version">v3.3.0</span>
<span class="changelog-date">2026-05-21</span>
<ul>
<li><strong>File Manager</strong> — browse device files, open/preview any file, install APKs directly</li>
<li><strong>SSH / Remote Access</strong> — AI can SSH into external machines, SCP files, curl URLs (user approves each)</li>
<li><strong>Approval Gate</strong> — all sensitive actions (SSH, SCP, curl, adb, pip, etc.) require your explicit approval</li>
<li><strong>New Action Tags</strong> — [SSH_EXEC], [SSH_UPLOAD], [SSH_DOWNLOAD], [REMOTE_EXEC], [CURL_EXEC]</li>
</ul>
</li>
<li>
<span class="changelog-version">v3.2.0</span>
<span class="changelog-date">2026-05-20</span>
<ul>
<li><strong>Full In-App Virtual Env</strong> — new internal virtual environment setup with no external Termux app dependency</li>
<li><strong>Module Installer</strong> — new AI actions: <code>[VENV_SETUP]</code> and <code>[VENV_PIP_INSTALL package]</code></li>
<li><strong>QA Critical Fix</strong> — fixed invalid JS file check that broke PRoot install fallback</li>
<li><strong>Stability</strong> — thread-safe process map in ShellPlugin and safer wake lock handling</li>
<li><strong>Resource Safety</strong> — fixed high-risk stream/file descriptor leaks in bootstrap extraction and downloads</li>
<li><strong>Accessibility</strong> — improved icon button labels for better screen reader support</li>
</ul>
</li>
<li>
<span class="changelog-version">v3.1.0</span>
<span class="changelog-date">2026-05-20</span>
<ul>
<li><strong>AutoGLM Device Control</strong> — AccessibilityService for tap, swipe, type, long press, screenshot, UI tree, click by text/ID</li>
<li><strong>Navigation Controls</strong> — press Back, Home, Recents, Notifications, Quick Settings, Power Dialog</li>
<li><strong>App Control</strong> — launch apps, get current app, read full UI hierarchy</li>
<li><strong>Hermes Agent</strong> — install hermes-agent in Python venv, execute Hermes commands from chat</li>
<li><strong>Device Tools in AI</strong> — [DEVICE_*] and [HERMES_*] tags parsed in coding + agentic modes</li>
<li><strong>Accessibility Setup</strong> — one-tap enable in Dev Setup screen with status indicator</li>
<li><strong>v2 Signing</strong> — APK signed with v2 scheme (required for targetSdk 36)</li>
</ul>
</li>
<li>
<span class="changelog-version">v2.3.0</span>
<span class="changelog-date">2026-05-20</span>
<ul>
<li><strong>Java Virtual Environment</strong> — ecj.jar + apksigner.jar bundled in APK, d8.jar downloaded at runtime</li>
<li><strong>app_process Wrappers</strong> — Java tools run via /system/bin/app_process (bypasses SELinux execve restrictions)</li>
<li><strong>Runtime aapt2 Install</strong> — downloads aapt2 + dependencies from Termux repo on demand</li>
<li><strong>extractAsset/downloadFile</strong> — new BootstrapPlugin methods for APK asset extraction and URL downloads</li>
<li><strong>Smart Tool Detection</strong> — checks both Termux native tools and Java virtual tools</li>
<li><strong>LD_LIBRARY_PATH</strong> — tools/lib added for aapt2 shared library resolution</li>
</ul>
</li>
<li>
<span class="changelog-version">v2.2.5</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li><strong>Shebang Patching</strong> — all bin/ scripts patched to use #!/system/bin/sh (bypasses interpreter SELinux)</li>
<li><strong>Proot from APK nativeLib</strong> — uses proot directly from APK (apk_data_file SELinux label, always executable)</li>
<li><strong>Termux Integration</strong> — detects installed Termux, sends RUN_COMMAND to install tools</li>
<li><strong>F-Droid Fallback</strong> — opens Termux F-Droid page if not installed</li>
<li><strong>3-Strategy Install</strong> — direct → proot → Termux RUN_COMMAND → manual instructions</li>
</ul>
</li>
<li>
<span class="changelog-version">v2.2.4</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li><strong>Bundled PRoot</strong> — proot binary included in APK as native library (executable SELinux label)</li>
<li><strong>Auto-Proot Install</strong> — copies proot + loader from APK to Termux prefix on first shell use</li>
<li><strong>Auto-Proot Wrapping</strong> — pkg/apt/dpkg commands automatically wrapped with proot</li>
<li><strong>PROOT_LOADER env</strong> — loader path set correctly for proot execution</li>
<li>Supports arm64-v8a, armeabi-v7a, x86_64, x86 architectures</li>
</ul>
</li>
<li>
<span class="changelog-version">v2.2.3</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li><strong>Os.chmod() Fix</strong> — uses Android system call (chmod(2)) instead of Runtime.exec for reliable permissions</li>
<li><strong>PRoot Fallback</strong> — auto-downloads PRoot from Termux repo when SELinux blocks binary execution</li>
<li><strong>Shell Always /system/bin/sh</strong> — avoids Termux bash permission issues entirely</li>
<li><strong>Explicit sh Invocation</strong> — runs pkg/apt via "sh script" instead of direct execution</li>
<li><strong>installProot Plugin</strong> — downloads .deb, extracts proot binary with AR+tar parser</li>
<li><strong>Termux Fallback Guide</strong> — if all else fails, clear instructions to install Termux from F-Droid</li>
</ul>
</li>
<li>
<span class="changelog-version">v2.2.2</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li><strong>Permission Fix</strong> — chmod 755 on all bootstrap binaries after extraction (fixes "Permission denied")</li>
<li><strong>Shell Auto-Fallback</strong> — if bash permission denied, auto-falls back to system sh</li>
<li><strong>fixPermissions Plugin</strong> — new BootstrapPlugin.fixPermissions() callable from JS</li>
<li>ensureBuildTools uses full paths to pkg/apt with chmod before execution</li>
</ul>
</li>
<li>
<span class="changelog-version">v2.2.1</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li><strong>Auto-Install Build Tools</strong> — aapt2/ecj/d8/apksigner auto-installed via pkg with full paths + retry logic</li>
<li><strong>Dev Tools Banner</strong> — warns on Coding/Agentic mode if tools missing, one-tap install button</li>
<li><strong>Bootstrap + Tools in One Tap</strong> — Install button auto-installs bootstrap then build tools</li>
<li>Checks tool availability before every build, auto-installs if missing</li>
</ul>
</li>
<li>
<span class="changelog-version">v2.2.0</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li><strong>Build Pipeline Rewrite</strong> — proven 7-step pipeline: resources, link, compile R.java + sources, DEX, package, sign</li>
<li><strong>Auto-Install Build Tools</strong> — aapt2/ecj/d8/apksigner auto-installed via pkg on first build</li>
<li><strong>APK Signing</strong> — generates debug keystore (keytool or openssl), signs with apksigner</li>
<li><strong>5-Minute Build Timeout</strong> — 10x longer for on-device compilation; kills stuck processes</li>
<li><strong>Fixed 18 Build Bugs</strong> — R.java now compiled, d8 uses @file not broken glob, proper error propagation</li>
<li><strong>Agentic IDE Loop</strong> — full tool→execute→verify→iterate cycle inspired by opencode/AIDE</li>
</ul>
</li>
<li>
<span class="changelog-version">v2.1.0</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li><strong>File Tree</strong> — per-session file tree shows all AI-generated files, view/edit/save from sidebar</li>
<li><strong>Auto-Continue</strong> — if AI stops mid-task, app auto-continues until task is confirmed complete</li>
<li><strong>Task Completion Protocol</strong> — AI outputs [TASK_COMPLETE] when done; app detects truncated responses</li>
<li>File viewer with edit mode — modify and save files back to device</li>
<li>Configurable max auto-continues (120, default 5) in Settings</li>
</ul>
</li>
<li>
<span class="changelog-version">v2.0.1</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li><strong>APK Verification</strong> — build output now verified: confirms APK file exists and shows size</li>
<li><strong>Stay Awake Fix</strong> — dual wake locks (screen bright + CPU) keep device fully awake during builds</li>
<li><strong>Configurable Retries</strong> — max auto-fix retries now adjustable (130) in Settings, default 10</li>
</ul>
</li>
<li>
<span class="changelog-version">v2.0.0</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li><strong>Built-in Termux</strong> — full Linux environment inside the app, no external Termux needed</li>
<li>One-time download (~30MB) of Termux bootstrap (bash, coreutils, apt package manager)</li>
<li>Auto-detects CPU architecture (ARM64, ARM, x86, x86_64)</li>
<li>Path patching — fixes all Termux paths to work from our app prefix</li>
<li>BootstrapPlugin — native download, extract, symlink, patch pipeline</li>
<li>ShellPlugin upgraded — uses bundled bash instead of limited /system/bin/sh</li>
<li>Install build tools via: <code>pkg install aapt2 ecj dx apksigner</code></li>
<li>APK stays tiny (~1MB) — bootstrap downloaded on first use, not embedded</li>
</ul>
</li>
<li>
<span class="changelog-version">v1.4.0</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li>Agentic feedback loop — build errors auto-sent back to AI for fixing (up to 3 retries)</li>
<li>Termux integration — auto-detects Termux on device, uses its PATH (aapt2, d8, ecj, tsu)</li>
<li>Workspace context — AI sees device info, available tools, and project files</li>
<li>AIDE-style tool protocol — upgraded agentic prompt with structured tool use</li>
<li>Auto-build pipeline — full aapt2→ecj→d8→sign→install chain</li>
<li>Build error detection — captures exit codes, feeds errors back for auto-correction</li>
<li>Termux root support — detects tsu/su for elevated privileges</li>
</ul>
</li>
<li>
<span class="changelog-version">v1.3.1</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li>Fixed: AI actions now AUTO-EXECUTE — files deploy, APKs build &amp; install automatically</li>
<li>Added Keep Screen On toggle — prevents sleep while agent works</li>
<li>Added Auto-Deploy toggle — controls whether AI actions auto-execute</li>
<li>Status toasts show deploy/build/install progress</li>
<li>New settings section: Terminal &amp; Agent (Auto-Deploy, Keep Screen On)</li>
</ul>
</li>
<li>
<span class="changelog-version">v1.3.0</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li>Full interactive Terminal screen — execute real shell commands on your device</li>
<li>Native Shell plugin — run commands, read/write files, create directories</li>
<li>APK Installer plugin — install built APKs directly from the app</li>
<li>Deploy Files button — AI-generated code saved to device with one tap</li>
<li>Build APK button — compiles Android projects on-device (needs Termux tools)</li>
<li>Install APK button — triggers Android package installer for built APKs</li>
<li>AI action parser — detects [CREATE_FILE], [RUN_COMMAND], [BUILD_APK], [INSTALL_APK]</li>
<li>Quick commands toolbar in terminal (ls, pwd, cat, mkdir, tools, sys)</li>
<li>Command history with arrow keys</li>
<li>Built-in commands: help, sysinfo, create, install, clear, exit, setup</li>
<li>Dev environment setup screen — bootstrap build tools</li>
<li>Project scaffolding — quick-create Android project structure</li>
<li>Enhanced Agentic mode prompt for on-device build awareness</li>
</ul>
</li>
<li>
<span class="changelog-version">v1.2.4</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li>Save button on every code block — downloads code as a real file to your phone</li>
<li>Copy & Save buttons on every AI response — one-tap copy or save as .txt</li>
<li>File paths in AI responses are now highlighted and tappable (tap to copy)</li>
<li>Smart filename detection — auto-names saved files from code content</li>
<li>30+ language-to-extension mappings for proper file saving</li>
</ul>
</li>
<li>
<span class="changelog-version">v1.2.3</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li>Fixed: Connect button not working — missing function declaration caused JS parse error</li>
<li>All UI event handlers now correctly initialized on app start</li>
</ul>
</li>
<li>
<span class="changelog-version">v1.2.2</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li>Fixed: network error on app backgrounding — now auto-retries with reconnect</li>
<li>Streaming resumes from last saved token after reconnection</li>
<li>Exponential backoff retry (3 attempts) for network interruptions</li>
<li>Retry button shown for failed requests due to connectivity</li>
<li>Offline/online detection with status banner</li>
<li>Visibility change handler saves state on app background</li>
<li>Partial response preserved and restorable on reconnect</li>
</ul>
</li>
<li>
<span class="changelog-version">v1.2.1</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li>Fixed: messages lost when switching conversations during streaming</li>
<li>Streaming responses now auto-save every 20 tokens to prevent data loss</li>
<li>Partial responses preserved when switching sessions mid-generation</li>
<li>Added in-app terminal panel for Coding and Agentic modes</li>
<li>Terminal parses code blocks, file ops, and tool calls from AI responses</li>
<li>Terminal toggle button with collapsible panel</li>
<li>Terminal state persists across sessions</li>
<li>Conversation list now shows message count</li>
<li>Improved conversation switch safety with flush-before-switch</li>
</ul>
</li>
<li>
<span class="changelog-version">v1.2.0</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li>Added light mode / dark mode toggle</li>
<li>Theme persists across sessions</li>
<li>Theme toggle button in chat header</li>
<li>Theme setting in Settings screen</li>
<li>Added changelog section to Settings</li>
<li>Optimized light theme color palette</li>
</ul>
</li>
<li>
<span class="changelog-version">v1.1.0</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li>Z.AI Coding Plan endpoint support</li>
<li>Fixed API base URL to use coding plan endpoint</li>
<li>Updated model list (GLM-5.1, GLM-5 Turbo, GLM-4.7, GLM-4.5 Air)</li>
</ul>
</li>
<li>
<span class="changelog-version">v1.0.0</span>
<span class="changelog-date">2026-05-19</span>
<ul>
<li>Initial release</li>
<li>Chat, Coding, Brainstorm, Agentic modes</li>
<li>Streaming SSE responses</li>
<li>Markdown rendering with syntax highlighting</li>
<li>Conversation management with sidebar</li>
<li>Settings with model, temperature, tokens controls</li>
<li>Web search integration</li>
<li>Export conversations to JSON</li>
<li>Android 15/16 support (targetSdk 36)</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="approval-modal" class="file-viewer" style="display:none;z-index:3000;">
<div class="file-viewer-header">
<div class="file-viewer-title">
<span id="approval-title">Approval required</span>
</div>
<div class="file-viewer-actions">
<button id="approval-deny" class="fv-btn">Deny</button>
<button id="approval-allow" class="fv-btn fv-btn-save">Approve</button>
</div>
</div>
<div class="file-viewer-body" style="padding:16px;">
<pre id="approval-body" style="white-space:pre-wrap;margin:0;"></pre>
</div>
</div>
</div>
</div>
<script src="js/marked.min.js"></script>
<script src="js/highlight.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>