@legna-lnc/legnacode 1.5.3 โ†’ 1.5.5

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