shell

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 40 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package shell is the main window's frame: the header band, the feature rail, the sidebar column and the right panel beside the page, each column opening, closing and resizing with the reference's motion, and the window's shortcuts, search, activity centre and knowledge viewer.

Index

Constants

View Source
const (
	HeaderHeight = 48
	RailWidth    = 56
	NavWidth     = 240
	NavMin       = 200
	NavMax       = 320
	MainMin      = 320 // the conversation's least width
	PanelWidth   = 560
	PanelMin     = 360
)

Layout metrics.

View Source
const (
	HeaderButton = 28
	RailButton   = 36
	ButtonGap    = 8
)

The header's and the rail's icon buttons are Kit's IconButton at one size each, 8 DIPs apart. Header contributions (Hooks.PluginHeader) use HeaderButton too.

View Source
const (
	ViewZoomIn    = "view.zoom_in"
	ViewZoomOut   = "view.zoom_out"
	ViewZoomReset = "view.zoom_reset"
)

The view zoom's commands, for the window's keys and the native menu (Do).

View Source
const PrefsFile = "ui-state.json"

PrefsFile is the preferences' file name in the app's user data folder, beside MyGo's window-state.json, which keeps the window's bounds.

View Source
const WindowMinimize = "window.minimize"

WindowMinimize is the Window menu's Minimize: its key enlarges the focused conversation pane in a split, and minimizes the window anywhere else.

Variables

View Source
var CloseFocused = Shortcut{ID: "close", Label: "menu_close_tab", Mods: ui.Cmd, Key: ui.KeyW}

CloseFocused is ⌘W. The reference binds it on the panes that close, not on the window: the right panel and an independent page take it while the focus is inside them (App.pane), a split's pane leaves its split, a conversation standing alone and a Files or Git page close their shown tab first, and anywhere else it does nothing.

View Source
var Motion = ui.Animation{Duration: 180 * time.Millisecond, Ease: ui.CubicBezier(0.2, 0, 0, 1)}

Motion is the columns' open and close: Kit's duration_normal along easing_move. MyGo makes it instant with Reduce Motion.

View Source
var Shortcuts = append(window(settings.Registry),
	Shortcut{ID: "app.settings", Label: "settings", Mods: ui.Cmd, Key: ui.KeyComma},
	Shortcut{ID: "conversation.find", Label: "chat_search", Mods: ui.Cmd, Key: ui.KeyF},
	Shortcut{ID: "conversation.stop", Label: "chat_stop", Mods: ui.Cmd, Key: ui.KeyPeriod},
	Shortcut{ID: "composer.focus", Label: "chat_message_placeholder", Mods: ui.Cmd, Key: ui.KeyL},
	Shortcut{ID: "composer.models", Label: "composer_model_settings", Mods: ui.Cmd | ui.Shift, Key: ui.KeyM},
)

Shortcuts are the reference's window keys, ⌘ standing for Ctrl off macOS: the Shortcuts settings' registry, which the user may rebind (App.binding), then Settings, Find and the conversation's own keys, which are fixed: Stop, Focus the composer and the model controls act on the conversation page only, and the reference lists them in neither the Shortcuts settings nor the menu. The system's shortcuts are not the window's. The registered panel resource keys follow.

Functions

func Accelerator

func Accelerator(mods ui.Modifiers, key ui.Key) string

Accelerator writes a shortcut as MyGo's menus take it: CmdOrCtrl+Alt+N for ⌥⌘N, ui.Cmd being Command on macOS and Ctrl elsewhere.

func ClampNav

func ClampNav(w float32) float32

ClampNav keeps the sidebar's width in 200..320.

func ClampPanel

func ClampPanel(width, w, nav float32) float32

ClampPanel keeps the panel's width in 360 and what leaves the conversation 320.

func HeaderInsets

func HeaderInsets(bar ui.TitleBar) float32

HeaderInsets is the room the header keeps clear at the window's right edge: 12, past the window buttons MyGo reports there (Windows and Linux; none on macOS, whose lights are on the left).

func NoticeAge

func NoticeAge(d time.Duration) (key string, count int)

NoticeAge is a notice's age as the activity centre writes it: an i18n key and its count.

func NoticeHeading

func NoticeHeading(n *viewmodel.Notice, language string) string

NoticeHeading is the heading a package gave its notice, in a language, "" when it gave none: a reminder says Reminder above its own title. System notices keep the application's headings.

func PanelFits

func PanelFits(w, nav, panel float32) bool

PanelFits reports whether the right panel shows beside the main column in a window w wide: the rail, the sidebar and 320 for the conversation leave it its width. A narrow window hides it without closing it.

func SavePrefs

func SavePrefs(dir string, p Prefs) error

SavePrefs writes the preferences in dir, through a temporary file so a crash keeps the last ones.

func SortNotices

func SortNotices(list []*preview.Notice) []*preview.Notice

SortNotices orders notices newest first.

Types

type App

type App struct {
	Data    *viewmodel.Data
	Preview bool
	Hooks   Hooks

	// Theme is the selected theme package's ID; empty is the built-in one.
	Theme   string
	Mode    theme.Mode
	Effects bool // the theme's animated effects
	// Surfaces are the window materials' opacities (Appearance).
	Surfaces theme.Surfaces
	Page     Page
	// NavOpen and NavWidth are the side column's saved choice, shared by the
	// pages that have one (HasNavigation); a page without one hides the
	// column and leaves the choice as it is.
	NavOpen  bool
	NavWidth float32
	// OverviewHidden is the header button's saved choice. A narrow pane
	// uses a popover without changing the wide pane's choice.
	OverviewHidden bool
	// PluginNavigation is the resource navigation supplied by the mounted
	// package page. The Shell owns its position, width and fold toggle.
	PluginNavigation func(*ui.Context)

	// PanelOpen is whether the user wants the right panel; a narrow window
	// hides it without changing this.
	PanelOpen bool
	// PluginDetails draws the details a package page's Workspace supplies
	// to the right column, nil while the page shown offers none. They show
	// until the toggle folds them; the conversation's PanelOpen is its own.
	PluginDetails func(*ui.Context)
	// PluginDetailsHeader draws what those details give the column's
	// header segment: their title, then their own actions.
	PluginDetailsHeader func(*ui.Context)
	PluginDetailsLabel  string
	PanelWidth          float32

	// DiffSplit is the window's diff layout, side by side when set: the
	// button at the end of a diff's footer writes it (kit.DiffSplit), and
	// it is saved with the window's other choices (prefs.go).
	DiffSplit bool
	// ListShare is the share of the height a list takes above its document
	// where a conversation panel is too narrow for both side by side
	// (panel.BindListShare); 0 is the first share. The divider between them
	// writes it, and it is saved as DiffSplit is.
	ListShare float32

	// OnMode, when set, gets the theme mode as it changes, so the window's
	// native material follows the app's appearance.
	OnMode func(theme.Mode)

	OnFeatureMenuChanged func()

	Sidebar  *sidebar.State
	Settings *settings.State
	// ProviderUI is installed with the optional model channels page.
	ProviderUI ProviderUI
	Website    string
	Feedback   string
	Messages   *conversation.State

	Panel *panel.State
	// Projects keeps each project's Files and Git state, shared by their
	// pages and the panel's tabs.
	Projects *panel.Projects

	// Host is the device whose monitor HostPage shows;
	// hosts are the host pages' data, made from the dataset as first
	// shown, and their UI state. Metrics is whether the host page's right
	// column shows the metrics summary (layout.panel_open of Page::Host):
	// closed until the user opens it, as the reference's, since the page
	// itself is the monitor.
	Host string

	Metrics bool

	// Welcome is the welcome guide, opened at the first launch
	// (SetPrefs) and from the Help menu in the preview.
	Welcome onboarding.Guide
	// contains filtered or unexported fields
}

