lingeebuild-cli 0.0.363 → 0.0.365

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 ADDED
@@ -0,0 +1,37 @@
1
+ # 更新日志
2
+
3
+ ## 0.0.365 - 2026-11-24
4
+
5
+ ### 修复
6
+
7
+ - 修复 Linux x64 和 x64-baseline 安装包未随带 `libstdc++.so.6`,在 GCC 10 等较老系统上可能出现 `GLIBCXX_3.4.31 not found` 的问题;Linux glibc 包现在会随带兼容库,并在启动时注入库搜索路径。
8
+ - 修复非 Windows 平台安装后 `rg` 未链接到 CLI 外壳包 `bin` 目录,导致 `doctor` 报告 `bundled rg` 缺失的问题。
9
+ - 修复多个进程同时启动时,内置技能和专家资源并发解包可能相互删除目录并出现 `EINVAL` 的问题;现在通过跨进程锁协调解包,并在等待后复核资源版本。
10
+ - 修复 macOS 专家脚本对外部 Node.js 的依赖,统一复用 CLI 内置的 Bun 运行时。
11
+
12
+ ### 优化
13
+
14
+ - 优化文件搜索稳定性,增加搜索缓存和进程限制,并禁止跟随目录符号链接,降低异常目录结构导致的重复扫描和资源占用。
15
+
16
+ ### 已知限制
17
+
18
+ - 本次 Windows npm 包未包含 `lingee-sandbox-helper.exe`,Windows 受限沙箱功能不可用,其他 CLI 功能不受影响。
19
+
20
+ ## 0.0.364 - 2026-11-23
21
+
22
+ ### 新增
23
+
24
+ - `run` 命令新增 `--sandbox-mode` 参数,支持只读 `read-only`、可写工作区 `workspace-write` 和完整访问 `full-access`;新会话默认使用 `workspace-write`。
25
+ - 沙箱档位会保存在当前会话中,使用 `--continue` 或 `--session` 继续会话时无需重复指定。
26
+
27
+ ### 修复
28
+
29
+ - 修复 Linux 服务器使用受限沙箱时,错误提示误报缺少 Windows 沙箱组件的问题;现在会明确说明当前版本在 Linux 上尚不支持受限沙箱,并给出 `--sandbox-mode full-access` 的命令示例。
30
+ - 修复 Work 会话已被服务端拒绝时,`auth status` 仍可能依据本地状态显示已登录的问题;现在查询状态会在线复核会话。
31
+ - 修复 MaaS 租户票据过期后,`models` 可能空输出且仍以成功状态退出的问题。命令会在请求前复核会话并刷新票据,目录接口返回 401/403 时自动换票并重试一次。
32
+ - 修复模型目录的鉴权、网络、HTTP 和响应格式错误被统一转换为空列表的问题;现在保留具体错误原因,并在没有可用模型时返回非零退出码。
33
+ - 修复 CLI 拉取模型目录后未同步模型映射与完整模型缓存的问题,确保模型能力、定制参数以及视觉、文生图场景可以正确解析。
34
+
35
+ ### 文档
36
+
37
+ - npm 软件包新增使用说明和更新日志。
package/LICENSE CHANGED
File without changes
package/README.md ADDED
@@ -0,0 +1,149 @@
1
+ # Lingeebuild CLI
2
+
3
+ 金蝶灵基 Build 命令行工具,可在终端中运行开发任务、管理模型,以及启动本地 Web 或服务端接口。
4
+
5
+ npm 软件包名为 `lingeebuild-cli`,安装后的命令为 `lingeebuild`。安装时会根据当前操作系统、CPU 架构和 C 库自动选择对应的平台二进制包。
6
+
7
+ ## 环境要求
8
+
9
+ - 建议使用 Node.js 20 或更高版本及 npm。
10
+ - 支持 macOS、Linux 和 Windows 的 x64、ARM64 平台。
11
+
12
+ ## 安装
13
+
14
+ ```bash
15
+ npm install -g lingeebuild-cli
16
+ ```
17
+
18
+ 检查安装结果:
19
+
20
+ ```bash
21
+ lingeebuild --version
22
+ lingeebuild --help
23
+ ```
24
+
25
+ ## 快速开始
26
+
27
+ 登录灵基 Work 平台:
28
+
29
+ ```bash
30
+ lingeebuild auth login
31
+ ```
32
+
33
+ 也可以通过手机扫码授权:
34
+
35
+ ```bash
36
+ lingeebuild auth login --qr
37
+ ```
38
+
39
+ 确认登录状态并查看当前租户可用的模型:
40
+
41
+ ```bash
42
+ lingeebuild auth status
43
+ lingeebuild models
44
+ ```
45
+
46
+ 在项目目录中运行任务:
47
+
48
+ ```bash
49
+ lingeebuild run "分析当前项目并修复发现的问题"
50
+ ```
51
+
52
+ ## 常用命令
53
+
54
+ | 命令 | 用途 |
55
+ | --------------------------------------- | --------------------------- |
56
+ | `lingeebuild run "任务描述"` | 执行一次开发任务 |
57
+ | `lingeebuild run --continue "继续处理"` | 继续最近一次会话 |
58
+ | `lingeebuild models` | 列出当前可用的模型 |
59
+ | `lingeebuild auth status` | 查看平台登录状态 |
60
+ | `lingeebuild auth switch` | 切换当前租户 |
61
+ | `lingeebuild auth logout` | 退出平台登录 |
62
+ | `lingeebuild web` | 启动本地服务并打开 Web 界面 |
63
+ | `lingeebuild serve` | 启动无界面的本地服务端 |
64
+
65
+ 查看某个命令的完整参数:
66
+
67
+ ```bash
68
+ lingeebuild run --help
69
+ lingeebuild auth --help
70
+ ```
71
+
72
+ ## 选择模型
73
+
74
+ 按供应商筛选模型,并在运行时指定 `provider/model`:
75
+
76
+ ```bash
77
+ lingeebuild models kingdee-maas
78
+ lingeebuild run --model "kingdee-maas/<model-id>" "任务描述"
79
+ ```
80
+
81
+ 调整当前默认模型的上下文窗口大小:
82
+
83
+ ```bash
84
+ lingeebuild model context 200000
85
+ ```
86
+
87
+ 平台登录态和 MaaS 租户票据会在执行模型目录等命令时按需复核、刷新;只有平台明确拒绝当前会话时才需要重新登录。
88
+
89
+ ## 沙箱档位
90
+
91
+ `run` 命令支持通过 `--sandbox-mode` 设置会话沙箱档位:
92
+
93
+ | 档位 | 说明 |
94
+ | ----------------- | ---------------------------------------- |
95
+ | `read-only` | 只读,不允许修改文件 |
96
+ | `workspace-write` | 允许修改当前工作区,新会话默认使用此档位 |
97
+ | `full-access` | 使用当前系统账户的完整权限,仅限可信环境 |
98
+
99
+ 在可信环境中显式选择完整访问:
100
+
101
+ ```bash
102
+ lingeebuild run --sandbox-mode full-access "查看项目结构"
103
+ ```
104
+
105
+ 档位设置后保存在当前会话中,继续会话时无需重复指定:
106
+
107
+ ```bash
108
+ lingeebuild run --continue "继续查看入口文件"
109
+ ```
110
+
111
+ 当前版本在 Linux 上尚不支持受限沙箱;在可信的 Linux 环境中可显式使用 `--sandbox-mode full-access`。
112
+
113
+ ## 自动化与脚本
114
+
115
+ 使用 JSONL 事件流并关闭交互等待,便于接入 CI 或其他自动化工具:
116
+
117
+ ```bash
118
+ lingeebuild run "执行测试并汇总结果" --format jsonl --no-interactive
119
+ ```
120
+
121
+ 也可以从文件或标准输入读取提示词:
122
+
123
+ ```bash
124
+ lingeebuild run --prompt-file ./task.md --no-interactive
125
+ cat ./task.md | lingeebuild run --prompt-file - --no-interactive
126
+ ```
127
+
128
+ ## 更新日志
129
+
130
+ ### 0.0.364
131
+
132
+ - `run` 新增 `--sandbox-mode` 会话沙箱档位,支持 `read-only`、`workspace-write` 和 `full-access`。
133
+ - 修正 Linux 受限沙箱不可用时的错误提示,不再误报缺少 Windows 沙箱组件。
134
+ - 修复登录状态误报,以及 MaaS 租户票据过期导致 `models` 静默空输出的问题。
135
+ - 模型目录请求支持自动换票并重试,同时保留鉴权、网络和服务端错误原因。
136
+ - 修复 CLI 模型能力、定制参数及视觉、文生图场景的缓存同步问题。
137
+
138
+ 完整更新日志见随软件包发布的 `CHANGELOG.md`。
139
+
140
+ ## 更新与卸载
141
+
142
+ ```bash
143
+ npm install -g lingeebuild-cli@latest
144
+ npm uninstall -g lingeebuild-cli
145
+ ```
146
+
147
+ ## 许可证
148
+
149
+ MIT
package/package.json CHANGED
@@ -1,19 +1,26 @@
1
1
  {
2
2
  "name": "lingeebuild-cli",
3
+ "description": "金蝶灵基 Build 命令行工具",
3
4
  "bin": {
4
5
  "lingeebuild": "./bin/lingeebuild"
5
6
  },
6
7
  "scripts": {
7
8
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
8
9
  },
9
- "version": "0.0.363",
10
+ "version": "0.0.365",
10
11
  "license": "MIT",
11
12
  "optionalDependencies": {
12
- "lingeebuild-darwin-arm64": "0.0.363",
13
- "lingeebuild-linux-arm64": "0.0.363",
14
- "lingeebuild-windows-x64": "0.0.363",
15
- "lingeebuild-darwin-x64": "0.0.363",
16
- "lingeebuild-windows-arm64": "0.0.363",
17
- "lingeebuild-linux-x64": "0.0.363"
13
+ "lingeebuild-linux-x64-musl": "0.0.365",
14
+ "lingeebuild-linux-x64-baseline": "0.0.365",
15
+ "lingeebuild-darwin-arm64": "0.0.365",
16
+ "lingeebuild-linux-arm64": "0.0.365",
17
+ "lingeebuild-windows-x64": "0.0.365",
18
+ "lingeebuild-darwin-x64-baseline": "0.0.365",
19
+ "lingeebuild-darwin-x64": "0.0.365",
20
+ "lingeebuild-windows-arm64": "0.0.365",
21
+ "lingeebuild-linux-x64": "0.0.365",
22
+ "lingeebuild-linux-arm64-musl": "0.0.365",
23
+ "lingeebuild-linux-x64-baseline-musl": "0.0.365",
24
+ "lingeebuild-windows-x64-baseline": "0.0.365"
18
25
  }
19
26
  }
