extension

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 11 Imported by: 2 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 extension is the contract between lich and an extension: the UI tree an extension asks lich to draw, the toasts it raises, and the events lich sends back. lich draws every node with its own UI kit.

Lengths are dp and text sizes sp. A color is a theme token ("muted-foreground") or "#rrggbb[aa]". An icon is a Lucide name, or "lobe:name" or "devicon:name".

The package is pure Go with no dependency beyond the standard library, since both lich and every extension compile against it. testdata/ records the JSON of every component and message; a change there is a change to the contract.

Index

Constants

View Source
const (
	VariantDefault     Variant = "default"
	VariantOutline     Variant = "outline"
	VariantSecondary   Variant = "secondary"
	VariantGhost       Variant = "ghost"
	VariantDestructive Variant = "destructive"

	SizeDefault Size = "default"
	SizeXS      Size = "xs"
	SizeSM      Size = "sm"
	SizeLG      Size = "lg"
	SizeIcon    Size = "icon"
	SizeIconXS  Size = "icon-xs"
	SizeIconSM  Size = "icon-sm"
	SizeIconLG  Size = "icon-lg"

	ToggleVariantDefault ToggleVariant = "default"
	ToggleVariantOutline ToggleVariant = "outline"

	ToggleSizeDefault ToggleSize = "default"
	ToggleSizeSM      ToggleSize = "sm"
	ToggleSizeLG      ToggleSize = "lg"

	SwitchSizeDefault SwitchSize = "default"
	SwitchSizeSM      SwitchSize = "sm"

	TabsVariantDefault TabsVariant = "default"
	TabsVariantLine    TabsVariant = "line"
	TabsVariantGhost   TabsVariant = "ghost"

	TabsHorizontal TabsOrientation = "horizontal"
	TabsVertical   TabsOrientation = "vertical"

	TooltipLabel TooltipVariant = "label"
	TooltipCard  TooltipVariant = "card"

	SideTop    Side = "top"
	SideBottom Side = "bottom"
	SideLeft   Side = "left"
	SideRight  Side = "right"

	JustifyStart   Justify = "start"
	JustifyCenter  Justify = "center"
	JustifyEnd     Justify = "end"
	JustifyBetween Justify = "between"

	AlignStart   Align = "start"
	AlignCenter  Align = "center"
	AlignEnd     Align = "end"
	AlignStretch Align = "stretch"

	DirectionColumn Direction = "column"
	DirectionRow    Direction = "row"

	PanelEdgeLeft  PanelEdge = "left"
	PanelEdgeRight PanelEdge = "right"

	TextAlignStart  TextAlign = "start"
	TextAlignCenter TextAlign = "center"
	TextAlignEnd    TextAlign = "end"

	FontRegular  FontWeight = "regular"
	FontMedium   FontWeight = "medium"
	FontSemibold FontWeight = "semibold"

	MenuItem         MenuEntryKind = "item"
	MenuCheckboxItem MenuEntryKind = "checkbox"
	MenuRadioItem    MenuEntryKind = "radio"
	MenuSubTrigger   MenuEntryKind = "sub"
	MenuLabel        MenuEntryKind = "label"
	MenuSeparator    MenuEntryKind = "separator"
	MenuSwatch       MenuEntryKind = "swatch"

	AnchorTopLeft     Anchor = "top-left"
	AnchorTop         Anchor = "top"
	AnchorTopRight    Anchor = "top-right"
	AnchorLeft        Anchor = "left"
	AnchorCenter      Anchor = "center"
	AnchorRight       Anchor = "right"
	AnchorBottomLeft  Anchor = "bottom-left"
	AnchorBottom      Anchor = "bottom"
	AnchorBottomRight Anchor = "bottom-right"

	ImageContain   ImageFit = "contain"
	ImageCover     ImageFit = "cover"
	ImageFill      ImageFit = "fill"
	ImageScaleDown ImageFit = "scale-down"
	ImageUnscaled  ImageFit = "unscaled"

	DiffOld DiffSide = "old"
	DiffNew DiffSide = "new"

	ToastDefault ToastVariant = "default"
	ToastSuccess ToastVariant = "success"
	ToastInfo    ToastVariant = "info"
	ToastWarning ToastVariant = "warning"
	ToastError   ToastVariant = "error"
)
View Source
const DataDirEnv = "LICH_EXTENSION_DATA"

DataDirEnv names the environment variable holding the absolute path of the extension's data directory, which lich creates before starting it and keeps across a reinstall. The install directory is replaced by one, so nothing the extension saves belongs there.

View Source
const LanguageEnv = "LICH_LANGUAGE"

LanguageEnv names the environment variable holding the BCP 47 tag of the language lich shows its interface in when it starts the extension ("en", "pt-BR"). The window corrects it with a language message once it attaches, and sends one on every change.

View Source
const ManifestFile = "manifest.json"

ManifestFile is the name of the manifest in an extension's directory.

View Source
const ManifestFormat = 1

ManifestFormat is the newest manifest format this package reads.

View Source
const ProtocolVersion = 1

ProtocolVersion is the version of the JSON this package writes.

View Source
const ToastForever = -1

ToastForever as DurationMs keeps a toast up until it is dismissed.

Variables

