Skip to content

Commit dc5a535

Browse files
author
wb-liuxuehuan
committed
Merge remote-tracking branch 'upstream/main' into token-plan-openapi
2 parents 1410554 + 19c4f5f commit dc5a535

113 files changed

Lines changed: 2471 additions & 1298 deletions

File tree

Some content is hidden

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

AGENTS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ CLI 只为「自己能权威解释的错误」发出语义化信号,服务端的
9393

9494
不要扮演服务端错误的翻译官——我们没有最新的错误码体系认知,二次包装只会撒谎(详见 `docs/agents/error-hint-change.md` 中的反面 case)。
9595

96+
### 4. Console Gateway 命令必须声明 console 全局 flags
97+
98+
如果新命令使用了 `callConsoleGateway`,必须在 `options` 中添加以下三个全局 flag 的说明,以便 `--help` 中展示:
99+
100+
```ts
101+
{ flag: "--console-region <region>", description: "Console region" },
102+
{ flag: "--console-site <site>", description: "Console site: domestic, international" },
103+
{ flag: "--console-switch-agent <uid>", description: "Switch agent UID", type: "number" },
104+
```
105+
106+
这些 flag 已在 `GLOBAL_OPTIONS``packages/core/src/types/command.ts`)中注册,由 `loadConfig` 写入 `config.consoleRegion` / `config.consoleSite` / `config.consoleSwitchAgent``callConsoleGateway` 自动读取——命令无需手动提取或传递。
107+
96108
## 完成改动后的快速验证
97109

98110
```sh

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,50 @@ 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.4.1] - 2026-06-22
10+
11+
### Changed
12+
13+
- Video generation now defaults to the upgraded HappyHorse 1.1 model for better quality. The 1.0 models are still available via `--model`.
14+
- `bl update` now keeps the agent skill in sync across all your agent apps (Claude Code, Cursor, etc.), and refreshes it even when the CLI is already up to date.
15+
16+
## [1.4.0] - 2026-06-17
17+
18+
### Added
19+
20+
- Console gateway now supports multiple regions and sites: `cn-beijing` and `ap-southeast-1`, each with domestic and international variants, plus `switchAgent` for delegated access.
21+
- New global flags `--console-region`, `--console-site`, and `--console-switch-agent`; `bl console call` also gains `--site` and `--switch-agent`.
22+
- `bl auth login --base-url <url>` to specify the base URL when logging in with an API key.
23+
- `bl omni` gains a `--voice` option (Chelsie, Cherry, Ethan, Serena, Sunny, Tina; default Cherry).
24+
25+
### Changed
26+
27+
- All user-facing CLI text is now standardized to English.
28+
- `bl advisor recommend` internal intent/ranking model upgraded from `qwen-turbo` to `qwen-flash`.
29+
- Cleaner JSON output for `usage`, `quota`, and `workspace` commands.
30+
- `base_url` from the config file now takes priority over the `DASHSCOPE_BASE_URL` environment variable.
31+
- `bl config show` now displays all fields from `config.json`, with sensitive values masked.
32+
33+
### Removed
34+
35+
- The legacy `region` config field and its related options.
36+
- Invalid leftover code for the removed `model list` command.
37+
38+
### Fixed
39+
40+
- When the console session is not logged in or has expired, the CLI now shows a clear sign-in prompt instead of a generic gateway error.
41+
- Corrected `--resolution` / `--ratio` / `--duration` flag descriptions for `bl video` commands.
42+
43+
## [1.3.3] - 2026-06-16
44+
45+
### Changed
46+
47+
- `bl knowledge retrieve --help` now clearly indicates that `--api-key` is the recommended authentication method; AK/SK flags are explicitly marked as deprecated with guidance to use `--api-key` instead.
48+
49+
### Added
50+
51+
- `notes` field for command definitions — commands can now include contextual notes (auth requirements, deprecation notices, etc.) that are displayed in both `--help` output and the generated reference docs.
52+
953
## [1.3.2] - 2026-06-12
1054

1155
### Fixed

CHANGELOG.zh.md

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

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

9+
## [1.4.1] - 2026-06-22
10+
11+
### 变更
12+
13+
- 视频生成默认升级到 HappyHorse 1.1 模型,画面质量更佳。如需使用 1.0 模型,可通过 `--model` 指定。
14+
- `bl update` 现在会把 agent skill 同步更新到所有 agent 应用(Claude Code、Cursor 等),即使 CLI 已是最新版本也会刷新 skill。
15+
16+
## [1.4.0] - 2026-06-17
17+
18+
### 新增
19+
20+
- 控制台网关支持多 region 与多站点:`cn-beijing``ap-southeast-1`,各含国内站 / 国际站变体,并新增 `switchAgent` 委托访问。
21+
- 新增全局标志 `--console-region``--console-site``--console-switch-agent``bl console call` 另外新增 `--site``--switch-agent`
22+
- `bl auth login --base-url <url>`:使用 API Key 登录时可指定 base URL。
23+
- `bl omni` 新增 `--voice` 选项(Chelsie、Cherry、Ethan、Serena、Sunny、Tina,默认 Cherry)。
24+
25+
### 变更
26+
27+
- 所有面向用户的 CLI 文案统一为英文。
28+
- `bl advisor recommend` 内部意图 / 排序模型由 `qwen-turbo` 升级为 `qwen-flash`
29+
- 优化 `usage``quota``workspace` 命令的 JSON 输出。
30+
- 配置文件中的 `base_url` 现在优先级高于环境变量 `DASHSCOPE_BASE_URL`
31+
- `bl config show` 现在展示 `config.json` 中的全部字段(敏感值已脱敏)。
32+
33+
### 移除
34+
35+
- 移除遗留的 `region` 配置字段及其相关选项。
36+
- 清理 `model list` 命令移除后遗留的无效代码。
37+
38+
### 修复
39+
40+
- 当控制台会话未登录或已过期时,CLI 现在会给出明确的登录提示,不再是笼统的网关错误。
41+
- 修正 `bl video` 命令 `--resolution` / `--ratio` / `--duration` 的帮助文案。
42+
43+
## [1.3.3] - 2026-06-16
44+
45+
### 变更
46+
47+
- `bl knowledge retrieve --help` 现在明确指出 `--api-key` 是推荐的鉴权方式;AK/SK 相关选项已标注废弃并引导用户使用 `--api-key`
48+
49+
### 新增
50+
51+
- 命令定义新增 `notes` 字段 — 命令可以附带上下文说明(鉴权要求、废弃提示等),同时展示在 `--help` 输出和生成的命令手册中。
52+
953
## [1.3.2] - 2026-06-12
1054

1155
### 修复

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ bl auth status --output json
102102
bl text chat --message "ping" --non-interactive --output json
103103
```
104104

