remote

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package remote mirrors agent session directories from SSH-reachable machines into a local cache, so the regular sources can parse them as if they were local. Transport is plain `ssh <host> tar` — nothing has to be installed on the remote side.

Index

Constants

This section is empty.

Variables

View Source
var AgentDirs = []string{
	".claude/projects",
	".codex/sessions",
	".cursor/chats",
	".opencode",
	".local/share/opencode",
	".gemini",
	".qwen",
	".iflow",
	".qoder",
	".aider.chat.history.md",
	".local/share/mimocode",
	".kimi-code",
}

AgentDirs are the session directories mirrored from the remote $HOME. Keep in sync with the source packages — each entry is a path relative to the remote user's home, and the local mirror preserves the exact layout so each source's New(<mirrorDir>) still finds the files where it expects them. Aider's whole history is a single flat file rather than a tree, so it's listed verbatim instead of as a directory; tar treats the two cases identically.

NOTE: missing directories on the remote are silently skipped (see remoteScript), so listing an agent the user hasn't installed costs nothing — keep this list permissive.

Functions

func HostDir

func HostDir(tapeDir, host string) string

HostDir returns the mirror directory for host under tapeDir.

func WrapSource

func WrapSource(src ports.Source, host string) ports.Source

WrapSource marks every session loaded from a mirrored source with the host it came from (session meta "host", title suffix in summaries comes for free via meta). IDs stay globally unique because session uuids are.

Types

type Mirror

type Mirror struct {
	Host string // ssh destination: host, user@host, or an ssh_config alias
	Dir  string // local mirror root; remote $HOME layout is preserved
}

Mirror pulls session files from one remote host into Dir.

func (*Mirror) Pull

func (m *Mirror) Pull(ctx context.Context) error

Pull fetches new/changed session files from the remote. The first pull is full; later pulls only transfer files modified since the last one (with one hour of slack — the archive's checksums make re-transfers harmless).

Jump to

Keyboard shortcuts

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