wraith/main.go
Vantz Stockwell 8572e6e7ea fix: wire SSH/SFTP/terminal to real Go backend — kill all stubs
Critical path wired end-to-end:
- ConnectSSH on WraithApp resolves credentials from vault, builds auth methods
- SSH output handler emits Wails events (base64) to frontend
- useTerminal.ts forwards keystrokes to SSHService.Write, resize to SSHService.Resize
- useTerminal.ts listens for ssh:data:{sessionId} events and writes to xterm.js
- session.store.ts connect() calls real Go ConnectSSH, not mock
- useSftp.ts calls real SFTPService.List instead of hardcoded mock data
- SFTP client auto-registered on SSH connection via pkg/sftp
- DisconnectSession cleans up both SSH and SFTP

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:49:21 -04:00

60 lines
1.4 KiB
Go

package main
import (
"embed"
"log"
"log/slog"
wraithapp "github.com/vstockwell/wraith/internal/app"
"github.com/wailsapp/wails/v3/pkg/application"
)
// version is set at build time via -ldflags "-X main.version=..."
var version = "dev"
//go:embed all:frontend/dist
var assets embed.FS
func main() {
slog.Info("starting Wraith")
wraith, err := wraithapp.New(version)
if err != nil {
log.Fatalf("failed to initialize: %v", err)
}
app := application.New(application.Options{
Name: "Wraith",
Description: "SSH + RDP + SFTP Desktop Client",
Services: []application.Service{
application.NewService(wraith),
application.NewService(wraith.Connections),
application.NewService(wraith.Themes),
application.NewService(wraith.Settings),
application.NewService(wraith.SSH),
application.NewService(wraith.SFTP),
application.NewService(wraith.RDP),
application.NewService(wraith.AI),
application.NewService(wraith.Updater),
},
Assets: application.AssetOptions{
Handler: application.BundledAssetFileServer(assets),
},
})
// Wire Wails app reference for event emission (SSH output → frontend)
wraith.SetWailsApp(app)
app.Window.NewWithOptions(application.WebviewWindowOptions{
Title: "Wraith",
Width: 1400,
Height: 900,
URL: "/",
BackgroundColour: application.NewRGBA(13, 17, 23, 255),
})
if err := app.Run(); err != nil {
log.Fatal(err)
}
}