View Source
var (
	// CallMethod asks lich to run a method. lich answers every call with a
	// CallResult under the same ID, an error included: an unknown method, a
	// permission the manifest does not list, params that do not decode.
	CallMethod = kind[CallData]("call")
	CallResult = kind[ResultData]("result")
	// LichEvent is an event the extension subscribed to with Subscribe.
	LichEvent = kind[LichEventData]("lich.event")
)
View Source
var (
	Box       = component[BoxProps]("box")
	Scroll    = component[ScrollProps]("scroll")
	Wrap      = component[WrapProps]("wrap")
	WrapItem  = component[WrapItemProps]("wrapItem")
	Separator = component[NoProps]("separator")

	Label     = component[LabelProps]("label")
	FormLabel = component[FormLabelProps]("formLabel")
	Glyph     = component[GlyphProps]("icon")
	Skeleton  = component[SkeletonProps]("skeleton")
	Progress  = component[ProgressProps]("progress")
	Spinner   = component[SpinnerProps]("spinner")
	BusyRing  = component[BusyRingProps]("busyRing")

	Button      = component[ButtonProps]("button")
	Chip        = component[ChipProps]("chip")
	Checkbox    = component[CheckboxProps]("checkbox")
	Switch      = component[SwitchProps]("switch")
	Toggle      = component[ToggleProps]("toggle")
	ToggleGroup = component[ToggleGroupProps]("toggleGroup")
	Tabs        = component[TabsProps]("tabs")

	Input      = component[InputProps]("input")
	InputGroup = component[InputGroupProps]("inputGroup")
	Textarea   = component[TextareaProps]("textarea")
	InlineEdit = component[InlineEditProps]("inlineEdit")

	Collapse     = component[CollapseProps]("collapse")
	Presence     = component[NoProps]("presence")
	SortableList = component[SortableListProps]("sortableList")
	ResizeHandle = component[ResizeHandleProps]("resizeHandle")
)
View Source
var (
	EmptyState       = component[EmptyStateProps]("emptyState")
	InlineEmptyState = component[EmptyStateProps]("inlineEmptyState")
	Avatar           = component[AvatarProps]("avatar")
	SectionHeading   = component[SectionHeadingProps]("sectionHeading")
	MarkedText       = component[MarkedTextProps]("markedText")
	Image            = component[ImageProps]("image")
	FileIcon         = component[FileIconProps]("fileIcon")

	SkeletonBar   = component[SkeletonBarProps]("skeletonBar")
	SkeletonText  = component[SkeletonTextProps]("skeletonText")
	SkeletonShape = component[NoProps]("skeletonShape")
	SkeletonFill  = component[SkeletonFillProps]("skeletonFill")
	SkeletonRow   = component[SkeletonRowProps]("skeletonRow")

	Stack       = component[GapProps]("stack")
	Row         = component[GapProps]("row")
	Columns     = component[GapProps]("columns")
	FixedColumn = component[FixedColumnProps]("fixedColumn")
	// AlignedEnd is the "alignEnd" component, named apart from the AlignEnd value.
	AlignedEnd = component[NoProps]("alignEnd")
	Spanning   = component[NoProps]("spanning")
	SplitPane  = component[SplitPaneProps]("splitPane")

	ThinScrollArea = component[ScrollProps]("thinScroll")
)
View Source
var (
	Notice      = component[TextProps]("notice")
	Footnote    = component[TextProps]("footnote")
	BodyLine    = component[TextProps]("bodyLine")
	PanelNotice = component[PanelNoticeProps]("panelNotice")

	IconAction    = component[IconActionProps]("iconAction")
	CornerButton  = component[IconToggleProps]("cornerButton")
	BarIconButton = component[IconToggleProps]("barIconButton")

	DiffStat      = component[DiffStatProps]("diffStat")
	MetaGlyph     = component[MetaGlyphProps]("metaGlyph")
	Pill          = component[PillProps]("pill")
	KeyCap        = component[KeyCapProps]("keyCap")
	PopoverRow    = component[PopoverRowProps]("popoverRow")
	SelectTrigger = component[SelectTriggerProps]("selectTrigger")
	VerticalRule  = component[NoProps]("verticalRule")
)
View Source
var (
	StatusDot        = component[ColorProps]("statusDot")
	HollowDot        = component[ColorProps]("hollowDot")
	BeatingDot       = component[ColorProps]("beatingDot")
	MarkDot          = component[ColorProps]("markDot")
	Swatch           = component[ColorProps]("swatch")
	CornerDot        = component[ColorProps]("cornerDot")
	PulsingCornerDot = component[ColorProps]("pulsingCornerDot")
	Dot              = component[DotProps]("dot")
	DotAt            = component[DotAtProps]("dotAt")
	PulseRing        = component[PulseRingProps]("pulseRing")
	NotifyDot        = component[SizeProps]("notifyDot")

	GaugeBar   = component[GaugeBarProps]("gaugeBar")
	SegmentBar = component[SegmentBarProps]("segmentBar")
	DonutGauge = component[DonutGaugeProps]("donutGauge")
	GaugeRow   = component[GaugeRowProps]("gaugeRow")

	CountBadge   = component[CountBadgeProps]("countBadge")
	OutlineBadge = component[TextProps]("outlineBadge")
	AbbrBadge    = component[AbbrBadgeProps]("abbrBadge")
	Tag          = component[TagProps]("tag")
	KeyHint      = component[KeyHintProps]("keyHint")
	DropHint     = component[DropHintProps]("dropHint")

	Tray         = component[TrayProps]("tray")
	DropTray     = component[DropTrayProps]("dropTray")
	FillIf       = component[FillIfProps]("fillIf")
	Checker      = component[CheckerProps]("checker")
	Fillet       = component[FilletProps]("fillet")
	FillRRect    = component[FillRRectProps]("fillRRect")
	InsetBorder  = component[InsetBorderProps]("insetBorder")
	InsetRing    = component[InsetRingProps]("insetRing")
	StrokeArc    = component[StrokeArcProps]("strokeArc")
	DashedBorder = component[DashedBorderProps]("dashedBorder")

	DashedRing   = component[RingProps]("dashedRing")
	MarchingRing = component[RingProps]("marchingRing")
	DashedCircle = component[DashedCircleProps]("dashedCircle")
)
View Source
var (
	Render       = kind[RenderData]("render")
	ShowToast    = kind[ToastData]("toast")
	DismissToast = kind[DismissToastData]("toast.dismiss")
	OpenExternal = kind[OpenExternalData]("openExternal")
	Clipboard    = kind[ClipboardData]("clipboard")
	Focus        = kind[FocusData]("focus")
	Footer       = kind[FooterData]("footer")

	FireEvent     = kind[EventData]("event")
	SurfaceOpened = kind[SurfaceData]("surface.opened")
	SurfaceClosed = kind[SurfaceData]("surface.closed")
	Language      = kind[LanguageData]("language")
	Context       = kind[ContextData]("context")
)
View Source
var (
	// ListProjects is every project open in lich's window.
	ListProjects = method[NoParams, []Project]("projects.list", PermissionProjectsRead)
	// ListSessions is every live session, as list_sessions returns them.
	ListSessions = method[NoParams, []Session]("sessions.list", PermissionSessionsRead)
	// ListWorktrees is a project's git worktrees, as list_worktrees returns them.
	ListWorktrees = method[WorktreesParams, []Worktree]("worktrees.list", PermissionProjectsRead)
	// OpenSession opens and starts a session, as open_session does.
	OpenSession = method[OpenSessionParams, OpenedSession]("sessions.open", PermissionSessionsWrite)
	// SendToSession gives a session a task, as send_to_session does.
	SendToSession = method[SendParams, SendResult]("sessions.send", PermissionSessionsWrite)
	// AskSession puts a side question to a Claude Code session and waits for
	// its answer, as ask_session does.
	AskSession = method[AskParams, AskResult]("sessions.ask", PermissionSessionsAsk)
	// CollectAnswer waits on a ticket this extension's own sessions.send or
	// sessions.open returned pending, as wait_for_answer does with a ticket.
	CollectAnswer = method[AnswerParams, SendResult]("sessions.answer", PermissionSessionsWrite)
	// ListServices is a project's services, as list_services returns them.
	ListServices = method[ServicesParams, []Service]("services.list", PermissionServicesRead)
	// StartService starts a service, as start_service does.
	StartService = method[ServiceParams, Service]("services.start", PermissionServicesWrite)
	// StopService asks a service to stop, as stop_service does.
	StopService = method[ServiceParams, Service]("services.stop", PermissionServicesWrite)
	// RestartService restarts a service, as restart_service does.
	RestartService = method[ServiceParams, Service]("services.restart", PermissionServicesWrite)
	// ServiceOutput reads a service's console, as read_service_output does.
	ServiceOutput = method[ServiceParams, ServiceOutputResult]("services.output", PermissionServicesRead)
	// GitStatus is a checkout's branch, changes and standing against its base,
	// as the window's cards read them.
	GitStatus = method[GitParams, GitStatusResult]("git.status", PermissionGitRead)
	// GitPullRequest is the open pull request of a checkout's branch, as its
	// badge shows it.
	GitPullRequest = method[GitParams, PullRequestResult]("git.pullRequest", PermissionGitRead)
	// Notify raises a desktop notification through lich's own.
	Notify = method[NotifyParams, NoParams]("notify", PermissionNotify)
	// ShowCode opens a file of a session's checkout in the window's dock, as
	// show_code does.
	ShowCode = method[ShowCodeParams, ShownCode]("window.showCode", PermissionWindow)
	// OpenURL loads a page in a session's browser, as browser_open does.
	OpenURL = method[OpenURLParams, OpenedURL]("window.openURL", PermissionWindow)
	// Subscribe starts the events named. Each needs its own permission, and
	// the call is refused whole when one is missing.
	Subscribe = method[SubscribeParams, NoParams]("events.subscribe", "")

	// SessionStatus fires when a session reports a new state.
	SessionStatus = event[SessionStatusData]("session.status", PermissionSessionEvents)
	// ServiceStatus fires when a service starts, stops or fails.
	ServiceStatus = event[ServiceStatusData]("service.status", PermissionServicesRead)
)

The methods and events mirror the tools lich's MCP server gives agents (list_sessions, list_worktrees, open_session, send_to_session, ask_session, wait_for_answer, the service tools, show_code, browser_open) and mean what they mean there. A call comes from no session, as the lich command line run outside one does: nothing defaults to "your own" project or provider.

View Source
var (
	Tooltip       = component[TooltipProps]("tooltip")
	DropdownMenu  = component[DropdownMenuProps]("dropdownMenu")
	ContextMenu   = component[ContextMenuProps]("contextMenu")
	DropdownPanel = component[DropdownPanelProps]("dropdownPanel")
	Dialog        = component[DialogProps]("dialog")
)
View Source
var (
	IconLine         = component[IconColorProps]("iconLine")
	BoxIcon          = component[IconColorProps]("boxIcon")
	IconLabel        = component[IconLabelProps]("iconLabel")
	MonoGlyph        = component[MetaGlyphProps]("monoGlyph")
	MutedGlyph       = component[MutedGlyphProps]("mutedGlyph")
	CenteredIcon     = component[GlyphProps]("centeredIcon")
	TriggerChevron   = component[TriggerChevronProps]("triggerChevron")
	TinyChip         = component[TinyChipProps]("tinyChip")
	HoverLink        = component[LinkProps]("hoverLink")
	TrailingIconLink = component[TrailingIconLinkProps]("trailingIconLink")
	TwoLines         = component[TwoLinesProps]("twoLines")
	SpinnerLine      = component[TextProps]("spinnerLine")
	SpinnerBeside    = component[NoProps]("spinnerBeside")
	Stat             = component[StatProps]("stat")

	CheckRow   = component[CheckRowProps]("checkRow")
	NavRow     = component[NavRowProps]("navRow")
	PanelRow   = component[PanelRowProps]("panelRow")
	FillRow    = component[FillRowProps]("fillRow")
	OrRule     = component[WordProps]("orRule")
	MenuHeader = component[MenuHeaderProps]("menuHeader")

	// MenuDivider is the "menuSeparator" component, named apart from the
	// MenuSeparator entry kind.
	MenuDivider    = component[NoProps]("menuSeparator")
	RailHairline   = component[NoProps]("railHairline")
	CaptionDivider = component[CaptionDividerProps]("captionDivider")

	GhostTextButton = component[GhostTextButtonProps]("ghostTextButton")
	CardIconButton  = component[CardIconButtonProps]("cardIconButton")
	GhostIconButton = component[GhostIconButtonProps]("ghostIconButton")
	SquareFace      = component[FaceProps]("squareFace")
	LabelFace       = component[LabelFaceProps]("labelFace")
)
View Source
var (
	Markdown = component[MarkdownProps]("markdown")
	CodeView = component[CodeViewProps]("codeView")
	DiffView = component[DiffViewProps]("diffView")
	FileTree = component[FileTreeProps]("fileTree")
)
View Source
var ErrClosed = errors.New("extension: lich closed the connection")

ErrClosed is what a call returns once lich has closed the connection.

Permissions is every permission this build knows, the names a manifest may list.

Functions

func Call

func Call[P, R any](ctx context.Context, c *Conn, m Method[P, R], params P) (R, error)

Call runs m in lich with params and waits for its result, or for ctx. A result that arrives after ctx ended is dropped.

func EnumValues

func EnumValues() map[string][]string

EnumValues is every value each enum accepts on the wire, by enum name.

func MethodNames

func MethodNames() []string

MethodNames is every method this build declares, sorted.

Types

type AbbrBadgeProps

type AbbrBadgeProps struct {
	Abbr       string `json:"abbr"`
	Background string `json:"background,omitempty"`
	Foreground string `json:"foreground,omitempty"`
}

type Align

type Align string

type Anchor

type Anchor string

type AnswerParams

