@langchain/langgraph-api 0.0.15 → 0.0.16
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/dist/cli/spawn.mjs +1 -0
- package/dist/graph/load.hooks.mjs +7 -0
- package/dist/server.mjs +0 -4
- package/dist/stream.mjs +1 -0
- package/dist/ui/load.mjs +2 -2
- package/package.json +1 -1
package/dist/cli/spawn.mjs
CHANGED
|
@@ -12,6 +12,13 @@ export async function initialize(args) {
|
|
|
12
12
|
parentURL = args.parentURL;
|
|
13
13
|
}
|
|
14
14
|
export async function resolve(specifier, context, nextResolve) {
|
|
15
|
+
// HACK: @tailwindcss/node internally uses an ESM loader cache, which does not play nicely with `tsx`.
|
|
16
|
+
// Node.js crashes with "TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file".
|
|
17
|
+
// As it already is a valid URI, we can just short-circuit the resolution and avoid `tsx`.
|
|
18
|
+
if (specifier.includes("@tailwindcss/node/dist/esm-cache.loader.mjs") &&
|
|
19
|
+
specifier.startsWith("file://")) {
|
|
20
|
+
return { shortCircuit: true, url: specifier, format: "module" };
|
|
21
|
+
}
|
|
15
22
|
if (OVERRIDE_RESOLVE.some((regex) => regex.test(specifier))) {
|
|
16
23
|
return await nextResolve(specifier, { ...context, parentURL });
|
|
17
24
|
}
|
package/dist/server.mjs
CHANGED
|
@@ -65,10 +65,6 @@ export async function startServer(options) {
|
|
|
65
65
|
logger.info(`Registering graphs from ${options.cwd}`);
|
|
66
66
|
await registerFromEnv(options.graphs, { cwd: options.cwd });
|
|
67
67
|
if (options.ui) {
|
|
68
|
-
if (process.versions.node.startsWith("18")) {
|
|
69
|
-
// Not supported due to weird interop issues with `@tailwindcss/postcss` and `tsx`
|
|
70
|
-
throw new Error("Built-in UI is not supported in Node.js 18.x. Please upgrade to Node.js 20.16 or later.");
|
|
71
|
-
}
|
|
72
68
|
logger.info(`Loading UI`);
|
|
73
69
|
const { api, registerGraphUi } = await import("./ui/load.mjs");
|
|
74
70
|
app.route("/", api);
|
package/dist/stream.mjs
CHANGED
|
@@ -95,6 +95,7 @@ export async function* streamState(run, attempt = 1, options) {
|
|
|
95
95
|
langgraph_version: "0.2.35",
|
|
96
96
|
langgraph_plan: "developer",
|
|
97
97
|
langgraph_host: "self-hosted",
|
|
98
|
+
langgraph_api_url: process.env.LANGGRAPH_API_URL ?? undefined,
|
|
98
99
|
};
|
|
99
100
|
const events = graph.streamEvents(kwargs.command != null
|
|
100
101
|
? getLangGraphCommand(kwargs.command)
|
package/dist/ui/load.mjs
CHANGED
|
@@ -26,11 +26,11 @@ api.post("/ui/:agent", zValidator("json", z.object({ name: z.string() })), async
|
|
|
26
26
|
const messageName = JSON.stringify(message.name);
|
|
27
27
|
const result = [];
|
|
28
28
|
for (const css of files.filter((i) => path.extname(i.basename) === ".css")) {
|
|
29
|
-
result.push(`<link rel="stylesheet" href="
|
|
29
|
+
result.push(`<link rel="stylesheet" href="http://${host}/ui/${agent}/${css.basename}" />`);
|
|
30
30
|
}
|
|
31
31
|
const js = files.find((i) => path.extname(i.basename) === ".js");
|
|
32
32
|
if (js) {
|
|
33
|
-
result.push(`<script src="
|
|
33
|
+
result.push(`<script src="http://${host}/ui/${agent}/${js.basename}" onload='__LGUI_${agent}.render(${messageName}, "{{shadowRootId}}")'></script>`);
|
|
34
34
|
}
|
|
35
35
|
return c.text(result.join("\n"), {
|
|
36
36
|
headers: { "Content-Type": "text/html" },
|