> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.band.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.band.ai/_mcp/server.

# TypeScript Architecture

Reference for `@band-ai/sdk` 1.0.0.

## Architecture

The table maps names when moving between the Python SDK and `@band-ai/sdk` 1.0.0. Use each language reference for its lifecycle, configuration and adapter behavior. Its source is under [`packages/sdk/src`](https://github.com/band-ai/band-sdk-typescript/tree/sdk-v1.0.0/packages/sdk/src).

| Python                | TypeScript                                                            | Source                                                |
| :-------------------- | :-------------------------------------------------------------------- | :---------------------------------------------------- |
| `Agent`               | `Agent`                                                               | `agent/Agent.ts`                                      |
| `PlatformRuntime`     | `PlatformRuntime`                                                     | `runtime/PlatformRuntime.ts`                          |
| `BandLink`            | `BandLink`                                                            | `platform/BandLink.ts`                                |
| `RoomPresence`        | `RoomPresence`, owned by `AgentRuntime`                               | `runtime/rooms/`                                      |
| `ExecutionContext`    | `ExecutionContext`, with one serialized `Execution` queue per room    | `runtime/ExecutionContext.ts`, `runtime/Execution.ts` |
| `DefaultPreprocessor` | `DefaultPreprocessor`, replaced with `Agent.create({ preprocessor })` | `runtime/preprocessing/DefaultPreprocessor.ts`        |
| `SimpleAdapter`       | `SimpleAdapter<H>`                                                    | `core/simpleAdapter.ts`                               |
| `AgentTools`          | `AgentTools`                                                          | `runtime/tools/AgentTools.ts`                         |

Differences an adapter author sees:

* `onMessage(message, tools, history, participantsMessage, contactsMessage, { isSessionBootstrap, roomId })` replaces `on_message()`, and a subclass sets the abstract `provider` string that names it in failure reports.
* `relayReply(tools, text, mentions)` from `@band-ai/sdk/core` posts the model's final text unless the turn already replied, and `renderSystemPrompt()` from `@band-ai/sdk/runtime` builds Band's instructions.
* Tool schemas come from `TOOL_MODELS`, through `tools.getToolSchemas("openai" | "anthropic")`. Optional tool groups are set agent-wide with `linkOptions.capabilities`; see [Tool capabilities](/sdks/typescript/platform-tools#tool-capabilities).
* Keep per-room state in a `Map` keyed by room ID and release it in `onCleanup(roomId)`.