Skip to content

Commit 4f59ca5

Browse files
committed
Merge branch 'main' into feat/runtime-risk-confirmation
2 parents 0872ff6 + 5c96077 commit 4f59ca5

70 files changed

Lines changed: 2045 additions & 576 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
66

77
[中文版](CHANGELOG.zh.md) · [README](README.md) · [Contributing](CONTRIBUTING.md)
88

9+
## [1.18.1] - 2026-08-28
10+
11+
### Removed
12+
13+
- Removed API Key validation from `bl auth login`.
14+
15+
## [1.18.0] - 2026-08-27
16+
17+
### Added
18+
19+
- **Automatic Profile API Key fallback** — unsupported commands use the API Key and endpoint from `default` without requiring a Profile switch; explicit credentials still take priority.
20+
- **Independent speech defaults** — Profiles support separate default models for TTS and ASR.
21+
- **Wan3.0 file-to-video**`bl video generate --file` accepts local files or URLs and validates incompatible inputs.
22+
23+
### Changed
24+
25+
- **Wan3.0 is now the default video model** — regular API Key text, image, and reference video tasks default to `wan3.0-video`, with first/last-frame and reference-audio support. Token Plan defaults remain unchanged.
26+
- **Expanded Token Plan preset** — login adds speech defaults and missing capabilities while preserving existing user configuration.
27+
- **Improved speech and Skill installation experience** — streaming synthesis defaults to PCM; installation docs add a Node 18-compatible fallback and clarify the Node.js and Git prerequisites.
28+
929
## [1.17.1] - 2026-08-22
1030

1131
### Fixed

CHANGELOG.zh.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@
66

77
[English](CHANGELOG.md) · [README](README.zh.md) · [参与贡献](CONTRIBUTING.zh.md)
88

9+
## [1.18.1] - 2026-08-28
10+
11+
### 已移除
12+
13+
- 移除 `bl auth login` 的 API Key 校验。
14+
15+
## [1.18.0] - 2026-08-27
16+
17+
### 新增
18+
19+
- **Profile API Key 自动回退** —— 当前 Profile 不支持某条命令时,自动使用 `default` 中的 API Key 和接入地址,无需手动切换 Profile;显式凭证仍然优先。
20+
- **语音合成与识别支持独立默认模型** —— Profile 支持分别配置 TTS 和 ASR 默认模型。
21+
- **Wan3.0 文件生视频** —— `bl video generate --file` 支持本地文件或 URL,并校验互斥输入。
22+
23+
### 变更
24+
25+
- **视频默认模型升级至 Wan3.0** —— 普通 API Key 的文生、图生和参考生视频默认使用 `wan3.0-video`,并支持首尾帧与参考音频;Token Plan 默认模型保持不变。
26+
- **扩展 Token Plan 预设** —— 登录后自动补充语音默认模型和缺失能力,同时保留用户已有配置。
27+
- **优化语音与 Skill 安装体验** —— 流式语音合成默认输出 PCM;Skill 安装文档补充兼容 Node 18 的降级方式及 Node.js、Git 前置条件。
28+
929
## [1.17.1] - 2026-08-22
1030

1131
### 修复

INSTALL.md

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,25 @@ npm install -g bailian-cli
1313
```
1414

1515
4. 校验:`bl --version`
16+
5. 按下方「安装 skills」安装。
1617

17-
安装 skills(CLI 内置,无需 Git / npx skills):
18+
### 安装 skills
19+
20+
**Supported(优先):** 用 CLI 内置命令一次装齐 registry 中全部 `bailian-*`(含共享协议 `bailian-protocol`):
1821

1922
```bash
2023
bl skill init
2124
```
2225

23-
**Supported:** `bl skill init` 一次装齐 registry 中全部 `bailian-*`(含共享协议 `bailian-protocol`)。
24-
25-
**Advanced / 按需子集:**
26+
**降级:**`bl skill init` 失败,先确认本机同时满足两个条件:`node -v` / `npm -v` 成功,**** `git --version` 成功。两个条件都成立时,再回退到:
2627

2728
```bash
28-
bl skill add --name bailian-protocol,bailian-gen
29+
npx skills@1.5.18 add modelstudioai/cli --all -g
2930
```
3031

31-
安装成功后,用中文简要说明已安装的 skills 及用户可做什么。
32+
> 必须使用 `skills@1.5.18`:这是最后兼容 Node ≥18 的版本(与 Bailian CLI 的 Node ≥18.17.0 一致);
33+
34+
安装成功后,按第 5 节向用户说明语言切换与能力 tip(若也装了 skills,一并简要说明)。
3235

3336
## 2. 备选:二进制安装(无需 Node)
3437

@@ -67,8 +70,6 @@ bl --version
6770
which bl # Windows: where.exe bl
6871
```
6972