App is the window's state.

func New

func New(d *preview.Data, pages ...NativePage) *App

New makes a standalone sample window with the supplied workspace pages.

func NewLive

func NewLive(d *viewmodel.Data, pages ...NativePage) *App

NewLive creates an unseeded live window with the supplied workspace pages.

func NewLiveWithAssembly

func NewLiveWithAssembly(d *viewmodel.Data, assembly Assembly) *App

NewLiveWithAssembly creates an unseeded live window with the supplied contributions.

func NewWithAssembly

func NewWithAssembly(d *preview.Data, assembly Assembly) *App

NewWithAssembly makes a preview window with the supplied page contributions.

func (*App) ActiveTerminal

func (a *App) ActiveTerminal() string

ActiveTerminal is the main terminal pane the conversation page shows active, "" while a conversation's is or another page shows. Its sidebar row is the selected one, and its right panel works in the terminal's worktree, not the selected conversation's.

func (*App) ActiveWorkspacePane

func (a *App) ActiveWorkspacePane() panes.Target

ActiveWorkspacePane identifies the focused module surface on the conversation page. A conversation or another page returns a zero target.

func (*App) AllPanelTabs

func (a *App) AllPanelTabs() []panel.Tab

AllPanelTabs are the panel tabs of every pane, the shown one's first.

func (*App) ApplyData

func (a *App) ApplyData(d *viewmodel.Data)

ApplyData replaces a Client projection on the UI thread, retaining local drafts.

func (*App) BindAppActions

func (a *App) BindAppActions(scope AppActionScope, current func() bool) *AppActionSource

BindAppActions binds trusted UI to its captured source. current must check the source's lifetime and identity; for window-wide actions scope may be empty.

func (*App) BindAppNavigation

func (a *App) BindAppNavigation(scope AppActionScope, current func() bool, allows func(protocol.PluginAction) bool) *AppActionSource

BindAppNavigation binds restricted UI to the same registry. The host validates the mounted source and its permissions; only public navigation is callable.

func (*App) BindPanelResources

func (a *App) BindPanelResources(assembly Assembly, host PanelResourceHost)

func (*App) BindWindow

func (a *App) BindWindow(ctx context.Context)

BindWindow supplies the live context after the window's services are ready. Fixture windows never acquire live resources.

func (*App) CancelPanelClose

func (a *App) CancelPanelClose(t panel.Tab)

CancelPanelClose clears a failed close so a later removal stays passive.

func (*App) CancelTerminalClose added in v0.2.3

func (a *App) CancelTerminalClose(id string)

CancelTerminalClose clears a failed close so a later shell exit stays passive.

func (*App) CloseKnowledge

func (a *App) CloseKnowledge()

CloseKnowledge releases a restricted projection, including text held by a callback that still refers to the old page.

func (*App) ClosePage

func (a *App) ClosePage() bool

ClosePage closes the independent page shown, back to the conversation. It reports whether there was one to close.

func (*App) CloseWindowBindings

func (a *App) CloseWindowBindings()

CloseWindowBindings releases the per-window callbacks registered by BindWindow.

func (*App) CloseWorkspacePane

func (a *App) CloseWorkspacePane(kind panes.Kind, id string)

CloseWorkspacePane releases a module surface and its placement in this window.

func (*App) Closing

func (a *App) Closing() bool

Closing reports whether the close prompt shows.

func (*App) Composer

func (a *App) Composer(id string) *composer.State

Composer returns the composer of a conversation, which keeps its draft.

func (*App) ConfirmClose

func (a *App) ConfirmClose(r CloseRequest)

ConfirmClose opens the close prompt. A prompt already showing stays as it is, so repeated close requests ask once.

func (*App) ConversationActiveTab

func (a *App) ConversationActiveTab(id string) panel.Tab

ConversationActiveTab is the tab a conversation's panel shows, on screen or not.

func (*App) ConversationTabs

func (a *App) ConversationTabs(id string) []panel.Tab

ConversationTabs are a conversation's panel tabs, shown or not.

func (*App) Demo

func (a *App) Demo() bool

Demo reports whether the window shows the demo conversations.

func (*App) DemoConversation

func (a *App) DemoConversation(id string) *viewmodel.Conversation

DemoConversation is the demo's conversation of that ID, nil without the demo. Unlike Demo it also answers while the window's own stage is back on the fields: the controller's frame hooks keep what it mounted over a demo conversation (Hooks.DemoConversation) for as long as the demo has it.

func (*App) DemoOn

func (a *App) DemoOn() bool

DemoOn reports whether the demo is on. Unlike Demo it also answers while the window's own stage is back on the fields, as in the controller's frame hooks: what the user does then is still done in the demo.

func (*App) DemoReveal

func (a *App) DemoReveal(id string, index int)

DemoReveal scrolls the demo's transcript of that conversation to the turn at index; nothing without the demo. Like DemoConversation it also answers while the window's own stage is back on the fields, where a package mounted over a demo conversation asks for it.

func (*App) DemoUsage

func (a *App) DemoUsage() *preview.Usage

DemoUsage is the usage the demo counts, which the Usage page reads while the demo shows; nil without the demo. Unlike Demo it also answers while the window's own stage is back on the fields.

func (a *App) DispatchLink(c *ui.Context, target LinkTarget, actions LinkActions) (bool, error)

func (*App) Do

func (a *App) Do(id string)

Do sends a command of the native menu, a Shortcut's ID or another of the menu's (menu.go), to run in the next frame. Call it on the main thread, where menu items' Click runs, then redraw the window.

func (*App) DraftComposer

func (a *App) DraftComposer(id string) *composer.State

DraftComposer returns the retained composer state for id without creating one.

func (*App) DropComposer

func (a *App) DropComposer(id string) *composer.State

DropComposer forgets the input state of a draft that is gone and returns it, nil when there was none.

func (*App) DropPanel

func (a *App) DropPanel(id string)

DropPanel forgets a conversation's panel, as when the conversation is deleted or archived. The owner of what its tabs show closes that first.

func (*App) DropPanelTab

func (a *App) DropPanelTab(t panel.Tab)

DropPanelTab removes a tab from the window, shown or not, then releases it. Acknowledging an explicit asynchronous close can also fold its panel.

func (*App) DropWorkspaceTerminal

