@langchain/langgraph-sdk 1.3.1 → 1.4.4
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/package.json +5 -5
- package/CHANGELOG.md +0 -281
- package/dist/_virtual/rolldown_runtime.cjs +0 -25
- package/dist/auth/error.cjs +0 -79
- package/dist/auth/error.cjs.map +0 -1
- package/dist/auth/error.d.cts +0 -13
- package/dist/auth/error.d.cts.map +0 -1
- package/dist/auth/error.d.ts +0 -13
- package/dist/auth/error.d.ts.map +0 -1
- package/dist/auth/error.js +0 -78
- package/dist/auth/error.js.map +0 -1
- package/dist/auth/index.cjs +0 -39
- package/dist/auth/index.cjs.map +0 -1
- package/dist/auth/index.d.cts +0 -31
- package/dist/auth/index.d.cts.map +0 -1
- package/dist/auth/index.d.ts +0 -31
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -37
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/types.d.cts +0 -294
- package/dist/auth/types.d.cts.map +0 -1
- package/dist/auth/types.d.ts +0 -294
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/client.cjs +0 -1219
- package/dist/client.cjs.map +0 -1
- package/dist/client.d.cts +0 -803
- package/dist/client.d.cts.map +0 -1
- package/dist/client.d.ts +0 -803
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -1212
- package/dist/client.js.map +0 -1
- package/dist/index.cjs +0 -6
- package/dist/index.d.cts +0 -7
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -4
- package/dist/logging/index.cjs +0 -35
- package/dist/logging/index.cjs.map +0 -1
- package/dist/logging/index.d.cts +0 -47
- package/dist/logging/index.d.cts.map +0 -1
- package/dist/logging/index.d.ts +0 -47
- package/dist/logging/index.d.ts.map +0 -1
- package/dist/logging/index.js +0 -34
- package/dist/logging/index.js.map +0 -1
- package/dist/react/index.cjs +0 -5
- package/dist/react/index.d.cts +0 -4
- package/dist/react/index.d.ts +0 -4
- package/dist/react/index.js +0 -4
- package/dist/react/stream.cjs +0 -18
- package/dist/react/stream.cjs.map +0 -1
- package/dist/react/stream.custom.cjs +0 -129
- package/dist/react/stream.custom.cjs.map +0 -1
- package/dist/react/stream.custom.d.cts +0 -39
- package/dist/react/stream.custom.d.cts.map +0 -1
- package/dist/react/stream.custom.d.ts +0 -39
- package/dist/react/stream.custom.d.ts.map +0 -1
- package/dist/react/stream.custom.js +0 -127
- package/dist/react/stream.custom.js.map +0 -1
- package/dist/react/stream.d.cts +0 -73
- package/dist/react/stream.d.cts.map +0 -1
- package/dist/react/stream.d.ts +0 -73
- package/dist/react/stream.d.ts.map +0 -1
- package/dist/react/stream.js +0 -17
- package/dist/react/stream.js.map +0 -1
- package/dist/react/stream.lgp.cjs +0 -446
- package/dist/react/stream.lgp.cjs.map +0 -1
- package/dist/react/stream.lgp.js +0 -445
- package/dist/react/stream.lgp.js.map +0 -1
- package/dist/react/thread.cjs +0 -22
- package/dist/react/thread.cjs.map +0 -1
- package/dist/react/thread.js +0 -21
- package/dist/react/thread.js.map +0 -1
- package/dist/react/types.d.cts +0 -363
- package/dist/react/types.d.cts.map +0 -1
- package/dist/react/types.d.ts +0 -363
- package/dist/react/types.d.ts.map +0 -1
- package/dist/react-ui/client.cjs +0 -137
- package/dist/react-ui/client.cjs.map +0 -1
- package/dist/react-ui/client.d.cts +0 -90
- package/dist/react-ui/client.d.cts.map +0 -1
- package/dist/react-ui/client.d.ts +0 -90
- package/dist/react-ui/client.d.ts.map +0 -1
- package/dist/react-ui/client.js +0 -134
- package/dist/react-ui/client.js.map +0 -1
- package/dist/react-ui/index.cjs +0 -14
- package/dist/react-ui/index.cjs.map +0 -1
- package/dist/react-ui/index.d.cts +0 -3
- package/dist/react-ui/index.d.ts +0 -3
- package/dist/react-ui/index.js +0 -9
- package/dist/react-ui/index.js.map +0 -1
- package/dist/react-ui/server/index.cjs +0 -5
- package/dist/react-ui/server/index.d.cts +0 -3
- package/dist/react-ui/server/index.d.ts +0 -3
- package/dist/react-ui/server/index.js +0 -4
- package/dist/react-ui/server/server.cjs +0 -57
- package/dist/react-ui/server/server.cjs.map +0 -1
- package/dist/react-ui/server/server.d.cts +0 -55
- package/dist/react-ui/server/server.d.cts.map +0 -1
- package/dist/react-ui/server/server.d.ts +0 -55
- package/dist/react-ui/server/server.d.ts.map +0 -1
- package/dist/react-ui/server/server.js +0 -56
- package/dist/react-ui/server/server.js.map +0 -1
- package/dist/react-ui/types.cjs +0 -38
- package/dist/react-ui/types.cjs.map +0 -1
- package/dist/react-ui/types.d.cts +0 -25
- package/dist/react-ui/types.d.cts.map +0 -1
- package/dist/react-ui/types.d.ts +0 -25
- package/dist/react-ui/types.d.ts.map +0 -1
- package/dist/react-ui/types.js +0 -35
- package/dist/react-ui/types.js.map +0 -1
- package/dist/schema.d.cts +0 -284
- package/dist/schema.d.cts.map +0 -1
- package/dist/schema.d.ts +0 -284
- package/dist/schema.d.ts.map +0 -1
- package/dist/singletons/fetch.cjs +0 -24
- package/dist/singletons/fetch.cjs.map +0 -1
- package/dist/singletons/fetch.d.cts +0 -14
- package/dist/singletons/fetch.d.cts.map +0 -1
- package/dist/singletons/fetch.d.ts +0 -14
- package/dist/singletons/fetch.d.ts.map +0 -1
- package/dist/singletons/fetch.js +0 -22
- package/dist/singletons/fetch.js.map +0 -1
- package/dist/types.d.cts +0 -187
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.ts +0 -187
- package/dist/types.d.ts.map +0 -1
- package/dist/types.messages.d.cts +0 -91
- package/dist/types.messages.d.cts.map +0 -1
- package/dist/types.messages.d.ts +0 -91
- package/dist/types.messages.d.ts.map +0 -1
- package/dist/types.stream.d.cts +0 -235
- package/dist/types.stream.d.cts.map +0 -1
- package/dist/types.stream.d.ts +0 -235
- package/dist/types.stream.d.ts.map +0 -1
- package/dist/ui/branching.cjs +0 -153
- package/dist/ui/branching.cjs.map +0 -1
- package/dist/ui/branching.d.cts +0 -22
- package/dist/ui/branching.d.cts.map +0 -1
- package/dist/ui/branching.d.ts +0 -22
- package/dist/ui/branching.d.ts.map +0 -1
- package/dist/ui/branching.js +0 -152
- package/dist/ui/branching.js.map +0 -1
- package/dist/ui/errors.cjs +0 -15
- package/dist/ui/errors.cjs.map +0 -1
- package/dist/ui/errors.js +0 -14
- package/dist/ui/errors.js.map +0 -1
- package/dist/ui/manager.cjs +0 -182
- package/dist/ui/manager.cjs.map +0 -1
- package/dist/ui/manager.js +0 -182
- package/dist/ui/manager.js.map +0 -1
- package/dist/ui/messages.cjs +0 -70
- package/dist/ui/messages.cjs.map +0 -1
- package/dist/ui/messages.js +0 -68
- package/dist/ui/messages.js.map +0 -1
- package/dist/ui/utils.cjs +0 -14
- package/dist/ui/utils.cjs.map +0 -1
- package/dist/ui/utils.js +0 -12
- package/dist/ui/utils.js.map +0 -1
- package/dist/utils/async_caller.cjs +0 -111
- package/dist/utils/async_caller.cjs.map +0 -1
- package/dist/utils/async_caller.d.cts +0 -53
- package/dist/utils/async_caller.d.cts.map +0 -1
- package/dist/utils/async_caller.d.ts +0 -53
- package/dist/utils/async_caller.d.ts.map +0 -1
- package/dist/utils/async_caller.js +0 -110
- package/dist/utils/async_caller.js.map +0 -1
- package/dist/utils/env.cjs +0 -13
- package/dist/utils/env.cjs.map +0 -1
- package/dist/utils/env.js +0 -12
- package/dist/utils/env.js.map +0 -1
- package/dist/utils/error.cjs +0 -17
- package/dist/utils/error.cjs.map +0 -1
- package/dist/utils/error.js +0 -16
- package/dist/utils/error.js.map +0 -1
- package/dist/utils/signals.cjs +0 -20
- package/dist/utils/signals.cjs.map +0 -1
- package/dist/utils/signals.js +0 -19
- package/dist/utils/signals.js.map +0 -1
- package/dist/utils/sse.cjs +0 -124
- package/dist/utils/sse.cjs.map +0 -1
- package/dist/utils/sse.js +0 -122
- package/dist/utils/sse.js.map +0 -1
- package/dist/utils/stream.cjs +0 -176
- package/dist/utils/stream.cjs.map +0 -1
- package/dist/utils/stream.js +0 -175
- package/dist/utils/stream.js.map +0 -1
package/dist/schema.d.ts
DELETED
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import { JSONSchema7 } from "json-schema";
|
|
2
|
-
|
|
3
|
-
//#region src/schema.d.ts
|
|
4
|
-
type Optional<T> = T | null | undefined;
|
|
5
|
-
type RunStatus = "pending" | "running" | "error" | "success" | "timeout" | "interrupted";
|
|
6
|
-
type ThreadStatus = "idle" | "busy" | "interrupted" | "error";
|
|
7
|
-
type MultitaskStrategy = "reject" | "interrupt" | "rollback" | "enqueue";
|
|
8
|
-
type CancelAction = "interrupt" | "rollback";
|
|
9
|
-
type Config = {
|
|
10
|
-
/**
|
|
11
|
-
* Tags for this call and any sub-calls (eg. a Chain calling an LLM).
|
|
12
|
-
* You can use these to filter calls.
|
|
13
|
-
*/
|
|
14
|
-
tags?: string[];
|
|
15
|
-
/**
|
|
16
|
-
* Maximum number of times a call can recurse.
|
|
17
|
-
* If not provided, defaults to 25.
|
|
18
|
-
*/
|
|
19
|
-
recursion_limit?: number;
|
|
20
|
-
/**
|
|
21
|
-
* Runtime values for attributes previously made configurable on this Runnable.
|
|
22
|
-
*/
|
|
23
|
-
configurable?: {
|
|
24
|
-
/**
|
|
25
|
-
* ID of the thread
|
|
26
|
-
*/
|
|
27
|
-
thread_id?: Optional<string>;
|
|
28
|
-
/**
|
|
29
|
-
* Timestamp of the state checkpoint
|
|
30
|
-
*/
|
|
31
|
-
checkpoint_id?: Optional<string>;
|
|
32
|
-
[key: string]: unknown;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
interface GraphSchema {
|
|
36
|
-
/**
|
|
37
|
-
* The ID of the graph.
|
|
38
|
-
*/
|
|
39
|
-
graph_id: string;
|
|
40
|
-
/**
|
|
41
|
-
* The schema for the input state.
|
|
42
|
-
* Missing if unable to generate JSON schema from graph.
|
|
43
|
-
*/
|
|
44
|
-
input_schema?: JSONSchema7 | null | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* The schema for the output state.
|
|
47
|
-
* Missing if unable to generate JSON schema from graph.
|
|
48
|
-
*/
|
|
49
|
-
output_schema?: JSONSchema7 | null | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* The schema for the graph state.
|
|
52
|
-
* Missing if unable to generate JSON schema from graph.
|
|
53
|
-
*/
|
|
54
|
-
state_schema?: JSONSchema7 | null | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* The schema for the graph config.
|
|
57
|
-
* Missing if unable to generate JSON schema from graph.
|
|
58
|
-
*/
|
|
59
|
-
config_schema?: JSONSchema7 | null | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* The schema for the graph context.
|
|
62
|
-
* Missing if unable to generate JSON schema from graph.
|
|
63
|
-
*/
|
|
64
|
-
context_schema?: JSONSchema7 | null | undefined;
|
|
65
|
-
}
|
|
66
|
-
type Subgraphs = Record<string, GraphSchema>;
|
|
67
|
-
type Metadata = Optional<{
|
|
68
|
-
source?: "input" | "loop" | "update" | (string & {}); // eslint-disable-line @typescript-eslint/ban-types
|
|
69
|
-
step?: number;
|
|
70
|
-
writes?: Record<string, unknown> | null;
|
|
71
|
-
parents?: Record<string, string>;
|
|
72
|
-
[key: string]: unknown;
|
|
73
|
-
}>;
|
|
74
|
-
interface AssistantBase {
|
|
75
|
-
/** The ID of the assistant. */
|
|
76
|
-
assistant_id: string;
|
|
77
|
-
/** The ID of the graph. */
|
|
78
|
-
graph_id: string;
|
|
79
|
-
/** The assistant config. */
|
|
80
|
-
config: Config;
|
|
81
|
-
/** The assistant context. */
|
|
82
|
-
context: unknown;
|
|
83
|
-
/** The time the assistant was created. */
|
|
84
|
-
created_at: string;
|
|
85
|
-
/** The assistant metadata. */
|
|
86
|
-
metadata: Metadata;
|
|
87
|
-
/** The version of the assistant. */
|
|
88
|
-
version: number;
|
|
89
|
-
/** The name of the assistant */
|
|
90
|
-
name: string;
|
|
91
|
-
/** The description of the assistant */
|
|
92
|
-
description?: string;
|
|
93
|
-
}
|
|
94
|
-
interface AssistantVersion extends AssistantBase {}
|
|
95
|
-
interface Assistant extends AssistantBase {
|
|
96
|
-
/** The last time the assistant was updated. */
|
|
97
|
-
updated_at: string;
|
|
98
|
-
}
|
|
99
|
-
interface AssistantsSearchResponse {
|
|
100
|
-
/** The assistants returned for the current search page. */
|
|
101
|
-
assistants: Assistant[];
|
|
102
|
-
/** Pagination cursor from the X-Pagination-Next response header. */
|
|
103
|
-
next: string | null;
|
|
104
|
-
}
|
|
105
|
-
interface AssistantGraph {
|
|
106
|
-
nodes: Array<{
|
|
107
|
-
id: string | number;
|
|
108
|
-
name?: string;
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
|
-
data?: Record<string, any> | string;
|
|
111
|
-
metadata?: unknown;
|
|
112
|
-
}>;
|
|
113
|
-
edges: Array<{
|
|
114
|
-
source: string;
|
|
115
|
-
target: string;
|
|
116
|
-
data?: string;
|
|
117
|
-
conditional?: boolean;
|
|
118
|
-
}>;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* An interrupt thrown inside a thread.
|
|
122
|
-
*/
|
|
123
|
-
interface Interrupt<TValue = unknown> {
|
|
124
|
-
/**
|
|
125
|
-
* The ID of the interrupt.
|
|
126
|
-
*/
|
|
127
|
-
id?: string;
|
|
128
|
-
/**
|
|
129
|
-
* The value of the interrupt.
|
|
130
|
-
*/
|
|
131
|
-
value?: TValue;
|
|
132
|
-
/**
|
|
133
|
-
* Will be deprecated in the future.
|
|
134
|
-
* @deprecated Will be removed in the future.
|
|
135
|
-
*/
|
|
136
|
-
when?: "during" | (string & {}); // eslint-disable-line @typescript-eslint/ban-types
|
|
137
|
-
/**
|
|
138
|
-
* Whether the interrupt can be resumed.
|
|
139
|
-
* @deprecated Will be removed in the future.
|
|
140
|
-
*/
|
|
141
|
-
resumable?: boolean;
|
|
142
|
-
/**
|
|
143
|
-
* The namespace of the interrupt.
|
|
144
|
-
* @deprecated Replaced by `interrupt_id`
|
|
145
|
-
*/
|
|
146
|
-
ns?: string[];
|
|
147
|
-
}
|
|
148
|
-
interface Thread<ValuesType = DefaultValues> {
|
|
149
|
-
/** The ID of the thread. */
|
|
150
|
-
thread_id: string;
|
|
151
|
-
/** The time the thread was created. */
|
|
152
|
-
created_at: string;
|
|
153
|
-
/** The last time the thread was updated. */
|
|
154
|
-
updated_at: string;
|
|
155
|
-
/** The thread metadata. */
|
|
156
|
-
metadata: Metadata;
|
|
157
|
-
/** The status of the thread */
|
|
158
|
-
status: ThreadStatus;
|
|
159
|
-
/** The current state of the thread. */
|
|
160
|
-
values: ValuesType;
|
|
161
|
-
/** Interrupts which were thrown in this thread */
|
|
162
|
-
interrupts: Record<string, Array<Interrupt>>;
|
|
163
|
-
}
|
|
164
|
-
interface Cron {
|
|
165
|
-
/** The ID of the cron */
|
|
166
|
-
cron_id: string;
|
|
167
|
-
/** The ID of the assistant */
|
|
168
|
-
assistant_id: string;
|
|
169
|
-
/** The ID of the thread */
|
|
170
|
-
thread_id: Optional<string>;
|
|
171
|
-
/** The end date to stop running the cron. */
|
|
172
|
-
end_time: Optional<string>;
|
|
173
|
-
/** The schedule to run, cron format. */
|
|
174
|
-
schedule: string;
|
|
175
|
-
/** The time the cron was created. */
|
|
176
|
-
created_at: string;
|
|
177
|
-
/** The last time the cron was updated. */
|
|
178
|
-
updated_at: string;
|
|
179
|
-
/** The run payload to use for creating new run. */
|
|
180
|
-
payload: Record<string, unknown>;
|
|
181
|
-
/** The user ID of the cron */
|
|
182
|
-
user_id: Optional<string>;
|
|
183
|
-
/** The next run date of the cron */
|
|
184
|
-
next_run_date: Optional<string>;
|
|
185
|
-
/** The metadata of the cron */
|
|
186
|
-
metadata: Record<string, unknown>;
|
|
187
|
-
}
|
|
188
|
-
type DefaultValues = Record<string, unknown>[] | Record<string, unknown>;
|
|
189
|
-
type ThreadValuesFilter = Record<string, unknown>;
|
|
190
|
-
interface ThreadState<ValuesType = DefaultValues> {
|
|
191
|
-
/** The state values */
|
|
192
|
-
values: ValuesType;
|
|
193
|
-
/** The next nodes to execute. If empty, the thread is done until new input is received */
|
|
194
|
-
next: string[];
|
|
195
|
-
/** Checkpoint of the thread state */
|
|
196
|
-
checkpoint: Checkpoint;
|
|
197
|
-
/** Metadata for this state */
|
|
198
|
-
metadata: Metadata;
|
|
199
|
-
/** Time of state creation */
|
|
200
|
-
created_at: Optional<string>;
|
|
201
|
-
/** The parent checkpoint. If missing, this is the root checkpoint */
|
|
202
|
-
parent_checkpoint: Optional<Checkpoint>;
|
|
203
|
-
/** Tasks to execute in this step. If already attempted, may contain an error */
|
|
204
|
-
tasks: Array<ThreadTask>;
|
|
205
|
-
}
|
|
206
|
-
interface ThreadTask {
|
|
207
|
-
id: string;
|
|
208
|
-
name: string;
|
|
209
|
-
result?: unknown;
|
|
210
|
-
error: Optional<string>;
|
|
211
|
-
interrupts: Array<Interrupt>;
|
|
212
|
-
checkpoint: Optional<Checkpoint>;
|
|
213
|
-
state: Optional<ThreadState>;
|
|
214
|
-
}
|
|
215
|
-
interface Run {
|
|
216
|
-
/** The ID of the run */
|
|
217
|
-
run_id: string;
|
|
218
|
-
/** The ID of the thread */
|
|
219
|
-
thread_id: string;
|
|
220
|
-
/** The assistant that wwas used for this run */
|
|
221
|
-
assistant_id: string;
|
|
222
|
-
/** The time the run was created */
|
|
223
|
-
created_at: string;
|
|
224
|
-
/** The last time the run was updated */
|
|
225
|
-
updated_at: string;
|
|
226
|
-
/** The status of the run. */
|
|
227
|
-
status: RunStatus;
|
|
228
|
-
/** Run metadata */
|
|
229
|
-
metadata: Metadata;
|
|
230
|
-
/** Strategy to handle concurrent runs on the same thread */
|
|
231
|
-
multitask_strategy: Optional<MultitaskStrategy>;
|
|
232
|
-
}
|
|
233
|
-
type Checkpoint = {
|
|
234
|
-
thread_id: string;
|
|
235
|
-
checkpoint_ns: string;
|
|
236
|
-
checkpoint_id: Optional<string>;
|
|
237
|
-
checkpoint_map: Optional<Record<string, unknown>>;
|
|
238
|
-
};
|
|
239
|
-
interface ListNamespaceResponse {
|
|
240
|
-
namespaces: string[][];
|
|
241
|
-
}
|
|
242
|
-
interface Item {
|
|
243
|
-
namespace: string[];
|
|
244
|
-
key: string;
|
|
245
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
246
|
-
value: Record<string, any>;
|
|
247
|
-
createdAt: string;
|
|
248
|
-
updatedAt: string;
|
|
249
|
-
}
|
|
250
|
-
interface SearchItem extends Item {
|
|
251
|
-
score?: number;
|
|
252
|
-
}
|
|
253
|
-
interface SearchItemsResponse {
|
|
254
|
-
items: SearchItem[];
|
|
255
|
-
}
|
|
256
|
-
interface CronCreateResponse {
|
|
257
|
-
cron_id: string;
|
|
258
|
-
assistant_id: string;
|
|
259
|
-
thread_id: string | undefined;
|
|
260
|
-
user_id: string;
|
|
261
|
-
payload: Record<string, unknown>;
|
|
262
|
-
schedule: string;
|
|
263
|
-
next_run_date: string;
|
|
264
|
-
end_time: string | undefined;
|
|
265
|
-
created_at: string;
|
|
266
|
-
updated_at: string;
|
|
267
|
-
metadata: Metadata;
|
|
268
|
-
}
|
|
269
|
-
interface CronCreateForThreadResponse extends Omit<CronCreateResponse, "thread_id"> {
|
|
270
|
-
thread_id: string;
|
|
271
|
-
}
|
|
272
|
-
type AssistantSortBy = "assistant_id" | "graph_id" | "name" | "created_at" | "updated_at";
|
|
273
|
-
type ThreadSortBy = "thread_id" | "status" | "created_at" | "updated_at";
|
|
274
|
-
type CronSortBy = "cron_id" | "assistant_id" | "thread_id" | "created_at" | "updated_at" | "next_run_date";
|
|
275
|
-
type SortOrder = "asc" | "desc";
|
|
276
|
-
// Select field aliases for client-side typing of `select` parameters.
|
|
277
|
-
// These mirror the server's allowed field sets.
|
|
278
|
-
type AssistantSelectField = "assistant_id" | "graph_id" | "name" | "description" | "config" | "context" | "created_at" | "updated_at" | "metadata" | "version";
|
|
279
|
-
type ThreadSelectField = "thread_id" | "created_at" | "updated_at" | "metadata" | "config" | "context" | "status" | "values" | "interrupts";
|
|
280
|
-
type RunSelectField = "run_id" | "thread_id" | "assistant_id" | "created_at" | "updated_at" | "status" | "metadata" | "kwargs" | "multitask_strategy";
|
|
281
|
-
type CronSelectField = "cron_id" | "assistant_id" | "thread_id" | "end_time" | "schedule" | "created_at" | "updated_at" | "user_id" | "payload" | "next_run_date" | "metadata" | "now";
|
|
282
|
-
//#endregion
|
|
283
|
-
export { Assistant, AssistantBase, AssistantGraph, AssistantSelectField, AssistantSortBy, AssistantVersion, AssistantsSearchResponse, CancelAction, Checkpoint, Config, Cron, CronCreateForThreadResponse, CronCreateResponse, CronSelectField, CronSortBy, DefaultValues, GraphSchema, Interrupt, Item, ListNamespaceResponse, Metadata, Run, RunSelectField, RunStatus, SearchItem, SearchItemsResponse, SortOrder, Subgraphs, Thread, ThreadSelectField, ThreadSortBy, ThreadState, ThreadStatus, ThreadTask, ThreadValuesFilter };
|
|
284
|
-
//# sourceMappingURL=schema.d.ts.map
|
package/dist/schema.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","names":["JSONSchema7","Optional","T","RunStatus","ThreadStatus","MultitaskStrategy","CancelAction","Config","GraphSchema","Subgraphs","Record","Metadata","AssistantBase","AssistantVersion","Assistant","AssistantsSearchResponse","AssistantGraph","Array","Interrupt","TValue","Thread","DefaultValues","ValuesType","Cron","ThreadValuesFilter","ThreadState","Checkpoint","ThreadTask","Run","ListNamespaceResponse","Item","SearchItem","SearchItemsResponse","CronCreateResponse","CronCreateForThreadResponse","Omit","AssistantSortBy","ThreadSortBy","CronSortBy","SortOrder","AssistantSelectField","ThreadSelectField","RunSelectField","CronSelectField"],"sources":["../src/schema.d.ts"],"sourcesContent":["import type { JSONSchema7 } from \"json-schema\";\ntype Optional<T> = T | null | undefined;\nexport type RunStatus = \"pending\" | \"running\" | \"error\" | \"success\" | \"timeout\" | \"interrupted\";\nexport type ThreadStatus = \"idle\" | \"busy\" | \"interrupted\" | \"error\";\ntype MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type CancelAction = \"interrupt\" | \"rollback\";\nexport type Config = {\n /**\n * Tags for this call and any sub-calls (eg. a Chain calling an LLM).\n * You can use these to filter calls.\n */\n tags?: string[];\n /**\n * Maximum number of times a call can recurse.\n * If not provided, defaults to 25.\n */\n recursion_limit?: number;\n /**\n * Runtime values for attributes previously made configurable on this Runnable.\n */\n configurable?: {\n /**\n * ID of the thread\n */\n thread_id?: Optional<string>;\n /**\n * Timestamp of the state checkpoint\n */\n checkpoint_id?: Optional<string>;\n [key: string]: unknown;\n };\n};\nexport interface GraphSchema {\n /**\n * The ID of the graph.\n */\n graph_id: string;\n /**\n * The schema for the input state.\n * Missing if unable to generate JSON schema from graph.\n */\n input_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the output state.\n * Missing if unable to generate JSON schema from graph.\n */\n output_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph state.\n * Missing if unable to generate JSON schema from graph.\n */\n state_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph config.\n * Missing if unable to generate JSON schema from graph.\n */\n config_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph context.\n * Missing if unable to generate JSON schema from graph.\n */\n context_schema?: JSONSchema7 | null | undefined;\n}\nexport type Subgraphs = Record<string, GraphSchema>;\nexport type Metadata = Optional<{\n source?: \"input\" | \"loop\" | \"update\" | (string & {}); // eslint-disable-line @typescript-eslint/ban-types\n step?: number;\n writes?: Record<string, unknown> | null;\n parents?: Record<string, string>;\n [key: string]: unknown;\n}>;\nexport interface AssistantBase {\n /** The ID of the assistant. */\n assistant_id: string;\n /** The ID of the graph. */\n graph_id: string;\n /** The assistant config. */\n config: Config;\n /** The assistant context. */\n context: unknown;\n /** The time the assistant was created. */\n created_at: string;\n /** The assistant metadata. */\n metadata: Metadata;\n /** The version of the assistant. */\n version: number;\n /** The name of the assistant */\n name: string;\n /** The description of the assistant */\n description?: string;\n}\nexport interface AssistantVersion extends AssistantBase {\n}\nexport interface Assistant extends AssistantBase {\n /** The last time the assistant was updated. */\n updated_at: string;\n}\nexport interface AssistantsSearchResponse {\n /** The assistants returned for the current search page. */\n assistants: Assistant[];\n /** Pagination cursor from the X-Pagination-Next response header. */\n next: string | null;\n}\nexport interface AssistantGraph {\n nodes: Array<{\n id: string | number;\n name?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data?: Record<string, any> | string;\n metadata?: unknown;\n }>;\n edges: Array<{\n source: string;\n target: string;\n data?: string;\n conditional?: boolean;\n }>;\n}\n/**\n * An interrupt thrown inside a thread.\n */\nexport interface Interrupt<TValue = unknown> {\n /**\n * The ID of the interrupt.\n */\n id?: string;\n /**\n * The value of the interrupt.\n */\n value?: TValue;\n /**\n * Will be deprecated in the future.\n * @deprecated Will be removed in the future.\n */\n when?: \"during\" | (string & {}); // eslint-disable-line @typescript-eslint/ban-types\n /**\n * Whether the interrupt can be resumed.\n * @deprecated Will be removed in the future.\n */\n resumable?: boolean;\n /**\n * The namespace of the interrupt.\n * @deprecated Replaced by `interrupt_id`\n */\n ns?: string[];\n}\nexport interface Thread<ValuesType = DefaultValues> {\n /** The ID of the thread. */\n thread_id: string;\n /** The time the thread was created. */\n created_at: string;\n /** The last time the thread was updated. */\n updated_at: string;\n /** The thread metadata. */\n metadata: Metadata;\n /** The status of the thread */\n status: ThreadStatus;\n /** The current state of the thread. */\n values: ValuesType;\n /** Interrupts which were thrown in this thread */\n interrupts: Record<string, Array<Interrupt>>;\n}\nexport interface Cron {\n /** The ID of the cron */\n cron_id: string;\n /** The ID of the assistant */\n assistant_id: string;\n /** The ID of the thread */\n thread_id: Optional<string>;\n /** The end date to stop running the cron. */\n end_time: Optional<string>;\n /** The schedule to run, cron format. */\n schedule: string;\n /** The time the cron was created. */\n created_at: string;\n /** The last time the cron was updated. */\n updated_at: string;\n /** The run payload to use for creating new run. */\n payload: Record<string, unknown>;\n /** The user ID of the cron */\n user_id: Optional<string>;\n /** The next run date of the cron */\n next_run_date: Optional<string>;\n /** The metadata of the cron */\n metadata: Record<string, unknown>;\n}\nexport type DefaultValues = Record<string, unknown>[] | Record<string, unknown>;\nexport type ThreadValuesFilter = Record<string, unknown>;\nexport interface ThreadState<ValuesType = DefaultValues> {\n /** The state values */\n values: ValuesType;\n /** The next nodes to execute. If empty, the thread is done until new input is received */\n next: string[];\n /** Checkpoint of the thread state */\n checkpoint: Checkpoint;\n /** Metadata for this state */\n metadata: Metadata;\n /** Time of state creation */\n created_at: Optional<string>;\n /** The parent checkpoint. If missing, this is the root checkpoint */\n parent_checkpoint: Optional<Checkpoint>;\n /** Tasks to execute in this step. If already attempted, may contain an error */\n tasks: Array<ThreadTask>;\n}\nexport interface ThreadTask {\n id: string;\n name: string;\n result?: unknown;\n error: Optional<string>;\n interrupts: Array<Interrupt>;\n checkpoint: Optional<Checkpoint>;\n state: Optional<ThreadState>;\n}\nexport interface Run {\n /** The ID of the run */\n run_id: string;\n /** The ID of the thread */\n thread_id: string;\n /** The assistant that wwas used for this run */\n assistant_id: string;\n /** The time the run was created */\n created_at: string;\n /** The last time the run was updated */\n updated_at: string;\n /** The status of the run. */\n status: RunStatus;\n /** Run metadata */\n metadata: Metadata;\n /** Strategy to handle concurrent runs on the same thread */\n multitask_strategy: Optional<MultitaskStrategy>;\n}\nexport type Checkpoint = {\n thread_id: string;\n checkpoint_ns: string;\n checkpoint_id: Optional<string>;\n checkpoint_map: Optional<Record<string, unknown>>;\n};\nexport interface ListNamespaceResponse {\n namespaces: string[][];\n}\nexport interface Item {\n namespace: string[];\n key: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: Record<string, any>;\n createdAt: string;\n updatedAt: string;\n}\nexport interface SearchItem extends Item {\n score?: number;\n}\nexport interface SearchItemsResponse {\n items: SearchItem[];\n}\nexport interface CronCreateResponse {\n cron_id: string;\n assistant_id: string;\n thread_id: string | undefined;\n user_id: string;\n payload: Record<string, unknown>;\n schedule: string;\n next_run_date: string;\n end_time: string | undefined;\n created_at: string;\n updated_at: string;\n metadata: Metadata;\n}\nexport interface CronCreateForThreadResponse extends Omit<CronCreateResponse, \"thread_id\"> {\n thread_id: string;\n}\nexport type AssistantSortBy = \"assistant_id\" | \"graph_id\" | \"name\" | \"created_at\" | \"updated_at\";\nexport type ThreadSortBy = \"thread_id\" | \"status\" | \"created_at\" | \"updated_at\";\nexport type CronSortBy = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"created_at\" | \"updated_at\" | \"next_run_date\";\nexport type SortOrder = \"asc\" | \"desc\";\n// Select field aliases for client-side typing of `select` parameters.\n// These mirror the server's allowed field sets.\nexport type AssistantSelectField = \"assistant_id\" | \"graph_id\" | \"name\" | \"description\" | \"config\" | \"context\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"version\";\nexport type ThreadSelectField = \"thread_id\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"config\" | \"context\" | \"status\" | \"values\" | \"interrupts\";\nexport type RunSelectField = \"run_id\" | \"thread_id\" | \"assistant_id\" | \"created_at\" | \"updated_at\" | \"status\" | \"metadata\" | \"kwargs\" | \"multitask_strategy\";\nexport type CronSelectField = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"end_time\" | \"schedule\" | \"created_at\" | \"updated_at\" | \"user_id\" | \"payload\" | \"next_run_date\" | \"metadata\" | \"now\";\nexport {};\n"],"mappings":"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"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/singletons/fetch.ts
|
|
3
|
-
const DEFAULT_FETCH_IMPLEMENTATION = (...args) => fetch(...args);
|
|
4
|
-
const LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for("lg:fetch_implementation");
|
|
5
|
-
/**
|
|
6
|
-
* Overrides the fetch implementation used for LangSmith calls.
|
|
7
|
-
* You should use this if you need to use an implementation of fetch
|
|
8
|
-
* other than the default global (e.g. for dealing with proxies).
|
|
9
|
-
* @param fetch The new fetch function to use.
|
|
10
|
-
*/
|
|
11
|
-
const overrideFetchImplementation = (fetch$1) => {
|
|
12
|
-
globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch$1;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
const _getFetchImplementation = () => {
|
|
18
|
-
return globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] ?? DEFAULT_FETCH_IMPLEMENTATION;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
exports._getFetchImplementation = _getFetchImplementation;
|
|
23
|
-
exports.overrideFetchImplementation = overrideFetchImplementation;
|
|
24
|
-
//# sourceMappingURL=fetch.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.cjs","names":["fetch","_getFetchImplementation: () => (...args: any[]) => any"],"sources":["../../src/singletons/fetch.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n// Wrap the default fetch call due to issues with illegal invocations\n// in some environments:\n// https://stackoverflow.com/questions/69876859/why-does-bind-fix-failed-to-execute-fetch-on-window-illegal-invocation-err\n// @ts-expect-error Broad typing to support a range of fetch implementations\nconst DEFAULT_FETCH_IMPLEMENTATION = (...args: any[]) => fetch(...args);\n\nconst LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for(\n \"lg:fetch_implementation\"\n);\n\n/**\n * Overrides the fetch implementation used for LangSmith calls.\n * You should use this if you need to use an implementation of fetch\n * other than the default global (e.g. for dealing with proxies).\n * @param fetch The new fetch function to use.\n */\nexport const overrideFetchImplementation = (fetch: (...args: any[]) => any) => {\n (globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;\n};\n\n/**\n * @internal\n */\nexport const _getFetchImplementation: () => (...args: any[]) => any = () => {\n return (\n (globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] ??\n DEFAULT_FETCH_IMPLEMENTATION\n );\n};\n"],"mappings":";;AAKA,MAAM,gCAAgC,GAAG,SAAgB,MAAM,GAAG;AAElE,MAAM,qCAAqC,OAAO,IAChD;;;;;;;AASF,MAAa,+BAA+B,YAAmC;AAC7E,CAAC,WAAmB,sCAAsCA;;;;;AAM5D,MAAaC,gCAA+D;AAC1E,QACG,WAAmB,uCACpB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/singletons/fetch.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Overrides the fetch implementation used for LangSmith calls.
|
|
4
|
-
* You should use this if you need to use an implementation of fetch
|
|
5
|
-
* other than the default global (e.g. for dealing with proxies).
|
|
6
|
-
* @param fetch The new fetch function to use.
|
|
7
|
-
*/
|
|
8
|
-
declare const overrideFetchImplementation: (fetch: (...args: any[]) => any) => void;
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
//#endregion
|
|
13
|
-
export { overrideFetchImplementation };
|
|
14
|
-
//# sourceMappingURL=fetch.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.cts","names":["overrideFetchImplementation","_getFetchImplementation"],"sources":["../../src/singletons/fetch.d.ts"],"sourcesContent":["/**\n * Overrides the fetch implementation used for LangSmith calls.\n * You should use this if you need to use an implementation of fetch\n * other than the default global (e.g. for dealing with proxies).\n * @param fetch The new fetch function to use.\n */\nexport declare const overrideFetchImplementation: (fetch: (...args: any[]) => any) => void;\n/**\n * @internal\n */\nexport declare const _getFetchImplementation: () => (...args: any[]) => any;\n"],"mappings":";;AAMA;;;;;cAAqBA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/singletons/fetch.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Overrides the fetch implementation used for LangSmith calls.
|
|
4
|
-
* You should use this if you need to use an implementation of fetch
|
|
5
|
-
* other than the default global (e.g. for dealing with proxies).
|
|
6
|
-
* @param fetch The new fetch function to use.
|
|
7
|
-
*/
|
|
8
|
-
declare const overrideFetchImplementation: (fetch: (...args: any[]) => any) => void;
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
//#endregion
|
|
13
|
-
export { overrideFetchImplementation };
|
|
14
|
-
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","names":["overrideFetchImplementation","_getFetchImplementation"],"sources":["../../src/singletons/fetch.d.ts"],"sourcesContent":["/**\n * Overrides the fetch implementation used for LangSmith calls.\n * You should use this if you need to use an implementation of fetch\n * other than the default global (e.g. for dealing with proxies).\n * @param fetch The new fetch function to use.\n */\nexport declare const overrideFetchImplementation: (fetch: (...args: any[]) => any) => void;\n/**\n * @internal\n */\nexport declare const _getFetchImplementation: () => (...args: any[]) => any;\n"],"mappings":";;AAMA;;;;;cAAqBA"}
|
package/dist/singletons/fetch.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region src/singletons/fetch.ts
|
|
2
|
-
const DEFAULT_FETCH_IMPLEMENTATION = (...args) => fetch(...args);
|
|
3
|
-
const LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for("lg:fetch_implementation");
|
|
4
|
-
/**
|
|
5
|
-
* Overrides the fetch implementation used for LangSmith calls.
|
|
6
|
-
* You should use this if you need to use an implementation of fetch
|
|
7
|
-
* other than the default global (e.g. for dealing with proxies).
|
|
8
|
-
* @param fetch The new fetch function to use.
|
|
9
|
-
*/
|
|
10
|
-
const overrideFetchImplementation = (fetch$1) => {
|
|
11
|
-
globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch$1;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
const _getFetchImplementation = () => {
|
|
17
|
-
return globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] ?? DEFAULT_FETCH_IMPLEMENTATION;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
export { _getFetchImplementation, overrideFetchImplementation };
|
|
22
|
-
//# sourceMappingURL=fetch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","names":["fetch","_getFetchImplementation: () => (...args: any[]) => any"],"sources":["../../src/singletons/fetch.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n// Wrap the default fetch call due to issues with illegal invocations\n// in some environments:\n// https://stackoverflow.com/questions/69876859/why-does-bind-fix-failed-to-execute-fetch-on-window-illegal-invocation-err\n// @ts-expect-error Broad typing to support a range of fetch implementations\nconst DEFAULT_FETCH_IMPLEMENTATION = (...args: any[]) => fetch(...args);\n\nconst LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for(\n \"lg:fetch_implementation\"\n);\n\n/**\n * Overrides the fetch implementation used for LangSmith calls.\n * You should use this if you need to use an implementation of fetch\n * other than the default global (e.g. for dealing with proxies).\n * @param fetch The new fetch function to use.\n */\nexport const overrideFetchImplementation = (fetch: (...args: any[]) => any) => {\n (globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;\n};\n\n/**\n * @internal\n */\nexport const _getFetchImplementation: () => (...args: any[]) => any = () => {\n return (\n (globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] ??\n DEFAULT_FETCH_IMPLEMENTATION\n );\n};\n"],"mappings":";AAKA,MAAM,gCAAgC,GAAG,SAAgB,MAAM,GAAG;AAElE,MAAM,qCAAqC,OAAO,IAChD;;;;;;;AASF,MAAa,+BAA+B,YAAmC;AAC7E,CAAC,WAAmB,sCAAsCA;;;;;AAM5D,MAAaC,gCAA+D;AAC1E,QACG,WAAmB,uCACpB"}
|
package/dist/types.d.cts
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { Checkpoint, Config, Metadata } from "./schema.cjs";
|
|
2
|
-
import { StreamMode } from "./types.stream.cjs";
|
|
3
|
-
import { LangChainTracer } from "@langchain/core/tracers/tracer_langchain";
|
|
4
|
-
|
|
5
|
-
//#region src/types.d.ts
|
|
6
|
-
type MultitaskStrategy = "reject" | "interrupt" | "rollback" | "enqueue";
|
|
7
|
-
type OnConflictBehavior = "raise" | "do_nothing";
|
|
8
|
-
type OnCompletionBehavior = "complete" | "continue";
|
|
9
|
-
type DisconnectMode = "cancel" | "continue";
|
|
10
|
-
type Durability = "exit" | "async" | "sync";
|
|
11
|
-
type StreamEvent = "events" | "metadata" | "debug" | "updates" | "values" | "messages/partial" | "messages/metadata" | "messages/complete" | "messages" | (string & {}); // eslint-disable-line @typescript-eslint/ban-types
|
|
12
|
-
interface Send {
|
|
13
|
-
node: string;
|
|
14
|
-
input: unknown | null;
|
|
15
|
-
}
|
|
16
|
-
interface Command {
|
|
17
|
-
/**
|
|
18
|
-
* An object to update the thread state with.
|
|
19
|
-
*/
|
|
20
|
-
update?: Record<string, unknown> | [string, unknown][] | null;
|
|
21
|
-
/**
|
|
22
|
-
* The value to return from an `interrupt` function call.
|
|
23
|
-
*/
|
|
24
|
-
resume?: unknown;
|
|
25
|
-
/**
|
|
26
|
-
* Determine the next node to navigate to. Can be one of the following:
|
|
27
|
-
* - Name(s) of the node names to navigate to next.
|
|
28
|
-
* - `Send` command(s) to execute node(s) with provided input.
|
|
29
|
-
*/
|
|
30
|
-
goto?: Send | Send[] | string | string[];
|
|
31
|
-
}
|
|
32
|
-
interface RunsInvokePayload {
|
|
33
|
-
/**
|
|
34
|
-
* Input to the run. Pass `null` to resume from the current state of the thread.
|
|
35
|
-
*/
|
|
36
|
-
input?: Record<string, unknown> | null;
|
|
37
|
-
/**
|
|
38
|
-
* Metadata for the run.
|
|
39
|
-
*/
|
|
40
|
-
metadata?: Metadata;
|
|
41
|
-
/**
|
|
42
|
-
* Additional configuration for the run.
|
|
43
|
-
*/
|
|
44
|
-
config?: Config;
|
|
45
|
-
/**
|
|
46
|
-
* Static context to add to the assistant.
|
|
47
|
-
* @remarks Added in LangGraph.js 0.4
|
|
48
|
-
*/
|
|
49
|
-
context?: unknown;
|
|
50
|
-
/**
|
|
51
|
-
* Checkpoint ID for when creating a new run.
|
|
52
|
-
*/
|
|
53
|
-
checkpointId?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Checkpoint for when creating a new run.
|
|
56
|
-
*/
|
|
57
|
-
checkpoint?: Omit<Checkpoint, "thread_id">;
|
|
58
|
-
/**
|
|
59
|
-
* Whether to checkpoint during the run (or only at the end/interruption).
|
|
60
|
-
* @deprecated Use `durability` instead.
|
|
61
|
-
*/
|
|
62
|
-
checkpointDuring?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Whether to checkpoint during the run (or only at the end/interruption).
|
|
65
|
-
* - `"async"`: Save checkpoint asynchronously while the next step executes (default).
|
|
66
|
-
* - `"sync"`: Save checkpoint synchronously before the next step starts.
|
|
67
|
-
* - `"exit"`: Save checkpoint only when the graph exits.
|
|
68
|
-
* @default "async"
|
|
69
|
-
*/
|
|
70
|
-
durability?: Durability;
|
|
71
|
-
/**
|
|
72
|
-
* Interrupt execution before entering these nodes.
|
|
73
|
-
*/
|
|
74
|
-
interruptBefore?: "*" | string[];
|
|
75
|
-
/**
|
|
76
|
-
* Interrupt execution after leaving these nodes.
|
|
77
|
-
*/
|
|
78
|
-
interruptAfter?: "*" | string[];
|
|
79
|
-
/**
|
|
80
|
-
* Strategy to handle concurrent runs on the same thread. Only relevant if
|
|
81
|
-
* there is a pending/inflight run on the same thread. One of:
|
|
82
|
-
* - "reject": Reject the new run.
|
|
83
|
-
* - "interrupt": Interrupt the current run, keeping steps completed until now,
|
|
84
|
-
and start a new one.
|
|
85
|
-
* - "rollback": Cancel and delete the existing run, rolling back the thread to
|
|
86
|
-
the state before it had started, then start the new run.
|
|
87
|
-
* - "enqueue": Queue up the new run to start after the current run finishes.
|
|
88
|
-
*/
|
|
89
|
-
multitaskStrategy?: MultitaskStrategy;
|
|
90
|
-
/**
|
|
91
|
-
* Abort controller signal to cancel the run.
|
|
92
|
-
*/
|
|
93
|
-
signal?: AbortController["signal"];
|
|
94
|
-
/**
|
|
95
|
-
* Behavior to handle run completion. Only relevant if
|
|
96
|
-
* there is a pending/inflight run on the same thread. One of:
|
|
97
|
-
* - "complete": Complete the run.
|
|
98
|
-
* - "continue": Continue the run.
|
|
99
|
-
*/
|
|
100
|
-
onCompletion?: OnCompletionBehavior;
|
|
101
|
-
/**
|
|
102
|
-
* Webhook to call when the run is complete.
|
|
103
|
-
*/
|
|
104
|
-
webhook?: string;
|
|
105
|
-
/**
|
|
106
|
-
* Behavior to handle disconnection. Only relevant if
|
|
107
|
-
* there is a pending/inflight run on the same thread. One of:
|
|
108
|
-
* - "cancel": Cancel the run.
|
|
109
|
-
* - "continue": Continue the run.
|
|
110
|
-
*/
|
|
111
|
-
onDisconnect?: DisconnectMode;
|
|
112
|
-
/**
|
|
113
|
-
* The number of seconds to wait before starting the run.
|
|
114
|
-
* Use to schedule future runs.
|
|
115
|
-
*/
|
|
116
|
-
afterSeconds?: number;
|
|
117
|
-
/**
|
|
118
|
-
* Behavior if the specified run doesn't exist. Defaults to "reject".
|
|
119
|
-
*/
|
|
120
|
-
ifNotExists?: "create" | "reject";
|
|
121
|
-
/**
|
|
122
|
-
* One or more commands to invoke the graph with.
|
|
123
|
-
*/
|
|
124
|
-
command?: Command;
|
|
125
|
-
/**
|
|
126
|
-
* Callback when a run is created.
|
|
127
|
-
*/
|
|
128
|
-
onRunCreated?: (params: {
|
|
129
|
-
run_id: string;
|
|
130
|
-
thread_id?: string;
|
|
131
|
-
}) => void;
|
|
132
|
-
/**
|
|
133
|
-
* @internal
|
|
134
|
-
* For LangSmith tracing purposes only. Not part of the public API.
|
|
135
|
-
*/
|
|
136
|
-
_langsmithTracer?: LangChainTracer;
|
|
137
|
-
}
|
|
138
|
-
interface RunsStreamPayload<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false> extends RunsInvokePayload {
|
|
139
|
-
/**
|
|
140
|
-
* One of `"values"`, `"messages"`, `"messages-tuple"`, `"updates"`, `"events"`, `"debug"`, `"custom"`.
|
|
141
|
-
*/
|
|
142
|
-
streamMode?: TStreamMode;
|
|
143
|
-
/**
|
|
144
|
-
* Stream output from subgraphs. By default, streams only the top graph.
|
|
145
|
-
*/
|
|
146
|
-
streamSubgraphs?: TSubgraphs;
|
|
147
|
-
/**
|
|
148
|
-
* Whether the stream is considered resumable.
|
|
149
|
-
* If true, the stream can be resumed and replayed in its entirety even after disconnection.
|
|
150
|
-
*/
|
|
151
|
-
streamResumable?: boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Pass one or more feedbackKeys if you want to request short-lived signed URLs
|
|
154
|
-
* for submitting feedback to LangSmith with this key for this run.
|
|
155
|
-
*/
|
|
156
|
-
feedbackKeys?: string[];
|
|
157
|
-
}
|
|
158
|
-
interface RunsCreatePayload extends RunsInvokePayload {
|
|
159
|
-
/**
|
|
160
|
-
* One of `"values"`, `"messages"`, `"messages-tuple"`, `"updates"`, `"events"`, `"debug"`, `"custom"`.
|
|
161
|
-
*/
|
|
162
|
-
streamMode?: StreamMode | Array<StreamMode>;
|
|
163
|
-
/**
|
|
164
|
-
* Stream output from subgraphs. By default, streams only the top graph.
|
|
165
|
-
*/
|
|
166
|
-
streamSubgraphs?: boolean;
|
|
167
|
-
/**
|
|
168
|
-
* Whether the stream is considered resumable.
|
|
169
|
-
* If true, the stream can be resumed and replayed in its entirety even after disconnection.
|
|
170
|
-
*/
|
|
171
|
-
streamResumable?: boolean;
|
|
172
|
-
}
|
|
173
|
-
interface CronsCreatePayload extends RunsCreatePayload {
|
|
174
|
-
/**
|
|
175
|
-
* Schedule for running the Cron Job
|
|
176
|
-
*/
|
|
177
|
-
schedule: string;
|
|
178
|
-
}
|
|
179
|
-
interface RunsWaitPayload extends RunsStreamPayload {
|
|
180
|
-
/**
|
|
181
|
-
* Raise errors returned by the run. Default is `true`.
|
|
182
|
-
*/
|
|
183
|
-
raiseError?: boolean;
|
|
184
|
-
}
|
|
185
|
-
//#endregion
|
|
186
|
-
export { Command, CronsCreatePayload, DisconnectMode, Durability, MultitaskStrategy, OnCompletionBehavior, OnConflictBehavior, RunsCreatePayload, RunsInvokePayload, RunsStreamPayload, RunsWaitPayload, StreamEvent };
|
|
187
|
-
//# sourceMappingURL=types.d.cts.map
|
package/dist/types.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":["LangChainTracer","Checkpoint","Config","Metadata","StreamMode","MultitaskStrategy","OnConflictBehavior","OnCompletionBehavior","DisconnectMode","Durability","StreamEvent","Send","Command","Record","RunsInvokePayload","Omit","AbortController","RunsStreamPayload","TStreamMode","TSubgraphs","RunsCreatePayload","Array","CronsCreatePayload","RunsWaitPayload"],"sources":["../src/types.d.ts"],"sourcesContent":["import { LangChainTracer } from \"@langchain/core/tracers/tracer_langchain\";\nimport { Checkpoint, Config, Metadata } from \"./schema.js\";\nimport { StreamMode } from \"./types.stream.js\";\nexport type MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type OnConflictBehavior = \"raise\" | \"do_nothing\";\nexport type OnCompletionBehavior = \"complete\" | \"continue\";\nexport type DisconnectMode = \"cancel\" | \"continue\";\nexport type Durability = \"exit\" | \"async\" | \"sync\";\nexport type StreamEvent = \"events\" | \"metadata\" | \"debug\" | \"updates\" | \"values\" | \"messages/partial\" | \"messages/metadata\" | \"messages/complete\" | \"messages\" | (string & {}); // eslint-disable-line @typescript-eslint/ban-types\nexport interface Send {\n node: string;\n input: unknown | null;\n}\nexport interface Command {\n /**\n * An object to update the thread state with.\n */\n update?: Record<string, unknown> | [string, unknown][] | null;\n /**\n * The value to return from an `interrupt` function call.\n */\n resume?: unknown;\n /**\n * Determine the next node to navigate to. Can be one of the following:\n * - Name(s) of the node names to navigate to next.\n * - `Send` command(s) to execute node(s) with provided input.\n */\n goto?: Send | Send[] | string | string[];\n}\nexport interface RunsInvokePayload {\n /**\n * Input to the run. Pass `null` to resume from the current state of the thread.\n */\n input?: Record<string, unknown> | null;\n /**\n * Metadata for the run.\n */\n metadata?: Metadata;\n /**\n * Additional configuration for the run.\n */\n config?: Config;\n /**\n * Static context to add to the assistant.\n * @remarks Added in LangGraph.js 0.4\n */\n context?: unknown;\n /**\n * Checkpoint ID for when creating a new run.\n */\n checkpointId?: string;\n /**\n * Checkpoint for when creating a new run.\n */\n checkpoint?: Omit<Checkpoint, \"thread_id\">;\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * @deprecated Use `durability` instead.\n */\n checkpointDuring?: boolean;\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * - `\"async\"`: Save checkpoint asynchronously while the next step executes (default).\n * - `\"sync\"`: Save checkpoint synchronously before the next step starts.\n * - `\"exit\"`: Save checkpoint only when the graph exits.\n * @default \"async\"\n */\n durability?: Durability;\n /**\n * Interrupt execution before entering these nodes.\n */\n interruptBefore?: \"*\" | string[];\n /**\n * Interrupt execution after leaving these nodes.\n */\n interruptAfter?: \"*\" | string[];\n /**\n * Strategy to handle concurrent runs on the same thread. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"reject\": Reject the new run.\n * - \"interrupt\": Interrupt the current run, keeping steps completed until now,\n and start a new one.\n * - \"rollback\": Cancel and delete the existing run, rolling back the thread to\n the state before it had started, then start the new run.\n * - \"enqueue\": Queue up the new run to start after the current run finishes.\n */\n multitaskStrategy?: MultitaskStrategy;\n /**\n * Abort controller signal to cancel the run.\n */\n signal?: AbortController[\"signal\"];\n /**\n * Behavior to handle run completion. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"complete\": Complete the run.\n * - \"continue\": Continue the run.\n */\n onCompletion?: OnCompletionBehavior;\n /**\n * Webhook to call when the run is complete.\n */\n webhook?: string;\n /**\n * Behavior to handle disconnection. Only relevant if\n * there is a pending/inflight run on the same thread. One of:\n * - \"cancel\": Cancel the run.\n * - \"continue\": Continue the run.\n */\n onDisconnect?: DisconnectMode;\n /**\n * The number of seconds to wait before starting the run.\n * Use to schedule future runs.\n */\n afterSeconds?: number;\n /**\n * Behavior if the specified run doesn't exist. Defaults to \"reject\".\n */\n ifNotExists?: \"create\" | \"reject\";\n /**\n * One or more commands to invoke the graph with.\n */\n command?: Command;\n /**\n * Callback when a run is created.\n */\n onRunCreated?: (params: {\n run_id: string;\n thread_id?: string;\n }) => void;\n /**\n * @internal\n * For LangSmith tracing purposes only. Not part of the public API.\n */\n _langsmithTracer?: LangChainTracer;\n}\nexport interface RunsStreamPayload<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false> extends RunsInvokePayload {\n /**\n * One of `\"values\"`, `\"messages\"`, `\"messages-tuple\"`, `\"updates\"`, `\"events\"`, `\"debug\"`, `\"custom\"`.\n */\n streamMode?: TStreamMode;\n /**\n * Stream output from subgraphs. By default, streams only the top graph.\n */\n streamSubgraphs?: TSubgraphs;\n /**\n * Whether the stream is considered resumable.\n * If true, the stream can be resumed and replayed in its entirety even after disconnection.\n */\n streamResumable?: boolean;\n /**\n * Pass one or more feedbackKeys if you want to request short-lived signed URLs\n * for submitting feedback to LangSmith with this key for this run.\n */\n feedbackKeys?: string[];\n}\nexport interface RunsCreatePayload extends RunsInvokePayload {\n /**\n * One of `\"values\"`, `\"messages\"`, `\"messages-tuple\"`, `\"updates\"`, `\"events\"`, `\"debug\"`, `\"custom\"`.\n */\n streamMode?: StreamMode | Array<StreamMode>;\n /**\n * Stream output from subgraphs. By default, streams only the top graph.\n */\n streamSubgraphs?: boolean;\n /**\n * Whether the stream is considered resumable.\n * If true, the stream can be resumed and replayed in its entirety even after disconnection.\n */\n streamResumable?: boolean;\n}\nexport interface CronsCreatePayload extends RunsCreatePayload {\n /**\n * Schedule for running the Cron Job\n */\n schedule: string;\n}\nexport interface RunsWaitPayload extends RunsStreamPayload {\n /**\n * Raise errors returned by the run. Default is `true`.\n */\n raiseError?: boolean;\n}\n"],"mappings":";;;;;KAGYK,iBAAAA;KACAC,kBAAAA;AADAD,KAEAE,oBAAAA,GAFiB,UAAA,GAAA,UAAA;AACjBD,KAEAE,cAAAA,GAFkB,QAAA,GAAA,UAAA;AAClBD,KAEAE,UAAAA,GAFAF,MAAoB,GAAA,OAAA,GAAA,MAAA;AACpBC,KAEAE,WAAAA,GAFc,QAAA,GAAA,UAAA,GAAA,OAAA,GAAA,SAAA,GAAA,QAAA,GAAA,kBAAA,GAAA,mBAAA,GAAA,mBAAA,GAAA,UAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACdD,UAEKE,IAAAA,CAFK;EACVD,IAAAA,EAAAA,MAAAA;EACKC,KAAAA,EAAI,OAAA,GAAA,IAAA;AAIrB;AAAwB,UAAPC,OAAAA,CAAO;;;;WAIXC;EAYIC;;;QAQFX,CAAAA,EAAAA,OAAAA;;;;;;MAqDFa,CAAAA,EA/DFL,IA+DEK,GA/DKL,IA+DLK,EAAAA,GAAAA,MAAAA,GAAAA,MAAAA,EAAAA;;AAkBMR,UA/EFM,iBAAAA,CA+EEN;;;;EA2BFS,KAAAA,CAAAA,EAtGLJ,MAsGKI,CAAAA,MAAiB,EAAA,OAAA,CAAA,GAAA,IAAA;EAAA;;;UAIjBC,CAAAA,EAtGFf,QAsGEe;;;;EAgBAE,MAAAA,CAAAA,EAlHJlB,MAkHIkB;EAAiB;;;;SAASN,CAAAA,EAAAA,OAAAA;;AAe3C;AAMA;;;;;eA1HiBC,KAAKd;;;;;;;;;;;;;eAaLQ;;;;;;;;;;;;;;;;;;;sBAmBOJ;;;;WAIXW;;;;;;;iBAOMT;;;;;;;;;;;iBAWAC;;;;;;;;;;;;;YAaLI;;;;;;;;;;;;qBAYSZ;;UAENiB,sCAAsCb,aAAaA,+DAA+DU;;;;eAIlHI;;;;oBAIKC;;;;;;;;;;;;UAYLC,iBAAAA,SAA0BN;;;;eAI1BV,aAAaiB,MAAMjB;;;;;;;;;;;UAWnBkB,kBAAAA,SAA2BF;;;;;;UAM3BG,eAAAA,SAAwBN"}
|