gui

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: Apache-2.0 Imports: 57 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; every use case is the app layer's, as for the command line.

Index

Constants

View Source
const (
	WhereHere     = config.ResumeHere     // a tab in the hopsesh Terminal window
	WhereTerminal = config.ResumeTerminal // the user's terminal app
	// WhereShown: the session runs in a tab already, which is now in front.
	WhereShown = "shown"
)

Where an entry point opens.

View Source
const (
	TerminalStream     = "hopsesh.terminal"
	TerminalTabsStream = "hopsesh.terminal.tabs"
	// TerminalEvent carries a tab's TermTab (State "" once it is gone) to the app's window,
	// for its chips and counts.
	TerminalEvent = "hopsesh:terminal"
	// QuitEvent asks the app's window to confirm quitting while programs run in tabs.
	QuitEvent = "hopsesh:quit"
	// SignedInEvent: a sign-in tab ended with code 0, and hopsesh checked the login again
	// (a SignedInDTO).
	SignedInEvent = "hopsesh:signed-in"
	// TerminalPage is where the terminal window's page is.
	TerminalPage = "/terminal/"
	// TerminalTitle is the terminal window's title.
	TerminalTitle = "hopsesh Terminal"
)

Stream and event names, and where the terminal page is.

View Source
const (
	TabSession = "session" // a session resumed here
	TabStep    = "step"    // a hand-off's driver step (claude --cloud)
	TabBring   = "bring"   // a bring-back's teleport (claude --teleport)
	TabSignIn  = "signin"  // a vendor's sign-in: nothing recorded
	TabShell   = "shell"   // the user's login shell: nothing recorded
)

What a tab is for (TabMeta.Kind).

View Source
const AccountEvent = "hopsesh:accounts"
View Source
const AppearanceEvent = "hopsesh:appearance"
View Source
const DiscoveryEvent = "hopsesh:discovery"
View Source
const ErrCLIRequired = "cli-required: "

ErrCLIRequired starts the error the window shows as "install the command first": the skill tells agents to run hopsesh, and the protection hooks run it, so both need it.

View Source
const ExternalExitEvent = "hopsesh:external-exit"

ExternalExitEvent carries an ExternalExitDTO to the window.

View Source
const MenuEvent = "hopsesh:menu"

MenuEvent carries a menu-bar command to the window ("palette", "refresh", "sessions", "activity", "machines", "settings", "undo-last").

View Source
const PasswordEvent = "hopsesh:password"

PasswordEvent is the event the window gets when ssh asks for a machine's password.

View Source
const ProgressEvent = "hopsesh:progress"

ProgressEvent carries the steps of a move or continuation to the window.

View Source
const QuickEvent = "hopsesh:quick"
View Source
const QuickRouteEvent = "hopsesh:quick-route"
View Source
const TerminalAppEvent = "hopsesh:terminal-app"

TerminalAppEvent tells the window that a launch opened in another terminal than the chosen one (TerminalAppNotice), so it can say so.

View Source
const TerminalCSP = "" /* 210-byte string literal not displayed */

TerminalCSP keeps the terminal page to its own scripts, and its requests to the app's asset server (the streams): no inline script, no other origin, no frames, no forms, no plugins. Styles may be inline because xterm.js writes its scrollbar's and its DOM renderer's rules into <style> elements it makes; the page's own markup never carries a program's text as anything but text.

View Source
const TerminalPreferencesEvent = "hopsesh:terminal-preferences"

TerminalPreferencesEvent synchronizes Settings with the terminal menu.

View Source
const TerminalWorkspaceEvent = "hopsesh:terminal-workspace"

Variables

View Source
var Assets embed.FS

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

Functions

func CLIReady added in v0.4.2

func CLIReady(st integrate.CLIStatus) bool

CLIReady reports whether the hopsesh command is installed where the skill and hooks can run it (a link to this or another copy of the app, or a separate install).

func SetAppHook added in v0.4.0

func SetAppHook(f func(name string, command agent.Command) error)

SetAppHook sends every desktop app ShowApp would bring forward to f instead (tests: the machine running them may have the real app).

func SetLinkHook added in v0.4.0

func SetLinkHook(f func(url string))

SetLinkHook sends every link a tab asks to open to f instead of the dialog (tests).

func SetListMenu added in v0.4.0

func SetListMenu(f func(groupBy, sortBy string, compact bool))

SetListMenu is how the app's View menu learns the list's grouping, sorting and rows.

func SetRevealHook added in v0.4.0

func SetRevealHook(f func(path string) error)

SetRevealHook sends every path RevealEntry would show to f instead (tests).

func SetStepProgram added in v0.4.0

func SetStepProgram(path string)

SetStepProgram sets the program the terminal runs for a step (the browser tests: their own, which carries the command line).

func SetTerminal added in v0.4.0

func SetTerminal(f func(line string) error)

SetTerminal replaces the user's terminal app with one that runs each launch's line (hopsesh's verb on a ticket, in the launch's folder) with f: the browser tests run it in the background, as a terminal would.

func SetViewMenu added in v0.4.0

func SetViewMenu(f func(sidebar, inspector bool))

SetViewMenu is how the app's View menu learns what the window shows.

Types

type AccountDTO added in v0.4.0

type AccountDTO struct {
	agent.RuntimeProfile
	Machine string `json:"machine"`
	Local   bool   `json:"local"`
	Stale   bool   `json:"stale"`
}

type ActivityDTO

type ActivityDTO struct {
	PendingReceipt bool     `json:"pendingReceipt"`
	ID             string   `json:"id"`
	Kind           string   `json:"kind"` // move | continue | push | fetch | handoff | hop | …
	Title          string   `json:"title"`
	When           string   `json:"when"` // RFC 3339
	Changes        int      `json:"changes"`
	Remote         []string `json:"remote"` // other machines whose part it undoes too
	CanUndo        bool     `json:"canUndo"`
	Undone         bool     `json:"undone"`
	Why            string   `json:"why,omitempty"` // why it cannot be undone now
	// Fetch is what a fetch from a cloud brought (kind fetch).
	Fetch *BroughtDTO `json:"fetch,omitempty"`
	// Handoff is where a hand-off went (kind handoff).
	Handoff *HandoffActivityDTO `json:"handoff,omitempty"`
	// Part: a leg of a hop, undone with it (PartOf); Parts, a hop's legs.
	Part   bool     `json:"part,omitempty"`
	PartOf string   `json:"partOf,omitempty"`
	Parts  []string `json:"parts,omitempty"`
	// Hop is a hop from one cloud to another (kind hop).
	Hop *move.HopResult `json:"hop,omitempty"`
}

ActivityDTO is one operation in the Activity list.

type ActivityListDTO

type ActivityListDTO struct {
	Items []ActivityDTO `json:"items"`
	// Waiting are fetches whose copy the agent's own command has not written yet.
	Waiting []BroughtDTO `json:"waiting"`
}

ActivityListDTO is the Activity screen.

type AgentCloudDTO added in v0.4.0

type AgentCloudDTO struct {
	Name         string             `json:"name"`
	Title        string             `json:"title"`
	Capabilities []agent.Capability `json:"capabilities"`
	Partial      bool               `json:"partial"`
	Fidelity     string             `json:"fidelity"` // what comes back of a conversation
}

AgentCloudDTO is one of an agent's clouds in Settings: the cloud capabilities its module has (cloud-list, cloud-fetch, …), and whether its listing is partial.

type AgentDTO

type AgentDTO struct {
	ID            agent.ID           `json:"id"`
	Name          string             `json:"name"`
	Stability     agent.Stability    `json:"stability"`
	Enabled       bool               `json:"enabled"`
	RemoteControl bool               `json:"remoteControl"`
	Import        bool               `json:"import"`  // continued sessions go through its own importer
	Version       string             `json:"version"` // installed here ("" when not)
	Folder        string             `json:"folder"`  // its data folder here
	Tested        []string           `json:"tested"`
	Capabilities  []agent.Capability `json:"capabilities"`
	Icon          string             `json:"icon,omitempty"` // a data URL: the installed app's icon or the module's mark ("": initials)
	// Clouds are the vendor clouds the agent reaches, with what hopsesh can do there.
	Clouds []AgentCloudDTO `json:"clouds"`
}

AgentDTO is one agent module.

type AgentOpt

type AgentOpt struct {
	ID           agent.ID `json:"id"`
	Name         string   `json:"name"`
	Experimental bool     `json:"experimental,omitempty"`
}

AgentOpt is an agent a session can continue in here.

type App

type App struct {
	Desktop DesktopShell `json:"-"`

	// Wails is the running application (events, clipboard, dialogs).
	Wails *application.App `json:"-"`
	// Terms are the terminal's tabs and window (not bound to the window: see terminal.go).
	Terms *Terminals `json:"-"`
	// Emitter takes the window's events when there is no Wails app (the browser tests).
	Emitter func(name string, data any) `json:"-"`
	// contains filtered or unexported fields
}

App is the service bound to the frontend.

func NewApp

func NewApp(reg *registry.Registry, options ...Option) *App

NewApp loads the configuration for the modules in reg. A configuration an older hopsesh wrote is reported by Info, not returned: the window offers to start fresh.

func (*App) AccountDestinations added in v0.4.0

func (a *App) AccountDestinations(machine, id string) []agent.RuntimeProfile

AccountDestinations returns only present profiles on a scanned destination.

func (*App) Accounts added in v0.4.0

func (a *App) Accounts() ([]AccountDTO, error)

func (*App) Activity

func (a *App) Activity() (*ActivityListDTO, error)

Activity lists what hopsesh did, newest first.

func (*App) AddCLIToPath

func (a *App) AddCLIToPath() (string, error)

AddCLIToPath adds ~/.local/bin to the login shell's PATH (only on the user's click).

func (*App) AddHost

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

AddHost adds and allows a machine by ssh destination. password: it logs in with a password (asked for when hopsesh connects; remember keeps it in the Keychain).

func (*App) AdoptStatus added in v0.4.0

func (a *App) AdoptStatus(journal string) (*BroughtDTO, error)

AdoptStatus looks for the copy the agent's own command wrote for a fetch, adopts it once it is there, and says where it stands (the done screen's wait).

func (*App) Appearance added in v0.4.0

func (a *App) Appearance() string

Appearance is a cheap startup read, independent of agent/integration discovery.

func (*App) Apply

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

Apply carries out the last plan, sending each step to the window.

func (*App) ApplyHandoff added in v0.4.0

func (a *App) ApplyHandoff() (*HandedOffDTO, error)

ApplyHandoff carries out the last hand-off plan, sending each step to the window. A step that fails is reported in the result (with what had happened by then), not as an error.