func (a *App) DropWorkspaceTerminal(id string)

DropWorkspaceTerminal closes only a main terminal's surface and its pane's right panel. Its running process remains in the Node's inventory and can be opened from terminal activity.

func (*App) FeaturePreferences

func (a *App) FeaturePreferences() ([]string, map[string]bool)

FeaturePreferences includes saved choices for destinations this window does not provide, so changing its rail cannot erase those preferences.

func (*App) FocusedConversation

func (a *App) FocusedConversation() string

FocusedConversation is the conversation receiving main-workspace actions, empty while a module surface or another page is focused.

func (*App) ForgetSession added in v0.2.7

func (a *App) ForgetSession(id string)

ForgetSession clears the tab, tab order entry and saved split position when the Node confirms deletion or the window discards a local draft.

func (*App) HasDraft

func (a *App) HasDraft(state *composer.State) bool

HasDraft reports whether the window currently retains the given composer state.

func (*App) HasNavigation

func (a *App) HasNavigation() bool

HasNavigation reports whether the page shown has a side column beside the rail, as the reference's feature_navigation: the sessions on the conversation and on the host and project pages opened from it, the sections on Settings. Activity, Files, Git, Market, the notification center have none. A package page can supply its own resource navigation.

func (*App) HasPanelTab

func (a *App) HasPanelTab(t panel.Tab) bool

HasPanelTab reports whether any conversation's panel has t.

func (*App) HasWorkspacePane

func (a *App) HasWorkspacePane(kind panes.Kind) bool

func (*App) HasWorkspaceResource

func (a *App) HasWorkspaceResource(kind panel.Kind) bool

HasWorkspaceResource covers resources that share a project with the panel or with a central page.

func (*App) HasWorkspaceTerminal

func (a *App) HasWorkspaceTerminal(id string) bool

HasWorkspaceTerminal reports whether the main workspace owns id's surface.

func (*App) InheritPackagePreferences

func (a *App) InheritPackagePreferences(node, packageName string)

InheritPackagePreferences binds only a verified installation on the profile's own Node.

func (*App) KeepWorkspacePane

func (a *App) KeepWorkspacePane(kind panes.Kind, id string)

KeepWorkspacePane retains the module surface's tab when another tab is selected.

func (*App) KeepWorkspaceTerminal

func (a *App) KeepWorkspaceTerminal(id string)

KeepWorkspaceTerminal keeps an open main terminal's tab, as a double click on its passing tab does.

func (*App) Menu

func (a *App) Menu(lang string, send func(id string)) []*mygo.MenuItem

Menu is the native app menu in lang: App, File, Edit, View, Window and Help, with the reference's items on the keys they have now (syncMenuKeys follows a rebound one), then the rail's features in View. The app's items send their command's ID through send, which the application passes to Do: the menu takes their keys before the window does. The system's items are MyGo's roles under the reference's labels and keys: the menu binds Close Window, Hide, Hide Others, Minimize and Full Screen on cmd (ui.Super), the rest on secondary (ui.Cmd). Minimize is the app's item on cmd: in a focused conversation its key enlarges the pane, elsewhere it minimizes the window (WindowMinimize). Save follows the focused live editor. Logs stays disabled without a live log folder (Hooks.OpenLogs). Help also opens the welcome guide.

func (*App) MetricLead

func (a *App) MetricLead(c *ui.Context, scope ComposerMetricScope) []conversation.Metric

MetricLead returns the context-bar lead metrics contributed by bound native modules for the active composer scope.

func (*App) MetricStatistics

func (a *App) MetricStatistics(c *ui.Context, scope ComposerMetricScope) [][]conversation.Metric

MetricStatistics returns the context-bar statistics metric groups contributed by bound native modules for the active composer scope, one group per contributor.

func (*App) MountPanel

func (a *App) MountPanel()

MountPanel gives the panel to the active pane: the tabs of the one left are kept for its return, and the active one's come back, or the closed panel of a pane that never opened it. The first pane takes what the window opened before it. A terminal has one tab in the window: the one in the shown panel.

func (*App) MovePanelTab

func (a *App) MovePanelTab(t panel.Tab, id string)

MovePanelTab gives t to conversation id's panel, behind its shown tab: a tab opened for a conversation that is not on screen, as the page its agent opened.

func (*App) NativePageEnabled

func (a *App) NativePageEnabled(p Page) bool

NativePageEnabled reports whether the assembly contributed this page.

func (*App) NativePageUsage

func (a *App) NativePageUsage() protocol.FeatureUse

NativePageUsage returns the counter declared by the current native page.

func (*App) NavShown

func (a *App) NavShown() bool

NavShown reports whether the side column shows: the page has one and the user keeps it open.

func (*App) Navigate

func (a *App) Navigate(p Page)

Navigate shows an available page in the main column.

func (*App) OpenConversation added in v0.2.7

func (a *App) OpenConversation(id string)

OpenConversation opens session id as the user asked for it, from a sidebar row, a link, search, a notification or another page: it shows on the conversation page, in its split group when it is in one, and otherwise has a tab until that is closed. A selection the window falls back to when data changes is no open and adds no tab, so closing the last tab stays closed.

func (*App) OpenHost

func (a *App) OpenHost(id string)

OpenHost opens a device monitor without changing the selected conversation.

func (*App) OpenKnowledge

func (a *App) OpenKnowledge(c *ui.Context, session, link string)

OpenKnowledge opens a knowledge link of a conversation on its Node.

func (*App) OpenProject

func (a *App) OpenProject(project *viewmodel.Project, actions ProjectActions)

func (*App) OpenSessionIDs

func (a *App) OpenSessionIDs() map[string]bool

OpenSessionIDs reports the session IDs currently referenced in open panes or kept tabs on the live workspace without cloning all preferences.

func (*App) OpenWorkspacePane

func (a *App) OpenWorkspacePane(kind panes.Kind, id string) bool

OpenWorkspacePane focuses an existing surface supplied by a module.

func (*App) OpenWorkspaceTerminal

func (a *App) OpenWorkspaceTerminal(id, title string)

OpenWorkspaceTerminal opens or focuses an independent main terminal. It does not add a conversation's right-panel tab or start a terminal process.

func (*App) PanelConversations

func (a *App) PanelConversations() []string

PanelConversations are the conversations that have a panel: the shown one first, then the others in order. A main terminal pane's panel is not a conversation's: it leaves with its pane (DropWorkspaceTerminal).

func (*App) PluginFeature

func (a *App) PluginFeature() string

func (*App) Prefs

func (a *App) Prefs() Prefs

Prefs returns the app's preferences as they are now. They are the window's own: the demo's panels and panes are never saved.

func (*App) ProjectOwner

func (a *App) ProjectOwner() (node, project string, shown bool)

func (*App) ProviderUsage

func (a *App) ProviderUsage(c *ui.Context, node, channel string) *settings.ChannelUsage

ProviderUsage returns the first native channel usage summary contributed for the given Node and provider ID, or nil when none applies.

func (*App) PruneComposers

