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 ¶
- Variables
- type App
- func (a *App) AddHost(name, destination string) error
- func (a *App) Apply() (*DoneDTO, error)
- func (a *App) CheckUpdate() (*UpdateDTO, error)
- func (a *App) ChooseFolder(title string) (string, error)
- func (a *App) CopyText(text string) bool
- func (a *App) Discover() []HostDTO
- func (a *App) Info() Info
- func (a *App) OpenInDesktop() error
- func (a *App) OpenInTerminal(command string) error
- func (a *App) OpenLocalNetworkSettings() error
- func (a *App) OpenURL(url string) error
- func (a *App) Plan(machine, sessionID string, o OptsDTO) (*PlanDTO, error)
- func (a *App) RetryLocalNetwork()
- func (a *App) Scan() (*ScanDTO, error)
- func (a *App) ScanKeys(name string) (*KeysDTO, error)
- func (a *App) SetAllowed(name, destination string, allowed bool) error
- func (a *App) SetReposDir(dir string) error
- func (a *App) SetUpdateCheck(on bool) error
- func (a *App) Shutdown()
- func (a *App) TrustHost(name string) error
- func (a *App) Undo(sessionID string) error
- type DoneDTO
- type EntryDTO
- type GroupDTO
- type HostDTO
- type Info
- type KeysDTO
- type MachineDTO
- type OptsDTO
- type PlanDTO
- type ScanDTO
- type UpdateDTO
Constants ¶
This section is empty.
Variables ¶
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 (*App) CheckUpdate ¶
CheckUpdate looks for a newer release, at most once a day, and only when allowed.
func (*App) ChooseFolder ¶
ChooseFolder asks for a directory.
func (*App) OpenInDesktop ¶
OpenInDesktop opens the moved session in the Claude desktop app.
func (*App) OpenInTerminal ¶
OpenInTerminal runs the resume command in a new terminal window.
func (*App) OpenLocalNetworkSettings ¶
OpenLocalNetworkSettings opens System Settings at Privacy & Security, where the Local Network list is (macOS offers no link to the list itself).
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) SetAllowed ¶
SetAllowed records consent for a machine.
func (*App) SetReposDir ¶
SetReposDir changes the clone folder.
func (*App) SetUpdateCheck ¶
SetUpdateCheck records whether the app may look for new releases once a day.
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 ScanDTO ¶
type ScanDTO struct {
Machines []MachineDTO `json:"machines"`
Groups []GroupDTO `json:"groups"`
Total int `json:"total"`
}
ScanDTO is the result of a scan.