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
- type Grant
- type Host
- 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
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)
}
Work the launcher does for the terminal UI on the home's gateway owner and its files, outside the wire
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
- i18n.go
- images.go
- inlineimages.go
- language.go
- liveprogress.go
- mailbox.go
- mcpservers.go
- memfacts_linux.go
- memfacts_unix.go
- memwatch.go
- overlay.go
- paint.go
- pastesections.go
- paths.go
- pdfpages.go
- pendinginputs.go
- petview.go
- pickers.go
- processroster.go
- promptstash.go
- promptstash_model.go
- queue.go
- queueslash.go
- reasoning.go
- resizecoalescer.go
- rewind.go
- roomcard.go
- rooms.go
- serverrequests.go
- sessionattach.go
- sessioncard.go
- sessiondelete.go
- sessioninfo.go
- sessionlifecycle.go
- sessionlist.go
- sessionstores.go
- setupflow.go
- setupsection.go
- setupsection_flow.go
- setupsection_model.go
- setupsection_terminal.go
- setupsection_tts.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_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
- 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
- virtualheights.go
- voicekey.go
- wheelaccel.go
- widgetgrid.go
- widgets.go
- widgets_builtin.go
- widgets_gridtest.go
- wirelink.go
- wiretyped.go