func (a *App) PruneComposers(keep func(id string) bool) map[string]*composer.State

PruneComposers releases idle composers not kept by keep, and strips stale controller callbacks from non-idle off-screen composers.

func (*App) Reading

func (a *App) Reading() *Reading

Reading is the live page the viewer shows, nil once it is closed.

func (*App) RegisterAppAction

func (a *App) RegisterAppAction(action AppAction) (release func(), err error)

RegisterAppAction binds a live service to this window. Release only removes this registration; a duplicate ID never replaces a handler.

func (*App) RegisterDefaultLinkHandler

func (a *App) RegisterDefaultLinkHandler(route LinkRoute, handler LinkHandler) error

RegisterDefaultLinkHandler registers the host's behavior at priority -1.

func (*App) RegisterLinkContribution

func (a *App) RegisterLinkContribution(route LinkRoute, scope LinkScope, handler func(LinkTarget) error, options ...LinkContributionOptions) (*LinkContribution, error)

RegisterLinkContribution uses the same route as RegisterLinkHandler, but only admits package schemes and requires an exact source scope at dispatch.

func (*App) RegisterLinkHandler

func (a *App) RegisterLinkHandler(route LinkRoute, handler LinkHandler) (release func(), err error)

RegisterLinkHandler binds a native handler at priority zero to this window.

func (*App) RegisterLinkHandlerWithPriority

func (a *App) RegisterLinkHandlerWithPriority(route LinkRoute, priority int, handler LinkHandler) (release func(), err error)

RegisterLinkHandlerWithPriority binds a candidate to this window. On error it leaves existing candidates unchanged and returns no release function.

func (*App) RegisterProjectResourceAction

func (a *App) RegisterProjectResourceAction(action sidebar.ProjectResourceAction)

func (*App) RenderResource

func (a *App) RenderResource(c *ui.Context, render func(*panel.Project))

RenderResource supplies the shared workspace project or shows the resource's empty state when the active page has no reachable project.

func (*App) ReplaceConversationID

func (a *App) ReplaceConversationID(before, after string)

ReplaceConversationID retains local input state when a draft is created on Node.

func (*App) ReplacementFeature

func (a *App) ReplacementFeature(packageName string) string

func (*App) ReplacesLegacyViews

func (a *App) ReplacesLegacyViews(packageName string) bool

func (*App) ResourceCheckpointHistory

func (a *App) ResourceCheckpointHistory() bool

ResourceCheckpointHistory reports whether this view needs checkpoint history.

func (*App) ResourceKind

func (a *App) ResourceKind() panel.Kind

ResourceKind identifies the workspace view used by the current page.

func (*App) ResourceProject

func (a *App) ResourceProject() *viewmodel.Project

ResourceProject is the project named in the Files or Git breadcrumb.

func (*App) ResourceTarget

func (a *App) ResourceTarget() ResourceTarget

ResourceTarget returns the explicit selection when Files or Git is shown. The zero value follows the current conversation.

func (*App) RevealConversationPanel added in v0.2.3

func (a *App) RevealConversationPanel()

RevealConversationPanel shows the active pane's right panel. Explicit open actions call it before changing the mounted panel's tabs.

func (*App) RevealDetails

func (a *App) RevealDetails()

RevealDetails shows the right column again after its toggle folded it.

func (*App) RevealResourceFile

func (a *App) RevealResourceFile() func(string)

RevealResourceFile returns the navigation callback for a file already opened in the shared workspace. Without a Files resource, the action is unavailable.

func (*App) SelectedConversation added in v0.2.7

func (a *App) SelectedConversation() *viewmodel.Conversation

SelectedConversation is the sidebar's selection on the host it was chosen on, as a row or a row's drop chose it, or by its ID alone when none was named: two hosts may list a session of one ID.

func (*App) SetFeaturePreferences

func (a *App) SetFeaturePreferences(order []string, pins map[string]bool)

func (*App) SetHostPorts

func (a *App) SetHostPorts(id string, ports []host.Port)

func (*App) SetHosts

func (a *App) SetHosts(hosts map[string]*host.Host)

func (*App) SetInstallations

func (a *App) SetInstallations(queue *transfers.Queue)

func (*App) SetLocalHost

func (a *App) SetLocalHost(h *host.Host)

SetLocalHost supplies current local overview data without preview metrics.

func (*App) SetPluginFeatures

func (a *App) SetPluginFeatures(features []Feature)

func (*App) SetPluginWorkspace

func (a *App) SetPluginWorkspace(key string, minNavigation, minDetails, defaultDetails float32)

SetPluginWorkspace projects the mounted Workspace's constraints. A default width initializes a Workspace once; subsequent projections preserve drags.

func (*App) SetPrefs

func (a *App) SetPrefs(p Prefs)

SetPrefs applies preferences, as at start-up.

func (*App) SetResourceTarget

func (a *App) SetResourceTarget(target ResourceTarget)

SetResourceTarget selects the workspace shared by Files and Git.

func (*App) SetWelcome

func (a *App) SetWelcome(seen bool)

SetWelcome uses the profile preference, independently of window UI state.

func (*App) SetWorkspaceOverlay

func (a *App) SetWorkspaceOverlay(show func(*ui.Context) bool, close func())

func (*App) ShowKnowledge

func (a *App) ShowKnowledge(r *Reading)

ShowKnowledge opens the viewer on a page read from a Node.

func (*App) ShowSelection

func (a *App) ShowSelection(text string)

ShowSelection presents text captured by the controller's native integration.

func (*App) SyncNativePages

func (a *App) SyncNativePages()

SyncNativePages delivers shared live state to the installed page controllers and metric contributors.

func (*App) SystemShortcuts

func (a *App) SystemShortcuts() map[string]string

SystemShortcuts are the system-wide shortcuts on the keys they have now, by accelerator: their commands go to Do. cmd/sailry-desktop registers them with the system as the app starts.

func (*App) TakePanelTab

func (a *App) TakePanelTab(t panel.Tab)

TakePanelTab takes t out of the panel that has it, shown or not, to show it in the main workspace. A panel it was the only tab of closes, as on an explicit close, rather than staying open with nothing in it.

func (*App) ToggleSettings

func (a *App) ToggleSettings()

ToggleSettings opens Settings, or from Settings goes back to the page it opened over: the rail's button opens and closes it (user decision 2026-11-12).

func (*App) Usage

func (a *App) Usage() Usage

Usage reads the state after a frame.

func (*App) View

func (a *App) View(c *ui.Context)

View builds the window.

func (*App) WorkspaceMount

func (a *App) WorkspaceMount(kind panel.Kind) panel.GitWorkspaceMount

func (*App) WorkspacePageEnabled

func (a *App) WorkspacePageEnabled(page Page) bool

func (*App) WorkspaceTerminalIDs

func (a *App) WorkspaceTerminalIDs() []string

WorkspaceTerminalIDs lists the open main terminal surfaces in opening order.

type AppAction

type AppAction struct {
	ID               AppActionID
	PublicNavigation bool
	PluginPermission protocol.PluginAction
	Run              func(*ui.Context, *App, AppActionContext, json.RawMessage) error
}

