558 Commits

Author SHA1 Message Date
zeyu.fz 822c4e6bfe fix(cli): 更新知识检索参数兼容性提示 2026-06-10 14:32:40 +08:00
zeyu.fz f90ed8a0cc feat(cli): 优化知识检索命令的rerank参数支持和请求构造 2026-06-10 14:19:17 +08:00
zeyu.fz 3395858c96 fix(cli): 修复检索命令中的 rerank 参数字段名 2026-06-10 13:59:55 +08:00
zeyu.fz b5abcaefd9 docs(cli): 更新 API Key 和相关链接地址 2026-06-09 15:56:29 +08:00
zeyu.fz d93b951d92 docs(cli): 更新 API Key 和相关链接地址 2026-06-09 15:53:53 +08:00
zeyu.fz d5407ae39b Merge remote-tracking branch 'origin/main' into feat/knowledge-api-key 2026-06-09 15:29:50 +08:00
zeyu.fz 20704ff1c6 fix(cli): 优化鉴权逻辑以支持显式API-Key和AK/SK优先级
- 优先使用显式提供的API-Key进行鉴权
- 在无显式API-Key时优先采用显式AK/SK鉴权
- 保持对无显式鉴权信息情况下的自动鉴权兼容
- 重构鉴权判断逻辑以提高代码清晰度和可维护性
2026-06-09 15:25:15 +08:00
若麒 04e7f30dc9 chore(release): bump version to 1.2.1 2026-06-09 00:35:26 +08:00
zeyu.fz 6317da8454 feat(cli): 重构知识库检索命令,支持API-KEY和AK/SK鉴权
- 增加API-KEY鉴权路径,采用DashScope协议(snake_case)请求后端接口
- 保留AK/SK鉴权路径,但打印废弃警告,采用PascalCase请求后端
- 命令参数调整,新增dense-similarity-top-k、sparse-similarity-top-k等API-KEY专用选项
- 废弃部分旧参数如顶层top-k,提醒用户改用rerank-top-n
- 统一输出格式以及静默模式下文本结果的打印逻辑优化
- 添加相关类型定义,完善请求与响应结构的类型支持
- CLI端增加dry-run模式,展示实际请求参数与地址
- E2E测试覆盖API-KEY和AK/SK两条路径,包含帮助提示、错误场景及关键参数测试
- 更新依赖的核心包导出与接口,新增knowledgeRetrieveEndpoint方法接口调用
2026-06-08 18:43:50 +08:00
若麒 ab0cf8c78e docs: rename README_CN.md to README.zh.md and add bailian-cli skill READMEs 2026-06-08 18:38:15 +08:00
qcq01083097 00934973e9 feat: The version synchronization and skills generation are executed in the pre-commit hook 2026-06-08 17:41:33 +08:00
qcq01083097 d75ddb407a feat: Version synchronization & automatic build generation skills 2026-06-08 17:12:25 +08:00
qcq01083097 252f85c717 feat: Fix the generation format of skills 2026-06-08 16:32:07 +08:00
qcq01083097 db5a96158d feat: Migrate official skills back to this repository 2026-06-08 15:29:51 +08:00
若麒 5a0015dc4f fix: sync README and README_CN to packages/cli 2026-06-05 17:22:26 +08:00
Gong Shiqi d08fa2bde5 Merge pull request #29 from modelstudioai/fix/e2e-test
fix(e2e): add DO_NOT_TRACK environment variable to CLI tests
2026-06-05 17:12:07 +08:00
Gong Shiqi d17fdd7e6f Merge pull request #30 from modelstudioai/feat/model-recommend
add model recommend cli commend
2026-06-05 17:09:08 +08:00
若麒 c1969254fa chore(release): bump version to 1.2.0
- Add `bl mcp` command group, security hardening, watermark/flag fixes
- Update CHANGELOG/CHANGELOG_CN with 1.2.0 entry
- Add MCP integration to README features

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-05 17:05:04 +08:00
clh02467605 6423dbfc96 fix(e2e): add DO_NOT_TRACK environment variable to CLI tests 2026-06-05 16:19:15 +08:00
故璃 e22dff3b3b feat: add model preferrence 2026-06-05 16:05:50 +08:00
Gong Shiqi 73acb39c2b Merge pull request #27 from modelstudioai/feat/mcp-command
Feat/mcp command
2026-06-05 16:01:53 +08:00
若麒 4ae68ef61e fix(mcp): let mcp commands handle auth after arg validation and dry-run check 2026-06-05 15:52:47 +08:00
Gong Shiqi 3708ec29fb Merge pull request #13 from modelstudioai/feat/watermark-and-paired-flags
fix: Fix the issue of the watermark being always on and address the i…
2026-06-05 15:25:36 +08:00
故璃 7914a6d203 Merge branch 'main' into feat/model-recommend 2026-06-05 14:01:09 +08:00
故璃 a767bee41e feat: model recommend beta version 2026-06-05 13:56:24 +08:00
qcq01083097 99ef96d209 feat: Fix the null value verification of the flag 2026-06-05 11:14:17 +08:00
若麒 cdbe5c080d docs: sync packages/cli/README.md with root 2026-06-05 10:41:50 +08:00
若麒 7b440177ee docs: sync packages/cli/README.md with root 2026-06-05 00:03:31 +08:00
若麒 6683ff172c Merge branch 'main' into feat/mcp-command 2026-06-05 00:00:45 +08:00
qcq01083097 ce59e2bd08 feat: Deal with text redundancy of flag default values 2026-06-04 17:49:03 +08:00
qcq01083097 fa3d3a6905 feat: Unify the text format of flag default values 2026-06-04 17:40:22 +08:00
qcq01083097 ea37be0e30 feat: Add illegal flag verification 2026-06-04 17:36:47 +08:00
qcq01083097 f3c35c411b feat: Dealing with redundancy and semanticization of file names 2026-06-04 17:30:30 +08:00
qcq01083097 6436ca88eb fix: Fix the issue of the watermark being always on and address the issue of paired flags 2026-06-04 17:07:11 +08:00
若麒 73d9d7ef07 feat(cli): add bl mcp command group (list/tools/call)
- `bl mcp list` — list MCP servers enabled under the current Bailian
  account via console gateway PageList (always activated=1).
- `bl mcp tools <server-code>` — list tools exposed by a server.
- `bl mcp call <server-code>.<tool>` — invoke a tool. Accepts `--json`,
  repeatable `--arg k=v` (JSON-parsed when possible) and `--query` sugar;
  `--url` overrides the endpoint for non-Bailian MCPs.
- core: export `bailianMcpUrl(baseUrl, code)` building
  `/api/v1/mcps/<code>/mcp`; `McpClient` now takes a full URL.
- `bl search web` switches to `mcpWebSearchEndpoint` directly.
- e2e: `mcp.e2e.test.ts` covering help, dry-run, arg-merge semantics,
  invalid-input paths, and one live `tools/list` against WebSearch.
2026-06-03 19:00:51 +08:00
mamba 14371a0647 Merge pull request #5 from lhfer/claude/busy-noether-Rjbaz
security: harden credential handling, pipeline JS execution, and the HTTP/stream layer
2026-06-03 15:06:26 +08:00
若麒 1499a5de2d chore(docs): fix ts problems 2026-06-02 18:05:03 +08:00
若麒 375e560804 chore(release): 1.1.3
- bump bailian-cli and bailian-cli-core to 1.1.3
- changelog: add 1.1.3 entry (console login auto-configures API key, validation retry)
- changelog: backfill missing 1.1.2 entry (default vision model → qwen3-vl-plus)
2026-06-02 18:02:39 +08:00
clh02467605 a490969d58 feat(auth): add retry logic and error handling for API key validation 2026-06-02 16:29:43 +08:00
lishengzxc 64f7e71783 feat(auth): 支持在控制台登录时自动处理 API 密钥 2026-06-02 10:53:31 +08:00
lishengzxc 993972cc93 Merge branch 'main' of github.com:lishengzxc/cli into feat/auto-set-apikey 2026-06-02 10:06:46 +08:00
lishengzxc c04deceb27 feat(auth): split console login into separate file and auto-request apikey
Extract console login logic to login-console.ts for better separation
of concerns. When no api_key is configured, append needapikey=true to
the console login URL so the frontend returns an apiKey in the callback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 16:59:02 +08:00
若麒 0543d27463 docs: add UTM tracking params to bailian console links in READMEs 2026-06-01 15:04:49 +08:00
Claude ba074f566d fix(security): validate base_url / console_gateway_url as real http(s) URLs
The config file accepted any value that merely starts with "http" (so even
"httpfoo://evil" passed) for base_url and console_gateway_url — origins the
client sends the Bearer token to. Validate them with `new URL()` and an
http:/https: protocol check instead, rejecting malformed values. Valid http(s)
URLs (including custom proxies and local http) are unaffected.

