meshpaths

package
v0.10.22 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package meshpaths is the SSOT for the mesh wake-watcher's on-disk state: which directory it lives in, and what each per-agent file is called.

Before it existed there were four independent opinions — two of mira's watcher scripts, workhorse's, and doctor's checker — aligned only by comments asserting agreement. One of those comments ("matches vaultmind doctor's xdg.ConfigFile path") was false on darwin for months, which is how a watcher dead for seven days reported as "not found": the checker was reading a directory nothing writes to.

The directory is xdg.ConfigDir(), which since the 2026-08-23 configBase fix resolves to ${XDG_CONFIG_HOME:-~/.config}/vaultmind on every Unix platform — the same expression the shell scripts have always used, now agreed on by mechanism (TestDir_MatchesTheShellDerivation) rather than by comment. $VAULTMIND_MESH_DIR overrides outright.

Index

Constants

View Source
const (
	// ListenFilename is the shared listen-control file. Deliberately NOT
	// slug-suffixed: it is one SSOT for every agent on the machine, with
	// per-agent sections inside it.
	ListenFilename = "mesh-listen.json"

	// RegistryFilename is chat-mcp's identity registry (slug → project path).
	// Written by a peer tool we do not own; named here so nothing else spells it.
	RegistryFilename = "agents.yaml"
)

Variables

View Source
var ErrNoSlug = errors.New("meshpaths: no agent slug — cannot derive per-agent mesh paths")

ErrNoSlug means the per-agent paths cannot be derived. A path built from an empty slug would be a real file ("mesh-watch-.heartbeat") that a checker would then report on as if it meant something.

Functions

func Dir

func Dir() (string, error)

Dir returns the mesh state directory: $VAULTMIND_MESH_DIR, else xdg.ConfigDir() (${XDG_CONFIG_HOME:-~/.config}/vaultmind on Unix).

func Heartbeat

func Heartbeat(slug string) (string, error)

Heartbeat is the one-path convenience used by doctor's default.

Types

type Paths

type Paths struct {
	Slug      string
	Dir       string
	Heartbeat string
	Pid       string
	Lastwake  string
	Lastarm   string
	Disarm    string
	Log       string
	Listen    string
	Registry  string
}

Paths is every mesh state path for one agent.

func For

func For(slug string) (Paths, error)

For derives every per-agent path from the slug. ErrNoSlug on "".

Jump to

Keyboard shortcuts

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