diff --git a/apps/host/src/components/ComposerControls.tsx b/apps/host/src/components/ComposerControls.tsx index 485cfe97..fd680d8e 100644 --- a/apps/host/src/components/ComposerControls.tsx +++ b/apps/host/src/components/ComposerControls.tsx @@ -48,6 +48,7 @@ export function ComposerControls({ session, onPreview, onAttach, onError, onSlas const trigger = useRef(null), modeTrigger = useRef(null), thinkingTrigger = useRef(null); const attachLatest = useRef(onAttach); attachLatest.current = onAttach; + const addFilesLatest = useRef<(files: File[]) => Promise>(async () => { }); const mode = modes.find(m => m.value === session?.preferences?.mode) ?? modes[0]; const effort = efforts.includes(session?.preferences?.thinking ?? '') ? session!.preferences!.thinking! : 'Medium'; const budget = session?.preferences?.thinkingBudget ?? 0; @@ -117,6 +118,7 @@ export function ComposerControls({ session, onPreview, onAttach, onError, onSlas setReading(false); } } + addFilesLatest.current = files => addFiles(files); useEffect(() => { folder.current?.setAttribute('webkitdirectory', ''); const key = (e: KeyboardEvent) => { @@ -127,10 +129,12 @@ export function ComposerControls({ session, onPreview, onAttach, onError, onSlas }; const website = () => { setUrlOpen(true); setError(''); }; const preview = () => previewFile.current?.click(); + const dropped = (e: Event) => { if (!streaming && !reading) void addFilesLatest.current((e as CustomEvent).detail ?? []); }; + window.addEventListener('strata:drop-files', dropped); window.addEventListener('keydown', key); window.addEventListener('strata:open-website', website); window.addEventListener('strata:open-preview', preview); - return () => { window.removeEventListener('keydown', key); window.removeEventListener('strata:open-website', website); window.removeEventListener('strata:open-preview', preview); }; + return () => { window.removeEventListener('strata:drop-files', dropped); window.removeEventListener('keydown', key); window.removeEventListener('strata:open-website', website); window.removeEventListener('strata:open-preview', preview); }; }, [streaming, reading]); useEffect(() => { if (preferences !== 'mode') diff --git a/apps/host/src/components/Deliverables.tsx b/apps/host/src/components/Deliverables.tsx new file mode 100644 index 00000000..48b850a0 --- /dev/null +++ b/apps/host/src/components/Deliverables.tsx @@ -0,0 +1,73 @@ +import { useRef, useState } from 'react'; +import { tr } from '../lib/i18n'; +import { fileAction, fileSize, fileTypeLabel, previewOf, rawUrlOf, type ActivityGroup, type Deliverable } from '../lib/deliverables'; +import type { PreviewArtifact } from '../lib/artifacts'; +import { pushToast } from '../lib/store'; +import { plainFailureText } from '../lib/plain-errors'; +import { FloatingMenu } from './FloatingMenu'; +import { Icon } from './ui'; + +const problem = (title: string, e: unknown) => pushToast('error', tr(title), plainFailureText(e instanceof Error ? e.message : String(e)).message); + +/** A line's numbers ("+225 −0") shown as a pair of small figures; the sentence itself stays plain grey. */ +export function Plusminus({ added, removed }: { added: number; removed: number }) { + return +{added}−{removed}; +} + +const showOf = (file: { path: string; name: string }, sessionId: string, onPreview: (a: PreviewArtifact) => void, kind?: string) => + previewOf(sessionId, file).then(onPreview, e => { + // A file with no preview opens in its own app instead. + if (kind === 'other') return fileAction.open(sessionId, file.path, 'app').catch(err => problem('The file was not opened', err)); + return problem('The file has no preview', e); + }); + +/** One file the assistant made or changed: its type, name and size, and Open (in the sidebar) with a menu for the other things to do with it. */ +export function FileCard({ file, sessionId, onPreview }: { file: Deliverable; sessionId: string; onPreview: (a: PreviewArtifact) => void }) { + const more = useRef(null); + const [menu, setMenu] = useState(false), [busy, setBusy] = useState(false); + const run = async (fn: () => Promise, failed: string) => { setMenu(false); try { await fn(); } catch (e) { problem(failed, e); } }; + return
+ {fileTypeLabel(file)} + {file.name}{fileSize(file.size)} + + + + + {tr(menu ? setMenu(false)}> + + + + : null)} +
; +} + +/** "Edited N files": each with its lines added and removed, and the total under See all. */ +export function EditedFiles({ files, sessionId, onPreview }: { files: Deliverable[]; sessionId: string; onPreview: (a: PreviewArtifact) => void }) { + const [all, setAll] = useState(false); + const textual = files.filter(f => f.lines !== null); + if (textual.length < 2) return null; + const shown = all ? textual : textual.slice(0, 3); + const added = textual.reduce((n, f) => n + f.added, 0), removed = textual.reduce((n, f) => n + f.removed, 0); + return
+
{tr('Edited {0} files', [textual.length])}
+ {shown.map(f => )} + +
; +} + +/** A run of tool use between two pieces of text, as one quiet line: "Ran 2 commands, read monitor.png", with a thumbnail when it touched a picture. */ +export function ActivityLine({ group, sessionId, onPreview }: { group: ActivityGroup; sessionId: string; onPreview: (a: PreviewArtifact) => void }) { + const [open, setOpen] = useState(false); + const picture = group.files.find(f => f.kind === 'image'); + // The host's sentence may end with the numbers ("… +225 −0"): they are drawn as figures instead. + const sentence = group.line.replace(/\s*\+\d+\s*[−-]\s*\d+\s*$/, ''); + return
+ + {picture ? void showOf(picture, sessionId, onPreview)}/> : null} + {open ?
    {group.files.map(f =>
  • )}
: null} +
; +} diff --git a/apps/host/src/components/DropZone.tsx b/apps/host/src/components/DropZone.tsx new file mode 100644 index 00000000..44c935a6 --- /dev/null +++ b/apps/host/src/components/DropZone.tsx @@ -0,0 +1,21 @@ +import { useRef, useState, type ReactNode } from 'react'; +import { tr } from '../lib/i18n'; +import { Icon } from './ui'; + +/** Files dropped on the chat go where the attach button would put them: the composer reads the 'strata:drop-files' event. */ +export const DROP_EVENT = 'strata:drop-files'; +const hasFiles = (e: React.DragEvent) => Array.from(e.dataTransfer?.types ?? []).includes('Files'); + +/** The conversation column, with a calm highlight while something is dragged over it. */ +export function DropZone({ children, className }: { children: ReactNode; className?: string }) { + const [over, setOver] = useState(false); + const depth = useRef(0); + return
{ if (!hasFiles(e)) return; e.preventDefault(); depth.current++; setOver(true); }} + onDragOver={e => { if (!hasFiles(e)) return; e.preventDefault(); e.dataTransfer.dropEffect = 'copy'; }} + onDragLeave={e => { if (!hasFiles(e)) return; depth.current = Math.max(0, depth.current - 1); if (!depth.current) setOver(false); }} + onDrop={e => { if (!hasFiles(e)) return; e.preventDefault(); depth.current = 0; setOver(false); const files = Array.from(e.dataTransfer.files); if (files.length) window.dispatchEvent(new CustomEvent(DROP_EVENT, { detail: files })); }}> + {children} + {over ? : null} +
; +} diff --git a/apps/host/src/components/FamilySwitch.tsx b/apps/host/src/components/FamilySwitch.tsx index 27d55f59..7b7c2a4b 100644 --- a/apps/host/src/components/FamilySwitch.tsx +++ b/apps/host/src/components/FamilySwitch.tsx @@ -1,12 +1,30 @@ +import { useRef, useState } from 'react'; import { tr } from '../lib/i18n'; import type { CatalogModel } from '../lib/native-catalog'; +import { FloatingMenu } from './FloatingMenu'; +import { Icon } from './ui'; -/** The model families of the catalog as a switch in the navbar (Qwen3.8-Flash-Next, Qwen3.6-35B-A3B). A single family is just its name. */ +/** + * The model family in the Models navbar: its icon, its name and a chevron. Opening it lists the families of the catalog (Qwen3.8-Flash-Next, + * Qwen3.6-35B-A3B, and future ones) to switch between. One family still shows as the same control, so the page looks the same as families arrive. + */ export function FamilySwitch({ families, selected, onPick }: { families: CatalogModel[]; selected?: string; onPick: (family: CatalogModel) => void }) { const shown = families.filter(f => f.sizes.length); - if (shown.length < 2) return shown[0] ? {tr(shown[0].title)} : null; - return
- {shown.map(f => )} -
; + const trigger = useRef(null); + const [open, setOpen] = useState(false); + if (!shown.length) return null; + const current = shown.find(f => f.family === selected) ?? shown[0]; + return <> + + {tr(open ? setOpen(false)}> +
+ {shown.map(f => )} +
+
: null)} + ; } diff --git a/apps/host/src/components/NativeModels.tsx b/apps/host/src/components/NativeModels.tsx index a8d6c9a1..1cf8d3d4 100644 --- a/apps/host/src/components/NativeModels.tsx +++ b/apps/host/src/components/NativeModels.tsx @@ -17,6 +17,7 @@ import { tuneEffective } from '../lib/native-tune'; import { tunedFields } from '../lib/tune-values'; import { NativeSettings } from './NativeSettings'; import { RunImageModel } from './RunImageModel'; +import { IMAGE_GENERATION_VISIBLE } from '../lib/features'; import { useStore } from '../lib/store'; import { NativePresets } from './NativePresets'; import { NativeTune } from './NativeTune'; @@ -135,7 +136,7 @@ export function NativeModels({ onOtherModels, onReady, onImport, onConnectEngine {selectedSize && installed?.ready ? : null}
{tr(loadedSelected ? <> void perform(() => nativeAction(`instances/${loadedSelected.id}/unload`))}>{tr("Unload")}{tr(onReady ? {tr("Start chatting")} : {tr("Ready")})} : onReady && native?.instances.some(i => i.status === 'ready') ? {tr("Start chatting")} : <> setTuneOpen(true)}>{tr("Tune model")} void load()}>{tr(pending ? 'Checking…' : installed?.ready ? 'Load model' : 'Download & load')})}
- {tr(expert ? <>
{tr("Image generation ")}{tr("Optional")} { }}/>
: null)} + {tr(expert && IMAGE_GENERATION_VISIBLE ? <>
{tr("Image generation ")}{tr("Optional")} { }}/>
: null)} {tr(expert ?

{tr("Expert settings")}

{tr(tunedNow ?

{tr("Showing the values of your tuning '{0}'.", [tunedNow.name])}

: null)}
: null)} diff --git a/apps/host/src/lib/deliverables.ts b/apps/host/src/lib/deliverables.ts new file mode 100644 index 00000000..0b597000 --- /dev/null +++ b/apps/host/src/lib/deliverables.ts @@ -0,0 +1,96 @@ +import { api } from './client'; +import type { PreviewArtifact } from './artifacts'; + +/** + * Deliverables and grouped activity (notes-split-agent8.md, item 12). The host sends `deliverable` frames for every file the assistant wrote or + * changed and `activity-group` frames for runs of tool use between two pieces of text. A reply keeps them in the order they came, so the text + * that arrives between activities reads as one continuous piece. + */ +export type DeliverableKind = 'html' | 'markdown' | 'pdf' | 'csv' | 'image' | 'code' | 'text' | 'other'; +export interface Deliverable { path: string; abs: string; name: string; kind: DeliverableKind; status: 'created' | 'changed'; size: number; lines: number | null; added: number; removed: number } +export interface GroupFile { path: string; name: string; kind: DeliverableKind; status: string; added: number; removed: number } +export interface ActivityGroup { id: string; closed: boolean; line: string; added: number; removed: number; files: GroupFile[] } +export type MessageBlock = { kind: 'text'; text: string } | ({ kind: 'group' } & ActivityGroup); + +const KINDS = ['html', 'markdown', 'pdf', 'csv', 'image', 'code', 'text', 'other']; +const num = (v: unknown) => (Number.isFinite(Number(v)) ? Number(v) : 0); + +export function readDeliverable(raw: unknown): Deliverable | null { + if (!raw || typeof raw !== 'object') return null; + const f = raw as Record; + if (typeof f.path !== 'string' || !f.path) return null; + const name = typeof f.name === 'string' && f.name ? f.name : f.path.split(/[\\/]/).at(-1) ?? f.path; + return { + path: f.path, abs: typeof f.abs === 'string' ? f.abs : f.path, name, kind: KINDS.includes(String(f.kind)) ? f.kind as DeliverableKind : 'other', + status: f.status === 'changed' ? 'changed' : 'created', size: num(f.size), lines: f.lines === null || f.lines === undefined ? null : num(f.lines), added: num(f.added), removed: num(f.removed), + }; +} + +export function readGroup(raw: unknown): ActivityGroup | null { + if (!raw || typeof raw !== 'object') return null; + const g = raw as Record; + if (typeof g.id !== 'string' || !g.id) return null; + const files = Array.isArray(g.files) ? g.files.flatMap((x): GroupFile[] => { + const d = readDeliverable(x); + return d ? [{ path: d.path, name: d.name, kind: d.kind, status: d.status, added: d.added, removed: d.removed }] : []; + }) : []; + return { id: g.id, closed: g.closed === true, line: typeof g.line === 'string' ? g.line : '', added: num(g.added), removed: num(g.removed), files }; +} + +/** Add streamed text to the reply's ordered pieces: it continues the last text piece, or starts a new one after an activity line. */ +export function appendText(blocks: MessageBlock[] | undefined, text: string): MessageBlock[] { + const list = blocks ?? [], last = list.at(-1); + if (last?.kind === 'text') return [...list.slice(0, -1), { kind: 'text', text: last.text + text }]; + return [...list, { kind: 'text', text }]; +} + +/** A group frame is re-sent while it grows: the same id replaces its line; a new id goes after what came before. */ +export function upsertGroup(blocks: MessageBlock[] | undefined, group: ActivityGroup): MessageBlock[] { + const list = blocks ?? [], at = list.findIndex(b => b.kind === 'group' && b.id === group.id); + const next: MessageBlock = { kind: 'group', ...group }; + return at >= 0 ? list.map((b, i) => (i === at ? next : b)) : [...list, next]; +} + +/** The same file may be written more than once in a run: one card per path, with its latest numbers. */ +export function mergeDeliverable(list: Deliverable[] | undefined, file: Deliverable): Deliverable[] { + const have = list ?? [], at = have.findIndex(f => f.path === file.path); + if (at < 0) return [...have, file]; + const old = have[at]; + return have.map((f, i) => (i === at ? { ...file, status: old.status === 'created' ? 'created' : file.status, added: old.added + file.added, removed: old.removed + file.removed } : f)); +} + +export const fileTypeLabel = (d: { kind: DeliverableKind; name: string }) => { + const ext = d.name.includes('.') ? d.name.split('.').at(-1)!.toUpperCase() : ''; + return d.kind === 'markdown' ? 'MD' : d.kind === 'html' ? 'HTML' : d.kind === 'csv' ? 'CSV' : d.kind === 'pdf' ? 'PDF' : ext && ext.length <= 10 ? ext : d.kind.toUpperCase(); +}; + +export function fileSize(bytes: number): string { + if (bytes < 1024) return `${bytes} B`; + if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(bytes < 10240 ? 1 : 0)} KB`; + return `${(bytes / 1024 / 1024).toFixed(1)} MB`; +} + +const csvText = (rows: string[][]) => rows.map(r => r.map(c => (/[",\n]/.test(c) ? `"${c.replace(/"/g, '""')}"` : c)).join(',')).join('\n'); + +interface PreviewAnswer { kind: DeliverableKind; name: string; path: string; size: number; url?: string; text?: string; rows?: string[][]; rawUrl?: string; note?: string } + +/** The sidebar preview of a file: the host reads it (only inside the chat's folder) and the page draws it as a website, markdown, table, picture, PDF or code. */ +export async function previewOf(sessionId: string, file: { path: string; name: string }): Promise { + const a = await api.get(`/api/files/preview?sessionId=${encodeURIComponent(sessionId)}&path=${encodeURIComponent(file.path)}`); + const id = `file:${a.path}`, title = a.name || file.name; + if (a.kind === 'image' && a.rawUrl) return { id, kind: 'image', title, url: a.rawUrl }; + if (a.kind === 'pdf' && a.rawUrl) return { id, kind: 'pdf', title, url: a.rawUrl }; + if (a.kind === 'html' && a.text !== undefined) return { id, kind: 'website', title, content: a.text }; + if (a.kind === 'markdown' && a.text !== undefined) return { id, kind: 'markdown', title, content: a.text }; + if (a.kind === 'csv' && a.rows) return { id, kind: 'table', title, content: csvText(a.rows) }; + if (a.text !== undefined) return { id, kind: 'code', title, content: a.text }; + throw new Error(a.note || 'This file has no preview. Open it in its own app.'); +} + +export const fileAction = { + open: (sessionId: string, path: string, how: 'browser' | 'app' | 'folder') => api.post('/api/files/open', { sessionId, path, how }), + fullPath: async (sessionId: string, path: string) => (await api.get<{ path: string }>(`/api/files/path?sessionId=${encodeURIComponent(sessionId)}&path=${encodeURIComponent(path)}`)).path, + attach: (sessionId: string, path: string) => api.post('/api/chat/attachments', { sessionId, path }), +}; + +export const rawUrlOf = (sessionId: string, path: string) => `/api/files/raw?sessionId=${encodeURIComponent(sessionId)}&path=${encodeURIComponent(path)}`; diff --git a/apps/host/src/lib/features.ts b/apps/host/src/lib/features.ts index 86ba6efd..39b5f125 100644 --- a/apps/host/src/lib/features.ts +++ b/apps/host/src/lib/features.ts @@ -1 +1,2 @@ -export const features = { toolAccess: false, thinkingLevels: false, sessionLog: true, demosInComposer: false } as const; +/** Image generation is hidden everywhere in the interface for this version (round 8, item 8). The pieces stay in the code; flip this to bring them back. */ +export const IMAGE_GENERATION_VISIBLE = false; diff --git a/apps/host/src/lib/store.ts b/apps/host/src/lib/store.ts index aa089593..61ff5a01 100644 --- a/apps/host/src/lib/store.ts +++ b/apps/host/src/lib/store.ts @@ -4,6 +4,7 @@ import { updateAgent } from './agents'; import { LOOP_MAX_RUNS, LOOP_USAGE, loopEvery, parseLoop, type LoopCommand } from './loop'; import { applyStatusFrame, clearStatus } from './live-status'; import { applyGoalFrame } from './goal'; +import { appendText, mergeDeliverable, readDeliverable, readGroup, upsertGroup } from './deliverables'; import { applyPlanFrame, applyQueueFrame, planApprove, queueMessage } from './plan'; import { TIME_SKIP_DURATION, timeSkipPrompt, timeSkipTabId, withTimeSkipResult, type TimeSkipFile, type TimeSkipJob, type TimeSkipRun, type TimeSkipVersion } from './time-skip'; import { PREVIEW_EXAMPLES, type PreviewArtifact } from './artifacts'; @@ -1650,7 +1651,13 @@ export async function sendMessage(text: string, options: { fromLoop?: boolean; g } else if (type === 'agent') { patchSession(sessionId, s => ({ ...s, agents: updateAgent(s.agents ?? [], frame.agent) })); } else if (type === 'delta') { - patchAssistant((m) => { const content=m.content+String(frame.text??''); if (m.reasoningStartedAt && m.reasoningMs === undefined) m = { ...m, reasoningMs: Date.now() - m.reasoningStartedAt }; const count=Math.max(1,Math.ceil((content.length+(m.reasoning?.length??0))/4)); return {...m,content,tokens:m.usageSource==='estimated'&&m.tps?m.tokens:count,inputTokens:m.inputTokens??Math.ceil((body.length+prior.reduce((n,p)=>n+p.content.length,0))/4),usageSource:'estimated'}; }); + patchAssistant((m) => { const content=m.content+String(frame.text??''); if (m.reasoningStartedAt && m.reasoningMs === undefined) m = { ...m, reasoningMs: Date.now() - m.reasoningStartedAt }; const count=Math.max(1,Math.ceil((content.length+(m.reasoning?.length??0))/4)); return {...m,content,...(m.blocks?{blocks:appendText(m.blocks,String(frame.text??''))}:{}),tokens:m.usageSource==='estimated'&&m.tps?m.tokens:count,inputTokens:m.inputTokens??Math.ceil((body.length+prior.reduce((n,p)=>n+p.content.length,0))/4),usageSource:'estimated'}; }); + } else if (type === 'deliverable') { + const file = readDeliverable(frame); + if (file) patchAssistant(m => ({ ...m, deliverables: mergeDeliverable(m.deliverables, file) })); + } else if (type === 'activity-group') { + const group = readGroup(frame); + if (group) patchAssistant(m => ({ ...m, blocks: upsertGroup(m.blocks ?? (m.content ? appendText(undefined, m.content) : undefined), group) })); } else if (type === 'artifacts' && Array.isArray(frame.artifacts)) { patchAssistant(m => ({ ...m, artifacts: frame.artifacts as PreviewArtifact[] })); } else if(type==='native-tool'){ diff --git a/apps/host/src/lib/types.ts b/apps/host/src/lib/types.ts index 67ff69d2..bfc8613a 100644 --- a/apps/host/src/lib/types.ts +++ b/apps/host/src/lib/types.ts @@ -320,6 +320,10 @@ export interface ChatMessage { timeSkipId?: string; /** The plan this reply proposed: shown as the plan card in place of the reply text. */ planId?: string; + /** The reply in the order it came: text and grouped activity lines (round 8, item 12). Absent on older replies. */ + blocks?: import('./deliverables').MessageBlock[]; + /** Files the assistant made or changed in this reply, one card each. */ + deliverables?: import('./deliverables').Deliverable[]; /** A line from the app itself (for example from /loop), never sent to the model. */ local?: boolean; ttftMs?: number; diff --git a/apps/host/src/locales/de.json b/apps/host/src/locales/de.json index 1c832e9b..38d71892 100644 --- a/apps/host/src/locales/de.json +++ b/apps/host/src/locales/de.json @@ -3087,9 +3087,22 @@ "s3091": "übersprungen", "s3092": "Pausiert · {0} von {1} erledigt", "s3093": "Plan genehmigt.", - "s3094": "Der Assistent antwortet noch", - "s3095": "Senden Sie Ihre Nachricht, wenn er fertig ist.", - "s3096": "Die Nachricht wurde nicht eingereiht", - "s3097": "In der Warteschlange — wird danach gesendet", - "s3098": "In der Warteschlange — wird gesendet, wenn das Ziel erreicht ist" + "s3094": "Experimentell", + "s3095": "Weitere Möglichkeiten, {0} zu öffnen", + "s3096": "Dateiaktionen", + "s3097": "Im Ordner anzeigen", + "s3098": "Pfad kopieren", + "s3099": "Als Kontext anhängen", + "s3100": "Pfad kopiert", + "s3101": "An Ihre nächste Nachricht angehängt", + "s3102": "Die Datei wurde nicht geöffnet", + "s3103": "Für diese Datei gibt es keine Vorschau", + "s3104": "Der Ordner wurde nicht geöffnet", + "s3105": "Der Pfad wurde nicht kopiert", + "s3106": "Die Datei wurde nicht angehängt", + "s3107": "{0} Zeilen hinzugefügt, {1} entfernt", + "s3108": "{0} Dateien bearbeitet", + "s3109": "Alle anzeigen", + "s3110": "Dateien hier ablegen, um sie hinzuzufügen", + "s3111": "Bilder und Textdateien" } diff --git a/apps/host/src/locales/en.json b/apps/host/src/locales/en.json index 2cec82a5..03ce6e51 100644 --- a/apps/host/src/locales/en.json +++ b/apps/host/src/locales/en.json @@ -3087,9 +3087,22 @@ "s3091": "skipped", "s3092": "Paused · {0} of {1} done", "s3093": "Approved the plan.", - "s3094": "The assistant is still answering", - "s3095": "Send your message when it has finished.", - "s3096": "The message was not queued", - "s3097": "Queued — sends after that", - "s3098": "Queued — sends when the goal finishes" + "s3094": "Experimental", + "s3095": "More ways to open {0}", + "s3096": "File actions", + "s3097": "Show in folder", + "s3098": "Copy path", + "s3099": "Attach as context", + "s3100": "Path copied", + "s3101": "Attached to your next message", + "s3102": "The file was not opened", + "s3103": "The file has no preview", + "s3104": "The folder was not opened", + "s3105": "The path was not copied", + "s3106": "The file was not attached", + "s3107": "{0} lines added, {1} removed", + "s3108": "Edited {0} files", + "s3109": "See all", + "s3110": "Drop files to add them", + "s3111": "Pictures and text files" } diff --git a/apps/host/src/locales/es.json b/apps/host/src/locales/es.json index c9395412..54b73e52 100644 --- a/apps/host/src/locales/es.json +++ b/apps/host/src/locales/es.json @@ -3087,9 +3087,22 @@ "s3091": "omitido", "s3092": "En pausa · {0} de {1} hechos", "s3093": "Plan aprobado.", - "s3094": "El asistente aún está respondiendo", - "s3095": "Envía tu mensaje cuando haya terminado.", - "s3096": "No se pudo poner el mensaje en cola", - "s3097": "En cola — se envía después", - "s3098": "En cola — se envía cuando termine el objetivo" + "s3094": "Experimental", + "s3095": "Más formas de abrir {0}", + "s3096": "Acciones del archivo", + "s3097": "Mostrar en la carpeta", + "s3098": "Copiar la ruta", + "s3099": "Adjuntar como contexto", + "s3100": "Ruta copiada", + "s3101": "Adjunto a tu próximo mensaje", + "s3102": "No se abrió el archivo", + "s3103": "Este archivo no tiene vista previa", + "s3104": "No se abrió la carpeta", + "s3105": "No se copió la ruta", + "s3106": "No se adjuntó el archivo", + "s3107": "{0} líneas añadidas, {1} eliminadas", + "s3108": "{0} archivos editados", + "s3109": "Ver todo", + "s3110": "Suelta archivos para añadirlos", + "s3111": "Imágenes y archivos de texto" } diff --git a/apps/host/src/locales/ja.json b/apps/host/src/locales/ja.json index fbb2cda3..d23a4fb0 100644 --- a/apps/host/src/locales/ja.json +++ b/apps/host/src/locales/ja.json @@ -3087,9 +3087,22 @@ "s3091": "スキップ", "s3092": "一時停止中 · {1} 件中 {0} 件完了", "s3093": "プランを承認しました。", - "s3094": "アシスタントはまだ回答中です", - "s3095": "完了してからメッセージを送ってください。", - "s3096": "メッセージを待機に入れられませんでした", - "s3097": "待機中 — その後に送信", - "s3098": "待機中 — ゴールの完了後に送信" + "s3094": "試験的", + "s3095": "{0} を開くその他の方法", + "s3096": "ファイル操作", + "s3097": "フォルダーで表示", + "s3098": "パスをコピー", + "s3099": "コンテキストとして添付", + "s3100": "パスをコピーしました", + "s3101": "次のメッセージに添付しました", + "s3102": "ファイルを開けませんでした", + "s3103": "このファイルはプレビューできません", + "s3104": "フォルダーを開けませんでした", + "s3105": "パスをコピーできませんでした", + "s3106": "ファイルを添付できませんでした", + "s3107": "{0} 行追加、{1} 行削除", + "s3108": "{0} 個のファイルを編集", + "s3109": "すべて表示", + "s3110": "ファイルをドロップして追加", + "s3111": "画像とテキストファイル" } diff --git a/apps/host/src/locales/ko.json b/apps/host/src/locales/ko.json index e8f77bd1..28973cd0 100644 --- a/apps/host/src/locales/ko.json +++ b/apps/host/src/locales/ko.json @@ -3087,9 +3087,22 @@ "s3091": "건너뜀", "s3092": "일시 중지 · {1}개 중 {0}개 완료", "s3093": "계획을 승인했습니다.", - "s3094": "어시스턴트가 아직 답하는 중입니다", - "s3095": "끝난 뒤에 메시지를 보내 주세요.", - "s3096": "메시지를 대기열에 넣지 못했습니다", - "s3097": "대기 중 — 그 다음에 전송됩니다", - "s3098": "대기 중 — 목표가 끝나면 전송됩니다" + "s3094": "실험적", + "s3095": "{0}을(를) 여는 다른 방법", + "s3096": "파일 작업", + "s3097": "폴더에서 보기", + "s3098": "경로 복사", + "s3099": "컨텍스트로 첨부", + "s3100": "경로를 복사했습니다", + "s3101": "다음 메시지에 첨부했습니다", + "s3102": "파일을 열지 못했습니다", + "s3103": "이 파일은 미리 볼 수 없습니다", + "s3104": "폴더를 열지 못했습니다", + "s3105": "경로를 복사하지 못했습니다", + "s3106": "파일을 첨부하지 못했습니다", + "s3107": "{0}줄 추가, {1}줄 삭제", + "s3108": "파일 {0}개 편집됨", + "s3109": "모두 보기", + "s3110": "파일을 놓아 추가하세요", + "s3111": "사진 및 텍스트 파일" } diff --git a/apps/host/src/locales/pt.json b/apps/host/src/locales/pt.json index 5de3161a..e2ed45a6 100644 --- a/apps/host/src/locales/pt.json +++ b/apps/host/src/locales/pt.json @@ -3087,9 +3087,22 @@ "s3091": "ignorado", "s3092": "Pausado · {0} de {1} concluídos", "s3093": "Plano aprovado.", - "s3094": "O assistente ainda está respondendo", - "s3095": "Envie sua mensagem quando ele terminar.", - "s3096": "A mensagem não foi colocada na fila", - "s3097": "Na fila — enviada depois disso", - "s3098": "Na fila — enviada quando a meta terminar" + "s3094": "Experimental", + "s3095": "Mais formas de abrir {0}", + "s3096": "Ações do arquivo", + "s3097": "Mostrar na pasta", + "s3098": "Copiar o caminho", + "s3099": "Anexar como contexto", + "s3100": "Caminho copiado", + "s3101": "Anexado à sua próxima mensagem", + "s3102": "O arquivo não foi aberto", + "s3103": "Este arquivo não tem pré-visualização", + "s3104": "A pasta não foi aberta", + "s3105": "O caminho não foi copiado", + "s3106": "O arquivo não foi anexado", + "s3107": "{0} linhas adicionadas, {1} removidas", + "s3108": "{0} arquivos editados", + "s3109": "Ver tudo", + "s3110": "Solte arquivos para adicioná-los", + "s3111": "Imagens e arquivos de texto" } diff --git a/apps/host/src/locales/ru.json b/apps/host/src/locales/ru.json index 3b189491..7f8b08ed 100644 --- a/apps/host/src/locales/ru.json +++ b/apps/host/src/locales/ru.json @@ -3087,9 +3087,22 @@ "s3091": "пропущено", "s3092": "Пауза · готово {0} из {1}", "s3093": "План одобрен.", - "s3094": "Ассистент ещё отвечает", - "s3095": "Отправьте сообщение, когда он закончит.", - "s3096": "Сообщение не удалось поставить в очередь", - "s3097": "В очереди — отправится после этого", - "s3098": "В очереди — отправится, когда цель будет достигнута" + "s3094": "Экспериментально", + "s3095": "Другие способы открыть {0}", + "s3096": "Действия с файлом", + "s3097": "Показать в папке", + "s3098": "Копировать путь", + "s3099": "Прикрепить как контекст", + "s3100": "Путь скопирован", + "s3101": "Прикреплено к вашему следующему сообщению", + "s3102": "Файл не удалось открыть", + "s3103": "У этого файла нет предпросмотра", + "s3104": "Папку не удалось открыть", + "s3105": "Путь не удалось скопировать", + "s3106": "Файл не удалось прикрепить", + "s3107": "Добавлено строк: {0}, удалено: {1}", + "s3108": "Изменено файлов: {0}", + "s3109": "Показать все", + "s3110": "Перетащите файлы, чтобы добавить их", + "s3111": "Изображения и текстовые файлы" } diff --git a/apps/host/src/locales/zh.json b/apps/host/src/locales/zh.json index 795518a1..b3b67f16 100644 --- a/apps/host/src/locales/zh.json +++ b/apps/host/src/locales/zh.json @@ -3087,9 +3087,22 @@ "s3091": "已跳过", "s3092": "已暂停 · 已完成 {0}/{1}", "s3093": "已批准计划。", - "s3094": "助手仍在回答", - "s3095": "等它完成后再发送你的消息。", - "s3096": "消息未能排队", - "s3097": "已排队 — 在此之后发送", - "s3098": "已排队 — 目标完成后发送" + "s3094": "实验性", + "s3095": "打开 {0} 的更多方式", + "s3096": "文件操作", + "s3097": "在文件夹中显示", + "s3098": "复制路径", + "s3099": "作为上下文附加", + "s3100": "路径已复制", + "s3101": "已附加到你的下一条消息", + "s3102": "文件未能打开", + "s3103": "此文件无法预览", + "s3104": "文件夹未能打开", + "s3105": "路径未能复制", + "s3106": "文件未能附加", + "s3107": "新增 {0} 行,删除 {1} 行", + "s3108": "已编辑 {0} 个文件", + "s3109": "查看全部", + "s3110": "拖放文件即可添加", + "s3111": "图片和文本文件" } diff --git a/apps/host/src/screens/Chat.tsx b/apps/host/src/screens/Chat.tsx index 1b898ef3..8b17cb24 100644 --- a/apps/host/src/screens/Chat.tsx +++ b/apps/host/src/screens/Chat.tsx @@ -21,6 +21,8 @@ import { ReasoningBlock } from '../components/ReasoningBlock'; import { StatusLine } from '../components/StatusLine'; import { GoalBar } from '../components/GoalBar'; import { PlanCard, PlanPanel, QueuedMessages } from '../components/PlanCard'; +import { DropZone } from '../components/DropZone'; +import { ActivityLine, EditedFiles, FileCard } from '../components/Deliverables'; import { queueMessage, usePlan, usePlanQuiet } from '../lib/plan'; import { plainFailureText } from '../lib/plain-errors'; import { useLiveStatus } from '../lib/live-status'; @@ -358,7 +360,7 @@ export function ChatScreen() { return (<> { setSelectedPreview(null); setExpanded(false); }} inline={inlinePreview} expanded={expanded} onExpand={() => setExpanded(v => !v)}/>
-
+
{tr(awayFromBottom ? () : null)} @@ -367,7 +369,7 @@ export function ChatScreen() {
-
+ setSelectedPreview(null)} inline={inlinePreview}/> {tr(resizeHandle)} @@ -380,7 +382,7 @@ export function ChatScreen() { the context panel open, a full-width composer sat underneath the panel and drifted out of alignment with the transcript it belongs to. */}
-
+
{ const el = e.currentTarget; if (session) @@ -403,7 +405,7 @@ export function ChatScreen() {
{tr(awayFromBottom ? () : null)}
-
+
{tr(!setupVisible && selectedRun && session ? { setSelectedPreview(null); setExpanded(false); }}/> : null)} {tr(!setupVisible && planShown ? : null)} setSelectedPreview(null)} inline={inlinePreview}/> @@ -571,6 +573,8 @@ function Message({ message: m, isLast, onEditPrompt, onPreview, onOpenLink, onOp // A reply that proposed a plan shows the plan card in place of its closing text (which is the plan in prose). const storedPlan = usePlanQuiet(m.planId ? activeSession : null); const planCard = !!m.planId && storedPlan?.id === m.planId; + // A reply with activity lines is drawn piece by piece in the order it came; one without is the plain text it always was. + const grouped = !!m.blocks?.some(b => b.kind === 'group'); const [sentTime, setSentTime] = useState(() => relTime(m.at)); if (m.role === 'user') { return (
setSentTime(relTime(m.at))} onFocus={() => setSentTime(relTime(m.at))}> @@ -593,18 +597,20 @@ function Message({ message: m, isLast, onEditPrompt, onPreview, onOpenLink, onOp {tr(m.reasoning ? : null)} - {tr((m.tools ?? []).map((t) => ()))} + {tr((m.tools ?? []).filter(t => !grouped || t.state !== 'done').map((t) => ()))} {tr(!(m.timeSkipId && timeSkipReal && !timeSkipDone) && (m.content || m.error || !m.streaming || !liveStatus) ?
{tr(planCard ? : null)} {tr(m.error ? () : null)} - {tr(m.content && !planCard ? ( onPreview({ id: m.id + '-html', kind: 'website', title: 'HTML preview', content })}/>) : !m.error && m.streaming && !liveStatus ? ( + {tr(grouped && !planCard && !m.timeSkipId ? m.blocks!.map((b, i) => b.kind === 'group' ? : onPreview({ id: m.id + '-html-' + i, kind: 'website', title: 'HTML preview', content })}/>) : null)} + {tr(m.content && !planCard && !grouped ? ( onPreview({ id: m.id + '-html', kind: 'website', title: 'HTML preview', content })}/>) : !m.error && m.streaming && !liveStatus ? ( ) : null)} {tr(m.streaming && m.content ?
: null)} + {tr(m.deliverables?.length && !m.streaming ?
{m.deliverables.map(f => )}
: null)} {tr(m.streaming && isLast && !m.timeSkipId ? : null)} {tr(m.timeSkipId && timeSkipReal && !timeSkipDone && timeSkipRun ? : m.timeSkipId && (!timeSkipReal || (timeSkipRun?.job?.files?.length ?? 0) > 0) ? : null)} diff --git a/apps/host/src/screens/ModelRun.tsx b/apps/host/src/screens/ModelRun.tsx index a4d8bc31..16ec83e9 100644 --- a/apps/host/src/screens/ModelRun.tsx +++ b/apps/host/src/screens/ModelRun.tsx @@ -10,6 +10,7 @@ import { RunningModels } from '../components/RunningModels'; import { LocalModelImport } from '../components/LocalModelImport'; import { gpuId } from '../lib/monitor-hardware'; import { RunImageModel } from '../components/RunImageModel'; +import { IMAGE_GENERATION_VISIBLE } from '../lib/features'; import { FloatingMenu } from '../components/FloatingMenu'; import { ModelsScreen } from './Models'; import { configDocument, configPatch, readConfig, type ConfigDocument } from '../lib/config'; @@ -424,7 +425,7 @@ function LegacyModelRunScreen({ importFirst = false, initialVariant }: {
{tr("Version")}