@legna-lnc/legnacode 1.1.5 → 1.1.7
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 +21 -18
- package/README.md +2 -1
- package/npm/bin/legna.cjs +22 -5
- package/package.json +15 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to LegnaCode CLI will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [1.1.
|
|
5
|
+
## [1.1.6] - 2026-04-03
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **Windows external module 报错** — 从编译 external 列表移除 `@anthropic-ai/sandbox-runtime`、`@anthropic-ai/mcpb`、`@anthropic-ai/claude-agent-sdk`、`audio-capture-napi`、`color-diff-napi`、`modifiers-napi`,让 stubs 代码直接打包进二进制,Windows 不再报 `Cannot find module`
|
|
10
|
+
- **bin wrapper 多路径查找** — `npm/bin/legna.cjs` 增加全局 node_modules 扁平路径和嵌套路径 fallback,提升跨平台 npm 全局安装兼容性
|
|
11
|
+
- **版本号自动化** — 新增 `scripts/bump.ts` 一键同步 package.json、bunfig.toml、webui/package.json、optionalDependencies 版本号
|
|
12
|
+
- **发版流程自动化** — 重写 `scripts/publish.ts`,一键完成 bump → build webui → compile all → publish npm
|
|
13
|
+
|
|
14
|
+
## [1.1.5] - 2026-04-03
|
|
6
15
|
|
|
7
16
|
### New Features
|
|
8
17
|
|
|
@@ -11,29 +20,23 @@ All notable changes to LegnaCode CLI will be documented in this file.
|
|
|
11
20
|
- **配置文件切换** — 列出 settings*.json,显示 baseUrl/model,一键交换激活
|
|
12
21
|
- **会话记录浏览** — 解析 projects 目录下所有 session jsonl 文件,显示项目路径、slug、时间、prompt 数量,复制 resume 命令
|
|
13
22
|
- **配置迁移** — Claude ↔ LegnaCode 双向迁移,支持全量或选择性字段迁移(env/model/permissions 等),迁移前预览 diff
|
|
14
|
-
- **npm
|
|
23
|
+
- **npm 全平台发布** — bin wrapper (.cjs)、compile-all 跨平台编译(darwin/linux/win32)、publish 脚本
|
|
15
24
|
- **OAuth 禁用** — `isAnthropicAuthEnabled()` 返回 false,移除 OAuth 登录流程
|
|
16
25
|
|
|
26
|
+
### Fixed (1.1.1 ~ 1.1.5)
|
|
27
|
+
|
|
28
|
+
- bin wrapper 改为 `.cjs` 修复 ESM `require` 报错
|
|
29
|
+
- `optionalDependencies` 平台包版本对齐
|
|
30
|
+
- 退出 admin server 时清屏恢复终端
|
|
31
|
+
- WebUI 前端内联到二进制,不再依赖外部 `webui/dist/`
|
|
32
|
+
- 所有包版本统一为 1.1.5
|
|
33
|
+
|
|
17
34
|
### Architecture
|
|
18
35
|
|
|
19
|
-
- 后端:`src/server/admin.ts` — Bun.serve REST API
|
|
36
|
+
- 后端:`src/server/admin.ts` — Bun.serve REST API,SPA 内联为字符串常量
|
|
20
37
|
- 前端:`webui/` — React 18 + Vite + Tailwind SPA,Tab 切换 scope
|
|
38
|
+
- 内联:`scripts/inline-webui.ts` → `src/server/admin-ui-html.ts`
|
|
21
39
|
- CLI:`src/entrypoints/cli.tsx` — `admin` fast-path,零额外模块加载
|
|
22
|
-
- 构建:`scripts/build-webui.ts` — WebUI 构建脚本
|
|
23
|
-
|
|
24
|
-
### Files Changed
|
|
25
|
-
|
|
26
|
-
| 文件 | 改动 |
|
|
27
|
-
|------|------|
|
|
28
|
-
| `src/server/admin.ts` | 新增:HTTP API + 静态文件服务 |
|
|
29
|
-
| `src/entrypoints/cli.tsx` | admin fast-path |
|
|
30
|
-
| `webui/` | 新增:完整 React SPA(package.json, vite, tailwind, 4 个面板组件) |
|
|
31
|
-
| `scripts/build-webui.ts` | 新增:WebUI 构建脚本 |
|
|
32
|
-
| `scripts/compile-all.ts` | 新增:跨平台编译 |
|
|
33
|
-
| `scripts/publish.ts` | 新增:npm 发布 |
|
|
34
|
-
| `.gitignore` | 添加 webui/dist/, webui/node_modules/ |
|
|
35
|
-
| `bunfig.toml` | 版本号 → 1.1.0 |
|
|
36
|
-
| `package.json` | 版本号 → 1.1.0 |
|
|
37
40
|
|
|
38
41
|
## [1.0.9] - 2026-04-03
|
|
39
42
|
|
package/README.md
CHANGED
|
@@ -10,7 +10,8 @@ LegnaCode 是一个基于 Anthropic Claude 的智能终端编程助手,让你
|
|
|
10
10
|
|
|
11
11
|
| 版本 | 日期 | 摘要 |
|
|
12
12
|
|------|------|------|
|
|
13
|
-
| [1.1.
|
|
13
|
+
| [1.1.6](./CHANGELOG.md#116---2026-04-03) | 2026-04-03 | 修复 Windows external module 报错、全平台发版流程自动化、版本号统一 |
|
|
14
|
+
| [1.1.5](./CHANGELOG.md#115---2026-04-03) | 2026-04-03 | WebUI 管理面板 (`legna admin`)、双目录管理、配置迁移、npm 全平台发布 |
|
|
14
15
|
| [1.0.9](./CHANGELOG.md#109---2026-04-03) | 2026-04-03 | i18n 多语言补全、内置精美状态栏、配置自动迁移 |
|
|
15
16
|
| [1.0.8](./CHANGELOG.md#108---2026-04-02) | 2026-04-02 | MONITOR_TOOL、WORKFLOW_SCRIPTS、HISTORY_SNIP,3 个重量级子系统,累计 47 flags |
|
|
16
17
|
| [1.0.7](./CHANGELOG.md#107---2026-04-02) | 2026-04-02 | TERMINAL_PANEL、WEB_BROWSER_TOOL、TEMPLATES、BG_SESSIONS,累计 44 flags |
|
package/npm/bin/legna.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var os = require("os");
|
|
5
5
|
var path = require("path");
|
|
6
|
+
var fs = require("fs");
|
|
6
7
|
var childProcess = require("child_process");
|
|
7
8
|
|
|
8
9
|
var PLATFORMS = {
|
|
@@ -24,14 +25,30 @@ if (!pkg) {
|
|
|
24
25
|
process.exit(1);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
var bin;
|
|
28
|
+
var binName = process.platform === "win32" ? "legna.exe" : "bin/legna";
|
|
29
|
+
var bin = null;
|
|
30
|
+
|
|
31
|
+
// Strategy 1: require.resolve (standard npm nested node_modules)
|
|
28
32
|
try {
|
|
29
|
-
var binName = process.platform === "win32" ? "legna.exe" : "bin/legna";
|
|
30
33
|
bin = path.resolve(require.resolve(pkg + "/package.json"), "..", binName);
|
|
31
|
-
} catch (e) {
|
|
34
|
+
} catch (e) {}
|
|
35
|
+
|
|
36
|
+
// Strategy 2: sibling in global node_modules (npm global flat layout)
|
|
37
|
+
if (!bin || !fs.existsSync(bin)) {
|
|
38
|
+
var globalFlat = path.resolve(__dirname, "..", "..", pkg.replace("@legna-lnc/", "@legna-lnc" + path.sep), binName);
|
|
39
|
+
if (fs.existsSync(globalFlat)) bin = globalFlat;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Strategy 3: nested node_modules inside our own package
|
|
43
|
+
if (!bin || !fs.existsSync(bin)) {
|
|
44
|
+
var nested = path.resolve(__dirname, "..", "..", "node_modules", pkg, binName);
|
|
45
|
+
if (fs.existsSync(nested)) bin = nested;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (!bin || !fs.existsSync(bin)) {
|
|
32
49
|
console.error(
|
|
33
50
|
"legna: could not find platform package " + pkg + "\n" +
|
|
34
|
-
"Try
|
|
51
|
+
"Try: npm install -g " + pkg
|
|
35
52
|
);
|
|
36
53
|
process.exit(1);
|
|
37
54
|
}
|
|
@@ -43,7 +60,7 @@ var result = childProcess.spawnSync(bin, process.argv.slice(2), {
|
|
|
43
60
|
|
|
44
61
|
if (result.error) {
|
|
45
62
|
if (result.error.code === "EACCES") {
|
|
46
|
-
|
|
63
|
+
fs.chmodSync(bin, 0o755);
|
|
47
64
|
result = childProcess.spawnSync(bin, process.argv.slice(2), {
|
|
48
65
|
stdio: "inherit",
|
|
49
66
|
env: process.env,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legna-lnc/legnacode",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "LegnaCode — legna.lnc's official CLI for coding assistance",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,7 +16,15 @@
|
|
|
16
16
|
"url": "https://github.com/LegnaOS/LegnaCode-cli.git"
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/LegnaOS/LegnaCode-cli",
|
|
19
|
-
"keywords": [
|
|
19
|
+
"keywords": [
|
|
20
|
+
"cli",
|
|
21
|
+
"ai",
|
|
22
|
+
"claude",
|
|
23
|
+
"coding",
|
|
24
|
+
"assistant",
|
|
25
|
+
"legnacode",
|
|
26
|
+
"anthropic"
|
|
27
|
+
],
|
|
20
28
|
"scripts": {
|
|
21
29
|
"build": "bun run scripts/build.ts && python3 scripts/postbuild-fix.py",
|
|
22
30
|
"compile": "bun run scripts/compile.ts",
|
|
@@ -133,10 +141,10 @@
|
|
|
133
141
|
"bun": ">=1.2.0"
|
|
134
142
|
},
|
|
135
143
|
"optionalDependencies": {
|
|
136
|
-
"@legna-lnc/legnacode-darwin-arm64": "1.1.
|
|
137
|
-
"@legna-lnc/legnacode-darwin-x64": "1.1.
|
|
138
|
-
"@legna-lnc/legnacode-linux-x64": "1.1.
|
|
139
|
-
"@legna-lnc/legnacode-linux-arm64": "1.1.
|
|
140
|
-
"@legna-lnc/legnacode-win32-x64": "1.1.
|
|
144
|
+
"@legna-lnc/legnacode-darwin-arm64": "1.1.7",
|
|
145
|
+
"@legna-lnc/legnacode-darwin-x64": "1.1.7",
|
|
146
|
+
"@legna-lnc/legnacode-linux-x64": "1.1.7",
|
|
147
|
+
"@legna-lnc/legnacode-linux-arm64": "1.1.7",
|
|
148
|
+
"@legna-lnc/legnacode-win32-x64": "1.1.7"
|
|
141
149
|
}
|
|
142
150
|
}
|