langgraph-middleware 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org/)
6
6
 
7
- **English** | [中文](doc/README.zh.md)
7
+ **English** | [中文](https://github.com/jakehkw/langgraph-middleware/blob/main/doc/README.zh.md)
8
8
 
9
9
  **langgraph-middleware** brings middleware-style utilities to LangGraph's `StateGraph` — add **before/after hooks**, **reusable inject modules**, **error catching**, and **observability callbacks** to your graph nodes with a clean chainable API.
10
10
 
@@ -51,6 +51,7 @@ This library is ideal for:
51
51
 
52
52
  ```ts
53
53
  import { StateGraph, Annotation, START, END } from "@langchain/langgraph";
54
+ import "langgraph-middleware";
54
55
 
55
56
  const GraphState = Annotation.Root({
56
57
  input: Annotation<string>(),
@@ -91,6 +92,7 @@ Create reusable modules that modify any graph before compilation:
91
92
 
92
93
  ```ts
93
94
  import { StateGraph, Annotation, START, END, type StateGraphWithInject } from "@langchain/langgraph";
95
+ import "langgraph-middleware";
94
96
 
95
97
  const MyAnnotation = Annotation.Root({ value: Annotation<string>() });
96
98
 
@@ -141,6 +143,7 @@ const graph = new StateGraph(MyAnnotation)
141
143
 
142
144
  ```ts
143
145
  import { BaseCallbackHandler } from "@langchain/core/callbacks/base";
146
+ import "langgraph-middleware";
144
147
 
145
148
  class MyTimer extends BaseCallbackHandler {
146
149
  name = "MyTimer";
@@ -276,3 +279,16 @@ MIT © jakehkw
276
279
 
277
280
  - GitHub: https://github.com/jakehkw/langgraph-middleware
278
281
  - npm: https://www.npmjs.com/package/langgraph-middleware
282
+
283
+ ---
284
+
285
+ ## For Maintainers & AI Assistants
286
+
287
+ This repository includes a rich `CONTEXT.md` file containing:
288
+ - Complete domain model and architecture decisions
289
+ - Detailed explanation of timing (builder-time vs compile-time)
290
+ - All important limitations and gotchas with rationale
291
+ - Expanded keywords and recommendation triggers
292
+ - When (and when not) to recommend this package
293
+
294
+ When working on this codebase or answering questions about LangGraph middleware patterns, read `CONTEXT.md` first. It is designed to serve as high-fidelity persistent context for future RAG / AI-assisted work.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langgraph-middleware",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Middleware utilities for LangGraph StateGraph — inject modules, before/after hooks, error catching, and callback observation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",