langgraph-api 0.1.16__py3-none-any.whl → 0.1.18__py3-none-any.whl
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.
Potentially problematic release.
This version of langgraph-api might be problematic. Click here for more details.
- langgraph_api/__init__.py +1 -1
- langgraph_api/api/ui.py +2 -2
- langgraph_api/config.py +6 -0
- langgraph_api/graph.py +1 -1
- langgraph_api/js/build.mts +28 -5
- langgraph_api/js/package.json +2 -2
- langgraph_api/js/remote.py +16 -3
- langgraph_api/js/src/graph.mts +0 -3
- langgraph_api/js/src/load.hooks.mjs +61 -0
- langgraph_api/js/src/parser/parser.mts +77 -51
- langgraph_api/js/src/preload.mjs +21 -0
- langgraph_api/js/tests/api.test.mts +6 -3
- langgraph_api/js/tests/graphs/package.json +1 -1
- langgraph_api/js/tests/graphs/yarn.lock +9 -9
- langgraph_api/js/tsconfig.json +15 -0
- langgraph_api/js/yarn.lock +15 -9
- langgraph_api/models/run.py +78 -22
- langgraph_api/thread_ttl.py +1 -1
- {langgraph_api-0.1.16.dist-info → langgraph_api-0.1.18.dist-info}/METADATA +8 -8
- {langgraph_api-0.1.16.dist-info → langgraph_api-0.1.18.dist-info}/RECORD +25 -23
- langgraph_api/js/src/hooks.mjs +0 -17
- /langgraph_api/js/src/{schema → parser/schema}/types.mts +0 -0
- /langgraph_api/js/src/{schema → parser/schema}/types.template.mts +0 -0
- {langgraph_api-0.1.16.dist-info → langgraph_api-0.1.18.dist-info}/LICENSE +0 -0
- {langgraph_api-0.1.16.dist-info → langgraph_api-0.1.18.dist-info}/WHEEL +0 -0
- {langgraph_api-0.1.16.dist-info → langgraph_api-0.1.18.dist-info}/entry_points.txt +0 -0
langgraph_api/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.18"
|
langgraph_api/api/ui.py
CHANGED
|
@@ -60,8 +60,8 @@ async def handle_ui(request: ApiRequest) -> Response:
|
|
|
60
60
|
elif ext == ".js":
|
|
61
61
|
result.append(
|
|
62
62
|
f'<script src="//{host}/ui/{graph_id}/{basename}" '
|
|
63
|
-
f
|
|
64
|
-
|
|
63
|
+
f"onload='__LGUI_{graph_id}.render({json.dumps(message['name'])}, \"{{{{shadowRootId}}}}\")'>"
|
|
64
|
+
"</script>"
|
|
65
65
|
)
|
|
66
66
|
|
|
67
67
|
return Response(content="\n".join(result), headers={"Content-Type": "text/html"})
|
langgraph_api/config.py
CHANGED
|
@@ -18,6 +18,11 @@ class CorsConfig(TypedDict, total=False):
|
|
|
18
18
|
max_age: int
|
|
19
19
|
|
|
20
20
|
|
|
21
|
+
class ConfigurableHeaders(TypedDict):
|
|
22
|
+
includes: list[str] | None
|
|
23
|
+
excludes: list[str] | None
|
|
24
|
+
|
|
25
|
+
|
|
21
26
|
class HttpConfig(TypedDict, total=False):
|
|
22
27
|
app: str
|
|
23
28
|
"""Import path for a custom Starlette/FastAPI app to mount"""
|
|
@@ -39,6 +44,7 @@ class HttpConfig(TypedDict, total=False):
|
|
|
39
44
|
"""Disable /mcp routes"""
|
|
40
45
|
mount_prefix: str
|
|
41
46
|
"""Prefix for mounted routes. E.g., "/my-deployment/api"."""
|
|
47
|
+
configurable_headers: ConfigurableHeaders | None
|
|
42
48
|
|
|
43
49
|
|
|
44
50
|
class ThreadTTLConfig(TypedDict, total=False):
|
langgraph_api/graph.py
CHANGED
|
@@ -487,7 +487,7 @@ def _graph_from_spec(spec: GraphSpec) -> GraphValue:
|
|
|
487
487
|
return graph
|
|
488
488
|
|
|
489
489
|
|
|
490
|
-
@functools.lru_cache
|
|
490
|
+
@functools.lru_cache(maxsize=1)
|
|
491
491
|
def _get_init_embeddings() -> Callable[[str, ...], "Embeddings"] | None:
|
|
492
492
|
try:
|
|
493
493
|
from langchain.embeddings import init_embeddings
|
langgraph_api/js/build.mts
CHANGED
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
/// <reference types="./global.d.ts" />
|
|
2
|
+
import "./src/preload.mjs";
|
|
2
3
|
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import * as fs from "node:fs/promises";
|
|
5
6
|
import * as path from "node:path";
|
|
6
7
|
import {
|
|
7
|
-
GraphSchema,
|
|
8
|
+
type GraphSchema,
|
|
8
9
|
resolveGraph,
|
|
9
10
|
runGraphSchemaWorker,
|
|
10
11
|
} from "./src/graph.mts";
|
|
11
12
|
import { build } from "@langchain/langgraph-ui";
|
|
13
|
+
import { checkLangGraphSemver } from "@langchain/langgraph-api/semver";
|
|
12
14
|
import { filterValidExportPath } from "./src/utils/files.mts";
|
|
13
15
|
|
|
14
16
|
const __dirname = new URL(".", import.meta.url).pathname;
|
|
15
17
|
|
|
16
18
|
async function main() {
|
|
17
19
|
const specs = Object.entries(
|
|
18
|
-
z.record(z.string()).parse(JSON.parse(process.env.LANGSERVE_GRAPHS))
|
|
20
|
+
z.record(z.string()).parse(JSON.parse(process.env.LANGSERVE_GRAPHS)),
|
|
19
21
|
).filter(([_, spec]) => filterValidExportPath(spec));
|
|
20
22
|
|
|
21
23
|
const GRAPH_SCHEMAS: Record<string, Record<string, GraphSchema> | false> = {};
|
|
22
|
-
let failed = false;
|
|
23
24
|
|
|
25
|
+
const semver = await checkLangGraphSemver();
|
|
26
|
+
const invalidPackages = semver.filter(
|
|
27
|
+
(s) => !s.satisfies && s.version !== "0.0.0",
|
|
28
|
+
);
|
|
29
|
+
if (invalidPackages.length > 0) {
|
|
30
|
+
console.error(
|
|
31
|
+
`Some LangGraph.js dependencies required by the LangGraph API server are not up to date. \n` +
|
|
32
|
+
`Please make sure to upgrade them to the required version:\n` +
|
|
33
|
+
invalidPackages
|
|
34
|
+
.map(
|
|
35
|
+
(i) =>
|
|
36
|
+
`- ${i.name}@${i.version} is not up to date. Required: ${i.required}`,
|
|
37
|
+
)
|
|
38
|
+
.join("\n") +
|
|
39
|
+
"\n" +
|
|
40
|
+
"Visit https://langchain-ai.github.io/langgraphjs/cloud/deployment/setup_javascript/ for more information.",
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let failed = false;
|
|
24
47
|
try {
|
|
25
48
|
await Promise.all(
|
|
26
49
|
specs.map(async ([graphId, rawSpec]) => {
|
|
@@ -38,13 +61,13 @@ async function main() {
|
|
|
38
61
|
console.error(`[${graphId}]: Error extracting schema: ${error}`);
|
|
39
62
|
GRAPH_SCHEMAS[graphId] = false;
|
|
40
63
|
}
|
|
41
|
-
})
|
|
64
|
+
}),
|
|
42
65
|
);
|
|
43
66
|
|
|
44
67
|
await fs.writeFile(
|
|
45
68
|
path.resolve(__dirname, "client.schemas.json"),
|
|
46
69
|
JSON.stringify(GRAPH_SCHEMAS),
|
|
47
|
-
{ encoding: "utf-8" }
|
|
70
|
+
{ encoding: "utf-8" },
|
|
48
71
|
);
|
|
49
72
|
} catch (error) {
|
|
50
73
|
console.error(`Error resolving graphs: ${error}`);
|
langgraph_api/js/package.json
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"undici": "^6.21.1",
|
|
25
25
|
"uuid": "^10.0.0",
|
|
26
26
|
"winston": "^3.17.0",
|
|
27
|
-
"@langchain/langgraph-api": "~0.0.
|
|
28
|
-
"@langchain/langgraph-ui": "~0.0.
|
|
27
|
+
"@langchain/langgraph-api": "~0.0.29",
|
|
28
|
+
"@langchain/langgraph-ui": "~0.0.29",
|
|
29
29
|
"zod": "^3.23.8"
|
|
30
30
|
},
|
|
31
31
|
"resolutions": {
|
langgraph_api/js/remote.py
CHANGED
|
@@ -350,9 +350,22 @@ async def run_js_process(paths_str: str, watch: bool = False):
|
|
|
350
350
|
attempt = 0
|
|
351
351
|
while not asyncio.current_task().cancelled():
|
|
352
352
|
client_file = os.path.join(os.path.dirname(__file__), "client.mts")
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
353
|
+
client_preload_file = os.path.join(
|
|
354
|
+
os.path.dirname(__file__), "src", "preload.mjs"
|
|
355
|
+
)
|
|
356
|
+
|
|
357
|
+
args = (
|
|
358
|
+
(
|
|
359
|
+
"tsx",
|
|
360
|
+
"watch",
|
|
361
|
+
"--import",
|
|
362
|
+
client_preload_file,
|
|
363
|
+
client_file,
|
|
364
|
+
"--skip-schema-cache",
|
|
365
|
+
)
|
|
366
|
+
if watch
|
|
367
|
+
else ("tsx", "--import", client_preload_file, client_file)
|
|
368
|
+
)
|
|
356
369
|
try:
|
|
357
370
|
process = await asyncio.create_subprocess_exec(
|
|
358
371
|
*args,
|
langgraph_api/js/src/graph.mts
CHANGED
|
@@ -5,9 +5,6 @@ import type { CompiledGraph, Graph } from "@langchain/langgraph";
|
|
|
5
5
|
import * as path from "node:path";
|
|
6
6
|
import type { JSONSchema7 } from "json-schema";
|
|
7
7
|
|
|
8
|
-
// enforce API @langchain/langgraph precedence
|
|
9
|
-
register("./hooks.mjs", import.meta.url);
|
|
10
|
-
|
|
11
8
|
export interface GraphSchema {
|
|
12
9
|
state: JSONSchema7 | undefined;
|
|
13
10
|
input: JSONSchema7 | undefined;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// This module hook is used to ensure that @langchain/langgraph package
|
|
2
|
+
// is imported from a consistent location.
|
|
3
|
+
// Accepts `{ parentURL: string }` as argument when registering the hook.
|
|
4
|
+
const OVERRIDE_RESOLVE = [
|
|
5
|
+
// Override `@langchain/langgraph` or `@langchain/langgraph/prebuilt`,
|
|
6
|
+
// but not `@langchain/langgraph-sdk`
|
|
7
|
+
new RegExp(`^@langchain\/langgraph(\/.+)?$`),
|
|
8
|
+
new RegExp(`^@langchain\/langgraph-checkpoint(\/.+)?$`),
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
let parentURL;
|
|
12
|
+
let langgraphPackageURL;
|
|
13
|
+
|
|
14
|
+
export async function initialize(args) {
|
|
15
|
+
parentURL = args.parentURL;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function resolve(specifier, context, nextResolve) {
|
|
19
|
+
// HACK: @tailwindcss/node internally uses an ESM loader cache, which does not play nicely with `tsx`.
|
|
20
|
+
// Node.js crashes with "TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file".
|
|
21
|
+
// As it already is a valid URI, we can just short-circuit the resolution and avoid `tsx`.
|
|
22
|
+
if (
|
|
23
|
+
specifier.includes("@tailwindcss/node/dist/esm-cache.loader") &&
|
|
24
|
+
specifier.startsWith("file://")
|
|
25
|
+
) {
|
|
26
|
+
return {
|
|
27
|
+
shortCircuit: true,
|
|
28
|
+
// Node 18.x will for some reason attempt to load `.mts` instead of `.mjs`
|
|
29
|
+
url: specifier.replace(".mts", ".mjs"),
|
|
30
|
+
format: "module",
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (specifier === "@langchain/langgraph-checkpoint") {
|
|
35
|
+
// resolve relative to @langchain/langgraph package instead
|
|
36
|
+
// This is done to avoid adding a direct dependency on @langchain/langgraph-checkpoint
|
|
37
|
+
// in project, which if not present will cause `pnpm` to not find the package.
|
|
38
|
+
if (!langgraphPackageURL) {
|
|
39
|
+
const main = await nextResolve("@langchain/langgraph", {
|
|
40
|
+
...context,
|
|
41
|
+
parentURL,
|
|
42
|
+
});
|
|
43
|
+
langgraphPackageURL = main.url.toString();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return await nextResolve(specifier, {
|
|
47
|
+
...context,
|
|
48
|
+
parentURL: langgraphPackageURL,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (OVERRIDE_RESOLVE.some((regex) => regex.test(specifier))) {
|
|
53
|
+
const resolved = await nextResolve(specifier, { ...context, parentURL });
|
|
54
|
+
|
|
55
|
+
// If @langchain/langgraph is resolved first, cache it!
|
|
56
|
+
if (specifier === "@langchain/langgraph" && !langgraphPackageURL) {
|
|
57
|
+
langgraphPackageURL = resolved.url.toString();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return nextResolve(specifier, context);
|
|
61
|
+
}
|
|
@@ -2,9 +2,17 @@ import * as ts from "typescript";
|
|
|
2
2
|
import * as vfs from "@typescript/vfs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import dedent from "dedent";
|
|
5
|
-
import { buildGenerator } from "
|
|
5
|
+
import { buildGenerator } from "./schema/types.mjs";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
6
7
|
|
|
7
|
-
const __dirname = new URL(".", import.meta.url)
|
|
8
|
+
const __dirname = fileURLToPath(new URL(".", import.meta.url));
|
|
9
|
+
|
|
10
|
+
const OVERRIDE_RESOLVE = [
|
|
11
|
+
// Override `@langchain/langgraph` or `@langchain/langgraph/prebuilt`,
|
|
12
|
+
// but not `@langchain/langgraph-sdk`
|
|
13
|
+
new RegExp(`^@langchain\/langgraph(\/.+)?$`),
|
|
14
|
+
new RegExp(`^@langchain\/langgraph-checkpoint(\/.+)?$`),
|
|
15
|
+
];
|
|
8
16
|
|
|
9
17
|
const compilerOptions = {
|
|
10
18
|
noEmit: true,
|
|
@@ -27,7 +35,7 @@ export class SubgraphExtractor {
|
|
|
27
35
|
program: ts.Program,
|
|
28
36
|
sourceFile: ts.SourceFile,
|
|
29
37
|
inferFile: ts.SourceFile,
|
|
30
|
-
options?: { strict?: boolean }
|
|
38
|
+
options?: { strict?: boolean },
|
|
31
39
|
) {
|
|
32
40
|
this.program = program;
|
|
33
41
|
this.sourceFile = sourceFile;
|
|
@@ -64,7 +72,7 @@ export class SubgraphExtractor {
|
|
|
64
72
|
|
|
65
73
|
private find = (
|
|
66
74
|
root: ts.Node,
|
|
67
|
-
predicate: (node: ts.Node) => boolean
|
|
75
|
+
predicate: (node: ts.Node) => boolean,
|
|
68
76
|
): ts.Node | undefined => {
|
|
69
77
|
let result: ts.Node | undefined = undefined;
|
|
70
78
|
|
|
@@ -83,7 +91,7 @@ export class SubgraphExtractor {
|
|
|
83
91
|
|
|
84
92
|
protected findSubgraphs = (
|
|
85
93
|
node: ts.Node,
|
|
86
|
-
namespace: string[] = []
|
|
94
|
+
namespace: string[] = [],
|
|
87
95
|
): {
|
|
88
96
|
node: string;
|
|
89
97
|
namespace: string[];
|
|
@@ -95,7 +103,7 @@ export class SubgraphExtractor {
|
|
|
95
103
|
namespace: string[];
|
|
96
104
|
subgraph: { name: string; node: ts.Node };
|
|
97
105
|
}[],
|
|
98
|
-
node: ts.Node
|
|
106
|
+
node: ts.Node,
|
|
99
107
|
) => {
|
|
100
108
|
if (ts.isCallExpression(node)) {
|
|
101
109
|
const firstChild = node.getChildAt(0);
|
|
@@ -127,7 +135,7 @@ export class SubgraphExtractor {
|
|
|
127
135
|
variables = this.reduceChildren(
|
|
128
136
|
callArg,
|
|
129
137
|
this.findSubgraphIdentifiers,
|
|
130
|
-
[]
|
|
138
|
+
[],
|
|
131
139
|
);
|
|
132
140
|
} else if (ts.isIdentifier(callArg)) {
|
|
133
141
|
variables = this.findSubgraphIdentifiers([], callArg);
|
|
@@ -165,13 +173,13 @@ export class SubgraphExtractor {
|
|
|
165
173
|
type InternalFlowNode = ts.Node & { flowNode?: { node: ts.Node } };
|
|
166
174
|
const candidate = this.find(
|
|
167
175
|
node,
|
|
168
|
-
(node: any) => node && "flowNode" in node && node.flowNode
|
|
176
|
+
(node: any) => node && "flowNode" in node && node.flowNode,
|
|
169
177
|
) as InternalFlowNode | undefined;
|
|
170
178
|
|
|
171
179
|
if (
|
|
172
180
|
candidate?.flowNode &&
|
|
173
181
|
this.isGraphOrPregelType(
|
|
174
|
-
this.checker.getTypeAtLocation(candidate.flowNode.node)
|
|
182
|
+
this.checker.getTypeAtLocation(candidate.flowNode.node),
|
|
175
183
|
)
|
|
176
184
|
) {
|
|
177
185
|
subgraphs = this.findSubgraphs(candidate.flowNode.node, namespace);
|
|
@@ -183,7 +191,7 @@ export class SubgraphExtractor {
|
|
|
183
191
|
return [
|
|
184
192
|
...subgraphs,
|
|
185
193
|
...subgraphs.map(({ subgraph, node }) =>
|
|
186
|
-
this.findSubgraphs(subgraph.node, [...namespace, node])
|
|
194
|
+
this.findSubgraphs(subgraph.node, [...namespace, node]),
|
|
187
195
|
),
|
|
188
196
|
].flat();
|
|
189
197
|
}
|
|
@@ -198,7 +206,7 @@ export class SubgraphExtractor {
|
|
|
198
206
|
const targetExport = exports.find((item) => item.name === name);
|
|
199
207
|
if (!targetExport) throw new Error(`Failed to find export "${name}"`);
|
|
200
208
|
const varDecls = (targetExport.declarations ?? []).filter(
|
|
201
|
-
ts.isVariableDeclaration
|
|
209
|
+
ts.isVariableDeclaration,
|
|
202
210
|
);
|
|
203
211
|
|
|
204
212
|
return varDecls.flatMap((varDecl) => {
|
|
@@ -208,7 +216,7 @@ export class SubgraphExtractor {
|
|
|
208
216
|
};
|
|
209
217
|
|
|
210
218
|
public getAugmentedSourceFile = (
|
|
211
|
-
name: string
|
|
219
|
+
name: string,
|
|
212
220
|
): {
|
|
213
221
|
files: [filePath: string, contents: string][];
|
|
214
222
|
exports: { typeName: string; valueName: string; graphName: string }[];
|
|
@@ -237,7 +245,7 @@ export class SubgraphExtractor {
|
|
|
237
245
|
this.getText(this.sourceFile),
|
|
238
246
|
...typeExports.map(
|
|
239
247
|
({ typeName, valueName }) =>
|
|
240
|
-
`export type ${typeName} = typeof ${valueName}
|
|
248
|
+
`export type ${typeName} = typeof ${valueName}`,
|
|
241
249
|
),
|
|
242
250
|
].join("\n\n");
|
|
243
251
|
|
|
@@ -245,7 +253,7 @@ export class SubgraphExtractor {
|
|
|
245
253
|
const inferContents = [
|
|
246
254
|
...typeExports.map(
|
|
247
255
|
({ typeName }) =>
|
|
248
|
-
`import type { ${typeName}} from "./__langgraph__source.mts"
|
|
256
|
+
`import type { ${typeName}} from "./__langgraph__source.mts"`,
|
|
249
257
|
),
|
|
250
258
|
this.inferFile.getText(this.inferFile),
|
|
251
259
|
|
|
@@ -276,7 +284,7 @@ export class SubgraphExtractor {
|
|
|
276
284
|
|
|
277
285
|
protected findSubgraphIdentifiers = (
|
|
278
286
|
acc: { node: ts.Node; name: string }[],
|
|
279
|
-
node: ts.Node
|
|
287
|
+
node: ts.Node,
|
|
280
288
|
) => {
|
|
281
289
|
if (ts.isIdentifier(node)) {
|
|
282
290
|
const smb = this.checker.getSymbolAtLocation(node);
|
|
@@ -321,11 +329,12 @@ export class SubgraphExtractor {
|
|
|
321
329
|
protected reduceChildren<Acc>(
|
|
322
330
|
node: ts.Node,
|
|
323
331
|
fn: (acc: Acc, node: ts.Node) => Acc,
|
|
324
|
-
initial: Acc
|
|
332
|
+
initial: Acc,
|
|
325
333
|
): Acc {
|
|
326
334
|
let acc = initial;
|
|
327
335
|
function it(node: ts.Node) {
|
|
328
336
|
acc = fn(acc, node);
|
|
337
|
+
// @ts-expect-error
|
|
329
338
|
ts.forEachChild(node, it.bind(this));
|
|
330
339
|
}
|
|
331
340
|
|
|
@@ -341,19 +350,27 @@ export class SubgraphExtractor {
|
|
|
341
350
|
files?: [fileName: string, contents: string][];
|
|
342
351
|
},
|
|
343
352
|
name: string,
|
|
344
|
-
options?: { strict?: boolean }
|
|
353
|
+
options?: { strict?: boolean },
|
|
345
354
|
) {
|
|
346
355
|
const dirname =
|
|
347
356
|
typeof target === "string" ? path.dirname(target) : __dirname;
|
|
348
357
|
|
|
358
|
+
// This API is not well made for Windows, ensure that the paths are UNIX slashes
|
|
349
359
|
const fsMap = new Map<string, string>();
|
|
350
360
|
const system = vfs.createFSBackedSystem(fsMap, dirname, ts);
|
|
351
361
|
|
|
352
362
|
// TODO: investigate if we should create a PR in @typescript/vfs
|
|
353
363
|
const oldReadFile = system.readFile.bind(system);
|
|
354
|
-
system.readFile = (fileName) =>
|
|
364
|
+
system.readFile = (fileName) =>
|
|
365
|
+
oldReadFile(fileName) ?? "// Non-existent file";
|
|
366
|
+
|
|
367
|
+
const vfsPath = (inputPath: string) => {
|
|
368
|
+
if (process.platform === "win32") return inputPath.replace(/\\/g, "/");
|
|
369
|
+
return inputPath;
|
|
370
|
+
};
|
|
355
371
|
|
|
356
|
-
const
|
|
372
|
+
const vfsHost = vfs.createVirtualCompilerHost(system, compilerOptions, ts);
|
|
373
|
+
const host = vfsHost.compilerHost;
|
|
357
374
|
|
|
358
375
|
const targetPath =
|
|
359
376
|
typeof target === "string"
|
|
@@ -362,65 +379,71 @@ export class SubgraphExtractor {
|
|
|
362
379
|
|
|
363
380
|
const inferTemplatePath = path.resolve(
|
|
364
381
|
__dirname,
|
|
365
|
-
"
|
|
382
|
+
"./schema/types.template.mts",
|
|
366
383
|
);
|
|
367
384
|
|
|
368
385
|
if (typeof target !== "string") {
|
|
369
|
-
fsMap.set(targetPath, target.contents);
|
|
386
|
+
fsMap.set(vfsPath(targetPath), target.contents);
|
|
370
387
|
for (const [name, contents] of target.files ?? []) {
|
|
371
|
-
fsMap.set(path.resolve(dirname, name), contents);
|
|
388
|
+
fsMap.set(vfsPath(path.resolve(dirname, name)), contents);
|
|
372
389
|
}
|
|
373
390
|
}
|
|
374
391
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
392
|
+
const moduleCache = ts.createModuleResolutionCache(dirname, (x) => x);
|
|
393
|
+
host.resolveModuleNameLiterals = (
|
|
394
|
+
entries,
|
|
395
|
+
containingFile,
|
|
396
|
+
redirectedReference,
|
|
397
|
+
options,
|
|
398
|
+
) =>
|
|
399
|
+
entries.flatMap((entry) => {
|
|
400
|
+
const specifier = entry.text;
|
|
401
|
+
|
|
402
|
+
// Force module resolution to use @langchain/langgraph from the local project
|
|
403
|
+
// rather than from API/CLI.
|
|
404
|
+
let targetFile = containingFile;
|
|
405
|
+
if (OVERRIDE_RESOLVE.some((regex) => regex.test(specifier))) {
|
|
406
|
+
// check if we're not already importing from node_modules
|
|
407
|
+
if (!containingFile.split(path.sep).includes("node_modules")) {
|
|
408
|
+
// Doesn't matter if the file exists, only used to nudge `ts.resolveModuleName`
|
|
409
|
+
targetFile = path.resolve(dirname, "__langgraph__resolve.mts");
|
|
410
|
+
}
|
|
387
411
|
}
|
|
388
412
|
|
|
389
|
-
|
|
413
|
+
return [
|
|
390
414
|
ts.resolveModuleName(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
host
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
};
|
|
415
|
+
specifier,
|
|
416
|
+
targetFile,
|
|
417
|
+
options,
|
|
418
|
+
host,
|
|
419
|
+
moduleCache,
|
|
420
|
+
redirectedReference,
|
|
421
|
+
),
|
|
422
|
+
];
|
|
423
|
+
});
|
|
401
424
|
|
|
402
425
|
const research = ts.createProgram({
|
|
403
426
|
rootNames: [inferTemplatePath, targetPath],
|
|
404
427
|
options: compilerOptions,
|
|
405
|
-
host
|
|
428
|
+
host,
|
|
406
429
|
});
|
|
407
430
|
|
|
408
431
|
const extractor = new SubgraphExtractor(
|
|
409
432
|
research,
|
|
410
433
|
research.getSourceFile(targetPath)!,
|
|
411
434
|
research.getSourceFile(inferTemplatePath)!,
|
|
412
|
-
options
|
|
435
|
+
options,
|
|
413
436
|
);
|
|
414
437
|
|
|
415
438
|
const { files, exports } = extractor.getAugmentedSourceFile(name);
|
|
416
439
|
for (const [name, source] of files) {
|
|
417
|
-
system.writeFile(path.resolve(dirname, name), source);
|
|
440
|
+
system.writeFile(vfsPath(path.resolve(dirname, name)), source);
|
|
418
441
|
}
|
|
419
442
|
|
|
420
443
|
const extract = ts.createProgram({
|
|
421
444
|
rootNames: [path.resolve(dirname, "./__langraph__infer.mts")],
|
|
422
445
|
options: compilerOptions,
|
|
423
|
-
host
|
|
446
|
+
host,
|
|
424
447
|
});
|
|
425
448
|
|
|
426
449
|
const schemaGenerator = buildGenerator(extract);
|
|
@@ -428,7 +451,10 @@ export class SubgraphExtractor {
|
|
|
428
451
|
try {
|
|
429
452
|
return schema?.getSchemaForSymbol(symbol) ?? undefined;
|
|
430
453
|
} catch (e) {
|
|
431
|
-
console.warn(
|
|
454
|
+
console.warn(
|
|
455
|
+
`Failed to obtain symbol "${symbol}":`,
|
|
456
|
+
(e as Error)?.message,
|
|
457
|
+
);
|
|
432
458
|
}
|
|
433
459
|
return undefined;
|
|
434
460
|
};
|
|
@@ -442,7 +468,7 @@ export class SubgraphExtractor {
|
|
|
442
468
|
state: trySymbol(schemaGenerator, `${typeName}__update`),
|
|
443
469
|
config: trySymbol(schemaGenerator, `${typeName}__config`),
|
|
444
470
|
},
|
|
445
|
-
])
|
|
471
|
+
]),
|
|
446
472
|
);
|
|
447
473
|
}
|
|
448
474
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { register } from "node:module";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
// we only care about the payload, which contains the server definition
|
|
6
|
+
const graphs = JSON.parse(process.env.LANGSERVE_GRAPHS || "{}");
|
|
7
|
+
const cwd = process.cwd();
|
|
8
|
+
|
|
9
|
+
// find the first file, as `parentURL` needs to be a valid file URL
|
|
10
|
+
// if no graph found, just assume a dummy default file, which should
|
|
11
|
+
// be working fine as well.
|
|
12
|
+
const firstGraphFile =
|
|
13
|
+
Object.values(graphs)
|
|
14
|
+
.flatMap((i) => i.split(":").at(0))
|
|
15
|
+
.at(0) || "index.mts";
|
|
16
|
+
|
|
17
|
+
// enforce API @langchain/langgraph resolution
|
|
18
|
+
register("./load.hooks.mjs", import.meta.url, {
|
|
19
|
+
parentURL: "data:",
|
|
20
|
+
data: { parentURL: pathToFileURL(join(cwd, firstGraphFile)).toString() },
|
|
21
|
+
});
|
|
@@ -488,7 +488,7 @@ describe("runs", () => {
|
|
|
488
488
|
expect(runs.length).toBe(1);
|
|
489
489
|
});
|
|
490
490
|
|
|
491
|
-
it.concurrent("stream values", async () => {
|
|
491
|
+
it.concurrent("stream values", { retry: 3 }, async () => {
|
|
492
492
|
const assistant = await client.assistants.create({ graphId: "agent" });
|
|
493
493
|
const thread = await client.threads.create();
|
|
494
494
|
const input = {
|
|
@@ -1991,8 +1991,11 @@ it("dynamic graph", async () => {
|
|
|
1991
1991
|
|
|
1992
1992
|
it("generative ui", async () => {
|
|
1993
1993
|
const ui = await client["~ui"].getComponent("agent", "weather-component");
|
|
1994
|
-
expect(ui).
|
|
1995
|
-
`<
|
|
1994
|
+
expect(ui).toContain(
|
|
1995
|
+
`<link rel="stylesheet" href="//localhost:9123/ui/agent/entrypoint.css" />`,
|
|
1996
|
+
);
|
|
1997
|
+
expect(ui).toContain(
|
|
1998
|
+
`<script src="//localhost:9123/ui/agent/entrypoint.js" onload='__LGUI_agent.render("weather-component", "{{shadowRootId}}")'></script>`,
|
|
1996
1999
|
);
|
|
1997
2000
|
|
|
1998
2001
|
const match = /src="(?<src>[^"]+)"/.exec(ui);
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
zod "^3.22.4"
|
|
26
26
|
zod-to-json-schema "^3.22.3"
|
|
27
27
|
|
|
28
|
-
"@langchain/langgraph-checkpoint@~0.0.
|
|
29
|
-
version "0.0.
|
|
30
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph-checkpoint/-/langgraph-checkpoint-0.0.
|
|
31
|
-
integrity sha512-
|
|
28
|
+
"@langchain/langgraph-checkpoint@~0.0.17":
|
|
29
|
+
version "0.0.17"
|
|
30
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph-checkpoint/-/langgraph-checkpoint-0.0.17.tgz#d0a8824eb0769567da54262adebe65db4ee6d58f"
|
|
31
|
+
integrity sha512-6b3CuVVYx+7x0uWLG+7YXz9j2iBa+tn2AXvkLxzEvaAsLE6Sij++8PPbS2BZzC+S/FPJdWsz6I5bsrqL0BYrCA==
|
|
32
32
|
dependencies:
|
|
33
33
|
uuid "^10.0.0"
|
|
34
34
|
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
p-retry "4"
|
|
43
43
|
uuid "^9.0.0"
|
|
44
44
|
|
|
45
|
-
"@langchain/langgraph
|
|
46
|
-
version "0.2.
|
|
47
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.2.
|
|
48
|
-
integrity sha512
|
|
45
|
+
"@langchain/langgraph@0.2.65":
|
|
46
|
+
version "0.2.65"
|
|
47
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph/-/langgraph-0.2.65.tgz#f080add1c26a3eb3744af2ef23b8b53eddbf5cb2"
|
|
48
|
+
integrity sha512-g/Xap2KSEaEBXMJXGZTh31fd0qrdfaWA1l8NJzweJg6AkvVSf+d6DmMk9DtzGW8W1H1qQ2I6FWZ3AdP61Kkaig==
|
|
49
49
|
dependencies:
|
|
50
|
-
"@langchain/langgraph-checkpoint" "~0.0.
|
|
50
|
+
"@langchain/langgraph-checkpoint" "~0.0.17"
|
|
51
51
|
"@langchain/langgraph-sdk" "~0.0.32"
|
|
52
52
|
uuid "^10.0.0"
|
|
53
53
|
zod "^3.23.8"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "NodeNext",
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"noEmit": true,
|
|
6
|
+
"strict": true,
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"noUnusedLocals": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": true
|
|
14
|
+
}
|
|
15
|
+
}
|
langgraph_api/js/yarn.lock
CHANGED
|
@@ -203,15 +203,15 @@
|
|
|
203
203
|
zod "^3.22.4"
|
|
204
204
|
zod-to-json-schema "^3.22.3"
|
|
205
205
|
|
|
206
|
-
"@langchain/langgraph-api@~0.0.
|
|
207
|
-
version "0.0.
|
|
208
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph-api/-/langgraph-api-0.0.
|
|
209
|
-
integrity sha512-
|
|
206
|
+
"@langchain/langgraph-api@~0.0.29":
|
|
207
|
+
version "0.0.29"
|
|
208
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph-api/-/langgraph-api-0.0.29.tgz#787e01675250720d293e3363ff579b601a9c94ab"
|
|
209
|
+
integrity sha512-WJVOWFJBEo7sCUtzchFRhFWT4+Zn3evKakmLGDJihMZ2nrNeoaordEUmbsXMLiQVOe3bP7Fpweq3mSPIwxQyyQ==
|
|
210
210
|
dependencies:
|
|
211
211
|
"@babel/code-frame" "^7.26.2"
|
|
212
212
|
"@hono/node-server" "^1.12.0"
|
|
213
213
|
"@hono/zod-validator" "^0.2.2"
|
|
214
|
-
"@langchain/langgraph-ui" "0.0.
|
|
214
|
+
"@langchain/langgraph-ui" "0.0.29"
|
|
215
215
|
"@types/json-schema" "^7.0.15"
|
|
216
216
|
"@typescript/vfs" "^1.6.0"
|
|
217
217
|
dedent "^1.5.3"
|
|
@@ -220,6 +220,7 @@
|
|
|
220
220
|
hono "^4.5.4"
|
|
221
221
|
langsmith "^0.2.15"
|
|
222
222
|
open "^10.1.0"
|
|
223
|
+
semver "^7.7.1"
|
|
223
224
|
stacktrace-parser "^0.1.10"
|
|
224
225
|
superjson "^2.2.2"
|
|
225
226
|
tsx "^4.19.3"
|
|
@@ -255,10 +256,10 @@
|
|
|
255
256
|
p-retry "4"
|
|
256
257
|
uuid "^9.0.0"
|
|
257
258
|
|
|
258
|
-
"@langchain/langgraph-ui@0.0.
|
|
259
|
-
version "0.0.
|
|
260
|
-
resolved "https://registry.yarnpkg.com/@langchain/langgraph-ui/-/langgraph-ui-0.0.
|
|
261
|
-
integrity sha512-
|
|
259
|
+
"@langchain/langgraph-ui@0.0.29", "@langchain/langgraph-ui@~0.0.29":
|
|
260
|
+
version "0.0.29"
|
|
261
|
+
resolved "https://registry.yarnpkg.com/@langchain/langgraph-ui/-/langgraph-ui-0.0.29.tgz#98659cc56f0e8e074a9a0b2e33e967dc5f30e79f"
|
|
262
|
+
integrity sha512-FADBt6B1/egKSpZFmTa6vxonBK9lF6EmeKoBEWh/XTkO6lD5zsejWoRgT+LR2x22CHJvfvCQtXxgP5y8AtxsQw==
|
|
262
263
|
dependencies:
|
|
263
264
|
"@commander-js/extra-typings" "^13.0.0"
|
|
264
265
|
commander "^13.0.0"
|
|
@@ -1440,6 +1441,11 @@ semver@^7.6.3:
|
|
|
1440
1441
|
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
|
|
1441
1442
|
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==
|
|
1442
1443
|
|
|
1444
|
+
semver@^7.7.1:
|
|
1445
|
+
version "7.7.1"
|
|
1446
|
+
resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f"
|
|
1447
|
+
integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==
|
|
1448
|
+
|
|
1443
1449
|
siginfo@^2.0.0:
|
|
1444
1450
|
version "2.0.0"
|
|
1445
1451
|
resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30"
|
langgraph_api/models/run.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
import functools
|
|
3
|
+
import re
|
|
2
4
|
import urllib.parse
|
|
3
5
|
import uuid
|
|
4
6
|
from collections.abc import Mapping, Sequence
|
|
@@ -159,6 +161,81 @@ LANGSMITH_TAGS = "langsmith-tags"
|
|
|
159
161
|
LANGSMITH_PROJECT = "langsmith-project"
|
|
160
162
|
|
|
161
163
|
|
|
164
|
+
def translate_pattern(pat: str) -> re.Pattern[str]:
|
|
165
|
+
"""Translate a pattern to regex, supporting only literals and * wildcards to avoid RE DoS."""
|
|
166
|
+
res = []
|
|
167
|
+
i = 0
|
|
168
|
+
n = len(pat)
|
|
169
|
+
|
|
170
|
+
while i < n:
|
|
171
|
+
c = pat[i]
|
|
172
|
+
i += 1
|
|
173
|
+
|
|
174
|
+
if c == "*":
|
|
175
|
+
res.append(".*")
|
|
176
|
+
else:
|
|
177
|
+
res.append(re.escape(c))
|
|
178
|
+
|
|
179
|
+
pattern = "".join(res)
|
|
180
|
+
return re.compile(rf"(?s:{pattern})\Z")
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
@functools.lru_cache(maxsize=1)
|
|
184
|
+
def get_header_patterns() -> tuple[
|
|
185
|
+
list[re.Pattern[str] | None], list[re.Pattern[str] | None]
|
|
186
|
+
]:
|
|
187
|
+
from langgraph_api import config
|
|
188
|
+
|
|
189
|
+
if not config.HTTP_CONFIG:
|
|
190
|
+
return None, None
|
|
191
|
+
configurable = config.HTTP_CONFIG.get("configurable_headers")
|
|
192
|
+
if not configurable:
|
|
193
|
+
return None, None
|
|
194
|
+
header_includes = configurable.get("includes") or []
|
|
195
|
+
include_patterns = []
|
|
196
|
+
for include in header_includes:
|
|
197
|
+
include_patterns.append(translate_pattern(include))
|
|
198
|
+
header_excludes = configurable.get("excludes") or []
|
|
199
|
+
exclude_patterns = []
|
|
200
|
+
for exclude in header_excludes:
|
|
201
|
+
exclude_patterns.append(translate_pattern(exclude))
|
|
202
|
+
return include_patterns, exclude_patterns
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def get_configurable_headers(headers: dict[str, str]) -> dict[str, str]:
|
|
206
|
+
configurable = {}
|
|
207
|
+
include_patterns, exclude_patterns = get_header_patterns()
|
|
208
|
+
for key, value in headers.items():
|
|
209
|
+
if include_patterns and not any(
|
|
210
|
+
pattern.match(key) for pattern in include_patterns
|
|
211
|
+
):
|
|
212
|
+
continue
|
|
213
|
+
if exclude_patterns and any(pattern.match(key) for pattern in exclude_patterns):
|
|
214
|
+
continue
|
|
215
|
+
if key.startswith("x-"):
|
|
216
|
+
if key in (
|
|
217
|
+
"x-api-key",
|
|
218
|
+
"x-tenant-id",
|
|
219
|
+
"x-service-key",
|
|
220
|
+
):
|
|
221
|
+
continue
|
|
222
|
+
configurable[key] = value
|
|
223
|
+
elif key == "langsmith-trace":
|
|
224
|
+
configurable[key] = value
|
|
225
|
+
if baggage := headers.get("baggage"):
|
|
226
|
+
for item in baggage.split(","):
|
|
227
|
+
key, value = item.split("=")
|
|
228
|
+
if key == LANGSMITH_METADATA and key not in configurable:
|
|
229
|
+
configurable[key] = orjson.loads(urllib.parse.unquote(value))
|
|
230
|
+
elif key == LANGSMITH_TAGS:
|
|
231
|
+
configurable[key] = urllib.parse.unquote(value).split(",")
|
|
232
|
+
elif key == LANGSMITH_PROJECT:
|
|
233
|
+
configurable[key] = urllib.parse.unquote(value)
|
|
234
|
+
elif key == "user-agent":
|
|
235
|
+
configurable[key] = value
|
|
236
|
+
return configurable
|
|
237
|
+
|
|
238
|
+
|
|
162
239
|
async def create_valid_run(
|
|
163
240
|
conn: AsyncConnectionProto,
|
|
164
241
|
thread_id: str | None,
|
|
@@ -197,28 +274,7 @@ async def create_valid_run(
|
|
|
197
274
|
configurable["checkpoint_id"] = str(checkpoint_id)
|
|
198
275
|
if checkpoint := payload.get("checkpoint"):
|
|
199
276
|
configurable.update(checkpoint)
|
|
200
|
-
|
|
201
|
-
if key.startswith("x-"):
|
|
202
|
-
if key in (
|
|
203
|
-
"x-api-key",
|
|
204
|
-
"x-tenant-id",
|
|
205
|
-
"x-service-key",
|
|
206
|
-
):
|
|
207
|
-
continue
|
|
208
|
-
configurable[key] = value
|
|
209
|
-
elif key == "langsmith-trace":
|
|
210
|
-
configurable[key] = value
|
|
211
|
-
if baggage := headers.get("baggage"):
|
|
212
|
-
for item in baggage.split(","):
|
|
213
|
-
key, value = item.split("=")
|
|
214
|
-
if key == LANGSMITH_METADATA and key not in configurable:
|
|
215
|
-
configurable[key] = orjson.loads(urllib.parse.unquote(value))
|
|
216
|
-
elif key == LANGSMITH_TAGS:
|
|
217
|
-
configurable[key] = urllib.parse.unquote(value).split(",")
|
|
218
|
-
elif key == LANGSMITH_PROJECT:
|
|
219
|
-
configurable[key] = urllib.parse.unquote(value)
|
|
220
|
-
elif key == "user-agent":
|
|
221
|
-
configurable[key] = value
|
|
277
|
+
configurable.update(get_configurable_headers(headers))
|
|
222
278
|
ctx = get_auth_ctx()
|
|
223
279
|
if ctx:
|
|
224
280
|
user = ctx.user
|
langgraph_api/thread_ttl.py
CHANGED
|
@@ -21,7 +21,7 @@ async def thread_ttl_sweep_loop():
|
|
|
21
21
|
strategy = thread_ttl_config.get("strategy", "delete")
|
|
22
22
|
if strategy != "delete":
|
|
23
23
|
raise NotImplementedError(
|
|
24
|
-
f"Unrecognized thread deletion strategy: {strategy}.
|
|
24
|
+
f"Unrecognized thread deletion strategy: {strategy}. Expected 'delete'."
|
|
25
25
|
)
|
|
26
26
|
sweep_interval_minutes = thread_ttl_config.get("sweep_interval_minutes", 5)
|
|
27
27
|
await logger.ainfo(
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: langgraph-api
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.18
|
|
4
4
|
Summary:
|
|
5
5
|
License: Elastic-2.0
|
|
6
6
|
Author: Nuno Campos
|
|
7
7
|
Author-email: nuno@langchain.dev
|
|
8
|
-
Requires-Python: >=3.11
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
9
|
Classifier: License :: Other/Proprietary License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -15,12 +15,12 @@ Requires-Dist: cloudpickle (>=3.0.0,<4.0.0)
|
|
|
15
15
|
Requires-Dist: cryptography (>=42.0.0,<45.0)
|
|
16
16
|
Requires-Dist: httpx (>=0.25.0)
|
|
17
17
|
Requires-Dist: jsonschema-rs (>=0.20.0,<0.30)
|
|
18
|
-
Requires-Dist: langchain-core (>=0.2.38
|
|
19
|
-
Requires-Dist: langgraph (>=0.2.56
|
|
20
|
-
Requires-Dist: langgraph-checkpoint (>=2.0.23
|
|
21
|
-
Requires-Dist: langgraph-runtime-inmem (>=0.0.
|
|
22
|
-
Requires-Dist: langgraph-sdk (>=0.1.63,<0.2.0)
|
|
23
|
-
Requires-Dist: langsmith (>=0.1.63
|
|
18
|
+
Requires-Dist: langchain-core (>=0.2.38) ; python_version < "4.0"
|
|
19
|
+
Requires-Dist: langgraph (>=0.2.56) ; python_version < "4.0"
|
|
20
|
+
Requires-Dist: langgraph-checkpoint (>=2.0.23) ; python_version < "4.0"
|
|
21
|
+
Requires-Dist: langgraph-runtime-inmem (>=0.0.7)
|
|
22
|
+
Requires-Dist: langgraph-sdk (>=0.1.63,<0.2.0) ; python_version < "4.0"
|
|
23
|
+
Requires-Dist: langsmith (>=0.1.63)
|
|
24
24
|
Requires-Dist: orjson (>=3.9.7)
|
|
25
25
|
Requires-Dist: pyjwt (>=2.9.0,<3.0.0)
|
|
26
26
|
Requires-Dist: sse-starlette (>=2.1.0,<2.2.0)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
|
|
2
|
-
langgraph_api/__init__.py,sha256=
|
|
2
|
+
langgraph_api/__init__.py,sha256=6BiuMUkhwQp6bzUZSF8np8F1NwCltEtK0sPBF__tepU,23
|
|
3
3
|
langgraph_api/api/__init__.py,sha256=IKKMrC5gCHTzjprbg8jgZDrAJRuqJfSUgEkZAgh3l-M,5771
|
|
4
4
|
langgraph_api/api/assistants.py,sha256=6oYFRKlvqheJQGbWjFhQOUnnSbvsbrdMYLRJP7WtSRo,14481
|
|
5
5
|
langgraph_api/api/mcp.py,sha256=KbR19dtFCpJEiKYj3IfepAuJij8YZVELuVp7JY_yu_o,13754
|
|
@@ -8,7 +8,7 @@ langgraph_api/api/openapi.py,sha256=OGwzPpYO4e98iqtgL7UEfzI6jP4zXahJ1R-7VgOSZeg,
|
|
|
8
8
|
langgraph_api/api/runs.py,sha256=dhHZ3xu7V0anftqzXaOYnhVEryJpVeqzu60MFiUw4u8,18010
|
|
9
9
|
langgraph_api/api/store.py,sha256=G4Fm8hgFLlJUW5_ekLS_IOgCfpFy-TK9uq5r9QTOELQ,5447
|
|
10
10
|
langgraph_api/api/threads.py,sha256=ogMKmEoiycuaV3fa5kpupDohJ7fwUOfVczt6-WSK4FE,9322
|
|
11
|
-
langgraph_api/api/ui.py,sha256=
|
|
11
|
+
langgraph_api/api/ui.py,sha256=kmXA270SX9JkF8_qrx1G_b3grc_SL6jEuCYpH1ZLPXE,2201
|
|
12
12
|
langgraph_api/asyncio.py,sha256=h0eZ7aoDGnJpoxnHLZABVlj1jQ78UxjgiHntTmAEWek,8613
|
|
13
13
|
langgraph_api/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
langgraph_api/auth/custom.py,sha256=QR49PnIfPPQZ6ygWmnMkSuAzgOpBBUbbz5kJ2yVwGmQ,21934
|
|
@@ -20,35 +20,36 @@ langgraph_api/auth/noop.py,sha256=Bk6Nf3p8D_iMVy_OyfPlyiJp_aEwzL-sHrbxoXpCbac,58
|
|
|
20
20
|
langgraph_api/auth/studio_user.py,sha256=FzFQRROKDlA9JjtBuwyZvk6Mbwno5M9RVYjDO6FU3F8,186
|
|
21
21
|
langgraph_api/cli.py,sha256=9Ou3tGDDY_VVLt5DFle8UviJdpI4ZigC5hElYvq2-To,14519
|
|
22
22
|
langgraph_api/command.py,sha256=3O9v3i0OPa96ARyJ_oJbLXkfO8rPgDhLCswgO9koTFA,768
|
|
23
|
-
langgraph_api/config.py,sha256=
|
|
23
|
+
langgraph_api/config.py,sha256=KXQ3W0LzGuEqc0kfB2B37tvqFBwl66rW7vXtw1gIZGc,10773
|
|
24
24
|
langgraph_api/cron_scheduler.py,sha256=i87j4pJrcsmsqMKeKUs69gaAjrGaSM3pM3jnXdN5JDQ,2630
|
|
25
25
|
langgraph_api/errors.py,sha256=Bu_i5drgNTyJcLiyrwVE_6-XrSU50BHf9TDpttki9wQ,1690
|
|
26
|
-
langgraph_api/graph.py,sha256=
|
|
26
|
+
langgraph_api/graph.py,sha256=YyWCPtoI9VDV0knjCMUFoH4r9OFVsAiv5K8FzbziMqs,21488
|
|
27
27
|
langgraph_api/http.py,sha256=gYbxxjY8aLnsXeJymcJ7G7Nj_yToOGpPYQqmZ1_ggfA,5240
|
|
28
28
|
langgraph_api/js/.gitignore,sha256=l5yI6G_V6F1600I1IjiUKn87f4uYIrBAYU1MOyBBhg4,59
|
|
29
29
|
langgraph_api/js/.prettierrc,sha256=r08GtR4CPFQkArPYy10eMUbrpTvGDVNeoZRvaeZu0Kc,18
|
|
30
30
|
langgraph_api/js/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
31
|
langgraph_api/js/base.py,sha256=gjY6K8avI03OrI-Hy6a311fQ_EG5r_x8hUYlc7uqxdE,534
|
|
32
|
-
langgraph_api/js/build.mts,sha256=
|
|
32
|
+
langgraph_api/js/build.mts,sha256=ceHRr_Io_9otkDOSgHuKbGnOUu4AX2jPj8APTTa9UjM,2741
|
|
33
33
|
langgraph_api/js/client.http.mts,sha256=AGA-p8J85IcNh2oXZjDxHQ4PnQdJmt-LPcpZp6j0Cws,4687
|
|
34
34
|
langgraph_api/js/client.mts,sha256=YUna7um53zSiZHt0Dfmd7fBTTEPAZ2-hLNZ7m9nDsT8,30090
|
|
35
35
|
langgraph_api/js/errors.py,sha256=Cm1TKWlUCwZReDC5AQ6SgNIVGD27Qov2xcgHyf8-GXo,361
|
|
36
36
|
langgraph_api/js/global.d.ts,sha256=j4GhgtQSZ5_cHzjSPcHgMJ8tfBThxrH-pUOrrJGteOU,196
|
|
37
|
-
langgraph_api/js/package.json,sha256=
|
|
38
|
-
langgraph_api/js/remote.py,sha256=
|
|
37
|
+
langgraph_api/js/package.json,sha256=5gtQpj0mXh069X5fWJFWp-jt7Sb3RQUPVpe4m8Q0KHE,1289
|
|
38
|
+
langgraph_api/js/remote.py,sha256=7n9JN6rLO3BcvLF76jSX6BHPM3vSrARqBeZGmsPANAI,35628
|
|
39
39
|
langgraph_api/js/schema.py,sha256=7idnv7URlYUdSNMBXQcw7E4SxaPxCq_Oxwnlml8q5ik,408
|
|
40
|
-
langgraph_api/js/src/graph.mts,sha256=
|
|
41
|
-
langgraph_api/js/src/hooks.mjs,sha256=
|
|
42
|
-
langgraph_api/js/src/parser/parser.mts,sha256=
|
|
40
|
+
langgraph_api/js/src/graph.mts,sha256=QVy2sUcwcG9WkPF6AXy9mh0dvaXccVIZNtv5rkUtUYc,3479
|
|
41
|
+
langgraph_api/js/src/load.hooks.mjs,sha256=xNVHq75W0Lk6MUKl1pQYrx-wtQ8_neiUyI6SO-k0ecM,2235
|
|
42
|
+
langgraph_api/js/src/parser/parser.mts,sha256=iW5G-YIVIuwuFsfn_GS3_CZsjpa00SxypICfPf2SN9Q,14156
|
|
43
43
|
langgraph_api/js/src/parser/parser.worker.mjs,sha256=2K6D0GlUmkk7LE39I8mryB8VZVE3-N9Cblji-ArPhFo,386
|
|
44
|
-
langgraph_api/js/src/schema/types.mts,sha256=SRCYZTWjxyc7528DaapR_DCm3G5bfDSh4vf-JsYpk0w,62633
|
|
45
|
-
langgraph_api/js/src/schema/types.template.mts,sha256=Dbjj_8d-OubqH4QY_OaxSu8ocZ4dVjI94oncL20fqtk,2235
|
|
44
|
+
langgraph_api/js/src/parser/schema/types.mts,sha256=SRCYZTWjxyc7528DaapR_DCm3G5bfDSh4vf-JsYpk0w,62633
|
|
45
|
+
langgraph_api/js/src/parser/schema/types.template.mts,sha256=Dbjj_8d-OubqH4QY_OaxSu8ocZ4dVjI94oncL20fqtk,2235
|
|
46
|
+
langgraph_api/js/src/preload.mjs,sha256=ORV7xwMuZcXWL6jQxNAcCYp8GZVYIvVJbUhmle8jbno,759
|
|
46
47
|
langgraph_api/js/src/utils/files.mts,sha256=MXC-3gy0pkS82AjPBoUN83jY_qg37WSAPHOA7DwfB4M,141
|
|
47
48
|
langgraph_api/js/src/utils/importMap.mts,sha256=pX4TGOyUpuuWF82kXcxcv3-8mgusRezOGe6Uklm2O5A,1644
|
|
48
49
|
langgraph_api/js/src/utils/pythonSchemas.mts,sha256=98IW7Z_VP7L_CHNRMb3_MsiV3BgLE2JsWQY_PQcRR3o,685
|
|
49
50
|
langgraph_api/js/src/utils/serde.mts,sha256=OuyyO9btvwWd55rU_H4x91dFEJiaPxL-lL9O6Zgo908,742
|
|
50
51
|
langgraph_api/js/sse.py,sha256=lsfp4nyJyA1COmlKG9e2gJnTttf_HGCB5wyH8OZBER8,4105
|
|
51
|
-
langgraph_api/js/tests/api.test.mts,sha256=
|
|
52
|
+
langgraph_api/js/tests/api.test.mts,sha256=mQxM4Dbdnv_nIYpMg6VIkpmpU012I3D4dwRko3Cw-zI,68115
|
|
52
53
|
langgraph_api/js/tests/auth.test.mts,sha256=Aink9N0y3VCxp-Q0sLapAmdiUBYGzcwU8_3RXkRYN4c,21614
|
|
53
54
|
langgraph_api/js/tests/compose-postgres.auth.yml,sha256=iPfJbCeYZdV6GiRLiDn_f7qgpG4TyyGaQ4lV-ZXr6Qk,1768
|
|
54
55
|
langgraph_api/js/tests/compose-postgres.yml,sha256=w4B3YRS0QEnTcZH2-MY0DYvR_c5GcER0uDa1Ga_knf8,1960
|
|
@@ -65,20 +66,21 @@ langgraph_api/js/tests/graphs/error.mts,sha256=l4tk89449dj1BnEF_0ZcfPt0Ikk1gl8L1
|
|
|
65
66
|
langgraph_api/js/tests/graphs/http.mts,sha256=64xbMlLA58323zOX68Zh57zIB5Zl8ZCqEWRPNdJ-oJs,2171
|
|
66
67
|
langgraph_api/js/tests/graphs/langgraph.json,sha256=h6hV1wkNEUIpLBX9JOUKqtIBvbhvzyLEuWtBIHteseg,265
|
|
67
68
|
langgraph_api/js/tests/graphs/nested.mts,sha256=4G7jSOSaFVQAza-_ARbK-Iai1biLlF2DIPDZXf7PLIY,1245
|
|
68
|
-
langgraph_api/js/tests/graphs/package.json,sha256=
|
|
69
|
+
langgraph_api/js/tests/graphs/package.json,sha256=8kgqWdZJCwekCqjsSrhbLrAPZ2vEy1DmcC8EQnwJMDU,262
|
|
69
70
|
langgraph_api/js/tests/graphs/weather.mts,sha256=A7mLK3xW8h5B-ZyJNAyX2M2fJJwzPJzXs4DYesJwreQ,1655
|
|
70
|
-
langgraph_api/js/tests/graphs/yarn.lock,sha256=
|
|
71
|
+
langgraph_api/js/tests/graphs/yarn.lock,sha256=HDLJKx47Y-csPzA5eYUMVHWE8fMKrZgrc4SEkQAYYCE,11201
|
|
71
72
|
langgraph_api/js/tests/parser.test.mts,sha256=BBKUTveZnf-RI6B9XfTBLqy6tp84ddyu1tN3z041IAs,27900
|
|
72
73
|
langgraph_api/js/tests/utils.mts,sha256=q1V9gvT63v95onlfK9W4iv3n9ZJO3h-0RD9TdDYuRyY,439
|
|
74
|
+
langgraph_api/js/tsconfig.json,sha256=imCYqVnqFpaBoZPx8k1nO4slHIWBFsSlmCYhO73cpBs,341
|
|
73
75
|
langgraph_api/js/ui.py,sha256=XNT8iBcyT8XmbIqSQUWd-j_00HsaWB2vRTVabwFBkik,2439
|
|
74
|
-
langgraph_api/js/yarn.lock,sha256=
|
|
76
|
+
langgraph_api/js/yarn.lock,sha256=OEj5JbffHe8opUAki0eH_0XJbVmgasv9zcHhGeI0g0w,84019
|
|
75
77
|
langgraph_api/logging.py,sha256=JJIzbNIgLCN6ClQ3tA-Mm5ffuBGvpRDSZsEvnIlsuu4,3693
|
|
76
78
|
langgraph_api/metadata.py,sha256=ptaxwmzdx2bUBSc1KRhqgF-Xnm-Zh2gqwSiHpl8LD9c,4482
|
|
77
79
|
langgraph_api/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
80
|
langgraph_api/middleware/http_logger.py,sha256=aj4mdisRobFePkD3Iy6-w_Mujwx4TQRaEhPvSd6HgLk,3284
|
|
79
81
|
langgraph_api/middleware/private_network.py,sha256=eYgdyU8AzU2XJu362i1L8aSFoQRiV7_aLBPw7_EgeqI,2111
|
|
80
82
|
langgraph_api/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
81
|
-
langgraph_api/models/run.py,sha256=
|
|
83
|
+
langgraph_api/models/run.py,sha256=nriNLvY9ZBmSDYDPQs9W9vj6yYZjRZUl7TtSZ6DaGSs,12944
|
|
82
84
|
langgraph_api/patch.py,sha256=Dgs0PXHytekX4SUL6KsjjN0hHcOtGLvv1GRGbh6PswU,1408
|
|
83
85
|
langgraph_api/queue_entrypoint.py,sha256=gjtajZfnDXhsi7JElfmkY-p0ENBiKBDJ4Ugiw-exapw,1839
|
|
84
86
|
langgraph_api/route.py,sha256=fM4qYCGbmH0a3_cV8uKocb1sLklehxO6HhdRXqLK6OM,4421
|
|
@@ -88,7 +90,7 @@ langgraph_api/server.py,sha256=lCv_ZHLbMnhKRhdaSJi1edk-O9We-MnQafkGzdWlngw,6599
|
|
|
88
90
|
langgraph_api/sse.py,sha256=3jG_FZj8FI9r7xGWTqaAyDkmqf6P1NOu0EzGrcSOGYc,4033
|
|
89
91
|
langgraph_api/state.py,sha256=8jx4IoTCOjTJuwzuXJKKFwo1VseHjNnw_CCq4x1SW14,2284
|
|
90
92
|
langgraph_api/stream.py,sha256=a4sjBm3XhHK6NC4OD1dHey53t6czKodvrlxh9rfjfSA,11718
|
|
91
|
-
langgraph_api/thread_ttl.py,sha256
|
|
93
|
+
langgraph_api/thread_ttl.py,sha256=-Ox8NFHqUH3wGNdEKMIfAXUubY5WGifIgCaJ7npqLgw,1762
|
|
92
94
|
langgraph_api/tunneling/cloudflare.py,sha256=iKb6tj-VWPlDchHFjuQyep2Dpb-w2NGfJKt-WJG9LH0,3650
|
|
93
95
|
langgraph_api/utils.py,sha256=92mSti9GfGdMRRWyESKQW5yV-75Z9icGHnIrBYvdypU,3619
|
|
94
96
|
langgraph_api/validation.py,sha256=zMuKmwUEBjBgFMwAaeLZmatwGVijKv2sOYtYg7gfRtc,4950
|
|
@@ -99,8 +101,8 @@ langgraph_license/validation.py,sha256=ZKraAVJArAABKqrmHN-EN18ncoNUmRm500Yt1Sc7t
|
|
|
99
101
|
langgraph_runtime/__init__.py,sha256=O4GgSmu33c-Pr8Xzxj_brcK5vkm70iNTcyxEjICFZxA,1075
|
|
100
102
|
logging.json,sha256=3RNjSADZmDq38eHePMm1CbP6qZ71AmpBtLwCmKU9Zgo,379
|
|
101
103
|
openapi.json,sha256=cjlQFtrH7TwXQ9GNe1jy2iBRhae_F6inFZhsaCQidBc,132770
|
|
102
|
-
langgraph_api-0.1.
|
|
103
|
-
langgraph_api-0.1.
|
|
104
|
-
langgraph_api-0.1.
|
|
105
|
-
langgraph_api-0.1.
|
|
106
|
-
langgraph_api-0.1.
|
|
104
|
+
langgraph_api-0.1.18.dist-info/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
|
|
105
|
+
langgraph_api-0.1.18.dist-info/METADATA,sha256=cwXR7lMnah_lJRlXq3hMxHQquSCsia8P6eH07Y56AzA,4236
|
|
106
|
+
langgraph_api-0.1.18.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
107
|
+
langgraph_api-0.1.18.dist-info/entry_points.txt,sha256=3EYLgj89DfzqJHHYGxPH4A_fEtClvlRbWRUHaXO7hj4,77
|
|
108
|
+
langgraph_api-0.1.18.dist-info/RECORD,,
|
langgraph_api/js/src/hooks.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// This hook is to ensure that @langchain/langgraph package
|
|
2
|
-
// found in /api folder has precendence compared to user-provided package
|
|
3
|
-
// found in /deps. Does not attempt to semver check for too old packages.
|
|
4
|
-
const OVERRIDE_RESOLVE = [
|
|
5
|
-
"@langchain/langgraph",
|
|
6
|
-
"@langchain/langgraph-checkpoint",
|
|
7
|
-
];
|
|
8
|
-
|
|
9
|
-
export const resolve = async (specifier, context, nextResolve) => {
|
|
10
|
-
const parentURL = new URL("./graph.mts", import.meta.url).toString();
|
|
11
|
-
|
|
12
|
-
if (OVERRIDE_RESOLVE.includes(specifier)) {
|
|
13
|
-
return nextResolve(specifier, { ...context, parentURL });
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return nextResolve(specifier, context);
|
|
17
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|