func (*App) ApplyHop added in v0.4.0

func (a *App) ApplyHop() (*HopDoneDTO, error)

ApplyHop carries out the last hop plan. When its first leg needs the user's terminal, it opens it there and returns waiting: the window then asks ContinueHop until the copy is here and handed on.

func (*App) ArchiveLineage added in v0.4.0

func (a *App) ArchiveLineage(machine, key string) error

func (*App) AssociateShell added in v0.4.0

func (a *App) AssociateShell(id, machine, key string) error

AssociateShell organizes a shell with a selected conversation. It does not claim that the shell runs the agent or write a historical lineage edge.

func (*App) AttachAppearance added in v0.4.0

func (a *App) AttachAppearance()

AttachAppearance applies the saved native preference once AppKit is running. System removes the override; subsequent OS changes need no saved config writes.

func (*App) AttachDesktop added in v0.4.0

func (a *App) AttachDesktop(main *application.WebviewWindow)

AttachDesktop installs the native shell. The popup uses the same trusted asset and service boundary as the main window; terminal windows remain isolated.

func (*App) Bootstrap added in v0.4.1

func (a *App) Bootstrap() Info

Bootstrap is configuration-only: integration checks cannot hold first paint.

func (*App) CachedScan added in v0.4.1

func (a *App) CachedScan() *ScanDTO

CachedScan has no agent, SSH, git, or presence probes. A cache failure falls back to an empty usable screen; the normal scan repairs its read model.

func (*App) CancelPassword

func (a *App) CancelPassword(id string)

CancelPassword declines a password question; that machine is skipped this time.

func (*App) CancelScan added in v0.4.1

func (a *App) CancelScan()

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) Checkouts added in v0.4.0

func (a *App) Checkouts() []CheckoutDTO

Checkouts resolves local folders on demand, including sessions published before repository enrichment completes. It neither borrows transports nor starts a scan.

func (*App) ChooseFolder

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

ChooseFolder asks for a directory.

func (*App) CleanupBranches added in v0.4.0

func (a *App) CleanupBranches() []app.BranchCandidate

CleanupBranches lists the branches hand-offs left on their remotes and whether hopsesh offers to delete each (it asks the remotes, read-only).

func (*App) ClosePlan

func (a *App) ClosePlan()

ClosePlan drops the plan the window closed, and ends a send's connection.

func (*App) ContinueHop added in v0.4.0

func (a *App) ContinueHop(journal string) (*HopDoneDTO, error)

ContinueHop takes a waiting hop on, once its copy is here (the window asks it while it waits).

func (*App) CopyText

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

CopyText puts text on the clipboard.

func (*App) DeleteBranches added in v0.4.0

func (a *App) DeleteBranches(ids []string) (*app.CleanupResult, error)

DeleteBranches deletes the merged branches the user picked, each with a lease; undo pushes them back.

func (*App) DesktopSettings added in v0.4.0

func (a *App) DesktopSettings() desktop.State

func (*App) DismissCLIOffer

func (a *App) DismissCLIOffer() error

DismissCLIOffer stops the app from offering to link the command-line tool.

func (*App) DismissSetup added in v0.4.0

func (a *App) DismissSetup() error

DismissSetup stops the app from showing its "Finish setting up" line; each step stays in Machines and Settings.

func (*App) DismissSkillOffer

func (a *App) DismissSkillOffer() error

DismissSkillOffer stops the app from offering the skill (it stays in Settings).

func (*App) EditAccount added in v0.4.0

func (a *App) EditAccount(id, name string, tags []string, generation int) error

func (*App) EndReturnDestination added in v0.4.2

func (a *App) EndReturnDestination(token string) error

EndReturnDestination consumes a review's one-use token. Invalidate the old plan before stopping, even on failure: an agent may save work as it exits. The window must request a fresh plan; this action cannot apply a transfer.

func (*App) EntryTab added in v0.4.0

func (a *App) EntryTab(machine, key string) (*TabDTO, error)

EntryTab finds the tab a session on this machine runs in (nil: none hopsesh can show): one of the hopsesh Terminal window's, or one in the user's terminal app.

func (*App) ExternalExits added in v0.4.0

func (a *App) ExternalExits() []ExternalExitDTO

ExternalExits are the launches in the user's terminal app that ended since the app started (where that terminal could say).

func (*App) FollowUp added in v0.4.0

func (a *App) FollowUp(cloud, id, text string) (*agent.CloudSession, error)

