@langchain/langgraph-api 0.0.20 → 0.0.22

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.
@@ -0,0 +1,30 @@
1
+ import { serializeError } from "./utils/serde.mjs";
2
+ let LOOPBACK_FETCH;
3
+ export const bindLoopbackFetch = (app) => {
4
+ LOOPBACK_FETCH = async (url, init) => app.request(url, init);
5
+ };
6
+ export async function callWebhook(result) {
7
+ const payload = {
8
+ ...result.run,
9
+ status: result.status,
10
+ run_started_at: result.run_started_at.toISOString(),
11
+ run_ended_at: result.run_ended_at?.toISOString(),
12
+ webhook_sent_at: new Date().toISOString(),
13
+ values: result.checkpoint?.values,
14
+ ...(result.exception
15
+ ? { error: serializeError(result.exception).message }
16
+ : undefined),
17
+ };
18
+ if (result.webhook.startsWith("/")) {
19
+ await LOOPBACK_FETCH?.(result.webhook, {
20
+ method: "POST",
21
+ body: JSON.stringify(payload),
22
+ });
23
+ }
24
+ else {
25
+ await fetch(result.webhook, {
26
+ method: "POST",
27
+ body: JSON.stringify(payload),
28
+ });
29
+ }
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-api",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": "^18.19.0 || >=20.16.0"
@@ -14,6 +14,10 @@
14
14
  ".": {
15
15
  "types": "./dist/cli/spawn.d.ts",
16
16
  "default": "./dist/cli/spawn.mjs"
17
+ },
18
+ "./auth": {
19
+ "types": "./dist/auth/index.d.ts",
20
+ "default": "./dist/auth/index.mjs"
17
21
  }
18
22
  },
19
23
  "repository": {
@@ -39,20 +43,27 @@
39
43
  "winston": "^3.17.0",
40
44
  "winston-console-format": "^1.0.8",
41
45
  "zod": "^3.23.8",
42
- "@langchain/langgraph-ui": "0.0.20"
46
+ "@langchain/langgraph-ui": "0.0.22"
43
47
  },
44
48
  "peerDependencies": {
45
49
  "@langchain/core": "^0.3.42",
46
50
  "@langchain/langgraph": "^0.2.57",
47
51
  "@langchain/langgraph-checkpoint": "^0.0.16",
52
+ "@langchain/langgraph-sdk": "^0.0.66",
48
53
  "typescript": "^5.5.4"
49
54
  },
55
+ "peerDependenciesMeta": {
56
+ "@langchain/langgraph-sdk": {
57
+ "optional": true
58
+ }
59
+ },
50
60
  "devDependencies": {
51
- "@langchain/langgraph-sdk": "^0.0.60",
61
+ "@langchain/langgraph-sdk": "^0.0.66",
52
62
  "@types/babel__code-frame": "^7.0.6",
53
63
  "@types/react": "^19.0.8",
54
64
  "@types/react-dom": "^19.0.3",
55
65
  "@types/node": "^22.2.0",
66
+ "jose": "^6.0.10",
56
67
  "@types/uuid": "^10.0.0",
57
68
  "postgres": "^3.4.5",
58
69
  "prettier": "^3.3.3",