Commit Graph

343 Commits

Author SHA1 Message Date
若麒 c18844120a fix: preserve offline dry-run validation before auth 2026-07-08 15:19:31 +08:00
若麒 4dfe3ac907 Merge branch 'main' into feat/self-built-framework 2026-07-08 14:15:39 +08:00
若麒 b0c48bab6b Merge branch 'main' into feat/self-built-framework 2026-07-08 14:05:48 +08:00
若麒 d20e037dec fix(verbose): restore request-side log lines dropped in credential refactor 2026-07-07 23:16:28 +08:00
若麒 476dd3b841 refactor(output): centralize ANSI styling and remove no-color flag
- remove --no-color from GLOBAL_FLAGS and drop Settings.noColor
- move ANSI styling decisions into runtime color helpers with NO_COLOR support
- update command text renderers to use shared color helpers instead of local ANSI codes
- refresh e2e invocations, generated reference, and agent skill guidance
2026-07-07 00:07:21 +08:00
若麒 c35f2856e5 refactor(flags): align media command async and concurrent handling
- scope image/video task execution to --async and --concurrent
- add concurrent task fan-out for video edit and video ref
- extend image edit to the async image task path
- refresh e2e coverage and generated command references
2026-07-06 22:11:52 +08:00
若麒 b3b1a08baf docs(agents): align maintenance guides with split CLI architecture 2026-07-06 21:50:50 +08:00
若麒 468b4d710e refactor(flags): scope yes/async/concurrent to command-owned flags
- remove nonInteractive plus yes/async/concurrent from GLOBAL_FLAGS and Settings;
  command dispatch no longer resolves command-only switches into global settings
- add shared ASYNC_FLAG / CONCURRENT_FLAG definitions for commands that actually
  support task-only return or parallel requests
- keep quota downgrade protection by moving --yes onto quota request and reading
  flags.yes for confirmed downgrade submission
- update existing async/concurrent consumers to read own flags; no new capability
  matrix entries are added
- refresh generated command reference and remove stale --non-interactive usage
  from e2e/stress invocations
2026-07-06 20:43:29 +08:00
若麒 deab3b3841 refactor(flags): scope credential flags by command auth domain
- flags split into GLOBAL_FLAGS (all commands) plus MODEL_AUTH_FLAGS /
  CONSOLE_AUTH_FLAGS, parsed only for commands of the matching auth
  domain; cross-domain flags now fail with "Unknown flag" instead of
  being silently ignored
- all shadow redeclarations removed; the registry guard now rejects any
  own flag named after a reserved (global or visible-domain) flag
- --workspace-id joins the console domain (chain: flag > env > file);
  usage stats drops its private declaration and in-command priority
- auth login declares its credential args as own command parameters
  (--api-key / --base-url / --console-site, original behavior intact);
  auth status no longer accepts credential-domain overrides (use env or
  config set instead)
- command help and the generated reference both show Flags (own + auth
  domain) plus a full Global Flags section, replacing the footer hint
- breaking: pipeline run --timeout renamed to --step-timeout (collided
  with the global request timeout)
2026-07-06 17:42:11 +08:00
若麒 d31b7f83ca refactor(core): split god Config into Identity/Settings/Credential resolved at the dispatch boundary
- commands consume a narrowed context (identity/settings/own flags/client);
  config/auth commands additionally use configStore()/authStore() accessors
- resolution happens once at dispatch: buildSources/buildSettings plus
  per-domain credential resolvers; dry-run tolerates missing credentials
- transport takes structured deps; credentials are injected only by Client;
  console gateway takes a resolved target with optional token (anonymous
  catalog calls); pipeline steps and advisor run against client/settings
- telemetry receives authMethod as a value; global/command flags are split
  at dispatch with a same-type shadowing guard at registry build
- behavior change: base URL resolution now prefers DASHSCOPE_BASE_URL env
  over config file base_url (unified flag > env > file > default chain)
- priority chains, store semantics and command capability boundaries are
  locked by unit tests
