Skip to content
Open
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
8 changes: 8 additions & 0 deletions specifications/ai-transport-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ The agent (server-side) session manages the run lifecycle over an Ably channel.

- `(AIT-ST13)` The SDK must provide an `Invocation` class with a static `fromJSON(data: InvocationData)` factory that wraps the JSON wire body sent from the client to the agent endpoint. `InvocationData` carries `runId`, `clientId`, `sessionName`, optional `messages`, optional `history`, optional `events`, optional `parent`, and optional `forkOf`. Omitted optional fields default to empty arrays / `undefined` on the constructed `Invocation`.

### Presence

- `(AIT-ST14)` The agent session must expose the underlying Ably channel's presence object via a read-only `presence` accessor. The accessor must return the channel's `RealtimePresence` directly, applying no AI-Transport-specific semantics, and must be usable before `connect()` is called.

## Client Session {#client-session}

The client session manages the client-side conversation lifecycle over an Ably channel. It composes a Tree for branching message history, a StreamRouter for per-run event streams, and a codec decoder for processing incoming Ably messages.
Expand Down Expand Up @@ -239,6 +243,10 @@ The client session manages the client-side conversation lifecycle over an Ably c

- `(AIT-CT20)` `send()` must throw with code `ChannelNotReady` (104007) if the channel is not in the ATTACHED or ATTACHING state.

### Presence

- `(AIT-CT21)` The client session must expose the underlying Ably channel's presence object via a read-only `presence` accessor. The accessor must return the channel's `RealtimePresence` directly, applying no AI-Transport-specific semantics, and must be usable before `connect()` is called.

## Common Error Codes used by AI Transport {#common-error-codes}

This section contains error codes that are common across Ably, but the AI Transport SDK makes use of. The status code for the error should align with the error code (i.e. 4xxxx and 5xxxx shall have statuses 400 and 500 respectively).
Expand Down
Loading