Skip to content

App ​

Category: Core

Source: app.dart

Enums ​

AppMode ​

Top-level application mode.

Classes ​

sealed AppEvent ​

Events that flow through the application event bus.

UserSubmit ​

Constructor ​

dart
UserSubmit(this.text)

Properties ​

PropertyTypeDescription
textString

UserCancel ​

UserScroll ​

Constructor ​

dart
UserScroll(this.delta)

Properties ​

PropertyTypeDescription
deltaint

UserResize ​

Constructor ​

dart
UserResize(this.cols, this.rows)

Properties ​

PropertyTypeDescription
colsint
rowsint

App ​

The main application controller.

Ties the terminal, layout, line editor, and agent together using an event-driven architecture. Two independent streams (terminal input and agent output) are merged into a single render cycle so the UI is never blocked.

Constructor ​

dart
App({
    required this.terminal,
    required this.layout,
    required this.editor,
    required this.agent,
    required this._modelId,
    this._manager,
    McpClientPool? mcpPool,
    this._llmFactory,
    GlueConfig? config,
    this._systemPrompt,
    ConversationClientBuilder? settingsClientBuilder,
    Set<String>? extraTrustedTools,
    SessionStore? sessionStore,
    CommandExecutor? executor,
    this._runtimeClose,
    this._runtimeDiff,
    this._runtimeInfo,
    ShellJobManager? jobManager,
    this._startupContinue = false,
    this._startupPrompt,
    this._printMode = false,
    this._jsonMode = false,
    this._resumeSessionId,
    Observability? obs,
    this._debugController,
    SkillRuntime? skillRuntime,
    Environment? environment,
  })

Properties ​

PropertyTypeDescription
terminalTerminal
layoutLayout
editorTextAreaEditor
agentAgentCore

Methods ​

`static Future<App> create({ ​
String? model,
String? reasoning,
String? prompt,
bool printMode = false,
bool jsonMode = false,
String? resumeSessionId,
bool startupContinue = false,
bool debug = false,

})`

Convenience factory that creates a fully wired [App] with real LLM provider and subagent system.

static String buildPrintPrompt({String? prompt, String? stdinContent}) ​

Builds the prompt for print mode by combining stdin content and the user-supplied prompt string. Exposed as a static method for testing.

void requestExit() ​

Request a clean exit. Can be called from signal handlers.

Future&lt;void&gt; run() ​

Run the application event loop.

void shutdown() ​

Cleanly shut down the application.

Released under the MIT License.