https://claude.ai/code/session_017ZGQCjwNQF5Pz96gLUnnG1
2026-05-29 12:44:50 +00:00
Claude bb9f941849 fix(security): require script/js code to be a literal (block untrusted-code RCE)
script/js executes its `code` as host JavaScript (via new Function), and a step's
`code` is a *resolved* input — so it could be written as `{ $from: <chat-step> }`,
turning model/API output into the body of the executed function (untrusted data
-> arbitrary host code execution). Pipeline validation now requires script/js
`code` to be a literal string: any $from/expression-sourced code is rejected.

Authoring a literal script/js step remains supported (the pipeline file is the
trust boundary, like a shell/npm script). Combined with "dry-run never executes
$js", this closes the path where untrusted text reaches the JS sink.

Adds regression tests: $from-sourced code rejected, literal code accepted,
dry-run does not execute $js, getByJsonPointer blocks prototype/inherited keys,
and concurrency clamps to the maximum.

https://claude.ai/code/session_017ZGQCjwNQF5Pz96gLUnnG1
2026-05-29 12:44:48 +00:00
Claude 8b9986bb47 fix(security): harden pipeline planning, pointer traversal, and concurrency
- expressions: never execute $js during planning/dry-run. `pipeline run --dry-run`
  is the command a cautious user runs to preview an unfamiliar pipeline; it must
  not run embedded JavaScript. Planning now returns the expression placeholder
  instead of calling new Function.
- schema (getByJsonPointer): block __proto__/constructor/prototype and require
  own properties, so a crafted $from/$input path cannot pull object internals
  (e.g. constructor) out of step output and feed them downstream.
- scheduler: clamp --concurrency to a maximum (64) to bound fan-out so a single
  run cannot launch an unbounded number of concurrent API calls / downloads.

Note: the runtime new Function sinks in script/js and $js (arbitrary host code
execution) are intentionally left unchanged here — remediating them is a design
decision (sandbox vs. literal-only code) for the maintainers; see PR notes.

https://claude.ai/code/session_017ZGQCjwNQF5Pz96gLUnnG1
2026-05-29 12:34:24 +00:00
Claude d24f203d68 fix(security): encode URL path segments and bound SSE buffering
- endpoints: encodeURIComponent the id segments (task_id, app_id, node_id,
  schema_id) interpolated into request URLs. task_id in particular comes from
  the server's async-submit response and is fetched back with the bearer token
  attached, so an unencoded value could steer the authenticated follow-up
  request to a different path on the host.
- stream (SSE parser): cap the in-memory buffer (16 MiB). A stream that never
  emits a newline, or that builds one enormous event from many data: lines,
  could otherwise grow the buffer without bound and exhaust process memory.

https://claude.ai/code/session_017ZGQCjwNQF5Pz96gLUnnG1
2026-05-29 12:34:22 +00:00
Claude 3e4f1f0ebf fix(security): stop leaking credentials and tighten on-disk permissions
- config set: mask api_key/access_token/access_key_id/access_key_secret in the
  confirmation echo. It previously printed the stored secret verbatim to stdout
  (CI logs, pipes, screen shares), unlike `config show` / `auth status` which
  already maskToken().
- http / knowledge retrieve: use maskToken() in --verbose request logs instead
  of printing the first 8 chars of the bearer token / AccessKey id.
- telemetry: write telemetry.jsonl with mode 0600 (was created world-readable
  by default), matching the other credential-area writers.
- ensureConfigDir: chmod 0700 after mkdir, so a pre-existing ~/.bailian created
  by an older build/another tool (where mkdir's mode is ignored) holding
  cleartext credentials gets locked down too. Best-effort; never fatal.

https://claude.ai/code/session_017ZGQCjwNQF5Pz96gLUnnG1
2026-05-29 12:34:19 +00:00
若麒 58f2cce555 chore(release): 1.1.2 2026-05-29 18:03:44 +08:00
clh02467605 208b1ce459 feat(cli): update the default vision model to qwen3-vl-plus 2026-05-29 17:50:07 +08:00