@langchain/langgraph 0.2.59 → 0.2.60

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isCommandParams = exports.isCommand = exports.Command = exports._isSend = exports.Send = exports._isSendInterface = exports.CHECKPOINT_NAMESPACE_END = exports.CHECKPOINT_NAMESPACE_SEPARATOR = exports.RESERVED = exports.NULL_TASK_ID = exports.TASK_NAMESPACE = exports.PULL = exports.PUSH = exports.TASKS = exports.SELF = exports.TAG_NOSTREAM = exports.TAG_HIDDEN = exports.RECURSION_LIMIT_DEFAULT = exports.RUNTIME_PLACEHOLDER = exports.PREVIOUS = exports.RETURN = exports.NO_WRITES = exports.RESUME = exports.INTERRUPT = exports.CONFIG_KEY_CHECKPOINT_MAP = exports.CONFIG_KEY_NODE_FINISHED = exports.CONFIG_KEY_CHECKPOINT_NS = exports.CONFIG_KEY_CHECKPOINT_ID = exports.CONFIG_KEY_PREVIOUS_STATE = exports.CONFIG_KEY_SCRATCHPAD = exports.CONFIG_KEY_RESUME_VALUE = exports.CONFIG_KEY_STREAM = exports.CONFIG_KEY_TASK_ID = exports.CONFIG_KEY_RESUMING = exports.CONFIG_KEY_CHECKPOINTER = exports.CONFIG_KEY_READ = exports.CONFIG_KEY_CALL = exports.CONFIG_KEY_SEND = exports.ERROR = exports.COPY = exports.INPUT = exports.END = exports.START = void 0;
3
+ exports._deserializeCommandSendObjectGraph = exports.isCommand = exports.Command = exports._isSend = exports.Send = exports._isSendInterface = exports.CHECKPOINT_NAMESPACE_END = exports.CHECKPOINT_NAMESPACE_SEPARATOR = exports.RESERVED = exports.NULL_TASK_ID = exports.TASK_NAMESPACE = exports.PULL = exports.PUSH = exports.TASKS = exports.SELF = exports.TAG_NOSTREAM = exports.TAG_HIDDEN = exports.RECURSION_LIMIT_DEFAULT = exports.RUNTIME_PLACEHOLDER = exports.PREVIOUS = exports.RETURN = exports.NO_WRITES = exports.RESUME = exports.INTERRUPT = exports.CONFIG_KEY_CHECKPOINT_MAP = exports.CONFIG_KEY_NODE_FINISHED = exports.CONFIG_KEY_CHECKPOINT_NS = exports.CONFIG_KEY_CHECKPOINT_ID = exports.CONFIG_KEY_PREVIOUS_STATE = exports.CONFIG_KEY_SCRATCHPAD = exports.CONFIG_KEY_RESUME_VALUE = exports.CONFIG_KEY_STREAM = exports.CONFIG_KEY_TASK_ID = exports.CONFIG_KEY_RESUMING = exports.CONFIG_KEY_CHECKPOINTER = exports.CONFIG_KEY_READ = exports.CONFIG_KEY_CALL = exports.CONFIG_KEY_SEND = exports.ERROR = exports.COPY = exports.INPUT = exports.END = exports.START = void 0;
4
4
  /** Special reserved node name denoting the start of a graph. */
5
5
  exports.START = "__start__";
6
6
  /** Special reserved node name denoting the end of a graph. */
@@ -147,10 +147,11 @@ class Send {
147
147
  value: void 0
148
148
  });
149
149
  this.node = node;
150
- this.args = _convertCommandSendTree(args);
150
+ this.args = _deserializeCommandSendObjectGraph(args);
151
151
  }
152
152
  toJSON() {
153
153
  return {
154
+ lg_name: this.lg_name,
154
155
  node: this.node,
155
156
  args: this.args,
156
157
  };
@@ -287,8 +288,8 @@ class Command {
287
288
  this.update = args.update;
288
289
  if (args.goto) {
289
290
  this.goto = Array.isArray(args.goto)
290
- ? _convertCommandSendTree(args.goto)
291
- : [_convertCommandSendTree(args.goto)];
291
+ ? _deserializeCommandSendObjectGraph(args.goto)
292
+ : [_deserializeCommandSendObjectGraph(args.goto)];
292
293
  }
293
294
  }
294
295
  /**
@@ -329,6 +330,7 @@ class Command {
329
330
  });
330
331
  }
331
332
  return {
333
+ lg_name: this.lg_name,
332
334
  update: this.update,
333
335
  resume: this.resume,
334
336
  goto: serializedGoto,
@@ -351,54 +353,76 @@ Object.defineProperty(Command, "PARENT", {
351
353
  * @returns `true` if the value is a {@link Command}, `false` otherwise.
352
354
  */
353
355
  function isCommand(x) {
354
- // eslint-disable-next-line no-instanceof/no-instanceof
355
- return x instanceof Command;
356
- }
357
- exports.isCommand = isCommand;
358
- /**
359
- * A type guard to check if the given value is a {@link CommandParams}.
360
- *
361
- * Useful for type narrowing when working with the {@link CommandParams} object.
362
- *
363
- * @param x - The value to check.
364
- * @returns `true` if the value is a {@link CommandParams}, `false` otherwise.
365
- */
366
- function isCommandParams(x) {
367
356
  if (typeof x !== "object") {
368
357
  return false;
369
358
  }
370
359
  if (x === null || x === undefined) {
371
360
  return false;
372
361
  }
373
- if ("update" in x && "resume" in x && "goto" in x) {
362
+ if ("lg_name" in x && x.lg_name === "Command") {
374
363
  return true;
375
364
  }
376
365
  return false;
377
366
  }
378
- exports.isCommandParams = isCommandParams;
379
- function _convertCommandSendTree(x, seen = new Set()) {
367
+ exports.isCommand = isCommand;
368
+ /**
369
+ * Reconstructs Command and Send objects from a deeply nested tree of anonymous objects
370
+ * matching their interfaces.
371
+ *
372
+ * This is only exported for testing purposes. It is NOT intended to be used outside of
373
+ * the Command and Send classes.
374
+ *
375
+ * @internal
376
+ *
377
+ * @param x - The command send tree to convert.
378
+ * @param seen - A map of seen objects to avoid infinite loops.
379
+ * @returns The converted command send tree.
380
+ */
381
+ function _deserializeCommandSendObjectGraph(x, seen = new Map()) {
380
382
  if (x !== undefined && x !== null && typeof x === "object") {
383
+ // If we've already processed this object, return the transformed version
381
384
  if (seen.has(x)) {
382
- throw new Error("Command send tree contains a cycle");
385
+ return seen.get(x);
383
386
  }
384
- seen.add(x);
387
+ let result;
385
388
  if (Array.isArray(x)) {
386
- return x.map((innerX) => _convertCommandSendTree(innerX, new Set(seen)));
389
+ // Create the array first, then populate it
390
+ result = [];
391
+ // Add to seen map before processing elements to handle self-references
392
+ seen.set(x, result);
393
+ // Now populate the array
394
+ x.forEach((item, index) => {
395
+ result[index] = _deserializeCommandSendObjectGraph(item, seen);
396
+ });
397
+ // eslint-disable-next-line no-instanceof/no-instanceof
387
398
  }
388
- if (isCommand(x) || _isSend(x)) {
389
- return x;
399
+ else if (isCommand(x) && !(x instanceof Command)) {
400
+ result = new Command(x);
401
+ seen.set(x, result);
402
+ // eslint-disable-next-line no-instanceof/no-instanceof
390
403
  }
391
- if (isCommandParams(x)) {
392
- return new Command(x);
404
+ else if (_isSendInterface(x) && !(x instanceof Send)) {
405
+ result = new Send(x.node, x.args);
406
+ seen.set(x, result);
393
407
  }
394
- if (_isSendInterface(x)) {
395
- return new Send(x.node, x.args);
408
+ else if (isCommand(x) || _isSend(x)) {
409
+ result = x;
410
+ seen.set(x, result);
411
+ }
412
+ else {
413
+ // Create empty object first
414
+ result = {};
415
+ // Add to seen map before processing properties to handle self-references
416
+ seen.set(x, result);
417
+ // Now populate the object
418
+ for (const [key, value] of Object.entries(x)) {
419
+ result[key] =
420
+ _deserializeCommandSendObjectGraph(value, seen);
421
+ }
396
422
  }
397
- return Object.fromEntries(Object.entries(x).map(([key, value]) => [
398
- key,
399
- _convertCommandSendTree(value, seen),
400
- ]));
423
+ return result;
401
424
  }
402
425
  return x;
403
426
  }
427
+ exports._deserializeCommandSendObjectGraph = _deserializeCommandSendObjectGraph;
404
428
  //# sourceMappingURL=constants.js.map
@@ -102,6 +102,7 @@ export declare class Send implements SendInterface {
102
102
  args: any;
103
103
  constructor(node: string, args: any);
104
104
  toJSON(): {
105
+ lg_name: string;
105
106
  node: string;
106
107
  args: any;
107
108
  };
@@ -114,6 +115,13 @@ export type Interrupt = {
114
115
  ns?: string[];
115
116
  };
116
117
  export type CommandParams<R> = {
118
+ /**
119
+ * A discriminator field used to identify the type of object. Must be populated when serializing.
120
+ *
121
+ * Optional because it's not required to specify this when directly constructing a {@link Command}
122
+ * object.
123
+ */
124
+ lg_name?: "Command";
117
125
  /**
118
126
  * Value to resume execution with. To be used together with {@link interrupt}.
119
127
  */
@@ -201,7 +209,7 @@ export type CommandParams<R> = {
201
209
  * ```
202
210
  */
203
211
  export declare class Command<R = unknown> {
204
- lg_name: string;
212
+ readonly lg_name = "Command";
205
213
  lc_direct_tool_output: boolean;
206
214
  /**
207
215
  * Graph to send the command to. Supported values are:
@@ -236,12 +244,15 @@ export declare class Command<R = unknown> {
236
244
  */
237
245
  _updateAsTuples(): PendingWrite[];
238
246
  toJSON(): {
247
+ lg_name: string;
239
248
  update: Record<string, unknown> | [string, unknown][] | undefined;
240
249
  resume: R | undefined;
241
250
  goto: string | {
251
+ lg_name: string;
242
252
  node: string;
243
253
  args: any;
244
254
  } | (string | {
255
+ lg_name: string;
245
256
  node: string;
246
257
  args: any;
247
258
  })[] | undefined;
@@ -257,11 +268,16 @@ export declare class Command<R = unknown> {
257
268
  */
258
269
  export declare function isCommand(x: unknown): x is Command;
259
270
  /**
260
- * A type guard to check if the given value is a {@link CommandParams}.
271
+ * Reconstructs Command and Send objects from a deeply nested tree of anonymous objects
272
+ * matching their interfaces.
261
273
  *
262
- * Useful for type narrowing when working with the {@link CommandParams} object.
274
+ * This is only exported for testing purposes. It is NOT intended to be used outside of
275
+ * the Command and Send classes.
263
276
  *
264
- * @param x - The value to check.
265
- * @returns `true` if the value is a {@link CommandParams}, `false` otherwise.
277
+ * @internal
278
+ *
279
+ * @param x - The command send tree to convert.
280
+ * @param seen - A map of seen objects to avoid infinite loops.
281
+ * @returns The converted command send tree.
266
282
  */
267
- export declare function isCommandParams<R = unknown>(x: unknown): x is CommandParams<R>;
283
+ export declare function _deserializeCommandSendObjectGraph(x: unknown, seen?: Map<object, unknown>): unknown;
package/dist/constants.js CHANGED
@@ -143,10 +143,11 @@ export class Send {
143
143
  value: void 0
144
144
  });
145
145
  this.node = node;
146
- this.args = _convertCommandSendTree(args);
146
+ this.args = _deserializeCommandSendObjectGraph(args);
147
147
  }
148
148
  toJSON() {
149
149
  return {
150
+ lg_name: this.lg_name,
150
151
  node: this.node,
151
152
  args: this.args,
152
153
  };
@@ -281,8 +282,8 @@ export class Command {
281
282
  this.update = args.update;
282
283
  if (args.goto) {
283
284
  this.goto = Array.isArray(args.goto)
284
- ? _convertCommandSendTree(args.goto)
285
- : [_convertCommandSendTree(args.goto)];
285
+ ? _deserializeCommandSendObjectGraph(args.goto)
286
+ : [_deserializeCommandSendObjectGraph(args.goto)];
286
287
  }
287
288
  }
288
289
  /**
@@ -323,6 +324,7 @@ export class Command {
323
324
  });
324
325
  }
325
326
  return {
327
+ lg_name: this.lg_name,
326
328
  update: this.update,
327
329
  resume: this.resume,
328
330
  goto: serializedGoto,
@@ -344,51 +346,73 @@ Object.defineProperty(Command, "PARENT", {
344
346
  * @returns `true` if the value is a {@link Command}, `false` otherwise.
345
347
  */
346
348
  export function isCommand(x) {
347
- // eslint-disable-next-line no-instanceof/no-instanceof
348
- return x instanceof Command;
349
- }
350
- /**
351
- * A type guard to check if the given value is a {@link CommandParams}.
352
- *
353
- * Useful for type narrowing when working with the {@link CommandParams} object.
354
- *
355
- * @param x - The value to check.
356
- * @returns `true` if the value is a {@link CommandParams}, `false` otherwise.
357
- */
358
- export function isCommandParams(x) {
359
349
  if (typeof x !== "object") {
360
350
  return false;
361
351
  }
362
352
  if (x === null || x === undefined) {
363
353
  return false;
364
354
  }
365
- if ("update" in x && "resume" in x && "goto" in x) {
355
+ if ("lg_name" in x && x.lg_name === "Command") {
366
356
  return true;
367
357
  }
368
358
  return false;
369
359
  }
370
- function _convertCommandSendTree(x, seen = new Set()) {
360
+ /**
361
+ * Reconstructs Command and Send objects from a deeply nested tree of anonymous objects
362
+ * matching their interfaces.
363
+ *
364
+ * This is only exported for testing purposes. It is NOT intended to be used outside of
365
+ * the Command and Send classes.
366
+ *
367
+ * @internal
368
+ *
369
+ * @param x - The command send tree to convert.
370
+ * @param seen - A map of seen objects to avoid infinite loops.
371
+ * @returns The converted command send tree.
372
+ */
373
+ export function _deserializeCommandSendObjectGraph(x, seen = new Map()) {
371
374
  if (x !== undefined && x !== null && typeof x === "object") {
375
+ // If we've already processed this object, return the transformed version
372
376
  if (seen.has(x)) {
373
- throw new Error("Command send tree contains a cycle");
377
+ return seen.get(x);
374
378
  }
375
- seen.add(x);
379
+ let result;
376
380
  if (Array.isArray(x)) {
377
- return x.map((innerX) => _convertCommandSendTree(innerX, new Set(seen)));
381
+ // Create the array first, then populate it
382
+ result = [];
383
+ // Add to seen map before processing elements to handle self-references
384
+ seen.set(x, result);
385
+ // Now populate the array
386
+ x.forEach((item, index) => {
387
+ result[index] = _deserializeCommandSendObjectGraph(item, seen);
388
+ });
389
+ // eslint-disable-next-line no-instanceof/no-instanceof
390
+ }
391
+ else if (isCommand(x) && !(x instanceof Command)) {
392
+ result = new Command(x);
393
+ seen.set(x, result);
394
+ // eslint-disable-next-line no-instanceof/no-instanceof
378
395
  }
379
- if (isCommand(x) || _isSend(x)) {
380
- return x;
396
+ else if (_isSendInterface(x) && !(x instanceof Send)) {
397
+ result = new Send(x.node, x.args);
398
+ seen.set(x, result);
381
399
  }
382
- if (isCommandParams(x)) {
383
- return new Command(x);
400
+ else if (isCommand(x) || _isSend(x)) {
401
+ result = x;
402
+ seen.set(x, result);
384
403
  }
385
- if (_isSendInterface(x)) {
386
- return new Send(x.node, x.args);
404
+ else {
405
+ // Create empty object first
406
+ result = {};
407
+ // Add to seen map before processing properties to handle self-references
408
+ seen.set(x, result);
409
+ // Now populate the object
410
+ for (const [key, value] of Object.entries(x)) {
411
+ result[key] =
412
+ _deserializeCommandSendObjectGraph(value, seen);
413
+ }
387
414
  }
388
- return Object.fromEntries(Object.entries(x).map(([key, value]) => [
389
- key,
390
- _convertCommandSendTree(value, seen),
391
- ]));
415
+ return result;
392
416
  }
393
417
  return x;
394
418
  }
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;AACjC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC;AAC7B,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAG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5B,MAAM,GAAG,EAAE,CAAC;YACZ,yEAAyE;YACzE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;YAEpB,0BAA0B;YAC1B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBAC3C,MAAkC,CAAC,GAAG,CAAC;oBACtC,kCAAkC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;aACnD;SACF;QAED,OAAO,MAAM,CAAC;KACf;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph",
3
- "version": "0.2.59",
3
+ "version": "0.2.60",
4
4
  "description": "LangGraph",
5
5
  "type": "module",
6
6
  "engines": {