xonecas.io
64875
Mc

mini-coder / commit 43c7916

feat: add read and grep tools and improve streaming rendering

xonecas2026-04-18 43c7916e8e2a60eeb4ad59fe061a173d71aca39c parent 284206f

29 files changed

This diff is too big to show in full. The first 1000 lines are below, and every file is listed with its counts.

.agents/skills/cel-tui/SKILL.md+289−0
@@ -0,0 +1,289 @@
1+---
2+name: cel-tui
3+description: Build terminal user interfaces with cel-tui, a TypeScript TUI framework. Use when the user wants to create a TUI app, build a terminal UI, render text in the terminal, create a CLI with interactive elements, build a chat interface, text editor, or any interactive terminal application. Triggers include "build a TUI", "terminal UI", "interactive CLI", "text-based interface", "render to terminal", or any task requiring a programmatic terminal user interface.
4+license: MIT
5+compatibility: Requires Bun runtime. Best experience on Kitty-compatible terminals and in tmux with `set -s extended-keys on`; uses SGR mouse mode and accepts recoverable legacy key encodings when hosts do not preserve a pure Kitty stream.
6+metadata:
7+ author: sacenox
8+ version: "0.7.2"
9+---
10+
11+# Building TUIs with cel-tui
12+
13+cel-tui is a TypeScript TUI framework with a declarative functional API, flexbox layout, cell-buffer rendering, style inheritance, and Kitty-first keyboard input. It has 4 primitives and external state management.
14+
15+## Terminal compatibility
16+
17+- **First-class:** Kitty-compatible terminals
18+- **First-class:** `tmux` with `set -s extended-keys on`
19+- **Best effort:** legacy terminals or multiplexers that collapse some modifier distinctions
20+
21+cel-tui enables Kitty level 1 for full modifier fidelity, but it also accepts recoverable legacy control bytes and ESC-prefixed Alt combinations so common keyboard flows keep working in tmux and mixed environments.
22+
23+## Install
24+
25+```bash
26+bun add @cel-tui/core
27+# Optional pre-made components
28+bun add @cel-tui/components
29+```
30+
31+## Core Pattern
32+
33+Every cel-tui app follows this structure:
34+
35+```ts
36+import {
37+ cel,
38+ VStack,
39+ HStack,
40+ Text,
41+ TextInput,
42+ ProcessTerminal,
43+} from "@cel-tui/core";
44+
45+let value = "";
46+
47+cel.init(new ProcessTerminal());
48+cel.viewport(() =>
49+ VStack(
50+ {
51+ height: "100%",
52+ onKeyPress: (key) => {
53+ if (key === "ctrl+q") {
54+ cel.stop();
55+ process.exit();
56+ }
57+ },
58+ },
59+ [
60+ Text("My App", { bold: true, fgColor: "color06" }),
61+ Text("─", { repeat: "fill" }),
62+ TextInput({
63+ flex: 1,
64+ value,
65+ onChange: (v) => {
66+ value = v;
67+ cel.render();
68+ },
69+ }),
70+ ],
71+ ),
72+);
73+```
74+
75+The steps: `cel.init(terminal)` → `cel.viewport(() => tree)` → mutate state + `cel.render()`.
76+
77+Use `cel.setTitle("My App")` when you want to update the terminal window or tab title. It is imperative terminal state, not part of the render tree, and the previous title is not restored automatically on `cel.stop()`.
78+
79+## 4 Primitives
80+
81+| Primitive | Type | Description |
82+| ------------------------- | ----------------------- | ----------------------------------------- |
83+| `VStack(props, children)` | Container | Vertical stack — children top to bottom |
84+| `HStack(props, children)` | Container | Horizontal stack — children left to right |
85+| `Text(content, props?)` | Leaf | Styled text, no children |
86+| `TextInput(props)` | Container (no children) | Multi-line editable text |
87+
88+Containers accept sizing (`width`, `height`, `flex`, `"50%"`, `minWidth`/`maxWidth`), layout (`padding`, `gap`, `justifyContent`, `alignItems`, `flexWrap`), scroll (`overflow: "scroll"`, `scrollbar`, `scrollStep`, `scrollOffset`, `onScroll`), styling (`fgColor`, `bgColor`, `bold`, `focusStyle`), and interaction (`onClick`, `focusable`, `focused`, `onKeyPress`). Colors are numbered palette slots (`"color00"`–`"color15"`), mapped to ANSI 16 by default. Custom themes can remap slots to different …
89+
90+Read [references/api.md](references/api.md) for the full props listing, sizing strategies, text props, and component reference.
91+
92+## Common Patterns
93+
94+### Spacer, divider, button
95+
96+```ts
97+HStack({ height: 1 }, [Text("left"), VStack({ flex: 1 }, []), Text("right")]);
98+Text("─", { repeat: "fill", fgColor: "color08" });
99+HStack(
100+ {
101+ onClick: handleClick,
102+ focusStyle: { bgColor: "color06", fgColor: "color00" },
103+ },
104+ [Text(" Send ", { bold: true })],
105+);
106+```
107+
108+### Scrollable list
109+
110+Scroll is **uncontrolled by default** — the framework manages scroll position internally. Mouse wheel just works:
111+
112+```ts
113+VStack({ overflow: "scroll", scrollbar: true }, [...items]);
114+```
115+
116+Mouse wheel scrolling uses an **adaptive step** by default based on the scroll target's visible main-axis viewport size:
117+
118+- `floor(viewportMainAxis / 3)`
119+- clamped to `3..8`
120+
121+Override it with `scrollStep` when a view should scroll faster or slower:
122+
123+```ts
124+VStack({ overflow: "scroll", scrollbar: true, scrollStep: 6 }, [...items]);
125+```
126+
127+Provide `scrollOffset` + `onScroll` to opt into **controlled mode** — you own the state:
128+
129+```ts
130+let offset = 0;
131+
132+VStack(
133+ {
134+ overflow: "scroll",
135+ scrollbar: true,
136+ scrollOffset: offset,
137+ onScroll: (newOffset, maxOffset) => {
138+ offset = newOffset;
139+ cel.render();
140+ },
141+ },
142+ [...items],
143+);
144+```
145+
146+Controlled mode enables patterns like auto-scroll to bottom on new content. `scrollStep` affects mouse wheel input only — not programmatic `scrollOffset` updates.
147+
148+### Measuring content height
149+
150+Use `measureContentHeight(node, { width })` when your app knows the wrapping width but needs to know how tall a content subtree will be.
151+
152+```ts
153+import { measureContentHeight, VStack } from "@cel-tui/core";
154+
155+const addedHeight = measureContentHeight(
156+ VStack({}, olderMessages.map(renderMessage)),
157+ { width: historyContentWidth },
158+);
159+
160+scrollOffset += addedHeight;
161+```
162+
163+This is for **intrinsic content measurement**, not viewport/clipping measurement. The provided `width` is authoritative. Measure the content subtree you are adding or anchoring around — not a wrapper whose visible height is controlled by `height`, `flex`, or percentage sizing. If you measure a padded container, pass its outer width; if you measure the children inside a padded container directly, pass the inner content width.
164+
165+### Layers (modals)
166+
167+Return an array from the render function — layers composite bottom-to-top:
168+
169+```ts
170+cel.viewport(() => [
171+ VStack({ height: "100%" }, [...mainUI]),
172+ ...(showModal
173+ ? [
174+ VStack(
175+ { height: "100%", justifyContent: "center", alignItems: "center" },
176+ [
177+ VStack(
178+ { width: 40, height: 10, bgColor: "color08", fgColor: "color07" },
179+ [...modalContent],
180+ ),
181+ ],
182+ ),
183+ ]
184+ : []),
185+]);
186+```
187+
188+### Focus
189+
190+Focus is **uncontrolled by default** — Tab/Shift+Tab/Escape/click just work. Provide `focused` prop to opt into controlled mode:
191+
192+```ts
193+// Uncontrolled — framework manages focus
194+HStack({ onClick: handleAction }, [Text("[ OK ]")]);
195+
196+// Controlled — app owns focus state
197+TextInput({
198+ value,
199+ onChange,
200+ focused: isFocused,
201+ onFocus: () => {
202+ isFocused = true;
203+ cel.render();
204+ },
205+});
206+```
207+
208+### Style inheritance
209+
210+Containers propagate styles to descendants. Explicit props always win:
211+
212+```ts
213+VStack({ fgColor: "color07", bgColor: "color04" }, [
214+ Text("inherits color07 on color04"),
215+ Text("explicit color02", { fgColor: "color02" }),
216+]);
217+```
218+
219+### Select component
220+
221+```ts
222+import { Select } from "@cel-tui/components";
223+
224+const mySelect = Select({
225+ items: ["apple", "banana", "cherry"],
226+ onSelect: (value) => {
227+ chosen = value;
228+ cel.render();
229+ },
230+});
231+
232+// ctrl+q lives on the root — Select returns false for unrecognized
233+// keys, so they bubble up automatically.
234+cel.viewport(() =>
235+ VStack(
236+ {
237+ height: "100%",
238+ onKeyPress: (key) => {
239+ if (key === "ctrl+q") {
240+ cel.stop();
241+ process.exit();
242+ }
243+ },
244+ },
245+ [mySelect()],
246+ ),
247+);
248+mySelect.reset(); // clear filter/highlight programmatically
249+```
250+
251+### SyntaxHighlight component
252+
253+```ts
254+import { SyntaxHighlight } from "@cel-tui/components";
255+
256+VStack({ flex: 1, overflow: "scroll", padding: { x: 1 } }, [
257+ SyntaxHighlight(source, "typescript"),
258+]);
259+
260+SyntaxHighlight(source, "javascript", { theme: "dark-plus" });
261+```
262+
263+`SyntaxHighlight(content, language, props?)` renders registered lextide languages and aliases into cel-tui primitives. The component stays synchronous to call and re-highlights the full snippet whenever content changes, so final output stays stable across streamed chunk boundaries. Unknown language ids render plain text. The optional `theme` accepts the small built-in presets (`"default"`, `"dark-plus"`) or a best-effort token-color registration object.
264+
265+## Gotchas
266+
267+- **State is external** — the framework has no state. Mutate variables then call `cel.render()`.
268+- **Text is a pure leaf** — no sizing props, no children. Parent controls the box.
269+- **TextInput consumes insertable text and editing/navigation keys** when focused (printable text, arrows, backspace, Enter, Tab), plus readline-style shortcuts: `ctrl+a` / `ctrl+e`, `alt+b` / `alt+f`, `ctrl+left` / `ctrl+right`, `ctrl+w`, and `alt+d`. Word movement and deletion are whitespace-delimited, and `up` / `down` follow visual wrapped lines. Enter inserts a newline by default. Use `onKeyPress` on TextInput to intercept keys before editing — return `false` to prevent the default action …
270+- **Escape unfocuses** the current element. Tab/Shift+Tab traverses focusable elements (wraps around). After Escape, traversal continues from where focus was lost.
271+- **Enter activates** a focused container's `onClick`. If no `onClick`, Enter reaches `onKeyPress`.
272+- **`focusable: true`** without `onClick` makes a container keyboard-focusable (receives `onKeyPress` events via Tab). Used by stateful components like `Select`.
273+- **Innermost handler wins** — for `onClick` and `onScroll`. For `onKeyPress`, keys **bubble up** through ancestors: return `false` from a handler to let the key continue to the next ancestor. Returning `void`/`undefined` consumes the key (stops bubbling). This is backward-compatible.
274+- **Mouse wheel step is adaptive by default** — scrollable containers and `TextInput` use `floor(viewportMainAxis / 3)`, clamped to `3..8`. Set `scrollStep` to override it for a specific view.
275+- **Container `bgColor`** fills the rect with opaque background before painting children. Always pair `bgColor` with `fgColor` for contrast — terminal default fg is designed for the terminal default bg, not for arbitrary palette backgrounds.
276+- **Colors are numbered slots** (`"color00"`–`"color15"`), not names. The default theme maps to ANSI 16. Omit `fgColor`/`bgColor` for terminal defaults (guaranteed readable across themes).
277+- **`repeat: "fill"` in HStack** gets width 0 (intrinsic width is 0). Workaround: wrap in `VStack({ flex: 1 }, [Text(" ", { repeat: "fill" })])`.
278+- **Crash cleanup** — terminal state is restored on SIGINT, SIGTERM, uncaughtException.
279+- **Always call `cel.stop()` before `process.exit()`** — restores raw mode, mouse tracking, and alternate screen.
280+- **Kitty-first keyboard input** — the framework enables Kitty level 1 and gets full modifier fidelity when the host preserves it (`alt+x`, `ctrl+plus`, `shift+enter`, etc.). It also normalizes recoverable legacy encodings so common shortcuts keep working in tmux. For best results, use a Kitty-compatible terminal or `tmux` with `set -s extended-keys on`. On older legacy hosts, historically ambiguous collisions such as `ctrl+i` vs `tab` or `ctrl+m` vs `enter` cannot be recovered once the host c …
281+- **tmux is good for keyboard-driven manual checks** — common `tmux send-keys` paths work for printable chars, `Tab`/`BTab`, `Enter`, `Escape`, arrows, and many `Ctrl+letter` shortcuts. Use exact raw-sequence injection only when you need to target a protocol-specific encoding. Mouse input remains unreliable in tmux and should be verified in a real terminal.
282+- **Button limitations** — `Button` from `@cel-tui/components` does not forward container sizing props (`width`, `height`, `flex`, `minWidth`, etc.). It supports styling (`fgColor`, `bgColor`, `bold`, etc.), `focusStyle`, `focused`, `onFocus`, `onBlur`, `onKeyPress`, and `padding`. For full layout control, use `HStack` + `Text` directly.
283+- **SyntaxHighlight re-highlights on content changes** — the component favors deterministic final output over incremental parser reuse, so streamed chunk boundaries do not change the final highlighting. Unknown language ids render plain text.
284+
285+## Composing Components
286+
287+Stateless components are plain functions returning `Node` trees — prefer this pattern. When a component needs internal state across renders, use a factory function that returns a callable instance. Read [references/composing-components.md](references/composing-components.md) for full patterns and examples.
288+
289+For the full framework specification, see the [cel-tui spec](https://raw.githubusercontent.com/sacenox/cel-tui/main/spec.md).
.agents/skills/cel-tui/references/api.md+346−0
@@ -0,0 +1,346 @@
1+# cel-tui API Reference
2+
3+## Framework lifecycle
4+
5+```ts
6+cel.init(new ProcessTerminal(), { theme?: Theme });
7+cel.viewport(() => tree); // or () => [layer1, layer2]
8+cel.render();
9+cel.setTitle("My App");
10+cel.stop();
11+```
12+
13+- `cel.viewport` sets the render function and triggers the first render.
14+- `cel.render()` requests a batched re-render after external state changes.
15+- `cel.setTitle(title)` writes a best-effort terminal title request. Control characters are stripped from `title`, and `cel.stop()` does not restore the previous title automatically.
16+- `cel.stop()` restores terminal state (raw mode, keyboard protocol, mouse tracking, alternate screen).
17+
18+## Container Props
19+
20+All props accepted by `VStack` and `HStack`:
21+
22+```ts
23+{
24+ // Sizing
25+ width, height, // SizeValue (number | "50%")
26+ flex, // number
27+ minWidth, maxWidth, // number
28+ minHeight, maxHeight, // number
29+ padding, // { x?: number, y?: number }
30+ gap, // number (cells between children)
31+ justifyContent, // "start" | "end" | "center" | "space-between"
32+ alignItems, // "start" | "end" | "center" | "stretch"
33+ overflow, // "hidden" (default) | "scroll"
34+ scrollbar, // boolean
35+ scrollStep, // number (mouse wheel step in cells; default adaptive)
36+ scrollOffset, // number (controlled scroll)
37+ onScroll, // (offset: number, maxOffset: number) => void
38+ flexWrap, // "nowrap" (default) | "wrap" (HStack only)
39+
40+ // Styling (inherited by descendants)
41+ bold, italic, underline,// boolean
42+ fgColor, bgColor, // Color ("color00"–"color15")
43+ focusStyle, // StyleProps — overrides when focused
44+
45+ // Interaction
46+ onClick, // () => void
47+ focusable, // boolean (default true if onClick set, or set true explicitly)
48+ focused, // boolean (controlled — omit for uncontrolled)
49+ onFocus, // () => void
50+ onBlur, // () => void
51+ onKeyPress, // (key: string) => boolean | void — normalized semantic key string; return false to keep bubbling
52+}
53+```
54+
55+## Measurement Helpers
56+
57+```ts
58+measureContentHeight(node, { width }); // number
59+```
60+
61+- Measures a node tree's **intrinsic content height** at the provided wrapping width.
62+- This is a content-measurement helper, not a viewport/clipping helper.
63+- The provided `width` is authoritative — use the actual width the subtree wraps at.
64+- Main use case: prepend-style scrollback, where older content is inserted above the current viewport and the app needs to preserve the viewport anchor.
65+
66+```ts
67+const addedHeight = measureContentHeight(
68+ VStack({}, olderMessages.map(renderMessage)),
69+ { width: historyContentWidth },
70+);
71+
72+scrollOffset += addedHeight;
73+```
74+
75+Measure the content subtree you are adding. If a wrapper's visible height is controlled by `height`, `flex`, or percentage sizing, measure the content inside that wrapper instead. For padded content, pass the outer width when measuring the padded container itself, or the inner content width when measuring its children directly.
76+
77+## Scroll
78+
79+Scroll supports **uncontrolled** (default) and **controlled** modes, mirroring the focus model:
80+
81+```ts
82+// Uncontrolled — framework manages scroll position. Mouse wheel just works.
83+VStack({ overflow: "scroll", scrollbar: true }, [...items]);
84+
85+// Controlled — app owns scroll state.
86+VStack(
87+ {
88+ overflow: "scroll",
89+ scrollbar: true,
90+ scrollOffset: offset,
91+ onScroll: (newOffset, maxOffset) => {
92+ offset = newOffset;
93+ cel.render();
94+ },
95+ },
96+ [...items],
97+);
98+```
99+
100+- Scroll direction follows the container’s main axis: VStack → vertical, HStack → horizontal.
101+- Scroll is pointer-driven (mouse wheel), not focus-driven. A user can type in a focused widget while scrolling a different container.
102+- Mouse wheel scrolling uses an adaptive default step based on the scroll target's visible main-axis viewport size: `floor(viewportMainAxis / 3)`, clamped to `3..8`.
103+- Set `scrollStep` to override the mouse wheel step for a specific scrollable or `TextInput`.
104+- In controlled mode, the UI only moves when the app passes the updated `scrollOffset` back. `onScroll` fires with the clamped new offset and the maximum offset (content size minus viewport size). Pass `Infinity` as `scrollOffset` to mean "scroll to end" (clamped during rendering). `scrollStep` affects mouse wheel input only.
105+
106+## Text Props
107+
108+```ts
109+Text("content", {
110+ repeat: "fill" | number, // Repeat to fill width or N times
111+ wrap: "none" | "word", // Default "none", hard-clips at edge
112+ bold,
113+ italic,
114+ underline, // boolean
115+ fgColor,
116+ bgColor, // Color ("color00"–"color15")
117+});
118+```
119+
120+Colors: 16 numbered palette slots — `"color00"` through `"color15"`. Mapped to ANSI 16 by default; custom themes can remap to different ANSI indices or 24-bit true color. Omit a color prop for the terminal default.
121+
122+## TextInput Props
123+
124+```ts
125+TextInput({
126+ value, // string (controlled)
127+ onChange, // (value: string) => void
128+ onKeyPress, // (key: string) => boolean | void — normalized semantic key string; return false to prevent default editing action
129+ placeholder, // Text() node shown when empty
130+ // + all container props (sizing, styling, focus, scrollStep, etc.)
131+});
132+```
133+
134+Enter inserts a newline by default. Use `onKeyPress` to intercept keys before editing:
135+
136+```ts
137+// Enter submits instead of inserting newline
138+TextInput({
139+ value: input,
140+ onChange: handleChange,
141+ onKeyPress: (key) => {
142+ if (key === "enter") {
143+ handleSend();
144+ return false;
145+ }
146+ },
147+});
148+```
149+
150+When focused, TextInput consumes insertable text plus editing/navigation keys, including readline-style shortcuts: `ctrl+a` / `ctrl+e`, `alt+b` / `alt+f`, `ctrl+left` / `ctrl+right`, `ctrl+w`, and `alt+d`. Word movement and deletion are whitespace-delimited, and `up` / `down` navigate visual wrapped lines. Other modifier combos and non-insertable control keys bubble. Key strings are semantic identifiers for handlers, not necessarily the exact inserted text — uppercase `A` normalizes to key `"a …
151+
152+## Sizing Strategies
153+
154+Containers accept 4 sizing strategies:
155+
156+```ts
157+VStack({}, []); // Intrinsic — size to fit content (default)
158+VStack({ width: 30, height: 10 }, []); // Fixed — exact cell count
159+VStack({ flex: 1 }, []); // Flex — proportional to siblings
160+VStack({ width: "50%", height: "100%" }, []); // Percentage — relative to parent
161+```
162+
163+Constraints: `minWidth`, `maxWidth`, `minHeight`, `maxHeight`.
164+
165+Text has no sizing props — parent controls the box, height is intrinsic (content + wrapping).
166+
167+TextInput accepts container sizing props (`flex`, `width`, `height`, `padding`, `maxHeight`, etc.) plus container scroll props like `scrollStep` for mouse wheel behavior.
168+
169+## Key Format
170+
171+All lowercase, modifiers joined by `+`: `"ctrl+s"`, `"ctrl+shift+n"`, `"escape"`, `"enter"`, `"alt+up"`, `"f1"`. Framework normalizes modifier order.
172+
173+cel-tui is **Kitty-first** and works well in `tmux` with `set -s extended-keys on`. Recoverable legacy forms normalize to the same key strings, but historically collapsed collisions (`ctrl+i` vs `tab`, `ctrl+m` vs `enter`, `ctrl+[` vs `escape`) remain limited by what the host terminal or multiplexer reports.
174+
175+## Pre-made Components
176+
177+```ts
178+import {
179+ Spacer,
180+ Divider,
181+ Button,
182+ Select,
183+ VDivider,
184+ Markdown,
185+ SyntaxHighlight,
186+} from "@cel-tui/components";
187+
188+Spacer(); // VStack({ flex: 1 }, [])
189+Divider(); // Text("─", { repeat: "fill" })
190+Divider({ char: "═", fgColor: "color08" });
191+Button("[OK]", { onClick: handleOk });
192+Button("✕", { onClick: handleClose, focusable: false });
193+// Button accepts: onClick, focusable, focused, onFocus, onBlur, focusStyle,
194+// onKeyPress, padding, bold, fgColor, bgColor, italic, underline.
195+// Note: Button does not forward container sizing props (width, height, flex).
196+// For full layout control, use HStack + Text directly.
197+```
198+
199+### Select (filterable list)
200+
201+Select props: `items`, `onSelect`, `placeholder` (default `"type to filter..."`), `maxVisible` (default `10`), `indicator` (default `"›"`), `highlightColor` (default `"color06"`), `onKeyPress` (composed with internal handler), plus container/style props: `width`, `height`, `flex`, `fgColor`, `bgColor`, `focused`, `focusable`, `onFocus`, `onBlur`, `focusStyle`.
202+
203+```ts
204+const mySelect = Select({
205+ items: ["apple", "banana", "cherry"],
206+ onSelect: (value) => {
207+ chosen = value;
208+ cel.render();
209+ },
210+ placeholder: "search fruits...",
211+ maxVisible: 8,
212+});
213+
214+// Select returns false for unrecognized keys, so they bubble to root.
215+cel.viewport(() =>
216+ VStack(
217+ {
218+ height: "100%",
219+ onKeyPress: (key) => {
220+ if (key === "ctrl+q") {
221+ cel.stop();
222+ process.exit();
223+ }
224+ },
225+ },
226+ [Text("Pick a fruit:"), mySelect()],
227+ ),
228+);
229+
230+// Reset state programmatically
231+mySelect.reset();
232+```
233+
234+Rich items with separate display label, return value, and filter text:
235+
236+```ts
237+const modelSelect = Select({
238+ items: [
239+ {
240+ label: "claude-sonnet-4 (free)",
241+ value: "anthropic/claude-sonnet-4",
242+ filterText: "claude-sonnet-4",
243+ },
244+ { label: "gpt-4o", value: "openai/gpt-4o", filterText: "gpt-4o" },
245+ ],
246+ onSelect: (value) => {
247+ model = value;
248+ cel.render();
249+ },
250+});
251+```
252+
253+### VDivider (vertical divider)
254+
255+```ts
256+import { VDivider } from "@cel-tui/components";
257+
258+// Separate columns in an HStack
259+HStack({ height: "100%" }, [
260+ VStack({ flex: 1 }, [Text("left pane")]),
261+ VDivider({ fgColor: "color08" }),
262+ VStack({ flex: 1 }, [Text("right pane")]),
263+]);
264+
265+// Custom character
266+VDivider({ char: "║", fgColor: "color08" });
267+```
268+
269+### Markdown (rendered markdown)
270+
271+Returns an array of nodes — spread into a container's children:
272+
273+````ts
274+import { Markdown } from "@cel-tui/components";
275+
276+VStack(
277+ { flex: 1, overflow: "scroll", padding: { x: 1 } },
278+ Markdown("# Hello\n\nSome **bold** text.\n\n```js\nconst x = 1;\n```"),
279+);
280+````
281+
282+Custom theme for markdown styling:
283+
284+```ts
285+Markdown(content, {
286+ theme: {
287+ heading1: { bold: true, fgColor: "color05" },
288+ codeBlock: { bgColor: "color08" },
289+ bold: { bold: true, fgColor: "color03" },
290+ },
291+});
292+```
293+
294+Streaming works naturally — append chunks and call `cel.render()`. Unclosed blocks are handled gracefully.
295+
296+### SyntaxHighlight (rendered code)
297+
298+Returns a `VStack` — place it directly in a container's children:
299+
300+```ts
301+import { SyntaxHighlight } from "@cel-tui/components";
302+
303+VStack({ flex: 1, overflow: "scroll", padding: { x: 1 } }, [
304+ SyntaxHighlight(code, "typescript"),
305+]);
306+
307+SyntaxHighlight(code, "javascript", { theme: "dark-plus" });
308+```
309+
310+- Signature: `SyntaxHighlight(content, language, props?)`
311+- `language` accepts registered lextide language ids and aliases
312+- `props.theme` accepts the built-in presets (`"default"`, `"dark-plus"`) or a best-effort token theme registration object
313+- Uses a terminal-friendly ANSI 16 fallback theme by default
314+- Highlighting is synchronous at the component boundary; unsupported languages render plain text
315+- Content changes re-highlight the full snippet so final output stays stable across streamed chunk boundaries
316+
317+## Theme
318+
319+The default theme maps 16 color slots to ANSI palette indices. Custom themes remap to different ANSI indices or 24-bit hex:
320+
321+```ts
322+import { cel, ProcessTerminal, type Theme } from "@cel-tui/core";
323+
324+const mocha: Theme = {
325+ color00: "#1e1e2e",
326+ color01: "#f38ba8",
327+ color02: "#a6e3a1",
328+ color03: "#f9e2af",
329+ color04: "#89b4fa",
330+ color05: "#cba6f7",
331+ color06: "#94e2d5",
332+ color07: "#cdd6f4",
333+ color08: "#45475a",
334+ color09: "#f38ba8",
335+ color10: "#a6e3a1",
336+ color11: "#f9e2af",
337+ color12: "#89b4fa",
338+ color13: "#cba6f7",
339+ color14: "#94e2d5",
340+ color15: "#bac2de",
341+};
342+
343+cel.init(new ProcessTerminal(), { theme: mocha });
344+```
345+
346+App code uses `"color00"`–`"color15"` regardless of theme. The mapping is a rendering concern.
.agents/skills/cel-tui/references/composing-components.md+109−0
@@ -0,0 +1,109 @@
1+# Composing Components
2+
3+cel-tui components are plain functions that return `Node` trees. There are two patterns depending on whether the component needs internal state.
4+
5+## Stateless components
6+
7+Simple functions that take props and return a `Node`. Called every render cycle inside `cel.viewport()`. All state is external — passed in as props.
8+
9+```ts
10+import type { ContainerNode } from "@cel-tui/types";
11+import { HStack, VStack, Text } from "@cel-tui/core";
12+
13+function StatusBar(left: string, right: string): ContainerNode {
14+ return HStack({ fgColor: "color00", bgColor: "color07" }, [
15+ Text(` ${left}`),
16+ VStack({ flex: 1 }, []), // spacer
17+ Text(`${right} `),
18+ ]);
19+}
20+
21+// Usage — called fresh each render
22+cel.viewport(() =>
23+ VStack({ height: "100%" }, [
24+ mainContent(),
25+ StatusBar(filename, `${lines} lines`),
26+ ]),
27+);
28+```
29+
30+This is the pattern used by `Button`, `Divider`, `Spacer`, `VDivider`, `Markdown`, and `SyntaxHighlight` — stateless functions that derive output from current inputs. Prefer it whenever possible — it's simple, testable, and composable.
31+
32+## Stateful components (factory pattern)
33+
34+When a component needs internal state that persists across renders (e.g., a search query, cursor position, scroll offset), use a **factory function** that returns a callable instance. State lives in the closure. The user calls the instance each render to get a fresh `Node` tree.
35+
36+```ts
37+import type { ContainerNode, Color } from "@cel-tui/types";
38+import { cel, VStack, HStack, Text } from "@cel-tui/core";
39+
40+interface ToggleGroupProps {
41+ options: string[];
42+ onSelect: (value: string) => void;
43+ activeColor?: Color;
44+}
45+
46+interface ToggleGroupInstance {
47+ (): ContainerNode;
48+ reset(): void;
49+}
50+
51+function ToggleGroup(props: ToggleGroupProps): ToggleGroupInstance {
52+ const { options, onSelect, activeColor = "color06" } = props;
53+ let activeIndex = 0;
54+
55+ function handleKey(key: string): boolean | void {
56+ if (key === "left" && activeIndex > 0) {
57+ activeIndex--;
58+ cel.render();
59+ } else if (key === "right" && activeIndex < options.length - 1) {
60+ activeIndex++;
61+ cel.render();
62+ } else if (key === "enter") {
63+ onSelect(options[activeIndex]!);
64+ } else {
65+ return false; // unrecognized key — let it bubble to ancestors
66+ }
67+ }
68+
69+ function render(): ContainerNode {
70+ return HStack(
71+ { focusable: true, onKeyPress: handleKey, gap: 1 },
72+ options.map((opt, i) =>
73+ Text(` ${opt} `, {
74+ fgColor: i === activeIndex ? "color00" : undefined,
75+ bgColor: i === activeIndex ? activeColor : undefined,
76+ }),
77+ ),
78+ );
79+ }
80+
81+ render.reset = () => {
82+ activeIndex = 0;
83+ };
84+ return render as ToggleGroupInstance;
85+}
86+
87+// Usage — create once, call each render
88+const formatToggle = ToggleGroup({
89+ options: ["JSON", "YAML", "TOML"],
90+ onSelect: (fmt) => {
91+ format = fmt;
92+ cel.render();
93+ },
94+});
95+
96+cel.viewport(() =>
97+ VStack({ height: "100%" }, [Text("Output format:"), formatToggle()]),
98+);
99+```
100+
101+## Key points
102+
103+- **Create once** outside `cel.viewport()`. The closure captures mutable state.
104+- **Call each render** inside `cel.viewport()` — the function builds a fresh node tree from current state.
105+- **`cel.render()`** is importable from `@cel-tui/core` — stateful components call it after internal state changes to trigger re-renders.
106+- **Key bubbling** — `onKeyPress` handlers bubble from innermost to root. Return `false` from a handler to signal the key was not consumed and let it continue to the next ancestor. Return `void`/`undefined` to consume (backward-compatible). Components like `Select` return `false` for unrecognized keys, so app-level shortcuts on parent containers work automatically.
107+- **`.reset()`** or other methods — attach to the render function (functions are objects in JS) to expose imperative control.
108+
109+This is the pattern used by `Select` from `@cel-tui/components`.
AGENTS.md+6−0
@@ -12,6 +12,12 @@
1212 - For audits, treat open `TODO.md` items as already-known issues and focus findings on new gaps unless the user asks to re-check known debt.
1313 - Keep `TODO.md` minimal and current; remove completed items instead of accumulating history.
1414
15+## Planning and design mode
16+
17+- In planning, debugging, and research sessions, optimize for the correct design first. Do not let patch size, dirty-tree caution, or implementation anxiety distort the recommendation.
18+- Minimal diffs are a delivery concern, not a design goal. If the current architecture is wrong, say so plainly and propose the proper refactor.
19+- When implementation starts, prefer the correct refactor over a band-aid. Use tactical workarounds only when the user explicitly asks for them or hard constraints make the proper fix impractical.
20+
1521 ## Code map
1622
1723 - `src/index.ts` — startup, providers, settings, AGENTS.md/skills/plugins loading, theme assembly, shared app state.
PROGRESS.md+110−0
@@ -0,0 +1,110 @@
1+# PROGRESS
2+
3+## Conversation summary
4+
5+We reviewed ideas from:
6+
7+- HumanLayer's advanced context engineering / 12-factor agents work
8+- several coding-agent implementations and docs, especially Pi, Codex, OpenCode, Gemini CLI, Amp, and Forge
9+
10+The main conclusion from this round:
11+
12+- mini-coder should stay fairly **shell-leaning** overall
13+- but **file reading** and **content search** should be **dedicated tools**, because shell commands are too ambiguous for those jobs
14+ - reading can happen through `cat`, `sed`, `awk`, `head`, `tail`, etc.
15+ - searching can happen through `grep`, `rg`, `find`, `fd`, etc.
16+- for simpler repo exploration, shell is still fine
17+ - prefer `ls` for directory listing
18+ - prefer `fd` for file discovery
19+
20+## Chosen direction
21+
22+The best next direction is:
23+
24+1. **Copy/adapt Pi's `read()` tool implementation** for mini-coder
25+2. **Copy/adapt Pi's `grep()` tool implementation** for mini-coder
26+3. Update mini-coder's prompt so it clearly teaches the model:
27+ - use `read()` for reading files
28+ - use `grep()` for content search
29+ - use shell `ls` and `fd` for lightweight exploration
30+4. Keep `shell` as the fallback tool for everything else, not the primary interface for reading/searching code
31+
32+## Why this direction
33+
34+- Pi's read/search tools are the cleanest practical baseline we found
35+- Codex reinforces the value of keeping search/read more explicit than raw shell
36+- Shell remains valuable, but it is a weak interface for precise read/search intent because the model has too many equivalent command shapes to choose from
37+- `ls` and `fd` are simple enough that dedicated tools are probably not worth adding right now
38+
39+## Important research notes
40+
41+### Pi
42+
43+Useful patterns worth copying:
44+
45+- `read(path, offset, limit)`
46+- `grep(pattern, path?, glob?, ignoreCase?, literal?, context?, limit?)`
47+- clear truncation behavior
48+- clear continuation hints like `use offset=...`
49+- explicit tool guidance telling the model to prefer `read` over `cat`/`sed`
50+
51+### Codex
52+
53+Useful conceptual takeaway:
54+
55+- dedicated tools for common read/search operations are better than forcing everything through shell
56+- search can often narrow candidates first, then follow up with read
57+
58+### OpenCode / Gemini CLI / Amp
59+
60+Useful secondary ideas:
61+
62+- good tool descriptions matter a lot
63+- for open-ended exploration, subagents/delegation can help keep context cleaner
64+- Gemini's grep implementation had strong ideas, especially structured `rg --json` handling and auto-context for small result sets
65+
66+## Current recommendation for implementation
67+
68+Keep scope narrow.
69+
70+Do **not** add a big new tool surface yet.
71+
72+Implement only:
73+
74+- dedicated `read` tool
75+- dedicated `grep` tool
76+- prompt clarification that `ls` and `fd` are the preferred shell commands for exploration
77+
78+Avoid adding new `ls` / `find` / `glob` tools for now unless later testing shows they are needed.
79+
80+## UI decisions from follow-up discussion
81+
82+These details are now decided for the first `read` / `grep` implementation pass:
83+
84+- `read` and `grep` tool-call previews should use the existing shared tool frame and stream their arguments in a structured, styled format rather than raw JSON.
85+- Those previews should follow the same `/verbose` behavior as the shell tool UI.
86+- `read` results should render syntax-highlighted file content as it streams in. That rendered body is still subject to `/verbose` UI truncation.
87+- The `read` result header should include the resolved file path after the `read <-` pill on the same line.
88+- `grep` results should render a structured, styled view derived from `rg --json`, focused on session-CWD-relative filenames and matches rather than raw JSON.
89+- `grep` result bodies should also follow `/verbose` UI behavior.
90+- Relative `grep` paths and displayed relative filenames should be based on the session CWD.
91+- Keep tool concerns separate from UI concerns: tool-level truncation / continuation behavior and UI `/verbose` rendering stay independent.
92+
93+## Likely files to touch later
94+
95+When implementation starts, the likely areas are:
96+
97+- `src/tools.ts`
98+- `src/prompt.ts`
99+- maybe `src/ui/conversation.ts` if tool rendering needs special treatment
100+- maybe tests in `src/tools.test.ts`, `src/prompt.test.ts`, and `src/agent.test.ts`
101+
102+## Open question to keep in mind
103+
104+If we copy Pi's read/search behavior, we should decide whether `read()` should follow the same ignore/security expectations as search tools. One real issue seen in other agents is inconsistent behavior where search respects ignore rules but direct read bypasses them.
105+
106+## Status at the end of this context
107+
108+Nothing has been implemented yet from this decision. The chosen tool surface and the intended `read` / `grep` UI behavior are now documented and should be treated as the plan for the next implementation pass.
109+
110+This file exists only to preserve the research outcome and chosen direction so a new context can continue from here without redoing the comparison.
TODO.md+37−32
@@ -1,46 +1,51 @@
11 # TODO
22
33 Keep this always updated so work can continue across sessions.
4-Don't keep completed items bloating the file, remove them before committing.
4+Don't keep completed items bloating the file; remove them before committing.
55 Keep the file structured and minimal.
6-The spec.md and code are the sources of truth, not this file, don't assume anything because it's documented here.
6+The spec and code are the sources of truth; this file is just the verified backlog.
77
8-## Implementation-pattern cleanup plan
8+## Open issues:
99
10-- [x] Extract narrow shared helpers for repeated text-shaping/state-reset logic instead of copy-modify variants (`src/session.ts`, `src/ui.ts`, `src/ui/commands.ts`, `src/ui/status.ts`)
11-- [x] Reduce weakly-typed tool wiring by moving built-in tool argument validation/coercion to typed boundaries instead of `Record<string, unknown>` casts in dispatch (`src/index.ts`, `src/tools.ts`, `src/agent.ts`)
12-- [x] Move session-state reload/reset sequences behind focused helpers so command flows stop manually reassigning `messages`/`stats`/`contextTokens` in multiple places (`src/index.ts`, `src/ui/commands.ts`, `src/submit.ts`)
13-- [x] Replace module-global UI streaming/runtime state with explicit controller/runtime state objects where practical, starting with the streaming agent tail and related render/reset hooks (`src/ui.ts`, `src/ui/agent.ts`, `src/ui/conversation.ts`)
14-- [x] Split oversized mixed-concern modules along existing seams without changing behavior: shell command normalization/capture helpers, persisted-message parsing helpers, and UI runtime helpers (`src/tools.ts`, `src/session.ts`, `src/ui.ts`)
15-- [x] Verify the cleanup with targeted tests first, then full repo checks, and only mark this section complete after diff review (`src/*.test.ts`, `src/ui/*.test.ts`)
10+- [ ] Fix headless `mc` not exiting after one-shot runs complete; explicit process exit after shutdown may be the missing piece (`src/index.ts`, `src/headless.ts`)
11+- [ ] Consolidate syntax-highlighting themes and fix `SyntaxHighlight` usage so markdown/code/tool rendering stays consistent (`src/ui/conversation.ts`, `src/theme.ts`)
1612
17-## Forge comparison follow-ups (high-value gaps, highest priority first)
13+## UI render scheduling fix plan (completed)
1814
19-- [x] Add first-class todo tools plus prompt/UI integration so the agent can track and complete work explicitly instead of relying only on a `/tmp` file (`src/tools.ts`, `src/agent.ts`, `src/prompt.ts`, `src/ui/conversation.ts`)
20-- [ ] Add loop safeguards: retry policy, tool-failure/request budgets, and doom-loop detection/reminders (`src/agent.ts`, `src/submit.ts`, `src/prompt.ts`)
21-- [ ] Add dedicated read/search tools so the model relies less on `shell` for code discovery (`src/tools.ts`, `src/prompt.ts`, `src/ui/conversation.ts`)
22-- [ ] Add first-class delegation/subagent support instead of relying on shell-level `mc -p` delegation (`src/agent.ts`, `src/tools.ts`, `src/prompt.ts`, `src/headless.ts`)
15+- [x] Centralize UI-triggered renders behind a scheduler in `src/ui.ts` so streaming, tool, and divider updates coalesce instead of calling `cel.render()` blindly
16+- [x] Stop redundant synchronous render requests from cel-managed input, scroll, and overlay paths while keeping their state mutations intact
17+- [x] Route async agent/runtime updates through the scheduler with lower-priority streaming/animation requests and normal-priority committed-state updates
18+- [x] Add focused UI tests for render coalescing/priorities, then remove the frozen-streaming open issue after verification
19+
20+## Spec-alignment backlog
21+
22+- [ ] Make invalid `settings.json` non-fatal at startup. Per spec, invalid or missing settings content should behave like "no saved settings" instead of aborting launch (`src/settings.ts`, `src/index.ts`)
23+- [ ] Clear queued steering messages on reset boundaries so they cannot leak across `/new`, `/undo`, `/session`, or aborted/replaced runs (`src/submit.ts`, `src/ui/commands.ts`, `src/agent.ts`)
24+- [ ] Encode Escape-over-overlay behavior in app code instead of relying on overlay blur side effects. The first `Escape` should dismiss the overlay, preserve the draft, and not interrupt the run (`src/ui.ts`, `src/ui/commands.ts`)
25+- [ ] Omit empty git fields from the system-prompt git line. Detached HEAD should not render `Git: branch ` (`src/prompt.ts`, `src/git.ts`)
26+- [ ] Return structured `shell` results that preserve stdout, stderr, and exit code instead of flattening everything into one text blob (`src/tool-shell.ts`, `src/tools.ts`, `src/ui/conversation.ts`)
27+- [ ] Escape skill catalog values before injecting them into the `<available_skills>` XML block (`src/skills.ts`, `src/prompt.ts`)
2328
24-## Low priority (deferred until further notice)
29+## Verified UX / behavior debt
2530
26-- [ ] Invalid `settings.json` is fatal instead of falling back to no saved settings (`src/settings.ts`)
27-- [ ] Providers should be readied lazily: on the first message for the selected provider, or for all providers when `/models` is used.
28-- [ ] Escape-over-overlay behavior is not encoded in app code (`src/ui/commands.ts`, `src/ui.ts`)
29-- [ ] Custom provider discovery ignores configured `apiKey` (`src/index.ts`)
30-- [ ] Slash-command autocomplete does not preserve the draft (`src/ui/commands.ts`)
31-- [ ] `/session` can switch sessions mid-run (`ui/commands.ts`, `ui/agent.ts`)
32-- [ ] `shell` results are flattened into one text blob (`src/tools.ts`, `src/ui/conversation.ts`)
33-- [ ] Steering meesages are implemented wrong, they appear in the UI at the end of the turn loop. Not at the next loop interation boundary... NOT CONFIRMED NEEDS DEBUGGING
34-- [ ] Skills aren't xml safe and we should use a frontmatter parsing library (`skills.ts`, `prompt.ts`)
31+- [ ] Prevent `/session` from switching sessions mid-run (`src/ui/commands.ts`, `src/ui/agent.ts`)
32+- [ ] Preserve the current slash-command draft when opening command autocomplete instead of clearing the input (`src/ui.ts`, `src/ui/commands.ts`)
33+
34+## Product backlog
35+
36+- [ ] Add loop safeguards that fit the no-step-limit spec: retry policy, tool-failure/request budgets, and doom-loop detection/reminders without introducing a hard step cap (`src/agent.ts`, `src/submit.ts`, `src/prompt.ts`)
37+- [ ] Add dedicated read/search tools so the model relies less on `shell` for code discovery (`src/tools.ts`, `src/prompt.ts`, `src/ui/conversation.ts`)
38+- [ ] Add first-class delegation/subagent support instead of relying on shell-level `mc -p` delegation (`src/agent.ts`, `src/tools.ts`, `src/prompt.ts`, `src/headless.ts`)
39+- [ ] Improve headless output when `--json` is not passed so it shows lightweight activity updates before the final answer (simple assistant commentary/snippets only; no tool-call details or reasoning) (`src/headless.ts`, `src/index.ts`)
3540
36-## Plugin related (documented only, no plugin-related work is planned right now)
41+## Plugin debt (verified, deferred)
3742
38-- [ ] Plugin tool execution API does not match the spec/docs (`plugins.ts`, `index.ts`, `spec.md`)
39-- [ ] Plugin `AgentContext.messages` is stale (`index.ts`)
40-- [ ] Package-name and config-relative plugin imports do not work (`plugins.ts`)
41-- [ ] Plugin tool rendering is not prefixed with `plugin/tool` in the log (`index.ts`, `ui/conversation.ts`)
43+- [ ] Make plugin lifecycle match the spec: initialize once at startup and destroy on shutdown, not on prompt-context reload boundaries (`src/index.ts`, `src/plugins.ts`)
44+- [ ] Match the plugin tool execution API to the spec/docs instead of the temporary `tools` + `toolHandlers` split (`src/plugins.ts`, `src/index.ts`, `spec.md`)
45+- [ ] Keep `Plugin AgentContext.messages` current or narrow the contract so it is not stale (`src/index.ts`, `src/plugins.ts`, `spec.md`)
46+- [ ] Support package-name and config-relative plugin imports (`src/plugins.ts`)
47+- [ ] Prefix plugin tool rendering with `plugin/tool` in the log when available (`src/index.ts`, `src/ui/conversation.ts`)
4248
43-## Future ideas
49+## Benchmark harness debt
4450
45-- [ ] Divider theme plugin — customizable divider animations (scanning pulse, breathing, flowing dots, wave)
46-- [ ] Backward-compatibility and migration policy for 1.0 (session/app data versioning, explicit migration strategy)
51+- [ ] Make the Harbor mini-coder wrappers use headless JSON mode (`mc --json -p ...`) instead of final-text mode mislabeled as NDJSON (`terminal-bench/mini_coder_agent.py`, `terminal-bench/mini_coder_local_agent.py`)
spec.md+86−7
@@ -57,7 +57,7 @@ This replaces: `yoctocolors`, `yoctomarkdown`, `yoctoselect`, and all our custom
5757
5858 ## Tools
5959
60-Four built-in tools, plus a read-only image tool. Plugins may add more (see [Plugins](#plugins)).
60+Six built-in tools, plus a conditional read-only image tool. Plugins may add more (see [Plugins](#plugins)).
6161
6262 ### `shell`
6363
@@ -73,6 +73,30 @@ Implementation details:
7373 - Compatibility normalization is best-effort and intentionally narrow. If a rewrite is ambiguous or the normalization step itself fails, the raw command is executed unchanged.
7474 - Timeout: no default timeout. The user can interrupt via `Escape`.
7575
76+### `read`
77+
78+Reads a UTF-8 text file from disk, optionally by line window. Use it for reading file contents instead of shelling out to `cat`, `sed`, `head`, or `tail`.
79+
80+Implementation details:
81+
82+- Takes `path`, optional `offset`, and optional `limit`.
83+- `path` may be absolute or relative to the session CWD.
84+- `offset` and `limit` are line-based.
85+- Returns the requested slice as plain text, plus a clear continuation hint when more content remains (for example `use offset=...`).
86+- Any tool-level truncation or continuation behavior is part of the tool contract and stays separate from the UI's `/verbose` rendering.
87+
88+### `grep`
89+
90+Searches file contents using ripgrep-style options and returns structured matches. Use it for content search instead of shelling out to `grep` / `rg` when the goal is to find relevant files or matching lines.
91+
92+Implementation details:
93+
94+- Takes `pattern`, optional `path`, optional `glob`, optional `ignoreCase`, optional `literal`, optional `context`, and optional `limit`.
95+- `path` defaults to the session CWD when omitted. Relative `path` values are resolved against the session CWD.
96+- Executes ripgrep in JSON mode under the hood (`rg --json`) so matches, context lines, and summary data can be parsed deterministically.
97+- Returns structured match data, plus clear continuation behavior when the result set is capped.
98+- Any tool-level truncation or continuation behavior is part of the tool contract and stays separate from the UI's `/verbose` rendering.
99+
76100 ### `edit`
77101
78102 Exact-text replacement in a single file. Use it to write the exact file content the task requires.
@@ -239,7 +263,7 @@ The core runtime. Streaming is the default behavior throughout the turn: user-vi
239263 - `error` → display error in the log, return to the input prompt.
240264
241265 4. **Tool execution** — when the LLM requests tool calls:
242- - Execute each tool call. For `shell`: run the command, capture output, truncate if needed. For `edit`: perform the replacement. For `todoWrite`: apply the incremental todo changes and return the full current list. For `todoRead`: return the full current list. For `readImage`: read and base64-encode the file. For plugin tools: delegate to the plugin.
Cut short: this commit's diff is over 1000 lines.
src/headless.test.ts+35−0
Cut short: this commit's diff is over 1000 lines.
src/headless.ts+62−21
Cut short: this commit's diff is over 1000 lines.
src/index.test.ts+3−1
Cut short: this commit's diff is over 1000 lines.
src/index.ts+15−2
Cut short: this commit's diff is over 1000 lines.
src/prompt.test.ts+0−4
Cut short: this commit's diff is over 1000 lines.
src/prompt.ts+8−0
Cut short: this commit's diff is over 1000 lines.
src/session-message.ts+39−36
Cut short: this commit's diff is over 1000 lines.
src/settings.ts+19−15
Cut short: this commit's diff is over 1000 lines.
src/shared.ts+39−0
Cut short: this commit's diff is over 1000 lines.
src/tool-grep.ts+606−0
Cut short: this commit's diff is over 1000 lines.
src/tool-read.ts+313−0
Cut short: this commit's diff is over 1000 lines.
src/tools.test.ts+290−4
Cut short: this commit's diff is over 1000 lines.
src/tools.ts+28−4
Cut short: this commit's diff is over 1000 lines.
src/ui.test.ts+35−0
Cut short: this commit's diff is over 1000 lines.
src/ui.ts+181−19
Cut short: this commit's diff is over 1000 lines.
src/ui/agent.ts+150−56
Cut short: this commit's diff is over 1000 lines.
src/ui/commands.test.ts+12−8
Cut short: this commit's diff is over 1000 lines.
src/ui/commands.ts+8−8
Cut short: this commit's diff is over 1000 lines.
src/ui/conversation.test.ts+360−0
Cut short: this commit's diff is over 1000 lines.
src/ui/conversation.ts+496−151
Cut short: this commit's diff is over 1000 lines.
src/ui/runtime.ts+6−3
Cut short: this commit's diff is over 1000 lines.
terminal-bench/mini_coder_agent.py+1−1
Cut short: this commit's diff is over 1000 lines.