langchain 1.0.6 → 1.1.1
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.
- package/CHANGELOG.md +26 -0
- package/README.md +1 -1
- package/chat_models/universal.cjs +1 -0
- package/chat_models/universal.d.cts +1 -0
- package/chat_models/universal.d.ts +1 -0
- package/chat_models/universal.js +1 -0
- package/dist/agents/ReactAgent.cjs +1 -1
- package/dist/agents/ReactAgent.cjs.map +1 -1
- package/dist/agents/ReactAgent.js +2 -2
- package/dist/agents/ReactAgent.js.map +1 -1
- package/dist/agents/index.d.cts +0 -2
- package/dist/agents/index.d.ts +0 -2
- package/dist/agents/middleware/constants.cjs +16 -0
- package/dist/agents/middleware/constants.cjs.map +1 -0
- package/dist/agents/middleware/constants.js +15 -0
- package/dist/agents/middleware/constants.js.map +1 -0
- package/dist/agents/middleware/contextEditing.cjs.map +1 -1
- package/dist/agents/middleware/contextEditing.d.cts +23 -7
- package/dist/agents/middleware/contextEditing.d.ts +23 -7
- package/dist/agents/middleware/contextEditing.js.map +1 -1
- package/dist/agents/middleware/dynamicSystemPrompt.cjs +5 -2
- package/dist/agents/middleware/dynamicSystemPrompt.cjs.map +1 -1
- package/dist/agents/middleware/dynamicSystemPrompt.d.cts +2 -1
- package/dist/agents/middleware/dynamicSystemPrompt.d.ts +2 -1
- package/dist/agents/middleware/dynamicSystemPrompt.js +4 -2
- package/dist/agents/middleware/dynamicSystemPrompt.js.map +1 -1
- package/dist/agents/middleware/error.cjs +20 -0
- package/dist/agents/middleware/error.cjs.map +1 -0
- package/dist/agents/middleware/error.js +19 -0
- package/dist/agents/middleware/error.js.map +1 -0
- package/dist/agents/middleware/index.cjs +4 -2
- package/dist/agents/middleware/index.d.ts +18 -0
- package/dist/agents/middleware/index.js +4 -2
- package/dist/agents/middleware/modelRetry.cjs +162 -0
- package/dist/agents/middleware/modelRetry.cjs.map +1 -0
- package/dist/agents/middleware/modelRetry.d.cts +134 -0
- package/dist/agents/middleware/modelRetry.d.ts +134 -0
- package/dist/agents/middleware/modelRetry.js +161 -0
- package/dist/agents/middleware/modelRetry.js.map +1 -0
- package/dist/agents/middleware/{promptCaching.cjs → provider/anthropic/promptCaching.cjs} +3 -3
- package/dist/agents/middleware/provider/anthropic/promptCaching.cjs.map +1 -0
- package/dist/agents/middleware/{promptCaching.d.cts → provider/anthropic/promptCaching.d.cts} +2 -2
- package/dist/agents/middleware/{promptCaching.d.ts → provider/anthropic/promptCaching.d.ts} +2 -2
- package/dist/agents/middleware/{promptCaching.js → provider/anthropic/promptCaching.js} +2 -2
- package/dist/agents/middleware/provider/anthropic/promptCaching.js.map +1 -0
- package/dist/agents/middleware/provider/openai/moderation.cjs +299 -0
- package/dist/agents/middleware/provider/openai/moderation.cjs.map +1 -0
- package/dist/agents/middleware/provider/openai/moderation.d.cts +133 -0
- package/dist/agents/middleware/provider/openai/moderation.d.ts +133 -0
- package/dist/agents/middleware/provider/openai/moderation.js +298 -0
- package/dist/agents/middleware/provider/openai/moderation.js.map +1 -0
- package/dist/agents/middleware/summarization.d.cts +0 -4
- package/dist/agents/middleware/summarization.d.ts +0 -4
- package/dist/agents/middleware/todoListMiddleware.cjs +1 -1
- package/dist/agents/middleware/todoListMiddleware.cjs.map +1 -1
- package/dist/agents/middleware/todoListMiddleware.js +1 -1
- package/dist/agents/middleware/todoListMiddleware.js.map +1 -1
- package/dist/agents/middleware/toolRetry.cjs +32 -44
- package/dist/agents/middleware/toolRetry.cjs.map +1 -1
- package/dist/agents/middleware/toolRetry.d.cts +16 -36
- package/dist/agents/middleware/toolRetry.d.ts +16 -36
- package/dist/agents/middleware/toolRetry.js +32 -44
- package/dist/agents/middleware/toolRetry.js.map +1 -1
- package/dist/agents/middleware/types.d.cts +9 -10
- package/dist/agents/middleware/types.d.ts +9 -10
- package/dist/agents/middleware/utils.cjs +23 -0
- package/dist/agents/middleware/utils.cjs.map +1 -1
- package/dist/agents/middleware/utils.d.ts +2 -0
- package/dist/agents/middleware/utils.js +23 -1
- package/dist/agents/middleware/utils.js.map +1 -1
- package/dist/agents/nodes/AgentNode.cjs +50 -22
- package/dist/agents/nodes/AgentNode.cjs.map +1 -1
- package/dist/agents/nodes/AgentNode.js +52 -24
- package/dist/agents/nodes/AgentNode.js.map +1 -1
- package/dist/agents/nodes/types.d.cts +39 -3
- package/dist/agents/nodes/types.d.ts +39 -3
- package/dist/agents/responses.d.cts +0 -19
- package/dist/agents/responses.d.ts +0 -19
- package/dist/agents/runtime.d.ts +1 -0
- package/dist/agents/tests/utils.cjs +10 -1
- package/dist/agents/tests/utils.cjs.map +1 -1
- package/dist/agents/tests/utils.js +10 -1
- package/dist/agents/tests/utils.js.map +1 -1
- package/dist/agents/types.d.cts +68 -2
- package/dist/agents/types.d.ts +68 -2
- package/dist/agents/utils.cjs +15 -12
- package/dist/agents/utils.cjs.map +1 -1
- package/dist/agents/utils.js +16 -13
- package/dist/agents/utils.js.map +1 -1
- package/dist/chat_models/universal.cjs +50 -16
- package/dist/chat_models/universal.cjs.map +1 -1
- package/dist/chat_models/universal.d.cts +19 -1
- package/dist/chat_models/universal.d.ts +19 -1
- package/dist/chat_models/universal.js +50 -16
- package/dist/chat_models/universal.js.map +1 -1
- package/dist/index.cjs +8 -2
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +7 -3
- package/dist/load/import_constants.cjs +2 -1
- package/dist/load/import_constants.cjs.map +1 -1
- package/dist/load/import_constants.js +2 -1
- package/dist/load/import_constants.js.map +1 -1
- package/dist/load/import_map.cjs +2 -19
- package/dist/load/import_map.cjs.map +1 -1
- package/dist/load/import_map.js +2 -19
- package/dist/load/import_map.js.map +1 -1
- package/hub/node.cjs +1 -0
- package/hub/node.d.cts +1 -0
- package/hub/node.d.ts +1 -0
- package/hub/node.js +1 -0
- package/hub.cjs +1 -0
- package/hub.d.cts +1 -0
- package/hub.d.ts +1 -0
- package/hub.js +1 -0
- package/load/serializable.cjs +1 -0
- package/load/serializable.d.cts +1 -0
- package/load/serializable.d.ts +1 -0
- package/load/serializable.js +1 -0
- package/load.cjs +1 -0
- package/load.d.cts +1 -0
- package/load.d.ts +1 -0
- package/load.js +1 -0
- package/package.json +66 -53
- package/storage/encoder_backed.cjs +1 -0
- package/storage/encoder_backed.d.cts +1 -0
- package/storage/encoder_backed.d.ts +1 -0
- package/storage/encoder_backed.js +1 -0
- package/storage/file_system.cjs +1 -0
- package/storage/file_system.d.cts +1 -0
- package/storage/file_system.d.ts +1 -0
- package/storage/file_system.js +1 -0
- package/storage/in_memory.cjs +1 -0
- package/storage/in_memory.d.cts +1 -0
- package/storage/in_memory.d.ts +1 -0
- package/storage/in_memory.js +1 -0
- package/dist/agents/ReactAgent.d.cts.map +0 -1
- package/dist/agents/ReactAgent.d.ts.map +0 -1
- package/dist/agents/constants.cjs +0 -7
- package/dist/agents/constants.cjs.map +0 -1
- package/dist/agents/constants.d.cts.map +0 -1
- package/dist/agents/constants.d.ts.map +0 -1
- package/dist/agents/constants.js +0 -6
- package/dist/agents/constants.js.map +0 -1
- package/dist/agents/errors.d.cts.map +0 -1
- package/dist/agents/errors.d.ts.map +0 -1
- package/dist/agents/index.d.cts.map +0 -1
- package/dist/agents/index.d.ts.map +0 -1
- package/dist/agents/middleware/contextEditing.d.cts.map +0 -1
- package/dist/agents/middleware/contextEditing.d.ts.map +0 -1
- package/dist/agents/middleware/dynamicSystemPrompt.d.cts.map +0 -1
- package/dist/agents/middleware/dynamicSystemPrompt.d.ts.map +0 -1
- package/dist/agents/middleware/hitl.d.cts.map +0 -1
- package/dist/agents/middleware/hitl.d.ts.map +0 -1
- package/dist/agents/middleware/llmToolSelector.d.cts.map +0 -1
- package/dist/agents/middleware/llmToolSelector.d.ts.map +0 -1
- package/dist/agents/middleware/modelCallLimit.d.cts.map +0 -1
- package/dist/agents/middleware/modelCallLimit.d.ts.map +0 -1
- package/dist/agents/middleware/modelFallback.d.cts.map +0 -1
- package/dist/agents/middleware/modelFallback.d.ts.map +0 -1
- package/dist/agents/middleware/pii.d.cts.map +0 -1
- package/dist/agents/middleware/pii.d.ts.map +0 -1
- package/dist/agents/middleware/piiRedaction.d.cts.map +0 -1
- package/dist/agents/middleware/piiRedaction.d.ts.map +0 -1
- package/dist/agents/middleware/promptCaching.cjs.map +0 -1
- package/dist/agents/middleware/promptCaching.d.cts.map +0 -1
- package/dist/agents/middleware/promptCaching.d.ts.map +0 -1
- package/dist/agents/middleware/promptCaching.js.map +0 -1
- package/dist/agents/middleware/summarization.d.cts.map +0 -1
- package/dist/agents/middleware/summarization.d.ts.map +0 -1
- package/dist/agents/middleware/todoListMiddleware.d.cts.map +0 -1
- package/dist/agents/middleware/todoListMiddleware.d.ts.map +0 -1
- package/dist/agents/middleware/toolCallLimit.d.cts.map +0 -1
- package/dist/agents/middleware/toolCallLimit.d.ts.map +0 -1
- package/dist/agents/middleware/toolEmulator.d.cts.map +0 -1
- package/dist/agents/middleware/toolEmulator.d.ts.map +0 -1
- package/dist/agents/middleware/toolRetry.d.cts.map +0 -1
- package/dist/agents/middleware/toolRetry.d.ts.map +0 -1
- package/dist/agents/middleware/types.d.cts.map +0 -1
- package/dist/agents/middleware/types.d.ts.map +0 -1
- package/dist/agents/middleware/utils.d.cts.map +0 -1
- package/dist/agents/middleware/utils.d.ts.map +0 -1
- package/dist/agents/middleware.d.cts.map +0 -1
- package/dist/agents/middleware.d.ts.map +0 -1
- package/dist/agents/nodes/types.d.cts.map +0 -1
- package/dist/agents/nodes/types.d.ts.map +0 -1
- package/dist/agents/responses.d.cts.map +0 -1
- package/dist/agents/responses.d.ts.map +0 -1
- package/dist/agents/runtime.d.cts.map +0 -1
- package/dist/agents/runtime.d.ts.map +0 -1
- package/dist/agents/tests/utils.d.cts.map +0 -1
- package/dist/agents/tests/utils.d.ts.map +0 -1
- package/dist/agents/types.d.cts.map +0 -1
- package/dist/agents/types.d.ts.map +0 -1
- package/dist/chat_models/universal.d.cts.map +0 -1
- package/dist/chat_models/universal.d.ts.map +0 -1
- package/dist/hub/base.d.cts.map +0 -1
- package/dist/hub/base.d.ts.map +0 -1
- package/dist/hub/index.d.cts.map +0 -1
- package/dist/hub/index.d.ts.map +0 -1
- package/dist/hub/node.d.cts.map +0 -1
- package/dist/hub/node.d.ts.map +0 -1
- package/dist/load/import_type.d.cts.map +0 -1
- package/dist/load/import_type.d.ts.map +0 -1
- package/dist/load/index.d.cts.map +0 -1
- package/dist/load/index.d.ts.map +0 -1
- package/dist/storage/encoder_backed.d.cts.map +0 -1
- package/dist/storage/encoder_backed.d.ts.map +0 -1
- package/dist/storage/file_system.d.cts.map +0 -1
- package/dist/storage/file_system.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import_map.cjs","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"import_map.cjs","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["/** Auto-generated by import-map plugin. Do not edit manually */\n\nexport * as storage__file_system from \"../storage/file_system.js\";\nexport * as storage__encoder_backed from \"../storage/encoder_backed.js\";\nexport * as storage__in_memory from \"../storage/in_memory.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as chat_models__universal from \"../chat_models/universal.js\";\nexport * as index from \"../index.js\";\nimport {\n PromptTemplate,\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n ImagePromptTemplate,\n PipelinePromptTemplate,\n} from \"@langchain/core/prompts\";\nimport {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n} from \"@langchain/core/messages\";\nimport { StringPromptValue } from \"@langchain/core/prompt_values\";\nimport {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n} from \"@langchain/core/runnables\";\nimport { ChatGenerationChunk, GenerationChunk } from \"@langchain/core/outputs\";\nconst prompts__prompt = {\n PromptTemplate,\n};\nexport { prompts__prompt };\nconst schema = {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n};\nexport { schema };\nconst prompts__chat = {\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n};\nexport { prompts__chat };\nconst prompts__image = {\n ImagePromptTemplate,\n};\nexport { prompts__image };\nconst prompts__pipeline = {\n PipelinePromptTemplate,\n};\nexport { prompts__pipeline };\nconst prompts__base = {\n StringPromptValue,\n};\nexport { prompts__base };\nconst schema__runnable = {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n};\nexport { schema__runnable };\nconst schema__output = {\n ChatGenerationChunk,\n GenerationChunk,\n};\nexport { schema__output };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,kBAAkB,EACtB,wDACD;AAED,MAAM,SAAS;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,iBAAiB,EACrB,kEACD;AAED,MAAM,oBAAoB,EACxB,wEACD;AAED,MAAM,gBAAgB,EACpB,oEACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,iBAAiB;CACrB;CACA;AACD"}
|
package/dist/load/import_map.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __export } from "../_virtual/rolldown_runtime.js";
|
|
2
2
|
import { universal_exports } from "../chat_models/universal.js";
|
|
3
3
|
import { src_exports } from "../index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { file_system_exports } from "../storage/file_system.js";
|
|
5
5
|
import { encoder_backed_exports } from "../storage/encoder_backed.js";
|
|
6
6
|
import { in_memory_exports } from "../storage/in_memory.js";
|
|
7
|
-
import {
|
|
7
|
+
import { serializable_exports } from "./serializable.js";
|
|
8
8
|
import { AIMessage, AIMessageChunk, BaseMessage, BaseMessageChunk, ChatMessage, ChatMessageChunk, FunctionMessage, FunctionMessageChunk, HumanMessage, HumanMessageChunk, SystemMessage, SystemMessageChunk, ToolMessage, ToolMessageChunk } from "@langchain/core/messages";
|
|
9
9
|
import { RouterRunnable, RunnableAssign, RunnableBinding, RunnableBranch, RunnableEach, RunnableMap, RunnableParallel, RunnablePassthrough, RunnablePick, RunnableRetry, RunnableSequence, RunnableWithFallbacks, RunnableWithMessageHistory } from "@langchain/core/runnables";
|
|
10
10
|
import { AIMessagePromptTemplate, ChatMessagePromptTemplate, ChatPromptTemplate, HumanMessagePromptTemplate, ImagePromptTemplate, MessagesPlaceholder, PipelinePromptTemplate, PromptTemplate, SystemMessagePromptTemplate } from "@langchain/core/prompts";
|
|
@@ -23,7 +23,6 @@ __export(import_map_exports, {
|
|
|
23
23
|
prompts__pipeline: () => prompts__pipeline,
|
|
24
24
|
prompts__prompt: () => prompts__prompt,
|
|
25
25
|
schema: () => schema,
|
|
26
|
-
schema__messages: () => schema__messages,
|
|
27
26
|
schema__output: () => schema__output,
|
|
28
27
|
schema__runnable: () => schema__runnable,
|
|
29
28
|
storage__encoder_backed: () => encoder_backed_exports,
|
|
@@ -31,22 +30,6 @@ __export(import_map_exports, {
|
|
|
31
30
|
storage__in_memory: () => in_memory_exports
|
|
32
31
|
});
|
|
33
32
|
const prompts__prompt = { PromptTemplate };
|
|
34
|
-
const schema__messages = {
|
|
35
|
-
AIMessage,
|
|
36
|
-
AIMessageChunk,
|
|
37
|
-
BaseMessage,
|
|
38
|
-
BaseMessageChunk,
|
|
39
|
-
ChatMessage,
|
|
40
|
-
ChatMessageChunk,
|
|
41
|
-
FunctionMessage,
|
|
42
|
-
FunctionMessageChunk,
|
|
43
|
-
HumanMessage,
|
|
44
|
-
HumanMessageChunk,
|
|
45
|
-
SystemMessage,
|
|
46
|
-
SystemMessageChunk,
|
|
47
|
-
ToolMessage,
|
|
48
|
-
ToolMessageChunk
|
|
49
|
-
};
|
|
50
33
|
const schema = {
|
|
51
34
|
AIMessage,
|
|
52
35
|
AIMessageChunk,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import_map.js","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"import_map.js","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["/** Auto-generated by import-map plugin. Do not edit manually */\n\nexport * as storage__file_system from \"../storage/file_system.js\";\nexport * as storage__encoder_backed from \"../storage/encoder_backed.js\";\nexport * as storage__in_memory from \"../storage/in_memory.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as chat_models__universal from \"../chat_models/universal.js\";\nexport * as index from \"../index.js\";\nimport {\n PromptTemplate,\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n ImagePromptTemplate,\n PipelinePromptTemplate,\n} from \"@langchain/core/prompts\";\nimport {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n} from \"@langchain/core/messages\";\nimport { StringPromptValue } from \"@langchain/core/prompt_values\";\nimport {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n} from \"@langchain/core/runnables\";\nimport { ChatGenerationChunk, GenerationChunk } from \"@langchain/core/outputs\";\nconst prompts__prompt = {\n PromptTemplate,\n};\nexport { prompts__prompt };\nconst schema = {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n};\nexport { schema };\nconst prompts__chat = {\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n};\nexport { prompts__chat };\nconst prompts__image = {\n ImagePromptTemplate,\n};\nexport { prompts__image };\nconst prompts__pipeline = {\n PipelinePromptTemplate,\n};\nexport { prompts__pipeline };\nconst prompts__base = {\n StringPromptValue,\n};\nexport { prompts__base };\nconst schema__runnable = {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n};\nexport { schema__runnable };\nconst schema__output = {\n ChatGenerationChunk,\n GenerationChunk,\n};\nexport { schema__output };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,kBAAkB,EACtB,eACD;AAED,MAAM,SAAS;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,iBAAiB,EACrB,oBACD;AAED,MAAM,oBAAoB,EACxB,uBACD;AAED,MAAM,gBAAgB,EACpB,kBACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,iBAAiB;CACrB;CACA;AACD"}
|
package/hub/node.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../dist/hub/node.cjs");
|
package/hub/node.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/hub/node.js";
|
package/hub/node.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/hub/node.js";
|
package/hub/node.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/hub/node.js";
|
package/hub.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("./dist/hub/index.cjs");
|
package/hub.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/hub/index.js";
|
package/hub.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/hub/index.js";
|
package/hub.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/hub/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../dist/load/serializable.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/load/serializable.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/load/serializable.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/load/serializable.js";
|
package/load.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("./dist/load/index.cjs");
|
package/load.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/load/index.js";
|
package/load.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/load/index.js";
|
package/load.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/load/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langchain",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Typescript bindings for langchain",
|
|
5
5
|
"author": "LangChain",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,7 +12,19 @@
|
|
|
12
12
|
"dist/",
|
|
13
13
|
"CHANGELOG.md",
|
|
14
14
|
"README.md",
|
|
15
|
-
"LICENSE"
|
|
15
|
+
"LICENSE",
|
|
16
|
+
"storage",
|
|
17
|
+
"load",
|
|
18
|
+
"load.d.cts",
|
|
19
|
+
"load.cjs",
|
|
20
|
+
"load.d.ts",
|
|
21
|
+
"load.js",
|
|
22
|
+
"hub",
|
|
23
|
+
"chat_models",
|
|
24
|
+
"hub.d.cts",
|
|
25
|
+
"hub.cjs",
|
|
26
|
+
"hub.d.ts",
|
|
27
|
+
"hub.js"
|
|
16
28
|
],
|
|
17
29
|
"repository": {
|
|
18
30
|
"type": "git",
|
|
@@ -40,14 +52,14 @@
|
|
|
40
52
|
"typescript": "~5.8.3",
|
|
41
53
|
"vitest": "^3.2.4",
|
|
42
54
|
"yaml": "^2.8.1",
|
|
43
|
-
"@langchain/anthropic": "1.1.
|
|
44
|
-
"@langchain/cohere": "1.0.
|
|
45
|
-
"@langchain/core": "1.0
|
|
46
|
-
"@langchain/eslint": "0.1.
|
|
47
|
-
"@langchain/openai": "1.1.
|
|
55
|
+
"@langchain/anthropic": "1.1.3",
|
|
56
|
+
"@langchain/cohere": "1.0.1",
|
|
57
|
+
"@langchain/core": "1.1.0",
|
|
58
|
+
"@langchain/eslint": "0.1.1",
|
|
59
|
+
"@langchain/openai": "1.1.3"
|
|
48
60
|
},
|
|
49
61
|
"peerDependencies": {
|
|
50
|
-
"@langchain/core": "
|
|
62
|
+
"@langchain/core": "1.1.0"
|
|
51
63
|
},
|
|
52
64
|
"dependencies": {
|
|
53
65
|
"@langchain/langgraph": "^1.0.0",
|
|
@@ -73,113 +85,114 @@
|
|
|
73
85
|
"embeddings",
|
|
74
86
|
"vectorstores"
|
|
75
87
|
],
|
|
76
|
-
"main": "./dist/index.
|
|
77
|
-
"types": "./dist/index.d.
|
|
88
|
+
"main": "./dist/index.cjs",
|
|
89
|
+
"types": "./dist/index.d.cts",
|
|
78
90
|
"exports": {
|
|
79
91
|
".": {
|
|
80
92
|
"input": "./src/index.ts",
|
|
81
|
-
"import": {
|
|
82
|
-
"types": "./dist/index.d.ts",
|
|
83
|
-
"default": "./dist/index.js"
|
|
84
|
-
},
|
|
85
93
|
"require": {
|
|
86
94
|
"types": "./dist/index.d.cts",
|
|
87
95
|
"default": "./dist/index.cjs"
|
|
96
|
+
},
|
|
97
|
+
"import": {
|
|
98
|
+
"types": "./dist/index.d.ts",
|
|
99
|
+
"default": "./dist/index.js"
|
|
88
100
|
}
|
|
89
101
|
},
|
|
90
102
|
"./chat_models/universal": {
|
|
91
103
|
"input": "./src/chat_models/universal.ts",
|
|
92
|
-
"import": {
|
|
93
|
-
"types": "./dist/chat_models/universal.d.ts",
|
|
94
|
-
"default": "./dist/chat_models/universal.js"
|
|
95
|
-
},
|
|
96
104
|
"require": {
|
|
97
105
|
"types": "./dist/chat_models/universal.d.cts",
|
|
98
106
|
"default": "./dist/chat_models/universal.cjs"
|
|
107
|
+
},
|
|
108
|
+
"import": {
|
|
109
|
+
"types": "./dist/chat_models/universal.d.ts",
|
|
110
|
+
"default": "./dist/chat_models/universal.js"
|
|
99
111
|
}
|
|
100
112
|
},
|
|
101
113
|
"./hub": {
|
|
102
114
|
"input": "./src/hub/index.ts",
|
|
103
|
-
"import": {
|
|
104
|
-
"types": "./dist/hub/index.d.ts",
|
|
105
|
-
"default": "./dist/hub/index.js"
|
|
106
|
-
},
|
|
107
115
|
"require": {
|
|
108
116
|
"types": "./dist/hub/index.d.cts",
|
|
109
117
|
"default": "./dist/hub/index.cjs"
|
|
118
|
+
},
|
|
119
|
+
"import": {
|
|
120
|
+
"types": "./dist/hub/index.d.ts",
|
|
121
|
+
"default": "./dist/hub/index.js"
|
|
110
122
|
}
|
|
111
123
|
},
|
|
112
124
|
"./hub/node": {
|
|
113
125
|
"input": "./src/hub/node.ts",
|
|
114
|
-
"import": {
|
|
115
|
-
"types": "./dist/hub/node.d.ts",
|
|
116
|
-
"default": "./dist/hub/node.js"
|
|
117
|
-
},
|
|
118
126
|
"require": {
|
|
119
127
|
"types": "./dist/hub/node.d.cts",
|
|
120
128
|
"default": "./dist/hub/node.cjs"
|
|
129
|
+
},
|
|
130
|
+
"import": {
|
|
131
|
+
"types": "./dist/hub/node.d.ts",
|
|
132
|
+
"default": "./dist/hub/node.js"
|
|
121
133
|
}
|
|
122
134
|
},
|
|
123
135
|
"./load": {
|
|
124
136
|
"input": "./src/load/index.ts",
|
|
125
|
-
"import": {
|
|
126
|
-
"types": "./dist/load/index.d.ts",
|
|
127
|
-
"default": "./dist/load/index.js"
|
|
128
|
-
},
|
|
129
137
|
"require": {
|
|
130
138
|
"types": "./dist/load/index.d.cts",
|
|
131
139
|
"default": "./dist/load/index.cjs"
|
|
140
|
+
},
|
|
141
|
+
"import": {
|
|
142
|
+
"types": "./dist/load/index.d.ts",
|
|
143
|
+
"default": "./dist/load/index.js"
|
|
132
144
|
}
|
|
133
145
|
},
|
|
134
146
|
"./load/serializable": {
|
|
135
147
|
"input": "./src/load/serializable.ts",
|
|
136
|
-
"import": {
|
|
137
|
-
"types": "./dist/load/serializable.d.ts",
|
|
138
|
-
"default": "./dist/load/serializable.js"
|
|
139
|
-
},
|
|
140
148
|
"require": {
|
|
141
149
|
"types": "./dist/load/serializable.d.cts",
|
|
142
150
|
"default": "./dist/load/serializable.cjs"
|
|
151
|
+
},
|
|
152
|
+
"import": {
|
|
153
|
+
"types": "./dist/load/serializable.d.ts",
|
|
154
|
+
"default": "./dist/load/serializable.js"
|
|
143
155
|
}
|
|
144
156
|
},
|
|
145
157
|
"./storage/encoder_backed": {
|
|
146
158
|
"input": "./src/storage/encoder_backed.ts",
|
|
147
|
-
"import": {
|
|
148
|
-
"types": "./dist/storage/encoder_backed.d.ts",
|
|
149
|
-
"default": "./dist/storage/encoder_backed.js"
|
|
150
|
-
},
|
|
151
159
|
"require": {
|
|
152
160
|
"types": "./dist/storage/encoder_backed.d.cts",
|
|
153
161
|
"default": "./dist/storage/encoder_backed.cjs"
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
"./storage/in_memory": {
|
|
157
|
-
"input": "./src/storage/in_memory.ts",
|
|
158
|
-
"import": {
|
|
159
|
-
"types": "./dist/storage/in_memory.d.ts",
|
|
160
|
-
"default": "./dist/storage/in_memory.js"
|
|
161
162
|
},
|
|
162
|
-
"
|
|
163
|
-
"types": "./dist/storage/
|
|
164
|
-
"default": "./dist/storage/
|
|
163
|
+
"import": {
|
|
164
|
+
"types": "./dist/storage/encoder_backed.d.ts",
|
|
165
|
+
"default": "./dist/storage/encoder_backed.js"
|
|
165
166
|
}
|
|
166
167
|
},
|
|
167
168
|
"./storage/file_system": {
|
|
168
169
|
"input": "./src/storage/file_system.ts",
|
|
170
|
+
"require": {
|
|
171
|
+
"types": "./dist/storage/file_system.d.cts",
|
|
172
|
+
"default": "./dist/storage/file_system.cjs"
|
|
173
|
+
},
|
|
169
174
|
"import": {
|
|
170
175
|
"types": "./dist/storage/file_system.d.ts",
|
|
171
176
|
"default": "./dist/storage/file_system.js"
|
|
172
|
-
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"./storage/in_memory": {
|
|
180
|
+
"input": "./src/storage/in_memory.ts",
|
|
173
181
|
"require": {
|
|
174
|
-
"types": "./dist/storage/
|
|
175
|
-
"default": "./dist/storage/
|
|
182
|
+
"types": "./dist/storage/in_memory.d.cts",
|
|
183
|
+
"default": "./dist/storage/in_memory.cjs"
|
|
184
|
+
},
|
|
185
|
+
"import": {
|
|
186
|
+
"types": "./dist/storage/in_memory.d.ts",
|
|
187
|
+
"default": "./dist/storage/in_memory.js"
|
|
176
188
|
}
|
|
177
189
|
},
|
|
178
190
|
"./package.json": "./package.json"
|
|
179
191
|
},
|
|
192
|
+
"module": "./dist/index.js",
|
|
180
193
|
"scripts": {
|
|
181
|
-
"build": "turbo build:compile --filter langchain",
|
|
182
|
-
"build:compile": "
|
|
194
|
+
"build": "turbo build:compile --filter langchain --output-logs new-only",
|
|
195
|
+
"build:compile": "tsdown",
|
|
183
196
|
"lint:eslint": "eslint --cache src/",
|
|
184
197
|
"lint:dpdm": "dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
|
|
185
198
|
"lint": "pnpm lint:eslint && pnpm lint:dpdm",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../dist/storage/encoder_backed.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/storage/encoder_backed.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/storage/encoder_backed.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/storage/encoder_backed.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../dist/storage/file_system.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/storage/file_system.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/storage/file_system.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/storage/file_system.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../dist/storage/in_memory.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/storage/in_memory.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/storage/in_memory.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/storage/in_memory.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReactAgent.d.cts","names":["InteropZodObject","Command","CompiledStateGraph","GetStateOptions","LangGraphRunnableConfig","StreamMode","StreamOutputMap","CheckpointListOptions","IterableReadableStream","Runnable","RunnableConfig","StreamEvent","CreateAgentParams","BuiltInState","UserInput","InvokeConfiguration","StreamConfiguration","AgentMiddleware","InferMiddlewareContextInputs","InferMiddlewareStates","InferMiddlewareInputStates","InferContextInput","AnyAnnotationRoot","InferSchemaInput","ToAnnotationRoot","ResponseFormatUndefined","MergedAgentState","Record","StateSchema","StructuredResponseFormat","Omit","TMiddleware","InvokeStateParameter","AgentGraph","ContextSchema","ReactAgent","Promise","TStreamMode","TEncoding","ArrayBuffer","Uint8Array","Parameters"],"sources":["../../src/agents/ReactAgent.d.ts"],"sourcesContent":["/* eslint-disable no-instanceof/no-instanceof */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { InteropZodObject } from \"@langchain/core/utils/types\";\nimport { Command, CompiledStateGraph, type GetStateOptions, type LangGraphRunnableConfig, type StreamMode, type StreamOutputMap } from \"@langchain/langgraph\";\nimport type { CheckpointListOptions } from \"@langchain/langgraph-checkpoint\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport type { Runnable, RunnableConfig } from \"@langchain/core/runnables\";\nimport type { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport type { CreateAgentParams, BuiltInState, UserInput } from \"./types.js\";\nimport type { InvokeConfiguration, StreamConfiguration } from \"./runtime.js\";\nimport type { AgentMiddleware, InferMiddlewareContextInputs, InferMiddlewareStates, InferMiddlewareInputStates, InferContextInput, AnyAnnotationRoot, InferSchemaInput, ToAnnotationRoot } from \"./middleware/types.js\";\nimport { type ResponseFormatUndefined } from \"./responses.js\";\n// Helper type to get the state definition with middleware states\ntype MergedAgentState<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined, StructuredResponseFormat extends Record<string, any> | ResponseFormatUndefined, TMiddleware extends readonly AgentMiddleware[]> = InferSchemaInput<StateSchema> & (StructuredResponseFormat extends ResponseFormatUndefined ? Omit<BuiltInState, \"jumpTo\"> : Omit<BuiltInState, \"jumpTo\"> & {\n structuredResponse: StructuredResponseFormat;\n}) & InferMiddlewareStates<TMiddleware>;\ntype InvokeStateParameter<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined, TMiddleware extends readonly AgentMiddleware[]> = (UserInput<StateSchema> & InferMiddlewareInputStates<TMiddleware>) | Command<any, any, any> | null;\ntype AgentGraph<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, StructuredResponseFormat extends Record<string, any> | ResponseFormatUndefined = Record<string, any>, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, TMiddleware extends readonly AgentMiddleware[] = []> = CompiledStateGraph<any, any, any, any, MergedAgentState<StateSchema, StructuredResponseFormat, TMiddleware>, ToAnnotationRoot<ContextSchema>[\"spec\"], unknown>;\nexport declare class ReactAgent<StructuredResponseFormat extends Record<string, any> | ResponseFormatUndefined = Record<string, any>, StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]> {\n #private;\n options: CreateAgentParams<StructuredResponseFormat, StateSchema, ContextSchema>;\n constructor(options: CreateAgentParams<StructuredResponseFormat, StateSchema, ContextSchema>);\n /**\n * Get the compiled {@link https://docs.langchain.com/oss/javascript/langgraph/use-graph-api | StateGraph}.\n */\n get graph(): AgentGraph<StateSchema, StructuredResponseFormat, ContextSchema, TMiddleware>;\n /**\n * Executes the agent with the given state and returns the final state after all processing.\n *\n * This method runs the agent's entire workflow synchronously, including:\n * - Processing the input messages through any configured middleware\n * - Calling the language model to generate responses\n * - Executing any tool calls made by the model\n * - Running all middleware hooks (beforeModel, afterModel, etc.)\n *\n * @param state - The initial state for the agent execution. Can be:\n * - An object containing `messages` array and any middleware-specific state properties\n * - A Command object for more advanced control flow\n *\n * @param config - Optional runtime configuration including:\n * @param config.context - The context for the agent execution.\n * @param config.configurable - LangGraph configuration options like `thread_id`, `run_id`, etc.\n * @param config.store - The store for the agent execution for persisting state, see more in {@link https://docs.langchain.com/oss/javascript/langgraph/memory#memory-storage | Memory storage}.\n * @param config.signal - An optional {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | `AbortSignal`} for the agent execution.\n * @param config.recursionLimit - The recursion limit for the agent execution.\n *\n * @returns A Promise that resolves to the final agent state after execution completes.\n * The returned state includes:\n * - a `messages` property containing an array with all messages (input, AI responses, tool calls/results)\n * - a `structuredResponse` property containing the structured response (if configured)\n * - all state values defined in the middleware\n *\n * @example\n * ```typescript\n * const agent = new ReactAgent({\n * llm: myModel,\n * tools: [calculator, webSearch],\n * responseFormat: z.object({\n * weather: z.string(),\n * }),\n * });\n *\n * const result = await agent.invoke({\n * messages: [{ role: \"human\", content: \"What's the weather in Paris?\" }]\n * });\n *\n * console.log(result.structuredResponse.weather); // outputs: \"It's sunny and 75°F.\"\n * ```\n */\n invoke(state: InvokeStateParameter<StateSchema, TMiddleware>, config?: InvokeConfiguration<InferContextInput<ContextSchema> & InferMiddlewareContextInputs<TMiddleware>>): Promise<MergedAgentState<StateSchema, StructuredResponseFormat, TMiddleware>>;\n /**\n * Executes the agent with streaming, returning an async iterable of state updates as they occur.\n *\n * This method runs the agent's workflow similar to `invoke`, but instead of waiting for\n * completion, it streams high-level state updates in real-time. This allows you to:\n * - Display intermediate results to users as they're generated\n * - Monitor the agent's progress through each step\n * - React to state changes as nodes complete\n *\n * For more granular event-level streaming (like individual LLM tokens), use `streamEvents` instead.\n *\n * @param state - The initial state for the agent execution. Can be:\n * - An object containing `messages` array and any middleware-specific state properties\n * - A Command object for more advanced control flow\n *\n * @param config - Optional runtime configuration including:\n * @param config.context - The context for the agent execution.\n * @param config.configurable - LangGraph configuration options like `thread_id`, `run_id`, etc.\n * @param config.store - The store for the agent execution for persisting state, see more in {@link https://docs.langchain.com/oss/javascript/langgraph/memory#memory-storage | Memory storage}.\n * @param config.signal - An optional {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | `AbortSignal`} for the agent execution.\n * @param config.streamMode - The streaming mode for the agent execution, see more in {@link https://docs.langchain.com/oss/javascript/langgraph/streaming#supported-stream-modes | Supported stream modes}.\n * @param config.recursionLimit - The recursion limit for the agent execution.\n *\n * @returns A Promise that resolves to an IterableReadableStream of state updates.\n * Each update contains the current state after a node completes.\n *\n * @example\n * ```typescript\n * const agent = new ReactAgent({\n * llm: myModel,\n * tools: [calculator, webSearch]\n * });\n *\n * const stream = await agent.stream({\n * messages: [{ role: \"human\", content: \"What's 2+2 and the weather in NYC?\" }]\n * });\n *\n * for await (const chunk of stream) {\n * console.log(chunk); // State update from each node\n * }\n * ```\n */\n stream<TStreamMode extends StreamMode | StreamMode[] | undefined, TEncoding extends \"text/event-stream\" | undefined>(state: InvokeStateParameter<StateSchema, TMiddleware>, config?: StreamConfiguration<InferContextInput<ContextSchema> & InferMiddlewareContextInputs<TMiddleware>, TStreamMode, TEncoding>): Promise<IterableReadableStream<StreamOutputMap<TStreamMode, false, MergedAgentState<StateSchema, StructuredResponseFormat, TMiddleware>, MergedAgentState<StateSchema, StructuredResponseFormat, TMiddleware>, string, unknown, unknown, TEncoding>>>;\n /**\n * Visualize the graph as a PNG image.\n * @param params - Parameters for the drawMermaidPng method.\n * @param params.withStyles - Whether to include styles in the graph.\n * @param params.curveStyle - The style of the graph's curves.\n * @param params.nodeColors - The colors of the graph's nodes.\n * @param params.wrapLabelNWords - The maximum number of words to wrap in a node's label.\n * @param params.backgroundColor - The background color of the graph.\n * @returns PNG image as a buffer\n */\n drawMermaidPng(params?: {\n withStyles?: boolean;\n curveStyle?: string;\n nodeColors?: Record<string, string>;\n wrapLabelNWords?: number;\n backgroundColor?: string;\n }): Promise<Uint8Array<ArrayBuffer>>;\n /**\n * Draw the graph as a Mermaid string.\n * @param params - Parameters for the drawMermaid method.\n * @param params.withStyles - Whether to include styles in the graph.\n * @param params.curveStyle - The style of the graph's curves.\n * @param params.nodeColors - The colors of the graph's nodes.\n * @param params.wrapLabelNWords - The maximum number of words to wrap in a node's label.\n * @param params.backgroundColor - The background color of the graph.\n * @returns Mermaid string\n */\n drawMermaid(params?: {\n withStyles?: boolean;\n curveStyle?: string;\n nodeColors?: Record<string, string>;\n wrapLabelNWords?: number;\n backgroundColor?: string;\n }): Promise<string>;\n /**\n * The following are internal methods to enable support for LangGraph Platform.\n * They are not part of the createAgent public API.\n *\n * Note: we intentionally return as `never` to avoid type errors due to type inference.\n */\n /**\n * @internal\n */\n streamEvents(state: InvokeStateParameter<StateSchema, TMiddleware>, config?: StreamConfiguration<InferContextInput<ContextSchema> & InferMiddlewareContextInputs<TMiddleware>, StreamMode | StreamMode[] | undefined, \"text/event-stream\" | undefined> & {\n version?: \"v1\" | \"v2\";\n }, streamOptions?: Parameters<Runnable[\"streamEvents\"]>[2]): IterableReadableStream<StreamEvent>;\n /**\n * @internal\n */\n getGraphAsync(config?: RunnableConfig): never;\n /**\n * @internal\n */\n getState(config: RunnableConfig, options?: GetStateOptions): never;\n /**\n * @internal\n */\n getStateHistory(config: RunnableConfig, options?: CheckpointListOptions): never;\n /**\n * @internal\n */\n getSubgraphs(namespace?: string, recurse?: boolean): never;\n /**\n * @internal\n */\n getSubgraphAsync(namespace?: string, recurse?: boolean): never;\n /**\n * @internal\n */\n updateState(inputConfig: LangGraphRunnableConfig, values: Record<string, unknown> | unknown, asNode?: string): never;\n}\nexport {};\n"],"mappings":";;;;;;;;;;;;;A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BnBH,CAAAA,CAAAA;EAAO;;;;;;;;;;EAUqF,WAElE3B,CAAAA,MAQC,CARDA,EAAAA;IAAXgC,UAAAA,CAAAA,EAAAA,OAAAA;IAAiE9B,UAAAA,CAAAA,EAAAA,MAAAA;IAAvBH,UAAAA,CAAAA,EAf5CmB,MAe4CnB,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;IAItCE,eAAAA,CAAAA,EAAAA,MAAAA;IAINA,eAAAA,CAAAA,EAAAA,MAAAA;EAAc,CAAA,CAAA,EApB3B0B,OAoBuCjC,CAAAA,MAAAA,CAAAA;EAAe;;;;AAgBM;;;;;sBA1B5C6B,qBAAqBJ,aAAaG,uBAAuBf,oBAAoBK,kBAAkBa,iBAAiBhB,6BAA6Ba,cAAc1B,aAAaA;;qBAEzKoC,WAAWhC,+BAA+BD,uBAAuBG;;;;yBAI7DD;;;;mBAINA,0BAA0BP;;;;0BAInBO,0BAA0BH;;;;;;;;;;;;2BAYzBH,iCAAiCuB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReactAgent.d.ts","names":["InteropZodObject","Command","CompiledStateGraph","GetStateOptions","LangGraphRunnableConfig","StreamMode","StreamOutputMap","CheckpointListOptions","IterableReadableStream","Runnable","RunnableConfig","StreamEvent","CreateAgentParams","BuiltInState","UserInput","InvokeConfiguration","StreamConfiguration","AgentMiddleware","InferMiddlewareContextInputs","InferMiddlewareStates","InferMiddlewareInputStates","InferContextInput","AnyAnnotationRoot","InferSchemaInput","ToAnnotationRoot","ResponseFormatUndefined","MergedAgentState","Record","StateSchema","StructuredResponseFormat","Omit","TMiddleware","InvokeStateParameter","AgentGraph","ContextSchema","ReactAgent","Promise","TStreamMode","TEncoding","ArrayBuffer","Uint8Array","Parameters"],"sources":["../../src/agents/ReactAgent.d.ts"],"sourcesContent":["/* eslint-disable no-instanceof/no-instanceof */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { InteropZodObject } from \"@langchain/core/utils/types\";\nimport { Command, CompiledStateGraph, type GetStateOptions, type LangGraphRunnableConfig, type StreamMode, type StreamOutputMap } from \"@langchain/langgraph\";\nimport type { CheckpointListOptions } from \"@langchain/langgraph-checkpoint\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport type { Runnable, RunnableConfig } from \"@langchain/core/runnables\";\nimport type { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport type { CreateAgentParams, BuiltInState, UserInput } from \"./types.js\";\nimport type { InvokeConfiguration, StreamConfiguration } from \"./runtime.js\";\nimport type { AgentMiddleware, InferMiddlewareContextInputs, InferMiddlewareStates, InferMiddlewareInputStates, InferContextInput, AnyAnnotationRoot, InferSchemaInput, ToAnnotationRoot } from \"./middleware/types.js\";\nimport { type ResponseFormatUndefined } from \"./responses.js\";\n// Helper type to get the state definition with middleware states\ntype MergedAgentState<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined, StructuredResponseFormat extends Record<string, any> | ResponseFormatUndefined, TMiddleware extends readonly AgentMiddleware[]> = InferSchemaInput<StateSchema> & (StructuredResponseFormat extends ResponseFormatUndefined ? Omit<BuiltInState, \"jumpTo\"> : Omit<BuiltInState, \"jumpTo\"> & {\n structuredResponse: StructuredResponseFormat;\n}) & InferMiddlewareStates<TMiddleware>;\ntype InvokeStateParameter<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined, TMiddleware extends readonly AgentMiddleware[]> = (UserInput<StateSchema> & InferMiddlewareInputStates<TMiddleware>) | Command<any, any, any> | null;\ntype AgentGraph<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, StructuredResponseFormat extends Record<string, any> | ResponseFormatUndefined = Record<string, any>, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, TMiddleware extends readonly AgentMiddleware[] = []> = CompiledStateGraph<any, any, any, any, MergedAgentState<StateSchema, StructuredResponseFormat, TMiddleware>, ToAnnotationRoot<ContextSchema>[\"spec\"], unknown>;\nexport declare class ReactAgent<StructuredResponseFormat extends Record<string, any> | ResponseFormatUndefined = Record<string, any>, StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]> {\n #private;\n options: CreateAgentParams<StructuredResponseFormat, StateSchema, ContextSchema>;\n constructor(options: CreateAgentParams<StructuredResponseFormat, StateSchema, ContextSchema>);\n /**\n * Get the compiled {@link https://docs.langchain.com/oss/javascript/langgraph/use-graph-api | StateGraph}.\n */\n get graph(): AgentGraph<StateSchema, StructuredResponseFormat, ContextSchema, TMiddleware>;\n /**\n * Executes the agent with the given state and returns the final state after all processing.\n *\n * This method runs the agent's entire workflow synchronously, including:\n * - Processing the input messages through any configured middleware\n * - Calling the language model to generate responses\n * - Executing any tool calls made by the model\n * - Running all middleware hooks (beforeModel, afterModel, etc.)\n *\n * @param state - The initial state for the agent execution. Can be:\n * - An object containing `messages` array and any middleware-specific state properties\n * - A Command object for more advanced control flow\n *\n * @param config - Optional runtime configuration including:\n * @param config.context - The context for the agent execution.\n * @param config.configurable - LangGraph configuration options like `thread_id`, `run_id`, etc.\n * @param config.store - The store for the agent execution for persisting state, see more in {@link https://docs.langchain.com/oss/javascript/langgraph/memory#memory-storage | Memory storage}.\n * @param config.signal - An optional {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | `AbortSignal`} for the agent execution.\n * @param config.recursionLimit - The recursion limit for the agent execution.\n *\n * @returns A Promise that resolves to the final agent state after execution completes.\n * The returned state includes:\n * - a `messages` property containing an array with all messages (input, AI responses, tool calls/results)\n * - a `structuredResponse` property containing the structured response (if configured)\n * - all state values defined in the middleware\n *\n * @example\n * ```typescript\n * const agent = new ReactAgent({\n * llm: myModel,\n * tools: [calculator, webSearch],\n * responseFormat: z.object({\n * weather: z.string(),\n * }),\n * });\n *\n * const result = await agent.invoke({\n * messages: [{ role: \"human\", content: \"What's the weather in Paris?\" }]\n * });\n *\n * console.log(result.structuredResponse.weather); // outputs: \"It's sunny and 75°F.\"\n * ```\n */\n invoke(state: InvokeStateParameter<StateSchema, TMiddleware>, config?: InvokeConfiguration<InferContextInput<ContextSchema> & InferMiddlewareContextInputs<TMiddleware>>): Promise<MergedAgentState<StateSchema, StructuredResponseFormat, TMiddleware>>;\n /**\n * Executes the agent with streaming, returning an async iterable of state updates as they occur.\n *\n * This method runs the agent's workflow similar to `invoke`, but instead of waiting for\n * completion, it streams high-level state updates in real-time. This allows you to:\n * - Display intermediate results to users as they're generated\n * - Monitor the agent's progress through each step\n * - React to state changes as nodes complete\n *\n * For more granular event-level streaming (like individual LLM tokens), use `streamEvents` instead.\n *\n * @param state - The initial state for the agent execution. Can be:\n * - An object containing `messages` array and any middleware-specific state properties\n * - A Command object for more advanced control flow\n *\n * @param config - Optional runtime configuration including:\n * @param config.context - The context for the agent execution.\n * @param config.configurable - LangGraph configuration options like `thread_id`, `run_id`, etc.\n * @param config.store - The store for the agent execution for persisting state, see more in {@link https://docs.langchain.com/oss/javascript/langgraph/memory#memory-storage | Memory storage}.\n * @param config.signal - An optional {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | `AbortSignal`} for the agent execution.\n * @param config.streamMode - The streaming mode for the agent execution, see more in {@link https://docs.langchain.com/oss/javascript/langgraph/streaming#supported-stream-modes | Supported stream modes}.\n * @param config.recursionLimit - The recursion limit for the agent execution.\n *\n * @returns A Promise that resolves to an IterableReadableStream of state updates.\n * Each update contains the current state after a node completes.\n *\n * @example\n * ```typescript\n * const agent = new ReactAgent({\n * llm: myModel,\n * tools: [calculator, webSearch]\n * });\n *\n * const stream = await agent.stream({\n * messages: [{ role: \"human\", content: \"What's 2+2 and the weather in NYC?\" }]\n * });\n *\n * for await (const chunk of stream) {\n * console.log(chunk); // State update from each node\n * }\n * ```\n */\n stream<TStreamMode extends StreamMode | StreamMode[] | undefined, TEncoding extends \"text/event-stream\" | undefined>(state: InvokeStateParameter<StateSchema, TMiddleware>, config?: StreamConfiguration<InferContextInput<ContextSchema> & InferMiddlewareContextInputs<TMiddleware>, TStreamMode, TEncoding>): Promise<IterableReadableStream<StreamOutputMap<TStreamMode, false, MergedAgentState<StateSchema, StructuredResponseFormat, TMiddleware>, MergedAgentState<StateSchema, StructuredResponseFormat, TMiddleware>, string, unknown, unknown, TEncoding>>>;\n /**\n * Visualize the graph as a PNG image.\n * @param params - Parameters for the drawMermaidPng method.\n * @param params.withStyles - Whether to include styles in the graph.\n * @param params.curveStyle - The style of the graph's curves.\n * @param params.nodeColors - The colors of the graph's nodes.\n * @param params.wrapLabelNWords - The maximum number of words to wrap in a node's label.\n * @param params.backgroundColor - The background color of the graph.\n * @returns PNG image as a buffer\n */\n drawMermaidPng(params?: {\n withStyles?: boolean;\n curveStyle?: string;\n nodeColors?: Record<string, string>;\n wrapLabelNWords?: number;\n backgroundColor?: string;\n }): Promise<Uint8Array<ArrayBuffer>>;\n /**\n * Draw the graph as a Mermaid string.\n * @param params - Parameters for the drawMermaid method.\n * @param params.withStyles - Whether to include styles in the graph.\n * @param params.curveStyle - The style of the graph's curves.\n * @param params.nodeColors - The colors of the graph's nodes.\n * @param params.wrapLabelNWords - The maximum number of words to wrap in a node's label.\n * @param params.backgroundColor - The background color of the graph.\n * @returns Mermaid string\n */\n drawMermaid(params?: {\n withStyles?: boolean;\n curveStyle?: string;\n nodeColors?: Record<string, string>;\n wrapLabelNWords?: number;\n backgroundColor?: string;\n }): Promise<string>;\n /**\n * The following are internal methods to enable support for LangGraph Platform.\n * They are not part of the createAgent public API.\n *\n * Note: we intentionally return as `never` to avoid type errors due to type inference.\n */\n /**\n * @internal\n */\n streamEvents(state: InvokeStateParameter<StateSchema, TMiddleware>, config?: StreamConfiguration<InferContextInput<ContextSchema> & InferMiddlewareContextInputs<TMiddleware>, StreamMode | StreamMode[] | undefined, \"text/event-stream\" | undefined> & {\n version?: \"v1\" | \"v2\";\n }, streamOptions?: Parameters<Runnable[\"streamEvents\"]>[2]): IterableReadableStream<StreamEvent>;\n /**\n * @internal\n */\n getGraphAsync(config?: RunnableConfig): never;\n /**\n * @internal\n */\n getState(config: RunnableConfig, options?: GetStateOptions): never;\n /**\n * @internal\n */\n getStateHistory(config: RunnableConfig, options?: CheckpointListOptions): never;\n /**\n * @internal\n */\n getSubgraphs(namespace?: string, recurse?: boolean): never;\n /**\n * @internal\n */\n getSubgraphAsync(namespace?: string, recurse?: boolean): never;\n /**\n * @internal\n */\n updateState(inputConfig: LangGraphRunnableConfig, values: Record<string, unknown> | unknown, asNode?: string): never;\n}\nexport {};\n"],"mappings":";;;;;;;;;;;;;AAW8D;KAEzD0B,gBAAgB,CAAA,oBAAqBJ,iBAArB,GAAyCtB,gBAAzC,GAAA,SAAA,EAAA,iCAAwG2B,MAAxG,CAAA,MAAA,EAAA,GAAA,CAAA,GAA8HF,uBAA9H,EAAA,oBAAA,SAAoLR,eAApL,EAAA,CAAA,GAAyMM,gBAAzM,CAA0NK,WAA1N,CAAA,GAAA,CAA0OC,wBAA1O,SAA2QJ,uBAA3Q,GAAqSK,IAArS,CAA0SjB,YAA1S,EAAA,QAAA,CAAA,GAAoUiB,IAApU,CAAyUjB,YAAzU,EAAA,QAAA,CAAA,GAAA;EAAA,kBAAqBS,EAClBO,wBADkBP;CAAiB,CAAA,GAEtDH,qBAFyDnB,CAEnC+B,WAFmC/B,CAAAA;KAGzDgC,oBAHwHL,CAAAA,oBAG/EL,iBAH+EK,GAG3D3B,gBAH2D2B,GAAAA,SAAAA,EAAAA,oBAAAA,SAGAV,eAHAU,EAAAA,CAAAA,GAAAA,CAGsBb,SAHtBa,CAGgCC,WAHhCD,CAAAA,GAG+CP,0BAH/CO,CAG0EI,WAH1EJ,CAAAA,CAAAA,GAG0F1B,OAH1F0B,CAAAA,GAAAA,EAAAA,GAAAA,EAAAA,GAAAA,CAAAA,GAAAA,IAAAA;KAIxHM,UAJ8IR,CAAAA,oBAI/GH,iBAJ+GG,GAI3FzB,gBAJ2FyB,GAAAA,SAAAA,GAA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JV,CAAAA,CAAAA,CAAAA;EAAW;;;;;;;;;;EAAjE,cAA9BQ,CAAAA,MA+B1R,CA/B0RA,EAAAA;IAchST,UAAAA,CAAAA,EAAAA,OAAAA;IAGMY,UAAAA,CAAAA,EAAAA,MAAAA;IAAXC,UAAAA,CAAAA,EAHKb,MAGLa,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;IAARJ,eAAAA,CAAAA,EAAAA,MAAAA;IAcaT,eAAAA,CAAAA,EAAAA,MAAAA;EAAM,CAAA,CAAA,EAdnBS,OAiBAA,CAjBQI,UAiBRJ,CAjBmBG,WAiBnBH,CAAAA,CAAAA;EAAO;;;;;;;;;;EAUqF,WAElE3B,CAAAA,MAQC,CARDA,EAAAA;IAAXgC,UAAAA,CAAAA,EAAAA,OAAAA;IAAiE9B,UAAAA,CAAAA,EAAAA,MAAAA;IAAvBH,UAAAA,CAAAA,EAf5CmB,MAe4CnB,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;IAItCE,eAAAA,CAAAA,EAAAA,MAAAA;IAINA,eAAAA,CAAAA,EAAAA,MAAAA;EAAc,CAAA,CAAA,EApB3B0B,OAoBuCjC,CAAAA,MAAAA,CAAAA;EAAe;;;;AAgBM;;;;;sBA1B5C6B,qBAAqBJ,aAAaG,uBAAuBf,oBAAoBK,kBAAkBa,iBAAiBhB,6BAA6Ba,cAAc1B,aAAaA;;qBAEzKoC,WAAWhC,+BAA+BD,uBAAuBG;;;;yBAI7DD;;;;mBAINA,0BAA0BP;;;;0BAInBO,0BAA0BH;;;;;;;;;;;;2BAYzBH,iCAAiCuB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","names":[],"sources":["../../src/agents/constants.ts"],"sourcesContent":["/**\n * jump targets (user facing)\n */\nexport const JUMP_TO_TARGETS = [\"model\", \"tools\", \"end\"] as const;\nexport type JumpToTarget = (typeof JUMP_TO_TARGETS)[number];\n\nexport const PROMPT_RUNNABLE_NAME = \"prompt\";\n"],"mappings":";;AAMA,MAAa,uBAAuB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.cts","names":["JUMP_TO_TARGETS","JumpToTarget","PROMPT_RUNNABLE_NAME"],"sources":["../../src/agents/constants.d.ts"],"sourcesContent":["/**\n * jump targets (user facing)\n */\nexport declare const JUMP_TO_TARGETS: readonly [\"model\", \"tools\", \"end\"];\nexport type JumpToTarget = (typeof JUMP_TO_TARGETS)[number];\nexport declare const PROMPT_RUNNABLE_NAME = \"prompt\";\n"],"mappings":";;AAGA;AACA;cADqBA;KACTC,YAAAA,WAAuBD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":["JUMP_TO_TARGETS","JumpToTarget","PROMPT_RUNNABLE_NAME"],"sources":["../../src/agents/constants.d.ts"],"sourcesContent":["/**\n * jump targets (user facing)\n */\nexport declare const JUMP_TO_TARGETS: readonly [\"model\", \"tools\", \"end\"];\nexport type JumpToTarget = (typeof JUMP_TO_TARGETS)[number];\nexport declare const PROMPT_RUNNABLE_NAME = \"prompt\";\n"],"mappings":";;AAGA;AACA;cADqBA;KACTC,YAAAA,WAAuBD"}
|
package/dist/agents/constants.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":[],"sources":["../../src/agents/constants.ts"],"sourcesContent":["/**\n * jump targets (user facing)\n */\nexport const JUMP_TO_TARGETS = [\"model\", \"tools\", \"end\"] as const;\nexport type JumpToTarget = (typeof JUMP_TO_TARGETS)[number];\n\nexport const PROMPT_RUNNABLE_NAME = \"prompt\";\n"],"mappings":";AAMA,MAAa,uBAAuB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.cts","names":["ToolCall","MultipleToolsBoundError","Error","MultipleStructuredOutputsError","StructuredOutputParsingError","ToolInvocationError"],"sources":["../../src/agents/errors.d.ts"],"sourcesContent":["/* eslint-disable no-instanceof/no-instanceof */\nimport type { ToolCall } from \"@langchain/core/messages/tool\";\nexport declare class MultipleToolsBoundError extends Error {\n constructor();\n}\n/**\n * Raised when model returns multiple structured output tool calls when only one is expected.\n */\nexport declare class MultipleStructuredOutputsError extends Error {\n readonly toolNames: string[];\n constructor(toolNames: string[]);\n}\n/**\n * Raised when structured output tool call arguments fail to parse according to the schema.\n */\nexport declare class StructuredOutputParsingError extends Error {\n readonly toolName: string;\n readonly errors: string[];\n constructor(toolName: string, errors: string[]);\n}\n/**\n * Raised when a tool call is throwing an error.\n */\nexport declare class ToolInvocationError extends Error {\n readonly toolCall: ToolCall;\n readonly toolError: Error;\n constructor(toolError: unknown, toolCall: ToolCall);\n}\n"],"mappings":";;;cAEqBC,uBAAAA,SAAgCC,KAAK;EAArCD,WAAAA,CAAAA;AAMrB;AAOA;AAQA;;AACuBD,cAhBFG,8BAAAA,SAAuCD,KAAK,CAgB1CF;EAAQ,SACPE,SAAAA,EAAAA,MAAAA,EAAAA;EAAK,WACiBF,CAAAA,SAAAA,EAAAA,MAAAA,EAAAA;;AAHQ;;;cARjCI,4BAAAA,SAAqCF,KAAK;;;;;;;;cAQ1CG,mBAAAA,SAA4BH,KAAAA;qBAC1BF;sBACCE;4CACsBF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","names":["ToolCall","MultipleToolsBoundError","Error","MultipleStructuredOutputsError","StructuredOutputParsingError","ToolInvocationError"],"sources":["../../src/agents/errors.d.ts"],"sourcesContent":["/* eslint-disable no-instanceof/no-instanceof */\nimport type { ToolCall } from \"@langchain/core/messages/tool\";\nexport declare class MultipleToolsBoundError extends Error {\n constructor();\n}\n/**\n * Raised when model returns multiple structured output tool calls when only one is expected.\n */\nexport declare class MultipleStructuredOutputsError extends Error {\n readonly toolNames: string[];\n constructor(toolNames: string[]);\n}\n/**\n * Raised when structured output tool call arguments fail to parse according to the schema.\n */\nexport declare class StructuredOutputParsingError extends Error {\n readonly toolName: string;\n readonly errors: string[];\n constructor(toolName: string, errors: string[]);\n}\n/**\n * Raised when a tool call is throwing an error.\n */\nexport declare class ToolInvocationError extends Error {\n readonly toolCall: ToolCall;\n readonly toolError: Error;\n constructor(toolError: unknown, toolCall: ToolCall);\n}\n"],"mappings":";;;cAEqBC,uBAAAA,SAAgCC,KAAK;EAArCD,WAAAA,CAAAA;AAMrB;AAOA;AAQA;;AACuBD,cAhBFG,8BAAAA,SAAuCD,KAAK,CAgB1CF;EAAQ,SACPE,SAAAA,EAAAA,MAAAA,EAAAA;EAAK,WACiBF,CAAAA,SAAAA,EAAAA,MAAAA,EAAAA;;AAHQ;;;cARjCI,4BAAAA,SAAqCF,KAAK;;;;;;;;cAQ1CG,mBAAAA,SAA4BH,KAAAA;qBAC1BF;sBACCE;4CACsBF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":["InteropZodObject","InteropZodType","ResponseFormatUndefined","CreateAgentParams","AgentMiddleware","AnyAnnotationRoot","ExtractZodArrayTypes","ToolStrategy","TypedToolStrategy","ProviderStrategy","ResponseFormat","JsonSchemaFormat","ReactAgent","createAgent","Record","T","StateSchema","ContextSchema","TMiddleware","Omit","StructuredResponseFormat","JumpToTarget","Runtime","toolStrategy","providerStrategy","createMiddleware","ToolCallRequest","ToolCallHandler","WrapToolCallHook","FakeToolCallingModel"],"sources":["../../src/agents/index.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { InteropZodObject, InteropZodType } from \"@langchain/core/utils/types\";\nimport type { ResponseFormatUndefined } from \"./responses.js\";\nimport type { CreateAgentParams } from \"./types.js\";\nimport type { AgentMiddleware, AnyAnnotationRoot } from \"./middleware/types.js\";\nimport type { ExtractZodArrayTypes } from \"./types.js\";\nimport type { ToolStrategy, TypedToolStrategy, ProviderStrategy, ResponseFormat, JsonSchemaFormat } from \"./responses.js\";\nimport { ReactAgent } from \"./ReactAgent.js\";\n/**\n * Creates a production-ready ReAct (Reasoning + Acting) agent that combines language models with tools\n * and middleware to create systems that can reason about tasks, decide which tools to use, and iteratively\n * work towards solutions.\n *\n * The agent follows the ReAct pattern, interleaving reasoning steps with tool calls to iteratively\n * work towards solutions. It can handle multiple tool calls in sequence or parallel, maintain state\n * across interactions, and provide auditable decision processes.\n *\n * ## Core Components\n *\n * ### Model\n * The reasoning engine can be specified as:\n * - **String identifier**: `\"openai:gpt-4o\"` for simple setup\n * - **Model instance**: Configured model object for full control\n * - **Dynamic function**: Select models at runtime based on state\n *\n * ### Tools\n * Tools give agents the ability to take actions:\n * - Pass an array of tools created with the `tool` function\n * - Or provide a configured `ToolNode` for custom error handling\n *\n * ### Prompt\n * Shape how your agent approaches tasks:\n * - String for simple instructions\n * - SystemMessage for structured prompts\n * - Function for dynamic prompts based on state\n *\n * ### Middleware\n * Middleware allows you to extend the agent's behavior:\n * - Add pre/post-model processing for context injection or validation\n * - Add dynamic control flows, e.g. terminate invocation or retries\n * - Add human-in-the-loop capabilities\n * - Add tool calls to the agent\n * - Add tool results to the agent\n *\n * ## Advanced Features\n *\n * - **Structured Output**: Use `responseFormat` with a Zod schema to get typed responses\n * - **Memory**: Extend the state schema to remember information across interactions\n * - **Streaming**: Get real-time updates as the agent processes\n *\n * @param options - Configuration options for the agent\n * @param options.llm - The language model as an instance of a chat model\n * @param options.model - The language model as a string identifier, see more in {@link https://docs.langchain.com/oss/javascript/langchain/models#basic-usage | Models}.\n * @param options.tools - Array of tools or configured ToolNode\n * @param options.prompt - System instructions (string, SystemMessage, or function)\n * @param options.responseFormat - Zod schema for structured output\n * @param options.stateSchema - Custom state schema for memory\n * @param options.middleware - Array of middleware for extending agent behavior, see more in {@link https://docs.langchain.com/oss/javascript/langchain/middleware | Middleware}.\n *\n * @returns A ReactAgent instance with `invoke` and `stream` methods\n *\n * @example Basic agent with tools\n * ```ts\n * import { createAgent, tool } from \"langchain\";\n * import { z } from \"zod\";\n *\n * const search = tool(\n * ({ query }) => `Results for: ${query}`,\n * {\n * name: \"search\",\n * description: \"Search for information\",\n * schema: z.object({\n * query: z.string().describe(\"The search query\"),\n * })\n * }\n * );\n *\n * const agent = createAgent({\n * llm: \"openai:gpt-4o\",\n * tools: [search],\n * });\n *\n * const result = await agent.invoke({\n * messages: [{ role: \"user\", content: \"Search for ReAct agents\" }],\n * });\n * ```\n *\n * @example Structured output\n * ```ts\n * import { createAgent } from \"langchain\";\n * import { z } from \"zod\";\n *\n * const ContactInfo = z.object({\n * name: z.string(),\n * email: z.string(),\n * phone: z.string(),\n * });\n *\n * const agent = createAgent({\n * llm: \"openai:gpt-4o\",\n * tools: [],\n * responseFormat: ContactInfo,\n * });\n *\n * const result = await agent.invoke({\n * messages: [{\n * role: \"user\",\n * content: \"Extract: John Doe, john@example.com, (555) 123-4567\"\n * }],\n * });\n *\n * console.log(result.structuredResponse);\n * // { name: 'John Doe', email: 'john@example.com', phone: '(555) 123-4567' }\n * ```\n *\n * @example Streaming responses\n * ```ts\n * const stream = await agent.stream(\n * { messages: [{ role: \"user\", content: \"What's the weather?\" }] },\n * { streamMode: \"values\" }\n * );\n *\n * for await (const chunk of stream) {\n * // ...\n * }\n * ```\n */\n// Overload 1: With responseFormat as single InteropZodType\nexport declare function createAgent<T extends Record<string, any> = Record<string, any>, StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: CreateAgentParams<T, StateSchema, ContextSchema, InteropZodType<T>> & {\n responseFormat: InteropZodType<T>;\n middleware?: TMiddleware;\n}): ReactAgent<T, StateSchema, ContextSchema, TMiddleware>;\n// Overload 2: With responseFormat as array of InteropZodTypes (infers union type)\nexport declare function createAgent<T extends readonly InteropZodType<any>[], StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: CreateAgentParams<ExtractZodArrayTypes<T> extends Record<string, any> ? ExtractZodArrayTypes<T> : Record<string, any>, StateSchema, ContextSchema, T> & {\n responseFormat: T;\n middleware?: TMiddleware;\n}): ReactAgent<ExtractZodArrayTypes<T> extends Record<string, any> ? ExtractZodArrayTypes<T> : Record<string, any>, StateSchema, ContextSchema, TMiddleware>;\n// Overload 3: With responseFormat as JsonSchemaFormat (JSON schema object)\nexport declare function createAgent<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: CreateAgentParams<Record<string, unknown>, StateSchema, ContextSchema, JsonSchemaFormat> & {\n responseFormat: JsonSchemaFormat;\n middleware?: TMiddleware;\n}): ReactAgent<Record<string, unknown>, StateSchema, ContextSchema, TMiddleware>;\n// Overload 4: With responseFormat as array of JsonSchemaFormat (JSON schema objects)\nexport declare function createAgent<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: CreateAgentParams<Record<string, unknown>, StateSchema, ContextSchema, JsonSchemaFormat[]> & {\n responseFormat: JsonSchemaFormat[];\n middleware?: TMiddleware;\n}): ReactAgent<Record<string, unknown>, StateSchema, ContextSchema, TMiddleware>;\n// Overload 4.5: With responseFormat as union of JsonSchemaFormat | JsonSchemaFormat[]\nexport declare function createAgent<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: CreateAgentParams<Record<string, unknown>, StateSchema, ContextSchema, JsonSchemaFormat | JsonSchemaFormat[]> & {\n responseFormat: JsonSchemaFormat | JsonSchemaFormat[];\n middleware?: TMiddleware;\n}): ReactAgent<Record<string, unknown>, StateSchema, ContextSchema, TMiddleware>;\n// Overload 5: With responseFormat as TypedToolStrategy (for union types from toolStrategy)\nexport declare function createAgent<T extends Record<string, any> = Record<string, any>, StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: CreateAgentParams<T, StateSchema, ContextSchema, TypedToolStrategy<T>> & {\n responseFormat: TypedToolStrategy<T>;\n middleware?: TMiddleware;\n}): ReactAgent<T, StateSchema, ContextSchema, TMiddleware>;\n// Overload 6: With responseFormat as single ToolStrategy instance\nexport declare function createAgent<T extends Record<string, any> = Record<string, any>, StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: CreateAgentParams<T, StateSchema, ContextSchema, ToolStrategy<T>> & {\n responseFormat: ToolStrategy<T>;\n middleware?: TMiddleware;\n}): ReactAgent<T, StateSchema, ContextSchema, TMiddleware>;\n// Overload 7: With responseFormat as ProviderStrategy\nexport declare function createAgent<T extends Record<string, any> = Record<string, any>, StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: CreateAgentParams<T, StateSchema, ContextSchema, ProviderStrategy<T>> & {\n responseFormat: ProviderStrategy<T>;\n middleware?: TMiddleware;\n}): ReactAgent<T, StateSchema, ContextSchema, TMiddleware>;\n// Overload 8: Without responseFormat property at all - with proper middleware state typing\nexport declare function createAgent<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: Omit<CreateAgentParams<ResponseFormatUndefined, StateSchema, ContextSchema, never>, \"responseFormat\"> & {\n middleware?: TMiddleware;\n}): ReactAgent<ResponseFormatUndefined, StateSchema, ContextSchema, TMiddleware>;\n// Overload 9: With responseFormat explicitly undefined\nexport declare function createAgent<StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: Omit<CreateAgentParams<ResponseFormatUndefined, StateSchema, ContextSchema, never>, \"responseFormat\"> & {\n responseFormat?: undefined;\n middleware?: TMiddleware;\n}): ReactAgent<ResponseFormatUndefined, StateSchema, ContextSchema, TMiddleware>;\n// Overload 10: For other ResponseFormat values (failsafe)\nexport declare function createAgent<StructuredResponseFormat extends Record<string, any> = Record<string, any>, StateSchema extends AnyAnnotationRoot | InteropZodObject | undefined = undefined, ContextSchema extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, const TMiddleware extends readonly AgentMiddleware[] = readonly AgentMiddleware[]>(params: CreateAgentParams<StructuredResponseFormat, StateSchema, ContextSchema, ResponseFormat> & {\n responseFormat: ResponseFormat;\n middleware?: TMiddleware;\n}): ReactAgent<StructuredResponseFormat, StateSchema, ContextSchema, TMiddleware>;\n// Re-export types and utilities\nexport * from \"./types.js\";\nexport * from \"./errors.js\";\nexport type { JumpToTarget } from \"./constants.js\";\nexport type { Runtime } from \"./runtime.js\";\nexport { toolStrategy, providerStrategy, ToolStrategy, ProviderStrategy, type ResponseFormat, type ResponseFormatUndefined, } from \"./responses.js\";\nexport { createMiddleware } from \"./middleware.js\";\nexport type { ToolCallRequest, ToolCallHandler, WrapToolCallHook, } from \"./middleware/types.js\";\nexport { FakeToolCallingModel } from \"./tests/utils.js\";\nexport type { ReactAgent } from \"./ReactAgent.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAgIA;;;;;;;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