type AnswerParams struct {
	Ticket      string `json:"ticket"`
	WaitSeconds int    `json:"waitSeconds,omitempty"`
}

AnswerParams waits on Ticket for WaitSeconds, at most 90, which is also what 0 means. The ticket must be one this extension's own sessions.send or sessions.open returned pending.

type AskParams

type AskParams struct {
	Session  string `json:"session"`
	Project  string `json:"project,omitempty"`
	Question string `json:"question"`
}

AskParams asks Session, its label, name or id, Question. Project narrows the search when two projects share the label. Only a Claude Code session whose lich-plugin mod is loaded answers; every other is refused.

type AskResult

type AskResult struct {
	ID      string `json:"id"`
	Project string `json:"project"`
	Label   string `json:"label"`
	Answer  string `json:"answer"`
}

AskResult is the session's answer: its id, project and label, and what it said. A session that does not answer within 90 seconds is an error, and an answer that comes later is dropped: an ask has no ticket.

type AvatarProps

type AvatarProps struct {
	Image      []byte  `json:"image,omitempty"`
	Initial    string  `json:"initial,omitempty"`
	Size       float64 `json:"size"`
	Background string  `json:"background,omitempty"`
	Foreground string  `json:"foreground,omitempty"`
}

AvatarProps draws Image, PNG or JPEG bytes, in a circle, or Initial on Background when there is none.

type BoxProps

type BoxProps struct {
	Direction  Direction `json:"direction,omitempty"`
	Gap        float64   `json:"gap,omitempty"`
	Padding    float64   `json:"padding,omitempty"`
	PaddingX   float64   `json:"paddingX,omitempty"`
	PaddingY   float64   `json:"paddingY,omitempty"`
	Align      Align     `json:"align,omitempty"`
	Justify    Justify   `json:"justify,omitempty"`
	Grow       float64   `json:"grow,omitempty"`
	Width      float64   `json:"width,omitempty"`
	Height     float64   `json:"height,omitempty"`
	Background string    `json:"background,omitempty"`
	Radius     float64   `json:"radius,omitempty"`
}

type BusyRingProps

type BusyRingProps struct {
	Size  float64 `json:"size,omitempty"`
	Color string  `json:"color,omitempty"`
	Track string  `json:"track,omitempty"`
}

type ButtonProps

type ButtonProps struct {
	Text     string  `json:"text,omitempty"`
	Icon     Icon    `json:"icon,omitempty"`
	Variant  Variant `json:"variant,omitempty"`
	Size     Size    `json:"size,omitempty"`
	Disabled bool    `json:"disabled,omitempty"`
	Lit      bool    `json:"lit,omitempty"`
	OnPress  Handler `json:"onPress,omitempty"`
}

type CallData

type CallData struct {
	ID     string          `json:"id"`
	Method string          `json:"method"`
	Params json.RawMessage `json:"params,omitempty"`
}

CallData is one call. ID is the extension's to choose and comes back on the result; two calls in flight should not share one.

type CaptionDividerProps

type CaptionDividerProps struct {
	Inset  float64 `json:"inset,omitempty"`
	Height float64 `json:"height"`
}

type CardIconButtonProps

type CardIconButtonProps struct {
	Icon    Icon    `json:"icon"`
	Size    float64 `json:"size,omitempty"`
	Turn    float64 `json:"turn,omitempty"`
	OnPress Handler `json:"onPress,omitempty"`
}

CardIconButtonProps is a bare icon button, Turn radians off upright; with no OnPress it draws disabled.

type CheckRowProps

type CheckRowProps struct {
	Checked  bool    `json:"checked,omitempty"`
	Label    string  `json:"label"`
	Note     string  `json:"note,omitempty"`
	OnChange Handler `json:"onChange,omitempty"`
}

type CheckboxProps

type CheckboxProps struct {
	Checked  bool    `json:"checked,omitempty"`
	Disabled bool    `json:"disabled,omitempty"`
	OnChange Handler `json:"onChange,omitempty"`
}

type CheckerProps

type CheckerProps struct {
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
	Cell   float64 `json:"cell"`
}

type ChipProps

type ChipProps struct {
	Label   string  `json:"label"`
	Count   int     `json:"count,omitempty"`
	On      bool    `json:"on,omitempty"`
	OnPress Handler `json:"onPress,omitempty"`
}

type ClipboardData

type ClipboardData struct {
	Text string `json:"text"`
}

ClipboardData replaces the clipboard's text.

type CodeBlock

type CodeBlock struct {
	After   int  `json:"after"`
	Content Node `json:"content"`
}

CodeBlock draws Content under a line of a CodeView, After counted from 0.

type CodeViewProps

type CodeViewProps struct {
	Filename string      `json:"filename,omitempty"`
	Text     string      `json:"text"`
	Size     float64     `json:"size,omitempty"`
	Blocks   []CodeBlock `json:"blocks,omitempty"`
}

CodeViewProps draws Text as source code, highlighted by the extension of Filename. It fills the room its parent gives it. Size is in sp.

type CollapseProps

type CollapseProps struct {
	Open bool `json:"open,omitempty"`
}

type ColorProps

type ColorProps struct {
	Color string `json:"color,omitempty"`
}

type Component

type Component[P any] struct {
	Name string
}

Component names a node type whose props are P.

func (Component[P]) New

func (c Component[P]) New(props P, children ...Node) Node

New returns a node of this component.

type Conn

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

Conn is an extension's end of its conversation with lich, over its stdin and stdout: NewConn(os.Stdin, os.Stdout). Every method is safe to call from several goroutines.

func NewConn

func NewConn(r io.Reader, w io.Writer) *Conn

NewConn starts reading r, which lich writes to, and writes to w, which lich reads.

func (*Conn) Answer

func (c *Conn) Answer(ctx context.Context, params AnswerParams) (SendResult, error)

Answer calls CollectAnswer.

func (*Conn) Ask

func (c *Conn) Ask(ctx context.Context, params AskParams) (AskResult, error)

Ask calls AskSession.

func (*Conn) GitStatus

func (c *Conn) GitStatus(ctx context.Context, path string) (GitStatusResult, error)

GitStatus calls GitStatus for the checkout at path.

func (*Conn) Messages

func (c *Conn) Messages() <-chan Message

Messages delivers every message from lich other than a call's result, in the order lich sent them: event, surface.opened, surface.closed and lich.event. It is closed once lich closes the connection and everything before that was delivered, which is the extension's cue to exit. Messages wait for the reader without holding up results, so a handler may call lich and wait for the answer on the goroutine reading this channel.

func (*Conn) Notify

func (c *Conn) Notify(ctx context.Context, title, body string) error

Notify calls Notify.

func (*Conn) OpenSession

func (c *Conn) OpenSession(ctx context.Context, params OpenSessionParams) (OpenedSession, error)

OpenSession calls OpenSession.

func (*Conn) OpenURL

func (c *Conn) OpenURL(ctx context.Context, session, url string) (OpenedURL, error)

OpenURL calls OpenURL.

func (*Conn) Projects

func (c *Conn) Projects(ctx context.Context) ([]Project, error)

Projects calls ListProjects.

func (*Conn) PullRequest

func (c *Conn) PullRequest(ctx context.Context, path string) (*PullRequest, error)

PullRequest calls GitPullRequest for the checkout at path: nil when its branch has no open pull request.

func (*Conn) RestartService

func (c *Conn) RestartService(ctx context.Context, params ServiceParams) (Service, error)

RestartService calls RestartService.

func (*Conn) Send

func (c *Conn) Send(msg Message) error

Send writes one message to lich: render, toast and the other kinds an extension sends.

func (*Conn) SendToSession

func (c *Conn) SendToSession(ctx context.Context, params SendParams) (SendResult, error)

SendToSession calls SendToSession.

func (*Conn) ServiceOutput

func (c *Conn) ServiceOutput(ctx context.Context, params ServiceParams) (string, error)

ServiceOutput calls ServiceOutput.

func (*Conn) Services

func (c *Conn) Services(ctx context.Context, project string) ([]Service, error)

Services calls ListServices for project.

func (*Conn) Sessions

func (c *Conn) Sessions(ctx context.Context) ([]Session, error)

Sessions calls ListSessions.

func (*Conn) ShowCode

func (c *Conn) ShowCode(ctx context.Context, params ShowCodeParams) (ShownCode, error)

ShowCode calls ShowCode.

func (*Conn) StartService

func (c *Conn) StartService(ctx context.Context, params ServiceParams) (Service, error)

StartService calls StartService.

func (*Conn) StopService

func (c *Conn) StopService(ctx context.Context, params ServiceParams) (Service, error)

StopService calls StopService.

func (*Conn) Subscribe

func (c *Conn) Subscribe(ctx context.Context, names ...string) error

Subscribe starts the events named, which then arrive on Messages as lich.event.

func (*Conn) Worktrees

func (c *Conn) Worktrees(ctx context.Context, project string) ([]Worktree, error)

Worktrees calls ListWorktrees for project.

type ContextData added in v0.2.0

type ContextData struct {
	Session string `json:"session,omitempty"`
	Project string `json:"project,omitempty"`
	Path    string `json:"path,omitempty"`
}

ContextData is what the window has active, sent to an extension with a dock or panel surface when it changes, when it starts, and when a window attaches. Path is the active session's checkout, or the project's own folder with no session, and is what FooterData and RenderData key on.

type ContextMenuProps

type ContextMenuProps struct {
	Entries []MenuEntry `json:"entries"`
}

ContextMenuProps opens Entries on a secondary click anywhere on its child.

