@langgraph-js/pure-graph 1.4.2 → 1.4.5

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 (51) hide show
  1. package/dist/adapter/hono/index.js +104 -7
  2. package/dist/adapter/hono/index.js.map +1 -0
  3. package/dist/adapter/nextjs/index.js +175 -2
  4. package/dist/adapter/nextjs/index.js.map +1 -0
  5. package/dist/{checkpoint-BHKV54sL.js → checkpoint-BQME4ngM.js} +2 -2
  6. package/dist/{checkpoint-BHKV54sL.js.map → checkpoint-BQME4ngM.js.map} +1 -1
  7. package/dist/{index-DcXE-SZb.js → createEndpoint-BcVhF-uq.js} +6 -17
  8. package/dist/createEndpoint-BcVhF-uq.js.map +1 -0
  9. package/dist/index.js +16 -5
  10. package/dist/index.js.map +1 -1
  11. package/dist/{queue-C6iEVbd2.js → queue-pSZu1PVS.js} +2 -2
  12. package/dist/{queue-C6iEVbd2.js.map → queue-pSZu1PVS.js.map} +1 -1
  13. package/dist/{threads-BUgBiCiK.js → threads-amMaxKul.js} +2 -2
  14. package/dist/{threads-BUgBiCiK.js.map → threads-amMaxKul.js.map} +1 -1
  15. package/dist/zod-BaCzVUl8.js +107 -0
  16. package/dist/zod-BaCzVUl8.js.map +1 -0
  17. package/package.json +2 -2
  18. package/dist/__vite-browser-external-DGN5jhtd.js +0 -4
  19. package/dist/__vite-browser-external-DGN5jhtd.js.map +0 -1
  20. package/dist/adapter/hono/assistants.js +0 -21
  21. package/dist/adapter/hono/endpoint.js +0 -2
  22. package/dist/adapter/hono/runs.js +0 -54
  23. package/dist/adapter/hono/threads.js +0 -30
  24. package/dist/adapter/nextjs/endpoint.js +0 -2
  25. package/dist/adapter/nextjs/router.js +0 -179
  26. package/dist/adapter/zod.js +0 -127
  27. package/dist/createEndpoint.js +0 -77
  28. package/dist/global.js +0 -13
  29. package/dist/graph/stream.js +0 -195
  30. package/dist/graph/stringify.js +0 -214
  31. package/dist/index-DcXE-SZb.js.map +0 -1
  32. package/dist/queue/JsonPlusSerializer.js +0 -138
  33. package/dist/queue/event_message.js +0 -27
  34. package/dist/queue/stream_queue.js +0 -177
  35. package/dist/storage/index.js +0 -64
  36. package/dist/storage/memory/checkpoint.js +0 -2
  37. package/dist/storage/memory/queue.js +0 -81
  38. package/dist/storage/memory/threads.js +0 -145
  39. package/dist/storage/pg/checkpoint.js +0 -9
  40. package/dist/storage/pg/threads.js +0 -303
  41. package/dist/storage/redis/queue.js +0 -130
  42. package/dist/storage/sqlite/DB.js +0 -14
  43. package/dist/storage/sqlite/checkpoint.js +0 -374
  44. package/dist/storage/sqlite/threads.js +0 -299
  45. package/dist/storage/sqlite/type.js +0 -1
  46. package/dist/threads/index.js +0 -1
  47. package/dist/tsconfig.tsbuildinfo +0 -1
  48. package/dist/types.js +0 -1
  49. package/dist/utils/createEntrypointGraph.js +0 -11
  50. package/dist/utils/getGraph.js +0 -18
  51. package/dist/utils/getLangGraphCommand.js +0 -13
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- import { StateGraph } from '@langchain/langgraph';
2
- export const createEntrypointGraph = ({ stateSchema, config, graph, }) => {
3
- const name = graph.getName();
4
- return new StateGraph(stateSchema, config)
5
- .addNode(name, (state, config) => graph.invoke(state, config))
6
- .addEdge('__start__', name)
7
- .addEdge(name, '__end__')
8
- .compile({
9
- name,
10
- });
11
- };
@@ -1,18 +0,0 @@
1
- import { LangGraphGlobal } from '../global';
2
- export const GRAPHS = {};
3
- export async function registerGraph(graphId, graph) {
4
- GRAPHS[graphId] = graph;
5
- }
6
- export async function getGraph(graphId, config, options) {
7
- if (!GRAPHS[graphId])
8
- throw new Error(`Graph "${graphId}" not found`);
9
- const compiled = typeof GRAPHS[graphId] === 'function' ? await GRAPHS[graphId](config ?? { configurable: {} }) : GRAPHS[graphId];
10
- if (typeof options?.checkpointer !== 'undefined') {
11
- compiled.checkpointer = options?.checkpointer ?? LangGraphGlobal.globalCheckPointer;
12
- }
13
- else {
14
- compiled.checkpointer = LangGraphGlobal.globalCheckPointer;
15
- }
16
- compiled.store = options?.store ?? undefined;
17
- return compiled;
18
- }
@@ -1,13 +0,0 @@
1
- import { Command, Send } from '@langchain/langgraph';
2
- export const getLangGraphCommand = (command) => {
3
- let goto = command.goto != null && !Array.isArray(command.goto) ? [command.goto] : command.goto;
4
- return new Command({
5
- goto: goto?.map((item) => {
6
- if (typeof item !== 'string')
7
- return new Send(item.node, item.input);
8
- return item;
9
- }),
10
- update: command.update ?? undefined,
11
- resume: command.resume,
12
- });
13
- };