Documentation
¶
Index ¶
- Constants
- Variables
- func After(ctx context.Context, wait time.Duration, next func() tea.Cmd) tea.Cmd
- func Async(work func() func() tea.Cmd) tea.Cmd
- func AsyncTo(card wm.Card, work func() func() tea.Cmd) tea.Cmd
- func Behind(work func() func() tea.Cmd) tea.Cmd
- func Call[R any](hub *cards.Hub, call func() (R, error), then func(result R) tea.Cmd) tea.Cmd
- func EditFile(ctx context.Context, path string, done func(err error) tea.Cmd) tea.Cmd
- func EditText(ctx context.Context, name, text string, ...) tea.Cmd
- func Followed(screens []Screen) []string
- func Held(value string) (string, bool)
- func Language(l *base.Language) tea.Cmd
- func PickOf(picks string) (kind, of string)
- func Reason(err error) string
- func Reread(card wm.Card, work func() func() bool) tea.Cmd
- func Run(ctx context.Context, screens []Screen, options Options) error
- func Theme(name string) tea.Cmd
- func Waiting(loaded bool, err error, none string) string
- type Activity
- type Area
- type Ask
- type Attention
- type Choice
- type Doing
- type Flow
- func (f *Flow) Ask(intro string, fields []cards.Field, verb string, ...) tea.Cmd
- func (f *Flow) End() tea.Cmd
- func (f *Flow) Hub() *cards.Hub
- func (f *Flow) Job(title string, run func(out Output) Outcome, ended func() tea.Cmd) tea.Cmd
- func (f *Flow) Mark(intro string, choices []Choice, marked []string, verb string, ...) tea.Cmd
- func (f *Flow) Pick(intro string, choices []Choice, current string, ...) tea.Cmd
- func (f *Flow) PickVerb(intro string, choices []Choice, current, verb string, ...) tea.Cmd
- func (f *Flow) Show(view wm.Card) tea.Cmd
- func (f *Flow) Step() wm.Card
- type Heed
- type Kit
- func (k *Kit) Add(screens ...Screen) (tea.Cmd, error)
- func (k *Kit) Apply(apply func() tea.Cmd)
- func (k *Kit) ApplyBehind(apply func() tea.Cmd)
- func (k *Kit) ApplyTo(card wm.Card, apply func() tea.Cmd)
- func (k *Kit) Areas(areas []Area)
- func (k *Kit) Ask(hub *cards.Hub, title string, field cards.Field, submit string, ...) tea.Cmd
- func (k *Kit) AskAny(hub *cards.Hub, title string, field cards.Field, submit string, ...) tea.Cmd
- func (k *Kit) AskOr(hub *cards.Hub, title string, field cards.Field, submit string, ...) tea.Cmd
- func (k *Kit) Attend(a Attention) tea.Cmd
- func (k *Kit) Changed(key, value string) tea.Cmd
- func (k *Kit) Changes() uint64
- func (k *Kit) Choose(hub *cards.Hub, picks string, ask Ask) (tea.Cmd, bool)
- func (k *Kit) CloneSession(profile, id string) tea.Cmd
- func (k *Kit) Dark() (dark, told bool)
- func (k *Kit) Drop(prefix string)
- func (k *Kit) EditBeside(name, text string, done func(edited string, err error) tea.Cmd) tea.Cmd
- func (k *Kit) Emptying(hub *cards.Hub, list wm.Card, ask Ask, current string)
- func (k *Kit) Flow(hub *cards.Hub, title string) *Flow
- func (k *Kit) FlowAlone(title string) *Flow
- func (k *Kit) FlowIn(hub *cards.Hub, title string) *Flow
- func (k *Kit) Focused() wm.Card
- func (k *Kit) HeldElsewhere(id string) bool
- func (k *Kit) Hub(key string, root wm.Card) *cards.Hub
- func (k *Kit) Indicate(indicator string) tea.Cmd
- func (k *Kit) Indicator() string
- func (k *Kit) Job(hub *cards.Hub, title string, run func(out Output) Outcome, ...) tea.Cmd
- func (k *Kit) Look(change func(looks *Looks)) tea.Cmd
- func (k *Kit) Mark(marked, on bool) string
- func (k *Kit) Mount(area, argument string) (*cards.Hub, tea.Cmd, bool)
- func (k *Kit) Move(folder string) error
- func (k *Kit) Notifier() tty.Notifier
- func (k *Kit) Notifying(mode string)
- func (k *Kit) Open(id, argument string) tea.Cmd
- func (k *Kit) OpenSession(profile, id string) tea.Cmd
- func (k *Kit) OwnServer() bool
- func (k *Kit) Pages(profile string) map[string][]Page
- func (k *Kit) Pick(hub *cards.Hub, title, verb string, choices []Choice, current string, ...) tea.Cmd
- func (k *Kit) PickAsked(hub *cards.Hub, ask Ask, title string, intro []string, verb string, ...) tea.Cmd
- func (k *Kit) PickField(hub *cards.Hub, form *cards.Form, field cards.Field) tea.Cmd
- func (k *Kit) PickFrom(hub *cards.Hub, title string, intro []string, verb string, choices []Choice, ...) tea.Cmd
- func (k *Kit) Picker(picks string) (Picker, bool)
- func (k *Kit) Refuses(profile, backend, then string) string
- func (k *Kit) Report(report func(status *wm.Status))
- func (k *Kit) Restatus()
- func (k *Kit) RunBy(id string, owner *Owner) string
- func (k *Kit) Runner(id string, owner *Owner) string
- func (k *Kit) Screens() []Screen
- func (k *Kit) SessionName(id, title, first string) string
- func (k *Kit) Sessions() []string
- func (k *Kit) SessionsVersion() uint64
- func (k *Kit) Set(name, value string) tea.Cmd
- func (k *Kit) SetRefusing(refuses func(profile, backend, then string) string)
- func (k *Kit) SetSessionDesk(desk SessionDesk)
- func (k *Kit) Show(key string, root wm.Card) (*cards.Hub, tea.Cmd)
- func (k *Kit) Shown() []Shown
- func (k *Kit) Slash(line string) (tea.Cmd, bool)
- func (k *Kit) Still() *Kit
- func (k *Kit) Terminal() *cards.Terminal
- func (k *Kit) TerminalCommand(line string) *cards.Terminal
- func (k *Kit) TerminalProgram(argv []string, done func(cards.TerminalEnd) tea.Cmd) *cards.Terminal
- func (k *Kit) WatchSessions(tell func() tea.Cmd) func()
- func (k *Kit) Wear(saved string) tea.Cmd
- func (k *Kit) While(hub *cards.Hub) func() context.Context
- func (k *Kit) Worn() string
- type LanguageMsg
- type Looks
- type Next
- type Options
- type Outcome
- type Output
- type Owner
- type Page
- type Picker
- type Screen
- type SessionDesk
- type Sessioned
- type Shown
- type ThemeMsg
- type Tone
- type Window
Constants ¶
const ( ReplyDone = "done" ReplyFailed = "failed" WaitsOnYou = "waiting" )
What happened in a window that may deserve the user's attention: a reply ended, a reply failed, or the agent waits on the user for an approval or an answer
const ( NotifyOff = "off" NotifyWaiting = "waiting" NotifyAll = "all" )
Values of Notifications: none, only as the agent waits on the user, or as a reply ends too
const ( LookLight = "light" LookDark = "dark" )
Modes of Looks that take one of the styles whatever the terminal
const ( GroupSessions = "Sessions" GroupModels = "Models" GroupAbilities = "Abilities" GroupAutomation = "Automation" GroupSafety = "Safety" GroupMedia = "Images and video" GroupVoice = "Voice" GroupSecrets = "Keys and passwords" GroupApp = "This app" GroupMore = "More" )
Headings the command palette lists screens under, in the order they show: what a user reaches for first comes first
const FlowContext = "flow"
FlowContext is the keymap context for job step keys.
const JobContext = "job"
JobContext is the keymap context for a job page's keys.
const LanguageSetting = "language"
Name the cards are told a change of the window's language by, as a setting of the kit
Variables ¶
var ErrNoEditor = lang.Errorf("No editor found. Set EDITOR to your preferred editor.")
Why nothing was opened in an editor: none is set and none of the usual ones is on this machine
Functions ¶
func After ¶
Runs what to do next once the time passed, on the UI loop and with nothing drawn again for it, or never when the context ends first: the wait between two readings of something read again every little while
func Async ¶
Runs work off the UI loop, then what it hands back on the UI loop, after which every card draws again as what it shows may have changed. Work that found nothing to apply hands back nil: then nothing reaches the UI loop and no card is drawn again, so reading something again every little while costs the app nothing while what is read stays the same
func AsyncTo ¶
Async for work whose outcome one card alone shows, such as what a view reads again every little while: what the work hands back runs on the UI loop, after which the card, or the hub or menu holding it, reads what it shows again and draws again while every other card stays as it is drawn, however many windows are open. Work that found nothing to apply hands back nil, and then nothing reaches the UI loop. Work whose outcome other cards show too, such as a setting kept, goes through Async
func Behind ¶
Async for work that changes nothing a card shows by itself, such as the wait between two readings: what the work hands back runs on the UI loop and nothing is drawn again for it, so it only looks at what the app holds and hands back what to do next. Whatever that does next that a card shows reaches the card as work of its own, through Async or AsyncTo
func Call ¶
Call runs call off the UI loop, then then with its result on the UI loop. A failure raises its reason as an error toast through the hub.
func EditFile ¶
Opens the file in the user's editor with the terminal handed over to it, the editor found off the UI loop. done runs on the UI loop once the editor is back, with ErrNoEditor when there is none and why it did not start when it could not. An editor that ends with a status of its own still ran
func EditText ¶
func EditText(ctx context.Context, name, text string, done func(edited string, err error) tea.Cmd) tea.Cmd
Opens the text in the user's editor, in a file of the name made off the UI loop in a folder of its own that only its owner can read. done runs on the UI loop once the editor is back, with what the file holds then, the folder gone, or why the text could not be edited
func Held ¶
Held returns the text that a YAML value encodes, the way a picker reads the value it shows, and false when the value is not text. The text is cached, because a row reads its value on every draw.
func PickOf ¶
Kind of thing a setting's Picks names and what of that kind the picker lists, written kind:argument, such as model:openrouter for the models of OpenRouter alone. The argument is the picker's own to read. Empty for every thing of the kind
func Reason ¶
Reason returns an error's words for the user: a service error's message, or the error's text in the window's language.
func Reread ¶
AsyncTo for a reading that mostly finds what its card shows already, such as what a card reads as it opens or reads again when something it follows changed: what the work hands back runs on the UI loop, where what the card holds now is known, and answers whether it changed anything the card shows. The card is drawn again only when it did. A reading that found what the card holds already, or that a later reading overtook, draws nothing at all and does not wake any frames. Looking on the UI loop rather than where the work ran means the answer is held against what the card holds as it arrives, not against what the card held as the reading began
func Run ¶
Makes the window of the screens and runs it on the terminal until the user quits or the context ends
func Waiting ¶
Waiting returns the static text that a list shows in place of its rows: a fixed text when they could not be read, cards.Loading while they are read, which the list shows beside a spinner until they arrive, and otherwise the screen's own empty text. It never shows the error's words: the screen that received the error raises its reason as a toast.
Types ¶
type Activity ¶
type Activity struct {
// A reply is under way, it waits on the user for an approval or an answer, a tool it called is at work, it thinks before it writes
Busy, Waiting, Tool, Thinking bool
// When its last reply ended well and whether it left every task of its list done, when one failed, when the user last sent it a
// message from this window and what that said, and when anything last happened in it. Zero for never
Ended time.Time
Finished bool
Failed time.Time
Said time.Time
Message string
Last time.Time
// Cell of the screen where what it does shows now, which what keeps the user company may look at: the approval or the question
// that waits, otherwise the composer while the user types, otherwise the newest line while a reply is written. Spotted false for none
Spot image.Point
Spotted bool
}
What a session does and what last happened in it
type Area ¶
type Area struct {
ID, Title, Group, About string
}
One area of the settings menu as the palette lists it: the key of its section, its name, which the palette shows after the menu's as the trail to the area, the heading of its group and what is set there
type Ask ¶
type Ask struct {
Title string
Intro []string
// Key is the setting's key, and empty when a screen asks for itself
Key string
// Values has the current values as YAML, by key: the setting's value and the values of the settings beside it
Values map[string]string
// Profile is the profile to list from. An empty Profile lists from the active profile
Profile string
// The setting's Picks gives Of after the kind to narrow the picker's list, such as to one provider's models. The picker reads it, and an
// empty Of lists everything
Of string
// Item says that the setting at Key is a list and one item is requested: Values has that item under Key, or no value when the item is
// new, and Done receives the picked item under Key, while the asker saves the list
Item bool
// Verb is the word on the button that picks, such as Add when the pick ends a job. An empty verb shows Choose
Verb string
// Done receives the values to save as YAML, by key. A null value restores a default. The asker ends the job once they are saved
Done func(values map[string]string) tea.Cmd
// Empty stores the setting's empty value. It is nil when the setting can't be left empty.
Empty func() tea.Cmd
}
Ask is a request to a picker.
type Attention ¶
type Attention struct {
Kind string
Bell bool
Stopped bool
Title string
Body string
Session string
Folder string
Project string
// How long the reply that ended ran, and the shortest whose end rings the bell, 0 for every one. A wait on the user rings whatever
// they are
Took, After time.Duration
// The user is typing in the window it happened in: it is in front, the terminal has the focus, and its prompt changed a moment ago
Typing bool
}
Something that happened, as the one rule of what deserves the user's attention weighs it: its kind, whether the bell of its kind is on, whether the user stopped the reply themselves, and what a notification of the desktop says of it: the title of the session with what looks like a secret masked, one line, and for Warp the session and the folder and project it works in
type Choice ¶
type Choice struct {
ID string
Title string
// Detail describes the choice in the detail pane while the choice is selected, and never in the list
Detail string
// Group is the heading over the choice, and choices with one heading sit together in their given order. A list without headings leaves
// it empty
Group string
// Verb is the button's word while the choice is selected, such as Add for a choice that ends a job while the others continue it. An
// empty verb shows the list's own verb
Verb string
// Every says that the choice stands for all the other choices in a list to mark (Flow.Mark): marking it marks them all, and it shows
// marked while they all are. A pick list ignores it
Every bool
}
Choice is one pick list row.
type Doing ¶
type Doing interface {
// What the session shown does now and what last happened in it, read on the UI loop
Doing() Activity
}
Card that shows a session at work, which says what the session is doing, so what keeps the user company in the app, such as a pet, reacts to it
type Flow ¶
type Flow struct {
// contains filtered or unexported fields
}
Flow is a job in steps, each step one question: a form of typed fields, a list to pick from or a list to mark, with one line that says what is asked. The steps are one view on the hub, titled as the job through every step. Esc goes back a step with the answers kept, and from the first step it leaves the job.
func (*Flow) Ask ¶
func (f *Flow) Ask(intro string, fields []cards.Field, verb string, next func(values map[string]string) tea.Cmd) tea.Cmd
Ask asks the next question in a form of fields under the intro, with verb on the button that enter presses from the last field, and Next when verb is empty. Every step says what is asked once: above its fields, or in the form's help pane for a single-field step, before the field's own help. Fields asked at this place before come back as they were left. A choice field with a long list opens it over the hub.
func (*Flow) End ¶
End ends the job: the flow closes, and so does a menu that the user opened directly for this job.
func (*Flow) Job ¶
Job runs a job on a job page over the steps, like Kit.Job, as the job's last step. While the job wrote nothing and did not end well, esc from the page goes back to the step under it, and a job that fails before it wrote anything closes its page, so the step under it shows again with the failure in a toast and the answers can change. Once the job wrote output or ended well, the answers are spent, and the page's closing ends the job's steps too. For a job that fills its dialog, the dialog closes with them.
func (*Flow) Mark ¶
func (f *Flow) Mark(intro string, choices []Choice, marked []string, verb string, next func(marked []string) tea.Cmd) tea.Cmd
Mark asks the next question as a list of choices to mark under the intro, any number of them, with the choices in marked marked at first. Enter or a click on the selected choice marks or unmarks it, and the button labeled verb, Next when verb is empty, passes the marked choices' IDs to next in the choices' order. A choice with Every set stands for all the other choices: marking it marks them all, unmarking it unmarks them all, and it shows marked while they all are. The marks made at this place before come back.
func (*Flow) Pick ¶
func (f *Flow) Pick(intro string, choices []Choice, current string, next func(choice Choice) tea.Cmd) tea.Cmd
Pick asks the next question as a list to pick from under the intro, with the current choice marked. A choice made at this place before is selected again.
func (*Flow) PickVerb ¶
func (f *Flow) PickVerb(intro string, choices []Choice, current, verb string, next func(choice Choice) tea.Cmd) tea.Cmd
PickVerb is Pick with verb on the button, such as Add for a choice that ends the job. An empty verb shows Choose.
func (*Flow) Show ¶
Show shows the caller's own view as the next step, such as a sign-in page. Esc goes back a step from it like from any other step.
type Heed ¶
type Heed struct {
Bell, Notify bool
}
What the one rule says of something that happened: whether the terminal's bell rings, and whether a notification of the desktop goes
func Weigh ¶
The one rule of what deserves the user's attention: nothing for a reply the user stopped, nor while they type in the window it happened in. The bell where its setting for the kind says so, for a reply that ended or failed only once it ran at least as long as the bell asks. A notification where Notifications covers the kind, the terminal shows them, and the user is not looking at the terminal, as far as it reports its focus, a terminal that reports none told every time since it can't be known
type Kit ¶
type Kit struct {
Env *cards.Env
WM *wm.Model
History cards.History
// contains filtered or unexported fields
}
func (*Kit) Add ¶
Adds screens while the app runs, such as the widgets of plugins, after those the app started with so a slash command of theirs wins; one with the ID of an added screen takes its place. Each is readied as a screen the app starts with is: its keys, the keys saved for them, its keymap contexts and actions, the settings it follows and what it learns before anyone opens it
func (*Kit) ApplyBehind ¶
Apply for a change no card shows by itself, such as what a list kept off the screen reads: it runs on the UI loop and nothing is drawn again for it, so what it changes that shows is drawn by what it does, such as Restatus or a Touch
func (*Kit) ApplyTo ¶
Apply for a change one card alone shows, which draws again while every other card stays as it is drawn
func (*Kit) Areas ¶
Tells the kit the areas of the settings menu, which the palette then lists in place of the screens that are their pages
func (*Kit) Ask ¶
func (k *Kit) Ask(hub *cards.Hub, title string, field cards.Field, submit string, done func(text string) tea.Cmd) tea.Cmd
Ask asks one question over the hub in a form of one typed field, with the field's help in the form's help pane. Enter or the button labeled submit passes the trimmed answer to done. An empty answer is refused.
func (*Kit) AskAny ¶
func (k *Kit) AskAny(hub *cards.Hub, title string, field cards.Field, submit string, done func(text string) tea.Cmd) tea.Cmd
AskAny is Ask that accepts an empty answer too, for a value that the user clears by leaving its field empty.
func (*Kit) AskOr ¶
func (k *Kit) AskOr(hub *cards.Hub, title string, field cards.Field, submit string, done func(text string) tea.Cmd, left func() tea.Cmd) tea.Cmd
AskOr is Ask that runs left when the form closes without an answer, through the way back or with its hub, for an asker that waits for the answer.
func (*Kit) Attend ¶
Tells the user of what happened as Weigh says, through the kit's writer to the terminal: the bell, then the notification in the form the terminal takes it, wrapped for tmux or screen where one stands between
func (*Kit) Changed ¶
Tells every screen that follows the setting its new value, as YAML, and every card that it changed. A value as the settings service shows it that is not the value in use, such as text that names a variable as ${NAME}, is read again for use first, off the UI loop, so what follows the setting acts on what it comes to and never on the reference. One that could not be read is said in the log and told to none
func (*Kit) Changes ¶
Count of the changes to the screens and the areas so far, so what is worked out of the screens, such as which areas have a page or which settings a picker keeps together, is worked out again only once it moved
func (*Kit) Choose ¶
Opens the picker of a kind of thing over the hub, handed what of the kind to list when picks names it after the kind and the ask does not. false when no screen offers one
func (*Kit) CloneSession ¶
Clones the session of the profile into a new session of this terminal, shown in a window of its own
func (*Kit) Drop ¶
Drop removes the screens added under IDs that start with the prefix, with their opening keys and the actions that only they add.
func (*Kit) EditBeside ¶
Opens the text in the user's editor in a terminal window beside what they work in, which stays on the screen and goes on while they edit, such as the list of the actions while the keys of the keymap are edited: in a file of the name made off the UI loop in a folder of its own that only its owner can read. done runs on the UI loop once the editor ended or its window was closed, with what the file holds then, the folder gone, or why the text could not be edited
func (*Kit) Emptying ¶
Emptying lets the empty key run the ask's Empty and close list, while list is on top of hub and current holds a choice. A picker that builds its own list calls it right after it pushes the list.
func (*Kit) Flow ¶
Flow starts a job in steps over the hub, titled as the job. Its first question shows it.
func (*Kit) FlowAlone ¶
FlowAlone starts a job in steps in a standalone dialog, titled as the job. Its first question shows the dialog.
func (*Kit) FlowIn ¶
FlowIn starts a job in steps that fills the hub, titled as the job. Its first question replaces the hub's first view, such as a view that shows while the first question's content loads, and esc from the first question closes the hub's dialog.
func (*Kit) HeldElsewhere ¶
Whether another terminal holds the session the server runs, false when no screen shows sessions
func (*Kit) Indicate ¶
Has every spinner of the app, those of the windows and of the bar alike, turn through the frames of the busy indicator, the wheel of the style worn for the unicode one. The style is worn again with them
func (*Kit) Job ¶
func (k *Kit) Job(hub *cards.Hub, title string, run func(out Output) Outcome, ended func() tea.Cmd) tea.Cmd
Job runs a job on a page pushed over the hub, which shows the job's output while it arrives. The job continues to its end when the page is closed. While the job runs, its status shows beside a spinner in the hub's foot, and its outcome is raised as one toast when it ends, whether or not the page still shows. ended runs on the UI loop once the job is over, such as to read a list again.
func (*Kit) Mark ¶
Mark returns the mark before a choice in a list with a current choice: filled on the current choice, hollow on the others, and nothing in a list without a current choice.
func (*Kit) Mount ¶
Opens the screen that names the area as the page of that area, handing it the argument: the hub its first view went into, with what its Open returned. False when no screen names the area. A nil hub when the screen showed nothing
func (*Kit) Move ¶
Moves the terminal into the folder its views and the sessions it starts work in, which every reader takes from Env.WorkDir; the process's own folder never changes. An error says why it could not, the terminal staying where it was. Whoever asks looks at the folder off the UI loop first, so the look here finds it in the disk cache
func (*Kit) Notifier ¶
The terminal this window runs in as its notifications go, read off the environment of the process once
func (*Kit) Notifying ¶
Sets what sends a notification of the desktop, as Notifications says: off, waiting or all
func (*Kit) OpenSession ¶
Opens the session of the profile, the one in use for none, in a window of its own, or focuses the window that shows it
func (*Kit) Pages ¶
Pages of the areas the screens are the pages of, by the key of each area, read from every screen that has some: off the UI thread, on a kit Still made on it
func (*Kit) Pick ¶
func (k *Kit) Pick(hub *cards.Hub, title, verb string, choices []Choice, current string, pick func(choice Choice) tea.Cmd) tea.Cmd
Pick opens a list of choices by their titles over the hub, or in a new hub when hub is nil, with the current choice marked and each selected choice's detail in the detail pane. Enter or the button labeled verb runs pick with the selected choice and closes the list.
func (*Kit) PickAsked ¶
func (k *Kit) PickAsked(hub *cards.Hub, ask Ask, title string, intro []string, verb string, choices []Choice, current string, pick func(choice Choice) tea.Cmd) tea.Cmd
PickAsked is PickFrom for a picker's ask. While the list is on top and a choice is held, the empty key runs the ask's Empty.
func (*Kit) PickField ¶
PickField opens a form's choice field's choices in a list over the hub and puts the picked choice in the field. While the field has a choice that it may be left without, the empty key empties the field.
func (*Kit) PickFrom ¶
func (k *Kit) PickFrom(hub *cards.Hub, title string, intro []string, verb string, choices []Choice, current string, pick func(choice Choice) tea.Cmd) tea.Cmd
PickFrom is Pick with intro lines above the choices, which say what is being chosen when the title does not.
func (*Kit) Picker ¶
Picker of the kind a setting's Picks names, the argument after the kind left to the picker. false when no screen offers that kind. Every row of a setting that names a kind asks, so the pickers are gathered by kind once and again only when the screens changed, the first screen that offers a kind winning as the screens are ordered
func (*Kit) Refuses ¶
Why the window can't go to the profile with the server at backend, the profile's saved one when empty: one line naming the work under way on this terminal's own server that the move would leave, ending "then " and what to do then. Empty when it can. Asks the server, so it is called off the UI loop
func (*Kit) Report ¶
Adds what a screen shows on the bar. The report runs only after Restatus, never on every frame
func (*Kit) Restatus ¶
func (k *Kit) Restatus()
Has the bar ask every report again before it is next drawn, for a screen whose part of the bar changed
func (*Kit) RunBy ¶
One line that says who runs the session when this terminal may not write it, empty when it may or when no screen shows sessions
func (*Kit) Runner ¶
Few words for who runs the session when this terminal may not write it, empty when it may or when no screen shows sessions
func (*Kit) SessionName ¶
SessionName returns what this terminal calls the session everywhere (SessionDesk.Name), from the title and the first message that a screen read for it. Without a screen that shows sessions it returns the title, and then no screen shows it.
func (*Kit) SessionsVersion ¶
Count that moves each time what the server runs or what the windows here show changes, which rows that say who runs a session follow
func (*Kit) Set ¶
Sets a setting of the kit by the name its cards read it by, telling every card it changed
func (*Kit) SetRefusing ¶
Sets what says why the window can't move to the server a profile uses
func (*Kit) SetSessionDesk ¶
func (k *Kit) SetSessionDesk(desk SessionDesk)
Sets what opens, clones and tells the owner of sessions for every screen
func (*Kit) Show ¶
Shows the first view of a screen: as the page of its area when the settings menu is opening it, otherwise in a dialog of its own. Called by Open before it returns
func (*Kit) Shown ¶
Sessions the windows of every space show with their profiles, each once, the focused one first
func (*Kit) Still ¶
The kit as it stands on the UI loop now, for work off it such as reading Pages: the folder of the session in view, the settings and the screens as they are now, so what the UI loop changes meanwhile, such as a session moving into a worktree, is never read from another thread
func (*Kit) TerminalCommand ¶
Terminal window that runs one command line through the shell in the folder the window works in, closing once it ends
func (*Kit) TerminalProgram ¶
Terminal window that runs a program with its arguments in the folder the window works in, with no shell between, such as the user's editor on a file: it closes once the program ends well and stays open with what the program printed when it fails. done is told once how the program ended and what it left on the screen, or that it did not start or its window was closed while it ran
func (*Kit) WatchSessions ¶
Calls tell on the UI loop each time what the server runs changes, until the function handed back is called
func (*Kit) Wear ¶
Wears the saved style again once a source handed the app's styles again, as one of a source has it now. While they lack it the one worn stays as long as they still have that, otherwise the default one is worn. A style of the kit is left to whatever follows the saved one. The light style stands in for the saved one where the look says the window wears it
func (*Kit) While ¶
Context for what a view reads to show itself, by the hub it shows on: it ends once the hub leaves the screen, so a reading still under way for a page a person left stops rather than running on behind, and it is made again the next time it is asked for after that. Asked for on the UI loop as a reading starts. Whoever takes the reading in drops what it found once the context ended and reads again when the page is back, as what a stopped reading answers is no answer
type LanguageMsg ¶
The window speaks another language
type Looks ¶
type Looks struct {
Style, Light string
// LookLight or LookDark to take one of the two always, anything else to go by the background of the terminal
Mode string
}
Which style the window wears: the style it is set to, the one for a light background, and which of the two it takes
type Next ¶
Next is the action that a job page offers after the job ends, such as installing what the job read: its key's word, a question in the page's foot first when there is one, and the code that runs on the UI loop, once.
type Options ¶
type Options struct {
Style string
Keys map[string][]string
// FrameRate shows the frame rate readout on the bar, and FrameLog logs frames slower than FrameLogFloor to FrameLogFile
FrameRate, FrameLog bool
FrameLogFloor time.Duration
FrameLogFile string
// Mouse tracking asked of the terminal, as the setting of the mouse names it: wm.MouseAll, wm.MouseClicks or wm.MouseOff, every move
// when empty
Mouse string
// Value as YAML of every setting a screen follows, by key, as it is read for use
Settings map[string]string
// Reads the value as YAML of a setting as it is read for use: of one that a screen added while the app runs follows, when the app did
// not read it as it started, and of one whose change was told as Shown says the settings service shows it
Read func(key string) (string, error)
// Whether a value as YAML that the settings service shows of a setting is not the value in use, such as text that names a variable as
// ${NAME} or a secret masked: a change told with such a value is read again with Read before the screens that follow the setting hear
// it
Shown func(value string) bool
// Variables the shells of terminal windows run with over this process's own, as KEY=value, read as each shell starts
ShellEnv func() []string
// Styles beside those of the kit by where they come from, such as the styles folder of the profile
Styles map[string][]theme.Theme
// What the terminal's background was the run before, LookLight, LookDark or empty, which the first frame is worn for until the terminal
// answers. And how what the window learns of it is kept for the next run, called off the UI loop, nil for not at all
Background string
Remember func(dark bool)
// Told what the terminal was found to draw and the way pictures are drawn in it each time that changed, off the UI loop, so the doctor
// and the report of the installation can say it. nil for no one
Graphics func(report gfx.Report)
// The server the window runs on is this process's own, so the replies it runs wait while the window is suspended to the shell
Own bool
// Windows the last run kept, opened again as the terminal starts, nil for none. And what keeps the windows for the next run, called off
// the UI loop a moment after they change and once the program ended, nil for nothing
Layout *wm.Layout
Keep func(layout wm.Layout)
}
type Outcome ¶
type Outcome struct {
// Err is a failure that the job did not report as a line
Err error
// Problems says that the job ended with problems that it reported as lines
Problems bool
// Made is something the job made that the user may copy, such as a path, which the toast at the job's end names, and MadeWhat says
// what it is
Made, MadeWhat string
// Note is what the toast at the job's end says, in place of the usual words
Note string
// Info marks the note as the next step for the user rather than a success, such as a step that the user must take by hand
Info bool
// Result builds the view that replaces the page on the UI loop when the job ends while the page shows, such as a list of the job's
// results. It is nil when the page stays
Result func() wm.Card
// Next is the action that the page offers after the job ends. It is nil when the page offers nothing
Next *Next
}
Outcome is how a job ended.
type Output ¶
type Output interface {
// Line adds a line of output in its tone
Line(text string, tone Tone)
// Status says what the job does now, shown beside a spinner in the hub's foot until the next line or status
Status(text string)
// Table adds rows under their column titles, drawn as a table at the page's width
Table(columns []render.Column, rows [][]string)
// Markdown adds markdown text, such as a file that the job read, drawn formatted at the page's width
Markdown(text string)
// Facts adds labeled values, drawn by render.Facts at the page's width.
Facts(facts []render.Fact)
}
Output is where a job reports its work to the user.
type Owner ¶
Process that runs a session, as the session store names it: its key, empty while none runs it, its pid, its purpose (window, server or command), its computer, and whether it is the process that answers this terminal
type Page ¶
type Page struct {
// What the page is called, and the titles of the pages above it inside the area, outermost first
Title string
Trail []string
// One line saying what is there
About string
// More words a search reads, such as the names of what the page shows
Words string
// Argument the screen opens the area with to show the page, as its Open takes it after the profile. Empty for the area's own page
Argument string
// Keys of the settings the page shows rows or controls of, so a setting found by a search opens the page with its control over it; a
// key ending in a dot stands for every key under it
Keys []string
}
A page inside an area that a search of Settings finds and opens: the area on that page, the keys on it
func Remembered ¶
Pages as last read under the key, read again behind so the next answer is fresh: how Pages answers at once for a screen whose things take time to find, such as places found by probing this computer. The first call for a key waits for its reading. A reading that fails, nil, keeps what was read before
type Picker ¶
type Picker struct {
// Open opens the pick list over the hub
Open func(kit *Kit, hub *cards.Hub, ask Ask) tea.Cmd
// Beside returns the setting keys that one choice sets together with the setting at key: one row shows them all, and their own rows are
// left out. It is nil when each choice sets a single value
Beside func(key string) []string
// Shown returns the row's text for the current values. When it is nil or returns nothing, the row shows the settings service's text
Shown func(ask Ask) string
}
Picker is a screen's picker for every setting with a value of one kind, registered under the kind that those settings give in their Picks.
type Screen ¶
type Screen struct {
ID string
// ID of the command that opens the screen from the palette, the keys and the bar, open.<ID> when empty
Command string
Title string
Short string
// Heading the command palette lists the screen under, one of the Group names, and its place among the screens of that heading,
// lower first. A screen that names no heading is listed under More
Group string
Order int
Slash []string
// More names the screen answers as a slash command, which the slash list, /help and the palette leave out
Aliases []string
Usage string
Keys []string
Actions []keys.Action
Where map[string]string
// Opened once when the app starts
Startup bool
// Listed with its key on an empty screen
Suggest bool
Ready func(kit *Kit) bool
Open func(kit *Kit, argument string) tea.Cmd
// Settings the screen follows by key, each run with the value as YAML once the app starts and again whenever it changes
Follows map[string]func(kit *Kit, value string) tea.Cmd
// Key of the settings section the screen is the page of. The screen is then one area of the settings menu: the palette, its slash
// commands, Kit.Open and the menu itself all show it there, and the palette names it by the trail to it, the menu's name before its own
Area string
// Opens the settings menu on the area with the section key and hands the argument to the page of that area. Only the screen of the
// menu itself has one
Menu func(kit *Kit, area, argument string) tea.Cmd
// Pickers the screen offers every other screen, by the kind of thing each picks
Pickers map[string]Picker
// Pages inside the area the screen is the page of, as a search of Settings finds them: read each time a search starts, off the UI
// thread on a kit Still made as it started, so it may ask a service. The profile is the one whose settings are shown
Pages func(kit *Kit, profile string) []Page
// Runs once as the app starts, for what a screen learns before anyone opens it
Start func(kit *Kit) tea.Cmd
// Values a hole of its usage takes as a user completes its slash line, such as the styles for [name]: called off the UI loop on a kit
// Still made on it, with the hole as the usage names it and the words typed before it. nil for a screen whose holes take anything
Values func(kit *Kit, hole string, words []string) []cards.Offer
// Card of the screen made again for one it made the run before under the key, as the window opens the windows the last run kept: a new
// card, which is handed the state the old one kept (wm.Stateful) before it starts, so the key it has now may differ. nil for a key that
// is not the screen's or a card it makes no more of, such as a window that showed no session. The state is what the old card kept, nil
// for none
Reopen func(kit *Kit, key string, state json.RawMessage) wm.Card
}
type SessionDesk ¶
type SessionDesk interface {
// Opens the session of the profile, the one in use for none, in a window of its own, or focuses the window that shows it
Open(profile, id string) tea.Cmd
// Clones the session of the profile into a new session of this terminal, shown in a window of its own
Clone(profile, id string) tea.Cmd
// One line that says who runs the session when this terminal may not write it, empty when it may. nil owner when the screen read none
RunBy(id string, owner *Owner) string
// The same in a few words, as a list's column says it
Runner(id string, owner *Owner) string
// Whether another terminal holds the session the server runs, so what it asks is that terminal's to answer
HeldElsewhere(id string) bool
// Calls tell on the UI loop each time what the server runs changes, until the function handed back is called
Watch(tell func() tea.Cmd) func()
// Count that moves each time what the server runs or what the windows here show changes
Version() uint64
// Name returns what this terminal calls the session everywhere, from the title and the first message that a screen read for it and from
// the windows' knowledge. It is never empty and never the session's id.
Name(id, title, first string) string
}
What the windows of sessions do for every screen that lists or opens sessions
type Sessioned ¶
type Sessioned interface {
// Id of the session shown, empty before it has one
Session() string
// Profile the session shown runs on, which requests about it name
Profile() string
}
Card that shows one session of the agent, such as a session window
type Shown ¶
type Shown struct{ ID, Profile string }
A session a window shows and the profile it runs on
type Tone ¶
type Tone int
Tone is the kind of a line in a job's output, which sets the line's color.
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
The window of the screens, made and not yet run on a terminal
func New ¶
Makes the window of the screens: its keymap with the action that opens each screen, the places a screen names and the actions it adds, the saved keys over them, and what each screen makes of the first values of the settings it follows. What the keymap refuses of a screen is the error, and no window is made