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
- Variables
- func Call[P, R any](ctx context.Context, c *Conn, m Method[P, R], params P) (R, error)
- func EnumValues() map[string][]string
- func MethodNames() []string
- type AbbrBadgeProps
- type Align
- type Anchor
- type AnswerParams
- type AskParams
- type AskResult
- type AvatarProps
- type BoxProps
- type BusyRingProps
- type ButtonProps
- type CallData
- type CaptionDividerProps
- type CardIconButtonProps
- type CheckRowProps
- type CheckboxProps
- type CheckerProps
- type ChipProps
- type ClipboardData
- type CodeBlock
- type CodeViewProps
- type CollapseProps
- type ColorProps
- type Component
- type Conn
- func (c *Conn) Answer(ctx context.Context, params AnswerParams) (SendResult, error)
- func (c *Conn) Ask(ctx context.Context, params AskParams) (AskResult, error)
- func (c *Conn) GitStatus(ctx context.Context, path string) (GitStatusResult, error)
- func (c *Conn) Messages() <-chan Message
- func (c *Conn) Notify(ctx context.Context, title, body string) error
- func (c *Conn) OpenSession(ctx context.Context, params OpenSessionParams) (OpenedSession, error)
- func (c *Conn) OpenURL(ctx context.Context, session, url string) (OpenedURL, error)
- func (c *Conn) Projects(ctx context.Context) ([]Project, error)
- func (c *Conn) PullRequest(ctx context.Context, path string) (*PullRequest, error)
- func (c *Conn) RestartService(ctx context.Context, params ServiceParams) (Service, error)
- func (c *Conn) Send(msg Message) error
- func (c *Conn) SendToSession(ctx context.Context, params SendParams) (SendResult, error)
- func (c *Conn) ServiceOutput(ctx context.Context, params ServiceParams) (string, error)
- func (c *Conn) Services(ctx context.Context, project string) ([]Service, error)
- func (c *Conn) Sessions(ctx context.Context) ([]Session, error)
- func (c *Conn) ShowCode(ctx context.Context, params ShowCodeParams) (ShownCode, error)
- func (c *Conn) StartService(ctx context.Context, params ServiceParams) (Service, error)
- func (c *Conn) StopService(ctx context.Context, params ServiceParams) (Service, error)
- func (c *Conn) Subscribe(ctx context.Context, names ...string) error
- func (c *Conn) Worktrees(ctx context.Context, project string) ([]Worktree, error)
- type ContextMenuProps
- type CountBadgeProps
- type DashedBorderProps
- type DashedCircleProps
- type DialogProps
- type DiffBlock
- type DiffSide
- type DiffStatProps
- type DiffViewProps
- type Direction
- type DismissToastData
- type DonutGaugeProps
- type DotAtProps
- type DotProps
- type DropHintProps
- type DropTrayProps
- type DropdownMenuProps
- type DropdownPanelProps
- type EmptyStateProps
- type Event
- type EventData
- type FaceProps
- type FileIconProps
- type FileStat
- type FileTreeProps
- type FillIfProps
- type FillRRectProps
- type FillRowProps
- type FilletProps
- type FixedColumnProps
- type FocusData
- type FontWeight
- type FormLabelProps
- type GapProps
- type GaugeBarProps
- type GaugeRowProps
- type GhostIconButtonProps
- type GhostTextButtonProps
- type GitParams
- type GitStatusResult
- type GlyphProps
- type Handler
- type Icon
- type IconActionProps
- type IconColorProps
- type IconLabelProps
- type IconToggleProps
- type ImageFit
- type ImageProps
- type InlineEditProps
- type InputGroupProps
- type InputProps
- type InsetBorderProps
- type InsetRingProps
- type Justify
- type KeyCapProps
- type KeyHintProps
- type Kind
- type LabelFaceProps
- type LabelProps
- type LanguageData
- type LichEventData
- type LinkProps
- type Manifest
- type MarkdownProps
- type MarkedSegment
- type MarkedTextProps
- type MenuEntry
- type MenuEntryKind
- type MenuHeaderProps
- type Message
- type MetaGlyphProps
- type Method
- type MutedGlyphProps
- type NavRowProps
- type NoParams
- type NoProps
- type Node
- type NotifyParams
- type OpenExternalData
- type OpenSessionParams
- type OpenURLParams
- type OpenedSession
- type OpenedURL
- type PanelEdge
- type PanelNoticeProps
- type PanelRowProps
- type Permission
- type PillProps
- type PopoverRowProps
- type ProgressProps
- type Project
- type PullRequest
- type PullRequestResult
- type PulseRingProps
- type RenderData
- type ResizeHandleProps
- type ResultData
- type RingProps
- type ScrollProps
- type SectionHeadingProps
- type Segment
- type SegmentBarProps
- type SelectTriggerProps
- type SendParams
- type SendResult
- type Service
- type ServiceOutputResult
- type ServiceParams
- type ServiceStatusData
- type ServicesParams
- type Session
- type SessionStatusData
- type Shortcut
- type ShowCodeParams
- type ShownCode
- type Side
- type Size
- type SizeProps
- type SkeletonBarProps
- type SkeletonFillProps
- type SkeletonProps
- type SkeletonRowProps
- type SkeletonTextProps
- type SortableListProps
- type SpinnerProps
- type SplitPaneProps
- type StatProps
- type StrokeArcProps
- type SubscribeParams
- type Surface
- type SurfaceData
- type SwitchProps
- type SwitchSize
- type TabsOrientation
- type TabsProps
- type TabsTrigger
- type TabsVariant
- type TagProps
- type TextAlign
- type TextProps
- type TextareaProps
- type TinyChipProps
- type ToastButton
- type ToastData
- type ToastLine
- type ToastProgress
- type ToastVariant
- type ToggleGroupProps
- type ToggleItem
- type ToggleProps
- type ToggleSize
- type ToggleVariant
- type TooltipProps
- type TooltipVariant
- type TrailingIconLinkProps
- type TrayProps
- type TriggerChevronProps
- type TwoLinesProps
- type Variant
- type WordProps
- type Worktree
- type WorktreesParams
- type WrapItemProps
- type WrapProps
Constants ¶
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" )
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.
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.
const ManifestFile = "manifest.json"
ManifestFile is the name of the manifest in an extension's directory.
const ManifestFormat = 1
ManifestFormat is the newest manifest format this package reads.
const ProtocolVersion = 1
ProtocolVersion is the version of the JSON this package writes.
const ToastForever = -1
ToastForever as DurationMs keeps a toast up until it is dismissed.
Variables ¶
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") )
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") )
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") )
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") )
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") )
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") FireEvent = kind[EventData]("event") SurfaceOpened = kind[SurfaceData]("surface.opened") SurfaceClosed = kind[SurfaceData]("surface.closed") Language = kind[LanguageData]("language") )
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.
var ( Tooltip = component[TooltipProps]("tooltip") DropdownMenu = component[DropdownMenuProps]("dropdownMenu") ContextMenu = component[ContextMenuProps]("contextMenu") DropdownPanel = component[DropdownPanelProps]("dropdownPanel") Dialog = component[DialogProps]("dialog") )
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") 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") )
var ( Markdown = component[MarkdownProps]("markdown") CodeView = component[CodeViewProps]("codeView") DiffView = component[DiffViewProps]("diffView") FileTree = component[FileTreeProps]("fileTree") )
var ErrClosed = errors.New("extension: lich closed the connection")
ErrClosed is what a call returns once lich has closed the connection.
var Permissions = []Permission{ PermissionProjectsRead, PermissionSessionsRead, PermissionSessionsWrite, PermissionSessionEvents, PermissionSessionsAsk, PermissionServicesRead, PermissionServicesWrite, PermissionGitRead, PermissionNotify, PermissionWindow, }
Permissions is every permission this build knows, the names a manifest may list.
Functions ¶
func Call ¶
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 ¶
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 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 ButtonProps ¶
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 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 CheckboxProps ¶
type CheckerProps ¶
type ClipboardData ¶
type ClipboardData struct {
Text string `json:"text"`
}
ClipboardData replaces the clipboard's text.
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 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 (*Conn) Answer ¶
func (c *Conn) Answer(ctx context.Context, params AnswerParams) (SendResult, error)
Answer calls CollectAnswer.
func (*Conn) Messages ¶
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) OpenSession ¶
func (c *Conn) OpenSession(ctx context.Context, params OpenSessionParams) (OpenedSession, error)
OpenSession calls OpenSession.
func (*Conn) PullRequest ¶
PullRequest calls GitPullRequest for the checkout at path: nil when its branch has no open pull request.
func (*Conn) RestartService ¶
RestartService calls RestartService.
func (*Conn) Send ¶
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 ¶
ServiceOutput calls ServiceOutput.
func (*Conn) StartService ¶
StartService calls StartService.
func (*Conn) StopService ¶
StopService calls StopService.
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 DashedCircleProps ¶
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 DiffStatProps ¶
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 DismissToastData ¶
type DismissToastData struct {
ID string `json:"id"`
}
type DonutGaugeProps ¶
type DotAtProps ¶
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 ¶
type DropdownMenuProps struct {
Entries []MenuEntry `json:"entries"`
}
DropdownMenuProps opens Entries from its child.
type DropdownPanelProps ¶
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.
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 FileStat ¶
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 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 ¶
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 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 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 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 IconActionProps ¶
type IconColorProps ¶
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 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 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 InsetRingProps ¶
type KeyCapProps ¶
type KeyCapProps struct {
Keys string `json:"keys"`
}
type KeyHintProps ¶
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 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 ¶
MarkdownProps draws Text as Markdown. OnOpen carries the URL of a clicked link in EventData.Text.
type MarkedSegment ¶
type MarkedTextProps ¶
type MarkedTextProps struct {
Segments []MarkedSegment `json:"segments"`
}
type MenuEntry ¶
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 ¶
type MenuEntryKind string
type MenuHeaderProps ¶
type Message ¶
Message is one line of the conversation between lich and an extension.
func (*Message) UnmarshalJSON ¶
UnmarshalJSON decodes Data into the type its kind declares.
type MetaGlyphProps ¶
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]) 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 NavRowProps ¶
type NavRowProps struct {
}
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 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 ¶
UnmarshalJSON decodes Props into the type its component declares.
type NotifyParams ¶
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 ¶
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 PanelNoticeProps ¶
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.
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 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 ¶
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"`
Root Node `json:"root"`
Shortcuts []Shortcut `json:"shortcuts,omitempty"`
}
RenderData replaces what a surface shows. Shortcuts are live while the surface is on screen.
type ResizeHandleProps ¶
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 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 ¶
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 ¶
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 SizeProps ¶
SizeProps is the props of NotifyDot, which sits in the top right corner of a button of this size.
type SkeletonBarProps ¶
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 SkeletonRowProps ¶
type SkeletonTextProps ¶
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 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 ¶
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"`
}
Surface is a full screen the extension draws, opened from the top bar.
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 TabsVariant ¶
type TabsVariant string
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 ToastButton ¶
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 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 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 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 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"`
}
Source Files
¶
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"). |