2026-07-06 15:59:33 +08:00
gujieye 7b08b8863e Merge pull request #88 from modelstudioai/feat/update-recommend
feat: update model recommend by using intent model & using soft / hard score in model recall
2026-07-06 14:03:23 +08:00
故璃 d118875772 Merge branch 'main' into feat/update-recommend 2026-07-06 13:40:41 +08:00
故璃 d2312847eb feat: update model recommend 2026-07-06 13:40:00 +08:00
clark-fc b5f2b8b691 Merge pull request #87 from modelstudioai/feat/update-version
Feat/update version
v1.6.1
2026-07-03 18:19:54 +08:00
qcq01083097 acfbc58516 feat: update skill version to 1.6.1 2026-07-03 18:15:53 +08:00
qcq01083097 e4849224c4 feat: update version to 1.6.1 2026-07-03 18:12:51 +08:00
clark-fc 3aa08e5d79 Merge pull request #86 from modelstudioai/feat/change-model
feat: change vision describe example model
2026-07-03 17:52:02 +08:00
qcq01083097 4914c5258b feat: change vision describe example model 2026-07-03 16:23:50 +08:00
clark-fc a20ab54406 Merge pull request #85 from modelstudioai/feat/knowledge-cli
Feat/knowledge cli
v1.6.0
2026-07-02 16:45:13 +08:00
zeyu.fz e6a8bf09e7 test(knowledge): 添加条件跳过无法执行的e2e错误场景测试
- 根据isDashScopeE2EReady函数动态跳过错误场景测试集
- 修改测试注释明确标注环境变量可能泄露风险
- 将BAILIAN_CONFIG_DIR改为固定临时目录路径以稳定测试
- 在知识检索命令新增dry-run支持,绕过凭证直接使用API-KEY路径执行请求体输出
2026-07-02 16:42:52 +08:00
zeyu.fz c6426e9e94 test(cli): 更新测试用例以模拟空环境变量场景
- 在 knowledge chat 相关测试中加入 BAILIAN_WORKSPACE_ID 为空的环境变量模拟
- 在 knowledge search 相关测试中加入 BAILIAN_WORKSPACE_ID 为空的环境变量模拟
- 将 knowledge 相关测试中的部分环境变量由 undefined 改为空字符串以更准确模拟环境场景
- 保持测试逻辑不变,确保非零退出码及错误提示的正确性
2026-07-02 16:31:00 +08:00
zeyu.fz 03541b4fd1 test(e2e): 移除多处测试调试信息并优化 runCli 调用参数
- 从 file-upload.e2e.test.ts 中删除无用的调试日志代码
- global-setup.ts 中清理环境变量调试打印信息
- knowledge-chat.e2e.test.ts 和 knowledge-search.e2e.test.ts 中去除多余的环境变量传入
- knowledge.e2e.test.ts 中调整 runCli 调用,统一简化测试参数
- commands/knowledge 下 chat.ts 与 search.ts 增加 skipDefaultApiKeySetup 标记,避免默认 API Key 初始化
2026-07-02 16:28:42 +08:00
zeyu.fz 6dd206eda9 debug(cli): 增加文件上传测试对配置文件读取的调试日志
- 添加对用户主目录下配置文件路径的打印和存在性检查
- 打印环境变量 HOME 及 BAILIAN_CONFIG_DIR 的值
- 调用 readConfigFile 并打印返回内容及 api_key 相关信息
- 捕获并打印 readConfigFile 的异常信息
- 如果配置文件存在,读取并打印其原始内容
- 保留现有环境变量和功能状态的调试输出
2026-07-02 16:08:36 +08:00
zeyu.fz e2efcfda77 test(cli): 添加文件上传E2E测试的环境变量调试信息
- 引入 isBailianE2EEnabled 方法用于调试
- 在 worker 进程中打印关键环境变量 DASHSCOPE_API_KEY
- 打印 isDashScopeE2EReady 与 isBailianE2EEnabled 的返回结果
- 方便排查文件上传相关E2E测试环境状态问题
2026-07-02 15:58:14 +08:00
zeyu.fz a078670445 Merge remote-tracking branch 'origin/feat/composable-cli' into feat/knowledge-cli 2026-07-02 15:51:40 +08:00
zeyu.fz 8fc2fc54fb test(e2e): 添加全局设置调试日志,排查CI环境变量问题
- 增加日志输出,详细打印CI环境中的关键变量值
- 检查并打印本地配置文件内容及其API Key长度
- 引入新的辅助函数,支持更全面的环境就绪状态检测
- 提升对DashScope和Console等E2E测试环境的诊断能力
- 便于排查CI中DASHSCOPE_API_KEY及相关环境变量的来源和状态
2026-07-02 15:49:48 +08:00
zeyu.fz 9bf6c6d9af refactor(release): 移除未使用的导入以简化代码
- 从 publish-stable.mjs 中删除了未使用的 findPackage 导入
- 仅保留 ALL_PACKAGES 和 PACKAGES 的导入
- 提升代码的清晰度和维护性
2026-07-02 15:36:48 +08:00
zeyu.fz 892ae300ae feat(knowledge): 新增基于 workspace 的知识库语义检索与问答功能
- 新增 `bl knowledge search` 命令,支持语义检索及多模态检索参数
- 新增 `bl knowledge chat` 命令,支持知识库 SSE 流式问答及多轮历史对话
- 在 `bailian-cli-core` 中添加相应的知识 API 类型和端点支持
- `kscli` 新增 `search` 和 `chat` 两个命令,`retrieve` 标记为废弃
- 更新 `kscli` README,调整主推命令并标记 `retrieve` 废弃
- 补充完善 E2E 测试覆盖检索与问答功能的多种用例
- 修正若干缺少必要参数时的 CLI 行为,确保打印帮助并正常退出
- 升级各相关包版本至 1.6.0,更新 CHANGELOG 及相关文档说明
2026-07-02 15:19:38 +08:00
zeyu.fz 6c4f31ddb2 test(e2e): 删除kscli的chat和search端到端测试
- 移除chat命令的多种输出模式测试(JSON、文本、流模式)
- 删除多轮对话上下文感知回答的测试用例
- 删除chat命令无效agent_id时的容错测试
- 移除search命令的JSON和文本模式搜索测试
- 删除带查询历史的搜索功能测试
- 删除search命令无效agent_id时的错误处理测试
- 清理与测试相关的类型定义和辅助函数调用
2026-07-02 14:38:20 +08:00
zeyu.fz 9ff8c53d53 feat: merge 2026-07-02 14:22:50 +08:00
Gong Shiqi a8652f350d Merge pull request #84 from modelstudioai/chore/kscli-version-1.5.0
chore(release): align knowledge-studio-cli to 1.5.0
v1.5.0
2026-07-01 16:08:40 +08:00
若麒 b1a0c0005d chore(release): align knowledge-studio-cli to 1.5.0
kscli joins the family lockstep version so the --knowledge stable publish
passes (validate.mjs asserts every package in ALL_PACKAGES matches
bailian-cli-core). Was 0.0.1, which blocked publish-stable --knowledge.
2026-07-01 16:06:20 +08:00
Gong Shiqi f597b94c46 Merge pull request #83 from modelstudioai/feat/composable-cli
Release 1.5.0: finetune / deploy / dataset / token-plan + composable CLI
2026-07-01 15:54:13 +08:00
若麒 750641dd0e chore(release): 1.5.0 2026-07-01 14:22:17 +08:00
若麒 11ed19723a fix(kscli): build entry key rag→kscli to fix publint path mismatch 2026-06-30 23:23:32 +08:00
若麒 848e44eb44 Merge branch 'main' into feat/composable-cli 2026-06-30 23:07:18 +08:00
gujieye 07875c309e Merge pull request #77 from modelstudioai/feat/auto-update
feat: auto-update CLI on major version gap
2026-06-30 14:15:45 +08:00
故璃 7d05649f8d Merge branch 'main' into feat/auto-update 2026-06-30 14:13:29 +08:00
gujieye fd9bba77a9 Merge pull request #80 from modelstudioai/feat/model-train
feat: add model finetune/deploy/dataset commend to support one step model training by Agent
2026-06-30 14:12:40 +08:00
故璃 0593c7eb28 Merge branch 'main' into feat/model-train 2026-06-30 14:10:47 +08:00
zeyu.fz 7c9ad7d6ce feat(packages): 添加 runtime 和 commands 包配置
- 在包列表中新增 runtime 包配置
- 在包列表中新增 commands 包配置
- 确保新包路径和名称正确设置
2026-06-29 18:18:44 +08:00
若麒 ae88f7a4ad refactor(runtime): group process-lifecycle setup into installProcessHandlers 2026-06-29 16:08:14 +08:00
若麒 bd431d769f feat(update-checker): surface update notice to non-TTY/agent runs
- drop the CI / non-TTY early-return so agents see "Update available" too
- widen check interval 4h→24h; stay silent inside the window (no per-command repeat)
- remove orphan isCI() helper (zero callers)
- versioning.md: drop the now-false "banner suppressed under agent" rationale
2026-06-29 15:45:34 +08:00
若麒 df89ededc2 test(e2e): align with UsageError validation contract
Missing required flags now throw UsageError (exit code 2, error on
stderr, JSON under --output json) instead of printing help and exiting
0. Update assertions and titles accordingly:

