@legna-lnc/legnacode 1.9.0 → 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 CHANGED
@@ -4,6 +4,49 @@
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
+
37
+ ## [1.9.2] - 2026-04-25
38
+
39
+ ### Features
40
+
41
+ - **Computer Use Python Bridge** — Replaced native Swift/Rust modules (`@ant/computer-use-swift` + `@ant/computer-use-input`) with pure Python subprocess bridge (`runtime/mac_helper.py` + `runtime/win_helper.py`). Zero NAPI dependencies. Supports 28 commands: screenshot, mouse, keyboard, app management, clipboard, permission detection. Cross-platform: macOS and Windows.
42
+ - **Auto Python Environment Setup** — First Computer Use invocation automatically detects system Python 3.12+, creates a venv at `~/.legna/computer-use-venv/`, installs platform-specific dependencies. Search order: `LEGNA_PYTHON_BIN` env → `python3.14`..`python3.12` → `python3`/`python` → Windows `py` launcher. Requirements hash invalidation triggers reinstall on dependency changes.
43
+ - **Platform-Specific Dependencies** — Split `requirements.txt` into `requirements-macos.txt` (pyobjc), `requirements-windows.txt` (pywin32/psutil/screeninfo/pyperclip), `requirements-common.txt` (mss/Pillow/pyautogui).
44
+
45
+ ### Improvements
46
+
47
+ - **Feature Gate Removal** — Removed all GrowthBook remote feature flags and Max/Pro subscription checks for Computer Use. Now controlled by local `settings.json` (`computerUse.enabled`, default `true`). Available to all users.
48
+ - **Executor Simplification** — `executor.ts` rewritten from ~800 lines to ~200 lines. No CFRunLoop drain, no NAPI, no animated mouse movement — pure subprocess I/O.
49
+
7
50
  ## [1.9.0] - 2026-04-24
8
51
 
9
52
  ### Features
package/README.md CHANGED
@@ -4,12 +4,12 @@
4
4
 
5
5
  **An AI-powered terminal programming assistant, supercharged.**
6
6
 
7
- [![version](https://img.shields.io/badge/version-1.9.0-blue)](./CHANGELOG.md)
7
+ [![version](https://img.shields.io/badge/version-1.9.3-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)
11
11
 
12
- 🌐 [中文文档](./README.zh-CN.md) · 🛠️ [开发者文档](./developer.md) · 🛠️ [Developer Guide](./developer.en.md) · 📊 [vs Claude Code](./COMPARISON.md) · 📊 [vs Codex](./COMPARISON-CODEX.md) · 📋 [Changelog](./CHANGELOG.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,8 @@ 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 |
38
+ | **1.9.2** | Computer Use Python bridge (macOS + Windows); auto Python 3.12+ venv setup; feature gate removal for Computer Use |
37
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 |
38
40
  | **1.8.5** | Token optimization: compress tool prompts (BashTool/AgentTool/TodoWrite/EnterPlanMode); fix cache_control for Kimi/MiniMax/MiMo adapters |
39
41
 
package/README.zh-CN.md CHANGED
@@ -4,12 +4,12 @@
4
4
 
5
5
  **AI 驱动的终端编程助手,全面增强。**
6
6
 
7
- [![version](https://img.shields.io/badge/version-1.9.0-blue)](./CHANGELOG.zh-CN.md)
7
+ [![version](https://img.shields.io/badge/version-1.9.3-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)
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,8 @@ 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 修复 |
38
+ | **1.9.2** | Computer Use Python 桥接(macOS + Windows);自动 Python 3.12+ venv 设置;Computer Use feature gate 全面解锁 |
37
39
  | **1.9.0** | 可移植会话(相对路径 cwd);WebUI 全面改版(项目浏览器、记忆编辑器、力导向关系图谱);完整项目迁移(sessions + subagents + memory + skills + agents + rules + MCP 配置);配置切换改为指针文件 |
38
40
  | **1.8.5** | Token 优化:压缩工具提示词(BashTool/AgentTool/TodoWrite/EnterPlanMode);修复 Kimi/MiniMax/MiMo 适配器 cache_control 被误删 |
39
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legna-lnc/legnacode",
3
- "version": "1.9.0",
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.0",
146
- "@legna-lnc/legnacode-darwin-x64": "1.9.0",
147
- "@legna-lnc/legnacode-darwin-x64-baseline": "1.9.0",
148
- "@legna-lnc/legnacode-linux-x64": "1.9.0",
149
- "@legna-lnc/legnacode-linux-x64-baseline": "1.9.0",
150
- "@legna-lnc/legnacode-linux-arm64": "1.9.0",
151
- "@legna-lnc/legnacode-win32-x64": "1.9.0",
152
- "@legna-lnc/legnacode-win32-ia32": "1.9.0"
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
  }