@langchain/langgraph 0.1.0-rc.0 → 0.1.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.
Files changed (62) hide show
  1. package/LICENSE +1 -1
  2. package/dist/channels/base.cjs +20 -15
  3. package/dist/channels/base.d.ts +2 -3
  4. package/dist/channels/base.js +18 -13
  5. package/dist/checkpoint/sqlite.cjs +14 -199
  6. package/dist/checkpoint/sqlite.d.ts +1 -16
  7. package/dist/checkpoint/sqlite.js +1 -195
  8. package/dist/graph/graph.d.ts +1 -1
  9. package/dist/graph/message.d.ts +0 -3
  10. package/dist/graph/messages_annotation.cjs +12 -0
  11. package/dist/graph/messages_annotation.d.ts +4 -0
  12. package/dist/graph/messages_annotation.js +9 -0
  13. package/dist/graph/state.cjs +2 -1
  14. package/dist/graph/state.d.ts +1 -1
  15. package/dist/graph/state.js +2 -1
  16. package/dist/index.cjs +3 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +1 -0
  19. package/dist/prebuilt/react_agent_executor.d.ts +3 -3
  20. package/dist/prebuilt/tool_node.d.ts +3 -3
  21. package/dist/pregel/algo.cjs +112 -105
  22. package/dist/pregel/algo.d.ts +8 -5
  23. package/dist/pregel/algo.js +109 -102
  24. package/dist/pregel/debug.cjs +9 -12
  25. package/dist/pregel/debug.d.ts +3 -2
  26. package/dist/pregel/debug.js +6 -10
  27. package/dist/pregel/index.cjs +92 -26
  28. package/dist/pregel/index.d.ts +41 -3
  29. package/dist/pregel/index.js +90 -24
  30. package/dist/pregel/io.d.ts +1 -1
  31. package/dist/pregel/loop.cjs +13 -9
  32. package/dist/pregel/loop.d.ts +1 -2
  33. package/dist/pregel/loop.js +8 -4
  34. package/dist/pregel/types.d.ts +5 -2
  35. package/dist/pregel/utils.cjs +25 -10
  36. package/dist/pregel/utils.d.ts +8 -1
  37. package/dist/pregel/utils.js +22 -9
  38. package/dist/web.cjs +6 -7
  39. package/dist/web.d.ts +1 -4
  40. package/dist/web.js +1 -2
  41. package/package.json +12 -12
  42. package/dist/checkpoint/base.cjs +0 -75
  43. package/dist/checkpoint/base.d.ts +0 -78
  44. package/dist/checkpoint/base.js +0 -66
  45. package/dist/checkpoint/id.cjs +0 -20
  46. package/dist/checkpoint/id.d.ts +0 -2
  47. package/dist/checkpoint/id.js +0 -15
  48. package/dist/checkpoint/index.cjs +0 -9
  49. package/dist/checkpoint/index.d.ts +0 -3
  50. package/dist/checkpoint/index.js +0 -2
  51. package/dist/checkpoint/memory.cjs +0 -195
  52. package/dist/checkpoint/memory.d.ts +0 -13
  53. package/dist/checkpoint/memory.js +0 -191
  54. package/dist/checkpoint/serde/types.cjs +0 -2
  55. package/dist/checkpoint/serde/types.d.ts +0 -40
  56. package/dist/checkpoint/serde/types.js +0 -1
  57. package/dist/checkpoint/types.cjs +0 -2
  58. package/dist/checkpoint/types.d.ts +0 -28
  59. package/dist/checkpoint/types.js +0 -1
  60. package/dist/serde/base.cjs +0 -8
  61. package/dist/serde/base.d.ts +0 -12
  62. package/dist/serde/base.js +0 -5
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,40 +0,0 @@
1
- export interface ChannelProtocol<ValueType = unknown, UpdateType = unknown, CheckpointType = unknown> {
2
- ValueType: ValueType;
3
- UpdateType: UpdateType;
4
- /**
5
- * The name of the channel.
6
- */
7
- lc_graph_name: string;
8
- /**
9
- * Return a new identical channel, optionally initialized from a checkpoint.
10
- * Can be thought of as a "restoration" from a checkpoint which is a "snapshot" of the channel's state.
11
- *
12
- * @param {CheckpointType | undefined} checkpoint
13
- * @param {CheckpointType | undefined} initialValue
14
- * @returns {this}
15
- */
16
- fromCheckpoint(checkpoint?: CheckpointType): this;
17
- /**
18
- * Update the channel's value with the given sequence of updates.
19
- * The order of the updates in the sequence is arbitrary.
20
- *
21
- * @throws {InvalidUpdateError} if the sequence of updates is invalid.
22
- * @param {Array<UpdateType>} values
23
- * @returns {void}
24
- */
25
- update(values: UpdateType[]): void;
26
- /**
27
- * Return the current value of the channel.
28
- *
29
- * @throws {EmptyChannelError} if the channel is empty (never updated yet).
30
- * @returns {ValueType}
31
- */
32
- get(): ValueType;
33
- /**
34
- * Return a string representation of the channel's current state.
35
- *
36
- * @throws {EmptyChannelError} if the channel is empty (never updated yet), or doesn't support checkpoints.
37
- * @returns {CheckpointType | undefined}
38
- */
39
- checkpoint(): CheckpointType | undefined;
40
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,28 +0,0 @@
1
- export type All = "*";
2
- export type PendingWriteValue = unknown;
3
- export type PendingWrite<Channel = string> = [Channel, PendingWriteValue];
4
- export type CheckpointPendingWrite<TaskId = string> = [
5
- TaskId,
6
- ...PendingWrite<string>
7
- ];
8
- export interface CheckpointMetadata {
9
- /**
10
- * The source of the checkpoint.
11
- * - "input": The checkpoint was created from an input to invoke/stream/batch.
12
- * - "loop": The checkpoint was created from inside the pregel loop.
13
- * - "update": The checkpoint was created from a manual state update.
14
- */
15
- source: "input" | "loop" | "update";
16
- /**
17
- * The step number of the checkpoint.
18
- * -1 for the first "input" checkpoint.
19
- * 0 for the first "loop" checkpoint.
20
- * ... for the nth checkpoint afterwards.
21
- */
22
- step: number;
23
- /**
24
- * The writes that were made between the previous checkpoint and this one.
25
- * Mapping from node name to writes emitted by that node.
26
- */
27
- writes: Record<string, unknown> | null;
28
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultSerializer = void 0;
4
- const load_1 = require("@langchain/core/load");
5
- exports.DefaultSerializer = {
6
- stringify: JSON.stringify,
7
- parse: load_1.load,
8
- };
@@ -1,12 +0,0 @@
1
- import { load } from "@langchain/core/load";
2
- export interface SerializerProtocol<D> {
3
- stringify(obj: D): string;
4
- parse(data: string): Promise<D>;
5
- }
6
- export declare const DefaultSerializer: {
7
- stringify: {
8
- (value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
9
- (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
10
- };
11
- parse: typeof load;
12
- };
@@ -1,5 +0,0 @@
1
- import { load } from "@langchain/core/load";
2
- export const DefaultSerializer = {
3
- stringify: JSON.stringify,
4
- parse: load,
5
- };