feat: add GitHub skin store and organize instance administration

Adopt the pinned published TeamSpeak SDK and direct relay routing.
Add optional TeamSpeak Query administration with encrypted credentials
and separate WebSpeak access, site, operations and skin management.
Distribute Discord Voice through the GitHub skin index, preserve skin
state during updates, and correct KAAK scaling and screen fullscreen.

Validation: 831 tests; backend and frontend builds; five-language UI
checks from narrow screens through 4K and local Query fixture actions.
This commit is contained in:
illusia committed 2026-10-24 12:52:59 +08:00
1 parent 180bfeb52f
commit 0af3236c30
95 files changed
+7678 -709

No files matched your search

+8 -1
View File
@@ -1,5 +1,6 @@
import { adminResponses, type AdminResponseReader } from "../../../src/shared/admin-responses.js";
import type { AdminSettingsInput, ManagedInviteInput } from "../../../src/shared/admin-inputs.js";
import type { AdminSettingsInput, ManagedInviteInput, TsAdminSettingsInput, TsAdminActionRequest } from "../../../src/shared/admin-inputs.js";
import type { SkinStoreInstallInput } from "../../../src/shared/skin-store.js";
export class AdminApiError extends Error {
constructor(readonly code: string, readonly status = 0, message = code) {
@@ -106,6 +107,10 @@ export function createAdminApi(options: AdminApiOptions) {
overview: (signal?: AbortSignal) => request("/overview", adminResponses.overview, "GET", undefined, true, signal),
settings: (signal?: AbortSignal) => request("/server", adminResponses.settings, "GET", undefined, true, signal),
saveSettings: (body: AdminSettingsInput, signal?: AbortSignal) => request("/server", adminResponses.savedSettings, "PUT", body, true, signal),
tsAdminSettings: (signal?: AbortSignal) => request("/ts-admin/settings", adminResponses.tsAdminSettings, "GET", undefined, true, signal),
saveTsAdminSettings: (body: TsAdminSettingsInput, signal?: AbortSignal) => request("/ts-admin/settings", adminResponses.savedTsAdminSettings, "PUT", body, true, signal),
tsAdminOverview: (signal?: AbortSignal) => request("/ts-admin/overview", adminResponses.tsAdminOverview, "POST", {}, true, signal),
tsAdminAction: (body: TsAdminActionRequest, signal?: AbortSignal) => request("/ts-admin/action", adminResponses.ok, "POST", body, true, signal),
probe: (body: Pick<AdminSettingsInput, "target" | "serverPassword" | "passwordAction">, signal?: AbortSignal) => request("/server/test", adminResponses.probe, "POST", body, true, signal),
sessions: (signal?: AbortSignal) => request("/sessions", adminResponses.sessions, "GET", undefined, true, signal),
terminateSession: (id: string, signal?: AbortSignal) => request(`/sessions/${encodeURIComponent(id)}/terminate`, adminResponses.ok, "POST", {}, true, signal),
@@ -116,6 +121,8 @@ export function createAdminApi(options: AdminApiOptions) {
logs: (signal?: AbortSignal) => request("/logs?limit=100", adminResponses.logs, "GET", undefined, true, signal),
audit: (signal?: AbortSignal) => request("/audit?limit=50", adminResponses.audit, "GET", undefined, true, signal),
skins: (signal?: AbortSignal) => request("/skins", adminResponses.skins, "GET", undefined, true, signal),
skinStore: (refresh = false, signal?: AbortSignal) => request(refresh ? "/skin-store/refresh" : "/skin-store", adminResponses.skinStore, refresh ? "POST" : "GET", refresh ? {} : undefined, true, signal),
installStoreSkin: (body: SkinStoreInstallInput, signal?: AbortSignal) => request("/skin-store/install", adminResponses.uploadedSkin, "POST", body, true, signal),
setDefaultSkin: (id: string, signal?: AbortSignal) => request("/skins/default", adminResponses.defaultSkin, "PUT", { id }, true, signal),
setSkinEnabled: (id: string, enabled: boolean, signal?: AbortSignal) => request(`/skins/${encodeURIComponent(id)}/enabled`, adminResponses.updatedSkin, "PUT", { enabled }, true, signal),
deleteSkin: (id: string, signal?: AbortSignal) => request(`/skins/${encodeURIComponent(id)}`, adminResponses.ok, "DELETE", {}, true, signal),
+1 -1
View File
@@ -46,7 +46,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
{
id: BUILTIN_KAAK_SKIN_ID,
name: "KAAK",
version: "3.1.121",
version: "3.1.122",
author: "WebSpeak Project",
license: "AGPL-3.0-only",
description: "A KOOK-inspired WebSpeak skin with a split-screen connection home, searchable server header, TeamSpeak banner, nested channel members, unified chat with local history, and a compact audio dock.",
+36 -2
View File
@@ -486,7 +486,7 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
const file = new File([archive], "kaak-voice.wskin", { type: "application/octet-stream" });
const skin = await importSkinPack(file);
assert.equal(skin.id, "community.kaak-voice");
assert.equal(skin.version, "3.1.121");
assert.equal(skin.version, "3.1.122");
assert.equal(BUILTIN_SKIN_CATALOG.find((entry) => entry.id === skin.id)?.version, skin.version);
assert.equal(skin.schemaVersion, 3);
const baseMessages = skin.contentData?.locales["zh-CN"]?.messages ?? {};
@@ -671,7 +671,7 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
assert.ok(skin.css.includes("data-session-connected=\"true\""));
assert.ok(skin.css.includes("[data-ws-plugin-part=\"kaak-workspace.workspace\"][data-session-connected=\"true\"]:not([data-mobile-channels=\"true\"])"));
assert.ok(skin.css.includes("[data-ws-plugin-part=\"kaak-workspace\"][data-ws-plugin-surface=\"voice\"]:has([data-ws-plugin-part=\"kaak-workspace.chat-panel-toggle\"][aria-expanded=\"false\"])"));
assert.match(skin.css, /\.ws-skin-root\[data-ws-skin="community\.kaak-voice"\]\s+\[data-ws-plugin-part="kaak-workspace"\]\[data-ws-plugin-surface="voice"\]\s*\{[\s\S]*?height: 100dvh;/, "the voice surface owns the KAAK grid and viewport sizing");
assert.match(skin.css, /\.ws-skin-root\[data-ws-skin="community\.kaak-voice"\]\s+\[data-ws-plugin-part="kaak-workspace"\]\[data-ws-plugin-surface="voice"\]\s*\{[^}]*height: calc\(var\(--ws-viewport-height, 100dvh\) \/ var\(--ui-scale, 1\)\);[^}]*max-height: calc\(var\(--ws-viewport-height, 100dvh\) \/ var\(--ui-scale, 1\)\);/, "the voice surface compensates application zoom so the bottom dock stays within the viewport");
assert.doesNotMatch(skin.css, /\[data-ws-plugin-part="kaak-workspace"\](?!\[data-ws-plugin-surface="voice"\])/, "KAAK workspace selectors must anchor to the voice surface root, not generic child nodes");
assert.ok(skin.css.includes("mobile-room-return"));
assert.ok(skin.css.includes('[data-ws-plugin-part="kaak-workspace.workspace"][data-session-connected="true"][data-mobile-channels="true"] [data-ws-plugin-part="kaak-workspace.mobile-room-menu"]'), "the room menu stays hidden on the channel tree page");
@@ -936,6 +936,40 @@ test("the full voice surface example packages share-aware members and host-owned
assert.ok(skin.css.includes("@media (max-width: 800px)"));
});
test("the Discord Voice package imports portable home and voice surfaces", async () => {
const archive = await readFile(new URL("../../../docs/examples/discord-voice.wskin", import.meta.url));
const file = new File([archive], "discord-voice.wskin", { type: "application/octet-stream" });
const skin = await importSkinPack(file);
assert.equal(skin.id, "community.discord-voice");
assert.equal(skin.packageType, "open-skin");
assert.equal(skin.schemaVersion, 3);
assert.deepEqual(skin.pluginData?.components.map(({ id, page, mode }) => [id, page, mode]), [
["discord-home", "home", "surface"],
["discord-workspace", "voice", "surface"],
]);
const voice = skin.pluginData?.components.find((component) => component.page === "voice");
assert.ok(voice?.permissions.includes("ui.surface.replace"));
assert.ok(voice?.permissions.includes("session.channels.read"));
assert.ok(voice?.permissions.includes("session.members.read"));
assert.ok(voice?.permissions.includes("chat.channel.send"));
assert.ok(voice?.permissions.includes("audio.microphone.control"));
assert.ok(voice?.permissions.includes("voice.screenShare.control"));
assert.equal(voice?.actions["copy-invite-link"]?.type, "session.copyInviteLink");
assert.equal(skin.runtimePlugins?.plugins.length ?? 0, 0, "the open skin contains no executable plugin code");
const baseMessageKeys = Object.keys(skin.contentData?.locales.en?.messages ?? {}).sort();
for (const locale of ["zh-CN", "de", "ru", "ja"]) {
assert.deepEqual(
Object.keys(skin.contentData?.locales[locale]?.messages ?? {}).sort(),
baseMessageKeys,
`Discord Voice provides complete skin copy for ${locale}`,
);
}
assert.ok(skin.css.includes("--skin-discord-bg-guilds"));
assert.doesNotMatch(skin.css, /\.ws-skin-root\[data-ws-skin="community\.discord-voice"\]\s+(?:strong|time)\b/, "host chat text styles stay scoped to public chat parts");
assert.doesNotMatch(skin.css, /(?:^|[\s,])\.message-(?:meta|row|body|bubble|composer)\b/, "the package does not depend on private chat CSS classes");
assert.ok(skin.css.includes("@media (max-width: 760px)"));
});
test("the Harbor voice skin imports a complete voice-only KOOK-inspired workspace", async () => {
const archive = await readFile(new URL("../../../docs/examples/harbor-voice.wskin", import.meta.url));
const file = new File([archive], "harbor-voice.wskin", { type: "application/octet-stream" });