FollowUp sends a cloud session one message (it starts a turn there, on the user's plan).

func (*App) ForgetAccount added in v0.4.0

func (a *App) ForgetAccount(id string, generation int) error

func (*App) ForgetPassword

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

ForgetPassword removes a machine's remembered password (it is asked for again).

func (*App) HandoffDefaults added in v0.4.0

func (a *App) HandoffDefaults(cloud string) HandoffDefaultsDTO

HandoffDefaults are a cloud's hand-off defaults.

func (a *App) HandoffPasteLink(link string) error

HandoffPasteLink gives the waiting hand-off the session's link the user pasted (the one Claude Code printed in the terminal).

func (*App) HandoffStep added in v0.4.0

func (a *App) HandoffStep() *HandoffStepDTO

HandoffStep is the terminal step the hand-off being applied waits for (nil: none).

func (*App) HandoffStopWaiting added in v0.4.0

func (a *App) HandoffStopWaiting()

HandoffStopWaiting ends the wait: the hand-off stops at its start step, and Undo removes what it did.

func (*App) HistorySettings added in v0.4.2

func (a *App) HistorySettings() HistorySettingsDTO

HistorySettings are Settings → History.

func (*App) HookHealth added in v0.4.2

func (a *App) HookHealth(force bool) (HookHealthDTO, error)

HookHealth checks the hopsesh command and every local protection hook, asking agents that review hooks (Codex) whether they trust them. force rechecks now; otherwise a check from the last five minutes is reused.

func (*App) Info

func (a *App) Info() Info

Info returns app and machine information.

func (*App) InitialScan added in v0.4.0

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

InitialScan does not contact remote machines during a quiet login launch.

func (*App) InstallCLI

func (a *App) InstallCLI(force bool) (integrate.CLIStatus, error)

InstallCLI links the hopsesh command into ~/.local/bin.

func (*App) InstallNoticeHooks added in v0.4.0

func (a *App) InstallNoticeHooks(id, profile string) ([]app.MovementHookStatus, error)

func (*App) InstallSkill

func (a *App) InstallSkill(force, addRules bool) (app.SkillReport, error)

InstallSkill installs or updates the hopsesh skill in every installed agent, the same files in each; addRules also adds each agent's approval rules (read-only commands run without asking, moves always ask).

func (*App) InstallUpdate

func (a *App) InstallUpdate() error

InstallUpdate downloads the newest release, verifies it (release signature and checksum; on macOS also the same Apple developer and notarization), installs it over this app, opens the new version and quits this one.

func (*App) KeepPartial added in v0.4.0

func (a *App) KeepPartial(journal string) error

KeepPartial keeps a partial copy as it is.

func (*App) LatestRelease added in v0.4.0

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

LatestRelease is a user-requested check: always fetch now, regardless of the daily check's opt-in or cached result, and report failures to the window.

func (*App) LoginAccount added in v0.4.0

func (a *App) LoginAccount(id string) (*OpenedDTO, error)

func (*App) MachineScans added in v0.4.0

func (a *App) MachineScans() map[string]MachineScan

MachineScans is cheap to poll: unlike Machines it does no network discovery.

func (*App) Machines

func (a *App) Machines() MachinesDTO

Machines lists this machine, the machines you added (with the last scan's findings) and the ones discovery found (connecting to none).

func (*App) MainClosing added in v0.4.0

func (a *App) MainClosing() (cancel, hide bool)

MainClosing applies desktop close behavior, then the terminal-aware quit guard. The installed desktop shell keeps running by default, independently of icon placement.

func (*App) NoticeHooks added in v0.4.0

func (a *App) NoticeHooks() ([]app.MovementHookStatus, error)

NoticeHooks reports local installation only. Vendor trust and actual delivery remain separate from an installed configuration file.

func (*App) OpenBrought added in v0.4.0

func (a *App) OpenBrought(journal, where string) (*OpenedDTO, error)

OpenBrought opens a fetch's next command: the agent's own command while it waits (in a tab, unless the user chose their terminal app), the command that resumes the copy once it is here (as ResumeSession). where is as for ResumeSession.

func (a *App) OpenConversationLink(raw string) error

OpenConversationLink opens a clicked and confirmed transcript link. Keep this separate from OpenURL's allowlist for app-generated links.

func (*App) OpenHop added in v0.4.0

func (a *App) OpenHop(journal string) error

OpenHop opens a waiting hop's first-leg command in a terminal again.

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) OpenResult

func (a *App) OpenResult(where string) (*OpenedDTO, error)

OpenResult starts the session that was just moved or continued: in the agent's desktop app when that was chosen, otherwise in a tab of the hopsesh Terminal window or the user's terminal app (where as for ResumeSession). A bring-back still waiting for the agent's own command (claude --teleport) runs that command, in a tab unless the user chose their terminal app.

func (*App) OpenShell added in v0.4.0

func (a *App) OpenShell(machine, key string) (*OpenedDTO, error)

OpenShell opens the user's login shell in a tab, in a session's folder on this machine (key "" or a folder that is gone: the home folder). Nothing in a shell tab is recorded.

func (*App) OpenURL

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

OpenURL opens a web page in the default browser: hopsesh's release pages, Tailscale's sign-in check for a machine, a cloud session's page, and an upstream problem a cloud points to.

func (*App) PasteCloud added in v0.4.0

func (a *App) PasteCloud(link, checkout string) (*PastedDTO, error)

PasteCloud remembers a cloud session by its link or id, with the checkout here it works on (chosen from Checkouts, "" when not known yet); the next scan lists it.

func (*App) PendingPasswords

func (a *App) PendingPasswords() []PasswordRequest

PendingPasswords lists unanswered password questions (for a window that missed the event).

func (*App) Plan

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

Plan works out how a session comes here: in its own agent (target "") or continued in another. Nothing changes.

func (*App) PlanHandoff added in v0.4.0

func (a *App) PlanHandoff(machine, key, cloud string, o HandoffOptsDTO) (*HandoffPlanDTO, error)

PlanHandoff works out handing a session off to a cloud and keeps the plan for ApplyHandoff. Nothing changes.

func (*App) PlanHop added in v0.4.0

func (a *App) PlanHop(machine, key, cloud string, o HandoffOptsDTO) (*HopPlanDTO, error)

PlanHop works out handing a cloud session on to another cloud through this machine, and keeps the plan for ApplyHop. Nothing changes.

func (*App) PlanPicked added in v0.4.0

func (a *App) PlanPicked(cloud, id, checkout, target string, o OptsDTO) (*PlanDTO, error)

PlanPicked plans bringing a cloud session that is not a row: id "" leaves the choice to the vendor's own picker (Find in Claude Code…), into the checkout chosen here.

func (*App) Presence added in v0.4.0

func (a *App) Presence() (*PresenceDTO, error)

Presence reads where this machine's sessions are open now: the agents' own registries and locks, and one snapshot of the process table (each process's first known ancestor: iTerm2, Terminal, an editor, tmux, ssh). It never talks to a terminal app (that happens only when the user asks to show a session).

func (*App) Preview added in v0.4.0

func (a *App) Preview(machine, key string, n int) (*PreviewDTO, error)

Preview returns the end of a session's conversation: its last n messages (4 when n is 0), with a line for each turn's tool calls. A machine that is slow to answer gets a note, not an error.

func (*App) ProvidePassword

func (a *App) ProvidePassword(id, password string, remember bool) error

ProvidePassword answers a password question. remember stores it in the Keychain and sets the machine to remember it; false forgets any remembered one.

func (*App) PushApply

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

PushApply carries out the planned push.

func (*App) PushPlan

func (a *App) PushPlan(key, machine, target string, o OptsDTO) (*PlanDTO, error)

PushPlan asks hopsesh on another machine to plan receiving a session from this one, in its own agent (target "") or another. The connection stays open for PushApply.

func (*App) QuickClose added in v0.4.0

func (a *App) QuickClose()

func (*App) QuickOpen added in v0.4.0

func (a *App) QuickOpen(screen, machine, key string) error

func (*App) QuickPreview added in v0.4.0

func (a *App) QuickPreview(machine, key string) (*PreviewDTO, error)

func (*App) QuickQuit added in v0.4.0

func (a *App) QuickQuit()

func (*App) QuickRefresh added in v0.4.0

func (a *App) QuickRefresh()

QuickRefresh is local-only, including the first scan. Background operation must never trigger an SSH/password dialog or erase a transfer under review.

func (*App) QuickShow added in v0.4.0

func (a *App) QuickShow() error

func (*App) QuickSnapshot added in v0.4.0

func (a *App) QuickSnapshot() QuickDTO

func (*App) QuitAndEnd added in v0.4.0

func (a *App) QuitAndEnd()

QuitAndEnd quits the app and ends the programs in its tabs (the user confirmed).

func (*App) RecheckDesktop added in v0.4.0

func (a *App) RecheckDesktop() desktop.State

func (*App) RefreshAccount added in v0.4.1

func (a *App) RefreshAccount(id string) (agent.RuntimeProfile, error)

RefreshAccount updates public profile metadata in existing rows without rescanning peers.

func (*App) RefreshHere added in v0.4.0

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

RefreshHere reads this machine again and keeps what the last scan found on the other machines and in the clouds (reading those takes SSH and the vendors' commands, so the window does it less often). It leaves a plan in progress alone. Before any scan it is local-only discovery, with no remote authentication.

func (*App) RegisterAccount added in v0.4.0

func (a *App) RegisterAccount(machine, id, name, root string, tags []string) (agent.RuntimeProfile, error)

func (*App) ReleaseOriginal added in v0.4.2

func (a *App) ReleaseOriginal(machine, key string) error

ReleaseOriginal removes the block (or advice) from one original on this machine, for its current movement. The window confirms first: continuing there makes the copies diverge, and moving back then needs a comparison instead of a clean return.

func (*App) RemoveHost

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

RemoveHost forgets a machine: hopsesh stops connecting to it and drops its remembered password (discovery may still list it).

func (*App) RemoveNoticeHooks added in v0.4.0

func (a *App) RemoveNoticeHooks(id, profile string) ([]app.MovementHookStatus, error)

func (*App) RemoveSkill

func (a *App) RemoveSkill(force bool) (app.SkillReport, error)

RemoveSkill removes every copy of the skill and the approval rules.

func (*App) Rename added in v0.4.0

func (a *App) Rename(machine, key, title string) error

Rename gives a session a new title in its agent's own data (Claude Code's custom title, Codex's thread name), as their own rename does; Activity undoes it.

func (*App) RenameFamily added in v0.4.0

func (a *App) RenameFamily(id, name string) error

RenameFamily changes a presentation label only, never the native session title or history. An empty label restores the title derived from the original branch.

func (*App) ResolveEntry added in v0.4.0

func (a *App) ResolveEntry(machine, key string) (*EntryDTO, error)

ResolveEntry resolves a raw scanned replica even when grouping shows a different copy of its branch. It never scans or guesses a destination from timestamps.

func (*App) RestoreBlock added in v0.4.2

func (a *App) RestoreBlock(machine, key string) error

RestoreBlock puts a removed block back on an original on this machine.

func (*App) ResumeCommand added in v0.4.0

func (a *App) ResumeCommand(machine, key string) (string, error)

ResumeCommand is the command that resumes a session on this machine, for the user's shell (copied from the ⋯ menu).

func (*App) ResumeEntry

func (a *App) ResumeEntry(machine, key string, inApp bool) error

ResumeEntry continues a session that is already on this machine, in a terminal or (inApp) the agent's desktop app.

func (*App) ResumeSession added in v0.4.0

func (a *App) ResumeSession(machine, key, where string) (*OpenedDTO, error)

ResumeSession continues a session that is on this machine: in a tab of the hopsesh Terminal window or in the user's terminal app (where: "here", "terminal", or "" for the setting). A session that runs in a tab already is shown instead.

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) RetryReceipts added in v0.4.0

func (a *App) RetryReceipts(id string) error

RetryReceipts repairs pending metadata without relaunching a native or cloud agent.

func (*App) Reveal

func (a *App) Reveal(path string) error

Reveal shows a file or folder in Finder, Explorer or the system file manager.

func (*App) RevealEntry added in v0.4.0

func (a *App) RevealEntry(machine, key string) error

RevealEntry shows a session's file in Finder (Explorer on Windows).

func (*App) SaveDesktop added in v0.4.0

func (a *App) SaveDesktop(in DesktopInput) error

func (*App) SaveLayout added in v0.4.0

func (a *App) SaveLayout(l LayoutDTO) error

SaveLayout stores the panes' layout (what the user chose: never a pane the window hid for being narrow) and the inspector's sections.

func (*App) SaveList added in v0.4.0

func (a *App) SaveList(d ListDTO) error

SaveList stores the list's display. Values the app does not know are refused; the collapsed and expanded groups keep the newest ListKeysMax.

func (*App) SaveSettings

func (a *App) SaveSettings(in SettingsInput) error

SaveSettings stores the user's choices.

func (*App) Scan

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

Scan reads this machine and every allowed machine, for every enabled agent.

func (*App) ScanAccounts added in v0.4.0

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

func (*App) ScanKeys

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

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

func (*App) ScanMachine added in v0.4.0

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

ScanMachine reads just one allowed machine, merges its result into the inventory, and leaves all other connections and cloud results in place.

func (*App) ScanSnapshot added in v0.4.1

func (a *App) ScanSnapshot() *ScanDTO

ScanSnapshot returns the current browsing model after a source-only retry.

func (*App) SetAgent

func (a *App) SetAgent(id string, enabled, remoteControl, imp bool) error

SetAgent turns an agent on or off (an agent that is off is not scanned and cannot be moved into), and sets whether sessions continued in it turn its remote control on and go through its own importer.

func (*App) SetAllowed

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

SetAllowed records consent for a machine.

func (*App) SetAuth

func (a *App) SetAuth(name, auth string, remember bool) error

SetAuth switches a machine between key login ("key") and password login ("password").

func (*App) SetCloudAllowed added in v0.4.0

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

SetCloudAllowed records consent for a cloud: hopsesh runs its agent's cloud commands only once it is allowed.

func (*App) SetCloudEnvironment added in v0.4.0

func (a *App) SetCloudEnvironment(name, repo, env string) error

SetCloudEnvironment sets the environment a repository's hand-offs to a cloud run in ("" forgets it): the Machines page's table.

func (*App) SetHistorySettings added in v0.4.2

func (a *App) SetHistorySettings(in config.History) error

SetHistorySettings stores Settings → History. Values equal to the default are stored as the default (left out of the file), so a later default change still applies.

func (*App) SetPlace added in v0.4.0

func (a *App) SetPlace(agentID, place string) error

SetPlace remembers where an agent's sessions resume: here (the hopsesh Terminal window), terminal (the user's terminal app) or app (the agent's desktop app).

func (*App) SetPreviews added in v0.4.0

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

SetPreviews turns the inspector's conversation previews on or off.

func (*App) SetReceive

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

SetReceive lets (or stops letting) hopsesh on your other machines send sessions here.

func (*App) SetReposDir

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

SetReposDir changes the clone folder.

func (*App) SetTerminalApps added in v0.4.0

func (a *App) SetTerminalApps(appID, resume string) error

SetTerminalApps stores the chosen terminal app ("" automatic) and where sessions resume.

func (*App) SetTerminalSettings added in v0.4.0

func (a *App) SetTerminalSettings(in TerminalSettingsInput) error

SetTerminalSettings stores Settings → Terminal, and gives the terminal window its new look.

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) Settings

func (a *App) Settings() SettingsDTO

Settings returns the current settings and integration state.

func (*App) SetupKeyLogin

func (a *App) SetupKeyLogin(name string, createKey bool) (*KeyLoginDTO, error)

SetupKeyLogin adds this Mac's public key to a password machine, checks that key login works and switches the machine to it. Without createKey it fails with "no-key" when this Mac has no key ssh would use (the window then asks before one is made).

func (*App) ShouldQuit added in v0.4.0

func (a *App) ShouldQuit() bool

ShouldQuit is the app's quit check: with programs running in tabs, the app's window asks first (QuitEvent), and quitting waits for QuitAndEnd.

func (*App) ShowApp added in v0.4.0

func (a *App) ShowApp(machine, key string) (string, error)

ShowApp brings forward the agent's own desktop app, which runs a session on this machine, and returns its name. Modules with exact chat links navigate to that chat; other modules can only bring their app forward.

func (*App) ShowEntry added in v0.4.0

func (a *App) ShowEntry(machine, key string) (string, error)

ShowEntry brings forward the tab a session on this machine runs in, and returns the terminal's name.

func (*App) ShowPlace added in v0.4.0

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

ShowPlace brings forward an editor a session runs in (VS Code, Cursor): hopsesh can't pick the terminal inside it, so the app comes to the front as it is.

func (*App) Shutdown

func (a *App) Shutdown()

Shutdown closes connections and ends the terminal's tabs.

func (*App) SignIn added in v0.4.0

func (a *App) SignIn(cloud, where string) (*OpenedDTO, error)

SignIn runs a cloud's own sign-in command (claude auth login, codex login --device-auth, gh auth login --web): in a sign-in tab, whose output hopsesh never reads or keeps, or in the user's terminal app (where as for ResumeSession). When the tab ends with code 0, hopsesh checks the login again and tells the window (SignedInEvent).

func (*App) SkillPreview

func (a *App) SkillPreview() (string, error)

SkillPreview returns the SKILL.md this build installs.

func (*App) StartFresh

func (a *App) StartFresh(newer bool) (string, error)

StartFresh sets aside a configuration file an older hopsesh wrote and starts with defaults (machines are added again). It returns where the old file went. A file a newer hopsesh wrote is set aside only when the user chose that over updating (newer).

func (*App) TakeQuickRoute added in v0.4.0

func (a *App) TakeQuickRoute() *QuickRoute

TakeQuickRoute also runs at main-window readiness, so a cold-start click isn't lost before its frontend event listener exists.

func (*App) TerminalApps added in v0.4.0

func (a *App) TerminalApps() TerminalAppsDTO

TerminalApps returns the terminal settings.

func (*App) TerminalCloseTab added in v0.4.0

func (a *App) TerminalCloseTab(id string) error

TerminalCloseTab closes a tab, ending its program.

func (*App) TerminalFocus added in v0.4.0

func (a *App) TerminalFocus(id string) error

TerminalFocus shows the terminal window with one of its tabs in front.

func (*App) TerminalOpenElsewhere added in v0.4.0

func (a *App) TerminalOpenElsewhere(id string) error

TerminalOpenElsewhere ends a tab and runs its command in the user's terminal app ("Move to Terminal…", which the window confirmed with the user).

func (*App) TerminalPlacement added in v0.4.0

func (a *App) TerminalPlacement(placement string) error

TerminalPlacement asks the existing renderer to checkpoint before rehosting. Changing bottom/right never changes the renderer, stream or process.

func (*App) TerminalRunning added in v0.4.0

func (a *App) TerminalRunning() int

TerminalRunning is how many tabs' programs still run (the window asks before quitting).

func (*App) TerminalSettings added in v0.4.0

func (a *App) TerminalSettings() TerminalSettingsDTO

TerminalSettings are Settings → Terminal.

func (*App) TerminalShow added in v0.4.0

func (a *App) TerminalShow()

TerminalShow brings the terminal window to the front.

func (*App) TerminalTabs added in v0.4.0

func (a *App) TerminalTabs() []TermTab

TerminalTabs are the terminal's open tabs (state, title, exit code, what each is for).

func (*App) TerminalWorkspace added in v0.4.0

func (a *App) TerminalWorkspace() (TerminalWorkspaceDTO, error)

func (*App) TerminalWorkspaceVisible added in v0.4.0

func (a *App) TerminalWorkspaceVisible(visible bool)

TerminalWorkspaceVisible reports presentation only; it grants no PTY authority.

func (*App) TestCloud added in v0.4.0

func (a *App) TestCloud(name string) (*CloudTestDTO, error)

TestCloud probes a cloud through its agent's command, read-only (the Test button).

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(journal string, force bool) error

Undo reverses a move or continuation by its journal id; force undoes it even when the session was used since.

func (*App) UndoLast

func (a *App) UndoLast() (string, error)

UndoLast undoes the newest operation that can still be undone and returns its title.

func (*App) UninstallCLI

func (a *App) UninstallCLI() (integrate.CLIStatus, error)

UninstallCLI removes the link the app made (and its PATH block).

func (*App) ViewState added in v0.4.0

func (a *App) ViewState(sidebar, inspector bool)

ViewState tells the View menu what the window shows now (sidebar, inspector), so its items say Show or Hide; a pane hidden for a narrow window counts as hidden.

type BroughtDTO added in v0.4.0

type BroughtDTO = app.Brought

BroughtDTO is a fetch from a cloud: waiting for the user's terminal, or what came back (app.Brought, the command line's shape too).

