artisanal library Core

Artisanal: A polished CLI framework for Dart.

This library provides the core CLI experience, including:

  • Console for rich terminal output and interactive prompts.
  • Verbosity levels for controlling output detail.
  • Unified Terminal abstraction for raw mode and ANSI handling.

Functional Areas

  • I/O: Console provides a high-level API for writing to stdout/stderr, handling verbosity, and running tasks with status indicators.
  • Terminal: Terminal and StdioTerminal handle raw mode, cursor positioning, and input event decoding.
  • Styling: Style and Color provide a fluent API for terminal text formatting (Lip Gloss-inspired).

High-Level I/O

The Console class is the primary entry point for high-level CLI output. It supports:

  • Writing styled text with verbosity awareness.
  • Rendering DisplayComponents (tables, lists, panels).
  • Interactive prompts (confirm, select, input).
  • Task tracking with spinners and progress bars.

Verbosity and Logging

Verbosity levels allow users to control the amount of output produced by your CLI.

  • quiet: Only essential output.
  • normal: Standard output (default).
  • verbose: Detailed information for debugging.
  • debug: Maximum detail, including internal state.

Modular Exports

For specific functionality, you may want to import the modular libraries:

  • package:artisanal/args.dart: Command-line argument parsing and runners.
  • package:artisanal/style.dart: Full Lip Gloss-style styling system.
  • package:artisanal/tui.dart: Interactive TUI framework (Elm Architecture), including the core runtime, key/mouse messages, and replay/trace utilities.
  • package:artisanal/bubbles.dart: Reusable interactive TUI components.
  • package:artisanal/terminal.dart: Unified terminal abstraction and ANSI handling.
  • package:artisanal/uv.dart: Compatibility re-export for UV cell-buffer types.
  • package:artisanal/compat.dart: Backward-compatible shims for prior APIs.
  • package:artisanal/editor_core.dart: Stable low-level text document, state, and viewport primitives for editor integrations.
  • package:artisanal/runtime.dart: Platform-safe core TEA runtime.
  • package:artisanal/text_editing.dart: Focused text input and editor models.
  • package:artisanal/markdown.dart: Focused Markdown-to-ANSI rendering.
  • package:artisanal/git_diff.dart: Focused diff model and review types.
  • package:artisanal/charting.dart, layout.dart, and scoring.dart: focused rendering and utility libraries.
  • package:artisanal/glamour.dart: Glamour-style Markdown rendering.
  • package:ultraviolet/ultraviolet.dart: Low-level cell-buffer rendering engine.

Charting, Liquify adapters, Markdown, scoring, and web helpers are exported directly from this library (package:artisanal/artisanal.dart).

The Console class is the primary entry point for high-level CLI output. It supports:

  • Writing styled text with verbosity awareness.
  • Rendering DisplayComponents (tables, lists, panels).
  • Interactive prompts (confirm, select, input).
  • Task tracking with spinners and progress bars.

Verbosity levels allow users to control the amount of output produced by your CLI.

  • quiet: Only essential output.
  • normal: Standard output (default).
  • verbose: Detailed information for debugging.
  • debug: Maximum detail, including internal state.

Classes

AdaptiveChromaTheme
An adaptive syntax highlighting theme that selects between light and dark variants based on terminal background.
AdaptiveColor
An adaptive color that switches based on terminal background.
Ansi Terminal
Unified ANSI escape sequence constants and utilities.
AnsiColor
An explicit ANSI color code (0-255).
AnsiRenderer
Renders markdown AST nodes to ANSI-styled terminal output.
AnsiRendererOptions
Configuration options for ANSI markdown rendering.
AppliedFileEdit
Result of applying one file's edits.
AreaChartProps
Props for filled area charts.
AsyncSyntaxTreeProvider
Asynchronous backend interface for incremental syntax trees.
AsyncSyntaxTreeSession
Coordinates asynchronous tree builds and rejects stale responses.
AsyncTextSyntaxProvider<State>
Asynchronous syntax provider for parsers that run outside the render loop.
AsyncTextSyntaxSession<State>
Coordinates asynchronous syntax builds and rejects stale responses.
AttachmentPreview
Prepared pixel payload (or failure) for one attachment.
AxisOptions
Axis display options.
BackendTerminal
Terminal implementation that layers ANSI/OSC semantics over a TerminalBackend.
BarChartProps
Props for bar charts.
BaseChartProps
Shared props for full-frame charts.
BasicColor
A color specified as a hex string or ANSI string code.
BayesianScorer
Bayesian fuzzy matcher for command palette.
Block
Block-drawing characters.
Braille
Braille base and bit layout.
BrailleCanvas
A 2x4 sub-cell braille canvas for plotting terminal-native 2D graphics.
BrowserTerminalHostServer
Reusable browser host server for remote TUI sessions.
CanvasCircle
An outlined circle in world coordinates.
CanvasLine
A line between two world-coordinate points.
CanvasPainter
Projects world coordinates onto a high-resolution braille canvas.
CanvasPoint
A point in a canvas's world-coordinate system.
CanvasPoints
A collection of independently projected world-coordinate points.
CanvasRange
A finite range used to project world coordinates onto a terminal canvas.
CanvasRectangle
An outlined rectangle positioned from its bottom-left corner.
CanvasShape
Something that can draw itself through a CanvasPainter.
ChartCanvas
A convenience canvas for rendering charts into UV buffers.
ChartLegendEntry
A single entry in a chart legend.
ChartMargins
Chart content margins in terminal cells.
ChartRamp
Discrete color ramp for mapping normalized 0..1 values to colors.
ChromaTheme
Configuration for syntax highlighting colors.
CodeBlockCommentDelimiters
CodeLanguageProfile
Color Style
Abstract base class for terminal colors.
Colors
Semantic and named color presets.
Command<T> Core
Base command class for Artisanal-style CLI commands.
CommandRunner<T> Core
An Artisanal-inspired wrapper around package:args CommandRunner.
CompleteAdaptiveColor
A color with explicit values for each profile, with light and dark variants.
Components
Higher-level console UI components (Laravel-style).
ComponentTheme
A palette and style bundle for Artisanal's built-in console components.
ConformalRanker
Conformal ranker that assigns distribution-free confidence to rank positions.
Console Core
The main I/O helper for Artisanal-style console output.
DataPoint
A labeled numeric data point.
DataSeries
A named series of Y values for multi-series charts.
DisplayNumberAssigner
Monotonic display-number assigner; reset when the prompt clears.
EditBuffer
EditConflict
Two edits in one file whose ranges overlap.
EditHistoryCheckpoint<Action, State, Marker>
EditHistoryController<Action, State, Marker>
EditorCodeAction
A quick fix, refactor, or source action offered by tooling.
EditorCodeActionProvider
Supplies code actions without coupling editor core to LSP or FFI.
EditorCodeActionRequest
Context passed to a backend-neutral code-action provider.
EditorCodeActionSession
Rejects results superseded by another request or explicit cancellation.
EditorCommand<T>
A stable, discoverable editor operation.
EditorCommandIds
Stable IDs for commands shared by editor hosts.
EditorCommandPalette<T>
UI-agnostic state for an editor command palette.
EditorCommandRegistry<T>
Ordered registry of stable editor commands.
EditorCommentConfig
Versatile language abstraction for the editor core.
EditorCompletionItem
One completion candidate and the edits needed to accept it.
EditorCompletionProvider
Backend-neutral source of editor completions.
EditorCompletionRequest
Immutable completion request in grapheme/document coordinates.
EditorCompletionResult
Result returned by an EditorCompletionProvider.
EditorCompletionSession
Coordinates asynchronous completion requests and rejects stale responses.
EditorCoreConfig
EditorDocumentSnapshot
Serializable editor document state supplied to persistence adapters.
EditorDocumentStore
Persistence boundary for files, databases, browser storage, or remote APIs.
EditorIndentContext
Indent request passed to a language adapter.
EditorKeyBinding
Associates a host-normalized key chord with a command.
EditorKeymap
Ordered keymap with conflict detection.
EditorLanguageAdapter
Adapter that customizes editing behavior per language.
EditorLanguageRegistry
Mutable registry mapping language identifiers to adapters.
EditorPairConfig
Bracket/pair configuration for a language.
EditorPersistenceSession
Coordinates durable saves and recovery while rejecting stale completions.
EditorSelection
External editor selection attached to a prompt.
EditorSelectionPosition
IDE selection ingestion for prompt composers.
EditorSelectionRange
One selected range inside EditorSelection.filePath.
EditorSortLinesArgument
Options supplied to the argument-taking sortSelectedLines command.
EditorState
EditorSyntaxCapture
A query capture mapped to a decoration style.
EditorSyntaxNode
Pure-Dart syntax-tree DTOs for Tree-sitter-style backends.
EditorSyntaxTree
Immutable snapshot of a parsed syntax tree.
EditorWorkAssessment
Feature recommendations derived from an EditorWorkBudget.
EditorWorkBudget
Configurable limits for features whose cost grows with document size.
EditorWrapSelectionArgument
Delimiters supplied to the argument-taking wrapSelection command.
EmbeddedTerminalBackend
Generic embedded backend backed by callbacks and externally supplied streams.
EvidenceEntry
A single piece of evidence contributing to the match score.
FenceLanguageResolver
FileTextEdit
Atomic multi-file edit sets for tooling (formatters, refactors, agents).
FoldRange
Foldable line range (both ends inclusive, 0-based).
FoldState
Collapse state over a fold list.
GaugeChartProps
Props for semicircular gauges.
GaugeThreshold
A gauge threshold stop.
GithubImageReference
GithubMarkdownDetailsSegment
GithubMarkdownSegment
GithubMarkdownTextSegment
GlamourBlockContext
Tracks rendering state for a block-level markdown element.
GlamourBlockStyle
Represents StyleBlock in glamour.
GlamourCodeBlockStyle
Represents StyleCodeBlock in glamour.
GlamourListStyle
Represents StyleList in glamour.
GlamourPrimitiveStyle
Represents StylePrimitive in glamour.
GlamourRenderer
Renders markdown to ANSI using the Glamour theme system.
GlamourTableStyle
Represents StyleTable in glamour.
GlamourTaskStyle
Represents StyleTask in glamour.
GlamourTheme
Configuration for Glamour markdown rendering.
GridOptions
Grid line options.
HeatmapCell
A heatmap cell coordinate (optional convenience type).
HeatmapChartProps
Props for heatmaps.
IncrementalScorer
Incremental scorer that caches previous query results.
InlineAnimation
Lightweight inline animation runner.
InlineAnimationResult<T>
Result metadata for an inline animation operation.
InlineElement
One typed span in a document.
InlineElementStore
Owns a document's live elements: ids, hit-testing, and offset tracking.
InteractiveStyle
Style set for interactive states.
JsonTerminalBackend
Message-oriented backend that speaks the terminal bridge JSON protocol.
Key
Represents a parsed keyboard input event.
Keys
Key constants and utilities for keyboard input handling.
KittyImage
Utilities for the Kitty Graphics Protocol.
Layout
Layout utilities for composing rendered blocks.
LegendOptions
Legend options.
LineChars
Box-drawing and marker characters.
LineChartProps
Props for multi-series line charts.
LiquidTemplate
Convenience wrapper for liquify templates.
MarkdownBlockContext
MarkdownElementStyle
Fine-grained style for a markdown element.
MarkdownRenderer
Renders markdown to ANSI-styled terminal output using standalone functions.
MatchResult
Result of scoring a query against a title.
MediaAttachment
One attached media item bound to an inline element id.
MediaViewerState
State for a modal media viewer.
MemoryEditorDocumentStore
In-memory EditorDocumentStore for tests, examples, and recovery drills.
MultiSeriesBuffer
Manages multiple named TimeSeriesBuffers with a shared window.
NiceScale
Result of computeNiceScale.
NullRenderer
A renderer that discards all output.
OutputTheme Core
Theme configuration for Console output styles.
ParsedSnippet
A parsed snippet: expanded text plus tabstops in document coordinates.
PieChartProps
Props for pie / donut charts.
PieSlice
A labeled slice for pie charts.
PlaceholderTracker
Tracks placeholder ranges across document edits.
ProgramHost
Reusable launch target for a Program.
ProgramHostBinding
Resolved runtime configuration produced by a ProgramHost.
ProgramOptions
Options for configuring the TUI program.
QuadrantCanvas
2×2 sub-pixel quadrant-block canvas for smooth solid lines.
RankConfidence
Confidence level for a ranking position.
RankedItem
A single item in the ranked results.
RankedResults
Result of ranking a set of match results.
RankingSummary
Summary statistics for a ranked result set.
RawModeGuard
Guard object returned by Terminal.enableRawMode.
Renderer
Abstract interface for rendering styled output.
ResponsiveBreakpoints
Configurable responsive thresholds with helpers for breakpoint branching.
ScatterChartProps
Props for scatter charts.
ScatterPoint
An (x, y) point for scatter charts.
SequenceActivation
Activation/deactivation bar marker.
SequenceDiagramOptions
Rendering options.
SequenceDiagramTheme
Theming configuration for sequence diagram rendering.
SequenceFragment
A fragment block (alt/else/loop/end).
SequenceMessage
A message between participants.
SequenceNote
A note displayed over participants.
SequenceParticipant
Immutable participant definition.
SequenceParticipantGroup
A group/box of participants.
SequenceRect
A rect region wrapping messages with a background color.
SequenceStep
A single step in the diagram timeline.
SequenceStepActivation
SequenceStepFragment
SequenceStepMessage
SequenceStepNote
SnippetSession
Ordered tabstop navigation over a ParsedSnippet.
SnippetTabstop
Snippet parsing (${1:default}, $1, $0) with tabstop sessions.
SocketTerminalBackend
Socket-backed backend for remote/shell-mode terminal hosts.
SocketTerminalHostServer
Reusable raw socket host server for remote TUI sessions.
SparklineProps
Props for compact sparklines.
StackedBarChartProps
Props for stacked bar charts.
StdioTerminal
Standard terminal implementation using dart:io.
StdioTerminalBackend
Native stdio backend for BackendTerminal.
StepsResult
Result of a steps workflow operation.
StringRenderer
A renderer that captures output to a string buffer.
StringRenderTarget
Render target that captures output into a raw string.
StringTerminal
A terminal that captures output to a string buffer (for testing).
Style Style
Fluent, chainable style builder for terminal output.
SyntaxHighlighter
SyntaxHighlightSpan
SyntaxTreeEdit
An incremental edit applied to a previous tree snapshot.
SyntaxTreeProvider
Backend interface for incremental syntax trees.
TaskGroupResult
Result of a task group operation.
Terminal Terminal
Abstract terminal interface for all terminal operations.
TerminalBackend
Low-level I/O backend for a terminal host.
TerminalBridge
Bridge controller for embedded terminal hosts such as xterm.js, sockets, or custom UI surfaces.
TerminalBridgeJsonChannel
JSON message channel layered over a TerminalBridge.
TerminalBridgeMessage
JSON-serializable bridge message for remote/browser terminal hosts.
TerminalHostServer
Common lifecycle contract for terminal servers that host programs.
TerminalRenderer
A renderer that outputs to a terminal.
TerminalReportProbe
Best-effort direct /dev/tty report probe.
TerminalReportSnapshot
Parsed terminal report values captured via direct /dev/tty probing.
TextCommandResult
TextCursorCommandResult
TextDecoration
A set of lines painted near terminal text.
TextDecorationRange
TextDiagnosticRange
TextDocument
TextDocumentChange
TextDocumentEditResult
TextEditResult
TextExtmark
TextExtmarkOptions
TextExtmarkPositionRange
TextExtmarksController
TextHighlightRange
TextHitResult
TextLineCommandResult
TextLineDecoration
TextLineStateSnapshot
TextOffsetStateSnapshot
TextPasteChunk
TextPasteChunkStep
TextPasteController
TextPastePlan
TextPasteReference
TextPasteReferenceStore
TextPasteSession
TextPatternDiagnosticRule
TextPosition
TextPositionDiagnosticRange
TextSearchMatch
One match in document coordinates.
TextSearchQuery
Regex-capable find/replace over a TextDocument.
TextSearchResult
Result of findTextSearchMatches.
TextSearchSession
Stateful find-next/previous cursor over a match list.
TextSelection
TextSelectionRange
Multi-selection sets for multi-cursor editing flows.
TextSelectionSet
Sorted, non-overlapping selection ranges with a primary index.
TextStyle Style
An immutable set of text-only terminal style declarations.
TextSyntaxBuildResult<State>
TextSyntaxChangeWindow
TextSyntaxDecorationPatch
TextSyntaxLineWindow
TextSyntaxProvider<State>
TextSyntaxSession<State>
TextSyntaxSnapshot<State>
TextUtf8CoordinateIndex
Reusable UTF-8/grapheme coordinate index for a document snapshot.
TextUtf8Point
A zero-based UTF-8 row and byte-column pair.
TextView
TextViewLine
TextViewport
TextVisualCursorPosition
ThemePalette
A semantic color palette for theming TUI applications.
TimeSeriesBuffer
Sliding-window buffer of timestamped numeric samples.
TimeSeriesBufferOptions
Options for TimeSeriesBuffer / MultiSeriesBuffer.
TrackedPlaceholderRange
Tracked placeholder ranges for prompt composers.
UndoableCommand<State>
A command that knows how to apply and undo its own effect on a mutable state.
UndoCommandJournalEntry
Journal envelope for one command or transaction.
UndoManager<State>
Undo/redo command journal with optional transactional grouping.
UvBufferTarget
Render target that converts Liquify output into a UV Buffer.
UVConsole
UV-powered inline console for professional CLI output.
Validators
Built-in validators for input prompts using Acanthis.
WebSocketTerminalBackend
WebSocket-backed backend that speaks the terminal bridge JSON protocol.
WhitespaceOptions
Options for rendering whitespace in layout functions.
WidgetCatalogEntry
A catalog entry for one reusable Artisanal widget or display component.
WorkspaceEdit
Named file edits applied together.