105-
若失败:根据 stderr / JSON 中的 `hint``message` 排查(网络、Key 无效、region 等)。全局 region:`--region cn|us|intl`,默认 `cn`
105+
若失败:根据 stderr / JSON 中的 `hint``message` 排查(网络、Key 无效、`base_url` 等)。DashScope 端点:使用 `--base-url` / `bl config set --key base_url` / `DASHSCOPE_BASE_URL`,默认中国大陆 `https://dashscope.aliyuncs.com`
106106

107107
---
108108

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ Equip your AI Agent out-of-the-box with these capabilities, composable across co
2727
- **Text chat** — Qwen3.7-max: major gains in agentic coding, frontend coding, and vibe coding
2828
- **Multimodal (Omni)** — Full omni-modal support across text + image + audio + video
2929
- **Image generation & editing** — Qwen-Image 2.0: pro text rendering, photorealism, strong semantic adherence, multi-image composition
30-
- **Video generation & editing**HappyHorse-1.0 series: text-/image-/reference-to-video and natural-language video editing (up to 9-image reference)
30+
- **Video generation & editing**happyhorse-1.1 series: text-/image-/reference-to-video and natural-language video editing (up to 9-image reference)
3131
- **Speech synthesis & recognition** — CosyVoice streaming TTS, voice cloning from 5–20s samples; FunAudio-ASR covers 30 languages including 7 Chinese dialects and 20+ Mandarin accents
3232
- **Image & video understanding** — Qwen-VL: long-form video analysis, chart/document parsing, visual reasoning, multilingual OCR
33+
34+
> **Note:** The features below are currently available only to China site (aliyun.com) account holders and are not yet supported for international / global site accounts.
35+
3336
- **Knowledge base & memory** — Multimodal RAG retrieval and cross-session memory for personalized, coherent dialogue
3437
- **App calls** — Invoke agents and workflows already published on Aliyun Model Studio
3538
- **MCP integration** — Orchestrate Bailian MCP servers: list services, inspect tools, and invoke any tool directly from the terminal
@@ -51,7 +54,7 @@ Equip your AI Agent out-of-the-box with these capabilities, composable across co
5154
A complete **2-minute, 16:9 cinematic short film** — produced end-to-end from a single natural-language sentence, with **zero manual editing**. This showcase demonstrates how an AI Agent can compose a multi-step creative pipeline by orchestrating three primitives:
5255