type CanDTO

type CanDTO struct {
	AppWhy        string `json:"appWhy,omitempty"`
	Fork          bool   `json:"fork"`
	RemoteControl bool   `json:"remoteControl"`
	App           bool   `json:"app"`
	Native        bool   `json:"native"`
	Import        bool   `json:"import"`
}

CanDTO is what the receiving agent can do, for the options shown.

type CheckoutDTO added in v0.4.0

type CheckoutDTO struct {
	Name     string `json:"name"`
	Identity string `json:"identity"`
	Path     string `json:"path"`
}

CheckoutDTO is a repository checked out here, for choosing where a cloud session comes.

type CloudDTO added in v0.4.0

type CloudDTO struct {
	Name      string `json:"name"`
	Title     string `json:"title"`
	Agent     string `json:"agent"`
	AgentName string `json:"agentName"`
	Driver    string `json:"driver"`
	Version   string `json:"version"`
	Tested    bool   `json:"tested"`
	TestedOn  string `json:"testedOn"` // the driver versions hopsesh tested ("2.1")
	Status    string `json:"status"`   // app.Cloud* statuses
	Hint      string `json:"hint"`
	Error     string `json:"error"`
	Allowed   bool   `json:"allowed"`
	Sessions  int    `json:"sessions"`
	Mirrors   int    `json:"mirrors"`
	Partial   bool   `json:"partial"`
	Listable  bool   `json:"listable"`
	Fetchable bool   `json:"fetchable"`
	// Experimental: its module is experimental (its drivers' output is partly unverified).
	Experimental bool `json:"experimental"`
	// Rename: the cloud's own branches come home under hopsesh/from/<cloud>/.
	Rename bool `json:"rename"`
	// VendorPrefix starts the cloud's own branches ("claude/").
	VendorPrefix string `json:"vendorPrefix"`
	// Fidelity is what comes back of a conversation (native, code, text).
	Fidelity string `json:"fidelity"`
	// CodeOnly: hopsesh brings only the code of this cloud's sessions (the cloud gives no
	// words back to write here as a session).
	CodeOnly bool `json:"codeOnly"`
	// Test is the last read-only probe of it, when there was one.
	Test *CloudTestDTO `json:"test,omitempty"`
	// SignIn is the driver's own sign-in command, for people ("codex login --device-auth";
	// "": the card offers no Sign in).
	SignIn string `json:"signIn,omitempty"`
	// Noun is what the cloud calls its sessions ("task"); Limits, what hopsesh cannot reach
	// there; CodeUp and CodeDown, how code travels each way; Hosts, the repository hosts it
	// takes.
	Noun     string   `json:"noun"`
	Limits   []string `json:"limits"`
	CodeUp   []string `json:"codeUp"`
	CodeDown []string `json:"codeDown"`
	Hosts    []string `json:"hosts"`
	// NeedsEnv: a hand-off runs in an environment (Codex cloud); Repos are the repositories
	// hopsesh knows with the environment set for each, Envs the environments to choose from,
	// EnvHint how to make one.
	NeedsEnv bool             `json:"needsEnv"`
	Repos    []app.RepoEnv    `json:"repos"`
	Envs     []move.EnvChoice `json:"envs"`
	EnvHint  string           `json:"envHint,omitempty"`
}

CloudDTO is one cloud as the window shows it (only clouds hopsesh can do something with).

type CloudEntryDTO added in v0.4.0

type CloudEntryDTO struct {
	Name     string `json:"name"`  // the cloud
	Title    string `json:"title"` // "Claude Code cloud"
	ID       string `json:"id"`
	URL      string `json:"url"`
	State    string `json:"state"`
	PR       string `json:"pr,omitempty"`
	Branch   string `json:"branch,omitempty"`
	Base     string `json:"base,omitempty"`
	Repo     string `json:"repo,omitempty"`
	Checkout string `json:"checkout,omitempty"`
	// EnvLabel is the environment it runs in; Changes sums up its code; Noun, what its
	// cloud calls it ("task").
	EnvLabel string `json:"envLabel,omitempty"`
	Changes  string `json:"changes,omitempty"`
	Noun     string `json:"noun"`
}

CloudEntryDTO is what a cloud row adds to a session row.

type CloudTestDTO added in v0.4.0

type CloudTestDTO struct {
	OK      bool               `json:"ok"`
	Account string             `json:"account,omitempty"`
	Checks  []agent.CloudCheck `json:"checks"`
	Error   string             `json:"error,omitempty"`
	At      string             `json:"at"` // RFC 3339
}

CloudTestDTO is a read-only probe of a cloud.

type ContinueDTO

type ContinueDTO struct {
	Comparison   *move.Comparison         `json:"comparison,omitempty"`
	Instructions []move.InstructionSource `json:"instructions"`
	From         string                   `json:"from"`
	Fidelity     string                   `json:"fidelity"`
	Relation     string                   `json:"relation"`
	AppendTo     string                   `json:"appendTo,omitempty"` // the title of the copy here that gets the new work
	Report       convert.Report           `json:"report"`
	Briefing     string                   `json:"briefing"`
	Via          string                   `json:"via,omitempty"`
}

ContinueDTO is the conversion part of a plan.

type CopyDTO

type CopyDTO struct {
	Profile    *agent.RuntimeProfile `json:"profile,omitempty"`
	Machine    string                `json:"machine"`
	Agent      agent.ID              `json:"agent"`
	AgentName  string                `json:"agentName"`
	Key        string                `json:"key"` // agent/session, as EntryDTO.Key
	Local      bool                  `json:"local"`
	LeftBehind bool                  `json:"leftBehind,omitempty"` // moved on since
	Newest     bool                  `json:"newest"`
}

CopyDTO is one copy of a session, on some machine and in some agent.

type DesktopInput added in v0.4.0

type DesktopInput struct {
	Mode      string `json:"mode"`
	Close     string `json:"close"`
	Attention bool   `json:"attention"`
	Previews  bool   `json:"previews"`
	Login     bool   `json:"login"`
}

type DesktopShell added in v0.4.0

type DesktopShell interface {
	Snapshot() desktop.State
	Apply(config.Desktop, bool) error
	Recheck()
	KeepOnClose() bool
	OpenMain()
	CloseQuick()
	SetAttention(int, int)
	Stop()
}

DesktopShell lets browser tests exercise the same lifecycle without modifying the host's login items or hiding real application windows.

type DoneDTO

