Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.
C++
Round 8: neutral Open result button, pictures uploaded to /api/chat/upload and sent as imageIds, picture-reading files note on the Models tab
Niko122176707b230b1f
diff --git a/apps/host/src/components/NativeModels.tsx b/apps/host/src/components/NativeModels.tsxindex 1cf8d3d4f..65785517a 100644--- a/apps/host/src/components/NativeModels.tsx+++ b/apps/host/src/components/NativeModels.tsx@@ -128,7 +128,7 @@ export function NativeModels({ onOtherModels, onReady, onImport, onConnectEngine<div className="native-choice__col"><span className="native-choice__label">{tr("Conversation context")}</span><Select ariaLabel={tr("Conversation context")} value={String(context)} options={(native?.catalog?.contexts ?? [8192, 32768, 65536, 131072, 262144]).map(n => ({ value: String(n), label: `${n / 1024}K` }))} onChange={n => setContext(Number(n))}/></div><div className="native-choice__col"><span className="native-choice__label">{tr("Computer use")}</span><div className="native-resource-choice"><button aria-pressed={resourceProfile === 'work'} data-selected={resourceProfile === 'work'} onClick={() => setResourceProfile('work')}><Icon name="computer" size={20}/><span><strong>{tr("Leave 20% for my work")}</strong><small>{tr("Headroom for your other apps")}</small></span>{tr(resourceProfile === 'work' ? <Icon name="check" size={15}/> : null)}</button><button aria-pressed={resourceProfile === 'performance'} data-selected={resourceProfile === 'performance'} onClick={() => setResourceProfile('performance')}><Icon name="bolt" size={20}/><span><strong>{tr("Full performance")}</strong><small>{tr("Give Strata priority")}</small></span>{tr(resourceProfile === 'performance' ? <Icon name="check" size={15}/> : null)}</button></div></div></div>- {tr(selectedSize?.images ? <div className="native-image-reading"><label><input type="checkbox" checked={vision !== 'no'} disabled={!selectedSize?.images || !!active} onChange={e => setVision(e.target.checked ? 'yes' : 'no')}/><span><strong>{tr("Read pictures ")}<small>{tr("Optional")}</small></strong><small>{tr("Understand photos, screenshots and charts. Vision files download automatically. Enable them when loading this model.")}</small></span></label>{tr(expert && vision !== 'no' ? <Select ariaLabel={tr("Image encoder device")} value={vision === 'yes' ? 'yes' : vision} options={[{ value: 'yes', label: 'Automatic' }, { value: 'gpu', label: 'GPU' }, { value: 'cpu', label: 'CPU' }]} onChange={setVision}/> : null)}</div> : null)}+ {tr(selectedSize?.images ? <><div className="native-image-reading"><label><input type="checkbox" checked={vision !== 'no'} disabled={!selectedSize?.images || !!active} onChange={e => setVision(e.target.checked ? 'yes' : 'no')}/><span><strong>{tr("Read pictures ")}<small>{tr("Optional")}</small></strong><small>{tr("Understand photos, screenshots and charts. Vision files download automatically. Enable them when loading this model.")}</small></span></label>{tr(expert && vision !== 'no' ? <Select ariaLabel={tr("Image encoder device")} value={vision === 'yes' ? 'yes' : vision} options={[{ value: 'yes', label: 'Automatic' }, { value: 'gpu', label: 'GPU' }, { value: 'cpu', label: 'CPU' }]} onChange={setVision}/> : null)}</div>{tr(vision !== 'no' && installed?.ready && installed.visionPrepared === false ? <div className="native-vision-missing" role="status"><span>{tr("Picture reading needs a few more files that are not on this computer yet.")}</span><Btn size="sm" disabled={pending || !!active} onClick={() => void download()}>{tr("Download picture-reading files")}</Btn></div> : null)}</> : null)}</> : null)}{tr(active ? <NativeProgress job={active}/> : null)}{tr(job?.state === 'error' ? <ErrorNotice message={job.error ?? job.summary} action={tr("Retry")} onRetry={() => void load()}/> : null)}diff --git a/apps/host/src/components/TimeSkipPanel.tsx b/apps/host/src/components/TimeSkipPanel.tsxindex 385e0971c..b6450f187 100644--- a/apps/host/src/components/TimeSkipPanel.tsx+++ b/apps/host/src/components/TimeSkipPanel.tsx@@ -192,7 +192,7 @@ export function TimeSkipPanel({ run, sessionId, inline, expanded, onCompare, onC</section></div></div>- <footer className="ts-footer"><div>{tr(sideBySide ? <Btn onClick={() => openResult('original')} icon="file">{tr("Open original")}</Btn> : null)}<Btn variant="primary" block disabled={(sideBySide || version === 'updated') && !ready} onClick={() => openResult(sideBySide ? 'updated' : version)}><Icon name="file" size={15}/>{tr(!sideBySide && version === 'original' ? 'Open original' : 'Open result')}<Icon name="chevron" size={12} className="timeskip-card-arrow"/></Btn><button ref={menuAnchor} className="st-btn st-btn--icon" aria-label={tr("More Time-skip actions")} aria-haspopup="menu" aria-expanded={menu} onClick={() => setMenu(v => !v)}><Icon name="ellipsis" size={17}/></button></div></footer>+ <footer className="ts-footer"><div>{tr(sideBySide ? <Btn onClick={() => openResult('original')} icon="file">{tr("Open original")}</Btn> : null)}<Btn variant="secondary" className="btn-neutral" block disabled={(sideBySide || version === 'updated') && !ready} onClick={() => openResult(sideBySide ? 'updated' : version)}><Icon name="file" size={15}/>{tr(!sideBySide && version === 'original' ? 'Open original' : 'Open result')}<Icon name="chevron" size={12} className="timeskip-card-arrow"/></Btn><button ref={menuAnchor} className="st-btn st-btn--icon" aria-label={tr("More Time-skip actions")} aria-haspopup="menu" aria-expanded={menu} onClick={() => setMenu(v => !v)}><Icon name="ellipsis" size={17}/></button></div></footer>{tr(menu ? <FloatingMenu anchor={menuAnchor.current} title={tr("Time-skip actions")} onClose={() => setMenu(false)}><button role="menuitem" className="menu__item" disabled={!frame.done} onClick={() => restore(kept === 'original' ? 'updated' : 'original')}><Icon name="branch"/>{tr(kept === 'original' ? 'Keep updated result' : 'Restore original result')}</button>{real ? (!frame.done ? <button role="menuitem" className="menu__item" onClick={() => { setMenu(false); void stopTimeSkip(sessionId, run.id); }}><Icon name="stop"/>{tr("Stop Time-skip")}</button> : null) : <button role="menuitem" className="menu__item" onClick={() => { setMenu(false); onCompare(false); replayTimeSkip(sessionId, run.id); }}><Icon name="refresh"/>{tr("Replay example")}</button>}</FloatingMenu> : null)}</aside>;return inline ? content : <Dialog open title={tr("Time-skip")} onClose={onClose} sheet wide={expanded} className="ts-dialog">{tr(content)}</Dialog>;diff --git a/apps/host/src/lib/chat-photos.ts b/apps/host/src/lib/chat-photos.tsindex 4fb537738..684eebee8 100644--- a/apps/host/src/lib/chat-photos.ts+++ b/apps/host/src/lib/chat-photos.ts@@ -8,6 +8,10 @@ export async function attachChatPhoto(file:File,id?:string|null){if(!['image/pngexport function removeChatPhoto(photo:string,id?:string|null){queues.set(key(id),(queues.get(key(id))??[]).filter(i=>i.id!==photo));listeners.forEach(fn=>fn());}export function pendingChatPhotos(id?:string|null){return queues.get(key(id))??empty;}export function takeChatPhotos(id?:string|null){const value=queues.get(key(id))??[];queues.delete(key(id));listeners.forEach(fn=>fn());return value;}+/** The stored picture itself, for uploading it to the host. */+export async function photoBlob(photo:ChatPhoto):Promise<Blob>{const db=await database();const file=await new Promise<Blob|undefined>((resolve,reject)=>{const request=db.transaction('photos','readonly').objectStore('photos').get(photo.id);request.onsuccess=()=>resolve(request.result);request.onerror=()=>reject(new Error('Could not read the attached picture.'));});db.close();if(!file)throw new Error(`${photo.name} is no longer in browser storage. Attach it again.`);return file;}+/** Upload the pictures of a message to the chat (POST /api/chat/upload); the host answers an id for each, which the send names as imageIds. */+export async function uploadChatPhotos(photos:ChatPhoto[],sessionId:string):Promise<string[]>{const ids:string[]=[];for(const photo of photos){const blob=await photoBlob(photo);const res=await fetch(`${(globalThis as {__STRATA_HOST__?:string}).__STRATA_HOST__??""}/api/chat/upload?sessionId=${encodeURIComponent(sessionId)}&name=${encodeURIComponent(photo.name)}`,{method:'POST',headers:{'content-type':blob.type||'application/octet-stream'},body:blob});const data=await res.json().catch(()=>({})) as {files?:{id:string|null;kind:string}[];error?:string};if(!res.ok)throw new Error(data.error||'The picture could not be sent. Try another one.');const id=data.files?.find(f=>f.kind==='image'&&f.id)?.id;if(!id)throw new Error('The picture could not be read. Use a PNG, JPEG or WebP picture.');ids.push(id);}return ids;}export async function photoData(photo:ChatPhoto){const db=await database();const file=await new Promise<Blob|undefined>((resolve,reject)=>{const request=db.transaction('photos','readonly').objectStore('photos').get(photo.id);request.onsuccess=()=>resolve(request.result);request.onerror=()=>reject(new Error('Could not read the attached picture.'));});db.close();if(!file)throw new Error(`${photo.name} is no longer in browser storage. Attach it again.`);return new Promise<{name:string;url:string}>((resolve,reject)=>{const reader=new FileReader();reader.onload=()=>resolve({name:photo.name,url:String(reader.result)});reader.onerror=()=>reject(new Error('Could not read this picture.'));reader.readAsDataURL(file);});}/** Keep at most three pictures in the inference context, including this turn. Originals remain in IndexedDB. */diff --git a/apps/host/src/lib/native.ts b/apps/host/src/lib/native.tsindex fdff0c0e5..1dda34989 100644--- a/apps/host/src/lib/native.ts+++ b/apps/host/src/lib/native.ts@@ -6,7 +6,7 @@ export interface NativeFamily {family:string;title:string;about:string;experimenexport interface NativeField {id:string;label:string;group:string;type:'number'|'boolean'|'string'|'enum'|'array';min?:number;max?:number;choices?:string[];hint?:string;supported?:boolean}export interface NativeJob {id:string;kind:string;guided?:boolean;model?:string;state:'running'|'done'|'error'|'cancelled';startedAt:string;summary:string;error:string|null;details?:string;result:Record<string,any>|null;progress?:Record<string,any>|null}export interface NativeInstance {id:string;apiModelId:string;model:string;label:string;aliases?:string[];vision?:boolean;resourceProfile?:'work'|'performance'|null;context?:number;port:number;gpus:number[];status:'loading'|'ready'|'unloading'|'error';phase:string;loadedAt:string;error:string|null;metrics:Record<string,any>|null}-export interface NativeState {available:boolean;repo:string;downloadDirectory?:string;version?:string|null;summary:string;error:string|null;catalog:{families:NativeFamily[];contexts:number[];recommendation:{family:string|null;model:string|null;context?:number;why?:string};context_note:string}|null;installed:{models:{model:string;config:string;model_name:string;ready:boolean;context?:number;kv?:string;images?:string;visionEnabled?:boolean;visionDevice?:string;lowRamMode?:string;resourceProfile?:'work'|'performance';dataFolder?:string;diskGb?:number;diskBytes?:number;missing_files?:string[]}[];data_folder:string;engine:{version:string|null}}|null;hardware:{ram_gb:number;gpus:{index:number;name:string;vram_gb:number;usable:boolean}[]}|null;fields:NativeField[];instances:NativeInstance[];defaultId:string|null;jobs:NativeJob[];capabilities:{responses?:boolean;updates:boolean;rollback:boolean;calibration:boolean;componentUpdates?:boolean}}+export interface NativeState {available:boolean;repo:string;downloadDirectory?:string;version?:string|null;summary:string;error:string|null;catalog:{families:NativeFamily[];contexts:number[];recommendation:{family:string|null;model:string|null;context?:number;why?:string};context_note:string}|null;installed:{models:{model:string;config:string;model_name:string;ready:boolean;/** The picture-reading files are on this computer (notes-split-agent8.md, item 8). */visionPrepared?:boolean;context?:number;kv?:string;images?:string;visionEnabled?:boolean;visionDevice?:string;lowRamMode?:string;resourceProfile?:'work'|'performance';dataFolder?:string;diskGb?:number;diskBytes?:number;missing_files?:string[]}[];data_folder:string;engine:{version:string|null}}|null;hardware:{ram_gb:number;gpus:{index:number;name:string;vram_gb:number;usable:boolean}[]}|null;fields:NativeField[];instances:NativeInstance[];defaultId:string|null;jobs:NativeJob[];capabilities:{responses?:boolean;updates:boolean;rollback:boolean;calibration:boolean;componentUpdates?:boolean}}let state:NativeState|null=null,timer:ReturnType<typeof setInterval>|null=null,reading:Promise<void>|null=null;const listeners=new Set<()=>void>();let again=false;diff --git a/apps/host/src/lib/store.ts b/apps/host/src/lib/store.tsindex 8e5bf27bf..e98afd8c0 100644--- a/apps/host/src/lib/store.ts+++ b/apps/host/src/lib/store.ts@@ -10,7 +10,7 @@ import { forkFields, isForkJob, TIME_SKIP_DURATION, timeSkipPrompt, timeSkipTabIimport { PREVIEW_EXAMPLES, type PreviewArtifact } from './artifacts';import { lifecyclePolicy } from './lifecycle';import { newestServingState } from './serving-state';-import { photoData, photoHistorySlots, pendingChatPhotos, takeChatPhotos } from './chat-photos';+import { photoData, uploadChatPhotos, photoHistorySlots, pendingChatPhotos, takeChatPhotos } from './chat-photos';import { nativeState } from './native';import { setTranslationLanguage, tr, validLanguage, type Language } from './i18n';/**@@ -1595,7 +1595,7 @@ export async function sendMessage(text: string, options: { fromLoop?: boolean; gmodel: state.library?.loaded ?? state.library?.current ?? null,remoteModel: state.remoteModel,nativeModelId:nativeState()?.instances.length?nativeState()?.defaultId:undefined,- images:await Promise.all(pictures.map(photoData)),+ ...(pictures.length ? { imageIds: await uploadChatPhotos(pictures, sessionId) } : {}),useTools:state.sessions.find(s=>s.id===sessionId)?.preferences?.useTools===true,// A chat set to plain talk (preferences.agent === false) never runs a tool: the host answers it directly....(state.sessions.find(s=>s.id===sessionId)?.preferences?.agent===false?{agent:false}:{}),diff --git a/apps/host/src/locales/de.json b/apps/host/src/locales/de.jsonindex 47bc0ada8..492a85e2c 100644--- a/apps/host/src/locales/de.json+++ b/apps/host/src/locales/de.json@@ -3117,8 +3117,8 @@"s3121": "Eine Version behalten","s3122": "Version A ist in Ihren Dateien.","s3123": "Version B ist in Ihren Dateien.",- "s3124": "Version A behalten",- "s3125": "Version B behalten",+ "s3124": "Für das Lesen von Bildern fehlen noch einige Dateien auf diesem Computer.",+ "s3125": "Dateien zum Lesen von Bildern herunterladen","s3126": "Zwei Versionen zum Vergleichen","s3127": "A und B sind jeweils vollständig durchgelaufen. Behalten Sie die, die Ihnen gefällt.","s3128": "Time-skip funktioniert mit einem geladenen Modell. Wählen Sie eines im Tab „Modelle“ und versuchen Sie es erneut."diff --git a/apps/host/src/locales/en.json b/apps/host/src/locales/en.jsonindex 2654c4349..427ffa5e7 100644--- a/apps/host/src/locales/en.json+++ b/apps/host/src/locales/en.json@@ -3117,8 +3117,8 @@"s3121": "Keep a version","s3122": "Version A is in your files.","s3123": "Version B is in your files.",- "s3124": "Version A kept",- "s3125": "Version B kept",+ "s3124": "Picture reading needs a few more files that are not on this computer yet.",+ "s3125": "Download picture-reading files","s3126": "Two versions to compare","s3127": "A and B each went all the way through. Keep the one you like.","s3128": "Time-skip works on a loaded model. Choose one on the Models tab, then try again."diff --git a/apps/host/src/locales/es.json b/apps/host/src/locales/es.jsonindex 9f3d8bf84..0e5d23160 100644--- a/apps/host/src/locales/es.json+++ b/apps/host/src/locales/es.json@@ -3117,8 +3117,8 @@"s3121": "Conservar una versión","s3122": "La versión A está en tus archivos.","s3123": "La versión B está en tus archivos.",- "s3124": "Versión A conservada",- "s3125": "Versión B conservada",+ "s3124": "Para leer imágenes faltan algunos archivos que aún no están en este equipo.",+ "s3125": "Descargar los archivos para leer imágenes","s3126": "Dos versiones para comparar","s3127": "A y B llegaron hasta el final. Conserva la que prefieras.","s3128": "Time-skip funciona con un modelo cargado. Elige uno en la pestaña Modelos y vuelve a intentarlo."diff --git a/apps/host/src/locales/ja.json b/apps/host/src/locales/ja.jsonindex 207539995..d7bc1349e 100644--- a/apps/host/src/locales/ja.json+++ b/apps/host/src/locales/ja.json@@ -3117,8 +3117,8 @@"s3121": "バージョンを残す","s3122": "バージョン A がファイルに反映されています。","s3123": "バージョン B がファイルに反映されています。",- "s3124": "バージョン A を残しました",- "s3125": "バージョン B を残しました",+ "s3124": "画像の読み取りには、このコンピューターにまだない追加ファイルが必要です。",+ "s3125": "画像読み取り用ファイルをダウンロード","s3126": "比べる 2 つのバージョン","s3127": "A も B も最後まで完了しました。気に入った方を残してください。","s3128": "Time-skip は読み込み済みのモデルで動作します。モデルタブで選んでから、もう一度お試しください。"diff --git a/apps/host/src/locales/ko.json b/apps/host/src/locales/ko.jsonindex 13fc315b4..612df529d 100644--- a/apps/host/src/locales/ko.json+++ b/apps/host/src/locales/ko.json@@ -3117,8 +3117,8 @@"s3121": "버전 유지","s3122": "버전 A가 파일에 적용되었습니다.","s3123": "버전 B가 파일에 적용되었습니다.",- "s3124": "버전 A 유지됨",- "s3125": "버전 B 유지됨",+ "s3124": "사진 읽기에는 아직 이 컴퓨터에 없는 파일이 더 필요합니다.",+ "s3125": "사진 읽기 파일 다운로드","s3126": "비교할 두 버전","s3127": "A와 B 모두 끝까지 진행되었습니다. 마음에 드는 쪽을 유지하세요.","s3128": "Time-skip은 불러온 모델에서 작동합니다. 모델 탭에서 하나를 고른 뒤 다시 시도하세요."diff --git a/apps/host/src/locales/pt.json b/apps/host/src/locales/pt.jsonindex 40b52384e..9da637643 100644--- a/apps/host/src/locales/pt.json+++ b/apps/host/src/locales/pt.json@@ -3117,8 +3117,8 @@"s3121": "Manter uma versão","s3122": "A versão A está nos seus arquivos.","s3123": "A versão B está nos seus arquivos.",- "s3124": "Versão A mantida",- "s3125": "Versão B mantida",+ "s3124": "A leitura de imagens precisa de alguns arquivos que ainda não estão neste computador.",+ "s3125": "Baixar os arquivos de leitura de imagens","s3126": "Duas versões para comparar","s3127": "A e B foram até o fim. Mantenha a que preferir.","s3128": "O Time-skip funciona com um modelo carregado. Escolha um na aba Modelos e tente de novo."diff --git a/apps/host/src/locales/ru.json b/apps/host/src/locales/ru.jsonindex aec071e3d..8f0dc27c7 100644--- a/apps/host/src/locales/ru.json+++ b/apps/host/src/locales/ru.json@@ -3117,8 +3117,8 @@"s3121": "Оставить версию","s3122": "Версия A в ваших файлах.","s3123": "Версия B в ваших файлах.",- "s3124": "Версия A оставлена",- "s3125": "Версия B оставлена",+ "s3124": "Для чтения изображений нужны дополнительные файлы, которых на этом компьютере ещё нет.",+ "s3125": "Скачать файлы для чтения изображений","s3126": "Две версии для сравнения","s3127": "И A, и B дошли до конца. Оставьте ту, что нравится.","s3128": "Time-skip работает с загруженной моделью. Выберите её на вкладке «Модели» и повторите."diff --git a/apps/host/src/locales/zh.json b/apps/host/src/locales/zh.jsonindex b027671ef..dee0246ec 100644--- a/apps/host/src/locales/zh.json+++ b/apps/host/src/locales/zh.json@@ -3117,8 +3117,8 @@"s3121": "保留一个版本","s3122": "版本 A 已在你的文件中。","s3123": "版本 B 已在你的文件中。",- "s3124": "已保留版本 A",- "s3125": "已保留版本 B",+ "s3124": "读取图片还需要一些此电脑上尚没有的文件。",+ "s3125": "下载图片读取文件","s3126": "两个版本待比较","s3127": "A 和 B 都已完整完成。保留你喜欢的那个。","s3128": "Time-skip 需要已加载的模型。请在“模型”标签页选择一个,然后重试。"diff --git a/apps/host/src/styles/app.css b/apps/host/src/styles/app.cssindex 76edb7e3a..149c2092c 100644--- a/apps/host/src/styles/app.css+++ b/apps/host/src/styles/app.css@@ -7474,3 +7474,8 @@ textarea {.tsf__lane[data-state="waiting"] .tsf__name, .tsf__lane[data-state="pending"] .tsf__name { opacity: .6; }@media (prefers-reduced-motion: reduce) { .tsf__prog i { transition: none; } }.ts-keep__buttons { display: inline-flex; gap: 8px; }++/* A neutral, theme-following button for content cards: no green (round 8 follow-up) */+.st-btn.btn-neutral { background: var(--st-surface); color: var(--st-ink); border: 1px solid var(--st-line); box-shadow: none; }+.st-btn.btn-neutral:hover:not(:disabled) { background: var(--st-surface-2); }+.native-vision-missing { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: var(--st-fs-sm); color: var(--st-ink-soft); }