diff --git a/apps/desktop/scripts/harness-prune.mjs b/apps/desktop/scripts/harness-prune.mjs new file mode 100644 index 00000000..35b81124 --- /dev/null +++ b/apps/desktop/scripts/harness-prune.mjs @@ -0,0 +1,79 @@ +/** + * Which files and folders of the staged Harness are dropped, and the check that nothing the Harness imports is gone. + * + * The 2026-10-17 tester report: on Linux and Mac every agent chat failed ("session/create ... waiting for workflowEngine"). + * Cause: the old rule "drop any folder named after another operating system" also removed the Harness's own JavaScript package + * `@deepseek-ai/dsh-win32-process`. It is plain JS (no binary), and `dsh-subprocess-local` and `dsh-sandbox-local` import it by + * name on every platform, so those two plugins failed to load, and everything waiting on them (shell, subprocess, ptcRuntime, + * workflowEngine) never started. Windows kept it (the rule differs there), so the Windows tests passed. + */ +import { existsSync, readFileSync, readdirSync } from 'node:fs'; +import { join, sep } from 'node:path'; + +export const OTHER_OS = { + win32: /(^|[\\/._-])(darwin|linux|android|freebsd|musl)([\\/._-]|$)/i, + darwin: /(^|[\\/._-])(win32|linux|android|freebsd|musl)([\\/._-]|$)/i, + // Linux: the AppImage bundler (linuxdeploy) resolves the libraries of every ELF file under resources and stops on one it + // cannot satisfy (koffi's musl build wants libc.musl). The app is glibc x86_64, so musl and other-CPU builds are dropped. + linux: /(^|[\\/._-])(win32|darwin|android|freebsd|musl|arm64|aarch64|armv7|arm|ia32|riscv64|ppc64|s390x|loong64)([\\/._-]|$)/i, +}; +const NATIVE_FOLDER = /prebuild|bin|native|platform|-(win32|darwin|linux)/i; + +/** The Harness's own JavaScript packages (`@deepseek-ai/dsh-*`) are code every platform imports by name; never drop one. */ +export function isHarnessCodePackage(path) { + const parts = path.split(sep); + const i = parts.lastIndexOf('@deepseek-ai'); + return i >= 0 && i === parts.length - 2 && parts[i + 1].startsWith('dsh-'); +} + +/** True when the folder `path` (a directory named `name`) is another operating system's prebuilt binary and can go. */ +export function isOtherOsBinaryFolder(platform, name, path) { + const rule = OTHER_OS[platform] ?? OTHER_OS.linux; + if (isHarnessCodePackage(path)) return false; + return rule.test(name) && NATIVE_FOLDER.test(path); +} + +/** Imports the Windows copy (which works) is also without: browser-side or dev-only bundles, and the document converter the app drops on purpose. */ +const KNOWN_ABSENT = new Set([ + '@deepseek-ai/libreoffice-kit', '@deepseek-ai/dsh-client-ui-dockkit', '@deepseek-ai/dsh-client-web', + '@deepseek-ai/dsh-experimental-webworker-runtime', '@deepseek-ai/dsh-remote-mock', '@deepseek-ai/dsh-client-test-runtime', +]); + +function jsFiles(dir, out = []) { + for (const e of readdirSync(dir, { withFileTypes: true })) { + const p = join(dir, e.name); + if (e.isSymbolicLink()) continue; + if (e.isDirectory()) jsFiles(p, out); + else if (/\.(m?js|cjs)$/.test(e.name)) out.push(p); + } + return out; +} + +/** + * Every bare `@deepseek-ai/` the staged Harness's own packages import (static `from "x"` and `import("x")`) must exist + * in the staged node_modules. Returns the list of `{from, missing}` problems (empty = good). Plugins that are only loaded on + * another platform still count: Node resolves a static import whether or not the code runs. + */ +export function missingHarnessImports(harnessDir) { + const scope = join(harnessDir, 'node_modules', '@deepseek-ai'); + if (!existsSync(scope)) return [{ from: scope, missing: '@deepseek-ai (no installed packages)' }]; + const problems = []; + const seen = new Set(); + const re = /(?:from|import)\s*\(?\s*["'](@deepseek-ai\/[^"'/]+)(?:\/[^"']*)?["']/g; + for (const pkg of readdirSync(scope)) { + const lib = join(scope, pkg, 'lib'); + if (!existsSync(lib)) continue; + for (const file of jsFiles(lib)) { + const text = readFileSync(file, 'utf8'); + for (const m of text.matchAll(re)) { + const name = m[1]; + const key = `${pkg}>${name}`; + if (seen.has(key) || KNOWN_ABSENT.has(name)) continue; + seen.add(key); + if (!existsSync(join(harnessDir, 'node_modules', ...name.split('/'))) + && !existsSync(join(scope, pkg, 'node_modules', ...name.split('/')))) problems.push({ from: `${pkg}`, missing: name }); + } + } + } + return problems; +} diff --git a/apps/desktop/scripts/repack-appimage.sh b/apps/desktop/scripts/repack-appimage.sh index c0fe4d8a..d7b36c14 100755 --- a/apps/desktop/scripts/repack-appimage.sh +++ b/apps/desktop/scripts/repack-appimage.sh @@ -49,6 +49,14 @@ for d in control harness node engine-bundle; do [ -d "$RES/$d" ] || continue rsync -aL --checksum --delete --exclude .gitignore "$RES/$d/" "$LIB/$d/" done +# The launcher records the environment the AppImage was started from, before its own hooks add the AppImage's libraries and GTK/GIO +# settings (LD_LIBRARY_PATH, GTK_*, XDG_DATA_DIRS ...). The host gives it back to every program that is not Strata's own (zenity, +# kdialog, xdg-open, the assistant's shell): apps/host/server/external-env.mjs. Without it a system program loads the AppImage's libssl +# and dies ("OPENSSL_3.2.0 not found"). The line goes right after `this_dir=...`, ahead of every hook. +if ! grep -q STRATA_ORIGINAL_ENV "$WORK/AppDir/AppRun"; then + sed -i '/^this_dir=/a # Strata: the environment this AppImage was started from (given back to programs that are not Strata'"'"'s own)\nexport STRATA_ORIGINAL_ENV="$(env -0 | base64 -w0)"' "$WORK/AppDir/AppRun" + grep -q STRATA_ORIGINAL_ENV "$WORK/AppDir/AppRun" || { echo "could not add the environment record to AppRun" >&2; exit 1; } +fi mksquashfs "$WORK/AppDir" "$WORK/app.squashfs" -root-owned -noappend -comp zstd -b 131072 -no-progress >/dev/null head -c "$OFFSET" "$IN" > "$OUT" cat "$WORK/app.squashfs" >> "$OUT" diff --git a/apps/desktop/scripts/stage-harness.mjs b/apps/desktop/scripts/stage-harness.mjs index 7ea86c34..7327d88e 100644 --- a/apps/desktop/scripts/stage-harness.mjs +++ b/apps/desktop/scripts/stage-harness.mjs @@ -18,6 +18,7 @@ import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, import { join, relative, resolve, sep } from 'node:path'; import { createHash } from 'node:crypto'; import { flattenPnpm } from './flatten-pnpm.mjs'; +import { isOtherOsBinaryFolder, missingHarnessImports } from './harness-prune.mjs'; const args = process.argv.slice(2); const opt = (name, fallback) => { const i = args.indexOf(`--${name}`); return i >= 0 ? args[i + 1] : fallback; }; @@ -118,11 +119,6 @@ const flat = flattenPnpm(out, { skip: /libreoffice-kit|sherpa-onnx/i }); console.log(`flattened: ${flat.packages} placed (${flat.nested} nested for a second version)`); // --- prune ------------------------------------------------------------------------------------------------------------ -const OTHER_OS = platform === 'win32' ? /(^|[\\/._-])(darwin|linux|android|freebsd|musl)([\\/._-]|$)/i - : platform === 'darwin' ? /(^|[\\/._-])(win32|linux|android|freebsd|musl)([\\/._-]|$)/i - : /(^|[\\/._-])(win32|darwin|android|freebsd|musl|arm64|aarch64|armv7|arm|ia32|riscv64|ppc64|s390x|loong64)([\\/._-]|$)/i; -// Linux: the AppImage bundler (linuxdeploy) resolves the libraries of every ELF file under resources and stops on one it -// cannot satisfy (koffi's musl build wants libc.musl). The app is glibc x86_64, so musl and other-CPU builds are dropped. /** Whole packages the app never loads: office-document conversion (hundreds of MB) and speech input. */ const DROP_PACKAGES = [/libreoffice-kit/i, /sherpa-onnx/i]; /** Only when sitting directly in a package's root (a library may have a runtime folder called `doc`, e.g. yaml/dist/doc). */ @@ -137,7 +133,7 @@ function prune(dir) { if (e.isSymbolicLink()) continue; if (e.isDirectory()) { const inLib = p.split(sep).includes('lib'); - if ((DROP_DIRS.has(e.name) && !inLib && existsSync(join(dir, 'package.json'))) || DROP_PACKAGES.some(r => r.test(e.name)) || (OTHER_OS.test(e.name) && /prebuild|bin|native|platform|-(win32|darwin|linux)/i.test(p))) { + if ((DROP_DIRS.has(e.name) && !inLib && existsSync(join(dir, 'package.json'))) || DROP_PACKAGES.some(r => r.test(e.name)) || isOtherOsBinaryFolder(platform, e.name, p)) { rmSync(p, { recursive: true, force: true }); removed++; continue; } prune(p); @@ -165,7 +161,13 @@ writeFileSync(join(out, 'BUNDLE.json'), JSON.stringify({ if (keepIgnore) writeFileSync(join(out, '.gitignore'), keepIgnore); -// --- proof: the staged copy answers --version and boots the web profile once ---------------------------------------- +// --- proof 1: nothing the Harness imports by name was pruned ------------------------------------------------------------ +// (2026-10-17: the other-OS rule once removed @deepseek-ai/dsh-win32-process, which every platform imports; Linux/Mac agent chats died.) +const lost = missingHarnessImports(out); +if (lost.length) { console.error(['staged Harness is missing imported packages:', ...lost.map(l => ` ${l.from} -> ${l.missing}`)].join(String.fromCharCode(10))); process.exit(1); } +console.log('import check: every @deepseek-ai package the Harness imports is staged'); + +// --- proof 2: the staged copy answers --version and boots the web profile once ---------------------------------------- const bin = join(out, 'apps', 'cli', 'lib', 'bin.js'); const entry = existsSync(bin) ? bin : join(out, 'lib', 'bin.js'); const v = spawnSync(process.execPath, [entry, '--version'], { encoding: 'utf8' }); diff --git a/apps/desktop/src-tauri/nsis/installer.nsi b/apps/desktop/src-tauri/nsis/installer.nsi index 38a4510b..45692664 100644 --- a/apps/desktop/src-tauri/nsis/installer.nsi +++ b/apps/desktop/src-tauri/nsis/installer.nsi @@ -202,6 +202,9 @@ ShowInstDetails nevershow ; 4. Custom page to ask user if he wants to reinstall/uninstall ; only if a previous installation was detected Var ReinstallPageCheck +; 1 when this installer was started on an installed copy of the SAME version and the person chose Uninstall: after it ran the +; uninstaller this installer ends. (Stock Tauri goes on to the install pages, so Uninstall reinstalled Strata at once; tester report 2026-10-17.) +Var UninstallOnly Page custom PageReinstall PageLeaveReinstall Function PageReinstall ; Uninstall previous WiX installation if exists. @@ -346,6 +349,7 @@ Function PageLeaveReinstall ${If} $R1 = 1 ; User chose to add/reinstall Goto reinst_done ${Else} ; User chose to uninstall + StrCpy $UninstallOnly 1 Goto reinst_uninstall ${EndIf} ${ElseIf} $R0 = 1 ; Upgrading @@ -408,6 +412,12 @@ Function PageLeaveReinstall Delete "$4\uninstall.exe" RMDir "$4" ${EndIf} + + ; Uninstall means uninstall: do not go on to the install pages. + ${If} $UninstallOnly = 1 + MessageBox MB_OK|MB_ICONINFORMATION "Strata was uninstalled." + Quit + ${EndIf} reinst_done: FunctionEnd @@ -451,45 +461,33 @@ FunctionEnd ; 1. Confirm uninstall page Var DeleteAppDataCheckbox Var DeleteAppDataCheckboxState -!define /ifndef WS_EX_LAYOUTRTL 0x00400000 -!define MUI_PAGE_CUSTOMFUNCTION_SHOW un.ConfirmShow -Function un.ConfirmShow ; Add add a `Delete app data` check box - ; $1 inner dialog HWND - ; $2 window DPI - ; $3 style - ; $4 x - ; $5 y - ; $6 width - ; $7 height - FindWindow $1 "#32770" "" $HWNDPARENT ; Find inner dialog - System::Call "user32::GetDpiForWindow(p r1) i .r2" - ${If} $(^RTL) = 1 - StrCpy $3 "${__NSD_CheckBox_EXSTYLE} | ${WS_EX_LAYOUTRTL}" - IntOp $4 50 * $2 - ${Else} - StrCpy $3 "${__NSD_CheckBox_EXSTYLE}" - IntOp $4 0 * $2 - ${EndIf} - IntOp $5 100 * $2 - IntOp $6 400 * $2 - IntOp $7 25 * $2 - IntOp $4 $4 / 96 - IntOp $5 $5 / 96 - IntOp $6 $6 / 96 - IntOp $7 $7 / 96 - System::Call 'user32::CreateWindowEx(i r3, w "${__NSD_CheckBox_CLASS}", w "$(deleteAppData)", i ${__NSD_CheckBox_STYLE}, i r4, i r5, i r6, i r7, p r1, i0, i0, i0) i .s' - Pop $DeleteAppDataCheckbox - SendMessage $HWNDPARENT ${WM_GETFONT} 0 0 $1 - SendMessage $DeleteAppDataCheckbox ${WM_SETFONT} $1 1 -FunctionEnd -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.ConfirmLeave -Function un.ConfirmLeave - SendMessage $DeleteAppDataCheckbox ${BM_GETCHECK} 0 0 $DeleteAppDataCheckboxState -FunctionEnd !define MUI_PAGE_CUSTOMFUNCTION_PRE un.SkipIfPassive !insertmacro MUI_UNPAGE_CONFIRM -; 2. Uninstalling Page +; 2. "Also remove my Strata data": unticked by default, and it says exactly what it deletes. Skipped when updating or in passive mode +; (an update never deletes anything). Model folders the person chose themselves are never touched. +UninstPage custom un.DataPage un.DataPageLeave +Function un.DataPage + ${If} $PassiveMode = 1 + ${OrIf} $UpdateMode = 1 + Abort + ${EndIf} + !insertmacro MUI_HEADER_TEXT "Remove your Strata data too?" "Your models, chats and settings stay on this PC unless you tick the box." + nsDialogs::Create 1018 + Pop $0 + ${IfThen} $(^RTL) = 1 ${|} nsDialogs::SetRTL $(^RTL) ${|} + ${NSD_CreateCheckBox} 0 0 100% 12u "Also remove my Strata data (models, chats, settings)" + Pop $DeleteAppDataCheckbox + ${NSD_CreateLabel} 12u 18u -12u 96u "If you tick it, these folders are deleted, and nothing else:$\r$\n$\r$\n$LOCALAPPDATA\Strata (engine, installed copy, tunings)$\r$\n$APPDATA\Strata (settings)$\r$\n$PROFILE\.strata (your chats, app settings)$\r$\n$DOCUMENTS\Strata\Models (models Strata downloaded into its own folder)$\r$\n$\r$\nA model folder you chose yourself is never deleted." + Pop $0 + ${NSD_SetFocus} $DeleteAppDataCheckbox + nsDialogs::Show +FunctionEnd +Function un.DataPageLeave + ${NSD_GetState} $DeleteAppDataCheckbox $DeleteAppDataCheckboxState +FunctionEnd + +; 3. Uninstalling Page !insertmacro MUI_UNPAGE_INSTFILES ;Languages @@ -931,6 +929,21 @@ Section Uninstall SetShellVarContext current RmDir /r "$APPDATA\${BUNDLEID}" RmDir /r "$LOCALAPPDATA\${BUNDLEID}" + + ; Strata's own data, for a fresh start: the folders listed on the page, nothing else. Each path is checked first. + ${If} "$LOCALAPPDATA" != "" + RmDir /r "$LOCALAPPDATA\Strata" + ${EndIf} + ${If} "$APPDATA" != "" + RmDir /r "$APPDATA\Strata" + ${EndIf} + ${If} "$PROFILE" != "" + RmDir /r "$PROFILE\.strata" + ${EndIf} + ${If} "$DOCUMENTS" != "" + RmDir /r "$DOCUMENTS\Strata\Models" + RmDir "$DOCUMENTS\Strata" ; only if it is empty now + ${EndIf} ${EndIf} !ifmacrodef NSIS_HOOK_POSTUNINSTALL diff --git a/apps/host/server/agent/agent-bridge.mjs b/apps/host/server/agent/agent-bridge.mjs index 07ceed36..e3e2c308 100644 --- a/apps/host/server/agent/agent-bridge.mjs +++ b/apps/host/server/agent/agent-bridge.mjs @@ -44,6 +44,24 @@ export function plainAgentFailure(raw) { return text; } +/** + * A failure thrown while a turn starts, as `{ message, details, code }` for the chat's error card. The agent's own errors read like + * `session/create: tool-bash (...): waiting for shell ...` (a plugin chain that never started): never shown raw. The plain sentence + * goes in `message`; the technical text goes in `details`, which the app shows only behind Details. + */ +export function plainTurnFailure(err) { + const raw = String(err?.message ?? err ?? ''); + const details = typeof err?.details === 'string' && err.details ? err.details : raw; + if (err instanceof AgentUnavailable) return { message: err.message, details, code: err.code ?? 'AGENT_ERROR' }; + if (err?.code === 'agent-preset/invalid' || /waiting for (shell|subprocess|ptcRuntime|workflowEngine|sandbox)|failed to import|did not activate/i.test(raw)) { + return { message: 'The coding assistant is missing a part it needs, so it cannot work on files yet. Close and reopen Strata. If it keeps happening, reinstall Strata. Chatting without tools still works.', details, code: 'AGENT_INCOMPLETE' }; + } + if (/^[a-z][a-z-]*\/[a-z][a-z-]*: /i.test(raw) || /^(gateway|rpc)/i.test(raw)) { + return { message: 'The coding assistant could not start this message. Try again. If it keeps happening, close and reopen Strata.', details, code: err?.code ?? 'AGENT_ERROR' }; + } + return { message: plainAgentFailure(raw), details, code: err?.code ?? 'AGENT_ERROR' }; +} + /** Attached pictures (data addresses) as the Harness's image prompt parts. */ export function imageParts(images) { return (Array.isArray(images) ? images : []).map(i => { diff --git a/apps/host/server/agent/harness-runtime.mjs b/apps/host/server/agent/harness-runtime.mjs index 4a1b0d8b..5093e54c 100644 --- a/apps/host/server/agent/harness-runtime.mjs +++ b/apps/host/server/agent/harness-runtime.mjs @@ -12,6 +12,7 @@ import { spawn, spawnSync } from 'node:child_process'; import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; import { join, resolve } from 'node:path'; +import { externalEnvironment } from '../external-env.mjs'; const URL_PATTERN = /http:\/\/127\.0\.0\.1:(\d+)\/\?token=([A-Za-z0-9_-]+)/; @@ -23,7 +24,9 @@ const KEEP = /^(PATH|PATHEXT|SYSTEMROOT|WINDIR|COMSPEC|TEMP|TMP|TMPDIR|HOME|USER /** The environment the agent gets: a filtered copy of the host's, plus exactly the names passed in `extra`. */ export function agentEnvironment(base = process.env, extra = {}) { const out = {}; - for (const [k, v] of Object.entries(base)) { + // The shell and tools the assistant runs for the person are the person's own programs: they get the environment the AppImage was + // started from, never Strata's bundled libraries and GTK/GIO settings (external-env.mjs). Outside an AppImage this is `base`. + for (const [k, v] of Object.entries(externalEnvironment(base))) { if (v === undefined || !KEEP.test(k) || SECRET_NAME.test(k)) continue; out[k] = v; } diff --git a/apps/host/server/artifacts.mjs b/apps/host/server/artifacts.mjs index fc8e9cb7..ac42c728 100644 --- a/apps/host/server/artifacts.mjs +++ b/apps/host/server/artifacts.mjs @@ -2,7 +2,8 @@ import { execFile } from 'node:child_process'; import { promisify } from 'node:util'; import { mkdir, mkdtemp, realpath, stat, writeFile } from 'node:fs/promises'; import { basename, dirname, extname, join, resolve, sep } from 'node:path'; -const run=promisify(execFile); +import { externalEnvironment } from './external-env.mjs'; +const run=(command,args)=>promisify(execFile)(command,args,{env:externalEnvironment()}); // xdg-open and the apps it starts: the environment the AppImage was started from const extensions=new Set(['.md','.txt','.pdf','.html','.htm','.png','.jpg','.jpeg','.webp','.gif','.svg','.csv','.ts','.tsx','.js','.jsx','.py','.json','.css','.rs','.go','.sh','.mp4','.webm']); export async function openArtifact(body,{examplesDir,previewsDir,platform=process.platform,launch=run}) { if(!['open','reveal'].includes(body.action))throw new Error('Choose Open or Show in file explorer.'); diff --git a/apps/host/server/chat-files.mjs b/apps/host/server/chat-files.mjs index 1c182804..eb6320b1 100644 --- a/apps/host/server/chat-files.mjs +++ b/apps/host/server/chat-files.mjs @@ -12,6 +12,7 @@ import { spawn } from 'node:child_process'; import { existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync, realpathSync } from 'node:fs'; import { basename, dirname, isAbsolute, relative, resolve, sep } from 'node:path'; import { pathToFileURL } from 'node:url'; +import { externalEnvironment } from './external-env.mjs'; /** A folder no chat may use as its project: the top of a drive, or the system's own folders. */ export function refusedFolder(dir) { @@ -74,7 +75,8 @@ export function resolveChatFile(root, rawPath) { */ export function launch(command, args, { recorder = null } = {}) { if (process.env.STRATA_OPENER === 'record' || recorder) { (recorder ?? launch.recorded).push([command, ...args]); return; } - const child = spawn(command, args, { detached: true, stdio: 'ignore', windowsHide: false }); + // xdg-open and the browser it starts are the system's programs: they get the environment the AppImage was started from, not Strata's libraries. + const child = spawn(command, args, { detached: true, stdio: 'ignore', windowsHide: false, env: externalEnvironment() }); child.on('error', () => {}); child.unref(); } diff --git a/apps/host/server/control-runtime.mjs b/apps/host/server/control-runtime.mjs index 4f7fc610..6f352b54 100644 --- a/apps/host/server/control-runtime.mjs +++ b/apps/host/server/control-runtime.mjs @@ -82,6 +82,9 @@ export function controlEnvironment(control, { env = process.env, components = co ...next, PYTHONNOUSERSITE: '1', PYTHONUTF8: '1', PYTHONUNBUFFERED: '1', PYTHONIOENCODING: 'utf-8', STRATA_NO_ACQUIRE: '1', STRATA_COMPONENTS_DIR: components, + // The app's own settings file, beside its components: Control and the installer never read or write the file an older + // command-line Strata keeps in %APPDATA% / ~/.config (its list of Strata folders), so an old install is never adopted. + ...(components ? { STRATA_SETTINGS_FILE: env.STRATA_SETTINGS_FILE || join(dirname(components), 'app-settings.json') } : {}), ...(control?.dir ? { STRATA_CONTROL_DIR: control.dir } : {}), }; // Only the explicit update step (`strata update`) may acquire; every other Control process keeps the switch on. diff --git a/apps/host/server/external-env.mjs b/apps/host/server/external-env.mjs new file mode 100644 index 00000000..169191ae --- /dev/null +++ b/apps/host/server/external-env.mjs @@ -0,0 +1,71 @@ +/** + * The environment for programs that are NOT part of Strata: the folder chooser (zenity, kdialog, gdbus), xdg-open and the browser it + * starts, and the shell and tools the coding assistant runs for the person. + * + * Why: the Linux AppImage starts Strata with its own libraries and settings in the environment (LD_LIBRARY_PATH, GTK_*, GIO_*, + * GSETTINGS_SCHEMA_DIR, XDG_DATA_DIRS, PYTHONHOME, ...). A system program that inherits them loads Strata's copies of libssl, GTK and + * GLib instead of its own and dies (tester report 2026-10-17: zenity "libssl.so.3: version OPENSSL_3.2.0 not found", so the folder + * picker did nothing). Programs Strata ships itself (its Python, Node and engine) keep the environment they were built for; everything + * else gets the environment the AppImage was started from. + * + * The AppImage's launcher records that original environment in STRATA_ORIGINAL_ENV (repack-appimage.sh adds the hook). An older + * AppImage without the record is cleaned instead: every variable that points into the AppImage's own folder is dropped, and its + * folders are removed from the path lists. + */ +const RECORD = 'STRATA_ORIGINAL_ENV'; + +/** Variables the AppImage tooling sets only for itself; never meant for another program. */ +const APPIMAGE_ONLY = [ + 'APPDIR', 'APPIMAGE', 'ARGV0', 'OWD', 'APPIMAGE_SILENT_INSTALL', 'APPIMAGE_EXTRACT_AND_RUN', + 'GTK_DATA_PREFIX', 'GTK_EXE_PREFIX', 'GTK_PATH', 'GTK_IM_MODULE_FILE', 'GTK_THEME', 'GDK_PIXBUF_MODULE_FILE', 'GDK_PIXBUF_MODULEDIR', + 'GSETTINGS_SCHEMA_DIR', 'GI_TYPELIB_PATH', 'GIO_MODULE_DIR', 'GIO_EXTRA_MODULES', + 'GST_REGISTRY_REUSE_PLUGIN_SCANNER', 'GST_PLUGIN_SYSTEM_PATH_1_0', 'GST_PLUGIN_PATH_1_0', 'GST_PLUGIN_SCANNER_1_0', 'GST_PTP_HELPER_1_0', + 'WEBKIT_EXEC_PATH', 'WEBKIT_INJECTED_BUNDLE_PATH', 'STRATA_ORIGINAL_ENV', 'STRATA_APPDIR', +]; +/** Lists of folders: the AppImage prepends its own; only its entries are removed. */ +const PATH_LISTS = ['PATH', 'XDG_DATA_DIRS', 'XDG_CONFIG_DIRS', 'LD_LIBRARY_PATH', 'LD_PRELOAD', 'LIBRARY_PATH', 'PYTHONPATH', 'PYTHONHOME', 'PERLLIB', 'PERL5LIB', 'QT_PLUGIN_PATH', 'QML2_IMPORT_PATH', 'GST_PLUGIN_PATH', 'GTK_PATH', 'GIO_MODULE_DIR']; + +/** The environment the program was started from, decoded from the launcher's record, or null when there is none. */ +export function recordedOriginal(env = process.env) { + const raw = env[RECORD]; + if (!raw) return null; + try { + const text = Buffer.from(raw, 'base64').toString('utf8'); + const out = {}; + for (const entry of text.split('\0')) { + const at = entry.indexOf('='); + if (at > 0) out[entry.slice(0, at)] = entry.slice(at + 1); + } + return Object.keys(out).length ? out : null; + } catch { return null; } +} + +/** `env` with everything that belongs to a running AppImage removed (no record needed). */ +export function withoutAppImage(env = process.env) { + const dir = env.APPDIR || ''; + const out = { ...env }; + const inside = value => !!dir && (value === dir || value.startsWith(`${dir}/`) || value.startsWith(`${dir}//`)); + for (const name of APPIMAGE_ONLY) delete out[name]; + if (dir) { + for (const name of Object.keys(out)) if (/^(GTK|GDK|GIO|GST|GI_|GSETTINGS|WEBKIT)/.test(name) && typeof out[name] === 'string' && out[name].includes(dir)) delete out[name]; + for (const name of PATH_LISTS) { + if (typeof out[name] !== 'string') continue; + const kept = out[name].split(':').filter(part => part && !inside(part)); + if (kept.length) out[name] = kept.join(':'); else delete out[name]; + } + } + return out; +} + +/** True when this process was started from an AppImage. */ +export const insideAppImage = (env = process.env) => !!(env.APPIMAGE || env.APPDIR); + +/** + * The environment for an external program (see the top of this file). Outside an AppImage it is `env` unchanged. + * `extra` is added last (a variable the caller really means to pass). + */ +export function externalEnvironment(env = process.env, extra = {}) { + if (!insideAppImage(env) && !env[RECORD]) return { ...env, ...extra }; + const original = recordedOriginal(env); + return { ...(original ?? withoutAppImage(env)), ...extra }; +} diff --git a/apps/host/server/folder-dialog.mjs b/apps/host/server/folder-dialog.mjs index 1748373b..bb2a9d36 100644 --- a/apps/host/server/folder-dialog.mjs +++ b/apps/host/server/folder-dialog.mjs @@ -2,11 +2,13 @@ * The host's native "choose a folder" dialog, one per platform: * macOS osascript (choose folder) -- unchanged * Windows PowerShell FolderBrowserDialog (STA, topmost owner so it never opens behind the app) - * Linux zenity, then kdialog - * Where no dialog exists the caller gets { unavailable: true } and tells the person to type a path. + * Linux zenity, then kdialog, then the desktop portal (gdbus), all with the environment the AppImage was started from + * Where no dialog works the caller gets { unavailable: true } and the app shows a plain message and a field for the path. */ +import { spawn } from 'node:child_process'; import { stat } from 'node:fs/promises'; import { exec } from './util.mjs'; +import { externalEnvironment } from './external-env.mjs'; const MAC_SCRIPT = prompt => `POSIX path of (choose folder with prompt "${prompt.replace(/["\\]/g, '')}")`; @@ -44,7 +46,7 @@ const missing = error => error?.code === 'ENOENT'; * Ask for a folder. Resolves { path } | { cancelled: true } | { unavailable: true, reason }. * `run` is injectable for tests: (command, args) => Promise<{ stdout }>. */ -export async function chooseFolder(prompt, { platform = process.platform, run = exec } = {}) { +export async function chooseFolder(prompt, { platform = process.platform, run = exec, portal = portalFolder } = {}) { if (platform === 'darwin') { try { const { stdout } = await run('osascript', ['-e', MAC_SCRIPT(prompt)]); @@ -63,25 +65,96 @@ export async function chooseFolder(prompt, { platform = process.platform, run = throw new Error('The folder chooser could not open.'); } } + return chooseLinuxFolder(prompt, { run, portal }); +} + +/** A chooser that is there but broke (the display is missing, a library does not load) must say so; a bare exit 1 is a cancel. */ +const BROKEN = /unable to init server|cannot open display|can't open display|no protocol specified|error while loading shared libraries|symbol lookup error|version `[^']*' not found|cannot connect to|failed to connect|could not connect/i; +const firstLine = text => String(text ?? '').split(/\r?\n/).map(l => l.trim()).find(Boolean)?.slice(0, 160) ?? ''; + +/** + * Linux: zenity, then kdialog, then the desktop portal's file chooser through gdbus. Every one of them runs with the environment the + * AppImage was started from (external-env.mjs), not Strata's own libraries. A chooser that is missing is skipped; one that fails is + * remembered and the next is tried; when none works the answer says why and the person types the path. + */ +async function chooseLinuxFolder(prompt, { run, portal }) { + const env = externalEnvironment(); const candidates = [ ['zenity', ['--file-selection', '--directory', `--title=${prompt}`]], ['kdialog', ['--getexistingdirectory', '.', '--title', prompt]], ]; + const failures = []; for (const [command, args] of candidates) { try { - const { stdout } = await run(command, args); + const { stdout } = await run(command, args, { env }); return stdout.trim() ? { path: cleanChosenPath(stdout) } : { cancelled: true }; } catch (error) { if (missing(error)) continue; - if (error?.code === 1) return { cancelled: true }; // both tools exit 1 when the dialog is dismissed - throw new Error('The folder chooser could not open.'); + const detail = `${error?.stderr ?? ''}`; + if (error?.code === 1 && !BROKEN.test(detail)) return { cancelled: true }; // both tools exit 1 when the dialog is dismissed + failures.push(`${command}: ${firstLine(detail) || firstLine(error?.message) || `exit ${error?.code}`}`); } } - return { unavailable: true, reason: 'No folder chooser is installed (install zenity or kdialog).' }; + try { + const picked = await portal(prompt, { run, env }); + if (picked) return picked; + } catch (error) { + failures.push(`portal: ${firstLine(error?.message)}`); + } + return { + unavailable: true, failed: failures.length > 0, ...(failures.length ? { detail: failures.join('; ') } : {}), + reason: failures.length + ? 'The folder chooser could not open. Install zenity or kdialog to pick a folder, or type the path.' + : 'No folder chooser was found. Install zenity or kdialog to pick a folder, or type the path.', + }; +} + +/** + * xdg-desktop-portal FileChooser through gdbus. Resolves { path } | { cancelled: true } | null when there is no portal or no gdbus. + * The answer arrives as a Response signal on the request the call returns, so a monitor is started first. + */ +export async function portalFolder(prompt, { run = exec, env = externalEnvironment(), spawnProcess = spawn, timeoutMs = 10 * 60_000 } = {}) { + const monitor = spawnProcess('gdbus', ['monitor', '--session', '--dest', 'org.freedesktop.portal.Desktop'], { env, stdio: ['ignore', 'pipe', 'ignore'] }); + let seen = ''; + let ended = false; + monitor.on('error', () => { ended = true; }); + monitor.on('close', () => { ended = true; }); + monitor.stdout?.on('data', chunk => { seen += chunk; }); + try { + let call; + try { + call = await run('gdbus', ['call', '--session', '--dest', 'org.freedesktop.portal.Desktop', '--object-path', '/org/freedesktop/portal/desktop', + '--method', 'org.freedesktop.portal.FileChooser.OpenFile', '', prompt, "{'directory': , 'modal': }"], { env }); + } catch { + return null; // no gdbus, or no portal on the session bus + } + const handle = /'(\/org\/freedesktop\/portal\/desktop\/request\/[^']+)'/.exec(call.stdout)?.[1]; + if (!handle) return null; + const deadline = Date.now() + timeoutMs; + while (Date.now() < deadline) { + const line = seen.split('\n').find(l => l.startsWith(`${handle}: org.freedesktop.portal.Request.Response`)); + if (line) { + const m = /\(uint32 (\d+), (.*)\)\s*$/.exec(line); + if (!m || m[1] !== '0') return { cancelled: true }; + const uri = /'(file:\/\/[^']*)'/.exec(m[2])?.[1]; + return uri ? { path: cleanChosenPath(decodeURIComponent(uri.replace(/^file:\/\//, ''))) } : { cancelled: true }; + } + if (ended) return null; + await new Promise(r => setTimeout(r, 100)); + } + return { cancelled: true }; + } finally { + try { monitor.kill(); } catch { /* already gone */ } + } } export const TYPE_A_PATH = 'No folder chooser is available on this system, so type the folder path instead.'; +/** The host's answer when no chooser works: a plain sentence and a code the app turns into a field for typing the path. */ +export function chooserUnavailable(picked) { + return { message: picked.reason, code: 'folder-chooser-unavailable', details: picked.detail }; +} + /** A typed path stands in for the dialog: it must be an absolute directory that exists. */ export async function typedFolder(value, { isAbsolute }) { const text = typeof value === 'string' ? value.trim() : ''; diff --git a/apps/host/server/index.mjs b/apps/host/server/index.mjs index c7ed4a88..63210c21 100644 --- a/apps/host/server/index.mjs +++ b/apps/host/server/index.mjs @@ -4,7 +4,7 @@ import { createConnectorInstaller } from './cloudflared-install.mjs'; import { openArtifact } from './artifacts.mjs'; import { saveSnapshot } from './snapshot.mjs'; import { resolvePython, shellPrefix } from './python-resolver.mjs'; -import { chooseFolder, typedFolder, TYPE_A_PATH } from './folder-dialog.mjs'; +import { chooseFolder, chooserUnavailable, typedFolder } from './folder-dialog.mjs'; import { createLocalShare } from './local-share.mjs'; import { createTaskService, validateTask } from './tasks.mjs'; import { createAgentTaskRunner } from './agent/task-run.mjs'; @@ -13,7 +13,7 @@ import { skillEdit } from './skill-edits.mjs'; import { materializeSkills, parseSkillFile, skillSlug, writeCreatedSkill } from './skill-files.mjs'; import { systemFonts } from './fonts.mjs'; import { tuningDir } from './platform-paths.mjs'; -import { createAgentBridge } from './agent/agent-bridge.mjs'; +import { createAgentBridge, plainTurnFailure } from './agent/agent-bridge.mjs'; import { createAgentTools } from './agent/tools-settings.mjs'; import { withPlainStatus } from './agent/status.mjs'; import { findBrowser, findPlaywrightMcp } from './agent/browser-probe.mjs'; @@ -563,8 +563,9 @@ async function runAgentTurn({ res, controller, chatId, body, message, workspaceI if (result?.detached) void result.ended.then(r => settle(r?.tokensOut ?? null), () => settle(null)); else settle(result?.tokensOut ?? null, result?.error ? 'The agent turn failed.' : undefined); } catch (err) { - write({ type: 'error', message: err.message, ...(err.details ? { details: err.details } : {}), code: err.code ?? 'AGENT_ERROR' }); - settle(null, err.message); + const plain = plainTurnFailure(err); + write({ type: 'error', message: plain.message, ...(plain.details ? { details: plain.details } : {}), code: plain.code }); + settle(null, plain.message); } } @@ -934,7 +935,7 @@ async function api(req, res, path, method, url) { /* "Use a local GGUF": pick (or type) the folder, and Control says what is in it. Nothing is copied or changed. */ const typed=await typedFolder((await readBody(req)).path,{isAbsolute}); const picked=typed?{path:typed}:await chooseFolder('Choose the folder that holds your GGUF files'); - if(picked.unavailable)return error(res,501,`${TYPE_A_PATH} ${picked.reason}`); + if(picked.unavailable){const u=chooserUnavailable(picked);return error(res,501,u.message,{code:u.code});}; if(picked.cancelled)return json(res,200,{cancelled:true}); return json(res,200,{path:picked.path,preview:await native.localPreview(picked.path)});} if(path==='/api/native/benchmark'&&method==='GET')return json(res,200,native.benchmarkReport()); @@ -1679,7 +1680,7 @@ async function api(req, res, path, method, url) { // The dialog is the normal path; a typed `path` in the body stands in where none exists. const typed = await typedFolder((await readBody(req)).path, { isAbsolute }); const picked = typed ? { path: typed } : await chooseFolder('Choose a skill folder (it should contain SKILL.md)'); - if (picked.unavailable) return error(res, 501, `${TYPE_A_PATH} ${picked.reason}`); + if (picked.unavailable) {const u=chooserUnavailable(picked);return error(res,501,u.message,{code:u.code});}; if (picked.cancelled) return json(res, 200, { cancelled: true }); const chosen = picked.path; const base = basename(chosen); @@ -1704,7 +1705,7 @@ async function api(req, res, path, method, url) { try { const typed = await typedFolder((await readBody(req)).path, { isAbsolute }); const picked = typed ? { path: typed } : await chooseFolder('Choose a folder for Strata'); - if (picked.unavailable) return error(res, 501, `${TYPE_A_PATH} ${picked.reason}`); + if (picked.unavailable) {const u=chooserUnavailable(picked);return error(res,501,u.message,{code:u.code});}; if (picked.cancelled) return json(res, 200, { cancelled: true }); return json(res, 200, { path: picked.path }); } catch (e) { diff --git a/apps/host/server/native-control.mjs b/apps/host/server/native-control.mjs index 196aa65a..f4b114c3 100644 --- a/apps/host/server/native-control.mjs +++ b/apps/host/server/native-control.mjs @@ -38,7 +38,7 @@ export function createNativeControl({directory,requests=()=>[],changed=()=>{},sp /* In the packaged app the model catalog, the GPU probe and the install job are Control's bundled tools/strata_mcp.py and setup.py, run on Control's own Python in the installer's mode (STRATA_CONTROL_INSTALL: no pip, no engine, no compiler). The install only runs when the user clicks Download; starting and serving (control.start) keep STRATA_NO_ACQUIRE. */ - const defaultInstall=()=>join(dirname(componentsDirectory()),'install'); + const defaultInstall=()=>process.env.STRATA_INSTALL_DIR?resolve(process.env.STRATA_INSTALL_DIR):join(dirname(componentsDirectory()),'install'); let packagedInstall=null; const NO_INSTALL='Installing, updating, tuning with calibration or rolling back model files and engines happens from the Terminal (strata install), never while the app runs.'; let defaultId=null,timer=null,closing=false,polling=false; @@ -51,7 +51,8 @@ export function createNativeControl({directory,requests=()=>[],changed=()=>{},sp const modelArena=id=>({arenaGb:(snapshot.catalog?.families??[]).flatMap(f=>f.sizes??[]).find(s=>s.id===id)?.experts_gb}); /* A start that ends with `server_exited` carries the engine's last log line with it; the app turns the code into words and keeps this text under "Details" (src/lib/plain-errors.ts). */ - function humanStartError(error){const text=String(error?.message??error),tail=error?.output?.log_tail;return tail&&!text.includes(tail)?`${text}: ${tail}`:text;} + function exitCodeText(code){const n=Number(code);if(!Number.isFinite(n)||n===0)return '';const u=n<0?n+2**32:n;return u>=0x80000000?`exit code 0x${u.toString(16).toUpperCase().padStart(8,'0')}`:`exit code ${u}`;} + function humanStartError(error){const text=String(error?.message??error),tail=error?.output?.log_tail,code=exitCodeText(error?.output?.engine_exit_code);const head=code&&!text.includes(code)?`${text} (${code})`:text;return tail&&!head.includes(tail)?`${head}: ${tail}`:head;} /* A run config the app's install job wrote names files inside the app's own Control folder (`cwd`, `--expert-profile`). When the app is reinstalled to another folder, or an update moves Control, those absolute paths point at nothing and every installed model breaks. At every read of the installed models, a path that ends up inside a folder called `control` that no longer @@ -63,7 +64,7 @@ export function createNativeControl({directory,requests=()=>[],changed=()=>{},sp const next={...config,...(config.cwd!==undefined?{cwd:fix(config.cwd)}:{}),...(Array.isArray(config.args)?{args:config.args.map(fix)}:{})}; if(JSON.stringify(next)!==JSON.stringify(config)){try{writeModelConfig(path,next);}catch{/* read-only folder: the load reports it */}}}} function installedInfo(info){if(!info)return info;return {...info,models:(info.models??[]).map(entry=>{const cfg=/^strata-[a-z0-9_-]+\.json$/i.test(entry.config??'')?readJson(entry.configPath??join(repo(),entry.config)):{};const at=cfg.args?.indexOf('--native')??-1,nativeFile=at>=0?cfg.args[at+1]:null;const dataFolder=typeof nativeFile==='string'&&basename(dirname(dirname(nativeFile)))==='models'?dirname(dirname(dirname(nativeFile))):info.data_folder;return {...entry,diskGb:entry.diskGb??entry.disk_gb,diskBytes:entry.diskBytes??entry.disk_bytes,dataFolder,visionPrepared:!!cfg.vision,visionEnabled:cfg.ui_vision_enabled??[...instances.values()].some(i=>i.model===entry.model&&i.status==='ready'&&i.vision),visionDevice:cfg.ui_vision_device,resourceProfile:cfg.ui_resource_profile,lowRamMode:cfg.args?.includes('--resident-experts')?'resident':cfg.args?.includes('--mmap-experts')?'mmap':'auto'};})};} - function installRoot(){const found=[preferences.installDir,packagedInstall,snapshot.installDir].find(d=>d&&existsSync(d));if(found)return realpathSync(found);mkdirSync(defaultInstall(),{recursive:true});return realpathSync(defaultInstall());} + function installRoot(){const found=[preferences.installDir].find(d=>d&&existsSync(d));if(found)return realpathSync(found);mkdirSync(defaultInstall(),{recursive:true});return realpathSync(defaultInstall());} function repo(){if(packaged)return installRoot();const path=realpathSync(preferences.repo);if(!existsSync(join(path,'setup.py'))||!existsSync(join(path,'tools/strata_mcp.py'))||!existsSync(join(path,'serve/server.py')))throw new Error('Choose the Strata repository folder containing setup.py and tools/strata_mcp.py.');return path;} function python(){return resolvePython({repo:preferences.repo});} function send(method,params,timeout=30000){return new Promise((resolve,reject)=>{const id=++seq;const alarm=setTimeout(()=>{pending.delete(id);reject(new Error('The native engine did not respond in time. Check engine logs.'));},timeout);pending.set(id,{resolve,reject,alarm});child.stdin.write(JSON.stringify({jsonrpc:'2.0',id,method,params})+'\n');});} @@ -85,9 +86,9 @@ export function createNativeControl({directory,requests=()=>[],changed=()=>{},sp async function controlTool(name){ if(name==='strata_status'){ for(const dir of [preferences.installDir,packagedInstall,installRoot()])repairControlPaths(dir); - let list=await control.installedModels({installDir:preferences.installDir&&existsSync(preferences.installDir)?preferences.installDir:null}); - if(!preferences.installDir&&!(list.models??[]).length){const own=installRoot();if(realpathSync(list.install_dir)!==own)list=await control.installedModels({installDir:own});} - if(!preferences.installDir&&list.install_dir&&![preferences.installDir,packagedInstall,installRoot()].some(d=>d&&resolve(d).toLowerCase()===resolve(list.install_dir).toLowerCase())){repairControlPaths(list.install_dir);list=await control.installedModels({installDir:list.install_dir});} + // Always the app's own install folder (or the one the person chose in Settings): Control is told explicitly, so it never falls + // back to an older command-line Strata's folder remembered in %APPDATA% (tester report 2026-10-17: logs landed in T:\Strata). + const list=await control.installedModels({installDir:installRoot()}); packagedInstall=list.install_dir; const engine=await control.engine(); const installer=await mcpCall('strata_status',{hardware:true}).catch(error=>({error:error.message})); diff --git a/apps/host/server/native-resources.mjs b/apps/host/server/native-resources.mjs index 519d020c..5dcf7baa 100644 --- a/apps/host/server/native-resources.mjs +++ b/apps/host/server/native-resources.mjs @@ -45,6 +45,9 @@ export function resourceSettings(config,hardware,profile,model={}){ technical line for Details. The caller tries once and never again, and does not save this config. */ export function saferStart(config,hardware,model,failure){ const text=String(failure??''); + // A start that died for a reason that is not memory (a missing or bad DLL, a crash, a blocked file) is not helped by a memory setting, and must not be called a memory failure. + if(/0xC0000135|0xC000007B|0xC0000142|0xC000001D|0xC0000005|0xC0000409|0xC0000022|error while loading shared libraries|cannot open shared object file|\bENOENT\b|exit code 127|exit code 139|illegal instruction/i.test(text))return null; + const ranOut=/out of memory|memory guard|\boom\b|\bkilled\b|exit code 137|cannot allocate|not enough memory|bad_alloc|insufficient memory/i.test(text),first=ranOut?'The first start ran out of memory':'The first start did not finish'; if(!/server_exited|exited before|died before|engine stopped|pinned-memory-exhausted|mapped staging|out of memory|memory guard|\bkilled\b/i.test(text))return null; const args=[...(config.args??[])],env={...(config.env??{})}; const ram=Number(hardware?.ram_gb)||0,arena=Number(model?.arenaGb)||0; @@ -61,10 +64,10 @@ export function saferStart(config,hardware,model,failure){ if(at>=0){ const next=Math.floor((Number(args[at+1])||0)*.7);if(next<8)return null; args[at+1]=String(next); - return {config:{...config,args},words:`The first start ran out of memory, so Strata started again and keeps less of the model in RAM (${next} GB); more of it is read from the SSD, which is slower.`,detail:`--resident-budget-gib ${next}`}; + return {config:{...config,args},words:`${first}, so Strata started again and keeps less of the model in RAM (${next} GB); more of it is read from the SSD, which is slower.`,detail:`--resident-budget-gib ${next}`}; } if(!(ram>0&&arena>0))return null; const budget=Math.max(8,Math.floor(ram*.5)-4);if(budget>=arena)return null; args.push('--resident-budget-gib',String(budget)); - return {config:{...config,args},words:`The first start ran out of memory, so Strata started again in low-memory mode: ${budget} GB of the model stays in RAM and the rest is read from the SSD. It is slower, but it should load.`,detail:`--resident-budget-gib ${budget}`}; + return {config:{...config,args},words:`${first}, so Strata started again in low-memory mode: ${budget} GB of the model stays in RAM and the rest is read from the SSD. It is slower, but it should load.`,detail:`--resident-budget-gib ${budget}`}; } diff --git a/apps/host/src/app/App.tsx b/apps/host/src/app/App.tsx index 92e06536..7604306c 100644 --- a/apps/host/src/app/App.tsx +++ b/apps/host/src/app/App.tsx @@ -8,6 +8,7 @@ import { bootOnce, bootstrap, setNavOpen, setFocus, useStore, } from '../lib/sto import { Sidebar } from './Sidebar'; import { CommandPalette } from './CommandPalette'; import { ShortcutsDialog } from './Shortcuts'; +import { FolderPathDialog } from '../components/FolderPathDialog'; import { handleAppShortcut, runCommand } from '../lib/commands'; import { useMedia } from '../lib/responsive'; import { Btn, Dialog, IconBtn, Toasts } from '../components/ui'; @@ -66,6 +67,7 @@ function AppShell() { + {tr(setupOpen ? (