type DoneDTO struct {
	NoWork           bool     `json:"noWork"`
	Kind             string   `json:"kind"`
	Title            string   `json:"title"`
	Agent            string   `json:"agent"`
	Command          string   `json:"command"`
	Files            int      `json:"files"`
	Bytes            string   `json:"bytes"`
	Paths            int      `json:"paths"`
	Secrets          int      `json:"secrets"`
	Redacted         bool     `json:"redacted"`
	Cloned           bool     `json:"cloned"`
	Worktree         string   `json:"worktree"`
	Journal          string   `json:"journal"`
	SourceHost       string   `json:"sourceHost"`
	Stopped          bool     `json:"stopped"`
	Pushed           string   `json:"pushed"`
	PushError        string   `json:"pushError"`
	SyncNote         string   `json:"syncNote"`
	SyncState        string   `json:"syncState"`
	Notice           string   `json:"notice"`
	Warnings         []string `json:"warnings"`
	InApp            bool     `json:"inApp"` // it opens in the agent's desktop app
	ContinuationHint string   `json:"continuationHint,omitempty"`
	Machine          string   `json:"machine,omitempty"` // a push: where it went (start it there)
	AuditDir         string   `json:"auditDir"`
	// Fetch is a session brought from a cloud: waiting for the user's terminal, or the
	// code only.
	Fetch *BroughtDTO `json:"fetch,omitempty"`
}

DoneDTO reports a finished move or continuation.

type EntryDTO

type EntryDTO struct {
	Cached       bool                  `json:"cached,omitempty"`
	Relationship app.Relationship      `json:"relationship"`
	ObservedAt   time.Time             `json:"observedAt,omitempty"`
	Returns      []app.ReturnCandidate `json:"returns,omitempty"`
	Movement     *app.MovementNotice   `json:"movement,omitempty"`
	// Departure: this copy moved on (to where, and what is known there). Arrival: how it
	// came here. Guard: how this original is protected until the session moves back.
	Departure       *app.MovementNotice   `json:"departure,omitempty"`
	Arrival         *app.Arrival          `json:"arrival,omitempty"`
	Guard           *GuardDTO             `json:"guard,omitempty"`
	ContextOverflow bool                  `json:"contextOverflow,omitempty"`
	CanApp          bool                  `json:"canApp"`
	AppWhy          string                `json:"appWhy,omitempty"`
	Profile         *agent.RuntimeProfile `json:"profile,omitempty"`
	Machine         string                `json:"machine"`
	Agent           agent.ID              `json:"agent"`
	AgentName       string                `json:"agentName"`
	Key             string                `json:"key"` // agent/session
	Title           string                `json:"title"`
	// TitleSource is where the title comes from: custom (renamed), live (the running
	// agent's name for it), generated (the agent's own title), prompt (the first prompt),
	// reply (the first reply) or none ("Untitled · folder").
	TitleSource string `json:"titleSource"`
	// Session is the agent's session id; Path its file on its machine; AgentVersion the
	// agent version that last wrote it.
	Session      string `json:"session"`
	Path         string `json:"path"`
	AgentVersion string `json:"agentVersion"`
	// CanRename: its agent's own title can be changed (Rename); CanPreview: the end of its
	// conversation can be shown (Preview).
	CanRename  bool       `json:"canRename"`
	CanPreview bool       `json:"canPreview"`
	Places     []PlaceDTO `json:"places"` // where it is open on this machine, besides hopsesh's tabs
	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"`
	Copies     []CopyDTO  `json:"copies,omitempty"` // every copy, across machines and agents
	HereNewest bool       `json:"hereNewest"`       // the newest copy is on this machine
	StaleHere  bool       `json:"staleHere"`        // an older copy is on this machine
	ContinueIn []AgentOpt `json:"continueIn"`       // other agents here it can continue in
	Needs      bool       `json:"needs"`            // the agent waits for the person (an approval)
	// App names the agent's desktop app ("Claude") when that app, not a terminal, runs the
	// open session.
	App               string           `json:"app,omitempty"`
	Journey           *lineage.Journey `json:"journey,omitempty"`
	CanArchiveLineage bool             `json:"canArchiveLineage"`
	LineageError      string           `json:"lineageError,omitempty"`
	History           []HopDTO         `json:"history"` // where it has been, oldest first
	// BringIn is the agent here a cloud-only module's session (Copilot's log, Amp's thread)
	// is written into by default: the one it was handed off from, else Claude Code;
	// ContinueIn then lists the others.
	BringIn *AgentOpt `json:"bringIn,omitempty"`
	// Location is "machine" or "cloud"; a cloud session's row has Cloud (Machine is the
	// cloud's name), and a session the vendor mirrors (Remote Control) has Mirror.
	Location string         `json:"location"`
	Cloud    *CloudEntryDTO `json:"cloud,omitempty"`
	Mirror   *MirrorDTO     `json:"mirror,omitempty"`
	// Handoff are the clouds it can be handed off to (every cloud; a disabled one with its
	// reason); Hop, for a cloud session, the other clouds it can be handed on to through
	// this machine.
	Handoff []app.HandoffTarget `json:"handoff"`
	Hop     []app.HandoffTarget `json:"hop"`
}

EntryDTO is one session row.

type ExternalExitDTO added in v0.4.0

type ExternalExitDTO struct {
	Kind     string `json:"kind"`              // session, step, sign-in
	Machine  string `json:"machine,omitempty"` // a session's row
	Key      string `json:"key,omitempty"`
	Title    string `json:"title"`
	Terminal string `json:"terminal"` // "iTerm2"
	Code     int    `json:"code"`     // the exit code; -1 when the tab was closed first
	Closed   bool   `json:"closed"`
	At       string `json:"at"` // RFC 3339
}

ExternalExitDTO is a launch in the user's terminal app that ended.

type FilterDTO added in v0.4.0

type FilterDTO struct {
	Account       []string `json:"account"`
	AccountNot    bool     `json:"accountNot"`
	Tag           []string `json:"tag"`
	TagNot        bool     `json:"tagNot"`
	Status        []string `json:"status"`
	StatusNot     bool     `json:"statusNot"`
	Location      []string `json:"location"`
	LocationNot   bool     `json:"locationNot"`
	Agent         []string `json:"agent"`
	AgentNot      bool     `json:"agentNot"`
	Repository    []string `json:"repository"`
	RepositoryNot bool     `json:"repositoryNot"`
	LastActive    string   `json:"lastActive"`
	Has           []string `json:"has"`
	HasNot        bool     `json:"hasNot"`
}

FilterDTO is the list's saved filters (config.ListFilter).

type FoundRow

type FoundRow struct {
	Name        string   `json:"name"`
	Destination string   `json:"destination"`
	Via         []string `json:"via"`
	OS          string   `json:"os"`
	Online      *bool    `json:"online"`
	Owner       string   `json:"owner"` // shared by someone else
}

FoundRow is a machine discovery found that is not added.

type GroupDTO

type GroupDTO struct {
	Name     string     `json:"name"`
	Remote   string     `json:"remote"`
	Local    string     `json:"local"`
	NoRepo   bool       `json:"noRepo"`   // not in a git checkout
	NoRemote bool       `json:"noRemote"` // a checkout without a remote (matched by path only)
	Entries  []EntryDTO `json:"entries"`
}

GroupDTO is one repository.

type GuardDTO added in v0.4.2

type GuardDTO struct {
	Mode      string `json:"mode"` // block | advise | off | released
	Effective bool   `json:"effective"`
	Problem   string `json:"problem,omitempty"`
	Fix       string `json:"fix,omitempty"`
	Operation string `json:"operation,omitempty"`
}

GuardDTO is how the copy left behind by a move is protected, as the app shows it. Effective is false when hopsesh cannot make the agent honor the choice here: the hook is not installed, the agent has not trusted it (Codex), or it cannot be verified.

type HandedOffDTO added in v0.4.0

type HandedOffDTO struct {
	Journal  string              `json:"journal"`
	Title    string              `json:"title"`
	Agent    string              `json:"agent"`
	Warnings []string            `json:"warnings"`
	Error    string              `json:"error,omitempty"`
	Handoff  *move.HandoffResult `json:"handoff"`
}

HandedOffDTO is a hand-off as the done screen shows it: what happened, or the step that failed and what had happened by then.

type HandoffActivityDTO added in v0.4.0

type HandoffActivityDTO struct {
	Cloud      string `json:"cloud"`
	CloudTitle string `json:"cloudTitle"`
	Machine    string `json:"machine"`
	Session    string `json:"session"`
	URL        string `json:"url"`
	Branch     string `json:"branch"`
	Pushed     bool   `json:"pushed"`
	Noun       string `json:"noun"` // what the cloud calls its sessions ("task")
}

HandoffActivityDTO is a hand-off in the Activity list.

type HandoffDefaultsDTO added in v0.4.0

type HandoffDefaultsDTO struct {
	HistoryFile bool   `json:"historyFile"`
	Bundle      bool   `json:"bundle"`
	Cleanup     string `json:"cleanup"`
}

HandoffDefaultsDTO are the sheet's first choices for a cloud, from the configuration.

type HandoffOptsDTO added in v0.4.0

type HandoffOptsDTO struct {
	Untracked   []string `json:"untracked"`   // untracked files to carry (paths)
	HistoryFile bool     `json:"historyFile"` // also commit the conversation on the branch
	Bundle      bool     `json:"bundle"`      // the agent uploads the repository instead
	Cleanup     string   `json:"cleanup"`
	Brief       string   `json:"brief"` // the user's edit of the briefing ("" : hopsesh's)
	Note        string   `json:"note"`
	CarryRules  bool     `json:"carryRules"`
	// Env is the cloud environment picked ("": the repository's); StartingDiff sends the
	// changes with the cloud session instead of on a branch.
	Env          string `json:"env"`
	StartingDiff bool   `json:"startingDiff"`
}

HandoffOptsDTO are the hand-off sheet's choices.

type HandoffPlanDTO added in v0.4.0

type HandoffPlanDTO struct {
	Kind       string            `json:"kind"` // "handoff"
	Title      string            `json:"title"`
	Agent      string            `json:"agent"` // the session's agent
	AgentID    agent.ID          `json:"agentId"`
	SourceHost string            `json:"sourceHost"`
	Local      bool              `json:"local"`
	Warnings   []string          `json:"warnings"`
	Blockers   []string          `json:"blockers"`
	Handoff    *move.HandoffPlan `json:"handoff"`
}

HandoffPlanDTO is a hand-off plan as the sheet shows it.

type HandoffStepDTO added in v0.4.0

