Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
feat(setup): add one-click agent install in setup wizard
yh c6aa8fbd6ab58
diff --git a/ui/package-lock.json b/ui/package-lock.jsonindex 3c731c797..79024b74e 100644--- a/ui/package-lock.json+++ b/ui/package-lock.json@@ -84,6 +84,7 @@"integrity": "sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@babel/code-frame": "^7.28.6","@babel/generator": "^7.28.6",@@ -2241,6 +2242,7 @@"integrity": "sha512-ne4A0IpG3+2ETuREInjPNhUGis1SFjv1d5asp8MzEAGtOZeTeHVDOYqOgqfhvseqg/iXty2hjBf1zAOb7RNiNw==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"undici-types": "~7.16.0"}@@ -2251,6 +2253,7 @@"integrity": "sha512-3MbSL37jEchWZz2p2mjntRZtPt837ij10ApxKfgmXCTuHWagYg7iA5bqPw6C8BMPfwidlvfPI/fxOc42HLhcyg==","devOptional": true,"license": "MIT",+ "peer": true,"dependencies": {"csstype": "^3.2.2"}@@ -2261,6 +2264,7 @@"integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==","devOptional": true,"license": "MIT",+ "peer": true,"peerDependencies": {"@types/react": "^19.2.0"}@@ -2310,6 +2314,7 @@"integrity": "sha512-npiaib8XzbjtzS2N4HlqPvlpxpmZ14FjSJrteZpPxGUaYPlvhzlzUZ4mZyABo0EFrOWnvyd0Xxroq//hKhtAWg==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@typescript-eslint/scope-manager": "8.53.0","@typescript-eslint/types": "8.53.0",@@ -2561,6 +2566,7 @@"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==","dev": true,"license": "MIT",+ "peer": true,"bin": {"acorn": "bin/acorn"},@@ -2715,6 +2721,7 @@}],"license": "MIT",+ "peer": true,"dependencies": {"baseline-browser-mapping": "^2.9.0","caniuse-lite": "^1.0.30001759",@@ -3004,6 +3011,7 @@"integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@eslint-community/eslint-utils": "^4.8.0","@eslint-community/regexpp": "^4.12.1",@@ -3435,6 +3443,7 @@}],"license": "MIT",+ "peer": true,"dependencies": {"@babel/runtime": "^7.28.4"},@@ -4101,6 +4110,7 @@"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==","dev": true,"license": "MIT",+ "peer": true,"engines": {"node": ">=12"},@@ -4128,6 +4138,7 @@}],"license": "MIT",+ "peer": true,"dependencies": {"nanoid": "^3.3.11","picocolors": "^1.1.1",@@ -4169,6 +4180,7 @@"resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz","integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==","license": "MIT",+ "peer": true,"engines": {"node": ">=0.10.0"}@@ -4178,6 +4190,7 @@"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz","integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==","license": "MIT",+ "peer": true,"dependencies": {"scheduler": "^0.27.0"},@@ -4551,6 +4564,7 @@"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==","devOptional": true,"license": "Apache-2.0",+ "peer": true,"bin": {"tsc": "bin/tsc","tsserver": "bin/tsserver"@@ -4689,6 +4703,7 @@"integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"esbuild": "^0.27.0","fdir": "^6.5.0",@@ -4819,6 +4834,7 @@"integrity": "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==","dev": true,"license": "MIT",+ "peer": true,"funding": {"url": "https://github.com/sponsors/colinhacks"}diff --git a/ui/src/components/steps/AgentDetection.tsx b/ui/src/components/steps/AgentDetection.tsxindex 1066dea2e..2d8f8d75c 100644--- a/ui/src/components/steps/AgentDetection.tsx+++ b/ui/src/components/steps/AgentDetection.tsx@@ -1,5 +1,5 @@import React, { useEffect, useState } from 'react';-import { Check, X, RefreshCw, Search, Settings } from 'lucide-react';+import { Check, X, RefreshCw, Search, Settings, Download } from 'lucide-react';import { useTranslation } from 'react-i18next';import clsx from 'clsx';import { useApi } from '../../context/ApiContext';@@ -32,7 +32,8 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on);const [permissionState, setPermissionState] = useState<PermissionState>('idle');const [permissionMessage, setPermissionMessage] = useState<string>('');-+ const [installing, setInstalling] = useState<string | null>(null);+ const [installMessage, setInstallMessage] = useState<Record<string, { ok: boolean; message: string }>>({});const isMissing = (agent: AgentState) => agent.status === 'missing';useEffect(() => {@@ -88,6 +89,29 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on}};+ const installAgent = async (name: string) => {+ setInstalling(name);+ setInstallMessage((prev) => ({ ...prev, [name]: { ok: false, message: '' } }));+ try {+ const result = await api.installAgent(name);+ setInstallMessage((prev) => ({+ ...prev,+ [name]: { ok: result.ok, message: result.message },+ }));+ if (result.ok) {+ // Re-detect after successful installation+ await detect(name);+ }+ } catch (e) {+ setInstallMessage((prev) => ({+ ...prev,+ [name]: { ok: false, message: String(e) },+ }));+ } finally {+ setInstalling(null);+ }+ };+const canContinue = Object.values(agents).some((agent) => agent.enabled);return (@@ -172,6 +196,35 @@ export const AgentDetection: React.FC<AgentDetectionProps> = ({ data, onNext, on</div></div>+ {/* One-click install button when agent is missing */}+ {isMissing(agent) && (+ <div className="mt-2 p-3 bg-blue-50 border border-blue-200 rounded-lg">+ <p className="text-sm text-blue-800 mb-2">{t('agentDetection.installHint')}</p>+ <div className="flex items-center gap-3 flex-wrap">+ <button+ onClick={() => installAgent(name)}+ disabled={installing === name}+ className="flex items-center gap-2 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white rounded text-sm font-medium transition-colors disabled:opacity-50"+ >+ {installing === name ? (+ <RefreshCw size={14} className="animate-spin" />+ ) : (+ <Download size={14} />+ )}+ {installing === name ? t('agentDetection.installing') : t('agentDetection.installAgent')}+ </button>+ {installMessage[name]?.message && (+ <span className={clsx(+ "text-sm",+ installMessage[name].ok ? "text-green-600" : "text-red-600"+ )}>+ {installMessage[name].message}+ </span>+ )}+ </div>+ </div>+ )}+{name === 'opencode' && agent.status === 'ok' && (<div className="mt-2 p-3 bg-amber-50 border border-amber-200 rounded-lg"><p className="text-sm text-amber-800 mb-2">{t('agentDetection.permissionHint')}</p>diff --git a/ui/src/context/ApiContext.tsx b/ui/src/context/ApiContext.tsxindex d06016197..4cfa9e816 100644--- a/ui/src/context/ApiContext.tsx+++ b/ui/src/context/ApiContext.tsx@@ -7,6 +7,7 @@ export type ApiContextType = {getSettings: () => Promise<any>;saveSettings: (payload: any) => Promise<any>;detectCli: (binary: string) => Promise<any>;+ installAgent: (name: string) => Promise<InstallResult>;slackAuthTest: (botToken: string) => Promise<any>;slackChannels: (botToken: string) => Promise<any>;slackManifest: () => Promise<{ ok: boolean; manifest?: string; manifest_compact?: string; error?: string }>;@@ -42,6 +43,12 @@ export type UpgradeResult = {restarting: boolean;};+export type InstallResult = {+ ok: boolean;+ message: string;+ output: string | null;+};+const ApiContext = createContext<ApiContextType | undefined>(undefined);export const useApi = () => {@@ -107,6 +114,7 @@ export const ApiProvider: React.FC<{ children: React.ReactNode }> = ({ childrengetSettings: () => getJson('/settings'),saveSettings: (payload) => postJson('/settings', payload),detectCli: (binary) => getJson(`/cli/detect?binary=${encodeURIComponent(binary)}`),+ installAgent: (name) => postJson(`/agent/${encodeURIComponent(name)}/install`, {}),slackAuthTest: (botToken) => postJson('/slack/auth_test', { bot_token: botToken }),slackChannels: (botToken) => postJson('/slack/channels', { bot_token: botToken }),slackManifest: () => getJson('/slack/manifest'),diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.jsonindex 83bc79310..bb9fed43b 100644--- a/ui/src/i18n/en.json+++ b/ui/src/i18n/en.json@@ -118,7 +118,10 @@"cliPathDetection": "CLI path detection and enablement","recommended": "(recommended)","permissionHint": "OpenCode requires permission config to skip approval prompts.",- "setupPermission": "Setup Permission"+ "setupPermission": "Setup Permission",+ "installHint": "Agent not found. Click to install automatically.",+ "installAgent": "Install",+ "installing": "Installing..."},"channelList": {"title": "Channel Settings",diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.jsonindex 377b05fd1..937092e2d 100644--- a/ui/src/i18n/zh.json+++ b/ui/src/i18n/zh.json@@ -118,7 +118,10 @@"cliPathDetection": "CLI 路径检测和启用设置","recommended": "(推荐)","permissionHint": "OpenCode 需要配置权限以跳过审批提示。",- "setupPermission": "一键设置权限"+ "setupPermission": "一键设置权限",+ "installHint": "未找到 Agent,点击自动安装。",+ "installAgent": "一键安装",+ "installing": "安装中..."},"channelList": {"title": "频道设置",diff --git a/ui/src/lib/utils.ts b/ui/src/lib/utils.tsnew file mode 100644index 000000000..bd0c391dd--- /dev/null+++ b/ui/src/lib/utils.ts@@ -0,0 +1,6 @@+import { clsx, type ClassValue } from "clsx"+import { twMerge } from "tailwind-merge"++export function cn(...inputs: ClassValue[]) {+ return twMerge(clsx(inputs))+}diff --git a/vibe/api.py b/vibe/api.pyindex ff8f5cef8..2955b750a 100644--- a/vibe/api.py+++ b/vibe/api.py@@ -84,9 +84,7 @@ def save_settings(payload: dict) -> dict:)channels[channel_id] = ChannelSettings(enabled=channel_payload.get("enabled", True),- show_message_types=normalize_show_message_types(- channel_payload.get("show_message_types")- ),+ show_message_types=normalize_show_message_types(channel_payload.get("show_message_types")),custom_cwd=channel_payload.get("custom_cwd"),routing=routing,require_mention=channel_payload.get("require_mention"),@@ -191,9 +189,7 @@ async def opencode_options_async(cwd: str) -> dict:if not config.opencode:return {"ok": False, "error": "opencode disabled"}opencode_config = config.opencode- timeout_seconds = min(- 10.0, float(opencode_config.request_timeout_seconds or 10)- )+ timeout_seconds = min(10.0, float(opencode_config.request_timeout_seconds or 10))def _build_reasoning_options(models: dict,@@ -201,11 +197,7 @@ async def opencode_options_async(cwd: str) -> dict:) -> dict:options: dict = {}for provider in models.get("providers", []):- provider_id = (- provider.get("id")- or provider.get("provider_id")- or provider.get("name")- )+ provider_id = provider.get("id") or provider.get("provider_id") or provider.get("name")if not provider_id:continuemodel_ids = []@@ -214,9 +206,7 @@ async def opencode_options_async(cwd: str) -> dict:model_ids = list(provider_models.keys())elif isinstance(provider_models, list):model_ids = [- model.get("id")- for model in provider_models- if isinstance(model, dict) and model.get("id")+ model.get("id") for model in provider_models if isinstance(model, dict) and model.get("id")]for model_id in model_ids:model_key = f"{provider_id}/{model_id}"@@ -229,18 +219,10 @@ async def opencode_options_async(cwd: str) -> dict:request_timeout_seconds=opencode_config.request_timeout_seconds,)await asyncio.wait_for(server.ensure_running(), timeout=timeout_seconds)- agents = await asyncio.wait_for(- server.get_available_agents(expanded_cwd), timeout=timeout_seconds- )- models = await asyncio.wait_for(- server.get_available_models(expanded_cwd), timeout=timeout_seconds- )- defaults = await asyncio.wait_for(- server.get_default_config(expanded_cwd), timeout=timeout_seconds- )- reasoning_options = _build_reasoning_options(- models, build_reasoning_effort_options- )+ agents = await asyncio.wait_for(server.get_available_agents(expanded_cwd), timeout=timeout_seconds)+ models = await asyncio.wait_for(server.get_available_models(expanded_cwd), timeout=timeout_seconds)+ defaults = await asyncio.wait_for(server.get_default_config(expanded_cwd), timeout=timeout_seconds)+ reasoning_options = _build_reasoning_options(models, build_reasoning_effort_options)data = {"agents": agents,"models": models,@@ -264,9 +246,7 @@ def _settings_to_payload(store: SettingsStore) -> dict:for channel_id, settings in store.settings.channels.items():payload["channels"][channel_id] = {"enabled": settings.enabled,- "show_message_types": normalize_show_message_types(- settings.show_message_types- ),+ "show_message_types": normalize_show_message_types(settings.show_message_types),"custom_cwd": settings.custom_cwd,"require_mention": settings.require_mention,"routing": {@@ -359,12 +339,8 @@ def get_version_info() -> dict:# Simple version comparison (works for semver)if latest and latest != current:try:- current_parts = [- int(x) for x in current.split(".")[:3] if x.isdigit()- ]- latest_parts = [- int(x) for x in latest.split(".")[:3] if x.isdigit()- ]+ current_parts = [int(x) for x in current.split(".")[:3] if x.isdigit()]+ latest_parts = [int(x) for x in latest.split(".")[:3] if x.isdigit()]result["has_update"] = latest_parts > current_partsexcept (ValueError, AttributeError):result["has_update"] = latest != current@@ -421,8 +397,7 @@ def do_upgrade(auto_restart: bool = True) -> dict:return {"ok": True,- "message": "Upgrade successful."- + (" Restarting..." if restarting else " Please restart vibe."),+ "message": "Upgrade successful." + (" Restarting..." if restarting else " Please restart vibe."),"output": result.stdout,"restarting": restarting,}@@ -489,9 +464,7 @@ def setup_opencode_permission() -> dict:}config["permission"] = "allow"- config_path.write_text(- json.dumps(config, indent=2) + "\n", encoding="utf-8"- )+ config_path.write_text(json.dumps(config, indent=2) + "\n", encoding="utf-8")return {"ok": True,"message": "Permission set to 'allow'",@@ -508,9 +481,7 @@ def setup_opencode_permission() -> dict:config_path = config_paths[0]try:config_path.parent.mkdir(parents=True, exist_ok=True)- config_path.write_text(- json.dumps({"permission": "allow"}, indent=2) + "\n", encoding="utf-8"- )+ config_path.write_text(json.dumps({"permission": "allow"}, indent=2) + "\n", encoding="utf-8")return {"ok": True,"message": "Permission set to 'allow'",@@ -583,6 +554,7 @@ def parse_claude_agent_file(agent_path: str) -> Optional[dict]:metadata: dict = {}try:import yaml+parsed = yaml.safe_load(frontmatter_text)if isinstance(parsed, dict):metadata = parsed@@ -598,7 +570,7 @@ def parse_claude_agent_file(agent_path: str) -> Optional[dict]:metadata[key] = value# Extract body (system prompt)- body_lines = lines[end_idx + 1:]+ body_lines = lines[end_idx + 1 :]body = "\n".join(body_lines).strip()# Parse tools if present@@ -648,7 +620,7 @@ def claude_agents(cwd: Optional[str] = None) -> dict:project_dir: Optional[Path] = Noneif cwd:try:- project_dir = (Path(cwd).expanduser().resolve() / ".claude" / "agents")+ project_dir = Path(cwd).expanduser().resolve() / ".claude" / "agents"except Exception:project_dir = None@@ -730,6 +702,91 @@ def claude_models() -> dict:return {"ok": True, "models": uniq}+def install_agent(name: str) -> dict:+ """Install an agent CLI tool.++ Supported agents:+ - opencode: curl -fsSL https://opencode.ai/install | bash+ - claude: curl -fsSL https://claude.ai/install.sh | bash (macOS/Linux)+ irm https://claude.ai/install.ps1 | iex (Windows)+ - codex: npm install -g @openai/codex++ Returns:+ {"ok": bool, "message": str, "output": str | None}+ """+ import platform+ import sys++ system = platform.system().lower()++ if name == "opencode":+ # OpenCode: use curl installer+ cmd = ["bash", "-c", "curl -fsSL https://opencode.ai/install | bash"]+ elif name == "claude":+ # Claude Code: platform-specific installer+ if system == "windows":+ # Windows: use PowerShell+ cmd = ["powershell", "-Command", "irm https://claude.ai/install.ps1 | iex"]+ else:+ # macOS/Linux: use bash+ cmd = ["bash", "-c", "curl -fsSL https://claude.ai/install.sh | bash"]+ elif name == "codex":+ # Codex: prefer npm, fallback to brew on macOS+ npm_path = shutil.which("npm")+ if npm_path:+ cmd = [npm_path, "install", "-g", "@openai/codex"]+ elif system == "darwin":+ # macOS: try brew cask+ brew_path = shutil.which("brew")+ if brew_path:+ cmd = [brew_path, "install", "--cask", "codex"]+ else:+ return {+ "ok": False,+ "message": "npm or brew not found. Please install Node.js or Homebrew first.",+ "output": None,+ }+ else:+ return {+ "ok": False,+ "message": "npm not found. Please install Node.js first.",+ "output": None,+ }+ else:+ return {"ok": False, "message": f"Unknown agent: {name}", "output": None}++ try:+ logger.info(f"Installing agent {name} with command: {cmd}")+ result = subprocess.run(+ cmd,+ capture_output=True,+ text=True,+ timeout=300, # 5 minute timeout for installation+ env={**os.environ, "PATH": os.environ.get("PATH", "")},+ )+ output = result.stdout + "\n" + result.stderr if result.stderr else result.stdout+ if result.returncode == 0:+ logger.info(f"Agent {name} installed successfully")+ return {+ "ok": True,+ "message": f"{name} installed successfully",+ "output": output.strip(),+ }+ else:+ logger.warning(f"Agent {name} installation failed: {output}")+ return {+ "ok": False,+ "message": f"Installation failed (exit code {result.returncode})",+ "output": output.strip(),+ }+ except subprocess.TimeoutExpired:+ logger.error(f"Agent {name} installation timed out")+ return {"ok": False, "message": "Installation timed out", "output": None}+ except Exception as e:+ logger.error(f"Agent {name} installation error: {e}")+ return {"ok": False, "message": str(e), "output": None}++def codex_models() -> dict:"""Best-effort list of Codex model options.diff --git a/vibe/ui_server.py b/vibe/ui_server.pyindex 8c25c23a8..ed216b535 100644--- a/vibe/ui_server.py+++ b/vibe/ui_server.py@@ -90,9 +90,7 @@ def status():if running:payload["service_pid"] = payload.get("service_pid") or payload["pid"]elif payload.get("state") == "running":- runtime.write_status(- "stopped", "process not running", None, payload.get("ui_pid")- )+ runtime.write_status("stopped", "process not running", None, payload.get("ui_pid"))payload = runtime.read_status()payload["running"] = Falsepayload["pid"] = None@@ -211,9 +209,7 @@ def ui_reload():from config import paths as config_pathsworking_dir = get_working_dir()- command = (- f"from vibe.ui_server import run_ui_server; run_ui_server('{host}', {port})"- )+ command = f"from vibe.ui_server import run_ui_server; run_ui_server('{host}', {port})"stdout_path = config_paths.get_runtime_dir() / "ui_stdout.log"stderr_path = config_paths.get_runtime_dir() / "ui_stderr.log"stdout = stdout_path.open("ab")@@ -228,9 +224,7 @@ def ui_reload():)stdout.close()stderr.close()- config_paths.get_runtime_ui_pid_path().write_text(- str(process.pid), encoding="utf-8"- )+ config_paths.get_runtime_ui_pid_path().write_text(str(process.pid), encoding="utf-8")runtime.write_status(status.get("state", "running"),status.get("detail"),@@ -291,9 +285,7 @@ def logs():with open(log_path, "r", encoding="utf-8", errors="replace") as f:all_lines = f.readlines()recent_lines = all_lines[-lines:] if len(all_lines) > lines else all_lines- log_pattern = re.compile(- r"^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3})\s+-\s+([\w.]+)\s+-\s+(\w+)\s+-\s+(.*)$"- )+ log_pattern = re.compile(r"^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3})\s+-\s+([\w.]+)\s+-\s+(\w+)\s+-\s+(.*)$")logs_list = []for line in recent_lines:line = line.rstrip("\n")@@ -371,6 +363,15 @@ def codex_models():return jsonify(api.codex_models())[email protected]("/agent/<name>/install", methods=["POST"])+def agent_install(name):+ """Install an agent CLI tool (opencode, claude, codex)."""+ from vibe import api++ result = api.install_agent(name)+ return jsonify(result)++# =============================================================================# Static Files (SPA)# =============================================================================@@ -392,17 +393,12 @@ def serve_static(path):resolved_path = file_path.resolve()# Security check: ensure path is within ui_dist- if (- ui_dist.resolve() not in resolved_path.parents- and resolved_path != ui_dist.resolve()- ):+ if ui_dist.resolve() not in resolved_path.parents and resolved_path != ui_dist.resolve():return jsonify({"error": "not_found"}), 404if resolved_path.exists() and resolved_path.is_file():mime_type, _ = mimetypes.guess_type(str(resolved_path))- return send_file(- resolved_path, mimetype=mime_type or "application/octet-stream"- )+ return send_file(resolved_path, mimetype=mime_type or "application/octet-stream")# SPA fallback: serve index.html for routes without file extensionif "." not in path: