@legna-lnc/legnacode 1.5.3 โ†’ 1.5.4

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/CHANGELOG.md CHANGED
@@ -1,723 +1,727 @@
1
- # Changelog
2
-
3
- ๐ŸŒ [ไธญๆ–‡ๆ–‡ๆกฃ](./CHANGELOG.zh-CN.md)
4
-
5
- All notable changes to LegnaCode CLI will be documented in this file.
6
-
7
- ## [1.5.3] - 2026-04-21
8
-
9
- ### Features
10
-
11
- - **Hermes Self-Evolution Loop** โ€” Automatic learning closed loop: repeated tool patterns (3x) auto-generate SKILL.md via side-channel LLM; behavior corrections auto-write to `.legna/memory/`; no user confirmation needed. Background Review Agent extracts experience insights after each session.
12
- - **Qwen Model Adapter** โ€” Dedicated adapter for Qwen full series (qwen-plus, qwen-max, qwen-turbo, qwen-coder-plus, qwq-plus, qwen3-235b). Supports `thinking_budget` mapping, DashScope server-side web search (`enable_search`), `reasoning_content` streaming, and `content_filter` stop reason.
13
- - **WebUI Chat Viewer** โ€” New "่Šๅคฉ่ฎฐๅฝ•" panel in admin WebUI. Browse session history with full message rendering, collapsible thinking blocks, tool call visualization (input/output/error), and auto-scroll. Backend `/api/:scope/sessions/:id/messages` endpoint reads JSONL session files.
14
- - **WebUI Live Chat** โ€” `legna admin` WebUI now supports live chat via SSE streaming. Send messages, see streaming responses with thinking/tool-use visualization. Note: each message starts a new independent session (no multi-turn conversation); intended for quick API connectivity testing, not as a full chat client.
15
- - **Skill Auto-Create** โ€” `SkillPatternDetector.record()` was already wired but results were never surfaced. Now auto-creates skills from detected patterns and notifies user after the fact.
16
- - **Skill Improvement Path B** โ€” `skillImprovement` no longer gated to active skill execution. General conversation learning detects workflow preferences, behavior corrections, and coding style preferences every 10 user messages.
17
- - **Nudge System** โ€” Counter-driven session learning summary. Reports what was automatically learned (skills created, corrections captured, insights recorded) instead of suggesting the user go learn.
18
-
19
- ### Improvements
20
-
21
- - **onPreCompress Enhanced** โ€” Working state extraction added alongside existing exchange pair extraction. Captures current task, key decisions, file paths, and error patterns before context compression. High-priority drawer written to DrawerStore.
22
- - **Skill Version Backup** โ€” `applySkillImprovement` now backs up current SKILL.md to `.versions/` before overwriting. Changelog with last 20 versions maintained automatically.
23
- - **`/skillify` Unlocked** โ€” Removed `USER_TYPE === 'ant'` gate. All users can now capture session workflows as reusable skills.
24
-
25
- ### Bug Fixes
26
-
27
- - **WebUI inline script crash** โ€” Fixed `Unexpected token '<'` error caused by unescaped `</` sequences in inlined JavaScript. JS and CSS are now served as separate files (`/__admin__/app.js`, `/__admin__/app.css`) instead of being inlined into `<script>` tags.
28
-
29
- ## [1.5.2] - 2026-04-20
30
-
31
- ### Performance
32
-
33
- - **Async CodeGraph** โ€” `build()` and `walkDir()` converted from sync to async, yielding the event loop every 50 files. Added `maxDepth=10` depth limit and `visitedInodes` symlink loop protection. `save()` now uses async `writeFile`.
34
- - **undoTracker size guard** โ€” Added 1MB file size limit; files exceeding it skip undo snapshot recording (prevents OOM). `readFileSync` โ†’ async `readFile`.
35
- - **Async error file pre-injection** โ€” `extractErrorFiles` converted from `existsSync`+`readFileSync` to async `access`+`readFile`.
36
- - **stripCode dedup** โ€” `magicKeywords.ts` reduced `stripCode()` from 3-4 calls to 1, passing the result to all downstream functions.
37
- - **FileMemoryProvider TTL cache** โ€” `searchSolutions` and fallback file search now use 60s TTL cache, avoiding repeated disk reads on every prefetch.
38
- - **OML_SESSION_GUIDANCE cache** โ€” `attachments.ts` dynamic import cached at module level after first load.
39
- - **frustrationHint patterns hoisted** โ€” Regex array moved from function body to module-level constant.
40
-
41
- ### i18n
42
-
43
- - **Compacting status messages localized** โ€” "Compacting contextโ€ฆ" โ†’ "ๅ‡็ปƒไธŠไธ‹ๆ–‡โ€ฆ", "Compacting conversation" โ†’ "็ฒพ็‚ผๅฏน่ฏไธญ" for Chinese users.
44
- - **Turn completion verbs localized** โ€” New `getTurnCompletionVerbs()` function; Chinese users see "็ƒนๅˆถไบ† 5s" instead of "Baked for 5s".
45
-
46
- ### Cleanup
47
-
48
- - Deleted dead code `src/commands/undo.ts` (was never registered in command list).
49
- - Fixed dead conditional in `extractImports`.
50
-
51
- ## [1.5.1] - 2026-04-19
52
-
53
- ### Features
54
-
55
- - **Proactive skill invocation** โ€” Wired `OML_SESSION_GUIDANCE` (the "1% rule") into the `skill_listing` attachment. The AI now proactively considers available skills before every response, instead of only responding to explicit `/slash` commands.
56
- - **Frontend/design auto-guidelines** โ€” New `designPrompt.ts` detects frontend intent (UI, prototype, design exploration) from user input and transparently injects layered design guidelines (oklch colors, responsive layout, animation best practices, design exploration methodology). Zero user action required.
57
- - **Enhanced designer agent** โ€” `/oml:designer` now carries a full design methodology prompt (oklch palettes, mobile-first, ARIA accessibility, 3+ variation exploration) instead of a one-line description.
58
-
59
- ### Bug Fixes
60
-
61
- - **Skills were never proactively used** โ€” `OML_SESSION_GUIDANCE` was defined in `superpowers.ts` but never imported or injected anywhere. Now wired into the skill listing attachment.
62
-
63
- ## [1.5.0] - 2026-04-19
64
-
65
- ### Bug Fixes
66
-
67
- - **Fix REPL startup deadlock** โ€” The `/undo` command was registered via static `import` in `commands.ts`, creating a circular dependency (`commands.ts` โ†’ `undo.ts` โ†’ `commands.ts`) that caused Bun's module loader to deadlock. The REPL would hang with no output on launch. Fixed by removing the static import entirely. The `/undo` feature remains available via `src/services/undoTracker.ts` (wired into Edit/Write tools) but is no longer registered as a slash command to avoid the circular dependency.
68
-
69
- ### Features (carried from 1.4.8/1.4.9)
70
-
71
- - **AtomCode intelligence fusion** โ€” Pangu CJK spacing, negative feedback detection, tool call loop detection, error file pre-injection, first-read full file
72
- - **OpenAI-compatible bridge adapter** โ€” Anthropic โ†” OpenAI format translation for DeepSeek/Qwen/GLM/Ollama/vLLM/LM Studio
73
- - **Code Graph** โ€” Regex-based symbol index + file dependency graph (TS/JS/Python/Go/Rust)
74
- - **Parallel File Edit** โ€” One sub-agent per file with sibling skeletons
75
- - **Workflow Engine** โ€” Structured markdown step execution with checks and dependencies
76
- - **Cross-session knowledge** โ€” Auto-writes `.legna/knowledge.md` on session end
77
- - **Baseline builds** โ€” No-AVX binaries for older x64 CPUs (darwin-x64-baseline, linux-x64-baseline)
78
-
79
- ## [1.4.9] - 2026-04-17
80
-
81
- ### Features
82
-
83
- - **Baseline (no-AVX) builds** โ€” New platform packages for older x64 CPUs without AVX instruction set support:
84
- - `@legna-lnc/legnacode-darwin-x64-baseline` โ€” macOS Intel (pre-2011 or Hackintosh without AVX)
85
- - `@legna-lnc/legnacode-linux-x64-baseline` โ€” Linux x64 servers/VMs without AVX
86
- - Fixes `warn: CPU lacks AVX support, strange crashes may occur` error
87
- - Install: `npm i -g @legna-lnc/legnacode-darwin-x64-baseline` (use directly, not via main package)
88
-
89
- ## [1.4.8] - 2026-04-17
90
-
91
- ### Features
92
-
93
- - **AtomCode intelligence fusion (Layer A)** โ€” Lightweight agent intelligence, zero new dependencies:
94
- - **Pangu CJK spacing** โ€” Auto-inserts spaces between CJK and ASCII in Markdown rendering
95
- - **Negative feedback detection** โ€” Detects frustration ("still broken"/"้”™ไบ†"/"ใพใ ๅฃŠใ‚Œ"), injects strategy-shift hint (EN/ZH/JA)
96
- - **Tool call loop detection** โ€” Same (tool, args) 3+ times โ†’ blocks. Resets per user message
97
- - **Error file pre-injection** โ€” Bash fail โ†’ extracts file paths from stderr, auto-reads first 30 lines
98
- - **First-read full file** โ€” First encounter ignores offset/limit, forces full read
99
-
100
- - **OpenAI-compatible bridge adapter (Layer B1)** โ€” Full Anthropic โ†” OpenAI format translation:
101
- - Message format: `tool_use` โ†” `tool_calls`, `tool_result` โ†” `role: "tool"`
102
- - Tool schema: `input_schema` โ†” `function.parameters`
103
- - JSON repair for weak models (markdown fences, trailing commas, unbalanced brackets)
104
- - Supports: OpenAI, DeepSeek, Qwen, GLM, SiliconFlow, Ollama, vLLM, LM Studio
105
- - Activate: `OPENAI_COMPAT_BASE_URL` + `OPENAI_COMPAT_API_KEY` env vars
106
-
107
- - **Code Graph (Layer B2)** โ€” Regex-based symbol index + file dependency graph:
108
- - Languages: TypeScript/TSX, JavaScript, Python, Go, Rust
109
- - Incremental mtime updates, persisted to `<cwd>/.legna/.palace/graph.json`
110
- - **Wired:** auto-builds on session start, injects file summaries into prefetch context
111
-
112
- - **Parallel File Edit (Layer B3)** โ€” "One sub-agent per file" execution model:
113
- - Target file full text + sibling skeletons + interface contracts
114
- - **Wired:** integrated into `/dispatch` skill prompt with parallel edit instructions
115
-
116
- - **Workflow Engine (Layer B4)** โ€” Structured step execution:
117
- - Markdown `## Step N:` format with checks, failure handling, dependencies
118
- - **Wired:** WorkflowTool now parses steps, shows status, substitutes args
119
-
120
- - **/undo command** โ€” Reverts the last file edit (Edit or Write tool):
121
- - Tracks original content before each edit, max 20 entries per session
122
- - New file creation โ†’ undo deletes the file
123
-
124
- - **Cross-session knowledge persistence** โ€” Auto-writes `<cwd>/.legna/knowledge.md`:
125
- - Extracts key decisions/actions from last 10 assistant messages on session end
126
- - Appends timestamped entries, caps at 50KB
127
-
128
- - **Enhanced compiler error detection** โ€” Extended error file pre-injection:
129
- - Now matches compiler-style paths (`file.ts:42`, `file.py(10)`) in addition to standard paths
130
-
131
- ## [1.4.7] - 2026-04-16
132
-
133
- ### Features
134
-
135
- - **claude-mem memory intelligence fusion** โ€” Ported 5 lightweight techniques from claude-mem's persistent memory system into DrawerStore, zero new dependencies:
136
- - **Content-hash deduplication** โ€” `sha256(wing + room + content)` with 30-second window prevents duplicate observations during rapid compaction cycles
137
- - **Token economics tracking** โ€” Each drawer records `discoveryTokens` (cost to create) and `readTokens` (accumulated recall cost) for memory ROI analysis
138
- - **Relevance feedback** โ€” `relevanceCount` incremented on each search hit; frequently recalled memories get up to +100% importance boost via `importance * (1 + 0.1 * min(count, 10))`
139
- - **90-day time decay** โ€” `max(0.3, 1.0 - age_days / 90)` applied to both search similarity and importance ranking. Old memories fade but never fully disappear
140
- - **Privacy tag filtering** โ€” `<private>...</private>` content stripped to `[REDACTED]` before memory extraction. Zero config, just wrap sensitive text in tags
141
-
142
- ### Architecture
143
-
144
- - Modified `src/memdir/vectorStore/types.ts` โ€” Drawer gains `discoveryTokens`, `readTokens`, `relevanceCount`, `contentHash` fields
145
- - Modified `src/memdir/vectorStore/drawerStore.ts` โ€” Schema migration (4 new columns), content-hash dedup in upsert, relevance feedback in search, time decay in search + topByImportance
146
- - Modified `src/memdir/vectorStore/exchangeExtractor.ts` โ€” `stripPrivate()` applied before pair extraction
147
-
148
- ## [1.4.6] - 2026-04-16
149
-
150
- ### Bug Fixes
151
-
152
- - **OML skill crash fix** โ€” All 40 OML skills (16 superpowers + 5 orchestrators + 19 agents) returned `string` instead of `ContentBlockParam[]` from `getPromptForCommand`, causing `result.filter is not a function` crash on `/ultrawork`, `/ralph`, `/autopilot`, etc. Now wrapped as `Promise<[{ type: 'text', text }]>`.
153
- - **Statusline writes to wrong config dir** โ€” `statuslineSetup` agent hardcoded `~/.claude/settings.json` and `~/.claude/statusline-command.sh`. Fixed to `~/.legna/`.
154
-
155
- ### Improvements
156
-
157
- - **Plans moved to project-local** โ€” Default plan directory changed from `~/.legna/plans/` to `<cwd>/.legna/plans/`. Plans now live alongside the project they belong to.
158
- - **Auto-memory moved to project-local** โ€” Default auto-memory path changed from `~/.legna/projects/<slug>/memory/` to `<cwd>/.legna/memory/`. First startup auto-migrates files from the legacy global path (non-destructive, never overwrites).
159
- - **Compound engineering seamless fusion** โ€” Knowledge compounding from compound-engineering-plugin, injected into 3 existing automation points with zero new commands:
160
- - `onPreCompress`: high-value exchange pairs auto-written to `docs/solutions/` (opt-in via `mkdir docs/solutions`)
161
- - `prefetch`: auto-searches `docs/solutions/` for past learnings when user asks related questions
162
- - `magicKeywords`: deep scope detection (refactor/migrate/architecture) appends a lightweight compound hint
163
- - **Legacy path comments cleaned** โ€” Updated stale `~/.claude/projects/` references in memdir, extractMemories, settings types
164
-
165
- ## [1.4.5] - 2026-04-13
166
-
167
- ### Features
168
-
169
- - **OpenViking content tiering fusion** โ€” Ported L0/L1/L2 three-tier content grading from OpenViking's context database:
170
- - **Content Tiering** โ€” Each drawer auto-generates L0 (one-sentence summary, ~25 words) and L1 (core overview, ~200 words) at upsert time. L2 is the full verbatim content.
171
- - **Budget-aware wake-up** โ€” `wakeUp()` now accepts a token budget (default 800) and greedily fills it with L1 content, degrading to L0 when budget is tight.
172
- - **Budget-capped recall** โ€” New `recallWithBudget()` method: L2โ†’L1โ†’L0 degradation strategy ensures recall never exceeds character budget.
173
- - **CJK-aware token estimation** โ€” `estimateTokens()` handles mixed CJK/Latin text.
174
- - **SQLite schema migration** โ€” Existing DrawerStore databases auto-migrate with `ALTER TABLE ADD COLUMN`.
175
- - **Fixed recallByTopic()** โ€” Now passes actual query for vector ranking instead of empty string.
176
-
177
- ## [1.4.4] - 2026-04-11
178
-
179
- ### Improvements
180
-
181
- - **Status messages moved to spinner line** โ€” autocompact / output truncated / interrupted status messages no longer insert system messages into the conversation; they now display temporarily on the spinner animation line, flashing briefly without polluting context
182
- - **ToolUseContext adds setSpinnerMessage** โ€” generic spinner text callback allowing the query loop to update spinner status at any time
183
- - **LegnaCode vs Claude Code comparison doc** โ€” added [COMPARISON.md](./COMPARISON.md) with 60+ item-by-item comparison across 9 categories
184
-
185
- ## [1.4.3] - 2026-04-11
186
-
187
- ### Features
188
-
189
- - **mempalace memory architecture integration** โ€” ported mempalace core memory system, pure TypeScript implementation, zero external dependencies:
190
- - **DrawerStore** โ€” SQLite-persisted vector memory storage + WAL audit log, deterministic drawer ID (sha256 idempotent upsert)
191
- - **TF-IDF vectorizer** โ€” pure TS implementation (Porter stemming + cosine similarity), <10K drawer search <5ms
192
- - **4-layer memory stack** โ€” L0 identity (~100 tokens) + L1 top drawers (~500-800 tokens) loaded every turn, L2/L3 recalled on demand. Per-turn tokens reduced from ~8K to ~800 (~88% savings)
193
- - **Temporal knowledge graph** โ€” SQLite entity-relation storage, supports triples with validity periods and point-in-time queries
194
- - **Room auto-classification** โ€” 6 categories (facts/decisions/events/discoveries/preferences/advice) with keyword scoring
195
- - **Exchange pair extractor** โ€” Q+A paired chunking + 5-category tag scoring (decisions/preferences/milestones/problems/emotional)
196
- - **Auto-migration** โ€” automatically migrates existing .legna/memory/*.md files to DrawerStore on first startup
197
- - **PreCompact memory save** โ€” automatically extracts high-value exchange pairs to DrawerStore before compaction, preventing memory loss
198
-
199
- ### Architecture
200
-
201
- - Added `src/memdir/vectorStore/` โ€” complete vector memory system (8 files)
202
- - `types.ts` โ€” Drawer, SearchResult, MetadataFilter types
203
- - `tfidfVectorizer.ts` โ€” TF-IDF + Porter stemming + cosine similarity
204
- - `drawerStore.ts` โ€” SQLite persistence + WAL + vector search
205
- - `roomDetector.ts` โ€” content auto-classification
206
- - `layeredStack.ts` โ€” 4-layer memory stack
207
- - `knowledgeGraph.ts` โ€” temporal knowledge graph
208
- - `exchangeExtractor.ts` โ€” exchange pair extraction + tag scoring
209
- - `migration.ts` โ€” .md โ†’ DrawerStore auto-migration
210
- - Upgraded `src/memdir/providers/FileMemoryProvider.ts` โ€” DrawerStore + LayeredStack backend
211
- - Wired `src/services/compact/autoCompact.ts` โ€” calls onPreCompress before compaction
212
-
213
- ## [1.4.2] - 2026-04-11
214
-
215
- ### Features
216
-
217
- - **verbose enabled by default** โ€” users now see full tool execution progress and status information by default
218
- - **Token/Timer instant display** โ€” removed 30-second delay, token count and elapsed time shown from second 1
219
- - **Autocompact status visible** โ€” displays "Compacting conversation context..." system message during conversation compaction
220
- - **Interrupt reason visible** โ€” shows abort reason on interruption (streaming and tool_execution phases)
221
- - **Output truncated retry prompt** โ€” displays retry progress during max output tokens recovery
222
- - **Tool execution logging** โ€” StreamingToolExecutor outputs current tool name and queue depth
223
- - **Microcompact/Snip logging** โ€” added debug logging for compaction operations
224
- - **ForkedAgent startup logging** โ€” outputs label and ID when child agent starts
225
-
226
- ### Bug Fixes
227
-
228
- - **Apple Terminal notification logic fix** โ€” bell is now sent only when bell is not disabled (logic was previously inverted)
229
-
230
- ## [1.4.0] - 2026-04-11
231
-
232
- ### Features
233
-
234
- - **MiniMax deep native integration** โ€” when using MiniMax models with `MINIMAX_API_KEY` configured, automatically registers 6 native multimodal tools:
235
- - `MiniMaxImageGenerate` โ€” image generation (POST /v1/image_generation)
236
- - `MiniMaxVideoGenerate` โ€” video generation + async polling (POST /v1/video_generation)
237
- - `MiniMaxSpeechSynthesize` โ€” text-to-speech (POST /v1/t2a_v2)
238
- - `MiniMaxMusicGenerate` โ€” music generation (POST /v1/music_generation)
239
- - `MiniMaxVisionDescribe` โ€” image understanding VLM (POST /v1/coding_plan/vlm)
240
- - `MiniMaxWebSearch` โ€” web search (POST /v1/web_search)
241
- - **MiniMax auth command** โ€” `/auth-minimax` command to configure API key, persisted to `~/.legna/minimax-credentials.json`
242
- - **MiniMax tool schema export** โ€” `schemaExport.ts` supports exporting Anthropic-compatible tool schemas
243
- - **MiniMax multimodal skill pack** โ€” 5 built-in skills (image/video/speech/music/pipeline) guiding AI to orchestrate multimodal workflows
244
- - **Smart model routing** โ€” heuristic routing to fast/default/strong model tiers based on prompt complexity
245
- - **Autonomous skill detection** โ€” detects repetitive tool call patterns and prompts users to save as reusable skills
246
- - **Context compression enhancements**:
247
- - Tool output pre-pruning โ€” large tool_result blocks auto-trimmed before compact (head + tail preserved)
248
- - Budget pressure injection โ€” injects hints into tool results when context usage exceeds 80%, guiding the model to wrap up
249
- - **RPC subprocess tool execution** โ€” Unix Domain Socket RPC server + stub generator + code execution runner; AI-generated scripts can call back LegnaCode tools (Bash/Read/Write/Edit/Glob/Grep/WebFetch) via RPC, compressing multi-step operations into a single inference
250
- - **Memory Provider plugin system** โ€” abstract base class + registry + default FileMemoryProvider; supports one external provider running in parallel with built-in memory, full lifecycle (initialize/prefetch/syncTurn/shutdown) + optional hooks (onTurnStart/onSessionEnd/onPreCompress/onDelegation)
251
- - **Cross-session memory search** โ€” `/recall` command searches historical session JSONL files with keyword matching + relevance ranking
252
- - **Worker thread pool** โ€” large file operations / batch searches can be offloaded to worker threads, avoiding main thread blocking
253
-
254
- ### Architecture
255
-
256
- - Added `src/tools/MiniMaxTools/` โ€” complete MiniMax multimodal tool directory (client, endpoints, 6 buildTool tools, conditional registration, schema export)
257
- - Added `src/services/rpc/` โ€” RPC subprocess tool execution (rpcServer.ts, stubGenerator.ts, codeExecutionRunner.ts)
258
- - Added `src/memdir/providers/` โ€” Memory Provider plugin system (MemoryProvider.ts abstract base class, FileMemoryProvider.ts default implementation, registry.ts registry)
259
- - Added `src/services/modelRouter.ts` โ€” task complexity estimation + model tier routing
260
- - Added `src/services/skillAutoCreate.ts` โ€” tool call pattern detector, integrated into toolExecution.ts
261
- - Added `src/services/compact/toolOutputPruner.ts` โ€” tool output pre-pruning, integrated into autoCompact.ts
262
- - Added `src/services/compact/budgetPressure.ts` โ€” context budget pressure injection, integrated into query.ts
263
- - Added `src/services/sessionSearch.ts` โ€” cross-session search engine
264
- - Added `src/commands/recall/` โ€” `/recall` command
265
- - Added `src/commands/auth/` โ€” `/auth-minimax` command
266
- - Added `src/skills/builtin-minimax/` โ€” 5 MiniMax multimodal skill files
267
- - Added `src/utils/workerPool.ts` โ€” worker thread pool
268
-
269
- ## [1.3.7] - 2026-04-09
270
-
271
- ### Bug Fixes
272
-
273
- - **Resume session detection** โ€” `legna resume` failed to discover sessions written to `<project>/.legna/sessions/` since v1.3.0. `getStatOnlyLogsForWorktrees()` only scanned the global `~/.legna/projects/`; it now also scans the project-local sessions directory, consistent with `fetchLogs()` behavior
274
- - **Interrupted diagnostics logging** โ€” added abort reason + call stack logging at `onCancel()` and `query.ts` interrupt points; traceable under `--verbose` mode
275
-
276
- ### Enhancements
277
-
278
- - **Priority-now interrupt visibility** โ€” when a queued command interrupts the current task, the command summary is logged to debug log instead of silently aborting
279
- - **Background task status visibility** โ€” footer pill shows real-time activity summary for a single background agent (latest tool + token stats); task completion notification includes progress statistics
280
-
281
- ### Architecture
282
-
283
- - `src/utils/sessionStorage.ts` โ€” `getStatOnlyLogsForWorktrees()` Path A/B both include `.legna/sessions/` scanning
284
- - `src/query.ts` โ€” abort reason logging added at both `createUserInterruptionMessage` call sites
285
- - `src/screens/REPL.tsx` โ€” `onCancel()` call stack logging, priority-now useEffect logs command summary
286
- - `src/tasks/pillLabel.ts` โ€” single agent task displays `getActivitySummary()` real-time activity
287
- - `src/tasks/LocalMainSessionTask.ts` โ€” `completeMainSessionTask` captures progress, notification includes statistics
288
-
289
- ## [1.3.6] - 2026-04-09
290
-
291
- ### Bug Fixes
292
-
293
- - **Windows Edit tool path separator false positive** โ€” fixed [#7935](https://github.com/anthropics/claude-code/issues/7935): on Windows, after reading a file with forward slashes (`D:/path`), Edit/MultiEdit tools reported "File has been unexpectedly modified" error. Root cause: `path.normalize()` does not always convert `/` to `\` in certain runtimes (Bun compiled binary + Git Bash/MINGW environment), causing FileStateCache key mismatch
294
- - `FileStateCache` added `normalizeKey()` โ€” explicitly replaces `/` with the native separator (Windows: `\`) after `path.normalize()`, ensuring `D:/foo` and `D:\foo` always hit the same cache entry
295
- - `expandPath()` added `ensureNativeSeparators()` โ€” all returned paths force backslashes on Windows as a defensive fix
296
-
297
- ### Architecture
298
-
299
- - `src/utils/fileStateCache.ts` โ€” `normalizeKey()` replaces bare `normalize()`, imports `sep`
300
- - `src/utils/path.ts` โ€” `ensureNativeSeparators()` wraps all `normalize()`/`resolve()`/`join()` return values
301
-
302
- ## [1.3.5] - 2026-04-07
303
-
304
- ### Bug Fixes
305
-
306
- - **SessionStart hook error** โ€” OML's SessionStart hook used `type: 'prompt'`, but the SessionStart phase has no `toolUseContext` (LLM call context), causing a guaranteed crash. Removed SessionStart hook; skill guidance is now exposed through skill descriptions
307
- - **Windows alt-screen rendering flicker** โ€” in alt-screen mode, `fullResetSequence_CAUSES_FLICKER` was still triggered (viewport changes, scrollback detection, etc.), causing full-screen clear + redraw flicker. Added `altScreenFullRedraw()` method; in alt-screen mode, uses simple `CSI 2J + CSI H` (erase screen + cursor home) instead of `clearTerminal`'s Windows legacy path
308
- - **Windows drainStdin** โ€” previously skipped stdin draining entirely on Windows; residual mouse events caused input field corruption. Changed to flush buffered input events by toggling raw mode
309
-
310
- ### Architecture
311
-
312
- - `src/ink/log-update.ts` โ€” 5 `fullResetSequence_CAUSES_FLICKER` call sites now check `altScreen`, added `altScreenFullRedraw()` method
313
- - `src/ink/ink.tsx` โ€” Windows `drainStdin` alternative (toggle raw mode)
314
- - `src/plugins/bundled/oml/definition.ts` โ€” removed SessionStart hook, OML upgraded to 1.2.0
315
-
316
- ## [1.3.4] - 2026-04-07
317
-
318
- ### New Features
319
-
320
- - **OML Superpowers engineering discipline** โ€” integrated obra/superpowers core skills, enforcing strict software engineering workflows for AI
321
- - `/verify` โ€” completion verification discipline: cannot claim completion without fresh evidence
322
- - `/tdd` โ€” TDD enforcement: RED-GREEN-REFACTOR, write tests before code
323
- - `/debug` โ€” 4-stage systematic debugging, question architecture after 3 failures
324
- - `/brainstorm` โ€” Socratic design: hard gate, no implementation allowed until design is approved
325
- - `/write-plan` โ€” break design into 2-5 minute tasks, zero placeholders
326
- - `/sdd` โ€” sub-agent driven development: implement โ†’ spec review โ†’ quality review, 3 stages
327
- - `/exec-plan` โ€” load plan file and execute tasks sequentially
328
- - `/dispatch` โ€” parallel sub-agent dispatch
329
- - `/code-review` โ€” dispatch reviewer sub-agent
330
- - `/worktree` โ€” Git worktree isolated development
331
- - `/finish-branch` โ€” branch wrap-up (merge/PR/keep/discard)
332
- - **SessionStart skill guidance** โ€” automatically injects OML skill guidance prompt at session start ("1% rule")
333
- - OML plugin version upgraded to 1.1.0, 35 built-in skills total
334
-
335
- ### Architecture
336
-
337
- - `src/plugins/bundled/oml/superpowers.ts` โ€” 11 engineering discipline skills + SessionStart guidance
338
- - `src/plugins/bundled/oml/definition.ts` โ€” appended superpowers skills + SessionStart hook
339
-
340
- ## [1.3.3] - 2026-04-07
341
-
342
- ### New Features
343
-
344
- - **OML (Oh-My-LegnaCode) smart orchestration layer** โ€” built-in oh-my-claudecode core functionality, works out of the box
345
- - 5 orchestration skills: `/ultrawork` (parallel execution), `/ralph` (persistent loop), `/autopilot` (fully autonomous), `/ralplan` (plan then execute), `/plan-oml` (structured planning)
346
- - 19 specialized agent skills: `/oml:explore`, `/oml:planner`, `/oml:architect`, `/oml:executor`, `/oml:verifier`, etc.
347
- - Magic Keywords auto-detection: when prompt contains keywords like ultrawork/ralph/autopilot/ultrathink, orchestration directives are auto-injected (supports CJK and Vietnamese)
348
- - Can be enabled/disabled via `/plugin` UI (`oml@builtin`, enabled by default)
349
- - `OML_BUILTIN` feature flag controls compile-time DCE
350
-
351
- ### Bug Fixes
352
-
353
- - **Windows Terminal Fullscreen** โ€” automatically enables alt-screen mode in `WT_SESSION` environment, completely eliminating the cursor-up viewport yank bug (microsoft/terminal#14774). Covers WSL-in-Windows-Terminal. `CLAUDE_CODE_NO_FLICKER=0` to opt-out
354
-
355
- ### Architecture
356
-
357
- - `src/plugins/bundled/oml/` โ€” OML plugin module (definition, skills, agents, magicKeywords)
358
- - `src/plugins/bundled/index.ts` โ€” registered OML builtin plugin
359
- - `src/utils/processUserInput/processUserInput.ts` โ€” magic keyword detection integration point
360
- - `src/utils/fullscreen.ts` โ€” Windows Terminal fullscreen condition
361
-
362
- ## [1.3.2] - 2026-04-07
363
-
364
- ### Breaking Changes
365
-
366
- - **Disabled HISTORY_SNIP** โ€” `bunfig.toml` feature flag set to false, compile-time DCE removes all snip-related code (SnipTool, snipCompact, snipProjection, force-snip command, attachments nudge). Auto-compact is unaffected; context management reverts to the original mechanism
367
-
368
- ### Bug Fixes
369
-
370
- - **Windows Terminal streaming text** โ€” no longer disables streaming text display for all Windows; now only disabled under legacy conhost. Windows Terminal (detected via `WT_SESSION` environment variable) restores normal streaming rendering
371
-
372
- ## [1.3.1] - 2026-04-06
373
-
374
- ### Bug Fixes
375
-
376
- - **Snip-aware context window** โ€” 1M models are no longer prematurely snipped; `KEEP_RECENT` changed from hardcoded 10 to dynamic calculation (1M: 200, 500K: 100, 200K: 10)
377
- - **Snip nudge frequency** โ€” 1M model nudge threshold raised from 20 to 100 messages
378
- - **branch command branding** โ€” `/branch` resume prompt changed from `claude -r` to `legna -r`
379
- - **admin version fallback** โ€” displays correct version number when running from source
380
-
381
- ### Architecture
382
-
383
- - `src/services/compact/snipCompact.ts` โ€” added `getSnipThresholds(model)` dynamic threshold function; `snipCompactIfNeeded` and `shouldNudgeForSnips` gained model parameter
384
- - `src/query.ts` / `src/QueryEngine.ts` / `src/commands/force-snip-impl.ts` โ€” pass model parameter
385
-
386
- ## [1.3.0] - 2026-04-04
387
-
388
- ### New Features
389
-
390
- - **Project-local storage** โ€” sessions, skills, memory, rules, and settings all moved down to `<project>/.legna/` directory
391
- - New sessions written to `<project>/.legna/sessions/<uuid>.jsonl`, traveling with the project
392
- - Project-level skills/rules/settings/agent-memory/workflows unified under `.legna/`
393
- - `.legna/` automatically added to `.gitignore`
394
- - **Global data migration** โ€” automatically migrates from `~/.claude/` to `~/.legna/` on first startup (one-way)
395
- - Migrates settings.json, credentials, rules, skills, agents, plugins, keybindings, etc.
396
- - Does not overwrite existing files; writes `.migration-done` marker on completion
397
- - `LEGNA_NO_CONFIG_SYNC=1` to disable
398
- - **`legna migrate` command** โ€” manual data migration
399
- - `--global` migrates global data only
400
- - `--sessions` migrates current project sessions to local only
401
- - `--all` migrates everything (default)
402
- - `--dry-run` preview mode
403
- - **Three-level fallback reads** โ€” automatically searches `.legna/` โ†’ `.claude/` โ†’ `~/.legna/` โ†’ `~/.claude/` when reading, zero-breakage backward compatibility
404
-
405
- ### Architecture
406
-
407
- - `src/utils/legnaPathResolver.ts` โ€” unified path resolution (PROJECT_FOLDER/LEGACY_FOLDER/resolveProjectPath)
408
- - `src/utils/ensureLegnaGitignored.ts` โ€” auto-gitignore utility
409
- - `src/utils/envUtils.ts` โ€” refactored global migration logic, removed old syncClaudeConfigToLegna
410
- - `src/utils/sessionStoragePortable.ts` โ€” added getLocalSessionsDir/getLegacyProjectsDir, refactored resolveSessionFilePath
411
- - `src/utils/sessionStorage.ts` โ€” session write path switched to project-local
412
- - `src/utils/listSessionsImpl.ts` โ€” multi-source scan and merge (local + global + legacy)
413
- - `src/commands/migrate/` โ€” CLI migration command
414
-
415
- ## [1.2.1] - 2026-04-04
416
-
417
- ### New Features
418
-
419
- - **Model Adapter Layer** โ€” unified third-party model compatibility framework, auto-detects model/endpoint and applies corresponding transforms
420
- - **MiMo (Xiaomi) adapter** โ€” api.xiaomimimo.com/anthropic, supports mimo-v2-pro/omni/flash (1M ctx)
421
- - simplifyThinking + forceAutoToolChoice + normalizeTools + stripBetas + injectTopP(0.95) + stripCacheControl
422
- - Handles content_filter / repetition_truncation stop_reason
423
- - **GLM (ZhipuAI) adapter** โ€” open.bigmodel.cn/api/anthropic, supports glm-5.1/5/5-turbo/4.7/4.6/4.5, etc.
424
- - Full standard transform suite, server-side auto-caching (strip cache_control)
425
- - **DeepSeek adapter** โ€” api.deepseek.com/anthropic, supports deepseek-chat/coder/reasoner
426
- - stripReasoningContent to avoid 400 errors, reasoner models auto-strip temperature/top_p
427
- - **Kimi (Moonshot) adapter** โ€” api.moonshot.ai/anthropic, supports kimi-k2/k2.5/k2-turbo, etc.
428
- - Preserves cache_control (Kimi supports prompt caching discount), stripReasoningContent
429
- - **MiniMax adapter** โ€” api.minimaxi.com/anthropic (China) + api.minimax.io/anthropic (international)
430
- - Supports MiniMax-M2.7/M2.5/M2.1/M2 full series (204K ctx), case-insensitive matching
431
- - Deep compatibility: preserves metadata, tool_choice, cache_control, top_p (other adapters need strip/force)
432
- - Only needs simplifyThinking + normalizeTools + stripBetas + stripUnsupportedFieldsKeepMetadata
433
-
434
- ### Architecture
435
-
436
- - `src/utils/model/adapters/index.ts` โ€” adapter registry + match/transform dispatch
437
- - `src/utils/model/adapters/shared.ts` โ€” 12 shared transform functions (including new stripUnsupportedFieldsKeepMetadata)
438
- - `src/utils/model/adapters/{mimo,glm,deepseek,kimi,minimax}.ts` โ€” 5 provider adapters
439
- - `src/services/api/claude.ts` โ€” paramsFromContext() calls applyModelAdapter() at the end
440
-
441
- ## [1.2.0] - 2026-04-03
442
-
443
- ### New Features
444
-
445
- - **Sessions grouped by project** โ€” WebUI session history panel groups sessions by project path
446
- - **resume command with cd** โ€” copied resume command auto-includes `cd` to project directory (Windows uses `cd /d`)
447
- - **Migration supports session history** โ€” config migration panel adds "also migrate session history" option, copies `projects/` directory
448
- - **Windows native compilation** โ€” Windows binary now compiled natively on Windows
449
-
450
- ### Fixed
451
-
452
- - Migration panel field names corrected to match actual settings.json fields
453
-
454
- ## [1.1.10] - 2026-04-03
455
-
456
- ### Fixed
457
-
458
- - **Windows compile script fix** โ€” `scripts/compile.ts` correctly handles `.exe` suffix on Windows, fixing the issue where compiled output file could not be found
459
- - **Windows native binary recompiled and published** โ€” recompiled native `legna.exe` using Windows-native Bun, replacing the previous cross-compiled version
460
-
461
- ## [1.1.9] - 2026-04-03
462
-
463
- ### Fixed
464
-
465
- - **postinstall auto-installs platform package** โ€” added `npm/postinstall.cjs`; during `npm install`, automatically detects and installs the corresponding platform binary package from the official registry, completely solving the issue where optionalDependencies fails on Windows/mirror registries
466
- - **Force official registry** โ€” postinstall uses `--registry https://registry.npmjs.org` to avoid 404 errors from unsynchronized mirrors (e.g., Taobao)
467
- - **bin wrapper simplified** โ€” removed runtime auto-install logic, now guaranteed by postinstall
468
-
469
- ## [1.1.8] - 2026-04-03
470
-
471
- ### Fixed
472
-
473
- - **Windows npm global install missing platform package** โ€” bin wrapper now auto-executes `npm install -g` for the corresponding platform package when it detects the package is not installed, no longer requiring manual user action
474
- - **bin wrapper path lookup optimization** โ€” fixed scope directory path joining under global node_modules flat layout
475
-
476
- ## [1.1.7] - 2026-04-03
477
-
478
- ### Fixed
479
-
480
- - **Completely fixed Windows external module error** โ€” cleared the compile external list; all stub modules (`@ant/*`, `@anthropic-ai/*`, native napi) are now bundled into the binary, no longer depending on runtime external modules
481
-
482
- ## [1.1.6] - 2026-04-03
483
-
484
- ### Fixed
485
-
486
- - **Windows external module error** โ€” removed `@anthropic-ai/sandbox-runtime`, `@anthropic-ai/mcpb`, `@anthropic-ai/claude-agent-sdk`, `audio-capture-napi`, `color-diff-napi`, `modifiers-napi` from the compile external list, letting stub code bundle directly into the binary; Windows no longer reports `Cannot find module`
487
- - **bin wrapper multi-path lookup** โ€” `npm/bin/legna.cjs` added global node_modules flat path and nested path fallback, improving cross-platform npm global install compatibility
488
- - **Version number automation** โ€” added `scripts/bump.ts` for one-click sync of version numbers across package.json, bunfig.toml, webui/package.json, and optionalDependencies
489
- - **Release process automation** โ€” rewrote `scripts/publish.ts` for one-click bump โ†’ build webui โ†’ compile all โ†’ publish npm
490
-
491
- ## [1.1.5] - 2026-04-03
492
-
493
- ### New Features
494
-
495
- - **WebUI admin panel** โ€” `legna admin` launches a browser-based admin panel (HTTP server + React SPA, default port 3456), visual management of both `~/.claude/` and `~/.legna/` config directories
496
- - **Config editing** โ€” edit API endpoint, API key, model mapping (Opus/Sonnet/Haiku), timeout, permission mode, language, and all other settings.json fields in the browser
497
- - **Config file switching** โ€” lists settings*.json files, shows baseUrl/model, one-click swap to activate
498
- - **Session history browsing** โ€” parses all session JSONL files under the projects directory, displays project path, slug, time, prompt count, and copy resume command
499
- - **Config migration** โ€” Claude โ†” LegnaCode bidirectional migration, supports full or selective field migration (env/model/permissions, etc.), preview diff before migration
500
- - **npm cross-platform publishing** โ€” bin wrapper (.cjs), compile-all cross-platform compilation (darwin/linux/win32), publish script
501
- - **OAuth disabled** โ€” `isAnthropicAuthEnabled()` returns false, removed OAuth login flow
502
-
503
- ### Fixed (1.1.1 ~ 1.1.5)
504
-
505
- - bin wrapper changed to `.cjs` to fix ESM `require` error
506
- - `optionalDependencies` platform package versions aligned
507
- - Terminal restored on admin server exit with screen clear
508
- - WebUI frontend inlined into binary, no longer depends on external `webui/dist/`
509
- - All package versions unified to 1.1.5
510
-
511
- ### Architecture
512
-
513
- - Backend: `src/server/admin.ts` โ€” Bun.serve REST API, SPA inlined as string constant
514
- - Frontend: `webui/` โ€” React 18 + Vite + Tailwind SPA, tab-based scope switching
515
- - Inlining: `scripts/inline-webui.ts` โ†’ `src/server/admin-ui-html.ts`
516
- - CLI: `src/entrypoints/cli.tsx` โ€” `admin` fast-path, zero extra module loading
517
-
518
- ## [1.0.9] - 2026-04-03
519
-
520
- ### New Features
521
-
522
- - **i18n multilingual completion** โ€” completed ~100 missing hardcoded English strings across 9 files, covering Spinner, teammate tree, pill labels, keyboard shortcut hints, Tips, and all other UI areas
523
- - **Built-in styled status bar** โ€” no external script configuration needed; displays directory, Git branch/sync status, model name (smart parsing to friendly name), colored context progress bar, and time by default; cross-platform compatible with Win/Mac/Linux
524
- - **Config auto-migration** โ€” automatically syncs `~/.claude/settings.json` to `~/.legna/settings.json` on startup; prints warning without overwriting when both sides differ; `LEGNA_NO_CONFIG_SYNC=1` to disable
525
-
526
- ### Changed
527
-
528
- - `~/.legna/` is now the preferred config directory, `~/.claude/` serves as compatibility fallback
529
- - Status bar model name auto-parsing: `Claude-Opus-4-6-Agentic[1m]` โ†’ `Opus 4.6`
530
- - `KeyboardShortcutHint` component "to" connector word internationalized (Chinese displays "โ†’")
531
-
532
- ### Files Changed
533
-
534
- | File | Changes |
535
- |------|---------|
536
- | `src/utils/i18n/zh.ts` | +50 translation entries |
537
- | `src/components/Spinner.tsx` | 7 i18n points |
538
- | `src/components/PromptInput/PromptInputFooterLeftSide.tsx` | 4 i18n points |
539
- | `src/components/design-system/KeyboardShortcutHint.tsx` | "to" internationalized |
540
- | `src/components/Spinner/teammateSelectHint.ts` | i18n |
541
- | `src/components/Spinner/TeammateSpinnerTree.tsx` | 6 i18n points |
542
- | `src/components/Spinner/TeammateSpinnerLine.tsx` | 7 i18n points |
543
- | `src/tasks/pillLabel.ts` | all pill labels i18n |
544
- | `src/services/tips/tipRegistry.ts` | 25 tips i18n |
545
- | `src/utils/builtinStatusLine.ts` | added: built-in status bar renderer |
546
- | `src/components/StatusLine.tsx` | integrated built-in status bar |
547
- | `src/utils/envUtils.ts` | config auto-migration logic |
548
-
549
- ## [1.0.8] - 2026-04-02
550
-
551
- ### New Features
552
-
553
- - **MONITOR_TOOL** โ€” MCP server health monitoring tool, supports start/stop/status operations, background periodic ping to detect connection status
554
- - **WORKFLOW_SCRIPTS** โ€” workflow automation system, reads `.claude/workflows/*.md` to execute multi-step workflows, `/workflows` command lists available workflows
555
- - **HISTORY_SNIP** โ€” session history trimming, model can proactively call SnipTool to remove old messages and free context, `/force-snip` for forced trimming, UI retains full history while model view is filtered
556
-
557
- ### Infrastructure
558
-
559
- - Added `src/tools/MonitorTool/MonitorTool.ts` โ€” MCP monitoring tool (buildTool construction)
560
- - Added `src/tasks/MonitorMcpTask/MonitorMcpTask.ts` โ€” monitoring background task lifecycle management
561
- - Added `src/components/permissions/MonitorPermissionRequest/` โ€” monitoring permission UI
562
- - Added `src/components/tasks/MonitorMcpDetailDialog.tsx` โ€” monitoring task detail dialog
563
- - Added `src/tools/WorkflowTool/WorkflowTool.ts` โ€” workflow execution tool
564
- - Added `src/tools/WorkflowTool/createWorkflowCommand.ts` โ€” workflow command scanning and registration
565
- - Added `src/tools/WorkflowTool/bundled/index.ts` โ€” built-in workflow registration entry
566
- - Added `src/tools/WorkflowTool/WorkflowPermissionRequest.tsx` โ€” workflow permission UI
567
- - Added `src/commands/workflows/` โ€” `/workflows` slash command
568
- - Added `src/tasks/LocalWorkflowTask/LocalWorkflowTask.ts` โ€” workflow background task (kill/skip/retry)
569
- - Added `src/components/tasks/WorkflowDetailDialog.tsx` โ€” workflow detail dialog
570
- - Added `src/services/compact/snipCompact.ts` โ€” trim trigger logic (rewrote stub)
571
- - Added `src/services/compact/snipProjection.ts` โ€” model view message filtering
572
- - Added `src/tools/SnipTool/SnipTool.ts` โ€” model-callable trimming tool
573
- - Added `src/tools/SnipTool/prompt.ts` โ€” SnipTool constants and prompt
574
- - Added `src/commands/force-snip.ts` โ€” `/force-snip` slash command
575
- - Added `src/components/messages/SnipBoundaryMessage.tsx` โ€” trim boundary UI component
576
- - 3 feature flags flipped: MONITOR_TOOL, WORKFLOW_SCRIPTS, HISTORY_SNIP
577
- - Cumulative 47/87 feature flags enabled
578
-
579
- ## [1.0.7] - 2026-04-02
580
-
581
- ### New Features
582
-
583
- - **TERMINAL_PANEL** โ€” `Alt+J` toggles built-in terminal panel (tmux persistent), TerminalCapture tool can read terminal content
584
- - **WEB_BROWSER_TOOL** โ€” built-in web browsing tool, fetches web page content and extracts text
585
- - **TEMPLATES** โ€” structured workflow template system, `legna new/list/reply` CLI commands, job status tracking
586
- - **BG_SESSIONS** โ€” background session management, `legna ps/logs/attach/kill/--bg`, tmux persistence + PID file discovery
587
-
588
- ### Infrastructure
589
-
590
- - Added `src/tools/TerminalCaptureTool/` โ€” tmux capture-pane tool (2 files)
591
- - Added `src/tools/WebBrowserTool/WebBrowserTool.ts` โ€” fetch + HTML text extraction
592
- - Added `src/jobs/classifier.ts` โ€” workflow turn classifier
593
- - Added `src/cli/handlers/templateJobs.ts` โ€” template CLI handler
594
- - Added `src/cli/bg.ts` โ€” background session CLI (5 handlers)
595
- - Added `src/utils/taskSummary.ts` โ€” periodic activity summary
596
- - Added `src/utils/udsClient.ts` โ€” active session enumeration
597
- - Cumulative 44/87 feature flags enabled
598
-
599
- ## [1.0.6] - 2026-04-02
600
-
601
- ### New Features
602
-
603
- - **CACHED_MICROCOMPACT** โ€” cache-aware tool result compression, deletes old tool_result via API cache_edits directive without breaking prompt cache
604
- - **AGENT_TRIGGERS** โ€” `/loop` cron scheduling command + CronCreate/Delete/List tools, local scheduled task engine
605
- - **TREE_SITTER_BASH** โ€” pure TypeScript bash AST parser (~4300 lines), used for command safety analysis
606
- - **TREE_SITTER_BASH_SHADOW** โ€” tree-sitter vs legacy parser shadow comparison mode
607
- - **MCP_SKILLS** โ€” auto-discovers and registers skill commands from MCP server `skill://` resources
608
- - **REACTIVE_COMPACT** โ€” auto-triggers context compression on 413/overload errors
609
- - **REVIEW_ARTIFACT** โ€” `/review` code review skill + ReviewArtifact tool
610
-
611
- ### Infrastructure
612
-
613
- - Rewrote `src/services/compact/cachedMicrocompact.ts` (from stub to 150+ line full implementation)
614
- - Added `src/services/compact/cachedMCConfig.ts` โ€” synchronous config module
615
- - Added `CACHE_EDITING_BETA_HEADER` to `src/constants/betas.ts`
616
- - Added `src/skills/mcpSkills.ts`, `src/services/compact/reactiveCompact.ts`
617
- - Added `src/tools/ReviewArtifactTool/`, `src/skills/bundled/hunter.ts`
618
- - Cumulative 40/87 feature flags enabled
619
-
620
- ## [1.0.5] - 2026-04-02
621
-
622
- ### New Features
623
-
624
- - **AGENT_TRIGGERS** โ€” `/loop` cron scheduling command, CronCreate/Delete/List tools, local scheduled task engine
625
- - **TREE_SITTER_BASH** โ€” pure TypeScript bash AST parser, used for command safety analysis
626
- - **TREE_SITTER_BASH_SHADOW** โ€” tree-sitter vs legacy parser shadow comparison mode
627
- - **MCP_SKILLS** โ€” auto-discovers and registers skill commands from MCP server `skill://` resources
628
- - **REACTIVE_COMPACT** โ€” auto-triggers context compression on 413/overload errors
629
- - **REVIEW_ARTIFACT** โ€” `/review` code review skill + ReviewArtifact tool + permission UI
630
-
631
- ### Infrastructure
632
-
633
- - Added `src/skills/mcpSkills.ts` โ€” MCP skill discovery module
634
- - Added `src/services/compact/reactiveCompact.ts` โ€” reactive compression strategy
635
- - Added `src/tools/ReviewArtifactTool/` โ€” code review tool
636
- - Added `src/components/permissions/ReviewArtifactPermissionRequest/` โ€” review permission UI
637
- - Added `src/skills/bundled/hunter.ts` โ€” /review skill registration
638
- - Cumulative 39/87 feature flags enabled
639
-
640
- ## [1.0.4] - 2026-04-02
641
-
642
- ### New Features
643
-
644
- - **ULTRAPLAN** โ€” `/ultraplan` structured multi-step planning command
645
- - **VERIFICATION_AGENT** โ€” auto-spawns verification Agent after batch task completion
646
- - **AUTO_THEME** โ€” auto-switches dark/light theme by querying terminal background color via OSC 11
647
- - **AGENT_MEMORY_SNAPSHOT** โ€” Agent memory snapshots
648
- - **FILE_PERSISTENCE** โ€” file persistence tracking
649
- - **POWERSHELL_AUTO_MODE** โ€” PowerShell auto mode
650
- - **HARD_FAIL** โ€” strict error mode
651
- - **SLOW_OPERATION_LOGGING** โ€” slow operation logging
652
- - **UNATTENDED_RETRY** โ€” unattended retry
653
- - **ALLOW_TEST_VERSIONS** โ€” allow test versions
654
-
655
- ### Infrastructure
656
-
657
- - Added `src/utils/systemThemeWatcher.ts` โ€” OSC 11 terminal theme detection and real-time monitoring
658
- - Cumulative 33/87 feature flags enabled
659
-
660
- ## [1.0.3] - 2026-04-02
661
-
662
- ### New Features
663
-
664
- - **COMMIT_ATTRIBUTION** โ€” tracks Claude's contribution ratio per commit, PR description auto-appends attribution trailer
665
- - **AWAY_SUMMARY** โ€” displays summary of what happened while user was away
666
- - **COMPACTION_REMINDERS** โ€” efficiency reminders during context compaction
667
- - **HOOK_PROMPTS** โ€” allows hooks to request user input
668
- - **BASH_CLASSIFIER** โ€” shell command safety classifier
669
- - **EXTRACT_MEMORIES** โ€” auto-extracts persistent memories from conversations
670
- - **SHOT_STATS** โ€” session statistics panel
671
- - **PROMPT_CACHE_BREAK_DETECTION** โ€” detects prompt cache invalidation
672
- - **ULTRATHINK** โ€” deep thinking mode
673
- - **MCP_RICH_OUTPUT** โ€” MCP tool rich text output
674
- - **CONNECTOR_TEXT** โ€” connector text enhancement
675
- - **NATIVE_CLIPBOARD_IMAGE** โ€” native clipboard image support
676
- - **NEW_INIT** โ€” improved project initialization flow
677
- - **DUMP_SYSTEM_PROMPT** โ€” debug system prompt export
678
- - **BREAK_CACHE_COMMAND** โ€” `/break-cache` command
679
- - **BUILTIN_EXPLORE_PLAN_AGENTS** โ€” built-in Explore/Plan Agents
680
-
681
- ### Infrastructure
682
-
683
- - Added `src/utils/attributionHooks.ts`, `attributionTrailer.ts`, `postCommitAttribution.ts` โ€” three attribution modules
684
-
685
- ## [1.0.2] - 2026-04-02
686
-
687
- ### New Features
688
-
689
- - **QUICK_SEARCH** โ€” `Ctrl+P` quick file open in fullscreen mode, `Ctrl+Shift+F` global symbol/content search
690
- - **MESSAGE_ACTIONS** โ€” copy, edit, retry and other actions on messages in fullscreen mode
691
- - **FORK_SUBAGENT** โ€” `/fork <directive>` session fork, child Agent inherits full conversation context and executes tasks in parallel
692
- - **HISTORY_PICKER** โ€” `Ctrl+R` opens history search dialog, replacing the previous inline search
693
-
694
- ### Infrastructure
695
-
696
- - Added `src/commands/fork/` command module and `UserForkBoilerplateMessage` UI component
697
-
698
- ## [1.0.1] - 2026-04-02
699
-
700
- ### New Features
701
-
702
- - **BUDDY virtual pet companion** โ€” `/buddy hatch` hatches an exclusive coding pet, 18 species, 5 rarities, random attributes
703
- - `/buddy hatch` hatch ยท `/buddy pet` pet ยท `/buddy stats` stats ยท `/buddy release` release
704
- - Pet comments in cute language based on conversation context, supports multilingual auto-switching
705
- - Re-hatching after release gives a different pet (generation counter)
706
- - **TOKEN_BUDGET** โ€” use `+500k` or `use 2M tokens` in prompts to set token budget, auto-tracks usage
707
- - **STREAMLINED_OUTPUT** โ€” environment variable `CLAUDE_CODE_STREAMLINED_OUTPUT=true` enables streamlined output
708
-
709
- ### Fixes
710
-
711
- - **Build system feature flags fix** โ€” `scripts/build.ts` now correctly reads `bunfig.toml`'s `[bundle.features]` and passes them to the `Bun.build()` API; previously all `feature()` calls defaulted to `false`
712
-
713
- ### Infrastructure
714
-
715
- - Added `scripts/compile.ts` replacing bare `bun build --compile`, ensuring compiled binary correctly applies feature flags
716
- - Added `src/buddy/companionObserver.ts` context-aware pet reaction system
717
- - Added `src/commands/buddy/` complete command module
718
-
719
- ## [1.0.0] - 2026-03-31
720
-
721
- - Initial release: LegnaCode CLI v1.0.0
722
- - Built on the Claude Code CLI open-source edition
723
- - Brand adaptation and customization
1
+ # Changelog
2
+
3
+ ๐ŸŒ [ไธญๆ–‡ๆ–‡ๆกฃ](./CHANGELOG.zh-CN.md)
4
+
5
+ All notable changes to LegnaCode CLI will be documented in this file.
6
+
7
+ ## [1.5.4] - 2026-04-21
8
+
9
+ Republish of 1.5.3 with all platform binaries in sync.
10
+
11
+ ## [1.5.3] - 2026-04-21
12
+
13
+ ### Features
14
+
15
+ - **Hermes Self-Evolution Loop** โ€” Automatic learning closed loop: repeated tool patterns (3x) auto-generate SKILL.md via side-channel LLM; behavior corrections auto-write to `.legna/memory/`; no user confirmation needed. Background Review Agent extracts experience insights after each session.
16
+ - **Qwen Model Adapter** โ€” Dedicated adapter for Qwen full series (qwen-plus, qwen-max, qwen-turbo, qwen-coder-plus, qwq-plus, qwen3-235b). Supports `thinking_budget` mapping, DashScope server-side web search (`enable_search`), `reasoning_content` streaming, and `content_filter` stop reason.
17
+ - **WebUI Chat Viewer** โ€” New "่Šๅคฉ่ฎฐๅฝ•" panel in admin WebUI. Browse session history with full message rendering, collapsible thinking blocks, tool call visualization (input/output/error), and auto-scroll. Backend `/api/:scope/sessions/:id/messages` endpoint reads JSONL session files.
18
+ - **WebUI Live Chat** โ€” `legna admin` WebUI now supports live chat via SSE streaming. Send messages, see streaming responses with thinking/tool-use visualization. Note: each message starts a new independent session (no multi-turn conversation); intended for quick API connectivity testing, not as a full chat client.
19
+ - **Skill Auto-Create** โ€” `SkillPatternDetector.record()` was already wired but results were never surfaced. Now auto-creates skills from detected patterns and notifies user after the fact.
20
+ - **Skill Improvement Path B** โ€” `skillImprovement` no longer gated to active skill execution. General conversation learning detects workflow preferences, behavior corrections, and coding style preferences every 10 user messages.
21
+ - **Nudge System** โ€” Counter-driven session learning summary. Reports what was automatically learned (skills created, corrections captured, insights recorded) instead of suggesting the user go learn.
22
+
23
+ ### Improvements
24
+
25
+ - **onPreCompress Enhanced** โ€” Working state extraction added alongside existing exchange pair extraction. Captures current task, key decisions, file paths, and error patterns before context compression. High-priority drawer written to DrawerStore.
26
+ - **Skill Version Backup** โ€” `applySkillImprovement` now backs up current SKILL.md to `.versions/` before overwriting. Changelog with last 20 versions maintained automatically.
27
+ - **`/skillify` Unlocked** โ€” Removed `USER_TYPE === 'ant'` gate. All users can now capture session workflows as reusable skills.
28
+
29
+ ### Bug Fixes
30
+
31
+ - **WebUI inline script crash** โ€” Fixed `Unexpected token '<'` error caused by unescaped `</` sequences in inlined JavaScript. JS and CSS are now served as separate files (`/__admin__/app.js`, `/__admin__/app.css`) instead of being inlined into `<script>` tags.
32
+
33
+ ## [1.5.2] - 2026-04-20
34
+
35
+ ### Performance
36
+
37
+ - **Async CodeGraph** โ€” `build()` and `walkDir()` converted from sync to async, yielding the event loop every 50 files. Added `maxDepth=10` depth limit and `visitedInodes` symlink loop protection. `save()` now uses async `writeFile`.
38
+ - **undoTracker size guard** โ€” Added 1MB file size limit; files exceeding it skip undo snapshot recording (prevents OOM). `readFileSync` โ†’ async `readFile`.
39
+ - **Async error file pre-injection** โ€” `extractErrorFiles` converted from `existsSync`+`readFileSync` to async `access`+`readFile`.
40
+ - **stripCode dedup** โ€” `magicKeywords.ts` reduced `stripCode()` from 3-4 calls to 1, passing the result to all downstream functions.
41
+ - **FileMemoryProvider TTL cache** โ€” `searchSolutions` and fallback file search now use 60s TTL cache, avoiding repeated disk reads on every prefetch.
42
+ - **OML_SESSION_GUIDANCE cache** โ€” `attachments.ts` dynamic import cached at module level after first load.
43
+ - **frustrationHint patterns hoisted** โ€” Regex array moved from function body to module-level constant.
44
+
45
+ ### i18n
46
+
47
+ - **Compacting status messages localized** โ€” "Compacting contextโ€ฆ" โ†’ "ๅ‡็ปƒไธŠไธ‹ๆ–‡โ€ฆ", "Compacting conversation" โ†’ "็ฒพ็‚ผๅฏน่ฏไธญ" for Chinese users.
48
+ - **Turn completion verbs localized** โ€” New `getTurnCompletionVerbs()` function; Chinese users see "็ƒนๅˆถไบ† 5s" instead of "Baked for 5s".
49
+
50
+ ### Cleanup
51
+
52
+ - Deleted dead code `src/commands/undo.ts` (was never registered in command list).
53
+ - Fixed dead conditional in `extractImports`.
54
+
55
+ ## [1.5.1] - 2026-04-19
56
+
57
+ ### Features
58
+
59
+ - **Proactive skill invocation** โ€” Wired `OML_SESSION_GUIDANCE` (the "1% rule") into the `skill_listing` attachment. The AI now proactively considers available skills before every response, instead of only responding to explicit `/slash` commands.
60
+ - **Frontend/design auto-guidelines** โ€” New `designPrompt.ts` detects frontend intent (UI, prototype, design exploration) from user input and transparently injects layered design guidelines (oklch colors, responsive layout, animation best practices, design exploration methodology). Zero user action required.
61
+ - **Enhanced designer agent** โ€” `/oml:designer` now carries a full design methodology prompt (oklch palettes, mobile-first, ARIA accessibility, 3+ variation exploration) instead of a one-line description.
62
+
63
+ ### Bug Fixes
64
+
65
+ - **Skills were never proactively used** โ€” `OML_SESSION_GUIDANCE` was defined in `superpowers.ts` but never imported or injected anywhere. Now wired into the skill listing attachment.
66
+
67
+ ## [1.5.0] - 2026-04-19
68
+
69
+ ### Bug Fixes
70
+
71
+ - **Fix REPL startup deadlock** โ€” The `/undo` command was registered via static `import` in `commands.ts`, creating a circular dependency (`commands.ts` โ†’ `undo.ts` โ†’ `commands.ts`) that caused Bun's module loader to deadlock. The REPL would hang with no output on launch. Fixed by removing the static import entirely. The `/undo` feature remains available via `src/services/undoTracker.ts` (wired into Edit/Write tools) but is no longer registered as a slash command to avoid the circular dependency.
72
+
73
+ ### Features (carried from 1.4.8/1.4.9)
74
+
75
+ - **AtomCode intelligence fusion** โ€” Pangu CJK spacing, negative feedback detection, tool call loop detection, error file pre-injection, first-read full file
76
+ - **OpenAI-compatible bridge adapter** โ€” Anthropic โ†” OpenAI format translation for DeepSeek/Qwen/GLM/Ollama/vLLM/LM Studio
77
+ - **Code Graph** โ€” Regex-based symbol index + file dependency graph (TS/JS/Python/Go/Rust)
78
+ - **Parallel File Edit** โ€” One sub-agent per file with sibling skeletons
79
+ - **Workflow Engine** โ€” Structured markdown step execution with checks and dependencies
80
+ - **Cross-session knowledge** โ€” Auto-writes `.legna/knowledge.md` on session end
81
+ - **Baseline builds** โ€” No-AVX binaries for older x64 CPUs (darwin-x64-baseline, linux-x64-baseline)
82
+
83
+ ## [1.4.9] - 2026-04-17
84
+
85
+ ### Features
86
+
87
+ - **Baseline (no-AVX) builds** โ€” New platform packages for older x64 CPUs without AVX instruction set support:
88
+ - `@legna-lnc/legnacode-darwin-x64-baseline` โ€” macOS Intel (pre-2011 or Hackintosh without AVX)
89
+ - `@legna-lnc/legnacode-linux-x64-baseline` โ€” Linux x64 servers/VMs without AVX
90
+ - Fixes `warn: CPU lacks AVX support, strange crashes may occur` error
91
+ - Install: `npm i -g @legna-lnc/legnacode-darwin-x64-baseline` (use directly, not via main package)
92
+
93
+ ## [1.4.8] - 2026-04-17
94
+
95
+ ### Features
96
+
97
+ - **AtomCode intelligence fusion (Layer A)** โ€” Lightweight agent intelligence, zero new dependencies:
98
+ - **Pangu CJK spacing** โ€” Auto-inserts spaces between CJK and ASCII in Markdown rendering
99
+ - **Negative feedback detection** โ€” Detects frustration ("still broken"/"้”™ไบ†"/"ใพใ ๅฃŠใ‚Œ"), injects strategy-shift hint (EN/ZH/JA)
100
+ - **Tool call loop detection** โ€” Same (tool, args) 3+ times โ†’ blocks. Resets per user message
101
+ - **Error file pre-injection** โ€” Bash fail โ†’ extracts file paths from stderr, auto-reads first 30 lines
102
+ - **First-read full file** โ€” First encounter ignores offset/limit, forces full read
103
+
104
+ - **OpenAI-compatible bridge adapter (Layer B1)** โ€” Full Anthropic โ†” OpenAI format translation:
105
+ - Message format: `tool_use` โ†” `tool_calls`, `tool_result` โ†” `role: "tool"`
106
+ - Tool schema: `input_schema` โ†” `function.parameters`
107
+ - JSON repair for weak models (markdown fences, trailing commas, unbalanced brackets)
108
+ - Supports: OpenAI, DeepSeek, Qwen, GLM, SiliconFlow, Ollama, vLLM, LM Studio
109
+ - Activate: `OPENAI_COMPAT_BASE_URL` + `OPENAI_COMPAT_API_KEY` env vars
110
+
111
+ - **Code Graph (Layer B2)** โ€” Regex-based symbol index + file dependency graph:
112
+ - Languages: TypeScript/TSX, JavaScript, Python, Go, Rust
113
+ - Incremental mtime updates, persisted to `<cwd>/.legna/.palace/graph.json`
114
+ - **Wired:** auto-builds on session start, injects file summaries into prefetch context
115
+
116
+ - **Parallel File Edit (Layer B3)** โ€” "One sub-agent per file" execution model:
117
+ - Target file full text + sibling skeletons + interface contracts
118
+ - **Wired:** integrated into `/dispatch` skill prompt with parallel edit instructions
119
+
120
+ - **Workflow Engine (Layer B4)** โ€” Structured step execution:
121
+ - Markdown `## Step N:` format with checks, failure handling, dependencies
122
+ - **Wired:** WorkflowTool now parses steps, shows status, substitutes args
123
+
124
+ - **/undo command** โ€” Reverts the last file edit (Edit or Write tool):
125
+ - Tracks original content before each edit, max 20 entries per session
126
+ - New file creation โ†’ undo deletes the file
127
+
128
+ - **Cross-session knowledge persistence** โ€” Auto-writes `<cwd>/.legna/knowledge.md`:
129
+ - Extracts key decisions/actions from last 10 assistant messages on session end
130
+ - Appends timestamped entries, caps at 50KB
131
+
132
+ - **Enhanced compiler error detection** โ€” Extended error file pre-injection:
133
+ - Now matches compiler-style paths (`file.ts:42`, `file.py(10)`) in addition to standard paths
134
+
135
+ ## [1.4.7] - 2026-04-16
136
+
137
+ ### Features
138
+
139
+ - **claude-mem memory intelligence fusion** โ€” Ported 5 lightweight techniques from claude-mem's persistent memory system into DrawerStore, zero new dependencies:
140
+ - **Content-hash deduplication** โ€” `sha256(wing + room + content)` with 30-second window prevents duplicate observations during rapid compaction cycles
141
+ - **Token economics tracking** โ€” Each drawer records `discoveryTokens` (cost to create) and `readTokens` (accumulated recall cost) for memory ROI analysis
142
+ - **Relevance feedback** โ€” `relevanceCount` incremented on each search hit; frequently recalled memories get up to +100% importance boost via `importance * (1 + 0.1 * min(count, 10))`
143
+ - **90-day time decay** โ€” `max(0.3, 1.0 - age_days / 90)` applied to both search similarity and importance ranking. Old memories fade but never fully disappear
144
+ - **Privacy tag filtering** โ€” `<private>...</private>` content stripped to `[REDACTED]` before memory extraction. Zero config, just wrap sensitive text in tags
145
+
146
+ ### Architecture
147
+
148
+ - Modified `src/memdir/vectorStore/types.ts` โ€” Drawer gains `discoveryTokens`, `readTokens`, `relevanceCount`, `contentHash` fields
149
+ - Modified `src/memdir/vectorStore/drawerStore.ts` โ€” Schema migration (4 new columns), content-hash dedup in upsert, relevance feedback in search, time decay in search + topByImportance
150
+ - Modified `src/memdir/vectorStore/exchangeExtractor.ts` โ€” `stripPrivate()` applied before pair extraction
151
+
152
+ ## [1.4.6] - 2026-04-16
153
+
154
+ ### Bug Fixes
155
+
156
+ - **OML skill crash fix** โ€” All 40 OML skills (16 superpowers + 5 orchestrators + 19 agents) returned `string` instead of `ContentBlockParam[]` from `getPromptForCommand`, causing `result.filter is not a function` crash on `/ultrawork`, `/ralph`, `/autopilot`, etc. Now wrapped as `Promise<[{ type: 'text', text }]>`.
157
+ - **Statusline writes to wrong config dir** โ€” `statuslineSetup` agent hardcoded `~/.claude/settings.json` and `~/.claude/statusline-command.sh`. Fixed to `~/.legna/`.
158
+
159
+ ### Improvements
160
+
161
+ - **Plans moved to project-local** โ€” Default plan directory changed from `~/.legna/plans/` to `<cwd>/.legna/plans/`. Plans now live alongside the project they belong to.
162
+ - **Auto-memory moved to project-local** โ€” Default auto-memory path changed from `~/.legna/projects/<slug>/memory/` to `<cwd>/.legna/memory/`. First startup auto-migrates files from the legacy global path (non-destructive, never overwrites).
163
+ - **Compound engineering seamless fusion** โ€” Knowledge compounding from compound-engineering-plugin, injected into 3 existing automation points with zero new commands:
164
+ - `onPreCompress`: high-value exchange pairs auto-written to `docs/solutions/` (opt-in via `mkdir docs/solutions`)
165
+ - `prefetch`: auto-searches `docs/solutions/` for past learnings when user asks related questions
166
+ - `magicKeywords`: deep scope detection (refactor/migrate/architecture) appends a lightweight compound hint
167
+ - **Legacy path comments cleaned** โ€” Updated stale `~/.claude/projects/` references in memdir, extractMemories, settings types
168
+
169
+ ## [1.4.5] - 2026-04-13
170
+
171
+ ### Features
172
+
173
+ - **OpenViking content tiering fusion** โ€” Ported L0/L1/L2 three-tier content grading from OpenViking's context database:
174
+ - **Content Tiering** โ€” Each drawer auto-generates L0 (one-sentence summary, ~25 words) and L1 (core overview, ~200 words) at upsert time. L2 is the full verbatim content.
175
+ - **Budget-aware wake-up** โ€” `wakeUp()` now accepts a token budget (default 800) and greedily fills it with L1 content, degrading to L0 when budget is tight.
176
+ - **Budget-capped recall** โ€” New `recallWithBudget()` method: L2โ†’L1โ†’L0 degradation strategy ensures recall never exceeds character budget.
177
+ - **CJK-aware token estimation** โ€” `estimateTokens()` handles mixed CJK/Latin text.
178
+ - **SQLite schema migration** โ€” Existing DrawerStore databases auto-migrate with `ALTER TABLE ADD COLUMN`.
179
+ - **Fixed recallByTopic()** โ€” Now passes actual query for vector ranking instead of empty string.
180
+
181
+ ## [1.4.4] - 2026-04-11
182
+
183
+ ### Improvements
184
+
185
+ - **Status messages moved to spinner line** โ€” autocompact / output truncated / interrupted status messages no longer insert system messages into the conversation; they now display temporarily on the spinner animation line, flashing briefly without polluting context
186
+ - **ToolUseContext adds setSpinnerMessage** โ€” generic spinner text callback allowing the query loop to update spinner status at any time
187
+ - **LegnaCode vs Claude Code comparison doc** โ€” added [COMPARISON.md](./COMPARISON.md) with 60+ item-by-item comparison across 9 categories
188
+
189
+ ## [1.4.3] - 2026-04-11
190
+
191
+ ### Features
192
+
193
+ - **mempalace memory architecture integration** โ€” ported mempalace core memory system, pure TypeScript implementation, zero external dependencies:
194
+ - **DrawerStore** โ€” SQLite-persisted vector memory storage + WAL audit log, deterministic drawer ID (sha256 idempotent upsert)
195
+ - **TF-IDF vectorizer** โ€” pure TS implementation (Porter stemming + cosine similarity), <10K drawer search <5ms
196
+ - **4-layer memory stack** โ€” L0 identity (~100 tokens) + L1 top drawers (~500-800 tokens) loaded every turn, L2/L3 recalled on demand. Per-turn tokens reduced from ~8K to ~800 (~88% savings)
197
+ - **Temporal knowledge graph** โ€” SQLite entity-relation storage, supports triples with validity periods and point-in-time queries
198
+ - **Room auto-classification** โ€” 6 categories (facts/decisions/events/discoveries/preferences/advice) with keyword scoring
199
+ - **Exchange pair extractor** โ€” Q+A paired chunking + 5-category tag scoring (decisions/preferences/milestones/problems/emotional)
200
+ - **Auto-migration** โ€” automatically migrates existing .legna/memory/*.md files to DrawerStore on first startup
201
+ - **PreCompact memory save** โ€” automatically extracts high-value exchange pairs to DrawerStore before compaction, preventing memory loss
202
+
203
+ ### Architecture
204
+
205
+ - Added `src/memdir/vectorStore/` โ€” complete vector memory system (8 files)
206
+ - `types.ts` โ€” Drawer, SearchResult, MetadataFilter types
207
+ - `tfidfVectorizer.ts` โ€” TF-IDF + Porter stemming + cosine similarity
208
+ - `drawerStore.ts` โ€” SQLite persistence + WAL + vector search
209
+ - `roomDetector.ts` โ€” content auto-classification
210
+ - `layeredStack.ts` โ€” 4-layer memory stack
211
+ - `knowledgeGraph.ts` โ€” temporal knowledge graph
212
+ - `exchangeExtractor.ts` โ€” exchange pair extraction + tag scoring
213
+ - `migration.ts` โ€” .md โ†’ DrawerStore auto-migration
214
+ - Upgraded `src/memdir/providers/FileMemoryProvider.ts` โ€” DrawerStore + LayeredStack backend
215
+ - Wired `src/services/compact/autoCompact.ts` โ€” calls onPreCompress before compaction
216
+
217
+ ## [1.4.2] - 2026-04-11
218
+
219
+ ### Features
220
+
221
+ - **verbose enabled by default** โ€” users now see full tool execution progress and status information by default
222
+ - **Token/Timer instant display** โ€” removed 30-second delay, token count and elapsed time shown from second 1
223
+ - **Autocompact status visible** โ€” displays "Compacting conversation context..." system message during conversation compaction
224
+ - **Interrupt reason visible** โ€” shows abort reason on interruption (streaming and tool_execution phases)
225
+ - **Output truncated retry prompt** โ€” displays retry progress during max output tokens recovery
226
+ - **Tool execution logging** โ€” StreamingToolExecutor outputs current tool name and queue depth
227
+ - **Microcompact/Snip logging** โ€” added debug logging for compaction operations
228
+ - **ForkedAgent startup logging** โ€” outputs label and ID when child agent starts
229
+
230
+ ### Bug Fixes
231
+
232
+ - **Apple Terminal notification logic fix** โ€” bell is now sent only when bell is not disabled (logic was previously inverted)
233
+
234
+ ## [1.4.0] - 2026-04-11
235
+
236
+ ### Features
237
+
238
+ - **MiniMax deep native integration** โ€” when using MiniMax models with `MINIMAX_API_KEY` configured, automatically registers 6 native multimodal tools:
239
+ - `MiniMaxImageGenerate` โ€” image generation (POST /v1/image_generation)
240
+ - `MiniMaxVideoGenerate` โ€” video generation + async polling (POST /v1/video_generation)
241
+ - `MiniMaxSpeechSynthesize` โ€” text-to-speech (POST /v1/t2a_v2)
242
+ - `MiniMaxMusicGenerate` โ€” music generation (POST /v1/music_generation)
243
+ - `MiniMaxVisionDescribe` โ€” image understanding VLM (POST /v1/coding_plan/vlm)
244
+ - `MiniMaxWebSearch` โ€” web search (POST /v1/web_search)
245
+ - **MiniMax auth command** โ€” `/auth-minimax` command to configure API key, persisted to `~/.legna/minimax-credentials.json`
246
+ - **MiniMax tool schema export** โ€” `schemaExport.ts` supports exporting Anthropic-compatible tool schemas
247
+ - **MiniMax multimodal skill pack** โ€” 5 built-in skills (image/video/speech/music/pipeline) guiding AI to orchestrate multimodal workflows
248
+ - **Smart model routing** โ€” heuristic routing to fast/default/strong model tiers based on prompt complexity
249
+ - **Autonomous skill detection** โ€” detects repetitive tool call patterns and prompts users to save as reusable skills
250
+ - **Context compression enhancements**:
251
+ - Tool output pre-pruning โ€” large tool_result blocks auto-trimmed before compact (head + tail preserved)
252
+ - Budget pressure injection โ€” injects hints into tool results when context usage exceeds 80%, guiding the model to wrap up
253
+ - **RPC subprocess tool execution** โ€” Unix Domain Socket RPC server + stub generator + code execution runner; AI-generated scripts can call back LegnaCode tools (Bash/Read/Write/Edit/Glob/Grep/WebFetch) via RPC, compressing multi-step operations into a single inference
254
+ - **Memory Provider plugin system** โ€” abstract base class + registry + default FileMemoryProvider; supports one external provider running in parallel with built-in memory, full lifecycle (initialize/prefetch/syncTurn/shutdown) + optional hooks (onTurnStart/onSessionEnd/onPreCompress/onDelegation)
255
+ - **Cross-session memory search** โ€” `/recall` command searches historical session JSONL files with keyword matching + relevance ranking
256
+ - **Worker thread pool** โ€” large file operations / batch searches can be offloaded to worker threads, avoiding main thread blocking
257
+
258
+ ### Architecture
259
+
260
+ - Added `src/tools/MiniMaxTools/` โ€” complete MiniMax multimodal tool directory (client, endpoints, 6 buildTool tools, conditional registration, schema export)
261
+ - Added `src/services/rpc/` โ€” RPC subprocess tool execution (rpcServer.ts, stubGenerator.ts, codeExecutionRunner.ts)
262
+ - Added `src/memdir/providers/` โ€” Memory Provider plugin system (MemoryProvider.ts abstract base class, FileMemoryProvider.ts default implementation, registry.ts registry)
263
+ - Added `src/services/modelRouter.ts` โ€” task complexity estimation + model tier routing
264
+ - Added `src/services/skillAutoCreate.ts` โ€” tool call pattern detector, integrated into toolExecution.ts
265
+ - Added `src/services/compact/toolOutputPruner.ts` โ€” tool output pre-pruning, integrated into autoCompact.ts
266
+ - Added `src/services/compact/budgetPressure.ts` โ€” context budget pressure injection, integrated into query.ts
267
+ - Added `src/services/sessionSearch.ts` โ€” cross-session search engine
268
+ - Added `src/commands/recall/` โ€” `/recall` command
269
+ - Added `src/commands/auth/` โ€” `/auth-minimax` command
270
+ - Added `src/skills/builtin-minimax/` โ€” 5 MiniMax multimodal skill files
271
+ - Added `src/utils/workerPool.ts` โ€” worker thread pool
272
+
273
+ ## [1.3.7] - 2026-04-09
274
+
275
+ ### Bug Fixes
276
+
277
+ - **Resume session detection** โ€” `legna resume` failed to discover sessions written to `<project>/.legna/sessions/` since v1.3.0. `getStatOnlyLogsForWorktrees()` only scanned the global `~/.legna/projects/`; it now also scans the project-local sessions directory, consistent with `fetchLogs()` behavior
278
+ - **Interrupted diagnostics logging** โ€” added abort reason + call stack logging at `onCancel()` and `query.ts` interrupt points; traceable under `--verbose` mode
279
+
280
+ ### Enhancements
281
+
282
+ - **Priority-now interrupt visibility** โ€” when a queued command interrupts the current task, the command summary is logged to debug log instead of silently aborting
283
+ - **Background task status visibility** โ€” footer pill shows real-time activity summary for a single background agent (latest tool + token stats); task completion notification includes progress statistics
284
+
285
+ ### Architecture
286
+
287
+ - `src/utils/sessionStorage.ts` โ€” `getStatOnlyLogsForWorktrees()` Path A/B both include `.legna/sessions/` scanning
288
+ - `src/query.ts` โ€” abort reason logging added at both `createUserInterruptionMessage` call sites
289
+ - `src/screens/REPL.tsx` โ€” `onCancel()` call stack logging, priority-now useEffect logs command summary
290
+ - `src/tasks/pillLabel.ts` โ€” single agent task displays `getActivitySummary()` real-time activity
291
+ - `src/tasks/LocalMainSessionTask.ts` โ€” `completeMainSessionTask` captures progress, notification includes statistics
292
+
293
+ ## [1.3.6] - 2026-04-09
294
+
295
+ ### Bug Fixes
296
+
297
+ - **Windows Edit tool path separator false positive** โ€” fixed [#7935](https://github.com/anthropics/claude-code/issues/7935): on Windows, after reading a file with forward slashes (`D:/path`), Edit/MultiEdit tools reported "File has been unexpectedly modified" error. Root cause: `path.normalize()` does not always convert `/` to `\` in certain runtimes (Bun compiled binary + Git Bash/MINGW environment), causing FileStateCache key mismatch
298
+ - `FileStateCache` added `normalizeKey()` โ€” explicitly replaces `/` with the native separator (Windows: `\`) after `path.normalize()`, ensuring `D:/foo` and `D:\foo` always hit the same cache entry
299
+ - `expandPath()` added `ensureNativeSeparators()` โ€” all returned paths force backslashes on Windows as a defensive fix
300
+
301
+ ### Architecture
302
+
303
+ - `src/utils/fileStateCache.ts` โ€” `normalizeKey()` replaces bare `normalize()`, imports `sep`
304
+ - `src/utils/path.ts` โ€” `ensureNativeSeparators()` wraps all `normalize()`/`resolve()`/`join()` return values
305
+
306
+ ## [1.3.5] - 2026-04-07
307
+
308
+ ### Bug Fixes
309
+
310
+ - **SessionStart hook error** โ€” OML's SessionStart hook used `type: 'prompt'`, but the SessionStart phase has no `toolUseContext` (LLM call context), causing a guaranteed crash. Removed SessionStart hook; skill guidance is now exposed through skill descriptions
311
+ - **Windows alt-screen rendering flicker** โ€” in alt-screen mode, `fullResetSequence_CAUSES_FLICKER` was still triggered (viewport changes, scrollback detection, etc.), causing full-screen clear + redraw flicker. Added `altScreenFullRedraw()` method; in alt-screen mode, uses simple `CSI 2J + CSI H` (erase screen + cursor home) instead of `clearTerminal`'s Windows legacy path
312
+ - **Windows drainStdin** โ€” previously skipped stdin draining entirely on Windows; residual mouse events caused input field corruption. Changed to flush buffered input events by toggling raw mode
313
+
314
+ ### Architecture
315
+
316
+ - `src/ink/log-update.ts` โ€” 5 `fullResetSequence_CAUSES_FLICKER` call sites now check `altScreen`, added `altScreenFullRedraw()` method
317
+ - `src/ink/ink.tsx` โ€” Windows `drainStdin` alternative (toggle raw mode)
318
+ - `src/plugins/bundled/oml/definition.ts` โ€” removed SessionStart hook, OML upgraded to 1.2.0
319
+
320
+ ## [1.3.4] - 2026-04-07
321
+
322
+ ### New Features
323
+
324
+ - **OML Superpowers engineering discipline** โ€” integrated obra/superpowers core skills, enforcing strict software engineering workflows for AI
325
+ - `/verify` โ€” completion verification discipline: cannot claim completion without fresh evidence
326
+ - `/tdd` โ€” TDD enforcement: RED-GREEN-REFACTOR, write tests before code
327
+ - `/debug` โ€” 4-stage systematic debugging, question architecture after 3 failures
328
+ - `/brainstorm` โ€” Socratic design: hard gate, no implementation allowed until design is approved
329
+ - `/write-plan` โ€” break design into 2-5 minute tasks, zero placeholders
330
+ - `/sdd` โ€” sub-agent driven development: implement โ†’ spec review โ†’ quality review, 3 stages
331
+ - `/exec-plan` โ€” load plan file and execute tasks sequentially
332
+ - `/dispatch` โ€” parallel sub-agent dispatch
333
+ - `/code-review` โ€” dispatch reviewer sub-agent
334
+ - `/worktree` โ€” Git worktree isolated development
335
+ - `/finish-branch` โ€” branch wrap-up (merge/PR/keep/discard)
336
+ - **SessionStart skill guidance** โ€” automatically injects OML skill guidance prompt at session start ("1% rule")
337
+ - OML plugin version upgraded to 1.1.0, 35 built-in skills total
338
+
339
+ ### Architecture
340
+
341
+ - `src/plugins/bundled/oml/superpowers.ts` โ€” 11 engineering discipline skills + SessionStart guidance
342
+ - `src/plugins/bundled/oml/definition.ts` โ€” appended superpowers skills + SessionStart hook
343
+
344
+ ## [1.3.3] - 2026-04-07
345
+
346
+ ### New Features
347
+
348
+ - **OML (Oh-My-LegnaCode) smart orchestration layer** โ€” built-in oh-my-claudecode core functionality, works out of the box
349
+ - 5 orchestration skills: `/ultrawork` (parallel execution), `/ralph` (persistent loop), `/autopilot` (fully autonomous), `/ralplan` (plan then execute), `/plan-oml` (structured planning)
350
+ - 19 specialized agent skills: `/oml:explore`, `/oml:planner`, `/oml:architect`, `/oml:executor`, `/oml:verifier`, etc.
351
+ - Magic Keywords auto-detection: when prompt contains keywords like ultrawork/ralph/autopilot/ultrathink, orchestration directives are auto-injected (supports CJK and Vietnamese)
352
+ - Can be enabled/disabled via `/plugin` UI (`oml@builtin`, enabled by default)
353
+ - `OML_BUILTIN` feature flag controls compile-time DCE
354
+
355
+ ### Bug Fixes
356
+
357
+ - **Windows Terminal Fullscreen** โ€” automatically enables alt-screen mode in `WT_SESSION` environment, completely eliminating the cursor-up viewport yank bug (microsoft/terminal#14774). Covers WSL-in-Windows-Terminal. `CLAUDE_CODE_NO_FLICKER=0` to opt-out
358
+
359
+ ### Architecture
360
+
361
+ - `src/plugins/bundled/oml/` โ€” OML plugin module (definition, skills, agents, magicKeywords)
362
+ - `src/plugins/bundled/index.ts` โ€” registered OML builtin plugin
363
+ - `src/utils/processUserInput/processUserInput.ts` โ€” magic keyword detection integration point
364
+ - `src/utils/fullscreen.ts` โ€” Windows Terminal fullscreen condition
365
+
366
+ ## [1.3.2] - 2026-04-07
367
+
368
+ ### Breaking Changes
369
+
370
+ - **Disabled HISTORY_SNIP** โ€” `bunfig.toml` feature flag set to false, compile-time DCE removes all snip-related code (SnipTool, snipCompact, snipProjection, force-snip command, attachments nudge). Auto-compact is unaffected; context management reverts to the original mechanism
371
+
372
+ ### Bug Fixes
373
+
374
+ - **Windows Terminal streaming text** โ€” no longer disables streaming text display for all Windows; now only disabled under legacy conhost. Windows Terminal (detected via `WT_SESSION` environment variable) restores normal streaming rendering
375
+
376
+ ## [1.3.1] - 2026-04-06
377
+
378
+ ### Bug Fixes
379
+
380
+ - **Snip-aware context window** โ€” 1M models are no longer prematurely snipped; `KEEP_RECENT` changed from hardcoded 10 to dynamic calculation (1M: 200, 500K: 100, 200K: 10)
381
+ - **Snip nudge frequency** โ€” 1M model nudge threshold raised from 20 to 100 messages
382
+ - **branch command branding** โ€” `/branch` resume prompt changed from `claude -r` to `legna -r`
383
+ - **admin version fallback** โ€” displays correct version number when running from source
384
+
385
+ ### Architecture
386
+
387
+ - `src/services/compact/snipCompact.ts` โ€” added `getSnipThresholds(model)` dynamic threshold function; `snipCompactIfNeeded` and `shouldNudgeForSnips` gained model parameter
388
+ - `src/query.ts` / `src/QueryEngine.ts` / `src/commands/force-snip-impl.ts` โ€” pass model parameter
389
+
390
+ ## [1.3.0] - 2026-04-04
391
+
392
+ ### New Features
393
+
394
+ - **Project-local storage** โ€” sessions, skills, memory, rules, and settings all moved down to `<project>/.legna/` directory
395
+ - New sessions written to `<project>/.legna/sessions/<uuid>.jsonl`, traveling with the project
396
+ - Project-level skills/rules/settings/agent-memory/workflows unified under `.legna/`
397
+ - `.legna/` automatically added to `.gitignore`
398
+ - **Global data migration** โ€” automatically migrates from `~/.claude/` to `~/.legna/` on first startup (one-way)
399
+ - Migrates settings.json, credentials, rules, skills, agents, plugins, keybindings, etc.
400
+ - Does not overwrite existing files; writes `.migration-done` marker on completion
401
+ - `LEGNA_NO_CONFIG_SYNC=1` to disable
402
+ - **`legna migrate` command** โ€” manual data migration
403
+ - `--global` migrates global data only
404
+ - `--sessions` migrates current project sessions to local only
405
+ - `--all` migrates everything (default)
406
+ - `--dry-run` preview mode
407
+ - **Three-level fallback reads** โ€” automatically searches `.legna/` โ†’ `.claude/` โ†’ `~/.legna/` โ†’ `~/.claude/` when reading, zero-breakage backward compatibility
408
+
409
+ ### Architecture
410
+
411
+ - `src/utils/legnaPathResolver.ts` โ€” unified path resolution (PROJECT_FOLDER/LEGACY_FOLDER/resolveProjectPath)
412
+ - `src/utils/ensureLegnaGitignored.ts` โ€” auto-gitignore utility
413
+ - `src/utils/envUtils.ts` โ€” refactored global migration logic, removed old syncClaudeConfigToLegna
414
+ - `src/utils/sessionStoragePortable.ts` โ€” added getLocalSessionsDir/getLegacyProjectsDir, refactored resolveSessionFilePath
415
+ - `src/utils/sessionStorage.ts` โ€” session write path switched to project-local
416
+ - `src/utils/listSessionsImpl.ts` โ€” multi-source scan and merge (local + global + legacy)
417
+ - `src/commands/migrate/` โ€” CLI migration command
418
+
419
+ ## [1.2.1] - 2026-04-04
420
+
421
+ ### New Features
422
+
423
+ - **Model Adapter Layer** โ€” unified third-party model compatibility framework, auto-detects model/endpoint and applies corresponding transforms
424
+ - **MiMo (Xiaomi) adapter** โ€” api.xiaomimimo.com/anthropic, supports mimo-v2-pro/omni/flash (1M ctx)
425
+ - simplifyThinking + forceAutoToolChoice + normalizeTools + stripBetas + injectTopP(0.95) + stripCacheControl
426
+ - Handles content_filter / repetition_truncation stop_reason
427
+ - **GLM (ZhipuAI) adapter** โ€” open.bigmodel.cn/api/anthropic, supports glm-5.1/5/5-turbo/4.7/4.6/4.5, etc.
428
+ - Full standard transform suite, server-side auto-caching (strip cache_control)
429
+ - **DeepSeek adapter** โ€” api.deepseek.com/anthropic, supports deepseek-chat/coder/reasoner
430
+ - stripReasoningContent to avoid 400 errors, reasoner models auto-strip temperature/top_p
431
+ - **Kimi (Moonshot) adapter** โ€” api.moonshot.ai/anthropic, supports kimi-k2/k2.5/k2-turbo, etc.
432
+ - Preserves cache_control (Kimi supports prompt caching discount), stripReasoningContent
433
+ - **MiniMax adapter** โ€” api.minimaxi.com/anthropic (China) + api.minimax.io/anthropic (international)
434
+ - Supports MiniMax-M2.7/M2.5/M2.1/M2 full series (204K ctx), case-insensitive matching
435
+ - Deep compatibility: preserves metadata, tool_choice, cache_control, top_p (other adapters need strip/force)
436
+ - Only needs simplifyThinking + normalizeTools + stripBetas + stripUnsupportedFieldsKeepMetadata
437
+
438
+ ### Architecture
439
+
440
+ - `src/utils/model/adapters/index.ts` โ€” adapter registry + match/transform dispatch
441
+ - `src/utils/model/adapters/shared.ts` โ€” 12 shared transform functions (including new stripUnsupportedFieldsKeepMetadata)
442
+ - `src/utils/model/adapters/{mimo,glm,deepseek,kimi,minimax}.ts` โ€” 5 provider adapters
443
+ - `src/services/api/claude.ts` โ€” paramsFromContext() calls applyModelAdapter() at the end
444
+
445
+ ## [1.2.0] - 2026-04-03
446
+
447
+ ### New Features
448
+
449
+ - **Sessions grouped by project** โ€” WebUI session history panel groups sessions by project path
450
+ - **resume command with cd** โ€” copied resume command auto-includes `cd` to project directory (Windows uses `cd /d`)
451
+ - **Migration supports session history** โ€” config migration panel adds "also migrate session history" option, copies `projects/` directory
452
+ - **Windows native compilation** โ€” Windows binary now compiled natively on Windows
453
+
454
+ ### Fixed
455
+
456
+ - Migration panel field names corrected to match actual settings.json fields
457
+
458
+ ## [1.1.10] - 2026-04-03
459
+
460
+ ### Fixed
461
+
462
+ - **Windows compile script fix** โ€” `scripts/compile.ts` correctly handles `.exe` suffix on Windows, fixing the issue where compiled output file could not be found
463
+ - **Windows native binary recompiled and published** โ€” recompiled native `legna.exe` using Windows-native Bun, replacing the previous cross-compiled version
464
+
465
+ ## [1.1.9] - 2026-04-03
466
+
467
+ ### Fixed
468
+
469
+ - **postinstall auto-installs platform package** โ€” added `npm/postinstall.cjs`; during `npm install`, automatically detects and installs the corresponding platform binary package from the official registry, completely solving the issue where optionalDependencies fails on Windows/mirror registries
470
+ - **Force official registry** โ€” postinstall uses `--registry https://registry.npmjs.org` to avoid 404 errors from unsynchronized mirrors (e.g., Taobao)
471
+ - **bin wrapper simplified** โ€” removed runtime auto-install logic, now guaranteed by postinstall
472
+
473
+ ## [1.1.8] - 2026-04-03
474
+
475
+ ### Fixed
476
+
477
+ - **Windows npm global install missing platform package** โ€” bin wrapper now auto-executes `npm install -g` for the corresponding platform package when it detects the package is not installed, no longer requiring manual user action
478
+ - **bin wrapper path lookup optimization** โ€” fixed scope directory path joining under global node_modules flat layout
479
+
480
+ ## [1.1.7] - 2026-04-03
481
+
482
+ ### Fixed
483
+
484
+ - **Completely fixed Windows external module error** โ€” cleared the compile external list; all stub modules (`@ant/*`, `@anthropic-ai/*`, native napi) are now bundled into the binary, no longer depending on runtime external modules
485
+
486
+ ## [1.1.6] - 2026-04-03
487
+
488
+ ### Fixed
489
+
490
+ - **Windows external module error** โ€” removed `@anthropic-ai/sandbox-runtime`, `@anthropic-ai/mcpb`, `@anthropic-ai/claude-agent-sdk`, `audio-capture-napi`, `color-diff-napi`, `modifiers-napi` from the compile external list, letting stub code bundle directly into the binary; Windows no longer reports `Cannot find module`
491
+ - **bin wrapper multi-path lookup** โ€” `npm/bin/legna.cjs` added global node_modules flat path and nested path fallback, improving cross-platform npm global install compatibility
492
+ - **Version number automation** โ€” added `scripts/bump.ts` for one-click sync of version numbers across package.json, bunfig.toml, webui/package.json, and optionalDependencies
493
+ - **Release process automation** โ€” rewrote `scripts/publish.ts` for one-click bump โ†’ build webui โ†’ compile all โ†’ publish npm
494
+
495
+ ## [1.1.5] - 2026-04-03
496
+
497
+ ### New Features
498
+
499
+ - **WebUI admin panel** โ€” `legna admin` launches a browser-based admin panel (HTTP server + React SPA, default port 3456), visual management of both `~/.claude/` and `~/.legna/` config directories
500
+ - **Config editing** โ€” edit API endpoint, API key, model mapping (Opus/Sonnet/Haiku), timeout, permission mode, language, and all other settings.json fields in the browser
501
+ - **Config file switching** โ€” lists settings*.json files, shows baseUrl/model, one-click swap to activate
502
+ - **Session history browsing** โ€” parses all session JSONL files under the projects directory, displays project path, slug, time, prompt count, and copy resume command
503
+ - **Config migration** โ€” Claude โ†” LegnaCode bidirectional migration, supports full or selective field migration (env/model/permissions, etc.), preview diff before migration
504
+ - **npm cross-platform publishing** โ€” bin wrapper (.cjs), compile-all cross-platform compilation (darwin/linux/win32), publish script
505
+ - **OAuth disabled** โ€” `isAnthropicAuthEnabled()` returns false, removed OAuth login flow
506
+
507
+ ### Fixed (1.1.1 ~ 1.1.5)
508
+
509
+ - bin wrapper changed to `.cjs` to fix ESM `require` error
510
+ - `optionalDependencies` platform package versions aligned
511
+ - Terminal restored on admin server exit with screen clear
512
+ - WebUI frontend inlined into binary, no longer depends on external `webui/dist/`
513
+ - All package versions unified to 1.1.5
514
+
515
+ ### Architecture
516
+
517
+ - Backend: `src/server/admin.ts` โ€” Bun.serve REST API, SPA inlined as string constant
518
+ - Frontend: `webui/` โ€” React 18 + Vite + Tailwind SPA, tab-based scope switching
519
+ - Inlining: `scripts/inline-webui.ts` โ†’ `src/server/admin-ui-html.ts`
520
+ - CLI: `src/entrypoints/cli.tsx` โ€” `admin` fast-path, zero extra module loading
521
+
522
+ ## [1.0.9] - 2026-04-03
523
+
524
+ ### New Features
525
+
526
+ - **i18n multilingual completion** โ€” completed ~100 missing hardcoded English strings across 9 files, covering Spinner, teammate tree, pill labels, keyboard shortcut hints, Tips, and all other UI areas
527
+ - **Built-in styled status bar** โ€” no external script configuration needed; displays directory, Git branch/sync status, model name (smart parsing to friendly name), colored context progress bar, and time by default; cross-platform compatible with Win/Mac/Linux
528
+ - **Config auto-migration** โ€” automatically syncs `~/.claude/settings.json` to `~/.legna/settings.json` on startup; prints warning without overwriting when both sides differ; `LEGNA_NO_CONFIG_SYNC=1` to disable
529
+
530
+ ### Changed
531
+
532
+ - `~/.legna/` is now the preferred config directory, `~/.claude/` serves as compatibility fallback
533
+ - Status bar model name auto-parsing: `Claude-Opus-4-6-Agentic[1m]` โ†’ `Opus 4.6`
534
+ - `KeyboardShortcutHint` component "to" connector word internationalized (Chinese displays "โ†’")
535
+
536
+ ### Files Changed
537
+
538
+ | File | Changes |
539
+ |------|---------|
540
+ | `src/utils/i18n/zh.ts` | +50 translation entries |
541
+ | `src/components/Spinner.tsx` | 7 i18n points |
542
+ | `src/components/PromptInput/PromptInputFooterLeftSide.tsx` | 4 i18n points |
543
+ | `src/components/design-system/KeyboardShortcutHint.tsx` | "to" internationalized |
544
+ | `src/components/Spinner/teammateSelectHint.ts` | i18n |
545
+ | `src/components/Spinner/TeammateSpinnerTree.tsx` | 6 i18n points |
546
+ | `src/components/Spinner/TeammateSpinnerLine.tsx` | 7 i18n points |
547
+ | `src/tasks/pillLabel.ts` | all pill labels i18n |
548
+ | `src/services/tips/tipRegistry.ts` | 25 tips i18n |
549
+ | `src/utils/builtinStatusLine.ts` | added: built-in status bar renderer |
550
+ | `src/components/StatusLine.tsx` | integrated built-in status bar |
551
+ | `src/utils/envUtils.ts` | config auto-migration logic |
552
+
553
+ ## [1.0.8] - 2026-04-02
554
+
555
+ ### New Features
556
+
557
+ - **MONITOR_TOOL** โ€” MCP server health monitoring tool, supports start/stop/status operations, background periodic ping to detect connection status
558
+ - **WORKFLOW_SCRIPTS** โ€” workflow automation system, reads `.claude/workflows/*.md` to execute multi-step workflows, `/workflows` command lists available workflows
559
+ - **HISTORY_SNIP** โ€” session history trimming, model can proactively call SnipTool to remove old messages and free context, `/force-snip` for forced trimming, UI retains full history while model view is filtered
560
+
561
+ ### Infrastructure
562
+
563
+ - Added `src/tools/MonitorTool/MonitorTool.ts` โ€” MCP monitoring tool (buildTool construction)
564
+ - Added `src/tasks/MonitorMcpTask/MonitorMcpTask.ts` โ€” monitoring background task lifecycle management
565
+ - Added `src/components/permissions/MonitorPermissionRequest/` โ€” monitoring permission UI
566
+ - Added `src/components/tasks/MonitorMcpDetailDialog.tsx` โ€” monitoring task detail dialog
567
+ - Added `src/tools/WorkflowTool/WorkflowTool.ts` โ€” workflow execution tool
568
+ - Added `src/tools/WorkflowTool/createWorkflowCommand.ts` โ€” workflow command scanning and registration
569
+ - Added `src/tools/WorkflowTool/bundled/index.ts` โ€” built-in workflow registration entry
570
+ - Added `src/tools/WorkflowTool/WorkflowPermissionRequest.tsx` โ€” workflow permission UI
571
+ - Added `src/commands/workflows/` โ€” `/workflows` slash command
572
+ - Added `src/tasks/LocalWorkflowTask/LocalWorkflowTask.ts` โ€” workflow background task (kill/skip/retry)
573
+ - Added `src/components/tasks/WorkflowDetailDialog.tsx` โ€” workflow detail dialog
574
+ - Added `src/services/compact/snipCompact.ts` โ€” trim trigger logic (rewrote stub)
575
+ - Added `src/services/compact/snipProjection.ts` โ€” model view message filtering
576
+ - Added `src/tools/SnipTool/SnipTool.ts` โ€” model-callable trimming tool
577
+ - Added `src/tools/SnipTool/prompt.ts` โ€” SnipTool constants and prompt
578
+ - Added `src/commands/force-snip.ts` โ€” `/force-snip` slash command
579
+ - Added `src/components/messages/SnipBoundaryMessage.tsx` โ€” trim boundary UI component
580
+ - 3 feature flags flipped: MONITOR_TOOL, WORKFLOW_SCRIPTS, HISTORY_SNIP
581
+ - Cumulative 47/87 feature flags enabled
582
+
583
+ ## [1.0.7] - 2026-04-02
584
+
585
+ ### New Features
586
+
587
+ - **TERMINAL_PANEL** โ€” `Alt+J` toggles built-in terminal panel (tmux persistent), TerminalCapture tool can read terminal content
588
+ - **WEB_BROWSER_TOOL** โ€” built-in web browsing tool, fetches web page content and extracts text
589
+ - **TEMPLATES** โ€” structured workflow template system, `legna new/list/reply` CLI commands, job status tracking
590
+ - **BG_SESSIONS** โ€” background session management, `legna ps/logs/attach/kill/--bg`, tmux persistence + PID file discovery
591
+
592
+ ### Infrastructure
593
+
594
+ - Added `src/tools/TerminalCaptureTool/` โ€” tmux capture-pane tool (2 files)
595
+ - Added `src/tools/WebBrowserTool/WebBrowserTool.ts` โ€” fetch + HTML text extraction
596
+ - Added `src/jobs/classifier.ts` โ€” workflow turn classifier
597
+ - Added `src/cli/handlers/templateJobs.ts` โ€” template CLI handler
598
+ - Added `src/cli/bg.ts` โ€” background session CLI (5 handlers)
599
+ - Added `src/utils/taskSummary.ts` โ€” periodic activity summary
600
+ - Added `src/utils/udsClient.ts` โ€” active session enumeration
601
+ - Cumulative 44/87 feature flags enabled
602
+
603
+ ## [1.0.6] - 2026-04-02
604
+
605
+ ### New Features
606
+
607
+ - **CACHED_MICROCOMPACT** โ€” cache-aware tool result compression, deletes old tool_result via API cache_edits directive without breaking prompt cache
608
+ - **AGENT_TRIGGERS** โ€” `/loop` cron scheduling command + CronCreate/Delete/List tools, local scheduled task engine
609
+ - **TREE_SITTER_BASH** โ€” pure TypeScript bash AST parser (~4300 lines), used for command safety analysis
610
+ - **TREE_SITTER_BASH_SHADOW** โ€” tree-sitter vs legacy parser shadow comparison mode
611
+ - **MCP_SKILLS** โ€” auto-discovers and registers skill commands from MCP server `skill://` resources
612
+ - **REACTIVE_COMPACT** โ€” auto-triggers context compression on 413/overload errors
613
+ - **REVIEW_ARTIFACT** โ€” `/review` code review skill + ReviewArtifact tool
614
+
615
+ ### Infrastructure
616
+
617
+ - Rewrote `src/services/compact/cachedMicrocompact.ts` (from stub to 150+ line full implementation)
618
+ - Added `src/services/compact/cachedMCConfig.ts` โ€” synchronous config module
619
+ - Added `CACHE_EDITING_BETA_HEADER` to `src/constants/betas.ts`
620
+ - Added `src/skills/mcpSkills.ts`, `src/services/compact/reactiveCompact.ts`
621
+ - Added `src/tools/ReviewArtifactTool/`, `src/skills/bundled/hunter.ts`
622
+ - Cumulative 40/87 feature flags enabled
623
+
624
+ ## [1.0.5] - 2026-04-02
625
+
626
+ ### New Features
627
+
628
+ - **AGENT_TRIGGERS** โ€” `/loop` cron scheduling command, CronCreate/Delete/List tools, local scheduled task engine
629
+ - **TREE_SITTER_BASH** โ€” pure TypeScript bash AST parser, used for command safety analysis
630
+ - **TREE_SITTER_BASH_SHADOW** โ€” tree-sitter vs legacy parser shadow comparison mode
631
+ - **MCP_SKILLS** โ€” auto-discovers and registers skill commands from MCP server `skill://` resources
632
+ - **REACTIVE_COMPACT** โ€” auto-triggers context compression on 413/overload errors
633
+ - **REVIEW_ARTIFACT** โ€” `/review` code review skill + ReviewArtifact tool + permission UI
634
+
635
+ ### Infrastructure
636
+
637
+ - Added `src/skills/mcpSkills.ts` โ€” MCP skill discovery module
638
+ - Added `src/services/compact/reactiveCompact.ts` โ€” reactive compression strategy
639
+ - Added `src/tools/ReviewArtifactTool/` โ€” code review tool
640
+ - Added `src/components/permissions/ReviewArtifactPermissionRequest/` โ€” review permission UI
641
+ - Added `src/skills/bundled/hunter.ts` โ€” /review skill registration
642
+ - Cumulative 39/87 feature flags enabled
643
+
644
+ ## [1.0.4] - 2026-04-02
645
+
646
+ ### New Features
647
+
648
+ - **ULTRAPLAN** โ€” `/ultraplan` structured multi-step planning command
649
+ - **VERIFICATION_AGENT** โ€” auto-spawns verification Agent after batch task completion
650
+ - **AUTO_THEME** โ€” auto-switches dark/light theme by querying terminal background color via OSC 11
651
+ - **AGENT_MEMORY_SNAPSHOT** โ€” Agent memory snapshots
652
+ - **FILE_PERSISTENCE** โ€” file persistence tracking
653
+ - **POWERSHELL_AUTO_MODE** โ€” PowerShell auto mode
654
+ - **HARD_FAIL** โ€” strict error mode
655
+ - **SLOW_OPERATION_LOGGING** โ€” slow operation logging
656
+ - **UNATTENDED_RETRY** โ€” unattended retry
657
+ - **ALLOW_TEST_VERSIONS** โ€” allow test versions
658
+
659
+ ### Infrastructure
660
+
661
+ - Added `src/utils/systemThemeWatcher.ts` โ€” OSC 11 terminal theme detection and real-time monitoring
662
+ - Cumulative 33/87 feature flags enabled
663
+
664
+ ## [1.0.3] - 2026-04-02
665
+
666
+ ### New Features
667
+
668
+ - **COMMIT_ATTRIBUTION** โ€” tracks Claude's contribution ratio per commit, PR description auto-appends attribution trailer
669
+ - **AWAY_SUMMARY** โ€” displays summary of what happened while user was away
670
+ - **COMPACTION_REMINDERS** โ€” efficiency reminders during context compaction
671
+ - **HOOK_PROMPTS** โ€” allows hooks to request user input
672
+ - **BASH_CLASSIFIER** โ€” shell command safety classifier
673
+ - **EXTRACT_MEMORIES** โ€” auto-extracts persistent memories from conversations
674
+ - **SHOT_STATS** โ€” session statistics panel
675
+ - **PROMPT_CACHE_BREAK_DETECTION** โ€” detects prompt cache invalidation
676
+ - **ULTRATHINK** โ€” deep thinking mode
677
+ - **MCP_RICH_OUTPUT** โ€” MCP tool rich text output
678
+ - **CONNECTOR_TEXT** โ€” connector text enhancement
679
+ - **NATIVE_CLIPBOARD_IMAGE** โ€” native clipboard image support
680
+ - **NEW_INIT** โ€” improved project initialization flow
681
+ - **DUMP_SYSTEM_PROMPT** โ€” debug system prompt export
682
+ - **BREAK_CACHE_COMMAND** โ€” `/break-cache` command
683
+ - **BUILTIN_EXPLORE_PLAN_AGENTS** โ€” built-in Explore/Plan Agents
684
+
685
+ ### Infrastructure
686
+
687
+ - Added `src/utils/attributionHooks.ts`, `attributionTrailer.ts`, `postCommitAttribution.ts` โ€” three attribution modules
688
+
689
+ ## [1.0.2] - 2026-04-02
690
+
691
+ ### New Features
692
+
693
+ - **QUICK_SEARCH** โ€” `Ctrl+P` quick file open in fullscreen mode, `Ctrl+Shift+F` global symbol/content search
694
+ - **MESSAGE_ACTIONS** โ€” copy, edit, retry and other actions on messages in fullscreen mode
695
+ - **FORK_SUBAGENT** โ€” `/fork <directive>` session fork, child Agent inherits full conversation context and executes tasks in parallel
696
+ - **HISTORY_PICKER** โ€” `Ctrl+R` opens history search dialog, replacing the previous inline search
697
+
698
+ ### Infrastructure
699
+
700
+ - Added `src/commands/fork/` command module and `UserForkBoilerplateMessage` UI component
701
+
702
+ ## [1.0.1] - 2026-04-02
703
+
704
+ ### New Features
705
+
706
+ - **BUDDY virtual pet companion** โ€” `/buddy hatch` hatches an exclusive coding pet, 18 species, 5 rarities, random attributes
707
+ - `/buddy hatch` hatch ยท `/buddy pet` pet ยท `/buddy stats` stats ยท `/buddy release` release
708
+ - Pet comments in cute language based on conversation context, supports multilingual auto-switching
709
+ - Re-hatching after release gives a different pet (generation counter)
710
+ - **TOKEN_BUDGET** โ€” use `+500k` or `use 2M tokens` in prompts to set token budget, auto-tracks usage
711
+ - **STREAMLINED_OUTPUT** โ€” environment variable `CLAUDE_CODE_STREAMLINED_OUTPUT=true` enables streamlined output
712
+
713
+ ### Fixes
714
+
715
+ - **Build system feature flags fix** โ€” `scripts/build.ts` now correctly reads `bunfig.toml`'s `[bundle.features]` and passes them to the `Bun.build()` API; previously all `feature()` calls defaulted to `false`
716
+
717
+ ### Infrastructure
718
+
719
+ - Added `scripts/compile.ts` replacing bare `bun build --compile`, ensuring compiled binary correctly applies feature flags
720
+ - Added `src/buddy/companionObserver.ts` context-aware pet reaction system
721
+ - Added `src/commands/buddy/` complete command module
722
+
723
+ ## [1.0.0] - 2026-03-31
724
+
725
+ - Initial release: LegnaCode CLI v1.0.0
726
+ - Built on the Claude Code CLI open-source edition
727
+ - Brand adaptation and customization