jeo-code 0.4.7 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ja.md CHANGED
@@ -150,11 +150,11 @@ CI は `.github/workflows/npm-publish.yml` で公開します — GitHub リリ
150
150
  ## 変更履歴 (Changelog)
151
151
 
152
152
  <!-- CHANGELOG:START (auto-generated from CHANGELOG.md — run `bun run changelog:sync`) -->
153
+ - **[0.4.9]** (2026-06-14) — Live-frame width-clamp (content-sized height) replaces the constant-height approach, typed text shows during a running turn, and a docs/AGENTS refresh.
154
+ - **[0.4.8]** (2026-06-14) — Live-frame stability: constant-height live turn, renderer self-heal off-by-one fix, and frame-safe child-stdout sanitizing — no more duplicate model bar or torn escapes.
153
155
  - **[0.4.7]** (2026-06-14) — Detached subagents + `subagent` control tool, live shaded in-flight output, registry-driven providers, fuller `read` budget, styled italics in the final report, and `gjc` retired.
154
156
  - **[0.4.6]** (2026-06-14) — Width-correct forge cards for CJK/emoji, red borders on failed tool cards, aligned `ooo ralph` monitor HUD, and a per-theme user-card palette.
155
157
  - **[0.4.5]** (2026-06-14) — First-class filesystem make/remove tools.
156
- - **[0.4.4]** (2026-06-13) — Live subagent status mirroring, always-useful Ctrl+O activity tail, read lineRange crash guard.
157
- - **[0.4.3]** (2026-06-13) — Readability pass for autopilot, subagent activity, and worked-history review.
158
158
 
159
159
  See [CHANGELOG.md](CHANGELOG.md) for the full history.
160
160
  <!-- CHANGELOG:END -->
package/README.ko.md CHANGED
@@ -150,11 +150,11 @@ CI는 `.github/workflows/npm-publish.yml`로 배포합니다 — GitHub 릴리
150
150
  ## 변경 이력 (Changelog)
151
151
 
152
152
  <!-- CHANGELOG:START (auto-generated from CHANGELOG.md — run `bun run changelog:sync`) -->
153
+ - **[0.4.9]** (2026-06-14) — Live-frame width-clamp (content-sized height) replaces the constant-height approach, typed text shows during a running turn, and a docs/AGENTS refresh.
154
+ - **[0.4.8]** (2026-06-14) — Live-frame stability: constant-height live turn, renderer self-heal off-by-one fix, and frame-safe child-stdout sanitizing — no more duplicate model bar or torn escapes.
153
155
  - **[0.4.7]** (2026-06-14) — Detached subagents + `subagent` control tool, live shaded in-flight output, registry-driven providers, fuller `read` budget, styled italics in the final report, and `gjc` retired.
154
156
  - **[0.4.6]** (2026-06-14) — Width-correct forge cards for CJK/emoji, red borders on failed tool cards, aligned `ooo ralph` monitor HUD, and a per-theme user-card palette.
155
157
  - **[0.4.5]** (2026-06-14) — First-class filesystem make/remove tools.
156
- - **[0.4.4]** (2026-06-13) — Live subagent status mirroring, always-useful Ctrl+O activity tail, read lineRange crash guard.
157
- - **[0.4.3]** (2026-06-13) — Readability pass for autopilot, subagent activity, and worked-history review.
158
158
 
159
159
  See [CHANGELOG.md](CHANGELOG.md) for the full history.
160
160
  <!-- CHANGELOG:END -->
package/README.md CHANGED
@@ -150,11 +150,11 @@ Required npm token permissions (repository secret `NPM_TOKEN`):
150
150
  ## Changelog
151
151
 
152
152
  <!-- CHANGELOG:START (auto-generated from CHANGELOG.md — run `bun run changelog:sync`) -->
153
+ - **[0.4.9]** (2026-06-14) — Live-frame width-clamp (content-sized height) replaces the constant-height approach, typed text shows during a running turn, and a docs/AGENTS refresh.
154
+ - **[0.4.8]** (2026-06-14) — Live-frame stability: constant-height live turn, renderer self-heal off-by-one fix, and frame-safe child-stdout sanitizing — no more duplicate model bar or torn escapes.
153
155
  - **[0.4.7]** (2026-06-14) — Detached subagents + `subagent` control tool, live shaded in-flight output, registry-driven providers, fuller `read` budget, styled italics in the final report, and `gjc` retired.
154
156
  - **[0.4.6]** (2026-06-14) — Width-correct forge cards for CJK/emoji, red borders on failed tool cards, aligned `ooo ralph` monitor HUD, and a per-theme user-card palette.
155
157
  - **[0.4.5]** (2026-06-14) — First-class filesystem make/remove tools.
156
- - **[0.4.4]** (2026-06-13) — Live subagent status mirroring, always-useful Ctrl+O activity tail, read lineRange crash guard.
157
- - **[0.4.3]** (2026-06-13) — Readability pass for autopilot, subagent activity, and worked-history review.
158
158
 
159
159
  See [CHANGELOG.md](CHANGELOG.md) for the full history.
160
160
  <!-- CHANGELOG:END -->
package/README.zh.md CHANGED
@@ -150,11 +150,11 @@ CI 通过 `.github/workflows/npm-publish.yml` 发布 — GitHub 发布 release
150
150
  ## 更新日志 (Changelog)
151
151
 
152
152
  <!-- CHANGELOG:START (auto-generated from CHANGELOG.md — run `bun run changelog:sync`) -->
153
+ - **[0.4.9]** (2026-06-14) — Live-frame width-clamp (content-sized height) replaces the constant-height approach, typed text shows during a running turn, and a docs/AGENTS refresh.
154
+ - **[0.4.8]** (2026-06-14) — Live-frame stability: constant-height live turn, renderer self-heal off-by-one fix, and frame-safe child-stdout sanitizing — no more duplicate model bar or torn escapes.
153
155
  - **[0.4.7]** (2026-06-14) — Detached subagents + `subagent` control tool, live shaded in-flight output, registry-driven providers, fuller `read` budget, styled italics in the final report, and `gjc` retired.
