Skip to content

Commit 0d28a35

Browse files
Merge pull request #158 from modelstudioai/feat/cma-deployment
feat(managed-agent): add OpenAgentPack deployment support
2 parents ad5c44d + 7aa6aab commit 0d28a35

17 files changed

Lines changed: 242 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ 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.17.0] - 2026-08-17
10+
11+
### Added
12+
13+
- **Native Bailian Managed Agent Deployments**`deployments` declared in `agents.yaml` now materialize as native AgentStudio resources, with server-side cron schedules, local file resource uploads, archival through `destroy`, and migration of legacy emulated state on the next `apply`.
14+
915
## [1.16.0] - 2026-08-17
1016

1117
> Full knowledge-base lifecycle management arrives in the CLI: create and configure knowledge bases, upload documents, tune chunks, and deploy retrieval/Q&A services — all from `bl knowledge` and `kscli`.

CHANGELOG.zh.md

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

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

9+
## [1.17.0] - 2026-08-17
10+
11+
### 新增
12+
13+
- **百炼原生 Managed Agent Deployment** —— `agents.yaml` 中声明的 `deployments` 现在会创建原生 AgentStudio 资源,支持服务端 Cron 调度、本地文件资源上传、通过 `destroy` 归档,以及在下次 `apply` 时迁移旧版模拟 Deployment state。
14+
915
## [1.16.0] - 2026-08-17
1016

