ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
feat(extensions): enforce the SDK gate at install; localize the GUI builtin
Juan Denis9c0ae9e957bb
diff --git a/backend/app/services/plugin_service.py b/backend/app/services/plugin_service.pyindex eb455f35..a3a4fb4f 100644--- a/backend/app/services/plugin_service.py+++ b/backend/app/services/plugin_service.py@@ -560,6 +560,36 @@ def _assert_manifest_panel_compatible(manifest):)+def _assert_manifest_sdk_compatible(manifest):+ """Enforce a manifest's ``sdk_version`` range at install.++ Two places already documented this check as existing — this module's own+ loader comment in the frontend and ``app/utils/sdk.py``'s docstring ("checked+ at install (manifest lint) and at load") — but nothing called+ ``sdk_version_satisfies`` outside its unit test. The consequences differed by+ extension kind, and both were bad:++ * a runtime ESM extension installed cleanly and only failed later, at load,+ on the version gate;+ * a builtin/in-repo extension is compiled in and never passes the load+ gate at all, so its range was never checked anywhere.++ Fail-open on a missing range is deliberate and matches the load-time+ 'grace' decision: an extension that pins nothing installs anywhere.+ """+ from app.utils.sdk import SDK_VERSION, sdk_version_satisfies+ range_str = manifest.get('sdk_version')+ if not range_str or not str(range_str).strip():+ return+ if not sdk_version_satisfies(range_str):+ raise ValueError(+ f"{manifest.get('display_name') or manifest.get('name')} "+ f"v{manifest.get('version')} needs panel SDK {range_str} "+ f"(this panel offers {SDK_VERSION}) — update the panel, or install "+ f"a build of the extension made for this SDK."+ )++def _safe_extract_path(dest_root, rel_path):"""Resolve `rel_path` under `dest_root` and assert it stays inside.@@ -924,6 +954,7 @@ def _install_from_buffer(buf, source_url, source_type, user_id=None, force=Falsemanifest = json.loads(zf.read(manifest_path))_validate_manifest(manifest)_assert_manifest_panel_compatible(manifest)+ _assert_manifest_sdk_compatible(manifest)slug = manifest['name']diff --git a/backend/app/utils/sdk.py b/backend/app/utils/sdk.pyindex ac8d678a..262b5829 100644--- a/backend/app/utils/sdk.py+++ b/backend/app/utils/sdk.py@@ -9,8 +9,11 @@ Purpose:- ``GET /api/v1/plugins/contributions`` reports ``sdk_version`` so the panel UIand tooling know what SDK surface the running panel offers.- An extension's ``plugin.json`` may declare ``sdk_version`` — a semver RANGE the- extension is built against. It's checked at install (manifest lint) and at load- (the runtime loader refuses an incompatible bundle and explains why).+ extension is built against. It's checked at install+ (``plugin_service._assert_manifest_sdk_compatible``) and, for runtime ESM+ bundles, again at load (the loader refuses an incompatible bundle before+ fetching any bytes and explains why). A manifest that pins no range installs+ and loads anywhere — fail-open, deliberately.The range grammar accepted by ``sdk_version_satisfies`` is intentionally small(the subset extension authors actually write):@@ -27,9 +30,16 @@ import refrom app.utils.version import compare_versions# Keep in lock-step with frontend/src/plugins/sdk/index.js `SDK_VERSION`.+#+# 1.3.0 — plan 79: localization. useTranslation/Trans/t, useLocale, useLabel,+# and the locale-aware format door (useFormat + formatDate/Number/Relative/…).+# i18next and react-i18next also became SHARED vendor singletons, so an+# extension that externalizes them needs a panel at this SDK or newer:+# pin `"sdk_version": "^1.3.0"` if you use any of that surface.+# Additive — an extension pinned to ^1.2.0 keeps loading.# 1.2.0 — plan 52 Phases 4-5: layout/feedback primitives, ui/* form kit,-# common hooks, format utils, and the cross-feature embeds (git repo-connect,-# backups ProtectionPanel) the WordPress runtime-ESM extraction needed.+# common hooks, format utils, and the cross-feature embeds (git repo-connect,+# backups ProtectionPanel) the WordPress runtime-ESM extraction needed.SDK_VERSION = '1.3.0'diff --git a/backend/tests/test_sdk_contract.py b/backend/tests/test_sdk_contract.pyindex 06edfd57..6306059b 100644--- a/backend/tests/test_sdk_contract.py+++ b/backend/tests/test_sdk_contract.py@@ -60,3 +60,57 @@ def test_sdk_version_satisfies(range_str, current, expected):def test_sdk_version_satisfies_defaults_to_panel():assert sdk_version_satisfies(f'^{SDK_VERSION.split(".")[0]}.0.0') is True+++# --- install-time SDK gate -------------------------------------------------+#+# Both this module's docstring and the frontend loader claimed the range was+# "checked at install" long before anything called it. The consequences split+# by extension kind: a runtime ESM extension installed fine and failed later at+# the load gate, while a builtin/in-repo extension never passes that gate at+# all, so its range went unchecked everywhere.++def _manifest(**overrides):+ base = {'name': 'demo-ext', 'display_name': 'Demo Extension', 'version': '1.0.0'}+ base.update(overrides)+ return base+++def test_install_refuses_an_extension_built_for_a_newer_sdk():+ from app.services.plugin_service import _assert_manifest_sdk_compatible++ major = int(SDK_VERSION.split('.')[0])+ with pytest.raises(ValueError) as excinfo:+ _assert_manifest_sdk_compatible(_manifest(sdk_version=f'^{major + 1}.0.0'))++ message = str(excinfo.value)+ # The operator has to be able to act on it: what it needs, what we have.+ assert 'Demo Extension' in message+ assert SDK_VERSION in message+ assert f'^{major + 1}.0.0' in message+++def test_install_allows_a_satisfied_range():+ from app.services.plugin_service import _assert_manifest_sdk_compatible++ major = int(SDK_VERSION.split('.')[0])+ _assert_manifest_sdk_compatible(_manifest(sdk_version=f'^{major}.0.0'))++[email protected]('value', [None, '', ' ', '*'])+def test_install_fails_open_without_a_pinned_range(value):+ """Deliberate: matches the load gate's 'grace'. An extension that pins+ nothing installs anywhere rather than being blocked by a field its author+ never filled in."""+ from app.services.plugin_service import _assert_manifest_sdk_compatible++ manifest = _manifest() if value is None else _manifest(sdk_version=value)+ _assert_manifest_sdk_compatible(manifest)+++def test_current_sdk_surface_is_reachable_by_a_caret_pin():+ """An extension pinning ^1.3.0 (the localization surface) must install on+ this panel — the pin authors are told to use in docs/EXTENSIONS.md."""+ from app.services.plugin_service import _assert_manifest_sdk_compatible++ _assert_manifest_sdk_compatible(_manifest(sdk_version='^1.3.0'))diff --git a/docs/EXTENSIONS.md b/docs/EXTENSIONS.mdindex e1d9ae5b..072d7e9a 100644--- a/docs/EXTENSIONS.md+++ b/docs/EXTENSIONS.md@@ -604,6 +604,25 @@ call `i18next.init()` or `changeLanguage()` from an extension: the panel ownsboth, and calling them would reconfigure or switch the language for the wholepanel.+### Checking your own extension++The panel's censuses take a `--root`, so run them against your repo instead of+copying them (copies drift — that is how the vendor shims broke):++```bash+SK=/path/to/ServerKit/frontend/scripts+node $SK/check-i18n-literals.mjs --root frontend --report # untranslated copy+node $SK/check-intl-door.mjs --root frontend --report # browser-locale dates+```++The first lists user-visible strings not addressed by a key; the second lists+`toLocaleDateString()` / `new Intl.*` calls, each of which follows the+**browser's** locale rather than the panel's. `--update` is refused with+`--root`: those ceilings belong to the panel, not to your extension.++`frontend/src/plugins/serverkit-gui/` in the panel repo is a worked example —+a builtin extension converted to the SDK surface, keys namespaced under `gui.*`.+## Permissions & compatibility`permissions` is a **consent signal**, and for most capabilities that is all it is.@@ -643,8 +662,28 @@ its detail page so an operator can review and install it deliberately. Operatorsopt in with `SERVERKIT_ALLOW_PLUGIN_PIP=1`. Design your extension to degradeclearly when an optional dependency is absent rather than crashing on import.-- `min_panel_version` / `max_panel_version` are enforced at install **and** update- for every source (URL/upload/local/builtin/registry).+### Version compatibility++Three independent bounds, all optional, all fail-open when omitted:++| Field | Bounds | Checked |+|---|---|---|+| `min_panel_version` / `max_panel_version` | the **panel release** | install **and** update, every source (URL/upload/local/builtin/registry) |+| `sdk_version` | the **frontend SDK surface** (a semver *range*) | install, and again at load for runtime ESM bundles — before any bytes are fetched |+| *(none)* | — | an extension that pins nothing installs and loads anywhere |++Pin `sdk_version` when you import something the SDK only started exporting in a+given release; that is what turns "white screen on an older panel" into a+readable *"needs panel SDK ^1.3.0 (this panel offers 1.2.0)"* at install time.++| SDK | Added |+|---|---|+| `^1.3.0` | Localization: `useTranslation`, `Trans`, `t`, `useLocale`, `useLabel`, `useFormat` and the `formatDate`/`formatNumber`/`formatRelative` door. `i18next` and `react-i18next` became shared singletons, so an extension that **externalizes** them needs this SDK or newer. |+| `^1.2.0` | Layout/feedback primitives, the `ui/*` form kit, common hooks, format utils, and the cross-feature embeds (git repo-connect, backups `ProtectionPanel`). |++Both bumps were additive: an extension pinned to `^1.2.0` keeps installing and+loading on a 1.3.0 panel. Pin the range you actually use — over-pinning locks+your users out of upgrades for no reason.---diff --git a/frontend/scripts/I18N_LITERAL_CEILING b/frontend/scripts/I18N_LITERAL_CEILINGindex 7d73dd85..af0a7b0a 100644--- a/frontend/scripts/I18N_LITERAL_CEILING+++ b/frontend/scripts/I18N_LITERAL_CEILING@@ -1 +1 @@-8055+8034diff --git a/frontend/scripts/INTL_DOOR_CEILING b/frontend/scripts/INTL_DOOR_CEILINGindex fc902f4f..190a1803 100644--- a/frontend/scripts/INTL_DOOR_CEILING+++ b/frontend/scripts/INTL_DOOR_CEILING@@ -1 +1 @@-124+123diff --git a/frontend/scripts/check-i18n-literals.mjs b/frontend/scripts/check-i18n-literals.mjsindex 32b61a97..3b75f250 100644--- a/frontend/scripts/check-i18n-literals.mjs+++ b/frontend/scripts/check-i18n-literals.mjs@@ -35,7 +35,16 @@ import { parse } from 'espree';const here = dirname(fileURLToPath(import.meta.url));const root = resolve(here, '..');-const srcDir = resolve(root, 'src');++// `--root <dir>` points the census at another tree — an extension repo's own+// src/. Extensions ship UI with the same copy problem and none of them live+// under frontend/src, so without this the ratchet cannot see them at all.+// An extension repo runs this file from the host checkout rather than copying+// it, which is how the vendor shims drifted.+const rootArg = process.argv.includes('--root')+ ? process.argv[process.argv.indexOf('--root') + 1]+ : null;+const srcDir = rootArg ? resolve(process.cwd(), rootArg) : resolve(root, 'src');const ceilingFile = resolve(here, 'I18N_LITERAL_CEILING');// Slack before the ceiling is considered stale. Larger than the style@@ -316,6 +325,10 @@ const byFile = census();const count = [...byFile.values()].reduce((total, hits) => total + hits.length, 0);if (process.argv.includes('--update')) {+ if (rootArg) {+ console.error('--update writes the HOST ceiling; refusing to do that from --root.');+ process.exit(2);+ }writeFileSync(ceilingFile, `${count}\n`);console.log(`i18n literal ceiling updated to ${count}`);process.exit(0);diff --git a/frontend/scripts/check-intl-door.mjs b/frontend/scripts/check-intl-door.mjsindex 3a43a1a6..8d0384e5 100644--- a/frontend/scripts/check-intl-door.mjs+++ b/frontend/scripts/check-intl-door.mjs@@ -22,7 +22,14 @@ import { fileURLToPath } from 'node:url';const here = dirname(fileURLToPath(import.meta.url));const root = resolve(here, '..');-const srcDir = resolve(root, 'src');+// `--root <dir>` censuses another tree — an extension repo's own src/. An+// extension's `toLocaleDateString()` is the same bug as core's: with no+// argument it follows the BROWSER, so its dates disagree with every date+// around them on a panel set to another language.+const rootArg = process.argv.includes('--root')+ ? process.argv[process.argv.indexOf('--root') + 1]+ : null;+const srcDir = rootArg ? resolve(process.cwd(), rootArg) : resolve(root, 'src');const ceilingFile = resolve(here, 'INTL_DOOR_CEILING');// The door itself, and the tests that prove it behaves per locale.@@ -84,6 +91,10 @@ const byFile = census();const count = [...byFile.values()].reduce((total, hits) => total + hits.length, 0);if (process.argv.includes('--update')) {+ if (rootArg) {+ console.error('--update writes the HOST ceiling; refusing to do that from --root.');+ process.exit(2);+ }writeFileSync(ceilingFile, `${count}\n`);console.log(`intl door ceiling updated to ${count}`);process.exit(0);diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.jsonindex b851fdf3..e201cbb0 100644--- a/frontend/src/i18n/locales/en.json+++ b/frontend/src/i18n/locales/en.json@@ -34,6 +34,7 @@"common": {"actions": {"back": "Back",+ "close": "Close","logOut": "Log out","refresh": "Refresh","retry": "Retry",@@ -105,6 +106,32 @@"search": "Search your repositories"}},+ "gui": {+ "fps": "{{rate}} fps",+ "frameAlt": "Remote desktop frame",+ "launcher": {+ "label": "Desktop",+ "open": "Open desktop view",+ "title": "Desktop view"+ },+ "loadingSynthetic": "Loading synthetic desktop…",+ "mode": {+ "auto": "Auto",+ "noDisplay": "no display",+ "screenshot": "Screenshot",+ "synthetic": "Synthetic",+ "unavailable": "Unavailable: {{reason}}"+ },+ "pause": "Pause",+ "probing": "Probing display capability…",+ "resume": "Resume",+ "toolbar": {+ "quality": "Quality",+ "rate": "Rate",+ "scale": "Scale"+ },+ "waitingFirstFrame": "Waiting for first frame…"+ },"nav": {"accountMenu": "Account and preferences","allSettings": "All Settings",diff --git a/frontend/src/i18n/locales/es.json b/frontend/src/i18n/locales/es.jsonindex a8882037..f4c4e699 100644--- a/frontend/src/i18n/locales/es.json+++ b/frontend/src/i18n/locales/es.json@@ -34,6 +34,7 @@"common": {"actions": {"back": "Atrás",+ "close": "Cerrar","logOut": "Cerrar sesión","refresh": "Actualizar","retry": "Reintentar",@@ -105,6 +106,32 @@"search": "Busca en tus repositorios"}},+ "gui": {+ "fps": "{{rate}} fps",+ "frameAlt": "Fotograma del escritorio remoto",+ "launcher": {+ "label": "Escritorio",+ "open": "Abrir la vista de escritorio",+ "title": "Vista de escritorio"+ },+ "loadingSynthetic": "Cargando el escritorio sintético…",+ "mode": {+ "auto": "Automático",+ "noDisplay": "sin pantalla",+ "screenshot": "Captura",+ "synthetic": "Sintético",+ "unavailable": "No disponible: {{reason}}"+ },+ "pause": "Pausar",+ "probing": "Comprobando la capacidad de pantalla…",+ "resume": "Reanudar",+ "toolbar": {+ "quality": "Calidad",+ "rate": "Frecuencia",+ "scale": "Escala"+ },+ "waitingFirstFrame": "Esperando el primer fotograma…"+ },"nav": {"accountMenu": "Cuenta y preferencias","allSettings": "Todos los ajustes",diff --git a/frontend/src/plugins/runtime/loader.js b/frontend/src/plugins/runtime/loader.jsindex 37d8abbe..760f47d4 100644--- a/frontend/src/plugins/runtime/loader.js+++ b/frontend/src/plugins/runtime/loader.js@@ -63,7 +63,8 @@ export function isRuntimeFrontend(frontends, slug) {// `sdk_version` range doesn't cover the panel's SDK version, BEFORE fetching any// bytes — the failure card then explains the version gap instead of a cryptic// import error. A missing/blank range is a one-release grace: warn (dev) and-// load, matching install-time's fail-open (`_assert_manifest_sdk_compatible`).+// load, matching the same fail-open in install-time's+// `plugin_service._assert_manifest_sdk_compatible`.function assertSdkCompatible(slug, descriptor, panelSdkVersion) {const range = descriptor && descriptor.sdk_version;const decision = sdkGateDecision(range, panelSdkVersion);diff --git a/frontend/src/plugins/runtime/sdkGate.js b/frontend/src/plugins/runtime/sdkGate.jsindex 0ba9d014..ce52bf49 100644--- a/frontend/src/plugins/runtime/sdkGate.js+++ b/frontend/src/plugins/runtime/sdkGate.js@@ -9,7 +9,8 @@** 'load' — range covers the panel's SDK (or the panel didn't report one).* 'grace' — the extension pins no range: warn-and-load for one release,- * matching install-time's fail-open (`_assert_manifest_sdk_compatible`).+ * matching the fail-open in install-time's+ * `plugin_service._assert_manifest_sdk_compatible`.* 'refuse' — the range excludes the panel's SDK; fail closed with an explain* string on the failure card instead of a cryptic import error.*/diff --git a/frontend/src/plugins/serverkit-gui/components/ServerGui.jsx b/frontend/src/plugins/serverkit-gui/components/ServerGui.jsxindex 2153c9ec..3d56d5e0 100644--- a/frontend/src/plugins/serverkit-gui/components/ServerGui.jsx+++ b/frontend/src/plugins/serverkit-gui/components/ServerGui.jsx@@ -1,4 +1,8 @@import { useEffect, useRef, useState, useCallback } from 'react';+// Imported from the SDK exactly as a third-party extension would (plan 79):+// these resolve to the HOST's i18next instance and format door, so this+// extension follows the panel's language and locale with no wiring of its own.+import { useTranslation, useFormat } from 'serverkit-sdk';import SyntheticDesktop from './SyntheticDesktop.jsx';const FRAME_INTERVAL_MS_DEFAULT = 700;@@ -27,6 +31,7 @@ function savePrefs(prefs) {* desktop based on user preference and what the agent reports.*/export default function ServerGui({ api, serverId }) {+ const { t } = useTranslation();const initial = loadPrefs();const [mode, setMode] = useState(initial.mode || MODES.AUTO);const [intervalMs, setIntervalMs] = useState(initial.intervalMs || FRAME_INTERVAL_MS_DEFAULT);@@ -89,7 +94,7 @@ export default function ServerGui({ api, serverId }) {{error && <div className="sk-gui__banner sk-gui__banner--error">{error}</div>}{!caps && !error && (- <div className="sk-gui__loading">Probing display capability…</div>+ <div className="sk-gui__loading">{t('gui.probing', 'Probing display capability…')}</div>)}{effectiveMode === MODES.SCREENSHOT && caps && (@@ -120,25 +125,30 @@ function Toolbar({quality, onQualityChange,effectiveMode,}) {+ const { t } = useTranslation();const screenshotDisabled = caps && caps.capability === 'none';return (<div className="sk-gui__toolbar"><div className="sk-gui__mode"><ModeBtn- label="Auto"+ label={t('gui.mode.auto', 'Auto')}active={mode === MODES.AUTO}onClick={() => onModeChange(MODES.AUTO)}/><ModeBtn- label="Screenshot"+ label={t('gui.mode.screenshot', 'Screenshot')}active={mode === MODES.SCREENSHOT}disabled={screenshotDisabled}- title={screenshotDisabled ? `Unavailable: ${caps.reason || 'no display'}` : ''}+ title={screenshotDisabled+ ? t('gui.mode.unavailable', 'Unavailable: {{reason}}', {+ reason: caps.reason || t('gui.mode.noDisplay', 'no display'),+ })+ : ''}onClick={() => onModeChange(MODES.SCREENSHOT)}/><ModeBtn- label="Synthetic"+ label={t('gui.mode.synthetic', 'Synthetic')}active={mode === MODES.SYNTHETIC}onClick={() => onModeChange(MODES.SYNTHETIC)}/>@@ -160,17 +170,17 @@ function Toolbar({{effectiveMode === MODES.SCREENSHOT && (<><label className="sk-gui__field">- Rate+ {t('gui.toolbar.rate', 'Rate')}<select value={intervalMs} onChange={e => onIntervalChange(Number(e.target.value))}>- <option value={2000}>0.5 fps</option>- <option value={1000}>1 fps</option>- <option value={700}>1.5 fps</option>- <option value={500}>2 fps</option>- <option value={300}>3 fps</option>+ <option value={2000}>{t('gui.fps', '{{rate}} fps', { rate: 0.5 })}</option>+ <option value={1000}>{t('gui.fps', '{{rate}} fps', { rate: 1 })}</option>+ <option value={700}>{t('gui.fps', '{{rate}} fps', { rate: 1.5 })}</option>+ <option value={500}>{t('gui.fps', '{{rate}} fps', { rate: 2 })}</option>+ <option value={300}>{t('gui.fps', '{{rate}} fps', { rate: 3 })}</option></select></label><label className="sk-gui__field">- Scale+ {t('gui.toolbar.scale', 'Scale')}<select value={scale} onChange={e => onScaleChange(Number(e.target.value))}><option value={0.5}>50%</option><option value={0.75}>75%</option>@@ -178,7 +188,7 @@ function Toolbar({</select></label><label className="sk-gui__field">- Quality+ {t('gui.toolbar.quality', 'Quality')}<inputtype="range"min="20"@@ -209,6 +219,8 @@ function ModeBtn({ label, active, disabled, title, onClick }) {}function ScreenshotView({ baseUrl, fetchJson, intervalMs, scale, quality }) {+ const { t } = useTranslation();+ const { formatTime } = useFormat();const [frame, setFrame] = useState(null);const [error, setError] = useState(null);const [paused, setPaused] = useState(false);@@ -255,17 +267,17 @@ function ScreenshotView({ baseUrl, fetchJson, intervalMs, scale, quality }) {className="sk-gui__viewport-btn"onClick={() => setPaused(p => !p)}>- {paused ? 'Resume' : 'Pause'}+ {paused ? t('gui.resume', 'Resume') : t('gui.pause', 'Pause')}</button>{error && <div className="sk-gui__banner sk-gui__banner--error">{error}</div>}{imgSrc ? (- <img className="sk-gui__frame" src={imgSrc} alt="Remote desktop frame" />+ <img className="sk-gui__frame" src={imgSrc} alt={t('gui.frameAlt', 'Remote desktop frame')} />) : (- <div className="sk-gui__loading">Waiting for first frame…</div>+ <div className="sk-gui__loading">{t('gui.waitingFirstFrame', 'Waiting for first frame…')}</div>)}{frame?.captured_at && (<div className="sk-gui__stamp">- {frame.width}×{frame.height} · {new Date(frame.captured_at).toLocaleTimeString()}+ {frame.width}×{frame.height} · {formatTime(frame.captured_at, { seconds: true })}</div>)}</div>diff --git a/frontend/src/plugins/serverkit-gui/components/ServerGuiLauncher.jsx b/frontend/src/plugins/serverkit-gui/components/ServerGuiLauncher.jsxindex 97650d76..71ea9500 100644--- a/frontend/src/plugins/serverkit-gui/components/ServerGuiLauncher.jsx+++ b/frontend/src/plugins/serverkit-gui/components/ServerGuiLauncher.jsx@@ -1,6 +1,7 @@import { useEffect, useState } from 'react';import { useLocation } from 'react-router-dom';import ServerGui from './ServerGui.jsx';+import { useTranslation } from 'serverkit-sdk';/*** Floating launcher that appears only on /servers/:id pages.@@ -13,6 +14,7 @@ import ServerGui from './ServerGui.jsx';const SERVER_DETAIL_RE = /^\/servers\/([^/]+)(\/[^/]*)?$/;export default function ServerGuiLauncher({ api }) {+ const { t } = useTranslation();const location = useLocation();const [open, setOpen] = useState(false);@@ -30,21 +32,21 @@ export default function ServerGuiLauncher({ api }) {<button type="button"className="sk-gui-launcher"onClick={() => setOpen(true)}- title="Open desktop view"+ title={t('gui.launcher.open', 'Open desktop view')}><DesktopIcon />- <span>Desktop</span>+ <span>{t('gui.launcher.label', 'Desktop')}</span></button>{open && (<div className="sk-gui-modal" onClick={() => setOpen(false)}><div className="sk-gui-modal__inner" onClick={e => e.stopPropagation()}><header className="sk-gui-modal__header">- <h3>Desktop view</h3>+ <h3>{t('gui.launcher.title', 'Desktop view')}</h3><button type="button"className="sk-gui-modal__close"onClick={() => setOpen(false)}- aria-label="Close"+ aria-label={t('common.actions.close', 'Close')}>×</button>diff --git a/frontend/src/plugins/serverkit-gui/components/SyntheticDesktop.jsx b/frontend/src/plugins/serverkit-gui/components/SyntheticDesktop.jsxindex 39b76118..21b534a9 100644--- a/frontend/src/plugins/serverkit-gui/components/SyntheticDesktop.jsx+++ b/frontend/src/plugins/serverkit-gui/components/SyntheticDesktop.jsx@@ -1,5 +1,6 @@import React, { useEffect, useState } from 'react';import { usePolling } from '@/hooks/usePolling';+import { useTranslation } from 'serverkit-sdk';// Synthetic desktop refresh cadence.const SYNTHETIC_REFRESH_MS = 4000;@@ -10,6 +11,7 @@ const SYNTHETIC_REFRESH_MS = 4000;* display server. Each "window" is just data the agent already exposes.*/export default function SyntheticDesktop({ api, serverId, fetchJson }) {+ const { t } = useTranslation();const [data, setData] = useState(null);const [error, setError] = useState(null);@@ -33,7 +35,7 @@ export default function SyntheticDesktop({ api, serverId, fetchJson }) {);if (error) return <div className="sk-gui__banner sk-gui__banner--error">{error}</div>;- if (!data) return <div className="sk-gui__loading">Loading synthetic desktop…</div>;+ if (!data) return <div className="sk-gui__loading">{t('gui.loadingSynthetic', 'Loading synthetic desktop…')}</div>;return (<div className="sk-synth">