gui

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gui is the backend of the hopsesh desktop app (Wails v3). The frontend in assets/ calls these methods; all work is done by the same engine as the CLI.

Index

Constants

This section is empty.

Variables

View Source
var Assets embed.FS

Assets is the frontend (plain HTML, CSS and JS; no build step).

Functions

This section is empty.

Types

type App

type App struct {
	App *application.App `json:"-"`
	// contains filtered or unexported fields
}

App is the service bound to the frontend.

func NewApp

func NewApp() (*App, error)

NewApp loads configuration.

func (*App) AddHost

func (a *App) AddHost(name, destination string) error

AddHost adds and allows a machine by ssh destination.

func (*App) Apply

func (a *App) Apply() (*DoneDTO, error)

Apply performs the last plan.

func (*App) CheckUpdate

func (a *App) CheckUpdate() (*UpdateDTO, error)

CheckUpdate looks for a newer release, at most once a day, and only when allowed.

func (*App) ChooseFolder

func (a *App) ChooseFolder(title string) (string, error)

ChooseFolder asks for a directory.

func (*App) CopyText

func (a *App) CopyText(text string) bool

CopyText puts text on the clipboard.

func (*App) Discover

func (a *App) Discover() []HostDTO

Discover lists machines (connecting to none) with their consent state.

func (*App) Info

func (a *App) Info() Info

Info returns app and machine information.

func (*App) OpenInDesktop

func (a *App) OpenInDesktop() error

OpenInDesktop opens the moved session in the Claude desktop app.

func (*App) OpenInTerminal

func (a *App) OpenInTerminal(command string) error

OpenInTerminal runs the resume command in a new terminal window.

func (*App) OpenLocalNetworkSettings

func (a *App) OpenLocalNetworkSettings() error

OpenLocalNetworkSettings opens System Settings at Privacy & Security, where the Local Network list is (macOS offers no link to the list itself).

func (*App) OpenURL

func (a *App) OpenURL(url string) error

OpenURL opens a web page in the default browser (release notes only).

func (*App) Plan

func (a *App) Plan(machine, sessionID string, o OptsDTO) (*PlanDTO, error)

Plan builds a transport plan for a session (nothing changes).

func (*App) RetryLocalNetwork

func (a *App) RetryLocalNetwork()

RetryLocalNetwork makes the next scan wait for the macOS prompt again, for someone who just changed the setting or wants to answer a prompt they dismissed.

func (*App) Scan

func (a *App) Scan() (*ScanDTO, error)

Scan scans this machine and every allowed machine.

func (*App) ScanKeys

func (a *App) ScanKeys(name string) (*KeysDTO, error)

ScanKeys fetches a machine's host keys for the trust dialog.

func (*App) SetAllowed

func (a *App) SetAllowed(name, destination string, allowed bool) error

SetAllowed records consent for a machine.

func (*App) SetReposDir

func (a *App) SetReposDir(dir string) error

SetReposDir changes the clone folder.

func (*App) SetUpdateCheck

func (a *App) SetUpdateCheck(on bool) error

SetUpdateCheck records whether the app may look for new releases once a day.

func (*App) Shutdown

func (a *App) Shutdown()

Shutdown closes connections.

func (*App) TrustHost

func (a *App) TrustHost(name string) error

TrustHost re-scans and records the machine's host keys (after the user confirmed).

func (*App) Undo

func (a *App) Undo(sessionID string) error

Undo reverses the latest transport of a session.

type DoneDTO

type DoneDTO struct {
	Title       string   `json:"title"`
	Command     string   `json:"command"`
	Paths       int      `json:"paths"`
	Files       int      `json:"files"`
	Bytes       string   `json:"bytes"`
	Secrets     int      `json:"secrets"`
	Cloned      bool     `json:"cloned"`
	Worktree    string   `json:"worktree"`
	SessionID   string   `json:"sessionId"`
	OldNotice   string   `json:"oldNotice"`
	NewName     string   `json:"newName"`
	RemoteCtl   bool     `json:"remoteControl"`
	NotifyOld   bool     `json:"notifyOld"`
	SetAside    []string `json:"setAside"`
	AuditDir    string   `json:"auditDir"`
	TargetDir   string   `json:"targetDir"`
	PromptFile  string   `json:"promptFile"`
	SourceHost  string   `json:"sourceHost"`
	Desktop     bool     `json:"desktop"` // the installed claude can open it in the desktop app
	ResumeArgv  []string `json:"-"`
	ResumeIntoD string   `json:"-"`
}