Enums

AttachmentPreviewStatus
Media attachment lifecycle for prompt composers.
ChartBorderStyle
Optional border style for chart containers (UI chrome).
ChartOrientation
Bar / stacked-bar orientation.
ColorProfile
Color profile indicating terminal color capabilities.
EditorCommandDispatchResult
Result of dispatching a command through EditorCommandRegistry.
EditorCompletionKind
Broad category used to decorate and rank a completion.
EditorDocumentScale
Coarse document-size class used to choose bounded editor strategies.
EvidenceKind
Types of evidence that contribute to match scoring.
FoldKind
Code folding: indent-based ranges plus collapse state.
FontStyle
Whether terminal glyphs use their normal or italic variant.
FontWeight
The terminal-supported intensity of a glyph.
GridStyle
Grid line stroke style.
KeyType
Types of keyboard input events.
LayoutBreakpoint
Breakpoint names for responsive terminal layouts.
LegendPosition
Legend placement relative to the plot.
LineStyle
Line interpolation style for line charts.
MatchType
Type of match between query and title.
MediaAffordance
What the composer may do with an attachment right now.
RankStability
Stability classification for a rank position.
SequenceArrowHead
Arrow head shape.
SequenceFragmentKind
Fragment/loop/alt block kind with default style.
SequenceMessageStyle
Message arrow style with default UV style and arrow character.
SparklineStyle
Compact sparkline rendering style.
TaskResult
Result of a task operation.
TerminalBridgeMessageType
Message kinds used by TerminalBridgeMessage.
TextDecorationLayerKey
TextDecorationStyle
The visual style used for an underline decoration.
TextDiagnosticSeverity
TextPasteMode
TreeStyle
Style presets for tree rendering.
Verbosity
Verbosity levels for console output.

Extensions

DisplayComponentExtension on DisplayComponent
Extension to allow DisplayComponents to be written directly to a Console.
GlamourThemeToOptions on GlamourTheme
Bridge between GlamourTheme and AnsiRendererOptions.
LiquidTemplateExtensions on Template
Convenience extensions on liquify Template for UV buffer rendering.
StyleConvenienceExtensions on Style
Convenience extensions for common semantic styles.
TextLineStateCommandExtensions on TextLineStateSnapshot
TextOffsetStateCommandExtensions on TextOffsetStateSnapshot
TextOffsetStateDocumentEditingExtensions on TextOffsetStateSnapshot

Constants

bracketClosings → const Map<String, String>
Closing brackets understood by the matcher.
bracketOpenings → const Map<String, String>
Structural bracket matching over a TextDocument.
codeSyntaxDecorationPrefix → const String
Syntax highlighter that converts code to ANSI-styled terminal output.
componentThemePresetNames → const List<String>
CLI-friendly names for the built-in ComponentTheme presets.
defaultCodeAutoPairs → const Map<String, String>
defaultCodeClosingToOpening → const Map<String, String>
defaultColors → const List<String>
Default multi-series color palette (hex).
defaultMargins → const ChartMargins
Default chart margins.
inlineElementFileRef → const String
inlineElementImage → const String
Typed inline elements (chips) anchored to document ranges.
inlineElementPaste → const String
pieChars → const List<String>
Alternate pie fill characters.
textActiveLineDecorationKey → const String
textActiveLineDecorationLayerKey → const String
textActiveLineDecorationLayerPriority → const int
textActiveLineNumberDecorationKey → const String
textDefaultDecorationLayerKey → const String
textDefaultDecorationLayerPriority → const int
textDefaultExtmarkType → const String
textDefaultLineDecorationLayerKey → const String
textDefaultLineDecorationLayerPriority → const int
textDiagnosticErrorDecorationKey → const String
textDiagnosticErrorLineDecorationKey → const String
textDiagnosticErrorLineNumberDecorationKey → const String
textDiagnosticHintDecorationKey → const String
textDiagnosticHintLineDecorationKey → const String
textDiagnosticHintLineNumberDecorationKey → const String
textDiagnosticInfoDecorationKey → const String
textDiagnosticInfoLineDecorationKey → const String
textDiagnosticInfoLineNumberDecorationKey → const String
textDiagnosticsDecorationLayerKey → const String
textDiagnosticsDecorationLayerPriority → const int
textDiagnosticsLineDecorationLayerKey → const String
textDiagnosticsLineDecorationLayerPriority → const int
textDiagnosticWarningDecorationKey → const String
textDiagnosticWarningLineDecorationKey → const String
textDiagnosticWarningLineNumberDecorationKey → const String
textSearchActiveMatchDecorationKey → const String
textSearchDecorationLayerKey → const String
textSearchDecorationLayerPriority → const int
textSearchMatchDecorationKey → const String
textSyntaxDecorationLayerKey → const String
textSyntaxDecorationLayerPriority → const int
widgetCatalogCategories → const List<String>
The categories represented by widgetCatalogEntries.
widgetCatalogEntries → const List<WidgetCatalogEntry>
Every built-in Artisanal Bubble and display component in catalog order.

Properties

defaultRenderer ↔ Renderer
Gets the default renderer.
getter/setter pair

Functions