AppAction handles one validated JSON object. Run must validate its own fields before acting. PublicNavigation is only for navigation without a data mutation.

type AppActionContext

type AppActionContext struct {
	AppActionScope
	// contains filtered or unexported fields
}

func (AppActionContext) Current

func (c AppActionContext) Current() bool

Current must be checked on the UI thread before applying a deferred result.

type AppActionID

type AppActionID string

type AppActionScope

type AppActionScope struct {
	Node     protocol.NodeID
	Worktree protocol.WorktreeID
	Session  protocol.SessionID
}

AppActionScope is supplied by the host, never by action input.

type AppActionSource

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

AppActionSource is a host-owned caller bound to one live window and source. Bind, invoke and release it on that window's UI thread.

func (*AppActionSource) Close

func (s *AppActionSource) Close()

Close invalidates this source, without unregistering actions or other callers.

func (*AppActionSource) Invoke

func (s *AppActionSource) Invoke(c *ui.Context, id AppActionID, input json.RawMessage) error

Invoke selects exactly one action. Absence, refusal and handler failure never retry or fall through to a link, shortcut or another action.

type Assembly

type Assembly struct {
	WorkspacePages            []NativePage
	SettingsPages             []settings.NativePage
	ExecutionSettings         []settings.ExecutionSettingFactory
	Permissions               []PermissionContribution
	ProjectWorkflows          []ProjectWorkflow
	PluginControlReplacements []PluginControlReplacement
	MetricContributions       []MetricContribution
	ProviderUI                func(*settings.State) ProviderUI
	Locales                   []fs.FS
	// contains filtered or unexported fields
}

Assembly selects the optional pages, services, and translations for each window.

func Assemble

func Assemble(modules ...Module) Assembly

func (Assembly) HasPanelResource

func (a Assembly) HasPanelResource(kind panel.Kind) bool

func (Assembly) HasWorkspacePane

func (a Assembly) HasWorkspacePane(kind panes.Kind) bool

func (*Assembly) RegisterAppAction

func (a *Assembly) RegisterAppAction(action AppAction) error

RegisterAppAction declares one action for every live window in this assembly.

func (*Assembly) RegisterLinkHandler

func (a *Assembly) RegisterLinkHandler(route LinkRoute, handler LinkHandler)

RegisterLinkHandler declares a native handler at priority zero.

func (*Assembly) RegisterLinkHandlerWithPriority

func (a *Assembly) RegisterLinkHandlerWithPriority(route LinkRoute, priority int, handler LinkHandler)

RegisterLinkHandlerWithPriority declares a handler for every live window. An overlapping claim at the same priority is a configuration error.

func (*Assembly) RegisterPanelResource

func (a *Assembly) RegisterPanelResource(resource panel.Resource, bind ...func(PanelResourceHost))

RegisterPanelResource contributes a conversation panel resource, including optional tab actions. The strip owns ordering, default tab chrome and close confirmation; the resource supplies its body, commands and release policy. Binding runs once in a live window after its controllers are available.

func (*Assembly) RegisterWorkspacePane

func (a *Assembly) RegisterWorkspacePane(pane WorkspacePane)

type BrowserNavigation

type BrowserNavigation struct {
	Available func() bool
	Navigate  func(tab, address string) bool
}

type Choice

type Choice struct {
	ID       string
	Label    string
	Icon     *ui.SVG
	Keywords []string
	Folder   string // the folder it opens, "" for an action
	Selected bool   // what the window shows: a check
	// contains filtered or unexported fields
}

Choice is a row of the search: a label with keywords that match too, a folder it opens, or an action.

type CloseDocument added in v0.2.3

type CloseDocument struct {
	Project *panel.Project
	Name    string
	Digest  [32]byte
}

CloseDocument identifies the draft that a discard confirmation would lose. Each window owns its project editors, even when they show the same file.

type CloseRequest

type CloseRequest struct {
	// Documents are read again before discarding drafts and after saving.
	Documents      func() []CloseDocument
	StopsLocalWork bool
	// Save starts saving every unsaved document; Saving reports whether a
	// save is still under way. A failed save tells its own toast.
	Save    func()
	Saving  func() bool
	Proceed func()
}

CloseRequest asks to close a window or quit the application. With unsaved documents the prompt offers Save all, Discard and Cancel. Otherwise it confirms the quit and warns about any local work that will stop.

type ComposerMetricScope

type ComposerMetricScope struct {
	Node        string
	Provider    string
	ProviderRev uint64
	Model       string
	Auth        protocol.Authentication
	Credential  *protocol.CredentialRef
	CredRev     uint64
	Connected   bool
	Demo        bool
	HasMessages bool
	Statistics  *protocol.ConversationStatistics
}

ComposerMetricScope describes the active conversation and selected model channel when rendering composer context-bar metrics.

type ConversationActions

type ConversationActions interface {
	composer.Actions
	conversation.Actions
}

type ConversationPanel

type ConversationPanel struct {
	Tabs   []panel.Tab `json:"tabs,omitempty"`
	Active panel.Tab   `json:"active"`
	Open   bool        `json:"open,omitempty"`
	// Width is the column's width when the conversation was left, 0 for the
	// window's.
	Width float32 `json:"width,omitempty"`
	// contains filtered or unexported fields
}

ConversationPanel is a pane's panel while another pane is shown, and in the saved window state.

type ConversationWorktreeActions

type ConversationWorktreeActions struct {
	Create, ForkTurn, ForkSession func(WorkflowConversation)
	Select                        func(WorkflowWorkspace, *ui.Context, string)
	BranchOptions                 func(*ui.Context, *kit.Menu, []viewmodel.Branch, func(*ui.Context, string, string))
}

type Feature

type Feature struct {
	ID            string
	Icon          *ui.SVG
	Label         string // i18n key
	Fixed         bool   // always on the rail, never moved (Conversation)
	Last          bool   // always last (Market)
	DefaultPinned bool
	// LegacyPackage identifies the official package whose rail preferences this page inherits.
	LegacyPackage string
}

Feature is a rail entry.

type Group

type Group struct {
	Heading string
	Choices []Choice
}

Group is a section of choices under an optional heading.

func Filter

func Filter(groups []Group, query string) []Group

Filter keeps the choices whose label or a keyword holds the query, ignoring case, and drops groups left empty; the order stays (no score, no limit). An empty query keeps all (Rows::filter).

type Hooks

