P4: SFTP provider, connection store, connection manager UI

- SftpProvider (ssh2): password + key auth, keepalive, clean-dispose vs
  unexpected-close distinction, POSIX path helpers, s->ms attr normalization
- ConnectionStore: plain JSON at appDataDir, 0600, atomic writes, folders
- connect/disconnect + store CRUD handlers; sessionClosed push -> panels fall
  back to local and in-flight jobs fail
- UI: session dropdown per panel (local/saved connections/manage), disconnect
  button, connection manager modal (folders, edit form, save/connect)
- electrobun bundler: external cpu-features/*.node (ssh2 optional natives)
- RpcService: gate requests on RPC socket open; defer initial panel loads past
  first render
- verified against 192.168.10.122: full op matrix, upload/download/remote-remote
  recursive transfers, roundtrip integrity, recursive remote delete, store CRUD

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jokin
2026-07-11 14:12:00 +02:00
co-authored by Claude Fable 5
parent 88af44acfc
commit 0d0e4cfde4
16 changed files with 1033 additions and 31 deletions
+5 -1
View File
@@ -2,6 +2,7 @@ import { BrowserWindow, Updater } from "electrobun/bun";
import { BRANDING } from "../shared/branding";
import { SessionRegistry } from "./fs/registry";
import { createAppRPC } from "./rpc-handlers";
import { ConnectionStore } from "./store/connections";
import { TransferEngine } from "./transfers/engine";
const PROD_URL = "views://app/index.html";
@@ -26,7 +27,9 @@ async function getMainViewUrl(): Promise<string> {
const registry = new SessionRegistry();
const engine = new TransferEngine(registry);
const rpc = createAppRPC(registry, engine);
const store = new ConnectionStore();
const events = { sessionClosed: (_info: { sessionId: string; reason: string }) => {} };
const rpc = createAppRPC({ registry, engine, store, events });
const url = await getMainViewUrl();
new BrowserWindow({
@@ -42,5 +45,6 @@ new BrowserWindow({
});
engine.onUpdate = (snapshot) => rpc.send.transferUpdate(snapshot);
events.sessionClosed = (info) => rpc.send.sessionClosed(info);
console.log(`${BRANDING.appName} started (${url})`);