@langchain/langgraph 1.4.15-rc.0 → 1.4.15

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 (49) hide show
  1. package/dist/func/index.cjs +1 -1
  2. package/dist/func/index.js +1 -1
  3. package/dist/graph/state.cjs +1 -3
  4. package/dist/graph/state.cjs.map +1 -1
  5. package/dist/graph/state.d.cts +2 -4
  6. package/dist/graph/state.d.cts.map +1 -1
  7. package/dist/graph/state.d.ts +2 -4
  8. package/dist/graph/state.d.ts.map +1 -1
  9. package/dist/graph/state.js +1 -3
  10. package/dist/graph/state.js.map +1 -1
  11. package/dist/index.cjs +4 -6
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +2 -2
  14. package/dist/index.d.ts +2 -2
  15. package/dist/index.js +1 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/pregel/algo.cjs +1 -1
  18. package/dist/pregel/algo.js +1 -1
  19. package/dist/pregel/index.cjs +1 -1
  20. package/dist/pregel/index.js +1 -1
  21. package/dist/pregel/loop.cjs +1 -1
  22. package/dist/pregel/loop.js +1 -1
  23. package/dist/pregel/read.cjs +7 -18
  24. package/dist/pregel/read.cjs.map +1 -1
  25. package/dist/pregel/read.d.cts +1 -3
  26. package/dist/pregel/read.d.cts.map +1 -1
  27. package/dist/pregel/read.d.ts +1 -3
  28. package/dist/pregel/read.d.ts.map +1 -1
  29. package/dist/pregel/read.js +7 -18
  30. package/dist/pregel/read.js.map +1 -1
  31. package/dist/pregel/runner.cjs +1 -1
  32. package/dist/pregel/runner.js +1 -1
  33. package/dist/pregel/utils/index.cjs +0 -8
  34. package/dist/pregel/utils/index.cjs.map +1 -1
  35. package/dist/pregel/utils/index.d.cts +1 -37
  36. package/dist/pregel/utils/index.d.cts.map +1 -1
  37. package/dist/pregel/utils/index.d.ts +1 -37
  38. package/dist/pregel/utils/index.d.ts.map +1 -1
  39. package/dist/pregel/utils/index.js +1 -8
  40. package/dist/pregel/utils/index.js.map +1 -1
  41. package/dist/web.cjs +4 -6
  42. package/dist/web.d.cts +2 -2
  43. package/dist/web.d.ts +2 -2
  44. package/dist/web.js +1 -2
  45. package/package.json +5 -5
  46. package/dist/pregel/runnable.cjs +0 -103
  47. package/dist/pregel/runnable.cjs.map +0 -1
  48. package/dist/pregel/runnable.js +0 -103
  49. package/dist/pregel/runnable.js.map +0 -1
@@ -47,42 +47,6 @@ type CachePolicy = {
47
47
  */
48
48
  ttl?: number;
49
49
  };
50
- /**
51
- * Controls the input and output payloads recorded on a node's own trace run.
52
- * The graph's root run and child runs created by traced runnables are unaffected.
53
- * Plain function nodes do not create an additional child run.
54
- *
55
- * Processors are synchronous and receive raw values, before callback payload
56
- * normalization. They run even without tracing callbacks. If a processor throws,
57
- * the original payload is recorded instead. Avoid mutating the supplied values:
58
- * they are also used for execution and are not copied.
59
- *
60
- * These transforms also affect chain callbacks, including `streamEvents` and
61
- * message streaming. Omitting outputs can suppress messages returned directly
62
- * by nodes; omitting inputs can affect message deduplication.
63
- *
64
- * This policy is intended to reduce trace payload sizes, not redact secrets.
65
- * For redaction across all runs, configure the LangSmith client instead.
66
- *
67
- * @example
68
- * ```ts
69
- * graph.addNode("before_model", beforeModel, {
70
- * tracePolicy: {
71
- * processInputs: omitPayload,
72
- * processOutputs: omitPayload,
73
- * },
74
- * });
75
- * ```
76
- */
77
- type TracePolicy = {
78
- /** Transform the raw node input recorded on its trace run. */processInputs?: (value: unknown) => unknown; /** Transform the raw node output recorded on its trace run. */
79
- processOutputs?: (value: unknown) => unknown;
80
- };
81
- /**
82
- * Record an empty trace payload while retaining the node's span and timing.
83
- * Use as `processInputs` and/or `processOutputs` in a {@link TracePolicy}.
84
- */
85
- declare function omitPayload(_value: unknown): Record<string, never>;
86
50
  //#endregion
87
- export { CachePolicy, RetryPolicy, TracePolicy, omitPayload };
51
+ export { CachePolicy, RetryPolicy };
88
52
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../../src/pregel/utils/index.ts"],"mappings":";;;;;KAuDY,WAAA;;;;;EAKV,eAAA;EAkBA;;;;EAZA,aAAA;EAwBU;;AASZ;;EA3BE,WAAA;EA2BqB;;;;EArBrB,WAAA;EAgCG;AA8BL;;;EAxDE,MAAA,YA0DA;EAvDA,OAAA,IAAW,CAAA,mBAyDX;EAtDA,UAAA;AAAA;;;;KASU,WAAA;;;;;EAKV,OAAA,IAAW,IAAA;;;;;EAMX,GAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BU,WAAA;gEAEV,aAAA,IAAiB,KAAA;EAEjB,cAAA,IAAkB,KAAA;AAAA;;;;;iBAOJ,WAAA,CAAY,MAAA,YAAkB,MAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../../src/pregel/utils/index.ts"],"mappings":";;;;;KAuDY,WAAA;;;;;EAKV,eAAA;EAkBA;;;;EAZA,aAAA;EAwBU;;AASZ;;EA3BE,WAAA;EA2BqB;;;;EArBrB,WAAA;EAgCG;;;;EA1BH,MAAA;EAGA,OAAA,IAAW,CAAA;EAGX,UAAA;AAAA;;;;KASU,WAAA;;;;;EAKV,OAAA,IAAW,IAAA;;;;;EAMX,GAAA;AAAA"}
@@ -46,42 +46,6 @@ type CachePolicy = {
46
46
  */
47
47
  ttl?: number;
48
48
  };
49
- /**
50
- * Controls the input and output payloads recorded on a node's own trace run.
51
- * The graph's root run and child runs created by traced runnables are unaffected.
52
- * Plain function nodes do not create an additional child run.
53
- *
54
- * Processors are synchronous and receive raw values, before callback payload
55
- * normalization. They run even without tracing callbacks. If a processor throws,
56
- * the original payload is recorded instead. Avoid mutating the supplied values:
57
- * they are also used for execution and are not copied.
58
- *
59
- * These transforms also affect chain callbacks, including `streamEvents` and
60
- * message streaming. Omitting outputs can suppress messages returned directly
61
- * by nodes; omitting inputs can affect message deduplication.
62
- *
63
- * This policy is intended to reduce trace payload sizes, not redact secrets.
64
- * For redaction across all runs, configure the LangSmith client instead.
65
- *
66
- * @example
67
- * ```ts
68
- * graph.addNode("before_model", beforeModel, {
69
- * tracePolicy: {
70
- * processInputs: omitPayload,
71
- * processOutputs: omitPayload,
72
- * },
73
- * });
74
- * ```
75
- */
76
- type TracePolicy = {
77
- /** Transform the raw node input recorded on its trace run. */processInputs?: (value: unknown) => unknown; /** Transform the raw node output recorded on its trace run. */
78
- processOutputs?: (value: unknown) => unknown;
79
- };
80
- /**
81
- * Record an empty trace payload while retaining the node's span and timing.
82
- * Use as `processInputs` and/or `processOutputs` in a {@link TracePolicy}.
83
- */
84
- declare function omitPayload(_value: unknown): Record<string, never>;
85
49
  //#endregion