package/postinstall.mjs CHANGED
@@ -68,6 +68,16 @@ function findBinary() {
68
68
  }
69
69
  }
70
70
 
71
+ function linkExecutable(source, target) {
72
+ if (fs.existsSync(target)) fs.unlinkSync(target)
73
+ try {
74
+ fs.linkSync(source, target)
75
+ } catch {
76
+ fs.copyFileSync(source, target)
77
+ }
78
+ fs.chmodSync(target, 0o755)
79
+ }
80
+
71
81
  async function main() {
72
82
  try {
73
83
  if (os.platform() === "win32") {
@@ -81,13 +91,12 @@ async function main() {
81
91
  // Don't replace the wrapper script - it handles binary execution
82
92
  const { binaryPath, packageDir } = findBinary()
83
93
  const target = path.join(__dirname, "bin", ".lingeebuild")
84
- if (fs.existsSync(target)) fs.unlinkSync(target)
85
- try {
86
- fs.linkSync(binaryPath, target)
87
- } catch {
88
- fs.copyFileSync(binaryPath, target)
89
- }
90
- fs.chmodSync(target, 0o755)
94
+ linkExecutable(binaryPath, target)
95
+
96
+ // process.execPath points at bin/.lingeebuild, so both doctor and the runtime
97
+ // resolve the bundled rg next to it rather than inside the platform package.
98
+ const ripgrep = path.join(packageDir, "bin", "rg")
99
+ if (fs.existsSync(ripgrep)) linkExecutable(ripgrep, path.join(__dirname, "bin", "rg"))
91
100
 
92
101
  // 平台包 bin/lib 随带兼容老发行版的 libstdc++;复制到 wrapper 的 bin/lib,
93
102
  // wrapper 启动二进制时注入 LD_LIBRARY_PATH(硬链接路径下同样生效)。