Help us shape the future of Go! Take the 2026 Go Developer Survey

state

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package state is the snapshot file a running console leaves behind so an agent can read the same facts without sampling again.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path() string

Path is $XDG_STATE_HOME/matchblox/state.json, defaulting to ~/.local/state.

func Write

func Write(path string, doc Doc) error

Write replaces the file atomically so a reader never sees half a snapshot.

Types

type Doc

type Doc struct {
	sample.Snapshot
	Git             *gitscan.Report `json:"git,omitempty"`
	Recommendations []advice.Rec    `json:"recommendations"`
	Queue           []queue.Item    `json:"queue"`
	// Doors are the setup steps of the machine; the console shows the open ones.
	Doors []doors.Door `json:"doors,omitempty"`
	// Stoker is the stoker mode and the steps of its last run. Nil: the
	// service keeps no stoker.
	Stoker *stoker.View `json:"stoker,omitempty"`
	// Ships are the pull requests sessions drive. Nil: the service reads
	// none (no git, or a fixture).
	Ships *ships.Report `json:"ships,omitempty"`
	// Holds are the sessions nothing types into: parked, or held by the stoker.
	Holds []holds.Hold `json:"holds,omitempty"`
	// Reasons say why each quiet session is idle, by its pane.
	Reasons map[string]idle.Reason `json:"reasons,omitempty"`
	// StokerServer is the tmux server (-L) matchblox keeps the stoker
	// agent on: a session whose pane is on it is the stoker's. Empty: none.
	StokerServer string `json:"stoker_server,omitempty"`
	// Agents are the agents a new session can start on this host: the
	// installed ones of claude, codex, opencode and cursor-agent.
	Agents []string `json:"agents,omitempty"`
	// Renames are the names sessions take at their next rest, by pane.
	Renames map[string]string `json:"renames,omitempty"`
}

Doc is everything the console knows at one moment.

func Read

func Read(path string) (Doc, error)

Jump to

Keyboard shortcuts

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