langgraph-ui-components 0.0.25 → 0.0.28
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/README.md +515 -55
- package/dist/_virtual/index.cjs.js +1 -1
- package/dist/_virtual/index.cjs2.js +1 -1
- package/dist/_virtual/index.cjs3.js +1 -1
- package/dist/_virtual/index.es.js +5 -2
- package/dist/_virtual/index.es2.js +4 -2
- package/dist/_virtual/index.es2.js.map +1 -1
- package/dist/_virtual/index.es3.js +4 -4
- package/dist/assets/langgraph-ui-components.css +1 -1
- package/dist/components/ChatBody.cjs.js +2 -2
- package/dist/components/ChatBody.cjs.js.map +1 -1
- package/dist/components/ChatBody.d.ts.map +1 -1
- package/dist/components/ChatBody.es.js +208 -142
- package/dist/components/ChatBody.es.js.map +1 -1
- package/dist/components/TodoList.cjs.js +2 -0
- package/dist/components/TodoList.cjs.js.map +1 -0
- package/dist/components/TodoList.d.ts +5 -0
- package/dist/components/TodoList.d.ts.map +1 -0
- package/dist/components/TodoList.es.js +65 -0
- package/dist/components/TodoList.es.js.map +1 -0
- package/dist/components/messages/AgentMessage.cjs.js +3 -1
- package/dist/components/messages/AgentMessage.cjs.js.map +1 -1
- package/dist/components/messages/AgentMessage.d.ts +5 -1
- package/dist/components/messages/AgentMessage.d.ts.map +1 -1
- package/dist/components/messages/AgentMessage.es.js +200 -112
- package/dist/components/messages/AgentMessage.es.js.map +1 -1
- package/dist/components/messages/CustomComponentRender.cjs.js.map +1 -1
- package/dist/components/messages/CustomComponentRender.es.js.map +1 -1
- package/dist/components/ui/syntax-highlighter.cjs.js +1 -1
- package/dist/components/ui/syntax-highlighter.cjs.js.map +1 -1
- package/dist/components/ui/syntax-highlighter.es.js +1 -1
- package/dist/entries/components.cjs.js +1 -1
- package/dist/entries/components.d.ts.map +1 -1
- package/dist/entries/components.es.js +4 -5
- package/dist/entries/components.es.js.map +1 -1
- package/dist/entries/hooks.cjs.js +1 -1
- package/dist/entries/hooks.d.ts.map +1 -1
- package/dist/entries/hooks.es.js +5 -6
- package/dist/entries/hooks.es.js.map +1 -1
- package/dist/entries/providers.cjs.js +1 -1
- package/dist/entries/providers.d.ts +1 -1
- package/dist/entries/providers.d.ts.map +1 -1
- package/dist/entries/providers.es.js +18 -19
- package/dist/entries/providers.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +28 -29
- package/dist/index.es.js.map +1 -1
- package/dist/node_modules/.pnpm/react-syntax-highlighter@16.1.0_react@19.2.3/node_modules/react-syntax-highlighter/dist/cjs/styles/prism/index.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-syntax-highlighter@16.1.0_react@19.2.3/node_modules/react-syntax-highlighter/dist/cjs/styles/prism/index.es.js +1 -1
- package/dist/node_modules/.pnpm/react-syntax-highlighter@16.1.0_react@19.2.3/node_modules/react-syntax-highlighter/dist/esm/async-languages/create-language-async-loader.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-syntax-highlighter@16.1.0_react@19.2.3/node_modules/react-syntax-highlighter/dist/esm/async-languages/create-language-async-loader.cjs.js.map +1 -1
- package/dist/node_modules/.pnpm/react-syntax-highlighter@16.1.0_react@19.2.3/node_modules/react-syntax-highlighter/dist/esm/async-languages/create-language-async-loader.es.js +1 -1
- package/dist/node_modules/.pnpm/react-syntax-highlighter@16.1.0_react@19.2.3/node_modules/react-syntax-highlighter/dist/esm/async-syntax-highlighter.cjs.js +1 -1
- package/dist/node_modules/.pnpm/react-syntax-highlighter@16.1.0_react@19.2.3/node_modules/react-syntax-highlighter/dist/esm/async-syntax-highlighter.cjs.js.map +1 -1
- package/dist/node_modules/.pnpm/react-syntax-highlighter@16.1.0_react@19.2.3/node_modules/react-syntax-highlighter/dist/esm/async-syntax-highlighter.es.js +1 -1
- package/dist/pages/Chat/Chat.cjs.js +1 -1
- package/dist/pages/Chat/Chat.cjs.js.map +1 -1
- package/dist/pages/Chat/Chat.d.ts.map +1 -1
- package/dist/pages/Chat/Chat.es.js +41 -34
- package/dist/pages/Chat/Chat.es.js.map +1 -1
- package/dist/pages/Sidebar/sidebar.cjs.js +1 -1
- package/dist/pages/Sidebar/sidebar.cjs.js.map +1 -1
- package/dist/pages/Sidebar/sidebar.d.ts.map +1 -1
- package/dist/pages/Sidebar/sidebar.es.js +75 -70
- package/dist/pages/Sidebar/sidebar.es.js.map +1 -1
- package/dist/providers/ChatProvider.cjs.js +1 -1
- package/dist/providers/ChatProvider.cjs.js.map +1 -1
- package/dist/providers/ChatProvider.d.ts +17 -1
- package/dist/providers/ChatProvider.d.ts.map +1 -1
- package/dist/providers/ChatProvider.es.js +18 -17
- package/dist/providers/ChatProvider.es.js.map +1 -1
- package/dist/providers/ChatRuntime.es.js +4 -4
- package/dist/providers/CustomComponentProvider.cjs.js +1 -1
- package/dist/providers/CustomComponentProvider.cjs.js.map +1 -1
- package/dist/providers/CustomComponentProvider.d.ts +11 -0
- package/dist/providers/CustomComponentProvider.d.ts.map +1 -1
- package/dist/providers/CustomComponentProvider.es.js +51 -35
- package/dist/providers/CustomComponentProvider.es.js.map +1 -1
- package/dist/providers/Stream.cjs.js +1 -1
- package/dist/providers/Stream.cjs.js.map +1 -1
- package/dist/providers/Stream.d.ts +40 -8
- package/dist/providers/Stream.d.ts.map +1 -1
- package/dist/providers/Stream.es.js +151 -119
- package/dist/providers/Stream.es.js.map +1 -1
- package/dist/providers/Thread.cjs.js +1 -1
- package/dist/providers/Thread.cjs.js.map +1 -1
- package/dist/providers/Thread.d.ts +2 -1
- package/dist/providers/Thread.d.ts.map +1 -1
- package/dist/providers/Thread.es.js +19 -19
- package/dist/providers/Thread.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +17 -1
- package/src/App.tsx +4 -4
- package/src/components/ChatBody.tsx +229 -78
- package/src/components/TodoList.tsx +72 -0
- package/src/components/messages/AgentMessage.tsx +288 -82
- package/src/components/messages/CustomComponentRender.tsx +1 -1
- package/src/entries/components.ts +0 -2
- package/src/entries/hooks.ts +0 -2
- package/src/entries/providers.ts +1 -3
- package/src/index.css +2 -2
- package/src/index.ts +2 -4
- package/src/pages/Chat/Chat.tsx +13 -3
- package/src/pages/Sidebar/sidebar.tsx +12 -3
- package/src/providers/ChatProvider.tsx +18 -1
- package/src/providers/CustomComponentProvider.tsx +41 -0
- package/src/providers/Stream.tsx +88 -25
- package/src/providers/Thread.tsx +2 -2
- package/dist/_virtual/index.cjs10.js +0 -2
- package/dist/_virtual/index.cjs10.js.map +0 -1
- package/dist/_virtual/index.cjs11.js +0 -2
- package/dist/_virtual/index.cjs11.js.map +0 -1
- package/dist/_virtual/index.cjs12.js +0 -2
- package/dist/_virtual/index.cjs12.js.map +0 -1
- package/dist/_virtual/index.cjs4.js +0 -2
- package/dist/_virtual/index.cjs4.js.map +0 -1
- package/dist/_virtual/index.cjs5.js +0 -2
- package/dist/_virtual/index.cjs5.js.map +0 -1
- package/dist/_virtual/index.cjs6.js +0 -2
- package/dist/_virtual/index.cjs6.js.map +0 -1
- package/dist/_virtual/index.cjs7.js +0 -2
- package/dist/_virtual/index.cjs7.js.map +0 -1
- package/dist/_virtual/index.cjs8.js +0 -2
- package/dist/_virtual/index.cjs8.js.map +0 -1
- package/dist/_virtual/index.cjs9.js +0 -2
- package/dist/_virtual/index.cjs9.js.map +0 -1
- package/dist/_virtual/index.es10.js +0 -8
- package/dist/_virtual/index.es10.js.map +0 -1
- package/dist/_virtual/index.es11.js +0 -5
- package/dist/_virtual/index.es11.js.map +0 -1
- package/dist/_virtual/index.es12.js +0 -8
- package/dist/_virtual/index.es12.js.map +0 -1
- package/dist/_virtual/index.es4.js +0 -6
- package/dist/_virtual/index.es4.js.map +0 -1
- package/dist/_virtual/index.es5.js +0 -5
- package/dist/_virtual/index.es5.js.map +0 -1
- package/dist/_virtual/index.es6.js +0 -5
- package/dist/_virtual/index.es6.js.map +0 -1
- package/dist/_virtual/index.es7.js +0 -5
- package/dist/_virtual/index.es7.js.map +0 -1
- package/dist/_virtual/index.es8.js +0 -5
- package/dist/_virtual/index.es8.js.map +0 -1
- package/dist/_virtual/index.es9.js +0 -5
- package/dist/_virtual/index.es9.js.map +0 -1
- package/dist/_virtual/lower-bound.cjs.js +0 -2
- package/dist/_virtual/lower-bound.cjs.js.map +0 -1
- package/dist/_virtual/lower-bound.es.js +0 -5
- package/dist/_virtual/lower-bound.es.js.map +0 -1
- package/dist/_virtual/priority-queue.cjs.js +0 -2
- package/dist/_virtual/priority-queue.cjs.js.map +0 -1
- package/dist/_virtual/priority-queue.es.js +0 -5
- package/dist/_virtual/priority-queue.es.js.map +0 -1
- package/dist/_virtual/re.cjs.js +0 -2
- package/dist/_virtual/re.cjs.js.map +0 -1
- package/dist/_virtual/re.es.js +0 -5
- package/dist/_virtual/re.es.js.map +0 -1
- package/dist/components/ToolCallFunctions.cjs.js +0 -2
- package/dist/components/ToolCallFunctions.cjs.js.map +0 -1
- package/dist/components/ToolCallFunctions.es.js +0 -75
- package/dist/components/ToolCallFunctions.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/_virtual/_rolldown/runtime.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/_virtual/_rolldown/runtime.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/_virtual/_rolldown/runtime.es.js +0 -12
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/_virtual/_rolldown/runtime.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/errors/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/errors/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/errors/index.es.js +0 -66
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/errors/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/anthropic.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/anthropic.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/anthropic.es.js +0 -283
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/anthropic.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/bedrock_converse.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/bedrock_converse.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/bedrock_converse.es.js +0 -219
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/bedrock_converse.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/data.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/data.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/data.es.js +0 -42
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/data.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/deepseek.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/deepseek.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/deepseek.es.js +0 -31
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/deepseek.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google.es.js +0 -77
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google_genai.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google_genai.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google_genai.es.js +0 -78
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google_genai.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google_vertexai.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google_vertexai.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google_vertexai.es.js +0 -75
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/google_vertexai.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/groq.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/groq.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/groq.es.js +0 -51
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/groq.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/index.es.js +0 -23
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/ollama.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/ollama.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/ollama.es.js +0 -31
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/ollama.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/openai.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/openai.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/openai.es.js +0 -241
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/openai.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/utils.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/utils.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/utils.es.js +0 -37
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/utils.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/xai.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/xai.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/xai.es.js +0 -42
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/block_translators/xai.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/content/data.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/content/data.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/content/data.es.js +0 -16
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/messages/content/data.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/tracers/console.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/tracers/console.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/tracers/console.es.js +0 -9
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/tracers/console.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/index.es.js +0 -3
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/src/core.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/src/core.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/src/core.es.js +0 -230
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/src/core.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.cjs.js +0 -3
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.es.js +0 -87
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/json.cjs.js +0 -3
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/json.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/json.es.js +0 -133
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/json.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/namespace.cjs.js +0 -2
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/namespace.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/namespace.es.js +0 -29
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/namespace.es.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/sax-js/sax.cjs.js +0 -10
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/sax-js/sax.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/sax-js/sax.es.js +0 -795
- package/dist/node_modules/.pnpm/@langchain_core@1.1.33_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/utils/sax-js/sax.es.js.map +0 -1
- package/dist/node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.es.js +0 -111
- package/dist/node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/camelcase@6.3.0/node_modules/camelcase/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/camelcase@6.3.0/node_modules/camelcase/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/camelcase@6.3.0/node_modules/camelcase/index.es.js +0 -30
- package/dist/node_modules/.pnpm/camelcase@6.3.0/node_modules/camelcase/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.es.js +0 -112
- package/dist/node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/_uuid.cjs.js +0 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/_uuid.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/_uuid.es.js +0 -3
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/_uuid.es.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/fast-safe-stringify/index.es.js +0 -6
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/fast-safe-stringify/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/fs.browser.cjs.js +0 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/fs.browser.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/fs.browser.es.js +0 -14
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/fs.browser.es.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/p-queue.cjs.js +0 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/p-queue.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/p-queue.es.js +0 -3
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/p-queue.es.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/prompt_cache/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/prompt_cache/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/prompt_cache/index.es.js +0 -200
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/prompt_cache/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/xxhash/xxhash.cjs.js +0 -2
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/xxhash/xxhash.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/xxhash/xxhash.es.js +0 -22
- package/dist/node_modules/.pnpm/langsmith@0.5.10_openai@6.16.0_zod@4.3.5_/node_modules/langsmith/dist/utils/xxhash/xxhash.es.js.map +0 -1
- package/dist/node_modules/.pnpm/p-finally@1.0.0/node_modules/p-finally/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/p-finally@1.0.0/node_modules/p-finally/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/p-finally@1.0.0/node_modules/p-finally/index.es.js +0 -18
- package/dist/node_modules/.pnpm/p-finally@1.0.0/node_modules/p-finally/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.es.js +0 -198
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/lower-bound.cjs.js +0 -2
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/lower-bound.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/lower-bound.es.js +0 -20
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/lower-bound.es.js.map +0 -1
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/priority-queue.cjs.js +0 -2
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/priority-queue.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/priority-queue.es.js +0 -41
- package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/priority-queue.es.js.map +0 -1
- package/dist/node_modules/.pnpm/p-timeout@3.2.0/node_modules/p-timeout/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/p-timeout@3.2.0/node_modules/p-timeout/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/p-timeout@3.2.0/node_modules/p-timeout/index.es.js +0 -45
- package/dist/node_modules/.pnpm/p-timeout@3.2.0/node_modules/p-timeout/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.es.js +0 -57
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.es.js +0 -149
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.es.js +0 -170
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.es.js +0 -15
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.es.js +0 -40
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.es.js +0 -34
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.es.js +0 -15
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.es.js +0 -25
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.es.js +0 -22
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.es.js +0 -22
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.es.js +0 -15
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.es.js +0 -19
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.es.js +0 -15
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.es.js +0 -98
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.es.js +0 -29
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.es.js +0 -9
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.es.js +0 -19
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.es.js +0 -33
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.es.js +0 -11
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.es.js +0 -33
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.es.js +0 -23
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.es.js +0 -23
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.es.js +0 -43
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.es.js +0 -45
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.es.js +0 -25
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.es.js +0 -95
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.es.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.es.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.cjs.js +0 -2
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.cjs.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.es.js +0 -18
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.es.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const u=require("react/jsx-runtime"),oe=require("../providers/Stream.cjs.js"),ae=require("../providers/CustomComponentProvider.cjs.js"),ie=require("../utils/logger.cjs.js"),y=require("../utils/utils.cjs.js"),o=require("react"),ce=require("./messages/AgentMessage.cjs.js"),ue=require("./messages/CustomComponentRender.cjs.js"),le=require("./messages/HumanMessage.cjs.js"),$=require("./Thinking.cjs.js");function de({setIsFirstMessage:j,enableToolCallIndicator:w=!0,chatBodyProps:A}){const i=oe.useStreamContext(),{interruptComponents:U}=ae.useCustomComponents(),T=i.messages,d=i.isLoading,[z,W]=o.useState({});ie.logger.debug("ChatBody render - messages count:",T,"isLoading:",d);const l=o.useMemo(()=>T??[],[T]),L=o.useMemo(()=>{const e=new Set,n=i.values?.ui;if(!Array.isArray(n))return e;for(const r of n){const s=r,c=s.metadata&&typeof s.metadata=="object"?s.metadata:void 0,h=[typeof s.id=="string"?s.id:void 0,typeof c?.id=="string"?c.id:void 0,typeof c?.message_id=="string"?c.message_id:void 0];for(const f of h)f&&e.add(f)}return e},[i.values?.ui]),v=o.useRef(null),H=o.useRef(0),b=o.useRef(!0),R=o.useRef(new Map),q=o.useCallback(e=>Array.isArray(e)?e.map((n,r)=>{if(!n||typeof n!="object")return null;const s=n,c=s.status;return typeof s.content!="string"||c!=="pending"&&c!=="in_progress"&&c!=="completed"?null:{id:s.id&&typeof s.id=="string"?s.id:`todo-${r}`,content:s.content,status:c,updatedAt:s.updatedAt instanceof Date||typeof s.updatedAt=="string"||typeof s.updatedAt=="number"?s.updatedAt:void 0,run_id:typeof s.run_id=="string"?s.run_id:void 0,runId:typeof s.runId=="string"?s.runId:void 0,messageId:typeof s.messageId=="string"?s.messageId:void 0,checkpoint:typeof s.checkpoint=="string"?s.checkpoint:void 0}}).filter(n=>n!==null):[],[]),I=o.useCallback((e,n)=>{W(r=>({...r,[e]:n}))},[]),F=o.useCallback(async e=>{if(!e){console.error("No parent checkpoint available for regeneration");return}await i.submit(void 0,{checkpoint:e,streamMode:["values"],streamSubgraphs:!0,streamResumable:!0})},[i]),B=o.useCallback(e=>{i.setBranch(e)},[i]),x=o.useCallback(e=>{i.submit(null,{command:{resume:e},streamMode:["values","messages-tuple","updates","custom"],streamSubgraphs:!0})},[i]),K=o.useMemo(()=>{const e=i.interrupt;if(!e)return null;const r=e.value?.actionRequests??[];return{approve:()=>{x({decisions:r.map(()=>({type:"approve"}))})},reject:s=>{x({decisions:r.map(()=>({type:"reject",message:s||void 0}))})},edit:s=>{const c=r[0];x({decisions:[{type:"edit",editedAction:{name:c?.name??"",args:{...c?.args,...s}}}]})}}},[i.interrupt,x]),p=o.useCallback(()=>{if(v.current){let e=v.current.parentElement;for(;e;){const n=window.getComputedStyle(e);if(n.overflowY==="auto"||n.overflowY==="scroll")return e;e=e.parentElement}}return null},[]);o.useEffect(()=>{l.length>0&&j&&j(!1)},[l.length,j]);const O=o.useCallback((e,n,r)=>{const s=d&&n===r.length-1&&e.type==="ai";if(!e.content.length&&!y.isAiWithToolCalls(e)&&!s||e.additional_kwargs?.hidden)return null;const c=e.id??`msg-${n}`,h=t=>typeof t.id=="string"&&L.has(t.id);if(e.type==="human")return u.jsx(le,{message:e,fontSize:A?.fontSize},c);if(y.isToolMessage(e))return null;if(e.type==="ai"&&n>0){let t=n-1;for(;t>=0&&y.isToolMessage(r[t]);)t--;if(t>=0&&r[t].type==="ai"&&!h(e))return null}const f=[e];let M=n+1;for(;M<r.length;){const t=r[M];if(y.isToolMessage(t))f.push(t),M++;else if(t.type==="ai"){if(h(t))break;f.push(t),M++}else break}const g=f.filter(t=>t.type==="ai"),_=g.some(t=>Array.isArray(t.content)),m=new Set,k=_?g.flatMap(t=>Array.isArray(t.content)?t.content.filter(a=>{if(a.type==="text"&&typeof a.text=="string"){if(m.has(a.text))return!1;m.add(a.text)}return!0}):typeof t.content=="string"&&t.content.length>0?m.has(t.content)?[]:(m.add(t.content),[{type:"text",text:t.content}]):[]):(()=>{const t=[];for(const a of g){const C=typeof a.content=="string"?a.content:"";C&&!m.has(C)&&(m.add(C),t.push(C))}return t.join(`
|
|
2
2
|
|
|
3
|
-
`),
|
|
3
|
+
`)})(),V=_?k.map(t=>t.type==="text"?t.text:"").filter(Boolean).join(" "):k,J={...e,content:k},D=e?i.getMessagesMetadata(e):void 0,Q=_?k.some(t=>t.type==="thinking"&&t.thinking?.length>0||t.type==="reasoning"&&t.reasoning?.length>0):!1,X=g.some(t=>{const a=t.additional_kwargs;return typeof a?.reasoning_content=="string"&&a.reasoning_content.length>0}),Z=g.some(t=>{const a=t.additional_kwargs;return Array.isArray(a?.tool_status)&&a.tool_status.length>0}),P=f.some(t=>y.isToolMessage(t)),ee=w&&(g.some(t=>y.isAiWithToolCalls(t))||Z||P),G=!!V||Q||X||ee,te=M>=r.length,S=d&&te,E=g.map(t=>t.id).filter(t=>typeof t=="string"&&t.length>0).join("|")||c,ne=(()=>{const t=R.current.get(E);if(!S&&t&&t.length>0)return t;if(S){const a=q(i.values?.todos);if(a.length>0)return R.current.set(E,a),a}for(let a=g.length-1;a>=0;a--){const re=i.getMessagesMetadata(g[a])?.firstSeenState?.values,N=q(re?.todos);if(N.length>0)return(!t||t.length===0)&&R.current.set(E,N),t??N}return t&&t.length>0?t:[]})(),se=S&&!G;return u.jsxs(o.Fragment,{children:[se&&u.jsx($,{}),G&&u.jsx(ce,{agentName:A?.agentName,fontSize:A?.fontSize,message:J,groupedMessages:f,showToolActivity:w,isStreaming:S,onRegenerate:F,feedback:e.id?z[e.id]:void 0,onFeedback:I,branch:D?.branch,branchOptions:D?.branchOptions,onBranchSelect:B,todos:ne}),g.map(t=>u.jsx(ue,{message:t,thread:i},t.id))]},c)},[d,i,q,w,F,z,I,B,L]),Y=o.useMemo(()=>l.map((e,n)=>{const r=O(e,n,l);return r&&!r.key?o.cloneElement(r,{key:e.id??`msg-${n}`}):r}),[l,O]);return o.useEffect(()=>{const e=p();if(!e)return;const n=()=>{const{scrollTop:r,scrollHeight:s,clientHeight:c}=e,h=s-r-c;b.current=h<100};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)},[p]),o.useEffect(()=>{const e=p();if(!e)return;const n=l.length;n>H.current&&(e.scrollTop=e.scrollHeight,b.current=!0),H.current=n},[l,p]),o.useEffect(()=>{const e=p();if(!e||!d)return;const n=new MutationObserver(()=>{b.current&&e&&(e.scrollTop=e.scrollHeight)});return v.current&&n.observe(v.current,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()},[d,p]),o.useLayoutEffect(()=>{const e=p();d&&b.current&&e&&(e.scrollTop=e.scrollHeight)}),u.jsx("div",{ref:v,className:"flex flex-col gap-4 rounded-4xl p-2",children:l.length===0?u.jsx("div",{className:"flex items-center justify-center h-full text-zinc-500",children:d?u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"animate-spin h-5 w-5 border-2 border-zinc-500 border-t-transparent rounded-full"}),u.jsx("span",{children:"Loading conversation..."})]}):"Start a conversation..."}):u.jsxs(u.Fragment,{children:[Y,d&&l.length>0&&l[l.length-1].type==="human"&&u.jsx($,{}),!d&&i.interrupt&&K&&(()=>{const e=i.interrupt.value,n=e?.actionRequests?.[0]?.name,r=n?U[n]:void 0;return r?u.jsx(r,{interrupt:e,actions:K}):null})()]})})}module.exports=de;
|
|
4
4
|
//# sourceMappingURL=ChatBody.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBody.cjs.js","sources":["../../src/components/ChatBody.tsx"],"sourcesContent":["import { parsePartialJson } from \"@langchain/core/output_parsers\";\nimport { useStreamContext } from \"@/providers/Stream\";\nimport type { chatBodyProps } from \"@/types/ChatProps\";\nimport { logger } from \"@/utils/logger\";\nimport { isAiWithToolCalls, isToolMessage } from \"@/utils/utils\";\nimport type { AIMessage, Message } from \"@langchain/langgraph-sdk\";\nimport React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport AgentMessage from \"./messages/AgentMessage\";\nimport CustomComponentRender from \"./messages/CustomComponentRender\";\nimport HumanMessage from \"./messages/HumanMessage\";\nimport type { MessageFeedback } from \"./messages/MessageActions\";\nimport Thinking from \"./Thinking\";\nimport ToolCallFunctions from \"./ToolCallFunctions\";\n\nexport default function ChatBody({ setIsFirstMessage, enableToolCallIndicator, chatBodyProps }: { setIsFirstMessage?: React.Dispatch<React.SetStateAction<boolean>>, enableToolCallIndicator?: boolean, chatBodyProps?: chatBodyProps }) {\n const stream = useStreamContext();\n const messages = stream.messages;\n const isLoading = stream.isLoading;\n\n // State to track message feedback (likes/dislikes)\n const [messageFeedback, setMessageFeedback] = useState<Record<string, MessageFeedback>>({});\n\n logger.debug(\"ChatBody render - messages count:\", messages, \"isLoading:\", isLoading);\n\n // Memoize messages with stable reference\n const memoMessages = useMemo(() => messages ?? [], [messages]);\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n const prevMessageCountRef = useRef(0);\n const shouldAutoScrollRef = useRef(true);\n\n // Handler for message feedback\n const handleFeedback = useCallback((messageId: string, feedback: MessageFeedback) => {\n setMessageFeedback(prev => ({\n ...prev,\n [messageId]: feedback,\n }));\n }, []);\n\n // Handler for message regeneration\n const handleRegenerate = useCallback(async (\n parentCheckpoint: any | null | undefined,\n ) => {\n if (!parentCheckpoint) {\n console.error(\"No parent checkpoint available for regeneration\");\n return;\n }\n\n await stream.submit(undefined, {\n checkpoint: parentCheckpoint,\n streamMode: [\"values\"],\n streamSubgraphs: true,\n streamResumable: true,\n });\n }, [stream]);\n\n // Handler for selecting a different branch\n const handleBranchSelect = useCallback((branch: string) => {\n stream.setBranch(branch);\n }, [stream]);\n\n const getToolCallsFromContent = useCallback((content: Message[\"content\"]): AIMessage[\"tool_calls\"] => {\n if (!Array.isArray(content)) return [];\n const toolCallContents = content.filter(\n (c) => typeof c === \"object\" && c !== null && (c as any).type === \"tool_use\" && (c as any).id,\n ) as Array<Record<string, any>>;\n\n return toolCallContents.map((tc) => {\n let args: Record<string, any> = {};\n if (tc?.input) {\n if (typeof tc.input === \"string\") {\n try {\n args = parsePartialJson(tc.input) ?? {};\n } catch {\n args = {};\n }\n } else if (typeof tc.input === \"object\") {\n args = tc.input as Record<string, any>;\n }\n }\n return {\n name: tc.name ?? \"\",\n id: tc.id ?? \"\",\n args,\n type: \"tool_call\",\n };\n });\n }, []);\n\n // Get the parent scroll container\n const getScrollContainer = useCallback(() => {\n if (containerRef.current) {\n // Find the parent with overflow-y-auto class\n let parent = containerRef.current.parentElement;\n while (parent) {\n const style = window.getComputedStyle(parent);\n if (style.overflowY === 'auto' || style.overflowY === 'scroll') {\n return parent;\n }\n parent = parent.parentElement;\n }\n }\n return null;\n }, []);\n\n useEffect(() => {\n if (memoMessages.length > 0 && setIsFirstMessage) {\n setIsFirstMessage(false);\n }\n }, [memoMessages.length, setIsFirstMessage]);\n\n // Memoize message rendering logic to prevent unnecessary re-renders\n const renderMessage = useCallback((msg: typeof messages[0], index: number, messagesArray: typeof messages) => {\n const isCurrentlyStreamingMessage = isLoading && index === messagesArray.length - 1 && msg.type === \"ai\";\n if (!msg.content.length && !isAiWithToolCalls(msg) && !isCurrentlyStreamingMessage) return null;\n\n if (msg.additional_kwargs?.hidden) {\n return null;\n }\n\n // Use message id or fallback to index for key\n const msgKey = msg.id ?? `msg-${index}`;\n\n if (msg.type === \"human\") {\n return <HumanMessage key={msgKey} message={msg} fontSize={chatBodyProps?.fontSize} />;\n }\n\n // Skip standalone tool messages\n if (isToolMessage(msg)) {\n return null;\n }\n\n // Skip if this AI message was already combined with a previous one\n if (msg.type === \"ai\" && index > 0) {\n // Check if previous non-tool message is also an AI message\n let prevIndex = index - 1;\n while (prevIndex >= 0 && isToolMessage(messagesArray[prevIndex])) {\n prevIndex--;\n }\n\n if (prevIndex >= 0 && messagesArray[prevIndex].type === \"ai\") {\n // This is a consecutive AI message, skip it (it will be combined with the previous one)\n return null;\n }\n }\n\n // Collect all consecutive AI messages and tool messages\n const groupedMessages = [msg];\n const toolMessages = [];\n let nextIndex = index + 1;\n\n while (nextIndex < messagesArray.length) {\n const nextMsg = messagesArray[nextIndex];\n\n if (isToolMessage(nextMsg)) {\n toolMessages.push(nextMsg);\n nextIndex++;\n } else if (nextMsg.type === \"ai\") {\n // Combine consecutive AI messages\n groupedMessages.push(nextMsg);\n nextIndex++;\n } else {\n // Stop at human messages or other types\n break;\n }\n }\n\n // Merge content from all AI messages, preserving r/reasoning blocks\n const hasArrayContent = groupedMessages.some(m => Array.isArray(m.content));\n const mergedContent: Message[\"content\"] = hasArrayContent\n ? groupedMessages.flatMap(m => {\n if (Array.isArray(m.content)) return m.content as any[];\n if (typeof m.content === \"string\" && m.content.length > 0)\n return [{ type: \"text\", text: m.content }];\n return [];\n })\n : groupedMessages\n .map(m => (typeof m.content === \"string\" ? m.content : \"\"))\n .filter(Boolean)\n .join(\"\\n\\n\");\n\n // Extract plain-text portion for legacy checks (tool-call extraction, etc.)\n const combinedContent = hasArrayContent\n ? (mergedContent as any[])\n .map((c: any) => (c.type === \"text\" ? (c.text as string) : \"\"))\n .filter(Boolean)\n .join(\" \")\n : (mergedContent as string);\n\n const toolCallsFromContent = groupedMessages\n .flatMap((m) => {\n const calls = getToolCallsFromContent(m.content);\n return calls || [];\n })\n .filter((tc): tc is NonNullable<typeof tc> => tc != null && tc !== undefined);\n\n // Create a combined message object preserving full content (including thinking blocks)\n const combinedMessage = {\n ...msg,\n content: mergedContent,\n };\n\n // Get branch metadata from thread\n const meta = msg ? stream.getMessagesMetadata(msg) : undefined;\n\n // Determine if there is any displayable content (text OR thinking/reasoning blocks)\n const hasThinkingContent = hasArrayContent\n ? (mergedContent as any[]).some(\n (b: any) =>\n (b.type === \"thinking\" && (b.thinking as string)?.length > 0) ||\n (b.type === \"reasoning\" && (b.reasoning as string)?.length > 0),\n )\n : false;\n const hasKwargsReasoning =\n typeof (msg as any).additional_kwargs?.reasoning_content === \"string\" &&\n ((msg as any).additional_kwargs.reasoning_content as string).length > 0;\n const hasAnyDisplayableContent = !!combinedContent || hasThinkingContent || hasKwargsReasoning;\n\n const isLastMessageGroup = nextIndex >= messagesArray.length;\n const isStreamingThisMessage = isLoading && isLastMessageGroup;\n\n // Check if the first message in the group has tool calls\n const hasToolCalls = isAiWithToolCalls(msg) || toolCallsFromContent.length > 0;\n\n // Show Thinking animation whenever streaming with no displayable content yet (plain chat or tool-call)\n const showThinkingIndicator = isStreamingThisMessage && !hasAnyDisplayableContent;\n\n return (\n <React.Fragment key={msgKey}>\n {/* 1. Thinking indicator - show when streaming with no content yet (no icon shown) */}\n {showThinkingIndicator && (\n <Thinking />\n )}\n {enableToolCallIndicator && hasToolCalls && (\n <ToolCallFunctions\n title=\"Agent Thinking\"\n toolMessages={toolMessages}\n toolCalls={toolCallsFromContent}\n />\n )}\n {/* 2. Agent message — pass full mergedContent so thinking/reasoning blocks are preserved */}\n {hasAnyDisplayableContent && (\n <AgentMessage\n agentName={chatBodyProps?.agentName}\n fontSize={chatBodyProps?.fontSize}\n // agentAvatarUrl={chatBodyProps?.agentAvatarUrl}\n message={combinedMessage}\n isStreaming={isStreamingThisMessage}\n onRegenerate={handleRegenerate}\n feedback={msg.id ? messageFeedback[msg.id] : undefined}\n onFeedback={handleFeedback}\n branch={meta?.branch}\n branchOptions={meta?.branchOptions}\n onBranchSelect={handleBranchSelect}\n />\n )}\n {/* 3. Custom component (from all messages in the group) */}\n {groupedMessages.map((m) => (\n <CustomComponentRender key={m.id} message={m} thread={stream} />\n ))}\n </React.Fragment>\n );\n }, [isLoading, stream, enableToolCallIndicator, handleRegenerate, messageFeedback, handleFeedback, handleBranchSelect]);\n\n // Memoize the rendered messages array\n const renderedMessages = useMemo(() => {\n return memoMessages.map((msg, index) => {\n const element = renderMessage(msg, index, memoMessages);\n // Ensure every element has a key, using message id or fallback to index\n if (element && !element.key) {\n return React.cloneElement(element, { key: msg.id ?? `msg-${index}` });\n }\n return element;\n });\n }, [memoMessages, renderMessage]);\n\n // Track user scroll position to determine if we should auto-scroll\n useEffect(() => {\n const scrollContainer = getScrollContainer();\n if (!scrollContainer) return;\n\n const handleScroll = () => {\n const { scrollTop, scrollHeight, clientHeight } = scrollContainer;\n const distanceFromBottom = scrollHeight - scrollTop - clientHeight;\n // Consider \"at bottom\" if within 100px\n shouldAutoScrollRef.current = distanceFromBottom < 100;\n };\n\n scrollContainer.addEventListener('scroll', handleScroll);\n return () => scrollContainer.removeEventListener('scroll', handleScroll);\n }, [getScrollContainer]);\n\n // Auto-scroll when new messages are added\n useEffect(() => {\n const scrollContainer = getScrollContainer();\n if (!scrollContainer) return;\n\n const currentCount = memoMessages.length;\n const hasNewMessage = currentCount > prevMessageCountRef.current;\n\n if (hasNewMessage) {\n scrollContainer.scrollTop = scrollContainer.scrollHeight;\n shouldAutoScrollRef.current = true;\n }\n\n prevMessageCountRef.current = currentCount;\n }, [memoMessages, getScrollContainer]);\n\n // Use MutationObserver to detect DOM changes and auto-scroll during streaming\n useEffect(() => {\n const scrollContainer = getScrollContainer();\n if (!scrollContainer || !isLoading) return;\n\n const observer = new MutationObserver(() => {\n if (shouldAutoScrollRef.current && scrollContainer) {\n scrollContainer.scrollTop = scrollContainer.scrollHeight;\n }\n });\n\n // Observe the ChatBody container for changes\n if (containerRef.current) {\n observer.observe(containerRef.current, {\n childList: true,\n subtree: true,\n characterData: true,\n });\n }\n\n return () => observer.disconnect();\n }, [isLoading, getScrollContainer]);\n\n // Use useLayoutEffect to scroll after DOM updates\n useLayoutEffect(() => {\n const scrollContainer = getScrollContainer();\n if (isLoading && shouldAutoScrollRef.current && scrollContainer) {\n scrollContainer.scrollTop = scrollContainer.scrollHeight;\n }\n });\n\n return (\n <div\n ref={containerRef}\n className=\"flex flex-col gap-4 rounded-4xl p-2\"\n >\n {memoMessages.length === 0 ? (\n <div className=\"flex items-center justify-center h-full text-zinc-500\">\n {isLoading ? (\n <div className=\"flex items-center gap-2\">\n <div className=\"animate-spin h-5 w-5 border-2 border-zinc-500 border-t-transparent rounded-full\" />\n <span>Loading conversation...</span>\n </div>\n ) : (\n \"Start a conversation...\"\n )}\n </div>\n ) : (\n <>\n {renderedMessages}\n {/* Show thinking indicator when loading and no AI response has started yet */}\n {isLoading && memoMessages.length > 0 && (() => {\n const lastMsg = memoMessages[memoMessages.length - 1];\n // Show if last message is human or if last AI has no content (only tool calls)\n return lastMsg.type === \"human\" ||\n (lastMsg.type === \"ai\" && !lastMsg.content && isAiWithToolCalls(lastMsg));\n })() && (\n <Thinking />\n )}\n </>\n )}\n\n </div>\n );\n}\n"],"names":["ChatBody","setIsFirstMessage","enableToolCallIndicator","chatBodyProps","stream","useStreamContext","messages","isLoading","messageFeedback","setMessageFeedback","useState","logger","memoMessages","useMemo","containerRef","useRef","prevMessageCountRef","shouldAutoScrollRef","handleFeedback","useCallback","messageId","feedback","prev","handleRegenerate","parentCheckpoint","handleBranchSelect","branch","getToolCallsFromContent","content","c","tc","args","parsePartialJson","getScrollContainer","parent","style","useEffect","renderMessage","msg","index","messagesArray","isCurrentlyStreamingMessage","isAiWithToolCalls","msgKey","HumanMessage","isToolMessage","prevIndex","groupedMessages","toolMessages","nextIndex","nextMsg","hasArrayContent","m","mergedContent","combinedContent","toolCallsFromContent","combinedMessage","meta","hasThinkingContent","b","hasKwargsReasoning","hasAnyDisplayableContent","isLastMessageGroup","isStreamingThisMessage","hasToolCalls","showThinkingIndicator","jsxs","React","Thinking","jsx","ToolCallFunctions","AgentMessage","CustomComponentRender","renderedMessages","element","scrollContainer","handleScroll","scrollTop","scrollHeight","clientHeight","distanceFromBottom","currentCount","observer","useLayoutEffect","Fragment","lastMsg"],"mappings":"21DAcA,SAAwBA,EAAS,CAAE,kBAAAC,EAAmB,wBAAAC,EAAyB,cAAAC,GAA0J,CACvO,MAAMC,EAASC,EAAAA,iBAAA,EACTC,EAAWF,EAAO,SAClBG,EAAYH,EAAO,UAGnB,CAACI,EAAiBC,CAAkB,EAAIC,EAAAA,SAA0C,CAAA,CAAE,EAE1FC,EAAAA,OA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,GAAaK,EAAa,OAAS,IAAM,IAAM,CAC9C,MAAMyE,EAAUzE,EAAaA,EAAa,OAAS,CAAC,EAEpD,OAAOyE,EAAQ,OAAS,SACrBA,EAAQ,OAAS,MAAQ,CAACA,EAAQ,SAAW3C,EAAAA,kBAAkB2C,CAAO,CAC3E,GAAA,GACIhB,MAACD,EAAA,CAAA,CAAS,CAAA,CAAA,CAEhB,CAAA,CAAA,CAKR"}
|
|
1
|
+
{"version":3,"file":"ChatBody.cjs.js","sources":["../../src/components/ChatBody.tsx"],"sourcesContent":["import { useStreamContext } from \"@/providers/Stream\";\nimport { useCustomComponents } from \"@/providers/CustomComponentProvider\";\nimport type { chatBodyProps } from \"@/types/ChatProps\";\nimport { logger } from \"@/utils/logger\";\nimport { isAiWithToolCalls, isToolMessage } from \"@/utils/utils\";\nimport type { Message } from \"@langchain/langgraph-sdk\";\nimport type { TodoItem } from \"@/providers/Stream\";\nimport React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport AgentMessage from \"./messages/AgentMessage\";\nimport CustomComponentRender from \"./messages/CustomComponentRender\";\nimport HumanMessage from \"./messages/HumanMessage\";\nimport type { MessageFeedback } from \"./messages/MessageActions\";\nimport Thinking from \"./Thinking\";\n\nexport default function ChatBody({ setIsFirstMessage, enableToolCallIndicator = true, chatBodyProps }: { setIsFirstMessage?: React.Dispatch<React.SetStateAction<boolean>>, enableToolCallIndicator?: boolean, chatBodyProps?: chatBodyProps }) {\n const stream = useStreamContext();\n const { interruptComponents } = useCustomComponents();\n const messages = stream.messages;\n const isLoading = stream.isLoading;\n\n // State to track message feedback (likes/dislikes)\n const [messageFeedback, setMessageFeedback] = useState<Record<string, MessageFeedback>>({});\n\n logger.debug(\"ChatBody render - messages count:\", messages, \"isLoading:\", isLoading);\n\n // Memoize messages with stable reference\n const memoMessages = useMemo(() => messages ?? [], [messages]);\n\n const uiMessageIds = useMemo(() => {\n const ids = new Set<string>();\n const uiMessages = stream.values?.ui;\n if (!Array.isArray(uiMessages)) return ids;\n\n for (const ui of uiMessages) {\n const uiObj = ui as unknown as Record<string, unknown>;\n const metadata =\n uiObj.metadata && typeof uiObj.metadata === \"object\"\n ? (uiObj.metadata as Record<string, unknown>)\n : undefined;\n\n const candidates = [\n typeof uiObj.id === \"string\" ? uiObj.id : undefined,\n typeof metadata?.id === \"string\" ? metadata.id : undefined,\n typeof metadata?.message_id === \"string\" ? metadata.message_id : undefined,\n ];\n\n for (const candidate of candidates) {\n if (candidate) ids.add(candidate);\n }\n }\n\n return ids;\n }, [stream.values?.ui]);\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n const prevMessageCountRef = useRef(0);\n const shouldAutoScrollRef = useRef(true);\n const frozenTodosByGroupRef = useRef<Map<string, TodoItem[]>>(new Map());\n\n const normalizeTodos = useCallback((todos: unknown): TodoItem[] => {\n if (!Array.isArray(todos)) return [];\n\n return todos\n .map((todo, index) => {\n if (!todo || typeof todo !== \"object\") return null;\n const t = todo as Record<string, unknown>;\n const status = t.status;\n if (\n typeof t.content !== \"string\" ||\n (status !== \"pending\" && status !== \"in_progress\" && status !== \"completed\")\n ) {\n return null;\n }\n\n return {\n id: t.id && typeof t.id === \"string\" ? t.id : `todo-${index}`,\n content: t.content,\n status,\n updatedAt: t.updatedAt instanceof Date || typeof t.updatedAt === \"string\" || typeof t.updatedAt === \"number\"\n ? (t.updatedAt as string | number | Date)\n : undefined,\n run_id: typeof t.run_id === \"string\" ? t.run_id : undefined,\n runId: typeof t.runId === \"string\" ? t.runId : undefined,\n messageId: typeof t.messageId === \"string\" ? t.messageId : undefined,\n checkpoint: typeof t.checkpoint === \"string\" ? t.checkpoint : undefined,\n } as TodoItem;\n })\n .filter((todo): todo is TodoItem => todo !== null);\n }, []);\n\n // Handler for message feedback\n const handleFeedback = useCallback((messageId: string, feedback: MessageFeedback) => {\n setMessageFeedback(prev => ({\n ...prev,\n [messageId]: feedback,\n }));\n }, []);\n\n // Handler for message regeneration\n const handleRegenerate = useCallback(async (\n parentCheckpoint: any | null | undefined,\n ) => {\n if (!parentCheckpoint) {\n console.error(\"No parent checkpoint available for regeneration\");\n return;\n }\n\n await stream.submit(undefined, {\n checkpoint: parentCheckpoint,\n streamMode: [\"values\"],\n streamSubgraphs: true,\n streamResumable: true,\n });\n }, [stream]);\n\n // Handler for selecting a different branch\n const handleBranchSelect = useCallback((branch: string) => {\n stream.setBranch(branch);\n }, [stream]);\n\n // Handler for HITL interrupt responses\n const handleInterruptRespond = useCallback((response: any) => {\n stream.submit(null, {\n command: { resume: response },\n streamMode: [\"values\", \"messages-tuple\", \"updates\", \"custom\"],\n streamSubgraphs: true,\n });\n }, [stream]);\n\n // Build interrupt actions for custom renderers\n const interruptActions = useMemo(() => {\n const interrupt = stream.interrupt;\n if (!interrupt) return null;\n const payload = interrupt.value as any;\n const actionRequests = payload?.actionRequests ?? [];\n return {\n approve: () => {\n handleInterruptRespond({\n decisions: actionRequests.map(() => ({ type: \"approve\" as const })),\n });\n },\n reject: (reason?: string) => {\n handleInterruptRespond({\n decisions: actionRequests.map(() => ({\n type: \"reject\" as const,\n message: reason || undefined,\n })),\n });\n },\n edit: (editedArgs: Record<string, unknown>) => {\n const action = actionRequests[0];\n handleInterruptRespond({\n decisions: [\n {\n type: \"edit\" as const,\n editedAction: {\n name: action?.name ?? \"\",\n args: { ...action?.args, ...editedArgs },\n },\n },\n ],\n });\n },\n };\n }, [stream.interrupt, handleInterruptRespond]);\n\n // Get the parent scroll container\n const getScrollContainer = useCallback(() => {\n if (containerRef.current) {\n // Find the parent with overflow-y-auto class\n let parent = containerRef.current.parentElement;\n while (parent) {\n const style = window.getComputedStyle(parent);\n if (style.overflowY === 'auto' || style.overflowY === 'scroll') {\n return parent;\n }\n parent = parent.parentElement;\n }\n }\n return null;\n }, []);\n\n useEffect(() => {\n if (memoMessages.length > 0 && setIsFirstMessage) {\n setIsFirstMessage(false);\n }\n }, [memoMessages.length, setIsFirstMessage]);\n\n // Memoize message rendering logic to prevent unnecessary re-renders\n const renderMessage = useCallback((msg: typeof messages[0], index: number, messagesArray: typeof messages) => {\n const isCurrentlyStreamingMessage = isLoading && index === messagesArray.length - 1 && msg.type === \"ai\";\n if (!msg.content.length && !isAiWithToolCalls(msg) && !isCurrentlyStreamingMessage) return null;\n\n if (msg.additional_kwargs?.hidden) {\n return null;\n }\n\n // Use message id or fallback to index for key\n const msgKey = msg.id ?? `msg-${index}`;\n const hasCustomComponentForMessage = (message: Message) =>\n typeof message.id === \"string\" && uiMessageIds.has(message.id);\n\n if (msg.type === \"human\") {\n return <HumanMessage key={msgKey} message={msg} fontSize={chatBodyProps?.fontSize} />;\n }\n\n // Skip standalone tool messages\n if (isToolMessage(msg)) {\n return null;\n }\n\n // Skip if this AI message was already combined with a previous one\n if (msg.type === \"ai\" && index > 0) {\n // Check if previous non-tool message is also an AI message\n let prevIndex = index - 1;\n while (prevIndex >= 0 && isToolMessage(messagesArray[prevIndex])) {\n prevIndex--;\n }\n\n if (prevIndex >= 0 && messagesArray[prevIndex].type === \"ai\") {\n // Only render separately if THIS message owns custom UI (needs its own group).\n // Otherwise it was already consumed by the previous group's forward scan.\n const currentHasCustomUi = hasCustomComponentForMessage(msg);\n if (!currentHasCustomUi) {\n return null;\n }\n }\n }\n\n const groupedTimelineMessages: Message[] = [msg];\n let nextIndex = index + 1;\n\n while (nextIndex < messagesArray.length) {\n const nextMsg = messagesArray[nextIndex];\n\n if (isToolMessage(nextMsg)) {\n groupedTimelineMessages.push(nextMsg);\n nextIndex++;\n } else if (nextMsg.type === \"ai\") {\n if (hasCustomComponentForMessage(nextMsg)) {\n // Sub-agent/custom UI messages should be rendered in their own section\n // to avoid parent-bubble flicker and reparenting during streaming.\n break;\n }\n groupedTimelineMessages.push(nextMsg);\n nextIndex++;\n } else {\n // Stop at human messages or other types\n break;\n }\n }\n\n const groupedAiMessages = groupedTimelineMessages.filter((m) => m.type === \"ai\");\n\n // Merge content from all AI messages, preserving reasoning blocks.\n // Deduplicate identical text content (subgraph messages can duplicate parent messages).\n const hasArrayContent = groupedAiMessages.some((m) => Array.isArray(m.content));\n const seenTexts = new Set<string>();\n const mergedContent: Message[\"content\"] = hasArrayContent\n ? groupedAiMessages.flatMap((m) => {\n if (Array.isArray(m.content)) {\n return (m.content as any[]).filter((block: any) => {\n if (block.type === \"text\" && typeof block.text === \"string\") {\n if (seenTexts.has(block.text)) return false;\n seenTexts.add(block.text);\n }\n return true;\n });\n }\n if (typeof m.content === \"string\" && m.content.length > 0) {\n if (seenTexts.has(m.content)) return [];\n seenTexts.add(m.content);\n return [{ type: \"text\", text: m.content }];\n }\n return [];\n })\n : (() => {\n const unique: string[] = [];\n for (const m of groupedAiMessages) {\n const text = typeof m.content === \"string\" ? m.content : \"\";\n if (text && !seenTexts.has(text)) {\n seenTexts.add(text);\n unique.push(text);\n }\n }\n return unique.join(\"\\n\\n\");\n })();\n\n // Extract plain-text portion for legacy checks\n const combinedContent = hasArrayContent\n ? (mergedContent as any[])\n .map((c: any) => (c.type === \"text\" ? (c.text as string) : \"\"))\n .filter(Boolean)\n .join(\" \")\n : (mergedContent as string);\n\n // Create a combined message object preserving full content (including thinking blocks)\n const combinedMessage = {\n ...msg,\n content: mergedContent,\n };\n\n // Get branch metadata from thread\n const meta = msg ? stream.getMessagesMetadata(msg) : undefined;\n\n // Determine if there is any displayable content (text OR thinking/reasoning blocks)\n const hasThinkingContent = hasArrayContent\n ? (mergedContent as any[]).some(\n (b: any) =>\n (b.type === \"thinking\" && (b.thinking as string)?.length > 0) ||\n (b.type === \"reasoning\" && (b.reasoning as string)?.length > 0),\n )\n : false;\n const hasKwargsReasoning =\n groupedAiMessages.some((m) => {\n const ak = (m as Record<string, unknown>).additional_kwargs as Record<string, unknown> | undefined;\n return typeof ak?.reasoning_content === \"string\" && (ak.reasoning_content as string).length > 0;\n });\n\n const hasKwargsToolStatus = groupedAiMessages.some((m) => {\n const ak = (m as Record<string, unknown>).additional_kwargs as Record<string, unknown> | undefined;\n return Array.isArray(ak?.tool_status) && (ak.tool_status as unknown[]).length > 0;\n });\n const hasToolMessages = groupedTimelineMessages.some((m) => isToolMessage(m));\n const hasToolCalls = enableToolCallIndicator && (\n groupedAiMessages.some((m) => isAiWithToolCalls(m)) ||\n hasKwargsToolStatus ||\n hasToolMessages\n );\n const hasAnyDisplayableContent =\n !!combinedContent ||\n hasThinkingContent ||\n hasKwargsReasoning ||\n hasToolCalls;\n\n const isLastMessageGroup = nextIndex >= messagesArray.length;\n const isStreamingThisMessage = isLoading && isLastMessageGroup;\n\n const groupKey = groupedAiMessages\n .map((m) => m.id)\n .filter((id): id is string => typeof id === \"string\" && id.length > 0)\n .join(\"|\") || msgKey;\n\n const todosForGroup = (() => {\n const frozen = frozenTodosByGroupRef.current.get(groupKey);\n if (!isStreamingThisMessage && frozen && frozen.length > 0) {\n return frozen;\n }\n\n if (isStreamingThisMessage) {\n const live = normalizeTodos(stream.values?.todos);\n if (live.length > 0) {\n frozenTodosByGroupRef.current.set(groupKey, live);\n return live;\n }\n }\n\n for (let i = groupedAiMessages.length - 1; i >= 0; i--) {\n const aiMeta = stream.getMessagesMetadata(groupedAiMessages[i]);\n const aiValues = aiMeta?.firstSeenState?.values as { todos?: unknown } | undefined;\n const snapshot = normalizeTodos(aiValues?.todos);\n if (snapshot.length > 0) {\n if (!frozen || frozen.length === 0) {\n frozenTodosByGroupRef.current.set(groupKey, snapshot);\n }\n return frozen ?? snapshot;\n }\n }\n\n if (frozen && frozen.length > 0) {\n return frozen;\n }\n\n return [];\n })();\n\n // Show Thinking animation whenever streaming with no displayable content yet (plain chat or tool-call)\n const showThinkingIndicator = isStreamingThisMessage && !hasAnyDisplayableContent;\n\n return (\n <React.Fragment key={msgKey}>\n {/* 1. Thinking indicator - show when streaming with no content yet (no icon shown) */}\n {showThinkingIndicator && (\n <Thinking />\n )}\n {/* 2. Agent message — pass full mergedContent and grouped timeline for in-order rendering */}\n {hasAnyDisplayableContent && (\n <AgentMessage\n agentName={chatBodyProps?.agentName}\n fontSize={chatBodyProps?.fontSize}\n message={combinedMessage}\n groupedMessages={groupedTimelineMessages}\n showToolActivity={enableToolCallIndicator}\n isStreaming={isStreamingThisMessage}\n onRegenerate={handleRegenerate}\n feedback={msg.id ? messageFeedback[msg.id] : undefined}\n onFeedback={handleFeedback}\n branch={meta?.branch}\n branchOptions={meta?.branchOptions}\n onBranchSelect={handleBranchSelect}\n todos={todosForGroup}\n />\n )}\n {/* 3. Custom component (from all messages in the group) */}\n {groupedAiMessages.map((m) => (\n <CustomComponentRender key={m.id} message={m} thread={stream} />\n ))}\n </React.Fragment>\n );\n }, [isLoading, stream, normalizeTodos, enableToolCallIndicator, handleRegenerate, messageFeedback, handleFeedback, handleBranchSelect, uiMessageIds]);\n\n // Memoize the rendered messages array\n const renderedMessages = useMemo(() => {\n return memoMessages.map((msg, index) => {\n const element = renderMessage(msg, index, memoMessages);\n // Ensure every element has a key, using message id or fallback to index\n if (element && !element.key) {\n return React.cloneElement(element, { key: msg.id ?? `msg-${index}` });\n }\n return element;\n });\n }, [memoMessages, renderMessage]);\n\n // Track user scroll position to determine if we should auto-scroll\n useEffect(() => {\n const scrollContainer = getScrollContainer();\n if (!scrollContainer) return;\n\n const handleScroll = () => {\n const { scrollTop, scrollHeight, clientHeight } = scrollContainer;\n const distanceFromBottom = scrollHeight - scrollTop - clientHeight;\n // Consider \"at bottom\" if within 100px\n shouldAutoScrollRef.current = distanceFromBottom < 100;\n };\n\n scrollContainer.addEventListener('scroll', handleScroll);\n return () => scrollContainer.removeEventListener('scroll', handleScroll);\n }, [getScrollContainer]);\n\n // Auto-scroll when new messages are added\n useEffect(() => {\n const scrollContainer = getScrollContainer();\n if (!scrollContainer) return;\n\n const currentCount = memoMessages.length;\n const hasNewMessage = currentCount > prevMessageCountRef.current;\n\n if (hasNewMessage) {\n scrollContainer.scrollTop = scrollContainer.scrollHeight;\n shouldAutoScrollRef.current = true;\n }\n\n prevMessageCountRef.current = currentCount;\n }, [memoMessages, getScrollContainer]);\n\n // Use MutationObserver to detect DOM changes and auto-scroll during streaming\n useEffect(() => {\n const scrollContainer = getScrollContainer();\n if (!scrollContainer || !isLoading) return;\n\n const observer = new MutationObserver(() => {\n if (shouldAutoScrollRef.current && scrollContainer) {\n scrollContainer.scrollTop = scrollContainer.scrollHeight;\n }\n });\n\n // Observe the ChatBody container for changes\n if (containerRef.current) {\n observer.observe(containerRef.current, {\n childList: true,\n subtree: true,\n characterData: true,\n });\n }\n\n return () => observer.disconnect();\n }, [isLoading, getScrollContainer]);\n\n // Use useLayoutEffect to scroll after DOM updates\n useLayoutEffect(() => {\n const scrollContainer = getScrollContainer();\n if (isLoading && shouldAutoScrollRef.current && scrollContainer) {\n scrollContainer.scrollTop = scrollContainer.scrollHeight;\n }\n });\n\n return (\n <div\n ref={containerRef}\n className=\"flex flex-col gap-4 rounded-4xl p-2\"\n >\n {memoMessages.length === 0 ? (\n <div className=\"flex items-center justify-center h-full text-zinc-500\">\n {isLoading ? (\n <div className=\"flex items-center gap-2\">\n <div className=\"animate-spin h-5 w-5 border-2 border-zinc-500 border-t-transparent rounded-full\" />\n <span>Loading conversation...</span>\n </div>\n ) : (\n \"Start a conversation...\"\n )}\n </div>\n ) : (\n <>\n {renderedMessages}\n {/* Show HITL interrupt card when agent is paused for approval */}\n {/* Show thinking indicator when loading and last message is human (no AI response yet) */}\n {isLoading && memoMessages.length > 0 &&\n memoMessages[memoMessages.length - 1].type === \"human\" && (\n <Thinking />\n )}\n {!isLoading && stream.interrupt && interruptActions && (() => {\n const payload = stream.interrupt.value as any;\n const toolName = payload?.actionRequests?.[0]?.name;\n const InterruptComponent = toolName ? interruptComponents[toolName] : undefined;\n if (!InterruptComponent) return null;\n return <InterruptComponent interrupt={payload} actions={interruptActions} />;\n })()}\n </>\n )}\n\n </div>\n );\n}\n"],"names":["ChatBody","setIsFirstMessage","enableToolCallIndicator","chatBodyProps","stream","useStreamContext","interruptComponents","useCustomComponents","messages","isLoading","messageFeedback","setMessageFeedback","useState","logger","memoMessages","useMemo","uiMessageIds","ids","uiMessages","ui","uiObj","metadata","candidates","candidate","containerRef","useRef","prevMessageCountRef","shouldAutoScrollRef","frozenTodosByGroupRef","normalizeTodos","useCallback","todos","todo","index","t","status","handleFeedback","messageId","feedback","prev","handleRegenerate","parentCheckpoint","handleBranchSelect","branch","handleInterruptRespond","response","interruptActions","interrupt","actionRequests","reason","editedArgs","action","getScrollContainer","parent","style","useEffect","renderMessage","msg","messagesArray","isCurrentlyStreamingMessage","isAiWithToolCalls","msgKey","hasCustomComponentForMessage","message","HumanMessage","isToolMessage","prevIndex","groupedTimelineMessages","nextIndex","nextMsg","groupedAiMessages","m","hasArrayContent","seenTexts","mergedContent","block","unique","text","combinedContent","c","combinedMessage","meta","hasThinkingContent","b","hasKwargsReasoning","ak","hasKwargsToolStatus","hasToolMessages","hasToolCalls","hasAnyDisplayableContent","isLastMessageGroup","isStreamingThisMessage","groupKey","id","todosForGroup","frozen","live","i","aiValues","snapshot","showThinkingIndicator","jsxs","React","Thinking","jsx","AgentMessage","CustomComponentRender","renderedMessages","element","scrollContainer","handleScroll","scrollTop","scrollHeight","clientHeight","distanceFromBottom","currentCount","observer","useLayoutEffect","Fragment","payload","toolName","InterruptComponent"],"mappings":"+ZAcA,SAAwBA,GAAS,CAAE,kBAAAC,EAAmB,wBAAAC,EAA0B,GAAM,cAAAC,GAA0J,CAC9O,MAAMC,EAASC,GAAAA,iBAAA,EACT,CAAE,oBAAAC,CAAA,EAAwBC,uBAAA,EAC1BC,EAAWJ,EAAO,SAClBK,EAAYL,EAAO,UAGnB,CAACM,EAAiBC,CAAkB,EAAIC,EAAAA,SAA0C,CAAA,CAAE,EAE1FC,GAAAA,OAAO,MAAM,oCAAqCL,EAAU,aAAcC,CAAS,EAGnF,MAAMK,EAAeC,EAAAA,QAAQ,IAAMP,GAAY,CAAA,EAAI,CAACA,CAAQ,CAAC,EAEvDQ,EAAeD,EAAAA,QAAQ,IAAM,CACjC,MAAME,MAAU,IACVC,EAAad,EAAO,QAAQ,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AS,WAAA,CACxB,EAAG,CAAC3G,EAAW2C,CAAkB,CAAC,EAGlCiE,EAAAA,gBAAgB,IAAM,CACpB,MAAMR,EAAkBzD,EAAA,EACpB3C,GAAakB,EAAoB,SAAWkF,IAC9CA,EAAgB,UAAYA,EAAgB,aAEhD,CAAC,EAGCL,EAAAA,IAAC,MAAA,CACC,IAAKhF,EACL,UAAU,sCAET,SAAAV,EAAa,SAAW,EACvB0F,EAAAA,IAAC,MAAA,CAAI,UAAU,wDACZ,SAAA/F,EACC4F,OAAC,MAAA,CAAI,UAAU,0BACb,SAAA,CAAAG,EAAAA,IAAC,MAAA,CAAI,UAAU,iFAAA,CAAkF,EACjGA,EAAAA,IAAC,QAAK,SAAA,yBAAA,CAAuB,CAAA,CAAA,CAC/B,EAEA,yBAAA,CAEJ,EAEAH,EAAAA,KAAAiB,EAAAA,SAAA,CACG,SAAA,CAAAX,EAGAlG,GAAaK,EAAa,OAAS,GAClCA,EAAaA,EAAa,OAAS,CAAC,EAAE,OAAS,SAC7C0F,EAAAA,IAACD,EAAA,CAAA,CAAS,EAEb,CAAC9F,GAAaL,EAAO,WAAa0C,IAAqB,IAAM,CAC5D,MAAMyE,EAAUnH,EAAO,UAAU,MAC3BoH,EAAWD,GAAS,iBAAiB,CAAC,GAAG,KACzCE,EAAqBD,EAAWlH,EAAoBkH,CAAQ,EAAI,OACtE,OAAKC,EACEjB,EAAAA,IAACiB,EAAA,CAAmB,UAAWF,EAAS,QAASzE,EAAkB,EAD1C,IAElC,GAAA,CAAG,CAAA,CACL,CAAA,CAAA,CAKR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBody.d.ts","sourceRoot":"","sources":["../../src/components/ChatBody.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatBody.d.ts","sourceRoot":"","sources":["../../src/components/ChatBody.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,OAAO,KAA6E,MAAM,OAAO,CAAC;AAOlG,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,iBAAiB,EAAE,uBAA8B,EAAE,aAAa,EAAE,EAAE;IAAE,iBAAiB,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,aAAa,CAAA;CAAE,2CA6f7O"}
|
|
@@ -1,192 +1,258 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { jsx as d, jsxs as F, Fragment as de } from "react/jsx-runtime";
|
|
2
|
+
import { useStreamContext as pe } from "../providers/Stream.es.js";
|
|
3
|
+
import { useCustomComponents as fe } from "../providers/CustomComponentProvider.es.js";
|
|
4
|
+
import { logger as ge } from "../utils/logger.es.js";
|
|
5
|
+
import { isAiWithToolCalls as W, isToolMessage as k } from "../utils/utils.es.js";
|
|
6
|
+
import J, { useState as he, useMemo as x, useRef as A, useCallback as g, useEffect as T, useLayoutEffect as me } from "react";
|
|
7
|
+
import ye from "./messages/AgentMessage.es.js";
|
|
8
|
+
import ve from "./messages/CustomComponentRender.es.js";
|
|
9
|
+
import Me from "./messages/HumanMessage.es.js";
|
|
10
|
+
import Q from "./Thinking.es.js";
|
|
11
|
+
function je({ setIsFirstMessage: R, enableToolCallIndicator: _ = !0, chatBodyProps: j }) {
|
|
12
|
+
const a = pe(), { interruptComponents: X } = fe(), N = a.messages, u = a.isLoading, [B, Z] = he({});
|
|
13
|
+
ge.debug("ChatBody render - messages count:", N, "isLoading:", u);
|
|
14
|
+
const c = x(() => N ?? [], [N]), q = x(() => {
|
|
15
|
+
const e = /* @__PURE__ */ new Set(), n = a.values?.ui;
|
|
16
|
+
if (!Array.isArray(n)) return e;
|
|
17
|
+
for (const o of n) {
|
|
18
|
+
const r = o, i = r.metadata && typeof r.metadata == "object" ? r.metadata : void 0, h = [
|
|
19
|
+
typeof r.id == "string" ? r.id : void 0,
|
|
20
|
+
typeof i?.id == "string" ? i.id : void 0,
|
|
21
|
+
typeof i?.message_id == "string" ? i.message_id : void 0
|
|
22
|
+
];
|
|
23
|
+
for (const p of h)
|
|
24
|
+
p && e.add(p);
|
|
25
|
+
}
|
|
26
|
+
return e;
|
|
27
|
+
}, [a.values?.ui]), y = A(null), K = A(0), C = A(!0), z = A(/* @__PURE__ */ new Map()), L = g((e) => Array.isArray(e) ? e.map((n, o) => {
|
|
28
|
+
if (!n || typeof n != "object") return null;
|
|
29
|
+
const r = n, i = r.status;
|
|
30
|
+
return typeof r.content != "string" || i !== "pending" && i !== "in_progress" && i !== "completed" ? null : {
|
|
31
|
+
id: r.id && typeof r.id == "string" ? r.id : `todo-${o}`,
|
|
32
|
+
content: r.content,
|
|
33
|
+
status: i,
|
|
34
|
+
updatedAt: r.updatedAt instanceof Date || typeof r.updatedAt == "string" || typeof r.updatedAt == "number" ? r.updatedAt : void 0,
|
|
35
|
+
run_id: typeof r.run_id == "string" ? r.run_id : void 0,
|
|
36
|
+
runId: typeof r.runId == "string" ? r.runId : void 0,
|
|
37
|
+
messageId: typeof r.messageId == "string" ? r.messageId : void 0,
|
|
38
|
+
checkpoint: typeof r.checkpoint == "string" ? r.checkpoint : void 0
|
|
39
|
+
};
|
|
40
|
+
}).filter((n) => n !== null) : [], []), O = g((e, n) => {
|
|
41
|
+
Z((o) => ({
|
|
42
|
+
...o,
|
|
43
|
+
[e]: n
|
|
31
44
|
}));
|
|
32
|
-
}, []),
|
|
45
|
+
}, []), D = g(async (e) => {
|
|
33
46
|
if (!e) {
|
|
34
47
|
console.error("No parent checkpoint available for regeneration");
|
|
35
48
|
return;
|
|
36
49
|
}
|
|
37
|
-
await
|
|
50
|
+
await a.submit(void 0, {
|
|
38
51
|
checkpoint: e,
|
|
39
52
|
streamMode: ["values"],
|
|
40
53
|
streamSubgraphs: !0,
|
|
41
54
|
streamResumable: !0
|
|
42
55
|
});
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
else typeof n.input == "object" && (l = n.input);
|
|
56
|
+
}, [a]), G = g((e) => {
|
|
57
|
+
a.setBranch(e);
|
|
58
|
+
}, [a]), b = g((e) => {
|
|
59
|
+
a.submit(null, {
|
|
60
|
+
command: { resume: e },
|
|
61
|
+
streamMode: ["values", "messages-tuple", "updates", "custom"],
|
|
62
|
+
streamSubgraphs: !0
|
|
63
|
+
});
|
|
64
|
+
}, [a]), $ = x(() => {
|
|
65
|
+
const e = a.interrupt;
|
|
66
|
+
if (!e) return null;
|
|
67
|
+
const o = e.value?.actionRequests ?? [];
|
|
57
68
|
return {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
approve: () => {
|
|
70
|
+
b({
|
|
71
|
+
decisions: o.map(() => ({ type: "approve" }))
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
reject: (r) => {
|
|
75
|
+
b({
|
|
76
|
+
decisions: o.map(() => ({
|
|
77
|
+
type: "reject",
|
|
78
|
+
message: r || void 0
|
|
79
|
+
}))
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
edit: (r) => {
|
|
83
|
+
const i = o[0];
|
|
84
|
+
b({
|
|
85
|
+
decisions: [
|
|
86
|
+
{
|
|
87
|
+
type: "edit",
|
|
88
|
+
editedAction: {
|
|
89
|
+
name: i?.name ?? "",
|
|
90
|
+
args: { ...i?.args, ...r }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
62
96
|
};
|
|
63
|
-
}
|
|
64
|
-
if (
|
|
65
|
-
let e =
|
|
97
|
+
}, [a.interrupt, b]), f = g(() => {
|
|
98
|
+
if (y.current) {
|
|
99
|
+
let e = y.current.parentElement;
|
|
66
100
|
for (; e; ) {
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
101
|
+
const n = window.getComputedStyle(e);
|
|
102
|
+
if (n.overflowY === "auto" || n.overflowY === "scroll")
|
|
69
103
|
return e;
|
|
70
104
|
e = e.parentElement;
|
|
71
105
|
}
|
|
72
106
|
}
|
|
73
107
|
return null;
|
|
74
108
|
}, []);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
if (!e.content.length && !
|
|
109
|
+
T(() => {
|
|
110
|
+
c.length > 0 && R && R(!1);
|
|
111
|
+
}, [c.length, R]);
|
|
112
|
+
const U = g((e, n, o) => {
|
|
113
|
+
const r = u && n === o.length - 1 && e.type === "ai";
|
|
114
|
+
if (!e.content.length && !W(e) && !r || e.additional_kwargs?.hidden)
|
|
81
115
|
return null;
|
|
82
|
-
const
|
|
116
|
+
const i = e.id ?? `msg-${n}`, h = (t) => typeof t.id == "string" && q.has(t.id);
|
|
83
117
|
if (e.type === "human")
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
if (
|
|
118
|
+
return /* @__PURE__ */ d(Me, { message: e, fontSize: j?.fontSize }, i);
|
|
119
|
+
if (k(e))
|
|
86
120
|
return null;
|
|
87
|
-
if (e.type === "ai" &&
|
|
88
|
-
let t =
|
|
89
|
-
for (; t >= 0 &&
|
|
121
|
+
if (e.type === "ai" && n > 0) {
|
|
122
|
+
let t = n - 1;
|
|
123
|
+
for (; t >= 0 && k(o[t]); )
|
|
90
124
|
t--;
|
|
91
|
-
if (t >= 0 &&
|
|
125
|
+
if (t >= 0 && o[t].type === "ai" && !h(e))
|
|
92
126
|
return null;
|
|
93
127
|
}
|
|
94
|
-
const
|
|
95
|
-
let
|
|
96
|
-
for (;
|
|
97
|
-
const t =
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
else if (t.type === "ai")
|
|
101
|
-
|
|
102
|
-
|
|
128
|
+
const p = [e];
|
|
129
|
+
let v = n + 1;
|
|
130
|
+
for (; v < o.length; ) {
|
|
131
|
+
const t = o[v];
|
|
132
|
+
if (k(t))
|
|
133
|
+
p.push(t), v++;
|
|
134
|
+
else if (t.type === "ai") {
|
|
135
|
+
if (h(t))
|
|
136
|
+
break;
|
|
137
|
+
p.push(t), v++;
|
|
138
|
+
} else
|
|
103
139
|
break;
|
|
104
140
|
}
|
|
105
|
-
const
|
|
141
|
+
const l = p.filter((t) => t.type === "ai"), H = l.some((t) => Array.isArray(t.content)), m = /* @__PURE__ */ new Set(), S = H ? l.flatMap((t) => Array.isArray(t.content) ? t.content.filter((s) => {
|
|
142
|
+
if (s.type === "text" && typeof s.text == "string") {
|
|
143
|
+
if (m.has(s.text)) return !1;
|
|
144
|
+
m.add(s.text);
|
|
145
|
+
}
|
|
146
|
+
return !0;
|
|
147
|
+
}) : typeof t.content == "string" && t.content.length > 0 ? m.has(t.content) ? [] : (m.add(t.content), [{ type: "text", text: t.content }]) : []) : (() => {
|
|
148
|
+
const t = [];
|
|
149
|
+
for (const s of l) {
|
|
150
|
+
const M = typeof s.content == "string" ? s.content : "";
|
|
151
|
+
M && !m.has(M) && (m.add(M), t.push(M));
|
|
152
|
+
}
|
|
153
|
+
return t.join(`
|
|
106
154
|
|
|
107
|
-
`)
|
|
155
|
+
`);
|
|
156
|
+
})(), ee = H ? S.map((t) => t.type === "text" ? t.text : "").filter(Boolean).join(" ") : S, te = {
|
|
108
157
|
...e,
|
|
109
|
-
content:
|
|
110
|
-
},
|
|
158
|
+
content: S
|
|
159
|
+
}, Y = e ? a.getMessagesMetadata(e) : void 0, ne = H ? S.some(
|
|
111
160
|
(t) => t.type === "thinking" && t.thinking?.length > 0 || t.type === "reasoning" && t.reasoning?.length > 0
|
|
112
|
-
) : !1,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
|
|
161
|
+
) : !1, re = l.some((t) => {
|
|
162
|
+
const s = t.additional_kwargs;
|
|
163
|
+
return typeof s?.reasoning_content == "string" && s.reasoning_content.length > 0;
|
|
164
|
+
}), oe = l.some((t) => {
|
|
165
|
+
const s = t.additional_kwargs;
|
|
166
|
+
return Array.isArray(s?.tool_status) && s.tool_status.length > 0;
|
|
167
|
+
}), se = p.some((t) => k(t)), ae = _ && (l.some((t) => W(t)) || oe || se), V = !!ee || ne || re || ae, ie = v >= o.length, w = u && ie, I = l.map((t) => t.id).filter((t) => typeof t == "string" && t.length > 0).join("|") || i, ce = (() => {
|
|
168
|
+
const t = z.current.get(I);
|
|
169
|
+
if (!w && t && t.length > 0)
|
|
170
|
+
return t;
|
|
171
|
+
if (w) {
|
|
172
|
+
const s = L(a.values?.todos);
|
|
173
|
+
if (s.length > 0)
|
|
174
|
+
return z.current.set(I, s), s;
|
|
175
|
+
}
|
|
176
|
+
for (let s = l.length - 1; s >= 0; s--) {
|
|
177
|
+
const le = a.getMessagesMetadata(l[s])?.firstSeenState?.values, E = L(le?.todos);
|
|
178
|
+
if (E.length > 0)
|
|
179
|
+
return (!t || t.length === 0) && z.current.set(I, E), t ?? E;
|
|
180
|
+
}
|
|
181
|
+
return t && t.length > 0 ? t : [];
|
|
182
|
+
})(), ue = w && !V;
|
|
183
|
+
return /* @__PURE__ */ F(J.Fragment, { children: [
|
|
184
|
+
ue && /* @__PURE__ */ d(Q, {}),
|
|
185
|
+
V && /* @__PURE__ */ d(
|
|
186
|
+
ye,
|
|
125
187
|
{
|
|
126
|
-
agentName:
|
|
127
|
-
fontSize:
|
|
128
|
-
message:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
188
|
+
agentName: j?.agentName,
|
|
189
|
+
fontSize: j?.fontSize,
|
|
190
|
+
message: te,
|
|
191
|
+
groupedMessages: p,
|
|
192
|
+
showToolActivity: _,
|
|
193
|
+
isStreaming: w,
|
|
194
|
+
onRegenerate: D,
|
|
195
|
+
feedback: e.id ? B[e.id] : void 0,
|
|
196
|
+
onFeedback: O,
|
|
197
|
+
branch: Y?.branch,
|
|
198
|
+
branchOptions: Y?.branchOptions,
|
|
199
|
+
onBranchSelect: G,
|
|
200
|
+
todos: ce
|
|
136
201
|
}
|
|
137
202
|
),
|
|
138
|
-
|
|
139
|
-
] },
|
|
140
|
-
}, [
|
|
141
|
-
const
|
|
142
|
-
return
|
|
143
|
-
}), [
|
|
144
|
-
return
|
|
145
|
-
const e =
|
|
203
|
+
l.map((t) => /* @__PURE__ */ d(ve, { message: t, thread: a }, t.id))
|
|
204
|
+
] }, i);
|
|
205
|
+
}, [u, a, L, _, D, B, O, G, q]), P = x(() => c.map((e, n) => {
|
|
206
|
+
const o = U(e, n, c);
|
|
207
|
+
return o && !o.key ? J.cloneElement(o, { key: e.id ?? `msg-${n}` }) : o;
|
|
208
|
+
}), [c, U]);
|
|
209
|
+
return T(() => {
|
|
210
|
+
const e = f();
|
|
146
211
|
if (!e) return;
|
|
147
|
-
const
|
|
148
|
-
const { scrollTop:
|
|
149
|
-
|
|
212
|
+
const n = () => {
|
|
213
|
+
const { scrollTop: o, scrollHeight: r, clientHeight: i } = e, h = r - o - i;
|
|
214
|
+
C.current = h < 100;
|
|
150
215
|
};
|
|
151
|
-
return e.addEventListener("scroll",
|
|
152
|
-
}, [
|
|
153
|
-
const e =
|
|
216
|
+
return e.addEventListener("scroll", n), () => e.removeEventListener("scroll", n);
|
|
217
|
+
}, [f]), T(() => {
|
|
218
|
+
const e = f();
|
|
154
219
|
if (!e) return;
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
}, [
|
|
158
|
-
const e =
|
|
159
|
-
if (!e || !
|
|
160
|
-
const
|
|
161
|
-
|
|
220
|
+
const n = c.length;
|
|
221
|
+
n > K.current && (e.scrollTop = e.scrollHeight, C.current = !0), K.current = n;
|
|
222
|
+
}, [c, f]), T(() => {
|
|
223
|
+
const e = f();
|
|
224
|
+
if (!e || !u) return;
|
|
225
|
+
const n = new MutationObserver(() => {
|
|
226
|
+
C.current && e && (e.scrollTop = e.scrollHeight);
|
|
162
227
|
});
|
|
163
|
-
return
|
|
228
|
+
return y.current && n.observe(y.current, {
|
|
164
229
|
childList: !0,
|
|
165
230
|
subtree: !0,
|
|
166
231
|
characterData: !0
|
|
167
|
-
}), () =>
|
|
168
|
-
}, [
|
|
169
|
-
const e =
|
|
170
|
-
|
|
171
|
-
}), /* @__PURE__ */
|
|
232
|
+
}), () => n.disconnect();
|
|
233
|
+
}, [u, f]), me(() => {
|
|
234
|
+
const e = f();
|
|
235
|
+
u && C.current && e && (e.scrollTop = e.scrollHeight);
|
|
236
|
+
}), /* @__PURE__ */ d(
|
|
172
237
|
"div",
|
|
173
238
|
{
|
|
174
|
-
ref:
|
|
239
|
+
ref: y,
|
|
175
240
|
className: "flex flex-col gap-4 rounded-4xl p-2",
|
|
176
|
-
children:
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
] }) : "Start a conversation..." }) : /* @__PURE__ */
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
241
|
+
children: c.length === 0 ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center h-full text-zinc-500", children: u ? /* @__PURE__ */ F("div", { className: "flex items-center gap-2", children: [
|
|
242
|
+
/* @__PURE__ */ d("div", { className: "animate-spin h-5 w-5 border-2 border-zinc-500 border-t-transparent rounded-full" }),
|
|
243
|
+
/* @__PURE__ */ d("span", { children: "Loading conversation..." })
|
|
244
|
+
] }) : "Start a conversation..." }) : /* @__PURE__ */ F(de, { children: [
|
|
245
|
+
P,
|
|
246
|
+
u && c.length > 0 && c[c.length - 1].type === "human" && /* @__PURE__ */ d(Q, {}),
|
|
247
|
+
!u && a.interrupt && $ && (() => {
|
|
248
|
+
const e = a.interrupt.value, n = e?.actionRequests?.[0]?.name, o = n ? X[n] : void 0;
|
|
249
|
+
return o ? /* @__PURE__ */ d(o, { interrupt: e, actions: $ }) : null;
|
|
250
|
+
})()
|
|
185
251
|
] })
|
|
186
252
|
}
|
|
187
253
|
);
|
|
188
254
|
}
|
|
189
255
|
export {
|
|
190
|
-
|
|
256
|
+
je as default
|
|
191
257
|
};
|
|
192
258
|
//# sourceMappingURL=ChatBody.es.js.map
|