Skip to main content

Connectors — Overview

A connector is the adapter between Chativa and your backend. It implements IConnector.

If "connector" is a new word, read Concepts → Ports first — the whole port idea is what makes Chativa transport-agnostic.

Built-in connectors​

PackageClassBest for
@chativa/connector-dummyDummyConnectorDevelopment, tests, sandbox demos. Pure local mock.
@chativa/connector-websocketWebSocketConnectorCustom WS backend. JSON frames in/out.
@chativa/connector-signalrSignalRConnectorMicrosoft SignalR hub.
@chativa/connector-directlineDirectLineConnectorAzure Bot Framework v3. Maps every activity type.
@chativa/connector-mekikMekikConnectormekik servers — Chativa's server-side sibling. Tool calls, GenUI, HITL, watermark resume.
@chativa/connector-convergerConvergerConnectorConverger channel hubs. Everything Mekik does, plus acks, delivery / read receipts, uploads, history paging, reactions and the agent panel.
@chativa/connector-sseSseConnectorServer-Sent Events stream + REST POST.
@chativa/connector-httpHttpConnectorPlain REST polling — simplest deployment.
Customyour classAnything else (REST, MQTT, gRPC, IPC…).

Tool calls, Generative UI and human-in-the-loop chips work the same over WebSocket, SignalR, SSE, HTTP, Mekik and Converger — see Rich frames for the shared JSON vocabulary.

Registering and selecting a connector​

import { ConnectorRegistry, chatStore } from "@chativa/core";
import { DirectLineConnector } from "@chativa/connector-directline";

ConnectorRegistry.register(new DirectLineConnector({ token: "..." }));
chatStore.getState().setConnector("directline");

Or via <chat-iva connector="directline"> once it's registered.

Capability matrix​

All optional methods are feature-detected at runtime. A capability is "advertised" simply by implementing the method.

CapabilityMethodDummyWSSignalRDirectLineMekikConvergerSSEHTTP
Send messagesendMessage✅✅✅✅✅✅✅✅
ReceiveonMessage✅✅✅✅✅✅✅✅
Connect / disconnect eventsonConnect / onDisconnect✅✅✅✅✅✅✅✅
Typing indicatoronTyping✅✅✅✅✅✅✅✅
Progress messagesonProgress✅
File uploadsendFile✅✅✅
History paginationloadHistory✅✅✅✅✅
Delivery / read statusonMessageStatus✅✅✅³
Like / dislike feedbacksendFeedback✅✅✅
Regenerate replyregenerate✅✅¹✅¹
Edit and resendeditMessage✅✅¹✅¹
Server-controlled action permissionsonCapabilities✅✅✅
End-of-conversation surveysendSurvey✅✅✅✅✅✅²✅✅
Tool callsonToolCall✅✅✅✅✅✅✅
GenUI streamingonGenUIChunk✅✅✅✅✅✅✅
GenUI events backreceiveComponentEvent✅✅✅✅✅²✅✅
Human-in-the-loop chipsquick-reply chips✅✅✅✅✅✅✅
Multi-conversationlistConversations & co✅✅

Empty cells are connectors that simply don't implement the method — the corresponding UI feature degrades gracefully (e.g. the file upload button hides itself when sendFile is missing).

¹ Only once the server's welcome frame advertises them (Converger relays the bot's flags). See mekik → Regenerate and edit. Connectors without regenerate / edit can emulate them with messageActions.fallback.

² Forwarded to the conversation's bot channel; until Converger's mekik relay ships (AimTune/converger#64) the hub answers bot_unavailable, which the connector ignores.

³ All five statuses: sending, sent, delivered, read and failed (see Converger → Receipts).

Configuration​

Each connector's options have a JSON Schema under schemas/connectors/ — drop the $schema URL into a config file and your editor will validate it as you type.