readiness

package
v0.185.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 4 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 readiness answers "can this computer run agents yet, and if not, what is the next step?" — the setup checklist of Settings → Computers, Home, `caprock setup`, and the readiness a linked laptop reads through `/v1/m/{id}/v1/setup` (GET /v1/setup, ADR-099).

The owner's first two-computer test (a MacBook driving a Windows PC, 2026-11-20) found a PC without Git and Claude Code that nothing on either screen mentioned, and a laptop that showed the PC linked without saying whether it could do anything. Five items cover the path from a fresh install to "start agents from your laptop": Git, an agent, its sign-in, a project, the link. Each says in a sentence what to do, and the installs and sign-ins carry the command that does it — typed into a shell tab for the user to run, never run by Caprock (ADR-046).

Build is pure: the daemon gathers the facts (files, PATH, the pairing state) and Build words them, so every wording is tested on every OS.

Index

Constants

View Source
const (
	// OK: done.
	OK = "ok"
	// Missing: not done; Detail says what to do, Command does it when there
	// is one command for it.
	Missing = "missing"
	// Unknown: Caprock cannot tell from what it may read (Codex keeping its
	// sign-in in the system keyring). Offered, never ticked.
	Unknown = "unknown"
	// NotNeeded: does not apply on this computer. A client treats it as done.
	NotNeeded = "not_needed"
)

The states of an item.

View Source
const (
	KeyGit     = "git"
	KeyAgent   = "agent"
	KeySignIn  = "signin"
	KeyProject = "project"
	KeyLink    = "link"
)

The items, in the checklist's order.

Variables

This section is empty.

Functions

func GitInstall

func GitInstall(goos string) string

GitInstall is the command that installs Git, "" where there is no single one (Linux: the distribution's package manager).

  • Windows: winget's Git for Windows package (Git.Git), the install Claude Code's setup page points at (code.claude.com/docs/en/setup, read 2026-11-20). It asks for an administrator once.
  • macOS: the Command Line Tools, which carry Git; macOS opens its own installer window.

Types

type Agent

type Agent struct {
	ID        string // "claude", "codex"
	Label     string // "Claude Code", "Codex"
	Installed bool
	// Install is the catalog's install command (ADR-046).
	Install string
	// SignIn is OK, Missing or Unknown.
	SignIn string
	// SignInCommand is the agent's own sign-in.
	SignInCommand string
}

Agent is one agent that can run here: Claude Code or Codex.

type Git

type Git struct {
	Found bool
	// Fresh is false when the user's current PATH could not be read, so a Git
	// installed after Caprock started may not be seen until it restarts.
	Fresh bool
}

Git is what was found of Git.

type GitFinder

type GitFinder struct {
	GOOS string
	// Dirs is the user's PATH as it is now (userenv.CurrentPath), split.
	Dirs []string
	// Env reads a variable (ProgramFiles, LOCALAPPDATA on Windows).
	Env func(string) string
	// IsFile reports whether a path is a regular file. Swapped by tests.
	IsFile func(string) bool
}

GitFinder looks for Git without running it. Running `git --version` on a Mac without the Command Line Tools would open Apple's install dialog from a daemon on a timer, so the answer is read from the file system only.

func (GitFinder) Found

func (f GitFinder) Found() bool

Found reports whether Git is installed.

type Inputs

type Inputs struct {
	GOOS     string
	Git      Git
	Agents   []Agent
	Projects int
	Link     Link
}

Inputs are the facts Build words.

type Item

type Item struct {
	Key    string `json:"key"`
	State  string `json:"state"`
	Label  string `json:"label"`
	Detail string `json:"detail"`
	// Command fixes it in a terminal: typed into a shell tab, or printed by
	// `caprock setup`, never run by Caprock. The link's is a caprock command
	// for a computer reached over SSH; its screen has its own buttons.
	Command string `json:"command,omitempty"`
}

Item is one line of the checklist.

type Link struct {
	// Supported is false in a build that cannot be reached through a relay.
	Supported bool
	// On: access from anywhere is on.
	On bool
	// Allowed are the computers allowed here, by name; Waiting those that
	// redeemed a link and wait for Allow.
	Allowed []string
	Waiting []string
}

Link is how this computer stands with the computers that reach it.

type Report

type Report struct {
	OS    string `json:"os"`
	Items []Item `json:"items"`
}

Report is GET /v1/setup.

func Build

func Build(in Inputs) Report

Build words the checklist.

func (Report) Ready

func (r Report) Ready() bool

Ready reports whether nothing is left to do.

Jump to

Keyboard shortcuts

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