- missing-flag cases: exitCode 0/1 -> 2, retitle to "errors as usage error (2)"
- auth / video-task-get under --output json: assert the error JSON on stderr
- proxy probe: import setupProxyFromEnv from runtime/src/proxy.ts
- drop tests for the removed config export-schema command
- fix t2v dry-run: cliTimeoutPrefix misplaced between --model and its value
2026-06-29 14:53:24 +08:00
zeyu.fz 2ec2f34763 feat(cli): 支持多模态消息内容及图片URL数组
- 扩展聊天消息内容类型,支持文本和图片URL的数组形式
- 处理 --image 参数,将图片URL作为多模态内容附加到最后一条用户消息
- 若无用户消息且指定图片URL,自动创建空用户消息以承载图片内容
- 禁止同时使用内嵌图片内容和 --image 参数,避免冲突
- 将知识搜索接口请求的图片参数字段 image_list 重命名为 images
- 单元测试覆盖多模态内容及图片数组行为验证
- 优化消息解析,支持JSON结构化消息和 role:content 格式
- 更新API类型声明,明确多模态消息结构与字段类型
2026-06-29 13:36:32 +08:00
若麒 1f56feab24 refactor(commands): route all exits through the central error handler
Commands no longer call process.exit() directly. Every failure now throws
UsageError (bad input → exit 2) or BailianError (runtime failure, with
AUTH/TIMEOUT codes), so the runtime's handleError stays the single exit
point and telemetry always flushes.