type HandoffStepDTO struct {
	// State: waiting (for the terminal), no-link (it ended without a session hopsesh saw),
	// no-terminal (the window could not open one).
	State string `json:"state"`
	// Where it runs: "here" (a tab of the hopsesh Terminal window, Tab) or "terminal" (the
	// user's terminal app).
	Where string `json:"where"`
	Tab   string `json:"tab,omitempty"`
	// Exit is how the step's tab in the user's terminal app ended, when that terminal can
	// say: its exit code, -1 when the tab was closed first.
	Exit       *int   `json:"exit,omitempty"`
	CloudTitle string `json:"cloudTitle"`
	Driver     string `json:"driver"` // "claude"
	Folder     string `json:"folder"`
	Message    string `json:"message,omitempty"`
}

HandoffStepDTO is the terminal step a hand-off waits for, as the window shows it.

type HereDTO

type HereDTO struct {
	Name    string   `json:"name"`
	Agents  []string `json:"agents"`
	Hopsesh string   `json:"hopsesh"`
	Receive bool     `json:"receive"`
}

HereDTO is this machine on the Machines screen.

type HistorySettingsDTO added in v0.4.2

type HistorySettingsDTO struct {
	config.History
	ContextBudgets []int `json:"contextBudgets"`
	ReadMemoryMBs  []int `json:"readMemoryMBs"`
	RecordMBs      []int `json:"recordMBs"`
	ArchiveMBs     []int `json:"archiveMBs"`
	NativeFileMBs  []int `json:"nativeFileMBs"`
	// Effective values after defaults, shown next to "Default".
	Effective ir.Limits `json:"effective"`
	Defaults  ir.Limits `json:"defaults"`
}

HistorySettingsDTO is Settings → History: how much history a transfer carries, and the resources it may use. Zero values are automatic/defaults.

type HookHealthDTO added in v0.4.2

type HookHealthDTO struct {
	CLI      integrate.CLIStatus      `json:"cli"`
	CLIReady bool                     `json:"cliReady"` // the hopsesh command is installed and works
	Hooks    []app.MovementHookStatus `json:"hooks"`
	Problems []HookProblem            `json:"problems"`
	Mode     string                   `json:"mode"` // config original
	Checked  time.Time                `json:"checked"`
}

HookHealthDTO is what keeps movement protection and the skill working on this machine.

type HookProblem added in v0.4.2

type HookProblem struct {
	Agent   agent.ID `json:"agent"`
	Profile string   `json:"profile"`
	Label   string   `json:"label"`
	State   string   `json:"state"` // not-installed | unsupported | needs-review | disabled | missing | unknown | settings
	Message string   `json:"message"`
	Fix     string   `json:"fix,omitempty"`
}

HookProblem is one agent profile whose protection hook cannot protect originals.

type HopDTO

type HopDTO struct {
	Operation string   `json:"operation,omitempty"`
	Branch    string   `json:"branch,omitempty"`
	Loss      []string `json:"loss,omitempty"`
	When      string   `json:"when"` // RFC 3339
	What      string   `json:"what"`
}

HopDTO is one step of a session's history.

type HopDoneDTO added in v0.4.0

type HopDoneDTO struct {
	Journal  string          `json:"journal"`
	Title    string          `json:"title"`
	Hop      *move.HopResult `json:"hop"`
	Fetch    string          `json:"fetch,omitempty"` // the first leg's journal
	Handoff  *HandedOffDTO   `json:"handoff,omitempty"`
	Brought  *BroughtDTO     `json:"brought,omitempty"`
	Error    string          `json:"error,omitempty"`
	Warnings []string        `json:"warnings"`
}

HopDoneDTO is where a hop stands: waiting for the user's terminal (its first leg), or done (Handoff is the hand-off as its done screen shows it), or failed.

type HopPlanDTO added in v0.4.0

type HopPlanDTO struct {
	Kind     string        `json:"kind"` // "hop"
	Title    string        `json:"title"`
	Agent    string        `json:"agent"`
	Warnings []string      `json:"warnings"`
	Blockers []string      `json:"blockers"`
	Hop      *move.HopPlan `json:"hop"`
}

HopPlanDTO is a hop's plan as the sheet shows it.

type Info

type Info struct {
	DesktopManaged bool   `json:"desktopManaged"`
	Version        string `json:"version"`
	OS             string `json:"os"` // runtime.GOOS: the window words things for its system
	Host           string `json:"host"`
	ReposDir       string `json:"reposDir"`
	AuditDir       string `json:"auditDir"`
	HasHosts       bool   `json:"hasHosts"`
	ConfigError    string `json:"configError,omitempty"`
	// ConfigNewer: a newer hopsesh wrote the configuration; the window offers to update
	// hopsesh first, and setting the file aside only as a second, confirmed choice.
	ConfigNewer bool       `json:"configNewer,omitempty"`
	Agents      []AgentDTO `json:"agents"`
	// 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"
	// Terminal is the terminal app sessions open in, by name ("iTerm2"): the window says
	// "Open in iTerm2".
	Terminal string `json:"terminal"`
	// Where is where sessions resume and steps run: here (the hopsesh Terminal window),
	// terminal (the user's terminal app) or ask.
	Where       string `json:"where"`
	SkillState  string `json:"skillState"`  // across every agent: absent | current | stale | modified | foreign | broken
	SkillPrompt string `json:"skillPrompt"` // "declined" once the user said not now
	CLIOffer    bool   `json:"cliOffer"`    // offer to link the command-line tool
	// SetupDismissed: the user closed the "Finish setting up" line.
	SetupDismissed bool `json:"setupDismissed"`
	// Layout is the window's pane layout, restored before the first paint.
	Layout LayoutDTO `json:"layout"`
	// List is how the session list shows sessions.
	List ListDTO `json:"list"`
	// Places is where each agent's sessions resume, as last chosen (by agent id: here,
	// terminal or app); an agent not listed follows Where.
	Places map[string]string `json:"places"`
	// Previews: the inspector shows the end of a session's conversation.
	Previews bool `json:"previews"`
	Receive  bool `json:"receive"` // other machines' hopsesh may send sessions here
	Defaults struct {
		MovementNotices bool   `json:"movementNotices"`
		Original        string `json:"original"`
		SyncCode        bool   `json:"syncCode"`
		PushSource      bool   `json:"pushSource"`
	} `json:"defaults"`
}

Info is static information for the window.

type KeyLoginDTO

type KeyLoginDTO struct {
	PublicKey string `json:"publicKey"`
	Created   bool   `json:"created"`
	Added     bool   `json:"added"`
}

KeyLoginDTO is what SetupKeyLogin did.

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 LayoutDTO added in v0.4.0

type LayoutDTO struct {
	SidebarWidth    int      `json:"sidebarWidth"`
	SidebarHidden   bool     `json:"sidebarHidden"`
	InspectorWidth  int      `json:"inspectorWidth"`
	InspectorHidden bool     `json:"inspectorHidden"`
	SectionsOpen    []string `json:"sectionsOpen"`
	SectionsClosed  []string `json:"sectionsClosed"`
}

LayoutDTO is the panes' widths (CSS pixels; the inspector's 0 is its default, which follows the window's width) and whether the user hid them, and the inspector's sections the user opened or closed.

type ListDTO added in v0.4.0

type ListDTO struct {
	Decided          bool      `json:"decided"`
	GroupBy          string    `json:"groupBy"`
	SortBy           string    `json:"sortBy"`
	SortReverse      bool      `json:"sortReverse"`
	Density          string    `json:"density"`
	CollapseInactive bool      `json:"collapseInactive"`
	Collapsed        []string  `json:"collapsed"`
	Expanded         []string  `json:"expanded"`
	Filter           FilterDTO `json:"filter"`
}

ListDTO is the list's display. Decided is false until the app (on the first scan) or the user chose: the window then picks rows by how many sessions there are.

type LiveDTO added in v0.4.0

type LiveDTO struct {
	Live   bool       `json:"live"`
	Status string     `json:"status"` // the entry's state words, as in a scan
	Needs  bool       `json:"needs"`
	App    string     `json:"app,omitempty"`
	Name   string     `json:"name,omitempty"` // the name the running agent gives it
	Places []PlaceDTO `json:"places"`
}

LiveDTO is how a session on this machine runs now.

type MachineDTO

type MachineDTO struct {
	Phase                string    `json:"phase,omitempty"`
	CheckedAt            time.Time `json:"checkedAt,omitempty"`
	AccountSetupRequired bool      `json:"accountSetupRequired"` // reachable remote without a persistent endpoint identity
	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"`
	Agents               []string  `json:"agents"`     // "Claude Code 2.1.284"
	AgentNames           []string  `json:"agentNames"` // detected agents, without versions or duplicate profiles
	Hopsesh              string    `json:"hopsesh"`    // hopsesh's version there ("" when not installed)
}

MachineDTO summarises one scanned machine.

type MachineRow

type MachineRow struct {
	Name        string      `json:"name"`
	Destination string      `json:"destination"`
	OS          string      `json:"os"`
	Auth        string      `json:"auth"`     // key | password
	Keychain    bool        `json:"keychain"` // the password is remembered
	CanRemember bool        `json:"canRemember"`
	Scanned     bool        `json:"scanned"` // the last scan reached for it
	Scan        MachineScan `json:"scan"`
	Status      string      `json:"status"` // the last scan's (app.Status*)
	Hint        string      `json:"hint"`
	Error       string      `json:"error"`
	Agents      []string    `json:"agents"`
	Hopsesh     string      `json:"hopsesh"`
	Sessions    int         `json:"sessions"`
}

MachineRow is a machine you added: how hopsesh logs in, and what the last scan found.

type MachineScan added in v0.4.0

type MachineScan struct {
	Phase    string `json:"phase"` // queued, scanning, done
	Started  string `json:"started,omitempty"`
	Finished string `json:"finished,omitempty"`
	Error    string `json:"error,omitempty"`
}

MachineScan is separate from the last result: refreshing never erases what was previously found. Times are for presentation and scheduling, not transfer ordering.

type MachinesDTO

type MachinesDTO struct {
	DiscoveryError string       `json:"discoveryError,omitempty"`
	Here           HereDTO      `json:"here"`
	Machines       []MachineRow `json:"machines"`
	Found          []FoundRow   `json:"found"`
	// Clouds are the agents' clouds hopsesh can do something with, as the last scan found
	// them (nil before a scan).
	Clouds []CloudDTO `json:"clouds"`
}

MachinesDTO is the Machines screen.

type MirrorDTO added in v0.4.0

type MirrorDTO struct {
	Cloud string `json:"cloud"`
	URL   string `json:"url"`
	Host  string `json:"host"` // "claude.ai"
}

MirrorDTO is a local session's copy on the vendor's site (Remote Control).

type OpenedDTO added in v0.4.0

