@langchain/langgraph-api 1.2.2 → 1.2.3

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 (45) hide show
  1. package/dist/experimental/embed/protocol.mjs +86 -15
  2. package/dist/protocol/service.d.mts +9 -1
  3. package/dist/protocol/service.mjs +65 -25
  4. package/package.json +6 -6
  5. package/dist/src/api/assistants.d.mts +0 -3
  6. package/dist/src/api/assistants.mjs +0 -194
  7. package/dist/src/api/meta.d.mts +0 -3
  8. package/dist/src/api/meta.mjs +0 -65
  9. package/dist/src/api/protocol.d.mts +0 -7
  10. package/dist/src/api/protocol.mjs +0 -157
  11. package/dist/src/api/runs.d.mts +0 -3
  12. package/dist/src/api/runs.mjs +0 -335
  13. package/dist/src/api/store.d.mts +0 -3
  14. package/dist/src/api/store.mjs +0 -111
  15. package/dist/src/api/threads.d.mts +0 -3
  16. package/dist/src/api/threads.mjs +0 -143
  17. package/dist/src/graph/load.utils.d.mts +0 -22
  18. package/dist/src/graph/load.utils.mjs +0 -59
  19. package/dist/src/protocol/service.d.mts +0 -101
  20. package/dist/src/protocol/service.mjs +0 -568
  21. package/dist/src/protocol/session/event-normalizers.d.mts +0 -52
  22. package/dist/src/protocol/session/index.d.mts +0 -261
  23. package/dist/src/protocol/session/index.mjs +0 -826
  24. package/dist/src/protocol/session/namespace.d.mts +0 -47
  25. package/dist/src/protocol/session/namespace.mjs +0 -62
  26. package/dist/src/protocol/types.d.mts +0 -121
  27. package/dist/src/protocol/types.mjs +0 -1
  28. package/dist/src/schemas.d.mts +0 -1552
  29. package/dist/src/semver/index.d.mts +0 -15
  30. package/dist/src/semver/index.mjs +0 -46
  31. package/dist/src/semver/satisfiesPeerRange.d.mts +0 -1
  32. package/dist/src/semver/satisfiesPeerRange.mjs +0 -19
  33. package/dist/src/state.d.mts +0 -3
  34. package/dist/src/state.mjs +0 -30
  35. package/dist/src/storage/context.d.mts +0 -3
  36. package/dist/src/storage/context.mjs +0 -11
  37. package/dist/src/storage/ops.mjs +0 -1281
  38. package/dist/src/stream.d.mts +0 -64
  39. package/dist/src/stream.mjs +0 -427
  40. package/dist/src/utils/hono.d.mts +0 -5
  41. package/dist/src/utils/hono.mjs +0 -24
  42. package/dist/src/utils/runnableConfig.d.mts +0 -3
  43. package/dist/src/utils/runnableConfig.mjs +0 -45
  44. package/dist/src/webhook.d.mts +0 -11
  45. package/dist/src/webhook.mjs +0 -30
