@legna-lnc/legnacode 1.9.2 → 1.9.3
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 +30 -0
- package/README.md +3 -2
- package/README.zh-CN.md +3 -2
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,36 @@
|
|
|
4
4
|
|
|
5
5
|
All notable changes to LegnaCode CLI will be documented in this file.
|
|
6
6
|
|
|
7
|
+
## [1.9.3] - 2026-04-25
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **OpenAI-Compatible API Routing** — New `apiFormat` setting ('anthropic' | 'openai' | auto) enables routing requests through OpenAI Chat Completions API instead of Anthropic Messages API. Per-adapter `apiFormat: 'auto'` auto-detects from base URL: `/anthropic` suffix → Anthropic SDK, otherwise → OpenAI fetch bridge. All 6 CN adapters default to auto.
|
|
12
|
+
- **OpenAI Streaming Bridge** — New `openaiStreamBridge.ts` translates OpenAI SSE stream into Anthropic event format. Handles `delta.content`, `delta.tool_calls`, `delta.reasoning_content` (DeepSeek/Kimi/MiMo), `delta.reasoning_details` (MiniMax). Downstream code (tool execution, session storage) sees identical events — zero changes needed.
|
|
13
|
+
- **Admin Profile Clone** — New "复制" button on each profile card in admin WebUI. Inline form with auto-prefixed `settings-` and `.json` suffix. Backend: `POST /api/:scope/profiles/clone`.
|
|
14
|
+
- **Admin API Route Selector** — Settings panel now shows "API 路由模式" dropdown: Auto (URL-based), Anthropic, or OpenAI.
|
|
15
|
+
|
|
16
|
+
### Improvements
|
|
17
|
+
|
|
18
|
+
- **Deep Adapter Alignment** — All 7 adapters (DeepSeek, MiniMax, Qwen, GLM, Kimi, MiMo, OpenAICompat) updated per official API docs:
|
|
19
|
+
- DeepSeek: dual endpoints, model list (v4-flash/v4-pro), `output_config.effort` preserved, `reasoning_content` passback
|
|
20
|
+
- MiniMax: dual endpoints (China/Global + Token Plan), `reasoning_details` array format, `stripUnsupportedContentBlocks`
|
|
21
|
+
- Qwen/DashScope: Beijing/Singapore/Coding Plan URLs, `coding.dashscope.aliyuncs.com` host, qwen3.6-* prefix
|
|
22
|
+
- GLM/ZhipuAI: OpenAI + Anthropic + Coding Plan URLs, `sensitive`/`network_error`/`model_context_window_exceeded` finish reasons, `cached_tokens` support
|
|
23
|
+
- Kimi/Moonshot: kimi-k2.6 (thinking, immutable temp/top_p), `moonshot-v1-*` prefix, Preserved Thinking (`thinking.keep: "all"`)
|
|
24
|
+
- MiMo/Xiaomi: mimo-v2.5-pro/v2.5 models, Token Plan host, `repetition_truncation` finish reason
|
|
25
|
+
- **OpenAI SDK Type Alignment** — Reviewed OpenAI SDK v6.34.0 types: `Delta.ToolCall.index` required, `Delta.content` nullable, `function_call` deprecated finish reason, `stream_options.include_usage`, `Delta.refusal` handling.
|
|
26
|
+
- **Shared Adapter Utilities** — `stripUnsupportedContentBlocks` filters image/document/server_tool_use/redacted_thinking. `forceAutoToolChoice` strips `disable_parallel_tool_use`. `stripUnsupportedFields` preserves `output_config.effort`.
|
|
27
|
+
- **API Key Resolution** — OpenAI bridge now uses `getAnthropicApiKey()` unified auth path (settings.json → env → keychain) instead of raw `process.env`.
|
|
28
|
+
|
|
29
|
+
### Fixes
|
|
30
|
+
|
|
31
|
+
- **Bash Exit Code 65** — macOS Seatbelt sandbox returns exit code 65 due to overly restrictive profile. `Shell.ts` now detects this and falls through to unsandboxed spawn path.
|
|
32
|
+
- **Admin Settings Profile** — `GET/PUT /api/:scope/settings` now reads/writes the active profile file (via `getActiveProfile()`) instead of hardcoded `settings.json`.
|
|
33
|
+
- **Design Prompt False Positives** — Narrowed Chinese keyword detection for design prompt injection. Replaced broad single-character words (界面, 组件, 页面) with compound terms (前端开发, UI组件, 页面设计).
|
|
34
|
+
- **Computer Use Auto-Enable** — Removed `DEFAULT_DISABLED_BUILTIN` whitelist that required manual opt-in via `enabledMcpServers`.
|
|
35
|
+
- **reasoning_content Passback** — DeepSeek/Kimi OpenAI endpoints require `reasoning_content` from thinking mode to be passed back. `convertAnthropicToOpenAI` now extracts thinking blocks and sets them on assistant messages.
|
|
36
|
+
|
|
7
37
|
## [1.9.2] - 2026-04-25
|
|
8
38
|
|
|
9
39
|
### Features
|
package/README.md
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
**An AI-powered terminal programming assistant, supercharged.**
|
|
6
6
|
|
|
7
|
-
[](./CHANGELOG.md)
|
|
8
8
|
[](#platform-support)
|
|
9
9
|
[](./LICENSE)
|
|
10
10
|
[](https://github.com/anthropics/claude-code)
|
|
11
11
|
|
|
12
|
-
🌐 [中文文档](./README.zh-CN.md) · 🛠️ [
|
|
12
|
+
🌐 [中文文档](./README.zh-CN.md) · 🛠️ [Developer Guide](./developer.en.md) · 📊 [vs Claude Code](./COMPARISON.md) · 📊 [vs Codex](./COMPARISON-CODEX.md) · 📋 [Changelog](./CHANGELOG.md)
|
|
13
13
|
|
|
14
14
|
<img width="855" height="319" alt="image" src="https://github.com/user-attachments/assets/02c7ba2f-4ef7-4799-8e3c-b469279c44e8" />
|
|
15
15
|
|
|
@@ -34,6 +34,7 @@ LegnaCode is built on top of [Claude Code CLI](https://github.com/anthropics/cla
|
|
|
34
34
|
|
|
35
35
|
| Version | Summary |
|
|
36
36
|
|---------|---------|
|
|
37
|
+
| **1.9.3** | OpenAI-compatible API routing; deep adapter alignment for all 7 CN providers; admin profile clone; Bash sandbox fix |
|
|
37
38
|
| **1.9.2** | Computer Use Python bridge (macOS + Windows); auto Python 3.12+ venv setup; feature gate removal for Computer Use |
|
|
38
39
|
| **1.9.0** | Portable sessions (relative cwd); WebUI overhaul (project browser, memory editor, force-directed graph); full project migration (sessions + subagents + memory + skills + agents + rules + MCP config); profile switching via pointer file |
|
|
39
40
|
| **1.8.5** | Token optimization: compress tool prompts (BashTool/AgentTool/TodoWrite/EnterPlanMode); fix cache_control for Kimi/MiniMax/MiMo adapters |
|
package/README.zh-CN.md
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
**AI 驱动的终端编程助手,全面增强。**
|
|
6
6
|
|
|
7
|
-
[](./CHANGELOG.zh-CN.md)
|
|
8
8
|
[](#平台支持)
|
|
9
9
|
[](./LICENSE)
|
|
10
10
|
[](https://github.com/anthropics/claude-code)
|
|
11
11
|
|
|
12
|
-
🌐 [English](./README.md) · 📊 [对比 Claude Code](./COMPARISON.zh-CN.md) · 📋 [更新日志](./CHANGELOG.zh-CN.md)
|
|
12
|
+
🌐 [English](./README.md) · 🛠️ [开发者文档](./developer.md) · 📊 [对比 Claude Code](./COMPARISON.zh-CN.md) · 📋 [更新日志](./CHANGELOG.zh-CN.md)
|
|
13
13
|
|
|
14
14
|
<img width="855" height="319" alt="image" src="https://github.com/user-attachments/assets/6e94a216-e382-49df-aa2f-63fb96336614" />
|
|
15
15
|
|
|
@@ -34,6 +34,7 @@ LegnaCode 基于 [Claude Code CLI](https://github.com/anthropics/claude-code)
|
|
|
34
34
|
|
|
35
35
|
| 版本 | 摘要 |
|
|
36
36
|
|------|------|
|
|
37
|
+
| **1.9.3** | OpenAI 兼容 API 路由;7 家国产模型适配器深度对齐;admin 配置复制;Bash sandbox 修复 |
|
|
37
38
|
| **1.9.2** | Computer Use Python 桥接(macOS + Windows);自动 Python 3.12+ venv 设置;Computer Use feature gate 全面解锁 |
|
|
38
39
|
| **1.9.0** | 可移植会话(相对路径 cwd);WebUI 全面改版(项目浏览器、记忆编辑器、力导向关系图谱);完整项目迁移(sessions + subagents + memory + skills + agents + rules + MCP 配置);配置切换改为指针文件 |
|
|
39
40
|
| **1.8.5** | Token 优化:压缩工具提示词(BashTool/AgentTool/TodoWrite/EnterPlanMode);修复 Kimi/MiniMax/MiMo 适配器 cache_control 被误删 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legna-lnc/legnacode",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"description": "LegnaCode — legna.lnc's official CLI for coding assistance",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -142,13 +142,13 @@
|
|
|
142
142
|
"bun": ">=1.2.0"
|
|
143
143
|
},
|
|
144
144
|
"optionalDependencies": {
|
|
145
|
-
"@legna-lnc/legnacode-darwin-arm64": "1.9.
|
|
146
|
-
"@legna-lnc/legnacode-darwin-x64": "1.9.
|
|
147
|
-
"@legna-lnc/legnacode-darwin-x64-baseline": "1.9.
|
|
148
|
-
"@legna-lnc/legnacode-linux-x64": "1.9.
|
|
149
|
-
"@legna-lnc/legnacode-linux-x64-baseline": "1.9.
|
|
150
|
-
"@legna-lnc/legnacode-linux-arm64": "1.9.
|
|
151
|
-
"@legna-lnc/legnacode-win32-x64": "1.9.
|
|
152
|
-
"@legna-lnc/legnacode-win32-ia32": "1.9.
|
|
145
|
+
"@legna-lnc/legnacode-darwin-arm64": "1.9.3",
|
|
146
|
+
"@legna-lnc/legnacode-darwin-x64": "1.9.3",
|
|
147
|
+
"@legna-lnc/legnacode-darwin-x64-baseline": "1.9.3",
|
|
148
|
+
"@legna-lnc/legnacode-linux-x64": "1.9.3",
|
|
149
|
+
"@legna-lnc/legnacode-linux-x64-baseline": "1.9.3",
|
|
150
|
+
"@legna-lnc/legnacode-linux-arm64": "1.9.3",
|
|
151
|
+
"@legna-lnc/legnacode-win32-x64": "1.9.3",
|
|
152
|
+
"@legna-lnc/legnacode-win32-ia32": "1.9.3"
|
|
153
153
|
}
|
|
154
154
|
}
|