type OpenedDTO struct {
	// Where: here, terminal or shown.
	Where string `json:"where"`
	// Tab is the tab it runs in (here, shown).
	Tab string `json:"tab,omitempty"`
	// Notice says why it opened elsewhere than chosen ("Opened in Terminal instead: …").
	Notice string `json:"notice,omitempty"`
}

OpenedDTO says where an entry point opened.

type Option added in v0.4.1

type Option func(*App)

Option configures service behavior before any discovery starts.

func WithoutSessionWatching added in v0.4.1

func WithoutSessionWatching() Option

WithoutSessionWatching lets headless fixture services publish changes explicitly. Desktop applications watch local session files by default.

type OptsDTO

type OptsDTO struct {
	Bounded       bool   `json:"bounded"`
	NewReplica    bool   `json:"newReplica"`
	TargetProfile string `json:"targetProfile"`
	OperationID   string `json:"operationId"`
	TargetSession string `json:"targetSession"`
	TargetDir     string `json:"targetDir"`
	Clone         bool   `json:"clone"`
	ReposDir      string `json:"reposDir"`
	Worktree      string `json:"worktree"`
	Fork          bool   `json:"fork"`
	RemoteControl bool   `json:"remoteControl"`
	Notify        bool   `json:"notify"`
	Redact        bool   `json:"redact"`
	SyncCode      bool   `json:"syncCode"`
	Push          bool   `json:"push"`
	StopLocal     bool   `json:"stopLocal"`
	Conflict      string `json:"conflict"` // "", "replace" or "keep-both"
	App           bool   `json:"app"`
	// Continuing in another agent.
	Fidelity   string   `json:"fidelity"` // history | note
	Native     bool     `json:"native"`
	Note       string   `json:"note"`
	Go         bool     `json:"go"`
	CarryRules bool     `json:"carryRules"`
	RuleFiles  []string `json:"ruleFiles"`
	Via        string   `json:"via"` // "" or "import"
	// This transfer only: a lower context budget (0: the setting) and how older history
	// is carried ("": the setting).
	ContextBudget int    `json:"contextBudget"`
	Older         string `json:"older"`
	// Bringing a session from a cloud: the branch only; add its work to the session it was
	// handed off from.
	CodeOnly bool `json:"codeOnly"`
	Append   bool `json:"append"`
}

OptsDTO are the choices on the plan screen.

type PasswordRequest

type PasswordRequest struct {
	ID          string `json:"id"`
	Machine     string `json:"machine"`
	Destination string `json:"destination"`
	Retry       bool   `json:"retry"`       // the last password was refused
	CanRemember bool   `json:"canRemember"` // the Keychain is available
	Remember    bool   `json:"remember"`    // the machine is set to remember it
}

PasswordRequest asks the window for a machine's password.

type PastedDTO added in v0.4.0

type PastedDTO struct {
	Cloud string `json:"cloud"`
	Key   string `json:"key"`
}

PastedDTO is a pasted cloud link, now a row (machine and key as the row's).

type PlaceDTO added in v0.4.0

type PlaceDTO struct {
	Kind    string `json:"kind"`          // presence.Kind
	App     string `json:"app,omitempty"` // its name for people ("VS Code")
	Count   int    `json:"count"`
	Waiting bool   `json:"waiting,omitempty"`
}

PlaceDTO is one place a session on this machine is open in, besides the hopsesh Terminal window's tabs (the window knows those): a terminal app, the agent's desktop app, an editor, tmux or ssh.

type PlanDTO

type PlanDTO struct {
	EndDestinationToken string `json:"endDestinationToken,omitempty"`
	ReviewNewSession    bool   `json:"reviewNewSession,omitempty"`

	SourceEntry   *EntryDTO        `json:"sourceEntry,omitempty"`
	SourceProfile string           `json:"sourceProfile,omitempty"`
	TargetProfile string           `json:"targetProfile,omitempty"`
	NoWork        bool             `json:"noWork"`
	Destinations  []agent.Summary  `json:"destinations,omitempty"`
	Kind          string           `json:"kind"` // move | continue
	Title         string           `json:"title"`
	Agent         string           `json:"agent"`     // the agent it lands in
	FromAgent     string           `json:"fromAgent"` // the agent it comes from
	SourceHost    string           `json:"sourceHost"`
	SourceOS      string           `json:"sourceOs"`
	SourceCWD     string           `json:"sourceCwd"`
	TargetCWD     string           `json:"targetCwd"`
	Live          bool             `json:"live"`
	Repo          move.RepoPlan    `json:"repo"`
	Mappings      []agent.Mapping  `json:"mappings"`
	Files         int              `json:"files"`
	Bytes         int64            `json:"bytes"`
	Sync          string           `json:"sync"`
	FromSource    bool             `json:"syncFromSource"`
	Push          bool             `json:"push"`
	StopHere      bool             `json:"stopHere"`
	Conflict      string           `json:"conflict"`
	Warnings      []string         `json:"warnings"`
	Blockers      []string         `json:"blockers"`
	NewName       string           `json:"newName"`
	OtherAcct     bool             `json:"otherAccount"`
	Continue      *ContinueDTO     `json:"continue,omitempty"`
	NativeCopy    *move.NativeCopy `json:"nativeCopy,omitempty"`
	Can           CanDTO           `json:"can"`
	SetAside      int              `json:"setAside"`
	Options       move.Options     `json:"-"`
	SessionKey    agent.SessionKey `json:"-"`
	SourceAgent   agent.ID         `json:"sourceAgent"`
	Machine       string           `json:"machine,omitempty"` // a push: the machine it goes to
	Fetch         *move.FetchPlan  `json:"fetch,omitempty"`   // bringing it from a cloud
}

PlanDTO is a plan as the window shows it.

type PresenceDTO added in v0.4.0

type PresenceDTO struct {
	Entries map[string]LiveDTO `json:"entries"`
}

PresenceDTO is where this machine's sessions are open now, by machine + "\x00" + key. Other machines' sessions are read with their scans.

type PreviewDTO added in v0.4.0

type PreviewDTO struct {
	Items []PreviewItemDTO `json:"items"`
	More  bool             `json:"more"`            // earlier messages exist
	First *PreviewItemDTO  `json:"first,omitempty"` // the first real prompt
	// Note says why there is no preview ("Preview not available: laptop is slow to
	// answer"); "" when there is one.
	Note string `json:"note,omitempty"`
}

PreviewDTO is the end of a session's conversation for the inspector. Text is the agents' own words: the window shows it as text only.

type PreviewItemDTO added in v0.4.0

type PreviewItemDTO struct {
	Role string `json:"role"` // user | agent | tools | compacted
	Text string `json:"text"`
	Time string `json:"time,omitempty"` // RFC 3339
}

PreviewItemDTO is one message, one turn's tool calls in words, or a compaction.

type QuickDTO added in v0.4.0

type QuickDTO struct {
	Agents     []AgentDTO    `json:"agents"`
	Presence   *PresenceDTO  `json:"presence"`
	Scan       *ScanDTO      `json:"scan"`
	Tabs       []TermTab     `json:"tabs"`
	Desktop    desktop.State `json:"desktop"`
	OS         string        `json:"os"`
	Refreshing bool          `json:"refreshing"`
	Error      string        `json:"error,omitempty"`
}

type QuickRoute added in v0.4.0

type QuickRoute struct {
	Screen  string `json:"screen"`
	Machine string `json:"machine"`
	Key     string `json:"key"`
}

type ScanDTO

type ScanDTO struct {
	Revision      uint64       `json:"revision"`
	Cached        bool         `json:"cached,omitempty"`
	Discovering   bool         `json:"discovering,omitempty"`
	Machines      []MachineDTO `json:"machines"`
	Groups        []GroupDTO   `json:"groups"`
	ProfileCopies []GroupDTO   `json:"profileCopies,omitempty"` // other native copies when grouped by account
	Total         int          `json:"total"`
	Peers         []string     `json:"peers"`   // reached machines with hopsesh, a session here can be sent to
	Updated       string       `json:"updated"` // when the scan finished (RFC 3339)
	// Elsewhere is when the other machines and the clouds were last read (RFC 3339): the
	// same as Updated, unless only this machine was read since (RefreshHere).
	Elsewhere string     `json:"elsewhere"`
	Clouds    []CloudDTO `json:"clouds"` // the clouds hopsesh can do something with
	// Adopted are copies brought from a cloud that this scan picked up.
	Adopted []BroughtDTO `json:"adopted"`
}

ScanDTO is the result of a scan.

type SettingsDTO

type SettingsDTO struct {
	Appearance       string                   `json:"appearance"`
	NoticeHooks      []app.MovementHookStatus `json:"noticeHooks"`
	NoticeHooksError string                   `json:"noticeHooksError,omitempty"`
	MovementNotices  bool                     `json:"movementNotices"` // the original is protected (block or advise)
	Original         string                   `json:"original"`        // block | advise | off
	Version          string                   `json:"version"`
	ReposDir         string                   `json:"reposDir"`
	Layout           string                   `json:"layout"` // flat | ghq
	SyncCode         bool                     `json:"syncCode"`
	PushSource       bool                     `json:"pushSource"`
	UpdateChk        string                   `json:"updateCheck"`
	AppIcons         bool                     `json:"appIcons"` // installed desktop apps' icons picture the agents
	Previews         bool                     `json:"previews"` // the inspector shows the end of a conversation
	Agents           []AgentDTO               `json:"agents"`

	CLI         integrate.CLIStatus `json:"cli"`
	CLIReady    bool                `json:"cliReady"` // the skill and hooks can run hopsesh
	Skill       app.SkillReport     `json:"skill"`
	SkillBin    string              `json:"skillBin"`
	SkillPrompt string              `json:"skillPrompt"`

	LocalNetworkGated bool   `json:"localNetworkGated"`
	ConfigDir         string `json:"configDir"`
	StateDir          string `json:"stateDir"`
}

SettingsDTO is everything the Settings screen shows.

type SettingsInput

type SettingsInput struct {
	// Nil preserves the current choice for callers changing unrelated settings.
	Appearance *string `json:"appearance,omitempty"`
	Original   string  `json:"original"` // block | advise | off ("" keeps the current choice)
	Layout     string  `json:"layout"`
	SyncCode   bool    `json:"syncCode"`
	PushSource bool    `json:"pushSource"`
	UpdateChk  string  `json:"updateCheck"`
	AppIcons   bool    `json:"appIcons"`
	Previews   bool    `json:"previews"`
}

SettingsInput are the settings the user can change.

type SignedInDTO added in v0.4.0

type SignedInDTO struct {
	Cloud  string        `json:"cloud"`
	Title  string        `json:"title"`
	Driver string        `json:"driver"`
	Test   *CloudTestDTO `json:"test"`
}

SignedInDTO is a sign-in tab's end: the login checked again (the card's Test).