applyFileEdits(String filePath, String text, List<FileTextEdit> edits) → AppliedFileEdit
Applies edits to text, descending by offset.
applyWorkspaceEdit(Map<String, String> files, WorkspaceEdit edit) → Map<String, AppliedFileEdit>
Applies edit to every file in files (missing files count as empty).
bracketPairRange(TextDocument document, int offset) → ({int endOffset, int startOffset})?
Returns the range covering a bracket pair and everything between the brackets (end exclusive, one past the closing bracket), or null when no pair is found at offset.
builtinCodeLanguageProfiles() → List<CodeLanguageProfile>
Builtin language registrations.
clamp01(double value) → double
Clamps value to the range 0..1, treating NaN as 0.
codeBlockNewlineSuffix({required String beforeCursor, required String afterCursor, required String baseIndent}) → ({int consumedColumns, String text})?
codeHandleAutoPair({required TextDocument document, required TextOffsetStateSnapshot state, required CodeLanguageProfile profile, required String typed}) → TextCommandResult
codeHandleClosingDelimiterAlignment({required TextDocument document, required TextOffsetStateSnapshot state, required CodeLanguageProfile profile, required String typed, required int indentWidth}) → TextCommandResult
codeHandlePairBackspace({required TextDocument document, required TextOffsetStateSnapshot state, required CodeLanguageProfile profile}) → TextCommandResult
codeInsertIndentedNewline({required TextDocument document, required TextOffsetStateSnapshot state, required int indentWidth, String? language}) → TextCommandResult
codeLeadingIndent(String line) → String
codeOutdentedIndent(String indent, int width) → String
codeShouldAutoPairSymmetricDelimiter(String text, int offset, {bool hasSelection = false}) → bool
codeShouldAutoPairSymmetricDelimiterInDocument(TextDocument document, int offset, {bool hasSelection = false}) → bool
codeShouldIncreaseIndentAfter(String prefix, {String? language}) → bool
codeShouldIncreaseIndentForAdapter(String prefix, {EditorLanguageAdapter? adapter}) → bool
Adapter-aware indent check. Prefer this over the string-based overload: pass the resolved EditorLanguageAdapter (builtin, Tree-sitter-backed, or custom) instead of a language name.
codeSyntaxDecorationStyleKey(String slot, {String prefix = codeSyntaxDecorationPrefix}) → String
codeToggleBlockComments({required TextDocument document, required TextOffsetStateSnapshot state, required CodeLanguageProfile profile}) → TextCommandResult
componentThemeForName(String name) → ComponentTheme
Returns a built-in component theme by its CLI-friendly name.
computeIndentFolds(List<String> lineTexts, {int tabWidth = 4}) → List<FoldRange>
Computes indent folds over lineTexts.
computeNiceScale(double dataMin, double dataMax, [int maxTicks = 10, int? plotHeight]) → NiceScale
Computes a "nice" axis scale with evenly spaced ticks.
computeTextDocumentChange(String previousText, String nextText) → TextDocumentChange
computeTextDocumentChangeForDocuments({required TextDocument previousDocument, required TextDocument nextDocument}) → TextDocumentChange
createAreaChart(AreaChartProps props) → String
Creates an area chart and returns it rendered as a multi-line string.
createBarChart(BarChartProps props) → String
Creates a bar chart and returns it rendered as a multi-line string.
createGaugeChart(GaugeChartProps props) → String
Creates a gauge chart and returns it rendered as a multi-line string.
createHeatmapChart(HeatmapChartProps props) → String
Creates a heatmap chart and returns it rendered as a multi-line string.
createLineChart(LineChartProps props) → String
Creates a line chart and returns it rendered as a multi-line string.
createPieChart(PieChartProps props) → String
Creates a pie chart and returns it rendered as a multi-line string.
createScatterChart(ScatterChartProps props) → String
Creates a scatter chart and returns it rendered as a multi-line string.
createSparkline(SparklineProps props) → String
Alias for createSparklineChart matching the legacy opentui-charts name.
createSparklineChart(SparklineProps props) → String
Creates a sparkline chart and returns it rendered as a multi-line string.
createStackedBarChart(StackedBarChartProps props) → String
Creates a stacked bar chart and returns it rendered as a multi-line string.
deleteAfterCursor(List<String> graphemes, int cursorOffset) → TextEditResult
deleteBeforeCursor(List<String> graphemes, int cursorOffset) → TextEditResult
deleteNext(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → TextCommandResult
deleteNextDocumentGrapheme(TextDocument document, int cursorOffset) → TextDocumentEditResult
deleteNextGrapheme(List<String> graphemes, int cursorOffset) → TextEditResult
deleteNextOrSelection(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → TextCommandResult
deletePrevious(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → TextCommandResult
deletePreviousDocumentGrapheme(TextDocument document, int cursorOffset) → TextDocumentEditResult
deletePreviousGrapheme(List<String> graphemes, int cursorOffset) → TextEditResult
deletePreviousOrSelection(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → TextCommandResult
deleteSelection(List<String> graphemes, {int? selectionBaseOffset, int? selectionExtentOffset, required int cursorOffset}) → TextCommandResult
deleteSurroundingPair(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required Map<String, String> surroundPairs}) → TextCommandResult
deleteToLineEnd(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required int lineEndOffset}) → TextCommandResult
deleteToLineStart(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required int lineStartOffset}) → TextCommandResult
deleteWordBackward(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required GraphemePredicate isWord}) → TextCommandResult
deleteWordBackwardRange(List<String> graphemes, int offset, {required GraphemePredicate isWord}) → ({int end, int start})
deleteWordBackwardRangeFromReader(int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → ({int end, int start})
deleteWordForward(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required GraphemePredicate isWord}) → TextCommandResult
deleteWordForwardRange(List<String> graphemes, int offset, {required GraphemePredicate isWord}) → ({int end, int start})
deleteWordForwardRangeFromReader(int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → ({int end, int start})
dimFg(String hex, [double factor = 0.4]) → UvStyle
Dims a hex color by factor (0..1) and returns a foreground style.
drawAxes(Screen screen, Rectangle area, int plotX, int plotY, int plotW, int plotH, NiceScale scale, List<String>? labels, UvStyle bg, UvStyle axisColor, AxisOptions? xAxisOpts, AxisOptions? yAxisOpts, GridOptions? gridOpts) → void
Draws axes, ticks, grid, and optional X labels on screen.
drawAxisLabels(Screen screen, Rectangle area, {List<String>? xLabels, List<String>? yLabels, UvStyle style = const UvStyle()}) → void
Draws axis labels along the X and/or Y edges of area.
drawCanvasShapes(Screen screen, Rectangle area, Iterable<CanvasShape> shapes, {CanvasRange xBounds = const CanvasRange(0, 100), CanvasRange yBounds = const CanvasRange(0, 100), UvStyle fallbackStyle = const UvStyle()}) → void
Draws shapes into screen using a braille sub-cell canvas.
drawCrosshair(Screen screen, Rectangle area, int x, int y, {UvStyle style = const UvStyle(), String hChar = '─', String vChar = '│', String intersectionChar = '┼', bool drawOnEmpty = true}) → void
Draws a crosshair overlay at (x, y) within area.
drawGrid(Screen screen, Rectangle area, {int rows = 3, int cols = 3, UvStyle style = const UvStyle(), String hChar = '┄', String vChar = '┆', String intersectionChar = '┼', bool preserveBackground = false}) → void
Draws a grid of horizontal and vertical guide lines within area.
drawGroupedHistogram(Screen screen, Rectangle area, List<List<double>> seriesList, {List<UvStyle> styles = const [UvStyle()], UvStyle axisStyle = const UvStyle(), UvStyle gridStyle = const UvStyle(), UvStyle labelStyle = const UvStyle(), bool showAxis = true, bool showGrid = false, int gridRows = 3, int gridCols = 0, List<String>? xLabels, List<String>? yLabels, String barChar = BlockShades.full, int barGap = 1, int groupGap = 1, int? barWidth, bool drawAxisLine = true}) → void
Draws a grouped (side-by-side) multi-series vertical bar chart.
drawHeatmap(Screen screen, Rectangle area, List<List<double>> grid, {ChartRamp? ramp, bool useBackground = true, String glyph = ' ', bool showGrid = false, int gridRows = 3, int gridCols = 3, UvStyle gridStyle = const UvStyle(), List<String>? xLabels, List<String>? yLabels, UvStyle labelStyle = const UvStyle()}) → void
Draws a heatmap of the 2-D grid values into area on screen.
drawHistogram(Screen screen, Rectangle area, List<double> values, {UvStyle barStyle = const UvStyle(), UvStyle axisStyle = const UvStyle(), UvStyle gridStyle = const UvStyle(), UvStyle labelStyle = const UvStyle(), bool showAxis = true, bool showGrid = false, int gridRows = 3, int gridCols = 0, List<String>? xLabels, List<String>? yLabels, String barChar = BlockShades.full, int barGap = 1, int? barWidth, bool drawAxisLine = true}) → void
Draws a vertical bar histogram of values into area on screen.
drawHLine(Screen screen, Rectangle area, int x1, int x2, int y, UvStyle fg, UvStyle bg, [String char = LineChars.horizontal]) → void
Draws a horizontal line on screen.
drawHorizontalGroupedHistogram(Screen screen, Rectangle area, List<List<double>> seriesList, {List<UvStyle> styles = const [UvStyle()], UvStyle axisStyle = const UvStyle(), UvStyle gridStyle = const UvStyle(), UvStyle labelStyle = const UvStyle(), bool showAxis = true, bool showGrid = false, int gridRows = 0, int gridCols = 3, List<String>? yLabels, String barChar = BlockShades.full, int barGap = 1, int groupGap = 1, int? barWidth, bool drawAxisLine = true}) → void
Draws a grouped multi-series horizontal bar chart.
drawHorizontalStackedHistogram(Screen screen, Rectangle area, List<List<double>> seriesList, {List<UvStyle> styles = const [UvStyle()], UvStyle axisStyle = const UvStyle(), UvStyle gridStyle = const UvStyle(), UvStyle labelStyle = const UvStyle(), bool showAxis = true, bool showGrid = false, int gridRows = 0, int gridCols = 3, List<String>? yLabels, String barChar = BlockShades.full, int barGap = 1, int groupGap = 1, int? barWidth, bool drawAxisLine = true}) → void
Draws a stacked multi-series horizontal bar chart.
drawLegend(Screen screen, Rectangle area, List<ChartLegendEntry> entries, {int columns = 1, int rowGap = 0}) → void
Draws a legend for the given entries within area.
drawLine(Screen screen, Rectangle area, int x0, int y0, int x1, int y1, UvStyle fg, UvStyle bg, [String char = '']) → void
Bresenham line with optional fixed char (else directional box-draw glyphs).
drawLineChart(Screen screen, Rectangle area, List<double> values, {UvStyle lineStyle = const UvStyle(), UvStyle gridStyle = const UvStyle(), UvStyle labelStyle = const UvStyle(), bool showGrid = false, int gridRows = 3, int gridCols = 3, bool showMarkers = false, String markerChar = Circles.filled, String lineChar = DotChars.bullet, List<String>? xLabels, List<String>? yLabels, double? minValue, double? maxValue}) → void
Draws a line chart of values into area on screen.
drawMultiSeriesLineChart(Screen screen, Rectangle area, List<List<double>> seriesList, {List<UvStyle> styles = const [UvStyle()], UvStyle gridStyle = const UvStyle(), UvStyle labelStyle = const UvStyle(), bool showGrid = false, int gridRows = 3, int gridCols = 3, bool showMarkers = false, String markerChar = Circles.filled, List<String>? xLabels, List<String>? yLabels, double? minValue, double? maxValue}) → void
Draws a multi-series line chart into area on screen.
drawPieChart(Screen screen, Rectangle area, List<double> values, {List<UvStyle>? styles, bool useBackground = true, bool donut = false, double innerRadiusRatio = 0.45, double cellAspect = 2.0, String glyph = ' ', int subSamples = 4}) → void
Draws a pie (or donut) chart of values into area on screen.
drawRibbonChart(Screen screen, Rectangle area, List<List<double>> series, {List<UvStyle>? styles, bool normalizeTotals = true, String fillChar = BlockShades.full, bool showGrid = false, int gridRows = 3, int gridCols = 0, UvStyle gridStyle = const UvStyle()}) → void
Draws a stacked ribbon chart of multiple series into area on screen.
drawSequenceDiagram(Canvas canvas, Rectangle area, SequenceDiagram diagram, {SequenceDiagramTheme theme = SequenceDiagramTheme.defaultTheme, SequenceDiagramOptions? options}) → void
Renders a parsed sequence diagram onto a UV Canvas.
drawSparkline(Screen screen, Rectangle area, List<double> values, {UvStyle style = const UvStyle(), bool showGrid = false, UvStyle gridStyle = const UvStyle(), double baseline = 0.0, double? minValue, double? maxValue, UvStyle? gradientLow, UvStyle? gradientHigh}) → void
Draws a compact sparkline of values into area on screen.
drawStackedHistogram(Screen screen, Rectangle area, List<List<double>> seriesList, {List<UvStyle> styles = const [UvStyle()], UvStyle axisStyle = const UvStyle(), UvStyle gridStyle = const UvStyle(), UvStyle labelStyle = const UvStyle(), bool showAxis = true, bool showGrid = false, int gridRows = 3, int gridCols = 0, List<String>? xLabels, List<String>? yLabels, String barChar = BlockShades.full, int barGap = 1, int groupGap = 1, int? barWidth, bool drawAxisLine = true}) → void
Draws a stacked multi-series vertical bar chart.
drawVLine(Screen screen, Rectangle area, int x, int y1, int y2, UvStyle fg, UvStyle bg, [String char = LineChars.vertical]) → void
Draws a vertical line on screen.
duplicateSelectedLinesAbove(List<String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent}) → TextLineCommandResult
duplicateSelectedLinesBelow(List<String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent}) → TextLineCommandResult
editorSelectionKey(EditorSelection? selection) → String
Stable key for dismiss tracking (dismissed context stays cleared until the selection changes again).
editorSelectionRangeLabel(EditorSelectionRange range) → String?
Short #line / #start-end label for a range (single-line ranges show just the line).
expandPlaceholderRanges(String text, List<TrackedPlaceholderRange> ranges) → String
Splices each range's TrackedPlaceholderRange.fullText into text.
expandSearchReplacementTemplate(String template, TextSearchMatch match, String matchedText) → String
Expands $& (whole match) and $1–$99 (groups) in template. Unknown references expand to ''. $$ is an escaped dollar.
extractPastedFilePaths(String text) → List<String>
Extracts file-path candidates from pasted or dropped text.
fg(String hex) → UvStyle
Foreground UvStyle for a hex color.
fillAreaUnderPolyline(Screen screen, Rectangle area, List<(int, int)> points, int baseY, int plotX, int plotY, int plotW, int plotH, UvStyle fillStyle, UvStyle bg, {String fillChar = Block.shadeMedium, List<int>? baselineYs}) → void
Continuous vertical fill under a polyline using shade glyphs.
fillRect(Screen screen, Rectangle area, int x, int y, int w, int h, UvStyle style) → void
Fills a rectangular region on screen with style as the background.
filterEditorCompletions(Iterable<EditorCompletionItem> items, String query) → List<EditorCompletionItem>
Deterministically filters and sorts items for a command palette or popup.
filterWidgetCatalog({String? category, String query = ''}) → List<WidgetCatalogEntry>
Returns catalog entries matching an optional category and fuzzy text query.
findMatchingBracket(TextDocument document, int offset) → int?
Returns the offset of the bracket matching the one at offset.
findTextQueryHighlights({required TextDocument document, required String query, bool caseSensitive = false}) → List<TextHighlightRange>
findTextSearchMatches(TextDocument document, TextSearchQuery query, {int? maxResults}) → TextSearchResult
Finds query in document.
formatEditorSelectionContext(EditorSelection selection) → String
Builds the context block sent with the prompt for selection.
formatNumber(double n) → String
Formats a number for axis labels.
githubDisplayMarkdown(String input) → String
githubDisplayMarkdownSegments(String input) → List<GithubMarkdownSegment>
githubImageReferences(String input) → List<GithubImageReference>
githubStripBlockquoteMarkers(String input) → String
highlightCodeString(String code, {String? language, ChromaTheme? theme}) → String
Highlights code and returns ANSI-styled output.
imageChipText(int displayNumber) → String
Chip text for an attachment. Always path-free: origins appear only in hover/cursor overlays, never in the buffer.
insertAtCursor(List<String> graphemes, int cursorOffset, List<String> inserted) → TextEditResult
insertAutoPair(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required List<String> opening, required List<String> closing}) → TextCommandResult
insertIndentedNewline(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required List<String> baseIndent, List<String> additionalIndent = const <String>[], List<String> trailingSuffix = const <String>[], int trailingSuffixReplaceCount = 0}) → TextCommandResult
insertIntoDocument(TextDocument document, int cursorOffset, List<String> inserted) → TextDocumentEditResult
insertTextAtEachSelection(List<String> graphemes, TextSelectionSet selections, List<String> insertion) → ({List<String> graphemes, TextSelectionSet selections})
Inserts insertion graphemes at every range in selections (ranges collapse to the insertion end). Applies descending; returns the new graphemes and set.
insertTextIntoDocument(TextDocument document, int cursorOffset, String inserted) → TextDocumentEditResult
isDecodableImageBytes(List<int> bytes) → bool
Whether bytes decode as an image (magic-byte probe, not extension).
isImagePath(String path) → bool
File-path recognition for pasted and dropped paths.
isSequenceDiagram(String content) → bool
Returns true if the content starts with sequenceDiagram.
layoutSequenceDiagram(SequenceDiagram diagram, {SequenceDiagramOptions? options}) → LayoutResult
Renders a parsed diagram to text lines.
lerpFg(String a, String b, double t) → UvStyle
Linearly interpolates between two hex colors; returns a foreground style.
lineSnapshotFromEditorState(EditorState editorState, {required int lineCount, required int lineLength(int line), bool preserveCollapsedSelection = false}) → TextLineStateSnapshot
lineSnapshotFromOffsets(TextDocument document, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → TextLineStateSnapshot
mapSelectionEnds(TextSelectionSet selections, {required int mapEnd(int activeOffset, TextSelectionRange range), required bool forward, bool extend = false}) → TextSelectionSet
Moves or extends every range's active edge through mapEnd.
mapSelectionRanges(TextSelectionSet selections, {required TextSelectionRange transform(TextSelectionRange range)}) → TextSelectionSet
Maps each range through transform and rebuilds the set.
markdownToAnsi(String markdown, {AnsiRendererOptions? options}) → String
Converts a markdown string to ANSI-styled terminal text.
mergeStyle(UvStyle fg, UvStyle bg) → UvStyle
Merges foreground and background UvStyles into a combined style.
mergeTextSyntaxDecorationPatch(List<TextDecorationRange> previousDecorations, TextSyntaxDecorationPatch patch) → List<TextDecorationRange>
moveCursorByCharacter(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required bool forward, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult
moveCursorByVisualLine(TextDocument document, EditorState state, TextView view, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required int lineDelta, int desiredDisplayColumn = -1, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult
moveCursorByWord(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required bool forward, required GraphemePredicate isWord, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult
moveCursorToDocumentBoundary(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required bool forward, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult
moveCursorToOffset({required int textLength, required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required int targetOffset, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult
moveCursorToVisualLineBoundary(TextDocument document, EditorState state, TextView view, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required bool end, bool extendSelection = false, bool clearSelection = true, bool preserveCollapsedSelection = false}) → TextCursorCommandResult
moveSelectedLines(List<String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, required int direction}) → TextLineCommandResult
moveWordBackward(List<String> graphemes, int offset, {required GraphemePredicate isWord}) → int
moveWordBackwardFromReader(int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → int
moveWordForward(List<String> graphemes, int offset, {required GraphemePredicate isWord}) → int
moveWordForwardFromReader(int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → int
nextTextPasteChunk({required int totalRunes, required int offset, required int chunkSize}) → TextPasteChunk?
nextWordRange(List<String> graphemes, int offset, {required GraphemePredicate isWord}) → ({int end, int start})?
nextWordRangeFromReader(int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → ({int end, int start})?
normalize(double value, double min, double max) → double
Normalizes value into the 0..1 range between min and max.
normalizedSelectionRange(int? baseOffset, int? extentOffset) → ({int end, int start})?
normalizePromptContent(String content) → String
Prompt-composer content helpers.
normalizeTextDiagnostics(Iterable<TextDiagnosticRange> diagnostics, {int? maxLength}) → List<TextDiagnosticRange>
offsetSnapshotFromEditorState(TextDocument document, EditorState editorState, {required int textLength, bool preserveCollapsedSelection = false}) → TextOffsetStateSnapshot
parseHexColor(String hex, {UvColor fallback = const UvColor.rgb(170, 170, 170)}) → UvColor
Parses a hex color (#RRGGBB or RRGGBB) into a UvColor.
parseMermaidColor(String value) → UvColor?
Parses a Mermaid color token (CSS name, hex, rgb, rgba) into UvColor.
parseSequenceDiagram(String content) → SequenceDiagram?
Parses Mermaid sequence diagram content into a SequenceDiagram record. Returns null if content does not start with sequenceDiagram.
parseSnippet(String source) → ParsedSnippet
Parses source into expanded text and tabstops. Never throws: malformed sequences (${x}, unterminated ${1:) emit literally.
partitionImagePaths(Iterable<String> candidates) → ({List<String> images, List<String> other})
Splits candidates into image paths and everything else.
planTextPaste(String content, {required bool collapseLargePaste, required int collapsedPasteMinChars, required int collapsedPasteMinLines, required int chunkThresholdRunes}) → TextPastePlan
previewWorkspaceEdit(Map<String, String> files, WorkspaceEdit edit, {int contextLines = 3}) → String
Renders a unified-style dry-run preview of edit against files.
previousWordRange(List<String> graphemes, int offset, {required GraphemePredicate isWord}) → ({int end, int start})?
previousWordRangeFromReader(int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → ({int end, int start})?
putText(Screen screen, Rectangle area, int x, int y, String text, UvStyle style) → void
reconcileExternalRecords<V>(Map<int, V> records, Set<int> liveIds) → List<V>
Drops sidecar records whose element id is no longer live.
registerBuiltinEditorLanguages([EditorLanguageRegistry? registry]) → void
Registers the builtin profiles on registry (defaults to the shared registry). Safe to call multiple times.
registerLiquidUiTags({Environment? environment}) → void
Registers Liquid UI tags for terminal layout.
removeDocumentRange(TextDocument document, {required int start, required int end, int? cursorOffset}) → TextDocumentEditResult
removeRange(List<String> graphemes, {required int start, required int end, int? cursorOffset}) → TextEditResult
renderAreaChart(Screen screen, Rectangle area, AreaChartProps props) → void
Renders an area chart onto screen within area.
renderBarChart(Screen screen, Rectangle area, BarChartProps props) → void
Renders a bar chart onto screen within area.
renderChart(int width, int height, ChartPainter painter) → String
Renders a chart using painter at the given width and height, returning the result as a single String with embedded newlines.
renderChartLines(int width, int height, ChartPainter painter) → List<String>
Renders a chart into a list of lines.
renderGaugeChart(Screen screen, Rectangle area, GaugeChartProps props) → void
Renders a gauge chart onto screen within area.
renderHeatmapChart(Screen screen, Rectangle area, HeatmapChartProps props) → void
Renders a heatmap chart onto screen within area.
renderLineChart(Screen screen, Rectangle area, LineChartProps props) → void
Renders a line chart onto screen within area.
renderPieChart(Screen screen, Rectangle area, PieChartProps props) → void
Renders a pie chart onto screen within area.
renderScatterChart(Screen screen, Rectangle area, ScatterChartProps props) → void
Renders a scatter chart onto screen within area.
renderSequenceDiagram(String content, {SequenceDiagramOptions? options, SequenceDiagramTheme? theme, int? maxWidth}) → String
Convenience: renders a Mermaid sequence diagram string to text.
renderSparklineChart(Screen screen, Rectangle area, SparklineProps props) → void
Renders a sparkline chart onto screen within area.
renderStackedBarChart(Screen screen, Rectangle area, StackedBarChartProps props) → void
Renders a stacked bar chart onto screen within area.
renumberNumberedList(List<String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, int startAt = 1}) → TextLineCommandResult
replaceDocumentRange(TextDocument document, {required int start, required int end, List<String> replacement = const <String>[], int? cursorOffset}) → TextDocumentEditResult
replaceDocumentTextRange(TextDocument document, {required int start, required int end, String replacement = '', int? cursorOffset}) → TextDocumentEditResult
replaceRange(List<String> graphemes, {required int start, required int end, List<String> replacement = const <String>[], int? cursorOffset}) → TextEditResult
replaceSelectionOrInsert(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, List<String> replacement = const <String>[], bool replaceSelection = true}) → TextCommandResult
replaceTextSearchMatches(List<String> graphemes, List<TextSearchMatch> matches, List<String> expand(TextSearchMatch match)) → List<String>
Replaces matches in graphemes (e.g. document.flattenWithNewlines()) using expand for each match's replacement graphemes.
resetDefaultRenderer() → void
Resets the default renderer to a new default.
resolveCodeLanguageProfile(String? language) → CodeLanguageProfile
resolveEditorSelectionRange(TextDocument document, EditorSelectionRange range) → ({int endOffset, int startOffset})
Resolves a wire range to clamped document offsets.
resolveExternalEditorExecutable(Map<String, String> environment, {bool isWindows = false, bool allowFallback = true}) → String?
Resolves the external editor executable from environment variables.
resolveMargins(ChartMargins? partial) → ChartMargins
Merges partial margins with defaultMargins.
resolveMediaAffordance({required bool protocolSupported, bool forceTextFallback = false}) → MediaAffordance
Resolves the affordance from capability probes. Hosts read the real probes (ultraviolet terminal capabilities); forceTextFallback covers minimal/scrollback-only modes that never paint pixels.
sampleSeries(List<double> values, int width) → List<double>
Down-samples or up-samples values to fit the given width.
skipClosingDelimiter(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required List<String> closing, bool clearSelection = false}) → TextCursorCommandResult
styleRunes(String s, Style styler(int rune, int index)) → String
Styles individual runes in a string using a styler function.
syncEditorStateFromLineSnapshot(EditorState editorState, TextLineStateSnapshot snapshot, {required int lineCount, required int lineLength(int line)}) → void
syncEditorStateFromOffsets(TextDocument document, EditorState editorState, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset}) → void
syntaxCapturesToRanges(Iterable<EditorSyntaxCapture> captures) → List<({int endOffset, int priority, int startOffset, String? styleKey})>
Maps EditorSyntaxCaptures to core decoration ranges.
syntaxTreeEditsForDocumentChange(TextDocumentChange change) → List<SyntaxTreeEdit>
Converts a document change into the backend-neutral syntax-tree edit shape.
syntaxTreeEditsForReplacement({required int startOffset, required int oldEndOffset, required int newEndOffset}) → List<SyntaxTreeEdit>
Computes the SyntaxTreeEdit list for a single replacement.
textCapitalizeWords(String text) → String
textCleanupWhitespace({required List<String> lines, required TextLineStateSnapshot state, bool trimTrailingBlankLines = true}) → TextLineCommandResult
textCleanupWhitespaceDocument({required TextDocument document, required TextLineStateSnapshot state, bool trimTrailingBlankLines = true}) → TextCommandResult
textCollapsedPasteToken({required int lineCount}) → String
textCountLines(String text) → int
textDeleteLines({required List<String> lines, required TextLineStateSnapshot state}) → TextLineCommandResult
textDeleteLinesDocument({required TextDocument document, required TextLineStateSnapshot state}) → TextCommandResult
textDeleteNext({required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult
textDeletePrevious({required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult
textDeleteSelection({required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult
textDeleteToLineEnd({required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult
textDeleteToLineStart({required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult
textDeleteWordBackward({required TextDocument document, required TextOffsetStateSnapshot state, GraphemePredicate isWord = _isWordGrapheme}) → TextCommandResult
textDeleteWordForward({required TextDocument document, required TextOffsetStateSnapshot state, GraphemePredicate isWord = _isWordGrapheme}) → TextCommandResult
textDiagnosticAtOffset({required List<TextDiagnosticRange> diagnostics, required int offset}) → TextDiagnosticRange?
textDiagnosticContainingIndex({required List<TextDiagnosticRange> diagnostics, required int offset}) → int?
textDiagnosticDecorations(Iterable<TextDiagnosticRange> diagnostics) → List<TextDecorationRange>
textDiagnosticLineDecorations({required String text, required Iterable<TextDiagnosticRange> diagnostics}) → List<TextLineDecoration>
textDiagnosticLineDecorationsForDocument({required TextDocument document, required Iterable<TextDiagnosticRange> diagnostics}) → List<TextLineDecoration>
textDiagnosticLineMarker(TextDiagnosticSeverity severity) → String
textDiagnosticLineNumberStyleKey(TextDiagnosticSeverity severity) → String
textDiagnosticLineStyleKey(TextDiagnosticSeverity severity) → String
textDiagnosticLocationLabel({required String text, required TextDiagnosticRange diagnostic}) → String
textDiagnosticLocationLabelForDocument({required TextDocument document, required TextDiagnosticRange diagnostic}) → String
textDiagnosticNavigationIndex({required List<TextDiagnosticRange> diagnostics, required int cursorOffset, int? activeIndex, bool forward = true, bool wrap = true}) → int?
textDiagnosticSeverityLabel(TextDiagnosticSeverity severity) → String
textDiagnosticsFromPositions({required TextDocument document, required Iterable<TextPositionDiagnosticRange> diagnostics}) → List<TextDiagnosticRange>
textDiagnosticStartPosition({required String text, required TextDiagnosticRange diagnostic}) → TextPosition
textDiagnosticStartPositionForDocument({required TextDocument document, required TextDiagnosticRange diagnostic}) → TextPosition
textDiagnosticStyleKey(TextDiagnosticSeverity severity) → String
textDiagnosticSummaryLabel({required String text, required TextDiagnosticRange diagnostic}) → String
textDiagnosticSummaryLabelForDocument({required TextDocument document, required TextDiagnosticRange diagnostic}) → String
textDuplicateSelectedLinesAbove({required List<String> lines, required TextLineStateSnapshot state}) → TextLineCommandResult
textDuplicateSelectedLinesAboveDocument({required TextDocument document, required TextLineStateSnapshot state}) → TextCommandResult
textDuplicateSelectedLinesBelow({required List<String> lines, required TextLineStateSnapshot state}) → TextLineCommandResult
textDuplicateSelectedLinesBelowDocument({required TextDocument document, required TextLineStateSnapshot state}) → TextCommandResult
textExtmarkPositionRange(TextDocument document, TextExtmark extmark) → TextExtmarkPositionRange
textIndentLines({required List<String> lines, required TextLineStateSnapshot state, int width = 2}) → TextLineCommandResult
textIndentLinesDocument({required TextDocument document, required TextLineStateSnapshot state, int width = 2}) → TextCommandResult
textInsertGraphemes({required TextDocument document, required TextOffsetStateSnapshot state, required List<String> graphemes, bool replaceSelection = true}) → TextCommandResult
textInsertText({required TextDocument document, required TextOffsetStateSnapshot state, required String text, bool replaceSelection = true}) → TextCommandResult
textJoinLines({required List<String> lines, required TextLineStateSnapshot state}) → TextLineCommandResult
textJoinLinesDocument({required TextDocument document, required TextLineStateSnapshot state}) → TextCommandResult
textMoveByCharacter({required TextDocument document, required TextOffsetStateSnapshot state, required bool forward, bool extendSelection = false, bool clearSelection = false}) → TextCursorCommandResult
textMoveByWord({required TextDocument document, required TextOffsetStateSnapshot state, required bool forward, GraphemePredicate isWord = _isWordGrapheme, bool extendSelection = false, bool clearSelection = false}) → TextCursorCommandResult
textMoveSelectedLines({required List<String> lines, required TextLineStateSnapshot state, required int direction}) → TextLineCommandResult
textMoveSelectedLinesDocument({required TextDocument document, required TextLineStateSnapshot state, required int direction}) → TextCommandResult
textMoveToDocumentBoundary({required TextDocument document, required TextOffsetStateSnapshot state, required bool forward, bool extendSelection = false, bool clearSelection = false}) → TextCursorCommandResult
textOffsetForUtf8ByteOffset(TextDocument document, int byteOffset) → int
Converts a UTF-8 byte offset from the document start into a grapheme offset.
textOffsetForUtf8Point(TextDocument document, TextUtf8Point point) → int
Converts a UTF-8 parser point into a grapheme offset.
textOffsetOnAdjacentVisibleLine({required TextDocument document, required int offset, required bool below, int? preferredColumn, TextLineHiddenPredicate? isLineHidden}) → int
Resolves the next visible logical line while retaining a preferred column.
textOutdentLines({required List<String> lines, required TextLineStateSnapshot state, int width = 2}) → TextLineCommandResult
textOutdentLinesDocument({required TextDocument document, required TextLineStateSnapshot state, int width = 2}) → TextCommandResult
textPatternDiagnostics({required String text, required Iterable<TextPatternDiagnosticRule> rules}) → List<TextPositionDiagnosticRange>
textPatternDiagnosticsForDocument({required TextDocument document, required Iterable<TextPatternDiagnosticRule> rules}) → List<TextPositionDiagnosticRange>
textPositionForUtf8Point(TextDocument document, TextUtf8Point point) → TextPosition
Converts a UTF-8 parser point into a grapheme-based document position.
textPrepareInsertedGraphemes(List<int> runes, {required bool multiline, int? maxGraphemes}) → List<String>
textRenumberNumberedList({required List<String> lines, required TextLineStateSnapshot state, int startAt = 1}) → TextLineCommandResult
textRenumberNumberedListDocument({required TextDocument document, required TextLineStateSnapshot state, int startAt = 1}) → TextCommandResult
textSanitizeRunes(List<int> runes, {required bool multiline}) → List<int>
textSanitizeRunesLimited(List<int> runes, {required bool multiline, required int maxOutputCodepoints}) → List<int>
textSearchDecorations(Iterable<TextHighlightRange> matches, {int activeIndex = -1}) → List<TextDecorationRange>
textSortSelectedLines({required List<String> lines, required TextLineStateSnapshot state, bool descending = false, bool caseSensitive = false}) → TextLineCommandResult
textSortSelectedLinesDocument({required TextDocument document, required TextLineStateSnapshot state, bool descending = false, bool caseSensitive = false}) → TextCommandResult
textSplitLine({required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult
textSyntaxChangeWindow({required TextDocument previousDocument, required TextDocument nextDocument, required TextDocumentChange change, int lookBehindLines = 0, int lookAheadLines = 0}) → TextSyntaxChangeWindow
textToggleChecklistState({required List<String> lines, required TextLineStateSnapshot state, String checkedMarker = 'x'}) → TextLineCommandResult
textToggleChecklistStateDocument({required TextDocument document, required TextLineStateSnapshot state, String checkedMarker = 'x'}) → TextCommandResult
textToggleHeadingPrefix({required List<String> lines, required TextLineStateSnapshot state, int level = 1}) → TextLineCommandResult
textToggleHeadingPrefixDocument({required TextDocument document, required TextLineStateSnapshot state, int level = 1}) → TextCommandResult
textToggleLinePrefix({required List<String> lines, required TextLineStateSnapshot state, required String prefix, bool addSpaceWhenNonEmpty = true, bool skipBlankLinesWhenChecking = true}) → TextLineCommandResult
textToggleLinePrefixDocument({required TextDocument document, required TextLineStateSnapshot state, required String prefix, bool addSpaceWhenNonEmpty = true, bool skipBlankLinesWhenChecking = true}) → TextCommandResult
textToggleNumberedList({required List<String> lines, required TextLineStateSnapshot state, int startAt = 1}) → TextLineCommandResult
textToggleNumberedListDocument({required TextDocument document, required TextLineStateSnapshot state, int startAt = 1}) → TextCommandResult
textTransformSelectionOrLine({required TextDocument document, required TextOffsetStateSnapshot state, required String transform(String text)}) → TextCommandResult
textTransformWordOrAdjacent({required TextDocument document, required TextOffsetStateSnapshot state, required String transform(String text)}) → TextCommandResult
textTransposeBackward({required TextDocument document, required TextOffsetStateSnapshot state}) → TextCommandResult
textUnwrapSelection({required TextDocument document, required TextOffsetStateSnapshot state, required Map<String, String> surroundPairs}) → TextCommandResult
textUtf8ByteOffsetForOffset(TextDocument document, int offset) → int
Converts a grapheme offset from the document start into a UTF-8 byte offset.
textUtf8PointForOffset(TextDocument document, int offset) → TextUtf8Point
Converts a grapheme offset into a zero-based UTF-8 parser point.
textUtf8PointForPosition(TextDocument document, TextPosition position) → TextUtf8Point
Converts a document position into a zero-based UTF-8 parser point.
textWrapSelection({required TextDocument document, required TextOffsetStateSnapshot state, required String before, String? after}) → TextCommandResult
toggleChecklistState(List<String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, String checkedMarker = 'x'}) → TextLineCommandResult
toggleDelimitedSegment(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required int rangeStartOffset, required int rangeEndOffset, required String startDelimiter, required String endDelimiter}) → TextCommandResult
toggleHeadingPrefix(List<String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, int level = 1}) → TextLineCommandResult
toggleLinePrefix(List<String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, required String prefix, bool addSpaceWhenNonEmpty = true, bool skipBlankLinesWhenChecking = true}) → TextLineCommandResult
toggleNumberedList(List<String> lines, {required TextPosition cursor, TextPosition? selectionBase, TextPosition? selectionExtent, int startAt = 1}) → TextLineCommandResult
transformSelectionOrLine(List<String> graphemes, {required int cursorOffset, required int lineStartOffset, required int lineEndOffset, int? selectionBaseOffset, int? selectionExtentOffset, required String transform(String text)}) → TextCommandResult
transformWordOrAdjacent(List<String> graphemes, {required int cursorOffset, required GraphemePredicate isWord, required String transform(String text)}) → TextCommandResult
unwrapSelection(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required Map<String, String> surroundPairs}) → TextCommandResult
uvColorFromHex(String hex, {UvColor fallback = const UvBasic16(7)}) → UvColor
Parses a hex color string (e.g. '#ff0000') into a UvColor.
uvStyleFromHex(String hex, {String? backgroundHex, int attrs = 0}) → UvStyle
Creates a UvStyle from hex color strings for foreground and optional background.
validateFileEdits(String filePath, List<FileTextEdit> edits) → List<EditConflict>
Returns the overlap conflicts in edits for filePath (empty = clean).
wordRangeForTransform(List<String> graphemes, int offset, {required GraphemePredicate isWord}) → ({int end, int start})?
wordRangeForTransformFromReader(int length, int offset, {required GraphemePredicate isWord, required GraphemeReader graphemeAt}) → ({int end, int start})?
wrapSelection(List<String> graphemes, {required int cursorOffset, int? selectionBaseOffset, int? selectionExtentOffset, required List<String> before, List<String>? after}) → TextCommandResult

Typedefs

BrowserTerminalSessionHandler = Future<void> Function(WebSocket socket)
Session handler invoked for each accepted browser websocket connection.
ChartPainter = void Function(Screen screen, Rectangle area)
Signature for chart painters.
EditHistoryCoalescePredicate<Action, State, Marker> = bool Function(Action action, {required State currentState, required Action? lastAction, required Marker? lastMarker})
EditHistoryMarkerBuilder<Action, State, Marker> = Marker Function(Action action, State state)
EditHistoryStateEquals<State> = bool Function(State a, State b)
EditorCommandArgumentHandler<T> = bool Function(T target, Object? argument)
Executes an editor command with a host-supplied argument such as insert text.
EditorCommandHandler<T> = bool Function(T target)
Executes an editor command against target.
EditorCommandPredicate<T> = bool Function(T target)
Decides whether an editor command is currently available.
EditorRangeResolver = TextSelectionSet Function(TextDocument document, TextSelectionSet current)
Produces a new selection set from the document and current selections.
GraphemePredicate = bool Function(String grapheme)
GraphemeReader = String? Function(int offset)
LayoutResult = ({int height, List<String> lines, int width})
Layout result with text lines and dimensions.
MarkdownBlockHandler = String? Function(MarkdownBlockContext context)
ProgramHostResolver = ProgramHostBinding Function(ProgramOptions options)
Resolves a reusable launch target for a Program.
ReadLine = String? Function()
Callback for reading a line of input.
SecretReader = String Function(String prompt, {String? fallback})
Callback for reading secret/password input without echo.
SequenceDiagram = ({Map<String, UvStyle> actorStyles, List<SequenceParticipantGroup> groups, List<SequenceMessage> messages, List<SequenceParticipant> participants, List<SequenceRect> rects, List<SequenceStep> steps})
Parsed sequence diagram data.
SocketTerminalSessionHandler = Future<void> Function(Socket socket)
Session handler invoked for each accepted raw socket terminal connection.
TerminalDimensions = ({int height, int width})
Terminal dimensions expressed in cells.
TextLineHiddenPredicate = bool Function(int line)
Reports whether a logical document line is hidden from vertical movement.
UndoCommandDecoder<State> = UndoableCommand<State> Function(String type, Map<String, Object?> payload)
WriteLine = void Function(String line)
Callback for writing a complete line to output.
WriteRaw = void Function(String line)
Callback for writing raw text (without newline) to output.