@@ -1,15 +0,0 @@
1
- export declare function checkSemver(packages: {
2
- name: string;
3
- version: string;
4
- }[]): Promise<{
5
- name: string;
6
- version: string;
7
- required: string;
8
- satisfies: boolean;
9
- }[]>;
10
- export declare function checkLangGraphSemver(): Promise<{
11
- name: string;
12
- version: string;
13
- required: string;
14
- satisfies: boolean;
15
- }[]>;
@@ -1,46 +0,0 @@
1
- import * as url from "node:url";
2
- import * as fs from "node:fs/promises";
3
- import * as path from "node:path";
4
- import { satisfiesPeerRange } from "./satisfiesPeerRange.mjs";
5
- const packageJsonPath = path.resolve(url.fileURLToPath(import.meta.url), "../../../package.json");
6
- export async function checkSemver(packages) {
7
- const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8"));
8
- const peerDependencies = packageJson.peerDependencies ?? {};
9
- return packages.flatMap((pkg) => {
10
- const required = peerDependencies[pkg.name];
11
- if (!required)
12
- return [];
13
- const satisfies = satisfiesPeerRange(pkg.version, required);
14
- return { ...pkg, required, satisfies };
15
- });
16
- }
17
- export async function checkLangGraphSemver() {
18
- const resolveVersion = async (name) => {
19
- let version = "0.0.0";
20
- try {
21
- const pkgJson = await import(`${name}/package.json`);
22
- if (pkgJson == null || typeof pkgJson !== "object") {
23
- return { name, version };
24
- }
25
- if ("default" in pkgJson &&
26
- typeof pkgJson.default === "object" &&
27
- pkgJson.default != null) {
28
- version = pkgJson.default.version || version;
29
- }
30
- else if ("version" in pkgJson) {
31
- version = pkgJson.version || version;
32
- }
33
- }
34
- catch {
35
- // pass
36
- }
37
- return { name, version };
38
- };
39
- const validate = [
40
- "@langchain/core",
41
- "@langchain/langgraph",
42
- "@langchain/langgraph-checkpoint",
43
- ];
44
- const resolved = await Promise.all(validate.map((name) => resolveVersion(name)));
45
- return checkSemver(resolved);
46
- }
@@ -1 +0,0 @@
1
- export declare function satisfiesPeerRange(version: string, required: string): boolean;
@@ -1,19 +0,0 @@
1
- import * as semver from "semver";
2
- export function satisfiesPeerRange(version, required) {
3
- if (semver.satisfies(version, required, { includePrerelease: true })) {
4
- return true;
5
- }
6
- const parsed = semver.parse(version);
7
- if (parsed == null || parsed.prerelease.length === 0) {
8
- return false;
9
- }
10
- // CI often installs internal dev builds such as
11
- // `1.1.44-dev-<timestamp>`. Semver orders those below the final
12
- // `1.1.44`, so `^1.1.44` does not match directly even though the
13
- // build targets that release line. Validate the release tuple as a
14
- // compatibility check while still rejecting prereleases below range.
15
- const releaseVersion = `${parsed.major}.${parsed.minor}.${parsed.patch}`;
16
- return semver.satisfies(releaseVersion, required, {
17
- includePrerelease: true,
18
- });
19
- }
@@ -1,3 +0,0 @@
1
- import type { StateSnapshot } from "@langchain/langgraph";
2
- import type { ThreadState } from "./storage/types.mjs";
3
- export declare const stateSnapshotToThreadState: (state: StateSnapshot) => ThreadState;
@@ -1,30 +0,0 @@
1
- import { runnableConfigToCheckpoint } from "./utils/runnableConfig.mjs";
2
- import { serializeError } from "./utils/serde.mjs";
3
- const isStateSnapshot = (state) => {
4
- return "values" in state && "next" in state;
5
- };
6
- export const stateSnapshotToThreadState = (state) => {
7
- return {
8
- values: state.values,
9
- next: state.next,
10
- tasks: state.tasks.map((task) => ({
11
- id: task.id,
12
- name: task.name,
13
- error: task.error != null ? serializeError(task.error).message : null,
14
- interrupts: task.interrupts,
15
- path: task.path,
16
- // TODO: too many type assertions, check if this is actually correct
17
- checkpoint: task.state != null && "configurable" in task.state
18
- ? (task.state.configurable ?? null)
19
- : null,
20
- state: task.state != null && isStateSnapshot(task.state)
21
- ? stateSnapshotToThreadState(task.state)
22
- : null,
23
- result: task.result ?? null,
24
- })),
25
- metadata: state.metadata,
26
- created_at: state.createdAt ? new Date(state.createdAt) : null,
27
- checkpoint: runnableConfigToCheckpoint(state.config),
28
- parent_checkpoint: runnableConfigToCheckpoint(state.parentConfig),
29
- };
30
- };
@@ -1,3 +0,0 @@
1
- export declare const assistants: () => import("./types.mjs").AssistantsRepo;
2
- export declare const runs: () => import("./types.mjs").RunsRepo;
3
- export declare const threads: () => import("./types.mjs").ThreadsRepo;
@@ -1,11 +0,0 @@
1
- // Hono context helpers for accessing repositories, etc.
2
- import { getContext } from "hono/context-storage";
3
- export const assistants = () => {
4
- return getContext().var.LANGGRAPH_OPS.assistants;
5
- };
6
- export const runs = () => {
7
- return getContext().var.LANGGRAPH_OPS.runs;
8
- };
9
- export const threads = () => {
10
- return getContext().var.LANGGRAPH_OPS.threads;
11
- };