154
156
  - **[0.4.6]** (2026-06-14) — Width-correct forge cards for CJK/emoji, red borders on failed tool cards, aligned `ooo ralph` monitor HUD, and a per-theme user-card palette.
155
157
  - **[0.4.5]** (2026-06-14) — First-class filesystem make/remove tools.
156
- - **[0.4.4]** (2026-06-13) — Live subagent status mirroring, always-useful Ctrl+O activity tail, read lineRange crash guard.
157
- - **[0.4.3]** (2026-06-13) — Readability pass for autopilot, subagent activity, and worked-history review.
158
158
 
159
159
  See [CHANGELOG.md](CHANGELOG.md) for the full history.
160
160
  <!-- CHANGELOG:END -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jeo-code",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "description": "Clean, highly optimized AI coding agent using spec-first loop",
5
5
  "type": "module",
6
6
  "main": "src/cli.ts",
package/src/AGENTS.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # src
5
5
 
@@ -9,9 +9,12 @@ Core application source code for the `jeo-code` CLI and agent runtime. It orches
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
+ | `autopilot.ts` | Brief description of purpose |
13
+ | `bun-imports.d.ts` | TypeScript declarations for Bun built-ins and raw module imports |
12
14
  | `cli.ts` | The main binary entrypoint |
13
15
  | `index.ts` | Library exports |
14
- | `bun-imports.d.ts` / `md-modules.d.ts` | TypeScript declarations for Bun built-ins and raw module imports |
16
+ | `ledger.ts` | Brief description of purpose |
17
+ | `md-modules.d.ts` | TypeScript declarations for Bun built-ins and raw module imports |
15
18
 
16
19
  ## Subdirectories
17
20
  | Directory | Purpose |
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # agent
5
5
 
@@ -9,13 +9,33 @@ The core runtime loop, tool registry, session management, and state persistence
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
+ | `bash-fixups.ts` | Brief description of purpose |
13
+ | `compaction.ts` | Brief description of purpose |
14
+ | `config-schema.ts` | Brief description of purpose |
15
+ | `context-files.ts` | Brief description of purpose |
16
+ | `engine.ts` | Brief description of purpose |
17
+ | `hooks.ts` | Brief description of purpose |
18
+ | `json.ts` | Brief description of purpose |
12
19
  | `loop.ts` | The primary execution loop orchestrating model calls and tool execution |
13
- | `tools.ts` | Built-in tool definitions (bash, read, write, edit, etc.) |
14
- | `state.ts` | File-backed state and session persistence (`.jeo/state/`) |
15
- | `session.ts` | Session context building, compaction, and history management |
20
+ | `memory.ts` | Brief description of purpose |
21
+ | `model-recency.ts` | Brief description of purpose |
22
+ | `output-minimizer.ts` | Brief description of purpose |
23
+ | `output-util.ts` | Brief description of purpose |
16
24
  | `plan.ts` | Subagent planning structures and validation |
25
+ | `seed.ts` | Brief description of purpose |
26
+ | `session.ts` | Session context building, compaction, and history management |
27
+ | `state.ts` | File-backed state and session persistence (`.jeo/state/`) |
17
28
  | `step-budget.ts` | gjc-style flexible step budgeting: progress-scored extensions, hard cap, fail-fast |
18
- | `subagents.ts` / `task-tool.ts` | Delegation mechanisms and background execution of task subagents |
29
+ | `subagent-registry.ts` | Brief description of purpose |
30
+ | `subagent-tool.ts` | Brief description of purpose |
31
+ | `subagents.ts` | Brief description of purpose |
32
+ | `task-tool.ts` | Brief description of purpose |
33
+ | `todo-tool.ts` | Brief description of purpose |
34
+ | `tokenizer.ts` | Brief description of purpose |
35
+ | `tool-output.ts` | Brief description of purpose |
36
+ | `tool-registry.ts` | Brief description of purpose |
37
+ | `tools.ts` | Built-in tool definitions (bash, read, write, edit, etc.) |
38
+ | `web-search.ts` | Brief description of purpose |
19
39
 
20
40
  ## Subdirectories
21
41
  | Directory | Purpose |
@@ -1,5 +1,5 @@
1
- <!-- Parent: ../../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
1
+ <!-- Parent: ../AGENTS.md -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # dev
5
5
 
@@ -9,6 +9,11 @@ Developer-specific agent tooling and spec automation.
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
+ | `advanced-analyzer.ts` | Brief description of purpose |
13
+ | `evolution-bridge.ts` | Brief description of purpose |
14
+ | `evolution-logger.ts` | Brief description of purpose |
15
+ | `self-analysis.ts` | Brief description of purpose |
16
+ | `self-improve.ts` | Brief description of purpose |
12
17
  | `spec-automation.ts` | Tools to sync `.specify/` artifacts to ooo seeds |
13
18
 
14
19
  ## Subdirectories
package/src/ai/AGENTS.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # ai
5
5
 
@@ -9,9 +9,20 @@ Abstractions for LLM inference, provider management, tool formatting, and token
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
- | `registry.ts` | Central registry for available providers and model resolution |
12
+ | `index.ts` | Brief description of purpose |
13
+ | `model-catalog-compat.ts` | Brief description of purpose |
14
+ | `model-catalog.ts` | Brief description of purpose |
15
+ | `model-discovery.ts` | Brief description of purpose |
16
+ | `model-enrich.ts` | Brief description of purpose |
17
+ | `model-manager.ts` | Brief description of purpose |
18
+ | `model-picker.ts` | Brief description of purpose |
19
+ | `model-registry.ts` | Brief description of purpose |
20
+ | `pricing.ts` | Brief description of purpose |
21
+ | `provider-registry.ts` | Brief description of purpose |
22
+ | `provider-status.ts` | Brief description of purpose |
23
+ | `register-providers.ts` | Brief description of purpose |
24
+ | `sse.ts` | Brief description of purpose |
13
25
  | `types.ts` | Common interfaces for AI requests, responses, and streams |
