Skip to content

Commit 0bc58d1

Browse files
committed
Merge branch 'main' into fix/issue-fix
2 parents 6d6606a + f999201 commit 0bc58d1

464 files changed

Lines changed: 37005 additions & 8133 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.

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@ packages/cli/scene/**/outputs/
5353

5454
# Local scratch / plan drafts (never commit)
5555
.scratch/
56+
57+
# Internal planning and QA handoff documents stay outside the public repository
58+
/docs/superpowers/
59+
/docs/testing/

‎.vite-hooks/pre-commit‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ git add \
1919
skills/bailian-sandbox/reference \
2020
skills/bailian-memory/SKILL.md \
2121
skills/bailian-memory/reference \
22+
skills/bailian-knowledge/SKILL.md \
23+
skills/bailian-knowledge/reference \
2224
skills/bailian-web-search/SKILL.md
2325

2426
vp staged

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Skill / 命令手册随 `skills/bailian-*/` 经 `bl skill init` 安装(装齐
7676
| 安装文档 | 改安装、鉴权、验证流程或线上 install 页面 | [docs/agents/install-doc-change.md](docs/agents/install-doc-change.md) |
7777
| 发布 | channel / stable 发布到 npm(CI 驱动) | [docs/agents/publish.md](docs/agents/publish.md) |
7878
| Change Log | 发版说明 / 历史版本说明 | [docs/agents/changelog-write.md](docs/agents/changelog-write.md) |
79+
| 公开内容检查 | 公开前检查凭证、真实资源、内部文档及 Git 历史 | [docs/agents/public-content-review.md](docs/agents/public-content-review.md) |
7980
| 工具链调整 | lint 规则 / 构建配置 / 依赖升级 | [docs/agents/lint-toolchain.md](docs/agents/lint-toolchain.md) |
8081
| Command Pack | 扩展包 / 白名单 / plugin 管理命令 | [docs/agents/command-pack.md](docs/agents/command-pack.md) |
8182
| dsh 插件 | 改 `packages/bailian-kb-dsh` / `bailian-memo-dsh`、dsh 依赖、插件发布 | [docs/agents/dsh-plugin.md](docs/agents/dsh-plugin.md) |

‎CHANGELOG.md‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,86 @@ 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+
## [2.7.0] - 2026-10-29
10+
11+
### Added
12+
13+
- **ParseX parsing**: Add `bl parsex parse submit/result` for document and audio/video parsing, result queries, and Markdown output.
14+
- **ParseX field extraction**: Add `bl parsex extract submit/result` to extract fields with a JSON Schema from documents or existing parsing results, including source citations.
15+
- **Configuration source diagnostics**: Show API key and Base URL sources in `bl config show`, and warn when requests use values from different configuration sources.
16+
17+
### Fixed
18+
19+
- **Workspace API key login**: Fix `bl auth login` rejecting valid workspace API keys on MaaS endpoints.
20+
- **Login validation errors**: Preserve service and network errors during API key validation instead of reporting every failure as an invalid key.
21+
22+
## [2.6.2] - 2026-10-28
23+
24+
### Changed
25+
26+
- **Default telemetry output (BREAKING)**: Business results from `bl alert`, `bl monitor`, and `bl log` now default to JSON, even when the Profile specifies text. Scripts relying on text must pass `--output text` or set `DASHSCOPE_OUTPUT=text`.
27+
28+
### Fixed
29+
30+
- **Workspace identity**: Resolve the selected workspace's Console identity automatically and share it across preflight, business requests, asynchronous polling, and follow-up requests, fixing ineffective `--workspace-id` filtering and incorrect cross-workspace results without changing saved configuration.
31+
- **Audit log parsing**: Normalize timestamps, models, request IDs, workspace IDs, and usage; fix missing fields, NaN timestamps, and malformed count displays, and reject audit results from a mismatched workspace.
32+
- **Log counts**: Use each corresponding list API's `totalCount` for `log audit count` and `log inference count`, fixing zero counts for non-empty lists without paginating or fetching full log content.
33+
- **Inference count filters and completion**: Preserve multiple-model and multiple-API-key filters by deduplicating and querying single-value combinations. Support asynchronous polling and emit totals only after every query succeeds; reject empty filters, invalid counts, and aggregate overflow.
34+
- **Dry-run previews**: Show the workspace identity resolution plan and actual count request combinations without sending business requests.
35+
36+
## [2.6.1] - 2026-10-28
37+
38+
### Added
39+
40+
- **Asynchronous Batch inference**: Add `bl batch convert/create/list/get/cancel/download` for CSV-to-JSONL conversion, Chat/Embedding task creation, progress tracking, cancellation, and result/error downloads with optional CSV export.
41+
- **Synchronous Batch Chat**: Add `bl text chat --batch` for one non-streaming request, separate from asynchronous file-based Batch tasks, with request timeouts of 60–3600 seconds.
42+
- **Model recommendation options**: Add `--top`, `--model`, `--no-agent`, `--trace`, `--think`, and `--no-thinking` to `bl advisor recommend`.
43+
44+
### Changed
45+
46+
- **Model recommendations**: Upgrade intent analysis, routing, recall, scoring, and ranking; support Agent clarification in interactive terminals and multi-step recommendations while preserving the existing recommendation JSON envelope.
47+
48+
### Removed
49+
50+
- **Advisor library interfaces (BREAKING)**: Remove legacy recommendation exports, including `getModels`, `recallCandidates`, `recallSemantic`, and `rankModels`. Library consumers must adapt to the new recommendation engine; legacy types are exported as `LegacyIntentProfile`, `LegacyModelProfile`, and `LegacyRecommendResult`.
51+
52+
### Fixed
53+
54+
- **Temporary file uploads**: Select the upload service from the active model endpoint, fixing Singapore and Prime video uploads incorrectly using Beijing. Official temporary uploads support only Beijing and Singapore; unsupported regions and Token Plan fail explicitly, while explicit custom upload proxies are no longer rejected based on key type.
55+
- **Node 26 compatibility**: Fix fetch/dispatcher incompatibility and proxy initialization across model requests, console requests, uploads, and downloads.
56+
- **API error passthrough**: Recognize nested business errors and preserve non-JSON error bodies and request IDs instead of treating error responses as successful results.
57+
58+
## [2.6.0] - 2026-10-27
59+
60+
### Added
61+
62+
- **Knowledge initialization**: Add `knowledge init` to upload a sample, create a knowledge base and retrieval service, and verify retrieval, with recovery and resource reuse.
63+
- **Directory sync and file import**: Add `knowledge doc sync` and `knowledge doc import` for local directories and existing files.
64+
- **Multimedia knowledge bases**: Support audio/video knowledge bases, parser configuration, streaming uploads, image-only search, and online search filters.
65+
- **Agent capability discovery**: Add `--introspect` and the `bailian-knowledge` skill, with corresponding capabilities in Knowledge Studio CLI.
66+
67+
### Changed
68+
69+
- **Chat output**: Separate answers, phases, tools, sources, and usage in structured output; quiet mode emits only the final answer.
70+
- **Knowledge-base creation**: Add billing notices, resource records, and cleanup guidance.
71+
72+
### Fixed
73+
74+
- Reject blank required inputs in knowledge commands.
75+
- Report completed, unconfirmed, and unexecuted batches when chunk deletion fails.
76+
77+
## [2.5.1] - 2026-10-23
78+
79+
### Added
80+
81+
- **Console login**: Support `--no-browser` for manually opening the login URL and `--token-stdin` for importing and validating console credentials from standard input.
82+
- **Agent attribution**: Support declaring the calling Agent, Skill name and version; undeclared callers remain unknown.
83+
84+
### Fixed
85+
86+
- **Login completion**: Handle fast browser callbacks reliably and report a timeout when no credentials are received.
87+
- **Credential refresh**: Correct region selection and validate the retried request before saving refreshed credentials.
88+
989
## [2.5.0] - 2026-10-20
1090

1191
### Added

‎CHANGELOG.zh.md‎

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

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

9+
## [2.7.0] - 2026-10-29
10+
11+
### 新增
12+
13+
- **ParseX 解析**:新增 `bl parsex parse submit/result`,支持文档及音视频解析、结果查询和 Markdown 输出。
14+
- **ParseX 字段抽取**:新增 `bl parsex extract submit/result`,支持按 JSON Schema 从文档或已有解析结果中抽取字段,并返回原文引用。
15+
- **配置来源诊断**:`bl config show` 展示 API Key 与 Base URL 的生效来源,请求使用的两者来自不同配置源时给出提示。
16+
17+
### 修复
18+
19+
- **工作空间 API Key 登录**:修复 `bl auth login` 在 MaaS Endpoint 上拒绝有效工作空间 API Key 的问题。
20+
- **登录校验错误**:API Key 校验保留服务端及网络错误,避免将所有失败统一报告为 Key 无效。
21+
22+
## [2.6.2] - 2026-10-28
23+
24+
### 变更
25+
26+
- **遥测默认输出(BREAKING)**:`bl alert`、`bl monitor` 和 `bl log` 的业务结果统一默认 JSON,即使 Profile 配置为 text。依赖文本输出的脚本需显式传入 `--output text` 或设置 `DASHSCOPE_OUTPUT=text`。
27+
28+
### 修复
29+
30+
- **工作空间身份**:遥测命令根据选定空间自动解析 Console 身份,预检、业务请求、异步轮询及后续请求使用同一身份,修复 `--workspace-id` 过滤失效及跨空间结果异常;不修改已保存配置。
31+
- **审计日志解析**:规范化时间、模型、请求 ID、工作空间及用量字段,修复缺失字段、NaN 时间及异常计数展示;拒绝空间不匹配的审计结果。
32+
- **日志计数**:`log audit count` 和 `log inference count` 分别采用对应列表接口的 `totalCount`,修复列表非空而计数为 0 的问题,不遍历分页或获取完整日志内容。
33+
- **推理计数过滤与完成判定**:保留多模型、多 API Key 过滤,去重后按单值组合查询并汇总;支持异步轮询,仅全部成功后输出,空过滤、无效计数及累计溢出明确报错。
34+
- **Dry-run 预览**:展示工作空间身份解析计划和实际计数请求组合,不发送业务请求。
35+
36+
## [2.6.1] - 2026-10-28
37+
38+
### 新增
39+
40+
- **异步批量推理**:新增 `bl batch convert/create/list/get/cancel/download`,支持 CSV 转 JSONL、创建 Chat/Embedding 批量任务、跟踪进度、取消任务及下载结果和错误文件,可选导出 CSV。
41+
- **同步 Batch Chat**:`bl text chat --batch` 支持单次非流式请求,与异步文件批量任务分开使用;支持 60–3600 秒请求超时。
42+
- **模型推荐参数**:`bl advisor recommend` 新增 `--top`、`--model`、`--no-agent`、`--trace`、`--think` 和 `--no-thinking`。
43+
44+
### 变更
45+
46+
- **模型推荐**:升级意图分析、路由、候选召回、评分及排序流程;交互终端支持 Agent 澄清与多步骤推荐,推荐结果保留原有 JSON 主结构。
47+
48+
### 已移除
49+
50+
- **Advisor 库接口(BREAKING)**:移除旧推荐流程导出,包括 `getModels`、`recallCandidates`、`recallSemantic` 和 `rankModels`。库调用方需适配新的推荐引擎接口;旧类型通过 `LegacyIntentProfile`、`LegacyModelProfile` 和 `LegacyRecommendResult` 导出。
51+
52+
### 修复
53+
54+
- **临时文件上传**:根据当前模型 Endpoint 选择上传服务,修复新加坡地域及 Prime 视频上传误用北京地址的问题;官方临时上传仅支持北京和新加坡,不支持的地域及 Token Plan 明确报错,显式自定义上传代理不再因 Key 类型被提前拒绝。
55+
- **Node 26 兼容**:修复 fetch 与 dispatcher 不兼容及代理初始化问题,覆盖模型请求、控制台请求、文件上传和下载。
56+
- **API 错误透传**:正确识别嵌套业务错误,保留非 JSON 错误正文及请求 ID,避免将错误响应作为成功结果。
57+
58+
## [2.6.0] - 2026-10-27
59+
60+
### 新增
61+
62+
- **知识库初始化**:新增 `knowledge init`,串联样例上传、建库、检索服务创建及首次检索验证,支持恢复和资源复用。
63+
- **目录同步与文件导入**:新增 `knowledge doc sync` 和 `knowledge doc import`,支持同步本地目录及导入已有文件。
64+
- **多媒体知识库**:支持音视频知识库、解析配置、流式上传、纯图片检索及在线检索过滤配置。
65+
- **Agent 能力发现**:新增 `--introspect` 结构化命令说明和 `bailian-knowledge` Skill;Knowledge Studio CLI 同步提供对应能力。
66+
67+
### 变更
68+
69+
- **知识库问答输出**:结构化输出区分最终答案、阶段、工具、来源和用量;quiet 模式仅输出最终答案。
70+
- **建库提示**:补充计费说明、资源记录与清理指引。
71+
72+
### 修复
73+
74+
- 拒绝知识库命令中的空白必填参数。
75+
- 切片批量删除失败时,明确报告已完成批次、结果未确认批次及未执行部分。
76+
77+
## [2.5.1] - 2026-10-23
78+
79+
### 新增
80+
81+
- **控制台登录**:支持 `--no-browser` 手动打开登录地址,以及 `--token-stdin` 从标准输入导入并校验控制台凭证。
82+
- **Agent 调用标识**:支持声明 Agent 来源、Skill 名称和版本;未声明来源记为未知。
83+
84+
### 修复
85+
86+
- **登录完成判定**:修复浏览器快速回调时的登录状态处理,未收到凭证时明确报告超时。
87+
- **凭证刷新**:修复控制台凭证刷新的地域选择,刷新后验证请求成功再保存凭证。
88+
989
## [2.5.0] - 2026-10-20
1090

1191
### 新增

‎README.md‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ _Built for AI Agents. Every command works as a structured tool call._
2828
- **App orchestration** — Call Managed Agents, agents, and workflows published on Aliyun Model Studio, wired to knowledge bases, memory, web search, and MCP tools
2929
- **Native MCP setup** — Register Bailian MCP servers in Codex, Claude Code, Cursor, Qoder, Qoder Work, QwenWork (千问办公), Qwen Code, Gemini CLI, or Pi
3030
- **Training & deployment** — Validate and upload datasets, fine-tune models, deploy dedicated models as endpoints
31+
- **Batch inference** — Prepare CSV/JSONL, create and follow asynchronous Chat/Embedding tasks, download original results/errors with optional CSV, or send one synchronous Batch Chat request
3132
- **Account operations** — Login, UI-based configuration, model marketplace, usage and quota, rate-limit increases, team seat management
3233
- **Plan onboarding** — Connect subscription plans such as Token Plan to the CLI and common coding agents in one step
3334

@@ -126,6 +127,53 @@ Once installed, just describe your task to your AI Agent — no need to assemble
126127

127128
> More examples and scenarios: [Aliyun Model Studio CLI Site](https://bailian.console.aliyun.com/cli?spm=a2ty07.github)
128129
130+
### Try a knowledge base
131+
132+
With a valid API key and workspace, preview initialization first:
133+
134+
```bash
135+
bl knowledge init --workspace-id <workspace-id> --dry-run
136+
```
137+
138+
Knowledge bases accrue running-time charges from creation, even without queries. The one-time Standard Edition 720-hour allowance is shared across knowledge bases and expires 30 days after activation for new users. Model calls cost extra; your remaining allowance is unknown. Review the plan and [billing rules](https://help.aliyun.com/zh/model-studio/billing-for-knowledge-base), then add `--yes` to the same command **after confirming the operation**, removing `--dry-run` to execute.
139+
140+
Keep the returned IDs and recovery record. Closing the CLI or a later failure does not stop billing; follow the reported cleanup actions to delete unused knowledge bases. See the [Knowledge Studio quick start](packages/kscli/README.md#quick-start) for retrieval and cleanup. The `bailian-knowledge` Skill is available through `bl skill init`.
141+
142+
### RAG audio and video
143+
144+
`bl knowledge doc import --index-id <id> --doc-id <fileId>` imports an existing file into a knowledge base; `doc list --details` shows per-file processing settings. Media support includes parser options, streaming uploads, and media references in search/chunk output. Chat JSON separates the final answer from phases, tools, docs, usage, and raw events; quiet mode emits only the final answer. See the [command guide](docs/knowledge/knowledge-cli-guide.md).
145+
146+
## ParseX
147+
148+
Parse documents or audio/video and extract structured fields through the workspace-scoped ParseX API:
149+
150+
```bash
151+
bl parsex parse submit --workspace-id <workspace-id> --file-url "https://example.com/document.pdf" --file-name document.pdf --output-file-format markdown --output json
152+
bl parsex parse result --workspace-id <workspace-id> --biz-id <parse-biz-id> --follow --output json
153+
bl parsex extract submit --workspace-id <workspace-id> --parsed-file-biz-id <parse-biz-id> --schema-file schema.json --output json
154+
bl parsex extract result --workspace-id <workspace-id> --biz-id <extract-biz-id> --follow --output json
155+
```
156+
157+
Use an ordinary API key and a workspace with ParseX access. Submission returns `data.biz_id` immediately; `result --follow` waits for completion. `schema.json` contains a JSON Schema object, for example `{"type":"object","properties":{"title":{"type":"string"}}}`. Inputs are accessible HTTP(S) URLs; extraction also accepts a retained document parsing task. See the [ParseX command guide](docs/parsex.md) for processing options, result slices, OSS credentials, dry-run and polling behavior.
158+
159+
## Batch Inference
160+
161+
```bash
162+
bl batch convert --help
163+
bl batch convert --file input.csv --output-file input.jsonl --model qwen-plus
164+
bl batch create --file input.jsonl --dry-run
165+
bl batch create --file input.jsonl
166+
bl batch get --batch-id <id> --follow
167+
bl batch download --batch-id <id> --csv
168+
bl text chat --batch --model qwen-plus --message "Hello" --timeout 3600
169+
```
170+
171+
`--help` includes CSV, JSONL and result data examples. `convert` is local and needs no key; inference/task commands use a model API key. File inference uses asynchronous tasks via `create → get → download`: `create` uploads/submits and returns a task ID without waiting for completion. Query with `get` and download results after completion. Conversion/download files are atomically published per file and never silently overwritten. Use `--force` to recover partial downloads. JSONL is the authoritative result, while CSV is a lossy display; import IDs as text to preserve leading zeros. Ctrl-C stops local polling, not the remote task.
172+
173+
`text chat --batch` sends one synchronous request and waits for its response; it does not create an asynchronous task ID. Use `--message` or `--messages-file`, which contains one request's conversation context, not independent file requests. The total request timeout defaults to 300 seconds (`--timeout`: 60–3600 seconds). Timeout/Ctrl-C/disconnection do not guarantee server cancellation.
174+
175+
Synchronous Batch Chat is non-streaming; explicit realtime/international/Token Plan endpoints are rejected. An explicit realtime profile requires `--base-url https://batch.dashscope.aliyuncs.com`. Batch availability and limits depend on the service/model. Dry-run avoids business requests and output/directory writes; framework update checks/telemetry follow their settings.
176+
129177
## Authentication
130178

131179
### Console Login (OAuth, Recommended)

0 commit comments

Comments
 (0)