type TabDTO added in v0.4.0

type TabDTO struct {
	Terminal string `json:"terminal"` // its name: "iTerm2"
}

TabDTO is where a running session's tab is: the terminal that has it.

type TabMeta added in v0.4.0

type TabMeta struct {
	LaunchedKey  string            `json:"launchedKey,omitempty"`
	Relationship *app.Relationship `json:"relationship,omitempty"`
	Account      string            `json:"account,omitempty"`
	Association  string            `json:"association,omitempty"`
	Kind         string            `json:"kind"`
	// Command is the program and its arguments, for people.
	Command string `json:"command"`
	// Agent names whose program it is ("Claude Code"; "" for a shell).
	Agent string `json:"agent,omitempty"`
	// Machine and Key are a session tab's row (or a bring-back's copy, once known).
	Machine string `json:"machine,omitempty"`
	Key     string `json:"key,omitempty"`
	// Cloud and CloudTitle are a step's, a bring-back's or a sign-in's cloud.
	Cloud      string `json:"cloud,omitempty"`
	CloudTitle string `json:"cloudTitle,omitempty"`
	// Journal is a bring-back's journal id (its done screen asks AdoptStatus by it).
	Journal string `json:"journal,omitempty"`
	// Saved is the title of the copy a bring-back saved here while its tab still runs it
	// (Machine and Key are then that copy's: the tab is the session's).
	Saved string `json:"saved,omitempty"`
	// Link is a step's session link, once the module's reader found it after the step
	// ended.
	Link string `json:"link,omitempty"`
	// External: the tab offers "Open in my terminal" (end it here and run the same command
	// in the user's terminal app).
	External bool `json:"external"`
	// Rerun: the tab offers "Run again" once its program ended.
	Rerun bool `json:"rerun"`
}

TabMeta is what the app knows about a tab besides its program's state.

type TabSetup added in v0.4.0

type TabSetup struct {
	Meta TabMeta
	// External ends tab id and runs its command in the user's terminal app (nil: the tab
	// does not offer it); Exited is told once that its program ended.
	External func(id string) error
	Exited   func(pty.Info)
	// Background opens the tab without bringing the window forward: it comes forward when
	// it waits for the user or fails (a hand-off's step, which may need nobody).
	Background bool
}

TabSetup is what an entry point opens a tab with, besides the program.

type TermPrefs added in v0.4.0

type TermPrefs struct {
	Collapsed    []string `json:"collapsed"`
	Placement    string   `json:"placement"`
	Grouping     string   `json:"grouping"`
	Appearance   string   `json:"appearance"`
	Font         string   `json:"font"`
	FontSize     int      `json:"fontSize"`
	Scrollback   int      `json:"scrollback"`
	ScreenReader bool     `json:"screenReader"`
	OS           string   `json:"os"`
	// Home is the home folder (the window shortens paths under it to ~); TerminalName is
	// the user's terminal app ("iTerm2"), for "Open in my terminal".
	Home         string `json:"home"`
	TerminalName string `json:"terminalName"`
}

TermPrefs are the terminal window's settings, sent with the list of tabs.

type TermTab added in v0.4.0

type TermTab struct {
	pty.Info
	TabMeta
	// Attention: the tab waits for the user (a bell or a notification from its program, a
	// step that asks or stays quiet, a bring-back until it ends); it counts in "Needs you".
	Attention bool `json:"attention"`
}

TermTab is a tab as the windows show it.

type TerminalAppNotice added in v0.4.0

type TerminalAppNotice struct {
	Terminal string `json:"terminal"`
	Message  string `json:"message"`
}

TerminalAppNotice is a TerminalAppEvent: where it opened, and why not in the chosen one.

type TerminalAppsDTO added in v0.4.0

type TerminalAppsDTO struct {
	Apps   []termapp.Info `json:"apps"`
	App    string         `json:"app"`    // configured ("" automatic)
	Using  string         `json:"using"`  // the id launches open in now
	Name   string         `json:"name"`   // its name: "iTerm2"
	Resume string         `json:"resume"` // here | terminal | ask
}

TerminalAppsDTO is the terminal settings: the apps hopsesh can open launches in, the chosen one (and the one used, when that is not installed), and where sessions resume.

type TerminalSettingsDTO added in v0.4.0

type TerminalSettingsDTO struct {
	Placement string `json:"placement"`
	Grouping  string `json:"grouping"`
	TerminalAppsDTO
	// Where is where sessions resume and steps run: here or terminal (the setting, or its
	// default; the command line's "ask" is the default here).
	Where        string `json:"where"`
	Default      string `json:"default"` // config.AppResumeDefault
	Font         string `json:"font"`
	FontSize     int    `json:"fontSize"`
	Scrollback   int    `json:"scrollback"`
	Scrollbacks  []int  `json:"scrollbacks"`
	KeepTabs     bool   `json:"keepTabs"`
	Notify       bool   `json:"notify"`
	CloseEnded   bool   `json:"closeEnded"`   // a tab closes once its program ended well
	ScreenReader string `json:"screenReader"` // "" automatic, on, off
	// SystemConsole (Windows): tabs use the system's pseudoconsole.
	SystemConsole bool `json:"systemConsole"`
	// Bundled: this app carries Microsoft's newer console host (Windows).
	Bundled bool `json:"bundled"`
}

TerminalSettingsDTO is Settings → Terminal: where steps and resumes open, the user's terminal app, and the hopsesh Terminal window's look and behaviour.

type TerminalSettingsInput added in v0.4.0

type TerminalSettingsInput struct {
	Grouping      string `json:"grouping"`
	App           string `json:"app"`
	Where         string `json:"where"`
	Font          string `json:"font"`
	FontSize      int    `json:"fontSize"`
	Scrollback    int    `json:"scrollback"`
	KeepTabs      bool   `json:"keepTabs"`
	Notify        bool   `json:"notify"`
	CloseEnded    bool   `json:"closeEnded"`
	ScreenReader  string `json:"screenReader"`
	SystemConsole bool   `json:"systemConsole"`
}

TerminalSettingsInput are the settings the user can change in Settings → Terminal.

type TerminalWorkspaceDTO added in v0.4.0

type TerminalWorkspaceDTO struct {
	URL       string `json:"url"`
	Placement string `json:"placement"`
}

type Terminals added in v0.4.0

type Terminals struct {
	SavePlacement func(string) error
	SaveGrouping  func(string, string, *bool) error

	// Prefs are the window's settings (nil: defaults); SavePrefs stores what the window
	// changed (a font size, the screen reader mode; nil: unchanged); Shell opens a shell
	// tab in a folder ("" home) for the window's "+"; NotifyOn says whether desktop
	// notifications are on. The App sets them.
	Prefs     func() TermPrefs
	SavePrefs func(fontSize int, reader *bool)
	Shell     func(dir string) error
	NotifyOn  func() bool
	// RaiseMain uses the desktop shell's readiness guard when it is attached.
	RaiseMain func()
	// AutoClose says whether a tab closes once its program ended well (Settings →
	// Terminal; nil: on).
	AutoClose func() bool
	// Emit sends the app's window an event (the App's emit).
	Emit func(name string, data any)
	// contains filtered or unexported fields
}

Terminals holds the app's terminal tabs and their window.

func NewTerminals added in v0.4.0

func NewTerminals(version string) *Terminals

NewTerminals is the app's tabs; version is hopsesh's.

func (*Terminals) Attach added in v0.4.0

func (t *Terminals) Attach(app *application.App)

Attach connects the tabs to the running app: its streams, and its window events.

func (*Terminals) CloseAll added in v0.4.0

func (t *Terminals) CloseAll()

CloseAll ends every tab (the app is quitting).

func (*Terminals) Focus added in v0.4.0

func (t *Terminals) Focus(id string)

Focus shows the terminal window with tab id in front.

func (*Terminals) Gate added in v0.4.0

func (t *Terminals) Gate(next http.Handler) http.Handler

Gate is the asset middleware that isolates terminal windows (see the top of this file): requests from the app's own windows pass; any other window gets only what the terminal page needs, and its page a strict content security policy.

func (*Terminals) Manager added in v0.4.0

func (t *Terminals) Manager() *pty.Manager

Manager is the tabs' manager.

func (*Terminals) Open added in v0.4.0

func (t *Terminals) Open(spec pty.Spec, setup TabSetup) (pty.Info, error)

Open opens a tab running spec's program, for what setup says, and shows it in the terminal window. Only hopsesh's own Go code calls it, with a program it chose, never with one a window sent: Terminals is not bound to the window.

func (*Terminals) Privileged added in v0.4.0

func (t *Terminals) Privileged(w *application.WebviewWindow)

Privileged marks a window as the app's own (its requests pass Gate); the first is the main window, which notifications and the terminal window's "back to sessions" raise.

func (*Terminals) Refresh added in v0.4.0

func (t *Terminals) Refresh()

Refresh sends both views their committed terminal preferences.

func (*Terminals) ServeList added in v0.4.0

func (t *Terminals) ServeList(c pty.Conn)

ServeList serves one TerminalTabsStream connection known to come from the terminal window: the tabs and settings now and on every change, and the window's requests.

func (*Terminals) ServeTab added in v0.4.0

func (t *Terminals) ServeTab(c pty.Conn)

ServeTab serves one TerminalStream connection that is known to come from the terminal window (the app checks the window first; the browser tests have only that page).

func (*Terminals) Show added in v0.4.0

func (t *Terminals) Show()

Show opens the terminal window, or brings it to the front.

func (*Terminals) ShowMain added in v0.4.0

func (t *Terminals) ShowMain()

ShowMain brings the app's window to the front.

func (*Terminals) Tabs added in v0.4.0

func (t *Terminals) Tabs() []TermTab

Tabs are the open tabs, oldest first.

func (*Terminals) Toggle added in v0.4.0

func (t *Terminals) Toggle()

Toggle is Ctrl+`: from the terminal window back to the app's window, from anywhere else to the terminal window.

func (*Terminals) WindowOpen added in v0.4.0

func (t *Terminals) WindowOpen() bool

WindowOpen reports whether the terminal window is open.

type UpdateDTO

type UpdateDTO struct {
	Latest string `json:"latest"`
	Newer  bool   `json:"newer"`
	URL    string `json:"url"`
	// CanInstall: this app can install the update itself (a release build, not managed by
	// a package manager); otherwise the window offers the release page.
	CanInstall bool `json:"canInstall"`
}

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