caps

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 25 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 caps is the one list of what each atc feature needs. Settings, `atc doctor` and first run all read it. A check really probes the thing, with a short timeout, and says in plain words how it stands.

Index

Constants

View Source
const (
	Core      = "Core"
	Assistant = "Assistant"
	Calls     = "Calls"
	Phone     = "Phone"
	Agents    = "Agents"
	Machines  = "Machines"
	Browser   = "Browser"
	Models    = "Other models"
	Summaries = "Summaries"
	WhatsApp  = "WhatsApp"
)
View Source
const MinClaude = "2.1.139"

MinClaude is the first Claude Code with background sessions and `claude agents` (its changelog, "Added agent view"); atc is built on them. There is no upper bound.

View Source
const Timeout = 8 * time.Second

Timeout bounds one check, so the list never waits longer than this for anything.

Variables

Groups is the order they are shown in.

Functions

func GuideName

func GuideName(guide string) string

GuideName is a guide's title, from its anchor or its page.

func GuideURL

func GuideURL(guide string) string

A guide is a page in docs/ with an optional anchor: "install#requirements" or "calls". docs_test.go checks each exists.

func SignedIn added in v0.1.1

func SignedIn(ctx context.Context, bin string) bool

SignedIn says whether the Claude Code at bin has a sign-in.

Types

type AgentFolder

type AgentFolder struct {
	Name, Dir string
	Scheduled bool
}

type Cap

type Cap struct {
	ID, Title, Group, Why string
	Optional              bool
	Needs                 []string
	Fields                []Field
	Fix                   Fix
	Cost                  string
	Check                 func(context.Context, Env) Result
}

Cap is one row. Without a Check it stands exactly as well as what it Needs.

func All

func All() []Cap

All is the registry.

type Engine

type Engine struct{ Name, URL string }

type Env

type Env struct {
	Get     func(key string) string
	Source  func(key string) string
	Bin     string
	Self    string
	Devices []string
	Peers   []Peer
	Engines []Engine
	Agents  []AgentFolder
}

Env is what a check looks at, the same whether the server or a lone `atc doctor` runs it.

type Field

type Field struct {
	Key    string `json:"key"`
	Label  string `json:"label"`
	Hint   string `json:"hint,omitempty"`
	Secret bool   `json:"secret,omitempty"`
	URL    bool   `json:"url,omitempty"`
	Hub    bool   `json:"-"`
	// Options makes it a choice, by value; the first is what empty means.
	Options []string `json:"options,omitempty"`
}

Field is a setting a feature reads, which the user can fill in from Settings. Hub says the hub process reads it too.

func FieldOf

func FieldOf(key string) (Field, bool)

FieldOf finds a setting in the registry, which is also the list of what Settings may write.

type FieldState

type FieldState struct {
	Field
	Value  string `json:"value,omitempty"`
	Set    bool   `json:"set,omitempty"`
	Source string `json:"source,omitempty"`
}

type Fix

type Fix struct {
	Command string `json:"command,omitempty"`
	Text    string `json:"text,omitempty"`
	Guide   string `json:"-"`

	GuideURL  string `json:"guideUrl,omitempty"`
	GuideName string `json:"guideName,omitempty"`
}

Fix is how to get a feature working: a command to copy, plain words, and the docs page with the rest. GuideURL and GuideName are filled in for clients.

type Need

type Need struct {
	ID     string `json:"id"`
	Title  string `json:"title"`
	Status Status `json:"status"`
}

type Peer

type Peer struct{ Name, URL, Token string }

type Result

type Result struct {
	Status Status
	Detail string
}

type Row

type Row struct {
	ID       string       `json:"id"`
	Title    string       `json:"title"`
	Group    string       `json:"group"`
	Why      string       `json:"why,omitempty"`
	Optional bool         `json:"optional,omitempty"`
	Status   Status       `json:"status"`
	Detail   string       `json:"detail"`
	Warn     bool         `json:"warn,omitempty"`
	Needs    []Need       `json:"needs,omitempty"`
	Fields   []FieldState `json:"fields,omitempty"`
	Fix      Fix          `json:"fix"`
	Cost     string       `json:"cost,omitempty"`
	Setup    string       `json:"setup,omitempty"`
}

Row is a Cap with how it stands now. Warn is what deserves attention: something required that is not ok, or something set up that stopped working. Optional and never set up is quiet.

func Failing

func Failing(rows []Row) []Row

Failing is what makes `atc doctor` exit 1.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner runs checks concurrently and keeps their results briefly; the zero value is ready.

func (*Runner) Forget

func (rn *Runner) Forget()

Forget drops the cached results, after a setting changed.

func (*Runner) Rows

func (rn *Runner) Rows(ctx context.Context, env Env, pick func(Cap) bool) []Row

Rows runs the picked caps, all of them when pick is nil.

func (*Runner) Test

func (rn *Runner) Test(ctx context.Context, env Env, id string, values map[string]string) (Row, bool)

Test runs one cap now, ignoring what is cached. With values it tries those in place of the settings and leaves no trace of them; without, its result replaces the cached one.

type Status

type Status string
const (
	OK      Status = "ok"
	Missing Status = "missing"
	Broken  Status = "broken"
)

Jump to

Keyboard shortcuts

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