import type { NodeMeta } from '../../../core/canvas/types.js'; import type { BrokerSnapshot } from '../../../core/runtime/broker-protocol.js'; import type { AttachPalette } from '../config.js'; import type { BashMode } from '../chrome/status-line.js'; import type { AttachSession } from './context.js'; /** Derive the shell-mode cue from the editor contents. Leading whitespace is * ignored so pasted commands and indented text still toggle correctly. */ export declare function deriveBashMode(text: string): 0 | 1 | 2; /** Resolve the editor border + title-chip styles for the current shell cue. */ export declare function resolveEditorFrameStyles(bashMode: 0 | 1 | 2, thinkingLevel: BrokerSnapshot['state']['thinkingLevel'] | undefined, pal: Pick): { borderColor: (s: string) => string; titleStyle: (s: string) => string; }; export interface EditorChromeHooks { /** The viewer's live node identity — a `let` runAttach owns and refreshes * (remote attach starts without one), so it MUST stay a getter. */ nodeIdentity: () => Pick | undefined; /** The engine's current thinking level, from live session state. */ thinkingLevel: () => BrokerSnapshot['state']['thinkingLevel'] | undefined; /** Repaint the status line — the bash-level segment tracks `bashMode`. */ renderFooter: () => void; /** Editor text changed — lets the command-preview inventory stay in sync. */ onTextChange: (text: string) => void; } export interface EditorChrome { /** Current shell/bash level, for the status line's segment. */ bashMode: () => BashMode; /** The `/color` override for the name chip — null restores the default. */ setChipColor: (color: string | null) => void; /** Repaint the editor border + title chip from current bash/thinking state. */ paintFrame: () => void; /** Normalize pi's session name into the title chip. */ setTitle: (sessionName: string | undefined) => void; /** Repaint the bottom-right cwd + persona badge. */ syncContextBadge: () => void; /** Kick an async git-status fetch that repaints the top border. */ pollGit: () => void; } /** The editor-chrome collaborator: owns the shell/bash level (`deriveBashMode` * over `editor.onChange` is its ONE writer) and the `/color` chip override, * and paints every frame-attached adornment — border hue, title chip, context * badge, and git context. */ export declare function createEditorChrome(ctx: Pick, hooks: EditorChromeHooks): EditorChrome;