@tdesign-react/chat 1.0.2-alpha.1 → 1.0.2-alpha.10
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/es/_util/reactify.d.ts +1 -2
- package/es/_util/reactify.js +83 -234
- package/es/_util/reactify.js.map +1 -1
- package/es/_util/useDynamicStyle.js +2 -2
- package/es/_util/useDynamicStyle.js.map +1 -1
- package/es/attachments/index.d.ts +5 -0
- package/es/attachments/index.js +24 -0
- package/es/attachments/index.js.map +1 -0
- package/es/chat-actionbar/index.js +5 -7
- package/es/chat-actionbar/index.js.map +1 -1
- package/es/chat-engine/components/activity/index.d.ts +4 -0
- package/es/chat-engine/components/activity/index.js +18 -0
- package/es/chat-engine/components/activity/index.js.map +1 -0
- package/es/chat-engine/components/activity/registry.d.ts +44 -0
- package/es/chat-engine/components/activity/registry.js +85 -0
- package/es/chat-engine/components/activity/registry.js.map +1 -0
- package/es/chat-engine/components/activity/render.d.ts +11 -0
- package/es/chat-engine/components/activity/render.js +107 -0
- package/es/chat-engine/components/activity/render.js.map +1 -0
- package/es/chat-engine/components/activity/types.d.ts +32 -0
- package/es/chat-engine/components/activity/types.js +7 -0
- package/es/chat-engine/components/activity/types.js.map +1 -0
- package/es/chat-engine/components/index.d.ts +3 -0
- package/es/chat-engine/components/index.js +55 -0
- package/es/chat-engine/components/index.js.map +1 -0
- package/es/chat-engine/components/provider/agent-state.js +2 -2
- package/es/chat-engine/components/toolcall/index.js +32 -2
- package/es/chat-engine/components/toolcall/index.js.map +1 -1
- package/es/chat-engine/components/toolcall/registry.js +2 -2
- package/es/chat-engine/components/toolcall/render.d.ts +1 -1
- package/es/chat-engine/components/toolcall/render.js +88 -15
- package/es/chat-engine/components/toolcall/render.js.map +1 -1
- package/es/chat-engine/components/toolcall/types.js +2 -2
- package/es/chat-engine/core/adapters/agui/event-mapper.d.ts +5 -0
- package/es/chat-engine/core/adapters/agui/event-mapper.js +60 -33
- package/es/chat-engine/core/adapters/agui/event-mapper.js.map +1 -1
- package/es/chat-engine/core/adapters/agui/events.d.ts +377 -221
- package/es/chat-engine/core/adapters/agui/events.js +52 -34
- package/es/chat-engine/core/adapters/agui/events.js.map +1 -1
- package/es/chat-engine/core/adapters/agui/index.d.ts +16 -0
- package/es/chat-engine/core/adapters/agui/index.js +52 -28
- package/es/chat-engine/core/adapters/agui/index.js.map +1 -1
- package/es/chat-engine/core/adapters/agui/state-manager.js +2 -2
- package/es/chat-engine/core/adapters/agui/types.d.ts +155 -97
- package/es/chat-engine/core/adapters/agui/types.js +13 -7
- package/es/chat-engine/core/adapters/agui/types.js.map +1 -1
- package/es/chat-engine/core/adapters/agui/utils.d.ts +20 -2
- package/es/chat-engine/core/adapters/agui/utils.js +23 -7
- package/es/chat-engine/core/adapters/agui/utils.js.map +1 -1
- package/es/chat-engine/core/index.js +7 -7
- package/es/chat-engine/core/processor/index.js +2 -2
- package/es/chat-engine/core/server/batch-client.js +2 -2
- package/es/chat-engine/core/server/connection-manager.js +2 -2
- package/es/chat-engine/core/server/errors.js +2 -2
- package/es/chat-engine/core/server/index.js +2 -2
- package/es/chat-engine/core/server/llm-service.js +2 -2
- package/es/chat-engine/core/server/sse-client.js +2 -2
- package/es/chat-engine/core/server/sse-parser.js +2 -2
- package/es/chat-engine/core/server/types.js +2 -2
- package/es/chat-engine/core/store/message.js +2 -2
- package/es/chat-engine/core/store/model.js +2 -2
- package/es/chat-engine/core/store/reactiveState.js +2 -2
- package/es/chat-engine/core/type.d.ts +8 -1
- package/es/chat-engine/core/type.js +2 -2
- package/es/chat-engine/core/utils/eventEmitter.js +2 -2
- package/es/chat-engine/core/utils/index.d.ts +2 -1
- package/es/chat-engine/core/utils/index.js +6 -3
- package/es/chat-engine/core/utils/index.js.map +1 -1
- package/es/chat-engine/core/utils/logger.js +2 -2
- package/es/chat-engine/hooks/index.d.ts +4 -0
- package/es/chat-engine/hooks/index.js +20 -0
- package/es/chat-engine/hooks/index.js.map +1 -0
- package/es/chat-engine/hooks/useAgentActivity.d.ts +16 -0
- package/es/chat-engine/hooks/useAgentActivity.js +73 -0
- package/es/chat-engine/hooks/useAgentActivity.js.map +1 -0
- package/es/chat-engine/hooks/useAgentState.js +2 -2
- package/es/chat-engine/hooks/useAgentState.js.map +1 -1
- package/es/chat-engine/hooks/useAgentToolcall.js +2 -2
- package/es/chat-engine/hooks/useAgentToolcall.js.map +1 -1
- package/es/chat-engine/hooks/useChat.js +4 -4
- package/es/chat-engine/hooks/useChat.js.map +1 -1
- package/es/chat-engine/index.d.ts +3 -3
- package/es/chat-engine/index.js +41 -6
- package/es/chat-engine/index.js.map +1 -1
- package/es/chat-filecard/index.js +5 -7
- package/es/chat-filecard/index.js.map +1 -1
- package/es/chat-loading/index.js +5 -7
- package/es/chat-loading/index.js.map +1 -1
- package/es/chat-markdown/index.js +5 -7
- package/es/chat-markdown/index.js.map +1 -1
- package/es/chat-message/index.js +5 -7
- package/es/chat-message/index.js.map +1 -1
- package/es/chat-sender/index.js +5 -7
- package/es/chat-sender/index.js.map +1 -1
- package/es/chat-thinking/index.js +5 -7
- package/es/chat-thinking/index.js.map +1 -1
- package/es/chatbot/index.js +5 -7
- package/es/chatbot/index.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +40 -11
- package/es/index.js.map +1 -1
- package/es/style/index.js +2 -2
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgentToolcall.js","sources":["../../../../pro-components/chat/chat-engine/hooks/useAgentToolcall.ts"],"sourcesContent":["import { useCallback, useRef, useEffect } from 'react';\nimport type { AgentToolcallConfig, ToolcallComponentProps } from '../components/toolcall/types';\nimport { agentToolcallRegistry } from '../components/toolcall/registry';\n\nexport interface UseAgentToolcallReturn {\n register: (config: AgentToolcallConfig | AgentToolcallConfig[]) => void;\n unregister: (names: string | string[]) => void;\n isRegistered: (name: string) => boolean;\n getRegistered: () => string[];\n config: any;\n}\n\n/**\n * 统一的、智能的 Agent Toolcall 适配器 Hook,\n * 注册管理:负责工具配置的注册、取消注册、状态跟踪;生命周期管理:自动清理、防止内存泄漏\n * 支持两种使用模式:\n * 1. 自动注册模式:传入配置,自动注册和清理\n * 2. 手动注册模式:不传配置或传入null,返回注册方法由业务控制\n */\nexport function useAgentToolcall<TArgs extends object = any, TResult = any, TResponse = any>(\n config?:\n | AgentToolcallConfig<TArgs, TResult, TResponse>\n | AgentToolcallConfig<TArgs, TResult, TResponse>[]\n | null\n | undefined,\n): UseAgentToolcallReturn {\n const registeredNamesRef = useRef<Set<string>>(new Set());\n const autoRegisteredNamesRef = useRef<Set<string>>(new Set());\n const configRef = useRef(config);\n\n // 手动注册方法\n const register = useCallback((newConfig: AgentToolcallConfig | AgentToolcallConfig[]) => {\n if (!newConfig) {\n console.warn('[useAgentToolcall] 配置为空,跳过注册');\n return;\n }\n\n const configs = Array.isArray(newConfig) ? newConfig : [newConfig];\n\n configs.forEach((cfg) => {\n if (agentToolcallRegistry.get(cfg.name)) {\n console.warn(`[useAgentToolcall] 配置名称 \"${cfg.name}\" 已存在于注册表中,将被覆盖`);\n }\n\n agentToolcallRegistry.register(cfg);\n registeredNamesRef.current.add(cfg.name);\n });\n }, []);\n\n // 手动取消注册方法\n const unregister = useCallback((names: string | string[]) => {\n const nameArray = Array.isArray(names) ? names : [names];\n\n nameArray.forEach((name) => {\n agentToolcallRegistry.unregister(name);\n registeredNamesRef.current.delete(name);\n autoRegisteredNamesRef.current.delete(name);\n });\n }, []);\n\n // 检查是否已注册\n const isRegistered = useCallback(\n (name: string) => registeredNamesRef.current.has(name) || autoRegisteredNamesRef.current.has(name),\n [],\n );\n\n // 获取所有已注册的配置名称\n const getRegistered = useCallback(\n () => Array.from(new Set([...registeredNamesRef.current, ...autoRegisteredNamesRef.current])),\n [],\n );\n\n // 自动注册逻辑(当传入配置时)\n useEffect(() => {\n if (!config) {\n return;\n }\n\n const configs = Array.isArray(config) ? config : [config];\n configs.forEach((cfg) => {\n if (agentToolcallRegistry.get(cfg.name)) {\n console.warn(`[useAgentToolcall] 配置名称 \"${cfg.name}\" 已存在于注册表中,将被覆盖`);\n }\n\n agentToolcallRegistry.register(cfg);\n autoRegisteredNamesRef.current.add(cfg.name);\n });\n\n // 清理函数:取消注册自动注册的配置\n return () => {\n configs.forEach((cfg) => {\n agentToolcallRegistry.unregister(cfg.name);\n autoRegisteredNamesRef.current.delete(cfg.name);\n });\n };\n }, [config]);\n\n // 更新配置引用\n useEffect(() => {\n configRef.current = config;\n }, [config]);\n\n return {\n register,\n unregister,\n isRegistered,\n getRegistered,\n config: configRef.current,\n };\n}\n\n// 创建带状态感知的工具配置(带状态变化事件),状态注入,自动为组件注入 agentState\nexport interface ToolConfigWithStateOptions<TArgs extends object = any, TResult = any> {\n name: string;\n description: string;\n parameters: Array<{ name: string; type: string }>;\n subscribeKey?: (props: ToolcallComponentProps<TArgs, TResult>) => string | undefined;\n component: React.ComponentType<ToolcallComponentProps<TArgs, TResult> & { agentState?: Record<string, any> }>;\n}\n"],"names":["useAgentToolcall","config","registeredNamesRef","useRef","Set","autoRegisteredNamesRef","configRef","register","useCallback","newConfig","console","warn","configs","Array","isArray","forEach","cfg","agentToolcallRegistry","get","name","concat","current","add","unregister","names","nameArray","isRegistered","has","getRegistered","from","_toConsumableArray","useEffect"],"mappings":";;;;;;;;;;;;;AAmBO,SAASA,iBACdC,MAKwB,EAAA;EACxB,IAAMC,kBAAqB,GAAAC,MAAA,gBAAwB,IAAAC,GAAA,EAAK,CAAA,CAAA;EACxD,IAAMC,sBAAyB,GAAAF,MAAA,gBAAwB,IAAAC,GAAA,EAAK,CAAA,CAAA;AACtD,EAAA,IAAAE,SAAA,GAAYH,OAAOF,MAAM,CAAA,CAAA;AAGzB,EAAA,IAAAM,QAAA,GAAWC,WAAY,CAAA,UAACC,SAA2D,EAAA;IACvF,IAAI,CAACA,SAAW,EAAA;AACdC,MAAAA,OAAA,CAAQC,KAAK,2EAA8B,CAAA,CAAA;AAC3C,MAAA,OAAA;AAC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,IAAI,CAAA,CAAA;AAAA,GAAA,EACjG,EACF,CAAA,CAAA;EAGA,IAAMS,aAAgB,GAAApB,WAAA,CACpB,YAAA;IAAA,OAAMK,KAAA,CAAMgB,IAAK,gBAAA,IAAIzB,GAAI,CAAAgB,EAAAA,CAAAA,MAAA,CAAAU,kBAAA,CAAI5B,kBAAA,CAAmBmB,OAAS,CAAA,EAAAS,kBAAA,CAAGzB,sBAAuB,CAAAgB,OAAO,CAAC,CAAA,CAAC,CAAA,CAAA;AAAA,GAAA,EAC5F,EACF,CAAA,CAAA;AAGAU,EAAAA,SAAA,CAAU,YAAM;IACd,IAAI,CAAC9B,MAAQ,EAAA;AACX,MAAA,OAAA;AACF,KAAA;AAEA,IAAA,IAAMW,UAAUC,KAAM,CAAAC,OAAA,CAAQb,MAAM,CAAI,GAAAA,MAAA,GAAS,CAACA,MAAM,CAAA,CAAA;AAChDW,IAAAA,OAAA,CAAAG,OAAA,CAAQ,UAACC,GAAQ,EAAA;MACvB,IAAIC,qBAAsB,CAAAC,GAAA,CAAIF,GAAI,CAAAG,IAAI,CAAG,EAAA;QAC/BT,OAAA,CAAAC,IAAA,CAAAS,gDAAAA,CAAAA,MAAA,CAAiCJ,GAAA,CAAIG,IAAqB,EAAA,mFAAA,CAAA,CAAA,CAAA;AACpE,OAAA;AAEAF,MAAAA,qBAAA,CAAsBV,SAASS,GAAG,CAAA,CAAA;MACXX,sBAAA,CAAAgB,OAAA,CAAQC,GAAI,CAAAN,GAAA,CAAIG,IAAI,CAAA,CAAA;AAC7C,KAAC,CAAA,CAAA;AAGD,IAAA,OAAO,YAAM;AACHP,MAAAA,OAAA,CAAAG,OAAA,CAAQ,UAACC,GAAQ,EAAA;AACDC,QAAAA,qBAAA,CAAAM,UAAA,CAAWP,IAAIG,IAAI,CAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"useAgentToolcall.js","sources":["../../../../pro-components/chat/chat-engine/hooks/useAgentToolcall.ts"],"sourcesContent":["import { useCallback, useRef, useEffect } from 'react';\nimport type { AgentToolcallConfig, ToolcallComponentProps } from '../components/toolcall/types';\nimport { agentToolcallRegistry } from '../components/toolcall/registry';\n\nexport interface UseAgentToolcallReturn {\n register: (config: AgentToolcallConfig | AgentToolcallConfig[]) => void;\n unregister: (names: string | string[]) => void;\n isRegistered: (name: string) => boolean;\n getRegistered: () => string[];\n config: any;\n}\n\n/**\n * 统一的、智能的 Agent Toolcall 适配器 Hook,\n * 注册管理:负责工具配置的注册、取消注册、状态跟踪;生命周期管理:自动清理、防止内存泄漏\n * 支持两种使用模式:\n * 1. 自动注册模式:传入配置,自动注册和清理\n * 2. 手动注册模式:不传配置或传入null,返回注册方法由业务控制\n */\nexport function useAgentToolcall<TArgs extends object = any, TResult = any, TResponse = any>(\n config?:\n | AgentToolcallConfig<TArgs, TResult, TResponse>\n | AgentToolcallConfig<TArgs, TResult, TResponse>[]\n | null\n | undefined,\n): UseAgentToolcallReturn {\n const registeredNamesRef = useRef<Set<string>>(new Set());\n const autoRegisteredNamesRef = useRef<Set<string>>(new Set());\n const configRef = useRef(config);\n\n // 手动注册方法\n const register = useCallback((newConfig: AgentToolcallConfig | AgentToolcallConfig[]) => {\n if (!newConfig) {\n console.warn('[useAgentToolcall] 配置为空,跳过注册');\n return;\n }\n\n const configs = Array.isArray(newConfig) ? newConfig : [newConfig];\n\n configs.forEach((cfg) => {\n if (agentToolcallRegistry.get(cfg.name)) {\n console.warn(`[useAgentToolcall] 配置名称 \"${cfg.name}\" 已存在于注册表中,将被覆盖`);\n }\n\n agentToolcallRegistry.register(cfg);\n registeredNamesRef.current.add(cfg.name);\n });\n }, []);\n\n // 手动取消注册方法\n const unregister = useCallback((names: string | string[]) => {\n const nameArray = Array.isArray(names) ? names : [names];\n\n nameArray.forEach((name) => {\n agentToolcallRegistry.unregister(name);\n registeredNamesRef.current.delete(name);\n autoRegisteredNamesRef.current.delete(name);\n });\n }, []);\n\n // 检查是否已注册\n const isRegistered = useCallback(\n (name: string) => registeredNamesRef.current.has(name) || autoRegisteredNamesRef.current.has(name),\n [],\n );\n\n // 获取所有已注册的配置名称\n const getRegistered = useCallback(\n () => Array.from(new Set([...registeredNamesRef.current, ...autoRegisteredNamesRef.current])),\n [],\n );\n\n // 自动注册逻辑(当传入配置时)\n useEffect(() => {\n if (!config) {\n return;\n }\n\n const configs = Array.isArray(config) ? config : [config];\n configs.forEach((cfg) => {\n if (agentToolcallRegistry.get(cfg.name)) {\n console.warn(`[useAgentToolcall] 配置名称 \"${cfg.name}\" 已存在于注册表中,将被覆盖`);\n }\n\n agentToolcallRegistry.register(cfg);\n autoRegisteredNamesRef.current.add(cfg.name);\n });\n\n // 清理函数:取消注册自动注册的配置\n return () => {\n configs.forEach((cfg) => {\n agentToolcallRegistry.unregister(cfg.name);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n autoRegisteredNamesRef.current.delete(cfg.name);\n });\n };\n }, [config]);\n\n // 更新配置引用\n useEffect(() => {\n configRef.current = config;\n }, [config]);\n\n return {\n register,\n unregister,\n isRegistered,\n getRegistered,\n config: configRef.current,\n };\n}\n\n// 创建带状态感知的工具配置(带状态变化事件),状态注入,自动为组件注入 agentState\nexport interface ToolConfigWithStateOptions<TArgs extends object = any, TResult = any> {\n name: string;\n description: string;\n parameters: Array<{ name: string; type: string }>;\n subscribeKey?: (props: ToolcallComponentProps<TArgs, TResult>) => string | undefined;\n component: React.ComponentType<ToolcallComponentProps<TArgs, TResult> & { agentState?: Record<string, any> }>;\n}\n"],"names":["useAgentToolcall","config","registeredNamesRef","useRef","Set","autoRegisteredNamesRef","configRef","register","useCallback","newConfig","console","warn","configs","Array","isArray","forEach","cfg","agentToolcallRegistry","get","name","concat","current","add","unregister","names","nameArray","isRegistered","has","getRegistered","from","_toConsumableArray","useEffect"],"mappings":";;;;;;;;;;;;;AAmBO,SAASA,iBACdC,MAKwB,EAAA;EACxB,IAAMC,kBAAqB,GAAAC,MAAA,gBAAwB,IAAAC,GAAA,EAAK,CAAA,CAAA;EACxD,IAAM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AAA;AAC7C,KAAC,CAAA,CAAA;AAGD,IAAA,OAAO,YAAM;AACHP,MAAAA,OAAA,CAAAG,OAAA,CAAQ,UAACC,GAAQ,EAAA;AACDC,QAAAA,qBAAA,CAAAM,UAAA,CAAWP,IAAIG,IAAI,CAAA,CAAA;AAElBd,QAAAA,sBAAA,CAAAgB,OAAA,CAAA,QAAA,CAAe,CAAAL,GAAA,CAAIG,IAAI,CAAA,CAAA;AAChD,OAAC,CAAA,CAAA;KACH,CAAA;AACF,GAAA,EAAG,CAAClB,MAAM,CAAC,CAAA,CAAA;AAGX8B,EAAAA,SAAA,CAAU,YAAM;IACdzB,SAAA,CAAUe,OAAU,GAAApB,MAAA,CAAA;AACtB,GAAA,EAAG,CAACA,MAAM,CAAC,CAAA,CAAA;EAEJ,OAAA;AACLM,IAAAA,QAAA,EAAAA,QAAA;AACAgB,IAAAA,UAAA,EAAAA,UAAA;AACAG,IAAAA,YAAA,EAAAA,YAAA;AACAE,IAAAA,aAAA,EAAAA,aAAA;IACA3B,QAAQK,SAAU,CAAAe,OAAAA;GACpB,CAAA;AACF;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.2-alpha.9
|
|
3
|
+
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
8
8
|
import { useState, useRef, useEffect } from 'react';
|
|
9
|
-
import
|
|
9
|
+
import ChatEngine from 'tdesign-web-components/lib/chat-engine';
|
|
10
10
|
|
|
11
11
|
var useChat = function useChat(_ref) {
|
|
12
12
|
var initialMessages = _ref.defaultMessages,
|
|
@@ -19,7 +19,7 @@ var useChat = function useChat(_ref) {
|
|
|
19
19
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
20
20
|
status = _useState4[0],
|
|
21
21
|
setStatus = _useState4[1];
|
|
22
|
-
var chatEngineRef = useRef(new
|
|
22
|
+
var chatEngineRef = useRef(new ChatEngine());
|
|
23
23
|
var msgSubscribeRef = useRef(null);
|
|
24
24
|
var prevInitialMessagesRef = useRef([]);
|
|
25
25
|
var chatEngine = chatEngineRef.current;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChat.js","sources":["../../../../pro-components/chat/chat-engine/hooks/useChat.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport ChatEngine from 'tdesign-web-components/lib/chat-engine';\nimport type { ChatMessagesData, ChatServiceConfig, ChatStatus } from 'tdesign-web-components/lib/chat-engine';\n\nexport type IUseChat = {\n defaultMessages?: ChatMessagesData[];\n chatServiceConfig: ChatServiceConfig;\n};\n\nexport const useChat = ({ defaultMessages: initialMessages, chatServiceConfig }: IUseChat) => {\n const [messages, setMessage] = useState<ChatMessagesData[]>([]);\n const [status, setStatus] = useState<ChatStatus>('idle');\n const chatEngineRef = useRef<ChatEngine>(new ChatEngine());\n const msgSubscribeRef = useRef<null | (() => void)>(null);\n const prevInitialMessagesRef = useRef<ChatMessagesData[]>([]);\n\n const chatEngine = chatEngineRef.current;\n\n const syncState = (state: ChatMessagesData[]) => {\n setMessage(state);\n setStatus(state.at(-1)?.status || 'idle');\n };\n\n const subscribeToChat = () => {\n // 清理之前的订阅\n msgSubscribeRef.current?.();\n\n msgSubscribeRef.current = chatEngine.messageStore.subscribe((state) => {\n syncState(state.messages);\n });\n };\n\n const initChat = () => {\n // @ts-ignore\n chatEngine.init(chatServiceConfig, initialMessages);\n // @ts-ignore\n syncState(initialMessages);\n subscribeToChat();\n };\n\n // 初始化聊天引擎\n useEffect(() => {\n initChat();\n return () => msgSubscribeRef.current?.();\n }, []);\n\n // 监听 defaultMessages 变化\n useEffect(() => {\n // 检查 initialMessages 是否真的发生了变化\n const hasChanged = JSON.stringify(prevInitialMessagesRef.current) !== JSON.stringify(initialMessages);\n\n if (hasChanged && initialMessages && initialMessages.length > 0) {\n // 更新引用\n prevInitialMessagesRef.current = initialMessages;\n\n // 重新初始化聊天引擎或更新消息\n chatEngine.setMessages(initialMessages, 'replace');\n\n // 同步状态\n syncState(initialMessages);\n }\n }, [initialMessages, chatEngine]);\n\n return {\n chatEngine,\n messages,\n status,\n };\n};\n"],"names":["useChat","initialMessages","_ref","defaultMessages","chatServiceConfig","_useState","useState","_useState2","_slicedToArray","messages","setMessage","_useState3","_useState4","status","setStatus","chatEngineRef","useRef","ChatEngine","msgSubscribeRef","prevInitialMessagesRef","chatEngine","current","syncState","state","_state$at","at","subscribeToChat","_msgSubscribeRef$curr","call","messageStore","subscribe","initChat","init","useEffect","_msgSubscribeRef$curr2","hasChanged","JSON","stringify","length","setMessages"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useChat.js","sources":["../../../../pro-components/chat/chat-engine/hooks/useChat.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n// import ChatEngine from '../core';\n// import type { ChatMessagesData, ChatServiceConfig, ChatStatus } from '../core';\nimport ChatEngine from 'tdesign-web-components/lib/chat-engine';\nimport type { ChatMessagesData, ChatServiceConfig, ChatStatus } from 'tdesign-web-components/lib/chat-engine';\n\n\nexport type IUseChat = {\n defaultMessages?: ChatMessagesData[];\n chatServiceConfig: ChatServiceConfig;\n};\n\nexport const useChat = ({ defaultMessages: initialMessages, chatServiceConfig }: IUseChat) => {\n const [messages, setMessage] = useState<ChatMessagesData[]>([]);\n const [status, setStatus] = useState<ChatStatus>('idle');\n const chatEngineRef = useRef<ChatEngine>(new ChatEngine());\n const msgSubscribeRef = useRef<null | (() => void)>(null);\n const prevInitialMessagesRef = useRef<ChatMessagesData[]>([]);\n\n const chatEngine = chatEngineRef.current;\n\n const syncState = (state: ChatMessagesData[]) => {\n setMessage(state);\n setStatus(state.at(-1)?.status || 'idle');\n };\n\n const subscribeToChat = () => {\n // 清理之前的订阅\n msgSubscribeRef.current?.();\n\n msgSubscribeRef.current = chatEngine.messageStore.subscribe((state) => {\n syncState(state.messages);\n });\n };\n\n const initChat = () => {\n // @ts-ignore\n chatEngine.init(chatServiceConfig, initialMessages);\n // @ts-ignore\n syncState(initialMessages);\n subscribeToChat();\n };\n\n // 初始化聊天引擎\n useEffect(() => {\n initChat();\n return () => msgSubscribeRef.current?.();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // 监听 defaultMessages 变化\n useEffect(() => {\n // 检查 initialMessages 是否真的发生了变化\n const hasChanged = JSON.stringify(prevInitialMessagesRef.current) !== JSON.stringify(initialMessages);\n\n if (hasChanged && initialMessages && initialMessages.length > 0) {\n // 更新引用\n prevInitialMessagesRef.current = initialMessages;\n\n // 重新初始化聊天引擎或更新消息\n chatEngine.setMessages(initialMessages, 'replace');\n\n // 同步状态\n syncState(initialMessages);\n }\n }, [initialMessages, chatEngine]);\n\n return {\n chatEngine,\n messages,\n status,\n };\n};\n"],"names":["useChat","initialMessages","_ref","defaultMessages","chatServiceConfig","_useState","useState","_useState2","_slicedToArray","messages","setMessage","_useState3","_useState4","status","setStatus","chatEngineRef","useRef","ChatEngine","msgSubscribeRef","prevInitialMessagesRef","chatEngine","current","syncState","state","_state$at","at","subscribeToChat","_msgSubscribeRef$curr","call","messageStore","subscribe","initChat","init","useEffect","_msgSubscribeRef$curr2","hasChanged","JSON","stringify","length","setMessages"],"mappings":";;;;;;;;;;IAYaA,UAAU,SAAVA,cAAiF;AAAA,EAAA,IAAnDC,eAAA,GAAAC,IAAA,CAAjBC,eAAiB;IAAiBC,yBAAAA;AAC1D,EAAA,IAAAC,SAAA,GAA+BC,QAAA,CAA6B,EAAE,CAAA;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAvDI,IAAAA,QAAU,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAAG,IAAAA,UAAU,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAC3B,EAAA,IAAAI,UAAA,GAA4BL,SAAqB,M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'./hooks/useAgentState';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './components
|
|
6
|
-
export * from '
|
|
4
|
+
export * from './hooks/useAgentActivity';
|
|
5
|
+
export * from './components';
|
|
6
|
+
export * from './core';
|
package/es/chat-engine/index.js
CHANGED
|
@@ -1,24 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.2-alpha.9
|
|
3
|
+
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export { useChat } from './hooks/useChat.js';
|
|
8
8
|
export { useAgentToolcall } from './hooks/useAgentToolcall.js';
|
|
9
9
|
export { AgentStateContext, useAgentState, useAgentStateContext, useAgentStateDataByKey } from './hooks/useAgentState.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export { useAgentActivity } from './hooks/useAgentActivity.js';
|
|
11
|
+
import './components/index.js';
|
|
12
|
+
import './core/index.js';
|
|
13
13
|
export { isNonInteractive, isNonInteractiveConfig } from './components/toolcall/types.js';
|
|
14
14
|
export { agentToolcallRegistry } from './components/toolcall/registry.js';
|
|
15
15
|
export { ToolCallRenderer, withAgentStateToolcall, withAgentStateToolcall1 } from './components/toolcall/render.js';
|
|
16
|
+
export { activityRegistry } from './components/activity/registry.js';
|
|
17
|
+
export { ActivityRenderer } from './components/activity/render.js';
|
|
18
|
+
export { AgentStateProvider } from './components/provider/agent-state.js';
|
|
19
|
+
export { applyJsonPatch, findTargetElement, getMessageContentForCopy, isAIMessage, isActivityContent, isAttachmentContent, isImageContent, isMarkdownContent, isReasoningContent, isSearchContent, isSuggestionContent, isTextContent, isThinkingContent, isToolCallContent, isUserMessage, safeParseJSON } from './core/utils/index.js';
|
|
20
|
+
export { StateManagerImpl, stateManager } from './core/adapters/agui/state-manager.js';
|
|
21
|
+
export { AGUIEventType, ActivityDeltaEventSchema, ActivitySnapshotEventSchema, CustomEventSchema, EventSchemas, MessagesSnapshotEventSchema, RawEventSchema, RunErrorEventSchema, RunFinishedEventSchema, RunStartedEventSchema, StateDeltaEventSchema, StateSnapshotEventSchema, StepFinishedEventSchema, StepStartedEventSchema, TextMessageChunkEventSchema, TextMessageContentEventSchema, TextMessageEndEventSchema, TextMessageStartEventSchema, ThinkingEndEventSchema, ThinkingStartEventSchema, ThinkingTextMessageContentEventSchema, ThinkingTextMessageEndEventSchema, ThinkingTextMessageStartEventSchema, ToolCallArgsEventSchema, ToolCallChunkEventSchema, ToolCallEndEventSchema, ToolCallResultEventSchema, ToolCallStartEventSchema, isActivityEvent, isStateEvent, isTextMessageEvent, isThinkingEvent, isToolCallEvent } from './core/adapters/agui/events.js';
|
|
22
|
+
export { AGUIAdapter } from './core/adapters/agui/index.js';
|
|
16
23
|
import '@babel/runtime/helpers/slicedToArray';
|
|
17
24
|
import 'react';
|
|
25
|
+
import 'tdesign-web-components/lib/chat-engine';
|
|
18
26
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
19
27
|
import '@babel/runtime/helpers/defineProperty';
|
|
28
|
+
import './components/toolcall/index.js';
|
|
29
|
+
import './components/activity/index.js';
|
|
30
|
+
import './components/activity/types.js';
|
|
31
|
+
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
32
|
+
import '@babel/runtime/helpers/asyncToGenerator';
|
|
20
33
|
import '@babel/runtime/helpers/classCallCheck';
|
|
21
34
|
import '@babel/runtime/helpers/createClass';
|
|
22
|
-
import '@babel/runtime/helpers/asyncToGenerator';
|
|
23
35
|
import '@babel/runtime/regenerator';
|
|
36
|
+
import './core/store/message.js';
|
|
37
|
+
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
38
|
+
import '@babel/runtime/helpers/getPrototypeOf';
|
|
39
|
+
import '@babel/runtime/helpers/get';
|
|
40
|
+
import '@babel/runtime/helpers/inherits';
|
|
41
|
+
import './core/store/reactiveState.js';
|
|
42
|
+
import '@babel/runtime/helpers/wrapNativeSuper';
|
|
43
|
+
import '@babel/runtime/helpers/typeof';
|
|
44
|
+
import './core/processor/index.js';
|
|
45
|
+
import './core/server/index.js';
|
|
46
|
+
import './core/server/llm-service.js';
|
|
47
|
+
import './core/utils/logger.js';
|
|
48
|
+
import './core/server/batch-client.js';
|
|
49
|
+
import './core/utils/eventEmitter.js';
|
|
50
|
+
import './core/server/errors.js';
|
|
51
|
+
import './core/server/sse-client.js';
|
|
52
|
+
import './core/server/connection-manager.js';
|
|
53
|
+
import './core/server/sse-parser.js';
|
|
54
|
+
import './core/server/types.js';
|
|
55
|
+
import 'zod';
|
|
56
|
+
import './core/adapters/agui/types.js';
|
|
57
|
+
import './core/adapters/agui/event-mapper.js';
|
|
58
|
+
import './core/adapters/agui/utils.js';
|
|
24
59
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.2-alpha.9
|
|
3
|
+
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import 'tdesign-web-components/lib/filecard';
|
|
8
8
|
import reactify from '../_util/reactify.js';
|
|
9
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
9
10
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
10
|
-
import '@babel/runtime/helpers/
|
|
11
|
+
import '@babel/runtime/helpers/typeof';
|
|
12
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
11
13
|
import '@babel/runtime/helpers/classCallCheck';
|
|
12
14
|
import '@babel/runtime/helpers/createClass';
|
|
13
15
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
14
16
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
15
17
|
import '@babel/runtime/helpers/inherits';
|
|
16
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
17
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
18
|
-
import '@babel/runtime/helpers/typeof';
|
|
19
18
|
import 'react';
|
|
20
|
-
import 'react-dom';
|
|
21
19
|
import 'react-dom/client';
|
|
22
20
|
|
|
23
21
|
var Filecard = reactify("t-filecard");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-filecard/index.ts"],"sourcesContent":["import { TdFileCardProps } from 'tdesign-web-components';\nimport 'tdesign-web-components/lib/filecard';\nimport reactify from '../_util/reactify';\n\nexport const Filecard: React.ForwardRefExoticComponent<\n Omit<TdFileCardProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdFileCardProps>('t-filecard');\n\nexport default Filecard;\nexport type { TdFileCardProps } from 'tdesign-web-components';\n"],"names":["Filecard","reactify"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-filecard/index.ts"],"sourcesContent":["import { TdFileCardProps } from 'tdesign-web-components';\nimport 'tdesign-web-components/lib/filecard';\nimport reactify from '../_util/reactify';\n\nexport const Filecard: React.ForwardRefExoticComponent<\n Omit<TdFileCardProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdFileCardProps>('t-filecard');\n\nexport default Filecard;\nexport type { TdFileCardProps } from 'tdesign-web-components';\n"],"names":["Filecard","reactify"],"mappings":";;;;;;;;;;;;;;;;;;;;IAIaA,QAAA,GAETC,SAA0B,YAAY;;;;"}
|
package/es/chat-loading/index.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.2-alpha.9
|
|
3
|
+
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import 'tdesign-web-components/lib/chat-loading';
|
|
8
8
|
import reactify from '../_util/reactify.js';
|
|
9
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
9
10
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
10
|
-
import '@babel/runtime/helpers/
|
|
11
|
+
import '@babel/runtime/helpers/typeof';
|
|
12
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
11
13
|
import '@babel/runtime/helpers/classCallCheck';
|
|
12
14
|
import '@babel/runtime/helpers/createClass';
|
|
13
15
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
14
16
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
15
17
|
import '@babel/runtime/helpers/inherits';
|
|
16
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
17
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
18
|
-
import '@babel/runtime/helpers/typeof';
|
|
19
18
|
import 'react';
|
|
20
|
-
import 'react-dom';
|
|
21
19
|
import 'react-dom/client';
|
|
22
20
|
|
|
23
21
|
var ChatLoading = reactify("t-chat-loading");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-loading/index.ts"],"sourcesContent":["import { TdChatLoadingProps } from 'tdesign-web-components';\nimport 'tdesign-web-components/lib/chat-loading';\nimport reactify from '../_util/reactify';\n\nexport const ChatLoading: React.ForwardRefExoticComponent<\n Omit<TdChatLoadingProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatLoadingProps>('t-chat-loading');\n\nexport default ChatLoading;\nexport type { TdChatLoadingProps, ChatLoadingAnimationType } from 'tdesign-web-components';\n"],"names":["ChatLoading","reactify"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-loading/index.ts"],"sourcesContent":["import { TdChatLoadingProps } from 'tdesign-web-components';\nimport 'tdesign-web-components/lib/chat-loading';\nimport reactify from '../_util/reactify';\n\nexport const ChatLoading: React.ForwardRefExoticComponent<\n Omit<TdChatLoadingProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatLoadingProps>('t-chat-loading');\n\nexport default ChatLoading;\nexport type { TdChatLoadingProps, ChatLoadingAnimationType } from 'tdesign-web-components';\n"],"names":["ChatLoading","reactify"],"mappings":";;;;;;;;;;;;;;;;;;;;IAIaA,WAAA,GAETC,SAA6B,gBAAgB;;;;"}
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.2-alpha.9
|
|
3
|
+
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { TdMarkdownEngine } from 'tdesign-web-components';
|
|
8
8
|
import reactify from '../_util/reactify.js';
|
|
9
9
|
import 'tdesign-web-components/lib/chat-message/content/markdown-content';
|
|
10
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
10
11
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
11
|
-
import '@babel/runtime/helpers/
|
|
12
|
+
import '@babel/runtime/helpers/typeof';
|
|
13
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
12
14
|
import '@babel/runtime/helpers/classCallCheck';
|
|
13
15
|
import '@babel/runtime/helpers/createClass';
|
|
14
16
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
15
17
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
16
18
|
import '@babel/runtime/helpers/inherits';
|
|
17
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
18
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
19
|
-
import '@babel/runtime/helpers/typeof';
|
|
20
19
|
import 'react';
|
|
21
|
-
import 'react-dom';
|
|
22
20
|
import 'react-dom/client';
|
|
23
21
|
|
|
24
22
|
var MarkdownEngine = TdMarkdownEngine;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-markdown/index.ts"],"sourcesContent":["import { TdChatMarkdownContentProps, TdMarkdownEngine } from 'tdesign-web-components';\nimport reactify from '../_util/reactify';\n\nexport const MarkdownEngine: typeof TdMarkdownEngine = TdMarkdownEngine;\nexport const ChatMarkdown: React.ForwardRefExoticComponent<\n Omit<TdChatMarkdownContentProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatMarkdownContentProps>('t-chat-md-content');\n\n// eslint-disable-next-line import/first\nimport 'tdesign-web-components/lib/chat-message/content/markdown-content';\n\nexport default ChatMarkdown;\nexport type { TdChatMarkdownContentProps } from 'tdesign-web-components';\n"],"names":["MarkdownEngine","TdMarkdownEngine","ChatMarkdown","reactify"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-markdown/index.ts"],"sourcesContent":["import { TdChatMarkdownContentProps, TdMarkdownEngine } from 'tdesign-web-components';\nimport reactify from '../_util/reactify';\n\nexport const MarkdownEngine: typeof TdMarkdownEngine = TdMarkdownEngine;\nexport const ChatMarkdown: React.ForwardRefExoticComponent<\n Omit<TdChatMarkdownContentProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatMarkdownContentProps>('t-chat-md-content');\n\n// eslint-disable-next-line import/first\nimport 'tdesign-web-components/lib/chat-message/content/markdown-content';\n\nexport default ChatMarkdown;\nexport type { TdChatMarkdownContentProps } from 'tdesign-web-components';\n"],"names":["MarkdownEngine","TdMarkdownEngine","ChatMarkdown","reactify"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,cAA0C,GAAAC,iBAAA;IAC1CC,YAAA,GAETC,SAAqC,mBAAmB;;;;"}
|
package/es/chat-message/index.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.2-alpha.9
|
|
3
|
+
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import 'tdesign-web-components/lib/chat-message';
|
|
8
8
|
import reactify from '../_util/reactify.js';
|
|
9
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
9
10
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
10
|
-
import '@babel/runtime/helpers/
|
|
11
|
+
import '@babel/runtime/helpers/typeof';
|
|
12
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
11
13
|
import '@babel/runtime/helpers/classCallCheck';
|
|
12
14
|
import '@babel/runtime/helpers/createClass';
|
|
13
15
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
14
16
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
15
17
|
import '@babel/runtime/helpers/inherits';
|
|
16
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
17
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
18
|
-
import '@babel/runtime/helpers/typeof';
|
|
19
18
|
import 'react';
|
|
20
|
-
import 'react-dom';
|
|
21
19
|
import 'react-dom/client';
|
|
22
20
|
|
|
23
21
|
var ChatMessage = reactify("t-chat-item");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-message/index.ts"],"sourcesContent":["import { type TdChatMessageProps } from 'tdesign-web-components';\nimport 'tdesign-web-components/lib/chat-message';\nimport reactify from '../_util/reactify';\n\nexport const ChatMessage: React.ForwardRefExoticComponent<\n Omit<TdChatMessageProps & React.PropsWithChildren, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatMessageProps>('t-chat-item');\n\nexport default ChatMessage;\n\nexport type { TdChatMessageProps } from 'tdesign-web-components';\n"],"names":["ChatMessage","reactify"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-message/index.ts"],"sourcesContent":["import { type TdChatMessageProps } from 'tdesign-web-components';\nimport 'tdesign-web-components/lib/chat-message';\nimport reactify from '../_util/reactify';\n\nexport const ChatMessage: React.ForwardRefExoticComponent<\n Omit<TdChatMessageProps & React.PropsWithChildren, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatMessageProps>('t-chat-item');\n\nexport default ChatMessage;\n\nexport type { TdChatMessageProps } from 'tdesign-web-components';\n"],"names":["ChatMessage","reactify"],"mappings":";;;;;;;;;;;;;;;;;;;;IAIaA,WAAA,GAETC,SAA6B,aAAa;;;;"}
|
package/es/chat-sender/index.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.2-alpha.9
|
|
3
|
+
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import 'tdesign-web-components/lib/chat-sender';
|
|
8
8
|
import reactify from '../_util/reactify.js';
|
|
9
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
9
10
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
10
|
-
import '@babel/runtime/helpers/
|
|
11
|
+
import '@babel/runtime/helpers/typeof';
|
|
12
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
11
13
|
import '@babel/runtime/helpers/classCallCheck';
|
|
12
14
|
import '@babel/runtime/helpers/createClass';
|
|
13
15
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
14
16
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
15
17
|
import '@babel/runtime/helpers/inherits';
|
|
16
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
17
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
18
|
-
import '@babel/runtime/helpers/typeof';
|
|
19
18
|
import 'react';
|
|
20
|
-
import 'react-dom';
|
|
21
19
|
import 'react-dom/client';
|
|
22
20
|
|
|
23
21
|
var ChatSender = reactify("t-chat-sender");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-sender/index.ts"],"sourcesContent":["import { TdChatSenderProps } from 'tdesign-web-components';\nimport 'tdesign-web-components/lib/chat-sender';\nimport reactify from '../_util/reactify';\n\nexport const ChatSender: React.ForwardRefExoticComponent<\n Omit<TdChatSenderProps & React.PropsWithChildren, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatSenderProps>('t-chat-sender');\n\nexport default ChatSender;\nexport type * from 'tdesign-web-components/lib/chat-sender/type';\n"],"names":["ChatSender","reactify"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-sender/index.ts"],"sourcesContent":["import { TdChatSenderProps } from 'tdesign-web-components';\nimport 'tdesign-web-components/lib/chat-sender';\nimport reactify from '../_util/reactify';\n\nexport const ChatSender: React.ForwardRefExoticComponent<\n Omit<TdChatSenderProps & React.PropsWithChildren, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatSenderProps>('t-chat-sender');\n\nexport default ChatSender;\nexport type * from 'tdesign-web-components/lib/chat-sender/type';\n"],"names":["ChatSender","reactify"],"mappings":";;;;;;;;;;;;;;;;;;;;IAIaA,UAAA,GAETC,SAA4B,eAAe;;;;"}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.2-alpha.9
|
|
3
|
+
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import 'tdesign-web-components/lib/chat-message/content/thinking-content';
|
|
8
8
|
import reactify from '../_util/reactify.js';
|
|
9
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
9
10
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
10
|
-
import '@babel/runtime/helpers/
|
|
11
|
+
import '@babel/runtime/helpers/typeof';
|
|
12
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
11
13
|
import '@babel/runtime/helpers/classCallCheck';
|
|
12
14
|
import '@babel/runtime/helpers/createClass';
|
|
13
15
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
14
16
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
15
17
|
import '@babel/runtime/helpers/inherits';
|
|
16
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
17
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
18
|
-
import '@babel/runtime/helpers/typeof';
|
|
19
18
|
import 'react';
|
|
20
|
-
import 'react-dom';
|
|
21
19
|
import 'react-dom/client';
|
|
22
20
|
|
|
23
21
|
var ChatThinkContent = reactify("t-chat-thinking-content");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-thinking/index.ts"],"sourcesContent":["import { TdChatThinkContentProps } from 'tdesign-web-components';\nimport 'tdesign-web-components/lib/chat-message/content/thinking-content';\nimport reactify from '../_util/reactify';\n\nconst ChatThinkContent: React.ForwardRefExoticComponent<\n Omit<TdChatThinkContentProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatThinkContentProps>('t-chat-thinking-content');\n\nexport const ChatThinking = ChatThinkContent;\n\nexport default ChatThinking;\n\nexport type { TdChatThinkContentProps } from 'tdesign-web-components';\n"],"names":["ChatThinkContent","reactify","ChatThinking"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chat-thinking/index.ts"],"sourcesContent":["import { TdChatThinkContentProps } from 'tdesign-web-components';\nimport 'tdesign-web-components/lib/chat-message/content/thinking-content';\nimport reactify from '../_util/reactify';\n\nconst ChatThinkContent: React.ForwardRefExoticComponent<\n Omit<TdChatThinkContentProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatThinkContentProps>('t-chat-thinking-content');\n\nexport const ChatThinking = ChatThinkContent;\n\nexport default ChatThinking;\n\nexport type { TdChatThinkContentProps } from 'tdesign-web-components';\n"],"names":["ChatThinkContent","reactify","ChatThinking"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,gBAAA,GAEFC,SAAkC,yBAAyB,CAAA,CAAA;AAExD,IAAMC,YAAe,GAAAF;;;;"}
|
package/es/chatbot/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.2-alpha.9
|
|
3
|
+
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -9,18 +9,16 @@ import 'tdesign-web-components/lib/chat-message/content/reasoning-content';
|
|
|
9
9
|
import 'tdesign-web-components/lib/chat-message/content/search-content';
|
|
10
10
|
import 'tdesign-web-components/lib/chat-message/content/suggestion-content';
|
|
11
11
|
import reactify from '../_util/reactify.js';
|
|
12
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
12
13
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
13
|
-
import '@babel/runtime/helpers/
|
|
14
|
+
import '@babel/runtime/helpers/typeof';
|
|
15
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
14
16
|
import '@babel/runtime/helpers/classCallCheck';
|
|
15
17
|
import '@babel/runtime/helpers/createClass';
|
|
16
18
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
17
19
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
18
20
|
import '@babel/runtime/helpers/inherits';
|
|
19
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
20
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
21
|
-
import '@babel/runtime/helpers/typeof';
|
|
22
21
|
import 'react';
|
|
23
|
-
import 'react-dom';
|
|
24
22
|
import 'react-dom/client';
|
|
25
23
|
|
|
26
24
|
var ChatBot = reactify("t-chatbot");
|
package/es/chatbot/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chatbot/index.ts"],"sourcesContent":["import 'tdesign-web-components/lib/chatbot';\nimport 'tdesign-web-components/lib/chat-message/content/reasoning-content';\nimport 'tdesign-web-components/lib/chat-message/content/search-content';\nimport 'tdesign-web-components/lib/chat-message/content/suggestion-content';\nimport type {\n TdChatbotApi,\n TdChatListApi,\n TdChatListProps,\n TdChatProps,\n TdChatSearchContentProps,\n TdChatSuggestionContentProps,\n} from 'tdesign-web-components';\nimport reactify from '../_util/reactify';\n\nconst ChatBot: React.ForwardRefExoticComponent<\n Omit<TdChatProps & Partial<TdChatbotApi>, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatProps>('t-chatbot');\n\nconst ChatSearchContent: React.ForwardRefExoticComponent<\n Omit<TdChatSearchContentProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatSearchContentProps>('t-chat-search-content');\n\nconst ChatSuggestionContent: React.ForwardRefExoticComponent<\n Omit<TdChatSuggestionContentProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatSuggestionContentProps>('t-chat-suggestion-content');\n\nconst ChatList: React.ForwardRefExoticComponent<\n Omit<TdChatListProps & Partial<TdChatListApi>, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatListProps>('t-chat-list');\n\n// 导出组件\nexport { ChatBot, ChatSearchContent, ChatSuggestionContent, ChatList };\n\n// 导出类型和工具\nexport type * from 'tdesign-web-components/lib/chatbot/type';\n"],"names":["ChatBot","reactify","ChatSearchContent","ChatSuggestionContent","ChatList"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../pro-components/chat/chatbot/index.ts"],"sourcesContent":["import 'tdesign-web-components/lib/chatbot';\nimport 'tdesign-web-components/lib/chat-message/content/reasoning-content';\nimport 'tdesign-web-components/lib/chat-message/content/search-content';\nimport 'tdesign-web-components/lib/chat-message/content/suggestion-content';\nimport type {\n TdChatbotApi,\n TdChatListApi,\n TdChatListProps,\n TdChatProps,\n TdChatSearchContentProps,\n TdChatSuggestionContentProps,\n} from 'tdesign-web-components';\nimport reactify from '../_util/reactify';\n\nconst ChatBot: React.ForwardRefExoticComponent<\n Omit<TdChatProps & Partial<TdChatbotApi>, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatProps>('t-chatbot');\n\nconst ChatSearchContent: React.ForwardRefExoticComponent<\n Omit<TdChatSearchContentProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatSearchContentProps>('t-chat-search-content');\n\nconst ChatSuggestionContent: React.ForwardRefExoticComponent<\n Omit<TdChatSuggestionContentProps, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatSuggestionContentProps>('t-chat-suggestion-content');\n\nconst ChatList: React.ForwardRefExoticComponent<\n Omit<TdChatListProps & Partial<TdChatListApi>, 'ref'> & React.RefAttributes<HTMLElement | undefined>\n> = reactify<TdChatListProps>('t-chat-list');\n\n// 导出组件\nexport { ChatBot, ChatSearchContent, ChatSuggestionContent, ChatList };\n\n// 导出类型和工具\nexport type * from 'tdesign-web-components/lib/chatbot/type';\n"],"names":["ChatBot","reactify","ChatSearchContent","ChatSuggestionContent","ChatList"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcA,IAAMA,OAAA,GAEFC,SAAsB,WAAW,EAAA;AAErC,IAAMC,iBAAA,GAEFD,SAAmC,uBAAuB,EAAA;AAE9D,IAAME,qBAAA,GAEFF,SAAuC,2BAA2B,EAAA;AAEtE,IAAMG,QAAA,GAEFH,SAA0B,aAAa;;;;"}
|
package/es/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './chatbot';
|
|
2
2
|
export * from './chat-engine';
|
|
3
3
|
export * from './chat-actionbar';
|
|
4
|
-
export * from './
|
|
4
|
+
export * from './attachments';
|
|
5
5
|
export * from './chat-filecard';
|
|
6
6
|
export * from './chat-loading';
|
|
7
7
|
export * from './chat-markdown';
|
package/es/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.2-alpha.9
|
|
3
|
+
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export { ChatBot, ChatList, ChatSearchContent, ChatSuggestionContent } from './chatbot/index.js';
|
|
8
8
|
import './chat-engine/index.js';
|
|
9
9
|
export { ChatActionBar } from './chat-actionbar/index.js';
|
|
10
|
-
export { Attachments } from './
|
|
10
|
+
export { Attachments } from './attachments/index.js';
|
|
11
11
|
export { Filecard } from './chat-filecard/index.js';
|
|
12
12
|
export { ChatLoading } from './chat-loading/index.js';
|
|
13
13
|
export { ChatMarkdown, MarkdownEngine } from './chat-markdown/index.js';
|
|
@@ -17,30 +17,56 @@ export { ChatThinking } from './chat-thinking/index.js';
|
|
|
17
17
|
export { useChat } from './chat-engine/hooks/useChat.js';
|
|
18
18
|
export { useAgentToolcall } from './chat-engine/hooks/useAgentToolcall.js';
|
|
19
19
|
export { AgentStateContext, useAgentState, useAgentStateContext, useAgentStateDataByKey } from './chat-engine/hooks/useAgentState.js';
|
|
20
|
+
export { useAgentActivity } from './chat-engine/hooks/useAgentActivity.js';
|
|
20
21
|
export { isNonInteractive, isNonInteractiveConfig } from './chat-engine/components/toolcall/types.js';
|
|
21
22
|
export { agentToolcallRegistry } from './chat-engine/components/toolcall/registry.js';
|
|
22
23
|
export { ToolCallRenderer, withAgentStateToolcall, withAgentStateToolcall1 } from './chat-engine/components/toolcall/render.js';
|
|
24
|
+
export { activityRegistry } from './chat-engine/components/activity/registry.js';
|
|
25
|
+
export { ActivityRenderer } from './chat-engine/components/activity/render.js';
|
|
23
26
|
export { AgentStateProvider } from './chat-engine/components/provider/agent-state.js';
|
|
24
|
-
export
|
|
27
|
+
export { applyJsonPatch, findTargetElement, getMessageContentForCopy, isAIMessage, isActivityContent, isAttachmentContent, isImageContent, isMarkdownContent, isReasoningContent, isSearchContent, isSuggestionContent, isTextContent, isThinkingContent, isToolCallContent, isUserMessage, safeParseJSON } from './chat-engine/core/utils/index.js';
|
|
28
|
+
export { StateManagerImpl, stateManager } from './chat-engine/core/adapters/agui/state-manager.js';
|
|
29
|
+
export { AGUIEventType, ActivityDeltaEventSchema, ActivitySnapshotEventSchema, CustomEventSchema, EventSchemas, MessagesSnapshotEventSchema, RawEventSchema, RunErrorEventSchema, RunFinishedEventSchema, RunStartedEventSchema, StateDeltaEventSchema, StateSnapshotEventSchema, StepFinishedEventSchema, StepStartedEventSchema, TextMessageChunkEventSchema, TextMessageContentEventSchema, TextMessageEndEventSchema, TextMessageStartEventSchema, ThinkingEndEventSchema, ThinkingStartEventSchema, ThinkingTextMessageContentEventSchema, ThinkingTextMessageEndEventSchema, ThinkingTextMessageStartEventSchema, ToolCallArgsEventSchema, ToolCallChunkEventSchema, ToolCallEndEventSchema, ToolCallResultEventSchema, ToolCallStartEventSchema, isActivityEvent, isStateEvent, isTextMessageEvent, isThinkingEvent, isToolCallEvent } from './chat-engine/core/adapters/agui/events.js';
|
|
30
|
+
export { AGUIAdapter } from './chat-engine/core/adapters/agui/index.js';
|
|
25
31
|
import 'tdesign-web-components/lib/chatbot';
|
|
26
32
|
import 'tdesign-web-components/lib/chat-message/content/reasoning-content';
|
|
27
33
|
import 'tdesign-web-components/lib/chat-message/content/search-content';
|
|
28
34
|
import 'tdesign-web-components/lib/chat-message/content/suggestion-content';
|
|
29
35
|
import './_util/reactify.js';
|
|
36
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
30
37
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
31
|
-
import '@babel/runtime/helpers/
|
|
38
|
+
import '@babel/runtime/helpers/typeof';
|
|
39
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
32
40
|
import '@babel/runtime/helpers/classCallCheck';
|
|
33
41
|
import '@babel/runtime/helpers/createClass';
|
|
34
42
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
35
43
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
36
44
|
import '@babel/runtime/helpers/inherits';
|
|
37
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
38
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
39
|
-
import '@babel/runtime/helpers/typeof';
|
|
40
45
|
import 'react';
|
|
41
|
-
import 'react-dom';
|
|
42
46
|
import 'react-dom/client';
|
|
47
|
+
import './chat-engine/components/index.js';
|
|
43
48
|
import './chat-engine/components/toolcall/index.js';
|
|
49
|
+
import './chat-engine/components/activity/index.js';
|
|
50
|
+
import './chat-engine/components/activity/types.js';
|
|
51
|
+
import './chat-engine/core/index.js';
|
|
52
|
+
import '@babel/runtime/helpers/asyncToGenerator';
|
|
53
|
+
import '@babel/runtime/regenerator';
|
|
54
|
+
import './chat-engine/core/store/message.js';
|
|
55
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
56
|
+
import '@babel/runtime/helpers/get';
|
|
57
|
+
import './chat-engine/core/store/reactiveState.js';
|
|
58
|
+
import '@babel/runtime/helpers/wrapNativeSuper';
|
|
59
|
+
import './chat-engine/core/processor/index.js';
|
|
60
|
+
import './chat-engine/core/server/index.js';
|
|
61
|
+
import './chat-engine/core/server/llm-service.js';
|
|
62
|
+
import './chat-engine/core/utils/logger.js';
|
|
63
|
+
import './chat-engine/core/server/batch-client.js';
|
|
64
|
+
import './chat-engine/core/utils/eventEmitter.js';
|
|
65
|
+
import './chat-engine/core/server/errors.js';
|
|
66
|
+
import './chat-engine/core/server/sse-client.js';
|
|
67
|
+
import './chat-engine/core/server/connection-manager.js';
|
|
68
|
+
import './chat-engine/core/server/sse-parser.js';
|
|
69
|
+
import './chat-engine/core/server/types.js';
|
|
44
70
|
import 'tdesign-web-components/lib/chat-action';
|
|
45
71
|
import 'tdesign-web-components/lib/attachments';
|
|
46
72
|
import 'tdesign-web-components/lib/filecard';
|
|
@@ -50,6 +76,9 @@ import 'tdesign-web-components/lib/chat-message/content/markdown-content';
|
|
|
50
76
|
import 'tdesign-web-components/lib/chat-message';
|
|
51
77
|
import 'tdesign-web-components/lib/chat-sender';
|
|
52
78
|
import 'tdesign-web-components/lib/chat-message/content/thinking-content';
|
|
53
|
-
import '
|
|
54
|
-
import '
|
|
79
|
+
import 'tdesign-web-components/lib/chat-engine';
|
|
80
|
+
import 'zod';
|
|
81
|
+
import './chat-engine/core/adapters/agui/types.js';
|
|
82
|
+
import './chat-engine/core/adapters/agui/event-mapper.js';
|
|
83
|
+
import './chat-engine/core/adapters/agui/utils.js';
|
|
55
84
|
//# sourceMappingURL=index.js.map
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/es/style/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tdesign-react/chat",
|
|
3
|
-
"version": "1.0.2-alpha.
|
|
3
|
+
"version": "1.0.2-alpha.10",
|
|
4
4
|
"title": "@tdesign-react/chat",
|
|
5
5
|
"description": "TDesign Pro Component for AIGC",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -50,15 +50,16 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@babel/runtime": "~7.26.7",
|
|
53
|
-
"tdesign-web-components": "1.2.
|
|
53
|
+
"tdesign-web-components": "1.2.11-alpha.9",
|
|
54
54
|
"classnames": "~2.5.1",
|
|
55
55
|
"lodash-es": "^4.17.21",
|
|
56
|
-
"zod": "^3.24.2"
|
|
56
|
+
"zod": "^3.24.2",
|
|
57
|
+
"cherry-markdown": "^0.10.0"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"cors": "^2.8.5",
|
|
60
61
|
"tdesign-icons-react": "0.5.0",
|
|
61
|
-
"tdesign-react": "
|
|
62
|
+
"tdesign-react": "workspace:^",
|
|
62
63
|
"tvision-charts-react": "^3.3.12",
|
|
63
64
|
"express": "^4.17.3"
|
|
64
65
|
}
|