@langchain/langgraph-api 0.0.10 → 0.0.11

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.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # LangGraph.js API
2
2
 
3
- In-memory implementation of the LangGraph.js API.
3
+ In-memory implementation of the LangGraph.js API.
@@ -77,7 +77,11 @@ api.get("/assistants/:assistant_id/graph", zValidator("query", z.object({ xray:
77
77
  const assistant = await Assistants.get(assistantId);
78
78
  const { xray } = c.req.valid("query");
79
79
  const graph = getGraph(assistant.graph_id);
80
- return c.json(graph.getGraph({ ...getRunnableConfig(assistant.config), xray }).toJSON());
80
+ const drawable = await graph.getGraphAsync({
81
+ ...getRunnableConfig(assistant.config),
82
+ xray: xray ?? undefined,
83
+ });
84
+ return c.json(drawable.toJSON());
81
85
  });
82
86
  api.get("/assistants/:assistant_id/schemas", async (c) => {
83
87
  // Get Assistant Schemas
@@ -69,7 +69,10 @@ api.post("/threads/:thread_id/state", zValidator("param", z.object({ thread_id:
69
69
  const inserted = await Threads.State.post(config, payload.values, payload.as_node);
70
70
  return jsonExtra(c, inserted);
71
71
  });
72
- api.get("/threads/:thread_id/state/:checkpoint_id", zValidator("param", z.object({ thread_id: z.string().uuid(), checkpoint_id: z.string().uuid() })), zValidator("query", z.object({ subgraphs: schemas.coercedBoolean.optional() })), async (c) => {
72
+ api.get("/threads/:thread_id/state/:checkpoint_id", zValidator("param", z.object({
73
+ thread_id: z.string().uuid(),
74
+ checkpoint_id: z.string().uuid(),
75
+ })), zValidator("query", z.object({ subgraphs: schemas.coercedBoolean.optional() })), async (c) => {
73
76
  // Get Thread State At Checkpoint
74
77
  const { thread_id, checkpoint_id } = c.req.valid("param");
75
78
  const { subgraphs } = c.req.valid("query");
@@ -30,5 +30,11 @@ For production use, please use LangGraph Cloud.
30
30
  graphs: context.config.graphs,
31
31
  cwd: options.projectCwd,
32
32
  }),
33
- ], { stdio: ["inherit", "inherit", "inherit", "ipc"], env: context.env });
33
+ ], {
34
+ stdio: ["inherit", "inherit", "inherit", "ipc"],
35
+ env: {
36
+ ...context.env,
37
+ NODE_ENV: "development",
38
+ },
39
+ });
34
40
  }
@@ -1,17 +1,17 @@
1
1
  // MIT License
2
- //
2
+ //
3
3
  // Copyright (c) Hiroki Osame <hiroki.osame@gmail.com>
4
- //
4
+ //
5
5
  // Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  // of this software and associated documentation files (the "Software"), to deal
7
7
  // in the Software without restriction, including without limitation the rights
8
8
  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
9
  // copies of the Software, and to permit persons to whom the Software is
10
10
  // furnished to do so, subject to the following conditions:
11
- //
11
+ //
12
12
  // The above copyright notice and this permission notice shall be included in all
13
13
  // copies or substantial portions of the Software.
14
- //
14
+ //
15
15
  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
16
  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -19,7 +19,7 @@
19
19
  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  // SOFTWARE.
22
- //
22
+ //
23
23
  // https://github.com/privatenumber/tsx/tree/28a3e7d2b8fd72b683aab8a98dd1fcee4624e4cb
24
24
  import net from "node:net";
25
25
  import { getPipePath } from "./utils/get-pipe-path.mjs";
@@ -1,17 +1,17 @@
1
1
  // MIT License
2
- //
2
+ //
3
3
  // Copyright (c) Hiroki Osame <hiroki.osame@gmail.com>
4
- //
4
+ //
5
5
  // Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  // of this software and associated documentation files (the "Software"), to deal
7
7
  // in the Software without restriction, including without limitation the rights
8
8
  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
9
  // copies of the Software, and to permit persons to whom the Software is
10
10
  // furnished to do so, subject to the following conditions:
11
- //
11
+ //
12
12
  // The above copyright notice and this permission notice shall be included in all
13
13
  // copies or substantial portions of the Software.
14
- //
14
+ //
15
15
  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
16
  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -19,7 +19,7 @@
19
19
  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  // SOFTWARE.
22
- //
22
+ //
23
23
  // https://github.com/privatenumber/tsx/tree/28a3e7d2b8fd72b683aab8a98dd1fcee4624e4cb
24
24
  import path from "node:path";
25
25
  import os from "node:os";
package/dist/schemas.mjs CHANGED
@@ -194,6 +194,7 @@ export const RunCreate = z
194
194
  "updates",
195
195
  "events",
196
196
  "debug",
197
+ "custom",
197
198
  ])),
198
199
  z.enum([
199
200
  "values",
@@ -202,6 +203,7 @@ export const RunCreate = z
202
203
  "updates",
203
204
  "events",
204
205
  "debug",
206
+ "custom",
205
207
  ]),
206
208
  ])
207
209
  .optional(),
package/dist/stream.mjs CHANGED
@@ -3,7 +3,6 @@ import { Client as LangSmithClient } from "langsmith";
3
3
  import { Command, Send, } from "@langchain/langgraph";
4
4
  import { runnableConfigToCheckpoint, taskRunnableConfigToCheckpoint, } from "./utils/runnableConfig.mjs";
5
5
  import { BaseMessageChunk, isBaseMessage } from "@langchain/core/messages";
6
- import { logger } from "./logging.mjs";
7
6
  const getLangGraphCommand = (command) => {
8
7
  let goto = command.goto != null && !Array.isArray(command.goto)
9
8
  ? [command.goto]
@@ -139,9 +138,6 @@ export async function* streamState(run, attempt = 1, options) {
139
138
  yield { event: "messages", data };
140
139
  }
141
140
  }
142
- else if (mode === "custom") {
143
- logger.warn("unhandled custom mode", { mode, chunk });
144
- }
145
141
  else if (userStreamMode.includes(mode)) {
146
142
  if (kwargs.subgraphs && ns?.length) {
147
143
  yield { event: `${mode}|${ns.join("|")}`, data };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-api",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -10,6 +10,10 @@
10
10
  "files": [
11
11
  "dist/"
12
12
  ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git@github.com:langchain-ai/langgraphjs-api.git"
16
+ },
13
17
  "dependencies": {
14
18
  "@babel/code-frame": "^7.26.2",
15
19
  "@hono/node-server": "^1.12.0",
@@ -46,11 +50,14 @@
46
50
  "vitest": "^3.0.5"
47
51
  },
48
52
  "scripts": {
53
+ "clean": "npx -y bun scripts/clean.mjs",
49
54
  "build": "npx -y bun scripts/build.mjs",
50
55
  "dev": "tsx ./tests/utils.server.mts",
51
56
  "typecheck": "tsc --noEmit",
52
57
  "test": "vitest",
53
58
  "test:parser": "vitest run ./tests/parser.test.mts --testTimeout 15000",
54
- "test:api": "npx -y bun scripts/test.mjs"
59
+ "test:api": "npx -y bun scripts/test.mjs",
60
+ "format": "prettier --write .",
61
+ "format:check": "prettier --check ."
55
62
  }
56
63
  }