@langchain/langgraph 0.1.5 → 0.1.7-rc.0

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.
@@ -2,14 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AnyValue = void 0;
4
4
  const errors_js_1 = require("../errors.cjs");
5
- const index_js_1 = require("./index.cjs");
5
+ const base_js_1 = require("./base.cjs");
6
6
  /**
7
7
  * Stores the last value received, assumes that if multiple values are received, they are all equal.
8
8
  *
9
9
  * Note: Unlike 'LastValue' if multiple nodes write to this channel in a single step, the values
10
10
  * will be continuously overwritten.
11
+ *
12
+ * @internal
11
13
  */
12
- class AnyValue extends index_js_1.BaseChannel {
14
+ class AnyValue extends base_js_1.BaseChannel {
13
15
  constructor() {
14
16
  super();
15
17
  Object.defineProperty(this, "lc_graph_name", {
@@ -1,9 +1,11 @@
1
- import { BaseChannel } from "./index.js";
1
+ import { BaseChannel } from "./base.js";
2
2
  /**
3
3
  * Stores the last value received, assumes that if multiple values are received, they are all equal.
4
4
  *
5
5
  * Note: Unlike 'LastValue' if multiple nodes write to this channel in a single step, the values
6
6
  * will be continuously overwritten.
7
+ *
8
+ * @internal
7
9
  */
8
10
  export declare class AnyValue<Value> extends BaseChannel<Value, Value, Value> {
9
11
  lc_graph_name: string;
@@ -1,10 +1,12 @@
1
1
  import { EmptyChannelError } from "../errors.js";
2
- import { BaseChannel } from "./index.js";
2
+ import { BaseChannel } from "./base.js";
3
3
  /**
4
4
  * Stores the last value received, assumes that if multiple values are received, they are all equal.
5
5
  *
6
6
  * Note: Unlike 'LastValue' if multiple nodes write to this channel in a single step, the values
7
7
  * will be continuously overwritten.
8
+ *
9
+ * @internal
8
10
  */
9
11
  export class AnyValue extends BaseChannel {
10
12
  constructor() {
@@ -2,21 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DynamicBarrierValue = void 0;
4
4
  const errors_js_1 = require("../errors.cjs");
5
- const index_js_1 = require("./index.cjs");
5
+ const base_js_1 = require("./base.cjs");
6
6
  const named_barrier_value_js_1 = require("./named_barrier_value.cjs");
7
7
  function isWaitForNames(v) {
8
8
  return v.__names !== undefined;
9
9
  }
10
10
  /**
11
- A channel that switches between two states
12
-
13
- - in the "priming" state it can't be read from.
14
- - if it receives a WaitForNames update, it switches to the "waiting" state.
15
- - in the "waiting" state it collects named values until all are received.
16
- - once all named values are received, it can be read once, and it switches
17
- back to the "priming" state.
11
+ * A channel that switches between two states
12
+ *
13
+ * - in the "priming" state it can't be read from.
14
+ * - if it receives a WaitForNames update, it switches to the "waiting" state.
15
+ * - in the "waiting" state it collects named values until all are received.
16
+ * - once all named values are received, it can be read once, and it switches
17
+ * back to the "priming" state.
18
+ * @internal
18
19
  */
19
- class DynamicBarrierValue extends index_js_1.BaseChannel {
20
+ class DynamicBarrierValue extends base_js_1.BaseChannel {
20
21
  constructor() {
21
22
  super();
22
23
  Object.defineProperty(this, "lc_graph_name", {
@@ -1,15 +1,16 @@
1
- import { BaseChannel } from "./index.js";
1
+ import { BaseChannel } from "./base.js";
2
2
  export interface WaitForNames<Value> {
3
3
  __names: Value[];
4
4
  }
5
5
  /**
6
- A channel that switches between two states
7
-
8
- - in the "priming" state it can't be read from.
9
- - if it receives a WaitForNames update, it switches to the "waiting" state.
10
- - in the "waiting" state it collects named values until all are received.
11
- - once all named values are received, it can be read once, and it switches
12
- back to the "priming" state.
6
+ * A channel that switches between two states
7
+ *
8
+ * - in the "priming" state it can't be read from.
9
+ * - if it receives a WaitForNames update, it switches to the "waiting" state.
10
+ * - in the "waiting" state it collects named values until all are received.
11
+ * - once all named values are received, it can be read once, and it switches
12
+ * back to the "priming" state.
13
+ * @internal
13
14
  */
14
15
  export declare class DynamicBarrierValue<Value> extends BaseChannel<void, Value | WaitForNames<Value>, [
15
16
  Value[] | undefined,
@@ -1,17 +1,18 @@
1
1
  import { EmptyChannelError, InvalidUpdateError } from "../errors.js";
2
- import { BaseChannel } from "./index.js";
2
+ import { BaseChannel } from "./base.js";
3
3
  import { areSetsEqual } from "./named_barrier_value.js";
4
4
  function isWaitForNames(v) {
5
5
  return v.__names !== undefined;
6
6
  }
7
7
  /**
8
- A channel that switches between two states
9
-
10
- - in the "priming" state it can't be read from.
11
- - if it receives a WaitForNames update, it switches to the "waiting" state.
12
- - in the "waiting" state it collects named values until all are received.
13
- - once all named values are received, it can be read once, and it switches
14
- back to the "priming" state.
8
+ * A channel that switches between two states
9
+ *
10
+ * - in the "priming" state it can't be read from.
11
+ * - if it receives a WaitForNames update, it switches to the "waiting" state.
12
+ * - in the "waiting" state it collects named values until all are received.
13
+ * - once all named values are received, it can be read once, and it switches
14
+ * back to the "priming" state.
15
+ * @internal
15
16
  */
16
17
  export class DynamicBarrierValue extends BaseChannel {
17
18
  constructor() {
@@ -5,6 +5,7 @@ const errors_js_1 = require("../errors.cjs");
5
5
  const index_js_1 = require("./index.cjs");
6
6
  /**
7
7
  * Stores the value received in the step immediately preceding, clears after.
8
+ * @internal
8
9
  */
9
10
  class EphemeralValue extends index_js_1.BaseChannel {
10
11
  constructor(guard = true) {
@@ -1,6 +1,7 @@
1
1
  import { BaseChannel } from "./index.js";
2
2
  /**
3
3
  * Stores the value received in the step immediately preceding, clears after.
4
+ * @internal
4
5
  */
5
6
  export declare class EphemeralValue<Value> extends BaseChannel<Value, Value, Value> {
6
7
  lc_graph_name: string;
@@ -2,6 +2,7 @@ import { EmptyChannelError, InvalidUpdateError } from "../errors.js";
2
2
  import { BaseChannel } from "./index.js";
3
3
  /**
4
4
  * Stores the value received in the step immediately preceding, clears after.
5
+ * @internal
5
6
  */
6
7
  export class EphemeralValue extends BaseChannel {
7
8
  constructor(guard = true) {
@@ -1,2 +1,7 @@
1
1
  export { BaseChannel, createCheckpoint, emptyChannels as empty, } from "./base.js";
2
2
  export { type BinaryOperator, BinaryOperatorAggregate } from "./binop.js";
3
+ export type { AnyValue } from "./any_value.js";
4
+ export type { WaitForNames, DynamicBarrierValue, } from "./dynamic_barrier_value.js";
5
+ export type { LastValue } from "./last_value.js";
6
+ export type { NamedBarrierValue } from "./named_barrier_value.js";
7
+ export type { Topic } from "./topic.js";
@@ -2,15 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LastValue = void 0;
4
4
  const errors_js_1 = require("../errors.cjs");
5
- const index_js_1 = require("./index.cjs");
5
+ const base_js_1 = require("./base.cjs");
6
6
  /**
7
7
  * Stores the last value received, can receive at most one value per step.
8
8
  *
9
9
  * Since `update` is only called once per step and value can only be of length 1,
10
10
  * LastValue always stores the last value of a single node. If multiple nodes attempt to
11
11
  * write to this channel in a single step, an error will be thrown.
12
+ * @internal
12
13
  */
13
- class LastValue extends index_js_1.BaseChannel {
14
+ class LastValue extends base_js_1.BaseChannel {
14
15
  constructor() {
15
16
  super(...arguments);
16
17
  Object.defineProperty(this, "lc_graph_name", {
@@ -1,10 +1,11 @@
1
- import { BaseChannel } from "./index.js";
1
+ import { BaseChannel } from "./base.js";
2
2
  /**
3
3
  * Stores the last value received, can receive at most one value per step.
4
4
  *
5
5
  * Since `update` is only called once per step and value can only be of length 1,
6
6
  * LastValue always stores the last value of a single node. If multiple nodes attempt to
7
7
  * write to this channel in a single step, an error will be thrown.
8
+ * @internal
8
9
  */
9
10
  export declare class LastValue<Value> extends BaseChannel<Value, Value, Value> {
10
11
  lc_graph_name: string;
@@ -1,11 +1,12 @@
1
1
  import { EmptyChannelError, InvalidUpdateError } from "../errors.js";
2
- import { BaseChannel } from "./index.js";
2
+ import { BaseChannel } from "./base.js";
3
3
  /**
4
4
  * Stores the last value received, can receive at most one value per step.
5
5
  *
6
6
  * Since `update` is only called once per step and value can only be of length 1,
7
7
  * LastValue always stores the last value of a single node. If multiple nodes attempt to
8
8
  * write to this channel in a single step, an error will be thrown.
9
+ * @internal
9
10
  */
10
11
  export class LastValue extends BaseChannel {
11
12
  constructor() {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NamedBarrierValue = exports.areSetsEqual = void 0;
4
4
  const errors_js_1 = require("../errors.cjs");
5
- const index_js_1 = require("./index.cjs");
5
+ const base_js_1 = require("./base.cjs");
6
6
  const areSetsEqual = (a, b) => a.size === b.size && [...a].every((value) => b.has(value));
7
7
  exports.areSetsEqual = areSetsEqual;
8
8
  /**
@@ -10,8 +10,9 @@ exports.areSetsEqual = areSetsEqual;
10
10
  *
11
11
  * This ensures that if node N and node M both write to channel C, the value of C will not be updated
12
12
  * until N and M have completed updating.
13
+ * @internal
13
14
  */
14
- class NamedBarrierValue extends index_js_1.BaseChannel {
15
+ class NamedBarrierValue extends base_js_1.BaseChannel {
15
16
  constructor(names) {
16
17
  super();
17
18
  Object.defineProperty(this, "lc_graph_name", {
@@ -1,10 +1,11 @@
1
- import { BaseChannel } from "./index.js";
1
+ import { BaseChannel } from "./base.js";
2
2
  export declare const areSetsEqual: <T>(a: Set<T>, b: Set<T>) => boolean;
3
3
  /**
4
4
  * A channel that waits until all named values are received before making the value available.
5
5
  *
6
6
  * This ensures that if node N and node M both write to channel C, the value of C will not be updated
7
7
  * until N and M have completed updating.
8
+ * @internal
8
9
  */
9
10
  export declare class NamedBarrierValue<Value> extends BaseChannel<void, Value, Value[]> {
10
11
  lc_graph_name: string;
@@ -1,11 +1,12 @@
1
1
  import { EmptyChannelError, InvalidUpdateError } from "../errors.js";
2
- import { BaseChannel } from "./index.js";
2
+ import { BaseChannel } from "./base.js";
3
3
  export const areSetsEqual = (a, b) => a.size === b.size && [...a].every((value) => b.has(value));
4
4
  /**
5
5
  * A channel that waits until all named values are received before making the value available.
6
6
  *
7
7
  * This ensures that if node N and node M both write to channel C, the value of C will not be updated
8
8
  * until N and M have completed updating.
9
+ * @internal
9
10
  */
10
11
  export class NamedBarrierValue extends BaseChannel {
11
12
  constructor(names) {
@@ -6,6 +6,9 @@ const base_js_1 = require("./base.cjs");
6
6
  function arraysEqual(a, b) {
7
7
  return a.length === b.length && a.every((val, index) => val === b[index]);
8
8
  }
9
+ /**
10
+ * @internal
11
+ */
9
12
  class Topic extends base_js_1.BaseChannel {
10
13
  constructor(fields) {
11
14
  super();
@@ -1,4 +1,7 @@
1
1
  import { BaseChannel } from "./base.js";
2
+ /**
3
+ * @internal
4
+ */
2
5
  export declare class Topic<Value> extends BaseChannel<Array<Value>, Value | Value[], [
3
6
  Value[],
4
7
  Value[]
@@ -3,6 +3,9 @@ import { BaseChannel } from "./base.js";
3
3
  function arraysEqual(a, b) {
4
4
  return a.length === b.length && a.every((val, index) => val === b[index]);
5
5
  }
6
+ /**
7
+ * @internal
8
+ */
6
9
  export class Topic extends BaseChannel {
7
10
  constructor(fields) {
8
11
  super();
@@ -1,4 +1,4 @@
1
- export { Annotation, type StateType, type UpdateType, AnnotationRoot, } from "./annotation.js";
1
+ export { Annotation, type StateType, type UpdateType, AnnotationRoot, StateDefinition, } from "./annotation.js";
2
2
  export { END, START, Graph, type CompiledGraph } from "./graph.js";
3
3
  export { type StateGraphArgs, StateGraph, type CompiledStateGraph, } from "./state.js";
4
4
  export { MessageGraph, messagesStateReducer } from "./message.js";
package/dist/web.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { END, Graph, type StateGraphArgs, START, StateGraph, type CompiledStateGraph, MessageGraph, messagesStateReducer, Annotation, AnnotationRoot, type StateType, type UpdateType, type CompiledGraph, } from "./graph/index.js";
1
+ export { END, Graph, type StateGraphArgs, START, StateGraph, type CompiledStateGraph, MessageGraph, messagesStateReducer, Annotation, AnnotationRoot, type StateDefinition, type StateType, type UpdateType, type CompiledGraph, } from "./graph/index.js";
2
2
  export { GraphRecursionError, GraphValueError, InvalidUpdateError, EmptyChannelError, } from "./errors.js";
3
- export { BaseChannel, type BinaryOperator, BinaryOperatorAggregate, } from "./channels/index.js";
3
+ export { BaseChannel, type BinaryOperator, BinaryOperatorAggregate, type AnyValue, type WaitForNames, type DynamicBarrierValue, type LastValue, type NamedBarrierValue, type Topic, } from "./channels/index.js";
4
4
  export { type RetryPolicy } from "./pregel/utils.js";
5
5
  export { Send } from "./constants.js";
6
6
  export { MemorySaver, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, copyCheckpoint, emptyCheckpoint, BaseCheckpointSaver, } from "@langchain/langgraph-checkpoint";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph",
3
- "version": "0.1.5",
3
+ "version": "0.1.7-rc.0",
4
4
  "description": "LangGraph",
5
5
  "type": "module",
6
6
  "engines": {