14
- | `format.ts` | Conversion between internal tool schemas and provider-specific formats |
15
26
 
16
27
  ## Subdirectories
17
28
  | Directory | Purpose |
@@ -1,5 +1,5 @@
1
- <!-- Parent: ../../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
1
+ <!-- Parent: ../AGENTS.md -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # providers
5
5
 
@@ -10,10 +10,12 @@ Concrete implementations for various LLM providers, translating generic requests
10
10
  | File | Description |
11
11
  |------|-------------|
12
12
  | `anthropic.ts` | Anthropic Claude integration |
13
- | `openai.ts` | OpenAI (and Codex backend) integration |
14
- | `gemini.ts` | Google Gemini (and Cloud Code Assist) integration |
15
13
  | `antigravity.ts` | Antigravity desktop-app OAuth client integration |
14
+ | `errors.ts` | Brief description of purpose |
15
+ | `gemini.ts` | Google Gemini (and Cloud Code Assist) integration |
16
16
  | `ollama.ts` | Local Ollama integration |
17
+ | `openai-responses.ts` | Brief description of purpose |
18
+ | `openai.ts` | OpenAI (and Codex backend) integration |
17
19
 
18
20
  ## Subdirectories
19
21
  *(None)*
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # auth
5
5
 
@@ -9,8 +9,13 @@ Authentication and credential management for OAuth flows and API keys. Ensures s
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
- | `store.ts` | Secure credential storage mechanism |
13
- | `config.ts` | Resolution of keys from environment variables and config files |
12
+ | `callback-server.ts` | Brief description of purpose |
13
+ | `index.ts` | Brief description of purpose |
14
+ | `oauth.ts` | Brief description of purpose |
15
+ | `pkce.ts` | Brief description of purpose |
16
+ | `refresh.ts` | Brief description of purpose |
17
+ | `storage.ts` | Brief description of purpose |
18
+ | `types.ts` | Brief description of purpose |
14
19
 
15
20
  ## Subdirectories
16
21
  | Directory | Purpose |
@@ -1,5 +1,5 @@
1
- <!-- Parent: ../../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
1
+ <!-- Parent: ../AGENTS.md -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # flows
5
5
 
@@ -9,8 +9,12 @@ Specific OAuth flow implementations for various providers.
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
- | `oauth.ts` / `pkce.ts` | Generic OAuth and PKCE utilities |
13
- | `*.ts` | Provider-specific login flows (e.g., anthropic, openai, gemini) |
12
+ | `anthropic.ts` | Brief description of purpose |
13
+ | `antigravity.ts` | Brief description of purpose |
14
+ | `google-project.ts` | Brief description of purpose |
15
+ | `google.ts` | Brief description of purpose |
16
+ | `index.ts` | Brief description of purpose |
17
+ | `openai.ts` | Brief description of purpose |
14
18
 
15
19
  ## Subdirectories
16
20
  *(None)*
@@ -27,6 +31,11 @@ Specific OAuth flow implementations for various providers.
27
31
  - Loopback HTTP servers for receiving OAuth callbacks.
28
32
 
29
33
  ## Dependencies
30
- *(None)*
34
+
35
+ ### Internal
36
+ {References to other parts of the codebase this depends on}
37
+
38
+ ### External
39
+ {Key external packages/libraries used}
31
40
 
32
41
  <!-- MANUAL: -->
package/src/cli/AGENTS.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # cli
5
5
 
@@ -9,8 +9,8 @@ Command-line interface routing, argument parsing, and initialization logic. Defi
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
- | `parser.ts` | Argument parsing and flag validation |
13
- | `router.ts` | Dispatches CLI commands to their respective implementations |
12
+ | `index.ts` | Brief description of purpose |
13
+ | `runner.ts` | Brief description of purpose |
14
14
 
15
15
  ## Subdirectories
16
16
  *(None)*
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # commands
5
5
 
@@ -9,10 +9,28 @@ Concrete implementations of `jeo` subcommands (e.g., launch, setup, team, ultrag
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
+ | `approve.ts` | Brief description of purpose |
13
+ | `auth.ts` | Brief description of purpose |
14
+ | `chat.ts` | Brief description of purpose |
15
+ | `deep-interview.ts` | Brief description of purpose |
16
+ | `doctor.ts` | Brief description of purpose |
17
+ | `evolve-core.ts` | Brief description of purpose |
18
+ | `evolve.ts` | Brief description of purpose |
19
+ | `export.ts` | Brief description of purpose |
12
20
  | `launch.ts` | The primary interactive/one-shot execution command |
21
+ | `mcp.ts` | Brief description of purpose |
22
+ | `ooo-seed.ts` | Brief description of purpose |
23
+ | `ralplan.ts` | Brief description of purpose |
24
+ | `resume.ts` | Brief description of purpose |
25
+ | `session.ts` | Brief description of purpose |
26
+ | `setup-helpers.ts` | Brief description of purpose |
13
27
  | `setup.ts` | Guided configuration command |
28
+ | `skills.ts` | Brief description of purpose |
29
+ | `state.ts` | Brief description of purpose |
30
+ | `status.ts` | Brief description of purpose |
14
31
  | `team.ts` | Multi-agent coordination command |
15
- | `status.ts` / `update.ts` | Inspection and maintenance commands |
32
+ | `ultragoal.ts` | Brief description of purpose |
33
+ | `update.ts` | Brief description of purpose |
16
34
 
17
35
  ## Subdirectories
18
36
  *(None)*
@@ -1418,13 +1418,13 @@ export async function runLaunchCommand(args: string[]): Promise<void> {
1418
1418
  return;
1419
1419
  }
1420
1420
  }