type Hooks struct {
	HostActions       func(string) host.Actions
	EditHost          func(string)
	WorkspaceProject  func() *panel.Project
	ResourceWorkspace func(ResourceTarget) *panel.Project
	DownloadDialog    func(*ui.Context)
	PackageDialogs    func(*ui.Context)
	// FilePreview draws the preview dialog of a file outside a
	// conversation.
	FilePreview func(*ui.Context)
	BeforeFrame func(*ui.Context)
	AfterFrame  func()
	// DemoChanged runs when Demo mode went on, off or into another
	// language, before the frame's other hooks.
	DemoChanged      func()
	Refresh          func()
	ReadNotice       func(string)
	ReadNotices      func([]string)
	DismissRead      func([]string)
	DismissNotices   func([]string)
	OpenKnowledge    func(c *ui.Context, node string, source Source)
	CaptureSelection func()
	OpenLogs         func()
	Conversation     func(*ui.Context, *viewmodel.Conversation, *composer.State) (*composer.Context, ConversationActions)
	// DemoConversation lets the controller show over a demo conversation
	// what reads nothing but the conversation itself: the statistics
	// package's figures in the composer's context bar. It runs after the
	// demo's composer is prepared and sends the Node nothing of the demo.
	DemoConversation func(*ui.Context, *viewmodel.Conversation, *composer.State)
	RenderChild      func(*ui.Context, string)
	ReadSelection    func(string, string)
	ReaderActive     func(string) bool
	SelectPlugin     func(string) bool
	PluginPage       func(*ui.Context, string)
	PluginHeader     func(*ui.Context)
	PluginTitle      func(*ui.Context) bool
	PluginOverlays   func(*ui.Context)
	// Overview is a conversation's session overview for the header's button.
	Overview func(*ui.Context, *viewmodel.Conversation) *composer.Overview
	// NewConversationDraft opens a fresh unsent conversation in project (nil:
	// without one) for the pane keys' new tab or split, with that location's
	// composer defaults, and selects it as New session does. Unlike New
	// session it never reuses the location's unsent draft. A selection left
	// as it was means none was created.
	NewConversationDraft func(project *viewmodel.Project)
}

Hooks keeps I/O and thread scheduling in the live controller.

type LinkActions

type LinkActions struct {
	LinkServices
	OpenWorkspaceFile      func(LinkFileDestination) error
	ShowWorkspaceDirectory func(Page, func(*panel.Project, string)) error
	OpenSession            func() error
}

LinkActions act only on the captured target, during the handler call.

type LinkContribution

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

LinkContribution is a window-local claim, including while another wins.

func (*LinkContribution) Active

func (claim *LinkContribution) Active() bool

func (*LinkContribution) Close

func (claim *LinkContribution) Close()

type LinkContributionOptions

type LinkContributionOptions struct {
	Priority int
	Current  func(LinkTarget) bool
}

LinkContributionOptions ranks a scoped candidate. Current is the host's side-effect-free authorization check, evaluated before ranking.

type LinkFileDestination

type LinkFileDestination struct {
	Page  Page
	Panel panel.Kind
}

LinkFileDestination names exactly one registered workspace page or panel.

type LinkHandler

type LinkHandler func(*ui.Context, LinkTarget, LinkActions) error

LinkHandler owns the attempted open. An error never selects another handler.

type LinkKind

type LinkKind string
const (
	LinkScheme    LinkKind = "scheme"
	LinkReference LinkKind = "reference"
	LinkFile      LinkKind = "file"
	LinkDirectory LinkKind = "directory"

	LinkDefaultPriority = -1
)

type LinkRoute

type LinkRoute struct {
	Kind LinkKind
	Name string
}

LinkRoute claims a URL scheme, a reference kind, or a validated workspace file or directory. Name is empty for workspace paths.

type LinkScope

type LinkScope struct {
	Node     protocol.NodeID
	Worktree protocol.WorktreeID
	Session  string
}

type LinkServices

type LinkServices struct {
	OpenKnowledge      func(*ui.Context, Source)
	OpenPackageDetails func(*ui.Context, string)
	ShowReference      func(label, subtitle, text string)
	SSHReference       func(protocol.SshID) (SSHReferenceEndpoint, bool)
	DatabaseReference  func(protocol.DatabaseID) (string, bool)
}

LinkServices are the read and presentation capabilities of the source conversation. Connection lookups expose only referable display data.

type LinkTarget

type LinkTarget struct {
	Route     LinkRoute
	Node      protocol.NodeID
	Session   string
	Worktree  protocol.WorktreeID
	Turn      protocol.TurnID
	URL       string
	Reference protocol.ConversationReference
	Path      string
	Line      int
	External  bool
	// ConversationWorkspace reports whether this worktree can be shown in the
	// source conversation's panel. It does not select a destination.
	ConversationWorkspace bool
}

LinkTarget carries the source location. Path is relative to Worktree ("." for its root); Line is one-based or zero if unspecified.

type MetricBinding

type MetricBinding struct {
	Lead       func(*ui.Context, ComposerMetricScope) []conversation.Metric
	Statistics func(*ui.Context, ComposerMetricScope) []conversation.Metric
	Provider   func(*ui.Context, string, string) *settings.ChannelUsage
	Sync       func()
	Close      func()
}

MetricBinding belongs to one metric contributor in one window. Lead and Statistics produce composer context-bar metrics; Provider supplies Settings channel usage. Sync runs before layout; Close releases owned resources when the window closes.

type MetricContribution

type MetricContribution struct {
	Bind func(WindowContext) MetricBinding
}

MetricContribution registers a window-scoped metric contributor in Assembly.

type Module

type Module func(*Assembly)

Module registers the contributions it supplies to a desktop assembly.

type NativePage

type NativePage struct {
	Page    Page
	Feature Feature
	Render  func(*ui.Context, *App)
	Usage   protocol.FeatureUse
	// ReplacesLegacyViews also replaces the official LegacyPackage's non-navigation
	// workspace views and contributions. Package settings and history remain available.
	ReplacesLegacyViews bool
	// LegacyWorkspace is the replaced package's layout ID for a project resource page.
	LegacyWorkspace string
	// Bind returns a window-local frame callback. visible reports whether this
	// route is active in the live window, including between frames.
	Bind func(app *App, visible func() bool) func()
	// BindWindow supplies the live window's instance of this page. Render and
	// Workspace are the fallbacks when there is no live binding.
	BindWindow func(WindowContext) WindowBinding
	// SupportsDemo reports whether this page's WindowBinding handles Demo mode
	// using sample data without contacting a Node.
	SupportsDemo bool
	// Workspace supplies the slots around Render before layout, for pages
	// without a project Resource.
	Workspace func(*App) WorkspaceSlots
	// Resource shares a workspace panel tab's project and the shell's layout.
	Resource panel.Kind
	// CheckpointHistory requests older checkpoints for the shown workspace.
	CheckpointHistory bool
	BindWorkspace     panel.GitWorkspaceMount
	// RenderDetails and BindKeys are optional resource callbacks. The shell
	// calls them with the current workspace project when it is available.
	RenderDetails func(*ui.Context, *App, *panel.Project)
	BindKeys      func(*ui.Context, *panel.Project, ui.Element)
	// ExtensionDetails shares Settings' extension details in the right column.
	ExtensionDetails bool
}

NativePage contributes a window-local rail destination and its content.

type Page

type Page string

Page is the stable ID of a destination in the main column. Native pages can use their own namespaced IDs.

