Documentation
¶
Index ¶
Constants ¶
const AutoModeIcon = "▸"
AutoModeIcon marks auto mode across all surfaces (banner, entry log, exit log). Small right-triangle — reads as "play / run" without the visual weight of the full ▶. Visually distinct from PlanModeIcon (◈) so users glance and know which mode is on.
const PlanModeIcon = "◈"
PlanModeIcon is the glyph that marks plan mode across all surfaces (banner, entry log, resume log, exit log, plan-file lines, approval card title). Single source of truth so changing the icon is one edit. Diamond-with-dot — reads as "marked / centered intent" without the edit-mode overtones the literal pencil glyph carries.
const YoloModeIcon = "⚠"
YoloModeIcon marks the permissions-bypass overlay across all surfaces. Warning sign — signals "this is the danger setting" visually before any text is read. Red color reinforces the meaning.
Variables ¶
This section is empty.
Functions ¶
func HighlightCode ¶
HighlightCode runs source through chroma and returns ANSI-colored text. languageHint can be a chroma lexer name ("go", "python") or empty; in either case the helper does its best to detect from content if the hint doesn't match a known lexer. Falls back to plain text when chroma can't tokenize.
Used by the approval modal renderers to make code review easier: the user sees keywords / strings / comments in distinct colors rather than a wall of monochrome text.
func HighlightFromPath ¶
HighlightFromPath is the convenience form: derive the language hint from the file extension, then highlight. Used by approval renderers that have a path on hand (edit_file, write_file).
Types ¶
type Config ¶
type Config struct {
Cfg agent.LoopConfig
Session *session.Session
Permissions *permissions.Permissions
Recall *recall.Index // optional; nil disables /recall
ModelName string
BaseURL string
APIKey string
Provider string
// ProviderLabel is the catalog identity ("nvidia-nim", "xai") of
// the active profile, surfaced in the status bar instead of the
// generic dispatch tag (Provider). Populated by Run() from the
// loaded config; leave empty when no profile is matched and the
// renderer falls back to Provider.
ProviderLabel string
ReasoningEffort string
EnableWebSearch bool
DisableWebSearch bool
EnableXSearch bool
EnableCodeInterpreter bool
SearchAllowedDomains string
SearchExcludedDomains string
XSearchAllowedHandles string
XSearchExcludedHandles string
XSearchFromDate string
XSearchToDate string
ProviderProfile adapter.ProviderProfile
Cwd string
// BypassPermissions auto-approves every tool call. DANGEROUS — see
// the flag help on --dangerously-skip-permissions. Explicit `deny`
// rules in .yottacode/permissions.json still apply.
BypassPermissions bool
Version string // e.g. "0.3.0" — shown in the header
Commit string // short SHA the binary was built from; "" when unknown (go run, tarball)
Dirty bool // true when the build had uncommitted changes; renders a "*" beside the commit
Branch string // current git branch (empty if not in a repo)
MemorySummary string // "USER", "YOTTA", "USER+YOTTA", "UMEM", "USER+UMEM", or "" if none
BaseSystemPrompt string // pre-memory prompt — needed by /memory reload to recompose
// FileCfg holds tunables loaded from ~/.yottacode/config.toml
// (context watermarks, retrieval). The TUI reads these at session
// start and re-reads them on /memory reload.
FileCfg config.Config
// Subagents is the session task registry the /subagents slash
// command inspects. Populated by run.go alongside Agent tool
// registration; nil disables /subagents (tests that don't wire
// subagents in are still valid).
Subagents *subagents.Registry
// AgentTool is the dispatch tool registered on Cfg.Registry. The
// TUI keeps a typed reference so the slash command can introspect
// the resolved agent list, and so the background-done callback
// can be wired to push events onto the model's session inbox.
AgentTool *agent.AgentTool
// CustomCommands is the set of user-authored slash commands
// loaded from ~/.yottacode/commands/ and <cwd>/.yottacode/commands/
// at startup. New() builds slashCommand entries from these and
// stores them on the Model so the dispatcher and /help can see
// them alongside built-ins.
CustomCommands []usercmd.Command
}
Config carries everything Run needs to build a Model. Bundling these into a struct is just ergonomics — there are too many fields for a positional argument list to stay readable.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubbletea state for the chat TUI. The TUI runs in inline mode (no alt-screen): conversation lines flow into the terminal's native scrollback via tea.Println, while only the live footer (input box + status bar + transient overlays) redraws in place at the bottom. This means the terminal — not the app — owns history, so native selection, scroll-wheel, and copy work end-to-end.
Source Files
¶
- approval_modal.go
- auto_mode_render.go
- cheatsheet.go
- checkpoints_picker.go
- cmd_auto.go
- cmd_custom.go
- cmd_filerefs.go
- cmd_init.go
- cmd_memory.go
- cmd_model.go
- cmd_permissions.go
- cmd_plan.go
- cmd_provider.go
- cmd_retrieval.go
- cmd_setup.go
- cmd_subagents.go
- cmd_summarize.go
- cmd_yolo.go
- commands.go
- connection.go
- diff.go
- events.go
- filepalette.go
- highlight.go
- markdown.go
- menu_render.go
- model.go
- model_picker.go
- openai_auth_inline.go
- palette.go
- plan_mode_render.go
- plans_picker.go
- provider_picker.go
- run.go
- run_bash_approval.go
- sessions_picker.go
- startup.go
- styles.go
- subagent_card.go
- subagents_picker.go
- tool_card.go
- watermark.go
- welcome.go
- write_file_approval.go
- yolo_mode_render.go