{"modulePath":"github.com/lichdotdev/lich","version":"v0.93.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\nPackage api is the contract between the lich backend and its clients: the window (native/backend), \\`lich\\` and \\`lich mcp\\`. Each RPC is declared here once, as a Method whose type parameters are what it takes and what it returns, so a client and the backend that disagree on either do not compile.\n\nOn the wire a call is a JSON array holding its one options object, or empty for a method that takes nothing: the envelope internal/rpc has always read, which keeps a \\`lich\\` of another release talking to this backend. Fields are matched by name, never by position, so an option one side does not know is dropped and one it does not send is its zero value.\n\nThe package is pure Go with no dependency beyond the standard library: the window's module imports it, and must not reach internal/. testdata/contract.golden records every method's shape; a change to it is a change to the contract, visible in review.\n\n## Constants\n\n```go\nconst (\n\tDownloadInProgress = \"inProgress\"\n\tDownloadCompleted  = \"completed\"\n\tDownloadCanceled   = \"canceled\"\n\tDownloadFailed     = \"failed\"\n)\n```\nDownload states, Chrome's own (Browser.downloadProgress), and lich's DownloadFailed: Chrome completed it, and moving it into Downloads failed.\n\n```go\nconst (\n\tTabNew    = \"new\"\n\tTabSelect = \"select\"\n\tTabClose  = \"close\"\n)\n```\nTab actions: open a blank tab in front, bring Tab to the front, close Tab.\n\n```go\nconst (\n\tDialogAccepted  = \"accepted\"\n\tDialogDismissed = \"dismissed\"\n)\n```\nDialog answers, as a page answer reports one the person gave.\n\n```go\nconst (\n\tExtensionInvalid    = \"invalid\"\n\tExtensionRunning    = \"running\"\n\tExtensionRestarting = \"restarting\"\n\tExtensionFailed     = \"failed\"\n\tExtensionStopped    = \"stopped\"\n)\n```\nThe states an Extension is in. Invalid never started, its Error says why; restarting is the wait after a crash; failed is lich having given up on it.\n\n```go\nconst (\n\tGitRefLocal  = \"local\"\n\tGitRefRemote = \"remote\"\n\tGitRefTag    = \"tag\"\n)\n```\nA GitRef's Kind, read from its full name: a remote branch called origin/x and a local branch called origin/x are both spelled the same short.\n\n```go\nconst (\n\tGitChunkOurs     = \"ours\"\n\tGitChunkTheirs   = \"theirs\"\n\tGitChunkBoth     = \"both\" // both sides made the same change\n\tGitChunkConflict = \"conflict\"\n)\n```\nA GitConflictChunk's Kind: which side changed the base there.\n\n```go\nconst (\n\tCheckOK    = \"ok\"\n\tCheckEmpty = \"empty\"\n)\n```\nThe Status of a BinaryCheck that passed, and of one with nothing to check; every other value is a failure.\n\n```go\nconst (\n\tQuotaWindowSession      = \"session\"\n\tQuotaWindowWeekly       = \"weekly\"\n\tQuotaWindowMonthly      = \"monthly\"\n\tQuotaWindowUsage        = \"usage\"\n\tQuotaWindowCursorModels = \"cursorModels\"\n\tQuotaWindowOtherModels  = \"otherModels\"\n\tQuotaWindowOnDemand     = \"onDemand\"\n)\n```\n\n```go\nconst (\n\tWatchChecksFailed = \"checks-failed\"\n\tWatchChecksPassed = \"checks-passed\"\n\tWatchReview       = \"review\"\n)\n```\nThe conditions a session's watch waits for, read from the pull request of the session's branch.\n\n```go\nconst (\n\tScheduledByAgent = \"agent\"\n\tScheduledByLich  = \"lich\"\n)\n```\nWho set a scheduled prompt or a watch, when not the person at the window.\n\n```go\nconst (\n\tServiceStopped  = \"stopped\"\n\tServiceRunning  = \"running\"\n\tServiceStopping = \"stopping\"\n\tServiceFailed   = \"failed\"\n)\n```\nThe states a Service is in. A service that is not running is stopped when it exited on its own with 0 or because it was asked to (Stop, or Ctrl+C typed at its console), and failed when it exited on its own with anything else.\n\n```go\nconst CheckLogLines = 80\n```\nCheckLogLines is how much of a failing step reaches the agent unless it asks for more: on lich's own failed runs the error and the lines that explain it sit within the last few dozen.\n\n```go\nconst MaxEventBytes = 8 \u003c\u003c 20\n```\nMaxEventBytes is what the window's /events socket reads in one message: one over it ends that socket for every session. The backend bounds what it sends (a browser frame, an extension's line) below it, leaving room for the envelope, so the two sides share this value instead of each keeping a copy.\n\n```go\nconst WatchRunLimit = 3\n```\nWatchRunLimit is how many times a watch fires on one pull request before it stops. An agent answering failing checks with commits is a loop nobody is watching, and three tries is where a person should look.\n\n## Variables\n\n```go\nvar (\n\tAgentPluginStatus  = define[None, []PluginStatus](\"agentplugin.Status\")\n\tAgentPluginInstall = define[PluginProviderOptions, None](\"agentplugin.Install\")\n\tAgentPluginUpdate  = define[PluginProviderOptions, None](\"agentplugin.Update\")\n)\n```\n\n```go\nvar (\n\tAppUpdateGetStatus = define[None, AppUpdateStatus](\"appupdate.Status\")\n\tAppUpdateApply     = define[None, None](\"appupdate.Apply\")\n)\n```\n\n```go\nvar (\n\t// ArtifactList is every open session's artifacts, for a window that has\n\t// just attached; ArtifactsEvent keeps it current from there.\n\tArtifactList = define[None, []SessionArtifacts](\"artifact.List\")\n\n\t// ArtifactAttach puts one of From's artifacts where SessionID can read it\n\t// and answers with the path and notice to paste at its prompt: From's own\n\t// path and no notice when the two are the same session, a copy in\n\t// SessionID's artifact folder otherwise.\n\tArtifactAttach = define[AttachArtifactOptions, DropAttachment](\"artifact.Attach\")\n\n\t// ArtifactOpen loads From's artifact Name in SessionID's browser, starting\n\t// one when SessionID has none. The page is served from From's own folder\n\t// and origin. Window only: a confined token is refused it\n\t// (internal/scope), since it would let one session read another's pages.\n\tArtifactOpen = define[AttachArtifactOptions, None](\"artifact.Open\")\n\n\t// ArtifactsEvent carries one open session's whole artifact list each time\n\t// its folder changes, and an empty one when the session closes.\n\tArtifactsEvent = defineEvent[SessionArtifacts](\"artifacts\")\n)\n```\n\n```go\nvar (\n\tBrowserShow = define[SessionIDOptions, BrowserHandle](\"browser.Show\")\n\tBrowserOpen = define[BrowserOpenOptions, BrowserHandle](\"browser.Open\")\n\tBrowserInfo = define[BrowserInfoOptions, BrowserPageInfo](\"browser.Info\")\n\t// Click and Press answer with the page as it stands after them, so an\n\t// agent reads what its action did without a browser.Info of its own. Type\n\t// does not: typing into a field seldom changes the page, and a page per\n\t// field filled cost a fifth of a session's page text (measured\n\t// 2026-10-26).\n\tBrowserClick      = define[BrowserClickOptions, BrowserPageInfo](\"browser.Click\")\n\tBrowserType       = define[BrowserTypeOptions, None](\"browser.Type\")\n\tBrowserPress      = define[BrowserPressOptions, BrowserPageInfo](\"browser.Press\")\n\tBrowserScreenshot = define[BrowserScreenshotOptions, string](\"browser.Screenshot\")\n\tBrowserNavigate   = define[BrowserOpenOptions, BrowserHandle](\"browser.Navigate\")\n\tBrowserReload     = define[SessionIDOptions, None](\"browser.Reload\")\n\tBrowserBack       = define[SessionIDOptions, None](\"browser.Back\")\n\tBrowserForward    = define[SessionIDOptions, None](\"browser.Forward\")\n\tBrowserScroll     = define[BrowserScrollOptions, None](\"browser.Scroll\")\n\tBrowserList       = define[SessionIDOptions, []BrowserHandle](\"browser.List\")\n\tBrowserClose      = define[SessionIDOptions, None](\"browser.Close\")\n\n\t// BrowserEval runs the agent's script in the page and answers with its\n\t// value: a string as it is, anything else as JSON.\n\tBrowserEval = define[BrowserEvalOptions, string](\"browser.Eval\")\n\n\t// BrowserTabs lists the browser's tabs; BrowserTabAction is the agent\n\t// opening, selecting or closing one, answered with the page then in front.\n\tBrowserTabs      = define[SessionIDOptions, []BrowserTab](\"browser.Tabs\")\n\tBrowserTabAction = define[BrowserTabOptions, BrowserPageInfo](\"browser.TabAction\")\n\t// BrowserAnswerDialog answers the JavaScript dialog the page holds open,\n\t// and answers with the page as it stands after it.\n\tBrowserAnswerDialog = define[BrowserDialogOptions, BrowserPageInfo](\"browser.AnswerDialog\")\n\n\t// The window's side: a pane that shows a session's page and passes the\n\t// person's input to it, beside the agent driving the same page.\n\tBrowserRunning = define[None, []BrowserState](\"browser.Running\")\n\tBrowserAttach  = define[BrowserViewOptions, BrowserHandle](\"browser.Attach\")\n\tBrowserDetach  = define[SessionIDOptions, None](\"browser.Detach\")\n\tBrowserResize  = define[BrowserViewOptions, None](\"browser.Resize\")\n\t// BrowserKeep answers BrowserState.Idle with keep: the browser stays and\n\t// is asked about again after another idle window. browser.Close answers\n\t// it with close.\n\tBrowserKeep = define[SessionIDOptions, None](\"browser.Keep\")\n\t// BrowserDefaultView is the window's size, which a page no pane shows\n\t// lays out at.\n\tBrowserDefaultView = define[BrowserDefaultViewOptions, None](\"browser.DefaultView\")\n\tBrowserMouse       = define[BrowserMouseOptions, None](\"browser.Mouse\")\n\tBrowserKey         = define[BrowserKeyOptions, None](\"browser.Key\")\n\tBrowserText        = define[BrowserTextOptions, None](\"browser.Text\")\n\tBrowserNav         = define[BrowserNavOptions, None](\"browser.Nav\")\n\t// BrowserTabNav is the person opening, selecting or closing a tab in the\n\t// pane, the window's side of BrowserTabAction.\n\tBrowserTabNav = define[BrowserTabOptions, None](\"browser.TabNav\")\n\t// BrowserDevTools is the person opening Chrome's DevTools for the front\n\t// tab in the pane, as a tab of its own, or selecting it when it is open.\n\t// The agent never sees that tab.\n\tBrowserDevTools = define[SessionIDOptions, None](\"browser.DevTools\")\n\t// BrowserAnswer is the person answering the page's open dialog in the\n\t// pane, the window's side of BrowserAnswerDialog.\n\tBrowserAnswer = define[BrowserDialogOptions, None](\"browser.Answer\")\n\t// BrowserSelection is the text selected in the page, which the pane\n\t// copies to the system clipboard: the headless browser's own clipboard\n\t// is not the person's.\n\tBrowserSelection = define[SessionIDOptions, string](\"browser.Selection\")\n\t// BrowserElementAt is the element under a point of the page, for a note\n\t// the person leaves on it; BrowserLocate is where noted elements stand\n\t// now, after the page scrolled or changed.\n\tBrowserElementAt = define[BrowserPointOptions, BrowserElement](\"browser.ElementAt\")\n\tBrowserLocate    = define[BrowserLocateOptions, []BrowserRect](\"browser.Locate\")\n)\n```\n\n```go\nvar (\n\t// BrowserStateEvent is emitted whenever a session's browser starts, closes,\n\t// moves to a window or loads another page, so the one store the window\n\t// keeps of them stays true.\n\tBrowserStateEvent = defineEvent[BrowserState](\"browser-state\")\n\n\t// BrowserFrameEvents carries a base64 JPEG of a session's page while a pane\n\t// shows it, and a PNG once the page is still: per session, like terminal\n\t// output, so only that pane listens.\n\tBrowserFrameEvents = defineEventFamily[BrowserFrame](\"browser:frame:\")\n\n\t// BrowserAgentEvent is emitted each time the agent acts on its page, so the\n\t// pane can show that the page moved because of it, and where it clicked.\n\tBrowserAgentEvent = defineEvent[BrowserAgentAct](\"browser-agent\")\n\n\t// BrowserDownloadEvent is emitted when a file a session's page downloaded\n\t// is complete on disk, so the person learns where it went.\n\tBrowserDownloadEvent = defineEvent[BrowserDownload](\"browser-download\")\n)\n```\n\n```go\nvar (\n\t// SessionStatusEvent carries a session's processing state ({id, state, tool,\n\t// detail, reason, program} — \"busy\"/\"done\"/\"waiting\"/\"idle\"/\"compacting\", plus the tool\n\t// a pre-tool report names and what a waiting one is blocked on), reported by\n\t// the lich hooks running inside the PTY (see transport.hook and\n\t// docs/hooks/session-state.md). \"interrupted\" is the one value lich raises\n\t// itself, for a turn the user stopped at the PTY. The window keeps it in a\n\t// store keyed by id (statusStore, native/cmd/lich- native/status.go).\n\tSessionStatusEvent = defineEvent[SessionStatus](\"session-status\")\n\n\t// SessionUsageEvent carries a session's context-window usage ({id, percent,\n\t// tokens}), emitted after a turn ends. Global like the other session events.\n\tSessionUsageEvent = defineEvent[SessionUsage](\"session-usage\")\n\n\t// SessionTitleEvent carries a session's new name ({id, label}), so every card\n\t// takes it without a reload: the auto-applied ai-title, and a rename the store\n\t// has written, whoever asked (the window, `lich rename` or the MCP tool). One\n\t// event for both because the payload is the same pair and the window's answer\n\t// to both is the same: relabel that card.\n\tSessionTitleEvent = defineEvent[SessionTitle](\"session-title\")\n\n\t// SessionTouchedEvent carries the id of a session that likely changed files on\n\t// disk, nudging an immediate git-status refresh ahead of the steady poll.\n\tSessionTouchedEvent = defineEvent[SessionTouched](\"session-touched\")\n\n\t// SessionAgentEvent carries which provider CLI is live inside a session's PTY\n\t// ({id, agent}) — reported through the session-start hook by whichever\n\t// provider ships it, so a shell card shows that provider's mark while its CLI\n\t// runs in it. An empty agent clears the mark; every PTY spawn emits that clear\n\t// so a respawned session never wears a dead agent's icon.\n\tSessionAgentEvent = defineEvent[SessionAgent](\"session-agent\")\n\n\t// SessionConversationEvent carries the provider conversation a session's row\n\t// now names ({id, providerSessionId}, \"\" once it names none), emitted after\n\t// the row is written: the window offers that conversation back when the\n\t// session's process exits.\n\tSessionConversationEvent = defineEvent[SessionConversation](\"session-conversation\")\n\n\t// SessionSandboxEvent carries whether a session's PTY runs confined ({id,\n\t// confined, skippedLinks}), emitted by every spawn. The card marks a confined\n\t// session, and the answer is the spawn's own — it takes the provider's rung,\n\t// the checkout and a per-session override to reach, so the window is told\n\t// rather than asked to work it out again. skippedLinks is what that sandbox\n\t// left out of the private home for being a symlink, which is the one absence a\n\t// session has no other way of learning about. Both persisted with the row\n\t// (store.Session's Sandbox and SandboxSkippedLinks), which is what a reopened\n\t// window hydrates from.\n\tSessionSandboxEvent = defineEvent[SessionSandbox](\"session-sandbox\")\n\n\t// SessionMCPEvent carries the MCP servers a session's provider could reach at\n\t// its spawn ({id, servers}), emitted by every spawn. The card divides a tool\n\t// name against them — two harnesses spell an MCP tool with a single underscore\n\t// between the server and the tool, which nothing in the string divides\n\t// (docs/hooks/session-state.md). Persisted with the row too (store.Session's\n\t// MCPServers), which is what a reopened window hydrates from: the PTY outlives\n\t// the window, so there is no second spawn to report it again.\n\tSessionMCPEvent = defineEvent[SessionMCP](\"session-mcp\")\n\n\t// SessionDuplicateEvent carries a session that just reported a conversation\n\t// another open card already runs ({id, heldBy}): a resume typed in the\n\t// provider's own TUI, which lich cannot stop, only point out. Emitted once the\n\t// report is stored, so the window can offer to switch to heldBy.\n\tSessionDuplicateEvent = defineEvent[SessionDuplicate](\"session-duplicate\")\n\n\t// SessionCwdEvent carries a session's live working directory ({id, cwd,\n\t// host}), emitted once with the directory the PTY starts in and again whenever\n\t// the child process moves (the user runs `cd`). A non-empty host names a\n\t// foreground process the directory cannot be read through (see shellHosts) and\n\t// comes with an empty cwd: the session is somewhere, but not somewhere this\n\t// machine can name. Global like the other session events.\n\tSessionCwdEvent = defineEvent[SessionCwd](\"session-cwd\")\n\n\t// SessionLimitEvent carries a turn a plan's usage limit ended ({id, window,\n\t// resetsAt}). Nothing clears it; the window reads plan quota again when it\n\t// arrives (planQuota, native/cmd/lich-native/footer_quota.go).\n\tSessionLimitEvent = defineEvent[SessionLimit](\"session-limit\")\n\n\t// SessionProfileOfferEvent carries another profile that could take a session:\n\t// one with quota left after a usage limit, or one the agent handing off to it\n\t// suggested. Nothing moves unless the person answers with\n\t// TerminalTakeProfileOffer.\n\tSessionProfileOfferEvent = defineEvent[SessionProfileOffer](\"session-profile-offer\")\n\n\t// SessionProfileEvent carries the profile a session moved to: Continue in, or\n\t// a resume that found its conversation in another profile.\n\tSessionProfileEvent = defineEvent[SessionProfile](\"session-profile\")\n\n\t// SessionTodoEvent carries how far a session got through the task list its\n\t// agent wrote for itself ({id, done, total}), emitted whenever that pair\n\t// changes. Global like the other session events.\n\t//\n\t// The pair is what the agent last wrote, not what is true: an agent that\n\t// abandons a list without closing its items leaves the card reporting the\n\t// count it was abandoned at, until it writes another one.\n\tSessionTodoEvent = defineEvent[SessionTodo](\"session-todo\")\n\n\t// PluginIncompatibleEvent carries a session whose hooks report from a plugin\n\t// release outside the range this lich speaks ({id, version}). The window\n\t// answers it by asking for the plugin status again, which is where the fix is\n\t// offered: an install moved by the harness's own marketplace shows up here\n\t// first.\n\tPluginIncompatibleEvent = defineEvent[PluginIncompatible](\"plugin-incompatible\")\n\n\t// TerminalDataEvents carries base64-encoded PTY output. Output is\n\t// base64-encoded because raw PTY bytes may split a multi-byte UTF-8 sequence\n\t// mid-read, which the JSON event bridge would otherwise corrupt.\n\tTerminalDataEvents = defineEventFamily[string](\"terminal:data:\")\n\n\t// TerminalExitEvents is emitted once when a session's shell process exits,\n\t// carrying the status it exited with (see SessionExit).\n\tTerminalExitEvents = defineEventFamily[SessionExit](\"terminal:exit:\")\n\n\t// SessionFocusEvent asks the window to open a session's card, the way a click\n\t// on it does. Global like the other session events: the card it names may live\n\t// in a project whose tab is not the one on screen.\n\tSessionFocusEvent = defineEvent[SessionFocus](\"session-focus\")\n\n\t// SessionInboxEvent carries how many uncollected results a session has\n\t// waiting, so its card can say so — the nudge tells the agent, and this tells\n\t// the person. Emitted whenever a sender's inbox changes size; zero clears the\n\t// mark. Global for the same reason the relay event is.\n\tSessionInboxEvent = defineEvent[SessionInbox](\"session-inbox\")\n\n\t// SessionScheduleEvent is emitted when a session's scheduled prompt changes\n\t// without the window having written it: delivered, or parked and dropped by\n\t// lich itself around a usage limit (resume.go). Payload: SessionSchedule.\n\tSessionScheduleEvent = defineEvent[SessionSchedule](\"session-schedule\")\n\n\t// SessionScheduleByEvent follows a SessionScheduleEvent that says who set\n\t// the prompt. Payload: SessionScheduleBy.\n\tSessionScheduleByEvent = defineEvent[SessionScheduleBy](\"session-schedule-by\")\n\n\t// SessionWatchEvent is emitted when a session's watch is armed, fires or\n\t// stops. Payload: SessionWatchChange.\n\tSessionWatchEvent = defineEvent[SessionWatchChange](\"session-watch\")\n\n\t// SessionWatchStoppedEvent is emitted when a watch reached its run limit on\n\t// one pull request and disarmed. Payload: SessionWatchStopped.\n\tSessionWatchStoppedEvent = defineEvent[SessionWatchStopped](\"session-watch-stopped\")\n\n\t// SessionRelayEvent carries which session is waiting on which, so the sidebar\n\t// can say it. Global rather than per-session because its consumer — one store\n\t// keyed by id — outlives any one card, exactly as the status event's does.\n\tSessionRelayEvent = defineEvent[SessionRelay](\"session-relay\")\n\n\t// RelayStalledEvent carries a request whose target ended its turn without\n\t// answering through lich. The window turns it into a toast that opens the\n\t// target's card, because the answer — if there is one — is on that screen and\n\t// the person who asked has no other way to know where it went.\n\tRelayStalledEvent = defineEvent[RelayStalled](\"session-relay-stalled\")\n\n\t// SessionOpenedEvent carries a session opened outside the window, so the card\n\t// appears without a reload. Global, like every other session event: its\n\t// consumer is the workspace state, which outlives any one card.\n\tSessionOpenedEvent = defineEvent[OpenedSession](\"session-opened\")\n\n\t// SessionClosedEvent carries a session closed outside the window, so the card\n\t// goes away without a reload. Its payload is SessionClosed.\n\tSessionClosedEvent = defineEvent[SessionClosed](\"session-closed\")\n\n\t// SessionsFiledEvent carries sessions whose folder changed outside the window,\n\t// so their cards move into or out of the folder's block without a reload. One\n\t// event for a card filed and for a folder renamed, because the window's answer\n\t// to both is the same: set these cards' folder.\n\tSessionsFiledEvent = defineEvent[SessionsFiled](\"sessions-filed\")\n\n\t// SessionsColoredEvent carries sessions painted outside the window, so their\n\t// cards take the colour without a reload.\n\tSessionsColoredEvent = defineEvent[SessionsColored](\"sessions-colored\")\n\n\t// ProjectOpenedEvent carries a project opened outside the window — an agent\n\t// naming a directory rather than a project already on screen — so its tab\n\t// appears without a reload. Its payload is the whole Project, sessions\n\t// included: a reopened project brings back the cards it was closed with, and\n\t// the session this open is about to announce lands in a tab the window has to\n\t// be holding already.\n\tProjectOpenedEvent = defineEvent[Project](\"project-opened\")\n\n\t// ProjectAddedEvent is emitted once AddProject has committed: a project opened\n\t// new, reopened from the history, or reopened at the directory it moved to —\n\t// the same id under another path is how a relocate reaches the store. Payload:\n\t// ProjectAdded. It is not project-opened, which an agent's open announces with\n\t// the whole project and which the web workspace adds a tab from; this one only\n\t// says the row changed, and the window reads it back.\n\tProjectAddedEvent = defineEvent[ProjectAdded](\"project-added\")\n\n\t// ProjectClosedEvent is emitted once CloseProject has marked a project closed,\n\t// whoever asked: the window's own tab, an agent, the CLI. Payload:\n\t// ProjectClosed.\n\tProjectClosedEvent = defineEvent[ProjectClosed](\"project-closed\")\n\n\t// ProjectsReorderedEvent is emitted once ReorderProjects has written the tab\n\t// order. Payload: ProjectsReordered.\n\tProjectsReorderedEvent = defineEvent[ProjectsReordered](\"projects-reordered\")\n\n\t// ScheduleForfeitedEvent is emitted when a scheduled prompt was lost with the\n\t// session it was parked on, so the person who parked it is told rather than\n\t// left to find out at a time that never comes. Payload: ScheduleForfeited.\n\tScheduleForfeitedEvent = defineEvent[ScheduleForfeited](\"session-schedule-forfeited\")\n\n\t// ClaudeProfileLoginEvent is the event a login reports its progress on.\n\tClaudeProfileLoginEvent = defineEvent[ProfileLogin](\"claude-profile-login\")\n\n\t// CodexProfileLoginEvent is the event a login reports its progress on.\n\tCodexProfileLoginEvent = defineEvent[ProfileLogin](\"codex-profile-login\")\n\n\t// ProfileChangedEvent is the event a profile's update emits once it is\n\t// written: its name, color or image changed.\n\tProfileChangedEvent = defineEvent[ProfileChanged](\"profile-changed\")\n\n\t// PluginProfilesEvent is the event a pass over a provider's profiles reports\n\t// on, once it has installed into at least one.\n\tPluginProfilesEvent = defineEvent[PluginProfiles](\"lich-plugin-profiles\")\n\n\t// AppUpdateProgressEvent is the hub event Apply's phases ride on, for the\n\t// toast.\n\tAppUpdateProgressEvent = defineEvent[AppUpdateProgress](\"appupdate-progress\")\n\n\t// ThemeSelectionEvent is pushed on /events with a ThemeSelection once a change\n\t// to it is stored.\n\tThemeSelectionEvent = defineEvent[ThemeSelection](\"theme-selection\")\n\n\t// ThemeUpdatesEvent is pushed on /events once the newer versions known for\n\t// the installed theme packs changed: a check found or lost one, or an\n\t// update installed one. Theme.Latest carries them.\n\tThemeUpdatesEvent = defineEvent[None](\"theme-updates\")\n\n\t// PullRequestChangedEvent is what a pull request write through lich reports\n\t// once GitHub took it, so every window's pull request store reads it again\n\t// instead of the screen that made the change telling the others.\n\tPullRequestChangedEvent = defineEvent[PRChanged](\"pull-request-changed\")\n\n\t// BranchPullRequestEvent is every read of a checkout's branch pull request,\n\t// changed or not: the backend is the one reader of it, and a window that\n\t// asked for a recheck hears its answer here.\n\tBranchPullRequestEvent = defineEvent[BranchPullRequest](\"branch-pull-request\")\n\n\t// ServicesEvent carries every project service and its state, emitted once a\n\t// change to either is true: a save, a delete, a start, an exit.\n\tServicesEvent = defineEvent[[]Service](\"services\")\n\n\t// ServiceRevealEvent asks the window to open a service's console, which the\n\t// tray's Show output does from outside it.\n\tServiceRevealEvent = defineEvent[ServiceIDOptions](\"service-reveal\")\n\n\t// ExtensionStatusEvent carries an extension once its state has changed.\n\tExtensionStatusEvent = defineEvent[Extension](\"extension-status\")\n\n\t// ExtensionUpdateEvent carries what a look for a newer release of an\n\t// extension found, once that differs from what the window was last told.\n\tExtensionUpdateEvent = defineEvent[ExtensionUpdate](\"extension-update\")\n\n\t// ExtensionRemovedEvent names an extension once its directory is gone, for\n\t// the window to drop it.\n\tExtensionRemovedEvent = defineEvent[ExtensionIDOptions](\"extension-removed\")\n\n\t// ExtensionCatalogEvent carries the lich catalog once the backend holds a\n\t// copy that differs from the one before.\n\tExtensionCatalogEvent = defineEvent[ExtensionCatalog](\"extension-catalog\")\n\n\t// ExtensionMessageEvent carries a line an extension wrote, after lich\n\t// accepted it. With no window attached it is dropped, like every event.\n\tExtensionMessageEvent = defineEvent[ExtensionMessage](\"extension-message\")\n\n\t// WindowCloseEvent asks the native window to close, lich quitting.\n\tWindowCloseEvent = defineEvent[None](\"window-close\")\n\n\t// WindowRaiseEvent asks the native window to come forward.\n\tWindowRaiseEvent = defineEvent[None](\"window-raise\")\n)\n```\n\n```go\nvar (\n\tExtensionsList = define[None, []Extension](\"extensions.List\")\n\tExtensionsSend = define[ExtensionSendOptions, None](\"extensions.Send\")\n\t// ExtensionsRestart starts an extension again, the one way back from failed.\n\tExtensionsRestart = define[ExtensionIDOptions, None](\"extensions.Restart\")\n\t// ExtensionsDir is the directory lich reads extensions from.\n\tExtensionsDir = define[None, string](\"extensions.Dir\")\n\t// ExtensionsPrepareFromGit downloads the latest release of a GitHub\n\t// repository's extension, checks and stages it, and returns what it is;\n\t// nothing runs until CommitInstall.\n\tExtensionsPrepareFromGit = define[ExtensionGitInstallOptions, ExtensionInstallPreview](\"extensions.PrepareFromGit\")\n\t// ExtensionsPrepareFromDir stages a copy of a folder on disk holding an\n\t// extension, as PrepareFromGit does.\n\tExtensionsPrepareFromDir = define[ExtensionDirInstallOptions, ExtensionInstallPreview](\"extensions.PrepareFromDir\")\n\t// ExtensionsCommitInstall moves a staged extension into place and starts it.\n\t// A token commits once.\n\tExtensionsCommitInstall = define[ExtensionInstallTokenOptions, Extension](\"extensions.CommitInstall\")\n\t// ExtensionsDiscardInstall deletes a staged extension.\n\tExtensionsDiscardInstall = define[ExtensionInstallTokenOptions, None](\"extensions.DiscardInstall\")\n\t// ExtensionsCheckUpdates looks for a newer release of every extension\n\t// installed from GitHub and answers with the list as it then stands; what\n\t// changed also arrives as ExtensionUpdateEvent.\n\tExtensionsCheckUpdates = define[None, []Extension](\"extensions.CheckUpdates\")\n\t// ExtensionsPrepareUpdate stages the latest release of an installed\n\t// extension's repository, as PrepareFromGit does; CommitInstall then puts\n\t// it in place of the installed version, which runs until then.\n\tExtensionsPrepareUpdate = define[ExtensionIDOptions, ExtensionInstallPreview](\"extensions.PrepareUpdate\")\n\t// ExtensionsRemove stops an extension and deletes its directory. Its data\n\t// directory is kept.\n\tExtensionsRemove = define[ExtensionIDOptions, None](\"extensions.Remove\")\n\t// ExtensionsDeleteData deletes the data directory of an extension that is\n\t// not installed, and refuses one that is.\n\tExtensionsDeleteData = define[ExtensionIDOptions, None](\"extensions.DeleteData\")\n\t// ExtensionsCatalog is the lich catalog the backend holds, read first when\n\t// it holds none: it fails only when it has no copy and cannot read one. A\n\t// copy read later arrives as ExtensionCatalogEvent.\n\tExtensionsCatalog = define[None, ExtensionCatalog](\"extensions.Catalog\")\n\t// ExtensionsCatalogImage reads an icon, cover or screenshot the catalog\n\t// held names, and nothing else.\n\tExtensionsCatalogImage = define[ExtensionCatalogImageOptions, []byte](\"extensions.CatalogImage\")\n)\n```\n\n```go\nvar (\n\tProjectGitLog        = define[GitLogOptions, GitLogPage](\"project.GitLog\")\n\tProjectGitAuthors    = define[GitAuthorsOptions, []string](\"project.GitAuthors\")\n\tProjectGitRefs       = define[PathOptions, GitRefs](\"project.GitRefs\")\n\tProjectGitCommit     = define[GitCommitOptions, GitCommitDetail](\"project.GitCommit\")\n\tProjectGitCommitDiff = define[GitCommitDiffOptions, string](\"project.GitCommitDiff\")\n\n\tProjectGitCheckout     = define[GitCheckoutOptions, None](\"project.GitCheckout\")\n\tProjectGitCreateBranch = define[GitCreateBranchOptions, None](\"project.GitCreateBranch\")\n\tProjectGitRenameBranch = define[GitRenameBranchOptions, None](\"project.GitRenameBranch\")\n\tProjectGitBranchOnly   = define[GitBranchOptions, int](\"project.GitBranchOnly\")\n\tProjectGitDeleteBranch = define[GitBranchOptions, GitDeletedBranch](\"project.GitDeleteBranch\")\n\n\tProjectGitMergePreview = define[GitMergeOptions, GitMergePreview](\"project.GitMergePreview\")\n\tProjectGitMerge        = define[GitMergeOptions, GitMergeResult](\"project.GitMerge\")\n\tProjectGitMergeUndo    = define[GitMergeUndoOptions, None](\"project.GitMergeUndo\")\n\tProjectGitConflict     = define[CheckoutFileOptions, GitConflict](\"project.GitConflict\")\n\tProjectGitResolveFile  = define[GitResolveFileOptions, None](\"project.GitResolveFile\")\n\tProjectGitMergeAbort   = define[PathOptions, None](\"project.GitMergeAbort\")\n\tProjectGitMergeCommit  = define[PathOptions, None](\"project.GitMergeCommit\")\n\tProjectGitMarkResolved = define[CheckoutFileOptions, None](\"project.GitMarkResolved\")\n)\n```\n\n```go\nvar (\n\tClaudeProfiles         = profileMethods(\"claudeprofile\")\n\tClaudeProfileLogin     = profileLoginMethods(\"claudeprofile\")\n\tClaudeProfilePlugins   = profilePluginMethods(\"claudeprofile\")\n\tClaudeProfileLoginCode = define[LoginCodeOptions, None](\"claudeprofile.LoginCode\")\n\tCodexProfiles          = profileMethods(\"codexprofile\")\n\tCodexProfileLogin      = profileLoginMethods(\"codexprofile\")\n\tCodexProfilePlugins    = profilePluginMethods(\"codexprofile\")\n\tOMPProfiles            = profileMethods(\"ompprofile\")\n\t// XDGProfiles are the profile services of the providers whose logins a\n\t// variable moves (internal/xdgprofile), by provider id.\n\tXDGProfiles = map[string]ProfileMethods{\n\t\t\"opencode\": profileMethods(\"opencodeprofile\"),\n\t\t\"cursor\":   profileMethods(\"cursorprofile\"),\n\t\t\"kiro\":     profileMethods(\"kiroprofile\"),\n\t}\n)\n```\n\n```go\nvar (\n\tProjectOpen                     = define[None, *OpenedProject](\"project.Open\")\n\tProjectHome                     = define[None, *OpenedProject](\"project.Home\")\n\tProjectRelocate                 = define[ProjectIDOptions, *OpenedProject](\"project.Relocate\")\n\tProjectExists                   = define[PathOptions, bool](\"project.Exists\")\n\tProjectMissing                  = define[PathsOptions, []string](\"project.Missing\")\n\tProjectPickFile                 = define[PickFileOptions, string](\"project.PickFile\")\n\tProjectPickDirectory            = define[PickFileOptions, string](\"project.PickDirectory\")\n\tProjectPickSaveFile             = define[PickSaveFileOptions, string](\"project.PickSaveFile\")\n\tProjectDiff                     = define[PathOptions, DiffStats](\"project.Diff\")\n\tProjectDiffText                 = define[PathOptions, string](\"project.DiffText\")\n\tProjectBranchesOf               = define[PathsOptions, map[string]string](\"project.BranchesOf\")\n\tProjectBaseStatus               = define[PathOptions, *BaseStatus](\"project.BaseStatus\")\n\tProjectBaseFreshness            = define[PathBranchOptions, BaseFreshness](\"project.BaseFreshness\")\n\tProjectBranchRules              = define[PathBranchOptions, *BranchRules](\"project.BranchRules\")\n\tProjectCommitIdentity           = define[PathOptions, CommitIdentity](\"project.CommitIdentity\")\n\tProjectTree                     = define[PathOptions, FileListing](\"project.Tree\")\n\tProjectSearch                   = define[SearchOptions, SearchResult](\"project.Search\")\n\tProjectReadFile                 = define[CheckoutFileOptions, string](\"project.ReadFile\")\n\tProjectReadFileAt               = define[ReadFileAtOptions, string](\"project.ReadFileAt\")\n\tProjectFileLines                = define[FileLinesOptions, []string](\"project.FileLines\")\n\tProjectDiscardFile              = define[CheckoutFileOptions, None](\"project.DiscardFile\")\n\tProjectRevertLines              = define[RevertLinesOptions, RevertResult](\"project.RevertLines\")\n\tProjectRestoreLines             = define[RestoreLinesOptions, None](\"project.RestoreLines\")\n\tProjectCarryUncommitted         = define[CarryUncommittedOptions, None](\"project.CarryUncommitted\")\n\tProjectListBranches             = define[PathOptions, Branches](\"project.ListBranches\")\n\tProjectListCheckouts            = define[PathOptions, []Worktree](\"project.ListCheckouts\")\n\tProjectCreateWorktree           = define[CreateWorktreeOptions, *Worktree](\"project.CreateWorktree\")\n\tProjectCreateWorktreeFromPR     = define[CreateWorktreeFromPROptions, *Worktree](\"project.CreateWorktreeFromPR\")\n\tProjectRemoveWorktree           = define[RemoveWorktreeOptions, None](\"project.RemoveWorktree\")\n\tProjectWorktreeDirty            = define[PathOptions, bool](\"project.WorktreeDirty\")\n\tProjectWorktreeAdopted          = define[PathOptions, bool](\"project.WorktreeAdopted\")\n\tProjectGitHubAccounts           = define[None, []string](\"project.GitHubAccounts\")\n\tProjectGitHubAccountOf          = define[PathOptions, GitHubAccountState](\"project.GitHubAccountOf\")\n\tProjectIssue                    = define[NumberOptions, Issue](\"project.Issue\")\n\tProjectRecheckPullRequest       = define[PathOptions, None](\"project.RecheckPullRequest\")\n\tProjectListPullRequests         = define[ListPullRequestsOptions, []PRSummary](\"project.ListPullRequests\")\n\tProjectPullRequestDetail        = define[NumberOptions, *PRDetail](\"project.PullRequestDetail\")\n\tProjectPullRequestConversation  = define[NumberOptions, *PRConversation](\"project.PullRequestConversation\")\n\tProjectPullRequestAvatar        = define[AvatarOptions, []byte](\"project.PullRequestAvatar\")\n\tProjectPullRequestDiff          = define[NumberOptions, string](\"project.PullRequestDiff\")\n\tProjectPullRequestMergeBase     = define[NumberOptions, string](\"project.PullRequestMergeBase\")\n\tProjectPullRequestConflicts     = define[PRConflictsOptions, []string](\"project.PullRequestConflicts\")\n\tProjectCreatePullRequest        = define[PathOptions, None](\"project.CreatePullRequest\")\n\tProjectMergePullRequest         = define[MergePullRequestOptions, None](\"project.MergePullRequest\")\n\tProjectEditPullRequestTitle     = define[PRTitleOptions, None](\"project.EditPullRequestTitle\")\n\tProjectEditPullRequestBody      = define[PRBodyOptions, None](\"project.EditPullRequestBody\")\n\tProjectCommentOnPullRequest     = define[PRBodyOptions, None](\"project.CommentOnPullRequest\")\n\tProjectEditPullRequestComment   = define[PRCommentBodyOptions, None](\"project.EditPullRequestComment\")\n\tProjectDeletePullRequestComment = define[PRCommentOptions, None](\"project.DeletePullRequestComment\")\n\tProjectSubmitReview             = define[SubmitReviewOptions, None](\"project.SubmitReview\")\n\tProjectEditReviewBody           = define[PRReviewBodyOptions, None](\"project.EditReviewBody\")\n\tProjectEditReviewComment        = define[PRCommentBodyOptions, None](\"project.EditReviewComment\")\n\tProjectDeleteReviewComment      = define[PRCommentOptions, None](\"project.DeleteReviewComment\")\n\tProjectReplyToReviewThread      = define[PRCommentBodyOptions, None](\"project.ReplyToReviewThread\")\n\tProjectResolveReviewThread      = define[ResolveThreadOptions, None](\"project.ResolveReviewThread\")\n)\n```\n\n```go\nvar (\n\tProvidersDetect      = define[None, []DetectedProvider](\"providers.Detect\")\n\tProvidersOnPath      = define[ProviderIDOptions, []ProviderBinary](\"providers.OnPath\")\n\tProvidersRefreshPath = define[None, None](\"providers.RefreshPath\")\n\tProvidersVerify      = define[BinaryOptions, BinaryCheck](\"providers.Verify\")\n\tProvidersVersion     = define[BinaryOptions, string](\"providers.Version\")\n)\n```\n\n```go\nvar (\n\tQuotaPlans            = define[QuotaPlansOptions, []QuotaPlan](\"quota.Plans\")\n\tQuotaProfilePlan      = define[ProfilePlanOptions, QuotaPlan](\"quota.ProfilePlan\")\n\tQuotaCodexProfilePlan = define[ProfilePlanOptions, QuotaPlan](\"quota.CodexProfilePlan\")\n)\n```\n\n```go\nvar (\n\tRelayPeers         = define[PeersOptions, []Peer](\"relay.Peers\")\n\tRelaySelf          = define[SelfOptions, Peer](\"relay.Self\")\n\tRelaySend          = define[SendOptions, SendResult](\"relay.Send\")\n\tRelaySendPrivate   = define[SendOptions, SendResult](\"relay.SendPrivate\")\n\tRelaySendSubagent  = define[SendOptions, SendResult](\"relay.SendSubagent\")\n\tRelayWait          = define[WaitOptions, SendResult](\"relay.Wait\")\n\tRelayCollect       = define[CollectOptions, CollectedResults](\"relay.Collect\")\n\tRelayCollectNow    = define[CollectNowOptions, CollectedResults](\"relay.CollectNow\")\n\tRelayReply         = define[ReplyOptions, None](\"relay.Reply\")\n\tRelayInsert        = define[InsertTextOptions, InsertedText](\"relay.Insert\")\n\tRelayFocus         = define[FocusSessionOptions, FocusedSession](\"relay.Focus\")\n\tRelayFocused       = define[None, FocusedSession](\"relay.Focused\")\n\tRelaySetShown      = define[ShownSessionOptions, None](\"relay.SetShown\")\n\tRelayAnnounceMerge = define[AnnounceMergeOptions, None](\"relay.AnnounceMerge\")\n\tRelaySubmit        = define[SubmitOptions, None](\"relay.Submit\")\n)\n```\n\n```go\nvar (\n\tRelaySetSchedule  = define[SetScheduleOptions, None](\"relay.SetSchedule\")\n\tRelayScheduleSelf = define[ScheduleSelfOptions, None](\"relay.ScheduleSelf\")\n)\n```\n\n```go\nvar (\n\tServicesList       = define[None, []Service](\"services.List\")\n\tServicesSave       = define[SaveServiceOptions, Service](\"services.Save\")\n\tServicesDelete     = define[ServiceIDOptions, None](\"services.Delete\")\n\tServicesStart      = define[ServiceIDOptions, None](\"services.Start\")\n\tServicesStop       = define[ServiceIDOptions, None](\"services.Stop\")\n\tServicesForceStop  = define[ServiceIDOptions, None](\"services.ForceStop\")\n\tServicesRestart    = define[ServiceIDOptions, None](\"services.Restart\")\n\tServicesStartAll   = define[ProjectIDOptions, None](\"services.StartAll\")\n\tServicesStopAll    = define[ProjectIDOptions, None](\"services.StopAll\")\n\tServicesOutput     = define[ServiceIDOptions, []byte](\"services.Output\")\n\tServicesLiveOutput = define[ServiceIDOptions, []byte](\"services.LiveOutput\")\n)\n```\n\n```go\nvar (\n\t// ProjectShowCode checks a file and lines of session ID's own checkout and\n\t// asks the window to show them. A confined token may call it for its own\n\t// session only (internal/scope).\n\tProjectShowCode = define[ShowCodeOptions, ShowCode](\"project.ShowCode\")\n\n\t// ShowCodeEvent carries what ProjectShowCode checked. It is global: the\n\t// session may not be the one on screen, and the window words that itself.\n\tShowCodeEvent = defineEvent[ShowCode](\"show-code\")\n)\n```\n\n```go\nvar (\n\tSpawnOpen         = define[OpenSessionOptions, OpenedSession](\"spawn.Open\")\n\tSpawnOpenSubagent = define[OpenSubagentOptions, OpenedSession](\"spawn.OpenSubagent\")\n\tSpawnHandoff      = define[HandoffSessionOptions, OpenedSession](\"spawn.Handoff\")\n\tSpawnClose        = define[CloseSessionOptions, ClosedSession](\"spawn.Close\")\n\tSpawnCloseProject = define[CloseProjectOptions, ClosedProject](\"spawn.CloseProject\")\n\tSpawnControl      = define[ControlSessionOptions, ControlledSession](\"spawn.Control\")\n\tSpawnAsk          = define[AskSessionOptions, SessionAnswer](\"spawn.Ask\")\n\tSpawnWorktrees    = define[WorktreesOptions, []WorktreeCheckout](\"spawn.Worktrees\")\n\tSpawnFolders      = define[FoldersOptions, []SessionFolder](\"spawn.Folders\")\n\tSpawnFile         = define[FileSessionOptions, FiledSession](\"spawn.File\")\n\tSpawnRenameFolder = define[RenameFolderOptions, RenamedFolder](\"spawn.RenameFolder\")\n\tSpawnColorFolder  = define[ColorFolderOptions, ColoredFolder](\"spawn.ColorFolder\")\n\tSpawnRename       = define[RenameSessionOptions, RenamedSession](\"spawn.Rename\")\n\tSpawnProject      = define[ProjectRefOptions, ProjectRef](\"spawn.Project\")\n)\n```\n\n```go\nvar (\n\tStoreCostTotals            = define[CostTotalsOptions, CostReport](\"store.CostTotals\")\n\tStoreLoadState             = define[None, []Project](\"store.LoadState\")\n\tStoreAddProject            = define[AddProjectOptions, None](\"store.AddProject\")\n\tStoreCloseProject          = define[ProjectIDOptions, None](\"store.CloseProject\")\n\tStoreReorderProjects       = define[ReorderProjectsOptions, None](\"store.ReorderProjects\")\n\tStoreRecentProjects        = define[SearchTermOptions, []RecentProject](\"store.RecentProjects\")\n\tStoreClosedProjectCount    = define[SearchTermOptions, int](\"store.ClosedProjectCount\")\n\tStoreAddSession            = define[AddSessionOptions, None](\"store.AddSession\")\n\tStoreAddSessionInFolder    = define[AddSessionInFolderOptions, None](\"store.AddSessionInFolder\")\n\tStoreAddSessionFrom        = define[AddSessionFromOptions, None](\"store.AddSessionFrom\")\n\tStoreSetActiveSession      = define[ActiveSessionOptions, None](\"store.SetActiveSession\")\n\tStoreCloseSession          = define[ParkSessionOptions, None](\"store.CloseSession\")\n\tStoreReopenSession         = define[ReopenSessionOptions, *Session](\"store.ReopenSession\")\n\tStoreReopenWorktreeSession = define[ReopenWorktreeSessionOptions, *Session](\"store.ReopenWorktreeSession\")\n\tStorePurgeWorktreeSessions = define[WorktreeSessionsOptions, None](\"store.PurgeWorktreeSessions\")\n\tStoreClosedSessions        = define[SearchTermOptions, ClosedHistory](\"store.ClosedSessions\")\n\tStoreExternalSessions      = define[None, []ExternalSession](\"store.ExternalSessions\")\n\tStoreAdoptExternalSession  = define[AdoptExternalSessionOptions, None](\"store.AdoptExternalSession\")\n\tStoreForgetSession         = define[SessionIDOptions, None](\"store.ForgetSession\")\n\tStoreMarkForked            = define[SessionIDOptions, None](\"store.MarkForked\")\n\tStoreReorderSessions       = define[ReorderSessionsOptions, None](\"store.ReorderSessions\")\n\tStoreRenameSession         = define[LabelSessionOptions, None](\"store.RenameSession\")\n\tStoreSetSessionColor       = define[SessionColorOptions, None](\"store.SetSessionColor\")\n\tStoreSetSessionFolder      = define[SessionFolderOptions, None](\"store.SetSessionFolder\")\n\tStoreSetSessionPinned      = define[SessionPinnedOptions, None](\"store.SetSessionPinned\")\n\tStoreSetSessionUnread      = define[SessionUnreadOptions, None](\"store.SetSessionUnread\")\n\tStoreRenameFolder          = define[RenameProjectFolderOptions, []string](\"store.RenameFolder\")\n\tStoreGetSetting            = define[GetSettingOptions, string](\"store.GetSetting\")\n\tStoreSetSetting            = define[SetSettingOptions, None](\"store.SetSetting\")\n)\n```\n\n```go\nvar (\n\tSystemShowWindow         = define[ShowWindowOptions, None](\"system.ShowWindow\")\n\tSystemQuit               = define[QuitOptions, None](\"system.Quit\")\n\tSystemAttachNative       = define[AttachNativeOptions, None](\"system.AttachNative\")\n\tSystemDiagnostics        = define[None, Diagnostics](\"system.Diagnostics\")\n\tSystemNotify             = define[NotifyOptions, None](\"system.Notify\")\n\tSystemOpenExternal       = define[OpenExternalOptions, None](\"system.OpenExternal\")\n\tSystemOpenFile           = define[OpenFileOptions, None](\"system.OpenFile\")\n\tSystemOpenFolder         = define[OpenFolderOptions, None](\"system.OpenFolder\")\n\tSystemOpenFolderInEditor = define[OpenFolderOptions, string](\"system.OpenFolderInEditor\")\n\tSystemRevealLog          = define[None, None](\"system.RevealLog\")\n\tSystemSandboxBackend     = define[None, string](\"system.SandboxBackend\")\n\tSystemSSHAgentKeys       = define[None, []string](\"system.SSHAgentKeys\")\n\tSystemTakeUncleanExit    = define[None, bool](\"system.TakeUncleanExit\")\n\tTraySetLabels            = define[TrayLabels, None](\"tray.SetLabels\")\n)\n```\n\n```go\nvar (\n\tTerminalStart             = define[StartOptions, None](\"terminal.Start\")\n\tTerminalClose             = define[SessionIDOptions, None](\"terminal.Close\")\n\tTerminalWrite             = define[WriteOptions, None](\"terminal.Write\")\n\tTerminalResize            = define[ResizeOptions, None](\"terminal.Resize\")\n\tTerminalSetVisible        = define[SetVisibleOptions, None](\"terminal.SetVisible\")\n\tTerminalReplay            = define[SessionIDOptions, bool](\"terminal.Replay\")\n\tTerminalLive              = define[SessionIDOptions, bool](\"terminal.Live\")\n\tTerminalLiveCount         = define[None, int](\"terminal.LiveCount\")\n\tTerminalReady             = define[SessionIDOptions, bool](\"terminal.Ready\")\n\tTerminalHandsOn           = define[SessionIDOptions, int64](\"terminal.HandsOn\")\n\tTerminalLastTurnSaid      = define[SessionIDOptions, LastSaid](\"terminal.LastTurnSaid\")\n\tTerminalTurnStates        = define[None, []TurnState](\"terminal.TurnStates\")\n\tTerminalContinueIn        = define[ContinueInOptions, None](\"terminal.ContinueIn\")\n\tTerminalTakeProfileOffer  = define[ContinueInOptions, None](\"terminal.TakeProfileOffer\")\n\tTerminalSearchTranscripts = define[SearchTranscriptsOptions, []TranscriptMatch](\"terminal.SearchTranscripts\")\n\tTerminalWorkdirMissing    = define[WorkdirOptions, bool](\"terminal.WorkdirMissing\")\n\tTerminalResumeAvailable   = define[ResumeAvailableOptions, bool](\"terminal.ResumeAvailable\")\n)\n```\n\n```go\nvar (\n\tThemesList            = define[None, []Theme](\"themes.List\")\n\tThemesListBroken      = define[None, []BrokenTheme](\"themes.ListBroken\")\n\tThemesImport          = define[ImportThemeOptions, ThemeImportResult](\"themes.Import\")\n\tThemesInstallFromGit  = define[InstallThemesOptions, ThemeGitResult](\"themes.InstallFromGit\")\n\tThemesUpdateFromGit   = define[UpdateThemeOptions, ThemeGitResult](\"themes.UpdateFromGit\")\n\tThemesCheckUpdates    = define[None, None](\"themes.CheckUpdates\")\n\tThemesRemove          = define[RemoveThemeOptions, None](\"themes.Remove\")\n\tThemesSaveTemplate    = define[SaveThemeTemplateOptions, None](\"themes.SaveTemplate\")\n\tThemesSelection       = define[None, ThemeSelection](\"themes.Selection\")\n\tThemesSelect          = define[SelectThemeOptions, None](\"themes.Select\")\n\tThemesSetFollowSystem = define[FollowSystemOptions, None](\"themes.SetFollowSystem\")\n)\n```\n\n```go\nvar (\n\tProjectAwaitThreadFix  = define[ThreadFixOptions, None](\"project.AwaitThreadFix\")\n\tProjectMarkThreadFixed = define[MarkThreadFixedOptions, None](\"project.MarkThreadFixed\")\n\tProjectThreadFixes     = define[None, []ThreadFix](\"project.ThreadFixes\")\n\n\t// ThreadFixesEvent carries every review thread handed to a session, emitted\n\t// once one is sent, marked fixed, or stops waiting: resolved by the push of\n\t// its fix, or dropped with its pull request.\n\tThreadFixesEvent = defineEvent[[]ThreadFix](\"thread-fixes\")\n)\n```\n\n```go\nvar DropAttach = define[AttachDropOptions, DropAttachment](\"drop.Attach\")\n```\n\n```go\nvar PatchNotesCurrent = define[PatchNotesOptions, PatchNotes](\"patchnotes.Current\")\n```\n\n```go\nvar ProjectCheckLog = define[CheckLogOptions, CheckLog](\"project.CheckLog\")\n```\nProjectCheckLog reads the failed checks of the pull request of session ID's own checkout, with the tail of each failed GitHub Actions job's log. A confined token may call it for its own session only (internal/scope).\n\n## Functions\n\n```go\nfunc Events() map[string]DeclaredEvent\n```\nEvents returns every Event and EventFamily this package declares.\n\n```go\nfunc Methods() map[string]Declared\n```\nMethods returns every Method this package declares.\n\n```go\nfunc ParseWhen(raw string, now time.Time) (time.Time, bool)\n```\nParseWhen reads the one form a scheduled time is written in, by the window's field and by \\`lich schedule --when\\`: 45m, 2h30, 14:30 or 2026-11-12 14:30. Digits only, so it reads the same in every interface language. A clock that has passed today means tomorrow; a full date in the past is refused.\n\n## Types\n\n```go\ntype ActiveSessionOptions struct {\n\tProjectID string `json:\"projectId\"`\n\tSessionID string `json:\"sessionId\"`\n}\n```\nActiveSessionOptions makes SessionID project ProjectID's active session.\n\n```go\ntype AddProjectOptions struct {\n\tID   string `json:\"id\"`\n\tName string `json:\"name\"`\n\tPath string `json:\"path\"`\n}\n```\nAddProjectOptions stores a project opened at Path.\n\n```go\ntype AddSessionFromOptions struct {\n\tProjectID   string `json:\"projectId\"`\n\tSessionID   string `json:\"sessionId\"`\n\tLabel       string `json:\"label\"`\n\tKind        string `json:\"kind\"`\n\tPath        string `json:\"path\"`\n\tNextSeq     int    `json:\"nextSeq\"`\n\tOriginID    string `json:\"originId\"`\n\tOriginLabel string `json:\"originLabel\"`\n\tFolder      string `json:\"folder\"`\n}\n```\nAddSessionFromOptions stores a session another session opened: OriginID and OriginLabel name that session.\n\n```go\ntype AddSessionInFolderOptions struct {\n\tAddSessionOptions\n\tFolder string `json:\"folder\"`\n}\n```\nAddSessionInFolderOptions stores a new session filed under Folder.\n\n```go\ntype AddSessionOptions struct {\n\tProjectID string `json:\"projectId\"`\n\tSessionID string `json:\"sessionId\"`\n\tLabel     string `json:\"label\"`\n\tKind      string `json:\"kind\"`\n\tPath      string `json:\"path\"`\n\tNextSeq   int    `json:\"nextSeq\"`\n\tSandbox   string `json:\"sandbox\"`\n}\n```\nAddSessionOptions stores a new session of project ProjectID. NextSeq is the project's label counter after it; Sandbox is the answer to the sandbox question, \"\" to follow the provider's rung.\n\n```go\ntype AdoptExternalSessionOptions struct {\n\tProjectID         string `json:\"projectId\"`\n\tSessionID         string `json:\"sessionId\"`\n\tKind              string `json:\"kind\"`\n\tPath              string `json:\"path\"`\n\tProviderSessionID string `json:\"providerSessionId\"`\n\tLabel             string `json:\"label\"`\n}\n```\nAdoptExternalSessionOptions files conversation ProviderSessionID as a parked session of project ProjectID under SessionID.\n\n```go\ntype AnnounceMergeOptions struct {\n\tCheckout string `json:\"checkout\"`\n\tNumber   int    `json:\"number\"`\n\tTitle    string `json:\"title\"`\n\tBranch   string `json:\"branch\"`\n\tBase     string `json:\"base\"`\n}\n```\nAnnounceMergeOptions is a pull request merged through lich: the checkout its branch was in and what the notice tells the agents working there.\n\n```go\ntype AppUpdateProgress struct {\n\tPhase    string `json:\"phase\"`\n\tReceived int64  `json:\"received\"`\n\tTotal    int64  `json:\"total\"`\n}\n```\nAppUpdateProgress is one step of Apply: bytes received of total during the download (total is -1 when the asset came without a Content-Length), then the phase that has no percentage: \"installer\", where lich hands over to the Windows installer and closes.\n\n```go\ntype AppUpdateStatus struct {\n\tCurrentVersion  string `json:\"currentVersion\"`\n\tLatestVersion   string `json:\"latestVersion\"`\n\tUpdateAvailable bool   `json:\"updateAvailable\"`\n\t// Required is true when a release newer than the running one, up to the\n\t// latest, marks itself required: no new agent session opens until lich is\n\t// updated.\n\tRequired     bool   `json:\"required\"`\n\tCanSelfApply bool   `json:\"canSelfApply\"`\n\tReleaseURL   string `json:\"releaseUrl\"`\n\t// InstallCommand is the shell command the UI pastes (never auto-runs) to\n\t// update a package-manager-owned install; empty on the self-apply platforms.\n\tInstallCommand string `json:\"installCommand\"`\n}\n```\nAppUpdateStatus is lich's install/update state, reported to the window.\n\n```go\ntype Artifact struct {\n\tName     string `json:\"name\"`\n\tPath     string `json:\"path\"`\n\tModified int64  `json:\"modified\"`\n}\n```\nArtifact is one page or file an agent left in its session's artifact folder. Name is the entry's own name; Path is the file to open, the folder's index.html for a folder that holds one. Modified is in unix milliseconds.\n\n```go\ntype AskSessionOptions struct {\n\tFrom     string `json:\"from\"`\n\tTarget   string `json:\"target\"`\n\tProject  string `json:\"project\"`\n\tQuestion string `json:\"question\"`\n}\n```\nAskSessionOptions is one Ask call, an object for the reason CloseOptions is one.\n\n```go\ntype AttachArtifactOptions struct {\n\tSessionID string `json:\"sessionId\"`\n\tFrom      string `json:\"from\"`\n\tName      string `json:\"name\"`\n}\n```\nAttachArtifactOptions names the artifact Name of session From, for session SessionID: to attach to its prompt, or to open in its browser.\n\n```go\ntype AttachDropOptions struct {\n\tSessionID string `json:\"sessionId\"`\n\tRoot      string `json:\"root\"`\n\tConfined  bool   `json:\"confined\"`\n}\n```\nAttachDropOptions asks for a file to attach to a session: SessionID's checkout is Root, and a Confined session reads only what lies inside it.\n\n```go\ntype AttachNativeOptions struct {\n\t// Executable is the native window's own binary, the one started again when\n\t// lich is asked for its window after that window closed.\n\tExecutable string `json:\"executable\"`\n}\n```\nAttachNativeOptions is the native window announcing itself.\n\n```go\ntype AvatarOptions struct {\n\tPath string `json:\"path\"`\n\tURL  string `json:\"url\"`\n}\n```\nAvatarOptions names the picture at URL, an author's Avatar in a conversation read from the checkout at Path.\n\n```go\ntype BaseFreshness struct {\n\tUpstream string `json:\"upstream\"` // \"origin/main\" form\n\tAhead    int    `json:\"ahead\"`\n\tBehind   int    `json:\"behind\"`\n\t// FetchError is why the fetch failed, \"\" when it did not. The counts are\n\t// then against whatever an earlier fetch left.\n\tFetchError string `json:\"fetchError,omitempty\"`\n}\n```\nBaseFreshness is where a local branch stands against its upstream, read right after fetching it: what the new-worktree dialog needs to start a worktree from the newer of the two. Upstream is \"\" for a branch that tracks nothing on a remote, and every other field is then zero.\n\n```go\ntype BaseStatus struct {\n\tBase      string   `json:\"base\"`   // the branch merged into, \"origin/main\" form\n\tBehind    int      `json:\"behind\"` // commits the base has that this checkout does not\n\tConflicts []string `json:\"conflicts\"`\n}\n```\nBaseStatus is where a checkout stands against the branch it will merge into: how far that branch has moved underneath it, and which files a merge would collide on right now. It is what turns \"the merge button refused\" into something a parallel worktree knows before anyone clicks it.\n\n```go\ntype BinaryCheck struct {\n\tPath   string `json:\"path\"`\n\tStatus string `json:\"status\"`\n}\n```\nBinaryCheck is what a configured binary resolves to. Path is the absolute executable a session would spawn, empty for every status but CheckOK.\n\n```go\nfunc (b BinaryCheck) Failed() bool\n```\nFailed reports a check to show as a problem.\n\n```go\ntype BinaryOptions struct {\n\tBin string `json:\"bin\"`\n}\n```\nBinaryOptions names an executable as a session's spawn would resolve it.\n\n```go\ntype BranchPullRequest struct {\n\tPath string       `json:\"path\"`\n\tPR   *PullRequest `json:\"pr\"`\n}\n```\nBranchPullRequest is one read of the pull request of the branch checked out at Path; PR is nil when the branch has none.\n\n```go\ntype BranchRules struct {\n\t// AllowedMergeMethods is squash|merge|rebase, in GitHub's own spelling.\n\t// Empty means the branch has no rule about it and all three stand — which\n\t// is also what a repository with no rulesets at all reports.\n\tAllowedMergeMethods []string `json:\"allowedMergeMethods\"`\n\t// CommitPatterns are the rules that read a commit's own text. Empty is the\n\t// common case and means only \"no rule of this kind\", never \"nothing blocks\".\n\tCommitPatterns []CommitPattern `json:\"commitPatterns\"`\n\t// ViewerCanBypass is whether this account administers the repository, and so\n\t// may merge past the rules above. It is the one answer here that must fail\n\t// *closed*: an unreadable one hides an action rather than offering one that\n\t// cannot work, because a bypass offered to an account that has none reads as\n\t// a broken button, not as a permission it never had.\n\tViewerCanBypass bool `json:\"viewerCanBypass\"`\n}\n```\nBranchRules is what a repository's rulesets say about merging into one branch. GitHub's pull request fields do not carry it: \\`mergeStateStatus\\` answers whether this merge can happen, never which methods the branch would accept, so a Merge menu built without this offers buttons the ruleset refuses — and gh's refusal arrives after the click, as one flat sentence (gherror.go).\n\nThe endpoint answers for a branch, not a pull request, which is why this is its own read: every pull request onto the same base shares one answer.\n\n```go\ntype Branches struct {\n\tLocal     []string   `json:\"local\"`\n\tRemote    []string   `json:\"remote\"` // \"origin/main\" form\n\tWorktrees []Worktree `json:\"worktrees\"`\n}\n```\nBranches groups everything the base-branch picker offers: local and remote branch names plus already-existing worktrees, so a closed-but-kept worktree can be resumed instead of recreated.\n\n```go\ntype BrokenTheme struct {\n\tID     string `json:\"id\"`\n\tReason string `json:\"reason\"`\n}\n```\nBrokenTheme is a stored custom theme this lich cannot load. It is listed rather than dropped, so the user sees why and can remove it by id.\n\n```go\ntype BrowserAgentAct struct {\n\tOwner  string   `json:\"owner\"`\n\tAction string   `json:\"action,omitempty\"`\n\tX      *float64 `json:\"x,omitempty\"`\n\tY      *float64 `json:\"y,omitempty\"`\n\tDY     int      `json:\"dy,omitempty\"`\n\tURL    string   `json:\"url,omitempty\"`\n\t// Tab is the tab a tab action acted on.\n\tTab string `json:\"tab,omitempty\"`\n}\n```\nBrowserAgentAct is one agent action on its page. Action is click, type, press or scroll at a point; back, forward, reload or navigate, which the pane's toolbar does; accept or dismiss, the buttons of the pane's dialog card; tab-new, tab-select or tab-close, the header's tabs, with Tab the one it acted on; or \"\" for one that changes nothing on screen (reading the page, a screenshot). X and Y are where it acted, in CSS pixels, when it acted at a point; DY is a scroll's distance, positive down; URL is where a navigate went.\n\n```go\ntype BrowserClickOptions struct {\n\tID string `json:\"id\"`\n\tBrowserTarget\n}\n```\nBrowserClickOptions clicks in the session's browser.\n\n```go\ntype BrowserDefaultViewOptions struct {\n\tW      int     `json:\"w\"`\n\tH      int     `json:\"h\"`\n\tScale  float64 `json:\"scale\"`\n\tWindow float64 `json:\"window\"`\n}\n```\nBrowserDefaultViewOptions is the window's size: W and H in CSS pixels, Scale the device pixels per CSS pixel, which is Window, the window's own scale, times the page zoom.\n\n```go\ntype BrowserDialog struct {\n\tType    string `json:\"type\"`\n\tMessage string `json:\"message\"`\n\tDefault string `json:\"default,omitempty\"`\n\tURL     string `json:\"url\"`\n\tAnswer  string `json:\"answer,omitempty\"`\n}\n```\nBrowserDialog is a JavaScript dialog a session's page opened. Type is Chrome's: alert, confirm, prompt or beforeunload. Default is a prompt's default text; URL is the page that opened it. Answer, on one the person answered, is DialogAccepted or DialogDismissed.\n\n```go\ntype BrowserDialogOptions struct {\n\tID     string  `json:\"id\"`\n\tAccept bool    `json:\"accept\"`\n\tText   *string `json:\"text,omitempty\"`\n}\n```\nBrowserDialogOptions answers session ID's open dialog: Accept is OK (Leave on a beforeunload), false is Cancel. Text is what a prompt returns on OK; nil keeps its default text.\n\n```go\ntype BrowserDownload struct {\n\tOwner string `json:\"owner,omitempty\"`\n\tPath  string `json:\"path\"`\n\tBytes int64  `json:\"bytes\"`\n\tState string `json:\"state\"`\n}\n```\nBrowserDownload is one file a session's page downloaded: Path is where it lands in the user's Downloads folder, under the name it keeps once complete; Bytes is what arrived so far.\n\n```go\ntype BrowserElement struct {\n\tLabel     string      `json:\"label\"`\n\tSelector  string      `json:\"selector\"`\n\tComponent string      `json:\"component,omitempty\"`\n\tSource    string      `json:\"source,omitempty\"`\n\tHTML      string      `json:\"html\"`\n\tURL       string      `json:\"url\"`\n\tBox       BrowserRect `json:\"box\"`\n}\n```\nBrowserElement is the element under a point, as a note on it names it. Label is its tag and text (button \"Buy now\"), empty when the point holds none; Selector finds it again, in the form browser.Click takes. Component and Source are the React component that drew it and where, when the page is a React development build. HTML is its markup, shortened, with no field's value. URL is the page's, without query or fragment.\n\n```go\ntype BrowserEvalOptions struct {\n\tID     string `json:\"id\"`\n\tScript string `json:\"script\"`\n}\n```\n\n```go\ntype BrowserFrame struct {\n\tTab  string `json:\"tab\"`\n\tData string `json:\"data\"`\n}\n```\nBrowserFrame is one screencast frame: Data is the base64 JPEG, Tab the BrowserTab.ID of the tab it is of. Chrome sends no frames for a tab behind another, so the window keeps each tab's last one to show on a switch.\n\n```go\ntype BrowserHandle struct {\n\tID        string            `json:\"id\"`\n\tURL       string            `json:\"url\"`\n\tTitle     string            `json:\"title\"`\n\tOwner     string            `json:\"owner\"`\n\tHeaded    bool              `json:\"headed\"`\n\tDownloads []BrowserDownload `json:\"downloads,omitempty\"`\n}\n```\nBrowserHandle is one session's browser: the id later calls take, and enough for a tool result to say which window it is. Downloads, on an open or a navigate, are what that load downloaded: a URL that answers with a file saves it and leaves the page where it was.\n\n```go\ntype BrowserInfoOptions struct {\n\tID       string `json:\"id\"`\n\tWaitFor  string `json:\"waitFor,omitempty\"`\n\tWaitGone string `json:\"waitGone,omitempty\"`\n\tWithin   string `json:\"within,omitempty\"`\n}\n```\nBrowserInfoOptions reads session ID's page. WaitFor and WaitGone, when set, hold the read until that text is on the page's visible text, or off it (case-sensitive substring, the whole page, not only the viewport). Within, when set, is a CSS selector that limits the page text and the element list to the first element it matches.\n\n```go\ntype BrowserInteractive struct {\n\tIndex   int         `json:\"index\"`\n\tTag     string      `json:\"tag\"`\n\tType    string      `json:\"type,omitempty\"`\n\tRole    string      `json:\"role,omitempty\"`\n\tText    string      `json:\"text\"`\n\tHref    string      `json:\"href,omitempty\"`\n\tRect    BrowserRect `json:\"rect\"`\n\tFilled  *bool       `json:\"filled,omitempty\"`\n\tChecked *bool       `json:\"checked,omitempty\"`\n}\n```\nBrowserInteractive is one clickable or fillable node. It never carries a control's value: filled and checked say that typing landed.\n\n```go\ntype BrowserKeyOptions struct {\n\tID        string `json:\"id\"`\n\tType      string `json:\"type\"`\n\tKey       string `json:\"key\"`\n\tCode      string `json:\"code,omitempty\"`\n\tKeyCode   int    `json:\"keyCode,omitempty\"`\n\tModifiers int    `json:\"modifiers,omitempty\"`\n}\n```\nBrowserKeyOptions is one key going down or up, for keys that do not type text (Enter, arrows, shortcuts): text goes through BrowserText. Key and Code are the DOM's KeyboardEvent.key and .code; Modifiers is CDP's bit set (Alt 1, Ctrl 2, Meta 4, Shift 8).\n\n```go\ntype BrowserLocateOptions struct {\n\tID        string   `json:\"id\"`\n\tSelectors []string `json:\"selectors\"`\n\tReveal    string   `json:\"reveal,omitempty\"`\n}\n```\nBrowserLocateOptions asks where the elements Selectors find stand in session ID's page; one gone from the page, or hidden by what it scrolls in, answers an empty box. Reveal, when set, is a selector whose element the page first scrolls into view unless it already shows whole.\n\n```go\ntype BrowserMouseOptions struct {\n\tID        string  `json:\"id\"`\n\tType      string  `json:\"type\"`\n\tX         float64 `json:\"x\"`\n\tY         float64 `json:\"y\"`\n\tButton    string  `json:\"button,omitempty\"`\n\tClicks    int     `json:\"clicks,omitempty\"`\n\tDX        float64 `json:\"dx,omitempty\"`\n\tDY        float64 `json:\"dy,omitempty\"`\n\tModifiers int     `json:\"modifiers,omitempty\"`\n}\n```\nBrowserMouseOptions is one pointer event over the pane, in CSS pixels. Type is press, release, move or wheel; Button is left, middle, right or none; DX and DY are a wheel's scroll in CSS pixels.\n\n```go\ntype BrowserNavOptions struct {\n\tID     string `json:\"id\"`\n\tAction string `json:\"action\"`\n\tURL    string `json:\"url,omitempty\"`\n}\n```\nBrowserNavOptions is the pane's toolbar: Action is back, forward, reload or go, and URL is where go loads.\n\n```go\ntype BrowserOpenOptions struct {\n\tID  string `json:\"id\"`\n\tURL string `json:\"url\"`\n}\n```\nBrowserOpenOptions loads a URL in the session's browser, creating a headless one when the card has not opened a window yet.\n\n```go\ntype BrowserPageInfo struct {\n\tURL         string               `json:\"url\"`\n\tTitle       string               `json:\"title\"`\n\tText        string               `json:\"text\"`\n\tInteractive []BrowserInteractive `json:\"interactive\"`\n\tTruncated   bool                 `json:\"truncated\"`\n\t// InteractiveSame leaves Interactive out: it is the list the agent's last\n\t// page answer gave, every element and index as they were.\n\tInteractiveSame bool `json:\"interactiveSame,omitempty\"`\n\t// Downloads are the ones the agent has not heard of in their current\n\t// state: what its last action saved, or one it saw start and that ended\n\t// since.\n\tDownloads []BrowserDownload `json:\"downloads,omitempty\"`\n\t// WaitTimedOut says the text a read waited for never came (or never\n\t// went): the page is the one standing when the wait gave up.\n\tWaitTimedOut bool `json:\"waitTimedOut,omitempty\"`\n\t// ConsoleErrors are the errors the page's console showed since the\n\t// agent's last page answer, each one line cut short; ConsoleErrorsMore\n\t// counts those past the cap.\n\tConsoleErrors     []string `json:\"consoleErrors,omitempty\"`\n\tConsoleErrorsMore int      `json:\"consoleErrorsMore,omitempty\"`\n\t// Dialog is the JavaScript dialog the page holds open: until it is\n\t// answered (BrowserAnswerDialog) the page runs no script, so the rest of the\n\t// answer is the page as it stood when the dialog opened.\n\tDialog *BrowserDialog `json:\"dialog,omitempty\"`\n\t// Dialogs are the ones the person answered in the pane since the agent's\n\t// last page answer.\n\tDialogs []BrowserDialog `json:\"dialogs,omitempty\"`\n}\n```\nBrowserPageInfo is what the agent reads instead of a screenshot.\n\n```go\ntype BrowserPointOptions struct {\n\tID string  `json:\"id\"`\n\tX  float64 `json:\"x\"`\n\tY  float64 `json:\"y\"`\n}\n```\nBrowserPointOptions is a point of session ID's page, in CSS pixels.\n\n```go\ntype BrowserPressOptions struct {\n\tID  string `json:\"id\"`\n\tKey string `json:\"key\"`\n\tBrowserTarget\n}\n```\nBrowserPressOptions presses one named key. An empty target presses into whatever is focused.\n\n```go\ntype BrowserRect struct {\n\tX int `json:\"x\"`\n\tY int `json:\"y\"`\n\tW int `json:\"w\"`\n\tH int `json:\"h\"`\n}\n```\nBrowserRect is an element's viewport box, integer pixels.\n\n```go\ntype BrowserScreenshotOptions struct {\n\tID       string `json:\"id\"`\n\tPath     string `json:\"path\"`\n\tAnnotate bool   `json:\"annotate\"`\n}\n```\nBrowserScreenshotOptions captures the page to Path, or to a file lich chooses when Path is empty. Annotate draws each listed element's index on the image.\n\n```go\ntype BrowserScrollOptions struct {\n\tID string `json:\"id\"`\n\tDY int    `json:\"dy\"`\n}\n```\nBrowserScrollOptions scrolls the page by DY CSS pixels. Positive is down.\n\n```go\ntype BrowserState struct {\n\tOwner   string `json:\"owner\"`\n\tOpen    bool   `json:\"open\"`\n\tHeaded  bool   `json:\"headed\"`\n\tByAgent bool   `json:\"byAgent\"`\n\tURL     string `json:\"url\"`\n\tTitle   string `json:\"title\"`\n\t// Dialog is the JavaScript dialog the page holds open until the person\n\t// or the agent answers it; nil when none is.\n\tDialog *BrowserDialog `json:\"dialog,omitempty\"`\n\t// Tabs are the browser's tabs in the order the pane shows them.\n\tTabs []BrowserTab `json:\"tabs,omitempty\"`\n\t// Idle is the reaper asking whether to close it: headless, no pane shows\n\t// it, and nobody used it for the idle window. It stays until browser.Close,\n\t// browser.Keep or a use answers it; the browser stays open meanwhile.\n\tIdle bool `json:\"idle,omitempty\"`\n}\n```\nBrowserState is a session's browser as the window shows it. Open false means it is gone; ByAgent says the agent started it rather than the window.\n\n```go\ntype BrowserTab struct {\n\tID       string `json:\"id\"`\n\tURL      string `json:\"url\"`\n\tTitle    string `json:\"title\"`\n\tFront    bool   `json:\"front,omitempty\"`\n\tDevTools bool   `json:\"devtools,omitempty\"`\n\tPaused   bool   `json:\"paused,omitempty\"`\n}\n```\nBrowserTab is one tab of a session's browser. ID is Chrome's own for it; Front marks the one shown and driven. In BrowserState, a DevTools tab follows the page tab it inspects, and is Front while the pane shows it in place of that page, which the agent still drives; Paused says that page is stopped in the debugger. The agent's list never holds a DevTools tab.\n\n```go\ntype BrowserTabOptions struct {\n\tID     string `json:\"id\"`\n\tAction string `json:\"action\"`\n\tTab    string `json:\"tab,omitempty\"`\n\tURL    string `json:\"url,omitempty\"`\n}\n```\nBrowserTabOptions acts on session ID's tabs: Action is a Tab\\* constant, Tab the tab it acts on (none for TabNew), and URL where a new tab loads, blank when empty.\n\n```go\ntype BrowserTarget struct {\n\tIndex    *int     `json:\"index,omitempty\"`\n\tSelector string   `json:\"selector,omitempty\"`\n\tX        *float64 `json:\"x,omitempty\"`\n\tY        *float64 `json:\"y,omitempty\"`\n}\n```\nBrowserTarget picks an element. Index is the one page-info stamped; selector is a CSS query; x/y are viewport coordinates. Coordinates win when set, then selector, then index.\n\n```go\ntype BrowserTextOptions struct {\n\tID   string `json:\"id\"`\n\tText string `json:\"text\"`\n}\n```\nBrowserTextOptions types text into whatever has focus, the way an input method commits it.\n\n```go\ntype BrowserTypeOptions struct {\n\tID    string `json:\"id\"`\n\tText  string `json:\"text\"`\n\tClear bool   `json:\"clear\"`\n\tBrowserTarget\n}\n```\nBrowserTypeOptions types into the session's browser. An empty target types into whatever is focused.\n\n```go\ntype BrowserViewOptions struct {\n\tID    string  `json:\"id\"`\n\tW     int     `json:\"w\"`\n\tH     int     `json:\"h\"`\n\tScale float64 `json:\"scale\"`\n}\n```\nBrowserViewOptions sizes a session's page to the pane showing it: W and H in CSS pixels, Scale the device pixels per CSS pixel.\n\n```go\ntype CarryUncommittedOptions struct {\n\tSrc string `json:\"src\"`\n\tDst string `json:\"dst\"`\n}\n```\nCarryUncommittedOptions carries the uncommitted changes of checkout Src to checkout Dst.\n\n```go\ntype CheckItem struct {\n\tName        string `json:\"name\"`\n\tState       string `json:\"state\"`\n\tDescription string `json:\"description\"` // workflow name, or the status context's own line\n\tURL         string `json:\"url\"`         // where to read the run; \"\" when gh reports none\n\tStartedAt   string `json:\"startedAt\"`\n\tCompletedAt string `json:\"completedAt\"`\n\t// Required is GitHub's own answer to \"does this check gate the merge\", the\n\t// same verdict its checks list labels Required.\n\tRequired bool `json:\"required\"`\n}\n```\nCheckItem is one check, flattened from gh's two rollup shapes into what the Checks tab lists. State is this package's own passed|failed|pending, the same verdict ChecksRollup counts. The timestamps are gh's ISO strings, left for the window to turn into a duration.\n\n```go\ntype CheckLog struct {\n\tNumber  int           `json:\"number,omitempty\"`\n\tHead    string        `json:\"head,omitempty\"`\n\tPassed  int           `json:\"passed\"`\n\tPending int           `json:\"pending\"`\n\tFailed  []FailedCheck `json:\"failed,omitempty\"`\n}\n```\nCheckLog is the pull request's checks at its head commit. Number 0 is a branch with no pull request. Logs are read only once no check is pending: gh serves a job's log only when its whole run has finished.\n\n```go\ntype CheckLogOptions struct {\n\tID    string `json:\"id\"`\n\tLines int    `json:\"lines,omitempty\"`\n}\n```\nCheckLogOptions names the calling session. Lines is how many lines of each failing step to keep; 0 keeps CheckLogLines.\n\n```go\ntype CheckoutFileOptions struct {\n\tPath string `json:\"path\"`\n\tRel  string `json:\"rel\"`\n}\n```\nCheckoutFileOptions names file Rel of the checkout at Path.\n\n```go\ntype ChecksRollup struct {\n\tPassed  int `json:\"passed\"`\n\tFailed  int `json:\"failed\"`\n\tPending int `json:\"pending\"`\n\tTotal   int `json:\"total\"`\n}\n```\nChecksRollup collapses gh's statusCheckRollup array into the counts the panel shows. Total is every check, so \"all green\" is Passed == Total \u0026\u0026 Total \u003e 0.\n\n```go\ntype CloseProjectOptions struct {\n\tFrom    string `json:\"from\"`\n\tProject string `json:\"project\"`\n}\n```\nCloseProjectOptions is one CloseProject call, an object for the reason CloseSessionOptions is one. Project is an open project by name or by directory path; From is the caller's session, whose own project is refused.\n\n```go\ntype CloseSessionOptions struct {\n\tFrom     string `json:\"from\"`\n\tTarget   string `json:\"target\"`\n\tProject  string `json:\"project\"`\n\tWorktree string `json:\"worktree\"`\n\tForce    bool   `json:\"force\"`\n\tSelf     bool   `json:\"self\"`\n}\n```\nCloseSessionOptions is one Close call, an object for the reason OpenOptions is one: an option a newer lich adds is dropped by an older backend, and one an older lich does not send is its zero value.\n\n```go\ntype ClosedHistory struct {\n\tSessions []ParkedSession `json:\"sessions\"`\n\tTotal    int             `json:\"total\"`\n\t// Parked sessions whose conversation has not been indexed yet, which is what\n\t// the list reports while the backfill catches up on a workspace that predates\n\t// the index. 0 once every row has one, which is the steady state.\n\tIndexing int `json:\"indexing\"`\n}\n```\nClosedHistory is one page of the parked-session history and the size of the match it was cut from. Total is what lets the list say it was cut instead of presenting closedSessionLimit rows as the whole answer.\n\n```go\ntype ClosedProject struct {\n\tID   string `json:\"id\"`\n\tName string `json:\"name\"`\n\tPath string `json:\"path\"`\n\t// Sessions is how many sessions the project held: their terminals were\n\t// stopped, and their rows stay for the reopen.\n\tSessions int `json:\"sessions\"`\n}\n```\nClosedProject is what a caller is told about the project it closed.\n\n```go\ntype ClosedSession struct {\n\tID        string `json:\"id\"`\n\tProjectID string `json:\"projectId\"`\n\tProject   string `json:\"project\"`\n\tLabel     string `json:\"label\"`\n\t// Worktree is the checkout the session lived in, empty for a session in the\n\t// project's own directory.\n\tWorktree string `json:\"worktree\"`\n\t// Kept is the answer given to the worktree question: the checkout was left on\n\t// disk rather than removed. Meaningless unless the close had that question to\n\t// answer — a session sharing its checkout, or living in the project's own\n\t// directory, reports false while leaving everything where it was.\n\t//\n\t// Nothing here reports the park, because every close but a removal parks and\n\t// a field that is true on all of them tells a caller nothing.\n\tKept bool `json:\"kept\"`\n\t// Removed is whether the checkout was deleted.\n\tRemoved bool `json:\"removed\"`\n}\n```\nClosedSession is what a caller is told about the session it closed.\n\n```go\ntype CollectNowOptions struct {\n\tFrom string `json:\"from\"`\n}\n```\nCollectNowOptions is one CollectNow call, an object for the reason SendOptions is one.\n\n```go\ntype CollectOptions struct {\n\tFrom        string `json:\"from\"`\n\tWaitSeconds int    `json:\"waitSeconds\"`\n}\n```\nCollectOptions is one Collect call, an object for the reason SendOptions is one.\n\n```go\ntype CollectedResults struct {\n\tResults []SendResult `json:\"results\"`\n\tOpen    []string     `json:\"open\"`\n}\n```\nCollectedResults is what a drain returns: every outcome that was waiting for the caller, oldest first, and the labels of the sessions still owing one.\n\n```go\ntype ColorFolderOptions struct {\n\tFrom    string `json:\"from\"`\n\tProject string `json:\"project\"`\n\tFolder  string `json:\"folder\"`\n\tColor   string `json:\"color\"`\n}\n```\nColorFolderOptions is one ColorFolder call, an object for the reason CloseOptions is one.\n\n```go\ntype ColoredFolder struct {\n\tProject  string   `json:\"project\"`\n\tFolder   string   `json:\"folder\"`\n\tColor    string   `json:\"color\"`\n\tSessions []string `json:\"sessions\"`\n}\n```\nColoredFolder is what a caller is told about a folder it painted: the sessions that took the colour, by label.\n\n```go\ntype CommitIdentity struct {\n\tName  string `json:\"name\"`\n\tEmail string `json:\"email\"`\n\tLocal bool   `json:\"local\"`\n}\n```\nCommitIdentity is the name and email the next commit in a checkout would be authored with — the fact the project's gh account (ghaccount.go) does not carry, since that one only governs what lich asks gh. Local says the value comes from the checkout's own config rather than the global one.\n\nThe zero value is a legitimate answer, not a failure: a checkout with no identity configured is one of the states worth showing.\n\n```go\ntype CommitPattern struct {\n\t// Target is the part the rule reads, already in the words the screen uses:\n\t// \"message\", \"author email\", \"committer email\".\n\tTarget string `json:\"target\"`\n\t// Operator is GitHub's own: regex | starts_with | ends_with | contains.\n\tOperator string `json:\"operator\"`\n\tPattern  string `json:\"pattern\"`\n\t// Negate flips the test — the pattern is then what the text must *not* be.\n\tNegate bool `json:\"negate\"`\n}\n```\nCommitPattern is one ruleset rule that tests the text of a commit rather than the state of a pull request. It earns its own field because it is the one class of rule nothing on a pull request hints at: the checks pass, the review lands, no conflict exists, and GitHub still answers BLOCKED — because the message the merge \\*would\\* write breaks a pattern nobody can see from here.\n\n```go\ntype ContinueInOptions struct {\n\tID      string `json:\"id\"`\n\tProfile string `json:\"profile\"`\n}\n```\nContinueInOptions moves session ID's conversation to Profile, a slug of its provider.\n\n```go\ntype ControlSessionOptions struct {\n\tFrom    string `json:\"from\"`\n\tTarget  string `json:\"target\"`\n\tProject string `json:\"project\"`\n\tAction  string `json:\"action\"`\n\tValue   string `json:\"value\"`\n\tArgs    string `json:\"args\"`\n}\n```\nControlSessionOptions is one Control call, an object for the reason CloseOptions is one.\n\n```go\ntype ControlledSession struct {\n\tID        string `json:\"id\"`\n\tProject   string `json:\"project\"`\n\tLabel     string `json:\"label\"`\n\tAction    string `json:\"action\"`\n\tValue     string `json:\"value,omitempty\"`\n\tCommandID string `json:\"command_id\"`\n\tState     string `json:\"state\"`\n}\n```\nControlledSession is what a caller is told about a command it gave a session. Value is the prompt, model, effort or slash command's name the action carried, and CommandID the id the session's mod acks it under.\n\n```go\ntype CostReport struct {\n\tProjects []CostTotal `json:\"projects\"`\n\tSessions int         `json:\"sessions\"`\n\tUnpriced int         `json:\"unpriced\"`\n\tPriced   int         `json:\"priced\"`\n\tReported int         `json:\"reported\"`\n\tSource   string      `json:\"source\"`\n\tCostUSD  float64     `json:\"costUsd\"`\n\tReadout  bool        `json:\"readout\"`\n}\n```\nCostReport is CostTotals' answer: a row per project, and the same numbers summed across every row.\n\nThe money is a \\*\\*lower bound\\*\\* whenever Unpriced is not zero. A session lich never priced holds no ledger row at all — its provider files its conversation where lich has no reader, a model in it has no price, or the readout was off while it ran — and nothing here can guess what it spent. Shipping that count beside the sum is the whole difference between \"this is what it cost\" and \"this is what lich could add up\", and a total that omitted it in silence would be the one failure mode that makes the number not worth reading.\n\nWhy the row is missing is not in here on purpose: that is costMiss (internal/terminal/usage\\_cost.go), which is decided by the live scan and never persisted, so the ledger can only say that a session has no price — not which of the reasons it was.\n\nPriced and Reported are how many counted sessions each rung contributed, and they are what lets a reader weigh the total: the sum is the one place the difference between the two is invisible, since both arrive as dollars.\n\nReadout is whether the cost readout is on at all. Off, no transcript is ever summed, so every session is unpriced and the total can only be zero — which a caller has to be able to say instead of printing a $0.00 that reads as free.\n\n```go\ntype CostTotal struct {\n\tProject  string  `json:\"project\"`\n\tSessions int     `json:\"sessions\"`\n\tUnpriced int     `json:\"unpriced\"`\n\tSource   string  `json:\"source\"`\n\tCostUSD  float64 `json:\"costUsd\"`\n}\n```\nCostTotal is what one project's sessions have cost. Sessions is every session in the unit; Unpriced is how many of them carry no price at all, so the money covers Sessions-Unpriced of them.\n\nSource is whose arithmetic that money is: providers.CostSourcePriced when lich derived every dollar of it from token counts, providers.CostSourceReported when the providers that spent it handed their own figures over, and CostSourceMixed when the row spans both. Empty is a row with nothing to attribute — every session in it unpriced, or its spend earned by a provider CLI run by hand inside a shell session, which lich never spawned a rung for.\n\n```go\ntype CostTotalsOptions struct {\n\tProject  string `json:\"project\"`\n\tProvider string `json:\"provider\"`\n\tSince    int64  `json:\"since\"`\n}\n```\nCostTotalsOptions is one CostTotals call. It travels as a single JSON object rather than as positional arguments because a package manager replaces the lich binary under a running backend: a filter a newer \\`lich cost\\` adds is dropped by an older backend, and one an older \\`lich cost\\` does not send is no filter, where a positional list refuses both on its count.\n\n```go\ntype CreateProfileOptions struct {\n\tName string `json:\"name\"`\n}\n```\nCreateProfileOptions names a new profile.\n\n```go\ntype CreateWorktreeFromPROptions struct {\n\tProjectPath string `json:\"projectPath\"`\n\tProjectID   string `json:\"projectId\"`\n\tNumber      int    `json:\"number\"`\n}\n```\nCreateWorktreeFromPROptions creates a worktree on pull request Number's branch.\n\n```go\ntype CreateWorktreeOptions struct {\n\tProjectPath  string `json:\"projectPath\"`\n\tProjectID    string `json:\"projectId\"`\n\tName         string `json:\"name\"`\n\tBase         string `json:\"base\"`\n\tBaseIsRemote bool   `json:\"baseIsRemote\"`\n\tSeedFrom     string `json:\"seedFrom,omitempty\"`\n}\n```\nCreateWorktreeOptions creates worktree Name of the project at ProjectPath, branched from Base (a remote branch when BaseIsRemote). SeedFrom is the checkout whose working tree the caller is about to carry into it; empty, or a branch that already exists, seeds from ProjectPath.\n\n```go\ntype Declared struct {\n\tName     string\n\tRequest  reflect.Type\n\tResponse reflect.Type\n}\n```\nDeclared is one Method with its type parameters as values, for code that walks the whole contract (the golden test).\n\n```go\ntype DeclaredEvent struct {\n\tName    string\n\tPayload reflect.Type\n}\n```\nDeclaredEvent is one Event or EventFamily with its payload as a value, for code that walks the whole contract (the golden test). Name ends in \"\\\u003cid\u003e\" for a family.\n\n```go\ntype DetectedProvider struct {\n\tID        string `json:\"id\"`\n\tName      string `json:\"name\"`\n\tBinary    string `json:\"binary\"`\n\tInstalled bool   `json:\"installed\"`\n\tPath      string `json:\"path\"`\n\tSource    string `json:\"source\"`\n\tDocs      string `json:\"docs\"`\n}\n```\nDetectedProvider reports a provider and whether a binary a session could spawn was found — on PATH, or at the path the user configured. Binary is the executable name a session spawns (DefaultBinary), which the settings screen needs even when nothing was found: a provider id is not its command — Antigravity's is \\`agy\\`. Docs is carried on every entry, installed or not: the row that has somewhere to send the user is exactly the one that found nothing. Source is SourcePath or SourceSetting, empty when nothing was found.\n\n```go\ntype Diagnostics struct {\n\tVersion  string `json:\"version\"`\n\tPlatform string `json:\"platform\"`\n\tLogPath  string `json:\"logPath\"`\n}\n```\nDiagnostics is what a bug report opens with: the three facts that decide whether a report is actionable, and the log path the user attaches.\n\n```go\ntype DiffStats struct {\n\tFiles   int    `json:\"files\"`\n\tAdded   int    `json:\"added\"`\n\tDeleted int    `json:\"deleted\"`\n\tHead    string `json:\"head\"`\n\tBranch  string `json:\"branch\"`\n\t// Merging names what a merge in progress brings in, \"\" when none.\n\t// Conflicted is the unmerged paths, repository-relative, during a merge,\n\t// a rebase or a cherry-pick alike.\n\tMerging    string   `json:\"merging,omitempty\"`\n\tConflicted []string `json:\"conflicted,omitempty\"`\n}\n```\nDiffStats is what one status read says about a work tree: its uncommitted changes, and the two things they sit on. Head is the commit — the window watches it to notice a commit the way it watches Files/Added/Deleted to notice an edit — and Branch is the branch, carried here because git answers both in the same call the counts come out of.\n\n```go\ntype DropAttachment struct {\n\tPath   string `json:\"path\"`\n\tNotice string `json:\"notice\"`\n}\n```\nDropAttachment is what the picker produced: the path to write at the prompt, and the line that goes under it when that path is a copy's (copyNotice), empty when the session opens the file where it lies. Both empty for a cancelled dialog.\n\n```go\ntype Event[T any] struct {\n\tName string\n}\n```\nEvent names one message of the /events stream; T is its payload (None for one that carries nothing).\n\n```go\ntype EventFamily[T any] struct {\n\tPrefix string\n}\n```\nEventFamily is a set of events named by a prefix and a session id, one per session: \"terminal:exit:\\\u003cid\u003e\". Terminal I/O is named this way so each terminal subscribes only to its own stream instead of filtering a global broadcast. Every other session event is global and carries the id in its payload: its consumers outlive any one card, and a per-session name can only reach a subscriber that exists when it is emitted.\n\n```go\nfunc (f EventFamily[T]) ID(name string) (string, bool)\n```\nID is the session an event of the family is about, false for an event of another name.\n\n```go\nfunc (f EventFamily[T]) Of(id string) Event[T]\n```\nOf is the family's event for session id.\n\n```go\ntype Extension struct {\n\tID          string                   `json:\"id\"`\n\tName        string                   `json:\"name\"`\n\tDescription string                   `json:\"description,omitempty\"`\n\tVersion     string                   `json:\"version\"`\n\tStatus      string                   `json:\"status\"`\n\tError       string                   `json:\"error,omitempty\"`\n\tDir         string                   `json:\"dir\"`\n\tSurfaces    []ExtensionSurface       `json:\"surfaces\"`\n\tSource      string                   `json:\"source,omitempty\"`\n\tRelease     string                   `json:\"release,omitempty\"`\n\tLatest      string                   `json:\"latest,omitempty\"`\n\tRevoked     string                   `json:\"revoked,omitempty\"`\n\tText        map[string]ExtensionText `json:\"text,omitempty\"`\n\t// Icons is the PNG each surface's iconFile names, by surface id, drawn in\n\t// place of its Icon.\n\tIcons map[string][]byte `json:\"icons,omitempty\"`\n\t// Permissions is what the manifest lists, the extension.Permission names\n\t// its calls and subscriptions may use.\n\tPermissions []string `json:\"permissions\"`\n}\n```\nExtension is one directory under lich's extensions directory and where its process is. Name, Description and Surfaces come from its manifest, so they are the extension's own words; Text holds their translations, by the tag of each folder of the extension's locales. Source is the repository or folder it was installed from and Release the repository's tag, both empty for one placed by hand. Latest is the tag of a newer release, empty while lich knows of none. Revoked is why the lich catalog took its repository down, which keeps it stopped for good.\n\n```go\ntype ExtensionCatalog struct {\n\tCatalog  extension.Catalog `json:\"catalog\"`\n\tPlatform string            `json:\"platform\"`\n}\n```\nExtensionCatalog is catalog.json as the backend holds it. Platform is this lich's \\\u003cgoos\u003e\\_\\\u003cgoarch\u003e, the key of an entry's Builds an install takes.\n\n```go\ntype ExtensionCatalogImageOptions struct {\n\tURL string `json:\"url\"`\n}\n```\nExtensionCatalogImageOptions names an image by the URL the catalog gives.\n\n```go\ntype ExtensionDirInstallOptions struct {\n\tDir string `json:\"dir\"`\n}\n```\nExtensionDirInstallOptions names a folder holding manifest.json and the executable at its root.\n\n```go\ntype ExtensionGitInstallOptions struct {\n\tURL string `json:\"url\"`\n}\n```\nExtensionGitInstallOptions names the repository to install from: [https://github.com/](https://github.com/)\\\u003cowner\u003e/\\\u003crepo\u003e, with or without .git.\n\n```go\ntype ExtensionIDOptions struct {\n\tID string `json:\"id\"`\n}\n```\nExtensionIDOptions names one extension.\n\n```go\ntype ExtensionInstallPreview struct {\n\tToken       string   `json:\"token\"`\n\tID          string   `json:\"id\"`\n\tName        string   `json:\"name\"`\n\tVersion     string   `json:\"version\"`\n\tSource      string   `json:\"source\"`\n\tRelease     string   `json:\"release,omitempty\"`\n\tPublisher   string   `json:\"publisher,omitempty\"`\n\tListed      bool     `json:\"listed,omitempty\"`\n\tPermissions []string `json:\"permissions\"`\n}\n```\nExtensionInstallPreview is a staged install: what the person is asked to confirm, read from the staged copy's manifest. Token names the copy for CommitInstall or DiscardInstall, and expires when neither comes in time. Publisher is the repository's owner, empty for a folder; Listed is whether the release is the one the lich catalog lists, pinned to its hashes.\n\n```go\ntype ExtensionInstallTokenOptions struct {\n\tToken string `json:\"token\"`\n}\n```\nExtensionInstallTokenOptions names a staged install by the token its preview carries.\n\n```go\ntype ExtensionMessage struct {\n\tExtensionID string          `json:\"extensionId\"`\n\tMessage     json.RawMessage `json:\"message\"`\n}\n```\nExtensionMessage is a line extension ExtensionID wrote and lich accepted.\n\n```go\ntype ExtensionSendOptions struct {\n\tID      string          `json:\"id\"`\n\tMessage json.RawMessage `json:\"message\"`\n}\n```\nExtensionSendOptions writes Message, one line of the extension contract, to the process of extension ID. Only event, surface.opened, surface.closed and language are accepted.\n\n```go\ntype ExtensionSurface struct {\n\tID    string `json:\"id\"`\n\tTitle string `json:\"title\"`\n\tIcon  string `json:\"icon,omitempty\"`\n\tPlace string `json:\"place,omitempty\"`\n}\n```\nExtensionSurface is a screen an extension declares, and Place where it lives: \"\" for a full screen, \"dock\" or \"panel\" (extension.Place).\n\n```go\ntype ExtensionText struct {\n\tName        string            `json:\"name,omitempty\"`\n\tDescription string            `json:\"description,omitempty\"`\n\tSurfaces    map[string]string `json:\"surfaces,omitempty\"`\n}\n```\nExtensionText is an extension's name, description and surface titles, by surface id, in one language of its catalogs. What it leaves out reads the manifest's.\n\n```go\ntype ExtensionUpdate struct {\n\tID     string `json:\"id\"`\n\tLatest string `json:\"latest\"`\n}\n```\nExtensionUpdate is the newer release lich found for extension ID, or an empty Latest once there is none.\n\n```go\ntype ExternalSession struct {\n\tKind              string `json:\"kind\"`\n\tProviderSessionID string `json:\"providerSessionId\"`\n\tTitle             string `json:\"title\"`\n\tPath              string `json:\"path\"`\n\tProjectID         string `json:\"projectId\"`\n\tProjectName       string `json:\"projectName\"`\n\tProjectPath       string `json:\"projectPath\"`\n\tUpdatedAt         int64  `json:\"updatedAt\"`\n\t// Profile is the Claude Code or Codex profile the conversation lives in,\n\t// the one a resume of it runs in whatever the project's own profile is.\n\tProfile string `json:\"profile,omitempty\"`\n}\n```\nExternalSession is a conversation started outside lich that one of its projects can adopt: it ran in that project's directory or in one of its checkouts. Path is what the adopted row carries, \"\" for the project's own directory, the same as a session lich opened there.\n\n```go\ntype FailedCheck struct {\n\tName  string    `json:\"name\"`\n\tURL   string    `json:\"url,omitempty\"`\n\tSteps []StepLog `json:\"steps,omitempty\"`\n}\n```\nFailedCheck is one failed check. Steps is empty for a check that is not a GitHub Actions job, whose log lives only at URL, and while checks are pending.\n\n```go\ntype FileLinesOptions struct {\n\tPath string `json:\"path\"`\n\tRel  string `json:\"rel\"`\n\tRef  string `json:\"ref\"`\n\tFrom int    `json:\"from\"`\n\tTo   int    `json:\"to\"`\n}\n```\nFileLinesOptions reads lines From to To of file Rel, at Ref (\"\" for the working tree).\n\n```go\ntype FileListing struct {\n\tFiles []string `json:\"files\"`\n\t// Cut reports a listing that stopped at walkLimit. Only a plain-folder walk\n\t// can set it; git's own listing is never capped.\n\tCut bool `json:\"cut\"`\n\t// Hidden names the walkIgnore directories this folder actually had, sorted\n\t// and deduped: the panel names them, so somebody keeping source under a\n\t// build/ or vendor/ reads why it is missing instead of guessing.\n\tHidden []string `json:\"hidden\"`\n}\n```\nFileListing is one listing of a directory's files: the paths, plus the two things the Files panel has to say out loud about how they were gathered. A tree that silently stops short, or silently leaves a directory out, reads as a folder with fewer files in it than it has.\n\n```go\ntype FileSessionOptions struct {\n\tFrom    string `json:\"from\"`\n\tTarget  string `json:\"target\"`\n\tProject string `json:\"project\"`\n\tFolder  string `json:\"folder\"`\n}\n```\nFileSessionOptions is one File call, an object for the reason CloseOptions is one.\n\n```go\ntype FiledSession struct {\n\tID       string `json:\"id\"`\n\tProject  string `json:\"project\"`\n\tLabel    string `json:\"label\"`\n\tFolder   string `json:\"folder\"`\n\tPrevious string `json:\"previous\"`\n}\n```\nFiledSession is what a caller is told about the session it filed. Previous is the folder it left, \"\" when it was in none.\n\n```go\ntype FocusSessionOptions struct {\n\tFrom    string `json:\"from\"`\n\tTarget  string `json:\"target\"`\n\tProject string `json:\"project\"`\n}\n```\nFocusSessionOptions is one Focus call, an object for the reason SendOptions is one.\n\n```go\ntype FocusedSession struct {\n\tID      string `json:\"id\"`\n\tLabel   string `json:\"label\"`\n\tProject string `json:\"project\"`\n}\n```\nFocusedSession says which session's card was brought up, so a caller that named it loosely can tell the person which one it was.\n\n```go\ntype FoldersOptions struct {\n\tFrom    string `json:\"from\"`\n\tProject string `json:\"project\"`\n}\n```\nFoldersOptions is one Folders call, an object for the reason CloseOptions is one.\n\n```go\ntype FollowSystemOptions struct {\n\tOn bool `json:\"on\"`\n}\n```\nFollowSystemOptions is whether the window follows the OS to the selected theme's pair.\n\n```go\ntype GetSettingOptions struct {\n\tKey       string `json:\"key\"`\n\tProjectID string `json:\"projectId\"`\n}\n```\nGetSettingOptions reads setting Key of project ProjectID, \"\" for a global one.\n\n```go\ntype GitAuthorsOptions struct {\n\tPath string `json:\"path\"`\n\tRef  string `json:\"ref,omitempty\"`\n}\n```\nGitAuthorsOptions names the history GitAuthors reads, Ref empty for the same everything GitLogOptions reads.\n\n```go\ntype GitBranchOptions struct {\n\tPath string `json:\"path\"`\n\tName string `json:\"name\"`\n}\n```\nGitBranchOptions names a local branch of the checkout at Path.\n\n```go\ntype GitCheckoutOptions struct {\n\tPath   string `json:\"path\"`\n\tBranch string `json:\"branch\"`\n\tRemote bool   `json:\"remote,omitempty\"`\n}\n```\nGitCheckoutOptions switches the checkout at Path to Branch. A Remote branch (\"origin/x\") is checked out as the local branch that tracks it.\n\n```go\ntype GitCommit struct {\n\tHash    string   `json:\"hash\"`\n\tParents []string `json:\"parents\"`\n\tAuthor  string   `json:\"author\"`\n\tWhen    int64    `json:\"when\"` // unix seconds, author date\n\tSubject string   `json:\"subject\"`\n\tRefs    []GitRef `json:\"refs\"`\n\t// Head marks the commit HEAD is at, a detached HEAD included.\n\tHead bool `json:\"head,omitempty\"`\n}\n```\nGitCommit is one row of the history.\n\n```go\ntype GitCommitDetail struct {\n\tHash    string          `json:\"hash\"`\n\tAuthor  string          `json:\"author\"`\n\tEmail   string          `json:\"email\"`\n\tWhen    int64           `json:\"when\"`\n\tMessage string          `json:\"message\"`\n\tRefs    []GitRef        `json:\"refs\"`\n\tFiles   []GitCommitFile `json:\"files\"`\n}\n```\nGitCommitDetail is what the history shows of the selected commit. Files of a merge are its changes against the first parent.\n\n```go\ntype GitCommitDiffOptions struct {\n\tPath    string `json:\"path\"`\n\tHash    string `json:\"hash\"`\n\tFile    string `json:\"file\"`\n\tOldFile string `json:\"oldFile,omitempty\"`\n}\n```\nGitCommitDiffOptions names one file of a commit. OldFile is where a renamed file came from: without it, git reads the rename as an added file.\n\n```go\ntype GitCommitFile struct {\n\tPath    string `json:\"path\"`\n\tOldPath string `json:\"oldPath,omitempty\"`\n\tAdded   int    `json:\"added\"`\n\tDeleted int    `json:\"deleted\"`\n\tBinary  bool   `json:\"binary,omitempty\"`\n}\n```\nGitCommitFile is one file a commit changed. Binary has no line counts.\n\n```go\ntype GitCommitOptions struct {\n\tPath string `json:\"path\"`\n\tHash string `json:\"hash\"`\n}\n```\nGitCommitOptions names a commit of the checkout at Path.\n\n```go\ntype GitConflict struct {\n\tBase   string             `json:\"base\"`\n\tOurs   string             `json:\"ours\"`\n\tTheirs string             `json:\"theirs\"`\n\tChunks []GitConflictChunk `json:\"chunks\"`\n}\n```\nGitConflict is a conflicted file's three versions as the index holds them, and the chunks where they differ, in order.\n\n```go\ntype GitConflictChunk struct {\n\tKind   string   `json:\"kind\"`\n\tBase   GitLines `json:\"base\"`\n\tOurs   GitLines `json:\"ours\"`\n\tTheirs GitLines `json:\"theirs\"`\n}\n```\nGitConflictChunk is one place where a side changed the base, and the lines it spans in each of the three versions.\n\n```go\ntype GitCreateBranchOptions struct {\n\tPath string `json:\"path\"`\n\tName string `json:\"name\"`\n\tFrom string `json:\"from\"`\n\t// Upstream is written to the new branch's config, to make a deleted one again.\n\tUpstream GitUpstream `json:\"upstream,omitzero\"`\n}\n```\nGitCreateBranchOptions makes branch Name at From, a ref or a commit, without checking it out.\n\n```go\ntype GitDeletedBranch struct {\n\tHash     string      `json:\"hash\"`\n\tUpstream GitUpstream `json:\"upstream,omitzero\"`\n}\n```\nGitDeletedBranch is what a delete returns to make the branch again: the commit it pointed at and the upstream it tracked.\n\n```go\ntype GitHubAccountState struct {\n\tAccount  string   `json:\"account\"`\n\tAccounts []string `json:\"accounts\"`\n\tHidden   bool     `json:\"hidden\"`\n}\n```\nGitHubAccountState is how the checkout's project answers to gh: Account is the one it selected, \"\" for gh's active one; Accounts is every account gh is signed in to, \"\\\u003chost\u003e/\\\u003clogin\u003e\"; Hidden is whether GitHub answers Account as if the repository did not exist, asked only when there is another account to pick instead.\n\n```go\ntype GitLines struct {\n\tFrom int `json:\"from\"`\n\tTo   int `json:\"to\"`\n}\n```\nGitLines is a run of lines, From included and To not, counted from 0; an empty run is the point between two lines.\n\n```go\ntype GitLogOptions struct {\n\tPath   string `json:\"path\"`\n\tRef    string `json:\"ref,omitempty\"`\n\tQuery  string `json:\"query,omitempty\"`\n\tAuthor string `json:\"author,omitempty\"`\n\tSince  int64  `json:\"since,omitempty\"` // unix seconds, 0 for no bound\n\tFile   string `json:\"file,omitempty\"`\n\tSkip   int    `json:\"skip,omitempty\"`\n\tLimit  int    `json:\"limit\"`\n}\n```\nGitLogOptions asks for a page of a repository's history. An empty Ref is every branch, remote branch and tag. Query, Author, Since and File narrow it; a narrowed page lists commits whose parents it may not hold.\n\n```go\ntype GitLogPage struct {\n\tCommits []GitCommit `json:\"commits\"`\n\tMore    bool        `json:\"more\"`\n}\n```\nGitLogPage is a page of the history, newest first; More says another page follows it.\n\n```go\ntype GitMergeOptions struct {\n\tPath string `json:\"path\"`\n\tRef  string `json:\"ref\"`\n}\n```\nGitMergeOptions names Ref, a branch or commit, to merge into the checkout at Path.\n\n```go\ntype GitMergePreview struct {\n\tCommits   int      `json:\"commits\"`\n\tConflicts []string `json:\"conflicts,omitempty\"`\n}\n```\nGitMergePreview is what merging Ref would bring: its commits HEAD lacks, and the files it would conflict on.\n\n```go\ntype GitMergeResult struct {\n\tBefore    string   `json:\"before\"`\n\tAfter     string   `json:\"after,omitempty\"`\n\tConflicts []string `json:\"conflicts,omitempty\"`\n}\n```\nGitMergeResult is a merge's outcome: the commit HEAD left and the one it reached, or, when it stopped, the files in conflict and no After.\n\n```go\ntype GitMergeUndoOptions struct {\n\tPath   string `json:\"path\"`\n\tBefore string `json:\"before\"`\n\tAfter  string `json:\"after\"`\n}\n```\nGitMergeUndoOptions takes the checkout at Path back from After to Before.\n\n```go\ntype GitRef struct {\n\tName string `json:\"name\"`\n\tKind string `json:\"kind\"`\n\tHead bool   `json:\"head,omitempty\"`\n\t// Worktree is where a local branch is checked out, \"\" for none. GitRefs\n\t// fills it; a log row's refs leave it empty.\n\tWorktree string `json:\"worktree,omitempty\"`\n}\n```\nGitRef is a branch or a tag. Name is the short name; Head marks the branch HEAD is on.\n\n```go\ntype GitRefs struct {\n\tRefs []GitRef `json:\"refs\"`\n\tHead string   `json:\"head\"`\n\t// Stamp changes when any ref or HEAD moves, for a poll to tell a new\n\t// history from the one it holds without reading the log again.\n\tStamp string `json:\"stamp\"`\n}\n```\nGitRefs is every branch and tag of a repository. Head is the commit HEAD is at, \"\" in a repository without commits.\n\n```go\ntype GitRenameBranchOptions struct {\n\tPath    string `json:\"path\"`\n\tName    string `json:\"name\"`\n\tNewName string `json:\"newName\"`\n}\n```\nGitRenameBranchOptions renames local branch Name to NewName.\n\n```go\ntype GitResolveFileOptions struct {\n\tPath    string `json:\"path\"`\n\tRel     string `json:\"rel\"`\n\tContent string `json:\"content\"`\n}\n```\nGitResolveFileOptions writes Content as the resolution of conflicted file Rel in the checkout at Path.\n\n```go\ntype GitUpstream struct {\n\tRemote     string `json:\"remote,omitempty\"`\n\tMerge      string `json:\"merge,omitempty\"`\n\tPushRemote string `json:\"pushRemote,omitempty\"`\n}\n```\nGitUpstream is a branch's branch.\\\u003cname\u003e.remote, .merge and .pushRemote settings, each \"\" when unset.\n\n```go\ntype HandoffSessionOptions struct {\n\tFrom    string `json:\"from\"`\n\tKind    string `json:\"kind\"`\n\tModel   string `json:\"model\"`\n\tEffort  string `json:\"effort\"`\n\tProfile string `json:\"profile\"`\n}\n```\nHandoffSessionOptions is one Handoff call: the session handing its work off (From) and what its successor runs. Kind, Model and Effort left empty are the caller's own. Profile is only a suggestion put to the user: the successor starts in the caller's profile whatever it names, because lich moves work to another account only on the user's click.\n\n```go\ntype ImportThemeOptions struct {\n\tPath      string `json:\"path\"`\n\tOverwrite bool   `json:\"overwrite\"`\n}\n```\nImportThemeOptions names the theme file to import; Overwrite replaces a custom theme of the same id instead of asking.\n\n```go\ntype InsertTextOptions struct {\n\tFrom        string `json:\"from\"`\n\tTarget      string `json:\"target\"`\n\tProject     string `json:\"project\"`\n\tText        string `json:\"text\"`\n\tWaitSeconds int    `json:\"waitSeconds\"`\n}\n```\nInsertTextOptions is one Insert call, an object for the reason SendOptions is one.\n\n```go\ntype InsertedText struct {\n\tID      string `json:\"id\"`\n\tLabel   string `json:\"label\"`\n\tProject string `json:\"project\"`\n\tKind    string `json:\"kind\"`\n\t// Bytes is what was pasted, after control characters were stripped (sanitize).\n\tBytes int `json:\"bytes\"`\n}\n```\nInsertedText says where the text went, so an editor can tell the person which session took it when the target was chosen for them.\n\n```go\ntype InstallPluginsOptions struct {\n\tSlug string   `json:\"slug\"`\n\tKeys []string `json:\"keys\"`\n}\n```\nInstallPluginsOptions installs Keys (plugin@marketplace) into profile Slug.\n\n```go\ntype InstallThemesOptions struct {\n\tURL       string `json:\"url\"`\n\tOverwrite bool   `json:\"overwrite\"`\n}\n```\nInstallThemesOptions names the theme repository to clone.\n\n```go\ntype Issue struct {\n\tNumber int    `json:\"number\"`\n\tTitle  string `json:\"title\"`\n\tBody   string `json:\"body\"`\n\tURL    string `json:\"url\"`\n}\n```\nIssue is the little of a GitHub issue the New worktree dialog needs: what to name the branch after, and what to tell the session it opens.\n\n```go\ntype LabelSessionOptions struct {\n\tSessionID string `json:\"sessionId\"`\n\tLabel     string `json:\"label\"`\n}\n```\nLabelSessionOptions gives session SessionID the label the user typed.\n\n```go\ntype LastSaid struct {\n\tText string `json:\"text,omitempty\"`\n}\n```\nLastSaid is the prose the agent ended its last turn with, the body of the window's finished-turn notification. Text is empty for every absence there is — a provider whose conversation lich cannot read, a turn that ended in a tool call, a transcript still being written — because the notification goes out without a body either way and a reason it cannot act on is a reason not worth wiring.\n\n```go\ntype ListPullRequestsOptions struct {\n\tPath  string `json:\"path\"`\n\tState string `json:\"state\"`\n}\n```\nListPullRequestsOptions lists the pull requests in State (\"open\", \"closed\", \"merged\", \"all\").\n\n```go\ntype LoginCodeOptions struct {\n\tSlug string `json:\"slug\"`\n\tCode string `json:\"code\"`\n}\n```\nLoginCodeOptions hands a running login of profile Slug the code its sign-in page showed.\n\n```go\ntype MarkThreadFixedOptions struct {\n\tThreadID string `json:\"threadId\"`\n\tCommit   string `json:\"commit\"`\n}\n```\nMarkThreadFixedOptions is the agent saying Commit fixes ThreadID, a thread handed to it from the Pulls screen.\n\n```go\ntype MergePullRequestOptions struct {\n\tPath    string `json:\"path\"`\n\tNumber  int    `json:\"number\"`\n\tMethod  string `json:\"method\"`\n\tSubject string `json:\"subject\"`\n\tBody    string `json:\"body\"`\n\tAdmin   bool   `json:\"admin\"`\n}\n```\nMergePullRequestOptions merges pull request Number by Method (\"merge\", \"squash\", \"rebase\"); Admin bypasses the branch's rules.\n\n```go\ntype Method[Req, Resp any] struct {\n\tName string\n}\n```\nMethod names one RPC. Req is its options object (None for a method that takes nothing) and Resp its result (None for one that only fails or not).\n\n```go\nfunc (m Method[Req, Resp]) Args(req Req) []any\n```\nArgs is req in the wire envelope.\n\n```go\ntype None struct{}\n```\nNone is the request of a method that takes nothing and the result of one that returns only an error.\n\n```go\ntype NotifyOptions struct {\n\tSummary string `json:\"summary\"`\n\tDetail  string `json:\"detail\"`\n}\n```\nNotifyOptions is a desktop notification: its summary line and the detail under it.\n\n```go\ntype NumberOptions struct {\n\tPath   string `json:\"path\"`\n\tNumber int    `json:\"number\"`\n}\n```\nNumberOptions names issue or pull request Number of the checkout at Path's repository.\n\n```go\ntype OpenExternalOptions struct {\n\tURL string `json:\"url\"`\n}\n```\nOpenExternalOptions names the link to open in the system's browser.\n\n```go\ntype OpenFileOptions struct {\n\tDir string `json:\"dir\"`\n\tRel string `json:\"rel\"`\n}\n```\nOpenFileOptions names a file by its checkout and its path inside it.\n\n```go\ntype OpenFolderOptions struct {\n\tDir string `json:\"dir\"`\n}\n```\nOpenFolderOptions names a folder to open.\n\n```go\ntype OpenSessionOptions struct {\n\tFrom      string `json:\"from\"`\n\tProject   string `json:\"project\"`\n\tKind      string `json:\"kind\"`\n\tWorktree  string `json:\"worktree\"`\n\tBase      string `json:\"base\"`\n\tModel     string `json:\"model\"`\n\tEffort    string `json:\"effort\"`\n\tFolder    string `json:\"folder\"`\n\tUltracode bool   `json:\"ultracode\"`\n}\n```\nOpenSessionOptions is one Open call. It travels as a single JSON object rather than as positional arguments because a package manager replaces the lich binary under a running backend: a newer CLI's option the backend does not know is dropped, and one an older CLI does not send is its zero value, where a positional list refuses both on its count.\n\nFrom is the session the caller runs in, empty for the command line run outside one. It decides two defaults: the project the session lands in and the provider it runs, both taken from the caller unless named. A caller with no session of its own must name the project — there is nothing to inherit. It is also recorded on the row as the new session's origin, which outlives the request that created it: the card says where it came from for as long as it exists.\n\nProject is a project already on screen, by name, or a directory path — and a path is the only way to reach a project the window is not holding, which is what opening one from the command line means. See ensureProject.\n\nWorktree, when given, is the branch name of a new git worktree created off Base (the project's current branch when Base is empty); the session is rooted there and labelled after it, exactly as the window's own worktree flow does. A Base without a Worktree has nothing to branch, and is refused rather than ignored.\n\nModel, when given, is the model the provider is spawned on, in that provider's own spelling. It is recorded on the row so every later spawn repeats it. Effort, when given, is the reasoning effort, passed and recorded the same way. Ultracode turns Claude Code's ultracode on, at whatever effort the session runs; it is recorded the same way, and refused for every other provider.\n\nFolder, when given, is the folder the session is filed under from its first frame: it is written with the row, so the card arrives in the folder's block rather than among its checkout's cards and then jumps.\n\n```go\ntype OpenSubagentOptions struct {\n\tFrom      string `json:\"from\"`\n\tKind      string `json:\"kind\"`\n\tWorktree  string `json:\"worktree\"`\n\tBase      string `json:\"base\"`\n\tModel     string `json:\"model\"`\n\tEffort    string `json:\"effort\"`\n\tUltracode bool   `json:\"ultracode\"`\n}\n```\nOpenSubagentOptions is one OpenSubagent call, an object for the reason OpenOptions is one. Its fields mean what Open's do; there is no project or folder, both of which are the caller's.\n\n```go\ntype OpenedProject struct {\n\tID   string `json:\"id\"`\n\tName string `json:\"name\"`\n\tPath string `json:\"path\"`\n}\n```\nOpenedProject identifies an opened project directory.\n\n```go\ntype OpenedSession struct {\n\tID              string `json:\"id\"`\n\tProjectID       string `json:\"projectId\"`\n\tProject         string `json:\"project\"`\n\tLabel           string `json:\"label\"`\n\tName            string `json:\"name\"`\n\tKind            string `json:\"kind\"`\n\tPath            string `json:\"path\"`\n\tNextSeq         int    `json:\"nextSeq\"`\n\tOriginSessionID string `json:\"originSessionId\"`\n\tOriginLabel     string `json:\"originLabel\"`\n\tConfined        bool   `json:\"confined\"`\n\tFolder          string `json:\"folder\"`\n\tProfileDropped  string `json:\"profileDropped,omitempty\"`\n}\n```\nOpenedSession is one opened session: what the caller is told, and what the window is handed to draw the card. Both read the same struct because both need the same facts — a divergence between them is a card that does not match the session the agent was given.\n\nName is the second name the session answers to, empty for a Claude Code one, which names itself (relay.RosterNameOf); Label is the name on its card. Both address it (see internal/relay). Path is the worktree the session lives in, empty for a session in the project's own directory — the store's own spelling. NextSeq is the project's label counter after this session took its number. OriginSessionID and OriginLabel name the session that asked for this one — empty when the caller was not a session at all. Confined is whether the session opened inside the sandbox. Nobody is at this end to be asked, so it is the rung's own answer (store.SandboxDefault), and saying it is what keeps a caller from discovering the empty home and the read-only machine by running into them. Folder is the folder it was filed under, \"\" for none. ProfileDropped is why a handoff's suggested profile could not be put to the user, \"\" when none was dropped.\n\n```go\ntype PRBodyOptions struct {\n\tPath   string `json:\"path\"`\n\tNumber int    `json:\"number\"`\n\tBody   string `json:\"body\"`\n}\n```\nPRBodyOptions is a text for pull request Number: its description, or a comment on it.\n\n```go\ntype PRChanged struct {\n\tPath   string `json:\"path\"`\n\tNumber int    `json:\"number\"`\n}\n```\nPRChanged names the checkout the write ran in and the pull request it addressed; Number is 0 where the write addresses a thread or a review rather than a number (the checkout's repository is then all that is known).\n\n```go\ntype PRComment struct {\n\t// ID is the REST database id, the address an edit or a delete takes.\n\tID        int64  `json:\"id\"`\n\tAuthor    string `json:\"author\"`\n\tAvatar    string `json:\"avatar,omitempty\"`\n\tBody      string `json:\"body\"`\n\tDate      string `json:\"date\"`\n\tCanEdit   bool   `json:\"canEdit\"`\n\tCanDelete bool   `json:\"canDelete\"`\n}\n```\nPRComment is one comment on the pull request itself.\n\n```go\ntype PRCommentBodyOptions struct {\n\tPath      string `json:\"path\"`\n\tNumber    int    `json:\"number\"`\n\tCommentID int64  `json:\"commentId\"`\n\tBody      string `json:\"body\"`\n}\n```\nPRCommentBodyOptions is a text for comment CommentID of pull request Number: its new body, or a reply to it.\n\n```go\ntype PRCommentOptions struct {\n\tPath      string `json:\"path\"`\n\tNumber    int    `json:\"number\"`\n\tCommentID int64  `json:\"commentId\"`\n}\n```\nPRCommentOptions names comment CommentID of pull request Number.\n\n```go\ntype PRCommit struct {\n\tOID      string `json:\"oid\"`\n\tHeadline string `json:\"headline\"`\n\tBody     string `json:\"body\"`\n\tLogin    string `json:\"login\"`\n\tName     string `json:\"name\"`\n\tEmail    string `json:\"email\"`\n\tDate     string `json:\"date\"` // gh's ISO committedDate\n}\n```\nPRCommit is one commit the pull request would land, split the way git itself splits a message: the subject line, then the body (empty for a one-liner).\n\nLogin and Name are kept apart because only one of them is evidence: Name is free text, Login is the account GitHub resolved the author's email to against every account's verified addresses — an answer lich cannot compute, and one whose \"\" means the email belongs to nobody rather than \"unknown\".\n\n```go\ntype PRConflictsOptions struct {\n\tPath   string `json:\"path\"`\n\tNumber int    `json:\"number\"`\n\tBase   string `json:\"base\"`\n\tPRURL  string `json:\"prUrl\"`\n}\n```\nPRConflictsOptions asks which files of pull request Number conflict with Base.\n\n```go\ntype PRConversation struct {\n\t// HeadRefOID is the commit a new review comment is filed against. GitHub\n\t// defaults to the latest commit, but naming it means a review submitted\n\t// seconds after a push cannot silently land on lines nobody read.\n\tHeadRefOID string `json:\"headRefOid\"`\n\t// ViewerDidAuthor is whether the account gh ran as opened the pull\n\t// request, which GitHub lets neither approve it nor request changes on it.\n\tViewerDidAuthor bool       `json:\"viewerDidAuthor\"`\n\tReviews         []PRReview `json:\"reviews\"`\n\t// Comments are the pull request's own comments — the ones with no file and\n\t// no line, which GitHub files as issue comments.\n\tComments []PRComment      `json:\"comments\"`\n\tThreads  []PRReviewThread `json:\"threads\"`\n}\n```\nPRConversation is everything said about a pull request: the reviews and their verdicts, the comments left on the pull request itself, and the threads anchored to a file and line. The Pulls screen renders the anchored ones inside the diff and the rest in its Conversation tab.\n\n```go\ntype PRDetail struct {\n\tNumber int    `json:\"number\"`\n\tURL    string `json:\"url\"`\n\tTitle  string `json:\"title\"`\n\tBody   string `json:\"body\"`\n\t// Author is the login of whoever opened it, or their display name when gh\n\t// reports no login. GitHub refuses a review request addressed to them, which\n\t// is what keeps them out of the picker.\n\tAuthor string `json:\"author\"`\n\t// AuthorLogin is the same account as Author, minus the fallback to a display\n\t// name — the value a commit's login is compared against. Author cannot serve:\n\t// a name matches no login, so a PR whose author gh reports without one would\n\t// read as every commit landing under the wrong account.\n\tAuthorLogin string `json:\"authorLogin\"`\n\t// State is gh's OPEN | CLOSED | MERGED. Only a number-addressed lookup can\n\t// return a non-OPEN one; the branch lookup still gates them out.\n\tState     string `json:\"state\"`\n\tIsDraft   bool   `json:\"isDraft\"`\n\tMergeable string `json:\"mergeable\"` // gh: MERGEABLE | CONFLICTING | UNKNOWN\n\t// MergeStateStatus is GitHub's own answer to \"can this merge right now\" —\n\t// CLEAN | UNSTABLE | BLOCKED | BEHIND | DIRTY | DRAFT | HAS_HOOKS | UNKNOWN.\n\t// Mergeable alone cannot gate the button: it says nothing about a required\n\t// review or a required check, and it reads UNKNOWN while GitHub recomputes\n\t// after a push.\n\tMergeStateStatus string `json:\"mergeStateStatus\"`\n\t// ReviewDecision is gh's aggregate verdict — APPROVED | CHANGES_REQUESTED |\n\t// REVIEW_REQUIRED — and \"\" where the repository requires no review. Who\n\t// reviewed is a different field (latestReviews) this does not carry.\n\tReviewDecision string `json:\"reviewDecision\"`\n\t// Reviewers is who was asked and who answered, in one list (prreviewers.go).\n\tReviewers    []PRReviewer `json:\"reviewers\"`\n\tBaseRefName  string       `json:\"baseRefName\"`\n\tHeadRefName  string       `json:\"headRefName\"`\n\tChangedFiles int          `json:\"changedFiles\"`\n\tAdditions    int          `json:\"additions\"`\n\tDeletions    int          `json:\"deletions\"`\n\tChecks       ChecksRollup `json:\"checks\"`\n\tCheckRuns    []CheckItem  `json:\"checkRuns\"`\n\tCommits      []PRCommit   `json:\"commits\"`\n\t// IsCrossRepository marks a head branch that lives on a fork.\n\tIsCrossRepository bool `json:\"isCrossRepository\"`\n\t// MaintainerCanModify is GitHub's \"allow edits by maintainers\" on a fork PR,\n\t// and the whole of what decides whether a session can be opened on one: with\n\t// it a push back to the fork's branch is authorised, without it there is\n\t// nowhere for an agent's commits to go (CreateWorktreeFromPR). It is false on\n\t// a same-repository PR, where nothing needs the permission.\n\tMaintainerCanModify bool `json:\"maintainerCanModify\"`\n}\n```\nPRDetail is the full view of a branch's open pull request — richer than the footer badge's PullRequest — driving the dock's Pulls panel: the title, body, CI rollup and mergeability gate the merge affordance. gh's state does not travel with it: a detail exists only when the PR is open (parsePRDetail).\n\n```go\ntype PRRead struct {\n\tPath   string\n\tNumber int\n\tOpen   bool\n\tHead   string\n\tChecks ChecksRollup\n\tReview string\n}\n```\nPRRead is one read of an armed checkout's pull request. Head, Checks and Review are only filled while it is open. Review is the latest submitted review's id, \"\" for none.\n\n```go\ntype PRReview struct {\n\t// ID is the GraphQL node id, which is what dismissing the review takes.\n\tID string `json:\"id\"`\n\t// DatabaseID is the REST id, the address its summary is rewritten at.\n\tDatabaseID int64  `json:\"databaseId\"`\n\tAuthor     string `json:\"author\"`\n\t// Avatar is the address of the author's picture, read with\n\t// ProjectPullRequestAvatar; \"\" for an account deleted since.\n\tAvatar string `json:\"avatar,omitempty\"`\n\t// State is gh's APPROVED | CHANGES_REQUESTED | COMMENTED | DISMISSED.\n\tState   string `json:\"state\"`\n\tBody    string `json:\"body\"`\n\tDate    string `json:\"date\"`\n\tCanEdit bool   `json:\"canEdit\"`\n}\n```\nPRReview is one submitted review: its verdict, and whatever was written in the summary box above the line comments.\n\n```go\ntype PRReviewBodyOptions struct {\n\tPath     string `json:\"path\"`\n\tNumber   int    `json:\"number\"`\n\tReviewID int64  `json:\"reviewId\"`\n\tBody     string `json:\"body\"`\n}\n```\nPRReviewBodyOptions rewrites the body of review ReviewID.\n\n```go\ntype PRReviewThread struct {\n\t// ID is the GraphQL node id, which is what resolving a thread takes. It is\n\t// not the number a reply is addressed to — that is a comment's own ID.\n\tID   string `json:\"id\"`\n\tPath string `json:\"path\"`\n\t// Line is the anchor in the file the thread's side names, and StartLine the\n\t// first line of a multi-line thread (0 when it covers one line). A thread\n\t// GitHub could not re-anchor keeps its original line and is marked outdated,\n\t// which is what sends it to the Conversation tab instead of the diff.\n\tLine      int `json:\"line\"`\n\tStartLine int `json:\"startLine\"`\n\t// Side is RIGHT for a thread on the new file, LEFT for one on a deleted\n\t// line — the two sides the diff renders in one document.\n\tSide       string            `json:\"side\"`\n\tIsResolved bool              `json:\"isResolved\"`\n\tIsOutdated bool              `json:\"isOutdated\"`\n\tComments   []PRThreadComment `json:\"comments\"`\n}\n```\nPRReviewThread is one conversation anchored to a line of the diff.\n\n```go\ntype PRReviewer struct {\n\t// Login is the account's login, or a team's slug — which is not what gh takes\n\t// to add or remove one (that is org/slug), so a team is shown and not edited.\n\tLogin  string `json:\"login\"`\n\tIsTeam bool   `json:\"isTeam\"`\n\t// State is \"\" while the review is still owed, else gh's APPROVED |\n\t// CHANGES_REQUESTED | COMMENTED | DISMISSED.\n\tState string `json:\"state\"`\n}\n```\nPRReviewer is one entry of a pull request's review roster: somebody who was asked and has not answered yet, or somebody who has.\n\n```go\ntype PRSummary struct {\n\tNumber  int    `json:\"number\"`\n\tTitle   string `json:\"title\"`\n\tAuthor  string `json:\"author\"` // login, or the display name when gh reports no login\n\tState   string `json:\"state\"`  // gh: OPEN | CLOSED | MERGED\n\tIsDraft bool   `json:\"isDraft\"`\n\t// ReviewDecision is gh's APPROVED | CHANGES_REQUESTED | REVIEW_REQUIRED,\n\t// and \"\" for a repository that requires no review.\n\tReviewDecision string `json:\"reviewDecision\"`\n\tHeadRefName    string `json:\"headRefName\"`\n\t// IsCrossRepository marks a PR whose head branch lives on a fork. lich can\n\t// check such a branch out, but the commits would have nowhere to push, so\n\t// the session flow refuses it (CreateWorktreeFromPR) and the button reads\n\t// as blocked rather than failing on click.\n\tIsCrossRepository bool         `json:\"isCrossRepository\"`\n\tUpdatedAt         string       `json:\"updatedAt\"` // gh's ISO timestamp\n\tChecks            ChecksRollup `json:\"checks\"`\n\t// Threads is counted only on a CHANGES_REQUESTED row (prlistthreads.go);\n\t// every other row carries a zero tally.\n\tThreads ThreadTally `json:\"threads\"`\n}\n```\nPRSummary is one row of the repository's open pull requests — what the list column needs to render and rank a PR before anything is selected. The full view behind a row is PRDetail, fetched per PR.\n\n```go\ntype PRThreadComment struct {\n\t// ID is the REST database id — the address a reply is posted to. GraphQL\n\t// node ids do not work there, which is why both identifiers travel.\n\tID     int64  `json:\"id\"`\n\tAuthor string `json:\"author\"`\n\tAvatar string `json:\"avatar,omitempty\"`\n\tBody   string `json:\"body\"`\n\tDate   string `json:\"date\"`\n\t// DiffHunk is GitHub's own snippet of the lines the thread is about. The\n\t// diff already has them where the thread is anchored; this is what an\n\t// outdated thread has left.\n\tDiffHunk string `json:\"diffHunk\"`\n\t// CanEdit is GitHub's own answer to whether the account reading may\n\t// rewrite the comment, which is what the Edit button stands on.\n\tCanEdit   bool `json:\"canEdit\"`\n\tCanDelete bool `json:\"canDelete\"`\n}\n```\nPRThreadComment is one message inside a thread.\n\n```go\ntype PRTitleOptions struct {\n\tPath   string `json:\"path\"`\n\tNumber int    `json:\"number\"`\n\tTitle  string `json:\"title\"`\n}\n```\nPRTitleOptions retitles pull request Number.\n\n```go\ntype ParkSessionOptions struct {\n\tProjectID string `json:\"projectId\"`\n\tSessionID string `json:\"sessionId\"`\n\tActiveID  string `json:\"activeId\"`\n}\n```\nParkSessionOptions parks session SessionID; ActiveID becomes the project's active session, \"\" for none.\n\n```go\ntype ParkedSession struct {\n\tID          string `json:\"id\"`\n\tProjectID   string `json:\"projectId\"`\n\tProjectName string `json:\"projectName\"`\n\t// The project's own directory, so resuming a session of a closed project can\n\t// reopen that project first without a second lookup — and can ask where it\n\t// went when the directory has moved.\n\tProjectPath string `json:\"projectPath\"`\n\tLabel       string `json:\"label\"`\n\tKind        string `json:\"kind\"`\n\tPath        string `json:\"path\"`\n\t// The branch the checkout was on at the close, empty for a row parked before\n\t// lich recorded one. Searchable, not drawn.\n\tParkedBranch string `json:\"parkedBranch\"`\n\t// Unix seconds, 0 for a row parked before closed_at existed — which sorts\n\t// last and is drawn as no date rather than as 1970.\n\tClosedAt int64 `json:\"closedAt\"`\n\t// Whether the search reached this row through its conversation. It is what\n\t// the window keeps the row on, apart from the snippet: a hit the index found\n\t// by a fold the plain text does not have (\"cion\" against \"ción\"), or a term\n\t// the index split on punctuation, has a snippet of nothing to show.\n\tMatchedConversation bool `json:\"matchedConversation\"`\n\t// The stretch of conversation that matched the search, empty for a row the\n\t// search matched by name, for one matched by a fold (see above), and for\n\t// every row of an empty query, which matched nothing in particular.\n\tSnippet string `json:\"snippet\"`\n\t// Whether the cap on one session's index dropped the oldest of this\n\t// conversation. The row says so on screen: a search that reaches only part\n\t// of a session has to be readable as that rather than as an absence.\n\tTruncated bool `json:\"truncated\"`\n}\n```\nParkedSession is one parked session offered for resuming — what identifies it in a list somebody is browsing rather than one they are already looking at. The project rides along because history spans every project at once, closed ones included, and the project name is what tells two sessions of the same name apart.\n\nTwo answers about the branch, and they are different questions: ParkedBranch is the snapshot this row was closed on, which is what the search matches, and what the window draws is read live off the checkout, because a worktree's directory stops agreeing with its branch the moment an agent branches inside it (native/cmd/lich-native/model.go, checkoutLabel). A row whose checkout is gone has nothing live to show — which is the same row that cannot be resumed anyway.\n\n```go\ntype PatchNotes struct {\n\tVersion    string                `json:\"version\"`\n\tHighlights []PatchNotesHighlight `json:\"highlights\"`\n\tGroups     []PatchNotesGroup     `json:\"groups\"`\n}\n```\nPatchNotes is a release's changelog section, ready for the window to render.\n\n```go\ntype PatchNotesGroup struct {\n\tLabel string `json:\"label\"`\n\t// Items keep their markdown bold/code markers; the window renders them.\n\tItems []string `json:\"items\"`\n}\n```\nPatchNotesGroup is one \"### Added / Changed / Fixed\" block of a release's notes.\n\n```go\ntype PatchNotesHighlight struct {\n\tKind string `json:\"kind\"`\n\t// Text keeps its markdown bold/code markers; the window renders them.\n\tText string `json:\"text\"`\n}\n```\nPatchNotesHighlight is one GitHub alert block (\"\u003e \\[!IMPORTANT]\") written between a release's heading and its first group. Kind is the alert type, lowercased.\n\n```go\ntype PatchNotesOptions struct {\n\tLocale string `json:\"locale\"`\n}\n```\nPatchNotesOptions names the interface language to read the release in.\n\n```go\ntype PathBranchOptions struct {\n\tPath   string `json:\"path\"`\n\tBranch string `json:\"branch\"`\n}\n```\nPathBranchOptions names a branch of the checkout at Path.\n\n```go\ntype PathOptions struct {\n\tPath string `json:\"path\"`\n}\n```\nPathOptions names a checkout, or a directory, by its path.\n\n```go\ntype PathsOptions struct {\n\tPaths []string `json:\"paths\"`\n}\n```\nPathsOptions names several paths.\n\n```go\ntype Peer struct {\n\tLabel   string `json:\"label\"`\n\tName    string `json:\"name\"`\n\tProject string `json:\"project\"`\n\tKind    string `json:\"kind\"`\n\tState   string `json:\"state\"`\n\t// ID is the session's lich id, the LICH_SESSION_ID its process carries,\n\t// so a reader holding a recorded id can find its card. Last, because\n\t// fields are appended to this shape, never inserted.\n\tID string `json:\"id\"`\n\t// Path is the directory the session runs in, the worktree's for a worktree\n\t// session, and ProjectPath the root of the project it belongs to. They are\n\t// what an editor matches its open folder against to find the session beside\n\t// it; the name of a project says nothing about where it is.\n\tPath        string `json:\"path\"`\n\tProjectPath string `json:\"projectPath\"`\n\t// Tool and Detail are the tool a busy session is running and what it acts\n\t// on, Reason what a waiting one is blocked on: the line its card draws\n\t// under the label, in the provider's own words (SessionStatus). Empty in\n\t// every other state, and for a busy turn that has named no tool yet.\n\tTool   string `json:\"tool,omitempty\"`\n\tDetail string `json:\"detail,omitempty\"`\n\tReason string `json:\"reason,omitempty\"`\n\t// Focused marks the session whose card the window has on screen: the\n\t// active card of the project tab in front. No session has it while no\n\t// window is open.\n\tFocused bool `json:\"focused,omitempty\"`\n}\n```\nPeer is one session a caller may address: the label it is addressed by, the name it answers to in Claude Code's peer roster, the project it belongs to (labels are unique within a project, not across them), what is running in it, and what that session last reported it was doing.\n\nBoth names are published because both reach this session and an agent sees them in different places — the label on the card, the roster name in \\`/list-agents\\` and in what a mention writes at a prompt. Showing one and accepting the other is what made an agent treat a single session as two.\n\nState is stateBusy, stateWaiting or stateDone, and empty when the session has reported nothing — which is a provider whose plugin does not report state as much as a session that has not had a turn yet. Empty is \"not known\", never \"idle\": guessing the second is how a caller ends up sending work into a session that cannot take it.\n\n```go\ntype PeersOptions struct {\n\tFrom string `json:\"from\"`\n}\n```\nPeersOptions is one Peers call, an object for the reason SendOptions is one.\n\n```go\ntype PickFileOptions struct {\n\tTitle string `json:\"title\"`\n}\n```\nPickFileOptions titles the file chooser.\n\n```go\ntype PickSaveFileOptions struct {\n\tTitle       string `json:\"title\"`\n\tDefaultName string `json:\"defaultName\"`\n}\n```\nPickSaveFileOptions titles the save dialog and names the file it offers.\n\n```go\ntype PluginIncompatible struct {\n\tID      string `json:\"id\"`\n\tVersion string `json:\"version\"`\n}\n```\n\n```go\ntype PluginProfileFailure struct {\n\tProfile string `json:\"profile\"`\n\tName    string `json:\"name\"`\n\tError   string `json:\"error\"`\n}\n```\nPluginProfileFailure is one profile the plugin could not be installed into.\n\n```go\ntype PluginProfiles struct {\n\tProvider string                 `json:\"provider\"`\n\tName     string                 `json:\"name\"`\n\tVersion  string                 `json:\"version\"`\n\tFailures []PluginProfileFailure `json:\"failures\"`\n}\n```\nPluginProfiles is what one pass did: the release it installed and the profiles where the install failed, in the CLI's own words. Name is the provider's display name.\n\n```go\ntype PluginProviderOptions struct {\n\tProvider string `json:\"provider\"`\n}\n```\nPluginProviderOptions names the provider whose lich plugin is installed or updated.\n\n```go\ntype PluginStatus struct {\n\tProvider string `json:\"provider\"`\n\tName     string `json:\"name\"`\n\t// Available is whether the provider's CLI is on PATH at all. A provider the\n\t// machine does not have is still listed — with nothing to install — so the\n\t// UI can say why it is not on offer.\n\tAvailable        bool   `json:\"available\"`\n\tInstalled        bool   `json:\"installed\"`\n\tInstalledVersion string `json:\"installedVersion\"`\n\t// LatestVersion is the newest release this lich is compatible with, not the\n\t// newest the plugin has published: it is the one an install or update writes.\n\tLatestVersion   string `json:\"latestVersion\"`\n\tUpdateAvailable bool   `json:\"updateAvailable\"`\n\t// Compatible is false when the installed release is outside the range this\n\t// lich speaks (PluginVersionFloor, PluginVersionCeiling). Its reports still\n\t// land where they parse; UpdateAvailable then offers LatestVersion, a\n\t// downgrade included.\n\tCompatible bool `json:\"compatible\"`\n}\n```\nPluginStatus is one provider's plugin state, reported to the window.\n\n```go\ntype Profile struct {\n\tSlug     string `json:\"slug\"`\n\tName     string `json:\"name\"`\n\tDir      string `json:\"dir\"`\n\tPersonal bool   `json:\"personal\"`\n\t// Copied names the shared entries (a settings file, say) this profile holds\n\t// as a copy, so edits made in one account no longer reach the other.\n\tCopied []string `json:\"copied,omitempty\"`\n\t// Color is the card color the profile is shown in, \"\" for the one the\n\t// window derives from the slug.\n\tColor string `json:\"color,omitempty\"`\n\t// Image is the profile's picture as a PNG, avatarEdge square.\n\tImage []byte `json:\"image,omitempty\"`\n}\n```\nProfile is one login lich knows about.\n\n```go\ntype ProfileChanged struct {\n\tProvider string  `json:\"provider\"`\n\tProfile  Profile `json:\"profile\"`\n}\n```\nProfileChanged is ProfileChangedEvent's payload: Provider is the provider id (\"claude\", \"kiro\"), Profile the profile as it now is, without its login state.\n\n```go\ntype ProfileInfo struct {\n\tProfile\n\tLoggedIn bool   `json:\"loggedIn\"`\n\tEmail    string `json:\"email,omitempty\"`\n\tOrgName  string `json:\"orgName,omitempty\"`\n\t// Plan is the subscription the login is on: Claude Code's own name (\"pro\",\n\t// \"max\", \"team\", …), or Codex's from its plan reading.\n\tPlan string `json:\"plan,omitempty\"`\n\t// AuthMethod is how a Claude Code profile authenticates: \"claude.ai\",\n\t// \"console\", or \"none\" when nobody is logged in.\n\tAuthMethod string `json:\"authMethod,omitempty\"`\n\t// Plugins counts a Claude Code or Codex profile's plugins.\n\tPlugins int `json:\"plugins\"`\n\t// Providers are the providers an oh-my-pi profile holds an OAuth login for.\n\tProviders []string `json:\"providers,omitempty\"`\n\t// StatusError is why the CLI's status gave no answer, in its own words;\n\t// LoggedIn is then false for want of one.\n\tStatusError string `json:\"statusError,omitempty\"`\n}\n```\nProfileInfo is a profile with its login state, as the profile services of every provider list it; a field a provider has no reading for stays empty.\n\n```go\ntype ProfileLogin struct {\n\tProfile        string `json:\"profile\"`\n\tOutput         string `json:\"output,omitempty\"`\n\tURL            string `json:\"url,omitempty\"`\n\tAuthenticating bool   `json:\"authenticating,omitempty\"`\n\tDone           bool   `json:\"done,omitempty\"`\n\tLoggedIn       bool   `json:\"loggedIn,omitempty\"`\n\tCancelled      bool   `json:\"cancelled,omitempty\"`\n\tError          string `json:\"error,omitempty\"`\n\tPluginError    string `json:\"pluginError,omitempty\"`\n}\n```\nProfileLogin is one step of a login. Output carries what the CLI printed, with URL set when that text holds the sign-in address. Authenticating says the CLI is through with the browser and lich is reading whether the login took. The last event has Done set: LoggedIn is what the CLI's login status answered afterwards (\\`claude auth status\\`, \\`codex login status\\`), Error why the login failed or was cancelled, and PluginError why the lich plugin did not install.\n\n```go\ntype ProfileLoginMethods struct {\n\tLogin       Method[ProfileSlugOptions, None]\n\tCancelLogin Method[ProfileSlugOptions, None]\n}\n```\nProfileLoginMethods run a provider's login from lich, where its CLI has one that is not a terminal card's: Claude Code's and Codex's.\n\n```go\ntype ProfileMethods struct {\n\tProfiles      Method[None, []ProfileInfo]\n\tCreateProfile Method[CreateProfileOptions, Profile]\n\tUpdateProfile Method[UpdateProfileOptions, Profile]\n\tDeleteProfile Method[ProfileSlugOptions, None]\n\tLoginCommand  Method[ProfileSlugOptions, string]\n}\n```\nProfileMethods are the calls every provider's profile service answers.\n\n```go\ntype ProfilePlanOptions struct {\n\tProfile string `json:\"profile\"`\n}\n```\nProfilePlanOptions names the profile whose plan is read, \"personal\" for the machine's own.\n\n```go\ntype ProfilePlugin struct {\n\tKey         string `json:\"key\"`\n\tName        string `json:\"name\"`\n\tMarketplace string `json:\"marketplace\"`\n\tVersion     string `json:\"version,omitempty\"`\n}\n```\nProfilePlugin is one plugin a profile has installed at user scope.\n\n```go\ntype ProfilePluginMethods struct {\n\tPlugins        Method[ProfileSlugOptions, []ProfilePlugin]\n\tInstallPlugins Method[InstallPluginsOptions, []ProfilePluginResult]\n}\n```\nProfilePluginMethods carry plugins between profiles: Claude Code's and Codex's.\n\n```go\ntype ProfilePluginResult struct {\n\tKey     string `json:\"key\"`\n\tOK      bool   `json:\"ok\"`\n\tMessage string `json:\"message,omitempty\"`\n}\n```\nProfilePluginResult is one plugin's install, with Claude Code's own words when it refused: an organization's policy, a marketplace the profile cannot reach.\n\n```go\ntype ProfileSlugOptions struct {\n\tSlug string `json:\"slug\"`\n}\n```\nProfileSlugOptions names a profile by its slug.\n\n```go\ntype ProfileUpdate struct {\n\tName string `json:\"name,omitempty\"`\n\t// Color is a card color's name; \"\" goes back to the color the window\n\t// derives from the slug. The window draws a name it does not know the same\n\t// way, so it is stored as given.\n\tColor *string `json:\"color,omitempty\"`\n\t// Image is a file to make the profile's image from; \"\" removes the image.\n\tImage *string `json:\"image,omitempty\"`\n}\n```\nProfileUpdate is a change to how a profile is shown. A field left nil keeps what the profile has; Name keeps it when empty.\n\n```go\ntype Project struct {\n\tID              string    `json:\"id\"`\n\tName            string    `json:\"name\"`\n\tPath            string    `json:\"path\"`\n\tNextSeq         int       `json:\"nextSeq\"`\n\tActiveSessionID string    `json:\"activeSessionId\"`\n\tDefaultProvider string    `json:\"defaultProvider\"`\n\tSessions        []Session `json:\"sessions\"`\n}\n```\nProject is a persisted project together with its restorable session state.\n\n```go\ntype ProjectAdded struct {\n\tID   string `json:\"id\"`\n\tName string `json:\"name\"`\n\tPath string `json:\"path\"`\n}\n```\nProjectAdded is the payload of ProjectAddedEvent: the identity as stored.\n\n```go\ntype ProjectClosed struct {\n\tID string `json:\"id\"`\n}\n```\nProjectClosed is the payload of ProjectClosedEvent.\n\n```go\ntype ProjectIDOptions struct {\n\tID string `json:\"id\"`\n}\n```\nProjectIDOptions names a project by its id.\n\n```go\ntype ProjectRef struct {\n\tID   string `json:\"id\"`\n\tName string `json:\"name\"`\n\tPath string `json:\"path\"`\n}\n```\nProjectRef is the open project a ProjectRefOptions resolved to: the id the methods keyed by project (services.Save, services.StartAll) take.\n\n```go\ntype ProjectRefOptions struct {\n\tFrom    string `json:\"from\"`\n\tProject string `json:\"project\"`\n}\n```\nProjectRefOptions names an open project the way every spawn call does: by name or by directory path, empty for the caller's own.\n\n```go\ntype ProjectsReordered struct {\n\tIDs []string `json:\"ids\"`\n}\n```\nProjectsReordered is the payload of ProjectsReorderedEvent: every open project, in the order that was stored.\n\n```go\ntype ProviderBinary struct {\n\tPath    string `json:\"path\"`\n\tVersion string `json:\"version\"`\n}\n```\nProviderBinary is one executable a provider could be started from, and the version it reports, empty when it printed none lich could read.\n\n```go\ntype ProviderIDOptions struct {\n\tID string `json:\"id\"`\n}\n```\nProviderIDOptions names a provider by its id (\"claude\", \"codex\").\n\n```go\ntype PullRequest struct {\n\tNumber      int    `json:\"number\"`\n\tURL         string `json:\"url\"`\n\tTitle       string `json:\"title\"`\n\tState       string `json:\"state\"`\n\tHeadRefName string `json:\"headRefName\"`\n\tBaseRefName string `json:\"baseRefName\"`\n}\n```\nPullRequest is the GitHub pull request of a work tree's current branch, as reported by the gh CLI, whatever its state: one of gh's OPEN, CLOSED, MERGED.\n\n```go\ntype QuitOptions struct{}\n```\nQuitOptions is one Quit call, an object for the reason ShowWindowOptions is.\n\n```go\ntype QuotaPlan struct {\n\tProvider  string        `json:\"provider\"`\n\tName      string        `json:\"name\"`\n\tPlan      string        `json:\"plan,omitempty\"`\n\tAccount   string        `json:\"account,omitempty\"`\n\tNoAccount string        `json:\"noAccount,omitempty\"`\n\tWindows   []QuotaWindow `json:\"windows,omitempty\"`\n\tStatus    string        `json:\"status\"`\n}\n```\nQuotaPlan is one provider's quota reading. Provider is a providers.Registry id, so the window resolves the icon and the login command it already knows.\n\nAccount names the login the windows were read against — the whole point of the custom-binary path being that a session can spend an account lich's own environment does not name. It is empty whenever the provider will not say which, which is a reading without a name and never an error: a gauge that cannot name its account is exactly what lich drew before this field existed.\n\nNoAccount carries why it is empty, for the one absence a reader can act on. Left empty, an unnamed account is drawn the same whether the provider names nobody or the session's own login is one lich may not ask about, and nothing on the gauge told the two apart.\n\n```go\ntype QuotaPlansOptions struct {\n\tSessionID string `json:\"sessionId\"`\n}\n```\nQuotaPlansOptions names the session whose account's plans are read; \"\" reads the machine's own login.\n\n```go\ntype QuotaWindow struct {\n\tKind         string `json:\"kind,omitempty\"`\n\tLabel        string `json:\"label,omitempty\"`\n\tSeconds      int    `json:\"seconds\"`\n\tPercent      int    `json:\"percent\"`\n\tResetsAt     string `json:\"resetsAt,omitempty\"`\n\tActive       bool   `json:\"active,omitempty\"`\n\tLockedReason string `json:\"lockedReason,omitempty\"`\n\tAhead        bool   `json:\"ahead,omitempty\"`\n}\n```\nQuotaWindow is one metered window of a plan: how much of it is spent, how long it runs, and when it starts over.\n\nKind names a window lich names itself, one of the QuotaWindow\\* kinds, which the window translates. Label is the provider's own name for the rest (the model a scoped weekly cap belongs to, an Antigravity group), shown verbatim; empty when Kind is set. Seconds is its length, so the window can print the metered window it is looking at; 0 when the provider does not report one. ResetsAt is RFC 3339, empty when unreported. Active is the provider's own verdict on which window is the binding one, when it reports one at all. LockedReason is non-empty only when the provider says this window cannot be spent past regardless of its percentage. Ahead is lich's own reading of the rate rather than the provider's — see pace.go.\n\n```go\ntype ReadFileAtOptions struct {\n\tPath string `json:\"path\"`\n\tRel  string `json:\"rel\"`\n\tRef  string `json:\"ref\"`\n}\n```\nReadFileAtOptions names file Rel of the checkout at Path as it was at Ref.\n\n```go\ntype RecentProject struct {\n\tID   string `json:\"id\"`\n\tName string `json:\"name\"`\n\tPath string `json:\"path\"`\n}\n```\nRecentProject is a closed project offered for reopening — identity only, since the menu that lists them shows a name and a path and nothing else.\n\n```go\ntype RelayStalled struct {\n\tID       string `json:\"id\"`\n\tTargetID string `json:\"targetId\"`\n\tTarget   string `json:\"target\"`\n}\n```\nRelayStalled is the payload of RelayStalledEvent: who asked (\"\" when the request came from the command line rather than a session), and the session that has whatever was produced.\n\n```go\ntype RemoveThemeOptions struct {\n\tID string `json:\"id\"`\n}\n```\nRemoveThemeOptions names the custom theme to delete.\n\n```go\ntype RemoveWorktreeOptions struct {\n\tProjectPath  string `json:\"projectPath\"`\n\tWorktreePath string `json:\"worktreePath\"`\n\tForce        bool   `json:\"force\"`\n\tAdoptedAck   bool   `json:\"adoptedAck\"`\n}\n```\nRemoveWorktreeOptions removes the worktree at WorktreePath. AdoptedAck is the user's answer to removing one lich did not create.\n\n```go\ntype RenameFolderOptions struct {\n\tFrom    string `json:\"from\"`\n\tProject string `json:\"project\"`\n\tFolder  string `json:\"folder\"`\n\tTo      string `json:\"to\"`\n}\n```\nRenameFolderOptions is one RenameFolder call, an object for the reason CloseOptions is one. Folder is the name to change and To the new one.\n\n```go\ntype RenameProjectFolderOptions struct {\n\tProjectID string `json:\"projectId\"`\n\tFrom      string `json:\"from\"`\n\tTo        string `json:\"to\"`\n}\n```\nRenameProjectFolderOptions renames project ProjectID's folder From to To.\n\n```go\ntype RenameSessionOptions struct {\n\tFrom    string `json:\"from\"`\n\tTarget  string `json:\"target\"`\n\tProject string `json:\"project\"`\n\tLabel   string `json:\"label\"`\n}\n```\nRenameSessionOptions is one Rename call, an object for the reason CloseOptions is one.\n\n```go\ntype RenamedFolder struct {\n\tProject  string   `json:\"project\"`\n\tFrom     string   `json:\"from\"`\n\tTo       string   `json:\"to\"`\n\tSessions []string `json:\"sessions\"`\n}\n```\nRenamedFolder is what a caller is told about a folder it renamed or took apart: every session that moved, which is the part a merge into an existing folder would otherwise hide.\n\n```go\ntype RenamedSession struct {\n\tID       string `json:\"id\"`\n\tProject  string `json:\"project\"`\n\tLabel    string `json:\"label\"`\n\tPrevious string `json:\"previous\"`\n}\n```\nRenamedSession is what a caller is told about the session it renamed. Previous is the name that is gone, which is the half the caller cannot look up afterwards.\n\n```go\ntype ReopenSessionOptions struct {\n\tSessionID    string `json:\"sessionId\"`\n\tNewSessionID string `json:\"newSessionId\"`\n}\n```\nReopenSessionOptions brings parked session SessionID back as NewSessionID.\n\n```go\ntype ReopenWorktreeSessionOptions struct {\n\tProjectID    string `json:\"projectId\"`\n\tPath         string `json:\"path\"`\n\tNewSessionID string `json:\"newSessionId\"`\n}\n```\nReopenWorktreeSessionOptions brings back the parked session of the checkout at Path as NewSessionID.\n\n```go\ntype ReorderProjectsOptions struct {\n\tIDs []string `json:\"ids\"`\n}\n```\nReorderProjectsOptions is the full order of the open projects.\n\n```go\ntype ReorderSessionsOptions struct {\n\tProjectID string   `json:\"projectId\"`\n\tIDs       []string `json:\"ids\"`\n}\n```\nReorderSessionsOptions is the full card order of project ProjectID.\n\n```go\ntype ReplyOptions struct {\n\tFrom   string `json:\"from\"`\n\tTicket string `json:\"ticket\"`\n\tAnswer string `json:\"answer\"`\n}\n```\nReplyOptions is one Reply call, an object for the reason SendOptions is one. From is the session replying.\n\n```go\ntype ResizeOptions struct {\n\tID   string `json:\"id\"`\n\tCols int    `json:\"cols\"`\n\tRows int    `json:\"rows\"`\n}\n```\nResizeOptions sets session ID's PTY size.\n\n```go\ntype ResolveThreadOptions struct {\n\tPath     string `json:\"path\"`\n\tThreadID string `json:\"threadId\"`\n\tResolved bool   `json:\"resolved\"`\n}\n```\nResolveThreadOptions resolves review thread ThreadID, or opens it again.\n\n```go\ntype RestoreLinesOptions struct {\n\tPath string       `json:\"path\"`\n\tRel  string       `json:\"rel\"`\n\tUndo RevertResult `json:\"undo\"`\n}\n```\nRestoreLinesOptions undoes the revert Undo describes.\n\n```go\ntype ResumeAvailableOptions struct {\n\tKind              string `json:\"kind\"`\n\tProviderSessionID string `json:\"providerSessionId\"`\n\tCwd               string `json:\"cwd\"`\n}\n```\nResumeAvailableOptions asks whether conversation ProviderSessionID of provider Kind can be resumed from Cwd.\n\n```go\ntype RevertLine struct {\n\tSide string `json:\"side\"`\n\tLine int    `json:\"line\"`\n\tText string `json:\"text\"`\n}\n```\nRevertLine names one changed line of the diff the panel drew. Side \"old\" is a deletion, numbered in HEAD; \"new\" is an addition, numbered in the working tree. Text is the line without its +/- prefix, and is what proves the number still points at the same line.\n\n```go\ntype RevertLinesOptions struct {\n\tPath  string       `json:\"path\"`\n\tRel   string       `json:\"rel\"`\n\tLines []RevertLine `json:\"lines\"`\n}\n```\nRevertLinesOptions puts Lines of file Rel back to HEAD.\n\n```go\ntype RevertResult struct {\n\tPatch      string\n\tIndexPatch string\n}\n```\nRevertResult is what undoing a revert needs: the patch reversed onto the working tree, and the one reversed onto the index (\"\" when the index did not hold the change and was left alone).\n\n```go\nfunc (r RevertResult) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (r *RevertResult) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype ReviewComment struct {\n\tPath      string `json:\"path\"`\n\tLine      int    `json:\"line\"`\n\tStartLine int    `json:\"startLine\"`\n\t// Side is RIGHT (the new file) or LEFT (a deleted line). Empty means RIGHT,\n\t// which is where all but a deletion comment goes.\n\tSide string `json:\"side\"`\n\tBody string `json:\"body\"`\n}\n```\nReviewComment is one line comment of a review being submitted. Line is the last line it covers and StartLine the first (0 for a single-line comment) — GitHub's own convention, kept here so a selection crosses unchanged.\n\n```go\ntype SaveServiceOptions struct {\n\tID            string `json:\"id\"`\n\tProjectID     string `json:\"projectId\"`\n\tName          string `json:\"name\"`\n\tCommand       string `json:\"command\"`\n\tStartWithLich bool   `json:\"startWithLich\"`\n}\n```\nSaveServiceOptions writes a service: a new one when ID is \"\", the one ID names otherwise. A changed command reaches a running service at its next start.\n\n```go\ntype SaveThemeTemplateOptions struct {\n\tPath string `json:\"path\"`\n}\n```\nSaveThemeTemplateOptions is where the starter theme is written.\n\n```go\ntype ScheduleForfeited struct {\n\tLabel  string `json:\"label\"`\n\tAt     int64  `json:\"at\"`\n\tPrompt string `json:\"prompt\"`\n}\n```\nScheduleForfeited is a scheduled prompt lost with the session it was parked on, which was deleted for good: the row was the only copy of what the user wrote.\n\n```go\ntype ScheduleSelfOptions struct {\n\tFrom   string `json:\"from\"`\n\tAt     int64  `json:\"at\"`\n\tOn     string `json:\"on\"`\n\tPrompt string `json:\"prompt\"`\n}\n```\nScheduleSelfOptions is an agent's trigger for the session it runs in.\n\n```go\ntype SearchMatch struct {\n\tPath string `json:\"path\"`\n\t// Line is 1-based, the same numbering the preview's gutter shows.\n\tLine int `json:\"line\"`\n\t// Text is the line with its indentation dropped, cut to an excerpt around\n\t// the first occurrence when the line is long.\n\tText string `json:\"text\"`\n}\n```\nSearchMatch is one line of one file that contains the query.\n\n```go\ntype SearchOptions struct {\n\tPath  string `json:\"path\"`\n\tQuery string `json:\"query\"`\n}\n```\nSearchOptions searches the checkout at Path for Query.\n\n```go\ntype SearchResult struct {\n\tMatches []SearchMatch `json:\"matches\"`\n\t// Cut reports a search that stopped at maxSearchMatches.\n\tCut bool `json:\"cut\"`\n\t// TooLarge counts the listed files skipped for being above maxReadFileSize.\n\t// The tree shows them, so an answer that left them out says so; a binary\n\t// is skipped without a count, since nobody searches one for text.\n\tTooLarge int `json:\"tooLarge\"`\n}\n```\nSearchResult is one search over a checkout's files.\n\n```go\ntype SearchTermOptions struct {\n\tTerm string `json:\"term\"`\n}\n```\nSearchTermOptions narrows a listing to what matches Term, \"\" for all of it.\n\n```go\ntype SearchTranscriptsOptions struct {\n\tIDs   []string `json:\"ids\"`\n\tQuery string   `json:\"query\"`\n}\n```\nSearchTranscriptsOptions searches the transcripts of sessions IDs for Query.\n\n```go\ntype SelectThemeOptions struct {\n\tID string `json:\"id\"`\n}\n```\nSelectThemeOptions names the theme to store as the selection: \"system\" or an installed theme's id.\n\n```go\ntype SelfOptions struct {\n\tFrom string `json:\"from\"`\n}\n```\nSelfOptions is one Self call, an object for the reason SendOptions is one.\n\n```go\ntype SendOptions struct {\n\tFrom        string `json:\"from\"`\n\tTarget      string `json:\"target\"`\n\tProject     string `json:\"project\"`\n\tPrompt      string `json:\"prompt\"`\n\tWaitSeconds int    `json:\"waitSeconds\"`\n\t// ExtensionID and ExtensionName say the call is an extension's, by its id\n\t// and its name in the prompt language, so the prompt the target receives is\n\t// introduced as relayed by it. A call from a session leaves them empty.\n\tExtensionID   string `json:\"extensionId,omitempty\"`\n\tExtensionName string `json:\"extensionName,omitempty\"`\n}\n```\nSendOptions is one Send, SendPrivate or SendSubagent call. It travels as a single JSON object rather than as positional arguments because a package manager replaces the lich binary under a running backend: a field a newer lich adds is dropped by an older backend, and one an older lich does not send is its zero value, where a positional list refuses both on its count.\n\n```go\ntype SendResult struct {\n\tTicket string `json:\"ticket\"`\n\tTarget string `json:\"target\"`\n\tStatus string `json:\"status\"`\n\tAnswer string `json:\"answer\"`\n\t// Private is set on the outcome of a ticket sent with SendPrivate, which\n\t// only that ticket collects: no note will announce it.\n\tPrivate bool `json:\"private,omitempty\"`\n}\n```\nSendResult is what a caller gets back from Send or Wait. Answer is empty unless Status is StatusAnswered.\n\n```go\ntype Service struct {\n\tServiceConfig\n\tProjectName string `json:\"projectName\"`\n\tTerminal    string `json:\"terminal\"`\n\tState       string `json:\"state\"`\n\tExitCode    *int   `json:\"exitCode,omitempty\"`\n\tStartedAt   int64  `json:\"startedAt\"`\n\tStoppedAt   int64  `json:\"stoppedAt\"`\n}\n```\nService is a service and where its process is. Terminal is the id its PTY streams under on /ws while it runs, the one terminal.Write, Resize, Replay and SetVisible take. ExitCode is set once a run exited with a status of its own (nil while it runs, before it ever ran, or when it was killed). StartedAt and StoppedAt are unix milliseconds, 0 for never.\n\n```go\ntype ServiceConfig struct {\n\tID            string `json:\"id\"`\n\tProjectID     string `json:\"projectId\"`\n\tName          string `json:\"name\"`\n\tCommand       string `json:\"command\"`\n\tStartWithLich bool   `json:\"startWithLich\"`\n}\n```\nServiceConfig is a project service as the user saved it: a command lich runs in the project's directory, on its own PTY, until it exits. StartWithLich starts it whenever the lich backend starts.\n\n```go\ntype ServiceIDOptions struct {\n\tID string `json:\"id\"`\n}\n```\nServiceIDOptions names a service by its id.\n\n```go\ntype Session struct {\n\tID                string `json:\"id\"`\n\tLabel             string `json:\"label\"`\n\tKind              string `json:\"kind\"`\n\tPath              string `json:\"path\"`\n\tProviderSessionID string `json:\"providerSessionId\"`\n\t// Sandbox is whether this session runs confined: \"on\", \"off\", or empty for a\n\t// row nothing has spawned yet. The spawn writes its own verdict here, so the\n\t// window can mark a confined card without re-deriving a decision that took\n\t// the provider's rung, the checkout and a per-session override to reach.\n\tSandbox string `json:\"sandbox\"`\n\tPinned  bool   `json:\"pinned\"`\n\t// Folder is the sidebar block this session was filed under, \"\" for one the\n\t// user has not filed. It rides the row rather than a preference because it\n\t// is what the list is organised by — a workspace of forty sessions that\n\t// came back ungrouped after a restart would be a workspace nobody files.\n\tFolder string `json:\"folder\"`\n\t// Color is the palette colour the user painted the card with, \"\" for one\n\t// that follows the theme.\n\tColor string `json:\"color\"`\n\t// Profile is the Claude Code profile the session runs in\n\t// (internal/claudeprofile), \"\" for Personal and for every other provider.\n\tProfile string `json:\"profile\"`\n\t// Model is the model the session was born on (SetSessionModel), \"\" for one\n\t// opened on its provider's default.\n\tModel           string `json:\"model\"`\n\tOriginSessionID string `json:\"originSessionId\"`\n\tOriginLabel     string `json:\"originLabel\"`\n\t// Forked is whether the session was born branching its origin's\n\t// conversation, rather than delegated or opened as a subagent.\n\tForked bool `json:\"forked\"`\n\t// ScheduledAt is when the prompt below is due, in unix seconds, 0 for a\n\t// session with nothing waiting. It rides the session row so the card that\n\t// draws the countdown and the relay that delivers it read the same hydration\n\t// call, and neither needs a channel of its own.\n\tScheduledAt     int64  `json:\"scheduledAt\"`\n\tScheduledPrompt string `json:\"scheduledPrompt\"`\n\t// ScheduledBy is who parked it: \"\" for the person, ScheduledByAgent or\n\t// ScheduledByLich.\n\tScheduledBy string `json:\"scheduledBy\"`\n\t// Watch is the condition this session waits on, beside its scheduled prompt\n\t// because lich's own continuation may sit in that slot meanwhile.\n\tWatch SessionWatch `json:\"watch\"`\n\t// Unread is whether this session's last finished turn is still waiting to be\n\t// read. It rides the hydration call because the mark has to survive a window\n\t// restart: the window holds it while it is up, and this row is what it comes\n\t// back to (see SetSessionUnread).\n\tUnread bool `json:\"unread\"`\n\t// MCPServers names the MCP servers this session's provider could reach when\n\t// it was spawned. It rides the row for the reason Sandbox does: the spawn is\n\t// what resolved it — from the provider's own config documents and this\n\t// session's directory — and a window restart has to come back to the same\n\t// answer without re-deriving it. Nil for a row nothing has spawned yet.\n\tMCPServers []string `json:\"mcpServers\"`\n\t// SandboxSkippedLinks names the paths under the user's home this session's\n\t// sandbox left out for being symlinks, relative to that home. It rides the\n\t// row for the reason MCPServers does — the spawn is what resolved it, and a\n\t// window restart has to come back to the same answer. Nil for an unconfined\n\t// session and for one whose sandbox skipped nothing.\n\tSandboxSkippedLinks []string `json:\"sandboxSkippedLinks\"`\n}\n```\nSession is a persisted terminal session (metadata only). Kind selects what the PTY runs: a provider id (see internal/providers) or \"shell\" (the user's shell). Path is the session's working directory when it lives in a git worktree; empty means the project's own path. ProviderSessionID is the id the provider CLI assigns the conversation running in the PTY, reported by that provider's session-start hook; empty until a hook fires (or for shell sessions), it is the key for features that need to reach a session's transcript or resume it. Pinned keeps a session at the head of its project's list and withholds its close affordances until it is unpinned. OriginSessionID and OriginLabel record the session that asked for this one, empty for a session nobody delegated: the id names the parent while it is still in the workspace, the label is what that parent was called at the time and is all that is left once it is closed.\n\n```go\ntype SessionAgent struct {\n\tID    string `json:\"id\"`\n\tAgent string `json:\"agent\"`\n}\n```\nSessionAgent is the payload of SessionAgentEvent: the session and the provider CLI now live in its PTY (\"\" when none is).\n\n```go\ntype SessionAnswer struct {\n\tID      string `json:\"id\"`\n\tProject string `json:\"project\"`\n\tLabel   string `json:\"label\"`\n\tAnswer  string `json:\"answer\"`\n}\n```\nSessionAnswer is a session's answer to a side question.\n\n```go\ntype SessionArtifacts struct {\n\tSessionID string     `json:\"sessionId\"`\n\tFiles     []Artifact `json:\"files\"`\n}\n```\nSessionArtifacts is one session's artifacts, newest first.\n\n```go\ntype SessionCache struct {\n\tRead     int `json:\"read\"`\n\tWrite    int `json:\"write\"`\n\tUncached int `json:\"uncached\"`\n}\n```\nSessionCache splits one turn's input tokens three ways: Read came from the prompt cache, Write was written into it, and Uncached was neither.\n\n```go\ntype SessionClosed struct {\n\tID        string `json:\"id\"`\n\tProjectID string `json:\"projectId\"`\n\tActiveID  string `json:\"activeId\"`\n}\n```\nSessionClosed is the payload of SessionClosedEvent: which session left, the project it left, and which of that project's sessions is active now — the window has no say in the choice, because the row that records it is already written.\n\n```go\ntype SessionColorOptions struct {\n\tSessionID string `json:\"sessionId\"`\n\tColor     string `json:\"color\"`\n}\n```\nSessionColorOptions tints session SessionID's card, \"\" for the theme's.\n\n```go\ntype SessionConversation struct {\n\tID                string `json:\"id\"`\n\tProviderSessionID string `json:\"providerSessionId\"`\n}\n```\n\n```go\ntype SessionCwd struct {\n\tID   string `json:\"id\"`\n\tCwd  string `json:\"cwd\"`\n\tHost string `json:\"host\"`\n}\n```\nSessionCwd is the payload of SessionCwdEvent.\n\n```go\ntype SessionDuplicate struct {\n\tID     string `json:\"id\"`\n\tHeldBy string `json:\"heldBy\"`\n}\n```\nSessionDuplicate is the payload of SessionDuplicateEvent.\n\n```go\ntype SessionExit struct {\n\tCode *int `json:\"code,omitempty\"`\n}\n```\nSessionExit is the payload of TerminalExitEvents: the status the session's PTY child exited with. Code is absent when the child left none — killed by a signal, or a wait that failed — so the window can say the session ended without reporting a clean exit nobody observed.\n\n```go\ntype SessionFocus struct {\n\tID string `json:\"id\"`\n}\n```\nSessionFocus is the payload of SessionFocusEvent.\n\n```go\ntype SessionFolder struct {\n\tName     string   `json:\"name\"`\n\tSessions []string `json:\"sessions\"`\n}\n```\nSessionFolder is one of a project's folders as a caller outside the window sees it: its name, which is its whole identity (store.SetSessionFolder), and the sessions filed under it, by label.\n\n```go\ntype SessionFolderOptions struct {\n\tSessionID string `json:\"sessionId\"`\n\tFolder    string `json:\"folder\"`\n}\n```\nSessionFolderOptions files session SessionID under Folder, \"\" for none.\n\n```go\ntype SessionIDOptions struct {\n\tID string `json:\"id\"`\n}\n```\nSessionIDOptions names a session by its id.\n\n```go\ntype SessionInbox struct {\n\tID    string `json:\"id\"`\n\tCount int    `json:\"count\"`\n}\n```\nSessionInbox is the payload of SessionInboxEvent.\n\n```go\ntype SessionLimit struct {\n\tID       string `json:\"id\"`\n\tWindow   string `json:\"window\"`\n\tResetsAt int64  `json:\"resetsAt\"`\n}\n```\nSessionLimit is the payload of SessionLimitEvent.\n\n```go\ntype SessionMCP struct {\n\tID      string   `json:\"id\"`\n\tServers []string `json:\"servers\"`\n}\n```\nSessionMCP is the payload of SessionMCPEvent: the session and the MCP servers its provider could reach when it was spawned.\n\n```go\ntype SessionPinnedOptions struct {\n\tSessionID string `json:\"sessionId\"`\n\tPinned    bool   `json:\"pinned\"`\n}\n```\nSessionPinnedOptions pins session SessionID to the head of the sidebar.\n\n```go\ntype SessionProfile struct {\n\tID string `json:\"id\"`\n\t// Profile is the slug, \"\" for Personal.\n\tProfile string `json:\"profile\"`\n}\n```\n\n```go\ntype SessionProfileOffer struct {\n\tID string `json:\"id\"`\n\t// Profile is the slug offered, \"personal\" for Personal.\n\tProfile string `json:\"profile\"`\n\t// Handoff is true for a profile the agent handing off to this session\n\t// suggested, false for one with quota left after a usage limit.\n\tHandoff bool `json:\"handoff\"`\n}\n```\nSessionProfileOffer is the payload of SessionProfileOfferEvent.\n\n```go\ntype SessionRelay struct {\n\tID        string `json:\"id\"`\n\tPeer      string `json:\"peer\"`\n\tDirection string `json:\"direction\"`\n\tTicket    string `json:\"ticket\"`\n}\n```\nSessionRelay is the payload of SessionRelayEvent: the session whose mark changed, the label at the other end, which way the request runs, and the ticket the two ends share. Peer is empty when the other end is not a session at all — the CLI run from a script or a shell — which the card words its own way.\n\nThe ticket rides along because it is otherwise written down in exactly one place: the message typed at the target's prompt. An agent whose context was compacted past that message has no way back to it, and neither had the person watching — the window knew a request was open and could not say which one. Empty when the mark is being cleared, along with the direction.\n\n```go\ntype SessionSandbox struct {\n\tID           string   `json:\"id\"`\n\tConfined     bool     `json:\"confined\"`\n\tSkippedLinks []string `json:\"skippedLinks\"`\n}\n```\nSessionSandbox is the payload of SessionSandboxEvent: the session, whether its PTY is confined, and the home paths that sandbox skipped for being symlinks, relative to the home (nil for an unconfined spawn and for one that skipped none).\n\n```go\ntype SessionSchedule struct {\n\tID     string `json:\"id\"`\n\tAt     int64  `json:\"at\"`\n\tPrompt string `json:\"prompt,omitempty\"`\n}\n```\nSessionSchedule is the payload of SessionScheduleEvent: the session whose mark changed, when its prompt is now due, and the prompt. At is 0 and Prompt empty when nothing is waiting anymore.\n\n```go\ntype SessionScheduleBy struct {\n\tID string `json:\"id\"`\n\tBy string `json:\"by\"`\n}\n```\nSessionScheduleBy is the payload of SessionScheduleByEvent: who set the prompt the last SessionScheduleEvent for this session named.\n\n```go\ntype SessionStatus struct {\n\tID     string `json:\"id\"`\n\tState  string `json:\"state\"`\n\tTool   string `json:\"tool,omitempty\"`\n\tDetail string `json:\"detail,omitempty\"`\n\tReason string `json:\"reason,omitempty\"`\n\t// Program marks a report read from the session's own output (OSC 7501)\n\t// rather than from a hook. The window limits the alerts these raise, since\n\t// nothing bounds how often a program can change its state, and reads none\n\t// of a hook's other meanings into them: an \"idle\" is not the CLI leaving, a\n\t// busy with no tool clears the tool line.\n\tProgram bool `json:\"program,omitempty\"`\n}\n```\nSessionStatus is the payload of SessionStatusEvent: the session whose processing state changed, the new state, and — on a pre-tool report alone — the tool it is about to run and what that tool acts on, or — on a waiting one alone — what it is blocked on. All three are the provider's own words, never translated here (docs/hooks/session-state.md tables them).\n\n```go\ntype SessionTitle struct {\n\tID    string `json:\"id\"`\n\tLabel string `json:\"label\"`\n}\n```\nSessionTitle is the payload of SessionTitleEvent: the session whose label changed and its new label.\n\n```go\ntype SessionTodo struct {\n\tID    string `json:\"id\"`\n\tDone  int    `json:\"done\"`\n\tTotal int    `json:\"total\"`\n}\n```\nSessionTodo is the payload of SessionTodoEvent. Both counts are the whole list the agent last wrote, so a card can decide for itself whether a list is worth drawing (a finished one is not, and neither is a list of one).\n\n```go\ntype SessionTouched struct {\n\tID string `json:\"id\"`\n}\n```\nSessionTouched is the payload of SessionTouchedEvent: the session whose files likely changed.\n\n```go\ntype SessionUnreadOptions struct {\n\tSessionID string `json:\"sessionId\"`\n\tUnread    bool   `json:\"unread\"`\n}\n```\nSessionUnreadOptions records whether session SessionID's finished turn is still unread.\n\n```go\ntype SessionUsage struct {\n\tID       string        `json:\"id\"`\n\tPercent  int           `json:\"percent\"`\n\tTokens   int           `json:\"tokens\"`\n\tWindow   int           `json:\"window\"`\n\tModel    string        `json:\"model\"`\n\tEffort   string        `json:\"effort\"`\n\tCostUSD  *float64      `json:\"costUsd,omitempty\"`\n\tCostMiss string        `json:\"costMiss,omitempty\"`\n\tCache    *SessionCache `json:\"cache,omitempty\"`\n}\n```\nSessionUsage is the payload of the session-usage event. Percent is the share of the context window the turn left occupied (0–100); Tokens is the provider's active context count behind it, Window the model's effective context window, Model the model id, and Effort the reasoning effort level (\"\" when the line records none).\n\nAll five are zero for a provider that records what a turn spent but not the window it spent it against — oh-my-pi, opencode and Crush, the cost-only rung of docs/ceilings.md (each in docs/providers/). A zero Window is the window's signal to draw the cost alone rather than a ring around a window nobody reported.\n\nCostUSD is what the session has cost so far, and is omitted — not zeroed — whenever there is no number worth showing: the setting is off, or a model in the transcript has no known price. The readout is for API billing, so on a subscription the field never appears at all and the footer shows nothing.\n\nCostMiss says why, and only when the answer is \"lich cannot price this conversation\". It stays empty for the readout being off, which is not a failure but the design above, and for a miss the next turn heals. Without it a session that cannot be priced and a session that is not being priced look identical, and an empty footer reads as zero spend.\n\nCache is where the last turn's input came from, and is nil whenever the provider files no split of it: Crush, Kiro, Cursor and Antigravity, and a Claude conversation whose last event is a compaction, since the turn before it no longer describes the window. On oh-my-pi and opencode it rides beside the cost with no window, so the footer puts it in the cost tooltip.\n\n```go\ntype SessionWatch struct {\n\tOn     string `json:\"on\"`\n\tPrompt string `json:\"prompt\"`\n\tBy     string `json:\"by\"`\n\tRuns   int    `json:\"runs\"`\n\tPR     int    `json:\"pr\"`\n\tSeen   string `json:\"seen\"`\n}\n```\nSessionWatch is a session's condition and the prompt typed when it is met. On is \"\" for a session watching nothing. Runs, PR and Seen outlive a disarm so an agent re-arming its own watch cannot reset its run limit.\n\n```go\ntype SessionWatchChange struct {\n\tID    string       `json:\"id\"`\n\tWatch SessionWatch `json:\"watch\"`\n}\n```\nSessionWatchChange is the payload of SessionWatchEvent: a session's watch as it now stands.\n\n```go\ntype SessionWatchStopped struct {\n\tID     string `json:\"id\"`\n\tLabel  string `json:\"label\"`\n\tNumber int    `json:\"number\"`\n\tRuns   int    `json:\"runs\"`\n}\n```\nSessionWatchStopped is the payload of SessionWatchStoppedEvent.\n\n```go\ntype SessionsColored struct {\n\tProjectID string   `json:\"projectId\"`\n\tIDs       []string `json:\"ids\"`\n\tColor     string   `json:\"color\"`\n}\n```\nSessionsColored is SessionsColoredEvent's payload. Color is \"\" when the cards went back to the theme.\n\n```go\ntype SessionsFiled struct {\n\tProjectID string   `json:\"projectId\"`\n\tIDs       []string `json:\"ids\"`\n\tFolder    string   `json:\"folder\"`\n}\n```\nSessionsFiled is SessionsFiledEvent's payload. Folder is \"\" when the cards were taken out of the one they were in.\n\n```go\ntype SetScheduleOptions struct {\n\tSessionID string `json:\"sessionId\"`\n\tAt        int64  `json:\"at\"`\n\tOn        string `json:\"on\"`\n\tPrompt    string `json:\"prompt\"`\n}\n```\nSetScheduleOptions is the person's trigger for a session. At and On are exclusive; neither clears what the session holds.\n\n```go\ntype SetSettingOptions struct {\n\tKey       string `json:\"key\"`\n\tProjectID string `json:\"projectId\"`\n\tValue     string `json:\"value\"`\n}\n```\nSetSettingOptions writes Value as setting Key of project ProjectID, \"\" for a global one.\n\n```go\ntype SetVisibleOptions struct {\n\tID      string `json:\"id\"`\n\tVisible bool   `json:\"visible\"`\n}\n```\nSetVisibleOptions says whether session ID is on screen.\n\n```go\ntype ShowCode struct {\n\tSessionID string `json:\"sessionId\"`\n\tRel       string `json:\"rel\"`\n\tLine      int    `json:\"line,omitempty\"`\n\tEndLine   int    `json:\"endLine,omitempty\"`\n\tComment   string `json:\"comment,omitempty\"`\n}\n```\nShowCode is a checked request: Rel is relative to the session's checkout.\n\n```go\ntype ShowCodeOptions struct {\n\tID      string `json:\"id\"`\n\tPath    string `json:\"path\"`\n\tLine    int    `json:\"line,omitempty\"`\n\tEndLine int    `json:\"endLine,omitempty\"`\n\tComment string `json:\"comment,omitempty\"`\n}\n```\nShowCodeOptions names a file relative to the session's checkout, or absolute inside it. Line and EndLine are 1-based and inclusive; 0 leaves them out. Comment is plain text the agent adds under the lines.\n\n```go\ntype ShowWindowOptions struct{}\n```\nShowWindowOptions is one ShowWindow call. It carries nothing yet; it is an object so a newer launch can still reach an older running lich the day it does (the CLI's options-object rule).\n\n```go\ntype ShownSessionOptions struct {\n\tSessionID string `json:\"sessionId\"`\n}\n```\nShownSessionOptions is the native window saying which session's card it has on screen, \"\" for none.\n\n```go\ntype StartOptions struct {\n\tID        string `json:\"id\"`\n\tProjectID string `json:\"projectId\"`\n\tCwd       string `json:\"cwd\"`\n\tKind      string `json:\"kind\"`\n\tResume    string `json:\"resume\"`\n\tFork      bool   `json:\"fork\"`\n\tCols      int    `json:\"cols\"`\n\tRows      int    `json:\"rows\"`\n}\n```\nStartOptions spawns session ID's process at Cols x Rows. Resume is a provider conversation to reopen, \"\" to start fresh; Fork branches it into a conversation of its own instead.\n\n```go\ntype StepLog struct {\n\tStep  string   `json:\"step,omitempty\"`\n\tLines []string `json:\"lines\"`\n\tCut   int      `json:\"cut,omitempty\"`\n}\n```\nStepLog is the tail of one failing step's log, cleaned of gh's prefixes and terminal escapes. Cut is how many earlier lines of the step were left out.\n\n```go\ntype SubmitOptions struct {\n\tSessionID string `json:\"sessionId\"`\n\tMessage   string `json:\"message\"`\n}\n```\nSubmitOptions is a message typed into a session and submitted with Enter.\n\n```go\ntype SubmitReviewOptions struct {\n\tPath     string          `json:\"path\"`\n\tNumber   int             `json:\"number\"`\n\tEvent    string          `json:\"event\"`\n\tBody     string          `json:\"body\"`\n\tHead     string          `json:\"head\"`\n\tComments []ReviewComment `json:\"comments\"`\n}\n```\nSubmitReviewOptions submits a review of pull request Number: Event is the verdict, Comments the line comments, and Head the commit they were written against.\n\n```go\ntype Syntax map[string]SyntaxStyle\n```\nSyntax is a theme's syntax highlighting, keyed by the tag each style is for, as @lezer/highlight prints it: \"keyword\", \"function(variableName)\".\n\n```go\nfunc (s *Syntax) UnmarshalJSON(data []byte) error\n```\nUnmarshalJSON reads each entry as a bare color or a style object, naming the entry that is neither.\n\n```go\ntype SyntaxStyle struct {\n\tColor         string `json:\"color,omitempty\"`\n\tBold          bool   `json:\"bold,omitempty\"`\n\tItalic        bool   `json:\"italic,omitempty\"`\n\tUnderline     bool   `json:\"underline,omitempty\"`\n\tStrikethrough bool   `json:\"strikethrough,omitempty\"`\n}\n```\nSyntaxStyle is how the code under one highlighting tag is drawn: a CodeMirror HighlightStyle spec. A theme file writes it as a bare color or as an object; Color empty leaves the code its foreground color.\n\n```go\ntype Theme struct {\n\tFormatVersion int               `json:\"formatVersion,omitempty\"`\n\tID            string            `json:\"id\"`\n\tName          string            `json:\"name\"`\n\tScheme        string            `json:\"scheme\"`\n\tOrigin        string            `json:\"origin\"`\n\tSource        *ThemeSource      `json:\"source,omitempty\"`\n\tApp           map[string]string `json:\"app\"`\n\tTerminal      map[string]string `json:\"terminal\"`\n\t// Syntax is optional: a theme without it is highlighted in the window's\n\t// default palette for its scheme.\n\tSyntax Syntax `json:\"syntax,omitempty\"`\n\t// Pair is optional: the id of this theme's variant for the other scheme,\n\t// which the window draws while the OS asks for that scheme and the user\n\t// turned on following it.\n\tPair string `json:\"pair,omitempty\"`\n\t// Latest is set by lich, never by a file: the newer version of this\n\t// theme's pack the last update check found, nil when there is none.\n\tLatest *ThemeLatest `json:\"latest,omitempty\"`\n}\n```\nTheme describes every color value the window needs to paint the app and the terminal.\n\n```go\ntype ThemeGitResult struct {\n\tPack      string   `json:\"pack\"`\n\tVersion   string   `json:\"version\"`\n\tThemes    []Theme  `json:\"themes\"`\n\tConflicts []string `json:\"conflicts\"`\n\tUpToDate  bool     `json:\"upToDate\"`\n}\n```\nThemeGitResult reports what installing a repository produced. Conflicts names the theme ids that already exist locally: found by the scan that runs before any write, nothing was installed at all; found by the write itself — a theme that appeared in between — that one id was left alone and Themes says what did go in.\n\n```go\ntype ThemeImportResult struct {\n\tTheme          Theme `json:\"theme\"`\n\tNeedsOverwrite bool  `json:\"needsOverwrite\"`\n}\n```\nThemeImportResult either reports the installed theme or asks the UI to confirm replacing the existing custom theme with the same id.\n\n```go\ntype ThemeLatest struct {\n\tPack    string `json:\"pack\"`\n\tVersion string `json:\"version\"`\n}\n```\nThemeLatest is a version of a theme pack newer than the installed one.\n\n```go\ntype ThemeSelection struct {\n\tTheme        string `json:\"theme\"`\n\tFollowSystem bool   `json:\"followSystem\"`\n}\n```\nThemeSelection is the theme the user chose and whether the window draws that theme's pair while the OS asks for the pair's scheme.\n\n```go\ntype ThemeSource struct {\n\tURL     string `json:\"url\"`\n\tVersion string `json:\"version\"`\n}\n```\nThemeSource records the repository a theme was installed from and the manifest version it came in at, so lich can clone it again to look for a newer one. It is written by lich, never by a picked file: a standalone import has no source and stays unversioned.\n\n```go\ntype ThreadFix struct {\n\tThreadID  string `json:\"threadId\"`\n\tPath      string `json:\"path\"`\n\tNumber    int    `json:\"number\"`\n\tCommentID int64  `json:\"commentId\"`\n\tCommit    string `json:\"commit,omitempty\"`\n}\n```\nThreadFix is a review thread handed to a session. Commit is empty until the agent marks the commit that fixes it; the thread is resolved once the pull request's head contains that commit.\n\n```go\ntype ThreadFixOptions struct {\n\tPath      string `json:\"path\"`\n\tNumber    int    `json:\"number\"`\n\tThreadID  string `json:\"threadId\"`\n\tCommentID int64  `json:\"commentId\"`\n}\n```\nThreadFixOptions names a review thread just handed to a session: ThreadID is its GraphQL node id (what resolving takes), CommentID the database id of a comment in it (what a reply takes).\n\n```go\ntype ThreadTally struct {\n\tOpen  int `json:\"open\"`\n\tTotal int `json:\"total\"`\n}\n```\nThreadTally is how many of a pull request's review threads are still open.\n\n```go\ntype TranscriptMatch struct {\n\tID      string `json:\"id\"`\n\tSnippet string `json:\"snippet\"`\n\tCount   int    `json:\"count\"`\n}\n```\nTranscriptMatch is one session whose conversation mentions the query: the session id to jump to, the newest matching message trimmed to a line, and how many of its messages matched.\n\n```go\ntype TrayLabels struct {\n\tShow            string `json:\"show\"`\n\tQuit            string `json:\"quit\"`\n\tNoSessions      string `json:\"noSessions\"`\n\tNeedsYou        string `json:\"needsYou\"`\n\tWorking         string `json:\"working\"`\n\tIdle            string `json:\"idle\"`\n\tMore            string `json:\"more\"`\n\tWaiting         string `json:\"waiting\"`\n\tDone            string `json:\"done\"`\n\tServicesRunning string `json:\"servicesRunning\"`\n\tShowOutput      string `json:\"showOutput\"`\n\tRestart         string `json:\"restart\"`\n\tStop            string `json:\"stop\"`\n\tStopAll         string `json:\"stopAll\"`\n}\n```\nTrayLabels are the tray menu's words, in the interface language. Idle, More and ServicesRunning carry a {count} placeholder and are written so they need no plural form.\n\n```go\ntype TurnState struct {\n\tID     string        `json:\"id\"`\n\tState  string        `json:\"state,omitempty\"`\n\tTool   string        `json:\"tool,omitempty\"`\n\tDetail string        `json:\"detail,omitempty\"`\n\tReason string        `json:\"reason,omitempty\"`\n\tSince  int64         `json:\"since,omitempty\"`\n\tUsage  *SessionUsage `json:\"usage,omitempty\"`\n\tCwd    string        `json:\"cwd,omitempty\"`\n\tHost   string        `json:\"host,omitempty\"`\n}\n```\nTurnState is what the window missed about one live session while it was not attached to /events: the last session-status report (State is empty for a session that never reported) and the readout the last session-usage event carried (nil when there is none to read). Since is when the session entered State, in Unix milliseconds. Cwd and Host are its last session-cwd report.\n\n```go\ntype UpdateProfileOptions struct {\n\tSlug   string        `json:\"slug\"`\n\tUpdate ProfileUpdate `json:\"update\"`\n}\n```\nUpdateProfileOptions changes profile Slug as Update says.\n\n```go\ntype UpdateThemeOptions struct {\n\tID string `json:\"id\"`\n}\n```\nUpdateThemeOptions names a theme whose repository is cloned again.\n\n```go\ntype WaitOptions struct {\n\tTicket      string `json:\"ticket\"`\n\tWaitSeconds int    `json:\"waitSeconds\"`\n}\n```\nWaitOptions is one Wait call, an object for the reason SendOptions is one.\n\n```go\ntype WorkdirOptions struct {\n\tCwd string `json:\"cwd\"`\n}\n```\nWorkdirOptions names a session's working directory.\n\n```go\ntype Worktree struct {\n\tName string `json:\"name\"`\n\tPath string `json:\"path\"`\n\t// Whether CreateWorktree checked out a branch that already existed instead\n\t// of starting one at the base it was given — the one case where the base\n\t// the caller picked decided nothing. Always false on a listed worktree.\n\tReused bool `json:\"reused,omitempty\"`\n}\n```\nWorktree is a git worktree checkout: the branch it holds and its path.\n\n```go\ntype WorktreeCheckout struct {\n\tName     string   `json:\"name\"`\n\tPath     string   `json:\"path\"`\n\tDirty    bool     `json:\"dirty\"`\n\tSessions []string `json:\"sessions\"`\n}\n```\nWorktreeCheckout is one of a project's git worktrees, as a caller outside the window needs to see it: what it is called, where it is, whether anything in it is uncommitted, and which sessions are open in it.\n\nSessions is what makes the list actionable rather than informational. A checkout with none is one nobody is working in; the last session in one is the thing whose closing decides whether the checkout stays (see Close).\n\n```go\ntype WorktreeSessionsOptions struct {\n\tProjectID string `json:\"projectId\"`\n\tPath      string `json:\"path\"`\n}\n```\nWorktreeSessionsOptions names the sessions of project ProjectID rooted in the checkout at Path.\n\n```go\ntype WorktreesOptions struct {\n\tFrom    string `json:\"from\"`\n\tProject string `json:\"project\"`\n}\n```\nWorktreesOptions is one Worktrees call, an object for the reason CloseOptions is one.\n\n```go\ntype WriteOptions struct {\n\tID   string `json:\"id\"`\n\tData string `json:\"data\"`\n}\n```\nWriteOptions types Data into session ID's PTY.\n\n","path":"github.com/lichdotdev/lich/api","name":"api","synopsis":"Package api is the contract between the lich backend and its clients: the window (native/backend), `lich` and `lich mcp`.","isRedistributable":true}