type CountBadgeProps

type CountBadgeProps struct {
	Count int `json:"count"`
}

CountBadgeProps draws nothing for a Count of 0.

type DashedBorderProps

type DashedBorderProps struct {
	Width      float64 `json:"width"`
	Height     float64 `json:"height"`
	Radius     float64 `json:"radius,omitempty"`
	Color      string  `json:"color,omitempty"`
	DashLength float64 `json:"dashLength"`
	GapLength  float64 `json:"gapLength"`
}

type DashedCircleProps

type DashedCircleProps struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Outer  float64 `json:"outer"`
	Stroke float64 `json:"stroke"`
	Dash   float64 `json:"dash"`
	Color  string  `json:"color,omitempty"`
}

type DialogProps

type DialogProps struct {
	Open        bool    `json:"open,omitempty"`
	Title       string  `json:"title,omitempty"`
	Description string  `json:"description,omitempty"`
	Actions     []Node  `json:"actions,omitempty"`
	MaxWidth    float64 `json:"maxWidth,omitempty"`
	HideClose   bool    `json:"hideClose,omitempty"`
	Raw         bool    `json:"raw,omitempty"`
	Top         float64 `json:"top,omitempty"`
	Scrim       float64 `json:"scrim,omitempty"`
	OnClose     Handler `json:"onClose,omitempty"`
}

DialogProps draws its children as the body, or as the whole panel with Raw.

type DiffBlock

type DiffBlock struct {
	Key     string   `json:"key"`
	Side    DiffSide `json:"side,omitempty"`
	Line    int      `json:"line"`
	Content Node     `json:"content"`
}

DiffBlock draws Content under a line of a DiffView, Line counted from 1 in the file Side names. Key keeps the block's height across updates.

type DiffSide

type DiffSide string

type DiffStatProps

type DiffStatProps struct {
	Added   int `json:"added,omitempty"`
	Deleted int `json:"deleted,omitempty"`
}

type DiffViewProps

type DiffViewProps struct {
	Patch  string      `json:"patch"`
	Split  bool        `json:"split,omitempty"`
	Height float64     `json:"height"`
	Size   float64     `json:"size,omitempty"`
	Blocks []DiffBlock `json:"blocks,omitempty"`
}

DiffViewProps draws the first file of Patch, a unified diff. Height is the diff's own height without its blocks, which add theirs.

type Direction

type Direction string

type DismissToastData

type DismissToastData struct {
	ID string `json:"id"`
}

type DonutGaugeProps

type DonutGaugeProps struct {
	Size    float64 `json:"size"`
	Percent int     `json:"percent"`
	Color   string  `json:"color,omitempty"`
}

type DotAtProps

type DotAtProps struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Radius float64 `json:"radius"`
	Color  string  `json:"color,omitempty"`
}

type DotProps

type DotProps struct {
	Color string  `json:"color,omitempty"`
	Size  float64 `json:"size"`
}

type DropHintProps

type DropHintProps struct {
	Icon   Icon   `json:"icon"`
	Before string `json:"before,omitempty"`
	Label  string `json:"label"`
	After  string `json:"after,omitempty"`
	Detail string `json:"detail,omitempty"`
}

DropHintProps fills its parent with a veil, Label in bold between Before and After; Detail shows only when the parent is tall enough.

type DropTrayProps

type DropTrayProps struct {
	Fill string `json:"fill,omitempty"`
	Edge string `json:"edge,omitempty"`
}

DropTrayProps is a Tray with a rim of Edge around it.

type DropdownMenuProps struct {
	Entries []MenuEntry `json:"entries"`
}

DropdownMenuProps opens Entries from its child.

type DropdownPanelProps struct {
	Trigger  Node    `json:"trigger"`
	Width    float64 `json:"width,omitempty"`
	AlignEnd bool    `json:"alignEnd,omitempty"`
}

DropdownPanelProps opens its children under Trigger.

type EmptyStateProps

type EmptyStateProps struct {
	Icon            Icon       `json:"icon,omitempty"`
	Title           string     `json:"title"`
	Description     string     `json:"description,omitempty"`
	IconSize        float64    `json:"iconSize,omitempty"`
	IconGap         float64    `json:"iconGap,omitempty"`
	DescriptionGap  float64    `json:"descriptionGap,omitempty"`
	ActionsGap      float64    `json:"actionsGap,omitempty"`
	TitleSize       float64    `json:"titleSize,omitempty"`
	DescriptionSize float64    `json:"descriptionSize,omitempty"`
	TitleLeading    float64    `json:"titleLeading,omitempty"`
	TitleWeight     FontWeight `json:"titleWeight,omitempty"`
	MaxLines        int        `json:"maxLines,omitempty"`
	Anchor          Anchor     `json:"anchor,omitempty"`
	Align           Align      `json:"align,omitempty"`
	Pad             float64    `json:"pad,omitempty"`
}

EmptyStateProps is the props of EmptyState and InlineEmptyState, which differ in the defaults of every field left at zero. The children are the actions. Gaps and Pad are dp, sizes sp.

type Event

type Event[D any] struct {
	Name       string
	Permission Permission
}

Event names an event whose payload is D, and the permission subscribing needs.

func (Event[D]) Decode

func (e Event[D]) Decode(ev LichEventData) (D, error)

Decode reads the payload of ev, which must be e.

func (Event[D]) New

func (e Event[D]) New(data D) Message

New returns the message carrying data as e.

type EventData

type EventData struct {
	Handler Handler  `json:"handler"`
	Text    string   `json:"text,omitempty"`
	Checked bool     `json:"checked,omitempty"`
	Index   int      `json:"index,omitempty"`
	Order   []string `json:"order,omitempty"`
	Width   float64  `json:"width,omitempty"`
	Ratio   float64  `json:"ratio,omitempty"`
	Key     string   `json:"key,omitempty"`
	From    string   `json:"from,omitempty"`
}

EventData is lich calling a Handler. The field that carries a value depends on the control: Text for fields and groups, Checked for switches, Index for tabs, Order for a sortable list's reorder, Width for a resize handle, Ratio for a split pane. A sortable list's move carries the moved item's Key, the Index it landed at in the receiving list and the key of the list it came From.

type FaceProps

type FaceProps struct {
	Background string `json:"background,omitempty"`
}

FaceProps is the props of SquareFace, an 8-unit tile whose child is the icon centered on Background.

type FileIconProps

type FileIconProps struct {
	Path string  `json:"path"`
	Size float64 `json:"size,omitempty"`
}

type FileStat

type FileStat struct {
	Added   int `json:"added,omitempty"`
	Deleted int `json:"deleted,omitempty"`
}

FileStat is the lines a file added and deleted. A folder's total is the sum of the files under it, so only files are named.

type FileTreeProps

type FileTreeProps struct {
	Paths       []string            `json:"paths"`
	Stats       map[string]FileStat `json:"stats,omitempty"`
	Selected    string              `json:"selected,omitempty"`
	ClosedPaths []string            `json:"closedPaths,omitempty"`
	OnSelect    Handler             `json:"onSelect,omitempty"`
	OnToggle    Handler             `json:"onToggle,omitempty"`
}

FileTreeProps draws Paths, slash-separated and relative, as a tree. Stats is keyed by path. A path in ClosedPaths is a folder drawn shut. OnSelect carries a clicked file's path in EventData.Text, OnToggle a folder's.

type FillIfProps

type FillIfProps struct {
	Color  string  `json:"color,omitempty"`
	Radius float64 `json:"radius,omitempty"`
}

FillIfProps fills its parent, and draws nothing for a transparent Color.

type FillRRectProps

type FillRRectProps struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
	Radius float64 `json:"radius,omitempty"`
	Color  string  `json:"color,omitempty"`
}

type FillRowProps

type FillRowProps struct {
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
	Alpha  float64 `json:"alpha"`
}

FillRowProps paints the accent at Alpha, from 0 to 1, behind a row of the given size.

type FilletProps

type FilletProps struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Radius float64 `json:"radius"`
	Right  bool    `json:"right,omitempty"`
	Color  string  `json:"color,omitempty"`
}

FilletProps is the concave corner joining a tab to its bar, curving to the right when Right is set.

type FixedColumnProps

type FixedColumnProps struct {
	Width float64 `json:"width"`
}

type FocusData

type FocusData struct {
	Surface string `json:"surface"`
	Key     string `json:"key"`
}

FocusData gives the keyboard to the field under Key on Surface: an input, inputGroup, textarea or inlineEdit. It lands on the next frame that draws that field and is dropped when that frame has none, or when Surface is not the one on screen. Escape hands the keyboard back to the surface.

type FontWeight

type FontWeight string

type FooterData added in v0.2.0

type FooterData struct {
	Surface string `json:"surface"`
	Path    string `json:"path,omitempty"`
	Text    string `json:"text,omitempty"`
}

FooterData sets the text of a dock or panel surface's footer item for the checkout at Path, a path ContextData named: the window shows it while that checkout is the active one. An empty Path sets it for every checkout without a text of its own, and an empty Text clears it, leaving the item its icon.

type FormLabelProps

type FormLabelProps struct {
	Text      string     `json:"text"`
	Size      float64    `json:"size,omitempty"`
	Weight    FontWeight `json:"weight,omitempty"`
	Uppercase bool       `json:"uppercase,omitempty"`
	Disabled  bool       `json:"disabled,omitempty"`
}

type GapProps

type GapProps struct {
	Gap float64 `json:"gap,omitempty"`
}

GapProps is the props of Stack (children one under another), Row (side by side, centered) and Columns (side by side, sharing the width evenly).