DoneDTO reports a finished transport.

type EntryDTO

type EntryDTO struct {
	Machine    string `json:"machine"`
	ID         string `json:"id"`
	Title      string `json:"title"`
	Status     string `json:"status"`
	Live       bool   `json:"live"`
	LastActive string `json:"lastActive"`
	LastPrompt string `json:"lastPrompt"`
	CWD        string `json:"cwd"`
	Branch     string `json:"branch"`
	Worktree   string `json:"worktree"`
	MainBranch string `json:"mainBranch"`
	Unpushed   int    `json:"unpushed"`
	Dirty      int    `json:"dirty"`
	SizeKB     int64  `json:"sizeKB"`
}

EntryDTO is one session row.

type GroupDTO

type GroupDTO struct {
	Name    string     `json:"name"`
	Remote  string     `json:"remote"`
	Local   string     `json:"local"`
	NoRepo  bool       `json:"noRepo"`
	Entries []EntryDTO `json:"entries"`
}

GroupDTO is one repository.

type HostDTO

type HostDTO struct {
	Name        string   `json:"name"`
	Destination string   `json:"destination"`
	Via         []string `json:"via"`
	OS          string   `json:"os"`
	Online      *bool    `json:"online"`
	OtherOwner  bool     `json:"otherOwner"`
	Owner       string   `json:"owner"`
	Allowed     bool     `json:"allowed"`
}

HostDTO is one machine on the consent screen.

type Info

type Info struct {
	Version   string `json:"version"`
	Host      string `json:"host"`
	ReposDir  string `json:"reposDir"`
	AuditDir  string `json:"auditDir"`
	HasHosts  bool   `json:"hasHosts"`
	ClaudeVer string `json:"claudeVersion"`
	// LocalNetwork describes macOS local network privacy: gated (macOS 15+) and firstRun
	// (the prompt has probably not been answered yet).
	LocalNetwork struct {
		Gated    bool `json:"gated"`
		FirstRun bool `json:"firstRun"`
	} `json:"localNetwork"`
	UpdateCheck string `json:"updateCheck"` // "", "on" or "off"
}

Info is static information for the window.

type KeysDTO

type KeysDTO struct {
	Host         string   `json:"host"`
	Address      string   `json:"address"`
	Fingerprints []string `json:"fingerprints"`
	Verified     string   `json:"verified"` // how it was verified, "" if not
}

KeysDTO describes host keys awaiting confirmation.

type MachineDTO

type MachineDTO struct {
	Name     string `json:"name"`
	Status   string `json:"status"`
	Hint     string `json:"hint"`
	Error    string `json:"error"`
	OS       string `json:"os"`
	Sessions int    `json:"sessions"`
	Local    bool   `json:"local"`
	Claude   string `json:"claude"`
}

MachineDTO summarises one scanned machine.

type OptsDTO

type OptsDTO struct {
	TargetDir    string `json:"targetDir"`
	Clone        bool   `json:"clone"`
	ReposDir     string `json:"reposDir"`
	Worktree     string `json:"worktree"`
	Fork         bool   `json:"fork"`
	RemoteCtl    bool   `json:"remoteControl"`
	NotifyOld    bool   `json:"notifyOld"`
	Redact       bool   `json:"redact"`
	OtherAccount bool   `json:"otherAccount"`
	Memory       bool   `json:"memory"`
}

OptsDTO are the preflight choices.

type PlanDTO

type PlanDTO struct {
	Plan  *engine.Plan `json:"plan"`
	Kinds []string     `json:"kinds"`
}

PlanDTO is the rendered plan.

type ScanDTO

type ScanDTO struct {
	Machines []MachineDTO `json:"machines"`
	Groups   []GroupDTO   `json:"groups"`
	Total    int          `json:"total"`
}

ScanDTO is the result of a scan.

type UpdateDTO

type UpdateDTO struct {
	Latest string `json:"latest"`
	Newer  bool   `json:"newer"`
	URL    string `json:"url"`
}

UpdateDTO is the result of an update check.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL