remote

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 7 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 remote holds hopsesh's remote-behaviour scenarios: hopsesh here working with another machine over real SSH as it is, with no hopsesh, with hopsesh set up but nobody logged in, with hopsesh in the login session, with an older hopsesh, and unreachable. The other machine is a throwaway user of the same machine (scripts/remote-scenarios.sh sets it up); the scenarios run only when HOPSESH_REMOTE_SCENARIOS=1, so `go test ./...` stays hermetic. This file has the helpers, which are tested without SSH.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClaudeSession

func ClaudeSession(id, cwd, title string) []byte

ClaudeSession is a small Claude Code transcript (the fixtures' version) for id in cwd.

func ClaudeSlug

func ClaudeSlug(dir string) string

ClaudeSlug is the folder Claude Code keeps a working folder's transcripts in.

func Crashed

func Crashed(out string) bool

Crashed reports whether a command's output shows a Go panic or a fatal runtime error.

func KeptEndpointPath

func KeptEndpointPath(stateDir, machine string) string

KeptEndpointPath is where hopsesh here keeps the identity of a machine without hopsesh (internal/app/endpoint_keeper.go): one file per configured machine name.

func Lookup

func Lookup(doc []byte, path string) (any, bool)

Lookup follows a dotted path ("plan.unprotected") through a JSON document; ok is false when a step is missing.

func ShQuote

func ShQuote(s string) string

ShQuote quotes s for a POSIX shell.

func ValidEndpoint

func ValidEndpoint(s string) bool

ValidEndpoint reports whether s is a persistent endpoint identity (32 bytes in hex).

Types

type Check

type Check struct {
	Name   string `json:"name"`
	OK     bool   `json:"ok"`
	Detail string `json:"detail"`
}

Check is one line of `hopsesh doctor --json`.

func FindCheck

func FindCheck(doctor []byte, name string) (Check, error)

FindCheck returns the doctor check named name.

type Machine

type Machine struct {
	Name        string `json:"name"`
	Local       bool   `json:"local"`
	Status      string `json:"status"`
	Error       string `json:"error"`
	Hint        string `json:"hint"`
	Hopsesh     string `json:"hopsesh"`
	Presence    string `json:"presence"`
	PresenceWhy string `json:"presenceWhy"`
}

Machine is a machine of `hopsesh ls --json` (the fields the scenarios check).

func FindMachine

func FindMachine(ls []byte, name string) (Machine, error)

FindMachine returns the machine named name in `hopsesh ls --json` output.

type Status added in v0.6.2

type Status struct {
	Machine   string      `json:"machine"`
	Version   string      `json:"version"`
	Reach     StatusCheck `json:"reach"`
	Hopsesh   StatusCheck `json:"hopsesh"`
	Login     StatusCheck `json:"login"`
	Receiving StatusCheck `json:"receiving"`
	CLI       StatusCheck `json:"cli"`
	Agents    []struct {
		Agent string      `json:"agent"`
		Hook  StatusCheck `json:"hook"`
		Skill StatusCheck `json:"skill"`
	} `json:"agents"`
	Todo int `json:"todo"`
}

Status is one machine of `hopsesh hosts status --json`, as far as the scenarios read it.

func FindStatus added in v0.6.2

func FindStatus(doc []byte, name string) (Status, error)

FindStatus is the machine called name in `hosts status --json`.

type StatusCheck added in v0.6.2

type StatusCheck struct {
	State  string `json:"state"`
	Text   string `json:"text"`
	Reason string `json:"reason"`
	Fix    string `json:"fix"`
}

StatusCheck is one check of a machine.

Jump to

Keyboard shortcuts

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