type GaugeBarProps

type GaugeBarProps struct {
	Percent int    `json:"percent"`
	Tone    string `json:"tone,omitempty"`
}

type GaugeRowProps

type GaugeRowProps struct {
	LabelWidth   float64 `json:"labelWidth"`
	ReadingWidth float64 `json:"readingWidth"`
	LeftWidth    float64 `json:"leftWidth"`
	Label        Node    `json:"label"`
	Bar          Node    `json:"bar"`
	Reading      Node    `json:"reading"`
	Left         Node    `json:"left"`
}

GaugeRowProps lays out four slots in a row: Label, Bar sharing what is left, Reading and Left, each of the three on the sides in a fixed width.

type GhostIconButtonProps

type GhostIconButtonProps struct {
	Icon     Icon    `json:"icon"`
	Hint     string  `json:"hint,omitempty"`
	Disabled bool    `json:"disabled,omitempty"`
	OnPress  Handler `json:"onPress,omitempty"`
}

GhostIconButtonProps is an icon button that names itself in a tooltip.

type GhostTextButtonProps

type GhostTextButtonProps struct {
	Label   string  `json:"label"`
	Color   string  `json:"color,omitempty"`
	OnPress Handler `json:"onPress,omitempty"`
}

type GitParams

type GitParams struct {
	Path string `json:"path"`
}

GitParams names a checkout by its directory path.

type GitStatusResult

type GitStatusResult struct {
	Branch     string   `json:"branch"`
	Head       string   `json:"head"`
	Files      int      `json:"files"`
	Added      int      `json:"added"`
	Deleted    int      `json:"deleted"`
	Upstream   string   `json:"upstream"`
	Ahead      int      `json:"ahead"`
	Behind     int      `json:"behind"`
	Base       string   `json:"base"`
	BehindBase int      `json:"behindBase"`
	Conflicts  []string `json:"conflicts"`
}

GitStatusResult is what a card shows of a checkout: its Branch and Head commit, its uncommitted Files, Added and Deleted lines; the commits it is Ahead and Behind its Upstream ("origin/feat" form, empty when it tracks none), counted from the refs on disk with no fetch, as `git status` does; and against Base (the branch it merges into, "origin/main" form, empty when it has none) the commits it is BehindBase and the files that would conflict.

type GlyphProps

type GlyphProps struct {
	Name  Icon    `json:"name"`
	Size  float64 `json:"size,omitempty"`
	Color string  `json:"color,omitempty"`
}

type Handler

type Handler string

Handler names an event the extension handles; empty means none.

type Icon

type Icon string

Icon names a glyph, see the package comment.

type IconActionProps

type IconActionProps struct {
	Icon    Icon    `json:"icon"`
	Label   string  `json:"label"`
	Pressed bool    `json:"pressed,omitempty"`
	OnPress Handler `json:"onPress,omitempty"`
}

type IconColorProps

type IconColorProps struct {
	Icon  Icon   `json:"icon"`
	Color string `json:"color,omitempty"`
}

IconColorProps is the props of IconLine, which draws its children after the icon, and of BoxIcon, which sizes the icon to its parent.

type IconLabelProps

type IconLabelProps struct {
	Icon  Icon       `json:"icon"`
	Glyph string     `json:"glyph,omitempty"`
	Label LabelProps `json:"label"`
}

IconLabelProps puts Label beside a 12dp icon painted in Glyph.

type IconToggleProps

type IconToggleProps struct {
	Icon    Icon    `json:"icon"`
	On      bool    `json:"on,omitempty"`
	OnPress Handler `json:"onPress,omitempty"`
}

IconToggleProps is a bare icon button; with no OnPress it draws disabled.

type ImageFit

type ImageFit string

type ImageProps

type ImageProps struct {
	Data     []byte   `json:"data"`
	Fit      ImageFit `json:"fit,omitempty"`
	Position Anchor   `json:"position,omitempty"`
	Width    float64  `json:"width,omitempty"`
	Height   float64  `json:"height,omitempty"`
}

ImageProps draws Data, PNG or JPEG bytes. A Width or Height of 0 leaves that side to the room the parent gives.

type InlineEditProps

type InlineEditProps struct {
	Value    string  `json:"value"`
	Size     float64 `json:"size,omitempty"`
	Mono     bool    `json:"mono,omitempty"`
	PadRight float64 `json:"padRight,omitempty"`
	OnCommit Handler `json:"onCommit,omitempty"`
	OnCancel Handler `json:"onCancel,omitempty"`
}

type InputGroupProps

type InputGroupProps struct {
	Value       string  `json:"value,omitempty"`
	Placeholder string  `json:"placeholder,omitempty"`
	Multiline   bool    `json:"multiline,omitempty"`
	Start       []Node  `json:"start,omitempty"`
	End         []Node  `json:"end,omitempty"`
	Width       float64 `json:"width,omitempty"`
	Disabled    bool    `json:"disabled,omitempty"`
	Invalid     bool    `json:"invalid,omitempty"`
	OnChange    Handler `json:"onChange,omitempty"`
	OnSubmit    Handler `json:"onSubmit,omitempty"`
}

type InputProps

type InputProps struct {
	Value       string  `json:"value,omitempty"`
	Placeholder string  `json:"placeholder,omitempty"`
	Leading     Icon    `json:"leading,omitempty"`
	LeadingSize float64 `json:"leadingSize,omitempty"`
	Height      float64 `json:"height,omitempty"`
	Width       float64 `json:"width,omitempty"`
	TextSize    float64 `json:"textSize,omitempty"`
	Mono        bool    `json:"mono,omitempty"`
	Password    bool    `json:"password,omitempty"`
	Borderless  bool    `json:"borderless,omitempty"`
	Bare        bool    `json:"bare,omitempty"`
	Clearable   bool    `json:"clearable,omitempty"`
	Disabled    bool    `json:"disabled,omitempty"`
	Invalid     bool    `json:"invalid,omitempty"`
	OnChange    Handler `json:"onChange,omitempty"`
	OnSubmit    Handler `json:"onSubmit,omitempty"`
}

type InsetBorderProps

type InsetBorderProps struct {
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
	Radius float64 `json:"radius,omitempty"`
	Color  string  `json:"color,omitempty"`
}

type InsetRingProps

type InsetRingProps struct {
	Width       float64 `json:"width"`
	Height      float64 `json:"height"`
	Radius      float64 `json:"radius,omitempty"`
	StrokeWidth float64 `json:"strokeWidth"`
	Color       string  `json:"color,omitempty"`
}

type Justify

type Justify string

type KeyCapProps

type KeyCapProps struct {
	Keys string `json:"keys"`
}

type KeyHintProps

type KeyHintProps struct {
	Keys  string `json:"keys"`
	Label string `json:"label"`
}

type Kind

type Kind[D any] struct {
	Name string
}

Kind names a message whose data is D.

func (Kind[D]) New

func (k Kind[D]) New(data D) Message

New returns a message of this kind.

type LabelFaceProps

type LabelFaceProps struct {
	Background string `json:"background,omitempty"`
	Label      string `json:"label"`
}

LabelFaceProps is a tile with its first child, the icon, then Label.

type LabelProps

type LabelProps struct {
	Text       string     `json:"text"`
	Size       float64    `json:"size,omitempty"`
	Color      string     `json:"color,omitempty"`
	Weight     FontWeight `json:"weight,omitempty"`
	Mono       bool       `json:"mono,omitempty"`
	MaxLines   int        `json:"maxLines,omitempty"`
	LineHeight float64    `json:"lineHeight,omitempty"`
	Align      TextAlign  `json:"align,omitempty"`
}

type LanguageData

type LanguageData struct {
	Tag string `json:"tag"`
}

LanguageData is the interface's language, sent to every running extension when the person changes it and when the extension starts while a window is attached.

type LichEventData

type LichEventData struct {
	Name string          `json:"name"`
	Data json.RawMessage `json:"data,omitempty"`
}

LichEventData is one event: Name is an Event's name, Data its payload.

type LinkProps

type LinkProps struct {
	Text    string  `json:"text"`
	OnPress Handler `json:"onPress,omitempty"`
}

type Manifest

type Manifest struct {
	FormatVersion  int       `json:"formatVersion"`
	ID             string    `json:"id"`
	Name           string    `json:"name"`
	Version        string    `json:"version"`
	MinLichVersion string    `json:"minLichVersion,omitempty"`
	Executable     string    `json:"executable"`
	Surfaces       []Surface `json:"surfaces,omitempty"`
	// Permissions is every Permission the extension's calls and
	// subscriptions need; lich refuses any other.
	Permissions []Permission `json:"permissions,omitempty"`
}

Manifest declares an extension to lich. Executable is relative to the manifest's directory and must stay inside it.

type MarkdownProps

type MarkdownProps struct {
	Text   string  `json:"text"`
	OnOpen Handler `json:"onOpen,omitempty"`
}

MarkdownProps draws Text as Markdown. OnOpen carries the URL of a clicked link in EventData.Text.

type MarkedSegment

type MarkedSegment struct {
	Text   string `json:"text"`
	Marked bool   `json:"marked,omitempty"`
}

type MarkedTextProps