const (
	ConversationPage  Page = "page:conversation"
	SettingsPage      Page = "page:settings"
	FilesPage         Page = "page:files"
	GitPage           Page = "page:git"
	ActivityPage      Page = "page:activity"
	MarketPage        Page = "page:settings_plugins"
	HostPage          Page = "page:host"
	NotificationsPage Page = "page:notifications"
	ProjectPage       Page = "page:project"
	PluginPage        Page = "page:plugin"
)

type PanelResourceHost

type PanelResourceHost struct {
	App               *App
	Report            func(error)
	BindBrowser       func()
	BrowserNavigation BrowserNavigation
	// BindTerminal connects the shared live terminal service to this window.
	BindTerminal func() sidebar.ProjectOpen
}

type PermissionCommand

type PermissionCommand func(context.Context, protocol.Command) (protocol.Output, error)

PermissionCommand executes an ordinary controller command on the selected Host.

type PermissionContribution

type PermissionContribution struct {
	Subject string
	Kinds   []protocol.PermissionsKind
	// Revision derives the availability revision from a read-only Host snapshot.
	// It is needed only when Available should follow changes while the page is open.
	Revision  func(*protocol.Snapshot) uint64
	Available func(context.Context, PermissionCommand) (bool, error)
	// Check returns all of the subject's grants in one read.
	Check func(context.Context, PermissionCommand) (PermissionReport, error)
	// Request is optional. The window calls it only on the local Host, after
	// Check reports that the selected grant can still be requested.
	Request func(context.Context, PermissionCommand, protocol.PermissionsKind) (PermissionReport, error)
}

PermissionContribution declares the grants of one native subject on the managed Host. An enabled package declaring that subject takes precedence.

type PermissionGrantState

type PermissionGrantState string
const (
	PermissionUnknown     PermissionGrantState = "permission_unknown"
	PermissionGranted     PermissionGrantState = "permission_granted"
	PermissionRequired    PermissionGrantState = "permission_required"
	PermissionNotNeeded   PermissionGrantState = "permission_not_needed"
	PermissionUnavailable PermissionGrantState = "permission_unavailable"
)

type PermissionReport

type PermissionReport struct {
	Grants     map[protocol.PermissionsKind]PermissionGrantState
	CanRequest bool
}

type PluginControlReplacement

type PluginControlReplacement struct {
	Package string
	Slot    protocol.PluginUiSlot
	ID      string
}

PluginControlReplacement identifies an old official control provided by a native module in this assembly. It never reserves an ID in another package.

type PluginWorkspacePrefs

type PluginWorkspacePrefs struct {
	Width  float32 `json:"width"`
	Folded bool    `json:"folded,omitempty"`
}

PluginWorkspacePrefs belong to one workspace, including the core Files and Git pages. Conversation panels and other workspaces keep their own widths and fold choices.

type Prefs

type Prefs struct {
	NavWidth float32 `json:"navWidth"`
	NavOpen  bool    `json:"navOpen"`
	// OverviewHidden hides the activity card in a wide conversation pane.
	OverviewHidden bool        `json:"overviewHidden,omitempty"`
	PanelWidth     float32     `json:"panelWidth"`
	PanelOpen      bool        `json:"panelOpen"`
	PanelTabs      []panel.Tab `json:"panelTabs,omitempty"`
	PanelTab       panel.Tab   `json:"panelTab"`
	// PanelOf is the conversation PanelTabs, PanelTab and PanelOpen belong
	// to, the one shown last; empty in a file from before the panel belonged
	// to conversations, whose tabs the first conversation shown takes.
	PanelOf string `json:"panelOf,omitempty"`
	// Panels are the other conversations' panels (panels.go).
	Panels           map[string]ConversationPanel    `json:"panels,omitempty"`
	PluginWorkspaces map[string]PluginWorkspacePrefs `json:"pluginWorkspaces,omitempty"`
	Collapsed        []string                        `json:"collapsed,omitempty"`
	// SessionOrder is the preview's sidebar order, a session_order value; a
	// profile keeps its own in its preferences.
	SessionOrder string   `json:"sessionOrder,omitempty"`
	Features     []string `json:"features,omitempty"` // the rail's order
	Unpinned     []string `json:"unpinned,omitempty"` // features off the rail
	// WelcomeSeen is whether the welcome guide was dismissed; nil in a file from
	// before it counts as seen, and no file at all as a first launch.
	WelcomeSeen *bool `json:"welcomeSeen,omitempty"`
	// Panes are the split workspace's groups, each a layout tree.
	Panes []*panes.Node `json:"panes,omitempty"`
	// Tabs are the sessions and terminals kept as tabs beside the groups.
	Tabs []panes.Target `json:"tabs,omitempty"`
	// TabOrder is the header tabs' opening order, each by its first target.
	TabOrder []panes.Target `json:"tabOrder,omitempty"`
	// WorkspaceTerminals are independent main terminal surfaces. They hold no
	// process state or conversation ownership.
	WorkspaceTerminals []WorkspaceTerminal `json:"workspaceTerminals,omitempty"`
	// DiffSplit is the window's diff layout: side by side when set, else
	// unified, as before the choice.
	DiffSplit bool `json:"diffSplit,omitempty"`
	// ListShare is the stacked list's share of the height (panel.pair);
	// absent, as in a file from before, is the first share.
	ListShare float32 `json:"listShare,omitempty"`
}

Prefs are the window's UI preferences that come back after a relaunch: the columns' widths and openness, the panel's tabs, the projects closed in the sidebar, and the preview's rail. They are UI state, not user data; the preview's conversations are never written.

The file is one for the preview and every profile. A profile keeps its rail's order and pins in its own preferences (FeaturePreferences), so a live window neither reads Features and Unpinned nor changes them: it writes back the ones it loaded.

func DefaultPrefs

func DefaultPrefs() Prefs

DefaultPrefs are the first launch's.

func LoadPrefs

func LoadPrefs(dir string) Prefs

LoadPrefs reads the preferences in dir, or the defaults when there are none or they do not parse. Widths out of range come back clamped.

type ProjectActions

type ProjectActions struct {
	NewSession     func(*viewmodel.Project)
	VisibleSession func(*viewmodel.Conversation) bool
	OpenSession    func(*viewmodel.Conversation, func(bool))
	Repository     func() ProjectRepository
	Initialize     func(func(bool))
	// NewTerminal opens an independent terminal in the project's worktree.
	NewTerminal func(*viewmodel.Project)
	// Terminals lists the project's running Node terminals, whichever
	// controller started them; OpenTerminal shows one as a main surface.
	Terminals       func() []ProjectTerminal
	OpenTerminal    func(id string)
	ResourceActions []sidebar.ProjectResourceAction
	WorktreePath    string
	// Controls draws the controls packages add to the page, after its own.
	Controls func(*ui.Context)
}

type ProjectLocationReader

type ProjectLocationReader struct {
	Main    protocol.WorktreeID
	Read    func(string, protocol.Command, func(protocol.Output))
	Publish func(protocol.GitWorktrees)
}

ProjectLocationReader reads and publishes the visible checkouts of one project. The host owns the cache and invalidates it when that workspace changes.

