feat(v2): add frontend remote machine integration

remote-bridge.ts adapter for machine management IPC. machines.svelte.ts
store for remote machine state. Layout store extended with
remoteMachineId on Pane interface. agent-bridge.ts and pty-bridge.ts
route to remote commands when remoteMachineId is set. SettingsDialog
gains Remote Machines section. Sidebar auto-groups remote panes by
machine label.
This commit is contained in:
Hibryda 2026-03-06 19:05:53 +01:00
parent 0b39133d66
commit 5503340e87
7 changed files with 481 additions and 5 deletions

View file

@ -10,15 +10,29 @@
type LayoutPreset,
type Pane,
} from '../../stores/layout.svelte';
import { getMachines } from '../../stores/machines.svelte';
import SshSessionList from '../SSH/SshSessionList.svelte';
let panes = $derived(getPanes());
let preset = $derived(getActivePreset());
let machines = $derived(getMachines());
// Build machine label lookup
let machineLabels = $derived.by(() => {
const map = new Map<string, string>();
for (const m of machines) {
map.set(m.id, `${m.label} (${m.status})`);
}
return map;
});
let grouped = $derived.by(() => {
const groups = new Map<string, Pane[]>();
for (const pane of panes) {
const g = pane.group || '';
// Remote panes auto-group by machine label; local panes use explicit group
const g = pane.remoteMachineId
? machineLabels.get(pane.remoteMachineId) ?? `Remote ${pane.remoteMachineId.slice(0, 8)}`
: (pane.group || '');
if (!groups.has(g)) groups.set(g, []);
groups.get(g)!.push(pane);
}