Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@langchain/protocol

Package Overview
Dependencies
Maintainers
13
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@langchain/protocol

TypeScript bindings for the LangChain agent streaming protocol

latest
npmnpm
Version
0.0.16
Version published
Weekly downloads
710K
8.34%
Maintainers
13
Weekly downloads
 
Created
Source

@langchain/protocol

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.

What this package includes

  • 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

What this package does not include

This package does not currently ship a runtime client, transport, or helper APIs. It is intended for typing protocol payloads and generated bindings only.

Installation

npm install @langchain/protocol

Usage

Use 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,
};

Source of truth

The canonical protocol definition lives at protocol.cddl. The TypeScript bindings in this package are generated from that schema.

Keywords

langchain

FAQs

Package last updated on 28 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts