TypeScript bindings for the LangChain agent streaming protocol.
This package publishes the generated TypeScript schema bindings from
protocol.cddl so TypeScript applications can type protocol commands, events,
results, and content blocks consistently.
- Generated TypeScript protocol bindings in
protocol.ts - Types for top-level messages such as
Command,Message, and protocol events - Types for protocol modules including run, subscription, agent, input, state, and usage
This package does not currently ship a runtime client, transport, or helper APIs. It is intended for typing protocol payloads and generated bindings only.
npm install @langchain/protocolUse type-only imports when consuming the protocol schema:
import type {
Command,
Message,
SubscribeParams,
MessagesEvent,
} from "@langchain/protocol";You can then use the exported types to model protocol payloads in your own transport or client implementation:
import type { Command, SubscribeParams } from "@langchain/protocol";
const params: SubscribeParams = {
channels: ["messages", "lifecycle"],
};
const subscribeCommand: Command = {
id: 1,
method: "subscription.subscribe",
params,
};The canonical protocol definition lives at protocol.cddl. The TypeScript
bindings in this package are generated from that schema.