# 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.0.0/).

## [Unreleased]

### Changed

- **Pi updated to 0.78.1** (from 0.74.0) — Claude Opus 4.8, subagent parallel fix, `--exclude-tools`, `--name`/`--session-id`, `ctx.mode`/`ctx.getSystemPromptOptions()` for extensions, SIGTERM/SIGHUP cleanup, clickable file paths, provider stability fixes
- **pi-mcp-adapter** updated to 2.9.0
- **AGENTS.md modularized** — extracted Coding Guidelines to `docs/coding-guidelines.md`, trimmed skill descriptions, cleaned up directory tree; AGENTS.md reduced from 142 to ~100 lines

### Removed

- **`code-intel/` extension** — `inspect_code`, `find_symbol`, `search_config` tools removed; LSP navigation and ast_grep_search cover the same use cases natively
- **Shared modules** — `exec.ts`, `lang-registry.ts`, `noise-dirs.ts` (only used by code-intel)
- **`web-tree-sitter`** devDependency (only used by code-intel)

### Changed

- **Extensions modularization** — each extension moved into its own folder with `index.ts` entry point (`kirby-indicator/`, `code-intel/`, `project-context/`, `questionnaire/`, `splash-screen/`, `todo/`, `toon-transformer/`), matching the existing `enhanced-edit/` layout
- **`lib/` directory removed** — `toon-transformer-core.ts` + `toon-validator.ts` moved into `toon-transformer/` folder (exclusively used there)
- **Each extension folder** has its own `package.json` with `pi.extensions` entry point
- **`enhanced-edit/` subdirectories** — reorganized into `lsp/`, `workspace/`, `replacers/`, `patches/`, `tools/`, `executors/` (from 18 flat files)
- **`shared/` cleanup** — removed dead `paths.ts`; moved `questionnaire-*`, `todo-component`, `global-state`, `toon-transformer.test` into owning extension folders
- **`kirby-indicator/` split** — `status-config.ts`, `phase.ts`, `frames.ts`, `index.ts`
- **`todo/` split** — `handlers.ts` (CRUD logic), `component.ts` (TodoListComponent), `index.ts` (registration)

## [0.4.0] - 2026-05-04

### Added

- **`code-intel.ts`** — `file_skeleton` + `get_function` tools for AST-guided code navigation (1:1 port of Dirac's skeleton + function extraction)

### Changed

- **Refactoring wave** — 15 commits covering: options objects replacing boolean params (7 instances), deep nesting → early returns, code duplication elimination (4 blocks), nested ternary → if/else (16 instances), complex conditionals → named booleans (21 instances), async noise removal (8 functions)
- **Module splits** — enhanced-edit (608→30 barrel + 252 replacers), todo (338→240+128), questionnaire (442→328 core + 90 types + 104 render)
- **`shared/`** — sub-modules moved from extensions root into `extensions/shared/`
- **SYSTEM.md** — improved system prompt + AST guidance

### Fixed

- **`enhanced-edit/`** — break circular dependency (Replacer type → replacer-helpers.ts)

### Removed

- **`dirac-mode.ts`** — anchor paradigm not useful; replaced by code-intel.ts approach

### Maintenance

- **pi-lens fork** — synced with upstream v3.8.40 (189 commits): server-aware LSP diagnostics, semgrep dispatch, dashboard widget, TypeScript 6.0.3, typebox 1.1.37
- **Pi packages updated** — pi-subagents 0.24.0, pi-web-access 0.10.7, pi-powerline-footer 0.5.1, pi-mcp-adapter 2.5.3, pi-btw 0.3.8 (new)
- **`.gitignore`** — added `powerline-footer/` (runtime state)

## [0.3.0] - 2026-04-26

### Added

- **`toon-transformer.ts` — tool-call sanitizer**: blocks bare `"{}"` / `"[]"` string literals (LLM serialization errors) and guards `read` against directory paths — blocked calls include a directory listing so the next attempt can target a specific file

### Changed

- **`enhanced-edit/`** — tilde expansion in all path arguments (`~/foo` now works in `edit`, `write`, and `multi_edit` patch paths); extracted `writeFileAndDiagnose()` and `diagnoseFile()` helpers; `computeBlockSimilarity()` and `resolvePatchPath()` take options objects instead of positional args
- **`cosmetics/` merger** — consolidated four duplicated message builders into two: `buildTimedMessage` (waiting/tool) and `buildSimpleMessage` (thinking/final)
- **`shared/design-system.ts`** — `progressBar()` now takes a `ProgressBarOptions` object instead of six positional parameters
- **`splash-screen.ts`** — extracted `renderBgCells()` helper from `overlayTextRow()`
- **`todo.ts`** — infers missing `action` from sibling params (text → add, id → toggle, neither → list); clearer toggle error message; updated `progressBar()` call site
- **`SYSTEM.md`** — sharpened `todo`/`read` tool quirk notes

## [0.2.0] - 2026-04-22

### Added

- `shared/paths.ts` — single source of truth for `piAgentDir()`, eliminating duplicate path derivation across extensions
- `shared/global-state.ts` — typed cross-extension state registry replacing ad-hoc `globalThis` casts
- Vitest test infrastructure with unit tests for pure functions

### Changed

- Consolidated `toon-transformer.ts` to use `shared/global-state.ts`
- `ui-chrome.ts` — replaced `any` types with proper `ExtensionContext` and `Theme`
- `splash-screen.ts` — replaced `any` theme type with `Theme`
- Updated `AGENTS.md` and `README.md` to reflect actual codebase state

### Removed

- `SPIRAL_FADE_START` constant from `splash-screen.ts` — commented-out dead code
- Unused `SEP` import
- Unused `toolName` parameter from `buildToolMessage()`
- Dead code cleanup from deleted extensions

## [0.1.0] - 2026-04-17

### Added

- **Enhanced Edit** — replaces built-in `edit` tool with 9-level fuzzy matching, atomic `multi_edit`, and automatic LSP diagnostics injection
- **Questionnaire** — structured multi-question UI with tab navigation and free-text fallback
- **Todo** — persistent todo list tool with inline rendering
- **Working Indicator** — animated status bar during agent work (thinking, streaming, tools), with Kirby persona
- **Kirby Working Indicator** — expressive Kirby ASCII art status bar (upstream default)
- **TOON Transformer** — converts JSON tool outputs to TOON format, saving ~40–60% tokens
- **Shared Design System** — reusable box drawing, icons, spinners, indicator animations, and text helpers

### Changed

- Extracted `computeBlockSimilarity()` in `replacers.ts` to eliminate duplicate similarity-scoring loops
- Extracted `buildDiagnosticsBlock()` / `formatDiagnosticsSection()` in `enhanced-edit` to eliminate duplicate LSP formatting blocks
- Added `boxTop`, `boxBottom`, `emptyRow`, `borderedLine`, `tableRow`, `themedStatusIcon`, `statusMessage` helpers to design system
- Added `LspManager` / `LspDiagnostic` interfaces to `enhanced-edit/src/index.ts`; removed `any` from LSP call sites
- Extracted `renderOptions()` and `renderSubmitTab()` from `questionnaire.ts` closure into module-level helpers

## [0.0.1–0.0.6] - 2026-03-30 to 2026-04-17

Early development. Initial extensions, provider management, local model support, and subagent infrastructure. Many components were later replaced by upstream packages or removed during the v0.3.0 cleanup.