type MarkedTextProps struct {
	Segments []MarkedSegment `json:"segments"`
}
type MenuEntry struct {
	Kind                MenuEntryKind `json:"kind,omitempty"`
	Label               string        `json:"label,omitempty"`
	Icon                Icon          `json:"icon,omitempty"`
	Shortcut            string        `json:"shortcut,omitempty"`
	ShortcutDestructive bool          `json:"shortcutDestructive,omitempty"`
	Lead                *Node         `json:"lead,omitempty"`
	Variant             Variant       `json:"variant,omitempty"`
	Inset               bool          `json:"inset,omitempty"`
	Disabled            bool          `json:"disabled,omitempty"`
	Checked             bool          `json:"checked,omitempty"`
	Sub                 []MenuEntry   `json:"sub,omitempty"`
	Columns             int           `json:"columns,omitempty"`
	Swatch              string        `json:"swatch,omitempty"`
	OnSelect            Handler       `json:"onSelect,omitempty"`
	OnCheckedChange     Handler       `json:"onCheckedChange,omitempty"`
}
type MenuEntryKind string
type MenuHeaderProps struct {
	Title string `json:"title"`
	Count string `json:"count,omitempty"`
}

type Message

type Message struct {
	Version int    `json:"v"`
	Kind    string `json:"kind"`
	Data    any    `json:"data"`
}

Message is one line of the conversation between lich and an extension.

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Data into the type its kind declares.

type MetaGlyphProps

type MetaGlyphProps struct {
	Icon  Icon   `json:"icon"`
	Text  string `json:"text"`
	Color string `json:"color,omitempty"`
}

type Method

type Method[P, R any] struct {
	Name       string
	Permission Permission
}

Method names a call whose params are P and whose result is R, and the permission it needs; empty needs none.

func (Method[P, R]) Answer

func (m Method[P, R]) Answer(id string, data R) Message

Answer returns the result of the call id carrying data.

func (Method[P, R]) Call

func (m Method[P, R]) Call(id string, params P) Message

Call returns the message asking for m under id.

func (Method[P, R]) Params

func (m Method[P, R]) Params(call CallData) (P, error)

Params decodes what a call to m carries.

func (Method[P, R]) Result

func (m Method[P, R]) Result(res ResultData) (R, error)

Result decodes the answer to a call to m, its error as a Go error.

type MutedGlyphProps

type MutedGlyphProps struct {
	Icon Icon    `json:"icon"`
	Size float64 `json:"size,omitempty"`
}
type NavRowProps struct {
	On      bool    `json:"on,omitempty"`
	Height  float64 `json:"height,omitempty"`
	PadX    float64 `json:"padX,omitempty"`
	OnPress Handler `json:"onPress,omitempty"`
}

NavRowProps draws its children as one selectable row, On when it is the page the person is on.

type NoParams

type NoParams struct{}

NoParams is the params or result of a method that takes or returns nothing.

type NoProps

type NoProps struct{}

NoProps is the props of a component that takes none.

type Node

type Node struct {
	Type     string `json:"type"`
	Key      string `json:"key,omitempty"`
	Props    any    `json:"props"`
	Children []Node `json:"children,omitempty"`
}

Node is one element of a tree lich draws. Key keeps a node's state, such as a field's cursor or a list's scroll, while its siblings change.

func (*Node) UnmarshalJSON

func (n *Node) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Props into the type its component declares.

func (Node) WithKey

func (n Node) WithKey(key string) Node

WithKey returns the node with its key set.

type NotifyParams

type NotifyParams struct {
	Title string `json:"title"`
	Body  string `json:"body,omitempty"`
}

NotifyParams is a desktop notification: Title, then Body under it, each cut at 120 characters.

type OpenExternalData

type OpenExternalData struct {
	URL string `json:"url"`
}

OpenExternalData opens an http or https URL in the user's browser.

type OpenSessionParams

type OpenSessionParams struct {
	Project  string `json:"project"`
	Worktree string `json:"worktree,omitempty"`
	Provider string `json:"provider,omitempty"`
	Prompt   string `json:"prompt,omitempty"`
}

OpenSessionParams opens a session in Project, an open project's name or a directory path, which is opened as a project first; it is required. Worktree, when set, is a branch to root the session in a git worktree of: one already checked out is opened, one that does not exist is created from the project's current branch. Provider is what runs in it, spelled as Kind is on a Session; empty is claude, as for any caller that is not a session. Prompt, when set, is the first task, handed over as soon as the agent is up and capped at 8 KB like a send.

type OpenURLParams

type OpenURLParams struct {
	Session string `json:"session"`
	URL     string `json:"url"`
}

OpenURLParams loads URL, http or https, in the browser of Session, its id as ListSessions returns it, which the person sees beside that session's terminal.

type OpenedSession

type OpenedSession struct {
	ID        string      `json:"id"`
	ProjectID string      `json:"projectId"`
	Project   string      `json:"project"`
	Label     string      `json:"label"`
	Name      string      `json:"name"`
	Kind      string      `json:"kind"`
	Path      string      `json:"path"`
	Confined  bool        `json:"confined"`
	Task      *SendResult `json:"task,omitempty"`
	TaskError string      `json:"taskError,omitempty"`
}

OpenedSession is the session opened: its id, its project, the Label and Name it is addressed by, its provider, the worktree Path it runs in (empty in the project's own directory) and whether it runs Confined in the sandbox. When a prompt came with it, Task is that send's outcome, or TaskError why it did not reach the session, which is open either way.

type OpenedURL

type OpenedURL struct {
	URL   string `json:"url"`
	Title string `json:"title"`
}

OpenedURL is the page the browser landed on.

type PanelEdge

type PanelEdge string

type PanelNoticeProps

type PanelNoticeProps struct {
	Text string  `json:"text"`
	PadX float64 `json:"padX,omitempty"`
}

type PanelRowProps

type PanelRowProps struct {
	Live    bool    `json:"live,omitempty"`
	Edge    float64 `json:"edge,omitempty"`
	PadX    float64 `json:"padX,omitempty"`
	OnPress Handler `json:"onPress,omitempty"`
}

PanelRowProps draws its children as one row inset Edge from the panel's sides. Only a Live row lights under the pointer, across the panel's whole width.

type Permission

type Permission string

Permission names a part of lich an extension reads or acts on through calls and events. The manifest lists every one it uses, and lich refuses a call or a subscription that needs one it did not list.

const (
	// PermissionProjectsRead lists the open projects and their worktrees.
	PermissionProjectsRead Permission = "projects:read"
	// PermissionSessionsRead lists the live sessions and what each is doing.
	PermissionSessionsRead Permission = "sessions:read"
	// PermissionSessionsWrite opens sessions and types prompts into them.
	PermissionSessionsWrite Permission = "sessions:write"
	// PermissionSessionEvents subscribes to session.status.
	PermissionSessionEvents Permission = "events:session"
	// PermissionSessionsAsk puts side questions to Claude Code sessions and
	// reads their answers.
	PermissionSessionsAsk Permission = "sessions:ask"
	// PermissionServicesRead lists a project's services, reads their output
	// and subscribes to service.status.
	PermissionServicesRead Permission = "services:read"
	// PermissionServicesWrite starts, stops and restarts services.
	PermissionServicesWrite Permission = "services:write"
	// PermissionGitRead reads a checkout's git status and pull request.
	PermissionGitRead Permission = "git:read"
	// PermissionNotify raises desktop notifications.
	PermissionNotify Permission = "notify"
	// PermissionWindow shows a file in the dock and opens pages in a session's
	// browser.
	PermissionWindow Permission = "window"
)

func EventPermission

func EventPermission(name string) (Permission, bool)

EventPermission is the permission subscribing to the event name needs, and whether this build declares that event.

type PillProps

type PillProps struct {
	PadLeft  float64 `json:"padLeft,omitempty"`
	PadRight float64 `json:"padRight,omitempty"`
}

PillProps draws its children inside the pill.

type Place added in v0.2.0

type Place string

Place is where a surface lives. Empty is a full screen opened from the top bar. A dock surface is a tab of the dock beside the terminal and a panel one rises from the footer; both open from an item of the footer and follow the active session (see ContextData). A lich older than Place shows every surface as a full screen.

const (
	PlaceScreen Place = ""
	PlaceDock   Place = "dock"
	PlacePanel  Place = "panel"
)

type PopoverRowProps

type PopoverRowProps struct {
	OnPress Handler `json:"onPress,omitempty"`
}

PopoverRowProps draws its children as one clickable row.

type ProgressProps

type ProgressProps struct {
	Percent int `json:"percent"`
}

type Project

type Project struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Path string `json:"path"`
}

Project is an open project: its lich id, the name its tab shows and the directory it is rooted in.

type PullRequest

type PullRequest struct {
	Number int    `json:"number"`
	URL    string `json:"url"`
	Title  string `json:"title"`
	Head   string `json:"head"`
	Base   string `json:"base"`
}

PullRequest is a GitHub pull request as gh reports it.

type PullRequestResult

type PullRequestResult struct {
	PullRequest *PullRequest `json:"pullRequest"`
}

PullRequestResult carries the open pull request of the checkout's branch, nil when it has none open.

type PulseRingProps

type PulseRingProps struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Radius float64 `json:"radius"`
	Reach  float64 `json:"reach"`
	Color  string  `json:"color,omitempty"`
}

PulseRingProps beats a ring out from the circle at X, Y, Reach wide.

type RenderData

type RenderData struct {
	Surface   string     `json:"surface"`
	Path      string     `json:"path,omitempty"`
	Root      Node       `json:"root"`
	Shortcuts []Shortcut `json:"shortcuts,omitempty"`
}

RenderData replaces what a surface shows. Shortcuts are live while the surface is on screen. Path, for a dock or panel surface, is the checkout the tree was drawn for, as ContextData named it: the window draws it only while that checkout is the active one, and a placeholder until the tree for the active one arrives. An empty Path is drawn for every checkout.

