state

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package state records which AI integrations the CLI has installed so that `ai list --installed` can report them. This package defines the on-disk file format and the read path; writing the file is added by #1337. Until then the file does not exist and Read returns an empty state.

Index

Constants

View Source
const FileVersion = 1

FileVersion is the install-state file format version. It is a major-only integer, like the manifest: bump it only on a breaking change to the file shape.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Version   int              `json:"version"`
	Installed []InstalledEntry `json:"installed"`
}

File is the on-disk install-state document.

func Read

func Read() (File, error)

Read loads the install-state file. A missing file is not an error: it returns an empty state, which is the expected situation until #1337 writes the file.

type InstalledEntry

type InstalledEntry struct {
	Name             string `json:"name"`
	Client           string `json:"client"`
	Scope            Scope  `json:"scope"`
	RequestedTag     string `json:"requestedTag"`
	ResolvedRevision string `json:"resolvedRevision"`
}

InstalledEntry records a single CLI-managed installation. The field names are a public contract (camelCase), reported by `ai list --installed` and `ai info`. #1337 fills these when it installs a skill.

type Scope

type Scope string

Scope is where an integration is installed.

const (
	ScopeProject Scope = "project"
	ScopeGlobal  Scope = "global"
)

Jump to

Keyboard shortcuts

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