Skip to content

armgit / avibe

Public Imported from GitHub
0

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.

feat(deps): auto-install askill + Settings → Dependencies tab (#365)

Call White72edac51b988
diff --git a/docs/plans/dependencies-settings.md b/docs/plans/dependencies-settings.md
new file mode 100644
index 000000000..e60b0a936
--- /dev/null
+++ b/docs/plans/dependencies-settings.md
@@ -0,0 +1,110 @@
+# Workbench Dependencies — Settings tab + askill auto-install
+
+Status: in progress (branch `feature/dependencies-settings`)
+
+## Background
+
+The Skills page wraps the open-source **askill** CLI. Today askill is *not*
+installed for the user: if it is missing, `SkillsPage` shows a dead-end
+"not installed" screen (`ui/src/components/workbench/SkillsPage.tsx:291`) and
+the user must install it by hand.
+
+By contrast, the **Show Page runtime** is a required local runtime that Vibe
+Remote installs and keeps current automatically: `core/show_runtime.py`
+(`ShowRuntimeManager`) plus `vibe runtime prepare --strict`, which is invoked
+from every install/upgrade path:
+
+- CLI upgrade → `_prepare_show_runtime_after_install` (`vibe/cli.py:4605/4686`)
+- UI upgrade (no auto-restart) → `_prepare_show_runtime_after_upgrade` (`vibe/api.py:1647/1680`)
+- UI upgrade (auto-restart) → `schedule_restart(prepare_show_runtime=True)` → `restart_supervisor`
+
+All three funnel through **`vibe runtime prepare`** (`cmd_runtime`, `vibe/cli.py:4661`).
+
+## Decision (user, 2026-05-31)
+
+askill is a **required** local dependency and must be **auto-installed at the
+same lifecycle point as the Show Page runtime** — not left as a manual
+dead-end. Add a Settings → **Dependencies** tab to surface status and offer
+manual re-check / repair / update.
+
+## Goals
+
+1. Auto-install + keep-updated askill wherever the Show Page runtime is prepared.
+2. New Settings → **Dependencies** tab: askill, Show Page runtime, Node.js
+ (+ a link to Backends), each with status + manual actions.
+3. Replace the Skills "not installed" dead-end with a one-click install.
+4. **Reuse** existing infra — no re-rolling (reuse ladder).
+
+Non-goal (Phase 2): unify backends + askill + show runtime into one declarative
+"managed local tool" registry. This phase keeps askill + show-runtime explicit.
+
+## Install mechanism (verified)
+
+- Official one-liner: `curl -fsSL https://askill.sh | sh` (same shape as the
+ OpenCode installer already in `install_agent`).
+- No npm fallback: askill ships via the askill.sh installer, not a public npm
+ package, so a curl/bash-less host (e.g. Windows) is told to install manually
+ rather than hit a guaranteed-failing `npm i -g`.
+- Target version: askill v0.1.13+.
+
+## Backend (`vibe/api.py`, `vibe/cli.py`, `vibe/ui_server.py`)
+
+- `install_askill()` — build the curl installer command (npm fallback) and run
+ it through the existing `_run_install_command(...)`. That helper already
+ skips the `agents.<name>.cli_path` write when there is no `agents.askill`
+ attribute (verified `api.py:2327`), so it is safe for a non-agent tool.
+- `ensure_askill_installed(force=False)` — `resolve_cli_path("askill")`; if
+ present and not forced, no-op; else `install_askill()`. Idempotent.
+- Hook askill into **`vibe runtime prepare`** (`cmd_runtime`): after the show
+ runtime is prepared, call `ensure_askill_installed()` and include askill in
+ the status/output. Respect a `VIBE_INSTALL_SKIP_ASKILL` escape hatch (mirrors
+ `VIBE_INSTALL_SKIP_SHOW_RUNTIME`). This is the single chokepoint, so askill
+ auto-installs in the same place as the show runtime — no new call sites.
+- `dependencies_status()` — aggregate: askill (`resolve_cli_path` + `askill
+ --version`), show runtime (`ShowRuntimeManager.status()`), Node.js
+ (`resolve_cli_path("node")` + version), backends summary (count installed via
+ the existing `get_backend_runtime`). Returns `{ok, deps:[{id, label, kind,
+ required, installed, version, status, detail, action}]}`.
+- Manual actions reuse the background install-job machinery
+ (`start_agent_install_job` / `get_agent_install_job`), generalized to accept
+ `askill` (relax the `is_agent_backend` gate; the worker dispatches askill →
+ `install_askill()`, no `restart_backend`). Show-runtime repair → run `vibe
+ runtime prepare --force`.
+- Routes (thin, `@app.route`): `GET /api/dependencies`, and a unified
+ `POST /api/dependencies/<dep>/install` + `GET .../install/<job_id>` for both
+ askill (install/reinstall) and show-runtime (repair, via prepare --force).
+- Tests (`tests/test_local_deps.py`, hermetic — monkeypatch the subprocess
+ boundary): askill install command construction, `ensure` idempotency, the
+ status aggregation shape, and the job-runner generalization.
+
+## Frontend (`ui/`)
+
+- Nav: add `dependencies` to `SettingsPageShell.tsx` `TABS` (after Backends,
+ icon `package`) + the `SettingsTab` union; route `/admin/settings/dependencies`
+ in `App.tsx` (+ legacy `/settings/dependencies` redirect).
+- `SettingsDependenciesPage.tsx` — reuse `SettingsPanel` / `SettingsRow` +
+ `Badge` status pills + `Button` actions + the install-job polling already in
+ `ApiContext` (generalize `installAgent` → `installDependency`). Rows: askill
+ (REQUIRED), Show Page runtime (REQUIRED), Node.js, Agent backends (dim, links
+ to Backends). Auto-managed banner up top. Matches the design.pen frame
+ `vibe-remote — Settings · Dependencies (Dark)`.
+- i18n: `settings.tabs.dependencies` + `settings.dependencies.*` in
+ `en.json` + `zh.json` (1:1).
+
+## Skills dead-end
+
+- `SkillsPage` `notInstalled` block → add a primary **Install askill** button
+ (reuse the install-job + poll); on success, re-run `refresh()`.
+
+## Evidence layers
+
+- Unit: `tests/test_local_deps.py`.
+- Build/type/lint: `tsc --noEmit`, `vite build`, `ruff`.
+- Residual manual (NOT runnable in the sandbox — AGENTS forbids mutating local
+ `~/.vibe_remote`): live install against real `askill.sh`, and the
+ auto-install hook firing during a real `vibe upgrade` / `runtime prepare`.
+
+## Todo
+
+D1 inventory ✓ · D2 plan ✓ · D3 backend · D4 frontend · D5 skills dead-end ·
+D6 validate + reviewer + PR + Codex watch.
diff --git a/tests/test_local_deps.py b/tests/test_local_deps.py
new file mode 100644
index 000000000..b619fb3a3
--- /dev/null
+++ b/tests/test_local_deps.py
@@ -0,0 +1,165 @@
+"""Hermetic tests for the askill local-dependency helpers in vibe/api.py.
+
+The subprocess / path-resolution boundary is monkeypatched, so these run
+without askill, npm, or the network — they pin the install command
+construction, the idempotency of ``ensure_askill_installed``, and the status
+shape.
+"""
+
+from __future__ import annotations
+
+import pytest
+
+from vibe import api
+
+
+def test_install_askill_uses_official_curl_installer(monkeypatch):
+ captured: dict = {}
+ monkeypatch.setattr(api, "resolve_cli_path", lambda b: f"/usr/bin/{b}" if b in {"curl", "bash"} else None)
+
+ def fake_run(name, cmd, _trunc, *, mode="install", env=None):
+ captured.update(name=name, cmd=cmd, mode=mode)
+ return {"ok": True, "path": "/usr/local/bin/askill", "output": ""}
+
+ monkeypatch.setattr(api, "_run_install_command", fake_run)
+ out = api.install_askill()
+ assert out["ok"]
+ assert captured["name"] == "askill"
+ assert captured["cmd"][:2] == ["bash", "-c"]
+ assert "curl -fsSL https://askill.sh | sh" in captured["cmd"][2]
+
+
+def test_install_askill_unsupported_without_curl(monkeypatch):
+ # No curl/bash (e.g. Windows): no broken npm fallback — a clear manual
+ # message pointing at askill.sh, and _run_install_command is never invoked.
+ monkeypatch.setattr(api, "resolve_cli_path", lambda b: None)
+ monkeypatch.setattr(api, "_run_install_command", lambda *a, **k: pytest.fail("should not install"))
+ out = api.install_askill()
+ assert out["ok"] is False
+ assert "askill.sh" in out["message"]
+
+
+def test_ensure_askill_idempotent_when_present(monkeypatch):
+ monkeypatch.setattr(api, "resolve_cli_path", lambda b: "/usr/local/bin/askill")
+ flag = {"installed": False}
+ monkeypatch.setattr(api, "install_askill", lambda: flag.__setitem__("installed", True) or {"ok": True})
+ out = api.ensure_askill_installed()
+ assert out == {"ok": True, "installed": True, "changed": False, "path": "/usr/local/bin/askill"}
+ assert flag["installed"] is False # never installed when already present
+
+
+def test_ensure_askill_installs_when_missing(monkeypatch):
+ # Missing on the first check, resolvable after install.
+ seen = {"n": 0}
+
+ def fake_resolve(_b):
+ seen["n"] += 1
+ return None if seen["n"] == 1 else "/x/askill"
+
+ monkeypatch.setattr(api, "resolve_cli_path", fake_resolve)
+ monkeypatch.setattr(api, "install_askill", lambda: {"ok": True})
+ out = api.ensure_askill_installed()
+ assert out["ok"] and out["installed"] and out["changed"] and out["path"] == "/x/askill"
+
+
+def test_ensure_askill_install_not_discoverable_is_failure(monkeypatch):
+ # Installer exits 0 but the binary never resolves on the service PATH —
+ # must NOT report success, or the UI claims installed while skills 404.
+ monkeypatch.setattr(api, "resolve_cli_path", lambda _b: None)
+ monkeypatch.setattr(api, "install_askill", lambda: {"ok": True})
+ out = api.ensure_askill_installed()
+ assert out["ok"] is False and out["installed"] is False and out["path"] is None
+
+
+def test_ensure_askill_force_reinstalls_even_when_present(monkeypatch):
+ monkeypatch.setattr(api, "resolve_cli_path", lambda b: "/usr/local/bin/askill")
+ flag = {"installed": False}
+ monkeypatch.setattr(api, "install_askill", lambda: flag.__setitem__("installed", True) or {"ok": True})
+ api.ensure_askill_installed(force=True)
+ assert flag["installed"] is True
+
+
+def test_askill_status_missing(monkeypatch):
+ monkeypatch.setattr(api, "resolve_cli_path", lambda b: None)
+ s = api.askill_status()
+ assert s["installed"] is False and s["status"] == "missing" and s["version"] is None
+
+
+def test_askill_status_present_parses_version(monkeypatch):
+ monkeypatch.setattr(api, "resolve_cli_path", lambda b: "/x/askill")
+ monkeypatch.setattr(api, "_command_env_for", lambda p: {})
+ monkeypatch.setattr(api, "isolated_subprocess_kwargs", lambda: {})
+
+ class _R:
+ returncode = 0
+ stdout = "askill 0.1.13\n"
+ stderr = ""
+
+ monkeypatch.setattr(api.subprocess, "run", lambda *a, **k: _R())
+ s = api.askill_status()
+ assert s["installed"] and s["version"] == "0.1.13" and s["status"] == "ready"
+
+
+def test_dependencies_status_shape(monkeypatch):
+ monkeypatch.setattr(
+ api, "askill_status", lambda: {"id": "askill", "installed": True, "version": "0.1.13", "status": "ready", "path": "/x"}
+ )
+ import core.show_runtime as srt_mod
+
+ class _Mgr:
+ def status(self):
+ return {"installed": True, "manifest": {"runtime_version": "1.4.0"}, "node_available": True, "node_version": "20.11"}
+
+ monkeypatch.setattr(srt_mod, "get_show_runtime_manager", lambda: _Mgr())
+ out = api.dependencies_status()
+ assert out["ok"]
+ by = {d["id"]: d for d in out["deps"]}
+ assert list(by) == ["askill", "show-runtime", "node"]
+ assert by["askill"]["status"] == "ready" and by["askill"]["version"] == "0.1.13" and by["askill"]["required"]
+ assert by["show-runtime"]["installed"] and by["show-runtime"]["version"] == "1.4.0"
+ assert by["node"]["installed"] and by["node"]["version"] == "20.11"
+
+
+def test_dependencies_status_node_unsupported_not_ready(monkeypatch):
+ # Node present but below the runtime minimum (node_supported False) -> not ready.
+ monkeypatch.setattr(
+ api, "askill_status", lambda: {"id": "askill", "installed": True, "version": "0.1.13", "status": "ready", "path": "/x"}
+ )
+ import core.show_runtime as srt_mod
+
+ class _Mgr:
+ def status(self):
+ return {"installed": False, "manifest": None, "node_available": True, "node_supported": False, "node_version": "16.0"}
+
+ monkeypatch.setattr(srt_mod, "get_show_runtime_manager", lambda: _Mgr())
+ by = {d["id"]: d for d in api.dependencies_status()["deps"]}
+ assert by["node"]["installed"] is False and by["node"]["status"] == "missing"
+
+
+def test_start_dependency_install_job_rejects_unknown():
+ assert api.start_dependency_install_job("bogus")["ok"] is False
+
+
+def test_start_dependency_install_job_runs_askill(monkeypatch):
+ import time as _t
+
+ flag = {"called": False}
+
+ def fake_ensure(force=False):
+ flag["called"] = True
+ return {"ok": True, "installed": True, "changed": True, "path": "/x/askill"}
+
+ monkeypatch.setattr(api, "ensure_askill_installed", fake_ensure)
+ job = api.start_dependency_install_job("askill")
+ # Don't assert status=="running": an instant (mocked) worker can finish
+ # before the snapshot is taken. Real installs are slow, so the UI still
+ # observes "running" + polls. Verify completion via the poller below.
+ assert job["ok"] and job["backend"] == "askill" and job.get("job_id")
+ cur = job
+ for _ in range(100):
+ cur = api.get_agent_install_job(job["job_id"], backend="askill")
+ if cur.get("status") != "running":
+ break
+ _t.sleep(0.02)
+ assert flag["called"] is True
+ assert cur["status"] == "succeeded" and cur["ok"] is True
diff --git a/ui/src/App.tsx b/ui/src/App.tsx
index 241bd5cae..9e141f576 100644
--- a/ui/src/App.tsx
+++ b/ui/src/App.tsx
@@ -13,6 +13,7 @@ import { ChannelList } from './components/steps/ChannelList';
import { UserList } from './components/steps/UserList';
import { SettingsDiagnosticsPage } from './components/settings/SettingsDiagnosticsPage';
import { SettingsBackendsPage } from './components/settings/SettingsBackendsPage';
+import { SettingsDependenciesPage } from './components/settings/SettingsDependenciesPage';
import { SettingsClaudeProviderPage } from './components/settings/SettingsClaudeProviderPage';
import { SettingsCodexProviderPage } from './components/settings/SettingsCodexProviderPage';
import { SettingsOpencodeProviderPage } from './components/settings/SettingsOpencodeProviderPage';
@@ -241,6 +242,7 @@ function AppRoutes() {
<Route path="/admin/settings/backends/opencode" element={<SettingsOpencodeProviderPage />} />
<Route path="/admin/settings/backends/claude" element={<SettingsClaudeProviderPage />} />
<Route path="/admin/settings/backends/codex" element={<SettingsCodexProviderPage />} />
+ <Route path="/admin/settings/dependencies" element={<SettingsDependenciesPage />} />
<Route path="/admin/settings/messaging" element={<SettingsMessagingPage />} />
<Route path="/admin/settings/diagnostics" element={<SettingsDiagnosticsPage />} />
<Route path="/admin/settings/logs" element={<SettingsLogsPage />} />
@@ -263,6 +265,7 @@ function AppRoutes() {
<Route path="/settings/backends/opencode" element={<Navigate to="/admin/settings/backends/opencode" replace />} />
<Route path="/settings/backends/claude" element={<Navigate to="/admin/settings/backends/claude" replace />} />
<Route path="/settings/backends/codex" element={<Navigate to="/admin/settings/backends/codex" replace />} />
+ <Route path="/settings/dependencies" element={<Navigate to="/admin/settings/dependencies" replace />} />
<Route path="/settings/messaging" element={<Navigate to="/admin/settings/messaging" replace />} />
<Route path="/settings/diagnostics" element={<Navigate to="/admin/settings/diagnostics" replace />} />
<Route path="/settings/logs" element={<Navigate to="/admin/settings/logs" replace />} />
diff --git a/ui/src/components/settings/SettingsBackendsPage.tsx b/ui/src/components/settings/SettingsBackendsPage.tsx
index e6055685d..08740f278 100644
--- a/ui/src/components/settings/SettingsBackendsPage.tsx
+++ b/ui/src/components/settings/SettingsBackendsPage.tsx
@@ -2,11 +2,10 @@ import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { ChevronRight, Settings2 } from 'lucide-react';
-import clsx from 'clsx';
import { Button } from '../ui/button';
import { Badge } from '../ui/badge';
-import { CompactSelect, ToggleSwitch } from './SettingsPrimitives';
+import { CompactSelect, SettingsResourceRow, ToggleSwitch } from './SettingsPrimitives';
import { BackendLifecycleChip } from './BackendLifecycleChip';
import { SettingsPageShell } from './SettingsPageShell';
import { useApi } from '@/context/ApiContext';
@@ -202,67 +201,53 @@ export const SettingsBackendsPage: React.FC = () => {
const route = meta.settingsRoute;
return (
- <div
+ <SettingsResourceRow
key={meta.id}
- className="flex flex-col gap-4 rounded-xl border border-border bg-background px-5 py-4 transition-colors hover:border-border-strong md:flex-row md:items-center"
- >
- <div className="flex min-w-0 flex-1 items-center gap-4">
- <div
- className={clsx(
- 'flex size-11 shrink-0 items-center justify-center rounded-[10px]',
- meta.tileCls
+ icon={Icon}
+ tileClassName={meta.tileCls}
+ iconClassName={meta.iconCls}
+ title={meta.label}
+ badges={
+ isDefault && (
+ <Badge variant="success" className="font-mono uppercase tracking-[0.08em]">
+ {t('settings.backends.defaultBadge')}
+ </Badge>
+ )
+ }
+ detail={t(`settings.backends.${meta.id}Description`)}
+ actions={
+ <>
+ <BackendLifecycleChip
+ name={meta.id}
+ enabled={agent.enabled}
+ cliStatus={agent.status}
+ onChanged={async (info) => {
+ const installedPath = info?.installedPath || null;
+ if (installedPath) {
+ setAgents((prev) => ({
+ ...prev,
+ [meta.id]: { ...prev[meta.id], cli_path: installedPath },
+ }));
+ }
+ await refreshDetectionFor(meta.id, installedPath || agent.cli_path);
+ }}
+ />
+ <ToggleSwitch
+ enabled={agent.enabled}
+ onClick={() => void handleToggle(meta.id, !agent.enabled)}
+ />
+ {route && (
+ <Button asChild variant="secondary" size="xs">
+ <Link to={route} aria-label={t('settings.backends.configure', { name: meta.label }) as string}>
+ <Settings2 className="size-3.5" />
+ {t('settings.backends.configure')}
+ <ChevronRight className="size-3.5" />
+ </Link>
+ </Button>
)}
- >
- <Icon size={22} className={meta.iconCls} />
- </div>
- <div className="flex min-w-0 flex-col gap-1">
- <div className="flex flex-wrap items-center gap-2">
- <span className="text-[15px] font-semibold text-foreground">
- {meta.label}
- </span>
- {isDefault && (
- <Badge variant="success" className="font-mono uppercase tracking-[0.08em]">
- {t('settings.backends.defaultBadge')}
- </Badge>
- )}
- </div>
- <p className="text-[12px] leading-snug text-muted">
- {t(`settings.backends.${meta.id}Description`)}
- </p>
- </div>
- </div>
-
- <div className="flex flex-wrap items-center gap-3 md:shrink-0 md:justify-end">
- <BackendLifecycleChip
- name={meta.id}
- enabled={agent.enabled}
- cliStatus={agent.status}
- onChanged={async (info) => {
- const installedPath = info?.installedPath || null;
- if (installedPath) {
- setAgents((prev) => ({
- ...prev,
- [meta.id]: { ...prev[meta.id], cli_path: installedPath },
- }));
- }
- await refreshDetectionFor(meta.id, installedPath || agent.cli_path);
- }}
- />
- <ToggleSwitch
- enabled={agent.enabled}
- onClick={() => void handleToggle(meta.id, !agent.enabled)}
- />
- {route && (
- <Button asChild variant="secondary" size="xs">
- <Link to={route} aria-label={t('settings.backends.configure', { name: meta.label }) as string}>
- <Settings2 className="size-3.5" />
- {t('settings.backends.configure')}
- <ChevronRight className="size-3.5" />
- </Link>
- </Button>
- )}
- </div>
- </div>
+ </>
+ }
+ />
);
})}
</div>
diff --git a/ui/src/components/settings/SettingsDependenciesPage.tsx b/ui/src/components/settings/SettingsDependenciesPage.tsx
new file mode 100644
index 000000000..6354cb461
--- /dev/null
+++ b/ui/src/components/settings/SettingsDependenciesPage.tsx
@@ -0,0 +1,164 @@
+import React, { useCallback, useEffect, useState } from 'react';
+import { Link } from 'react-router-dom';
+import { useTranslation } from 'react-i18next';
+import { ArrowUpRight, Download, Hexagon, LayoutDashboard, Loader2, RefreshCw, ShieldCheck, Terminal, WandSparkles } from 'lucide-react';
+import type { LucideIcon } from 'lucide-react';
+
+import { Button } from '../ui/button';
+import { Badge } from '../ui/badge';
+import { SettingsPageShell } from './SettingsPageShell';
+import { SettingsResourceRow } from './SettingsPrimitives';
+import { useApi } from '@/context/ApiContext';
+import type { DependencyItem } from '@/context/ApiContext';
+import { useToast } from '@/context/ToastContext';
+
+// Mirrors design.pen "vibe-remote — Settings · Dependencies": one card per
+// required local runtime (icon tile + name/REQUIRED + detail + status pill +
+// action), reusing the Backends-page card shape. askill + the Show Page
+// runtime auto-install during `vibe runtime prepare`; this page surfaces their
+// status and offers manual re-check / install / repair. Backend CLIs are
+// managed on the Backends tab — linked, not duplicated.
+
+type DepMeta = { icon: LucideIcon; tileCls: string; iconCls: string };
+
+const DEP_META: Record<string, DepMeta> = {
+ askill: { icon: WandSparkles, tileCls: 'bg-mint-soft', iconCls: 'text-mint' },
+ 'show-runtime': { icon: LayoutDashboard, tileCls: 'bg-cyan-soft', iconCls: 'text-cyan' },
+ node: { icon: Hexagon, tileCls: 'bg-violet-soft', iconCls: 'text-violet' },
+};
+
+export const SettingsDependenciesPage: React.FC = () => {
+ const { t } = useTranslation();
+ const api = useApi();
+ const { showToast } = useToast();
+
+ const [deps, setDeps] = useState<DependencyItem[] | null>(null);
+ const [busy, setBusy] = useState<string | null>(null);
+
+ const refresh = useCallback(async () => {
+ try {
+ const res = await api.listDependencies();
+ setDeps(res.deps ?? []);
+ } catch {
+ setDeps([]);
+ }
+ }, [api]);
+
+ useEffect(() => {
+ void refresh();
+ }, [refresh]);
+
+ const install = async (dep: DependencyItem) => {
+ setBusy(dep.id);
+ try {
+ const res = await api.installDependency(dep.id);
+ showToast(
+ res.ok
+ ? t('settings.dependencies.installed', { name: t(`settings.dependencies.items.${dep.id}.label`) })
+ : res.message || t('settings.dependencies.installFailed'),
+ res.ok ? 'success' : 'error'
+ );
+ await refresh();
+ } catch (e: any) {
+ showToast(e?.message || t('settings.dependencies.installFailed'), 'error');
+ } finally {
+ setBusy(null);
+ }
+ };
+
+ const statusText = (d: DependencyItem) => {
+ if (!d.installed) return t('settings.dependencies.statusMissing');
+ const word = d.kind === 'node' ? t('settings.dependencies.statusDetected') : t('settings.dependencies.statusReady');
+ return d.version ? `${word} · v${String(d.version).replace(/^v/i, '')}` : word;
+ };
+
+ return (
+ <SettingsPageShell
+ activeTab="dependencies"
+ title={t('settings.dependenciesTitle')}
+ subtitle={t('settings.dependenciesSubtitle')}
+ actions={
+ <Button variant="secondary" size="sm" onClick={() => void refresh()}>
+ <RefreshCw className="size-3.5" />
+ {t('settings.dependencies.recheckAll')}
+ </Button>
+ }
+ >
+ {deps === null ? (
+ <div className="text-sm text-muted">{t('common.loading')}</div>
+ ) : (
+ <div className="flex flex-col gap-3.5">
+ <div className="flex items-center gap-3 rounded-xl border border-mint/30 bg-mint/[0.08] px-5 py-3.5">
+ <ShieldCheck className="size-4 shrink-0 text-mint" />
+ <span className="text-[13px] leading-snug text-foreground">{t('settings.dependencies.autoBanner')}</span>
+ </div>
+
+ {deps.map((d) => {
+ const meta = DEP_META[d.id] ?? DEP_META.node;
+ const installing = busy === d.id;
+ const showAction = d.id === 'askill' || d.id === 'show-runtime';
+ return (
+ <SettingsResourceRow
+ key={d.id}
+ icon={meta.icon}
+ tileClassName={meta.tileCls}
+ iconClassName={meta.iconCls}
+ title={t(`settings.dependencies.items.${d.id}.label`)}
+ badges={
+ d.required && (
+ <Badge variant="secondary" className="font-mono uppercase tracking-[0.08em]">
+ {t('settings.dependencies.required')}
+ </Badge>
+ )
+ }
+ detail={t(`settings.dependencies.items.${d.id}.detail`)}
+ actions={
+ <>
+ <Badge variant={d.installed ? 'success' : 'destructive'} className="font-mono">
+ {statusText(d)}
+ </Badge>
+ {showAction && (
+ <Button variant={d.installed ? 'secondary' : 'brand'} size="xs" disabled={installing} onClick={() => void install(d)}>
+ {installing ? (
+ <Loader2 className="size-3.5 animate-spin" />
+ ) : d.installed ? (
+ <RefreshCw className="size-3.5" />
+ ) : (
+ <Download className="size-3.5" />
+ )}
+ {installing
+ ? t('settings.dependencies.installing')
+ : d.installed
+ ? d.id === 'show-runtime'
+ ? t('settings.dependencies.repair')
+ : t('settings.dependencies.reinstall')
+ : t('settings.dependencies.install')}
+ </Button>
+ )}
+ </>
+ }
+ />
+ );
+ })}
+
+ <SettingsResourceRow
+ icon={Terminal}
+ tileClassName="bg-surface-3"
+ iconClassName="text-muted"
+ className="opacity-70"
+ title={t('settings.dependencies.backendsTitle')}
+ detail={t('settings.dependencies.backendsDetail')}
+ actions={
+ <Button asChild variant="secondary" size="xs">
+ <Link to="/admin/settings/backends">
+ {t('settings.dependencies.manageBackends')}
+ <ArrowUpRight className="size-3.5" />
+ </Link>
+ </Button>
+ }
+ />
+ </div>
+ )}
+ </SettingsPageShell>
+ );
+};
diff --git a/ui/src/components/settings/SettingsPageShell.tsx b/ui/src/components/settings/SettingsPageShell.tsx
index b503b1652..107b80faf 100644
--- a/ui/src/components/settings/SettingsPageShell.tsx
+++ b/ui/src/components/settings/SettingsPageShell.tsx
@@ -4,13 +4,14 @@ import clsx from 'clsx';
import { useTranslation } from 'react-i18next';
import {
MessageSquare,
+ Package,
PlugZap,
Server,
Sparkles,
Stethoscope,
} from 'lucide-react';
-type SettingsTab = 'service' | 'platforms' | 'backends' | 'messaging' | 'diagnostics';
+type SettingsTab = 'service' | 'platforms' | 'backends' | 'dependencies' | 'messaging' | 'diagnostics';
const TABS: Array<{
key: SettingsTab;
@@ -21,6 +22,7 @@ const TABS: Array<{
{ key: 'service', href: '/settings/service', label: 'settings.tabs.service', icon: Server },
{ key: 'platforms', href: '/settings/platforms', label: 'settings.tabs.platforms', icon: PlugZap },
{ key: 'backends', href: '/settings/backends', label: 'settings.tabs.backends', icon: Sparkles },
+ { key: 'dependencies', href: '/settings/dependencies', label: 'settings.tabs.dependencies', icon: Package },
{ key: 'messaging', href: '/settings/messaging', label: 'settings.tabs.messaging', icon: MessageSquare },
{ key: 'diagnostics', href: '/settings/diagnostics', label: 'settings.tabs.diagnostics', icon: Stethoscope },
];
diff --git a/ui/src/components/settings/SettingsPrimitives.tsx b/ui/src/components/settings/SettingsPrimitives.tsx
index cb5e890bd..a08c8e928 100644
--- a/ui/src/components/settings/SettingsPrimitives.tsx
+++ b/ui/src/components/settings/SettingsPrimitives.tsx
@@ -145,3 +145,50 @@ export const ToggleSwitch: React.FC<{ enabled: boolean; onClick: () => void; dis
/>
</button>
);
+
+type SettingsResourceRowProps = {
+ icon: React.ComponentType<{ size?: number; className?: string }>;
+ tileClassName: string;
+ iconClassName: string;
+ title: React.ReactNode;
+ badges?: React.ReactNode;
+ detail?: React.ReactNode;
+ actions?: React.ReactNode;
+ className?: string;
+};
+
+// Shared "managed resource" card: lead icon tile + title (+ inline badges) +
+// detail line, with a right-aligned action cluster. Mirrors design.pen
+// qVHh4 (VR/CM/Backends) cards; used by both the Backends and Dependencies
+// settings pages so the row shell stays one concept in one home.
+export const SettingsResourceRow: React.FC<SettingsResourceRowProps> = ({
+ icon: Icon,
+ tileClassName,
+ iconClassName,
+ title,
+ badges,
+ detail,
+ actions,
+ className,
+}) => (
+ <div
+ className={clsx(
+ 'flex flex-col gap-4 rounded-xl border border-border bg-background px-5 py-4 transition-colors hover:border-border-strong md:flex-row md:items-center',
+ className
+ )}
+ >
+ <div className="flex min-w-0 flex-1 items-center gap-4">
+ <div className={clsx('flex size-11 shrink-0 items-center justify-center rounded-[10px]', tileClassName)}>
+ <Icon size={22} className={iconClassName} />
+ </div>
+ <div className="flex min-w-0 flex-col gap-1">
+ <div className="flex flex-wrap items-center gap-2">
+ <span className="text-[15px] font-semibold text-foreground">{title}</span>
+ {badges}
+ </div>
+ {detail && <p className="text-[12px] leading-snug text-muted">{detail}</p>}
+ </div>
+ </div>
+ {actions && <div className="flex flex-wrap items-center gap-3 md:shrink-0 md:justify-end">{actions}</div>}
+ </div>
+);
diff --git a/ui/src/components/workbench/SkillsPage.tsx b/ui/src/components/workbench/SkillsPage.tsx
index 0f11ca12e..b67e4842c 100644
--- a/ui/src/components/workbench/SkillsPage.tsx
+++ b/ui/src/components/workbench/SkillsPage.tsx
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { ChevronDown, Compass, Funnel, Info, Plus, RefreshCw, Search, Terminal, WandSparkles } from 'lucide-react';
+import { ChevronDown, Compass, Download, Funnel, Info, Loader2, Plus, RefreshCw, Search, Terminal, WandSparkles } from 'lucide-react';
import clsx from 'clsx';
import { useApi } from '../../context/ApiContext';
@@ -31,6 +31,7 @@ export const SkillsPage: React.FC = () => {
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
const [notInstalled, setNotInstalled] = useState(false);
+ const [installingAskill, setInstallingAskill] = useState(false);
const [search, setSearch] = useState('');
const [backendFilter, setBackendFilter] = useState<Backend | 'all'>('all');
const [selectedKey, setSelectedKey] = useState<string | null>(null);
@@ -289,10 +290,35 @@ export const SkillsPage: React.FC = () => {
) : null}
{notInstalled ? (
- <div className="flex flex-col items-center gap-2 rounded-xl border border-dashed border-border bg-surface px-6 py-12 text-center">
+ <div className="flex flex-col items-center gap-3 rounded-xl border border-dashed border-border bg-surface px-6 py-12 text-center">
<Terminal className="size-7 text-muted" />
<div className="text-[14px] font-semibold text-foreground">{t('skills.notInstalled')}</div>
- <div className="font-mono text-[11.5px] text-muted">{t('skills.notInstalledHint')}</div>
+ <div className="max-w-md font-mono text-[11.5px] text-muted">{t('skills.notInstalledHint')}</div>
+ <Button
+ variant="brand"
+ size="sm"
+ className="mt-1"
+ disabled={installingAskill}
+ onClick={async () => {
+ setInstallingAskill(true);
+ try {
+ const res = await api.installDependency('askill');
+ if (res.ok) {
+ setNotInstalled(false);
+ await refresh();
+ } else {
+ showToast(res.message || t('skills.installFailed'), 'error');
+ }
+ } catch (err: any) {
+ showToast(err?.message || t('skills.installFailed'), 'error');
+ } finally {
+ setInstallingAskill(false);
+ }
+ }}
+ >
+ {installingAskill ? <Loader2 className="size-3.5 animate-spin" /> : <Download className="size-3.5" />}
+ {installingAskill ? t('skills.installing') : t('skills.installAskill')}
+ </Button>
</div>
) : (
<div className={clsx('grid gap-5', selected ? 'lg:grid-cols-[1fr_400px]' : 'grid-cols-1')}>
diff --git a/ui/src/context/ApiContext.tsx b/ui/src/context/ApiContext.tsx
index 235c2ebe3..bc08dcb26 100644
--- a/ui/src/context/ApiContext.tsx
+++ b/ui/src/context/ApiContext.tsx
@@ -19,6 +19,8 @@ export type ApiContextType = {
getFirstBindCode: () => Promise<any>;
detectCli: (binary: string) => Promise<any>;
installAgent: (name: string) => Promise<InstallResult>;
+ listDependencies: () => Promise<DependenciesResult>;
+ installDependency: (dep: string) => Promise<InstallResult>;
getBackendRuntime: (name: string) => Promise<BackendRuntimeInfo>;
restartBackend: (name: string) => Promise<BackendRestartResult>;
getCodexAuth: () => Promise<CodexAuthState>;
@@ -586,6 +588,17 @@ export type InstallResult = {
status?: 'running' | 'succeeded' | 'failed';
};
+export type DependencyItem = {
+ id: string;
+ kind: 'tool' | 'runtime' | 'node';
+ required: boolean;
+ installed: boolean;
+ version: string | null;
+ status: 'ready' | 'missing';
+};
+
+export type DependenciesResult = { ok: boolean; deps: DependencyItem[] };
+
export type BackendRuntimeInfo = {
ok: boolean;
name?: string;
@@ -935,6 +948,23 @@ export const ApiProvider: React.FC<{ children: React.ReactNode }> = ({ children
const sleep = (ms: number) => new Promise((resolve) => window.setTimeout(resolve, ms));
+ const startAndPollDependencyInstall = async (dep: string): Promise<InstallResult> => {
+ const started = await postJson(`/api/dependencies/${encodeURIComponent(dep)}/install`, {});
+ const jobId = typeof started?.job_id === 'string' ? started.job_id : null;
+ if (!jobId) return started;
+
+ const deadline = Date.now() + 310_000;
+ let last = started;
+ while (Date.now() < deadline) {
+ await sleep(1000);
+ last = await getJson(`/api/dependencies/${encodeURIComponent(dep)}/install/${encodeURIComponent(jobId)}`);
+ if (last?.status === 'succeeded' || last?.status === 'failed') {
+ return last;
+ }
+ }
+ return { ...last, ok: false, status: 'failed', message: t('settings.dependencies.installFailed') };
+ };
+
const startAndPollAgentInstall = async (name: string): Promise<InstallResult> => {
const started = await postJson(`/api/agent/${encodeURIComponent(name)}/install`, {});
const jobId = typeof started?.job_id === 'string' ? started.job_id : null;
@@ -999,6 +1029,8 @@ export const ApiProvider: React.FC<{ children: React.ReactNode }> = ({ children
getFirstBindCode: () => getJson('/api/setup/first-bind-code'),
detectCli: (binary) => getJson(`/api/cli/detect?binary=${encodeURIComponent(binary)}`),
installAgent: (name) => startAndPollAgentInstall(name),
+ listDependencies: () => getJson('/api/dependencies'),
+ installDependency: (dep) => startAndPollDependencyInstall(dep),
getBackendRuntime: (name) => getJson(`/api/backend/${encodeURIComponent(name)}/runtime`),
restartBackend: (name) => postJson(`/api/backend/${encodeURIComponent(name)}/restart`, {}),
getCodexAuth: () => getJson('/api/backend/codex/auth'),
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index 0ebd8cd82..7c91b4ba4 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -80,6 +80,7 @@
"service": "Service",
"platforms": "Platforms",
"backends": "Backends",
+ "dependencies": "Dependencies",
"messaging": "Messaging",
"diagnostics": "Diagnostics",
"serviceRoot": "Settings"
@@ -103,6 +104,30 @@
"platformsSubtitle": "Configure which messaging platforms are connected and how each one is enabled.",
"backendsTitle": "Backends",
"backendsSubtitle": "Manage agent backends, default routing, and local CLI availability.",
+ "dependenciesTitle": "Dependencies",
+ "dependenciesSubtitle": "Local runtimes that Vibe Remote installs and keeps up to date automatically.",
+ "dependencies": {
+ "autoBanner": "Vibe Remote installs and updates these for you. Re-check, repair, or update manually below.",
+ "recheckAll": "Re-check all",
+ "required": "Required",
+ "statusReady": "Ready",
+ "statusDetected": "Detected",
+ "statusMissing": "Not installed",
+ "install": "Install",
+ "reinstall": "Reinstall",
+ "repair": "Repair",
+ "installing": "Installing…",
+ "installed": "{{name}} is ready.",
+ "installFailed": "Install failed.",
+ "backendsTitle": "Agent backends",
+ "backendsDetail": "Claude · OpenCode · Codex — managed in the Backends tab.",
+ "manageBackends": "Manage in Backends",
+ "items": {
+ "askill": { "label": "askill", "detail": "Agent Skills runtime — powers the Skills page." },
+ "show-runtime": { "label": "Show Page runtime", "detail": "Renders visual Show Pages on your machine." },
+ "node": { "label": "Node.js", "detail": "Shared prerequisite for the runtimes above." }
+ }
+ },
"backends": {
"routingTitle": "Default routing",
"routingHint": "Pick the backend that powers new conversations by default. Per-group overrides are configured on the Groups page.",
@@ -1329,7 +1354,10 @@
"empty": "No skills installed yet. Add one from GitHub, a .zip, or the registry.",
"noSearchMatch": "No matching skills.",
"notInstalled": "askill isn't installed",
- "notInstalledHint": "Install the askill CLI to manage skills: curl -fsSL https://askill.sh | sh",
+ "notInstalledHint": "askill powers the Skills page. Install it now, or it installs automatically when Vibe Remote updates.",
+ "installAskill": "Install askill",
+ "installing": "Installing…",
+ "installFailed": "Could not install askill.",
"removeConfirm": "Remove skill \"{{name}}\"? This unlinks it from the selected scope.",
"removeSuccess": "Removed {{name}}.",
"addSuccess": "Installed {{count}} skill(s).",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index 9cef5700d..bc205ae1f 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -80,6 +80,7 @@
"service": "服务",
"platforms": "平台",
"backends": "后端",
+ "dependencies": "依赖",
"messaging": "消息",
"diagnostics": "诊断",
"serviceRoot": "设置"
@@ -103,6 +104,30 @@
"platformsSubtitle": "配置启用哪些消息平台,以及每个平台的接入状态。",
"backendsTitle": "后端",
"backendsSubtitle": "管理 agent 后端、默认路由和本地 CLI 可用性。",
+ "dependenciesTitle": "依赖",
+ "dependenciesSubtitle": "Vibe Remote 自动安装并保持最新的本地运行时。",
+ "dependencies": {
+ "autoBanner": "这些依赖由 Vibe Remote 自动安装与更新。下面可手动重新检查、修复或更新。",
+ "recheckAll": "全部重新检查",
+ "required": "必装",
+ "statusReady": "就绪",
+ "statusDetected": "已检测",
+ "statusMissing": "未安装",
+ "install": "安装",
+ "reinstall": "重新安装",
+ "repair": "修复",
+ "installing": "安装中…",
+ "installed": "{{name}} 已就绪。",
+ "installFailed": "安装失败。",
+ "backendsTitle": "Agent 后端",
+ "backendsDetail": "Claude · OpenCode · Codex —— 在 Backends 标签页管理。",
+ "manageBackends": "前往 Backends",
+ "items": {
+ "askill": { "label": "askill", "detail": "Agent Skills 运行时 —— 驱动 Skills 页面。" },
+ "show-runtime": { "label": "Show Page 运行时", "detail": "在你本机渲染可视化 Show 页面。" },
+ "node": { "label": "Node.js", "detail": "上述运行时的共同前置依赖。" }
+ }
+ },
"backends": {
"routingTitle": "默认路由",
"routingHint": "选择默认承载新会话的后端。每个群组的覆盖项在「群组」页配置。",
@@ -1328,7 +1353,10 @@
"empty": "还没有安装技能。可从 GitHub、.zip 或注册表添加。",
"noSearchMatch": "没有匹配的技能。",
"notInstalled": "尚未安装 askill",
- "notInstalledHint": "安装 askill CLI 以管理技能:curl -fsSL https://askill.sh | sh",
+ "notInstalledHint": "askill 驱动 Skills 页面。可现在安装,或在 Vibe Remote 更新时自动安装。",
+ "installAskill": "安装 askill",
+ "installing": "安装中…",
+ "installFailed": "安装 askill 失败。",
"removeConfirm": "移除技能 \"{{name}}\"?这会从当前范围解除链接。",
"removeSuccess": "已移除 {{name}}。",
"addSuccess": "已安装 {{count}} 个技能。",
diff --git a/vibe/api.py b/vibe/api.py
index 2a8c93653..cc9b1f2ad 100644
--- a/vibe/api.py
+++ b/vibe/api.py
@@ -1687,7 +1687,9 @@ def _prepare_show_runtime_after_upgrade(vibe_path: str | None, cwd: str) -> str
[vibe_path, "runtime", "prepare", "--strict"],
capture_output=True,
text=True,
- timeout=300,
+ # 600s (not 300s): prepare now refreshes both the Show Runtime AND
+ # askill, so budget for two installers nested in this one call.
+ timeout=600,
cwd=cwd,
check=False,
)
@@ -2360,6 +2362,225 @@ def _run_install_command(
return {"ok": False, "message": str(e), "output": None}
+# =============================================================================
+# Local dependencies (askill) — required tools Vibe Remote installs for the user
+# =============================================================================
+
+
+def _truncate_install_output(output: str, limit: int = 8192) -> str:
+ return output if len(output) <= limit else "...(truncated)\n" + output[-limit:]
+
+
+def install_askill() -> dict:
+ """Install (or refresh) the askill CLI — a required local dependency for Skills.
+
+ Uses the official one-line installer (same shape as the OpenCode bootstrap
+ in ``install_agent``), with an npm fallback. Runs through
+ ``_run_install_command``, which already skips the ``agents.<name>.cli_path``
+ write when there is no ``agents.askill`` attribute, so it is safe for a
+ standalone (non-agent) tool.
+ """
+ import platform
+
+ system = platform.system().lower()
+ if system != "windows" and resolve_cli_path("curl") and resolve_cli_path("bash"):
+ cmd = ["bash", "-c", "set -euo pipefail; curl -fsSL https://askill.sh | sh"]
+ return _run_install_command("askill", cmd, _truncate_install_output, mode="install")
+ # No npm fallback: askill is distributed via the askill.sh installer, not a
+ # public npm package, so a curl/bash-less host (e.g. Windows) must install
+ # it manually rather than hit a guaranteed-failing `npm i -g`.
+ return {
+ "ok": False,
+ "message": "askill auto-install needs curl + bash (macOS/Linux). Install it manually from https://askill.sh.",
+ "output": None,
+ }
+
+
+def ensure_askill_installed(force: bool = False) -> dict:
+ """Ensure askill is present. Idempotent — installs only when missing or forced.
+
+ Reports success only when the binary is actually resolvable afterward: an
+ installer can exit 0 while leaving the binary on a PATH this service does not
+ inherit, and we must not claim "installed" while ``/api/skills`` still
+ answers ``askill_not_found``.
+ """
+ existing = resolve_cli_path("askill")
+ if existing and not force:
+ return {"ok": True, "installed": True, "changed": False, "path": existing}
+ result = install_askill()
+ resolved = resolve_cli_path("askill")
+ installed = bool(resolved)
+ result["installed"] = installed
+ result["changed"] = installed and bool(result.get("ok"))
+ result["path"] = resolved
+ if result.get("ok") and not installed:
+ result["ok"] = False
+ result["message"] = (
+ result.get("message") or "askill installed but was not found on PATH; restart the service or check PATH."
+ )
+ return result
+
+
+def askill_status() -> dict:
+ """Report whether askill is installed and its version (best-effort)."""
+ path = resolve_cli_path("askill")
+ if not path:
+ return {"id": "askill", "installed": False, "version": None, "status": "missing", "path": None}
+ version: str | None = None
+ try:
+ proc = subprocess.run(
+ [path, "--version"],
+ capture_output=True,
+ text=True,
+ timeout=10,
+ env=_command_env_for(path),
+ **isolated_subprocess_kwargs(),
+ )
+ text = (proc.stdout or proc.stderr or "").strip()
+ if proc.returncode == 0 and text:
+ version = text.split()[-1]
+ except Exception: # noqa: BLE001
+ version = None
+ return {"id": "askill", "installed": True, "version": version, "status": "ready", "path": path}
+
+
+# =============================================================================
+# Dependencies aggregate + manual install jobs (askill / show runtime)
+# =============================================================================
+
+_ALLOWED_DEP_INSTALLS = {"askill", "show-runtime"}
+
+
+def dependencies_status() -> dict:
+ """Status of the required local runtime dependencies for the Dependencies
+ settings page: askill, the Show Page runtime, and the shared Node.js
+ prerequisite. (Agent backend CLIs are managed on the Backends tab.)
+
+ Returns stable ids + machine-readable status only — display copy (label /
+ detail) is localized in the React page, not sent from here.
+ """
+ deps: list[dict] = []
+
+ a = askill_status()
+ deps.append(
+ {
+ "id": "askill",
+ "kind": "tool",
+ "required": True,
+ "installed": a["installed"],
+ "version": a.get("version"),
+ "status": a["status"],
+ }
+ )
+
+ try:
+ from core.show_runtime import get_show_runtime_manager
+
+ srt = get_show_runtime_manager().status()
+ except Exception as exc: # noqa: BLE001
+ srt = {"installed": False, "node_available": None, "node_version": None, "reason": str(exc)}
+ manifest = srt.get("manifest") if isinstance(srt.get("manifest"), dict) else {}
+ srt_installed = bool(srt.get("installed"))
+ deps.append(
+ {
+ "id": "show-runtime",
+ "kind": "runtime",
+ "required": True,
+ "installed": srt_installed,
+ "version": manifest.get("runtime_version"),
+ "status": "ready" if srt_installed else "missing",
+ }
+ )
+
+ # Node present but below the Show Runtime minimum (node_supported is False)
+ # is not actually usable — don't show it green while runtime repair fails.
+ node_ok = bool(srt.get("node_available")) and srt.get("node_supported") is not False
+ deps.append(
+ {
+ "id": "node",
+ "kind": "node",
+ "required": True,
+ "installed": node_ok,
+ "version": srt.get("node_version"),
+ "status": "ready" if node_ok else "missing",
+ }
+ )
+
+ return {"ok": True, "deps": deps}
+
+
+def _prepare_show_runtime_job() -> dict:
+ try:
+ from core.show_runtime import get_show_runtime_manager
+
+ payload = get_show_runtime_manager().prepare(force=True)
+ ok = bool(payload.get("ok"))
+ return {
+ "ok": ok,
+ "message": "Show Runtime ready." if ok else (payload.get("reason") or "Show Runtime prepare failed"),
+ "output": None,
+ }
+ except Exception as exc: # noqa: BLE001
+ return {"ok": False, "message": str(exc), "output": None}
+
+
+def start_dependency_install_job(dep: str) -> dict:
+ """Install/repair a required local dependency in a background job.
+
+ Reuses the agent install-job store (lock / prune / latest-by-key and the
+ ``get_agent_install_job`` poller) keyed by the dependency id, so the UI gets
+ the same non-blocking install + poll experience without running
+ package-manager subprocesses on the request path.
+ """
+ if dep not in _ALLOWED_DEP_INSTALLS:
+ return {"ok": False, "message": f"Unknown dependency: {dep}"}
+
+ job_id = uuid.uuid4().hex
+ now = time.time()
+ job = {
+ "ok": True,
+ "job_id": job_id,
+ "backend": dep,
+ "status": "running",
+ "message": "Install started",
+ "output": "",
+ "path": None,
+ "started_at": now,
+ "finished_at": None,
+ }
+ with _AGENT_INSTALL_JOB_LOCK:
+ _prune_agent_install_jobs(now)
+ latest_job_id = _AGENT_INSTALL_LATEST_BY_BACKEND.get(dep)
+ latest_job = _AGENT_INSTALL_JOBS.get(latest_job_id or "")
+ if isinstance(latest_job, dict) and latest_job.get("status") == "running":
+ return dict(latest_job)
+ _AGENT_INSTALL_JOBS[job_id] = job
+ _AGENT_INSTALL_LATEST_BY_BACKEND[dep] = job_id
+
+ def _worker() -> None:
+ try:
+ result = ensure_askill_installed(force=True) if dep == "askill" else _prepare_show_runtime_job()
+ ok = bool(result.get("ok"))
+ with _AGENT_INSTALL_JOB_LOCK:
+ current = _AGENT_INSTALL_JOBS.get(job_id)
+ if current is not None:
+ current.update(result)
+ current["ok"] = ok
+ current["status"] = "succeeded" if ok else "failed"
+ current["finished_at"] = time.time()
+ except Exception as exc: # noqa: BLE001
+ logger.warning("Dependency install job failed for %s: %s", dep, exc, exc_info=True)
+ with _AGENT_INSTALL_JOB_LOCK:
+ current = _AGENT_INSTALL_JOBS.get(job_id)
+ if current is not None:
+ current.update(
+ {"ok": False, "status": "failed", "message": str(exc), "output": None, "finished_at": time.time()}
+ )
+
+ threading.Thread(target=_worker, daemon=True, name=f"vibe-dep-install-{dep}-{job_id[:8]}").start()
+ return dict(job)
+
+
# =============================================================================
# Backend lifecycle (version probe, latest check, restart)
# =============================================================================
diff --git a/vibe/cli.py b/vibe/cli.py
index 585bb8842..b48b008d9 100644
--- a/vibe/cli.py
+++ b/vibe/cli.py
@@ -4661,16 +4661,25 @@ def cmd_runtime(args) -> int:
if command == "prepare":
offline = True if getattr(args, "offline", False) else None
payload = manager.prepare(force=getattr(args, "force", False), offline=offline)
+ askill = _ensure_askill_during_prepare(offline=bool(offline))
+ payload["askill"] = askill
if getattr(args, "json", False):
print(json.dumps(payload, indent=2))
- elif payload.get("ok"):
- print("Show Runtime ready.")
- status = payload.get("status") or {}
- if status.get("install_dir"):
- print(f"Install dir: {status['install_dir']}")
else:
- reason = payload.get("reason") or "unknown"
- print(f"Show Runtime prepare failed: {reason}", file=sys.stderr)
+ if payload.get("ok"):
+ print("Show Runtime ready.")
+ status = payload.get("status") or {}
+ if status.get("install_dir"):
+ print(f"Install dir: {status['install_dir']}")
+ else:
+ reason = payload.get("reason") or "unknown"
+ print(f"Show Runtime prepare failed: {reason}", file=sys.stderr)
+ if askill.get("skipped"):
+ print(f"askill: skipped ({askill.get('reason') or 'skipped'}).")
+ elif askill.get("ok"):
+ print("askill installed." if askill.get("changed") else "askill ready.")
+ else:
+ print(f"askill not ready: {askill.get('message') or 'install failed'}", file=sys.stderr)
return 1 if getattr(args, "strict", False) and not payload.get("ok") else 0
if command == "clean":
payload = manager.clean(keep_previous=getattr(args, "keep_previous", 1))
@@ -4698,7 +4707,9 @@ def _prepare_show_runtime_after_install(vibe_path: str | None) -> None:
capture_output=True,
text=True,
cwd=safe_cwd,
- timeout=300,
+ # 600s (not 300s): prepare now refreshes both the Show Runtime AND
+ # askill, so budget for two installers nested in this one call.
+ timeout=600,
check=False,
)
except Exception as exc:
@@ -4713,6 +4724,27 @@ def _prepare_show_runtime_after_install(vibe_path: str | None) -> None:
print(detail)
+def _ensure_askill_during_prepare(offline: bool = False) -> dict:
+ """Ensure askill (a required local dependency) alongside the Show Runtime.
+
+ Folded into ``vibe runtime prepare`` so askill auto-installs at exactly the
+ same lifecycle points as the Show Page runtime (post install / upgrade),
+ with a ``VIBE_INSTALL_SKIP_ASKILL`` escape hatch mirroring the Show Runtime
+ one. Skipped under ``--offline`` (the askill installer needs the network).
+ Refreshes askill to latest even when a binary already exists — prepare is
+ the chokepoint that keeps required local deps current on upgrade. An askill
+ hiccup never fails the prepare; the Dependencies page offers a manual retry.
+ """
+ if offline:
+ return {"ok": True, "skipped": True, "reason": "offline"}
+ if os.environ.get("VIBE_INSTALL_SKIP_ASKILL", "").strip().lower() in {"1", "true", "yes", "on"}:
+ return {"ok": True, "skipped": True, "reason": "VIBE_INSTALL_SKIP_ASKILL"}
+ try:
+ return api.ensure_askill_installed(force=True)
+ except Exception as exc: # noqa: BLE001
+ return {"ok": False, "message": str(exc)}
+
+
def cmd_restart():
"""Restart all services (stop + start)."""
return _cmd_restart_with_delay(0.0)
diff --git a/vibe/ui_server.py b/vibe/ui_server.py
index 2543bea6d..2fedeee9f 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -2378,6 +2378,41 @@ def backend_restart(name):
return jsonify(api.restart_backend(name))
+_ALLOWED_DEPENDENCIES = {"askill", "show-runtime"}
+
+
[email protected]("/api/dependencies")
+def get_dependencies():
+ """Status of required local runtime dependencies (askill, Show runtime, Node)."""
+ from vibe import api
+
+ return jsonify(api.dependencies_status())
+
+
[email protected]("/api/dependencies/<dep>/install", methods=["POST"])
+def dependency_install(dep):
+ """Install/repair a required local dependency in a background job."""
+ if dep not in _ALLOWED_DEPENDENCIES:
+ return jsonify({"ok": False, "message": f"Unknown dependency: {dep}"}), 400
+
+ from vibe import api
+
+ return jsonify(api.start_dependency_install_job(dep))
+
+
[email protected]("/api/dependencies/<dep>/install/<job_id>", methods=["GET"])
+def dependency_install_status(dep, job_id):
+ """Poll a background dependency install job."""
+ if dep not in _ALLOWED_DEPENDENCIES:
+ return jsonify({"ok": False, "message": f"Unknown dependency: {dep}"}), 400
+
+ from vibe import api
+
+ result = api.get_agent_install_job(job_id, backend=dep)
+ status = 404 if not result.get("ok") and result.get("error") == "job_not_found" else 200
+ return jsonify(result), status
+
+
@app.route("/api/backend/codex/auth", methods=["GET"])
def backend_codex_auth_get():
"""Read the user-facing Codex auth state (masked secrets)."""