86
- export { CachePolicy, RetryPolicy, TracePolicy, omitPayload };
50
+ export { CachePolicy, RetryPolicy };
87
51
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/pregel/utils/index.ts"],"mappings":";;;;KAuDY,WAAA;EAAW;;;;EAKrB,eAAA;EAYA;;;;EANA,aAAA;EAwBA;;;AASF;EA3BE,WAAA;;;;;EAMA,WAAA;EAgCG;;AA8BL;;EAxDE,MAAA,YAwDqB;EArDrB,OAAA,IAAW,CAAA,mBAuDM;EApDjB,UAAA;AAAA;AA6DF;;;AAAA,KApDY,WAAA;EAoDwC;;;;EA/ClD,OAAA,IAAW,IAAA;;;;;EAMX,GAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BU,WAAA;gEAEV,aAAA,IAAiB,KAAA;EAEjB,cAAA,IAAkB,KAAA;AAAA;;;;;iBAOJ,WAAA,CAAY,MAAA,YAAkB,MAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/pregel/utils/index.ts"],"mappings":";;;;KAuDY,WAAA;EAAW;;;;EAKrB,eAAA;EAYA;;;;EANA,aAAA;EAwBA;;;AASF;EA3BE,WAAA;;;;;EAMA,WAAA;EAgCG;;;;EA1BH,MAAA;EAGA,OAAA,IAAW,CAAA;EAGX,UAAA;AAAA;;;;KASU,WAAA;;;;;EAKV,OAAA,IAAW,IAAA;;;;;EAMX,GAAA;AAAA"}
@@ -22,13 +22,6 @@ function getNewChannelVersions(previousVersions, currentVersions) {
22
22
  function _coerceToDict(value, defaultKey) {
23
23
  return value && !Array.isArray(value) && !(value instanceof Date) && typeof value === "object" ? value : { [defaultKey]: value };
24
24
  }
25
- /**
26
- * Record an empty trace payload while retaining the node's span and timing.
27
- * Use as `processInputs` and/or `processOutputs` in a {@link TracePolicy}.
28
- */
29
- function omitPayload(_value) {
30
- return {};
31
- }
32
25
  function patchConfigurable(config, patch) {
33
26
  if (config === null) return { configurable: patch };
34
27
  else if (config?.configurable === void 0) return {
@@ -83,6 +76,6 @@ function combineAbortSignals(...x) {
83
76
  };
84
77
  }
85
78
  //#endregion
86
- export { _coerceToDict, combineAbortSignals, getNewChannelVersions, getNullChannelVersion, omitPayload, patchCheckpointMap, patchConfigurable };
79
+ export { _coerceToDict, combineAbortSignals, getNewChannelVersions, getNullChannelVersion, patchCheckpointMap, patchConfigurable };
87
80
 
88
81
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/pregel/utils/index.ts"],"sourcesContent":["import { Callbacks } from \"@langchain/core/callbacks/manager\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport type {\n ChannelVersions,\n CheckpointMetadata,\n} from \"@langchain/langgraph-checkpoint\";\nimport { CONFIG_KEY_CHECKPOINT_MAP, START } from \"../../constants.js\";\n\nexport function getNullChannelVersion(currentVersions: ChannelVersions) {\n // Short circuit for commonly used channels such as __start__\n // (used by StateGraph)\n const startVersion = typeof currentVersions[START];\n if (startVersion === \"number\") return 0;\n if (startVersion === \"string\") return \"\";\n\n // Defer back to obtaining a first key from channel versions\n for (const key in currentVersions) {\n if (!Object.prototype.hasOwnProperty.call(currentVersions, key)) continue;\n const versionType = typeof currentVersions[key];\n if (versionType === \"number\") return 0;\n if (versionType === \"string\") return \"\";\n break;\n }\n\n return undefined;\n}\n\nexport function getNewChannelVersions(\n previousVersions: ChannelVersions,\n currentVersions: ChannelVersions\n): ChannelVersions {\n // Get new channel versions\n if (Object.keys(previousVersions).length > 0) {\n const nullVersion = getNullChannelVersion(currentVersions);\n return Object.fromEntries(\n Object.entries(currentVersions).filter(\n ([k, v]) => v > (previousVersions[k] ?? nullVersion)\n )\n );\n } else {\n return currentVersions;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function _coerceToDict(value: any, defaultKey: string) {\n return value &&\n !Array.isArray(value) &&\n // eslint-disable-next-line no-instanceof/no-instanceof\n !(value instanceof Date) &&\n typeof value === \"object\"\n ? value\n : { [defaultKey]: value };\n}\n\nexport type RetryPolicy = {\n /**\n * Amount of time that must elapse before the first retry occurs in milliseconds.\n * @default 500\n */\n initialInterval?: number;\n\n /**\n * Multiplier by which the interval increases after each retry.\n * @default 2\n */\n backoffFactor?: number;\n\n /**\n * Maximum amount of time that may elapse between retries in milliseconds.\n * @default 128000\n */\n maxInterval?: number;\n\n /**\n * Maximum amount of time that may elapse between retries.\n * @default 3\n */\n maxAttempts?: number;\n\n /**\n * Whether to add random jitter to the interval between retries.\n * @default true\n */\n jitter?: boolean;\n\n /** A function that returns True for exceptions that should trigger a retry. */\n retryOn?: (e: any) => boolean; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n /** Whether to log a warning when a retry is attempted. Defaults to true. */\n logWarning?: boolean;\n};\n\nexport type { TimeoutPolicy } from \"./timeout.js\";\nexport { coerceTimeoutPolicy } from \"./timeout.js\";\n\n/**\n * Configuration for caching nodes.\n */\nexport type CachePolicy = {\n /**\n * A function used to generate a cache key from node's input.\n * @returns A key for the cache.\n */\n keyFunc?: (args: unknown[]) => string;\n\n /**\n * The time to live for the cache in seconds.\n * If not defined, the entry will never expire.\n */\n ttl?: number;\n};\n\n/**\n * Controls the input and output payloads recorded on a node's own trace run.\n * The graph's root run and child runs created by traced runnables are unaffected.\n * Plain function nodes do not create an additional child run.\n *\n * Processors are synchronous and receive raw values, before callback payload\n * normalization. They run even without tracing callbacks. If a processor throws,\n * the original payload is recorded instead. Avoid mutating the supplied values:\n * they are also used for execution and are not copied.\n *\n * These transforms also affect chain callbacks, including `streamEvents` and\n * message streaming. Omitting outputs can suppress messages returned directly\n * by nodes; omitting inputs can affect message deduplication.\n *\n * This policy is intended to reduce trace payload sizes, not redact secrets.\n * For redaction across all runs, configure the LangSmith client instead.\n *\n * @example\n * ```ts\n * graph.addNode(\"before_model\", beforeModel, {\n * tracePolicy: {\n * processInputs: omitPayload,\n * processOutputs: omitPayload,\n * },\n * });\n * ```\n */\nexport type TracePolicy = {\n /** Transform the raw node input recorded on its trace run. */\n processInputs?: (value: unknown) => unknown;\n /** Transform the raw node output recorded on its trace run. */\n processOutputs?: (value: unknown) => unknown;\n};\n\n/**\n * Record an empty trace payload while retaining the node's span and timing.\n * Use as `processInputs` and/or `processOutputs` in a {@link TracePolicy}.\n */\nexport function omitPayload(_value: unknown): Record<string, never> {\n return {};\n}\n\nexport function patchConfigurable(\n config: RunnableConfig | undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patch: Record<string, any>\n): RunnableConfig {\n if (config === null) {\n return { configurable: patch };\n } else if (config?.configurable === undefined) {\n return { ...config, configurable: patch };\n } else {\n return {\n ...config,\n configurable: { ...config.configurable, ...patch },\n };\n }\n}\n\nexport function patchCheckpointMap(\n config: RunnableConfig,\n metadata?: CheckpointMetadata\n): RunnableConfig {\n const parents = metadata?.parents ?? {};\n\n if (Object.keys(parents).length > 0) {\n return patchConfigurable(config, {\n [CONFIG_KEY_CHECKPOINT_MAP]: {\n ...parents,\n [config.configurable?.checkpoint_ns ?? \"\"]:\n config.configurable?.checkpoint_id,\n },\n });\n } else {\n return config;\n }\n}\n\n/**\n * Combine multiple abort signals into a single abort signal.\n * @param signals - The abort signals to combine.\n * @returns A combined abort signal and a dispose function to remove the abort listener if unused.\n */\nexport function combineAbortSignals(...x: (AbortSignal | undefined)[]): {\n signal: AbortSignal | undefined;\n dispose?: () => void;\n} {\n const signals = [...new Set(x.filter(Boolean))] as AbortSignal[];\n\n if (signals.length === 0) {\n return { signal: undefined, dispose: undefined };\n }\n\n if (signals.length === 1) {\n return { signal: signals[0], dispose: undefined };\n }\n\n const combinedController = new AbortController();\n const listener = () => {\n const reason = signals.find((s) => s.aborted)?.reason;\n combinedController.abort(reason);\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n };\n\n signals.forEach((s) => s.addEventListener(\"abort\", listener, { once: true }));\n\n const hasAlreadyAbortedSignal = signals.find((s) => s.aborted);\n if (hasAlreadyAbortedSignal) {\n combinedController.abort(hasAlreadyAbortedSignal.reason);\n }\n\n return {\n signal: combinedController.signal,\n dispose: () => {\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n },\n };\n}\n\n/**\n * Combine multiple callbacks into a single callback.\n * @param callback1 - The first callback to combine.\n * @param callback2 - The second callback to combine.\n * @returns A single callback that is a combination of the input callbacks.\n */\nexport const combineCallbacks = (\n callback1?: Callbacks,\n callback2?: Callbacks\n): Callbacks | undefined => {\n if (!callback1 && !callback2) {\n return undefined;\n }\n\n if (!callback1) {\n return callback2;\n }\n\n if (!callback2) {\n return callback1;\n }\n if (Array.isArray(callback1) && Array.isArray(callback2)) {\n return [...callback1, ...callback2];\n }\n if (Array.isArray(callback1)) {\n return [...callback1, callback2] as Callbacks;\n }\n if (Array.isArray(callback2)) {\n return [callback1, ...callback2];\n }\n return [callback1, callback2] as Callbacks;\n};\n"],"mappings":";;;AAQA,SAAgB,sBAAsB,iBAAkC;CAGtE,MAAM,eAAe,OAAO,gBAAgB;AAC5C,KAAI,iBAAiB,SAAU,QAAO;AACtC,KAAI,iBAAiB,SAAU,QAAO;AAGtC,MAAK,MAAM,OAAO,iBAAiB;AACjC,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,iBAAiB,IAAI,CAAE;EACjE,MAAM,cAAc,OAAO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AQ,QAAQ;EAAI,SAAS,KAAA;EAAW;CAGnD,MAAM,qBAAqB,IAAI,iBAAiB;CAChD,MAAM,iBAAiB;EACrB,MAAM,SAAS,QAAQ,MAAM,MAAM,EAAE,QAAQ,EAAE;AAC/C,qBAAmB,MAAM,OAAO;AAChC,UAAQ,SAAS,MAAM,EAAE,oBAAoB,SAAS,SAAS,CAAC;;AAGlE,SAAQ,SAAS,MAAM,EAAE,iBAAiB,SAAS,UAAU,EAAE,MAAM,MAAM,CAAC,CAAC;CAE7E,MAAM,0BAA0B,QAAQ,MAAM,MAAM,EAAE,QAAQ;AAC9D,KAAI,wBACF,oBAAmB,MAAM,wBAAwB,OAAO;AAG1D,QAAO;EACL,QAAQ,mBAAmB;EAC3B,eAAe;AACb,WAAQ,SAAS,MAAM,EAAE,oBAAoB,SAAS,SAAS,CAAC;;EAEnE"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/pregel/utils/index.ts"],"sourcesContent":["import { Callbacks } from \"@langchain/core/callbacks/manager\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport type {\n ChannelVersions,\n CheckpointMetadata,\n} from \"@langchain/langgraph-checkpoint\";\nimport { CONFIG_KEY_CHECKPOINT_MAP, START } from \"../../constants.js\";\n\nexport function getNullChannelVersion(currentVersions: ChannelVersions) {\n // Short circuit for commonly used channels such as __start__\n // (used by StateGraph)\n const startVersion = typeof currentVersions[START];\n if (startVersion === \"number\") return 0;\n if (startVersion === \"string\") return \"\";\n\n // Defer back to obtaining a first key from channel versions\n for (const key in currentVersions) {\n if (!Object.prototype.hasOwnProperty.call(currentVersions, key)) continue;\n const versionType = typeof currentVersions[key];\n if (versionType === \"number\") return 0;\n if (versionType === \"string\") return \"\";\n break;\n }\n\n return undefined;\n}\n\nexport function getNewChannelVersions(\n previousVersions: ChannelVersions,\n currentVersions: ChannelVersions\n): ChannelVersions {\n // Get new channel versions\n if (Object.keys(previousVersions).length > 0) {\n const nullVersion = getNullChannelVersion(currentVersions);\n return Object.fromEntries(\n Object.entries(currentVersions).filter(\n ([k, v]) => v > (previousVersions[k] ?? nullVersion)\n )\n );\n } else {\n return currentVersions;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function _coerceToDict(value: any, defaultKey: string) {\n return value &&\n !Array.isArray(value) &&\n // eslint-disable-next-line no-instanceof/no-instanceof\n !(value instanceof Date) &&\n typeof value === \"object\"\n ? value\n : { [defaultKey]: value };\n}\n\nexport type RetryPolicy = {\n /**\n * Amount of time that must elapse before the first retry occurs in milliseconds.\n * @default 500\n */\n initialInterval?: number;\n\n /**\n * Multiplier by which the interval increases after each retry.\n * @default 2\n */\n backoffFactor?: number;\n\n /**\n * Maximum amount of time that may elapse between retries in milliseconds.\n * @default 128000\n */\n maxInterval?: number;\n\n /**\n * Maximum amount of time that may elapse between retries.\n * @default 3\n */\n maxAttempts?: number;\n\n /**\n * Whether to add random jitter to the interval between retries.\n * @default true\n */\n jitter?: boolean;\n\n /** A function that returns True for exceptions that should trigger a retry. */\n retryOn?: (e: any) => boolean; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n /** Whether to log a warning when a retry is attempted. Defaults to true. */\n logWarning?: boolean;\n};\n\nexport type { TimeoutPolicy } from \"./timeout.js\";\nexport { coerceTimeoutPolicy } from \"./timeout.js\";\n\n/**\n * Configuration for caching nodes.\n */\nexport type CachePolicy = {\n /**\n * A function used to generate a cache key from node's input.\n * @returns A key for the cache.\n */\n keyFunc?: (args: unknown[]) => string;\n\n /**\n * The time to live for the cache in seconds.\n * If not defined, the entry will never expire.\n */\n ttl?: number;\n};\n\nexport function patchConfigurable(\n config: RunnableConfig | undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patch: Record<string, any>\n): RunnableConfig {\n if (config === null) {\n return { configurable: patch };\n } else if (config?.configurable === undefined) {\n return { ...config, configurable: patch };\n } else {\n return {\n ...config,\n configurable: { ...config.configurable, ...patch },\n };\n }\n}\n\nexport function patchCheckpointMap(\n config: RunnableConfig,\n metadata?: CheckpointMetadata\n): RunnableConfig {\n const parents = metadata?.parents ?? {};\n\n if (Object.keys(parents).length > 0) {\n return patchConfigurable(config, {\n [CONFIG_KEY_CHECKPOINT_MAP]: {\n ...parents,\n [config.configurable?.checkpoint_ns ?? \"\"]:\n config.configurable?.checkpoint_id,\n },\n });\n } else {\n return config;\n }\n}\n\n/**\n * Combine multiple abort signals into a single abort signal.\n * @param signals - The abort signals to combine.\n * @returns A combined abort signal and a dispose function to remove the abort listener if unused.\n */\nexport function combineAbortSignals(...x: (AbortSignal | undefined)[]): {\n signal: AbortSignal | undefined;\n dispose?: () => void;\n} {\n const signals = [...new Set(x.filter(Boolean))] as AbortSignal[];\n\n if (signals.length === 0) {\n return { signal: undefined, dispose: undefined };\n }\n\n if (signals.length === 1) {\n return { signal: signals[0], dispose: undefined };\n }\n\n const combinedController = new AbortController();\n const listener = () => {\n const reason = signals.find((s) => s.aborted)?.reason;\n combinedController.abort(reason);\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n };\n\n signals.forEach((s) => s.addEventListener(\"abort\", listener, { once: true }));\n\n const hasAlreadyAbortedSignal = signals.find((s) => s.aborted);\n if (hasAlreadyAbortedSignal) {\n combinedController.abort(hasAlreadyAbortedSignal.reason);\n }\n\n return {\n signal: combinedController.signal,\n dispose: () => {\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n },\n };\n}\n\n/**\n * Combine multiple callbacks into a single callback.\n * @param callback1 - The first callback to combine.\n * @param callback2 - The second callback to combine.\n * @returns A single callback that is a combination of the input callbacks.\n */\nexport const combineCallbacks = (\n callback1?: Callbacks,\n callback2?: Callbacks\n): Callbacks | undefined => {\n if (!callback1 && !callback2) {\n return undefined;\n }\n\n if (!callback1) {\n return callback2;\n }\n\n if (!callback2) {\n return callback1;\n }\n if (Array.isArray(callback1) && Array.isArray(callback2)) {\n return [...callback1, ...callback2];\n }\n if (Array.isArray(callback1)) {\n return [...callback1, callback2] as Callbacks;\n }\n if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cAAc;EACxB,EACF,CAAC;KAEF,QAAO;;;;;;;AASX,SAAgB,oBAAoB,GAAG,GAGrC;CACA,MAAM,UAAU,CAAC,GAAG,IAAI,IAAI,EAAE,OAAO,QAAQ,CAAC,CAAC;AAE/C,KAAI,QAAQ,WAAW,EACrB,QAAO;EAAE,QAAQ,KAAA;EAAW,SAAS,KAAA;EAAW;AAGlD,KAAI,QAAQ,WAAW,EACrB,QAAO;EAAE,QAAQ,QAAQ;EAAI,SAAS,KAAA;EAAW;CAGnD,MAAM,qBAAqB,IAAI,iBAAiB;CAChD,MAAM,iBAAiB;EACrB,MAAM,SAAS,QAAQ,MAAM,MAAM,EAAE,QAAQ,EAAE;AAC/C,qBAAmB,MAAM,OAAO;AAChC,UAAQ,SAAS,MAAM,EAAE,oBAAoB,SAAS,SAAS,CAAC;;AAGlE,SAAQ,SAAS,MAAM,EAAE,iBAAiB,SAAS,UAAU,EAAE,MAAM,MAAM,CAAC,CAAC;CAE7E,MAAM,0BAA0B,QAAQ,MAAM,MAAM,EAAE,QAAQ;AAC9D,KAAI,wBACF,oBAAmB,MAAM,wBAAwB,OAAO;AAG1D,QAAO;EACL,QAAQ,mBAAmB;EAC3B,eAAe;AACb,WAAQ,SAAS,MAAM,EAAE,oBAAoB,SAAS,SAAS,CAAC;;EAEnE"}
package/dist/web.cjs CHANGED
@@ -5,7 +5,6 @@ const require_base = require("./channels/base.cjs");
5
5
  const require_binop = require("./channels/binop.cjs");
6
6
  const require_annotation = require("./graph/annotation.cjs");
7
7
  const require_config = require("./pregel/utils/config.cjs");
8
- const require_index = require("./pregel/utils/index.cjs");
9
8
  const require_runtime = require("./pregel/runtime.cjs");
10
9
  const require_convert = require("./stream/convert.cjs");
11
10
  const require_stream_channel = require("./stream/stream-channel.cjs");
@@ -33,7 +32,7 @@ require("./state/index.cjs");
33
32
  const require_state = require("./graph/state.cjs");
34
33
  const require_message = require("./graph/message.cjs");
35
34
  require("./graph/index.cjs");
36
- const require_index$4 = require("./func/index.cjs");
35
+ const require_index$3 = require("./func/index.cjs");
37
36
  const require_messages_annotation = require("./graph/messages_annotation.cjs");
38
37
  const require_writer = require("./writer.cjs");
39
38
  let _langchain_langgraph_checkpoint = require("@langchain/langgraph-checkpoint");
@@ -143,13 +142,13 @@ Object.defineProperty(exports, "emptyCheckpoint", {
143
142
  return _langchain_langgraph_checkpoint.emptyCheckpoint;
144
143
  }
145
144
  });
146
- exports.entrypoint = require_index$4.entrypoint;
145
+ exports.entrypoint = require_index$3.entrypoint;
147
146
  exports.filterLifecycleEntries = require_lifecycle.filterLifecycleEntries;
148
147
  exports.filterSubgraphHandles = require_subgraphs.filterSubgraphHandles;
149
148
  exports.getConfig = require_config.getConfig;
150
149
  exports.getCurrentTaskInput = require_config.getCurrentTaskInput;
151
150
  exports.getJsonSchemaFromSchema = require_adapter.getJsonSchemaFromSchema;
