Skip to content
Merged
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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,30 @@ existing `0.1.0` release; earlier development prereleases are not listed.

## [Unreleased]

### Added

- Type Forward Session `auto_title` on creation and update-only `config.multiagent`, including persistent null clearing without restoring Template inheritance.
- Add independent Forward Template A2A publication models and `templates.getAgentCard()` for authenticated 0.3/1.0 discovery. Protocol selection uses `A2A-Version`; PAT Identity scope uses query parameters. Unknown Card fields are retained; invocation URLs are never followed automatically.
- Add typed Forward OSS Environment configs, storage and buckets with separate required new write credentials, optional update credentials, and secret-free response declarations. Config and bucket arrays replace saved values; mount removals affect only new Sessions. OSS storage requires `oss-bucket-2026-09-23` beta.
- Add Managed `always_deny` for built-in defaults, per-tool configs and the top-level MCP default policy, ImageGen/ImageSearch/VideoGen/DeliverArtifacts config request and response interfaces, and the type-only Browser toolset across Agent and Session snapshot unions. Browser requests use the existing `browser-use-2026-07-14` beta header mechanism.

### Fixed

- Accept masked OSS bucket credentials in typed Forward Environment updates, so callers can edit and resend read configurations without supplying secrets again. New bucket creation still requires complete write credentials.
- Send Managed `environments.work.heartbeat()` `expected_last_heartbeat` and `desired_ttl_seconds` as query parameters. Earlier releases put them in the JSON body, which the service ignores, so lease preconditions and requested TTLs had no effect.
- Accept `"latest"` and positive integer strings for child Agent `version` in Managed Agent multiagent rosters, and type saved roster versions as `number | "latest"` in Agent responses. Session and Deployment Agent references keep numeric versions.

### Breaking changes

- Managed built-in per-tool config request and response declarations now require `name`. Legacy optional `type` is retained but cannot select a tool on its own; canonical service names and existing lowercase/snake aliases are accepted. Bash invocation input syntax is unchanged.
- `ManagedAgentsMultiagentAgentUnion` now uses `ManagedAgentsMultiagentAgentReference`, whose `version` is `number | "latest"`, and roster requests use `ManagedAgentsMultiagentAgentParams`.
- Managed MCP response `configs` and `default_config`, plus their nested `enabled` and `permission_policy` fields, are now optional and nullable. Callers that previously iterated or dereferenced them directly must narrow these values to compile.

### Migration

- Configure the default MCP policy on `tools[].permission_policy`, not `tools[].default_config.permission_policy`; unlisted MCP tools use the top-level policy. Check optional media-config response fields and A2A `enabled` before reading them.
- Iterate MCP configs with `for (const config of tool.configs ?? [])`. Use `if (tool.default_config)` before accessing default metadata, `if (config.permission_policy)` or `if (tool.default_config?.permission_policy)` before reading a nested policy's `type`, and `if (config.enabled != null)` (likewise for default `enabled`) before treating it as a boolean. Check `tool.permission_policy` for the effective default; do not fall back to legacy `default_config.permission_policy` when the top-level policy is absent.
- Add `name` to each Managed built-in config, for example replace `{ type: 'bash', enabled: true }` with `{ name: 'Bash', enabled: true }`. Media configs need no prompt or other invocation parameters. Browser entries must contain only `{ type: 'browser_toolset_20260714' }`.
- Check for `"latest"` before treating a saved roster `version` as a number. Code that only builds roster requests needs no change.

