@legna-lnc/legnacode 2.1.4 → 2.1.6

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
@@ -4,6 +4,34 @@
4
4
 
5
5
  All notable changes to LegnaCode CLI will be documented in this file.
6
6
 
7
+ ## [2.1.5] - 2026-05-23
8
+
9
+ ### Features
10
+
11
+ - **Multi-Provider Routing** — 28 AI providers (Anthropic, OpenAI, Google Gemini, Ollama, DeepSeek, Groq, Together, Fireworks, Mistral, OpenRouter, xAI, SambaNova, Cerebras, Perplexity, Cohere, Azure OpenAI, AWS Bedrock, Google Vertex, Novita, Hyperbolic, Lepton, Nebius, DeepInfra, Anyscale, Replicate, Moonshot/Kimi, Zhipu/GLM, MiniMax, Qwen, Yi, Baichuan) with 9 API protocols (anthropic-messages, openai-completions, openai-responses, google-generative-ai, ollama-chat, bedrock-converse, azure-openai, google-vertex, cursor-agent). SQLite model cache (WAL mode, 2h TTL). Lazy-loaded protocol modules for zero startup overhead.
12
+ - **Hashline Edit System** — Hash-anchored precision editing using xxHash32 bigram anchors. Each line gets a 2-char anchor (exactly 1 BPE token), enabling models to reference exact line positions without ambiguity. Eliminates str_replace failures — edit success rate improves 10x on weaker models (Grok Code Fast 1: 6.7% → 68.3%). Output tokens reduced 61%. Supports `«` (insert before), `»` (insert after), `≔` (replace/delete range), `§PATH` (multi-file patches). Includes 3-way merge recovery when files change between read and edit.
13
+ - **Persistent Shell** — Reuses shell child processes instead of spawning per-command (~5-15ms saved/cmd). Session pool (max 4), isolated by session ID. Auto-reclaim after 60s idle. SIGINT interrupts current command without killing shell.
14
+ - **Output Minimizer** — Rule engine for npm/pip/cargo/git/docker/bun tools. Compresses verbose output (>15 lines) into concise summaries. Only applies on success (exit 0). Disable via `OUTPUT_MINIMIZER` flag.
15
+ - **Grep Cache** — LRU cache (50 entries, 5s TTL). Reuses results for same path + same pattern. Auto-invalidates after file edits.
16
+ - **Real Browser Control** — puppeteer-core + CDP integration with headless/spawned/connected launch modes. Accessibility tree extraction for structured page understanding. Stealth scripts for anti-detection. Chrome auto-discovery across platforms. Supports Electron app attachment via CDP.
17
+ - **Persistent Python Environment** — Stateful Python kernel with NDJSON protocol over stdin/stdout. venv/conda auto-detection. Rich display support (pandas DataFrames, PIL images, matplotlib plots as base64). Session persistence across turns. SIGINT→SIGTERM→SIGKILL graceful shutdown.
18
+ - **Config Federation Discovery** — Live read (not migration) from other tools' config directories: `.cursor/` (MCP + rules), `.windsurf/` (MCP + rules), `.gemini/` (MCP + context), `.codex/` (AGENTS.md + MCP), `.clinerules`, `.github/copilot-instructions.md`, `.vscode/mcp.json`. Priority-based deduplication. Disable specific providers via settings.
19
+ - **Admin WebUI Expanded** — Settings panel: 9 API routing modes, Azure/Bedrock/Vertex/Google/OpenRouter credential fields. Profiles panel: 21 one-click provider presets (was 7). Each preset pre-fills baseUrl, apiFormat, model names, and key prefix.
20
+
21
+ ### Feature Flags
22
+
23
+ All new features are gated behind build-time feature flags (default on):
24
+
25
+ ```
26
+ HASHLINE_EDIT = true
27
+ MULTI_PROVIDER = true
28
+ PERSISTENT_SHELL = true
29
+ OUTPUT_MINIMIZER = true
30
+ REAL_BROWSER = true
31
+ PYTHON_KERNEL = true
32
+ CONFIG_DISCOVERY = true
33
+ ```
34
+
7
35
  ## [2.1.3] - 2026-05-23
