Documentation
¶
Index ¶
- Constants
- Variables
- func BuildPreview(text string, width int) string
- func OpenWidget(ctx context.Context, id string, state any) bool
- func RegisterWidget(w Widget) error
- func Run(ctx context.Context, host Host) int
- func TakeAfterExit() ([][]string, error)
- type Grant
- type Host
- type Prefs
- type PromptStash
- func (s *PromptStash) Clear()
- func (s *PromptStash) ClosePanel()
- func (s *PromptStash) ComposerHint() string
- func (s *PromptStash) DeleteAtCursor() bool
- func (s *PromptStash) Indicator() string
- func (s *PromptStash) Items() []StashEntry
- func (s *PromptStash) Len() int
- func (s *PromptStash) MoveCursor(delta int) int
- func (s *PromptStash) OpenPanel() bool
- func (s *PromptStash) PanelRows() []map[string]any
- func (s *PromptStash) Peek(index int) (StashEntry, bool)
- func (s *PromptStash) Pop(index int) (string, []any, bool)
- func (s *PromptStash) RestoreAtCursor() (string, []any, bool)
- func (s *PromptStash) Stash(text string, images []any) bool
- type SnapshotRestore
- type StashEntry
- type StashPayload
- type Widget
- type WidgetFrame
- type WidgetInput
- type WidgetLine
- type WidgetLoadFailure
- type WidgetSpan
- type WidgetView
- type Worktree
Constants ¶
const ( PromptStashPreviewWidth = 60 MaxStashItems = 20 ActionNoop = "noop" ActionStashed = "stashed" ActionRestored = "restored" ActionOpenPanel = "open_panel" ActionClosePanel = "close_panel" )
Variables ¶
var ClipboardImage func(dest string) bool
Saves the clipboard image of the host to a PNG file, false when the clipboard holds none
var ClipboardImageBlocker func() (missing string, noDesktop bool)
Program this host lacks to read clipboard images, or that no desktop clipboard is reachable
var PluginWidgets func(ctx context.Context) []Widget
Widgets the plugins of the profile registered, read each time the list is asked for, assigned where the plugin manager is wired
var ScanPluginWidgets func(ctx context.Context, force bool) ([]Widget, []WidgetLoadFailure)
Widgets the plugins of the profile register and the plugins that failed to load, after a scan of the plugins that is forced anew when asked or else runs only the first time, assigned where the plugin manager is wired
var SpeechOutput struct { Play func(path string) bool Stop func() StartThinking func(ctx context.Context, shouldPlay func() bool) bool StopThinking func() }
Speech output of this window, bound by the tier that carries voice and unset in a build without it
Functions ¶
func BuildPreview ¶
Collapses a multi line draft into one preview line ellipsized to width runes
func OpenWidget ¶
Opens the widget of an id in place of the modal one whose input function is running, with a state that needs no argument to parse, false outside such a call and for an id no widget has
func RegisterWidget ¶
Adds a widget compiled into the binary, refusing one without an id or a render function
func Run ¶
Runs the terminal UI, prints the session summary when it ends and returns the exit status
func TakeAfterExit ¶
TakeAfterExit returns the commands this window queued to run once the terminal UI has exited and empties its queue
Types ¶
type Grant ¶
type Grant struct {
URL string
Protocols []string
ProfileID string
InstanceID string
// Build of an idle gateway the attach replaced by one of this build, empty when none was
Replaced string
}
Private WebSocket target of the home's gateway owner the terminal UI attaches with
type Host ¶
type Host struct {
Attach func(ctx context.Context, start, recover bool) (Grant, error)
RestoreSnapshot func(ctx context.Context, id, session string, handoff bool, release func()) SnapshotRestore
SettleWorktrees func(ctx context.Context, trees []Worktree, active string)
// Stops the home's background service of another build so the next attach starts one of this build, nil where the launcher cannot
ReplaceOwner func(ctx context.Context) error
// Settings of the window the launcher resolved for the home, the built-in defaults when nil
Prefs *Prefs
}
Work the launcher does for the terminal UI on the home's gateway owner and its files, outside the wire
type Prefs ¶
type Prefs struct {
// Theme the profile sets at launch: auto, light or dark; light and dark pin the mode before the background service answers
Theme string
// Window animations turned off
ReducedMotion bool
// Rows one wheel step scrolls before it speeds up
ScrollSpeed float64
// Termux layout defaults apply when the window runs inside Termux
TermuxLayout bool
// Longest wait for the background service to answer a request
RequestTimeout time.Duration
// Longest wait for the background service to be ready
StartupTimeout time.Duration
// Destructive commands run without their confirmation
NoConfirm bool
// Copies always (true) or never (false) go through the terminal's clipboard sequence, nil deciding by the connection
ClipboardSequence *bool
// File the CPU profile goes to, empty for none
CPUProfile string
// Frame rate readout over the window
FrameRate bool
// Timing log of the slow frames
FrameLog bool
// Frames drawn faster than this stay out of the timing log
FrameLogFloor time.Duration
// File of the timing log, empty for perf.log in the icebath folder
FrameLogFile string
// Folder the memory dumps go to, empty for heapdumps in the icebath folder
HeapDumpDir string
// Memory watchdog writes whole heap profiles and not the facts alone
AutoHeapProfile bool
// Bytes the memory dump folder may hold
HeapDumpMaxBytes int64
// Shortest wait between two automatic memory dumps
HeapDumpCooldown time.Duration
// Memory dump written as soon as the window starts
HeapDumpOnStart bool
}
Settings of the window itself, resolved by the launcher before the background service answers since the terminal UI reads no settings of its own
type PromptStash ¶
type PromptStash struct {
PanelOpen bool
PanelCursor int
// contains filtered or unexported fields
}
Session scoped newest first stack of parked composer drafts
func NewPromptStashWith ¶
func NewPromptStashWith(maxItems int, clock func() float64) *PromptStash
Stash capped at maxItems, at least one, stamping entries with clock
func (*PromptStash) Clear ¶
func (s *PromptStash) Clear()
func (*PromptStash) ClosePanel ¶
func (s *PromptStash) ClosePanel()
func (*PromptStash) ComposerHint ¶
func (s *PromptStash) ComposerHint() string
Composer hint advertising the stashed drafts
func (*PromptStash) DeleteAtCursor ¶
func (s *PromptStash) DeleteAtCursor() bool
Deletes the highlighted entry, closing the panel once empty, false when nothing was stashed
func (*PromptStash) Indicator ¶
func (s *PromptStash) Indicator() string
Status bar pin with the count, an up arrow while browsing, empty when nothing is stashed
func (*PromptStash) Items ¶
func (s *PromptStash) Items() []StashEntry
Newest first copy of the entries
func (*PromptStash) Len ¶
func (s *PromptStash) Len() int
func (*PromptStash) MoveCursor ¶
func (s *PromptStash) MoveCursor(delta int) int
Moves the panel cursor by delta clamped to the list bounds
func (*PromptStash) OpenPanel ¶
func (s *PromptStash) OpenPanel() bool
Opens the browse panel at the top, false when nothing is stashed
func (*PromptStash) PanelRows ¶
func (s *PromptStash) PanelRows() []map[string]any
func (*PromptStash) Peek ¶
func (s *PromptStash) Peek(index int) (StashEntry, bool)
func (*PromptStash) Pop ¶
func (s *PromptStash) Pop(index int) (string, []any, bool)
Removes and returns the text and images at index, ok false when out of range
func (*PromptStash) RestoreAtCursor ¶
func (s *PromptStash) RestoreAtCursor() (string, []any, bool)
Pops the highlighted entry and closes the panel
type SnapshotRestore ¶
Outcome of a quick snapshot restore, the lines to show and whether the socket was released for it
type StashEntry ¶
One parked draft with its exact text and attached images
func (StashEntry) AsDict ¶
func (e StashEntry) AsDict() map[string]any
Row the stash panel renderer consumes, images copied
type StashPayload ¶
Restored draft of a ctrl s press
func ResolveCtrlS ¶
func ResolveCtrlS(s *PromptStash, bufferText string, images []any) (string, *StashPayload)
Action one ctrl s press takes, with the restored draft for a restore
type Widget ¶
type Widget struct {
ID string
Help string
Usage string
// Modal takes the keys in a window over the session, ambient sits in a zone beside the transcript
Mode string
// One of top-left, top-right, bottom-left, bottom-right, dock-top, dock-bottom
Zone string
Width int
// Interval at which Tick advances the state of an animated widget, zero for a still one
Every time.Duration
// Rows the window of a modal widget asks for at a width, six tenths of the screen when the widget has no say
Rows func(state any, cols int) int
// Step a modal widget takes back at the close key before its window closes, false once it has none left
Back func(ctx context.Context, state any) (next any, stepped bool, err error)
Open func(ctx context.Context, arg string) (state any, ok bool, err error)
Input func(ctx context.Context, state any, in WidgetInput) (next any, open bool, err error)
Tick func(ctx context.Context, state any) (next any, err error)
Render func(ctx context.Context, frame WidgetFrame) (WidgetView, error)
}
Widget the terminal UI shows from its slash command, built in or provided by a plugin
type WidgetFrame ¶
Size and state a widget renders for
type WidgetInput ¶
One key press or text input delivered to a modal widget
type WidgetLoadFailure ¶
Plugin that failed to load at a scan, with the reason
Source Files
¶
- agentroster.go
- app.go
- arenafeed.go
- backgroundsessions.go
- bannerart.go
- batterypoll.go
- bootstrap.go
- canonical.go
- canonicalcontrols.go
- canonicalevents.go
- clipboard.go
- colortones.go
- completion.go
- composerio.go
- composertokens.go
- configsync.go
- content.go
- controlbars.go
- cpuprofile.go
- details.go
- dialogs.go
- editor.go
- eventdispatch.go
- eventhandler.go
- eventhelpers.go
- exitsummary.go
- framemeter.go
- fuzzyscore.go
- gateway.go
- gatewaylog.go
- gatewayrecovery.go
- gitbranch.go
- heapdump.go
- history.go
- hub_afterexit.go
- hub_approvals.go
- hub_chatapps.go
- hub_command_args.go
- hub_cron.go
- hub_fallback.go
- hub_firstrun.go
- hub_help.go
- hub_hooks.go
- hub_kanban.go
- hub_kit.go
- hub_logins.go
- hub_mcp.go
- hub_memory.go
- hub_mixes.go
- hub_plugins.go
- hub_profiles.go
- hub_projects.go
- hub_secrets.go
- hub_session_options.go
- hub_sessions.go
- hub_settings.go
- hub_setup.go
- hub_system.go
- hub_vault.go
- i18n.go
- images.go
- inlineimages.go
- language.go
- liveprogress.go
- mailbox.go
- memfacts_linux.go
- memfacts_unix.go
- memwatch.go
- messages.go
- overlay.go
- paint.go
- pastesections.go
- paths.go
- pdfpages.go
- pendinginputs.go
- petview.go
- pickers.go
- placedimages.go
- processroster.go
- promptstash.go
- promptstash_model.go
- queue.go
- queueslash.go
- reasoning.go
- resizecoalescer.go
- rewind.go
- roomcard.go
- rooms.go
- runcommand.go
- serverrequests.go
- sessionattach.go
- sessioncard.go
- sessiondelete.go
- sessioninfo.go
- sessionlifecycle.go
- sessionlist.go
- sessionstores.go
- shell.go
- slash.go
- slash_agents.go
- slash_args.go
- slash_commands.go
- slash_control.go
- slash_debug.go
- slash_handoff.go
- slash_hatch.go
- slash_journey.go
- slash_keys.go
- slash_lane.go
- slash_pet.go
- slash_profiles.go
- slash_recovery.go
- slash_screen.go
- slash_session.go
- slash_snapshot.go
- slash_tools.go
- slash_usage.go
- slash_wm.go
- slash_worktree.go
- spawntree.go
- speechplayer.go
- subagent_key.go
- submissioncore.go
- subscriptions.go
- terminals.go
- terminalsetup.go
- text.go
- theme.go
- themeboot.go
- themesync.go
- tier_surfaces.go
- transcript.go
- transcriptlines.go
- transcriptparts.go
- transcriptview.go
- turncontroller.go
- turnstore.go
- turnsummary.go
- usagegauge.go
- usermessages.go
- viewmode.go
- virtualheights.go
- voicekey.go
- wheelaccel.go
- widgetgrid.go
- widgets.go
- widgets_builtin.go
- widgets_gridtest.go
- wirelink.go
- wiretyped.go