1421
- // Mid-turn additional input is committed (and shown) ONLY on Enter (above):
1422
- // the running turn does NOT echo half-typed text per keystroke. Captured
1423
- // printable input accumulates silently in the draft buffer and surfaces as a
1424
- // `user` card the moment Enter lifts it into the steering inbox (or folds into
1425
- // the next prompt if the turn ends first). JEO_LIVE_DRAFT=1 restores the
1426
- // legacy live per-keystroke echo in the input box.
1427
- if (captured && jeoEnv("LIVE_DRAFT") === "1") {
1421
+ // Mid-turn typing is echoed LIVE into the input box so the field never looks
1422
+ // frozen/disabled while a turn runs the typed text IS captured, so it must be
1423
+ // visible. This updates the in-frame input box via the differential renderer
1424
+ // only; it never leaks into scrollback/history (native readline echo stays
1425
+ // suppressed for the whole turn). On Enter the draft is lifted into the steering
1426
+ // inbox and surfaces as a `user` card (above). JEO_NO_LIVE_DRAFT=1 opts out.
1427
+ if (captured && jeoEnv("NO_LIVE_DRAFT") !== "1") {
1428
1428
  tui.setLivePromptInput(queueBusySnapshot?.().text ?? "");
1429
1429
  }
1430
1430
  },
package/src/mcp/AGENTS.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # mcp
5
5
 
@@ -9,8 +9,10 @@ Model Context Protocol (MCP) integration, allowing `jeo-code` to expose tools or
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
+ | `index.ts` | Brief description of purpose |
13
+ | `protocol.ts` | Brief description of purpose |
12
14
  | `server.ts` | MCP server implementation (if exposing tools) |
13
- | `client.ts` | MCP client implementation (for consuming external tools) |
15
+ | `tools.ts` | Brief description of purpose |
14
16
 
15
17
  ## Subdirectories
16
18
  *(None)*
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # prompts
5
5
 
@@ -7,9 +7,7 @@
7
7
  Bundled system prompts, role definitions, and workflow skill documentation for the agent.
8
8
 
9
9
  ## Key Files
10
- | File | Description |
11
- |------|-------------|
12
- | `system.md` | Core system prompt template |
10
+ *(None)*
13
11
 
14
12
  ## Subdirectories
15
13
  | Directory | Purpose |
@@ -1,5 +1,5 @@
1
- <!-- Parent: ../../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
1
+ <!-- Parent: ../AGENTS.md -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # agents
5
5
 