70-
若自动 skill 安装失败,再手动执行:`bl skill init`
71-
7273
> CDN / GitHub Release 未就绪或下载失败时,若本机已有合格 Node,回退到上方 npm 安装。
7374
7475
---
@@ -99,12 +100,43 @@ which bl # Windows: where.exe bl
99100
bl auth status --output json
100101
```
101102

102-
## 5. 常见问题
103+
## 5. 安装成功后向用户说明(必做)
104+
105+
安装与校验完成后,**主动**用中文向用户说明下列两项;不要等用户追问。可执行 `bl`(已登录时)对照终端 tip,但以下列表为准,勿臆造。
106+
107+
### 5.1 界面语言
108+
109+
Bailian CLI 支持中英文界面(help / 欢迎语 / Quick Start 主次文案)。默认 `en-US`,可切换为 `zh-CN`
110+
111+
```bash
112+
bl config set --key language --value zh-CN
113+
bl config set --key language --value en-US
114+
```
103115

104-
| 现象 | 可能原因 | 建议动作 |
105-
| ------------------------ | ---------------------------- | ------------------------------------------------ |
106-
| `bl: command not found` | bin 不在 PATH | 检查 `~/.local/bin``npm prefix -g` |
107-
| curl 安装 404 | GitHub Release 资产未上传 | 改用 `npm install -g bailian-cli` |
108-
| Windows `bl update` 失败 | 旧布局 / 文件锁 / 网络 | 重跑 `irm .../install.ps1 \| iex` 迁移布局后重试 |
109-
| `plugin` 需要 npm | 二进制安装无本机 npm | 安装 Node,或改用 npm 版 CLI |
110-
| 安装报错 engines | Node 版本过低(仅 npm 路径) | 升级到 ≥ 18.17.0 |
116+
向用户说明:可随时用上述命令切换语言。
117+
118+
### 5.2 能力 tip(Quick Start)
119+
120+
向用户展示「试试使用Bailian CLI完成这些任务」及下列 5 条(中英各一行,与 `bl` 根帮助 tip 一致):
121+
122+
1. 帮我创建一个能够生成短片分镜和视频的 Managed Agent。
123+
Help me create a Managed Agent that can generate short-film storyboards and videos.
124+
2. 生成一张穿着太空服的猫站在火星上的图片,再把它制作成一段视频。
125+
Generate an image of a cat in a spacesuit standing on Mars, then turn it into a video.
126+
3. 查看最近的模型用量、免费额度和限流情况。
127+
Check my recent model usage, free quota, and rate limits.
128+
4. 推荐一个适合图片理解和智能客服的模型。
129+
Recommend a model suitable for image understanding and intelligent customer service.
130+
5. 介绍一下 Bailian CLI 能帮我完成哪些任务,并根据我的需求推荐使用方式。
131+
Explain what Bailian CLI can help me accomplish, and recommend how to use it based on my needs.
132+
133+
## 6. 常见问题
134+
135+
| 现象 | 可能原因 | 建议动作 |
136+
| ------------------------ | ---------------------------- | ---------------------------------------------------------------------------------------------- |
137+
| `bl: command not found` | bin 不在 PATH | 检查 `~/.local/bin``npm prefix -g` |
138+
| curl 安装 404 | GitHub Release 资产未上传 | 改用 `npm install -g bailian-cli` |
139+
| Windows `bl update` 失败 | 旧布局 / 文件锁 / 网络 | 重跑 `irm .../install.ps1 \| iex` 迁移布局后重试 |
140+
| `plugin` 需要 npm | 二进制安装无本机 npm | 安装 Node,或改用 npm 版 CLI |
141+
| 安装报错 engines | Node 版本过低(仅 npm 路径) | 升级到 ≥ 18.17.0 |
142+
| `bl skill init` 失败 | 网络 / registry 不可达等 | 有 Node 且有 Git 时降级 `npx skills@1.5.18 add modelstudioai/cli --all -g`;否则重试或告知用户 |

docs/agents/auth-change.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ defineCommand({ auth }) → runtime/authStage → ctx.client → command.run(ctx
3333

3434
`~/.bailian/config.json` 可同时保存 `api_key``access_token``access_key_*`。登录任一种方式不得删除另一种:
3535

36-
- `bl auth login --api-key ...` 只更新 `api_key` / `base_url`
36+
- `bl auth login --api-key ...` 更新 `api_key`;显式 `base_url` 会一并写入,所选命名 Profile 若命中内置套餐预设(当前为 `token-plan`),则在尚未保存 `base_url` 时补写预设地址,并把该预设的默认模型物化写入。API Key 落盘成功后,`api_key_capabilities` 保留已有项并追加当前 preset 中缺少的项,不自动删除任何已有能力;无 preset 的自定义 Profile 不做合并。登录仍不得删除其他鉴权域的凭证
3737
- `bl auth login --console` 只更新 `access_token` 以及回调携带的 console 作用域字段
3838
- `bl auth login --open-api ...` 更新 `access_key_id` / `access_key_secret`,同时会调用 OpenAPI 生成 CLI `access_token` 并一并写入;即一次 `--open-api` 登录同时产生 `openapi``console` 域凭证
3939
- `bl auth logout --console` 只清 `access_token`
@@ -44,8 +44,12 @@ defineCommand({ auth }) → runtime/authStage → ctx.client → command.run(ctx
4444

4545
- `resolveApiKey()``auth: "apiKey"` 命令;优先级 `--api-key` > `DASHSCOPE_API_KEY` > config `api_key`
4646
- `resolveModelBaseUrl()` — model base URL;优先级 `--base-url` > `DASHSCOPE_BASE_URL` > config `base_url` > `REGIONS.cn`,返回前统一归一化为 URL origin(仅保留协议、host 和显式端口,去除 path、query、fragment)
47-
- `--config` 只选择 config 文件 block,不提升该 block 的字段优先级;内置套餐 Profile(当前为 `token-plan`)的预设仅在登录时物化写入,运行时继续走统一的 flag > env > selected config file > 默认值
48-
- 显式 `auth login --config <name>` 在凭证验证并落盘成功后自动激活目标 Profile;未传
47+
- `--config` 只选择 config 文件 block,不提升该 block 的字段优先级。对 `auth: "apiKey"` 命令,runtime 会先按叶子命令路径检查所选 Profile 的 `api_key_capabilities`:
48+
- `--api-key` / `--base-url``DASHSCOPE_API_KEY` / `DASHSCOPE_BASE_URL` 任一显式连接覆盖存在时,完全跳过自动降级,继续走统一的 flag > env > selected config file > 默认值
49+
- 配置文件显式声明 `api_key_capabilities` 后,命中能力时保留所选 Profile,未命中时仅把 file-backed `api_key` / `base_url` 来源切到顶层 `default`,其他 Settings 仍来自所选 Profile
50+
- 字段缺失时不启用降级,包括命中内置套餐预设的 Profile;preset 只在 API Key 登录落盘成功后物化写入,升级 preset 需要重新登录
51+
- fallback 反馈写 stderr:text 模式输出本地化句子,`--output json` 输出两空格缩进的多行 `warning` 对象;若后续鉴权失败,warning 与多行 `error` 对象以空行分隔,stdout 仍只保留命令结果
52+
- 显式 `auth login --config <name>` 在凭证落盘成功后自动激活目标 Profile;未传
4953
`--config` 时继续写当前激活项,失败和 dry-run 不切换
5054
- `resolveConsole()``auth: "console"` 命令;当前 token 来自 config `access_token`,region/site/switchAgent 来自 flag > config > 默认
5155
- `resolveOpenApi()``auth: "openapi"` 命令;优先级 `--access-key-id/--access-key-secret` > `ALIBABA_CLOUD_ACCESS_KEY_ID/ALIBABA_CLOUD_ACCESS_KEY_SECRET` > config `access_key_*`。兼容读取旧字段 `openapi_access_key_*`,新写入只写短字段

docs/agents/cli-e2e-tests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ describe.skipIf(<ready>)("e2e: <topic>(DashScope …)", () => {
101101

102102
## 安全与例外
103103

104-
- **禁止破坏真实用户配置**`auth logout` 默认只用 `--dry-run`需要验证实际落盘时,必须通过
105-
`BAILIAN_CONFIG_DIR` 指向隔离 fixture;`config set` 只用 `--dry-run`
104+
- **禁止破坏真实用户配置**`auth logout` `config set` 默认只用 `--dry-run`只有验证持久化契约时,才允许通过
105+
`BAILIAN_CONFIG_DIR` 指向每个用例独占的临时目录实际落盘,并必须在 `finally` 中清理;禁止写入或复用真实 `~/.bailian`
106106
- **不加 dry-run**`dryRun``resolveFileUrl` / `resolveCredential` / 上传**之后**的命令(如 `image edit``speech recognize``--url`
107107
- **`--list-voices` 等旁路**:先于 `--text` 校验的 flag,缺参用例勿带该 flag
108108
- 新增 required option → 至少一条缺参用例;改 dry-run 输出 → 更新对应断言

docs/agents/command-pack.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
- [ ] Command Pack 不能覆盖内置命令、其他 pack 命令或重声明保留 flag。
3333
- [ ] 普通网络请求走 `ctx.client`;基础 Context 提供 `identity/settings/flags/client/output/errors`,不提供原始凭据。
3434
- [ ] `ctx.credentials.apiKey()` 仅限 policy 显式声明 `credentialAccess: ["apiKey"]`,且命令自身为 `auth: "apiKey"`
35+
- [ ] API Key capability ID 由 host 按实际叶子命令路径生成(例如 `agent credential``agent.credential`);Command Pack 不声明额外元数据,Profile allowlist 对 pack 命令同样 fail closed。
36+
- [ ] `ctx.credentials.apiKey()` 必须返回 `authStage` 已注入 `ctx.client` 的实际凭证,不能重新读取原 Profile 绕过 capability fallback。
3537
- [ ] 不向 Command Pack 暴露原始 Console Token、OpenAPI AK/SK、`authStore``configStore`
3638
- [ ] 不向 Command Pack 暴露宿主的 `commandPacks` manager,避免 pack 安装或删除其他 pack。
3739
- [ ] 单包失败必须 fail-open:保留内置命令和其他合法 pack。
@@ -40,6 +42,7 @@
4042
## 测试与文档
4143

4244
- [ ] `packages/runtime/tests/command-packs.test.ts` 覆盖产品 policy、安装目录隔离、协议版本、前缀和导出契约。
45+
- [ ] Command Pack 测试覆盖 capability 格式/鉴权域、adapter 保留字段,以及 raw API Key 委托使用 fallback 后的实际 Base URL。
4346
- [ ] `packages/cli/tests/e2e/command-packs.e2e.test.ts` 覆盖 help、link、执行、output/errors、凭据授权、list、remove。
4447
- [ ] `packages/kscli/tests/e2e/command-packs.e2e.test.ts` 覆盖统一 host 和 runtime 默认空 policy 下不暴露管理命令。
4548
- [ ] fixture 的包名必须在测试白名单内,且构建入口不依赖工作区运行时解析。

docs/agents/config-add.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ config 文件 ─┘
2929
- `ConfigFile`(disk 形状,snake_case)加新字段(如果允许写文件)
3030
- `parseConfigFile()` 解析新字段
3131
- 如果是 enum 字段,加校验
32+
- 如果是数组字段,明确“缺失 / 空数组 / 非法值”的不同语义;安全策略字段的非法值必须 fail closed
3233

3334
### B. 加载逻辑
3435

@@ -51,6 +52,7 @@ config 文件 ─┘
5152
- [ ] 配置展示 / 修改命令同步:
5253
- `packages/commands/src/commands/config/show.ts` 显示新字段
5354
- `packages/commands/src/commands/config/set.ts``VALID_KEYS` / `KEY_ALIASES` / description 允许 set
55+
- `packages/commands/src/commands/config/ui.ts` / `ui-html.ts` 能按原类型往返数组字段,不能把 `[]` 保存成字段缺失
5456

5557
### E. 文档
5658

@@ -61,6 +63,7 @@ config 文件 ─┘
6163
- [ ] 单测覆盖优先级:flag > env > file
6264
- [ ] 校验失败抛错(非法值)
6365
- [ ] 默认值正确
66+
- [ ] 数组配置覆盖 CLI 逗号/JSON 输入、Config UI 往返、去重和显式空数组
6467

6568
## 完成后自查
6669

@@ -82,3 +85,4 @@ cat ~/.bailian/config.json
8285
- ✗ 全局 switch 没标 `type: "switch"`,被当成需要值的 `--xxx <value>`
8386
- ✗ 加了 env var 但 README 表格没更新,用户不知道有这条
8487
-`config show` 不显示新字段,用户改了无法回查
88+
- ✗ UI 用 `String([])` 把显式空数组渲染为空串,保存后意外关闭安全策略

0 commit comments

Comments
 (0)