type ProjectRepository

type ProjectRepository struct {
	Known, Directory bool
	Branch           string
	Repositories     []string
}

type ProjectTerminal added in v0.2.5

type ProjectTerminal = sidebar.Terminal

ProjectTerminal is a running terminal in one of a project's worktrees, the sidebar's row of it.

type ProjectWorkflow

type ProjectWorkflow func(ProjectWorkflowHost)

ProjectWorkflow binds an optional workflow to one live window.

type ProjectWorkflowHost

type ProjectWorkflowHost struct {
	RegisterMenu            func(sidebar.ProjectMenuAction)
	RegisterLocations       func(func(ProjectLocationReader))
	RegisterWorktreeActions func(ConversationWorktreeActions)
	RegisterWorkspaceAction func(string, WorkspaceAction)
	NewDraft                func(*viewmodel.Project) (WorkflowConversation, bool)
	ProjectWorkspace        func(*viewmodel.Project) (WorkflowWorkspace, bool)
}

type ProviderUI

type ProviderUI interface {
	Picker(c *ui.Context, chosen, back func())
	CloseProviderEditor(nextNode string)
	LoginDialog(*ui.Context)
	ShowProviderAuthorization(node, id string, view *settings.Authorization)
	ProviderAuthorization() *settings.Authorization
	WarnProviderAuthorization(title, text string, proceed, cancel func())
}

ProviderUI is the model channels page's presentation for this window.

type Reading

type Reading struct {
	Node, Collection                  string
	Title, Host, Path, Position, Text string
	First, Last, Pending              bool
	Unavailable                       bool
	Turn                              func(forward bool)
}

Reading is one page of a citation read from its Node. The controller owns it: it replaces the page and the ends as Previous and Next load.

type ResourceTarget

type ResourceTarget struct {
	Node, Project, Worktree string
}

ResourceTarget identifies the independent Files and Git workspace. An empty Worktree selects the project's main worktree.

type SSHReferenceEndpoint

type SSHReferenceEndpoint struct {
	Username, Host string
	Port           uint16
}

type Shortcut

type Shortcut = settings.Shortcut

Shortcut is a key of the window: its id, label and default key, as the Shortcuts settings list them.

type Source

type Source struct {
	Collection, Chunk, Revision, Node string
}

Source is a knowledge citation's identity (sailry-knowledge://<collection>/<chunk>?revision=<rev>).

func ParseSource

func ParseSource(link string) (Source, bool)

ParseSource reads a knowledge link, rejecting what the reference rejects: another scheme, a user, password or port, a fragment, more path segments, and query fields other than revision and an optional storage Node.

type Usage

type Usage struct {
	Page Page
	// PluginPage is the rail feature of the package page shown, "" on any
	// other page.
	PluginPage string
	// Search is whether the search palette is open.
	Search bool
	// ModelPicker is whether a composer's model controls are open.
	ModelPicker bool
	// Splits is how many panes were split off since the window opened.
	Splits int
}

Usage is the part of the window's state the anonymous feature counters compare from one frame to the next. It names no session, project or host.

type WindowBinding

type WindowBinding struct {
	Render func(*ui.Context)
	Slots  func() WorkspaceSlots
	Sync   func()
	Close  func()
}

WindowBinding belongs to one registered page in one window. Sync runs before layout; Close releases whatever the page still owns at window close.

type WindowContext

type WindowContext struct {
	Context context.Context
	Visible func() bool
}

WindowContext is passed only to pages registered in this live window.

type WorkflowConversation

type WorkflowConversation struct {
	Session       *protocol.Session
	Execute       func(string, protocol.Command, func(*ui.Context, protocol.Output, error))
	Report        func(*ui.Context, error, string, string, string)
	OpenWorkspace func() (WorkflowWorkspace, bool)
}

WorkflowConversation captures the Node and source of an explicitly invoked action.

type WorkflowWorkspace

type WorkflowWorkspace struct {
	Worktree           protocol.Worktree
	Session            *protocol.Session
	Presentation       *panel.Project
	Current            func() bool
	Read               func(string, protocol.Command, func(*ui.Context, protocol.Output))
	Execute            func(string, protocol.Command, func(*ui.Context, protocol.Output, error))
	Report             func(*ui.Context, error, string, string, string)
	Pick               func(string, []panel.PickerRow)
	Prompt             func(string, []string, []string, func([]string, func(bool)), ...panel.PromptToggle)
	Confirm            func(string, string, func(func(bool)), ...string)
	LockPrompt         func(bool)
	SetPromptAction    func(string)
	SetPromptDetail    func(string, string)
	SetPromptUncertain func(bool)
	Locations          func() ([]protocol.Worktree, []protocol.Session)
	HasDrafts          func(protocol.WorktreeID) bool
	Admit              func(protocol.Worktree)
	Release            func(protocol.WorktreeID)
	UseLocation        func(protocol.Worktree)
	CanSelectLocation  func() bool
	SelectLocation     func(*ui.Context, protocol.Worktree)
	OpenSession        func(protocol.SessionID)
	Refresh            func()
	RefreshLocations   func()
}

WorkflowWorkspace captures a workspace and the window surface that opened it. Current reports whether its controls and location selection are still active.

type WorkspaceAction

type WorkspaceAction func(*ui.Context, WorkflowWorkspace, string, string)

type WorkspacePane

type WorkspacePane struct {
	Kind   panes.Kind
	Icon   *ui.SVG
	Exists func(*App, string) bool
	Title  func(*App, *ui.Context, string) string
	Render func(*App, *ui.Context, string)
	Close  func(*App, string)
	Split  func(*App, string) (string, bool)
}

WorkspacePane contributes one kind of main-workspace surface. Callbacks operate on the supplied window. Close releases the module's surface; the shell removes its tab, split placement and panel. The module's window binding releases window-scoped resources on shutdown. Split optionally opens a sibling surface and returns its ID.

func TerminalWorkspacePane

func TerminalWorkspacePane() WorkspacePane

TerminalWorkspacePane contributes the independent terminal surface to a product that provides a terminal service.

type WorkspaceSlots

type WorkspaceSlots struct {
	PreferenceKey       string
	MinNavigationWidth  float32
	MinDetailsWidth     float32
	DefaultDetailsWidth float32
	DetailsLabel        string // i18n key or a localized label
	Navigation          func(*ui.Context)
	Details             func(*ui.Context)
	DetailsHeader       func(*ui.Context)
	Title               func(*ui.Context)
	Header              func(*ui.Context)
	// Close handles the scoped Close Tab action, including when it is a no-op.
	Close func(*ui.Context)
}

WorkspaceSlots are a native page's current frame: the Shell places the navigation, details and header slots and owns their sizing and folding.

type WorkspaceTerminal

type WorkspaceTerminal struct {
	ID    string `json:"id"`
	Title string `json:"title,omitempty"`
	// contains filtered or unexported fields
}

WorkspaceTerminal is an independent terminal surface in the main workspace. The Node owns its process; this record only keeps its presentation open.

Jump to

Keyboard shortcuts

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