@@ -9,10 +9,10 @@ Role-specific system prompts defining the behavior of subagents (executor, plann
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
- | `executor.md` | Mutating agent for executing bounded tasks |
13
- | `planner.md` | Read-only agent for sequencing tasks |
14
12
  | `architect.md` | Read-only agent for structural review |
15
13
  | `critic.md` | Read-only agent for plan critique |
14
+ | `executor.md` | Mutating agent for executing bounded tasks |
15
+ | `planner.md` | Read-only agent for sequencing tasks |
16
16
 
17
17
  ## Subdirectories
18
18
  *(None)*
@@ -30,6 +30,11 @@ Role-specific system prompts defining the behavior of subagents (executor, plann
30
30
  *(None)*
31
31
 
32
32
  ## Dependencies
33
- *(None)*
33
+
34
+ ### Internal
35
+ {References to other parts of the codebase this depends on}
36
+
37
+ ### External
38
+ {Key external packages/libraries used}
34
39
 
35
40
  <!-- MANUAL: -->
@@ -1,5 +1,5 @@
1
- <!-- Parent: ../../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
1
+ <!-- Parent: ../AGENTS.md -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # skills
5
5
 
@@ -7,16 +7,16 @@
7
7
  Bundled workflow skills offering specialized, multi-step procedures for the agent.
8
8
 
9
9
  ## Key Files
10
- *(See subdirectories)*
10
+ *(None)*
11
11
 
12
12
  ## Subdirectories
13
13
  | Directory | Purpose |
14
14
  |-----------|---------|
15
+ | `deep-dive/` | What it contains (see `deep-dive/AGENTS.md`) |
15
16
  | `deep-interview/` | Socratic requirements gathering |
16
17
  | `ralplan/` | Spec-first planning and consensus building |
17
18
  | `team/` | Coordinated multi-agent execution |
18
19
  | `ultragoal/` | Durable verification and ledger tracking |
19
- | `gjc/` | Legacy parity configurations |
20
20
 
21
21
  ## For AI Agents
22
22
 
@@ -31,6 +31,11 @@ Bundled workflow skills offering specialized, multi-step procedures for the agen
31
31
  *(None)*
32
32
 
33
33
  ## Dependencies
34
- *(None)*
34
+
35
+ ### Internal
36
+ {References to other parts of the codebase this depends on}
37
+
38
+ ### External
39
+ {Key external packages/libraries used}
35
40
 
36
41
  <!-- MANUAL: -->
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # deep-dive
5
5
 
@@ -26,6 +26,11 @@ Bundled SKILL.md for the `deep-dive` workflow.
26
26
  *(None)*
27
27
 
28
28
  ## Dependencies
29
- *(None)*
29
+
30
+ ### Internal
31
+ {References to other parts of the codebase this depends on}
32
+
33
+ ### External
34
+ {Key external packages/libraries used}
30
35
 
31
36
  <!-- MANUAL: -->
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # deep-interview
5
5
 
@@ -26,6 +26,11 @@ Bundled SKILL.md for the `deep-interview` workflow.
26
26
  *(None)*
27
27
 
28
28
  ## Dependencies
29
- *(None)*
29
+
30
+ ### Internal
31
+ {References to other parts of the codebase this depends on}
32
+
33
+ ### External
34
+ {Key external packages/libraries used}
30
35
 
31
36
  <!-- MANUAL: -->
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # ralplan
5
5
 
@@ -26,6 +26,11 @@ Bundled SKILL.md for the `ralplan` workflow.
26
26
  *(None)*
27
27
 
28
28
  ## Dependencies
29
- *(None)*
29
+
30
+ ### Internal
31
+ {References to other parts of the codebase this depends on}
32
+
33
+ ### External
34
+ {Key external packages/libraries used}
30
35
 
31
36
  <!-- MANUAL: -->
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # team
5
5
 
@@ -26,6 +26,11 @@ Bundled SKILL.md for the `team` workflow.
26
26
  *(None)*
27
27
 
28
28
  ## Dependencies
29
- *(None)*
29
+
30
+ ### Internal
31
+ {References to other parts of the codebase this depends on}
32
+
33
+ ### External
34
+ {Key external packages/libraries used}
30
35
 
31
36
  <!-- MANUAL: -->
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # ultragoal
5
5
 
@@ -26,6 +26,11 @@ Bundled SKILL.md for the `ultragoal` workflow.
26
26
  *(None)*
27
27
 
28
28
  ## Dependencies
29
- *(None)*
29
+
30
+ ### Internal
31
+ {References to other parts of the codebase this depends on}
32
+
33
+ ### External
34
+ {Key external packages/libraries used}
30
35
 
31
36
  <!-- MANUAL: -->
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # skills
5
5
 
@@ -9,8 +9,7 @@ Framework for discovering, loading, and executing workflow skills (both bundled
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
- | `registry.ts` | Discovers and catalogs available skills |
13
- | `executor.ts` | Mechanism to inject skill prompts into the active session |
12
+ | `catalog.ts` | Brief description of purpose |
14
13
 
15
14
  ## Subdirectories
16
15
  *(None)*
package/src/tui/AGENTS.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # tui
5
5
 
@@ -10,6 +10,7 @@ Terminal User Interface logic, layout systems, and the differential renderer. Re
10
10
  | File | Description |
11
11
  |------|-------------|
12
12
  | `app.ts` | High-level TUI orchestrator (`LaunchTui`) |
13
+ | `index.ts` | Brief description of purpose |
13
14
  | `renderer.ts` | The differential, atomic terminal renderer (handles scrollback, resizing, DECSET 2026) |
14
15
  | `terminal.ts` | Low-level ANSI escape codes and terminal size utilities |
15
16
 
package/src/tui/app.ts CHANGED
@@ -30,7 +30,7 @@ import { costForUsage, formatCost } from "../ai/pricing";
30
30
  import { renderMarkdownTables } from "./components/markdown-table";
31
31
 
32
32
  import { stripMarkdown, renderMarkdownAnsi } from "./components/markdown-text";
33
- import { visibleWidth, wrapTextWithAnsi } from "./components/width";
33
+ import { visibleWidth, wrapTextWithAnsi, truncateToWidth, sanitizeForFrame } from "./components/width";
34
34
  import { categoryBadge } from "./components/category-index";
35
35
  import { formatStepTimeline, stepsFromTools, formatStepHeader, formatStepTimelineCompact, type StepState } from "./components/step-timeline";
36
36
  import { formatHintBar } from "./components/hints";
@@ -428,7 +428,10 @@ export class LaunchTui {
428
428
  },
429
429
  onToolProgress: (_tool, partial) => {
430
430
  if (this.finished) return;
431
- this.liveToolOutput = partial;
431
+ // Sanitize raw child stdout (CR / EL / cursor-move escapes) before it enters the
432
+ // frame — unsanitized control bytes tore the renderer's next \x1b[2K (literal "2K")
433
+ // and hijacked the cursor, corrupting the live frame.
434
+ this.liveToolOutput = sanitizeForFrame(partial);
432
435
  if (Date.now() - this.lastStreamDraw >= 100) {
433
436
  this.lastStreamDraw = Date.now();
434
437
  this.draw();
@@ -551,10 +554,6 @@ export class LaunchTui {
551
554
  });
552
555
  }
553
556
 
554
- private renderLiveUserQueryCard(cols: number): string[] {
555
- return this.renderUserCard(this.livePromptInput, cols);
556
- }
557
-
558
557
  /** Render a `user`-labeled query card (orange "user" header over a filled box).
559
558
  * Shared by the live next-prompt draft and the mid-turn steering flush. */
560
559
  private renderUserCard(rawText: string, cols: number): string[] {
@@ -1119,12 +1118,16 @@ export class LaunchTui {
1119
1118
  .split("\n")
1120
1119
  .flatMap(l => wrapTextWithAnsi(l, wrapW))
1121
1120
  .filter(l => l.length > 0);
1122
- const shown = wrapped.slice(-6); // bottom-anchored tail of the live trace
1123
- if (shown.length) {
1124
- tail.push(dim(`${this.unicode ? "│" : "|"} thinking`));
1125
- for (const l of shown) tail.push(dim(` ${l}`));
1126
- tail.push("");
1127
- }
1121
+ // FIXED reserved height (bottom-anchored, blank-padded at top): once present the
1122
+ // block's row count is CONSTANT, so streaming content never changes the frame
1123
+ // height. The per-100ms height thrash that desynced the differential renderer
1124
+ // (duplicate model bar) is gone; height now toggles only at lifecycle boundaries.
1125
+ const ROWS = 6;
1126
+ const shown = wrapped.slice(-ROWS);
1127
+ tail.push(dim(`${this.unicode ? "│" : "|"} thinking`));
1128
+ for (let k = 0; k < ROWS - shown.length; k++) tail.push("");
1129
+ for (const l of shown) tail.push(dim(` ${l}`));
1130
+ tail.push("");
1128
1131
  }
1129
1132
 
1130
1133
  // Live tool output (gjc-style streaming bash stdout): while a tool runs, its
@@ -1136,12 +1139,14 @@ export class LaunchTui {
1136
1139
  .split("\n")
1137
1140
  .flatMap(l => wrapTextWithAnsi(l, wrapW))
1138
1141
  .filter(l => l.length > 0);
1139
- const shown = wrapped.slice(-8); // bottom-anchored tail of the live output
1140
- if (shown.length) {
1141
- tail.push(dim(`${this.unicode ? "│" : "|"} output`));
1142
- for (const l of shown) tail.push(dim(` ${l}`));
1143
- tail.push("");
1144
- }
1142
+ // FIXED reserved height (see thinking block): constant rows while a tool streams,
1143
+ // so cumulative stdout growth does not thrash the frame height.
1144
+ const ROWS = 8;
1145
+ const shown = wrapped.slice(-ROWS);
1146
+ tail.push(dim(`${this.unicode ? "" : "|"} output`));
1147
+ for (let k = 0; k < ROWS - shown.length; k++) tail.push("");
1148
+ for (const l of shown) tail.push(dim(` ${l}`));
1149
+ tail.push("");
1145
1150
  }
1146
1151
 
1147
1152
  // Live status field: unboxed thinking line + compact metrics row. The model's
@@ -1177,12 +1182,6 @@ export class LaunchTui {
1177
1182
  }));
1178
1183
  }
1179
1184
 
1180
- // User text typed while the model is still thinking is surfaced as a live
1181
- // pending-user card (same query input underneath, no hidden auto-executing queue).
1182
- if (this.livePromptInput.trim()) {
1183
- tail.push("");
1184
- tail.push(...this.renderLiveUserQueryCard(cols));
1185
- }
1186
1185
 
1187
1186
  // Agent task plan (the `todo` tool) as a Todos checklist.
1188
1187
  if (args.planLines.length) {
@@ -1307,7 +1306,11 @@ export class LaunchTui {
1307
1306
  // model bar), no outer border, no mascot art — completed work lives in scrollback.
1308
1307
  if (fit && this.inline) {
1309
1308
  const inlineFrame = this.composeInlineFrame({ cols, rows, stepNow, elapsedMs, idx, isThinking, planLines });
1310
- this.renderer.render(inlineFrame.slice(0, rows));
1309
+ // Screen-safety: every rendered line is width-clamped to `cols` so a long line
1310
+ // (e.g. the model bar with a deep cwd) cannot soft-wrap into a second physical row
1311
+ // and desync the differential renderer's 1-line=1-row accounting. Frame height stays
1312
+ // content-sized so completed cards remain visible in scrollback above the live frame.
1313
+ this.renderer.render(inlineFrame.slice(0, rows).map(l => truncateToWidth(l, cols)));
1311
1314
  return;
1312
1315
  }
1313
1316
 
@@ -1371,10 +1374,6 @@ export class LaunchTui {
1371
1374
  bottom.push(` ${categoryBadge("status", { color: this.theme.color })} ${msg}${guardBadge}`);
1372
1375
  }
1373
1376
  }
1374
- if (fit && this.livePromptInput.trim()) {
1375
- bottom.push("");
1376
- bottom.push(...this.renderLiveUserQueryCard(innerWidth));
1377
- }
1378
1377
  // TTY only: keep the same query input box visible above the footer while the
1379
1378
  // turn is running; typed text edits the next-prompt draft, not a side queue.
1380
1379
  if (fit) {
@@ -1492,6 +1491,6 @@ export class LaunchTui {
1492
1491
  if (fit) {
1493
1492
  frame = frame.slice(0, rows);
1494
1493
  }
1495
- this.renderer.render(frame);
1494
+ this.renderer.render(frame.map(l => truncateToWidth(l, cols)));
1496
1495
  }
1497
1496
  }
@@ -1,5 +1,5 @@
1
- <!-- Parent: ../../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
1
+ <!-- Parent: ../AGENTS.md -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # components
5
5
 
@@ -9,11 +9,44 @@ Reusable UI widgets and layout primitives for the terminal interface.
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
+ | `ascii-art.ts` | Cellular evolution graphics |
13
+ | `autocomplete.ts` | Brief description of purpose |
14
+ | `autopilot-status.ts` | Brief description of purpose |
15
+ | `capability.ts` | Brief description of purpose |
16
+ | `category-index.ts` | Brief description of purpose |
17
+ | `code-view.ts` | Brief description of purpose |
18
+ | `color.ts` | Brief description of purpose |
19
+ | `config-panel.ts` | Brief description of purpose |
20
+ | `duration.ts` | Brief description of purpose |
21
+ | `evolution.ts` | Brief description of purpose |
22
+ | `footer.ts` | Brief description of purpose |
12
23
  | `forge.ts` | Formats the boxed tool execution outputs |
13
- | `status.ts` | The `[STEP]` / `[STATUS]` / `[TOOL]` HUD lines |
14
- | `section.ts` | Shadcn-inspired card layout and spacing tokens |
24
+ | `hints.ts` | Brief description of purpose |
25
+ | `hud.ts` | Brief description of purpose |
26
+ | `index.ts` | Brief description of purpose |
27
+ | `input-box.ts` | Brief description of purpose |
15
28
  | `layout.ts` | Low-level padding, boxing, and alignment math |
16
- | `ascii-art.ts` | Cellular evolution graphics |
29
+ | `live-model-picker.ts` | Brief description of purpose |
30
+ | `markdown-table.ts` | Brief description of purpose |
31
+ | `markdown-text.ts` | Brief description of purpose |
32
+ | `meter.ts` | Brief description of purpose |
33
+ | `model-picker.ts` | Brief description of purpose |
34
+ | `provider-picker.ts` | Brief description of purpose |
35
+ | `section.ts` | Shadcn-inspired card layout and spacing tokens |
36
+ | `select-list.ts` | Brief description of purpose |
37
+ | `skill-picker.ts` | Brief description of purpose |
38
+ | `slash.ts` | Brief description of purpose |
39
+ | `spinner.ts` | Brief description of purpose |
40
+ | `status.ts` | The `[STEP]` / `[STATUS]` / `[TOOL]` HUD lines |
41
+ | `step-timeline.ts` | Brief description of purpose |
42
+ | `stream.ts` | Brief description of purpose |
43
+ | `themes.ts` | Brief description of purpose |
44
+ | `todo-card.ts` | Brief description of purpose |
45
+ | `tool-list.ts` | Brief description of purpose |
46
+ | `transcript.ts` | Brief description of purpose |
47
+ | `update-box.ts` | Brief description of purpose |
48
+ | `welcome.ts` | Brief description of purpose |
49
+ | `width.ts` | Brief description of purpose |
17
50
 
18
51
  ## Subdirectories
19
52
  *(None)*
@@ -134,6 +134,57 @@ export function truncateToWidth(s: string, cols: number): string {
134
134
  return out;
135
135
  }
136
136
 
137
+ /**
138
+ * Strip control bytes that would corrupt the live differential frame. KEEPS SGR color
139
+ * escapes (`\x1b[…m`); DROPS every other CSI (cursor moves, EL/ED erase, etc.), OSC
140
+ * sequences, other escapes, and bare C0/C1 control bytes except tab/newline; and DROPS
141
+ * an INCOMPLETE trailing escape (a chunk that ends mid-sequence) so it can never eat the
142
+ * next line's `\x1b[2K`. Used to sanitize raw child stdout (e.g. a streaming `bun test`
143
+ * with `\r\x1b[2K` progress lines) before it enters the frame — the torn-escape /
144
+ * cursor-hijack class of screen corruption.
145
+ */
146
+ export function sanitizeForFrame(s: string): string {
147
+ if (!s.includes("\x1b") && !/[\x00-\x08\x0b-\x1f\x7f]/.test(s)) return s; // fast path
148
+ let out = "";
149
+ let i = 0;
150
+ const n = s.length;
151
+ while (i < n) {
152
+ const ch = s[i]!;
153
+ if (ch === "\x1b") {
154
+ if (s[i + 1] === "[") {
155
+ // CSI: ESC [ params (0-9;:?<>= space) final (@-~)
156
+ let j = i + 2;
157
+ while (j < n && /[0-9;:?<>= ]/.test(s[j]!)) j++;
158
+ if (j < n && /[@-~]/.test(s[j]!)) {
159
+ const seq = s.slice(i, j + 1);
160
+ if (seq.endsWith("m")) out += seq; // keep SGR color, drop all other CSI
161
+ i = j + 1;
162
+ continue;
163
+ }
164
+ break; // incomplete CSI at the chunk tail → drop the rest
165
+ }
166
+ if (s[i + 1] === "]") {
167
+ // OSC: ESC ] … (BEL | ST = ESC \)
168
+ let j = i + 2;
169
+ while (j < n && s[j] !== "\x07" && !(s[j] === "\x1b" && s[j + 1] === "\\")) j++;
170
+ if (j >= n) break; // incomplete OSC → drop
171
+ i = s[j] === "\x07" ? j + 1 : j + 2;
172
+ continue;
173
+ }
174
+ i += i + 1 < n ? 2 : 1; // other ESC x → drop ESC (+ its single byte)
175
+ continue;
176
+ }
177
+ const code = ch.charCodeAt(0);
178
+ if ((code < 0x20 && code !== 0x09 && code !== 0x0a) || code === 0x7f) {
179
+ i++; // strip bare control bytes (CR/BS/…), keep tab + newline
180
+ continue;
181
+ }
182
+ out += ch;
183
+ i++;
184
+ }
185
+ return out;
186
+ }
187
+
137
188
  /**
138
189
  * Hard-wrap text to `cols` display columns, breaking long words and preserving
139
190
  * existing newlines. SGR-aware (escapes don't consume width). Returns the wrapped
@@ -1,5 +1,5 @@
1
- <!-- Parent: ../../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
1
+ <!-- Parent: ../AGENTS.md -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # monitoring
5
5
 
@@ -26,6 +26,11 @@ Specialized HUD views and sovereign monitoring interfaces.
26
26
  *(None)*
27
27
 
28
28
  ## Dependencies
29
- *(None)*
29
+
30
+ ### Internal
31
+ {References to other parts of the codebase this depends on}
32
+
33
+ ### External
34
+ {Key external packages/libraries used}
30
35
 
31
36
  <!-- MANUAL: -->
@@ -51,17 +51,22 @@ export class Renderer {
51
51
  this.prevCols = currentCols;
52
52
 
53
53
  const next = lines.map(line => truncate(line, currentCols));
54
+ // Rows physically occupied by the prior frame — or recorded by reset() when the
55
+ // baseline was dropped WITHOUT clearing the screen. The diff below EL-clears any
56
+ // of these that the new (possibly shorter) frame does not cover, and the reserve
57
+ // block below uses it so a post-reset repaint does not spuriously re-scroll.
58
+ const occupied = Math.max(this.prev.length, this.coverRows);
54
59
  const maxLen = Math.max(this.prev.length, next.length, this.coverRows);
55
60
  this.coverRows = 0;
56
61
  let cursorRow = 0;
57
62
  let out = "";
58
63
 
59
- if (this.reserve && next.length > this.prev.length && next.length <= Math.max(1, size().rows)) {
64
+ if (this.reserve && next.length > occupied && next.length <= Math.max(1, size().rows)) {
60
65
  // The cursor rests on the frame's first row (the anchor). Walk to the last
61
66
  // currently-occupied row, emit one newline per missing row (scrolling the
62
67
  // viewport when at the bottom margin), then hop back up to the — possibly
63
68
  // shifted — anchor so the diff below paints at stable relative positions.
64
- const have = Math.max(this.prev.length, 1);
69
+ const have = Math.max(occupied, 1);
65
70
  out += cursorDown(have - 1) + "\n".repeat(next.length - have) + cursorUp(next.length - 1) + toColumn(1);
66
71
  }
67
72
 
@@ -92,16 +97,17 @@ export class Renderer {
92
97
  }
93
98
  out += toColumn(1);
94
99
 
95
- // Close the synchronized update opened by insertAbove() now that the full
96
- // repaint is in the same buffered stream the terminal presents the overwritten
97
- // first row(s), the flushed ledger line, and the repainted frame as ONE atomic update.
98
- if (this.syncOpen) {
99
- out += END_SYNC;
100
- this.syncOpen = false;
101
- }
102
-
100
+ // Atomic present (DECSET-2026 synchronized update): wrap the WHOLE repaint so the
101
+ // terminal never shows a half-painted frameno torn row, no transient duplicate
102
+ // bar a mid-repaint snapshot could catch. An insertAbove() may have already opened
103
+ // the update (syncOpen); otherwise this render opens its own. Exactly one BSU/ESU
104
+ // pair is emitted per write.
103
105
  if (out.length > 0) {
104
- this.write(out);
106
+ this.write((this.syncOpen ? "" : BEGIN_SYNC) + out + END_SYNC);
107
+ this.syncOpen = false;
108
+ } else if (this.syncOpen) {
109
+ this.write(END_SYNC);
110
+ this.syncOpen = false;
105
111
  }
106
112
 
107
113
  this.prev = next;
@@ -128,16 +134,12 @@ export class Renderer {
128
134
  .map((line, i, arr) => (i === arr.length - 1 && line === "" ? "" : toColumn(1) + clearLine() + line))
129
135
  .join("\n");
130
136
  let out = BEGIN_SYNC + body;
131
- // Eagerly EL-clear the old frame rows the inserted block did NOT cover, then hop
132
- // back to the row right below the insert (where the next render() anchors).
133
- // The geometry is provably safe HERE: when stale > 0 the body write never hit
134
- // the bottom margin (the old frame fit on screen and the insert is shorter), so
135
- // every stale row exists and cursor-down cannot clamp. Deferring this clear to
136
- // the next render() via coverRows walked PAST the bottom margin, where the
137
- // clamped cursor-down desynced the row bookkeeping — each subsequent frame then
138
- // painted one row higher, devouring the flushed scrollback content above (the
139
- // "truncated card" corruption).
140
- const stale = this.prev.length - written;
137
+ // EL-clear the old frame rows the inserted block did NOT cover, then hop back to the
138
+ // row right below the insert (where the next render() anchors). occupied = max(prev,
139
+ // coverRows) matches the reserve block so a reset()->insertAbove() ordering still
140
+ // clears the old frame's lower rows (the off-by-one that duplicated the model bar).
141
+ const occupied = Math.max(this.prev.length, this.coverRows);
142
+ const stale = occupied - written;
141
143
  if (stale > 0) {
142
144
  for (let i = 0; i < stale; i++) {
143
145
  out += toColumn(1) + clearLine() + (i < stale - 1 ? cursorDown(1) : "");
@@ -146,6 +148,7 @@ export class Renderer {
146
148
  }
147
149
  this.write(out);
148
150
  this.prev = [];
151
+ this.coverRows = 0;
149
152
  }
150
153
 
151
154
  /** Clear the live frame. Inline (reserve) mode walks the known frame rows with
@@ -174,6 +177,19 @@ export class Renderer {
174
177
  }
175
178
 
176
179
  reset(): void {
180
+ // Drop the diff baseline so the next render() repaints every line — but REMEMBER
181
+ // how many rows are physically on screen so that repaint also EL-clears any the
182
+ // new (possibly shorter) frame doesn't cover. Without this, a self-heal reset on a
183
+ // frame that just shrank left stale rows behind (duplicate model bars / orphaned
184
+ // borders — the live-analysis screen corruption).
185
+ this.coverRows = Math.max(this.coverRows, this.prev.length);
177
186
  this.prev = [];
187
+ // Close any synchronized update opened by a preceding insertAbove() so a reset()
188
+ // landing between insertAbove() and the next render() cannot strand an open BSU
189
+ // window (which times out ~150ms later and flashes a partial frame).
190
+ if (this.syncOpen) {
191
+ this.write(END_SYNC);
192
+ this.syncOpen = false;
193
+ }
178
194
  }
179
195
  }
@@ -1,5 +1,5 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-06-11 | Updated: 2026-06-11 -->
2
+ <!-- Generated: 2026-06-11 | Updated: 2026-06-14 -->
3
3
 
4
4
  # util
5
5
 
@@ -9,9 +9,11 @@ General utilities, helper functions, and shared types used across the applicatio
9
9
  ## Key Files
10
10
  | File | Description |
11
11
  |------|-------------|
12
- | `update-check.ts` | Async check for newer npm versions |
13
- | `retry.ts` | Rate-limit backoff and generic retry mechanisms |
12
+ | `clipboard-image.ts` | Brief description of purpose |
13
+ | `env.ts` | Brief description of purpose |
14
14
  | `provider-error.ts` | Error normalization helpers |
15
+ | `retry.ts` | Rate-limit backoff and generic retry mechanisms |
16
+ | `update-check.ts` | Async check for newer npm versions |
15
17
 
16
18
  ## Subdirectories
17
19
  *(None)*