type ResizeHandleProps

type ResizeHandleProps struct {
	Edge     PanelEdge `json:"edge"`
	Width    float64   `json:"width"`
	MinWidth float64   `json:"minWidth,omitempty"`
	MaxWidth float64   `json:"maxWidth,omitempty"`
	OnResize Handler   `json:"onResize,omitempty"`
}

type ResultData

type ResultData struct {
	ID    string          `json:"id"`
	Data  json.RawMessage `json:"data,omitempty"`
	Error string          `json:"error,omitempty"`
}

ResultData answers the call with ID: Data on success, Error otherwise.

type RingProps

type RingProps struct {
	X           float64 `json:"x"`
	Y           float64 `json:"y"`
	Width       float64 `json:"width"`
	Height      float64 `json:"height"`
	Radius      float64 `json:"radius,omitempty"`
	StrokeWidth float64 `json:"strokeWidth"`
	Color       string  `json:"color,omitempty"`
	Halo        string  `json:"halo,omitempty"`
}

RingProps is the props of DashedRing and MarchingRing, whose dashes travel around it. Halo outlines each dash.

type ScrollProps

type ScrollProps struct {
	Direction Direction `json:"direction,omitempty"`
}

type SectionHeadingProps

type SectionHeadingProps struct {
	Text      string     `json:"text"`
	Size      float64    `json:"size,omitempty"`
	Weight    FontWeight `json:"weight,omitempty"`
	Leading   float64    `json:"leading,omitempty"`
	PadTop    float64    `json:"padTop,omitempty"`
	PadRight  float64    `json:"padRight,omitempty"`
	PadBottom float64    `json:"padBottom,omitempty"`
	PadLeft   float64    `json:"padLeft,omitempty"`
}

type Segment

type Segment struct {
	Share int    `json:"share"`
	Color string `json:"color,omitempty"`
}

type SegmentBarProps

type SegmentBarProps struct {
	Segments []Segment `json:"segments"`
}

SegmentBarProps splits its bar by the Share of each segment.

type SelectTriggerProps

type SelectTriggerProps struct {
	Value string  `json:"value"`
	Width float64 `json:"width,omitempty"`
	Lead  *Node   `json:"lead,omitempty"`
}

SelectTriggerProps draws the closed face of a select. Put it inside a DropdownMenu to open choices from it.

type SendParams

type SendParams struct {
	Session     string `json:"session"`
	Project     string `json:"project,omitempty"`
	Prompt      string `json:"prompt"`
	WaitSeconds int    `json:"waitSeconds,omitempty"`
}

SendParams types Prompt at the prompt of Session, its label or id as ListSessions returns them, or holds it until the session reaches one. Project narrows the search when two projects share the label. Prompt is capped at 8 KB: name the paths to read rather than pasting them. WaitSeconds is how long the call holds for a quick answer, at most 90, which is also what 0 means.

type SendResult

type SendResult struct {
	Ticket string `json:"ticket"`
	Target string `json:"target"`
	Status string `json:"status"`
	Answer string `json:"answer"`
}

SendResult is a send's outcome. Status is "answered", with the session's Answer; "pending", still working when the wait ran out, under Ticket; "unread", "unanswered", "undelivered", "stopped" or "expired", with no answer. Target is the label of the session it went to.

type Service

type Service struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	Command       string `json:"command"`
	StartWithLich bool   `json:"startWithLich"`
	State         string `json:"state"`
	ExitCode      *int   `json:"exitCode,omitempty"`
	StartedAt     int64  `json:"startedAt"`
	StoppedAt     int64  `json:"stoppedAt"`
}

Service is a project service: State is "running", "stopping", "stopped" (exited 0 or asked to stop) or "failed" (exited on its own with ExitCode). StartedAt and StoppedAt are unix milliseconds, 0 for never.

type ServiceOutputResult

type ServiceOutputResult struct {
	Output string `json:"output"`
}

ServiceOutputResult is the service's console as it is now, terminal escapes included: what a running one printed so far, or what a stopped one printed in its last run. It is one read: call again for what came since.

type ServiceParams

type ServiceParams struct {
	Project string `json:"project"`
	Service string `json:"service"`
}

ServiceParams names a service of Project by its name, matched ignoring case.

type ServiceStatusData

type ServiceStatusData struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	ProjectID string `json:"projectId"`
	State     string `json:"state"`
	ExitCode  *int   `json:"exitCode,omitempty"`
}

ServiceStatusData is a service's new State, as on a Service, with the id and name of the service and the project it belongs to.

type ServicesParams

type ServicesParams struct {
	Project string `json:"project"`
}

ServicesParams names the project, by name or directory path. It is required.

type Session

type Session struct {
	Label       string `json:"label"`
	Name        string `json:"name"`
	Project     string `json:"project"`
	Kind        string `json:"kind"`
	State       string `json:"state"`
	ID          string `json:"id"`
	Path        string `json:"path"`
	ProjectPath string `json:"projectPath"`
	Tool        string `json:"tool,omitempty"`
	Detail      string `json:"detail,omitempty"`
	Reason      string `json:"reason,omitempty"`
	Focused     bool   `json:"focused,omitempty"`
}

Session is a live session. Label is the name on its card and how it is addressed, unique within its Project; Name is the second name it answers to, empty for Claude Code. Kind is the provider running in it (claude, codex, antigravity, opencode, omp, crush, cursor, kiro or shell). State is what it last reported: "busy" mid-turn, "done" free, "waiting" blocked on a person; empty when it reported nothing, which says nothing about whether it is free, since only some providers report. A busy session may carry Tool and Detail, the tool it runs and what it acts on, and a waiting one Reason. Path is the directory it runs in and ProjectPath its project's root. Focused marks the card the window has on screen.

type SessionStatusData

type SessionStatusData struct {
	ID     string `json:"id"`
	State  string `json:"state"`
	Tool   string `json:"tool,omitempty"`
	Detail string `json:"detail,omitempty"`
	Reason string `json:"reason,omitempty"`
}

SessionStatusData is a session's new state: ID is the Session's ID, State one of "busy", "done", "waiting", "idle", "compacting" or "interrupted", with Tool, Detail and Reason as on a Session.

type Shortcut

type Shortcut struct {
	Keys    string  `json:"keys"`
	Handler Handler `json:"handler"`
}

Shortcut calls Handler when Keys is pressed, spelled as "r", "shift+g" or "ctrl+k". While a field has focus only a chord with ctrl fires.

type ShowCodeParams

type ShowCodeParams struct {
	Session string `json:"session"`
	Path    string `json:"path"`
	Line    int    `json:"line,omitempty"`
	EndLine int    `json:"endLine,omitempty"`
	Comment string `json:"comment,omitempty"`
}

ShowCodeParams opens Path, relative to the checkout of Session (its id as ListSessions returns it) or absolute inside it, at Line through EndLine, 1-based and inclusive, 0 leaving them out. Comment is plain text shown under the lines, at most 360 characters, and needs Line.

type ShownCode

type ShownCode struct {
	Session string `json:"session"`
	Path    string `json:"path"`
	Line    int    `json:"line,omitempty"`
	EndLine int    `json:"endLine,omitempty"`
}

ShownCode is what the dock shows: Path relative to the session's checkout.

type Side

type Side string

type Size

type Size string

type SizeProps

type SizeProps struct {
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
}

SizeProps is the props of NotifyDot, which sits in the top right corner of a button of this size.

type SkeletonBarProps

type SkeletonBarProps struct {
	Width  float64 `json:"width,omitempty"`
	Line   float64 `json:"line,omitempty"`
	Height float64 `json:"height,omitempty"`
}

type SkeletonFillProps

type SkeletonFillProps struct {
	MaxRows int     `json:"maxRows,omitempty"`
	PadY    float64 `json:"padY,omitempty"`
}

SkeletonFillProps repeats its children, in turn, as rows down to the bottom of its parent or MaxRows of them.

type SkeletonProps

type SkeletonProps struct {
	Width  float64 `json:"width,omitempty"`
	Height float64 `json:"height,omitempty"`
}

type SkeletonRowProps

type SkeletonRowProps struct {
	PadX float64 `json:"padX,omitempty"`
	PadY float64 `json:"padY,omitempty"`
}

type SkeletonTextProps

type SkeletonTextProps struct {
	Size  float64 `json:"size,omitempty"`
	Width float64 `json:"width,omitempty"`
}

type SortableListProps

type SortableListProps struct {
	Gap        float64 `json:"gap,omitempty"`
	Horizontal bool    `json:"horizontal,omitempty"`
	Within     bool    `json:"within,omitempty"`
	Leaves     bool    `json:"leaves,omitempty"`
	Group      string  `json:"group,omitempty"`
	OnReorder  Handler `json:"onReorder,omitempty"`
	OnMove     Handler `json:"onMove,omitempty"`
}

SortableListProps reorders its keyed children; OnReorder carries the keys in their new order. Lists on one surface with the same non-empty Group exchange items: an item dropped into another list fires that list's OnMove with the item's key, the index it landed at and the source list's key, and the source fires no OnReorder. Keys are unique across a group.

type SpinnerProps

type SpinnerProps struct {
	Size  float64 `json:"size,omitempty"`
	Color string  `json:"color,omitempty"`
}

type SplitPaneProps

type SplitPaneProps struct {
	Direction Direction `json:"direction,omitempty"`
	Ratio     float64   `json:"ratio"`
	MinRatio  float64   `json:"minRatio,omitempty"`
	MaxRatio  float64   `json:"maxRatio,omitempty"`
	Gap       float64   `json:"gap,omitempty"`
	MinFirst  float64   `json:"minFirst,omitempty"`
	MinSecond float64   `json:"minSecond,omitempty"`
	OnResize  Handler   `json:"onResize,omitempty"`
}

