Skip to navigation

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.

PythonTypeScriptSource
AgentAgentagent/Agent.ts
PlatformRuntimePlatformRuntimeruntime/PlatformRuntime.ts
BandLinkBandLinkplatform/BandLink.ts
RoomPresenceRoomPresence, owned by AgentRuntimeruntime/rooms/
ExecutionContextExecutionContext, with one serialized Execution queue per roomruntime/ExecutionContext.ts, runtime/Execution.ts
DefaultPreprocessorDefaultPreprocessor, replaced with Agent.create({ preprocessor })runtime/preprocessing/DefaultPreprocessor.ts
SimpleAdapterSimpleAdapter<H>core/simpleAdapter.ts
AgentToolsAgentToolsruntime/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.
  • Keep per-room state in a Map keyed by room ID and release it in onCleanup(roomId).