feat: plugins only see their own host settings in the browser

This commit is contained in:
LukeGus committed 2026-09-29 13:38:11 -05:00
1 parent 50d43e29fb
commit fb9c168b6b
17 files changed
+488 -52

No files matched your search

+5 -4
View File
@@ -7,7 +7,6 @@ import {
SquareTerminal,
Terminal,
} from "lucide-react";
import { listHosts } from "@termix/plugin-sdk/frontend";
import type {
PanelProps,
PluginHostRecord,
@@ -309,9 +308,11 @@ export function activate(app: TermixApp): void {
);
let host: PluginHostRecord | null | undefined = request.host;
if (!host && request.hostId !== undefined) {
host = (await listHosts().catch(() => [])).find(
(entry) => String(entry.id) === String(request.hostId),
);
host =
app.getHost(request.hostId) ??
(await app.listHosts().catch(() => [])).find(
(entry) => String(entry.id) === String(request.hostId),
);
}
return resolveTerminalLook({ ...request, host }, settings?.user);
}) as never);