@tdesign-react/chat 1.0.2-alpha.6 → 1.0.2-alpha.8
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 +2 -1
- package/es/_util/reactify.js +231 -81
- package/es/_util/reactify.js.map +1 -1
- package/es/_util/useDynamicStyle.js +1 -1
- package/es/attachments/index.js +6 -4
- package/es/attachments/index.js.map +1 -1
- package/es/chat-actionbar/index.js +6 -4
- package/es/chat-actionbar/index.js.map +1 -1
- package/es/chat-attachments/index.js +1 -3
- package/es/chat-attachments/index.js.map +1 -1
- package/es/chat-engine/components/provider/agent-state.js +2 -6
- package/es/chat-engine/components/provider/agent-state.js.map +1 -1
- package/es/chat-engine/components/toolcall/index.js +2 -7
- package/es/chat-engine/components/toolcall/index.js.map +1 -1
- package/es/chat-engine/components/toolcall/registry.js +1 -1
- package/es/chat-engine/components/toolcall/render.d.ts +1 -1
- package/es/chat-engine/components/toolcall/render.js +24 -68
- package/es/chat-engine/components/toolcall/render.js.map +1 -1
- package/es/chat-engine/components/toolcall/types.js +1 -1
- package/es/chat-engine/hooks/useAgentState.js +2 -6
- package/es/chat-engine/hooks/useAgentState.js.map +1 -1
- package/es/chat-engine/hooks/useAgentToolcall.js +1 -1
- package/es/chat-engine/hooks/useChat.d.ts +2 -2
- package/es/chat-engine/hooks/useChat.js +3 -37
- package/es/chat-engine/hooks/useChat.js.map +1 -1
- package/es/chat-engine/index.d.ts +1 -3
- package/es/chat-engine/index.js +3 -36
- package/es/chat-engine/index.js.map +1 -1
- package/es/chat-filecard/index.js +6 -4
- package/es/chat-filecard/index.js.map +1 -1
- package/es/chat-loading/index.js +6 -4
- package/es/chat-loading/index.js.map +1 -1
- package/es/chat-markdown/index.js +6 -4
- package/es/chat-markdown/index.js.map +1 -1
- package/es/chat-message/index.js +6 -4
- package/es/chat-message/index.js.map +1 -1
- package/es/chat-sender/index.js +6 -4
- package/es/chat-sender/index.js.map +1 -1
- package/es/chat-thinking/index.js +6 -4
- package/es/chat-thinking/index.js.map +1 -1
- package/es/chatbot/components/provider/agent-state.d.ts +5 -0
- package/es/chatbot/components/provider/agent-state.js +28 -0
- package/es/chatbot/components/provider/agent-state.js.map +1 -0
- package/es/{chat-engine/components/activity → chatbot/components/toolcall}/index.d.ts +0 -1
- package/es/chatbot/components/toolcall/index.js +19 -0
- package/es/{chat-engine/components/activity → chatbot/components/toolcall}/index.js.map +1 -1
- package/es/chatbot/components/toolcall/registry.d.ts +35 -0
- package/es/{chat-engine/components/activity → chatbot/components/toolcall}/registry.js +22 -32
- package/es/chatbot/components/toolcall/registry.js.map +1 -0
- package/es/chatbot/components/toolcall/render.d.ts +13 -0
- package/es/chatbot/components/toolcall/render.js +207 -0
- package/es/chatbot/components/toolcall/render.js.map +1 -0
- package/es/chatbot/components/toolcall/types.d.ts +57 -0
- package/es/chatbot/components/toolcall/types.js +15 -0
- package/es/chatbot/components/toolcall/types.js.map +1 -0
- package/es/chatbot/hooks/useAgentState.d.ts +40 -0
- package/es/chatbot/hooks/useAgentState.js +76 -0
- package/es/chatbot/hooks/useAgentState.js.map +1 -0
- package/es/chatbot/hooks/useAgentToolcall.d.ts +28 -0
- package/es/chatbot/hooks/useAgentToolcall.js +78 -0
- package/es/chatbot/hooks/useAgentToolcall.js.map +1 -0
- package/es/chatbot/hooks/useChat.d.ts +11 -0
- package/es/chatbot/hooks/useChat.js +66 -0
- package/es/chatbot/hooks/useChat.js.map +1 -0
- package/es/chatbot/index.js +6 -4
- package/es/chatbot/index.js.map +1 -1
- package/es/index.js +9 -36
- package/es/index.js.map +1 -1
- package/es/style/index.js +1 -1
- package/package.json +2 -2
- package/es/chat-actionbar/_example-js/base.d.ts +0 -2
- package/es/chat-actionbar/_example-js/custom.d.ts +0 -2
- package/es/chat-actionbar/_example-js/style.d.ts +0 -2
- package/es/chat-attachments/_example-js/base.d.ts +0 -2
- package/es/chat-attachments/_example-js/scroll-x.d.ts +0 -2
- package/es/chat-attachments/_example-js/scroll-y.d.ts +0 -2
- package/es/chat-engine/_example-js/agui-basic.d.ts +0 -10
- package/es/chat-engine/_example-js/agui-comprehensive.d.ts +0 -2
- package/es/chat-engine/_example-js/agui-test.d.ts +0 -11
- package/es/chat-engine/_example-js/agui-toolcall.d.ts +0 -5
- package/es/chat-engine/_example-js/agui-videoclip.d.ts +0 -8
- package/es/chat-engine/_example-js/agui.d.ts +0 -1
- package/es/chat-engine/_example-js/basic.d.ts +0 -9
- package/es/chat-engine/_example-js/components/HotelCard.d.ts +0 -3
- package/es/chat-engine/_example-js/components/HumanInputForm.d.ts +0 -6
- package/es/chat-engine/_example-js/components/HumanInputResult.d.ts +0 -3
- package/es/chat-engine/_example-js/components/ItineraryCard.d.ts +0 -3
- package/es/chat-engine/_example-js/components/PlanningStatePanel.d.ts +0 -4
- package/es/chat-engine/_example-js/components/Toolcall.d.ts +0 -4
- package/es/chat-engine/_example-js/components/WeatherCard.d.ts +0 -3
- package/es/chat-engine/_example-js/components/login.d.ts +0 -1
- package/es/chat-engine/_example-js/comprehensive.d.ts +0 -12
- package/es/chat-engine/_example-js/custom-content.d.ts +0 -1
- package/es/chat-engine/_example-js/hookComponent.d.ts +0 -1
- package/es/chat-engine/_example-js/initial-messages.d.ts +0 -9
- package/es/chat-engine/_example-js/instance-methods.d.ts +0 -13
- package/es/chat-engine/_example-js/travel-actions.d.ts +0 -91
- package/es/chat-engine/_example-js/travelToolcall.d.ts +0 -1
- package/es/chat-engine/components/activity/index.js +0 -18
- package/es/chat-engine/components/activity/registry.d.ts +0 -44
- package/es/chat-engine/components/activity/registry.js.map +0 -1
- package/es/chat-engine/components/activity/render.d.ts +0 -11
- package/es/chat-engine/components/activity/render.js +0 -107
- package/es/chat-engine/components/activity/render.js.map +0 -1
- package/es/chat-engine/components/activity/types.d.ts +0 -32
- package/es/chat-engine/components/activity/types.js +0 -7
- package/es/chat-engine/components/activity/types.js.map +0 -1
- package/es/chat-engine/components/index.d.ts +0 -3
- package/es/chat-engine/components/index.js +0 -30
- package/es/chat-engine/components/index.js.map +0 -1
- package/es/chat-engine/core/adapters/agui/event-mapper.d.ts +0 -109
- package/es/chat-engine/core/adapters/agui/event-mapper.js +0 -370
- package/es/chat-engine/core/adapters/agui/event-mapper.js.map +0 -1
- package/es/chat-engine/core/adapters/agui/events.d.ts +0 -1550
- package/es/chat-engine/core/adapters/agui/events.js +0 -199
- package/es/chat-engine/core/adapters/agui/events.js.map +0 -1
- package/es/chat-engine/core/adapters/agui/index.d.ts +0 -75
- package/es/chat-engine/core/adapters/agui/index.js +0 -175
- package/es/chat-engine/core/adapters/agui/index.js.map +0 -1
- package/es/chat-engine/core/adapters/agui/state-manager.d.ts +0 -99
- package/es/chat-engine/core/adapters/agui/state-manager.js +0 -168
- package/es/chat-engine/core/adapters/agui/state-manager.js.map +0 -1
- package/es/chat-engine/core/adapters/agui/types.d.ts +0 -817
- package/es/chat-engine/core/adapters/agui/types.js +0 -95
- package/es/chat-engine/core/adapters/agui/types.js.map +0 -1
- package/es/chat-engine/core/adapters/agui/utils.d.ts +0 -197
- package/es/chat-engine/core/adapters/agui/utils.js +0 -311
- package/es/chat-engine/core/adapters/agui/utils.js.map +0 -1
- package/es/chat-engine/core/index.d.ts +0 -132
- package/es/chat-engine/core/index.js +0 -597
- package/es/chat-engine/core/index.js.map +0 -1
- package/es/chat-engine/core/processor/index.d.ts +0 -20
- package/es/chat-engine/core/processor/index.js +0 -146
- package/es/chat-engine/core/processor/index.js.map +0 -1
- package/es/chat-engine/core/server/batch-client.d.ts +0 -20
- package/es/chat-engine/core/server/batch-client.js +0 -114
- package/es/chat-engine/core/server/batch-client.js.map +0 -1
- package/es/chat-engine/core/server/connection-manager.d.ts +0 -39
- package/es/chat-engine/core/server/connection-manager.js +0 -84
- package/es/chat-engine/core/server/connection-manager.js.map +0 -1
- package/es/chat-engine/core/server/errors.d.ts +0 -22
- package/es/chat-engine/core/server/errors.js +0 -80
- package/es/chat-engine/core/server/errors.js.map +0 -1
- package/es/chat-engine/core/server/index.d.ts +0 -11
- package/es/chat-engine/core/server/index.js +0 -26
- package/es/chat-engine/core/server/index.js.map +0 -1
- package/es/chat-engine/core/server/llm-service.d.ts +0 -44
- package/es/chat-engine/core/server/llm-service.js +0 -198
- package/es/chat-engine/core/server/llm-service.js.map +0 -1
- package/es/chat-engine/core/server/sse-client.d.ts +0 -77
- package/es/chat-engine/core/server/sse-client.js +0 -362
- package/es/chat-engine/core/server/sse-client.js.map +0 -1
- package/es/chat-engine/core/server/sse-parser.d.ts +0 -49
- package/es/chat-engine/core/server/sse-parser.js +0 -116
- package/es/chat-engine/core/server/sse-parser.js.map +0 -1
- package/es/chat-engine/core/server/types.d.ts +0 -54
- package/es/chat-engine/core/server/types.js +0 -28
- package/es/chat-engine/core/server/types.js.map +0 -1
- package/es/chat-engine/core/store/message.d.ts +0 -27
- package/es/chat-engine/core/store/message.js +0 -263
- package/es/chat-engine/core/store/message.js.map +0 -1
- package/es/chat-engine/core/store/model.d.ts +0 -8
- package/es/chat-engine/core/store/model.js +0 -65
- package/es/chat-engine/core/store/model.js.map +0 -1
- package/es/chat-engine/core/store/reactiveState.d.ts +0 -52
- package/es/chat-engine/core/store/reactiveState.js +0 -1359
- package/es/chat-engine/core/store/reactiveState.js.map +0 -1
- package/es/chat-engine/core/type.d.ts +0 -255
- package/es/chat-engine/core/type.js +0 -7
- package/es/chat-engine/core/type.js.map +0 -1
- package/es/chat-engine/core/utils/eventEmitter.d.ts +0 -10
- package/es/chat-engine/core/utils/eventEmitter.js +0 -67
- package/es/chat-engine/core/utils/eventEmitter.js.map +0 -1
- package/es/chat-engine/core/utils/index.d.ts +0 -33
- package/es/chat-engine/core/utils/index.js +0 -999
- package/es/chat-engine/core/utils/index.js.map +0 -1
- package/es/chat-engine/core/utils/logger.d.ts +0 -30
- package/es/chat-engine/core/utils/logger.js +0 -87
- package/es/chat-engine/core/utils/logger.js.map +0 -1
- package/es/chat-engine/hooks/index.d.ts +0 -4
- package/es/chat-engine/hooks/index.js +0 -50
- package/es/chat-engine/hooks/index.js.map +0 -1
- package/es/chat-engine/hooks/useAgentActivity.d.ts +0 -16
- package/es/chat-engine/hooks/useAgentActivity.js +0 -73
- package/es/chat-engine/hooks/useAgentActivity.js.map +0 -1
- package/es/chat-filecard/_example-js/base.d.ts +0 -1
- package/es/chat-loading/_example-js/base.d.ts +0 -2
- package/es/chat-loading/_example-js/text.d.ts +0 -2
- package/es/chat-markdown/_example-js/base.d.ts +0 -1
- package/es/chat-markdown/_example-js/custom.d.ts +0 -2
- package/es/chat-markdown/_example-js/event.d.ts +0 -1
- package/es/chat-markdown/_example-js/footnote.d.ts +0 -2
- package/es/chat-markdown/_example-js/plugin.d.ts +0 -2
- package/es/chat-markdown/_example-js/theme.d.ts +0 -2
- package/es/chat-message/_example-js/action.d.ts +0 -1
- package/es/chat-message/_example-js/base.d.ts +0 -1
- package/es/chat-message/_example-js/configure.d.ts +0 -1
- package/es/chat-message/_example-js/content.d.ts +0 -1
- package/es/chat-message/_example-js/custom.d.ts +0 -1
- package/es/chat-message/_example-js/handle-actions.d.ts +0 -7
- package/es/chat-message/_example-js/status.d.ts +0 -1
- package/es/chat-message/_example-js/think.d.ts +0 -1
- package/es/chat-sender/_example-js/attachment.d.ts +0 -2
- package/es/chat-sender/_example-js/base.d.ts +0 -2
- package/es/chat-sender/_example-js/custom.d.ts +0 -2
- package/es/chat-thinking/_example-js/base.d.ts +0 -1
- package/es/chat-thinking/_example-js/style.d.ts +0 -1
- package/es/chatbot/_example-js/agent.d.ts +0 -1
- package/es/chatbot/_example-js/agui.d.ts +0 -13
- package/es/chatbot/_example-js/backup/travel.d.ts +0 -1
- package/es/chatbot/_example-js/basic.d.ts +0 -1
- package/es/chatbot/_example-js/code.d.ts +0 -1
- package/es/chatbot/_example-js/components/ItineraryCard.d.ts +0 -3
- package/es/chatbot/_example-js/components/login.d.ts +0 -1
- package/es/chatbot/_example-js/comprehensive.d.ts +0 -1
- package/es/chatbot/_example-js/custom-content.d.ts +0 -1
- package/es/chatbot/_example-js/custom-merge.d.ts +0 -1
- package/es/chatbot/_example-js/custom.d.ts +0 -1
- package/es/chatbot/_example-js/docs.d.ts +0 -1
- package/es/chatbot/_example-js/image.d.ts +0 -1
- package/es/chatbot/_example-js/initial-messages.d.ts +0 -9
- package/es/chatbot/_example-js/instance-methods.d.ts +0 -14
- package/es/chatbot/_example-js/nostream.d.ts +0 -1
- package/es/chatbot/_example-js/quick-start.d.ts +0 -9
- package/es/chatbot/_example-js/research.d.ts +0 -1
- package/es/chatbot/_example-js/role-message-config.d.ts +0 -22
- package/es/chatbot/_example-js/sender-config.d.ts +0 -20
- package/es/chatbot/_example-js/service-config.d.ts +0 -17
- package/es/chatbot/_example-js/simple.d.ts +0 -1
- package/es/chatbot/_example-js/utils/messageRenderer.d.ts +0 -5
package/es/chat-engine/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.2-alpha.
|
|
2
|
+
* tdesign v1.0.2-alpha.0
|
|
3
3
|
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -7,51 +7,18 @@
|
|
|
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
|
-
export { useAgentActivity } from './hooks/useAgentActivity.js';
|
|
11
10
|
import './components/toolcall/index.js';
|
|
12
|
-
import './components/activity/index.js';
|
|
13
11
|
export { AgentStateProvider } from './components/provider/agent-state.js';
|
|
14
|
-
|
|
12
|
+
export * from 'tdesign-web-components/lib/chat-engine';
|
|
15
13
|
export { isNonInteractive, isNonInteractiveConfig } from './components/toolcall/types.js';
|
|
16
14
|
export { agentToolcallRegistry } from './components/toolcall/registry.js';
|
|
17
15
|
export { ToolCallRenderer, withAgentStateToolcall, withAgentStateToolcall1 } from './components/toolcall/render.js';
|
|
18
|
-
export { activityRegistry } from './components/activity/registry.js';
|
|
19
|
-
export { ActivityRenderer } from './components/activity/render.js';
|
|
20
|
-
export { applyJsonPatch, findTargetElement, getMessageContentForCopy, isAIMessage, isActivityContent, isAttachmentContent, isImageContent, isMarkdownContent, isReasoningContent, isSearchContent, isSuggestionContent, isTextContent, isThinkingContent, isToolCallContent, isUserMessage, safeParseJSON } from './core/utils/index.js';
|
|
21
|
-
export { StateManagerImpl, stateManager } from './core/adapters/agui/state-manager.js';
|
|
22
|
-
export { AGUIAdapter } from './core/adapters/agui/index.js';
|
|
23
16
|
import '@babel/runtime/helpers/slicedToArray';
|
|
24
17
|
import 'react';
|
|
25
18
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
26
19
|
import '@babel/runtime/helpers/defineProperty';
|
|
27
|
-
import './components/activity/types.js';
|
|
28
|
-
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
29
|
-
import '@babel/runtime/helpers/asyncToGenerator';
|
|
30
20
|
import '@babel/runtime/helpers/classCallCheck';
|
|
31
21
|
import '@babel/runtime/helpers/createClass';
|
|
22
|
+
import '@babel/runtime/helpers/asyncToGenerator';
|
|
32
23
|
import '@babel/runtime/regenerator';
|
|
33
|
-
import './core/store/message.js';
|
|
34
|
-
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
35
|
-
import '@babel/runtime/helpers/getPrototypeOf';
|
|
36
|
-
import '@babel/runtime/helpers/get';
|
|
37
|
-
import '@babel/runtime/helpers/inherits';
|
|
38
|
-
import './core/store/reactiveState.js';
|
|
39
|
-
import '@babel/runtime/helpers/wrapNativeSuper';
|
|
40
|
-
import '@babel/runtime/helpers/typeof';
|
|
41
|
-
import './core/processor/index.js';
|
|
42
|
-
import './core/server/index.js';
|
|
43
|
-
import './core/server/llm-service.js';
|
|
44
|
-
import './core/utils/logger.js';
|
|
45
|
-
import './core/server/batch-client.js';
|
|
46
|
-
import './core/utils/eventEmitter.js';
|
|
47
|
-
import './core/server/errors.js';
|
|
48
|
-
import './core/server/sse-client.js';
|
|
49
|
-
import './core/server/connection-manager.js';
|
|
50
|
-
import './core/server/sse-parser.js';
|
|
51
|
-
import './core/server/types.js';
|
|
52
|
-
import './core/adapters/agui/event-mapper.js';
|
|
53
|
-
import './core/adapters/agui/events.js';
|
|
54
|
-
import 'zod';
|
|
55
|
-
import './core/adapters/agui/types.js';
|
|
56
|
-
import './core/adapters/agui/utils.js';
|
|
57
24
|
//# 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,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.2-alpha.
|
|
2
|
+
* tdesign v1.0.2-alpha.0
|
|
3
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';
|
|
10
9
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
11
|
-
import '@babel/runtime/helpers/
|
|
12
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
10
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
13
11
|
import '@babel/runtime/helpers/classCallCheck';
|
|
14
12
|
import '@babel/runtime/helpers/createClass';
|
|
15
13
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
16
14
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
17
15
|
import '@babel/runtime/helpers/inherits';
|
|
16
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
17
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
18
|
+
import '@babel/runtime/helpers/typeof';
|
|
18
19
|
import 'react';
|
|
20
|
+
import 'react-dom';
|
|
19
21
|
import 'react-dom/client';
|
|
20
22
|
|
|
21
23
|
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,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.2-alpha.
|
|
2
|
+
* tdesign v1.0.2-alpha.0
|
|
3
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';
|
|
10
9
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
11
|
-
import '@babel/runtime/helpers/
|
|
12
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
10
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
13
11
|
import '@babel/runtime/helpers/classCallCheck';
|
|
14
12
|
import '@babel/runtime/helpers/createClass';
|
|
15
13
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
16
14
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
17
15
|
import '@babel/runtime/helpers/inherits';
|
|
16
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
17
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
18
|
+
import '@babel/runtime/helpers/typeof';
|
|
18
19
|
import 'react';
|
|
20
|
+
import 'react-dom';
|
|
19
21
|
import 'react-dom/client';
|
|
20
22
|
|
|
21
23
|
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,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.2-alpha.
|
|
2
|
+
* tdesign v1.0.2-alpha.0
|
|
3
3
|
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -7,16 +7,18 @@
|
|
|
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';
|
|
11
10
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
12
|
-
import '@babel/runtime/helpers/
|
|
13
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
11
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
14
12
|
import '@babel/runtime/helpers/classCallCheck';
|
|
15
13
|
import '@babel/runtime/helpers/createClass';
|
|
16
14
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
17
15
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
18
16
|
import '@babel/runtime/helpers/inherits';
|
|
17
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
18
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
19
|
+
import '@babel/runtime/helpers/typeof';
|
|
19
20
|
import 'react';
|
|
21
|
+
import 'react-dom';
|
|
20
22
|
import 'react-dom/client';
|
|
21
23
|
|
|
22
24
|
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,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.2-alpha.
|
|
2
|
+
* tdesign v1.0.2-alpha.0
|
|
3
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';
|
|
10
9
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
11
|
-
import '@babel/runtime/helpers/
|
|
12
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
10
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
13
11
|
import '@babel/runtime/helpers/classCallCheck';
|
|
14
12
|
import '@babel/runtime/helpers/createClass';
|
|
15
13
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
16
14
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
17
15
|
import '@babel/runtime/helpers/inherits';
|
|
16
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
17
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
18
|
+
import '@babel/runtime/helpers/typeof';
|
|
18
19
|
import 'react';
|
|
20
|
+
import 'react-dom';
|
|
19
21
|
import 'react-dom/client';
|
|
20
22
|
|
|
21
23
|
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,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.2-alpha.
|
|
2
|
+
* tdesign v1.0.2-alpha.0
|
|
3
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';
|
|
10
9
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
11
|
-
import '@babel/runtime/helpers/
|
|
12
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
10
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
13
11
|
import '@babel/runtime/helpers/classCallCheck';
|
|
14
12
|
import '@babel/runtime/helpers/createClass';
|
|
15
13
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
16
14
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
17
15
|
import '@babel/runtime/helpers/inherits';
|
|
16
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
17
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
18
|
+
import '@babel/runtime/helpers/typeof';
|
|
18
19
|
import 'react';
|
|
20
|
+
import 'react-dom';
|
|
19
21
|
import 'react-dom/client';
|
|
20
22
|
|
|
21
23
|
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,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.2-alpha.
|
|
2
|
+
* tdesign v1.0.2-alpha.0
|
|
3
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';
|
|
10
9
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
11
|
-
import '@babel/runtime/helpers/
|
|
12
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
10
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
13
11
|
import '@babel/runtime/helpers/classCallCheck';
|
|
14
12
|
import '@babel/runtime/helpers/createClass';
|
|
15
13
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
16
14
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
17
15
|
import '@babel/runtime/helpers/inherits';
|
|
16
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
17
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
18
|
+
import '@babel/runtime/helpers/typeof';
|
|
18
19
|
import 'react';
|
|
20
|
+
import 'react-dom';
|
|
19
21
|
import 'react-dom/client';
|
|
20
22
|
|
|
21
23
|
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;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StateActionOptions } from '../../hooks/useAgentState';
|
|
3
|
+
export declare const AgentStateProvider: ({ children, initialState, subscribeKey }: StateActionOptions & {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tdesign v1.0.0-beta.4
|
|
3
|
+
* (c) 2025 tdesign
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { useAgentState, AgentStateContext } from '../../hooks/useAgentState.js';
|
|
9
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
10
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
11
|
+
import 'tdesign-web-components/lib/chat-engine';
|
|
12
|
+
|
|
13
|
+
var AgentStateProvider = function AgentStateProvider(_ref) {
|
|
14
|
+
var children = _ref.children,
|
|
15
|
+
_ref$initialState = _ref.initialState,
|
|
16
|
+
initialState = _ref$initialState === void 0 ? {} : _ref$initialState,
|
|
17
|
+
subscribeKey = _ref.subscribeKey;
|
|
18
|
+
var agentStateResult = useAgentState({
|
|
19
|
+
initialState: initialState,
|
|
20
|
+
subscribeKey: subscribeKey
|
|
21
|
+
});
|
|
22
|
+
return /* @__PURE__ */React.createElement(AgentStateContext.Provider, {
|
|
23
|
+
value: agentStateResult
|
|
24
|
+
}, children);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { AgentStateProvider };
|
|
28
|
+
//# sourceMappingURL=agent-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-state.js","sources":["../../../../../pro-components/chat/chatbot/components/provider/agent-state.tsx"],"sourcesContent":["import React from 'react';\nimport { AgentStateContext, type StateActionOptions, useAgentState } from '../../hooks/useAgentState';\n\n// 导出 Provider 组件\nexport const AgentStateProvider = ({ children, initialState = {}, subscribeKey }: StateActionOptions & {\n children: React.ReactNode;\n}) => {\n const agentStateResult = useAgentState({\n initialState,\n subscribeKey,\n });\n\n return (\n <AgentStateContext.Provider value={agentStateResult}>\n {children}\n </AgentStateContext.Provider>\n );\n};\n"],"names":["AgentStateProvider","_ref","children","_ref$initialState","initialState","subscribeKey","agentStateResult","useAgentState","React","createElement","AgentStateContext","Provider","value"],"mappings":";;;;;;;;;;;;IAIaA,kBAAA,GAAqB,SAArBA,kBAAAA,CAAAC,IAAA,EAEP;AAAA,EAAA,IAF+BC,QAAA,GAAAD,IAAA,CAAAC,QAAA;IAAAC,iBAAA,GAAAF,IAAA,CAAUG;AAAAA,IAAAA,8CAAe,EAAC,GAAAD,iBAAA;IAAGE,oBAAAA;EAGhE,IAAMC,mBAAmBC,aAAc,CAAA;AACrCH,IAAAA,YAAA,EAAAA,YAAA;AACAC,IAAAA,YAAA,EAAAA,YAAAA;AACF,GAAC,CAAA,CAAA;EAGC,sBAAAG,KAAA,CAAAC,aAAA,CAACC,kBAAkBC,QAAlB,EAAA;AAA2BC,IAAAA,KAAO,EAAAN,gBAAAA;GAAA,EAChCJ,QACH,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tdesign v1.0.0-beta.4
|
|
3
|
+
* (c) 2025 tdesign
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { isNonInteractive, isNonInteractiveConfig } from './types.js';
|
|
8
|
+
export { agentToolcallRegistry } from './registry.js';
|
|
9
|
+
export { ToolCallRenderer, withAgentStateToolcall, withAgentStateToolcall1 } from './render.js';
|
|
10
|
+
import '@babel/runtime/helpers/classCallCheck';
|
|
11
|
+
import '@babel/runtime/helpers/createClass';
|
|
12
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
13
|
+
import 'react';
|
|
14
|
+
import '@babel/runtime/helpers/asyncToGenerator';
|
|
15
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
16
|
+
import '@babel/runtime/regenerator';
|
|
17
|
+
import '../../hooks/useAgentState.js';
|
|
18
|
+
import 'tdesign-web-components/lib/chat-engine';
|
|
19
|
+
//# 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":";;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AgentToolcallConfig, AgentToolcallRegistry, ToolcallComponentProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 全局 Agent Toolcall 注册表
|
|
5
|
+
*/
|
|
6
|
+
declare class AgentToolcallRegistryManager {
|
|
7
|
+
private registry;
|
|
8
|
+
private renderFunctionCache;
|
|
9
|
+
/**
|
|
10
|
+
* 注册一个 Agent Toolcall
|
|
11
|
+
*/
|
|
12
|
+
register<TArgs extends object = any, TResult = any, TResponse = any>(config: AgentToolcallConfig<TArgs, TResult, TResponse>): void;
|
|
13
|
+
/**
|
|
14
|
+
* 获取指定名称的 Agent Toolcall 配置
|
|
15
|
+
*/
|
|
16
|
+
get(name: string): AgentToolcallConfig | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* 获取或创建缓存的组件渲染函数
|
|
19
|
+
*/
|
|
20
|
+
getRenderFunction(name: string): React.MemoExoticComponent<React.ComponentType<ToolcallComponentProps>> | null;
|
|
21
|
+
/**
|
|
22
|
+
* 获取所有已注册的 Agent Toolcall
|
|
23
|
+
*/
|
|
24
|
+
getAll(): AgentToolcallRegistry;
|
|
25
|
+
/**
|
|
26
|
+
* 取消注册指定的 Agent Toolcall
|
|
27
|
+
*/
|
|
28
|
+
unregister(name: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* 清空所有注册的 Agent Toolcall
|
|
31
|
+
*/
|
|
32
|
+
clear(): void;
|
|
33
|
+
}
|
|
34
|
+
export declare const agentToolcallRegistry: AgentToolcallRegistryManager;
|
|
35
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.
|
|
3
|
-
* (c)
|
|
2
|
+
* tdesign v1.0.0-beta.4
|
|
3
|
+
* (c) 2025 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -11,42 +11,42 @@ import React from 'react';
|
|
|
11
11
|
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
_classCallCheck(this,
|
|
14
|
+
var AgentToolcallRegistryManager = /*#__PURE__*/function () {
|
|
15
|
+
function AgentToolcallRegistryManager() {
|
|
16
|
+
_classCallCheck(this, AgentToolcallRegistryManager);
|
|
17
17
|
_defineProperty(this, "registry", {});
|
|
18
18
|
_defineProperty(this, "renderFunctionCache", /* @__PURE__ */new Map());
|
|
19
19
|
}
|
|
20
|
-
return _createClass(
|
|
20
|
+
return _createClass(AgentToolcallRegistryManager, [{
|
|
21
21
|
key: "register",
|
|
22
22
|
value: function register(config) {
|
|
23
|
-
var existingConfig = this.registry[config.
|
|
23
|
+
var existingConfig = this.registry[config.name];
|
|
24
24
|
if (existingConfig && existingConfig.component !== config.component) {
|
|
25
|
-
this.renderFunctionCache["delete"](config.
|
|
25
|
+
this.renderFunctionCache["delete"](config.name);
|
|
26
26
|
}
|
|
27
|
-
this.registry[config.
|
|
28
|
-
window.dispatchEvent(new CustomEvent("
|
|
27
|
+
this.registry[config.name] = config;
|
|
28
|
+
window.dispatchEvent(new CustomEvent("toolcall-registered", {
|
|
29
29
|
detail: {
|
|
30
|
-
|
|
30
|
+
name: config.name
|
|
31
31
|
}
|
|
32
32
|
}));
|
|
33
33
|
}
|
|
34
34
|
}, {
|
|
35
35
|
key: "get",
|
|
36
|
-
value: function get(
|
|
37
|
-
return this.registry[
|
|
36
|
+
value: function get(name) {
|
|
37
|
+
return this.registry[name];
|
|
38
38
|
}
|
|
39
39
|
}, {
|
|
40
40
|
key: "getRenderFunction",
|
|
41
|
-
value: function getRenderFunction(
|
|
42
|
-
var config = this.registry[
|
|
41
|
+
value: function getRenderFunction(name) {
|
|
42
|
+
var config = this.registry[name];
|
|
43
43
|
if (!config) return null;
|
|
44
|
-
var memoizedComponent = this.renderFunctionCache.get(
|
|
44
|
+
var memoizedComponent = this.renderFunctionCache.get(name);
|
|
45
45
|
if (!memoizedComponent) {
|
|
46
46
|
memoizedComponent = /*#__PURE__*/React.memo(function (props) {
|
|
47
47
|
return /*#__PURE__*/React.createElement(config.component, props);
|
|
48
48
|
});
|
|
49
|
-
this.renderFunctionCache.set(
|
|
49
|
+
this.renderFunctionCache.set(name, memoizedComponent);
|
|
50
50
|
}
|
|
51
51
|
return memoizedComponent;
|
|
52
52
|
}
|
|
@@ -57,9 +57,9 @@ var ActivityRegistryManager = /*#__PURE__*/function () {
|
|
|
57
57
|
}
|
|
58
58
|
}, {
|
|
59
59
|
key: "unregister",
|
|
60
|
-
value: function unregister(
|
|
61
|
-
delete this.registry[
|
|
62
|
-
this.renderFunctionCache["delete"](
|
|
60
|
+
value: function unregister(name) {
|
|
61
|
+
delete this.registry[name];
|
|
62
|
+
this.renderFunctionCache["delete"](name);
|
|
63
63
|
}
|
|
64
64
|
}, {
|
|
65
65
|
key: "clear",
|
|
@@ -67,19 +67,9 @@ var ActivityRegistryManager = /*#__PURE__*/function () {
|
|
|
67
67
|
this.registry = {};
|
|
68
68
|
this.renderFunctionCache.clear();
|
|
69
69
|
}
|
|
70
|
-
}, {
|
|
71
|
-
key: "has",
|
|
72
|
-
value: function has(activityType) {
|
|
73
|
-
return activityType in this.registry;
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
key: "getRegisteredTypes",
|
|
77
|
-
value: function getRegisteredTypes() {
|
|
78
|
-
return Object.keys(this.registry);
|
|
79
|
-
}
|
|
80
70
|
}]);
|
|
81
71
|
}();
|
|
82
|
-
var
|
|
72
|
+
var agentToolcallRegistry = new AgentToolcallRegistryManager();
|
|
83
73
|
|
|
84
|
-
export {
|
|
74
|
+
export { agentToolcallRegistry };
|
|
85
75
|
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sources":["../../../../../pro-components/chat/chatbot/components/toolcall/registry.ts"],"sourcesContent":["import React from 'react';\nimport type { AgentToolcallConfig, AgentToolcallRegistry, ToolcallComponentProps } from './types';\n\n/**\n * 全局 Agent Toolcall 注册表\n */\nclass AgentToolcallRegistryManager {\n private registry: AgentToolcallRegistry = {};\n\n // 添加组件渲染函数缓存(类似CopilotKit的chatComponentsCache.current.actions)\n private renderFunctionCache = new Map<\n string,\n React.MemoExoticComponent<React.ComponentType<ToolcallComponentProps>>\n >();\n\n /**\n * 注册一个 Agent Toolcall\n */\n register<TArgs extends object = any, TResult = any, TResponse = any>(\n config: AgentToolcallConfig<TArgs, TResult, TResponse>,\n ): void {\n const existingConfig = this.registry[config.name];\n\n // 如果组件发生变化,清除旧的缓存\n if (existingConfig && existingConfig.component !== config.component) {\n this.renderFunctionCache.delete(config.name);\n }\n this.registry[config.name] = config;\n window.dispatchEvent(\n new CustomEvent('toolcall-registered', {\n detail: { name: config.name },\n }),\n );\n }\n\n /**\n * 获取指定名称的 Agent Toolcall 配置\n */\n get(name: string): AgentToolcallConfig | undefined {\n return this.registry[name];\n }\n\n /**\n * 获取或创建缓存的组件渲染函数\n */\n getRenderFunction(name: string): React.MemoExoticComponent<React.ComponentType<ToolcallComponentProps>> | null {\n const config = this.registry[name];\n if (!config) return null;\n\n // 检查缓存\n let memoizedComponent = this.renderFunctionCache.get(name);\n\n if (!memoizedComponent) {\n // 创建memo化的组件\n memoizedComponent = React.memo((props: ToolcallComponentProps) => React.createElement(config.component, props));\n\n // 缓存组件\n this.renderFunctionCache.set(name, memoizedComponent);\n }\n\n return memoizedComponent;\n }\n\n /**\n * 获取所有已注册的 Agent Toolcall\n */\n getAll(): AgentToolcallRegistry {\n return { ...this.registry };\n }\n\n /**\n * 取消注册指定的 Agent Toolcall\n */\n unregister(name: string): void {\n delete this.registry[name];\n this.renderFunctionCache.delete(name);\n }\n\n /**\n * 清空所有注册的 Agent Toolcall\n */\n clear(): void {\n this.registry = {};\n this.renderFunctionCache.clear();\n }\n}\n\n// 导出单例实例\nexport const agentToolcallRegistry = new AgentToolcallRegistryManager();\n"],"names":["AgentToolcallRegistryManager","_classCallCheck","_defineProperty","Map","_createClass","key","value","register","config","existingConfig","registry","name","component","renderFunctionCache","window","dispatchEvent","CustomEvent","detail","get","getRenderFunction","memoizedComponent","React","memo","props","createElement","set","getAll","_objectSpread","unregister","clear","agentToolcallRegistry"],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ToolCall } from 'tdesign-web-components/lib/chat-engine';
|
|
3
|
+
interface ToolCallRendererProps {
|
|
4
|
+
toolCall: ToolCall;
|
|
5
|
+
onRespond?: (toolCall: ToolCall, response: any) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const ToolCallRenderer: React.NamedExoticComponent<ToolCallRendererProps>;
|
|
8
|
+
type WithAgentStateProps<P> = P & {
|
|
9
|
+
agentState?: Record<string, any>;
|
|
10
|
+
};
|
|
11
|
+
export declare const withAgentStateToolcall1: <P extends object>(Component: React.ComponentType<WithAgentStateProps<P>>) => React.ComponentType<P>;
|
|
12
|
+
export declare const withAgentStateToolcall: <P extends object>(Component: React.ComponentType<WithAgentStateProps<P>>, subscribeKeyExtractor?: (props: P) => string | undefined) => React.ComponentType<P>;
|
|
13
|
+
export {};
|