## [0.15.0]
Expand Down
80 changes: 80 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,86 @@ for (const model of models.data) {

Each client also has its own entry point, `qca-sdk/forward` or `qca-sdk/managed`, with named and default exports.

## Capability configuration

Forward Session `config.multiagent` is update-only: omission keeps the current
roster, `null` persistently clears it without restoring Template inheritance, and
empty `agents` arrays are rejected by the service; use `null` to clear the roster. Session
creation accepts `auto_title: true` only when `title` is absent (including no
empty string or `null`); conflicts are validated by the service.

Template `a2a` is publication metadata, separate from `multiagent`. Updates patch
object members: omission or `{}` keeps metadata, `skills: []` replaces the skill
list, `enabled: false` disables access but retains metadata, and `a2a: null`
disables access and clears metadata. Members must not be `null`.

```ts
import { ForwardClient } from 'qca-sdk';

const forward = new ForwardClient({ pat: process.env.QODER_PAT });
await forward.sessions.create({ identity_id: 'idn_example', template_id: 'tpl_example', auto_title: true });
await forward.sessions.update('sess_example', { config: { multiagent: null } });
await forward.templates.update('tpl_example', {
a2a: { enabled: true, skills: [{ id: 'summary', name: 'Summary', description: 'Summarize text', tags: ['summary'], examples: ['Summarize these notes'] }] },
});
const card = await forward.templates.getAgentCard('tpl_example', { identity_id: 'idn_example', a2a_version: '1.0' });
console.log(card.supportedInterfaces);
```

`getAgentCard()` defaults to A2A 0.3 when the version is omitted; 0.3 returns
`url`, while 1.0 returns `supportedInterfaces` with `url`, `protocolBinding`, and
`protocolVersion`. Omit `identity_id` for SAT calls. Request-option headers/query
can override typed values. Unknown Card fields are preserved. This is discovery
only, not an A2A task client; the SDK never follows returned invocation URLs.

Forward cloud Environments support up to **7 OSS buckets**, gated by
`x-qoder-beta: oss-bucket-2026-09-23`. Use `EnvironmentConfigParam` for typed new
config or `EnvironmentConfigUpdateParam` for updates; outer requests retain raw
object compatibility. Config updates replace the entire config. Existing buckets
may omit `credential` on update to keep saved credentials; `buckets: []` removes
mounts only for newly created Sessions. The service returns only the credential
type and optionally a masked AccessKey ID, never role ARN or AccessKey secrets.
The SDK does not check cloud permissions or enforce a local bucket-count limit.

```ts
import { ForwardClient } from 'qca-sdk';
import type { EnvironmentConfigUpdateParam } from 'qca-sdk/forward';

const forward = new ForwardClient({ pat: process.env.QODER_PAT });
const config: EnvironmentConfigUpdateParam = {
type: 'cloud',
storage: { buckets: [{ name: 'datasets', provider: 'aliyun-oss', region: 'cn-hangzhou', bucket: 'example-datasets', access: 'read_only' }] },
};
await forward.environments.update('env_example', { config }, {
headers: { 'x-qoder-beta': 'oss-bucket-2026-09-23' },
});
```

Managed per-tool configs require `name` (canonical names or supported lowercase /
snake aliases); legacy optional `type` never replaces it. `always_deny` is available
for built-in defaults and per-tool configs. Set MCP's default with top-level
`permission_policy`; `default_config.permission_policy` does not control unlisted
MCP tools. MCP response configs/default metadata and nested enabled/policy fields
may be omitted or null: iterate `tool.configs ?? []` and check defaults/policies
before dereferencing them. Media tool configs govern access, not generation inputs. Browser is a separate toolset with **only** `type`, no
`enabled` or `configs`; the existing `betas` parameter sends its required header.

```ts
import { ManagedClient } from 'qca-sdk';

const managed = new ManagedClient({ pat: process.env.QODER_PAT });
await managed.agents.update('agent_example', {
betas: ['browser-use-2026-07-14'],
tools: [
{ type: 'browser_toolset_20260714' },
{ type: 'agent_toolset_20260401', configs: [
{ name: 'ImageGen', permission_policy: { type: 'always_deny' } },
{ name: 'ImageSearch' }, { name: 'VideoGen' }, { name: 'DeliverArtifacts' },
] },
],
});
```

## Configuration

`accessToken` accepts a string or a function returning a string or a promise, re-resolved before every request attempt. `pat` remains available for existing PAT integrations. `QODER_ACCESS_TOKEN` supplies the selected mode's token; PAT mode falls back to `QODER_PAT`. A `Credential` object can be supplied instead; see the authentication section for automatic SA exchange.
Expand Down
17 changes: 17 additions & 0 deletions docs/api/forward/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

## Interfaces

- [AgentCard](interfaces/AgentCard.md)
- [AgentCardSupportedInterface](interfaces/AgentCardSupportedInterface.md)
- [Batch](interfaces/Batch.md)
- [BatchCancelParams](interfaces/BatchCancelParams.md)
- [BatchFile](interfaces/BatchFile.md)
Expand All @@ -54,6 +56,9 @@
- [BatchTaskListParams](interfaces/BatchTaskListParams.md)
- [BatchTaskUsage](interfaces/BatchTaskUsage.md)
- [BatchUsage](interfaces/BatchUsage.md)
- [BucketStorage](interfaces/BucketStorage.md)
- [BucketStorageParam](interfaces/BucketStorageParam.md)
- [BucketStorageUpdateParam](interfaces/BucketStorageUpdateParam.md)
- [Channel](interfaces/Channel.md)
- [ChannelChannelConfig](interfaces/ChannelChannelConfig.md)
- [ChannelChannelConfigResponseOptions](interfaces/ChannelChannelConfigResponseOptions.md)
Expand Down Expand Up @@ -164,6 +169,9 @@
- [MultiagentConfigParam](interfaces/MultiagentConfigParam.md)
- [MultiagentEntry](interfaces/MultiagentEntry.md)
- [MultiagentEntryParam](interfaces/MultiagentEntryParam.md)
- [OSSBucket](interfaces/OSSBucket.md)
- [OSSBucketParam](interfaces/OSSBucketParam.md)
- [OSSBucketUpdateParam](interfaces/OSSBucketUpdateParam.md)
- [PermissionPolicy](interfaces/PermissionPolicy.md)
- [PermissionPolicyParam](interfaces/PermissionPolicyParam.md)
- [ResourceBinding](interfaces/ResourceBinding.md)
Expand Down Expand Up @@ -242,8 +250,13 @@
- [SystemOverride](interfaces/SystemOverride.md)
- [SystemOverrideParam](interfaces/SystemOverrideParam.md)
- [Template](interfaces/Template.md)
- [TemplateA2AConfig](interfaces/TemplateA2AConfig.md)
- [TemplateA2AConfigParam](interfaces/TemplateA2AConfigParam.md)
- [TemplateA2ASkill](interfaces/TemplateA2ASkill.md)
- [TemplateA2ASkillParam](interfaces/TemplateA2ASkillParam.md)
- [TemplateArchiveParams](interfaces/TemplateArchiveParams.md)
- [TemplateCloneParams](interfaces/TemplateCloneParams.md)
- [TemplateGetAgentCardParams](interfaces/TemplateGetAgentCardParams.md)
- [TemplateListParams](interfaces/TemplateListParams.md)
- [TemplateNewParams](interfaces/TemplateNewParams.md)
- [TemplateUpdateParams](interfaces/TemplateUpdateParams.md)
Expand Down Expand Up @@ -276,6 +289,8 @@
- [ChannelQRSessionCreateParams](type-aliases/ChannelQRSessionCreateParams.md)
- [DreamInput](type-aliases/DreamInput.md)
- [DreamInputParam](type-aliases/DreamInputParam.md)
- [EnvironmentConfigParam](type-aliases/EnvironmentConfigParam.md)
- [EnvironmentConfigUpdateParam](type-aliases/EnvironmentConfigUpdateParam.md)
- [EnvironmentCreateParams](type-aliases/EnvironmentCreateParams.md)
- [EnvironmentVariablesUnionParam](type-aliases/EnvironmentVariablesUnionParam.md)
- [EventContentUnionParam](type-aliases/EventContentUnionParam.md)
Expand All @@ -286,6 +301,8 @@
- [MemoryStoreMemoryCreateParams](type-aliases/MemoryStoreMemoryCreateParams.md)
- [ModelConfig](type-aliases/ModelConfig.md)
- [ModelConfigUnionParam](type-aliases/ModelConfigUnionParam.md)
- [OSSBucketCredential](type-aliases/OSSBucketCredential.md)
- [OSSBucketCredentialParam](type-aliases/OSSBucketCredentialParam.md)
- [OutcomeRubric](type-aliases/OutcomeRubric.md)
- [OutcomeRubricParam](type-aliases/OutcomeRubricParam.md)
- [ScheduleCreateParams](type-aliases/ScheduleCreateParams.md)
Expand Down
26 changes: 26 additions & 0 deletions docs/api/forward/classes/Templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,32 @@ createTemplate

***

### getAgentCard()

> **getAgentCard**(`templateID`, `params?`, `options?`): [`APIPromise`](../../index/classes/APIPromise.md)\<[`AgentCard`](../interfaces/AgentCard.md)\>

Retrieve authenticated A2A discovery metadata without following invocation URLs.

#### Parameters

##### templateID

`string`

##### params?

[`TemplateGetAgentCardParams`](../interfaces/TemplateGetAgentCardParams.md) = `{}`

##### options?

[`RequestOptions`](../../index/interfaces/RequestOptions.md)

#### Returns

[`APIPromise`](../../index/classes/APIPromise.md)\<[`AgentCard`](../interfaces/AgentCard.md)\>

***

### list()

> **list**(`params?`, `options?`): [`PagePromise`](../../index/classes/PagePromise.md)\<[`Template`](../interfaces/Template.md)\>
Expand Down
65 changes: 65 additions & 0 deletions docs/api/forward/interfaces/AgentCard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[**qca-sdk**](../../README.md)

***

[qca-sdk](../../README.md) / [forward](../README.md) / AgentCard

# Interface: AgentCard

A2A discovery only. Returned URLs are metadata and are never fetched automatically.

## Indexable

> \[`key`: `string`\]: `unknown`

## Properties

### defaultInputModes

> **defaultInputModes**: `string`[]

***

### defaultOutputModes

> **defaultOutputModes**: `string`[]

***

### description

> **description**: `string`

***

### name

> **name**: `string`

***

### skills

> **skills**: [`TemplateA2ASkill`](TemplateA2ASkill.md)[]

***

### supportedInterfaces?

> `optional` **supportedInterfaces?**: [`AgentCardSupportedInterface`](AgentCardSupportedInterface.md)[]

A2A 1.0 invocation interfaces.

***

### url?

> `optional` **url?**: `string`

A2A 0.3 invocation endpoint.

***

### version

> **version**: `string`
29 changes: 29 additions & 0 deletions docs/api/forward/interfaces/AgentCardSupportedInterface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[**qca-sdk**](../../README.md)

***

[qca-sdk](../../README.md) / [forward](../README.md) / AgentCardSupportedInterface

# Interface: AgentCardSupportedInterface

## Indexable

> \[`key`: `string`\]: `unknown`

## Properties

### protocolBinding

> **protocolBinding**: `string`

***

### protocolVersion

> **protocolVersion**: `string`

***

### url

> **url**: `string`
13 changes: 13 additions & 0 deletions docs/api/forward/interfaces/BucketStorage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[**qca-sdk**](../../README.md)

***

[qca-sdk](../../README.md) / [forward](../README.md) / BucketStorage

# Interface: BucketStorage

## Properties

### buckets

> **buckets**: [`OSSBucket`](OSSBucket.md)[]
13 changes: 13 additions & 0 deletions docs/api/forward/interfaces/BucketStorageParam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[**qca-sdk**](../../README.md)

***

[qca-sdk](../../README.md) / [forward](../README.md) / BucketStorageParam

# Interface: BucketStorageParam

## Properties

### buckets

> **buckets**: [`OSSBucketParam`](OSSBucketParam.md)[]
15 changes: 15 additions & 0 deletions docs/api/forward/interfaces/BucketStorageUpdateParam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[**qca-sdk**](../../README.md)

***

[qca-sdk](../../README.md) / [forward](../README.md) / BucketStorageUpdateParam

# Interface: BucketStorageUpdateParam

The complete array replaces existing mounts. Removals affect only new Sessions.

## Properties

### buckets

> **buckets**: [`OSSBucketUpdateParam`](OSSBucketUpdateParam.md)[]
8 changes: 8 additions & 0 deletions docs/api/forward/interfaces/EnvironmentConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ Runs on sandbox start/resume; self-hosted execution depends on the worker.

***

### storage?

> `optional` **storage?**: [`BucketStorage`](BucketStorage.md)

Bucket read views never declare role ARN or AccessKey secrets.

***

### type

> **type**: `string`
5 changes: 3 additions & 2 deletions docs/api/forward/interfaces/EnvironmentNewParams.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ Additional fields are preserved verbatim by the SDK.

### config?

> `optional` **config?**: `Record`\<`string`, `unknown`\> \| `null`
> `optional` **config?**: `Record`\<`string`, `unknown`\> \| [`EnvironmentConfigParam`](../type-aliases/EnvironmentConfigParam.md) \| `null`

Environment 运行时配置对象;省略时默认使用 `{"type":"cloud"}`。显式传入时不能为 `null` 或空对象。字段详见 schemas。
Runtime config; omit for cloud defaults. Explicit null/empty objects are invalid.
OSS buckets require X-Qoder-Beta: oss-bucket-2026-09-23 (Forward supports up to 7).

***

Expand Down
5 changes: 3 additions & 2 deletions docs/api/forward/interfaces/EnvironmentUpdateParams.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ Additional fields are preserved verbatim by the SDK.

### config?

> `optional` **config?**: `Record`\<`string`, `unknown`\> \| `null`
> `optional` **config?**: `Record`\<`string`, `unknown`\> \| [`EnvironmentConfigUpdateParam`](../type-aliases/EnvironmentConfigUpdateParam.md) \| `null`

新配置;传入时不能为 `null`,显式 `null` 返回 400。字段详见 schemas。
Replaces the entire config; explicit null is invalid. Bucket credentials may be omitted to preserve them.
Removing buckets affects only new Sessions. Send X-Qoder-Beta: oss-bucket-2026-09-23 for OSS storage.

***

Expand Down
Loading