5356
- **[Qwen Code](https://github.com/QwenLM/qwen-code)** — the agentic coding model that interprets the user's intent and drives the workflow
54-
- **[Aliyun Model Studio CLI](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)** — invokes **HappyHorse 1.0**, Aliyun Model Studio's text-/image-/reference-to-video generation model
57+
- **[Aliyun Model Studio CLI](https://bailian.console.aliyun.com/cli?source_channel=cli_github&)** — invokes **HappyHorse 1.1**, Aliyun Model Studio's text-/image-/reference-to-video generation model
5558
- **[spark-video Skill](https://github.com/JohnKeating1997/spark-video)** — handles scene decomposition, storyboarding, shot continuity, and final stitching
5659

5760
### The single prompt
@@ -64,7 +67,7 @@ A complete **2-minute, 16:9 cinematic short film** — produced end-to-end from
6467

6568
1. **Qwen Code** parses the request, plans the narrative beats, and decides which tools to call.
6669
2. The **spark-video Skill** breaks the story into shots, writes per-shot prompts, and enforces visual continuity (characters, lighting, palette, lens language).
67-
3. **`bl video generate`** dispatches each shot to **HappyHorse 1.0** in parallel.
70+
3. **`bl video generate`** dispatches each shot to **HappyHorse 1.1** in parallel.
6871
4. The skill stitches all clips back together into a single 16:9 / ~2-min deliverable.
6972

7073
No timeline scrubbing. No frame-by-frame editing. Just one sentence → one video.
@@ -172,7 +175,7 @@ export BAILIAN_WORKSPACE_ID=ws-...
172175
bl config show
173176

174177
# Set defaults
175-
bl config set --key region --value us
178+
bl config set --key base_url --value https://dashscope-us.aliyuncs.com
176179
bl config set --key default_text_model --value qwen-turbo
177180
bl config set --key timeout --value 600
178181

README.zh.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
2727
- **文本对话** — Qwen3.7-max:Agentic coding、前端编程、Vibe coding 等能力显著增强
2828
- **全模态对话** — 文本 + 图像 + 音频 + 视频全模态支持
2929
- **图像生成与编辑** — Qwen-Image 2.0:专业文字渲染、真实质感、强语义遵循、多图合成
30-
- **视频生成与编辑**HappyHorse-1.0 系列,支持文生 / 图生 / 参考生(最多 9 张图参考)/ 自然语言视频编辑
30+
- **视频生成与编辑**happyhorse-1.1 系列,支持文生 / 图生 / 参考生(最多 9 张图参考)/ 自然语言视频编辑
3131
- **语音合成与识别** — CosyVoice 实时流式合成,5-20s 样本即可克隆;FunAudio-ASR 覆盖 30 种语种,含汉语七大方言与 20+ 口音官话
3232
- **图像与视频理解** — Qwen-VL:长视频解析、复杂图表与文档识别、视觉推理、多语种 OCR
33+
34+
> **注意:** 以下功能目前仅对中国站(aliyun.com)账号开放,国际站 / 全球站账号暂不支持。
35+
3336
- **知识库与记忆库** — 多模态 RAG 检索 + 跨会话记忆,提供个性化连贯对话体验
3437
- **应用调用** — 调用已发布在阿里云百炼平台上的智能体与工作流应用
3538
- **MCP 集成** — 统一调度百炼 MCP 服务:列出服务、查看工具、直接在终端调用任意工具
@@ -51,7 +54,7 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
5154
一部完整的 **2 分钟、16:9 电影感短片** —— 由一句自然语言端到端生成,**全程零手动剪辑**。这个示例展示了 AI Agent 如何把三个基础能力编排成一条多步创作流水线:
5255

5356
- **[Qwen Code](https://github.com/QwenLM/qwen-code)** —— Agentic coding 模型,解析用户意图、驱动整个工作流
54-
- **[阿里云百炼 CLI](https://github.com/modelstudioai/cli/)** —— 调用 **HappyHorse 1.0**,百炼的文生/图生/参考生视频模型
57+
- **[阿里云百炼 CLI](https://github.com/modelstudioai/cli/)** —— 调用 **HappyHorse 1.1**,百炼的文生/图生/参考生视频模型
5558
- **[spark-video Skill](https://github.com/JohnKeating1997/spark-video)** —— 负责场景拆分、分镜设计、镜头连贯性和最终拼接
5659

5760
### 唯一的提示词
@@ -62,7 +65,7 @@ _专为 AI Agent 打造,每个命令均可作为结构化工具调用。_
6265

6366
1. **Qwen Code** 解析需求、规划叙事节奏,决定要调用哪些工具。
6467
2. **spark-video Skill** 把故事拆成镜头、为每个镜头写提示词,并保证视觉连贯性(角色、光线、色调、镜头语言)。
65-
3. **`bl video generate`** 把每个镜头并行下发给 **HappyHorse 1.0**
68+
3. **`bl video generate`** 把每个镜头并行下发给 **HappyHorse 1.1**
6669
4. Skill 把所有片段拼成最终的 16:9 / 约 2 分钟成片。
6770

6871
没有时间线拖拽,没有逐帧剪辑。一句话 → 一部短片。
@@ -167,7 +170,7 @@ export BAILIAN_WORKSPACE_ID=ws-...
167170
bl config show
168171

169172
# 设置默认值
170-
bl config set --key region --value us
173+
bl config set --key base_url --value https://dashscope-us.aliyuncs.com
171174
bl config set --key default_text_model --value qwen-turbo
172175
bl config set --key timeout --value 600
173176

docs/agents/auth-change.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ flag 优先 ─→ config 文件 ─→ env var
7878

7979
### D. main 启动逻辑
8080

81-
- [ ] `packages/cli/src/main.ts:NO_AUTH_SETUP` 列表:
82-
- 如果新增的命令"自己管鉴权或不需要鉴权",加进去绕开 ensureApiKey 拦截
83-
- 当前清单以 `main.ts:NO_AUTH_SETUP` 为准
81+
- [ ] 若新增命令**自行处理鉴权****不应在入口触发默认 API key 引导**,在对应 `defineCommand` 上设 `skipDefaultApiKeySetup: true`(见 `packages/core/src/types/command.ts`;`packages/cli/src/main.ts``registry.resolve` 后读取 `command.skipDefaultApiKeySetup`)
8482

8583
### E. 错误文案
8684

docs/agents/branch-merge-review.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ git diff --name-only <base>...<head>
5050
- [ ] **`package.json` 没破坏发布元数据**:`bin` / `exports` / `files` / `inlinedDependencies` 字段任何删除或改名都要单独评估
5151
- [ ] **公共依赖没被悄悄升级**:catalog / 根 lockfile 改动要列出来
5252
- [ ] **`package.json` version 没倒退**:目标分支已经更高时(如 main 1.0.3 vs head 1.0.0-beta.1),手动对齐版本号,不要被 head 覆盖
53-
- [ ] **全局表没冲突**:`registry.ts``NO_AUTH_SETUP`(`packages/cli/src/main.ts`)、`ExitCode` 三个全局表新增项不和现有项冲突
53+
- [ ] **全局表没冲突**:`registry.ts``defineCommand``skipDefaultApiKeySetup`(见 `packages/core/src/types/command.ts`)、`ExitCode` 三处新增项不和现有项冲突
5454

5555
## 清单 B:用户透出(用户可见的新东西必看)
5656

@@ -80,7 +80,7 @@ git diff --name-only <base>...<head>
8080
解冲突要点(merge 时不要漏):
8181
- <冲突文件> + <字段/段落> + <怎么取舍>
8282
↑ 放"合并那一刻才会出现"的细节,例如 package.json 的 files/scripts/devDependencies 各取并集、
83-
NO_AUTH_SETUP 这种全局表两边都加项时不要丢一侧、pnpm-lock.yaml 直接 rm 后 pnpm install 重生等。
83+
`skipDefaultApiKeySetup` 这类命令元数据两边都加项时不要丢一侧、pnpm-lock.yaml 直接 rm 后 pnpm install 重生等。
8484
建议修(可后置):
8585
- ...
8686
仅信息(无需动作,告知即可):
@@ -94,11 +94,11 @@ git diff --name-only <base>...<head>
9494

9595
## 常见漏点(基于历史踩坑)
9696

97-
| 漏点 | 后果 |
98-
| ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
99-
| `pnpm-workspace.yaml``packages/*` 收窄成显式列表 | 合并后目标分支的新子包不再被 workspace 识别,`pnpm install` 看似正常但子包失联 |
100-
| 源分支 version 比目标分支低,直接 merge 覆盖 | npm 上版本号回退,latest tag 错乱 |
101-
| `registry.ts` 注册新命令但忘了 [README](README.md) / [README.zh](README.zh.md) | 用户完全感知不到新功能 |
102-
| 共享 util 重构(抽公共函数)只改了一处调用方 | 其它调用方静默走旧分支,行为分裂 |
103-
| `NO_AUTH_SETUP` 加了不该免登录的命令 | 安全风险,用户没登录也能调付费 API |
104-
| `NO_AUTH_SETUP` / `registry.ts` 这类全局表两边都加项,解冲突时被合掉一侧 | 某个命令突然要求登录 / 某个新命令注册丢失,编译能过、回归不易察觉 |
97+
| 漏点 | 后果 |
98+
| ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
99+
| `pnpm-workspace.yaml``packages/*` 收窄成显式列表 | 合并后目标分支的新子包不再被 workspace 识别,`pnpm install` 看似正常但子包失联 |
100+
| 源分支 version 比目标分支低,直接 merge 覆盖 | npm 上版本号回退,latest tag 错乱 |
101+
| `registry.ts` 注册新命令但忘了 [README](README.md) / [README.zh](README.zh.md) | 用户完全感知不到新功能 |
102+
| 共享 util 重构(抽公共函数)只改了一处调用方 | 其它调用方静默走旧分支,行为分裂 |
103+
| 不该跳过默认 API key 引导的命令误设 `skipDefaultApiKeySetup: true` | 安全风险,用户没配置 key 也能调付费 API |
104+
| `catalog.ts` / `skipDefaultApiKeySetup` 这类元数据两边都加项,解冲突时被合掉一侧 | 某个命令突然要求登录 / 某个新命令注册丢失,编译能过、回归不易察觉 |

docs/agents/command-add-remove.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ registry.ts main.ts tools/generate-reference.ts export-schema.ts
5353
- 增删 `import xxx from "./.../xxx.ts"`
5454
-`export const commands` 里增删 `"<group> <action>": xxx`(key 与 `defineCommand({ name })` 一致)
5555
- [ ] **不要**`registry.ts` 里重复登记命令(已从 catalog 读取)
56-
- [ ] 如果命令需要鉴权之外的特殊路径,看 `packages/cli/src/main.ts` `NO_AUTH_SETUP`
56+
- [ ] 如果命令需要跳过入口的默认 DashScope API key 引导(`ensureApiKey`),在对应 `defineCommand` 上设 `skipDefaultApiKeySetup: true`(字段定义见 `packages/core/src/types/command.ts`;`main.ts` 根据已解析的 `command` 读取)
5757
- [ ] **`config/export-schema.ts`**: 若新命令不适合作为 agent tool,评估是否加入 `SKIP_PREFIXES`;该文件在 `run()``import("../catalog.ts")`,勿顶层 import catalog 以免循环依赖
5858

5959
### B. 文档层

0 commit comments

Comments
 (0)