@langchain/langgraph-ui 0.0.20-dev.1 → 0.0.20-dev.2

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/dist/api.mjs +8 -13
  2. package/package.json +1 -1
package/dist/api.mjs CHANGED
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import * as fs from "node:fs/promises";
3
3
  import * as path from "node:path";
4
4
  import * as bundler from "./bundler.mjs";
5
- export async function build(options) {
5
+ function getBuildContext(options) {
6
6
  const cwd = process.cwd();
7
7
  const defs = z
8
8
  .record(z.string(), z.string())
@@ -11,8 +11,12 @@ export async function build(options) {
11
11
  .object({ shared: z.array(z.string()).optional() })
12
12
  .parse(JSON.parse(process.env.LANGGRAPH_UI_CONFIG || "{}"));
13
13
  const fullPath = path.resolve(cwd, options.output);
14
- const publicPath = path.resolve(fullPath, "ui");
15
- const schemasPath = path.resolve(fullPath, "client.ui.schemas.json");
14
+ const publicPath = path.resolve(fullPath, "public");
15
+ const schemasPath = path.resolve(fullPath, "schemas.json");
16
+ return { cwd, defs, config, publicPath, schemasPath };
17
+ }
18
+ export async function build(options) {
19
+ const { cwd, defs, config, publicPath, schemasPath } = getBuildContext(options);
16
20
  const schemas = {};
17
21
  await Promise.all(Object.entries(defs).map(async ([graphId, userPath]) => {
18
22
  const folder = path.resolve(publicPath, graphId);
@@ -30,16 +34,7 @@ export async function build(options) {
30
34
  });
31
35
  }
32
36
  export async function watch(options) {
33
- const cwd = process.cwd();
34
- const defs = z
35
- .record(z.string(), z.string())
36
- .parse(JSON.parse(process.env.LANGGRAPH_UI || "{}"));
37
- const config = z
38
- .object({ shared: z.array(z.string()).optional() })
39
- .parse(JSON.parse(process.env.LANGGRAPH_UI_CONFIG || "{}"));
40
- const fullPath = path.resolve(cwd, options.output);
41
- const publicPath = path.resolve(fullPath, "public");
42
- const schemasPath = path.resolve(fullPath, "schemas.json");
37
+ const { cwd, defs, config, publicPath, schemasPath } = getBuildContext(options);
43
38
  const schemas = {};
44
39
  let promiseSeq = Promise.resolve();
45
40
  await Promise.all(Object.entries(defs).map(async ([graphId, userPath]) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-ui",
3
- "version": "0.0.20-dev.1",
3
+ "version": "0.0.20-dev.2",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": "^18.19.0 || >=20.16.0"