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

npmnpm
Version
0.0.11
Version published
Weekly downloads
877K
34.83%
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 session, subscription, resource, sandbox, input, state, and usage

What this package does not include

This package does not currently ship a runtime client, transport, or helper APIs such as createSession(). 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,
  SessionOpenParams,
  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, SessionOpenParams } from "@langchain/protocol";

const params: SessionOpenParams = {
  protocolVersion: "0.3.0",
};

const openCommand: Command = {
  id: 1,
  method: "session.open",
  params,
};

Versioning

The package version is aligned with the draft protocol schema version published from this repository. The current generated bindings target protocol 0.3.0.

Source of truth

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

Keywords

langchain

FAQs

Package last updated on 23 Apr 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