Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## [Unreleased]

## [0.5.0]

### Added

- Add typed Forward `ManagedToolConfig.schedule` and `ScheduleToolConfig.accessScope` for Identity- or Template-scoped Schedule management tools. Preserve unknown fields and omitted/null schedule configuration; Template managed-capability updates remain whole-object replacements.
- Add offline contracts and packaged-consumer checks for Schedule tool scope and direct Managed SA Key Bearer authentication, including rejection without PAT fallback.

### Documentation

- Document Managed SA Key direct calls separately from optional SAT exchange and Forward authentication, and reconcile Forward coverage to 147 HTTP operations including A2A Agent Card discovery.

## [0.4.0]

### Added
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

The Qoder Cloud Agents Java SDK provides typed synchronous and asynchronous clients, with shared authentication, timeouts, retries, pagination, streaming and error handling.

Version **0.4.0** supports both the **Forward API** and the **[Managed API](docs/managed.md)** in one package. Use `ForwardClient` / `AsyncForwardClient` for Forward and `ManagedClient` / `AsyncManagedClient` for Managed.
Version **0.5.0** supports both the **Forward API** and the **[Managed API](docs/managed.md)** in one package. Use `ForwardClient` / `AsyncForwardClient` for Forward and `ManagedClient` / `AsyncManagedClient` for Managed.

- [Installation](#installation)
- [Quick start](#quick-start)
Expand All @@ -20,13 +20,13 @@ Version **0.4.0** supports both the **Forward API** and the **[Managed API](docs

## Installation

Add the Maven dependency; published versions require no local SDK build or additional repository configuration.
Add the Maven dependency; published versions require no local SDK build or additional repository configuration. Version 0.5.0 is prepared in this checkout but is not yet published; install the local SDK for development, or use a version listed in [Releases](https://github.com/QoderAI/qoder-cloud-agents-sdk-java/releases).

```xml
<dependency>
<groupId>com.qoder.sdk</groupId>
<artifactId>qoder-cloud-agents-sdk</artifactId>
<version>0.4.0</version>
<version>0.5.0</version>
</dependency>
```

Expand Down Expand Up @@ -76,6 +76,7 @@ PAT and SA are parallel authentication modes:
| PAT | `.pat(token)` | Managed by your application |
| SA Key | `.credential(ServiceAccountCredential)` | SDK exchanges, caches and refreshes the SAT on demand |
| Existing SAT | `.authMode(AuthMode.SA).accessToken(token)` | Managed by your application |
| Direct SA Key (Managed only) | `.authMode(AuthMode.SA).accessToken(saKey)` | No SAT exchange or renewal; rotate the Key in your application |

With no explicit credentials, PAT mode reads `QODER_ACCESS_TOKEN`, then `QODER_PAT`. An explicit token or credential takes precedence over environment tokens; configure only one explicit source. The SDK does not load `.env` files or enable SA merely because `QODER_SA_KEY` is set.

Expand All @@ -96,7 +97,9 @@ try (ServiceAccountCredential credential = ServiceAccountCredential.builder()
}
```

Business requests use the SAT; the SA Key is sent only to the exchange service. For CN, use both `Region.CN` and the CN BaseURL. Keep a shared credential open until all clients using it are closed. Failed SA authentication does not fall back to PAT.
With `ServiceAccountCredential`, business requests use the SAT; the SA Key is sent only to the exchange service. For CN, use both `Region.CN` and the CN BaseURL. Keep a shared credential open until all clients using it are closed. Failed SA authentication does not fall back to PAT.

Managed APIs also accept the full SA Key directly as a Bearer credential through the existing `accessToken(...)` builder. Explicitly read it from your secrets manager or `QODER_SA_KEY`; the SDK does not infer this mode. See [Managed authentication](docs/managed.md#client-and-authentication) for a complete example. Direct SA Key authentication does not apply to Forward business APIs, which require PAT or SAT.

Forward also provides explicit administrator/Identity SAT issuance and revocation through `serviceAccountTokens()` and `identities().serviceAccountTokens()`. These methods take a per-call SA Key and do not retry automatically. See [SAT management](docs/usage-sat-drive.md) and [authentication configuration](docs/client-configuration.md).

Expand Down
2 changes: 2 additions & 0 deletions docs/client-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Forward SAT management uses explicit per-call SA Keys through `serviceAccountTok

Close the client after use. A static SAT is not automatically renewed. SA mode does not fall back to `QODER_PAT`. For application-managed rotation, implement `Credential.getToken()` returning a `CompletableFuture<String>`; it is called before each attempt and must be thread-safe and return promptly. Cancelling a request does not cancel a shared credential future.

For Managed-only integrations, the full SA Key can instead be passed directly with `ManagedClient.builder().authMode(AuthMode.SA).accessToken(saKey)`. This sends the Key as Bearer without exchange or SAT renewal; do not use this path for Forward business requests. No `QODER_SA_KEY` lookup is automatic. See [Managed authentication](managed.md#client-and-authentication) and [the official credential rules](https://docs.qoder.com/cloud-agents/api/conventions/authentication).

## Asynchronous calls and cancellation

```java
Expand Down
10 changes: 9 additions & 1 deletion docs/forward-api-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

开发中契约复核(2026-11-03):补齐 Session budget(省略/null/对象)、config.model、审批 evaluation 和 Environment startup_script;修正顶层 evaluatedPermission 字符串与 Thread 终止后的续订行为。本轮没有新增 HTTP 操作;验证见 `DocumentationAlignmentTest`,真实环境结果单独记录。

契约核对:2026-10-28。**0.2.0** 覆盖 **146 个 HTTP 操作及 Realtime WebSocket**:首版 123 项、Webhook 8 项、Forward Search / Dream / Pairing / Decision 15 项。同一版本还提供 [107 个 Managed 操作](managed-api-coverage.md)。离线验证与真实环境验收分别记录,不能把操作覆盖数当作线上通过率。
契约核对:2026-10-28,能力增量核对:2026-11-21,Schedule 工具范围核对:2026-12-03。当前 **0.5.0** 覆盖 **147 个 HTTP 操作及 Realtime WebSocket**:首版 123 项、Webhook 8 项、Forward Search / Dream / Pairing / Decision 15 项、0.4.0 新增 A2A Agent Card 1 项。同一包还提供 [107 个 Managed 操作](managed-api-coverage.md)。离线验证与真实环境验收分别记录,不能把操作覆盖数当作线上通过率。

HTTP BaseURL 为 CN `https://api.qoder.com.cn/api/v1/forward` 或 Global `https://api.qoder.com/api/v1/forward`;表内路径均相对于 BaseURL。

Expand All @@ -16,6 +16,8 @@ HTTP BaseURL 为 CN `https://api.qoder.com.cn/api/v1/forward` 或 Global `https:

开发中能力补齐(2026-11-21):新增 `GET /templates/{template_id}/a2a/agent-card.json`,方法 `templates().retrieveAgentCard(...)`,同步/异步及 withResponse 均支持;其余变更补齐 Session 更新多智能体、创建自动标题、A2A 配置和 OSS 模型,不新增这些资源的 HTTP 路由。新增测试见 `CapabilityParityTest`;真实环境未在本轮执行。

0.5.0 补齐 `managed_tool_config.schedule.access_scope` 的类型化请求/响应和省略/null 表达,不新增 HTTP 路由。Template 配置整体替换与 Identity/template 范围边界见 [Template 指南](templates.md#schedule-management-tool-scope),契约测试见 `TemplatesTest`,独立 JAR 消费测试见 `TemplateConsumerTest`。

## 使用指南

- [客户端认证、超时、重试与取消](client-configuration.md)
Expand Down Expand Up @@ -214,6 +216,12 @@ Webhook 的 8 个操作已实现同步/异步、分页、原始请求体验签
| 145 | `GET` | `/decisions` | `decisions().list(...)` |
| 146 | `GET` | `/decisions/{decision_id}` | `decisions().retrieve(...)` |

## 0.4.0 新增的 A2A 操作

| # | HTTP | 相对路径 | Java 入口 |
| ---: | --- | --- | --- |
| 147 | `GET` | `/templates/{template_id}/a2a/agent-card.json` | `templates().retrieveAgentCard(...)` |

最新公开契约及字段迁移说明见 [Forward 补齐指南](forward-parity.md)。固定官方来源为 2026-10-28 文档快照;Go/Python/TS 0.13.0 作为行为对照,不把其扩展字段自动视为官方契约。

本轮独立请求 fixture 位于 `src/test/resources/forward-parity-routes.json`,覆盖 15 个操作的同步/异步及 withResponse 入口。`ForwardParityTest`、`ForwardPaginationParityTest` 验证字段、metadata 冲突、精度、分页、幂等重试与取消。`ForwardCapabilitiesConsumerTest` 通过独立 examples 工程消费实际 JAR。真实环境和 QA 包尚须按 [验收指南](live-testing.md) 执行;目前没有这些新增功能的线上通过声明。
6 changes: 3 additions & 3 deletions docs/maintaining.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Java SDK maintenance

SDK 0.4.0 covers Forward and Managed and targets Java 8. Use JDK 17 or later for maintenance tools; the runtime compatibility matrix remains Java 8, 11, 17, 21 and 25.
SDK 0.5.0 covers Forward and Managed and targets Java 8. Use JDK 17 or later for maintenance tools; the runtime compatibility matrix remains Java 8, 11, 17, 21 and 25.

## Local checks and pull requests

Expand Down Expand Up @@ -36,10 +36,10 @@ The SDK's embedded version is filtered from `${project.version}`; do not replace
```sh
python3 .github/scripts/release_notes.py check
# After adding the actual release entry:
python3 .github/scripts/release_notes.py extract --version 0.4.0
python3 .github/scripts/release_notes.py extract --version 0.5.0
```

The release version in this checkout is `0.4.0`. Also update the README dependency and version-specific maintenance examples. Acceptance records must include the resolved version, source SHA and JAR digest. Release versions must not be overwritten; a successful test of an older build is not evidence for a newer one.
The release version in this checkout is `0.5.0`. Also update the README dependency and version-specific maintenance examples. Acceptance records must include the resolved version, source SHA and JAR digest. Release versions must not be overwritten; a successful test of an older build is not evidence for a newer one.

### RC qualification for 0.1.0

Expand Down
23 changes: 22 additions & 1 deletion docs/managed.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,28 @@ try (ManagedClient client = ManagedClient.builder()
}
```

The base URL is resolved from `.baseUrl(...)`, then `QODER_BASE_URL`, then Global `https://api.qoder.com/api/v1/cloud`. CN uses `https://api.qoder.com.cn/api/v1/cloud`. PAT and static SAT use the same configuration rules as Forward; `ServiceAccountCredential` exchanges an SA Key for a platform SAT with `qca.access`. The examples' `ManagedExampleClient` handles PAT, SA Key and static SAT selection. Managed does not expose Forward's Identity query selector.
The base URL is resolved from `.baseUrl(...)`, then `QODER_BASE_URL`, then Global `https://api.qoder.com/api/v1/cloud`. CN uses `https://api.qoder.com.cn/api/v1/cloud`. PAT and static SAT use the same configuration rules as Forward. Managed does not expose Forward's Identity query selector.

Managed APIs accept the **full SA Key directly** as a Bearer credential; no SAT exchange or renewal is required. Use the existing builder explicitly:

```java
import com.qoder.cloudagents.ManagedClient;
import com.qoder.cloudagents.auth.AuthMode;

try (ManagedClient client = ManagedClient.builder()
.baseUrl("https://api.qoder.com/api/v1/cloud")
.authMode(AuthMode.SA)
.accessToken(System.getenv("QODER_SA_KEY"))
.build()) {
System.out.println(client.models().list().data().size());
}
```

For an independently owned async client, use the same builder with `.buildAsync()` and close it after requests finish. The SDK does not automatically read `QODER_SA_KEY`, exchange a directly configured Key, validate JWT structure or fall back to PAT on rejection. Keep the Key in a secrets manager, rotate it in your application, and select the credential's region and workspace binding; the service enforces access.

SAT exchange remains optional: `ServiceAccountCredential` obtains, caches and refreshes a platform SAT with `qca.access`; request both `qca.access` and `forward.access` if that SAT will also call Forward. Forward business APIs accept PAT/SAT, **not direct SA Keys**. `ManagedExampleClient` retains its existing automatic-exchange behavior when `QODER_SA_KEY` is supplied. For direct calls with that helper, set `QODER_AUTH_MODE=sa` and put the Key in `QODER_ACCESS_TOKEN`, leaving `QODER_SA_KEY` unset in the helper's environment.

Source: [official authentication](https://docs.qoder.com/cloud-agents/api/conventions/authentication), checked on 2026-12-03. `ManagedContractsTest` and `ManagedConsumerTest` validate direct Bearer wire placement without contacting the service; real account access remains a separate opt-in verification.

`client.async()` shares the parent's transport; closing that view is a no-op. `ManagedClient.builder().buildAsync()` owns its transport. `withOptions(...)` creates an independently closeable client. Ordinary HTTP methods also offer `withResponse()` for status, headers and request ID. SSE streams expose handshake metadata through `response()` and must be closed.

Expand Down
6 changes: 3 additions & 3 deletions docs/releasing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Java SDK release setup

The release version in this checkout is `com.qoder.sdk:qoder-cloud-agents-sdk:0.4.0`. The manual [Release workflow](../.github/workflows/release.yml) publishes using repository Actions secrets. Dispatching it from `main` authorizes publication after all automated checks pass; there is no separate environment approval. The Central account, namespace, signing key and repository settings below must be configured first. The GitHub repository and internal Maven access do not grant Maven Central publishing access.
The release version in this checkout is `com.qoder.sdk:qoder-cloud-agents-sdk:0.5.0`. The manual [Release workflow](../.github/workflows/release.yml) publishes using repository Actions secrets. Dispatching it from `main` authorizes publication after all automated checks pass; there is no separate environment approval. The Central account, namespace, signing key and repository settings below must be configured first. The GitHub repository and internal Maven access do not grant Maven Central publishing access.

`0.1.0-rc.1` was published to Maven Central on 2026-10-21; see its [Release](https://github.com/QoderAI/qoder-cloud-agents-sdk-java/releases/tag/v0.1.0-rc.1) and [successful publication workflow](https://github.com/QoderAI/qoder-cloud-agents-sdk-java/actions/runs/39572349619). A version committed to a POM is not yet a published package: check the workflow's public verification and matching GitHub Release for each version.

Expand Down Expand Up @@ -70,13 +70,13 @@ The namespace variable is a maintainer's setup confirmation, not an automatic ow

Prepare a PR that updates the root POM, the example project's version and SDK dependency, plus the changelog version section. Keep an empty `Unreleased` section. Review any version-specific install examples. Merge only after `quality` and all five Java checks succeed. The workflow does not bump versions or merge the PR.

For the Forward and Managed contract-alignment `0.4.0` release, run internal integration tests and accept a QA package built from the merged version commit. Record both API surfaces, the Java runtime, cleanup warnings and untested scenarios. Earlier development-package results do not replace this check. Use the merged `0.4.0` main SHA and a new batch ID; leave recovery inputs empty for the first publication.
For the Forward and Managed contract-alignment `0.5.0` release, run internal integration tests and accept a QA package built from the merged version commit. Record both API surfaces, the Java runtime, cleanup warnings and untested scenarios. Earlier development-package results do not replace this check. Use the merged `0.5.0` main SHA and a new batch ID; leave recovery inputs empty for the first publication.

Open **Actions → Release → Run workflow**, select **main**, and verify the following inputs before dispatch. Successful preflight automatically proceeds to signing and publication; it does not pause for an additional approval.

| Input | First publication |
| --- | --- |
| `version` | The reviewed version without `v` or `SNAPSHOT`, for example `0.4.0` |
| `version` | The reviewed version without `v` or `SNAPSHOT`, for example `0.5.0` |
| `commit_sha` | Full 40-character lowercase SHA of the current GitHub main |
| `batch_id` | 1–64 letters/digits/dots/underscores/hyphens, starting with a letter or digit |
| `resume_run_id` | Empty |
Expand Down
Loading