1117
> CLI 迎来知识库全生命周期管理:从创建配置知识库、上传文档、调优切片,到部署检索/问答服务,均可通过 `bl knowledge``kscli` 完成。

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bailian-cli",
3-
"version": "1.16.0",
3+
"version": "1.17.0",
44
"description": "CLI for Aliyun Model Studio (DashScope) AI Platform.",
55
"keywords": [
66
"agent",

packages/commands/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bailian-cli-commands",
3-
"version": "1.16.0",
3+
"version": "1.17.0",
44
"description": "Command library for bailian-cli products (knowledge, memory, media, …). See https://www.npmjs.com/package/bailian-cli for usage.",
55
"homepage": "https://bailian.console.aliyun.com/cli",
66
"bugs": {
@@ -40,7 +40,7 @@
4040
"check": "vp check"
4141
},
4242
"dependencies": {
43-
"@openagentpack/sdk": "0.3.1",
43+
"@openagentpack/sdk": "0.3.2",
4444
"bailian-cli-core": "workspace:*",
4545
"bailian-cli-runtime": "workspace:*",
4646
"boxen": "catalog:",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
version: "1"
2+
3+
providers:
4+
bailian:
5+
api_key: ${DASHSCOPE_API_KEY}
6+
base_url: ${BAILIAN_BASE_URL}
7+
8+
defaults:
9+
provider: bailian
10+
11+
environments:
12+
dev:
13+
config:
14+
type: cloud
15+
networking:
16+
type: unrestricted
17+
18+
agents:
19+
reporter:
20+
description: "Invalid deployment integration fixture"
21+
model: qwen3.7-max
22+
instructions: |
23+
Generate a concise engineering report from the mounted template.
24+
environment: dev
25+
26+
deployments:
27+
invalid-report:
28+
agent: reporter
29+
initial_events:
30+
- type: user.define_outcome
31+
rubric: "Report is concise and actionable."
32+
resources:
33+
- type: file
34+
source: ./report-template.md
35+
- type: file
36+
source: ./report-template.md
37+
mount_path: report-template.md
38+
- type: file
39+
source: ./report-template.md
40+
mount_path: /mnt/report-template.md
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: "1"
2+
3+
providers:
4+
bailian:
5+
api_key: ${DASHSCOPE_API_KEY}
6+
base_url: ${BAILIAN_BASE_URL}
7+
8+
defaults:
9+
provider: bailian
10+
11+
environments:
12+
dev:
13+
config:
14+
type: cloud
15+
networking:
16+
type: unrestricted
17+
18+
agents:
19+
reporter:
20+
description: "Deployment integration fixture"
21+
model: qwen3.7-max
22+
instructions: |
23+
Generate a concise engineering report from the mounted template.
24+
environment: dev
25+
26+
deployments:
27+
daily-report:
28+
agent: reporter
29+
description: "Native Bailian deployment"
30+
schedule:
31+
expression: "0 9 * * *"
32+
timezone: UTC
33+
initial_events:
34+
- type: user.message
35+
content: "Generate today's engineering report."
36+
resources:
37+
- type: file
38+
source: ./report-template.md
39+
mount_path: /mnt/report-template.md
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Engineering report
2+
3+
Summarize completed work, current risks, and next actions.

packages/commands/tests/e2e/managed-agent.e2e.test.ts

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
import { join } from "node:path";
12
import { describe, expect, test } from "vite-plus/test";
2-
import { parseStdoutJson, runCommandE2e } from "./helpers.ts";
3+
import { e2eFixturesDir, parseStdoutJson, runCommandE2e } from "./helpers.ts";
34
import { MANAGED_AGENT_ROUTES } from "./topic-routes.ts";
45

6+
const AGENTS_DEPLOYMENT_YAML = join(e2eFixturesDir, "managed-agent", "agents-deployment.yaml");
7+
const AGENTS_DEPLOYMENT_INVALID_YAML = join(
8+
e2eFixturesDir,
9+
"managed-agent",
10+
"agents-deployment-invalid.yaml",
11+
);
12+
13+
const DEPLOYMENT_SAFETY_DIAGNOSTIC_CODES = [
14+
"bailian.deployment.initial_events.message_required",
15+
"bailian.deployment.file.mount_path.required",
16+
"bailian.deployment.file.mount_path.duplicate",
17+
];
18+
519
/**
620
* managed-agent:help / 缺参不依赖密钥;所有 mutation 命令的 --dry-run
721
* 必须在构建 SDK runtime(凭证注入 / 联网 / 写盘)之前短路,因此同样不需要密钥。
@@ -12,6 +26,102 @@ import { MANAGED_AGENT_ROUTES } from "./topic-routes.ts";
1226
*/
1327

1428
describe("e2e: managed-agent", () => {
29+
test("validate 接受原生 Bailian Deployment 配置", async () => {
30+
const { stdout, stderr, exitCode } = await runCommandE2e(MANAGED_AGENT_ROUTES, [
31+
"managed-agent",
32+
"validate",
33+
"--file",
34+
AGENTS_DEPLOYMENT_YAML,
35+
"--output",
36+
"json",
37+
]);
38+
expect(exitCode, stderr).toBe(0);
39+
const data = parseStdoutJson<{
40+
valid?: boolean;
41+
diagnostics?: Array<{ code?: string; severity?: string }>;
42+
}>(stdout);
43+
expect(data.valid).toBe(true);
44+
expect(data.diagnostics).not.toContainEqual(
45+
expect.objectContaining({ code: "bailian.deployment.schedule_unsupported" }),
46+
);
47+
});
48+
49+
test("plan --dry-run 通过 SDK planner 规划原生 Bailian Deployment", async () => {
50+
const { stdout, stderr, exitCode } = await runCommandE2e(MANAGED_AGENT_ROUTES, [
51+
"managed-agent",
52+
"plan",
53+
"--dry-run",
54+
"--file",
55+
AGENTS_DEPLOYMENT_YAML,
56+
"--output",
57+
"json",
58+
]);
59+
expect(exitCode, stderr).toBe(0);
60+
const data = parseStdoutJson<{
61+
actions?: Array<{
62+
action?: string;
63+
address?: { provider?: string; type?: string; name?: string };
64+
}>;
65+
diagnostics?: Array<{ code?: string; severity?: string }>;
66+
}>(stdout);
67+
expect(data.actions).toContainEqual(
68+
expect.objectContaining({
69+
action: "create",
70+
address: {
71+
provider: "bailian",
72+
type: "deployment",
73+
name: "daily-report",
74+
},
75+
}),
76+
);
77+
expect(data.diagnostics).not.toContainEqual(
78+
expect.objectContaining({ code: "bailian.deployment.schedule_unsupported" }),
79+
);
80+
});
81+
82+
test("validate 拒绝会产生空消息或无效挂载路径的 Bailian Deployment", async () => {
83+
const { stdout, exitCode } = await runCommandE2e(MANAGED_AGENT_ROUTES, [
84+
"managed-agent",
85+
"validate",
86+
"--file",
87+
AGENTS_DEPLOYMENT_INVALID_YAML,
88+
"--output",
89+
"json",
90+
]);
91+
expect(exitCode).toBe(1);
92+
const data = parseStdoutJson<{
93+
valid?: boolean;
94+
diagnostics?: Array<{ code?: string; severity?: string }>;
95+
}>(stdout);
96+
expect(data.valid).toBe(false);
97+
for (const diagnosticCode of DEPLOYMENT_SAFETY_DIAGNOSTIC_CODES) {
98+
expect(data.diagnostics).toContainEqual(
99+
expect.objectContaining({ code: diagnosticCode, severity: "error" }),
100+
);
101+
}
102+
});
103+
104+
test("plan --dry-run 在 Deployment 安全诊断失败时阻断计划", async () => {
105+
const { stdout, exitCode } = await runCommandE2e(MANAGED_AGENT_ROUTES, [
106+
"managed-agent",
107+
"plan",
108+
"--dry-run",
109+
"--file",
110+
AGENTS_DEPLOYMENT_INVALID_YAML,
111+
"--output",
112+
"json",
113+
]);
114+
expect(exitCode).toBe(1);
115+
const data = parseStdoutJson<{
116+
diagnostics?: Array<{ code?: string; severity?: string }>;
117+
}>(stdout);
118+
for (const diagnosticCode of DEPLOYMENT_SAFETY_DIAGNOSTIC_CODES) {
119+
expect(data.diagnostics).toContainEqual(
120+
expect.objectContaining({ code: diagnosticCode, severity: "error" }),
121+
);
122+
}
123+
});
124+
15125
test("managed-agent apply --help 正常退出", async () => {
16126
const { stderr, exitCode } = await runCommandE2e(MANAGED_AGENT_ROUTES, [
17127
"managed-agent",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bailian-cli-core",
3-
"version": "1.16.0",
3+
"version": "1.17.0",
44
"description": "Core SDK for bailian-cli. See https://www.npmjs.com/package/bailian-cli for usage.",
55
"homepage": "https://bailian.console.aliyun.com/cli",
66
"bugs": {

packages/kscli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "knowledge-studio-cli",
3-
"version": "1.16.0",
3+
"version": "1.17.0",
44
"description": "Lightweight RAG CLI for Aliyun Model Studio — focused on knowledge-base retrieval.",
55
"keywords": [
66
"alibaba-cloud",

0 commit comments

Comments
 (0)