152
- exports.getPreviousState = require_index$4.getPreviousState;
151
+ exports.getPreviousState = require_index$3.getPreviousState;
153
152
  exports.getSchemaDefaultGetter = require_adapter.getSchemaDefaultGetter;
154
153
  exports.getStore = require_config.getStore;
155
154
  exports.getSubgraphsSeenSet = require_errors.getSubgraphsSeenSet;
@@ -169,7 +168,6 @@ exports.isSerializableSchema = require_types$1.isSerializableSchema;
169
168
  exports.isStandardSchema = require_types$1.isStandardSchema;
170
169
  exports.messagesDeltaReducer = require_messages_reducer.messagesDeltaReducer;
171
170
  exports.messagesStateReducer = require_messages_reducer.messagesStateReducer;
172
- exports.omitPayload = require_index.omitPayload;
173
171
  exports.pushMessage = require_message.pushMessage;
174
- exports.task = require_index$4.task;
172
+ exports.task = require_index$3.task;
175
173
  exports.writer = require_writer.writer;
package/dist/web.d.cts CHANGED
@@ -13,7 +13,7 @@ import { UntrackedValueChannel } from "./channels/untracked_value.cjs";
13
13
  import { RunControl } from "./pregel/runtime.cjs";
14
14
  import { ExecutionInfo, LangGraphRunnableConfig, Runtime, ServerInfo } from "./pregel/runnable_types.cjs";
15
15
  import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.cjs";
16
- import { CachePolicy, RetryPolicy, TracePolicy, omitPayload } from "./pregel/utils/index.cjs";
16
+ import { CachePolicy, RetryPolicy } from "./pregel/utils/index.cjs";
17
17
  import { PregelNode } from "./pregel/read.cjs";
18
18
  import { AgentStatus, ChatModelStream, InferExtensions, InterruptPayload, LifecycleCause, LifecycleData, MessagesEventData, Namespace, NativeStreamTransformer, ProtocolEvent, StreamEmitter, StreamTransformer, ToolCallStatus, ToolCallStream, ToolsEventData, UpdatesEventData, UsageInfo, isNativeTransformer } from "./stream/types.cjs";