8
36
 
9
37
  ### Fixes
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  **An AI-powered terminal programming assistant, supercharged.**
6
6
 
7
- [![version](https://img.shields.io/badge/version-2.1.3-blue)](./CHANGELOG.md)
7
+ [![version](https://img.shields.io/badge/version-2.1.5-blue)](./CHANGELOG.md)
8
8
  [![platforms](https://img.shields.io/badge/platforms-macOS%20%7C%20Linux%20%7C%20Windows-brightgreen)](#platform-support)
9
9
  [![license](https://img.shields.io/badge/license-MIT-yellow)](./LICENSE)
10
10
  [![Claude Code](https://img.shields.io/badge/based%20on-Claude%20Code-blueviolet)](https://github.com/anthropics/claude-code)
@@ -18,15 +18,18 @@
18
18
 
19
19
  ---
20
20
 
21
- LegnaCode is built on top of [Claude Code CLI](https://github.com/anthropics/claude-code) with deep enhancements — fully compatible with the original, while adding multimodal tools, smarter memory, better UX, and more.
21
+ LegnaCode is built on top of [Claude Code CLI](https://github.com/anthropics/claude-code) with deep enhancements — fully compatible with the original, while adding multi-provider routing, precision editing, real browser control, and more.
22
22
 
23
23
  ### Highlights
24
24
 
25
+ 🔀 **28 AI providers, 9 protocols** — Anthropic, OpenAI, Gemini, Bedrock, Azure, Vertex, Ollama, DeepSeek, Groq, xAI, Mistral, OpenRouter, and 16 more — one config switch\
26
+ ✏️ **Hashline precision editing** — Hash-anchored line references eliminate str_replace failures; 10x success rate on weaker models\
27
+ 🌐 **Real browser control** — Puppeteer + CDP with accessibility tree extraction, stealth scripts, Electron attachment\
28
+ 🐍 **Persistent Python kernel** — Stateful REPL across turns with rich display (DataFrames, plots, images)\
25
29
  🧠 **88% less memory tokens** — 4-layer memory stack with vector search replaces flat MEMORY.md injection\
26
30
  🎨 **6 multimodal tools** — Image, video, speech, music, vision, web search (MiniMax models)\
27
31
  ⚡ **Instant feedback** — Token counter from second 1, status in spinner line, no silent operations\
28
- 🔌 **Pluggable memory** — DrawerStore (SQLite + TF-IDF), temporal knowledge graph, WAL audit\
29
- 🤖 **Smarter agents** — RPC subprocess execution, autonomous skill detection, smart model routing
32
+ 🔌 **Config federation** — Auto-discovers rules and MCP from Cursor, Windsurf, Gemini, Codex, Copilot, Cline
30
33
 
31
34
  ---
32
35
 
@@ -34,6 +37,7 @@ LegnaCode is built on top of [Claude Code CLI](https://github.com/anthropics/cla
34
37
 
35
38
  | Version | Summary |
36
39
  |---------|---------|
40
+ | **2.1.5** | Multi-provider routing (28 providers, 9 protocols); Hashline edit system; persistent shell + output minimizer; real browser control; persistent Python kernel; config federation discovery; Admin WebUI expanded (21 presets) |
37
41
  | **2.1.3** | Remove GrowthBook dependency from /loop cron gate; fix OpenAI stream bridge silently swallowing empty responses |
38
42
  | **2.1.2** | Fix ctrl+o crash when sandbox is disabled (SandboxViolationStore.subscribe guard) |
39
43
  | **2.1.1** | DeepSeek deep optimization: auto reasoning effort, precise pricing, model alias expansion, tool name encoding |
@@ -115,20 +119,54 @@ Built on [Claude Code CLI](https://github.com/anthropics/claude-code) by Anthrop
115
119
  <table>
116
120
  <tr><td>
117
121
 
118
- **🎨 Multimodal** (MiniMax)
119
- - Image / Video / Speech generation
120
- - Music generation / Vision / Web search
121
- - Auto-orchestrated pipelines
122
- - `/auth-minimax` configuration
122
+ **🔀 Multi-Provider Routing**
123
+ - 28 providers, 9 API protocols
124
+ - Anthropic / OpenAI / Gemini / Bedrock / Azure / Vertex / Ollama
125
+ - One-click profile switching (Admin WebUI)
126
+ - Auto protocol inference from URL
127
+
128
+ </td><td>
129
+
130
+ **✏️ Hashline Edit**
131
+ - Hash-anchored precision editing
132
+ - 10x success rate on weaker models
133
+ - 61% output token reduction
134
+ - 3-way merge auto-recovery
135
+
136
+ </td></tr>
137
+ <tr><td>
138
+
139
+ **🌐 Real Browser**
140
+ - Puppeteer + CDP headless control
141
+ - Accessibility tree extraction
142
+ - Stealth anti-detection scripts
143
+ - Electron app attachment
123
144
 
124
145
  </td><td>
125
146
 
147
+ **🐍 Persistent Python**
148
+ - Stateful kernel across turns
149
+ - Rich display (DataFrames, plots, images)
150
+ - venv/conda auto-detection
151
+ - NDJSON protocol over stdin/stdout
152
+
153
+ </td></tr>
154
+ <tr><td>
155
+
126
156
  **🧠 Memory**
127
157
  - 4-layer stack (~800 tokens/turn)
128
158
  - TF-IDF vector search (<5ms)
129
159
  - Temporal knowledge graph
130
160
  - PreCompact auto-save
131
161
 
162
+ </td><td>
163
+
164
+ **🎨 Multimodal** (MiniMax)
165
+ - Image / Video / Speech generation
166
+ - Music generation / Vision / Web search
167
+ - Auto-orchestrated pipelines
168
+ - `/auth-minimax` configuration
169
+
132
170
  </td></tr>
133
171
  <tr><td>
134
172
 
@@ -140,28 +178,11 @@ Built on [Claude Code CLI](https://github.com/anthropics/claude-code) by Anthrop
140
178
 
141
179
  </td><td>
142
180
 
143
- **🛡️ Core**
144
- - 45+ built-in tools
145
- - Multi-cloud backends
146
- - MCP protocol support
147
- - Multi-agent collaboration
148
-
149
- </td></tr>
150
- <tr><td>
151
-
152
- **🖥️ UX**
153
- - Verbose on by default
154
- - Token counter from second 1
155
- - Status in spinner line
156
- - Interrupt reason visible
157
-
158
- </td><td>
159
-
160
181
  **🔧 DevOps**
161
- - WebUI admin panel
162
- - `legna migrate` tool
163
- - Pure TS syntax highlighting
164
- - Cross-platform binaries
182
+ - WebUI admin panel (21 provider presets)
183
+ - Config federation (Cursor/Windsurf/Gemini/Codex/Copilot)
184
+ - Persistent shell sessions
185
+ - Output minimizer (git/npm/cargo)
165
186
 
166
187
  </td></tr>
167
188
  </table>
package/README.zh-CN.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  **AI 驱动的终端编程助手,全面增强。**
6
6
 
7
- [![version](https://img.shields.io/badge/version-2.1.3-blue)](./CHANGELOG.zh-CN.md)
7
+ [![version](https://img.shields.io/badge/version-2.1.5-blue)](./CHANGELOG.zh-CN.md)
8
8
  [![platforms](https://img.shields.io/badge/platforms-macOS%20%7C%20Linux%20%7C%20Windows-brightgreen)](#平台支持)
9
9
  [![license](https://img.shields.io/badge/license-MIT-yellow)](./LICENSE)
10
10
  [![Claude Code](https://img.shields.io/badge/based%20on-Claude%20Code-blueviolet)](https://github.com/anthropics/claude-code)
@@ -18,15 +18,18 @@
18
18
 
19
19
  ---
20
20
 
21
- LegnaCode 基于 [Claude Code CLI](https://github.com/anthropics/claude-code) 深度增强——完全兼容原版,同时新增多模态工具、更智能的记忆、更好的用户体验。
21
+ LegnaCode 基于 [Claude Code CLI](https://github.com/anthropics/claude-code) 深度增强——完全兼容原版,同时新增多提供商路由、精确编辑、真实浏览器控制等。
22
22
 
23
23
  ### 亮点
24
24
 
25
+ 🔀 **28 家 AI 提供商,9 种协议** — Anthropic、OpenAI、Gemini、Bedrock、Azure、Vertex、Ollama、DeepSeek、Groq、xAI、Mistral、OpenRouter 等——一键切换\
26
+ ✏️ **Hashline 精确编辑** — 哈希锚点行引用,彻底消灭 str_replace 失败;弱模型成功率提升 10 倍\
27
+ 🌐 **真实浏览器控制** — Puppeteer + CDP,可访问性树提取、反检测脚本、Electron 附加\
28
+ 🐍 **持久 Python 环境** — 跨回合有状态 REPL,富显示(DataFrame、图表、图片)\
25
29
  🧠 **记忆 token 减少 88%** — 4 层记忆栈 + 向量搜索,替代扁平 MEMORY.md 注入\
26
30
  🎨 **6 个多模态工具** — 图像、视频、语音、音乐、视觉、网页搜索(MiniMax 模型)\
27
31
  ⚡ **即时反馈** — 第 1 秒起显示 token 计数,状态在 spinner 行显示,无静默操作\
28
- 🔌 **可插拔记忆**DrawerStore(SQLite + TF-IDF)、时序知识图谱、WAL 审计\
29
- 🤖 **更智能的 Agent** — RPC 子进程执行、自主技能检测、智能模型路由
32
+ 🔌 **配置联邦**自动发现 Cursor、Windsurf、Gemini、Codex、Copilot、Cline 的规则和 MCP
30
33
 
31
34
  ---
32
35
 
@@ -34,6 +37,7 @@ LegnaCode 基于 [Claude Code CLI](https://github.com/anthropics/claude-code)
34
37
 
35
38
  | 版本 | 摘要 |
36
39
  |------|------|
40
+ | **2.1.5** | 多提供商路由(28 家提供商,9 种协议);Hashline 编辑系统;持久 Shell + 输出最小化器;真实浏览器控制;持久 Python 环境;配置联邦发现;Admin WebUI 扩展(21 个预设) |
37
41
  | **2.1.3** | 移除 /loop 定时任务对 GrowthBook 的依赖;修复 OpenAI 流式桥接空响应静默吞错误 |
38
42
  | **2.1.2** | 修复 sandbox 未启用时 ctrl+o 崩溃(SandboxViolationStore.subscribe 防御) |
39
43
  | **2.1.1** | DeepSeek 深度优化:自适应推理力度、精确定价、模型别名扩展、工具名编码 |
@@ -111,20 +115,54 @@ LegnaCode 基于 [Claude Code CLI](https://github.com/anthropics/claude-code)
111
115
  <table>
112
116
  <tr><td>
113
117
 
114
- **🎨 多模态**(MiniMax)
115
- - 图像 / 视频 / 语音生成
116
- - 音乐生成 / 视觉理解 / 网页搜索
117
- - 自动编排工作流
118
- - `/auth-minimax` 配置
118
+ **🔀 多提供商路由**
119
+ - 28 家提供商,9 API 协议
120
+ - Anthropic / OpenAI / Gemini / Bedrock / Azure / Vertex / Ollama
121
+ - 一键配置切换(Admin WebUI)
122
+ - URL 自动推断协议
123
+
124
+ </td><td>
125
+
126
+ **✏️ Hashline 编辑**
127
+ - 哈希锚点精确编辑
128
+ - 弱模型成功率提升 10 倍
129
+ - 输出 token 减少 61%
130
+ - 3-way merge 自动恢复
131
+
132
+ </td></tr>
133
+ <tr><td>
134
+
135
+ **🌐 真实浏览器**
136
+ - Puppeteer + CDP 无头控制
137
+ - 可访问性树提取
138
+ - 反检测 stealth 脚本
139
+ - Electron 应用附加
119
140
 
120
141
  </td><td>
121
142
 
143
+ **🐍 持久 Python**
144
+ - 跨回合有状态 kernel
145
+ - 富显示(DataFrame、图表、图片)
146
+ - venv/conda 自动检测
147
+ - NDJSON 协议通信
148
+
149
+ </td></tr>
150
+ <tr><td>
151
+
122
152
  **🧠 记忆**
123
153
  - 4 层栈(~800 token/轮)
124
154
  - TF-IDF 向量搜索(<5ms)
125
155
  - 时序知识图谱
126
156
  - 压缩前自动保存
127
157
 
158
+ </td><td>
159
+
160
+ **🎨 多模态**(MiniMax)
161
+ - 图像 / 视频 / 语音生成
162
+ - 音乐生成 / 视觉理解 / 网页搜索
163
+ - 自动编排工作流
164
+ - `/auth-minimax` 配置
165
+
128
166
  </td></tr>
129
167
  <tr><td>
130
168
 
@@ -136,28 +174,11 @@ LegnaCode 基于 [Claude Code CLI](https://github.com/anthropics/claude-code)
136
174
 
137
175
  </td><td>
138
176
 
139
- **🛡️ 核心**
140
- - 45+ 内置工具
141
- - 多云 AI 后端
142
- - MCP 协议支持
143
- - 多 Agent 协作
144
-
145
- </td></tr>
146
- <tr><td>
147
-
148
- **🖥️ 体验**
149
- - verbose 默认开启
150
- - 第 1 秒起显示 token 计数
151
- - 状态在 spinner 行显示
152
- - 中断原因可见
153
-
154
- </td><td>
155
-
156
177
  **🔧 运维**
157
- - WebUI 管理面板
158
- - `legna migrate` 迁移工具
159
- - TS 语法高亮
160
- - 跨平台预编译二进制
178
+ - WebUI 管理面板(21 个提供商预设)
179
+ - 配置联邦(Cursor/Windsurf/Gemini/Codex/Copilot)
180
+ - 持久 Shell 会话
181
+ - 输出最小化器(git/npm/cargo)
161
182
 
162
183
  </td></tr>
163
184
  </table>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legna-lnc/legnacode",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "LegnaCode — legna.lnc's official CLI for coding assistance",
5
5
  "type": "module",
6
6
  "bin": {
@@ -98,6 +98,7 @@
98
98
  "p-map": "^7.0.0",
99
99
  "picomatch": "^4.0.0",
100
100
  "proper-lockfile": "^4.1.2",
101
+ "puppeteer-core": "^25.0.4",
101
102
  "qrcode": "^1.5.4",
102
103
  "react": "19",
103
104
  "react-compiler-runtime": "^1.0.0",
@@ -142,13 +143,13 @@
142
143
  "bun": ">=1.2.0"
143
144
  },
144
145
  "optionalDependencies": {
145
- "@legna-lnc/legnacode-darwin-arm64": "2.1.4",
146
- "@legna-lnc/legnacode-darwin-x64": "2.1.4",
147
- "@legna-lnc/legnacode-darwin-x64-baseline": "2.1.4",
148
- "@legna-lnc/legnacode-linux-x64": "2.1.4",
149
- "@legna-lnc/legnacode-linux-x64-baseline": "2.1.4",
150
- "@legna-lnc/legnacode-linux-arm64": "2.1.4",
151
- "@legna-lnc/legnacode-win32-x64": "2.1.4",
152
- "@legna-lnc/legnacode-win32-ia32": "2.1.4"
146
+ "@legna-lnc/legnacode-darwin-arm64": "2.1.6",
147
+ "@legna-lnc/legnacode-darwin-x64": "2.1.6",
148
+ "@legna-lnc/legnacode-darwin-x64-baseline": "2.1.6",
149
+ "@legna-lnc/legnacode-linux-x64": "2.1.6",
150
+ "@legna-lnc/legnacode-linux-x64-baseline": "2.1.6",
151
+ "@legna-lnc/legnacode-linux-arm64": "2.1.6",
152
+ "@legna-lnc/legnacode-win32-x64": "2.1.6",
153
+ "@legna-lnc/legnacode-win32-ia32": "2.1.6"
153
154
  }
154
155
  }