- convert 27 process.exit() sites across 15 commands to throws
- move cross-flag/value checks into validate(); use flag `choices` for
  --events / --sort; drop dead --model required check
- keep pipeline's process.exitCode for lint-style soft failures
- enforce with unicorn/no-process-exit, allowed only in runtime/tools/tests
- fix incidental lint: void floating run(), narrow console errorCode,
  align generate-reference type imports to source
2026-06-29 09:07:12 +08:00
若麒 2f9558c161 refactor(auth): remove deprecated AK/SK auth for knowledge retrieve
AK/SK signing was used only by `knowledge retrieve`'s deprecated fallback,
which the api-key auth gate now makes unreachable. Drop it; the command is
pure api-key.

- knowledge/retrieve: remove the AK/SK path + --access-key-id/secret/workspace-id
  flags; api-key only
- delete client/ak-sign.ts and its signRequest/AkSignConfig exports
- drop access_key_id/access_key_secret from config schema, loader, and
  `config show` / `config set`
- remove the now-unused PascalCase KnowledgeRetrieve request/response types
2026-06-28 22:24:59 +08:00
若麒 95eb07d04a refactor(auth): centralize credential resolution into authStage + Client
Move all credential handling out of commands into one place. authStage
resolves the credential for the command's declared `auth` and bakes it into
`ctx.client`, gating (throw) when missing; commands reach the network only
through `ctx.client` and never touch tokens or baseUrl.

- add Client (request/requestJson/uploadFile/mcp/console/url) wrapping the
  token + baseUrl; commands call it instead of self-resolving
- run(config, flags) → run(ctx) + CommandContext; migrate all 45 commands
- split domains: model = pure api-key (drop access-token fallback), console =
  config.json only (drop DASHSCOPE_ACCESS_TOKEN env)
- consolidate env reads in loadConfig; CredentialSource = flag | env | config;
  priority flag > env > config
- endpoints return paths (xxxPath) instead of full URLs; baseUrl owned by Client
- auth status now uses describeAuth
- video/download: auth "none" → "apiKey" (it needs the model API)
- dedupe fetchModelList behind an injected console-call function
- remove ensureApiKey/ensure-key.ts, prompt.ts + isInteractive, and the old
  resolveCredential/resolveConsoleGatewayCredential resolvers
- tests: adapt auth.e2e to the new auth status shape; drop the
  DASHSCOPE_ACCESS_TOKEN branch from console-readiness gates
2026-06-28 20:42:33 +08:00
若麒 f9bf36c242 refactor(flags): keyed type-inferred flag schema; option→flag rename
Replace the positional `OptionDef[]` array (key/type regex-parsed from
"--x <v>" strings) with a keyed `FlagsDef` record whose `type` drives both
runtime parsing and compile-time flag-type inference (`Flags<typeof DEF>`).
GLOBAL_FLAGS becomes the single source; the hand-kept GlobalFlags interface
(types/flags.ts) is deleted.

- core: SwitchFlag|ValueFlag union, ParsedFlags/Flags inference, defineCommand
  infers F from spec.flags
- runtime: parseFlags dispatches on def.type (switch/string/number/boolean/
  array/choices) with declarative required-flag enforcement
- commands: migrate every flag declaration to the keyed form
- naming: option→flag throughout (OptionDef→FlagDef, OptionsDef→FlagsDef,
  GLOBAL_OPTIONS→GLOBAL_FLAGS, command field options→flags), plus user-facing
  "Options:"→"Flags:" in help and the regenerated skill reference docs

Behavior-preserving aside from the intentional Options→Flags wording:
vp check clean across all packages, 29 parser tests pass, reference regen
byte-identical before the terminology swap.
2026-06-28 11:19:21 +08:00
若麒 cbd3c1232c refactor(runtime): unify validation into UsageError; bare command shows help
- drop IncompleteCommandError: missing-required, failed validate, and bad/unknown
  flags are all UsageError now
- error boundary keys on bareness — bare command that fails → help (exit 0);
  non-bare invalid → error + message (exit 2)
- login: drop config.apiKey fallback, --api-key required-unless-console via validate
- speech: drop empty --text-file guard (empty content is the API's concern)
2026-06-27 10:56:28 +08:00