# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

> **Note**: Version numbers reset at v0.1.0 with the WebUI-first rewrite and
> jumped again to v2.0.0 at the 2026-04-21 monorepo re-consolidation.
> For the TUI-era changelog (v0.0.1–v0.20.0), see [Legacy Changelog](#legacy-tui-era-v001v0200).

## [3.2.0] - 2026-05-11 — multi-pane display modes + WebUI prefs store

WebUI dogfooding feature drop. The agent main panel learns four layouts
(Tabs / Split-H / Split-V / Triple) instead of a single split-or-fullscreen
toggle, and a new browser-only prefs store finally consolidates the
ad-hoc `tmai:*` localStorage keys behind one schema. Bundles the
`core-v3.0.1` patch from PR #639. Wire / engine unchanged from v3.1.1
otherwise (tmai-core 3.0.1, ratatui 0.2.0, api-spec 3.0.1).

### Bundled

- tmai-core 3.0.1 (`core-v3.0.1`)
- clients/react 2.2.0
- clients/ratatui 0.2.0 (unchanged)
- api-spec 3.0.1 (unchanged from PR #639)

### Added

- **Four display modes for the agent main panel**, switchable via a
  segmented control in the panel header or `\` to cycle. `tabs` keeps a
  single viewport with a 3-tab bar (preview / git / docs) and mounts all
  three so xterm scrollback and graph layouts survive tab swaps.
  `split-h` / `split-v` give the existing left-right (or new top-bottom)
  split with a draggable divider. `triple` shows preview + git + docs
  simultaneously with two independent dividers.
- **Unified WebUI prefs store** at `localStorage["tmai:ui:prefs"]`
  (`lib/ui-prefs.ts` + `UIPrefsProvider`). Replaces the per-feature
  `tmai:split-ratio` / `tmai:split-v-ratio` / `tmai:dev-show-auto-discovered`
  keys via one-shot migration on first load. Schema-validated: corrupt
  fields fall back to defaults without nuking siblings; the consolidated
  blob fires storage events once per change for cheap cross-tab sync.
- **WAI-ARIA Window Splitter keyboard support** on every divider
  (Split-H / Split-V / Triple outer / Triple inner). Arrow keys nudge by
  ~2.5%, Home / End snap to min / max, double-click resets to centre.
- **Settings panel grouping**: a new "WebUI (this browser)" header
  separates browser-stored prefs (Display & Layout section, with a
  ConfirmDialog-gated "Reset all WebUI prefs" button) from the existing
  "tmai (core)" sections that write to `~/.config/tmai/config.toml`.

### Changed

- `useSplitPane` is now controlled (`initialRatio` + `onCommit`) so
  persistence is owned by the prefs store. Drag stays in-memory; the
  prefs blob is only touched on mouseup or a programmatic adjust.

### Removed

- Auto-discovered agent surface (`is_auto_discovered` filter,
  `DeveloperSection`, `useShowAutoDiscovered`, `UIPrefs.showAutoDiscovered`,
  the wire field) — detection canonicalization (core v3.0.0) removed the
  underlying flow so the UI hatch had nothing left to gate.

## [3.1.1] - 2026-05-10 — focus ring + scrollbar polish

WebUI dogfooding follow-up to v3.1.0. Visual polish only — no wire / engine
changes (tmai-core stays 3.0.0, ratatui 0.2.0, api-spec 3.0.0).

### Bundled

- tmai-core 3.0.0 (`core-v3.0.0`, unchanged)
- clients/react 2.1.1
- clients/ratatui 0.2.0 (unchanged)
- api-spec 3.0.0 (unchanged)

### Fixed

- **Active panel is visibly selected**. TerminalPanel had no focus indicator
  at all and PreviewPanel's 1 px / 30 % cyan whisper barely registered. Both
  panels now share an inset-shadow recipe — 2 px / 55 % cyan + faint inner
  glow when focused, faint 1 px / 4 % white outline otherwise — driven off
  `focusin` / `focusout` on the panel wrapper so xterm's helper textarea
  bubbles through naturally.
- **xterm scrollbar gutter retires when empty**. xterm ships
  `.xterm-viewport` with `overflow-y: scroll`, reserving a 6 px gutter on
  every terminal even when there is nothing to scroll yet. Override to
  `auto` and recolor the thumb to match the dark canvas (white/6 %, hover
  white/18 %) so the gutter only appears when scrollback overflows.

## [3.1.0] - 2026-05-10 — spawn flow polish

WebUI dogfooding pass smoothing the spawn → use → kill loop. No wire or
engine changes — bundle continues to ship `tmai-core 3.0.0`. clients/react
ticks to 2.1.0; ratatui and api-spec stay pinned.

### Bundled

- tmai-core 3.0.0 (`core-v3.0.0`, unchanged)
- clients/react 2.1.0
- clients/ratatui 0.2.0 (unchanged)
- api-spec 3.0.0 (unchanged)

### Changed

- **`+ New agent` is one click instead of two** — DirBrowser now renders
  the runtime buttons (`claude` / `codex` / `bash`) inline against the
  currently-browsed path. The old "Select this → close modal → pick a
  runtime in a secondary panel" flow is retired. Picker stays open
  until spawn succeeds, with errors surfaced inline. Settings's
  `default_project_root` picker and OrchestrationSection's scope picker
  keep the original "Select this" mode unchanged.

### Fixed

- **Type-ready on spawn / agent switch** — TerminalPanel grabs xterm
  focus on every fresh mount instead of waiting for the user to click
  into the panel. Also closes the spawn-time race where wire-delivered
  `pty_session_id` flips the panel from PreviewPanel → TerminalPanel
  mid-flight, leaving the hidden IME input's focus orphaned.
- **Kill no longer drops you into an empty pane** — when the resolved
  agent disappears (kill button, CC quit, dispatch unwind), selection
  hands off to a sibling in the same cwd (orchestrator first, matching
  sidebar order), then to any agent, and only clears when no agents
  remain. Reacts to the resolved target rather than `selection.id` so
  the spawn-time pre-resolution gap isn't misread as a death.

## [3.0.0] - 2026-05-10 — agent detection canonicalization

Major release closing the agent detection / state-model rebuild chain (Step 6
through 2026-05-09 detection canonicalization, decision
`tmai-core/.claude/decisions/2026-05-09-agent-detection-canonicalization.md`).
**Wire shape is breaking** — the `attention` axis collapses from a
`{required, reason?}` struct to a flat string enum
(`"started" | "halted" | "completed" | null`); `AttentionReason` is removed.
Mixing a v2.x client with a v3 engine (or vice-versa) is not supported.

### Bundled

- tmai-core 3.0.0 (`core-v3.0.0`)
- clients/react 2.0.0
- clients/ratatui 0.2.0
- api-spec 3.0.0

### Changed

- **`AgentSnapshot.attention` is now a string enum** — three variants flag
  user-blocked states; `null` means "running normally". Replaces the
  `{ required: bool, reason?: "completed" | "halted" }` struct shape that
  shipped in 2.x. UIs no longer branch on a `required` boolean — they switch
  on the discriminator (or check `attention === null`).
- **Three pills retire** — `Active`, `Wait`, `Bootstrap`. New pills:
  - `Started` (cyan) — agent just spawned; awaiting first prompt.
  - `Halted` (red) — at a permission/selection prompt.
  - `Done` (sky blue) — turn finished; awaiting next decision.
  - `Running` (muted gray, ambient) — `attention === null`; no UI action
    needed.
- **`PreToolUse` hook retired** — `tmai init` only configures `Stop`,
  `Notification`, `UserPromptSubmit`. Existing CC settings.json files keep
  working; on next `tmai init --force` the `PreToolUse` entry is dropped.
- **Auto-discovery retired** — tmai exclusively manages tmai-spawned agents.
  Manually-launched CCs no longer surface in the WebUI even with the dev
  toggle on. Restart picks live agents back up because the PTY-server
  dispatch ledger is the single canonical source.
- **PTY-server attention sampler retired** — the subtree CPU/IO/PTY-write
  quiet-signal aggregator is gone (~890 LOC). Attention is hook-driven
  exclusively (`Stop` → Completed, `Notification[PermissionPrompt]` →
  Halted, spawn → Started).

### Fixed

- L2-upgrade race that blanked the WebUI preview during the first hook —
  wire emit reordered to `Upserted(canonical) → Removed(provisional)` so
  the entity cache holds both keys through the swap.
- Steady-state preview-disappear after re-selecting a hook-resolved agent —
  `resolve_agent_key_in_state` falls through to target-based lookup when
  the parsed canonical id doesn't match the L2-upgraded state map.
- Terminal subscription tickets resolve via `agent.target` (PTY-server's
  spawn-time identity, stable across L2 upgrade) instead of Core's
  canonical id, which PTY-server doesn't track.

### Migration

- Re-run `tmai init --force` after upgrading to refresh `~/.claude/settings.json`
  with the new hook set (`PreToolUse` removed, `X-Tmai-Agent-Id: $TMAI_AGENT_ID`
  header added so spawned CCs route deterministically without cwd inference).
- Previous `~/.claude/settings.json.before-attention-rebuild-cleanup` backup
  remains the rollback path.

## [2.0.0] - 2026-04-22 — monorepo re-consolidation

First release under the two-repo structure adopted on 2026-04-21: a public
`trust-delta/tmai` monorepo that holds the UI layer, the wire contract, and the
release hub; and a private `trust-delta/tmai-core` that ships the engine
binary through artifact PRs and `core-v*` Releases.

### Bundled

- tmai-core 2.0.0
- clients/react 1.0.0
- clients/ratatui 0.1.0
- api-spec 2.0.0

### Added

- `api-spec/`, `clients/react/`, `clients/ratatui/` brought into this monorepo
  (subtree imports + fresh copy of the api-spec) from the now-archived
  `tmai-api-spec` / `tmai-react` / `tmai-ratatui`.
- `install.sh` curl-pipeable installer with platform detection and SHA-256
  verification; installs under `$PREFIX/bin` + `$PREFIX/share/tmai/{webui,api-spec}/`.
- Engine serves the WebUI from a filesystem path (`$TMAI_SHARE/webui/` →
  config `web.webui_path` → `<exe>/../share/tmai/webui/`) with SPA fallback.
- `/api/version` endpoint exposing `tmai_version` / `core_version` /
  `api_spec_version` / `error_taxonomy_version`.
- Generated spec / types pipeline: tmai-core publishes `openapi.json`,
  `corevents.schema.json`, `mcp-tools.json`, and TypeScript types to this repo
  via bot PRs (`bot/gen-spec-<sha>`).

### Changed

- Distribution: binaries ship as platform-specific bundle tarballs from this
  repo's Releases (`bin/tmai` + `bin/tmai-ratatui` + `share/tmai/webui/` +
  `share/tmai/api-spec/`). The previous crates.io path is frozen at 1.7.0.
- Wire contract refreshed to 2.0.0 (DispatchId / DispatchRefs / expanded
  CoreEvent payloads; see `api-spec/openapi.json`).

### Archived

- `trust-delta/tmai-api-spec` → content now under `api-spec/`
- `trust-delta/tmai-react` → content now under `clients/react/`
- `trust-delta/tmai-ratatui` → content now under `clients/ratatui/`

### Install

```bash
curl -fsSL https://raw.githubusercontent.com/trust-delta/tmai/main/install.sh | bash
```

See [`README.md`](README.md) for pinned-version / custom-prefix variants and supported platforms.

## Pre-split history (2025 – 2026-04-18)

> The entries below are from the pre-split / single-repo / 4-repo eras. Kept
> for reference; future changes will be tracked under 2.x above.

## [1.6.0] - 2026-04-05

### Added

- PR/CI status monitor with automatic notification to orchestrator (#229)
- Notify orchestrator agent on sub-agent state changes (#256)
- Orchestrator UX improvements: rename label to "Orchestrator", visual badge, pin to top, prevent duplicate spawn (#258)
- set_orchestrator MCP tool for re-registering agents as orchestrator after /resume (#268)
- MCP tools auto-approve rule preset (#254)

### Fixed

- MCP server reconnects after tmai restart by re-reading api.json on every request (#270)
- delete_worktree gracefully handles already-removed directories with prune + cleanup (#257)
- Orchestrator spawn respects tmux mode (#255)
- send_text character limit increased from 1024 to 32768 (#253)
- Flaky MCP client tests caused by parallel file access race (#274)

### Docs

- Comprehensive orchestration documentation update: MCP-driven workflow, config guide, recovery, competitive positioning (#272)

## [1.5.0] - 2026-04-05

### Added

- Orchestrator Agent with per-project workflow settings and Spawn Dialog integration (#226)
- send_prompt API/MCP for queuing prompts to idle/stopped agents (#225)
- dispatch_issue MCP tool for one-shot issue-to-agent workflow (#223)
- Issue context in spawn_worktree MCP tool via issue_number param (#222)
- Auto-rebase stale PRs after merge with conflict notification (#224)
- Stable agent IDs independent of tmux pane numbering (#232)
- Light mode / theme toggle with system preference support (#221)
- Browser notification when agent stops with idle threshold (#217)
- Click-to-copy commit SHA in git panel (#216)
- Issue-to-PR progress tracker in Issues tab (#201)
- Styled transcript rendering with Claude Code UI patterns (#200)
- Responsive layout for narrow viewports (#197)
- Bulk delete merged branches (#199)
- MCP server documentation (EN/JA) (#198)

### Fixed

- Kill tmux pane before worktree deletion (#202)
- Block worktree deletion during pending agent detection window (#220)

### Improved

- Reduce O(n²) complexity in compute_branch_parents() (#219)
- Make audit validation periodic instead of every-poll (#214)
- Extract repo validation helper for GitHub API endpoints (#209)
- Deduplicate CI status rollup computation (#205)
- Deduplicate session lookup functions (#206)
- Extract common fallback chain in CommandSender (#207)
- Replace custom floor_char_boundary with std (#211)

## [1.4.0] - 2026-04-04

### Added

- MCP server for programmatic agent orchestration (#186)
- Context-aware action buttons based on branch state in git panel (#187)
- Issue detail view in Issues tab, similar to PR detail panel (#189)
- PermissionDenied hook event integration into audit system (#190)
- Relative commit date display on branches in git panel (#193)
- TaskCreated hook event integration for task monitoring (#194)

### Fixed

- Add repo parameter to MCP GitHub/Git tools (#188)
- Add type field and write MCP server config to ~/.claude.json (#191)
- Preserve existing statusLine tool in tmai init (#191)
- Add repo parameter to spawn_worktree MCP tool
- Auto-force delete for squash-merged branches (#196)

## [1.3.0] - 2026-04-03

### Added

- JSONL web-native rendering: react-markdown + remark-gfm based transcript view with collapsible thinking blocks, expandable tool details, and tool-specific color coding (#183)
- Move to Worktree action for in-progress branches in git panel (#185)

### Changed

- Scope TUI-era keyboard shortcuts (h/j/k/l etc.) to TUI mode only in WebUI (#184)

### Improved

- TranscriptRecord now includes uuid, timestamp, thinking blocks, full tool input, and error status for richer data

## [1.2.1] - 2026-04-02

### Fixed

- Transcript record limit increased from 50 to 10,000 for full session scrollback (#179)
- Initial transcript load now reads full session history instead of last 100 lines (#180)

## [1.2.0] - 2026-04-01

### Added

- **Hybrid scrollback preview** — Live area uses capture-pane (ANSI), history area uses JSONL transcript. Resilient to context compaction and scrollback resets (#177)
- **Hook-based auto-approve via Defer Permission** — PreToolUse hooks can defer tool execution for tmai's Rules/AI/Hybrid evaluation. Zero-latency, structured data, no keystroke injection (#178)
- Documentation updates for hooks (PermissionDenied, TaskCreated events), terminal panel, worktree UI, and auto-approve

## [1.1.3] - 2026-04-01

### Added

- Unified PR card design between source and target views with CI status labels (#172)
- Sidebar icon state syncs with active right pane panel (#167)
- Solid merge lines from merged PR branches to merge commit in git graph (#156)
- Statusline hook integration for improved agent info accuracy (#155)
- Press Enter to switch from select mode to input mode (#152)

### Fixed

- Issues tab now stays stable when spawning worktree from git panel (#171)
- Worktree delete works for paths under .git/.claude/worktrees/ (#169)
- Create & Resolve now sends initial prompt through spawnWorktree (#168)
- Straight lines instead of curves for PR base dashed lines in git panel (#154)

### Changed

- Renamed Security Scan to Config Audit and extended scan targets (#153)

## [1.1.2] - 2026-03-31

### Added

- **Create & Resolve button** — Launch agent with issue context and auto-PR directly from the git panel (#141)
- WebUI dashboard screenshot in README

### Fixed

- Cursor overlay misalignment when tmux panes are horizontally split (#143)
- Markdown panel root path not resolved in split-pane view (#146)
- Conversation panel false focus ring when right panel has focus (#148)
- Usage stats not auto-fetched on startup when enabled in settings (#149)
- Pre-commit hook silently skipped frontend checks in worktrees — now auto-installs node_modules

## [1.1.1] - 2026-03-30

### Fixed

- Hook errors on every PostToolUse event — `tool_response` type changed from `String` to `Value` to match Claude Code v2.1.87+ payload format (#139)

### Added

- Issue-driven orchestration workflow guide (`doc/workflows/issue-driven-orchestration.md`)

## [1.1.0] - 2026-03-30

### Added

- **Split-pane layout** — Conversation panel left, git/markdown panel right with draggable divider (#131)
- **Worktree status badges on issues** — Show "In Progress" or "Worktree" badges on issues with linked worktrees, plus "Go to Worktree" navigation button (#130)
- **Remote-only branches in git panel** — Display branches that exist only on remote (#121)

### Fixed

- Settings not hot-reloading after PUT API calls (#128)
- Branch delete now offers checkbox to also delete remote tracking branch (#126)
- Git panel header shows correct total commit count (#124)
- Web assets rebuild for remote branches feature (#122)

### Security

- Update picomatch 4.0.3 → 4.0.4 (CVE fix) (#133)

## [1.0.0] - 2026-03-30

WebUI-first rewrite. The default mode is now a React + Vite web application with glassmorphism design.
TUI mode remains available via `--tmux` flag.

### Added

- **WebUI-first frontend** — React 19 + Vite + Tailwind v4, glassmorphism design, Chrome App Mode auto-open
- **Interactive terminal** — Full xterm.js terminal with WebGL rendering, WebSocket I/O, PTY spawn
- **Branch graph** — GitKraken-style lane-based SVG commit graph with branch hierarchy
- **GitHub integration** — PR status, CI checks (with re-run), issues panel, branch-to-issue linking, worktree-from-issue
- **Terminal cursor tracking** — Cyan block cursor overlay in preview panel
  - Two-tier detection: tmux `display-message` or `vt100` crate (IPC/wrap mode)
  - DOM marker injection for accurate positioning (handles line wrapping and CJK full-width characters)
  - Configurable via Settings panel (persists) or per-session footer toggle
- **RuntimeAdapter trait** — Abstraction over tmux/standalone runtime; enables WebUI without tmux
- **Standalone mode** — Hook/IPC-only operation, no tmux required
- **PTY spawn API** — Launch agents directly from WebUI with xterm.js terminal
- **Inter-agent messaging** — Send text between agents via `/agents/{from}/send-to/{to}`
- **Spawn bash terminal** — Open shell in tmux pane environment
- **Markdown viewer** — Browse and edit project documentation in-app
- **Worktree orchestration** — Create, delete, diff, and launch agents in Git worktrees from WebUI
- **Context compaction tracking** — Monitor compaction count (♻×N) and active subagents (⑂N) from hook events
- **Codex CLI WebSocket integration** — Connect to `codex app-server` JSON-RPC 2.0 API for real-time monitoring
- **Codex CLI hooks bridge** — `tmai codex-hook` + `tmai init --codex` for Codex event translation
- **Preview settings API** — `GET/PUT /api/settings/preview` with `[web] show_cursor` config option

### Changed

- Default mode switched from TUI to WebUI (use `--tmux` for TUI)
- Cargo workspace: 3-crate structure (tmai bin + tmai-core lib + tmai-app bin)

### Fixed

- HTTP hook 415 errors: accept raw bytes instead of requiring `Content-Type: application/json`
- Hook timeout unit corrected from milliseconds to seconds in `tmai init`
- rustls-webpki CRL matching vulnerability (updated to 0.103.10)
- HTTP hook timeout to prevent Claude Code stall when tmai is not running

### Dependencies

- vt100 0.16 (terminal cursor tracking)
- React 19, Vite 6, Tailwind v4, xterm.js 6, lucide-react
- tokio-tungstenite 0.29, notify 8.2, clap 4.6, ureq 3.3

---

## Legacy (TUI-era, v0.0.1–v0.20.0)

<details>
<summary>Click to expand TUI-era changelog</summary>

### v0.20.0 (2026-03-27)

- Git worktree orchestration (Phase B-1 + B-2)
- Context compaction tracking and subagent count from hook events

### v0.19.0 (2026-03-14)

- Codex CLI app-server WebSocket integration

### v0.18.0 (2026-03-11)

- Codex CLI hooks bridge integration

### v0.17.0 (2026-03-11)

- Effort level detection from Claude Code title icons

### v0.16.0 (2026-03-08)

- PreToolUse hook-based auto-approve with rule engine

### v0.15.0–v0.15.1 (2026-03-07)

- Stepwise preview split offset, review pane auto-close
- wezterm SSH domain fix

### v0.14.0 (2026-03-06)

- Fresh Session Review (hook-driven automatic code review)
- `line_wrap` config option

### v0.13.0 (2026-03-05)

- New Claude Code hook events (ConfigChange, WorktreeCreate/Remove, PreCompact)

### v0.12.0–v0.12.1 (2026-03-04)

- Worktree management (scan, list, create, overview screen)

### v0.11.0–v0.11.1 (2026-03-02–03)

- Hook-as-Teacher detection validation
- AskUserQuestion auto-approve fix

### v0.10.0–v0.10.3 (2026-03-01–02)

- Claude Code Hooks integration (event-driven detection)
- Security Monitor (9 rules)
- Hook payload format fixes

### v0.9.0 (2026-03-01)

- Security Monitor panel

### v0.8.0–v0.8.3 (2026-02-25–27)

- Usage monitoring, auto-refresh
- Agent definition scanner, Teams × Worktree mapping

### v0.7.0 (2026-02-25)

- Agent definition scanner, TeammateIdle/TaskCompleted notifications

### v0.6.0–v0.6.2 (2026-02-23–24)

- Facade API (TmaiCore), CoreEvent broadcast, Worktree monitoring, SortBy::Repository

### v0.5.0 (2026-02-21)

- Cargo workspace化 (tmai-core lib crate分離)

### v0.4.0–v0.4.5 (2026-02-19–21)

- Auto-approve (AI model), Web Remote voice input, IPC upgrade restart
- 4-mode auto-approve (Off/Rules/AI/Hybrid)

### v0.3.0–v0.3.2 (2026-02-14–18)

- Spinner grace period, git branch detection, demo mode
- Codex/Gemini detector improvements

### v0.2.0–v0.2.10 (2026-02-06–13)

- Agent Teams, IPC communication, detection audit log
- Permission mode detection, processing activity display
- Web API auth, external transmission detection

### v0.1.0–v0.1.4 (2026-01-27–02-05)

- Initial public release on crates.io
- Web Remote Control, PTY wrapping, passthrough mode
- Comprehensive documentation

### v0.0.1 (2026-01-25)

- Initial implementation

</details>
