Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Install page: offer an optional local model instead of opening the panel first

Claudea9d0a9c57a4b
diff --git a/docs/webgpu-models.md b/docs/webgpu-models.md
index 9b5f27382..656414307 100644
--- a/docs/webgpu-models.md
+++ b/docs/webgpu-models.md
@@ -253,7 +253,12 @@ Use the tools in `scripts/models/bonsai/`:
- Apply the same pattern to any new model that serves long prompts on
shared GPUs.
- **Cache-only inference.** Chat never downloads. Only explicit download or
- preload flows fetch model files.
+ preload flows fetch model files: Settings → Providers → WebGPU, Apocalypse
+ Mode, and the first-install page (Chrome), which offers Ternary Bonsai 2 2B
+ Vision behind its optional "Download a local model" button. The install page
+ checks for hardware WebGPU before fetching anything, never changes the
+ active provider, and only points an idle WebGPU provider at Bonsai when the
+ configured model is not already downloaded.
## Decisions on WebGPU
diff --git a/src/chrome/src/ui/install.css b/src/chrome/src/ui/install.css
index 70795eb34..5cee99cae 100644
--- a/src/chrome/src/ui/install.css
+++ b/src/chrome/src/ui/install.css
@@ -218,6 +218,121 @@ h1 {
color: var(--error);
}
+/* Optional local model (Chrome hero). Firefox has no in-browser runtime, so
+ its page has no .local-model block and these rules stay unused there. */
+.local-model {
+ margin-top: 34px;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+
+.local-model .open-panel-button {
+ margin-top: 0;
+}
+
+.local-model-icon--pause,
+.local-model-icon--ready,
+.local-model[data-state="downloading"] .local-model-icon--download,
+.local-model[data-state="ready"] .local-model-icon--download {
+ display: none;
+}
+
+.local-model[data-state="downloading"] .local-model-icon--pause,
+.local-model[data-state="ready"] .local-model-icon--ready {
+ display: block;
+}
+
+.local-model-button:hover svg {
+ transform: translateY(2px);
+}
+
+/* While the transfer runs the button only pauses it, so it steps back. */
+.local-model[data-state="downloading"] .local-model-button {
+ background: var(--surface-strong);
+ color: var(--text);
+ box-shadow: inset 0 0 0 1px var(--line);
+}
+
+.local-model[data-state="downloading"] .local-model-button:hover {
+ background: color-mix(in srgb, var(--accent) 12%, var(--surface-strong));
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, var(--line));
+}
+
+.local-model[data-state="downloading"] .local-model-button:hover svg {
+ transform: none;
+}
+
+.local-model[data-state="ready"] .local-model-button:disabled {
+ background: color-mix(in srgb, var(--success) 13%, var(--surface));
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 42%, transparent);
+ color: var(--success);
+ cursor: default;
+ opacity: 1;
+}
+
+.local-model-progress {
+ width: min(100%, 340px);
+ height: 6px;
+ margin-top: 16px;
+ overflow: hidden;
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--text) 11%, transparent);
+}
+
+.local-model-progress[hidden] {
+ display: none;
+}
+
+.local-model-progress > i {
+ display: block;
+ width: var(--local-model-progress, 0%);
+ height: 100%;
+ border-radius: inherit;
+ background: linear-gradient(90deg, var(--accent-strong), var(--accent));
+ transition: width 400ms ease;
+}
+
+.local-model-status {
+ max-width: 440px;
+ margin: 10px 0 0;
+ color: var(--muted);
+ font-size: 13px;
+ font-weight: 520;
+ line-height: 1.5;
+ font-variant-numeric: tabular-nums;
+}
+
+.local-model-status:empty {
+ display: none;
+}
+
+.local-model-status.is-error {
+ color: var(--error);
+}
+
+.local-model-note {
+ max-width: 440px;
+ margin: 10px 0 0;
+ color: var(--quiet);
+ font-size: 12px;
+ line-height: 1.5;
+}
+
+.local-model[data-state="ready"] .local-model-note {
+ display: none;
+}
+
+/* In the closing call-to-action the empty status line should not push the
+ shortcut hint away from the button it refers to. */
+.install-cta .open-panel-status:empty {
+ display: none;
+}
+
+.install-cta .shortcut-hint {
+ margin-top: 14px;
+}
+
.shortcut-hint {
margin: 5px 0 0;
color: var(--muted);
@@ -585,7 +700,9 @@ body::after {
}
@media (max-width: 420px) {
- .open-panel-button {
+ .open-panel-button,
+ .local-model,
+ .local-model-progress {
width: 100%;
}
@@ -597,6 +714,7 @@ body::after {
@media (prefers-reduced-motion: reduce) {
.open-panel-button,
.open-panel-button svg,
+ .local-model-progress > i,
.feature-tab {
transition: none;
}
diff --git a/src/chrome/src/ui/install.html b/src/chrome/src/ui/install.html
index 2dc693565..433499be1 100644
--- a/src/chrome/src/ui/install.html
+++ b/src/chrome/src/ui/install.html
@@ -14,17 +14,28 @@
<div class="install-copy">
<p id="browser-label" class="eyebrow" aria-live="polite" data-i18n="install.checking">Checking your browser…</p>
<h1 id="install-title" data-i18n="install.installed">WebBrain installed</h1>
- <p id="install-intro" class="intro" aria-live="polite" data-i18n="install.open_panel.body">Open WebBrain next to this page to finish setup.</p>
+ <p id="install-intro" class="intro" aria-live="polite" data-i18n="install.local_model.intro">Start with an optional local model. When you’re ready, open WebBrain at the bottom of this page.</p>
- <button id="open-panel-button" class="open-panel-button" type="button" disabled>
- <span id="open-panel-label" data-i18n="install.open_panel">Open Side Panel</span>
- <svg viewBox="0 0 24 24" aria-hidden="true">
- <path d="M5 12h13M13 6l6 6-6 6"/>
- </svg>
- </button>
-
- <p id="open-panel-status" class="open-panel-status" aria-live="polite"></p>
- <p id="shortcut-hint" class="shortcut-hint" data-i18n-html="install.open.shortcut_html">Or press <kbd>Alt</kbd><span>+</span><kbd>Shift</kbd><span>+</span><kbd>W</kbd> anytime.</p>
+ <!-- The one in-browser model WebBrain already offers for WebGPU. Its id
+ lives here so install.js stays identical in the Firefox build,
+ which has no in-browser model runtime and no such block. -->
+ <div id="local-model" class="local-model" data-model="webbrain-one/Ternary-Bonsai-2-2B-ONNX-WebGPU-Vision" data-state="checking">
+ <button id="local-model-button" class="open-panel-button local-model-button" type="button" aria-describedby="local-model-status local-model-note" disabled>
+ <span id="local-model-label" data-i18n="install.local_model.download">Download a local model</span>
+ <svg class="local-model-icon local-model-icon--download" viewBox="0 0 24 24" aria-hidden="true">
+ <path d="M12 4v11M7.5 10.5 12 15l4.5-4.5M5 19.5h14"/>
+ </svg>
+ <svg class="local-model-icon local-model-icon--pause" viewBox="0 0 24 24" aria-hidden="true">
+ <path d="M9 6.5v11M15 6.5v11"/>
+ </svg>
+ <svg class="local-model-icon local-model-icon--ready" viewBox="0 0 24 24" aria-hidden="true">
+ <path d="M5 12.5l4.5 4.5L19 7.5"/>
+ </svg>
+ </button>
+ <div id="local-model-progress" class="local-model-progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" aria-label="Local model download" data-i18n-aria-label="install.local_model.progress_label" hidden><i></i></div>
+ <p id="local-model-status" class="local-model-status" aria-live="polite"></p>
+ <p id="local-model-note" class="local-model-note" data-i18n="install.local_model.note">Optional · about 1.45 GB · runs on this device. You can skip this.</p>
+ </div>
</div>
<aside class="feature-showcase" aria-labelledby="install-title">
@@ -319,13 +330,14 @@
<p data-i18n="install.open_panel.body">Open WebBrain next to this page to finish setup.</p>
</div>
<div class="install-cta-action">
- <button class="open-panel-button" type="button" data-open-panel-mirror disabled>
- <span data-i18n="install.open_panel">Open Side Panel</span>
+ <button id="open-panel-button" class="open-panel-button" type="button" disabled>
+ <span id="open-panel-label" data-i18n="install.open_panel">Open Side Panel</span>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="M5 12h13M13 6l6 6-6 6"/>
</svg>
</button>
- <p class="open-panel-status" data-open-panel-status-mirror aria-live="polite"></p>
+ <p id="open-panel-status" class="open-panel-status" aria-live="polite"></p>
+ <p id="shortcut-hint" class="shortcut-hint" data-i18n-html="install.open.shortcut_html">Or press <kbd>Alt</kbd><span>+</span><kbd>Shift</kbd><span>+</span><kbd>W</kbd> anytime.</p>
</div>
</section>
</main>
diff --git a/src/chrome/src/ui/install.js b/src/chrome/src/ui/install.js
index a782be531..27b5553d6 100644
--- a/src/chrome/src/ui/install.js
+++ b/src/chrome/src/ui/install.js
@@ -124,6 +124,225 @@ export function reportInstalledPanelOpened({
})).then(() => true);
}
+// ── Optional local model ─────────────────────────────────────────────────
+// The install page offers the in-browser model WebBrain already ships for
+// WebGPU. It drives the same background routes as Settings and Apocalypse Mode
+// (get/start/pause_webgpu_download), so the download shows up there too.
+
+const LOCAL_MODEL_POLL_MS = 1500;
+const LOCAL_MODEL_STATUSES = new Set(['checking', 'not-downloaded', 'downloading', 'paused', 'stopping', 'ready', 'error']);
+// The WebGPU worker downloads one model at a time, and a paused transfer still
+// holds that slot until it finishes or is stopped.
+const LOCAL_MODEL_TRANSFER_STATUSES = new Set(['checking', 'starting', 'queued', 'downloading', 'paused', 'stopping']);
+const LOCAL_MODEL_POLLING_STATUSES = new Set(['checking', 'downloading', 'stopping', 'busy']);
+
+export function normalizeLocalModelSnapshot(snapshot = {}, modelId = '') {
+ const raw = String(snapshot?.status || '');
+ let status = ['starting', 'queued', 'loading'].includes(raw)
+ ? 'downloading'
+ : LOCAL_MODEL_STATUSES.has(raw) ? raw : 'not-downloaded';
+ const ready = snapshot?.ready === true || status === 'ready';
+ const loaded = Math.max(0, Number(snapshot?.loaded) || 0);
+ const total = Math.max(0, Number(snapshot?.total) || 0);
+ const progress = ready
+ ? 100
+ : Math.max(0, Math.min(100, Number(snapshot?.progress) || (total > 0 ? loaded / total * 100 : 0)));
+ const other = snapshot?.activeTransfer;
+ const otherModel = String(other?.modelId || other?.model || '').trim();
+ if (ready) status = 'ready';
+ else if (['not-downloaded', 'error'].includes(status) && otherModel && otherModel !== String(modelId || '').trim()
+ && LOCAL_MODEL_TRANSFER_STATUSES.has(String(other?.status || ''))) {
+ status = 'busy';
+ }
+ return {
+ status,
+ progress: Math.round(progress),
+ error: status === 'error' ? String(snapshot?.error || '') : '',
+ };
+}
+
+/** What the button and status line show for one normalized state. */
+export function localModelView(state = {}) {
+ const progress = Math.round(Number(state.progress) || 0);
+ switch (state.status) {
+ case 'ready':
+ return { labelKey: 'install.local_model.ready', action: null, statusKey: 'install.local_model.ready_detail', progress: null };
+ case 'downloading':
+ return { labelKey: 'install.local_model.pause', action: 'pause', statusKey: 'install.local_model.downloading', progress };
+ case 'paused':
+ return { labelKey: 'install.local_model.resume', action: 'resume', statusKey: 'install.local_model.paused', progress };
+ case 'stopping':
+ return { labelKey: 'install.local_model.download', action: null, statusKey: 'install.local_model.working', progress: null };
+ case 'busy':
+ return { labelKey: 'install.local_model.download', action: null, statusKey: 'install.local_model.busy', progress: null };
+ case 'unsupported':
+ return { labelKey: 'install.local_model.download', action: null, statusKey: 'install.local_model.unsupported', progress: null };
+ case 'error':
+ return { labelKey: 'install.local_model.retry', action: 'start', statusKey: 'install.local_model.error', progress: null, isError: true };
+ case 'checking':
+ return { labelKey: 'install.local_model.download', action: null, statusKey: 'install.local_model.checking', progress: null };
+ default:
+ return { labelKey: 'install.local_model.download', action: 'start', statusKey: '', progress: null };
+ }
+}
+
+function backgroundCommand(runtime, action, payload = {}) {
+ return Promise.resolve(runtime.sendMessage({ target: 'background', action, ...payload })).then((response) => {
+ // A thrown handler error arrives as { error, status: 500 }. A download
+ // snapshot in its error state also carries `error`, but with a string
+ // status, and a probe reports { ok: false, error }: both are answers.
+ if (response?.error && typeof response.status !== 'string' && response.ok !== false) {
+ throw new Error(response.error);
+ }
+ return response;
+ });
+}
+
+/**
+ * Point the WebGPU provider at the downloaded model so Settings and Apocalypse
+ * Mode show it as ready. Never touches the active chat provider, and never
+ * replaces a configured model that is already downloaded or downloading.
+ */
+export async function pointWebgpuProviderAtModel(modelId, { runtime = globalThis.chrome?.runtime } = {}) {
+ const { providers = {}, active } = await backgroundCommand(runtime, 'get_providers') || {};
+ const config = providers.webgpu;
+ if (!config || active === 'webgpu') return false;
+ const configured = String(config.model || '').trim();
+ if (configured === modelId) return false;
+ const current = normalizeLocalModelSnapshot(
+ await backgroundCommand(runtime, 'get_webgpu_download_status', configured ? { model: configured } : {}),
+ configured,
+ );
+ if (!['not-downloaded', 'error'].includes(current.status)) return false;
+ await backgroundCommand(runtime, 'update_provider', {
+ providerId: 'webgpu',
+ config: { model: modelId },
+ markConfigured: false,
+ });
+ return true;
+}
+
+export function initializeLocalModelDownload({
+ documentLike = globalThis.document,
+ runtime = globalThis.chrome?.runtime,
+ translate = t,
+ pollMs = LOCAL_MODEL_POLL_MS,
+} = {}) {
+ const root = documentLike?.getElementById?.('local-model');
+ const modelId = String(root?.dataset?.model || '').trim();
+ if (!root || !modelId || !runtime?.sendMessage) return null;
+ const button = documentLike.getElementById('local-model-button');
+ const label = documentLike.getElementById('local-model-label');
+ const bar = documentLike.getElementById('local-model-progress');
+ const statusLine = documentLike.getElementById('local-model-status');
+ let state = { status: 'checking', progress: 0, error: '' };
+ let inFlight = false;
+ let pollTimer = null;
+ let disposed = false;
+
+ const render = () => {
+ const view = localModelView(state);
+ root.dataset.state = state.status;
+ if (label) label.textContent = translate(view.labelKey);
+ if (button) {
+ button.disabled = inFlight || !view.action;
+ if (inFlight || ['checking', 'downloading', 'stopping'].includes(state.status)) button.setAttribute('aria-busy', 'true');
+ else button.removeAttribute('aria-busy');
+ }
+ if (bar) {
+ bar.hidden = view.progress == null;
+ bar.setAttribute('aria-valuenow', String(view.progress ?? 0));
+ bar.style?.setProperty?.('--local-model-progress', `${view.progress ?? 0}%`);
+ }
+ if (statusLine) {
+ statusLine.textContent = view.statusKey ? translate(view.statusKey, { progress: view.progress ?? 0, error: state.error || '' }) : '';
+ statusLine.classList?.toggle?.('is-error', view.isError === true);
+ }
+ };
+
+ const schedulePoll = () => {
+ clearTimeout(pollTimer);
+ pollTimer = null;
+ if (disposed || !LOCAL_MODEL_POLLING_STATUSES.has(state.status)) return;
+ pollTimer = setTimeout(() => { void refresh(); }, pollMs);
+ };
+
+ const setState = (next) => {
+ state = { progress: 0, error: '', ...next };
+ render();
+ schedulePoll();
+ };
+
+ async function refresh({ quiet = false } = {}) {
+ try {
+ const snapshot = await backgroundCommand(runtime, 'get_webgpu_download_status', { model: modelId });
+ if (!inFlight) setState(normalizeLocalModelSnapshot(snapshot, modelId));
+ } catch (error) {
+ // On first paint a missing status is just "not downloaded yet"; the click
+ // probes the browser and reports a real problem.
+ if (!inFlight) setState(quiet ? { status: 'not-downloaded' } : { status: 'error', error: error?.message || String(error) });
+ }
+ }
+
+ button?.addEventListener('click', async () => {
+ const view = localModelView(state);
+ if (!view.action || inFlight) return;
+ inFlight = true;
+ try {
+ if (view.action === 'pause') {
+ render();
+ await backgroundCommand(runtime, 'pause_webgpu_download');
+ } else {
+ if (view.action === 'start') {
+ state = { status: 'checking', progress: 0, error: '' };
+ render();
+ // A browser without hardware WebGPU could download the files but never
+ // run them, so check the adapter first (no weights are fetched).
+ const probe = await backgroundCommand(runtime, 'test_provider', { providerId: 'webgpu' });
+ if (probe?.ok === false) {
+ inFlight = false;
+ setState({ status: 'unsupported', error: String(probe.error || '') });
+ return;
+ }
+ try {
+ await pointWebgpuProviderAtModel(modelId, { runtime });
+ } catch {
+ // Only cosmetic for Settings; the download itself does not need it.
+ }
+ } else {
+ render();
+ }
+ await backgroundCommand(runtime, 'start_webgpu_download', { model: modelId });
+ }
+ } catch (error) {
+ inFlight = false;
+ setState({ status: 'error', error: error?.message || String(error) });
+ return;
+ }
+ inFlight = false;
+ await refresh();
+ });
+
+ // The offscreen host broadcasts transfer progress; polling is the fallback.
+ runtime.onMessage?.addListener?.((message) => {
+ if (message?.type !== 'webgpu-text-download-state' || inFlight) return false;
+ if (String(message.state?.modelId || '').trim() !== modelId) return false;
+ setState(normalizeLocalModelSnapshot(message.state, modelId));
+ return false;
+ });
+
+ render();
+ void refresh({ quiet: true });
+ return {
+ getState: () => ({ ...state }),
+ refresh,
+ dispose() {
+ disposed = true;
+ clearTimeout(pollTimer);
+ },
+ };
+}
+
async function getInstallTab(build) {
const tabs = build === 'firefox'
? globalThis.browser?.tabs
@@ -154,6 +373,12 @@ async function hydrateGuide() {
applyDOMTranslations(document);
initializeFeatureShowcase();
initializeMotion();
+ try {
+ // Chrome only: the Firefox page has no local-model block.
+ initializeLocalModelDownload();
+ } catch (error) {
+ console.warn('[WebBrain] Local model download unavailable:', error);
+ }
const build = document.documentElement.dataset.build;
const [browserKey, installTab] = await Promise.all([
@@ -167,9 +392,11 @@ async function hydrateGuide() {
const openButton = document.getElementById('open-panel-button');
const openLabel = document.getElementById('open-panel-label');
const status = document.getElementById('open-panel-status');
- // The closing call-to-action repeats the button for visitors who scrolled
- // the whole page. It forwards to the primary button (so one click handler,
- // one in-flight open) and mirrors its status line.
+ // Chrome keeps the only open button in the closing call-to-action: the hero
+ // offers the optional local model instead. Firefox has no local model, so
+ // its hero keeps the open button and the closing call-to-action mirrors it,
+ // forwarding to the primary button (one click handler, one in-flight open)
+ // and repeating its status line.
const mirrorButtons = Array.from(document.querySelectorAll('[data-open-panel-mirror]'));
const statusLines = [status, ...document.querySelectorAll('[data-open-panel-status-mirror]')];
const showStatus = (text, isError = false) => {
diff --git a/src/chrome/src/ui/locales/ar.js b/src/chrome/src/ui/locales/ar.js
index a06c433c5..50313fde9 100644
--- a/src/chrome/src/ui/locales/ar.js
+++ b/src/chrome/src/ui/locales/ar.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'تسجيل الشاشة',
'install.chip.shot': 'لقطات شاشة كاملة للصفحة',
'install.chip.dl': 'تنزيلات جماعية',
+ 'install.local_model.intro': 'ابدأ بنموذج محلي اختياري. وعندما تكون جاهزًا، افتح WebBrain من أسفل هذه الصفحة.',
+ 'install.local_model.download': 'تنزيل نموذج محلي',
+ 'install.local_model.note': 'اختياري · نحو 1.45 غيغابايت · يعمل على هذا الجهاز. يمكنك تخطي هذه الخطوة.',
+ 'install.local_model.checking': 'جارٍ التحقق من هذا المتصفح…',
+ 'install.local_model.downloading': 'جارٍ تنزيل Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'إيقاف التنزيل مؤقتًا',
+ 'install.local_model.resume': 'استئناف التنزيل',
+ 'install.local_model.paused': 'متوقف مؤقتًا عند {progress}%.',
+ 'install.local_model.working': 'لحظة…',
+ 'install.local_model.ready': 'النموذج المحلي جاهز',
+ 'install.local_model.ready_detail': 'تم حفظ Ternary Bonsai 2 2B Vision على هذا الجهاز.',
+ 'install.local_model.retry': 'إعادة المحاولة',
+ 'install.local_model.error': 'توقف التنزيل: {error}',
+ 'install.local_model.unsupported': 'تحتاج النماذج المحلية إلى WebGPU عبر العتاد، ولا يوفّره هذا المتصفح حاليًا.',
+ 'install.local_model.busy': 'يجري تنزيل نموذج محلي آخر. يمكن أن يبدأ هذا التنزيل بعد انتهائه.',
+ 'install.local_model.progress_label': 'تنزيل النموذج المحلي',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} من {total}',
diff --git a/src/chrome/src/ui/locales/bn.js b/src/chrome/src/ui/locales/bn.js
index 91377353e..ebb0cded8 100644
--- a/src/chrome/src/ui/locales/bn.js
+++ b/src/chrome/src/ui/locales/bn.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'স্ক্রিন রেকর্ড',
'install.chip.shot': 'ফুল-পেজ স্ক্রিনশট',
'install.chip.dl': 'বাল্ক ডাউনলোড',
+ 'install.local_model.intro': 'চাইলে আগে একটি ঐচ্ছিক লোকাল মডেল ডাউনলোড করুন। প্রস্তুত হলে এই পেজের নিচ থেকে WebBrain খুলুন।',
+ 'install.local_model.download': 'লোকাল মডেল ডাউনলোড করুন',
+ 'install.local_model.note': 'ঐচ্ছিক · প্রায় 1.45 GB · এই ডিভাইসেই চলে। এই ধাপটি বাদ দিতে পারেন।',
+ 'install.local_model.checking': 'এই ব্রাউজার যাচাই করা হচ্ছে…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision ডাউনলোড হচ্ছে · {progress}%',
+ 'install.local_model.pause': 'ডাউনলোড বিরতি দিন',
+ 'install.local_model.resume': 'ডাউনলোড আবার শুরু করুন',
+ 'install.local_model.paused': '{progress}%-এ বিরতি দেওয়া হয়েছে।',
+ 'install.local_model.working': 'এক মুহূর্ত…',
+ 'install.local_model.ready': 'লোকাল মডেল প্রস্তুত',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision এই ডিভাইসে সংরক্ষিত হয়েছে।',
+ 'install.local_model.retry': 'আবার চেষ্টা করুন',
+ 'install.local_model.error': 'ডাউনলোড থেমে গেছে: {error}',
+ 'install.local_model.unsupported': 'লোকাল মডেলের জন্য হার্ডওয়্যার WebGPU দরকার, যা এই ব্রাউজার এখন দিচ্ছে না।',
+ 'install.local_model.busy': 'আরেকটি লোকাল মডেল ডাউনলোড হচ্ছে। সেটি শেষ হলে এটি শুরু হতে পারবে।',
+ 'install.local_model.progress_label': 'লোকাল মডেল ডাউনলোড',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': "সংযোগ বিচ্ছিন্ন",
diff --git a/src/chrome/src/ui/locales/de.js b/src/chrome/src/ui/locales/de.js
index f76c396d8..f4f4904c2 100644
--- a/src/chrome/src/ui/locales/de.js
+++ b/src/chrome/src/ui/locales/de.js
@@ -114,6 +114,22 @@ export default {
'install.chip.record': 'Bildschirmaufnahme',
'install.chip.shot': 'Ganzseiten-Screenshots',
'install.chip.dl': 'Massen-Downloads',
+ 'install.local_model.intro': 'Beginnen Sie mit einem optionalen lokalen Modell. Wenn Sie bereit sind, öffnen Sie WebBrain unten auf dieser Seite.',
+ 'install.local_model.download': 'Lokales Modell herunterladen',
+ 'install.local_model.note': 'Optional · etwa 1,45 GB · läuft auf diesem Gerät. Sie können das überspringen.',
+ 'install.local_model.checking': 'Browser wird geprüft…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision wird heruntergeladen · {progress} %',
+ 'install.local_model.pause': 'Download pausieren',
+ 'install.local_model.resume': 'Download fortsetzen',
+ 'install.local_model.paused': 'Bei {progress} % pausiert.',
+ 'install.local_model.working': 'Einen Moment…',
+ 'install.local_model.ready': 'Lokales Modell bereit',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision ist auf diesem Gerät gespeichert.',
+ 'install.local_model.retry': 'Erneut versuchen',
+ 'install.local_model.error': 'Der Download wurde gestoppt: {error}',
+ 'install.local_model.unsupported': 'Lokale Modelle brauchen Hardware-WebGPU, das dieser Browser gerade nicht bereitstellt.',
+ 'install.local_model.busy': 'Gerade wird ein anderes lokales Modell heruntergeladen. Dieses kann danach starten.',
+ 'install.local_model.progress_label': 'Download des lokalen Modells',
'sp.status.disconnected': 'Getrennt',
'sp.status.connected': 'Verbunden ({model})',
'sp.status.error': 'Fehler: {msg}',
diff --git a/src/chrome/src/ui/locales/en.js b/src/chrome/src/ui/locales/en.js
index 79d623230..bdbe8d605 100644
--- a/src/chrome/src/ui/locales/en.js
+++ b/src/chrome/src/ui/locales/en.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'Record screen',
'install.chip.shot': 'Full-page screenshots',
'install.chip.dl': 'Bulk downloads',
+ 'install.local_model.intro': 'Start with an optional local model. When you’re ready, open WebBrain at the bottom of this page.',
+ 'install.local_model.download': 'Download a local model',
+ 'install.local_model.note': 'Optional · about 1.45 GB · runs on this device. You can skip this.',
+ 'install.local_model.checking': 'Checking this browser…',
+ 'install.local_model.downloading': 'Downloading Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Pause download',
+ 'install.local_model.resume': 'Resume download',
+ 'install.local_model.paused': 'Paused at {progress}%.',
+ 'install.local_model.working': 'One moment…',
+ 'install.local_model.ready': 'Local model ready',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision is saved on this device.',
+ 'install.local_model.retry': 'Try again',
+ 'install.local_model.error': 'The download stopped: {error}',
+ 'install.local_model.unsupported': 'Local models need hardware WebGPU, which this browser isn’t offering right now.',
+ 'install.local_model.busy': 'Another local model is downloading. This one can start after it finishes.',
+ 'install.local_model.progress_label': 'Local model download',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': 'Disconnected',
diff --git a/src/chrome/src/ui/locales/es.js b/src/chrome/src/ui/locales/es.js
index 0a87833f1..952dceb7a 100644
--- a/src/chrome/src/ui/locales/es.js
+++ b/src/chrome/src/ui/locales/es.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Grabar pantalla',
'install.chip.shot': 'Capturas de página completa',
'install.chip.dl': 'Descargas masivas',
+ 'install.local_model.intro': 'Empieza con un modelo local opcional. Cuando estés listo, abre WebBrain al final de esta página.',
+ 'install.local_model.download': 'Descargar un modelo local',
+ 'install.local_model.note': 'Opcional · unos 1,45 GB · se ejecuta en este dispositivo. Puedes omitirlo.',
+ 'install.local_model.checking': 'Comprobando este navegador…',
+ 'install.local_model.downloading': 'Descargando Ternary Bonsai 2 2B Vision · {progress} %',
+ 'install.local_model.pause': 'Pausar descarga',
+ 'install.local_model.resume': 'Reanudar descarga',
+ 'install.local_model.paused': 'En pausa al {progress} %.',
+ 'install.local_model.working': 'Un momento…',
+ 'install.local_model.ready': 'Modelo local listo',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision está guardado en este dispositivo.',
+ 'install.local_model.retry': 'Reintentar',
+ 'install.local_model.error': 'La descarga se detuvo: {error}',
+ 'install.local_model.unsupported': 'Los modelos locales necesitan WebGPU por hardware, que este navegador no ofrece ahora mismo.',
+ 'install.local_model.busy': 'Se está descargando otro modelo local. Este podrá empezar cuando termine.',
+ 'install.local_model.progress_label': 'Descarga del modelo local',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} de {total}',
diff --git a/src/chrome/src/ui/locales/fa.js b/src/chrome/src/ui/locales/fa.js
index 73e4fe543..c2c7d5908 100644
--- a/src/chrome/src/ui/locales/fa.js
+++ b/src/chrome/src/ui/locales/fa.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'ضبط صفحه',
'install.chip.shot': 'اسکرین‌شات تمام‌صفحه',
'install.chip.dl': 'دانلود گروهی',
+ 'install.local_model.intro': 'اگر بخواهید، اول یک مدل محلی اختیاری دانلود کنید. هر وقت آماده بودید، WebBrain را از پایین همین صفحه باز کنید.',
+ 'install.local_model.download': 'دانلود مدل محلی',
+ 'install.local_model.note': 'اختیاری · حدود ۱٫۴۵ گیگابایت · روی همین دستگاه اجرا می‌شود. می‌توانید این مرحله را رد کنید.',
+ 'install.local_model.checking': 'در حال بررسی این مرورگر…',
+ 'install.local_model.downloading': 'در حال دانلود Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'توقف موقت دانلود',
+ 'install.local_model.resume': 'ادامهٔ دانلود',
+ 'install.local_model.paused': 'در {progress}% متوقف شد.',
+ 'install.local_model.working': 'یک لحظه…',
+ 'install.local_model.ready': 'مدل محلی آماده است',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision روی این دستگاه ذخیره شد.',
+ 'install.local_model.retry': 'تلاش دوباره',
+ 'install.local_model.error': 'دانلود متوقف شد: {error}',
+ 'install.local_model.unsupported': 'مدل‌های محلی به WebGPU سخت‌افزاری نیاز دارند که این مرورگر فعلاً ارائه نمی‌کند.',
+ 'install.local_model.busy': 'مدل محلی دیگری در حال دانلود است. این دانلود بعد از آن می‌تواند شروع شود.',
+ 'install.local_model.progress_label': 'دانلود مدل محلی',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': "قطع شد",
diff --git a/src/chrome/src/ui/locales/fr.js b/src/chrome/src/ui/locales/fr.js
index a590b691f..0a3009209 100644
--- a/src/chrome/src/ui/locales/fr.js
+++ b/src/chrome/src/ui/locales/fr.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Enregistrer l’écran',
'install.chip.shot': 'Captures de page entière',
'install.chip.dl': 'Téléchargements groupés',
+ 'install.local_model.intro': 'Commencez par un modèle local facultatif. Quand vous êtes prêt, ouvrez WebBrain en bas de cette page.',
+ 'install.local_model.download': 'Télécharger un modèle local',
+ 'install.local_model.note': 'Facultatif · environ 1,45 Go · s’exécute sur cet appareil. Vous pouvez passer cette étape.',
+ 'install.local_model.checking': 'Vérification de ce navigateur…',
+ 'install.local_model.downloading': 'Téléchargement de Ternary Bonsai 2 2B Vision · {progress} %',
+ 'install.local_model.pause': 'Mettre en pause',
+ 'install.local_model.resume': 'Reprendre le téléchargement',
+ 'install.local_model.paused': 'En pause à {progress} %.',
+ 'install.local_model.working': 'Un instant…',
+ 'install.local_model.ready': 'Modèle local prêt',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision est enregistré sur cet appareil.',
+ 'install.local_model.retry': 'Réessayer',
+ 'install.local_model.error': 'Le téléchargement s’est arrêté : {error}',
+ 'install.local_model.unsupported': 'Les modèles locaux nécessitent WebGPU matériel, que ce navigateur ne propose pas pour le moment.',
+ 'install.local_model.busy': 'Un autre modèle local est en cours de téléchargement. Celui-ci pourra démarrer ensuite.',
+ 'install.local_model.progress_label': 'Téléchargement du modèle local',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} sur {total}',
diff --git a/src/chrome/src/ui/locales/he.js b/src/chrome/src/ui/locales/he.js
index fb9edd2ce..1cfdbe151 100644
--- a/src/chrome/src/ui/locales/he.js
+++ b/src/chrome/src/ui/locales/he.js
@@ -128,6 +128,22 @@ export default {
'install.chip.record': 'הקלטת מסך',
'install.chip.shot': 'צילומי מסך של דף מלא',
'install.chip.dl': 'הורדות בכמות גדולה',
+ 'install.local_model.intro': 'אפשר להתחיל במודל מקומי אופציונלי. כשתהיו מוכנים, פתחו את WebBrain בתחתית הדף.',
+ 'install.local_model.download': 'הורדת מודל מקומי',
+ 'install.local_model.note': 'אופציונלי · כ-1.45 GB · פועל במכשיר הזה. אפשר לדלג על השלב.',
+ 'install.local_model.checking': 'בודקים את הדפדפן…',
+ 'install.local_model.downloading': 'מוריד את Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'השהיית ההורדה',
+ 'install.local_model.resume': 'המשך ההורדה',
+ 'install.local_model.paused': 'הושהה ב-{progress}%.',
+ 'install.local_model.working': 'רגע אחד…',
+ 'install.local_model.ready': 'המודל המקומי מוכן',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision נשמר במכשיר הזה.',
+ 'install.local_model.retry': 'ניסיון נוסף',
+ 'install.local_model.error': 'ההורדה נעצרה: {error}',
+ 'install.local_model.unsupported': 'מודלים מקומיים דורשים WebGPU בחומרה, והדפדפן הזה לא מציע אותו כרגע.',
+ 'install.local_model.busy': 'מודל מקומי אחר נמצא בהורדה. ההורדה הזו תוכל להתחיל אחריו.',
+ 'install.local_model.progress_label': 'הורדת המודל המקומי',
"sp.status.disconnected": "לא מחובר",
"sp.status.connected": "מחובר ({model})",
"sp.status.error": "שגיאה: {msg}",
diff --git a/src/chrome/src/ui/locales/hi.js b/src/chrome/src/ui/locales/hi.js
index 07ab173b2..a88d61b68 100644
--- a/src/chrome/src/ui/locales/hi.js
+++ b/src/chrome/src/ui/locales/hi.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'स्क्रीन रिकॉर्ड',
'install.chip.shot': 'फ़ुल-पेज स्क्रीनशॉट',
'install.chip.dl': 'बल्क डाउनलोड',
+ 'install.local_model.intro': 'चाहें तो पहले एक वैकल्पिक लोकल मॉडल डाउनलोड करें। तैयार होने पर इस पेज के नीचे से WebBrain खोलें।',
+ 'install.local_model.download': 'लोकल मॉडल डाउनलोड करें',
+ 'install.local_model.note': 'वैकल्पिक · लगभग 1.45 GB · इसी डिवाइस पर चलता है। आप इसे छोड़ सकते हैं।',
+ 'install.local_model.checking': 'इस ब्राउज़र की जाँच हो रही है…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision डाउनलोड हो रहा है · {progress}%',
+ 'install.local_model.pause': 'डाउनलोड रोकें',
+ 'install.local_model.resume': 'डाउनलोड फिर शुरू करें',
+ 'install.local_model.paused': '{progress}% पर रोका गया।',
+ 'install.local_model.working': 'एक पल…',
+ 'install.local_model.ready': 'लोकल मॉडल तैयार है',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision इस डिवाइस पर सेव हो गया है।',
+ 'install.local_model.retry': 'फिर से कोशिश करें',
+ 'install.local_model.error': 'डाउनलोड रुक गया: {error}',
+ 'install.local_model.unsupported': 'लोकल मॉडल के लिए हार्डवेयर WebGPU चाहिए, जो यह ब्राउज़र अभी नहीं दे रहा है।',
+ 'install.local_model.busy': 'एक और लोकल मॉडल डाउनलोड हो रहा है। यह उसके पूरा होने के बाद शुरू हो सकता है।',
+ 'install.local_model.progress_label': 'लोकल मॉडल डाउनलोड',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': "विच्छेदित",
diff --git a/src/chrome/src/ui/locales/id.js b/src/chrome/src/ui/locales/id.js
index 28f7c8e36..2ddcb1560 100644
--- a/src/chrome/src/ui/locales/id.js
+++ b/src/chrome/src/ui/locales/id.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Rekam layar',
'install.chip.shot': 'Screenshot halaman penuh',
'install.chip.dl': 'Unduhan massal',
+ 'install.local_model.intro': 'Mulailah dengan model lokal opsional. Jika sudah siap, buka WebBrain di bagian bawah halaman ini.',
+ 'install.local_model.download': 'Unduh model lokal',
+ 'install.local_model.note': 'Opsional · sekitar 1,45 GB · berjalan di perangkat ini. Anda bisa melewatinya.',
+ 'install.local_model.checking': 'Memeriksa browser ini…',
+ 'install.local_model.downloading': 'Mengunduh Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Jeda unduhan',
+ 'install.local_model.resume': 'Lanjutkan unduhan',
+ 'install.local_model.paused': 'Dijeda di {progress}%.',
+ 'install.local_model.working': 'Sebentar…',
+ 'install.local_model.ready': 'Model lokal siap',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision tersimpan di perangkat ini.',
+ 'install.local_model.retry': 'Coba lagi',
+ 'install.local_model.error': 'Unduhan berhenti: {error}',
+ 'install.local_model.unsupported': 'Model lokal memerlukan WebGPU perangkat keras, yang saat ini tidak tersedia di browser ini.',
+ 'install.local_model.busy': 'Model lokal lain sedang diunduh. Unduhan ini bisa dimulai setelahnya.',
+ 'install.local_model.progress_label': 'Unduhan model lokal',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} dari {total}',
diff --git a/src/chrome/src/ui/locales/ja.js b/src/chrome/src/ui/locales/ja.js
index c84046da3..3d9aff3c4 100644
--- a/src/chrome/src/ui/locales/ja.js
+++ b/src/chrome/src/ui/locales/ja.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': '画面録画',
'install.chip.shot': 'ページ全体のスクリーンショット',
'install.chip.dl': '一括ダウンロード',
+ 'install.local_model.intro': 'まずはオプションのローカルモデルをどうぞ。準備ができたら、このページの一番下から WebBrain を開いてください。',
+ 'install.local_model.download': 'ローカルモデルをダウンロード',
+ 'install.local_model.note': 'オプション · 約 1.45 GB · このデバイス上で動作。スキップしてもかまいません。',
+ 'install.local_model.checking': 'このブラウザーを確認しています…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision をダウンロード中 · {progress}%',
+ 'install.local_model.pause': 'ダウンロードを一時停止',
+ 'install.local_model.resume': 'ダウンロードを再開',
+ 'install.local_model.paused': '{progress}% で一時停止しました。',
+ 'install.local_model.working': '少々お待ちください…',
+ 'install.local_model.ready': 'ローカルモデルの準備完了',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision をこのデバイスに保存しました。',
+ 'install.local_model.retry': '再試行',
+ 'install.local_model.error': 'ダウンロードが停止しました: {error}',
+ 'install.local_model.unsupported': 'ローカルモデルにはハードウェア WebGPU が必要ですが、このブラウザーでは現在利用できません。',
+ 'install.local_model.busy': '別のローカルモデルをダウンロード中です。完了後にこちらを開始できます。',
+ 'install.local_model.progress_label': 'ローカルモデルのダウンロード',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} / {total}',
diff --git a/src/chrome/src/ui/locales/ko.js b/src/chrome/src/ui/locales/ko.js
index d4cc064de..570b48125 100644
--- a/src/chrome/src/ui/locales/ko.js
+++ b/src/chrome/src/ui/locales/ko.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': '화면 녹화',
'install.chip.shot': '전체 페이지 스크린샷',
'install.chip.dl': '일괄 다운로드',
+ 'install.local_model.intro': '원하면 먼저 로컬 모델을 받아 두세요. 준비되면 이 페이지 맨 아래에서 WebBrain을 여세요.',
+ 'install.local_model.download': '로컬 모델 다운로드',
+ 'install.local_model.note': '선택 사항 · 약 1.45GB · 이 기기에서 실행됩니다. 건너뛰어도 됩니다.',
+ 'install.local_model.checking': '이 브라우저를 확인하는 중…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision 다운로드 중 · {progress}%',
+ 'install.local_model.pause': '다운로드 일시중지',
+ 'install.local_model.resume': '다운로드 재개',
+ 'install.local_model.paused': '{progress}%에서 일시중지됨.',
+ 'install.local_model.working': '잠시만요…',
+ 'install.local_model.ready': '로컬 모델 준비 완료',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision이 이 기기에 저장되었습니다.',
+ 'install.local_model.retry': '다시 시도',
+ 'install.local_model.error': '다운로드가 중단되었습니다: {error}',
+ 'install.local_model.unsupported': '로컬 모델에는 하드웨어 WebGPU가 필요한데, 이 브라우저는 지금 이를 제공하지 않습니다.',
+ 'install.local_model.busy': '다른 로컬 모델을 다운로드하는 중입니다. 끝나면 이 모델을 시작할 수 있습니다.',
+ 'install.local_model.progress_label': '로컬 모델 다운로드',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} / {total}',
diff --git a/src/chrome/src/ui/locales/ms.js b/src/chrome/src/ui/locales/ms.js
index feb95b317..2cd46df8b 100644
--- a/src/chrome/src/ui/locales/ms.js
+++ b/src/chrome/src/ui/locales/ms.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Rakam skrin',
'install.chip.shot': 'Tangkapan skrin halaman penuh',
'install.chip.dl': 'Muat turun pukal',
+ 'install.local_model.intro': 'Mulakan dengan model setempat pilihan. Apabila sedia, buka WebBrain di bahagian bawah halaman ini.',
+ 'install.local_model.download': 'Muat turun model setempat',
+ 'install.local_model.note': 'Pilihan · kira-kira 1.45 GB · berjalan pada peranti ini. Anda boleh melangkau langkah ini.',
+ 'install.local_model.checking': 'Menyemak pelayar ini…',
+ 'install.local_model.downloading': 'Memuat turun Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Jeda muat turun',
+ 'install.local_model.resume': 'Sambung muat turun',
+ 'install.local_model.paused': 'Dijeda pada {progress}%.',
+ 'install.local_model.working': 'Sebentar…',
+ 'install.local_model.ready': 'Model setempat sedia',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision disimpan pada peranti ini.',
+ 'install.local_model.retry': 'Cuba lagi',
+ 'install.local_model.error': 'Muat turun terhenti: {error}',
+ 'install.local_model.unsupported': 'Model setempat memerlukan WebGPU perkakasan, yang tidak ditawarkan oleh pelayar ini sekarang.',
+ 'install.local_model.busy': 'Model setempat lain sedang dimuat turun. Yang ini boleh bermula selepas ia selesai.',
+ 'install.local_model.progress_label': 'Muat turun model setempat',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} daripada {total}',
diff --git a/src/chrome/src/ui/locales/nl.js b/src/chrome/src/ui/locales/nl.js
index f0a837f0d..9c30c276d 100644
--- a/src/chrome/src/ui/locales/nl.js
+++ b/src/chrome/src/ui/locales/nl.js
@@ -114,6 +114,22 @@ export default {
'install.chip.record': 'Scherm opnemen',
'install.chip.shot': 'Screenshots van hele pagina’s',
'install.chip.dl': 'Bulkdownloads',
+ 'install.local_model.intro': 'Begin met een optioneel lokaal model. Open WebBrain onderaan deze pagina wanneer je klaar bent.',
+ 'install.local_model.download': 'Lokaal model downloaden',
+ 'install.local_model.note': 'Optioneel · ongeveer 1,45 GB · draait op dit apparaat. Je kunt dit overslaan.',
+ 'install.local_model.checking': 'Deze browser controleren…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision downloaden · {progress}%',
+ 'install.local_model.pause': 'Download pauzeren',
+ 'install.local_model.resume': 'Download hervatten',
+ 'install.local_model.paused': 'Gepauzeerd bij {progress}%.',
+ 'install.local_model.working': 'Even geduld…',
+ 'install.local_model.ready': 'Lokaal model klaar',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision staat op dit apparaat.',
+ 'install.local_model.retry': 'Opnieuw proberen',
+ 'install.local_model.error': 'De download is gestopt: {error}',
+ 'install.local_model.unsupported': 'Lokale modellen hebben hardware-WebGPU nodig, en die biedt deze browser nu niet.',
+ 'install.local_model.busy': 'Er wordt al een ander lokaal model gedownload. Dit model kan daarna starten.',
+ 'install.local_model.progress_label': 'Download van lokaal model',
'sp.status.disconnected': 'Niet verbonden',
'sp.status.connected': 'Verbonden ({model})',
'sp.status.error': 'Fout: {msg}',
diff --git a/src/chrome/src/ui/locales/pl.js b/src/chrome/src/ui/locales/pl.js
index ab1170824..6f1963720 100644
--- a/src/chrome/src/ui/locales/pl.js
+++ b/src/chrome/src/ui/locales/pl.js
@@ -114,6 +114,22 @@ export default {
'install.chip.record': 'Nagrywanie ekranu',
'install.chip.shot': 'Zrzuty całej strony',
'install.chip.dl': 'Pobieranie zbiorcze',
+ 'install.local_model.intro': 'Zacznij od opcjonalnego modelu lokalnego. Gdy będziesz gotowy, otwórz WebBrain na dole tej strony.',
+ 'install.local_model.download': 'Pobierz model lokalny',
+ 'install.local_model.note': 'Opcjonalne · ok. 1,45 GB · działa na tym urządzeniu. Możesz to pominąć.',
+ 'install.local_model.checking': 'Sprawdzanie tej przeglądarki…',
+ 'install.local_model.downloading': 'Pobieranie Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Wstrzymaj pobieranie',
+ 'install.local_model.resume': 'Wznów pobieranie',
+ 'install.local_model.paused': 'Wstrzymano przy {progress}%.',
+ 'install.local_model.working': 'Chwileczkę…',
+ 'install.local_model.ready': 'Model lokalny gotowy',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision jest zapisany na tym urządzeniu.',
+ 'install.local_model.retry': 'Spróbuj ponownie',
+ 'install.local_model.error': 'Pobieranie zostało przerwane: {error}',
+ 'install.local_model.unsupported': 'Modele lokalne wymagają sprzętowego WebGPU, którego ta przeglądarka teraz nie udostępnia.',
+ 'install.local_model.busy': 'Trwa pobieranie innego modelu lokalnego. Ten może zacząć się po jego zakończeniu.',
+ 'install.local_model.progress_label': 'Pobieranie modelu lokalnego',
'sp.status.disconnected': 'Rozłączono',
'sp.status.connected': 'Połączono ({model})',
'sp.status.error': 'Błąd: {msg}',
diff --git a/src/chrome/src/ui/locales/pt.js b/src/chrome/src/ui/locales/pt.js
index 6df358dec..119044a19 100644
--- a/src/chrome/src/ui/locales/pt.js
+++ b/src/chrome/src/ui/locales/pt.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'Gravar a tela',
'install.chip.shot': 'Capturas de página inteira',
'install.chip.dl': 'Downloads em massa',
+ 'install.local_model.intro': 'Comece com um modelo local opcional. Quando estiver pronto, abra o WebBrain no fim desta página.',
+ 'install.local_model.download': 'Baixar um modelo local',
+ 'install.local_model.note': 'Opcional · cerca de 1,45 GB · roda neste dispositivo. Você pode pular esta etapa.',
+ 'install.local_model.checking': 'Verificando este navegador…',
+ 'install.local_model.downloading': 'Baixando Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Pausar download',
+ 'install.local_model.resume': 'Retomar download',
+ 'install.local_model.paused': 'Pausado em {progress}%.',
+ 'install.local_model.working': 'Um momento…',
+ 'install.local_model.ready': 'Modelo local pronto',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision está salvo neste dispositivo.',
+ 'install.local_model.retry': 'Tentar novamente',
+ 'install.local_model.error': 'O download parou: {error}',
+ 'install.local_model.unsupported': 'Modelos locais precisam de WebGPU por hardware, que este navegador não está oferecendo agora.',
+ 'install.local_model.busy': 'Outro modelo local está sendo baixado. Este pode começar quando ele terminar.',
+ 'install.local_model.progress_label': 'Download do modelo local',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': "Desconectado",
diff --git a/src/chrome/src/ui/locales/ru.js b/src/chrome/src/ui/locales/ru.js
index cf4cf2b56..9788fd47f 100644
--- a/src/chrome/src/ui/locales/ru.js
+++ b/src/chrome/src/ui/locales/ru.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Запись экрана',
'install.chip.shot': 'Скриншоты всей страницы',
'install.chip.dl': 'Массовая загрузка',
+ 'install.local_model.intro': 'Для начала можно скачать локальную модель — это необязательно. Когда будете готовы, откройте WebBrain внизу этой страницы.',
+ 'install.local_model.download': 'Скачать локальную модель',
+ 'install.local_model.note': 'Необязательно · около 1,45 ГБ · работает на этом устройстве. Этот шаг можно пропустить.',
+ 'install.local_model.checking': 'Проверяем этот браузер…',
+ 'install.local_model.downloading': 'Загрузка Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Приостановить загрузку',
+ 'install.local_model.resume': 'Продолжить загрузку',
+ 'install.local_model.paused': 'Приостановлено на {progress}%.',
+ 'install.local_model.working': 'Секунду…',
+ 'install.local_model.ready': 'Локальная модель готова',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision сохранена на этом устройстве.',
+ 'install.local_model.retry': 'Повторить',
+ 'install.local_model.error': 'Загрузка остановилась: {error}',
+ 'install.local_model.unsupported': 'Локальным моделям нужен аппаратный WebGPU, а этот браузер сейчас его не предоставляет.',
+ 'install.local_model.busy': 'Сейчас загружается другая локальная модель. Эта начнётся после неё.',
+ 'install.local_model.progress_label': 'Загрузка локальной модели',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} из {total}',
diff --git a/src/chrome/src/ui/locales/th.js b/src/chrome/src/ui/locales/th.js
index 8e8eb8404..0e9324a96 100644
--- a/src/chrome/src/ui/locales/th.js
+++ b/src/chrome/src/ui/locales/th.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'บันทึกหน้าจอ',
'install.chip.shot': 'แคปหน้าเว็บทั้งหน้า',
'install.chip.dl': 'ดาวน์โหลดจำนวนมาก',
+ 'install.local_model.intro': 'เริ่มด้วยโมเดลในเครื่องแบบไม่บังคับก็ได้ เมื่อพร้อมแล้ว เปิด WebBrain ที่ด้านล่างของหน้านี้',
+ 'install.local_model.download': 'ดาวน์โหลดโมเดลในเครื่อง',
+ 'install.local_model.note': 'ไม่บังคับ · ประมาณ 1.45 GB · ทำงานบนอุปกรณ์นี้ ข้ามขั้นตอนนี้ได้',
+ 'install.local_model.checking': 'กำลังตรวจสอบเบราว์เซอร์นี้…',
+ 'install.local_model.downloading': 'กำลังดาวน์โหลด Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'หยุดดาวน์โหลดชั่วคราว',
+ 'install.local_model.resume': 'ดาวน์โหลดต่อ',
+ 'install.local_model.paused': 'หยุดชั่วคราวที่ {progress}%',
+ 'install.local_model.working': 'สักครู่…',
+ 'install.local_model.ready': 'โมเดลในเครื่องพร้อมแล้ว',
+ 'install.local_model.ready_detail': 'บันทึก Ternary Bonsai 2 2B Vision ไว้ในอุปกรณ์นี้แล้ว',
+ 'install.local_model.retry': 'ลองอีกครั้ง',
+ 'install.local_model.error': 'การดาวน์โหลดหยุดลง: {error}',
+ 'install.local_model.unsupported': 'โมเดลในเครื่องต้องใช้ WebGPU ระดับฮาร์ดแวร์ ซึ่งเบราว์เซอร์นี้ยังไม่มีให้ในตอนนี้',
+ 'install.local_model.busy': 'กำลังดาวน์โหลดโมเดลในเครื่องตัวอื่นอยู่ ตัวนี้จะเริ่มได้หลังจากนั้น',
+ 'install.local_model.progress_label': 'การดาวน์โหลดโมเดลในเครื่อง',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} จาก {total}',
diff --git a/src/chrome/src/ui/locales/tl.js b/src/chrome/src/ui/locales/tl.js
index 21496e2a5..c387214cb 100644
--- a/src/chrome/src/ui/locales/tl.js
+++ b/src/chrome/src/ui/locales/tl.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'I-record ang screen',
'install.chip.shot': 'Full-page na screenshot',
'install.chip.dl': 'Maramihang pag-download',
+ 'install.local_model.intro': 'Puwede kang magsimula sa isang opsyonal na lokal na model. Kapag handa ka na, buksan ang WebBrain sa ibaba ng pahinang ito.',
+ 'install.local_model.download': 'Mag-download ng lokal na model',
+ 'install.local_model.note': 'Opsyonal · mga 1.45 GB · tumatakbo sa device na ito. Puwede mo itong laktawan.',
+ 'install.local_model.checking': 'Sinusuri ang browser na ito…',
+ 'install.local_model.downloading': 'Dina-download ang Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'I-pause ang download',
+ 'install.local_model.resume': 'Ituloy ang download',
+ 'install.local_model.paused': 'Naka-pause sa {progress}%.',
+ 'install.local_model.working': 'Sandali lang…',
+ 'install.local_model.ready': 'Handa na ang lokal na model',
+ 'install.local_model.ready_detail': 'Naka-save na sa device na ito ang Ternary Bonsai 2 2B Vision.',
+ 'install.local_model.retry': 'Subukang muli',
+ 'install.local_model.error': 'Huminto ang download: {error}',
+ 'install.local_model.unsupported': 'Kailangan ng mga lokal na model ang hardware WebGPU, na hindi iniaalok ng browser na ito ngayon.',
+ 'install.local_model.busy': 'May ibang lokal na model na dina-download. Puwedeng magsimula ito pagkatapos noon.',
+ 'install.local_model.progress_label': 'Download ng lokal na model',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} sa {total}',
diff --git a/src/chrome/src/ui/locales/tr.js b/src/chrome/src/ui/locales/tr.js
index 6b0567877..6f04f966f 100644
--- a/src/chrome/src/ui/locales/tr.js
+++ b/src/chrome/src/ui/locales/tr.js
@@ -221,6 +221,22 @@ export default {
'install.chip.record': 'Ekran kaydı',
'install.chip.shot': 'Tam sayfa ekran görüntüleri',
'install.chip.dl': 'Toplu indirme',
+ 'install.local_model.intro': 'İstersen önce yerel bir model indir. Hazır olduğunda WebBrain’i bu sayfanın en altından aç.',
+ 'install.local_model.download': 'Yerel model indir',
+ 'install.local_model.note': 'İsteğe bağlı · yaklaşık 1,45 GB · bu cihazda çalışır. Bu adımı atlayabilirsin.',
+ 'install.local_model.checking': 'Tarayıcı kontrol ediliyor…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision indiriliyor · %{progress}',
+ 'install.local_model.pause': 'İndirmeyi duraklat',
+ 'install.local_model.resume': 'İndirmeye devam et',
+ 'install.local_model.paused': '%{progress} noktasında duraklatıldı.',
+ 'install.local_model.working': 'Bir saniye…',
+ 'install.local_model.ready': 'Yerel model hazır',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision bu cihaza kaydedildi.',
+ 'install.local_model.retry': 'Tekrar dene',
+ 'install.local_model.error': 'İndirme durdu: {error}',
+ 'install.local_model.unsupported': 'Yerel modeller donanım WebGPU desteği ister; bu tarayıcı şu anda bunu sunmuyor.',
+ 'install.local_model.busy': 'Başka bir yerel model indiriliyor. Bu indirme o bittikten sonra başlayabilir.',
+ 'install.local_model.progress_label': 'Yerel model indirmesi',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} / {total}',
diff --git a/src/chrome/src/ui/locales/uk.js b/src/chrome/src/ui/locales/uk.js
index 73cb46ec0..7ee02eaec 100644
--- a/src/chrome/src/ui/locales/uk.js
+++ b/src/chrome/src/ui/locales/uk.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Запис екрана',
'install.chip.shot': 'Знімки всієї сторінки',
'install.chip.dl': 'Масове завантаження',
+ 'install.local_model.intro': 'Для початку можна завантажити локальну модель — це необов’язково. Коли будете готові, відкрийте WebBrain унизу цієї сторінки.',
+ 'install.local_model.download': 'Завантажити локальну модель',
+ 'install.local_model.note': 'Необов’язково · близько 1,45 ГБ · працює на цьому пристрої. Цей крок можна пропустити.',
+ 'install.local_model.checking': 'Перевіряємо цей браузер…',
+ 'install.local_model.downloading': 'Завантаження Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Призупинити завантаження',
+ 'install.local_model.resume': 'Продовжити завантаження',
+ 'install.local_model.paused': 'Призупинено на {progress}%.',
+ 'install.local_model.working': 'Хвилинку…',
+ 'install.local_model.ready': 'Локальна модель готова',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision збережено на цьому пристрої.',
+ 'install.local_model.retry': 'Спробувати ще раз',
+ 'install.local_model.error': 'Завантаження зупинилося: {error}',
+ 'install.local_model.unsupported': 'Локальним моделям потрібен апаратний WebGPU, якого цей браузер зараз не надає.',
+ 'install.local_model.busy': 'Зараз завантажується інша локальна модель. Ця почнеться після неї.',
+ 'install.local_model.progress_label': 'Завантаження локальної моделі',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} з {total}',
diff --git a/src/chrome/src/ui/locales/vi.js b/src/chrome/src/ui/locales/vi.js
index 3d08f81c6..c8a273543 100644
--- a/src/chrome/src/ui/locales/vi.js
+++ b/src/chrome/src/ui/locales/vi.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'Quay màn hình',
'install.chip.shot': 'Chụp toàn trang',
'install.chip.dl': 'Tải xuống hàng loạt',
+ 'install.local_model.intro': 'Bạn có thể bắt đầu với một mô hình cục bộ tùy chọn. Khi sẵn sàng, hãy mở WebBrain ở cuối trang này.',
+ 'install.local_model.download': 'Tải xuống mô hình cục bộ',
+ 'install.local_model.note': 'Tùy chọn · khoảng 1,45 GB · chạy trên thiết bị này. Bạn có thể bỏ qua bước này.',
+ 'install.local_model.checking': 'Đang kiểm tra trình duyệt này…',
+ 'install.local_model.downloading': 'Đang tải Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Tạm dừng tải xuống',
+ 'install.local_model.resume': 'Tiếp tục tải xuống',
+ 'install.local_model.paused': 'Đã tạm dừng ở {progress}%.',
+ 'install.local_model.working': 'Chờ một chút…',
+ 'install.local_model.ready': 'Mô hình cục bộ đã sẵn sàng',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision đã được lưu trên thiết bị này.',
+ 'install.local_model.retry': 'Thử lại',
+ 'install.local_model.error': 'Quá trình tải xuống đã dừng: {error}',
+ 'install.local_model.unsupported': 'Mô hình cục bộ cần WebGPU phần cứng, nhưng trình duyệt này hiện không cung cấp.',
+ 'install.local_model.busy': 'Một mô hình cục bộ khác đang được tải. Mô hình này có thể bắt đầu sau khi nó xong.',
+ 'install.local_model.progress_label': 'Tải xuống mô hình cục bộ',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': "Đã ngắt kết nối",
diff --git a/src/chrome/src/ui/locales/zh.js b/src/chrome/src/ui/locales/zh.js
index d3e71e137..b47d567b4 100644
--- a/src/chrome/src/ui/locales/zh.js
+++ b/src/chrome/src/ui/locales/zh.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': '录制屏幕',
'install.chip.shot': '整页截图',
'install.chip.dl': '批量下载',
+ 'install.local_model.intro': '可以先下载一个可选的本地模型。准备好后,在本页底部打开 WebBrain。',
+ 'install.local_model.download': '下载本地模型',
+ 'install.local_model.note': '可选 · 约 1.45 GB · 在此设备上运行。可以跳过此步骤。',
+ 'install.local_model.checking': '正在检查此浏览器…',
+ 'install.local_model.downloading': '正在下载 Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': '暂停下载',
+ 'install.local_model.resume': '继续下载',
+ 'install.local_model.paused': '已在 {progress}% 处暂停。',
+ 'install.local_model.working': '请稍候…',
+ 'install.local_model.ready': '本地模型已就绪',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision 已保存在此设备上。',
+ 'install.local_model.retry': '重试',
+ 'install.local_model.error': '下载已停止:{error}',
+ 'install.local_model.unsupported': '本地模型需要硬件 WebGPU,而此浏览器目前未提供。',
+ 'install.local_model.busy': '另一个本地模型正在下载。它完成后才能开始此下载。',
+ 'install.local_model.progress_label': '本地模型下载',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} / {total}',
diff --git a/src/firefox/src/ui/install.css b/src/firefox/src/ui/install.css
index 70795eb34..5cee99cae 100644
--- a/src/firefox/src/ui/install.css
+++ b/src/firefox/src/ui/install.css
@@ -218,6 +218,121 @@ h1 {
color: var(--error);
}
+/* Optional local model (Chrome hero). Firefox has no in-browser runtime, so
+ its page has no .local-model block and these rules stay unused there. */
+.local-model {
+ margin-top: 34px;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+
+.local-model .open-panel-button {
+ margin-top: 0;
+}
+
+.local-model-icon--pause,
+.local-model-icon--ready,
+.local-model[data-state="downloading"] .local-model-icon--download,
+.local-model[data-state="ready"] .local-model-icon--download {
+ display: none;
+}
+
+.local-model[data-state="downloading"] .local-model-icon--pause,
+.local-model[data-state="ready"] .local-model-icon--ready {
+ display: block;
+}
+
+.local-model-button:hover svg {
+ transform: translateY(2px);
+}
+
+/* While the transfer runs the button only pauses it, so it steps back. */
+.local-model[data-state="downloading"] .local-model-button {
+ background: var(--surface-strong);
+ color: var(--text);
+ box-shadow: inset 0 0 0 1px var(--line);
+}
+
+.local-model[data-state="downloading"] .local-model-button:hover {
+ background: color-mix(in srgb, var(--accent) 12%, var(--surface-strong));
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, var(--line));
+}
+
+.local-model[data-state="downloading"] .local-model-button:hover svg {
+ transform: none;
+}
+
+.local-model[data-state="ready"] .local-model-button:disabled {
+ background: color-mix(in srgb, var(--success) 13%, var(--surface));
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 42%, transparent);
+ color: var(--success);
+ cursor: default;
+ opacity: 1;
+}
+
+.local-model-progress {
+ width: min(100%, 340px);
+ height: 6px;
+ margin-top: 16px;
+ overflow: hidden;
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--text) 11%, transparent);
+}
+
+.local-model-progress[hidden] {
+ display: none;
+}
+
+.local-model-progress > i {
+ display: block;
+ width: var(--local-model-progress, 0%);
+ height: 100%;
+ border-radius: inherit;
+ background: linear-gradient(90deg, var(--accent-strong), var(--accent));
+ transition: width 400ms ease;
+}
+
+.local-model-status {
+ max-width: 440px;
+ margin: 10px 0 0;
+ color: var(--muted);
+ font-size: 13px;
+ font-weight: 520;
+ line-height: 1.5;
+ font-variant-numeric: tabular-nums;
+}
+
+.local-model-status:empty {
+ display: none;
+}
+
+.local-model-status.is-error {
+ color: var(--error);
+}
+
+.local-model-note {
+ max-width: 440px;
+ margin: 10px 0 0;
+ color: var(--quiet);
+ font-size: 12px;
+ line-height: 1.5;
+}
+
+.local-model[data-state="ready"] .local-model-note {
+ display: none;
+}
+
+/* In the closing call-to-action the empty status line should not push the
+ shortcut hint away from the button it refers to. */
+.install-cta .open-panel-status:empty {
+ display: none;
+}
+
+.install-cta .shortcut-hint {
+ margin-top: 14px;
+}
+
.shortcut-hint {
margin: 5px 0 0;
color: var(--muted);
@@ -585,7 +700,9 @@ body::after {
}
@media (max-width: 420px) {
- .open-panel-button {
+ .open-panel-button,
+ .local-model,
+ .local-model-progress {
width: 100%;
}
@@ -597,6 +714,7 @@ body::after {
@media (prefers-reduced-motion: reduce) {
.open-panel-button,
.open-panel-button svg,
+ .local-model-progress > i,
.feature-tab {
transition: none;
}
diff --git a/src/firefox/src/ui/install.js b/src/firefox/src/ui/install.js
index a782be531..27b5553d6 100644
--- a/src/firefox/src/ui/install.js
+++ b/src/firefox/src/ui/install.js
@@ -124,6 +124,225 @@ export function reportInstalledPanelOpened({
})).then(() => true);
}
+// ── Optional local model ─────────────────────────────────────────────────
+// The install page offers the in-browser model WebBrain already ships for
+// WebGPU. It drives the same background routes as Settings and Apocalypse Mode
+// (get/start/pause_webgpu_download), so the download shows up there too.
+
+const LOCAL_MODEL_POLL_MS = 1500;
+const LOCAL_MODEL_STATUSES = new Set(['checking', 'not-downloaded', 'downloading', 'paused', 'stopping', 'ready', 'error']);
+// The WebGPU worker downloads one model at a time, and a paused transfer still
+// holds that slot until it finishes or is stopped.
+const LOCAL_MODEL_TRANSFER_STATUSES = new Set(['checking', 'starting', 'queued', 'downloading', 'paused', 'stopping']);
+const LOCAL_MODEL_POLLING_STATUSES = new Set(['checking', 'downloading', 'stopping', 'busy']);
+
+export function normalizeLocalModelSnapshot(snapshot = {}, modelId = '') {
+ const raw = String(snapshot?.status || '');
+ let status = ['starting', 'queued', 'loading'].includes(raw)
+ ? 'downloading'
+ : LOCAL_MODEL_STATUSES.has(raw) ? raw : 'not-downloaded';
+ const ready = snapshot?.ready === true || status === 'ready';
+ const loaded = Math.max(0, Number(snapshot?.loaded) || 0);
+ const total = Math.max(0, Number(snapshot?.total) || 0);
+ const progress = ready
+ ? 100
+ : Math.max(0, Math.min(100, Number(snapshot?.progress) || (total > 0 ? loaded / total * 100 : 0)));
+ const other = snapshot?.activeTransfer;
+ const otherModel = String(other?.modelId || other?.model || '').trim();
+ if (ready) status = 'ready';
+ else if (['not-downloaded', 'error'].includes(status) && otherModel && otherModel !== String(modelId || '').trim()
+ && LOCAL_MODEL_TRANSFER_STATUSES.has(String(other?.status || ''))) {
+ status = 'busy';
+ }
+ return {
+ status,
+ progress: Math.round(progress),
+ error: status === 'error' ? String(snapshot?.error || '') : '',
+ };
+}
+
+/** What the button and status line show for one normalized state. */
+export function localModelView(state = {}) {
+ const progress = Math.round(Number(state.progress) || 0);
+ switch (state.status) {
+ case 'ready':
+ return { labelKey: 'install.local_model.ready', action: null, statusKey: 'install.local_model.ready_detail', progress: null };
+ case 'downloading':
+ return { labelKey: 'install.local_model.pause', action: 'pause', statusKey: 'install.local_model.downloading', progress };
+ case 'paused':
+ return { labelKey: 'install.local_model.resume', action: 'resume', statusKey: 'install.local_model.paused', progress };
+ case 'stopping':
+ return { labelKey: 'install.local_model.download', action: null, statusKey: 'install.local_model.working', progress: null };
+ case 'busy':
+ return { labelKey: 'install.local_model.download', action: null, statusKey: 'install.local_model.busy', progress: null };
+ case 'unsupported':
+ return { labelKey: 'install.local_model.download', action: null, statusKey: 'install.local_model.unsupported', progress: null };
+ case 'error':
+ return { labelKey: 'install.local_model.retry', action: 'start', statusKey: 'install.local_model.error', progress: null, isError: true };
+ case 'checking':
+ return { labelKey: 'install.local_model.download', action: null, statusKey: 'install.local_model.checking', progress: null };
+ default:
+ return { labelKey: 'install.local_model.download', action: 'start', statusKey: '', progress: null };
+ }
+}
+
+function backgroundCommand(runtime, action, payload = {}) {
+ return Promise.resolve(runtime.sendMessage({ target: 'background', action, ...payload })).then((response) => {
+ // A thrown handler error arrives as { error, status: 500 }. A download
+ // snapshot in its error state also carries `error`, but with a string
+ // status, and a probe reports { ok: false, error }: both are answers.
+ if (response?.error && typeof response.status !== 'string' && response.ok !== false) {
+ throw new Error(response.error);
+ }
+ return response;
+ });
+}
+
+/**
+ * Point the WebGPU provider at the downloaded model so Settings and Apocalypse
+ * Mode show it as ready. Never touches the active chat provider, and never
+ * replaces a configured model that is already downloaded or downloading.
+ */
+export async function pointWebgpuProviderAtModel(modelId, { runtime = globalThis.chrome?.runtime } = {}) {
+ const { providers = {}, active } = await backgroundCommand(runtime, 'get_providers') || {};
+ const config = providers.webgpu;
+ if (!config || active === 'webgpu') return false;
+ const configured = String(config.model || '').trim();
+ if (configured === modelId) return false;
+ const current = normalizeLocalModelSnapshot(
+ await backgroundCommand(runtime, 'get_webgpu_download_status', configured ? { model: configured } : {}),
+ configured,
+ );
+ if (!['not-downloaded', 'error'].includes(current.status)) return false;
+ await backgroundCommand(runtime, 'update_provider', {
+ providerId: 'webgpu',
+ config: { model: modelId },
+ markConfigured: false,
+ });
+ return true;
+}
+
+export function initializeLocalModelDownload({
+ documentLike = globalThis.document,
+ runtime = globalThis.chrome?.runtime,
+ translate = t,
+ pollMs = LOCAL_MODEL_POLL_MS,
+} = {}) {
+ const root = documentLike?.getElementById?.('local-model');
+ const modelId = String(root?.dataset?.model || '').trim();
+ if (!root || !modelId || !runtime?.sendMessage) return null;
+ const button = documentLike.getElementById('local-model-button');
+ const label = documentLike.getElementById('local-model-label');
+ const bar = documentLike.getElementById('local-model-progress');
+ const statusLine = documentLike.getElementById('local-model-status');
+ let state = { status: 'checking', progress: 0, error: '' };
+ let inFlight = false;
+ let pollTimer = null;
+ let disposed = false;
+
+ const render = () => {
+ const view = localModelView(state);
+ root.dataset.state = state.status;
+ if (label) label.textContent = translate(view.labelKey);
+ if (button) {
+ button.disabled = inFlight || !view.action;
+ if (inFlight || ['checking', 'downloading', 'stopping'].includes(state.status)) button.setAttribute('aria-busy', 'true');
+ else button.removeAttribute('aria-busy');
+ }
+ if (bar) {
+ bar.hidden = view.progress == null;
+ bar.setAttribute('aria-valuenow', String(view.progress ?? 0));
+ bar.style?.setProperty?.('--local-model-progress', `${view.progress ?? 0}%`);
+ }
+ if (statusLine) {
+ statusLine.textContent = view.statusKey ? translate(view.statusKey, { progress: view.progress ?? 0, error: state.error || '' }) : '';
+ statusLine.classList?.toggle?.('is-error', view.isError === true);
+ }
+ };
+
+ const schedulePoll = () => {
+ clearTimeout(pollTimer);
+ pollTimer = null;
+ if (disposed || !LOCAL_MODEL_POLLING_STATUSES.has(state.status)) return;
+ pollTimer = setTimeout(() => { void refresh(); }, pollMs);
+ };
+
+ const setState = (next) => {
+ state = { progress: 0, error: '', ...next };
+ render();
+ schedulePoll();
+ };
+
+ async function refresh({ quiet = false } = {}) {
+ try {
+ const snapshot = await backgroundCommand(runtime, 'get_webgpu_download_status', { model: modelId });
+ if (!inFlight) setState(normalizeLocalModelSnapshot(snapshot, modelId));
+ } catch (error) {
+ // On first paint a missing status is just "not downloaded yet"; the click
+ // probes the browser and reports a real problem.
+ if (!inFlight) setState(quiet ? { status: 'not-downloaded' } : { status: 'error', error: error?.message || String(error) });
+ }
+ }
+
+ button?.addEventListener('click', async () => {
+ const view = localModelView(state);
+ if (!view.action || inFlight) return;
+ inFlight = true;
+ try {
+ if (view.action === 'pause') {
+ render();
+ await backgroundCommand(runtime, 'pause_webgpu_download');
+ } else {
+ if (view.action === 'start') {
+ state = { status: 'checking', progress: 0, error: '' };
+ render();
+ // A browser without hardware WebGPU could download the files but never
+ // run them, so check the adapter first (no weights are fetched).
+ const probe = await backgroundCommand(runtime, 'test_provider', { providerId: 'webgpu' });
+ if (probe?.ok === false) {
+ inFlight = false;
+ setState({ status: 'unsupported', error: String(probe.error || '') });
+ return;
+ }
+ try {
+ await pointWebgpuProviderAtModel(modelId, { runtime });
+ } catch {
+ // Only cosmetic for Settings; the download itself does not need it.
+ }
+ } else {
+ render();
+ }
+ await backgroundCommand(runtime, 'start_webgpu_download', { model: modelId });
+ }
+ } catch (error) {
+ inFlight = false;
+ setState({ status: 'error', error: error?.message || String(error) });
+ return;
+ }
+ inFlight = false;
+ await refresh();
+ });
+
+ // The offscreen host broadcasts transfer progress; polling is the fallback.
+ runtime.onMessage?.addListener?.((message) => {
+ if (message?.type !== 'webgpu-text-download-state' || inFlight) return false;
+ if (String(message.state?.modelId || '').trim() !== modelId) return false;
+ setState(normalizeLocalModelSnapshot(message.state, modelId));
+ return false;
+ });
+
+ render();
+ void refresh({ quiet: true });
+ return {
+ getState: () => ({ ...state }),
+ refresh,
+ dispose() {
+ disposed = true;
+ clearTimeout(pollTimer);
+ },
+ };
+}
+
async function getInstallTab(build) {
const tabs = build === 'firefox'
? globalThis.browser?.tabs
@@ -154,6 +373,12 @@ async function hydrateGuide() {
applyDOMTranslations(document);
initializeFeatureShowcase();
initializeMotion();
+ try {
+ // Chrome only: the Firefox page has no local-model block.
+ initializeLocalModelDownload();
+ } catch (error) {
+ console.warn('[WebBrain] Local model download unavailable:', error);
+ }
const build = document.documentElement.dataset.build;
const [browserKey, installTab] = await Promise.all([
@@ -167,9 +392,11 @@ async function hydrateGuide() {
const openButton = document.getElementById('open-panel-button');
const openLabel = document.getElementById('open-panel-label');
const status = document.getElementById('open-panel-status');
- // The closing call-to-action repeats the button for visitors who scrolled
- // the whole page. It forwards to the primary button (so one click handler,
- // one in-flight open) and mirrors its status line.
+ // Chrome keeps the only open button in the closing call-to-action: the hero
+ // offers the optional local model instead. Firefox has no local model, so
+ // its hero keeps the open button and the closing call-to-action mirrors it,
+ // forwarding to the primary button (one click handler, one in-flight open)
+ // and repeating its status line.
const mirrorButtons = Array.from(document.querySelectorAll('[data-open-panel-mirror]'));
const statusLines = [status, ...document.querySelectorAll('[data-open-panel-status-mirror]')];
const showStatus = (text, isError = false) => {
diff --git a/src/firefox/src/ui/locales/ar.js b/src/firefox/src/ui/locales/ar.js
index e14f5d311..cbb73a309 100644
--- a/src/firefox/src/ui/locales/ar.js
+++ b/src/firefox/src/ui/locales/ar.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'تسجيل الشاشة',
'install.chip.shot': 'لقطات شاشة كاملة للصفحة',
'install.chip.dl': 'تنزيلات جماعية',
+ 'install.local_model.intro': 'ابدأ بنموذج محلي اختياري. وعندما تكون جاهزًا، افتح WebBrain من أسفل هذه الصفحة.',
+ 'install.local_model.download': 'تنزيل نموذج محلي',
+ 'install.local_model.note': 'اختياري · نحو 1.45 غيغابايت · يعمل على هذا الجهاز. يمكنك تخطي هذه الخطوة.',
+ 'install.local_model.checking': 'جارٍ التحقق من هذا المتصفح…',
+ 'install.local_model.downloading': 'جارٍ تنزيل Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'إيقاف التنزيل مؤقتًا',
+ 'install.local_model.resume': 'استئناف التنزيل',
+ 'install.local_model.paused': 'متوقف مؤقتًا عند {progress}%.',
+ 'install.local_model.working': 'لحظة…',
+ 'install.local_model.ready': 'النموذج المحلي جاهز',
+ 'install.local_model.ready_detail': 'تم حفظ Ternary Bonsai 2 2B Vision على هذا الجهاز.',
+ 'install.local_model.retry': 'إعادة المحاولة',
+ 'install.local_model.error': 'توقف التنزيل: {error}',
+ 'install.local_model.unsupported': 'تحتاج النماذج المحلية إلى WebGPU عبر العتاد، ولا يوفّره هذا المتصفح حاليًا.',
+ 'install.local_model.busy': 'يجري تنزيل نموذج محلي آخر. يمكن أن يبدأ هذا التنزيل بعد انتهائه.',
+ 'install.local_model.progress_label': 'تنزيل النموذج المحلي',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} من {total}',
diff --git a/src/firefox/src/ui/locales/bn.js b/src/firefox/src/ui/locales/bn.js
index 0b59e0d1d..6a2648114 100644
--- a/src/firefox/src/ui/locales/bn.js
+++ b/src/firefox/src/ui/locales/bn.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'স্ক্রিন রেকর্ড',
'install.chip.shot': 'ফুল-পেজ স্ক্রিনশট',
'install.chip.dl': 'বাল্ক ডাউনলোড',
+ 'install.local_model.intro': 'চাইলে আগে একটি ঐচ্ছিক লোকাল মডেল ডাউনলোড করুন। প্রস্তুত হলে এই পেজের নিচ থেকে WebBrain খুলুন।',
+ 'install.local_model.download': 'লোকাল মডেল ডাউনলোড করুন',
+ 'install.local_model.note': 'ঐচ্ছিক · প্রায় 1.45 GB · এই ডিভাইসেই চলে। এই ধাপটি বাদ দিতে পারেন।',
+ 'install.local_model.checking': 'এই ব্রাউজার যাচাই করা হচ্ছে…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision ডাউনলোড হচ্ছে · {progress}%',
+ 'install.local_model.pause': 'ডাউনলোড বিরতি দিন',
+ 'install.local_model.resume': 'ডাউনলোড আবার শুরু করুন',
+ 'install.local_model.paused': '{progress}%-এ বিরতি দেওয়া হয়েছে।',
+ 'install.local_model.working': 'এক মুহূর্ত…',
+ 'install.local_model.ready': 'লোকাল মডেল প্রস্তুত',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision এই ডিভাইসে সংরক্ষিত হয়েছে।',
+ 'install.local_model.retry': 'আবার চেষ্টা করুন',
+ 'install.local_model.error': 'ডাউনলোড থেমে গেছে: {error}',
+ 'install.local_model.unsupported': 'লোকাল মডেলের জন্য হার্ডওয়্যার WebGPU দরকার, যা এই ব্রাউজার এখন দিচ্ছে না।',
+ 'install.local_model.busy': 'আরেকটি লোকাল মডেল ডাউনলোড হচ্ছে। সেটি শেষ হলে এটি শুরু হতে পারবে।',
+ 'install.local_model.progress_label': 'লোকাল মডেল ডাউনলোড',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': "সংযোগ বিচ্ছিন্ন",
diff --git a/src/firefox/src/ui/locales/de.js b/src/firefox/src/ui/locales/de.js
index 8bc039dfb..b5eef515e 100644
--- a/src/firefox/src/ui/locales/de.js
+++ b/src/firefox/src/ui/locales/de.js
@@ -114,6 +114,22 @@ export default {
'install.chip.record': 'Bildschirmaufnahme',
'install.chip.shot': 'Ganzseiten-Screenshots',
'install.chip.dl': 'Massen-Downloads',
+ 'install.local_model.intro': 'Beginnen Sie mit einem optionalen lokalen Modell. Wenn Sie bereit sind, öffnen Sie WebBrain unten auf dieser Seite.',
+ 'install.local_model.download': 'Lokales Modell herunterladen',
+ 'install.local_model.note': 'Optional · etwa 1,45 GB · läuft auf diesem Gerät. Sie können das überspringen.',
+ 'install.local_model.checking': 'Browser wird geprüft…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision wird heruntergeladen · {progress} %',
+ 'install.local_model.pause': 'Download pausieren',
+ 'install.local_model.resume': 'Download fortsetzen',
+ 'install.local_model.paused': 'Bei {progress} % pausiert.',
+ 'install.local_model.working': 'Einen Moment…',
+ 'install.local_model.ready': 'Lokales Modell bereit',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision ist auf diesem Gerät gespeichert.',
+ 'install.local_model.retry': 'Erneut versuchen',
+ 'install.local_model.error': 'Der Download wurde gestoppt: {error}',
+ 'install.local_model.unsupported': 'Lokale Modelle brauchen Hardware-WebGPU, das dieser Browser gerade nicht bereitstellt.',
+ 'install.local_model.busy': 'Gerade wird ein anderes lokales Modell heruntergeladen. Dieses kann danach starten.',
+ 'install.local_model.progress_label': 'Download des lokalen Modells',
'sp.status.disconnected': 'Getrennt',
'sp.status.connected': 'Verbunden ({model})',
'sp.status.error': 'Fehler: {msg}',
diff --git a/src/firefox/src/ui/locales/en.js b/src/firefox/src/ui/locales/en.js
index 7913a2914..c5a1a48fb 100644
--- a/src/firefox/src/ui/locales/en.js
+++ b/src/firefox/src/ui/locales/en.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'Record screen',
'install.chip.shot': 'Full-page screenshots',
'install.chip.dl': 'Bulk downloads',
+ 'install.local_model.intro': 'Start with an optional local model. When you’re ready, open WebBrain at the bottom of this page.',
+ 'install.local_model.download': 'Download a local model',
+ 'install.local_model.note': 'Optional · about 1.45 GB · runs on this device. You can skip this.',
+ 'install.local_model.checking': 'Checking this browser…',
+ 'install.local_model.downloading': 'Downloading Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Pause download',
+ 'install.local_model.resume': 'Resume download',
+ 'install.local_model.paused': 'Paused at {progress}%.',
+ 'install.local_model.working': 'One moment…',
+ 'install.local_model.ready': 'Local model ready',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision is saved on this device.',
+ 'install.local_model.retry': 'Try again',
+ 'install.local_model.error': 'The download stopped: {error}',
+ 'install.local_model.unsupported': 'Local models need hardware WebGPU, which this browser isn’t offering right now.',
+ 'install.local_model.busy': 'Another local model is downloading. This one can start after it finishes.',
+ 'install.local_model.progress_label': 'Local model download',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': 'Disconnected',
diff --git a/src/firefox/src/ui/locales/es.js b/src/firefox/src/ui/locales/es.js
index 173ebdb34..250b42afd 100644
--- a/src/firefox/src/ui/locales/es.js
+++ b/src/firefox/src/ui/locales/es.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Grabar pantalla',
'install.chip.shot': 'Capturas de página completa',
'install.chip.dl': 'Descargas masivas',
+ 'install.local_model.intro': 'Empieza con un modelo local opcional. Cuando estés listo, abre WebBrain al final de esta página.',
+ 'install.local_model.download': 'Descargar un modelo local',
+ 'install.local_model.note': 'Opcional · unos 1,45 GB · se ejecuta en este dispositivo. Puedes omitirlo.',
+ 'install.local_model.checking': 'Comprobando este navegador…',
+ 'install.local_model.downloading': 'Descargando Ternary Bonsai 2 2B Vision · {progress} %',
+ 'install.local_model.pause': 'Pausar descarga',
+ 'install.local_model.resume': 'Reanudar descarga',
+ 'install.local_model.paused': 'En pausa al {progress} %.',
+ 'install.local_model.working': 'Un momento…',
+ 'install.local_model.ready': 'Modelo local listo',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision está guardado en este dispositivo.',
+ 'install.local_model.retry': 'Reintentar',
+ 'install.local_model.error': 'La descarga se detuvo: {error}',
+ 'install.local_model.unsupported': 'Los modelos locales necesitan WebGPU por hardware, que este navegador no ofrece ahora mismo.',
+ 'install.local_model.busy': 'Se está descargando otro modelo local. Este podrá empezar cuando termine.',
+ 'install.local_model.progress_label': 'Descarga del modelo local',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} de {total}',
diff --git a/src/firefox/src/ui/locales/fa.js b/src/firefox/src/ui/locales/fa.js
index 04de2ae8b..aea52f3ff 100644
--- a/src/firefox/src/ui/locales/fa.js
+++ b/src/firefox/src/ui/locales/fa.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'ضبط صفحه',
'install.chip.shot': 'اسکرین‌شات تمام‌صفحه',
'install.chip.dl': 'دانلود گروهی',
+ 'install.local_model.intro': 'اگر بخواهید، اول یک مدل محلی اختیاری دانلود کنید. هر وقت آماده بودید، WebBrain را از پایین همین صفحه باز کنید.',
+ 'install.local_model.download': 'دانلود مدل محلی',
+ 'install.local_model.note': 'اختیاری · حدود ۱٫۴۵ گیگابایت · روی همین دستگاه اجرا می‌شود. می‌توانید این مرحله را رد کنید.',
+ 'install.local_model.checking': 'در حال بررسی این مرورگر…',
+ 'install.local_model.downloading': 'در حال دانلود Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'توقف موقت دانلود',
+ 'install.local_model.resume': 'ادامهٔ دانلود',
+ 'install.local_model.paused': 'در {progress}% متوقف شد.',
+ 'install.local_model.working': 'یک لحظه…',
+ 'install.local_model.ready': 'مدل محلی آماده است',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision روی این دستگاه ذخیره شد.',
+ 'install.local_model.retry': 'تلاش دوباره',
+ 'install.local_model.error': 'دانلود متوقف شد: {error}',
+ 'install.local_model.unsupported': 'مدل‌های محلی به WebGPU سخت‌افزاری نیاز دارند که این مرورگر فعلاً ارائه نمی‌کند.',
+ 'install.local_model.busy': 'مدل محلی دیگری در حال دانلود است. این دانلود بعد از آن می‌تواند شروع شود.',
+ 'install.local_model.progress_label': 'دانلود مدل محلی',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': "قطع شد",
diff --git a/src/firefox/src/ui/locales/fr.js b/src/firefox/src/ui/locales/fr.js
index 56216c59f..5f707b058 100644
--- a/src/firefox/src/ui/locales/fr.js
+++ b/src/firefox/src/ui/locales/fr.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Enregistrer l’écran',
'install.chip.shot': 'Captures de page entière',
'install.chip.dl': 'Téléchargements groupés',
+ 'install.local_model.intro': 'Commencez par un modèle local facultatif. Quand vous êtes prêt, ouvrez WebBrain en bas de cette page.',
+ 'install.local_model.download': 'Télécharger un modèle local',
+ 'install.local_model.note': 'Facultatif · environ 1,45 Go · s’exécute sur cet appareil. Vous pouvez passer cette étape.',
+ 'install.local_model.checking': 'Vérification de ce navigateur…',
+ 'install.local_model.downloading': 'Téléchargement de Ternary Bonsai 2 2B Vision · {progress} %',
+ 'install.local_model.pause': 'Mettre en pause',
+ 'install.local_model.resume': 'Reprendre le téléchargement',
+ 'install.local_model.paused': 'En pause à {progress} %.',
+ 'install.local_model.working': 'Un instant…',
+ 'install.local_model.ready': 'Modèle local prêt',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision est enregistré sur cet appareil.',
+ 'install.local_model.retry': 'Réessayer',
+ 'install.local_model.error': 'Le téléchargement s’est arrêté : {error}',
+ 'install.local_model.unsupported': 'Les modèles locaux nécessitent WebGPU matériel, que ce navigateur ne propose pas pour le moment.',
+ 'install.local_model.busy': 'Un autre modèle local est en cours de téléchargement. Celui-ci pourra démarrer ensuite.',
+ 'install.local_model.progress_label': 'Téléchargement du modèle local',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} sur {total}',
diff --git a/src/firefox/src/ui/locales/he.js b/src/firefox/src/ui/locales/he.js
index a9a8f752f..ea3770aba 100644
--- a/src/firefox/src/ui/locales/he.js
+++ b/src/firefox/src/ui/locales/he.js
@@ -128,6 +128,22 @@ export default {
'install.chip.record': 'הקלטת מסך',
'install.chip.shot': 'צילומי מסך של דף מלא',
'install.chip.dl': 'הורדות בכמות גדולה',
+ 'install.local_model.intro': 'אפשר להתחיל במודל מקומי אופציונלי. כשתהיו מוכנים, פתחו את WebBrain בתחתית הדף.',
+ 'install.local_model.download': 'הורדת מודל מקומי',
+ 'install.local_model.note': 'אופציונלי · כ-1.45 GB · פועל במכשיר הזה. אפשר לדלג על השלב.',
+ 'install.local_model.checking': 'בודקים את הדפדפן…',
+ 'install.local_model.downloading': 'מוריד את Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'השהיית ההורדה',
+ 'install.local_model.resume': 'המשך ההורדה',
+ 'install.local_model.paused': 'הושהה ב-{progress}%.',
+ 'install.local_model.working': 'רגע אחד…',
+ 'install.local_model.ready': 'המודל המקומי מוכן',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision נשמר במכשיר הזה.',
+ 'install.local_model.retry': 'ניסיון נוסף',
+ 'install.local_model.error': 'ההורדה נעצרה: {error}',
+ 'install.local_model.unsupported': 'מודלים מקומיים דורשים WebGPU בחומרה, והדפדפן הזה לא מציע אותו כרגע.',
+ 'install.local_model.busy': 'מודל מקומי אחר נמצא בהורדה. ההורדה הזו תוכל להתחיל אחריו.',
+ 'install.local_model.progress_label': 'הורדת המודל המקומי',
"sp.status.disconnected": "לא מחובר",
"sp.status.connected": "מחובר ({model})",
"sp.status.error": "שגיאה: {msg}",
diff --git a/src/firefox/src/ui/locales/hi.js b/src/firefox/src/ui/locales/hi.js
index 6e160f811..746ed3e47 100644
--- a/src/firefox/src/ui/locales/hi.js
+++ b/src/firefox/src/ui/locales/hi.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'स्क्रीन रिकॉर्ड',
'install.chip.shot': 'फ़ुल-पेज स्क्रीनशॉट',
'install.chip.dl': 'बल्क डाउनलोड',
+ 'install.local_model.intro': 'चाहें तो पहले एक वैकल्पिक लोकल मॉडल डाउनलोड करें। तैयार होने पर इस पेज के नीचे से WebBrain खोलें।',
+ 'install.local_model.download': 'लोकल मॉडल डाउनलोड करें',
+ 'install.local_model.note': 'वैकल्पिक · लगभग 1.45 GB · इसी डिवाइस पर चलता है। आप इसे छोड़ सकते हैं।',
+ 'install.local_model.checking': 'इस ब्राउज़र की जाँच हो रही है…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision डाउनलोड हो रहा है · {progress}%',
+ 'install.local_model.pause': 'डाउनलोड रोकें',
+ 'install.local_model.resume': 'डाउनलोड फिर शुरू करें',
+ 'install.local_model.paused': '{progress}% पर रोका गया।',
+ 'install.local_model.working': 'एक पल…',
+ 'install.local_model.ready': 'लोकल मॉडल तैयार है',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision इस डिवाइस पर सेव हो गया है।',
+ 'install.local_model.retry': 'फिर से कोशिश करें',
+ 'install.local_model.error': 'डाउनलोड रुक गया: {error}',
+ 'install.local_model.unsupported': 'लोकल मॉडल के लिए हार्डवेयर WebGPU चाहिए, जो यह ब्राउज़र अभी नहीं दे रहा है।',
+ 'install.local_model.busy': 'एक और लोकल मॉडल डाउनलोड हो रहा है। यह उसके पूरा होने के बाद शुरू हो सकता है।',
+ 'install.local_model.progress_label': 'लोकल मॉडल डाउनलोड',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': "विच्छेदित",
diff --git a/src/firefox/src/ui/locales/id.js b/src/firefox/src/ui/locales/id.js
index 01d62b5b1..ddd124583 100644
--- a/src/firefox/src/ui/locales/id.js
+++ b/src/firefox/src/ui/locales/id.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Rekam layar',
'install.chip.shot': 'Screenshot halaman penuh',
'install.chip.dl': 'Unduhan massal',
+ 'install.local_model.intro': 'Mulailah dengan model lokal opsional. Jika sudah siap, buka WebBrain di bagian bawah halaman ini.',
+ 'install.local_model.download': 'Unduh model lokal',
+ 'install.local_model.note': 'Opsional · sekitar 1,45 GB · berjalan di perangkat ini. Anda bisa melewatinya.',
+ 'install.local_model.checking': 'Memeriksa browser ini…',
+ 'install.local_model.downloading': 'Mengunduh Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Jeda unduhan',
+ 'install.local_model.resume': 'Lanjutkan unduhan',
+ 'install.local_model.paused': 'Dijeda di {progress}%.',
+ 'install.local_model.working': 'Sebentar…',
+ 'install.local_model.ready': 'Model lokal siap',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision tersimpan di perangkat ini.',
+ 'install.local_model.retry': 'Coba lagi',
+ 'install.local_model.error': 'Unduhan berhenti: {error}',
+ 'install.local_model.unsupported': 'Model lokal memerlukan WebGPU perangkat keras, yang saat ini tidak tersedia di browser ini.',
+ 'install.local_model.busy': 'Model lokal lain sedang diunduh. Unduhan ini bisa dimulai setelahnya.',
+ 'install.local_model.progress_label': 'Unduhan model lokal',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} dari {total}',
diff --git a/src/firefox/src/ui/locales/ja.js b/src/firefox/src/ui/locales/ja.js
index bc04ed217..39240db3f 100644
--- a/src/firefox/src/ui/locales/ja.js
+++ b/src/firefox/src/ui/locales/ja.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': '画面録画',
'install.chip.shot': 'ページ全体のスクリーンショット',
'install.chip.dl': '一括ダウンロード',
+ 'install.local_model.intro': 'まずはオプションのローカルモデルをどうぞ。準備ができたら、このページの一番下から WebBrain を開いてください。',
+ 'install.local_model.download': 'ローカルモデルをダウンロード',
+ 'install.local_model.note': 'オプション · 約 1.45 GB · このデバイス上で動作。スキップしてもかまいません。',
+ 'install.local_model.checking': 'このブラウザーを確認しています…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision をダウンロード中 · {progress}%',
+ 'install.local_model.pause': 'ダウンロードを一時停止',
+ 'install.local_model.resume': 'ダウンロードを再開',
+ 'install.local_model.paused': '{progress}% で一時停止しました。',
+ 'install.local_model.working': '少々お待ちください…',
+ 'install.local_model.ready': 'ローカルモデルの準備完了',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision をこのデバイスに保存しました。',
+ 'install.local_model.retry': '再試行',
+ 'install.local_model.error': 'ダウンロードが停止しました: {error}',
+ 'install.local_model.unsupported': 'ローカルモデルにはハードウェア WebGPU が必要ですが、このブラウザーでは現在利用できません。',
+ 'install.local_model.busy': '別のローカルモデルをダウンロード中です。完了後にこちらを開始できます。',
+ 'install.local_model.progress_label': 'ローカルモデルのダウンロード',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} / {total}',
diff --git a/src/firefox/src/ui/locales/ko.js b/src/firefox/src/ui/locales/ko.js
index 87e24b0ee..038625b6e 100644
--- a/src/firefox/src/ui/locales/ko.js
+++ b/src/firefox/src/ui/locales/ko.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': '화면 녹화',
'install.chip.shot': '전체 페이지 스크린샷',
'install.chip.dl': '일괄 다운로드',
+ 'install.local_model.intro': '원하면 먼저 로컬 모델을 받아 두세요. 준비되면 이 페이지 맨 아래에서 WebBrain을 여세요.',
+ 'install.local_model.download': '로컬 모델 다운로드',
+ 'install.local_model.note': '선택 사항 · 약 1.45GB · 이 기기에서 실행됩니다. 건너뛰어도 됩니다.',
+ 'install.local_model.checking': '이 브라우저를 확인하는 중…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision 다운로드 중 · {progress}%',
+ 'install.local_model.pause': '다운로드 일시중지',
+ 'install.local_model.resume': '다운로드 재개',
+ 'install.local_model.paused': '{progress}%에서 일시중지됨.',
+ 'install.local_model.working': '잠시만요…',
+ 'install.local_model.ready': '로컬 모델 준비 완료',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision이 이 기기에 저장되었습니다.',
+ 'install.local_model.retry': '다시 시도',
+ 'install.local_model.error': '다운로드가 중단되었습니다: {error}',
+ 'install.local_model.unsupported': '로컬 모델에는 하드웨어 WebGPU가 필요한데, 이 브라우저는 지금 이를 제공하지 않습니다.',
+ 'install.local_model.busy': '다른 로컬 모델을 다운로드하는 중입니다. 끝나면 이 모델을 시작할 수 있습니다.',
+ 'install.local_model.progress_label': '로컬 모델 다운로드',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} / {total}',
diff --git a/src/firefox/src/ui/locales/ms.js b/src/firefox/src/ui/locales/ms.js
index 8bf21dd38..406440996 100644
--- a/src/firefox/src/ui/locales/ms.js
+++ b/src/firefox/src/ui/locales/ms.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Rakam skrin',
'install.chip.shot': 'Tangkapan skrin halaman penuh',
'install.chip.dl': 'Muat turun pukal',
+ 'install.local_model.intro': 'Mulakan dengan model setempat pilihan. Apabila sedia, buka WebBrain di bahagian bawah halaman ini.',
+ 'install.local_model.download': 'Muat turun model setempat',
+ 'install.local_model.note': 'Pilihan · kira-kira 1.45 GB · berjalan pada peranti ini. Anda boleh melangkau langkah ini.',
+ 'install.local_model.checking': 'Menyemak pelayar ini…',
+ 'install.local_model.downloading': 'Memuat turun Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Jeda muat turun',
+ 'install.local_model.resume': 'Sambung muat turun',
+ 'install.local_model.paused': 'Dijeda pada {progress}%.',
+ 'install.local_model.working': 'Sebentar…',
+ 'install.local_model.ready': 'Model setempat sedia',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision disimpan pada peranti ini.',
+ 'install.local_model.retry': 'Cuba lagi',
+ 'install.local_model.error': 'Muat turun terhenti: {error}',
+ 'install.local_model.unsupported': 'Model setempat memerlukan WebGPU perkakasan, yang tidak ditawarkan oleh pelayar ini sekarang.',
+ 'install.local_model.busy': 'Model setempat lain sedang dimuat turun. Yang ini boleh bermula selepas ia selesai.',
+ 'install.local_model.progress_label': 'Muat turun model setempat',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} daripada {total}',
diff --git a/src/firefox/src/ui/locales/nl.js b/src/firefox/src/ui/locales/nl.js
index 9bc1b4ac8..14e8ed869 100644
--- a/src/firefox/src/ui/locales/nl.js
+++ b/src/firefox/src/ui/locales/nl.js
@@ -114,6 +114,22 @@ export default {
'install.chip.record': 'Scherm opnemen',
'install.chip.shot': 'Screenshots van hele pagina’s',
'install.chip.dl': 'Bulkdownloads',
+ 'install.local_model.intro': 'Begin met een optioneel lokaal model. Open WebBrain onderaan deze pagina wanneer je klaar bent.',
+ 'install.local_model.download': 'Lokaal model downloaden',
+ 'install.local_model.note': 'Optioneel · ongeveer 1,45 GB · draait op dit apparaat. Je kunt dit overslaan.',
+ 'install.local_model.checking': 'Deze browser controleren…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision downloaden · {progress}%',
+ 'install.local_model.pause': 'Download pauzeren',
+ 'install.local_model.resume': 'Download hervatten',
+ 'install.local_model.paused': 'Gepauzeerd bij {progress}%.',
+ 'install.local_model.working': 'Even geduld…',
+ 'install.local_model.ready': 'Lokaal model klaar',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision staat op dit apparaat.',
+ 'install.local_model.retry': 'Opnieuw proberen',
+ 'install.local_model.error': 'De download is gestopt: {error}',
+ 'install.local_model.unsupported': 'Lokale modellen hebben hardware-WebGPU nodig, en die biedt deze browser nu niet.',
+ 'install.local_model.busy': 'Er wordt al een ander lokaal model gedownload. Dit model kan daarna starten.',
+ 'install.local_model.progress_label': 'Download van lokaal model',
'sp.status.disconnected': 'Niet verbonden',
'sp.status.connected': 'Verbonden ({model})',
'sp.status.error': 'Fout: {msg}',
diff --git a/src/firefox/src/ui/locales/pl.js b/src/firefox/src/ui/locales/pl.js
index d00bea1e2..08463a88b 100644
--- a/src/firefox/src/ui/locales/pl.js
+++ b/src/firefox/src/ui/locales/pl.js
@@ -114,6 +114,22 @@ export default {
'install.chip.record': 'Nagrywanie ekranu',
'install.chip.shot': 'Zrzuty całej strony',
'install.chip.dl': 'Pobieranie zbiorcze',
+ 'install.local_model.intro': 'Zacznij od opcjonalnego modelu lokalnego. Gdy będziesz gotowy, otwórz WebBrain na dole tej strony.',
+ 'install.local_model.download': 'Pobierz model lokalny',
+ 'install.local_model.note': 'Opcjonalne · ok. 1,45 GB · działa na tym urządzeniu. Możesz to pominąć.',
+ 'install.local_model.checking': 'Sprawdzanie tej przeglądarki…',
+ 'install.local_model.downloading': 'Pobieranie Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Wstrzymaj pobieranie',
+ 'install.local_model.resume': 'Wznów pobieranie',
+ 'install.local_model.paused': 'Wstrzymano przy {progress}%.',
+ 'install.local_model.working': 'Chwileczkę…',
+ 'install.local_model.ready': 'Model lokalny gotowy',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision jest zapisany na tym urządzeniu.',
+ 'install.local_model.retry': 'Spróbuj ponownie',
+ 'install.local_model.error': 'Pobieranie zostało przerwane: {error}',
+ 'install.local_model.unsupported': 'Modele lokalne wymagają sprzętowego WebGPU, którego ta przeglądarka teraz nie udostępnia.',
+ 'install.local_model.busy': 'Trwa pobieranie innego modelu lokalnego. Ten może zacząć się po jego zakończeniu.',
+ 'install.local_model.progress_label': 'Pobieranie modelu lokalnego',
'sp.status.disconnected': 'Rozłączono',
'sp.status.connected': 'Połączono ({model})',
'sp.status.error': 'Błąd: {msg}',
diff --git a/src/firefox/src/ui/locales/pt.js b/src/firefox/src/ui/locales/pt.js
index 31820ca59..7e75b020b 100644
--- a/src/firefox/src/ui/locales/pt.js
+++ b/src/firefox/src/ui/locales/pt.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'Gravar a tela',
'install.chip.shot': 'Capturas de página inteira',
'install.chip.dl': 'Downloads em massa',
+ 'install.local_model.intro': 'Comece com um modelo local opcional. Quando estiver pronto, abra o WebBrain no fim desta página.',
+ 'install.local_model.download': 'Baixar um modelo local',
+ 'install.local_model.note': 'Opcional · cerca de 1,45 GB · roda neste dispositivo. Você pode pular esta etapa.',
+ 'install.local_model.checking': 'Verificando este navegador…',
+ 'install.local_model.downloading': 'Baixando Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Pausar download',
+ 'install.local_model.resume': 'Retomar download',
+ 'install.local_model.paused': 'Pausado em {progress}%.',
+ 'install.local_model.working': 'Um momento…',
+ 'install.local_model.ready': 'Modelo local pronto',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision está salvo neste dispositivo.',
+ 'install.local_model.retry': 'Tentar novamente',
+ 'install.local_model.error': 'O download parou: {error}',
+ 'install.local_model.unsupported': 'Modelos locais precisam de WebGPU por hardware, que este navegador não está oferecendo agora.',
+ 'install.local_model.busy': 'Outro modelo local está sendo baixado. Este pode começar quando ele terminar.',
+ 'install.local_model.progress_label': 'Download do modelo local',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': "Desconectado",
diff --git a/src/firefox/src/ui/locales/ru.js b/src/firefox/src/ui/locales/ru.js
index 75c8ba4f8..8a047b38e 100644
--- a/src/firefox/src/ui/locales/ru.js
+++ b/src/firefox/src/ui/locales/ru.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Запись экрана',
'install.chip.shot': 'Скриншоты всей страницы',
'install.chip.dl': 'Массовая загрузка',
+ 'install.local_model.intro': 'Для начала можно скачать локальную модель — это необязательно. Когда будете готовы, откройте WebBrain внизу этой страницы.',
+ 'install.local_model.download': 'Скачать локальную модель',
+ 'install.local_model.note': 'Необязательно · около 1,45 ГБ · работает на этом устройстве. Этот шаг можно пропустить.',
+ 'install.local_model.checking': 'Проверяем этот браузер…',
+ 'install.local_model.downloading': 'Загрузка Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Приостановить загрузку',
+ 'install.local_model.resume': 'Продолжить загрузку',
+ 'install.local_model.paused': 'Приостановлено на {progress}%.',
+ 'install.local_model.working': 'Секунду…',
+ 'install.local_model.ready': 'Локальная модель готова',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision сохранена на этом устройстве.',
+ 'install.local_model.retry': 'Повторить',
+ 'install.local_model.error': 'Загрузка остановилась: {error}',
+ 'install.local_model.unsupported': 'Локальным моделям нужен аппаратный WebGPU, а этот браузер сейчас его не предоставляет.',
+ 'install.local_model.busy': 'Сейчас загружается другая локальная модель. Эта начнётся после неё.',
+ 'install.local_model.progress_label': 'Загрузка локальной модели',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} из {total}',
diff --git a/src/firefox/src/ui/locales/th.js b/src/firefox/src/ui/locales/th.js
index 34aff3b61..b319226b0 100644
--- a/src/firefox/src/ui/locales/th.js
+++ b/src/firefox/src/ui/locales/th.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'บันทึกหน้าจอ',
'install.chip.shot': 'แคปหน้าเว็บทั้งหน้า',
'install.chip.dl': 'ดาวน์โหลดจำนวนมาก',
+ 'install.local_model.intro': 'เริ่มด้วยโมเดลในเครื่องแบบไม่บังคับก็ได้ เมื่อพร้อมแล้ว เปิด WebBrain ที่ด้านล่างของหน้านี้',
+ 'install.local_model.download': 'ดาวน์โหลดโมเดลในเครื่อง',
+ 'install.local_model.note': 'ไม่บังคับ · ประมาณ 1.45 GB · ทำงานบนอุปกรณ์นี้ ข้ามขั้นตอนนี้ได้',
+ 'install.local_model.checking': 'กำลังตรวจสอบเบราว์เซอร์นี้…',
+ 'install.local_model.downloading': 'กำลังดาวน์โหลด Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'หยุดดาวน์โหลดชั่วคราว',
+ 'install.local_model.resume': 'ดาวน์โหลดต่อ',
+ 'install.local_model.paused': 'หยุดชั่วคราวที่ {progress}%',
+ 'install.local_model.working': 'สักครู่…',
+ 'install.local_model.ready': 'โมเดลในเครื่องพร้อมแล้ว',
+ 'install.local_model.ready_detail': 'บันทึก Ternary Bonsai 2 2B Vision ไว้ในอุปกรณ์นี้แล้ว',
+ 'install.local_model.retry': 'ลองอีกครั้ง',
+ 'install.local_model.error': 'การดาวน์โหลดหยุดลง: {error}',
+ 'install.local_model.unsupported': 'โมเดลในเครื่องต้องใช้ WebGPU ระดับฮาร์ดแวร์ ซึ่งเบราว์เซอร์นี้ยังไม่มีให้ในตอนนี้',
+ 'install.local_model.busy': 'กำลังดาวน์โหลดโมเดลในเครื่องตัวอื่นอยู่ ตัวนี้จะเริ่มได้หลังจากนั้น',
+ 'install.local_model.progress_label': 'การดาวน์โหลดโมเดลในเครื่อง',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} จาก {total}',
diff --git a/src/firefox/src/ui/locales/tl.js b/src/firefox/src/ui/locales/tl.js
index 6567c9928..42203c97a 100644
--- a/src/firefox/src/ui/locales/tl.js
+++ b/src/firefox/src/ui/locales/tl.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'I-record ang screen',
'install.chip.shot': 'Full-page na screenshot',
'install.chip.dl': 'Maramihang pag-download',
+ 'install.local_model.intro': 'Puwede kang magsimula sa isang opsyonal na lokal na model. Kapag handa ka na, buksan ang WebBrain sa ibaba ng pahinang ito.',
+ 'install.local_model.download': 'Mag-download ng lokal na model',
+ 'install.local_model.note': 'Opsyonal · mga 1.45 GB · tumatakbo sa device na ito. Puwede mo itong laktawan.',
+ 'install.local_model.checking': 'Sinusuri ang browser na ito…',
+ 'install.local_model.downloading': 'Dina-download ang Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'I-pause ang download',
+ 'install.local_model.resume': 'Ituloy ang download',
+ 'install.local_model.paused': 'Naka-pause sa {progress}%.',
+ 'install.local_model.working': 'Sandali lang…',
+ 'install.local_model.ready': 'Handa na ang lokal na model',
+ 'install.local_model.ready_detail': 'Naka-save na sa device na ito ang Ternary Bonsai 2 2B Vision.',
+ 'install.local_model.retry': 'Subukang muli',
+ 'install.local_model.error': 'Huminto ang download: {error}',
+ 'install.local_model.unsupported': 'Kailangan ng mga lokal na model ang hardware WebGPU, na hindi iniaalok ng browser na ito ngayon.',
+ 'install.local_model.busy': 'May ibang lokal na model na dina-download. Puwedeng magsimula ito pagkatapos noon.',
+ 'install.local_model.progress_label': 'Download ng lokal na model',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} sa {total}',
diff --git a/src/firefox/src/ui/locales/tr.js b/src/firefox/src/ui/locales/tr.js
index 0af28a830..104c904e3 100644
--- a/src/firefox/src/ui/locales/tr.js
+++ b/src/firefox/src/ui/locales/tr.js
@@ -221,6 +221,22 @@ export default {
'install.chip.record': 'Ekran kaydı',
'install.chip.shot': 'Tam sayfa ekran görüntüleri',
'install.chip.dl': 'Toplu indirme',
+ 'install.local_model.intro': 'İstersen önce yerel bir model indir. Hazır olduğunda WebBrain’i bu sayfanın en altından aç.',
+ 'install.local_model.download': 'Yerel model indir',
+ 'install.local_model.note': 'İsteğe bağlı · yaklaşık 1,45 GB · bu cihazda çalışır. Bu adımı atlayabilirsin.',
+ 'install.local_model.checking': 'Tarayıcı kontrol ediliyor…',
+ 'install.local_model.downloading': 'Ternary Bonsai 2 2B Vision indiriliyor · %{progress}',
+ 'install.local_model.pause': 'İndirmeyi duraklat',
+ 'install.local_model.resume': 'İndirmeye devam et',
+ 'install.local_model.paused': '%{progress} noktasında duraklatıldı.',
+ 'install.local_model.working': 'Bir saniye…',
+ 'install.local_model.ready': 'Yerel model hazır',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision bu cihaza kaydedildi.',
+ 'install.local_model.retry': 'Tekrar dene',
+ 'install.local_model.error': 'İndirme durdu: {error}',
+ 'install.local_model.unsupported': 'Yerel modeller donanım WebGPU desteği ister; bu tarayıcı şu anda bunu sunmuyor.',
+ 'install.local_model.busy': 'Başka bir yerel model indiriliyor. Bu indirme o bittikten sonra başlayabilir.',
+ 'install.local_model.progress_label': 'Yerel model indirmesi',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} / {total}',
diff --git a/src/firefox/src/ui/locales/uk.js b/src/firefox/src/ui/locales/uk.js
index e130325e7..eb64ee0da 100644
--- a/src/firefox/src/ui/locales/uk.js
+++ b/src/firefox/src/ui/locales/uk.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': 'Запис екрана',
'install.chip.shot': 'Знімки всієї сторінки',
'install.chip.dl': 'Масове завантаження',
+ 'install.local_model.intro': 'Для початку можна завантажити локальну модель — це необов’язково. Коли будете готові, відкрийте WebBrain унизу цієї сторінки.',
+ 'install.local_model.download': 'Завантажити локальну модель',
+ 'install.local_model.note': 'Необов’язково · близько 1,45 ГБ · працює на цьому пристрої. Цей крок можна пропустити.',
+ 'install.local_model.checking': 'Перевіряємо цей браузер…',
+ 'install.local_model.downloading': 'Завантаження Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Призупинити завантаження',
+ 'install.local_model.resume': 'Продовжити завантаження',
+ 'install.local_model.paused': 'Призупинено на {progress}%.',
+ 'install.local_model.working': 'Хвилинку…',
+ 'install.local_model.ready': 'Локальна модель готова',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision збережено на цьому пристрої.',
+ 'install.local_model.retry': 'Спробувати ще раз',
+ 'install.local_model.error': 'Завантаження зупинилося: {error}',
+ 'install.local_model.unsupported': 'Локальним моделям потрібен апаратний WebGPU, якого цей браузер зараз не надає.',
+ 'install.local_model.busy': 'Зараз завантажується інша локальна модель. Ця почнеться після неї.',
+ 'install.local_model.progress_label': 'Завантаження локальної моделі',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} з {total}',
diff --git a/src/firefox/src/ui/locales/vi.js b/src/firefox/src/ui/locales/vi.js
index a51d2c038..0df6dd7f2 100644
--- a/src/firefox/src/ui/locales/vi.js
+++ b/src/firefox/src/ui/locales/vi.js
@@ -112,6 +112,22 @@ export default {
'install.chip.record': 'Quay màn hình',
'install.chip.shot': 'Chụp toàn trang',
'install.chip.dl': 'Tải xuống hàng loạt',
+ 'install.local_model.intro': 'Bạn có thể bắt đầu với một mô hình cục bộ tùy chọn. Khi sẵn sàng, hãy mở WebBrain ở cuối trang này.',
+ 'install.local_model.download': 'Tải xuống mô hình cục bộ',
+ 'install.local_model.note': 'Tùy chọn · khoảng 1,45 GB · chạy trên thiết bị này. Bạn có thể bỏ qua bước này.',
+ 'install.local_model.checking': 'Đang kiểm tra trình duyệt này…',
+ 'install.local_model.downloading': 'Đang tải Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': 'Tạm dừng tải xuống',
+ 'install.local_model.resume': 'Tiếp tục tải xuống',
+ 'install.local_model.paused': 'Đã tạm dừng ở {progress}%.',
+ 'install.local_model.working': 'Chờ một chút…',
+ 'install.local_model.ready': 'Mô hình cục bộ đã sẵn sàng',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision đã được lưu trên thiết bị này.',
+ 'install.local_model.retry': 'Thử lại',
+ 'install.local_model.error': 'Quá trình tải xuống đã dừng: {error}',
+ 'install.local_model.unsupported': 'Mô hình cục bộ cần WebGPU phần cứng, nhưng trình duyệt này hiện không cung cấp.',
+ 'install.local_model.busy': 'Một mô hình cục bộ khác đang được tải. Mô hình này có thể bắt đầu sau khi nó xong.',
+ 'install.local_model.progress_label': 'Tải xuống mô hình cục bộ',
// --- Sidepanel ---------------------------------------------------------
'sp.status.disconnected': "Đã ngắt kết nối",
diff --git a/src/firefox/src/ui/locales/zh.js b/src/firefox/src/ui/locales/zh.js
index 4b2c6bac0..67e19188d 100644
--- a/src/firefox/src/ui/locales/zh.js
+++ b/src/firefox/src/ui/locales/zh.js
@@ -185,6 +185,22 @@ export default {
'install.chip.record': '录制屏幕',
'install.chip.shot': '整页截图',
'install.chip.dl': '批量下载',
+ 'install.local_model.intro': '可以先下载一个可选的本地模型。准备好后,在本页底部打开 WebBrain。',
+ 'install.local_model.download': '下载本地模型',
+ 'install.local_model.note': '可选 · 约 1.45 GB · 在此设备上运行。可以跳过此步骤。',
+ 'install.local_model.checking': '正在检查此浏览器…',
+ 'install.local_model.downloading': '正在下载 Ternary Bonsai 2 2B Vision · {progress}%',
+ 'install.local_model.pause': '暂停下载',
+ 'install.local_model.resume': '继续下载',
+ 'install.local_model.paused': '已在 {progress}% 处暂停。',
+ 'install.local_model.working': '请稍候…',
+ 'install.local_model.ready': '本地模型已就绪',
+ 'install.local_model.ready_detail': 'Ternary Bonsai 2 2B Vision 已保存在此设备上。',
+ 'install.local_model.retry': '重试',
+ 'install.local_model.error': '下载已停止:{error}',
+ 'install.local_model.unsupported': '本地模型需要硬件 WebGPU,而此浏览器目前未提供。',
+ 'install.local_model.busy': '另一个本地模型正在下载。它完成后才能开始此下载。',
+ 'install.local_model.progress_label': '本地模型下载',
// --- Onboarding --------------------------------------------------------
'ob.step': '{current} / {total}',
diff --git a/test/run.js b/test/run.js
index d649cad21..db7443e9c 100644
--- a/test/run.js
+++ b/test/run.js
@@ -44731,7 +44731,15 @@ test('first install opens a browser-aware panel launcher without fake toolbar co
assert.match(sceneCss, /@media \(prefers-reduced-motion: reduce\)/, `${label}: feature scenes should respect reduced motion`);
assert.match(sceneCss, /\.js-motion \[data-reveal\]/, `${label}: content should only be hidden for reveal once the motion script is running`);
assert.match(html, /\/screenshot --full-page|data-i18n-html="install\.shot\.body_html"/, `${label}: the screenshot card should show its command`);
- assert.match(html, /<button class="open-panel-button" type="button" data-open-panel-mirror disabled>/, `${label}: closing call-to-action should start disabled like the primary one`);
+ if (label === 'firefox') {
+ assert.match(html, /<button class="open-panel-button" type="button" data-open-panel-mirror disabled>/, `${label}: closing call-to-action should start disabled like the primary one`);
+ } else {
+ // Chrome's hero offers the optional local model; the closing call-to-action
+ // owns the only open button, so nothing mirrors it.
+ assert.doesNotMatch(html, /data-open-panel-mirror/, 'chrome: the closing call-to-action should be the primary open button, not a mirror');
+ assert.match(html, /<section class="install-cta"[\s\S]*?id="open-panel-button"[\s\S]*?id="open-panel-status"[\s\S]*?id="shortcut-hint"[\s\S]*?<\/section>/, 'chrome: the open button, its status line and the shortcut hint should live in the closing call-to-action');
+ assert.doesNotMatch(html.match(/<section class="install-hero"[\s\S]*?<\/section>/)[0], /id="open-panel-button"/, 'chrome: the hero should no longer open the side panel');
+ }
assert.equal((html.match(/id="open-panel-button"/g) || []).length, 1, `${label}: only one primary panel-open button should exist`);
// The hero looks complete in a laptop-sized window, so a permanent row of pills says what is
// further down and jumps to it. The page has no header: people know which product they installed.
@@ -45052,7 +45060,7 @@ test('first install opens a browser-aware panel launcher without fake toolbar co
const chromeLocale = (await import(pathToFileURL(path.join(ROOT, 'src/chrome/src/ui/locales', filename)).href)).default;
const firefoxLocale = (await import(pathToFileURL(path.join(ROOT, 'src/firefox/src/ui/locales', filename)).href)).default;
const installKeys = Object.keys(chromeLocale).filter((key) => key.startsWith('install.'));
- assert.equal(installKeys.length, 64, `${filename}: install guide should translate every user-facing string`);
+ assert.equal(installKeys.length, 80, `${filename}: install guide should translate every user-facing string`);
assert.ok(chromeLocale['install.showcase.ask.title'], `${filename}: Ask showcase headline should be translated`);
assert.ok(chromeLocale['install.showcase.apocalypse.body'], `${filename}: Apocalypse showcase body should be translated`);
for (const key of [
@@ -45064,9 +45072,14 @@ test('first install opens a browser-aware panel launcher without fake toolbar co
'install.mock.files', 'install.mock.offline', 'install.mock.not_robot', 'install.mock.captcha_blocked',
'install.mock.captcha_sent', 'install.mock.captcha_waiting', 'install.mock.captcha_note',
'install.mock.show_image', 'install.mock.safesocial_note', 'install.mock.tab', 'install.mock.screen',
+ ...['intro', 'download', 'note', 'checking', 'downloading', 'pause', 'resume', 'paused', 'working', 'ready',
+ 'ready_detail', 'retry', 'error', 'unsupported', 'busy', 'progress_label'].map((key) => `install.local_model.${key}`),
]) {
assert.ok(chromeLocale[key], `${filename}: ${key} should be translated`);
}
+ assert.ok(chromeLocale['install.local_model.downloading'].includes('{progress}'), `${filename}: download progress must keep its placeholder`);
+ assert.ok(chromeLocale['install.local_model.paused'].includes('{progress}'), `${filename}: paused progress must keep its placeholder`);
+ assert.ok(chromeLocale['install.local_model.error'].includes('{error}'), `${filename}: the download error must keep its placeholder`);
assert.ok(chromeLocale['install.shot.body_html'].includes('<code>/screenshot --full-page</code>'), `${filename}: the screenshot command must survive translation verbatim`);
assert.ok(chromeLocale['install.record.body_html'].includes('<code>/record</code>'), `${filename}: the record command must survive translation verbatim`);
assert.ok(chromeLocale['install.pin.confirm'], `${filename}: pin coachmark should translate its confirmation action`);
@@ -45087,6 +45100,239 @@ test('first install opens a browser-aware panel launcher without fake toolbar co
assert.match(englishLocale['install.open_failed_firefox'], /Firefox Extensions/i, 'firefox: failed open should point to Firefox Extensions');
});
+test('chrome install page offers the shipped in-browser model with progress instead of opening the panel first', async () => {
+ const chromeHtml = fs.readFileSync(path.join(ROOT, 'src/chrome/src/ui/install.html'), 'utf8');
+ const firefoxHtml = fs.readFileSync(path.join(ROOT, 'src/firefox/src/ui/install.html'), 'utf8');
+ const css = fs.readFileSync(path.join(ROOT, 'src/chrome/src/ui/install.css'), 'utf8');
+ const webgpu = await import(pathToFileURL(path.join(ROOT, 'src/chrome/src/providers/webgpu.js')).href);
+ const install = await import(pathToFileURL(path.join(ROOT, 'src/chrome/src/ui/install.js')).href);
+ const english = (await import(pathToFileURL(path.join(ROOT, 'src/chrome/src/ui/locales/en.js')).href)).default;
+
+ const hero = chromeHtml.match(/<section class="install-hero"[\s\S]*?<\/section>/)[0];
+ const modelId = hero.match(/<div id="local-model" class="local-model" data-model="([^"]+)"/)?.[1];
+ assert.equal(modelId, webgpu.WEBGPU_BONSAI2_VL_2B_MODEL_ID, 'the install page should download the Ternary Bonsai 2 2B Vision preset');
+ assert.ok(webgpu.isSelectableWebgpuPreset(modelId), 'the install page should offer a model the WebGPU pickers already offer');
+ assert.match(hero, /id="local-model-button"[^>]*\sdisabled(?:\s|>)/, 'the download button should start disabled until its state is known');
+ assert.match(hero, /id="local-model-progress"[^>]*role="progressbar"[^>]*hidden/, 'progress should be an accessible progress bar, hidden until a transfer runs');
+ assert.match(hero, /id="local-model-status"[^>]*aria-live="polite"/, 'download status should be announced');
+ assert.match(hero, /id="local-model-note" class="local-model-note" data-i18n="install\.local_model\.note"/, 'the optional note should sit under the button');
+ assert.match(hero, /id="install-intro"[^>]*data-i18n="install\.local_model\.intro"/, 'the hero intro should point to the open button at the bottom of the page');
+ assert.doesNotMatch(firefoxHtml, /id="local-model"|install\.local_model\./, 'firefox: no in-browser model runtime, so the page keeps its sidebar button');
+ assert.match(css, /\.local-model-note \{[\s\S]*?color: var\(--quiet\);[\s\S]*?font-size: 12px;/, 'the optional note should be small and gray');
+ assert.match(english['install.local_model.note'], /^Optional\b/, 'the note should say up front that the download is optional');
+ assert.match(english['install.local_model.note'], /1\.45 GB/, 'the note should state the download size of the preset');
+ const preset = webgpu.WEBGPU_MODEL_PRESETS.find((entry) => entry.id === modelId);
+ assert.equal(preset.size, '1.45 GB', 'the note quotes the preset size; update the copy if the preset changes');
+
+ const normalize = install.normalizeLocalModelSnapshot;
+ assert.deepEqual(normalize({ status: 'starting' }, modelId), { status: 'downloading', progress: 0, error: '' });
+ assert.deepEqual(normalize({ status: 'downloading', loaded: 25, total: 100 }, modelId), { status: 'downloading', progress: 25, error: '' });
+ assert.deepEqual(normalize({ status: 'not-downloaded', ready: true }, modelId), { status: 'ready', progress: 100, error: '' });
+ assert.deepEqual(normalize({ status: 'error', error: 'Failed to fetch' }, modelId), { status: 'error', progress: 0, error: 'Failed to fetch' });
+ assert.equal(normalize({ status: 'mystery' }, modelId).status, 'not-downloaded');
+ for (const otherStatus of ['downloading', 'paused', 'stopping']) {
+ assert.equal(
+ normalize({ status: 'not-downloaded', activeTransfer: { status: otherStatus, modelId: webgpu.WEBGPU_COMPASS_TINY_V2_MODEL_ID } }, modelId).status,
+ 'busy',
+ `another model ${otherStatus} holds the worker's single download slot`,
+ );
+ }
+ assert.equal(normalize({ status: 'not-downloaded', activeTransfer: { status: 'ready', modelId: 'x/y' } }, modelId).status, 'not-downloaded');
+ assert.equal(normalize({ status: 'downloading', activeTransfer: { status: 'downloading', modelId } }, modelId).status, 'downloading');
+
+ const view = install.localModelView;
+ assert.equal(view({ status: 'not-downloaded' }).action, 'start');
+ assert.equal(view({ status: 'downloading', progress: 41.6 }).action, 'pause');
+ assert.equal(view({ status: 'downloading', progress: 41.6 }).progress, 42);
+ assert.equal(view({ status: 'paused', progress: 63 }).action, 'resume');
+ assert.equal(view({ status: 'error' }).action, 'start');
+ assert.equal(view({ status: 'error' }).isError, true);
+ for (const status of ['ready', 'checking', 'stopping', 'busy', 'unsupported']) {
+ assert.equal(view({ status }).action, null, `${status}: the button should not act`);
+ }
+ for (const status of ['not-downloaded', 'downloading', 'paused', 'ready', 'checking', 'stopping', 'busy', 'unsupported', 'error']) {
+ const { labelKey, statusKey } = view({ status });
+ assert.ok(english[labelKey], `${status}: label ${labelKey} should be translated`);
+ if (statusKey) assert.ok(english[statusKey], `${status}: status ${statusKey} should be translated`);
+ }
+
+ function fakeRuntime(responses) {
+ const sent = [];
+ const listeners = [];
+ return {
+ sent,
+ listeners,
+ onMessage: { addListener(fn) { listeners.push(fn); } },
+ async sendMessage(message) {
+ sent.push(message);
+ const reply = responses[message.action];
+ return typeof reply === 'function' ? reply(message) : reply;
+ },
+ };
+ }
+
+ // Never change the model of the active chat provider, or a model the user has.
+ for (const [name, providers, status, expected] of [
+ ['active WebGPU', { providers: { webgpu: { model: '' } }, active: 'webgpu' }, { status: 'not-downloaded' }, false],
+ ['configured model ready', { providers: { webgpu: { model: webgpu.WEBGPU_COMPASS_TINY_V2_MODEL_ID } }, active: 'webbrain_cloud' }, { status: 'ready', ready: true }, false],
+ ['configured model downloading', { providers: { webgpu: { model: webgpu.WEBGPU_COMPASS_TINY_V2_MODEL_ID } }, active: 'webbrain_cloud' }, { status: 'downloading' }, false],
+ ['already pointed', { providers: { webgpu: { model: modelId } }, active: 'webbrain_cloud' }, { status: 'not-downloaded' }, false],
+ ['default not downloaded', { providers: { webgpu: { model: webgpu.WEBGPU_COMPASS_TINY_V2_MODEL_ID } }, active: 'webbrain_cloud' }, { status: 'not-downloaded' }, true],
+ ]) {
+ const runtime = fakeRuntime({ get_providers: providers, get_webgpu_download_status: status, update_provider: { ok: true } });
+ assert.equal(await install.pointWebgpuProviderAtModel(modelId, { runtime }), expected, `${name}: repoint decision`);
+ const update = runtime.sent.find((message) => message.action === 'update_provider');
+ if (expected) {
+ assert.deepEqual(update, { target: 'background', action: 'update_provider', providerId: 'webgpu', config: { model: modelId }, markConfigured: false }, `${name}: only the WebGPU model changes`);
+ } else {
+ assert.equal(update, undefined, `${name}: the WebGPU provider should stay as it is`);
+ }
+ assert.ok(!runtime.sent.some((message) => message.action === 'set_active_provider'), `${name}: the active provider never changes`);
+ }
+
+ function fakeDocument() {
+ const element = (id, extra = {}) => {
+ const attributes = new Map();
+ const classes = new Set();
+ const listeners = new Map();
+ return {
+ id,
+ dataset: {},
+ hidden: false,
+ disabled: true,
+ textContent: '',
+ style: { props: {}, setProperty(name, value) { this.props[name] = value; } },
+ classList: { toggle(name, on) { if (on) classes.add(name); else classes.delete(name); }, contains: (name) => classes.has(name) },
+ setAttribute(name, value) { attributes.set(name, String(value)); },
+ removeAttribute(name) { attributes.delete(name); },
+ getAttribute(name) { return attributes.get(name) ?? null; },
+ addEventListener(type, fn) { listeners.set(type, fn); },
+ fire(type) { return listeners.get(type)?.(); },
+ ...extra,
+ };
+ };
+ const nodes = {
+ 'local-model': element('local-model', { dataset: { model: modelId, state: 'checking' } }),
+ 'local-model-button': element('local-model-button'),
+ 'local-model-label': element('local-model-label'),
+ 'local-model-progress': element('local-model-progress', { hidden: true }),
+ 'local-model-status': element('local-model-status'),
+ };
+ return { nodes, getElementById: (id) => nodes[id] || null };
+ }
+ const translate = (key, params = {}) => `${key}${params.progress != null ? `|${params.progress}` : ''}${params.error ? `|${params.error}` : ''}`;
+ const settle = () => new Promise((resolve) => setTimeout(resolve, 0));
+
+ assert.equal(install.initializeLocalModelDownload({ documentLike: { getElementById: () => null }, runtime: fakeRuntime({}) }), null, 'firefox: no local-model block, nothing to wire');
+
+ {
+ const documentLike = fakeDocument();
+ let status = { status: 'not-downloaded', modelId };
+ const runtime = fakeRuntime({
+ get_webgpu_download_status: (message) => (message.model === modelId ? status : { status: 'not-downloaded' }),
+ test_provider: { ok: true },
+ get_providers: { providers: { webgpu: { model: webgpu.WEBGPU_COMPASS_TINY_V2_MODEL_ID } }, active: 'webbrain_cloud' },
+ update_provider: { ok: true },
+ start_webgpu_download: () => { status = { status: 'downloading', modelId, loaded: 400, total: 1000 }; return { ok: true }; },
+ pause_webgpu_download: () => { status = { status: 'paused', modelId, progress: 40 }; return { ok: true }; },
+ });
+ const controller = install.initializeLocalModelDownload({ documentLike, runtime, translate, pollMs: 60_000 });
+ await settle();
+ const { nodes } = documentLike;
+ assert.equal(nodes['local-model'].dataset.state, 'not-downloaded');
+ assert.equal(nodes['local-model-button'].disabled, false, 'the button should become usable once the state is known');
+ assert.equal(nodes['local-model-label'].textContent, 'install.local_model.download');
+ assert.equal(nodes['local-model-progress'].hidden, true);
+
+ await nodes['local-model-button'].fire('click');
+ await settle();
+ assert.deepEqual(
+ runtime.sent.map((message) => message.action),
+ ['get_webgpu_download_status', 'test_provider', 'get_providers', 'get_webgpu_download_status', 'update_provider', 'start_webgpu_download', 'get_webgpu_download_status'],
+ 'start should probe WebGPU, point the idle WebGPU provider at the model, download it, then read progress',
+ );
+ assert.deepEqual(runtime.sent.find((message) => message.action === 'test_provider'), { target: 'background', action: 'test_provider', providerId: 'webgpu' });
+ assert.deepEqual(runtime.sent.find((message) => message.action === 'start_webgpu_download'), { target: 'background', action: 'start_webgpu_download', model: modelId });
+ assert.equal(nodes['local-model'].dataset.state, 'downloading');
+ assert.equal(nodes['local-model-progress'].hidden, false, 'progress should show while downloading');
+ assert.equal(nodes['local-model-progress'].getAttribute('aria-valuenow'), '40');
+ assert.equal(nodes['local-model-progress'].style.props['--local-model-progress'], '40%');
+ assert.equal(nodes['local-model-status'].textContent, 'install.local_model.downloading|40');
+ assert.equal(nodes['local-model-label'].textContent, 'install.local_model.pause');
+
+ // Pushed progress from the offscreen host updates without waiting for a poll.
+ runtime.listeners[0]({ type: 'webgpu-text-download-state', state: { status: 'downloading', modelId, progress: 55 } });
+ assert.equal(nodes['local-model-status'].textContent, 'install.local_model.downloading|55');
+ runtime.listeners[0]({ type: 'webgpu-text-download-state', state: { status: 'downloading', modelId: 'other/model', progress: 90 } });
+ assert.equal(nodes['local-model-status'].textContent, 'install.local_model.downloading|55', 'another model\'s progress is not ours');
+
+ await nodes['local-model-button'].fire('click');
+ await settle();
+ assert.equal(runtime.sent.filter((message) => message.action === 'pause_webgpu_download').length, 1, 'the running download can be paused');
+ assert.equal(nodes['local-model'].dataset.state, 'paused');
+ assert.equal(nodes['local-model-label'].textContent, 'install.local_model.resume');
+
+ const before = runtime.sent.length;
+ await nodes['local-model-button'].fire('click');
+ await settle();
+ assert.deepEqual(runtime.sent.slice(before).map((message) => message.action), ['start_webgpu_download', 'get_webgpu_download_status'], 'resume continues the transfer without probing again');
+
+ runtime.listeners[0]({ type: 'webgpu-text-download-state', state: { status: 'ready', ready: true, modelId } });
+ assert.equal(nodes['local-model'].dataset.state, 'ready');
+ assert.equal(nodes['local-model-button'].disabled, true, 'a downloaded model leaves nothing to click');
+ assert.equal(nodes['local-model-label'].textContent, 'install.local_model.ready');
+ assert.equal(nodes['local-model-progress'].hidden, true);
+ controller.dispose();
+ }
+
+ {
+ const documentLike = fakeDocument();
+ const runtime = fakeRuntime({
+ get_webgpu_download_status: { status: 'not-downloaded', modelId },
+ test_provider: { ok: false, error: 'Hardware WebGPU is unavailable.' },
+ });
+ const controller = install.initializeLocalModelDownload({ documentLike, runtime, translate, pollMs: 60_000 });
+ await settle();
+ await documentLike.nodes['local-model-button'].fire('click');
+ await settle();
+ assert.equal(documentLike.nodes['local-model'].dataset.state, 'unsupported', 'no hardware WebGPU: say so instead of downloading files that cannot run');
+ assert.ok(!runtime.sent.some((message) => ['start_webgpu_download', 'update_provider'].includes(message.action)), 'nothing is downloaded or reconfigured without hardware WebGPU');
+ assert.equal(documentLike.nodes['local-model-button'].disabled, true);
+ controller.dispose();
+ }
+
+ {
+ const documentLike = fakeDocument();
+ const runtime = fakeRuntime({
+ get_webgpu_download_status: { status: 'not-downloaded', modelId },
+ test_provider: { ok: true },
+ get_providers: { providers: { webgpu: { model: modelId } }, active: 'webbrain_cloud' },
+ start_webgpu_download: { error: 'webbrain-one/webbrain-compass-tiny-v2.1 is still downloading. Pause it before switching models.', status: 500 },
+ });
+ const controller = install.initializeLocalModelDownload({ documentLike, runtime, translate, pollMs: 60_000 });
+ await settle();
+ await documentLike.nodes['local-model-button'].fire('click');
+ await settle();
+ assert.equal(documentLike.nodes['local-model'].dataset.state, 'error');
+ assert.match(documentLike.nodes['local-model-status'].textContent, /^install\.local_model\.error\|.*still downloading/, 'a refused start should show the background error');
+ assert.equal(documentLike.nodes['local-model-status'].classList.contains('is-error'), true);
+ assert.equal(documentLike.nodes['local-model-label'].textContent, 'install.local_model.retry');
+ assert.equal(documentLike.nodes['local-model-button'].disabled, false, 'errors can be retried');
+ controller.dispose();
+ }
+
+ {
+ // Reopening the guide after a finished download shows the done state at once.
+ const documentLike = fakeDocument();
+ const runtime = fakeRuntime({ get_webgpu_download_status: { status: 'ready', ready: true, modelId } });
+ const controller = install.initializeLocalModelDownload({ documentLike, runtime, translate, pollMs: 60_000 });
+ await settle();
+ assert.equal(documentLike.nodes['local-model'].dataset.state, 'ready');
+ assert.match(documentLike.nodes['local-model-status'].textContent, /^install\.local_model\.ready_detail\b/);
+ controller.dispose();
+ }
+});
+
test('chrome /record reports mic denial as a warning, not recording failure', () => {
const panel = fs.readFileSync(path.join(ROOT, 'src/chrome/src/ui/sidepanel.js'), 'utf8');
const locale = fs.readFileSync(path.join(ROOT, 'src/chrome/src/ui/locales/en.js'), 'utf8');