Skip to content

Commit 9ccef75

Browse files
authored
同步bailian deployment能力 (#86)
* feat(bailian): implement native Deployment support Bailian's Agent Studio now exposes a first-class Deployment resource, so replace the emulated implementation that expanded a deployment into a one-shot Session at run time. The adapter now uses the real endpoints for create, get, list, update, archive, run, and pause/unpause; the deployment API takes `agent` as an object ({id, version?}) rather than the bare id the sessions API accepts. Notable behavior: file resources upload at apply time instead of run time, and updateDeployment falls back to create when a state row carries a null remote_id so deployments recorded under the emulated implementation materialize on the next apply. Removing an existing schedule is rejected — update replaces only the fields it is given and the API documents no null form for `schedule`. `user.define_outcome` events and `github_repository` resources are dropped from the payload and now warn in validate-config; the emulated schedule warning no longer fires since cron runs server-side. Docs, capability tables, examples, and the live smoke script move to native. Verified: typecheck, bun test (653 pass), biome. Not run against the live API — no workspace credentials. * fix(bailian): harden native deployment lifecycle * fix(deps): upgrade nanoid to 3.3.18
1 parent a295920 commit 9ccef75

39 files changed

Lines changed: 1519 additions & 278 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@openagentpack/sdk": minor
3+
---
4+
5+
Bailian: implement native Deployment support against the Agent Studio `/deployments` API (create, get, list, update, archive, run, pause/unpause), replacing the previous emulated session expansion. Deployment schedules now run server-side; `user.define_outcome` events and `github_repository` resources are dropped from the deployment payload and surface a warning on plan.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Beta testers can install `@openagentpack/cli@beta`; see the [release guide](./do
147147
| MCP Server | native | native | native | native |
148148
| Memory Store | unsupported | native | native | native |
149149
| Multi-Agent | unsupported | unsupported | native | native |
150-
| Deployment | emulated | native | native | emulated |
150+
| Deployment | native | native | native | emulated |
151151
| Session | native | native | native | native |
152152

153153
The full capability matrix and per-provider differences live in the [Provider reference](./docs/reference/providers.md).

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Beta 用户可以安装 `@openagentpack/cli@beta`;固定版本及切回稳定
147147
| MCP Server | native | native | native | native |
148148
| Memory Store | unsupported | native | native | native |
149149
| Multi-Agent | unsupported | unsupported | native | native |
150-
| Deployment | emulated | native | native | emulated |
150+
| Deployment | native | native | native | emulated |
151151
| Session | native | native | native | native |
152152

153153
完整能力矩阵与各 Provider 差异见 [Provider 参考](./docs/reference/providers.zh-CN.md)。

bun.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/architecture/how-it-works.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ agents state import <address> <remote-id>
6363

6464
Resources (agents, environments, skills…) are **infrastructure** — long-lived, managed by `plan`/`apply`. A **session** is a **runtime** conversation started from an agent. Sessions are managed separately with `agents session` and are not part of the plan/apply lifecycle.
6565

66-
Deployments sit between the two: they are declared as resources but produce runs. On Qoder and Claude they schedule server-side; on Bailian and Volcengine Ark a `deployment run` expands into a session.
66+
Deployments sit between the two: they are declared as resources but produce runs. On Bailian, Qoder, and Claude they schedule server-side; on Volcengine Ark a `deployment run` expands into a session.

docs/concepts/agents-as-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Because the declaration is a file, it gets everything a file gets: code review,
1919
- The **agent harness** is the provider-managed layer that wraps a model into an agent: knowledge base, skills, MCP wiring, prompt/instructions, vault, deployment, multi-agent orchestration. These are the customer's portable assets.
2020
- The **agent infra** is the interchangeable execution substrate beneath the harness — the specific provider (Bailian, Qoder, Claude, Volcengine Ark) that runs the agent.
2121

22-
OpenAgentPack's portability claim is that the same harness declaration can target different agent infra. Portability means the *core declaration* is portable and the per-provider **capability contract** is explicit — unsupported facets degrade gracefully (for example, an emulated `Deployment` on Bailian/Volcengine Ark) — not that every feature is identical on every provider.
22+
OpenAgentPack's portability claim is that the same harness declaration can target different agent infra. Portability means the _core declaration_ is portable and the per-provider **capability contract** is explicit — unsupported facets degrade gracefully (for example, an emulated `Deployment` on Volcengine Ark) — not that every feature is identical on every provider.
2323

2424
## What this enables
2525

docs/concepts/sessions-and-deployments.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,18 @@ How a deployment *runs* depends on the provider's capability tier:
2424
|----------|:--------------:|------------------------------------|
2525
| Claude | native | schedules server-side through the deployments API |
2626
| Qoder | native | creates a deployment run and associated session |
27-
| Bailian, Ark | emulated | expands into a one-shot session at run time |
27+
| Bailian | native | triggers a server-side run through the deployments API |
28+
| Ark | emulated | expands into a one-shot session at run time |
2829

29-
On the emulated providers, scheduling and outcome rubrics are **not** enforced server-side — use external cron/CI for always-on or scheduled runs.
30+
On Ark (the emulated provider), scheduling and outcome rubrics are **not** enforced server-side — use external cron/CI for always-on or scheduled runs.
3031

3132
## The lifecycle in one picture
3233

3334
```text
3435
agents.yaml ──plan/apply──▶ managed resources (agent, environment, …)
3536
3637
└─session create/run──▶ runtime session
37-
└─deployment run──────▶ runtime session (emulated) or scheduled run (native)
38+
└─deployment run──────▶ scheduled run (native) or runtime session (emulated on Ark)
3839
```
3940

4041
Next: [Run sessions](../guides/run-sessions.md) and [Manage deployments](../guides/manage-deployments.md).

docs/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ agents destroy
5353
| MCP Server | native | native | native | native |
5454
| Memory Store | unsupported | native | native | native |
5555
| Multi-Agent | unsupported | unsupported | native | native |
56-
| Deployment | emulated | native | native | emulated |
56+
| Deployment | native | native | native | emulated |
5757
| Session | native | native | native | native |
5858

5959
See [Provider reference](./reference/providers.md) for per-provider configuration and notes.

docs/guides/configure-an-agent.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ Deployment 是介于「定义」与「运行」之间的声明式中间层。它
484484
- **部署层**(Deployment):声明「用哪个 Agent、带哪些绑定、以什么初始事件和调度运行」。
485485
- **运行层**(Session):一次具体的执行实例。
486486

487-
> Provider 差异:Qoder 和 Claude 原生支持 Deployment(对应平台的 deployments API,可服务端调度);百炼、火山方舟为**模拟**实现——`apply` 只写本地状态(`remote_id` 为 `null`),`agents deployment run` 时展开为一个 Session。详见 [Provider 参考](../reference/providers.zh-CN.md#模拟emulated资源的能力降级)。
487+
> Provider 差异:百炼、Qoder 和 Claude 原生支持 Deployment(对应平台的 deployments API,可服务端调度);火山方舟为**模拟**实现——`apply` 只写本地状态(`remote_id` 为 `null`),`agents deployment run` 时展开为一个 Session。百炼上 `user.define_outcome` 事件和 `github_repository` 资源不在部署 payload 内,plan 时会输出警告。详见 [Provider 参考](../reference/providers.zh-CN.md#原生-deployment-的-payload-裁剪)。
488488

489489
### 定义 Deployment
490490

docs/guides/deploy-to-bailian.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ providers:
2626
| Environment, Vault, Skill, Agent, MCP Server, Session | native |
2727
| Memory Store | unsupported |
2828
| Multi-Agent | unsupported |
29-
| Deployment | emulated |
29+
| Deployment | native |
3030

3131
- Skills upload as a zip via the Files API (two-step).
3232
- MCP servers are **official managed servers** referenced by `name` (no vault needed for them).
33-
- `deployment run` expands into a one-shot session; scheduling/outcome rubrics are not enforced server-side.
33+
- Deployments are native: `apply` creates the remote deployment, `schedule` runs server-side (cron + timezone), and `deployment run` triggers a server-side run. `user.define_outcome` events and `github_repository` resources are not part of the deployment payload and surface a warning on plan.
3434

3535
## Minimal agent
3636

0 commit comments

Comments
 (0)