Commit Graph

459 Commits

Author SHA1 Message Date
若麒 9cd4adb26c refactor(release): merge stable + channel into single release.yml
npm Trusted Publishers only supports ONE (repo, workflow, environment)
tuple per package, so the two split workflows cannot both be granted
OIDC publish rights. Consolidate into release.yml with a mode input:

- mode=stable  -> publish-stable job, environment=production (reviewer
  gate), contents:write (push lightweight tag).
- mode=channel -> publish-channel job, no environment, contents:read.

Concurrency group keys on mode + channel so stable serializes globally
and channels serialize per dist-tag. Trusted Publisher entry should
now point at release.yml with environment left blank (matches both
the production-gated stable job and the env-less channel job).
2026-06-04 23:53:18 +08:00
Gong Shiqi f1c78f01b7 Merge pull request #21 from modelstudioai/feat/release-pipeline
chore: drop dependabot version-updates config
2026-06-04 23:34:09 +08:00
若麒 7a8c55dd4a chore: drop dependabot version-updates config 2026-06-04 23:29:03 +08:00
若麒 d6cbe981a8 fix(ci): build core/cli before pnpm run check 2026-06-04 23:16:15 +08:00
若麒 3693f7dacb feat(release): CI-driven publish pipeline via GitHub Actions + npm OIDC
Replace tools/release.mjs with two workflow_dispatch flows:

- stable: production environment gate (Required Reviewers) + lightweight git tag. Trusted Publishing (OIDC) removes the need for an npm token.
- channel beta: disposable 0.0.0-beta-<sha>-<date> versions on the corresponding dist-tag, no tag, no commit. Any collaborator can dispatch without npm credentials.

Pack-time scans via publint, attw, gitleaks; weekly Dependabot for npm + actions.
2026-06-04 23:02:38 +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
qcq01083097 0781aa7db2 feat: add schedule 2026-06-04 15:46:28 +08:00
qcq01083097 3461e53404 feat: 增加自动同步skills的workflow 2026-06-04 15:22:58 +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
若麒 3a8121328c docs(install): promote bl auth login --console as recommended auth method 2026-06-02 21:57:59 +08:00
inhai 7e85bdd36c Update README.md 2026-06-02 19:41:05 +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
Gong Shiqi d3e6743735 Merge pull request #9 from modelstudioai/feat/auto-set-apikey
Refactor console login and implement auto-request for API key
2026-06-02 17:26:53 +08:00
clh02467605 a490969d58 feat(auth): add retry logic and error handling for API key validation 2026-06-02 16:29:43 +08:00
ls 842bec922d Merge pull request #8 from lishengzxc/feat/auto-set-apikey
feat(auth): 支持在控制台登录时自动处理 API 密钥
2026-06-02 11:04:38 +08:00
lishengzxc 64f7e71783 feat(auth): 支持在控制台登录时自动处理 API 密钥 2026-06-02 10:53:31 +08:00
ls 8af4257412 Merge pull request #7 from lishengzxc/feat/auto-set-apikey
Refactor console login and auto-request API key
2026-06-02 10:40:00 +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
inhai 765fa23c5b Update README.md 2026-06-01 18:09:24 +08:00
inhai 4485e67ff4 Update README.md 2026-06-01 18:08:58 +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
Gong Shiqi dc04f0430c Merge pull request #4 from modelstudioai/feat/switch-model
feat(cli): update the default vision model to qwen3-vl-plus
2026-05-29 17:58:51 +08:00
clh02467605 208b1ce459 feat(cli): update the default vision model to qwen3-vl-plus 2026-05-29 17:50:07 +08:00
clh02467605 03d1c48d41 feat(cli): update the default vision model to qwen3-vl-plus 2026-05-29 17:20:33 +08:00
clh02467605 ee8aed0edf feat(cli): update the default vision model to qwen3-vl-plus 2026-05-29 16:57:45 +08:00
Gong Shiqi 55f9fa21cf Merge pull request #2 from modelstudioai/fix/ts-lint
refactor(stress): simplify target definitions and enhance trace ID ha…
2026-05-29 15:03:26 +08:00
若麒 b0baa63a89 chore: stop tracking .codegraph and .vscode editor configs 2026-05-29 14:56:58 +08:00
clh02467605 27494cfd1b refactor(stress): simplify target definitions and enhance trace ID handling 2026-05-29 14:49:36 +08:00
若麒 88576a6c1c fix(release): build before check; reformat docs
Follow-up to 1.1.1.

- release.mjs: build packages before type checks so bailian-cli-core resolves on clean checkouts
- CHANGELOG: record the above under Fixed
- Reformat CONTRIBUTING / INSTALL / README / docs tables (prettier only, no content changes)
2026-05-29 13:52:06 +08:00
若麒 b896c3fbec chore(release): 1.1.1
Documentation-only patch release.

- Add INSTALL.md for AI-Agent-driven installation
- Sync root and packages/cli READMEs (EN + CN)
- Drop unpkg links in favor of canonical sources
- release.mjs: assert README sync before publishing
2026-05-29 13:41:36 +08:00
TreeLin aab9efaf20 Update README.md 2026-05-29 09:42:57 +08:00
TreeLin c65043a4f4 Update README.md 2026-05-29 09:40:55 +08:00
若麒 830e64117e docs: drop unpkg links, cross-link top-level docs, align CN README 2026-05-28 23:49:47 +08:00
若麒 81f954271f docs: add INSTALL.md for AI Agent-driven installation 2026-05-28 23:29:16 +08:00
inhai 4e0d01e925 Update README.md 2026-05-28 22:28:34 +08:00
inhai e564b6f26f Update README.md 2026-05-28 21:47:10 +08:00
TreeLin 9b03ff38b8 Update README.md 2026-05-28 21:11:58 +08:00