@langchain/langgraph-api 1.1.17 → 1.2.1
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/api/protocol.d.mts +7 -0
- package/dist/api/protocol.mjs +157 -0
- package/dist/api/runs.mjs +15 -4
- package/dist/command.mjs +1 -1
- package/dist/experimental/embed/constants.d.mts +3 -0
- package/dist/experimental/embed/constants.mjs +11 -0
- package/dist/experimental/embed/protocol.d.mts +9 -0
- package/dist/experimental/embed/protocol.mjs +453 -0
- package/dist/experimental/embed/runs.d.mts +8 -0
- package/dist/experimental/embed/runs.mjs +202 -0
- package/dist/experimental/embed/threads.d.mts +8 -0
- package/dist/experimental/embed/threads.mjs +151 -0
- package/dist/experimental/embed/types.d.mts +77 -0
- package/dist/experimental/embed/types.mjs +1 -0
- package/dist/experimental/embed/utils.d.mts +29 -0
- package/dist/experimental/embed/utils.mjs +62 -0
- package/dist/experimental/embed.d.mts +11 -31
- package/dist/experimental/embed.mjs +19 -399
- package/dist/graph/load.d.mts +2 -2
- package/dist/graph/load.utils.mjs +13 -3
- package/dist/protocol/constants.d.mts +7 -0
- package/dist/protocol/constants.mjs +7 -0
- package/dist/protocol/service.d.mts +101 -0
- package/dist/protocol/service.mjs +568 -0
- package/dist/protocol/session/event-normalizers.d.mts +52 -0
- package/dist/protocol/session/event-normalizers.mjs +162 -0
- package/dist/protocol/session/index.d.mts +261 -0
- package/dist/protocol/session/index.mjs +826 -0
- package/dist/protocol/session/internal-types.d.mts +67 -0
- package/dist/protocol/session/internal-types.mjs +28 -0
- package/dist/protocol/session/metadata.d.mts +24 -0
- package/dist/protocol/session/metadata.mjs +95 -0
- package/dist/protocol/session/namespace.d.mts +47 -0
- package/dist/protocol/session/namespace.mjs +62 -0
- package/dist/protocol/session/state-normalizers.d.mts +57 -0
- package/dist/protocol/session/state-normalizers.mjs +430 -0
- package/dist/protocol/session/tool-calls.d.mts +27 -0
- package/dist/protocol/session/tool-calls.mjs +59 -0
- package/dist/protocol/types.d.mts +121 -0
- package/dist/protocol/types.mjs +1 -0
- package/dist/queue.mjs +8 -2
- package/dist/schemas.d.mts +58 -58
- package/dist/semver/index.mjs +19 -1
- package/dist/server.mjs +22 -3
- package/dist/state.mjs +1 -1
- package/dist/storage/ops.mjs +17 -5
- package/dist/storage/persist.mjs +1 -1
- package/dist/storage/types.d.mts +10 -1
- package/dist/stream.d.mts +25 -4
- package/dist/stream.mjs +203 -11
- package/dist/utils/serde.mjs +1 -1
- package/package.json +16 -14
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { zValidator } from "@hono/zod-validator";
|
|
2
|
+
import { v7 as uuidv7 } from "uuid";
|
|
3
|
+
import { z } from "zod/v3";
|
|
4
|
+
import * as schemas from "../../schemas.mjs";
|
|
5
|
+
import { jsonExtra } from "../../utils/hono.mjs";
|
|
6
|
+
import { stateSnapshotToThreadState } from "../../state.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* Register thread CRUD and state routes on an embed server Hono app.
|
|
9
|
+
*
|
|
10
|
+
* @experimental Does not follow semver.
|
|
11
|
+
*/
|
|
12
|
+
export function registerThreadRoutes(api, context) {
|
|
13
|
+
api.post("/threads", zValidator("json", schemas.ThreadCreate), async (c) => {
|
|
14
|
+
const payload = c.req.valid("json");
|
|
15
|
+
const threadId = payload.thread_id || uuidv7();
|
|
16
|
+
return jsonExtra(c, await context.threads.set(threadId, {
|
|
17
|
+
kind: "put",
|
|
18
|
+
metadata: payload.metadata,
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
api.get("/threads/:thread_id", zValidator("param", z.object({ thread_id: z.string().uuid() })), async (c) => {
|
|
22
|
+
const { thread_id } = c.req.valid("param");
|
|
23
|
+
return jsonExtra(c, await context.threads.get(thread_id));
|
|
24
|
+
});
|
|
25
|
+
api.patch("/threads/:thread_id", zValidator("param", z.object({ thread_id: z.string().uuid() })), zValidator("json", schemas.ThreadCreate), async (c) => {
|
|
26
|
+
const { thread_id } = c.req.valid("param");
|
|
27
|
+
const payload = c.req.valid("json");
|
|
28
|
+
return jsonExtra(c, await context.threads.set(thread_id, {
|
|
29
|
+
kind: "patch",
|
|
30
|
+
metadata: payload.metadata,
|
|
31
|
+
}));
|
|
32
|
+
});
|
|
33
|
+
api.delete("/threads/:thread_id", zValidator("param", z.object({ thread_id: z.string().uuid() })), async (c) => {
|
|
34
|
+
const { thread_id } = c.req.valid("param");
|
|
35
|
+
await context.threads.delete(thread_id);
|
|
36
|
+
return new Response(null, { status: 204 });
|
|
37
|
+
});
|
|
38
|
+
api.post("/threads/search", zValidator("json", schemas.ThreadSearchRequest), async (c) => {
|
|
39
|
+
const payload = c.req.valid("json");
|
|
40
|
+
const result = [];
|
|
41
|
+
if (!context.threads.search)
|
|
42
|
+
return c.json({ error: "Threads search not implemented" }, 422);
|
|
43
|
+
const sortBy = payload.sort_by === "created_at" || payload.sort_by === "updated_at"
|
|
44
|
+
? payload.sort_by
|
|
45
|
+
: "created_at";
|
|
46
|
+
let total = 0;
|
|
47
|
+
for await (const item of context.threads.search({
|
|
48
|
+
metadata: payload.metadata,
|
|
49
|
+
limit: payload.limit ?? 10,
|
|
50
|
+
offset: payload.offset ?? 0,
|
|
51
|
+
sortBy,
|
|
52
|
+
sortOrder: payload.sort_order ?? "desc",
|
|
53
|
+
})) {
|
|
54
|
+
result.push(item.thread);
|
|
55
|
+
if (total === 0)
|
|
56
|
+
total = item.total;
|
|
57
|
+
}
|
|
58
|
+
c.res.headers.set("X-Pagination-Total", total.toString());
|
|
59
|
+
return jsonExtra(c, result);
|
|
60
|
+
});
|
|
61
|
+
api.get("/threads/:thread_id/state", zValidator("param", z.object({ thread_id: z.string().uuid() })), zValidator("query", z.object({ subgraphs: schemas.coercedBoolean.optional() })), async (c) => {
|
|
62
|
+
const { thread_id } = c.req.valid("param");
|
|
63
|
+
const { subgraphs } = c.req.valid("query");
|
|
64
|
+
const thread = await context.threads.get(thread_id);
|
|
65
|
+
const graphId = thread?.metadata?.graph_id;
|
|
66
|
+
const graph = graphId ? await context.getGraph(graphId) : undefined;
|
|
67
|
+
if (graph == null) {
|
|
68
|
+
return jsonExtra(c, stateSnapshotToThreadState({
|
|
69
|
+
values: {},
|
|
70
|
+
next: [],
|
|
71
|
+
config: {},
|
|
72
|
+
metadata: undefined,
|
|
73
|
+
createdAt: undefined,
|
|
74
|
+
parentConfig: undefined,
|
|
75
|
+
tasks: [],
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
const config = { configurable: { thread_id } };
|
|
79
|
+
const result = await graph.getState(config, { subgraphs });
|
|
80
|
+
return jsonExtra(c, stateSnapshotToThreadState(result));
|
|
81
|
+
});
|
|
82
|
+
api.post("/threads/:thread_id/state", zValidator("param", z.object({ thread_id: z.string().uuid() })), zValidator("json", schemas.ThreadStateUpdate), async (c) => {
|
|
83
|
+
const { thread_id } = c.req.valid("param");
|
|
84
|
+
const payload = c.req.valid("json");
|
|
85
|
+
const config = { configurable: { thread_id } };
|
|
86
|
+
config.configurable ??= {};
|
|
87
|
+
if (payload.checkpoint_id) {
|
|
88
|
+
config.configurable.checkpoint_id = payload.checkpoint_id;
|
|
89
|
+
}
|
|
90
|
+
if (payload.checkpoint) {
|
|
91
|
+
Object.assign(config.configurable, payload.checkpoint);
|
|
92
|
+
}
|
|
93
|
+
const thread = await context.threads.get(thread_id);
|
|
94
|
+
const graphId = thread?.metadata?.graph_id;
|
|
95
|
+
const graph = graphId ? await context.getGraph(graphId) : undefined;
|
|
96
|
+
if (graph == null)
|
|
97
|
+
return c.json({ error: "Graph not found" }, 404);
|
|
98
|
+
const result = await graph.updateState(config, payload.values, payload.as_node);
|
|
99
|
+
return jsonExtra(c, { checkpoint: result.configurable });
|
|
100
|
+
});
|
|
101
|
+
api.get("/threads/:thread_id/state/:checkpoint_id", zValidator("param", z.object({
|
|
102
|
+
thread_id: z.string().uuid(),
|
|
103
|
+
checkpoint_id: z.string().uuid(),
|
|
104
|
+
})), zValidator("query", z.object({ subgraphs: schemas.coercedBoolean.optional() })), async (c) => {
|
|
105
|
+
const { thread_id, checkpoint_id } = c.req.valid("param");
|
|
106
|
+
const { subgraphs } = c.req.valid("query");
|
|
107
|
+
const thread = await context.threads.get(thread_id);
|
|
108
|
+
const graphId = thread?.metadata?.graph_id;
|
|
109
|
+
const graph = graphId ? await context.getGraph(graphId) : undefined;
|
|
110
|
+
if (graph == null)
|
|
111
|
+
return c.json({ error: "Graph not found" }, 404);
|
|
112
|
+
const result = await graph.getState({ configurable: { thread_id, checkpoint_id } }, { subgraphs });
|
|
113
|
+
return jsonExtra(c, stateSnapshotToThreadState(result));
|
|
114
|
+
});
|
|
115
|
+
api.post("/threads/:thread_id/state/checkpoint", zValidator("param", z.object({ thread_id: z.string().uuid() })), zValidator("json", z.object({
|
|
116
|
+
subgraphs: schemas.coercedBoolean.optional(),
|
|
117
|
+
checkpoint: schemas.CheckpointSchema.nullish(),
|
|
118
|
+
})), async (c) => {
|
|
119
|
+
const { thread_id } = c.req.valid("param");
|
|
120
|
+
const { checkpoint, subgraphs } = c.req.valid("json");
|
|
121
|
+
const thread = await context.threads.get(thread_id);
|
|
122
|
+
const graphId = thread?.metadata?.graph_id;
|
|
123
|
+
const graph = graphId ? await context.getGraph(graphId) : undefined;
|
|
124
|
+
if (graph == null)
|
|
125
|
+
return c.json({ error: "Graph not found" }, 404);
|
|
126
|
+
const result = await graph.getState({ configurable: { thread_id, ...checkpoint } }, { subgraphs });
|
|
127
|
+
return jsonExtra(c, stateSnapshotToThreadState(result));
|
|
128
|
+
});
|
|
129
|
+
api.post("/threads/:thread_id/history", zValidator("param", z.object({ thread_id: z.string().uuid() })), zValidator("json", schemas.ThreadHistoryRequest), async (c) => {
|
|
130
|
+
const { thread_id } = c.req.valid("param");
|
|
131
|
+
const { limit, before, metadata, checkpoint } = c.req.valid("json");
|
|
132
|
+
const thread = await context.threads.get(thread_id);
|
|
133
|
+
const graphId = thread?.metadata?.graph_id;
|
|
134
|
+
const graph = graphId ? await context.getGraph(graphId) : undefined;
|
|
135
|
+
if (graph == null)
|
|
136
|
+
return jsonExtra(c, []);
|
|
137
|
+
const config = { configurable: { thread_id, ...checkpoint } };
|
|
138
|
+
const result = [];
|
|
139
|
+
const beforeConfig = typeof before === "string"
|
|
140
|
+
? { configurable: { checkpoint_id: before } }
|
|
141
|
+
: before;
|
|
142
|
+
for await (const state of graph.getStateHistory(config, {
|
|
143
|
+
limit,
|
|
144
|
+
before: beforeConfig,
|
|
145
|
+
filter: metadata,
|
|
146
|
+
})) {
|
|
147
|
+
result.push(stateSnapshotToThreadState(state));
|
|
148
|
+
}
|
|
149
|
+
return jsonExtra(c, result);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { BaseCheckpointSaver, BaseStore, Pregel } from "@langchain/langgraph";
|
|
2
|
+
import type { Metadata, Run } from "../../storage/types.mjs";
|
|
3
|
+
import type { ProtocolEvent } from "../../protocol/types.mjs";
|
|
4
|
+
import type { RunProtocolSession } from "../../protocol/session/index.mjs";
|
|
5
|
+
export type AnyPregel = Pregel<any, any, any, any, any>;
|
|
6
|
+
/**
|
|
7
|
+
* Shared context passed to each embed route module so that route handlers
|
|
8
|
+
* can access graphs, thread storage, and the checkpointer without closures.
|
|
9
|
+
*/
|
|
10
|
+
export interface EmbedRouteContext {
|
|
11
|
+
graph: Record<string, AnyPregel>;
|
|
12
|
+
threads: ThreadSaver;
|
|
13
|
+
checkpointer: BaseCheckpointSaver;
|
|
14
|
+
store?: BaseStore;
|
|
15
|
+
getGraph: (graphId: string) => Promise<AnyPregel>;
|
|
16
|
+
}
|
|
17
|
+
export interface Thread {
|
|
18
|
+
thread_id: string;
|
|
19
|
+
metadata: Metadata;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Interface for storing and retrieving threads used by `createEmbedServer`.
|
|
23
|
+
* @experimental Does not follow semver.
|
|
24
|
+
*/
|
|
25
|
+
export interface ThreadSaver {
|
|
26
|
+
get: (id: string) => Promise<Thread>;
|
|
27
|
+
set: (id: string, options: {
|
|
28
|
+
kind: "put" | "patch";
|
|
29
|
+
metadata?: Metadata;
|
|
30
|
+
}) => Promise<Thread>;
|
|
31
|
+
delete: (id: string) => Promise<void>;
|
|
32
|
+
search?: (options: {
|
|
33
|
+
metadata?: Metadata;
|
|
34
|
+
limit: number;
|
|
35
|
+
offset: number;
|
|
36
|
+
sortBy: "created_at" | "updated_at";
|
|
37
|
+
sortOrder: "asc" | "desc";
|
|
38
|
+
}) => AsyncGenerator<{
|
|
39
|
+
thread: Thread;
|
|
40
|
+
total: number;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export type RunStatus = "pending" | "running" | "success" | "error" | "interrupted";
|
|
44
|
+
/** Per-thread run queue state for enqueue support. */
|
|
45
|
+
export interface ThreadRunState {
|
|
46
|
+
activeRunId: string | null;
|
|
47
|
+
pendingRuns: Run[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* In-memory record for an active embed thread connection.
|
|
51
|
+
*/
|
|
52
|
+
export interface EmbedThread {
|
|
53
|
+
threadId: string;
|
|
54
|
+
assistantId?: string;
|
|
55
|
+
seq: number;
|
|
56
|
+
runSession?: RunProtocolSession;
|
|
57
|
+
/** Per-connection filtered event sinks (SSE). */
|
|
58
|
+
eventSinks: Map<string, {
|
|
59
|
+
id: string;
|
|
60
|
+
filter: {
|
|
61
|
+
channels: Set<string>;
|
|
62
|
+
namespaces?: string[][];
|
|
63
|
+
depth?: number;
|
|
64
|
+
since?: number;
|
|
65
|
+
};
|
|
66
|
+
send: (message: ProtocolEvent) => Promise<void> | void;
|
|
67
|
+
pendingReplay?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Bypass the sink filter when true. Used for WebSocket transports
|
|
70
|
+
* which deliver the full event stream to the connected client and
|
|
71
|
+
* let the client filter locally.
|
|
72
|
+
*/
|
|
73
|
+
unfiltered?: boolean;
|
|
74
|
+
}>;
|
|
75
|
+
queuedEvents: ProtocolEvent[];
|
|
76
|
+
currentRun?: Run;
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod/v3";
|
|
2
|
+
import type { MultitaskStrategy, Run } from "../../storage/types.mjs";
|
|
3
|
+
import * as schemas from "../../schemas.mjs";
|
|
4
|
+
import type { RunStatus } from "./types.mjs";
|
|
5
|
+
export declare const ProtocolCommandSchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodNumber;
|
|
7
|
+
method: z.ZodString;
|
|
8
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
id: number;
|
|
11
|
+
method: string;
|
|
12
|
+
params?: Record<string, unknown> | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
id: number;
|
|
15
|
+
method: string;
|
|
16
|
+
params?: Record<string, unknown> | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const ThreadIdSchema: z.ZodObject<{
|
|
19
|
+
thread_id: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
thread_id: string;
|
|
22
|
+
}, {
|
|
23
|
+
thread_id: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
26
|
+
export declare function createStubRun(threadId: string, payload: z.infer<typeof schemas.RunCreate>, overrides?: {
|
|
27
|
+
status?: RunStatus;
|
|
28
|
+
multitask_strategy?: MultitaskStrategy;
|
|
29
|
+
}): Run;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { v7 as uuidv7 } from "uuid";
|
|
2
|
+
import { z } from "zod/v3";
|
|
3
|
+
export const ProtocolCommandSchema = z.object({
|
|
4
|
+
id: z.number().int().nonnegative(),
|
|
5
|
+
method: z.string(),
|
|
6
|
+
params: z.record(z.unknown()).optional(),
|
|
7
|
+
});
|
|
8
|
+
export const ThreadIdSchema = z.object({ thread_id: z.string() });
|
|
9
|
+
export const isRecord = (value) => typeof value === "object" && value !== null;
|
|
10
|
+
export function createStubRun(threadId, payload, overrides) {
|
|
11
|
+
const now = new Date();
|
|
12
|
+
const runId = uuidv7();
|
|
13
|
+
let streamMode = Array.isArray(payload.stream_mode)
|
|
14
|
+
? payload.stream_mode
|
|
15
|
+
: payload.stream_mode
|
|
16
|
+
? [payload.stream_mode]
|
|
17
|
+
: undefined;
|
|
18
|
+
if (streamMode == null || streamMode.length === 0)
|
|
19
|
+
streamMode = ["values"];
|
|
20
|
+
const config = Object.assign({}, payload.config ?? {}, {
|
|
21
|
+
configurable: {
|
|
22
|
+
...payload.config?.configurable,
|
|
23
|
+
run_id: runId,
|
|
24
|
+
thread_id: threadId,
|
|
25
|
+
graph_id: payload.assistant_id,
|
|
26
|
+
...(payload.checkpoint_id
|
|
27
|
+
? { checkpoint_id: payload.checkpoint_id }
|
|
28
|
+
: null),
|
|
29
|
+
...payload.checkpoint,
|
|
30
|
+
...(payload.langsmith_tracer
|
|
31
|
+
? {
|
|
32
|
+
langsmith_project: payload.langsmith_tracer.project_name,
|
|
33
|
+
langsmith_example_id: payload.langsmith_tracer.example_id,
|
|
34
|
+
}
|
|
35
|
+
: null),
|
|
36
|
+
},
|
|
37
|
+
}, { metadata: payload.metadata ?? {} });
|
|
38
|
+
return {
|
|
39
|
+
run_id: runId,
|
|
40
|
+
thread_id: threadId,
|
|
41
|
+
assistant_id: payload.assistant_id,
|
|
42
|
+
metadata: payload.metadata ?? {},
|
|
43
|
+
status: overrides?.status ?? "running",
|
|
44
|
+
kwargs: {
|
|
45
|
+
input: payload.input,
|
|
46
|
+
command: payload.command,
|
|
47
|
+
config,
|
|
48
|
+
context: payload.context,
|
|
49
|
+
stream_mode: streamMode,
|
|
50
|
+
interrupt_before: payload.interrupt_before,
|
|
51
|
+
interrupt_after: payload.interrupt_after,
|
|
52
|
+
feedback_keys: payload.feedback_keys,
|
|
53
|
+
subgraphs: payload.stream_subgraphs,
|
|
54
|
+
temporary: false,
|
|
55
|
+
},
|
|
56
|
+
multitask_strategy: (overrides?.multitask_strategy ??
|
|
57
|
+
payload.multitask_strategy ??
|
|
58
|
+
"reject"),
|
|
59
|
+
created_at: now,
|
|
60
|
+
updated_at: now,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -1,42 +1,22 @@
|
|
|
1
|
-
import type { BaseCheckpointSaver, BaseStore
|
|
1
|
+
import type { BaseCheckpointSaver, BaseStore } from "@langchain/langgraph";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
|
-
import type {
|
|
4
|
-
type AnyPregel
|
|
5
|
-
|
|
6
|
-
thread_id: string;
|
|
7
|
-
metadata: Metadata;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Interface for storing and retrieving threads used by `createEmbedServer`.
|
|
11
|
-
* @experimental Does not follow semver.
|
|
12
|
-
*/
|
|
13
|
-
export interface ThreadSaver {
|
|
14
|
-
get: (id: string) => Promise<Thread>;
|
|
15
|
-
set: (id: string, options: {
|
|
16
|
-
kind: "put" | "patch";
|
|
17
|
-
metadata?: Metadata;
|
|
18
|
-
}) => Promise<Thread>;
|
|
19
|
-
delete: (id: string) => Promise<void>;
|
|
20
|
-
search?: (options: {
|
|
21
|
-
metadata?: Metadata;
|
|
22
|
-
limit: number;
|
|
23
|
-
offset: number;
|
|
24
|
-
sortBy: "created_at" | "updated_at";
|
|
25
|
-
sortOrder: "asc" | "desc";
|
|
26
|
-
}) => AsyncGenerator<{
|
|
27
|
-
thread: Thread;
|
|
28
|
-
total: number;
|
|
29
|
-
}>;
|
|
30
|
-
}
|
|
3
|
+
import type { UpgradeWebSocket } from "hono/ws";
|
|
4
|
+
import type { AnyPregel } from "./embed/types.mjs";
|
|
5
|
+
export type { ThreadSaver } from "./embed/types.mjs";
|
|
31
6
|
/**
|
|
32
7
|
* Create a Hono server with a subset of LangGraph Platform routes.
|
|
33
8
|
*
|
|
9
|
+
* Pass `upgradeWebSocket` to enable the WebSocket protocol transport
|
|
10
|
+
* on `GET /threads/:thread_id/stream/events`. Create it with `@hono/node-ws`'s
|
|
11
|
+
* `createNodeWebSocket({ app })` and make sure to call `injectWebSocket`
|
|
12
|
+
* on the underlying HTTP server.
|
|
13
|
+
*
|
|
34
14
|
* @experimental Does not follow semver.
|
|
35
15
|
*/
|
|
36
16
|
export declare function createEmbedServer(options: {
|
|
37
17
|
graph: Record<string, AnyPregel>;
|
|
38
|
-
threads: ThreadSaver;
|
|
18
|
+
threads: import("./embed/types.mjs").ThreadSaver;
|
|
39
19
|
checkpointer: BaseCheckpointSaver;
|
|
40
20
|
store?: BaseStore;
|
|
21
|
+
upgradeWebSocket?: UpgradeWebSocket;
|
|
41
22
|
}): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
42
|
-
export {};
|