19
19
  import { GetStateOptions, MultipleChannelSubscriptionOptions, PregelOptions, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from "./pregel/types.cjs";
@@ -46,4 +46,4 @@ import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter
46
46
  import { MessagesDeltaValue, MessagesValue } from "./state/prebuilt/messages.cjs";
47
47
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.cjs";
48
48
  import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
49
- export { type AddNodeOptions, type AgentStatus, Annotation, type AnnotationRoot, AnyStateSchema, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type CachePolicy, type ChatModelStream, ChatModelStreamImpl, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, type CompiledGraphType, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type ConvertToProtocolEventOptions, type CreateGraphRunStreamOptions, DeltaChannel, type DeltaReducer, DeltaValue, DeltaValueInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, StreamChannel as EventLog, type ExecutionInfo, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphDrained, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphRunStream, GraphValueError, INTERRUPT, InMemoryStore, type InferExtensions, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, type InterruptPayload, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type LifecycleCause, type LifecycleData, type LifecycleEntry, type LifecycleProjection, type LifecycleTransformerOptions, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesDeltaValue, type MessagesEventData, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type Namespace, type NamespaceMatchType, type NativeStreamTransformer, NodeError, NodeInterrupt, type NodePolicyOptions, type NodeSpec, NodeTimeoutError, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type ProtocolEvent, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, RunControl, type Runtime, START, STREAM_EVENTS_V3_MODES, type SearchOperation, Send, type SendOptions, type ServerInfo, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphAddNodeOptions, type StateGraphArgs, type StateGraphArgsWithInputOutputSchemas, type StateGraphArgsWithStateSchema, type StateGraphInit, StateGraphInputError, type StateGraphNodeSpec, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFieldToChannel, StateSchemaFields, StateSchemaFieldsToStateDefinition, type StateSnapshot, type StateType, StreamChannel, type StreamEmitter, type StreamMode, type StreamOutputMap, type StreamTransformer, type SubgraphDiscoveryProjection, type SubgraphDiscoveryTransformerOptions, SubgraphRunStream, type TaskOptions, type TimeoutPolicy, type ToStateDefinition, type ToolCallStatus, type ToolCallStream, type ToolsEventData, type Topic, type TracePolicy, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type UpdatesEventData, type UsageInfo, type WaitForNames, messagesStateReducer as addMessages, convertToProtocolEvent, copyCheckpoint, createGraphRunStream, createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer, emptyCheckpoint, entrypoint, filterLifecycleEntries, filterSubgraphHandles, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCheckpointEnvelope, isCommand, isGraphBubbleUp, isGraphDrained, isGraphInterrupt, isInterrupted, isNativeTransformer, isNodeError, isNodeTimeoutError, isParentCommand, isSerializableSchema, isStandardSchema, messagesDeltaReducer, messagesStateReducer, omitPayload, pushMessage, task, writer };
49
+ export { type AddNodeOptions, type AgentStatus, Annotation, type AnnotationRoot, AnyStateSchema, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type CachePolicy, type ChatModelStream, ChatModelStreamImpl, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, type CompiledGraphType, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type ConvertToProtocolEventOptions, type CreateGraphRunStreamOptions, DeltaChannel, type DeltaReducer, DeltaValue, DeltaValueInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, StreamChannel as EventLog, type ExecutionInfo, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphDrained, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphRunStream, GraphValueError, INTERRUPT, InMemoryStore, type InferExtensions, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, type InterruptPayload, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type LifecycleCause, type LifecycleData, type LifecycleEntry, type LifecycleProjection, type LifecycleTransformerOptions, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesDeltaValue, type MessagesEventData, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type Namespace, type NamespaceMatchType, type NativeStreamTransformer, NodeError, NodeInterrupt, type NodePolicyOptions, type NodeSpec, NodeTimeoutError, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type ProtocolEvent, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, RunControl, type Runtime, START, STREAM_EVENTS_V3_MODES, type SearchOperation, Send, type SendOptions, type ServerInfo, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphAddNodeOptions, type StateGraphArgs, type StateGraphArgsWithInputOutputSchemas, type StateGraphArgsWithStateSchema, type StateGraphInit, StateGraphInputError, type StateGraphNodeSpec, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFieldToChannel, StateSchemaFields, StateSchemaFieldsToStateDefinition, type StateSnapshot, type StateType, StreamChannel, type StreamEmitter, type StreamMode, type StreamOutputMap, type StreamTransformer, type SubgraphDiscoveryProjection, type SubgraphDiscoveryTransformerOptions, SubgraphRunStream, type TaskOptions, type TimeoutPolicy, type ToStateDefinition, type ToolCallStatus, type ToolCallStream, type ToolsEventData, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type UpdatesEventData, type UsageInfo, type WaitForNames, messagesStateReducer as addMessages, convertToProtocolEvent, copyCheckpoint, createGraphRunStream, createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer, emptyCheckpoint, entrypoint, filterLifecycleEntries, filterSubgraphHandles, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCheckpointEnvelope, isCommand, isGraphBubbleUp, isGraphDrained, isGraphInterrupt, isInterrupted, isNativeTransformer, isNodeError, isNodeTimeoutError, isParentCommand, isSerializableSchema, isStandardSchema, messagesDeltaReducer, messagesStateReducer, pushMessage, task, writer };
package/dist/web.d.ts CHANGED
@@ -13,7 +13,7 @@ import { UntrackedValueChannel } from "./channels/untracked_value.js";
13
13
  import { RunControl } from "./pregel/runtime.js";
14
14
  import { ExecutionInfo, LangGraphRunnableConfig, Runtime, ServerInfo } from "./pregel/runnable_types.js";
15
15
  import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.js";
16
- import { CachePolicy, RetryPolicy, TracePolicy, omitPayload } from "./pregel/utils/index.js";
16
+ import { CachePolicy, RetryPolicy } from "./pregel/utils/index.js";
17
17
  import { PregelNode } from "./pregel/read.js";
18
18
  import { AgentStatus, ChatModelStream, InferExtensions, InterruptPayload, LifecycleCause, LifecycleData, MessagesEventData, Namespace, NativeStreamTransformer, ProtocolEvent, StreamEmitter, StreamTransformer, ToolCallStatus, ToolCallStream, ToolsEventData, UpdatesEventData, UsageInfo, isNativeTransformer } from "./stream/types.js";
19
19
  import { GetStateOptions, MultipleChannelSubscriptionOptions, PregelOptions, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from "./pregel/types.js";
@@ -46,4 +46,4 @@ import { getJsonSchemaFromSchema, getSchemaDefaultGetter } from "./state/adapter
46
46
  import { MessagesDeltaValue, MessagesValue } from "./state/prebuilt/messages.js";
47
47
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.js";
48
48
  import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
49
- export { type AddNodeOptions, type AgentStatus, Annotation, type AnnotationRoot, AnyStateSchema, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type CachePolicy, type ChatModelStream, ChatModelStreamImpl, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, type CompiledGraphType, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type ConvertToProtocolEventOptions, type CreateGraphRunStreamOptions, DeltaChannel, type DeltaReducer, DeltaValue, DeltaValueInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, StreamChannel as EventLog, type ExecutionInfo, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphDrained, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphRunStream, GraphValueError, INTERRUPT, InMemoryStore, type InferExtensions, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, type InterruptPayload, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type LifecycleCause, type LifecycleData, type LifecycleEntry, type LifecycleProjection, type LifecycleTransformerOptions, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesDeltaValue, type MessagesEventData, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type Namespace, type NamespaceMatchType, type NativeStreamTransformer, NodeError, NodeInterrupt, type NodePolicyOptions, type NodeSpec, NodeTimeoutError, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type ProtocolEvent, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, RunControl, type Runtime, START, STREAM_EVENTS_V3_MODES, type SearchOperation, Send, type SendOptions, type ServerInfo, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphAddNodeOptions, type StateGraphArgs, type StateGraphArgsWithInputOutputSchemas, type StateGraphArgsWithStateSchema, type StateGraphInit, StateGraphInputError, type StateGraphNodeSpec, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFieldToChannel, StateSchemaFields, StateSchemaFieldsToStateDefinition, type StateSnapshot, type StateType, StreamChannel, type StreamEmitter, type StreamMode, type StreamOutputMap, type StreamTransformer, type SubgraphDiscoveryProjection, type SubgraphDiscoveryTransformerOptions, SubgraphRunStream, type TaskOptions, type TimeoutPolicy, type ToStateDefinition, type ToolCallStatus, type ToolCallStream, type ToolsEventData, type Topic, type TracePolicy, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type UpdatesEventData, type UsageInfo, type WaitForNames, messagesStateReducer as addMessages, convertToProtocolEvent, copyCheckpoint, createGraphRunStream, createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer, emptyCheckpoint, entrypoint, filterLifecycleEntries, filterSubgraphHandles, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCheckpointEnvelope, isCommand, isGraphBubbleUp, isGraphDrained, isGraphInterrupt, isInterrupted, isNativeTransformer, isNodeError, isNodeTimeoutError, isParentCommand, isSerializableSchema, isStandardSchema, messagesDeltaReducer, messagesStateReducer, omitPayload, pushMessage, task, writer };
49
+ export { type AddNodeOptions, type AgentStatus, Annotation, type AnnotationRoot, AnyStateSchema, type AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, type BinaryOperator, BinaryOperatorAggregate, COMMAND_SYMBOL, type CachePolicy, type ChatModelStream, ChatModelStreamImpl, type Checkpoint, type CheckpointMetadata, type CheckpointTuple, Command, CommandInstance, type CommandParams, type CompiledGraph, type CompiledGraphType, CompiledStateGraph, type ConditionalEdgeRouter, type ConditionalEdgeRouterTypes, type ContextSchemaInit, type ConvertToProtocolEventOptions, type CreateGraphRunStreamOptions, DeltaChannel, type DeltaReducer, DeltaValue, DeltaValueInit, type DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, type EntrypointOptions, type EphemeralValue, StreamChannel as EventLog, type ExecutionInfo, type ExtractStateType, type ExtractUpdateType, type GetOperation, type GetStateOptions, Graph, GraphBubbleUp, GraphDrained, GraphInterrupt, type GraphNode, type GraphNodeReturnValue, type GraphNodeTypes, GraphRecursionError, GraphRunStream, GraphValueError, INTERRUPT, InMemoryStore, type InferExtensions, type InferInterruptInputType, type InferInterruptResumeType, InferStateSchemaUpdate, InferStateSchemaValue, type InferWriterType, type Interrupt, type InterruptPayload, InvalidUpdateError, type Item, type LangGraphRunnableConfig, type LastValue, type LifecycleCause, type LifecycleData, type LifecycleEntry, type LifecycleProjection, type LifecycleTransformerOptions, type ListNamespacesOperation, type MatchCondition, MemorySaver, MessageGraph, type Messages, MessagesAnnotation, MessagesDeltaValue, type MessagesEventData, MessagesValue, MessagesZodMeta, MessagesZodState, type MultipleChannelSubscriptionOptions, MultipleSubgraphsError, type NameSpacePath, type NamedBarrierValue, type Namespace, type NamespaceMatchType, type NativeStreamTransformer, NodeError, NodeInterrupt, type NodePolicyOptions, type NodeSpec, NodeTimeoutError, type NodeType, type Operation, type OperationResults, Overwrite, type OverwriteValue, ParentCommand, type Pregel, type PregelNode, type PregelOptions, type PregelParams, type ProtocolEvent, type PutOperation, REMOVE_ALL_MESSAGES, ReducedValue, ReducedValueInit, RemoteException, type RetryPolicy, RunControl, type Runtime, START, STREAM_EVENTS_V3_MODES, type SearchOperation, Send, type SendOptions, type ServerInfo, type SingleChannelSubscriptionOptions, type SingleReducer, type StateDefinition, type StateDefinitionInit, StateGraph, type StateGraphAddNodeOptions, type StateGraphArgs, type StateGraphArgsWithInputOutputSchemas, type StateGraphArgsWithStateSchema, type StateGraphInit, StateGraphInputError, type StateGraphNodeSpec, type StateGraphOptions, StateSchema, StateSchemaField, StateSchemaFieldToChannel, StateSchemaFields, StateSchemaFieldsToStateDefinition, type StateSnapshot, type StateType, StreamChannel, type StreamEmitter, type StreamMode, type StreamOutputMap, type StreamTransformer, type SubgraphDiscoveryProjection, type SubgraphDiscoveryTransformerOptions, SubgraphRunStream, type TaskOptions, type TimeoutPolicy, type ToStateDefinition, type ToolCallStatus, type ToolCallStream, type ToolsEventData, type Topic, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, UntrackedValueInit, type UpdateType, type UpdatesEventData, type UsageInfo, type WaitForNames, messagesStateReducer as addMessages, convertToProtocolEvent, copyCheckpoint, createGraphRunStream, createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer, emptyCheckpoint, entrypoint, filterLifecycleEntries, filterSubgraphHandles, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCheckpointEnvelope, isCommand, isGraphBubbleUp, isGraphDrained, isGraphInterrupt, isInterrupted, isNativeTransformer, isNodeError, isNodeTimeoutError, isParentCommand, isSerializableSchema, isStandardSchema, messagesDeltaReducer, messagesStateReducer, pushMessage, task, writer };
package/dist/web.js CHANGED
@@ -4,7 +4,6 @@ import { BaseChannel } from "./channels/base.js";
4
4
  import { BinaryOperatorAggregate } from "./channels/binop.js";
5
5
  import { Annotation } from "./graph/annotation.js";
6
6
  import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.js";
7
- import { omitPayload } from "./pregel/utils/index.js";
8
7
  import { RunControl } from "./pregel/runtime.js";
9
8
  import { STREAM_EVENTS_V3_MODES, convertToProtocolEvent, isCheckpointEnvelope } from "./stream/convert.js";
10
9
  import { StreamChannel } from "./stream/stream-channel.js";
@@ -36,4 +35,4 @@ import { entrypoint, getPreviousState, task } from "./func/index.js";
36
35
  import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.js";
37
36
  import { writer } from "./writer.js";
38
37
  import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, InMemoryStore, MemorySaver, copyCheckpoint, emptyCheckpoint } from "@langchain/langgraph-checkpoint";
39
- export { Annotation, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseStore, BinaryOperatorAggregate, COMMAND_SYMBOL, ChatModelStreamImpl, Command, CommandInstance, CompiledStateGraph, DeltaChannel, DeltaValue, END, EmptyChannelError, EmptyInputError, StreamChannel as EventLog, Graph, GraphBubbleUp, GraphDrained, GraphInterrupt, GraphRecursionError, GraphRunStream, GraphValueError, INTERRUPT, InMemoryStore, InvalidUpdateError, MemorySaver, MessageGraph, MessagesAnnotation, MessagesDeltaValue, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleSubgraphsError, NodeError, NodeInterrupt, NodeTimeoutError, Overwrite, ParentCommand, REMOVE_ALL_MESSAGES, ReducedValue, RemoteException, RunControl, START, STREAM_EVENTS_V3_MODES, Send, StateGraph, StateGraphInputError, StateSchema, StreamChannel, SubgraphRunStream, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, messagesStateReducer as addMessages, convertToProtocolEvent, copyCheckpoint, createGraphRunStream, createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer, emptyCheckpoint, entrypoint, filterLifecycleEntries, filterSubgraphHandles, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCheckpointEnvelope, isCommand, isGraphBubbleUp, isGraphDrained, isGraphInterrupt, isInterrupted, isNativeTransformer, isNodeError, isNodeTimeoutError, isParentCommand, isSerializableSchema, isStandardSchema, messagesDeltaReducer, messagesStateReducer, omitPayload, pushMessage, task, writer };
38
+ export { Annotation, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseStore, BinaryOperatorAggregate, COMMAND_SYMBOL, ChatModelStreamImpl, Command, CommandInstance, CompiledStateGraph, DeltaChannel, DeltaValue, END, EmptyChannelError, EmptyInputError, StreamChannel as EventLog, Graph, GraphBubbleUp, GraphDrained, GraphInterrupt, GraphRecursionError, GraphRunStream, GraphValueError, INTERRUPT, InMemoryStore, InvalidUpdateError, MemorySaver, MessageGraph, MessagesAnnotation, MessagesDeltaValue, MessagesValue, MessagesZodMeta, MessagesZodState, MultipleSubgraphsError, NodeError, NodeInterrupt, NodeTimeoutError, Overwrite, ParentCommand, REMOVE_ALL_MESSAGES, ReducedValue, RemoteException, RunControl, START, STREAM_EVENTS_V3_MODES, Send, StateGraph, StateGraphInputError, StateSchema, StreamChannel, SubgraphRunStream, UnreachableNodeError, UntrackedValue, UntrackedValueChannel, messagesStateReducer as addMessages, convertToProtocolEvent, copyCheckpoint, createGraphRunStream, createLifecycleTransformer, createMessagesTransformer, createSubgraphDiscoveryTransformer, createValuesTransformer, emptyCheckpoint, entrypoint, filterLifecycleEntries, filterSubgraphHandles, getConfig, getCurrentTaskInput, getJsonSchemaFromSchema, getPreviousState, getSchemaDefaultGetter, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCheckpointEnvelope, isCommand, isGraphBubbleUp, isGraphDrained, isGraphInterrupt, isInterrupted, isNativeTransformer, isNodeError, isNodeTimeoutError, isParentCommand, isSerializableSchema, isStandardSchema, messagesDeltaReducer, messagesStateReducer, pushMessage, task, writer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph",
3
- "version": "1.4.15-rc.0",
3
+ "version": "1.4.15",
4
4
  "description": "LangGraph",
5
5
  "type": "module",
6
6
  "engines": {
@@ -19,7 +19,7 @@
19
19
  "@langchain/protocol": "^0.0.19",
20
20
  "@standard-schema/spec": "1.1.0",
21
21
  "@langchain/langgraph-checkpoint": "^1.1.5",
22
- "@langchain/langgraph-sdk": "~1.10.3-rc.0"
22
+ "@langchain/langgraph-sdk": "~1.11.0"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@langchain/core": "^1.1.48",
@@ -35,8 +35,8 @@
35
35
  "@testing-library/dom": "^10.4.0",
36
36
  "@tsconfig/recommended": "^1.0.3",
37
37
  "@types/pg": "^8",
38
- "@vitest/browser": "^4.1.10",
39
- "@vitest/browser-playwright": "^4.1.10",
38
+ "@vitest/browser": "^4.1.11",
39
+ "@vitest/browser-playwright": "^4.1.11",
40
40
  "@xenova/transformers": "^2.17.2",
41
41
  "cheerio": "1.0.0-rc.12",
42
42
  "dotenv": "^16.3.1",
@@ -48,7 +48,7 @@
48
48
  "tsx": "^4.19.3",
49
49
  "typescript": "^4.9.5 || ^5.4.5",
50
50
  "vite-plugin-node-polyfills": "^0.28.0",
51
- "vitest": "^4.1.10",
51
+ "vitest": "^4.1.11",
52
52
  "@langchain/langgraph-checkpoint-postgres": "1.0.5",
53
53
  "@langchain/langgraph-checkpoint-sqlite": "1.0.4"
54
54
  },
@@ -1,103 +0,0 @@
1
- const require_index = require("./utils/index.cjs");
2
- let _langchain_core_runnables = require("@langchain/core/runnables");
3
- //#region src/pregel/runnable.ts
4
- function tracePayload(value, processor) {
5
- if (processor === void 0) return value;
6
- try {
7
- return processor(value);
8
- } catch (error) {
9
- console.warn("Trace input/output processor raised; recording untransformed payload", error);
10
- return value;
11
- }
12
- }
13
- /**
14
- * A node sequence with transforms at its own tracing boundaries. Keep execution
15
- * and child callback propagation aligned with Core's RunnableSequence; only the
16
- * values passed to handleChainStart/handleChainEnd are transformed.
17
- * @internal
18
- */
19
- var RunnableSeq = class extends _langchain_core_runnables.RunnableSequence {
20
- tracePolicy;
21
- constructor(fields) {
22
- const { tracePolicy, ...sequenceFields } = fields;
23
- super(sequenceFields);
24
- this.tracePolicy = tracePolicy;
25
- }
26
- async startTrace(input, config) {
27
- const payload = tracePayload(input, this.tracePolicy?.processInputs);
28
- return (await (0, _langchain_core_runnables.getCallbackManagerForConfig)(config))?.handleChainStart(this.toJSON(), require_index._coerceToDict(payload, "input"), config.runId, void 0, void 0, void 0, config.runName);
29
- }
30
- async endTrace(output, manager) {
31
- const payload = tracePayload(output, this.tracePolicy?.processOutputs);
32
- await manager?.handleChainEnd(require_index._coerceToDict(payload, "output"));
33
- }
34
- async invoke(input, options) {
35
- const config = (0, _langchain_core_runnables.ensureConfig)(options);
36
- const manager = await this.startTrace(input, config);
37
- delete config.runId;
38
- let nextInput = input;
39
- let output;
40
- try {
41
- const steps = [this.first, ...this.middle];
42
- for (let i = 0; i < steps.length; i += 1) nextInput = await (0, _langchain_core_runnables.raceWithSignal)(steps[i].invoke(nextInput, (0, _langchain_core_runnables.patchConfig)(config, { callbacks: manager?.getChild(this.omitSequenceTags ? void 0 : `seq:step:${i + 1}`) })), config.signal);
43
- if (config.signal?.aborted) await (0, _langchain_core_runnables.raceWithSignal)(Promise.resolve(), config.signal);
44
- output = await this.last.invoke(nextInput, (0, _langchain_core_runnables.patchConfig)(config, { callbacks: manager?.getChild(this.omitSequenceTags ? void 0 : `seq:step:${this.steps.length}`) }));
45
- } catch (error) {
46
- await manager?.handleChainError(error);
47
- throw error;
48
- }
49
- await this.endTrace(output, manager);
50
- return output;
51
- }
52
- async batch(inputs, options, batchOptions) {
53
- const configList = this._getOptionsList(options ?? {}, inputs.length);
54
- const managers = await Promise.all(configList.map(async (config, i) => {
55
- const manager = await this.startTrace(inputs[i], config);
56
- delete config.runId;
57
- return manager;
58
- }));
59
- let outputs = inputs;
60
- try {
61
- for (let i = 0; i < this.steps.length; i += 1) outputs = await (0, _langchain_core_runnables.raceWithSignal)(this.steps[i].batch(outputs, managers.map((manager, j) => (0, _langchain_core_runnables.patchConfig)(configList[j], { callbacks: manager?.getChild(this.omitSequenceTags ? void 0 : `seq:step:${i + 1}`) })), batchOptions), configList[0]?.signal);
62
- } catch (error) {
63
- await Promise.all(managers.map((manager) => manager?.handleChainError(error)));
64
- throw error;
65
- }
66
- await Promise.all(managers.map((manager, i) => this.endTrace(outputs[i], manager)));
67
- return outputs;
68
- }
69
- async *_streamIterator(input, options) {
70
- const config = (0, _langchain_core_runnables.ensureConfig)(options);
71
- const manager = await this.startTrace(input, config);
72
- delete config.runId;
73
- const steps = this.steps;
74
- let output;
75
- let concatSupported = true;
76
- async function* inputGenerator() {
77
- yield input;
78
- }
79
- try {
80
- let generator = steps[0].transform(inputGenerator(), (0, _langchain_core_runnables.patchConfig)(config, { callbacks: manager?.getChild(this.omitSequenceTags ? void 0 : "seq:step:1") }));
81
- for (let i = 1; i < steps.length; i += 1) generator = steps[i].transform(generator, (0, _langchain_core_runnables.patchConfig)(config, { callbacks: manager?.getChild(this.omitSequenceTags ? void 0 : `seq:step:${i + 1}`) }));
82
- for await (const chunk of generator) {
83
- config.signal?.throwIfAborted();
84
- yield chunk;
85
- if (concatSupported) if (output === void 0) output = chunk;
86
- else try {
87
- output = this._concatOutputChunks(output, chunk);
88
- } catch {
89
- output = void 0;
90
- concatSupported = false;
91
- }
92
- }
93
- } catch (error) {
94
- await manager?.handleChainError(error);
95
- throw error;
96
- }
97
- await this.endTrace(output, manager);
98
- }
99
- };
100
- //#endregion
101
- exports.RunnableSeq = RunnableSeq;
102
-
103
- //# sourceMappingURL=runnable.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runnable.cjs","names":["RunnableSequence","_coerceToDict"],"sources":["../../src/pregel/runnable.ts"],"sourcesContent":["import type { CallbackManagerForChainRun } from \"@langchain/core/callbacks/manager\";\nimport {\n ensureConfig,\n getCallbackManagerForConfig,\n patchConfig,\n raceWithSignal,\n RunnableSequence,\n type RunnableBatchOptions,\n type RunnableConfig,\n} from \"@langchain/core/runnables\";\nimport { _coerceToDict, type TracePolicy } from \"./utils/index.js\";\n\nfunction tracePayload(\n value: unknown,\n processor: ((value: unknown) => unknown) | undefined\n): unknown {\n if (processor === undefined) return value;\n try {\n return processor(value);\n } catch (error) {\n console.warn(\n \"Trace input/output processor raised; recording untransformed payload\",\n error\n );\n return value;\n }\n}\n\n/**\n * A node sequence with transforms at its own tracing boundaries. Keep execution\n * and child callback propagation aligned with Core's RunnableSequence; only the\n * values passed to handleChainStart/handleChainEnd are transformed.\n * @internal\n */\nexport class RunnableSeq<\n RunInput = unknown,\n RunOutput = unknown,\n> extends RunnableSequence<RunInput, RunOutput> {\n private tracePolicy?: TracePolicy;\n\n constructor(\n fields: ConstructorParameters<\n typeof RunnableSequence<RunInput, RunOutput>\n >[0] & {\n tracePolicy?: TracePolicy;\n }\n ) {\n const { tracePolicy, ...sequenceFields } = fields;\n super(sequenceFields);\n this.tracePolicy = tracePolicy;\n }\n\n private async startTrace(input: RunInput, config: RunnableConfig) {\n // Evaluate outside optional chaining: processors run without callbacks too.\n const payload = tracePayload(input, this.tracePolicy?.processInputs);\n const manager = await getCallbackManagerForConfig(config);\n return manager?.handleChainStart(\n this.toJSON(),\n _coerceToDict(payload, \"input\"),\n config.runId,\n undefined,\n undefined,\n undefined,\n config.runName\n );\n }\n\n private async endTrace(\n output: unknown,\n manager: CallbackManagerForChainRun | undefined\n ) {\n const payload = tracePayload(output, this.tracePolicy?.processOutputs);\n await manager?.handleChainEnd(_coerceToDict(payload, \"output\"));\n }\n\n override async invoke(\n input: RunInput,\n options?: RunnableConfig\n ): Promise<RunOutput> {\n const config = ensureConfig(options);\n const manager = await this.startTrace(input, config);\n delete config.runId;\n let nextInput = input;\n let output: RunOutput;\n try {\n const steps = [this.first, ...this.middle];\n for (let i = 0; i < steps.length; i += 1) {\n nextInput = await raceWithSignal(\n steps[i].invoke(\n nextInput,\n patchConfig(config, {\n callbacks: manager?.getChild(\n this.omitSequenceTags ? undefined : `seq:step:${i + 1}`\n ),\n })\n ),\n config.signal\n );\n }\n if (config.signal?.aborted) {\n // Use Core's abort-error normalization before invoking the last step.\n await raceWithSignal(Promise.resolve(), config.signal);\n }\n output = await this.last.invoke(\n nextInput,\n patchConfig(config, {\n callbacks: manager?.getChild(\n this.omitSequenceTags ? undefined : `seq:step:${this.steps.length}`\n ),\n })\n );\n } catch (error) {\n await manager?.handleChainError(error);\n throw error;\n }\n await this.endTrace(output, manager);\n return output;\n }\n\n override batch(\n inputs: RunInput[],\n options?: Partial<RunnableConfig> | Partial<RunnableConfig>[],\n batchOptions?: RunnableBatchOptions & { returnExceptions?: false }\n ): Promise<RunOutput[]>;\n override batch(\n inputs: RunInput[],\n options?: Partial<RunnableConfig> | Partial<RunnableConfig>[],\n batchOptions?: RunnableBatchOptions & { returnExceptions: true }\n ): Promise<(RunOutput | Error)[]>;\n override batch(\n inputs: RunInput[],\n options?: Partial<RunnableConfig> | Partial<RunnableConfig>[],\n batchOptions?: RunnableBatchOptions\n ): Promise<(RunOutput | Error)[]>;\n override async batch(\n inputs: RunInput[],\n options?: Partial<RunnableConfig> | Partial<RunnableConfig>[],\n batchOptions?: RunnableBatchOptions\n ): Promise<(RunOutput | Error)[]> {\n const configList = this._getOptionsList(options ?? {}, inputs.length);\n const managers = await Promise.all(\n configList.map(async (config, i) => {\n const manager = await this.startTrace(inputs[i], config);\n delete config.runId;\n return manager;\n })\n );\n let outputs: unknown[] = inputs;\n try {\n // Preserve RunnableSequence's step-wise batching so child runnables can\n // use their native batch implementations and handle returnExceptions.\n for (let i = 0; i < this.steps.length; i += 1) {\n outputs = await raceWithSignal(\n this.steps[i].batch(\n outputs,\n managers.map((manager, j) =>\n patchConfig(configList[j], {\n callbacks: manager?.getChild(\n this.omitSequenceTags ? undefined : `seq:step:${i + 1}`\n ),\n })\n ),\n batchOptions\n ),\n configList[0]?.signal\n );\n }\n } catch (error) {\n await Promise.all(\n managers.map((manager) => manager?.handleChainError(error))\n );\n throw error;\n }\n await Promise.all(\n managers.map((manager, i) => this.endTrace(outputs[i], manager))\n );\n return outputs as (RunOutput | Error)[];\n }\n\n override async *_streamIterator(input: RunInput, options?: RunnableConfig) {\n const config = ensureConfig(options);\n const manager = await this.startTrace(input, config);\n delete config.runId;\n const steps = this.steps;\n let output: RunOutput | undefined;\n let concatSupported = true;\n async function* inputGenerator() {\n yield input;\n }\n try {\n let generator = steps[0].transform(\n inputGenerator(),\n patchConfig(config, {\n callbacks: manager?.getChild(\n this.omitSequenceTags ? undefined : \"seq:step:1\"\n ),\n })\n );\n for (let i = 1; i < steps.length; i += 1) {\n generator = steps[i].transform(\n generator,\n patchConfig(config, {\n callbacks: manager?.getChild(\n this.omitSequenceTags ? undefined : `seq:step:${i + 1}`\n ),\n })\n );\n }\n for await (const chunk of generator) {\n config.signal?.throwIfAborted();\n yield chunk as RunOutput;\n if (concatSupported) {\n if (output === undefined) output = chunk;\n else {\n try {\n output = this._concatOutputChunks(output, chunk);\n } catch {\n output = undefined;\n concatSupported = false;\n }\n }\n }\n }\n } catch (error) {\n await manager?.handleChainError(error);\n throw error;\n }\n await this.endTrace(output, manager);\n }\n}\n"],"mappings":";;;AAYA,SAAS,aACP,OACA,WACS;AACT,KAAI,cAAc,KAAA,EAAW,QAAO;AACpC,KAAI;AACF,SAAO,UAAU,MAAM;UAChB,OAAO;AACd,UAAQ,KACN,wEAC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vB,gBAAgB,GAAA,GAAA,0BAAA,aACJ,QAAQ,EAClB,WAAW,SAAS,SAClB,KAAK,mBAAmB,KAAA,IAAY,aACrC,EACF,CAAC,CACH;AACD,QAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,EACrC,aAAY,MAAM,GAAG,UACnB,YAAA,GAAA,0BAAA,aACY,QAAQ,EAClB,WAAW,SAAS,SAClB,KAAK,mBAAmB,KAAA,IAAY,YAAY,IAAI,IACrD,EACF,CAAC,CACH;AAEH,cAAW,MAAM,SAAS,WAAW;AACnC,WAAO,QAAQ,gBAAgB;AAC/B,UAAM;AACN,QAAI,gBACF,KAAI,WAAW,KAAA,EAAW,UAAS;QAEjC,KAAI;AACF,cAAS,KAAK,oBAAoB,QAAQ,MAAM;YAC1C;AACN,cAAS,KAAA;AACT,uBAAkB;;;WAKnB,OAAO;AACd,SAAM,SAAS,iBAAiB,MAAM;AACtC,SAAM;;AAER,QAAM,KAAK,SAAS,QAAQ,QAAQ"}
@@ -1,103 +0,0 @@
1
- import { _coerceToDict } from "./utils/index.js";
2
- import { RunnableSequence, ensureConfig, getCallbackManagerForConfig, patchConfig, raceWithSignal } from "@langchain/core/runnables";
3
- //#region src/pregel/runnable.ts
4
- function tracePayload(value, processor) {
5
- if (processor === void 0) return value;
6
- try {
7
- return processor(value);
8
- } catch (error) {
9
- console.warn("Trace input/output processor raised; recording untransformed payload", error);
10
- return value;
11
- }
12
- }
13
- /**
14
- * A node sequence with transforms at its own tracing boundaries. Keep execution
15
- * and child callback propagation aligned with Core's RunnableSequence; only the
16
- * values passed to handleChainStart/handleChainEnd are transformed.
17
- * @internal
18
- */
19
- var RunnableSeq = class extends RunnableSequence {
20
- tracePolicy;
21
- constructor(fields) {
22
- const { tracePolicy, ...sequenceFields } = fields;
23
- super(sequenceFields);
24
- this.tracePolicy = tracePolicy;
25
- }
26
- async startTrace(input, config) {
27
- const payload = tracePayload(input, this.tracePolicy?.processInputs);
28
- return (await getCallbackManagerForConfig(config))?.handleChainStart(this.toJSON(), _coerceToDict(payload, "input"), config.runId, void 0, void 0, void 0, config.runName);
29
- }
30
- async endTrace(output, manager) {
31
- const payload = tracePayload(output, this.tracePolicy?.processOutputs);
32
- await manager?.handleChainEnd(_coerceToDict(payload, "output"));
33
- }
34
- async invoke(input, options) {
35
- const config = ensureConfig(options);
36
- const manager = await this.startTrace(input, config);
37
- delete config.runId;
38
- let nextInput = input;
39
- let output;
40
- try {
41
- const steps = [this.first, ...this.middle];
42
- for (let i = 0; i < steps.length; i += 1) nextInput = await raceWithSignal(steps[i].invoke(nextInput, patchConfig(config, { callbacks: manager?.getChild(this.omitSequenceTags ? void 0 : `seq:step:${i + 1}`) })), config.signal);
43
- if (config.signal?.aborted) await raceWithSignal(Promise.resolve(), config.signal);
44
- output = await this.last.invoke(nextInput, patchConfig(config, { callbacks: manager?.getChild(this.omitSequenceTags ? void 0 : `seq:step:${this.steps.length}`) }));
45
- } catch (error) {
46
- await manager?.handleChainError(error);
47
- throw error;
48
- }
49
- await this.endTrace(output, manager);
50
- return output;
51
- }
52
- async batch(inputs, options, batchOptions) {
53
- const configList = this._getOptionsList(options ?? {}, inputs.length);
54
- const managers = await Promise.all(configList.map(async (config, i) => {
55
- const manager = await this.startTrace(inputs[i], config);
56
- delete config.runId;
57
- return manager;
58
- }));
59
- let outputs = inputs;
60
- try {
61
- for (let i = 0; i < this.steps.length; i += 1) outputs = await raceWithSignal(this.steps[i].batch(outputs, managers.map((manager, j) => patchConfig(configList[j], { callbacks: manager?.getChild(this.omitSequenceTags ? void 0 : `seq:step:${i + 1}`) })), batchOptions), configList[0]?.signal);
62
- } catch (error) {
63
- await Promise.all(managers.map((manager) => manager?.handleChainError(error)));
64
- throw error;
65
- }
66
- await Promise.all(managers.map((manager, i) => this.endTrace(outputs[i], manager)));
67
- return outputs;
68
- }
69
- async *_streamIterator(input, options) {
70
- const config = ensureConfig(options);
71
- const manager = await this.startTrace(input, config);
72
- delete config.runId;
73
- const steps = this.steps;
74
- let output;
75
- let concatSupported = true;
76
- async function* inputGenerator() {
77
- yield input;
78
- }
79
- try {
80
- let generator = steps[0].transform(inputGenerator(), patchConfig(config, { callbacks: manager?.getChild(this.omitSequenceTags ? void 0 : "seq:step:1") }));
81
- for (let i = 1; i < steps.length; i += 1) generator = steps[i].transform(generator, patchConfig(config, { callbacks: manager?.getChild(this.omitSequenceTags ? void 0 : `seq:step:${i + 1}`) }));
82
- for await (const chunk of generator) {
83
- config.signal?.throwIfAborted();
84
- yield chunk;
85
- if (concatSupported) if (output === void 0) output = chunk;
86
- else try {
87
- output = this._concatOutputChunks(output, chunk);
88
- } catch {
89
- output = void 0;
90
- concatSupported = false;
91
- }
92
- }
93
- } catch (error) {
94
- await manager?.handleChainError(error);
95
- throw error;
96
- }
97
- await this.endTrace(output, manager);
98
- }
99
- };
100
- //#endregion
101
- export { RunnableSeq };
102
-
103
- //# sourceMappingURL=runnable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runnable.js","names":[],"sources":["../../src/pregel/runnable.ts"],"sourcesContent":["import type { CallbackManagerForChainRun } from \"@langchain/core/callbacks/manager\";\nimport {\n ensureConfig,\n getCallbackManagerForConfig,\n patchConfig,\n raceWithSignal,\n RunnableSequence,\n type RunnableBatchOptions,\n type RunnableConfig,\n} from \"@langchain/core/runnables\";\nimport { _coerceToDict, type TracePolicy } from \"./utils/index.js\";\n\nfunction tracePayload(\n value: unknown,\n processor: ((value: unknown) => unknown) | undefined\n): unknown {\n if (processor === undefined) return value;\n try {\n return processor(value);\n } catch (error) {\n console.warn(\n \"Trace input/output processor raised; recording untransformed payload\",\n error\n );\n return value;\n }\n}\n\n/**\n * A node sequence with transforms at its own tracing boundaries. Keep execution\n * and child callback propagation aligned with Core's RunnableSequence; only the\n * values passed to handleChainStart/handleChainEnd are transformed.\n * @internal\n */\nexport class RunnableSeq<\n RunInput = unknown,\n RunOutput = unknown,\n> extends RunnableSequence<RunInput, RunOutput> {\n private tracePolicy?: TracePolicy;\n\n constructor(\n fields: ConstructorParameters<\n typeof RunnableSequence<RunInput, RunOutput>\n >[0] & {\n tracePolicy?: TracePolicy;\n }\n ) {\n const { tracePolicy, ...sequenceFields } = fields;\n super(sequenceFields);\n this.tracePolicy = tracePolicy;\n }\n\n private async startTrace(input: RunInput, config: RunnableConfig) {\n // Evaluate outside optional chaining: processors run without callbacks too.\n const payload = tracePayload(input, this.tracePolicy?.processInputs);\n const manager = await getCallbackManagerForConfig(config);\n return manager?.handleChainStart(\n this.toJSON(),\n _coerceToDict(payload, \"input\"),\n config.runId,\n undefined,\n undefined,\n undefined,\n config.runName\n );\n }\n\n private async endTrace(\n output: unknown,\n manager: CallbackManagerForChainRun | undefined\n ) {\n const payload = tracePayload(output, this.tracePolicy?.processOutputs);\n await manager?.handleChainEnd(_coerceToDict(payload, \"output\"));\n }\n\n override async invoke(\n input: RunInput,\n options?: RunnableConfig\n ): Promise<RunOutput> {\n const config = ensureConfig(options);\n const manager = await this.startTrace(input, config);\n delete config.runId;\n let nextInput = input;\n let output: RunOutput;\n try {\n const steps = [this.first, ...this.middle];\n for (let i = 0; i < steps.length; i += 1) {\n nextInput = await raceWithSignal(\n steps[i].invoke(\n nextInput,\n patchConfig(config, {\n callbacks: manager?.getChild(\n this.omitSequenceTags ? undefined : `seq:step:${i + 1}`\n ),\n })\n ),\n config.signal\n );\n }\n if (config.signal?.aborted) {\n // Use Core's abort-error normalization before invoking the last step.\n await raceWithSignal(Promise.resolve(), config.signal);\n }\n output = await this.last.invoke(\n nextInput,\n patchConfig(config, {\n callbacks: manager?.getChild(\n this.omitSequenceTags ? undefined : `seq:step:${this.steps.length}`\n ),\n })\n );\n } catch (error) {\n await manager?.handleChainError(error);\n throw error;\n }\n await this.endTrace(output, manager);\n return output;\n }\n\n override batch(\n inputs: RunInput[],\n options?: Partial<RunnableConfig> | Partial<RunnableConfig>[],\n batchOptions?: RunnableBatchOptions & { returnExceptions?: false }\n ): Promise<RunOutput[]>;\n override batch(\n inputs: RunInput[],\n options?: Partial<RunnableConfig> | Partial<RunnableConfig>[],\n batchOptions?: RunnableBatchOptions & { returnExceptions: true }\n ): Promise<(RunOutput | Error)[]>;\n override batch(\n inputs: RunInput[],\n options?: Partial<RunnableConfig> | Partial<RunnableConfig>[],\n batchOptions?: RunnableBatchOptions\n ): Promise<(RunOutput | Error)[]>;\n override async batch(\n inputs: RunInput[],\n options?: Partial<RunnableConfig> | Partial<RunnableConfig>[],\n batchOptions?: RunnableBatchOptions\n ): Promise<(RunOutput | Error)[]> {\n const configList = this._getOptionsList(options ?? {}, inputs.length);\n const managers = await Promise.all(\n configList.map(async (config, i) => {\n const manager = await this.startTrace(inputs[i], config);\n delete config.runId;\n return manager;\n })\n );\n let outputs: unknown[] = inputs;\n try {\n // Preserve RunnableSequence's step-wise batching so child runnables can\n // use their native batch implementations and handle returnExceptions.\n for (let i = 0; i < this.steps.length; i += 1) {\n outputs = await raceWithSignal(\n this.steps[i].batch(\n outputs,\n managers.map((manager, j) =>\n patchConfig(configList[j], {\n callbacks: manager?.getChild(\n this.omitSequenceTags ? undefined : `seq:step:${i + 1}`\n ),\n })\n ),\n batchOptions\n ),\n configList[0]?.signal\n );\n }\n } catch (error) {\n await Promise.all(\n managers.map((manager) => manager?.handleChainError(error))\n );\n throw error;\n }\n await Promise.all(\n managers.map((manager, i) => this.endTrace(outputs[i], manager))\n );\n return outputs as (RunOutput | Error)[];\n }\n\n override async *_streamIterator(input: RunInput, options?: RunnableConfig) {\n const config = ensureConfig(options);\n const manager = await this.startTrace(input, config);\n delete config.runId;\n const steps = this.steps;\n let output: RunOutput | undefined;\n let concatSupported = true;\n async function* inputGenerator() {\n yield input;\n }\n try {\n let generator = steps[0].transform(\n inputGenerator(),\n patchConfig(config, {\n callbacks: manager?.getChild(\n this.omitSequenceTags ? undefined : \"seq:step:1\"\n ),\n })\n );\n for (let i = 1; i < steps.length; i += 1) {\n generator = steps[i].transform(\n generator,\n patchConfig(config, {\n callbacks: manager?.getChild(\n this.omitSequenceTags ? undefined : `seq:step:${i + 1}`\n ),\n })\n );\n }\n for await (const chunk of generator) {\n config.signal?.throwIfAborted();\n yield chunk as RunOutput;\n if (concatSupported) {\n if (output === undefined) output = chunk;\n else {\n try {\n output = this._concatOutputChunks(output, chunk);\n } catch {\n output = undefined;\n concatSupported = false;\n }\n }\n }\n }\n } catch (error) {\n await manager?.handleChainError(error);\n throw error;\n }\n await this.endTrace(output, manager);\n }\n}\n"],"mappings":";;;AAYA,SAAS,aACP,OACA,WACS;AACT,KAAI,cAAc,KAAA,EAAW,QAAO;AACpC,KAAI;AACF,SAAO,UAAU,MAAM;UAChB,OAAO;AACd,UAAQ,KACN,wEACA,MACD;AACD,SAAO;;;;;;;;;AAUX,IAAa,cAAb,cAGU,iBAAsC;CAC9C;CAEA,YACE,QAKA;EACA,MAAM,EAAE,aAAa,GAAG,mBAAmB;AAC3C,QAAM,eAAe;AACrB,OAAK,cAAc;;CAGrB,MAAc,WAAW,OAAiB,QAAwB;EAEhE,MAAM,UAAU,aAAa,OAAO,KAAK,aAAa,cAAc;AAEpE,UADgB,MAAM,4BAA4B,OAAO,GACzC,iBACd,KAAK,QAAQ,EACb,cAAc,SAAS,QAAQ,EAC/B,OAAO,OACP,KAAA,GACA,KAAA,GACA,KAAA,GACA,OAAO,QACR;;CAGH,MAAc,SACZ,QACA,SACA;EACA,MAAM,UAAU,aAAa,QAAQ,KAAK,aAAa,eAAe;AACtE,QAAM,SAAS,eAAe,cAAc,SAAS,SAAS,CAAC;;CAGjE,MAAe,OACb,OACA,SACoB;EACpB,MAAM,SAAS,aAAa,QAAQ;EACpC,MAAM,UAAU,MAAM,KAAK,WAAW,OAAO,OAAO;AACpD,SAAO,OAAO;EACd,IAAI,YAAY;EAChB,IAAI;AACJ,MAAI;GACF,MAAM,QAAQ,CAAC,KAAK,OAAO,GAAG,KAAK,OAAO;AAC1C,QAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,EACrC,aAAY,MAAM,eAChB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