Documentation
¶
Overview ¶
Package capabilities is the source of truth for which graith capabilities each frontend surface (CLI, iOS, macOS) supports.
The manifest lives in capabilities.json and is embedded here. The docs page at website/content/docs/capabilities.md renders a table from this manifest inside a generated region; TestDocMatchesManifest fails if the two drift apart, so the doc can never silently disagree with the manifest. Regenerate the doc with `go test ./internal/capabilities -run TestDocMatchesManifest -update`.
Index ¶
- Constants
- func ExtractRegion(doc string) (string, error)
- type Capability
- type GUICapability
- type GUIFixture
- type Manifest
- func (m *Manifest) Categories() []string
- func (m *Manifest) Coverage() map[string]map[string]int
- func (m *Manifest) GUIFixture() GUIFixture
- func (m *Manifest) MarshalGUIFixture() ([]byte, error)
- func (m *Manifest) MatrixMarkdown() string
- func (m *Manifest) ReplaceRegion(doc string) (string, error)
- func (m *Manifest) StateIDs() []string
- func (m *Manifest) SurfaceIDs() []string
- func (m *Manifest) Validate() error
- type State
- type Surface
Constants ¶
const ( BeginMarker = "<!-- BEGIN GENERATED CAPABILITY MATRIX -->" EndMarker = "<!-- END GENERATED CAPABILITY MATRIX -->" )
Markers bracket the generated matrix region in the docs page. Everything between them is owned by the generator; prose outside them is hand-written and preserved.
Variables ¶
This section is empty.
Functions ¶
func ExtractRegion ¶
ExtractRegion returns the trimmed content between the two markers.
Types ¶
type Capability ¶
type Capability struct {
ID string `json:"id"`
Category string `json:"category"`
Name string `json:"name"`
CLI string `json:"cli"`
IOS string `json:"ios"`
MacOS string `json:"macos"`
Notes string `json:"notes,omitempty"`
}
Capability is one unit of behaviour and its support state per surface.
type GUICapability ¶
type GUICapability struct {
ID string `json:"id"`
IOS string `json:"ios"`
MacOS string `json:"macos"`
}
GUICapability is one capability projected for the GUI conformance check: its id and its state on the two GUI surfaces. The CLI column is deliberately dropped — the Swift check only reasons about iOS/macOS, and coupling the GUI fixture to CLI churn would make it stale for no reason.
type GUIFixture ¶
type GUIFixture struct {
Version int `json:"version"`
Capabilities []GUICapability `json:"capabilities"`
}
GUIFixture is the language-neutral projection the Swift GraithSessionKit conformance test reads (issue #1149). It mirrors the #1129/#1144 protocol fixture: the Go manifest is the source of truth, this is committed under gui/ so SwiftPM can bundle it, and a staleness test keeps the two in step.
type Manifest ¶
type Manifest struct {
Version int `json:"version"`
Surfaces []Surface `json:"surfaces"`
States []State `json:"states"`
Capabilities []Capability `json:"capabilities"`
}
Manifest is the whole capability matrix.
func (*Manifest) Categories ¶
Categories returns the capability categories in first-seen order.
func (*Manifest) Coverage ¶
Coverage reports, per surface, how many capabilities are in each state. Handy for a quick "how far behind is macOS" read; sorted by surface order.
func (*Manifest) GUIFixture ¶
func (m *Manifest) GUIFixture() GUIFixture
GUIFixture projects the manifest to the GUI-facing fixture, in manifest order.
func (*Manifest) MarshalGUIFixture ¶
MarshalGUIFixture renders the GUI fixture as indented JSON with a trailing newline, so the committed file is diff-friendly and byte-stable.
func (*Manifest) MatrixMarkdown ¶
MatrixMarkdown renders the capability matrix as Markdown: a legend, then one table per category. Deterministic output so it can be diffed against the committed doc.
func (*Manifest) ReplaceRegion ¶
ReplaceRegion returns doc with the text between BeginMarker and EndMarker replaced by the freshly rendered matrix. It errors if the markers are missing, duplicated, or out of order, so a malformed doc fails loudly rather than being silently rewritten.
func (*Manifest) SurfaceIDs ¶
SurfaceIDs returns surface IDs in manifest order.