@getdiff/transport
v0.1.0
Published
Transport layer for GetDiff — remote control, channels (Discord, Slack, Telegram, GitHub), and dispatch
Downloads
304
Maintainers
Readme
@getdiff/transport
Transport layer for the GetDiff SDK — remote control, channels, and dispatch.
Connect agent sessions to chat platforms, GitHub events, and remote clients.
Install
npm install @getdiff/transportChannels
Bidirectional bridges between external platforms and agent sessions.
Discord
npm install @getdiff/transport discord.jsimport { DiscordAdapter } from "@getdiff/transport/adapters/discord";
const discord = new DiscordAdapter({
token: process.env.DISCORD_TOKEN,
onSession: async (prompt, channelId) => {
// Create an agent session and stream results back
},
});
await discord.start();Slack
npm install @getdiff/transport @slack/boltTelegram
npm install @getdiff/transport node-telegram-bot-apiGitHub Events
Respond to PR reviews, issue assignments, CI failures:
npm install @getdiff/transport @octokit/appWebhooks
Generic outbound webhooks for any platform:
import { WebhookAdapter } from "@getdiff/transport/adapters/webhook";Remote Control
Connect any client (mobile, web, CLI) to a running agent session via WebSocket.
import { RelayServer } from "@getdiff/transport/relay";
const relay = new RelayServer({ port: 3001 });
await relay.start();
// Clients connect via WebSocket to ws://localhost:3001Protocol
The transport layer uses a typed envelope protocol over WebSocket. Messages are wrapped in WireEnvelope objects with version, type, id, and timestamp fields. The two primary message types are PromptEnvelope (client → agent, with sender, intent, replyTo, hint fields) and ResponseEnvelope (agent → client). See protocol.ts for the full schema.
License
MIT