SplitPaneProps draws its two children side by side (row) or one over the other (column), with a divider Gap wide between them. Ratio is the share the first takes, held between MinRatio and MaxRatio (0 means 1) and MinFirst and MinSecond. OnResize carries the new ratio in EventData.Ratio when a drag ends.

type StatProps

type StatProps struct {
	Text  string `json:"text"`
	Color string `json:"color,omitempty"`
}

StatProps is the props of Stat, which draws its first child, a glyph the extension sizes (an icon, or a busyRing for work in flight), and Text after it.

type StrokeArcProps

type StrokeArcProps struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Radius float64 `json:"radius"`
	Width  float64 `json:"width"`
	Start  float64 `json:"start,omitempty"`
	Sweep  float64 `json:"sweep"`
	Color  string  `json:"color,omitempty"`
}

StrokeArcProps strokes an arc of the circle at X, Y, from Start sweeping Sweep radians, clockwise from three o'clock.

type SubscribeParams

type SubscribeParams struct {
	Names []string `json:"names"`
}

SubscribeParams names the events to start, adding to any already started.

type Surface

type Surface struct {
	ID       string `json:"id"`
	Title    string `json:"title"`
	Icon     Icon   `json:"icon,omitempty"`
	IconFile string `json:"iconFile,omitempty"`
	Place    Place  `json:"place,omitempty"`
}

Surface is a screen the extension draws, living where Place says. IconFile is a PNG relative to the manifest's directory, drawn in place of Icon in its own colors, or in the theme's when every visible pixel is black; Icon is still what a lich older than IconFile draws.

type SurfaceData

type SurfaceData struct {
	Surface  string `json:"surface"`
	Language string `json:"language,omitempty"`
}

SurfaceData names a surface the person opened or left. Answer surface.opened with a render: lich keeps only what reaches an open window, so a render sent before the surface opened may never be drawn. A process that starts while its surface is on screen is sent surface.opened again. Language is the tag of the interface's language, on surface.opened only.

type SwitchProps

type SwitchProps struct {
	Checked  bool       `json:"checked,omitempty"`
	Size     SwitchSize `json:"size,omitempty"`
	Disabled bool       `json:"disabled,omitempty"`
	OnChange Handler    `json:"onChange,omitempty"`
}

type SwitchSize

type SwitchSize string

type TabsOrientation

type TabsOrientation string

type TabsProps

type TabsProps struct {
	Selected    int             `json:"selected,omitempty"`
	Triggers    []TabsTrigger   `json:"triggers"`
	Variant     TabsVariant     `json:"variant,omitempty"`
	Orientation TabsOrientation `json:"orientation,omitempty"`
	OnChange    Handler         `json:"onChange,omitempty"`
}

type TabsTrigger

type TabsTrigger struct {
	Text     string `json:"text,omitempty"`
	Icon     Icon   `json:"icon,omitempty"`
	Trailing *Node  `json:"trailing,omitempty"`
	Disabled bool   `json:"disabled,omitempty"`
}

type TabsVariant

type TabsVariant string

type TagProps

type TagProps struct {
	Text  string `json:"text"`
	Color string `json:"color,omitempty"`
}

type TextAlign

type TextAlign string

type TextProps

type TextProps struct {
	Text string `json:"text"`
}

type TextareaProps

type TextareaProps struct {
	Value       string `json:"value,omitempty"`
	Placeholder string `json:"placeholder,omitempty"`
	Resizable   bool   `json:"resizable,omitempty"`
	// Grow takes the room its box leaves, as a scroll does, up to MaxHeight;
	// text past it scrolls.
	Grow      bool    `json:"grow,omitempty"`
	MaxHeight float64 `json:"maxHeight,omitempty"`
	Width     float64 `json:"width,omitempty"`
	Disabled  bool    `json:"disabled,omitempty"`
	Invalid   bool    `json:"invalid,omitempty"`
	OnChange  Handler `json:"onChange,omitempty"`
}

type TinyChipProps

type TinyChipProps struct {
	Word string `json:"word"`
	Tone string `json:"tone,omitempty"`
}

type ToastButton

type ToastButton struct {
	Label   string  `json:"label"`
	OnPress Handler `json:"onPress,omitempty"`
}

type ToastData

type ToastData struct {
	ID          string         `json:"id,omitempty"`
	Variant     ToastVariant   `json:"variant,omitempty"`
	Title       string         `json:"title"`
	Description string         `json:"description,omitempty"`
	Action      *ToastButton   `json:"action,omitempty"`
	Cancel      *ToastButton   `json:"cancel,omitempty"`
	Secondary   *ToastButton   `json:"secondary,omitempty"`
	Icon        Icon           `json:"icon,omitempty"`
	IconColor   string         `json:"iconColor,omitempty"`
	Spin        bool           `json:"spin,omitempty"`
	Lines       []ToastLine    `json:"lines,omitempty"`
	Progress    *ToastProgress `json:"progress,omitempty"`
	DurationMs  int            `json:"durationMs,omitempty"`
	OnDismiss   Handler        `json:"onDismiss,omitempty"`
}

ToastData raises a toast. A toast with the ID of one on screen replaces it; DurationMs 0 is the window's default.

type ToastLine

type ToastLine struct {
	Icon Icon   `json:"icon,omitempty"`
	Text string `json:"text"`
}

type ToastProgress

type ToastProgress struct {
	Percent int `json:"percent"`
}

ToastProgress is a bar from 0 to 100, negative while the total is unknown.

type ToastVariant

type ToastVariant string

type ToggleGroupProps

type ToggleGroupProps struct {
	Value      string        `json:"value,omitempty"`
	Items      []ToggleItem  `json:"items"`
	Variant    ToggleVariant `json:"variant,omitempty"`
	Size       ToggleSize    `json:"size,omitempty"`
	ItemHeight float64       `json:"itemHeight,omitempty"`
	ItemPadX   float64       `json:"itemPadX,omitempty"`
	ItemText   float64       `json:"itemText,omitempty"`
	OnChange   Handler       `json:"onChange,omitempty"`
}

type ToggleItem

type ToggleItem struct {
	Value    string `json:"value"`
	Text     string `json:"text,omitempty"`
	Icon     Icon   `json:"icon,omitempty"`
	Disabled bool   `json:"disabled,omitempty"`
}

type ToggleProps

type ToggleProps struct {
	Pressed  bool          `json:"pressed,omitempty"`
	Text     string        `json:"text,omitempty"`
	Icon     Icon          `json:"icon,omitempty"`
	Variant  ToggleVariant `json:"variant,omitempty"`
	Size     ToggleSize    `json:"size,omitempty"`
	Height   float64       `json:"height,omitempty"`
	PadX     float64       `json:"padX,omitempty"`
	TextSize float64       `json:"textSize,omitempty"`
	Disabled bool          `json:"disabled,omitempty"`
	OnChange Handler       `json:"onChange,omitempty"`
}

type ToggleSize

type ToggleSize string

type ToggleVariant

type ToggleVariant string

type TooltipProps

type TooltipProps struct {
	Text    string         `json:"text,omitempty"`
	Content *Node          `json:"content,omitempty"`
	Variant TooltipVariant `json:"variant,omitempty"`
	Side    Side           `json:"side,omitempty"`
}

TooltipProps wraps its child. Content replaces Text for a card tooltip.

type TooltipVariant

type TooltipVariant string

type TrailingIconLinkProps

type TrailingIconLinkProps struct {
	Label   string  `json:"label"`
	Icon    Icon    `json:"icon"`
	OnPress Handler `json:"onPress,omitempty"`
}

type TrayProps

type TrayProps struct {
	Fill string `json:"fill,omitempty"`
}

TrayProps draws its children on a rounded Fill.

type TriggerChevronProps

type TriggerChevronProps struct {
	Open bool `json:"open,omitempty"`
}

type TwoLinesProps

type TwoLinesProps struct {
	Top   string `json:"top"`
	Under string `json:"under,omitempty"`
}

type Variant

type Variant string

type WordProps

type WordProps struct {
	Word string `json:"word"`
}

type Worktree

type Worktree struct {
	Name     string   `json:"name"`
	Path     string   `json:"path"`
	Dirty    bool     `json:"dirty"`
	Sessions []string `json:"sessions"`
}

Worktree is one git worktree of a project other than its own directory: its branch, where it is, whether it holds uncommitted work and the labels of the sessions open in it.

type WorktreesParams

type WorktreesParams struct {
	Project string `json:"project"`
}

WorktreesParams names the project, by name or directory path. It is required: a call comes from no session to take a project from.

type WrapItemProps

type WrapItemProps struct {
	MarginAuto bool `json:"marginAuto,omitempty"`
}

type WrapProps

type WrapProps struct {
	GapX         float64 `json:"gapX,omitempty"`
	GapY         float64 `json:"gapY,omitempty"`
	Justify      Justify `json:"justify,omitempty"`
	ContentStart bool    `json:"contentStart,omitempty"`
}

Directories

Path Synopsis
Package i18n reads lich's translation catalogs: locales/<tag>/<namespace>.json, one tree per namespace, looked up by a dotted key ("settings.title").
Package i18n reads lich's translation catalogs: locales/<tag>/<namespace>.json, one tree per namespace, looked up by a dotted key ("settings.title").

Jump to

Keyboard shortcuts

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