@langchain/langgraph 0.0.16 → 0.0.17

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.
@@ -406,7 +406,10 @@ class Pregel extends runnables_1.Runnable {
406
406
  else {
407
407
  checkpoint = (0, base_js_2.copyCheckpoint)(checkpoint);
408
408
  for (const k of this.streamChannelsList) {
409
- const version = checkpoint.channel_versions[k];
409
+ const version = checkpoint.channel_versions[k] ?? 0;
410
+ if (!checkpoint.versions_seen[constants_js_1.INTERRUPT]) {
411
+ checkpoint.versions_seen[constants_js_1.INTERRUPT] = {};
412
+ }
410
413
  checkpoint.versions_seen[constants_js_1.INTERRUPT][k] = version;
411
414
  }
412
415
  }
@@ -402,7 +402,10 @@ export class Pregel extends Runnable {
402
402
  else {
403
403
  checkpoint = copyCheckpoint(checkpoint);
404
404
  for (const k of this.streamChannelsList) {
405
- const version = checkpoint.channel_versions[k];
405
+ const version = checkpoint.channel_versions[k] ?? 0;
406
+ if (!checkpoint.versions_seen[INTERRUPT]) {
407
+ checkpoint.versions_seen[INTERRUPT] = {};
408
+ }
406
409
  checkpoint.versions_seen[INTERRUPT][k] = version;
407
410
  }
408
411
  }
@@ -53,11 +53,10 @@ function* mapInput(inputChannels,
53
53
  chunk
54
54
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
55
  ) {
56
- if (chunk) {
56
+ if (chunk !== undefined && chunk !== null) {
57
57
  if (Array.isArray(inputChannels) &&
58
58
  typeof chunk === "object" &&
59
- !Array.isArray(chunk) &&
60
- !!chunk) {
59
+ !Array.isArray(chunk)) {
61
60
  for (const k in chunk) {
62
61
  if (inputChannels.includes(k)) {
63
62
  yield [k, chunk[k]];
package/dist/pregel/io.js CHANGED
@@ -48,11 +48,10 @@ export function* mapInput(inputChannels,
48
48
  chunk
49
49
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
50
  ) {
51
- if (chunk) {
51
+ if (chunk !== undefined && chunk !== null) {
52
52
  if (Array.isArray(inputChannels) &&
53
53
  typeof chunk === "object" &&
54
- !Array.isArray(chunk) &&
55
- !!chunk) {
54
+ !Array.isArray(chunk)) {
56
55
  for (const k in chunk) {
57
56
  if (inputChannels.includes(k)) {
58
57
  yield [k, chunk[k]];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "LangGraph",
5
5
  "type": "module",
6
6
  "engines": {