@tdesign-react/chat 1.0.2-alpha.8 → 1.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_chunks/dep-f2051ebd.js +839 -0
- package/es/_chunks/dep-f2051ebd.js.map +1 -0
- package/es/_util/reactify.d.ts +1 -2
- package/es/_util/reactify.js +81 -231
- package/es/_util/reactify.js.map +1 -1
- package/es/_util/useDynamicStyle.js +1 -1
- package/es/attachments/index.js +4 -6
- package/es/attachments/index.js.map +1 -1
- package/es/chat-actionbar/_example-js/base.d.ts +2 -0
- package/es/chat-actionbar/_example-js/custom.d.ts +2 -0
- package/es/chat-actionbar/_example-js/style.d.ts +2 -0
- package/es/chat-actionbar/index.js +4 -6
- package/es/chat-actionbar/index.js.map +1 -1
- package/es/chat-attachments/_example-js/base.d.ts +2 -0
- package/es/chat-attachments/_example-js/scroll-x.d.ts +2 -0
- package/es/chat-attachments/_example-js/scroll-y.d.ts +2 -0
- package/es/chat-attachments/index.js +3 -1
- package/es/chat-attachments/index.js.map +1 -1
- package/es/chat-engine/_example-js/agui-basic.d.ts +10 -0
- package/es/chat-engine/_example-js/agui-comprehensive.d.ts +2 -0
- package/es/chat-engine/_example-js/agui-test.d.ts +11 -0
- package/es/chat-engine/_example-js/agui-toolcall.d.ts +5 -0
- package/es/chat-engine/_example-js/agui-videoclip.d.ts +8 -0
- package/es/chat-engine/_example-js/agui.d.ts +1 -0
- package/es/chat-engine/_example-js/basic.d.ts +9 -0
- package/es/chat-engine/_example-js/components/HotelCard.d.ts +3 -0
- package/es/chat-engine/_example-js/components/HumanInputForm.d.ts +6 -0
- package/es/chat-engine/_example-js/components/HumanInputResult.d.ts +3 -0
- package/es/chat-engine/_example-js/components/ItineraryCard.d.ts +3 -0
- package/es/chat-engine/_example-js/components/PlanningStatePanel.d.ts +4 -0
- package/es/chat-engine/_example-js/components/Toolcall.d.ts +4 -0
- package/es/chat-engine/_example-js/components/WeatherCard.d.ts +3 -0
- package/es/chat-engine/_example-js/components/login.d.ts +1 -0
- package/es/chat-engine/_example-js/comprehensive.d.ts +12 -0
- package/es/chat-engine/_example-js/custom-content.d.ts +1 -0
- package/es/chat-engine/_example-js/hookComponent.d.ts +1 -0
- package/es/chat-engine/_example-js/initial-messages.d.ts +9 -0
- package/es/chat-engine/_example-js/instance-methods.d.ts +13 -0
- package/es/chat-engine/_example-js/travel-actions.d.ts +91 -0
- package/es/chat-engine/_example-js/travelToolcall.d.ts +1 -0
- package/es/chat-engine/components/a2ui/A2UIActivityRenderer.d.ts +196 -0
- package/es/chat-engine/components/a2ui/A2UIActivityRenderer.js +301 -0
- package/es/chat-engine/components/a2ui/A2UIActivityRenderer.js.map +1 -0
- package/es/chat-engine/components/a2ui/A2UIComponentRenderer.d.ts +37 -0
- package/es/chat-engine/components/a2ui/A2UIComponentRenderer.js +116 -0
- package/es/chat-engine/components/a2ui/A2UIComponentRenderer.js.map +1 -0
- package/es/chat-engine/components/a2ui/A2UIErrorBoundary.d.ts +42 -0
- package/es/chat-engine/components/a2ui/A2UIErrorBoundary.js +113 -0
- package/es/chat-engine/components/a2ui/A2UIErrorBoundary.js.map +1 -0
- package/es/chat-engine/components/a2ui/A2UISkeleton.d.ts +60 -0
- package/es/chat-engine/components/a2ui/A2UISkeleton.js +197 -0
- package/es/chat-engine/components/a2ui/A2UISkeleton.js.map +1 -0
- package/es/chat-engine/components/a2ui/A2UISurfaceRenderer.d.ts +44 -0
- package/es/chat-engine/components/a2ui/A2UISurfaceRenderer.js +139 -0
- package/es/chat-engine/components/a2ui/A2UISurfaceRenderer.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/A2UICard.d.ts +22 -0
- package/es/chat-engine/components/a2ui/containers/A2UICard.js +82 -0
- package/es/chat-engine/components/a2ui/containers/A2UICard.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/A2UIColumn.d.ts +18 -0
- package/es/chat-engine/components/a2ui/containers/A2UIColumn.js +81 -0
- package/es/chat-engine/components/a2ui/containers/A2UIColumn.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/A2UIList.d.ts +14 -0
- package/es/chat-engine/components/a2ui/containers/A2UIList.js +62 -0
- package/es/chat-engine/components/a2ui/containers/A2UIList.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/A2UIRow.d.ts +20 -0
- package/es/chat-engine/components/a2ui/containers/A2UIRow.js +84 -0
- package/es/chat-engine/components/a2ui/containers/A2UIRow.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/A2UITabs.d.ts +14 -0
- package/es/chat-engine/components/a2ui/containers/A2UITabs.js +69 -0
- package/es/chat-engine/components/a2ui/containers/A2UITabs.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/index.d.ts +8 -0
- package/es/chat-engine/components/a2ui/containers/index.js +30 -0
- package/es/chat-engine/components/a2ui/containers/index.js.map +1 -0
- package/es/chat-engine/components/a2ui/index.d.ts +11 -0
- package/es/chat-engine/components/a2ui/index.js +62 -0
- package/es/chat-engine/components/a2ui/index.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIButton.d.ts +33 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIButton.js +80 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIButton.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckBox.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckBox.js +43 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckBox.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckboxGroup.d.ts +50 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckboxGroup.js +54 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckboxGroup.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIChoicePicker.d.ts +13 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIChoicePicker.js +89 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIChoicePicker.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIDivider.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIDivider.js +25 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIDivider.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIIcon.d.ts +13 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIIcon.js +138942 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIIcon.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIImage.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIImage.js +75 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIImage.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIInput.d.ts +20 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIInput.js +63 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIInput.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIRadioGroup.d.ts +56 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIRadioGroup.js +64 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIRadioGroup.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UISlider.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UISlider.js +55 -0
- package/es/chat-engine/components/a2ui/primitives/A2UISlider.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIText.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIText.js +104 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIText.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UITextField.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UITextField.js +80 -0
- package/es/chat-engine/components/a2ui/primitives/A2UITextField.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/index.d.ts +15 -0
- package/es/chat-engine/components/a2ui/primitives/index.js +39 -0
- package/es/chat-engine/components/a2ui/primitives/index.js.map +1 -0
- package/es/chat-engine/components/a2ui/registry.d.ts +35 -0
- package/es/chat-engine/components/a2ui/registry.js +74 -0
- package/es/chat-engine/components/a2ui/registry.js.map +1 -0
- package/es/{chatbot/components/toolcall → chat-engine/components/activity}/index.d.ts +1 -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/{chatbot/components/toolcall → chat-engine/components/activity}/registry.js +32 -22
- 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 +4 -0
- package/es/chat-engine/components/index.js +76 -0
- package/es/chat-engine/components/index.js.map +1 -0
- package/es/chat-engine/components/json-render/A2UIJsonRenderActivityRenderer.d.ts +36 -0
- package/es/chat-engine/components/json-render/A2UIJsonRenderActivityRenderer.js +36 -0
- package/es/chat-engine/components/json-render/A2UIJsonRenderActivityRenderer.js.map +1 -0
- package/es/chat-engine/components/json-render/JsonRenderActivityRenderer.d.ts +46 -0
- package/es/chat-engine/components/json-render/JsonRenderActivityRenderer.js +36 -0
- package/es/chat-engine/components/json-render/JsonRenderActivityRenderer.js.map +1 -0
- package/es/chat-engine/components/json-render/SurfaceStateManager.d.ts +113 -0
- package/es/chat-engine/components/json-render/SurfaceStateManager.js +195 -0
- package/es/chat-engine/components/json-render/SurfaceStateManager.js.map +1 -0
- package/es/chat-engine/components/json-render/adapters/a2ui-to-jsonrender.d.ts +49 -0
- package/es/chat-engine/components/json-render/adapters/a2ui-to-jsonrender.js +307 -0
- package/es/chat-engine/components/json-render/adapters/a2ui-to-jsonrender.js.map +1 -0
- package/es/chat-engine/components/json-render/adapters/a2ui-types.d.ts +96 -0
- package/es/chat-engine/components/json-render/adapters/a2ui-types.js +7 -0
- package/es/chat-engine/components/json-render/adapters/a2ui-types.js.map +1 -0
- package/es/chat-engine/components/json-render/adapters/index.d.ts +7 -0
- package/es/chat-engine/components/json-render/adapters/index.js +11 -0
- package/es/chat-engine/components/json-render/adapters/index.js.map +1 -0
- package/es/chat-engine/components/json-render/catalog/a2ui-binding.d.ts +64 -0
- package/es/chat-engine/components/json-render/catalog/a2ui-binding.js +36 -0
- package/es/chat-engine/components/json-render/catalog/a2ui-binding.js.map +1 -0
- package/es/chat-engine/components/json-render/catalog/a2ui-registry.d.ts +78 -0
- package/es/chat-engine/components/json-render/catalog/a2ui-registry.js +36 -0
- package/es/chat-engine/components/json-render/catalog/a2ui-registry.js.map +1 -0
- package/es/chat-engine/components/json-render/catalog/button.d.ts +14 -0
- package/es/chat-engine/components/json-render/catalog/button.js +71 -0
- package/es/chat-engine/components/json-render/catalog/button.js.map +1 -0
- package/es/chat-engine/components/json-render/catalog/card.d.ts +11 -0
- package/es/chat-engine/components/json-render/catalog/card.js +57 -0
- package/es/chat-engine/components/json-render/catalog/card.js.map +1 -0
- package/es/chat-engine/components/json-render/catalog/index.d.ts +127 -0
- package/es/chat-engine/components/json-render/catalog/index.js +36 -0
- package/es/chat-engine/components/json-render/catalog/index.js.map +1 -0
- package/es/chat-engine/components/json-render/catalog/input.d.ts +20 -0
- package/es/chat-engine/components/json-render/catalog/input.js +36 -0
- package/es/chat-engine/components/json-render/catalog/input.js.map +1 -0
- package/es/chat-engine/components/json-render/catalog/layout.d.ts +44 -0
- package/es/chat-engine/components/json-render/catalog/layout.js +129 -0
- package/es/chat-engine/components/json-render/catalog/layout.js.map +1 -0
- package/es/chat-engine/components/json-render/catalog/text.d.ts +11 -0
- package/es/chat-engine/components/json-render/catalog/text.js +31 -0
- package/es/chat-engine/components/json-render/catalog/text.js.map +1 -0
- package/es/chat-engine/components/json-render/catalog.d.ts +549 -0
- package/es/chat-engine/components/json-render/catalog.js +147 -0
- package/es/chat-engine/components/json-render/catalog.js.map +1 -0
- package/es/chat-engine/components/json-render/config.d.ts +154 -0
- package/es/chat-engine/components/json-render/config.js +36 -0
- package/es/chat-engine/components/json-render/config.js.map +1 -0
- package/es/chat-engine/components/json-render/contexts/actions.d.ts +74 -0
- package/es/chat-engine/components/json-render/contexts/actions.js +290 -0
- package/es/chat-engine/components/json-render/contexts/actions.js.map +1 -0
- package/es/chat-engine/components/json-render/contexts/data.d.ts +45 -0
- package/es/chat-engine/components/json-render/contexts/data.js +104 -0
- package/es/chat-engine/components/json-render/contexts/data.js.map +1 -0
- package/es/chat-engine/components/json-render/contexts/validation.d.ts +59 -0
- package/es/chat-engine/components/json-render/contexts/validation.js +151 -0
- package/es/chat-engine/components/json-render/contexts/validation.js.map +1 -0
- package/es/chat-engine/components/json-render/contexts/visibility.d.ts +29 -0
- package/es/chat-engine/components/json-render/contexts/visibility.js +56 -0
- package/es/chat-engine/components/json-render/contexts/visibility.js.map +1 -0
- package/es/chat-engine/components/json-render/engine.d.ts +58 -0
- package/es/chat-engine/components/json-render/engine.js +88 -0
- package/es/chat-engine/components/json-render/engine.js.map +1 -0
- package/es/chat-engine/components/json-render/index.d.ts +34 -0
- package/es/chat-engine/components/json-render/index.js +36 -0
- package/es/chat-engine/components/json-render/index.js.map +1 -0
- package/es/chat-engine/components/json-render/performance.d.ts +91 -0
- package/es/chat-engine/components/json-render/performance.js +135 -0
- package/es/chat-engine/components/json-render/performance.js.map +1 -0
- package/es/chat-engine/components/json-render/renderer.d.ts +71 -0
- package/es/chat-engine/components/json-render/renderer.js +124 -0
- package/es/chat-engine/components/json-render/renderer.js.map +1 -0
- package/es/chat-engine/components/json-render/types.d.ts +69 -0
- package/es/chat-engine/components/json-render/types.js +7 -0
- package/es/chat-engine/components/json-render/types.js.map +1 -0
- package/es/chat-engine/components/provider/agent-state.js +39 -2
- package/es/chat-engine/components/provider/agent-state.js.map +1 -1
- package/es/chat-engine/components/toolcall/index.js +35 -2
- 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 +102 -26
- 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/core/a2ui/index.d.ts +10 -0
- package/es/chat-engine/core/a2ui/index.js +24 -0
- package/es/chat-engine/core/a2ui/index.js.map +1 -0
- package/es/chat-engine/core/a2ui/processor/A2uiMessageProcessor.d.ts +197 -0
- package/es/chat-engine/core/a2ui/processor/A2uiMessageProcessor.js +438 -0
- package/es/chat-engine/core/a2ui/processor/A2uiMessageProcessor.js.map +1 -0
- package/es/chat-engine/core/a2ui/processor/ComponentTree.d.ts +53 -0
- package/es/chat-engine/core/a2ui/processor/ComponentTree.js +158 -0
- package/es/chat-engine/core/a2ui/processor/ComponentTree.js.map +1 -0
- package/es/chat-engine/core/a2ui/processor/DataStore.d.ts +63 -0
- package/es/chat-engine/core/a2ui/processor/DataStore.js +172 -0
- package/es/chat-engine/core/a2ui/processor/DataStore.js.map +1 -0
- package/es/chat-engine/core/a2ui/processor/PathResolver.d.ts +47 -0
- package/es/chat-engine/core/a2ui/processor/PathResolver.js +99 -0
- package/es/chat-engine/core/a2ui/processor/PathResolver.js.map +1 -0
- package/es/chat-engine/core/a2ui/types/index.d.ts +4 -0
- package/es/chat-engine/core/a2ui/types/index.js +9 -0
- package/es/chat-engine/core/a2ui/types/index.js.map +1 -0
- package/es/chat-engine/core/a2ui/types/types.d.ts +770 -0
- package/es/chat-engine/core/a2ui/types/types.js +104 -0
- package/es/chat-engine/core/a2ui/types/types.js.map +1 -0
- package/es/chat-engine/core/a2ui/utils/binding.d.ts +34 -0
- package/es/chat-engine/core/a2ui/utils/binding.js +1784 -0
- package/es/chat-engine/core/a2ui/utils/binding.js.map +1 -0
- package/es/chat-engine/core/a2ui/utils/index.d.ts +5 -0
- package/es/chat-engine/core/a2ui/utils/index.js +13 -0
- package/es/chat-engine/core/a2ui/utils/index.js.map +1 -0
- package/es/chat-engine/core/a2ui/utils/validation.d.ts +70 -0
- package/es/chat-engine/core/a2ui/utils/validation.js +333 -0
- package/es/chat-engine/core/a2ui/utils/validation.js.map +1 -0
- package/es/chat-engine/core/adapters/agui/activity-manager.d.ts +102 -0
- package/es/chat-engine/core/adapters/agui/activity-manager.js +144 -0
- package/es/chat-engine/core/adapters/agui/activity-manager.js.map +1 -0
- package/es/chat-engine/core/adapters/agui/event-mapper.d.ts +149 -0
- package/es/chat-engine/core/adapters/agui/event-mapper.js +415 -0
- package/es/chat-engine/core/adapters/agui/event-mapper.js.map +1 -0
- package/es/chat-engine/core/adapters/agui/events.d.ts +1550 -0
- package/es/chat-engine/core/adapters/agui/events.js +199 -0
- package/es/chat-engine/core/adapters/agui/events.js.map +1 -0
- package/es/chat-engine/core/adapters/agui/index.d.ts +95 -0
- package/es/chat-engine/core/adapters/agui/index.js +195 -0
- package/es/chat-engine/core/adapters/agui/index.js.map +1 -0
- package/es/chat-engine/core/adapters/agui/state-manager.d.ts +99 -0
- package/es/chat-engine/core/adapters/agui/state-manager.js +168 -0
- package/es/chat-engine/core/adapters/agui/state-manager.js.map +1 -0
- package/es/chat-engine/core/adapters/agui/types.d.ts +818 -0
- package/es/chat-engine/core/adapters/agui/types.js +95 -0
- package/es/chat-engine/core/adapters/agui/types.js.map +1 -0
- package/es/chat-engine/core/adapters/agui/utils.d.ts +203 -0
- package/es/chat-engine/core/adapters/agui/utils.js +330 -0
- package/es/chat-engine/core/adapters/agui/utils.js.map +1 -0
- package/es/chat-engine/core/event-bus/ChatEventBus.d.ts +88 -0
- package/es/chat-engine/core/event-bus/ChatEventBus.js +295 -0
- package/es/chat-engine/core/event-bus/ChatEventBus.js.map +1 -0
- package/es/chat-engine/core/event-bus/index.d.ts +5 -0
- package/es/chat-engine/core/event-bus/index.js +13 -0
- package/es/chat-engine/core/event-bus/index.js.map +1 -0
- package/es/chat-engine/core/event-bus/types.d.ts +230 -0
- package/es/chat-engine/core/event-bus/types.js +32 -0
- package/es/chat-engine/core/event-bus/types.js.map +1 -0
- package/es/chat-engine/core/index.d.ts +147 -0
- package/es/chat-engine/core/index.js +754 -0
- package/es/chat-engine/core/index.js.map +1 -0
- package/es/chat-engine/core/processor/index.d.ts +20 -0
- package/es/chat-engine/core/processor/index.js +146 -0
- package/es/chat-engine/core/processor/index.js.map +1 -0
- package/es/chat-engine/core/server/batch-client.d.ts +20 -0
- package/es/chat-engine/core/server/batch-client.js +114 -0
- package/es/chat-engine/core/server/batch-client.js.map +1 -0
- package/es/chat-engine/core/server/connection-manager.d.ts +39 -0
- package/es/chat-engine/core/server/connection-manager.js +84 -0
- package/es/chat-engine/core/server/connection-manager.js.map +1 -0
- package/es/chat-engine/core/server/errors.d.ts +22 -0
- package/es/chat-engine/core/server/errors.js +80 -0
- package/es/chat-engine/core/server/errors.js.map +1 -0
- package/es/chat-engine/core/server/index.d.ts +11 -0
- package/es/chat-engine/core/server/index.js +26 -0
- package/es/chat-engine/core/server/index.js.map +1 -0
- package/es/chat-engine/core/server/llm-service.d.ts +44 -0
- package/es/chat-engine/core/server/llm-service.js +200 -0
- package/es/chat-engine/core/server/llm-service.js.map +1 -0
- package/es/chat-engine/core/server/sse-client.d.ts +77 -0
- package/es/chat-engine/core/server/sse-client.js +362 -0
- package/es/chat-engine/core/server/sse-client.js.map +1 -0
- package/es/chat-engine/core/server/sse-parser.d.ts +49 -0
- package/es/chat-engine/core/server/sse-parser.js +116 -0
- package/es/chat-engine/core/server/sse-parser.js.map +1 -0
- package/es/chat-engine/core/server/types.d.ts +54 -0
- package/es/chat-engine/core/server/types.js +28 -0
- package/es/chat-engine/core/server/types.js.map +1 -0
- package/es/chat-engine/core/store/message.d.ts +27 -0
- package/es/chat-engine/core/store/message.js +263 -0
- package/es/chat-engine/core/store/message.js.map +1 -0
- package/es/chat-engine/core/store/model.d.ts +8 -0
- package/es/chat-engine/core/store/model.js +65 -0
- package/es/chat-engine/core/store/model.js.map +1 -0
- package/es/chat-engine/core/store/reactiveState.d.ts +52 -0
- package/es/chat-engine/core/store/reactiveState.js +1359 -0
- package/es/chat-engine/core/store/reactiveState.js.map +1 -0
- package/es/chat-engine/core/type.d.ts +271 -0
- package/es/chat-engine/core/type.js +7 -0
- package/es/chat-engine/core/type.js.map +1 -0
- package/es/chat-engine/core/utils/eventEmitter.d.ts +10 -0
- package/es/chat-engine/core/utils/eventEmitter.js +67 -0
- package/es/chat-engine/core/utils/eventEmitter.js.map +1 -0
- package/es/chat-engine/core/utils/index.d.ts +33 -0
- package/es/chat-engine/core/utils/index.js +999 -0
- package/es/chat-engine/core/utils/index.js.map +1 -0
- package/es/chat-engine/core/utils/logger.d.ts +30 -0
- package/es/chat-engine/core/utils/logger.js +87 -0
- package/es/chat-engine/core/utils/logger.js.map +1 -0
- package/es/chat-engine/hooks/a2ui/A2UIContext.d.ts +90 -0
- package/es/chat-engine/hooks/a2ui/A2UIContext.js +97 -0
- package/es/chat-engine/hooks/a2ui/A2UIContext.js.map +1 -0
- package/es/chat-engine/hooks/a2ui/index.d.ts +12 -0
- package/es/chat-engine/hooks/a2ui/index.js +19 -0
- package/es/chat-engine/hooks/a2ui/useA2UIAction.d.ts +40 -0
- package/es/chat-engine/hooks/a2ui/useA2UIAction.js +74 -0
- package/es/chat-engine/hooks/a2ui/useA2UIAction.js.map +1 -0
- package/es/chat-engine/hooks/a2ui/useA2UISurface.d.ts +36 -0
- package/es/chat-engine/hooks/a2ui/useA2UISurface.js +39 -0
- package/es/chat-engine/hooks/a2ui/useA2UISurface.js.map +1 -0
- package/es/chat-engine/hooks/a2ui/useDataBinding.d.ts +53 -0
- package/es/chat-engine/hooks/a2ui/useDataBinding.js +111 -0
- package/es/chat-engine/hooks/a2ui/useDataBinding.js.map +1 -0
- package/es/chat-engine/hooks/index.d.ts +4 -0
- package/es/chat-engine/hooks/index.js +54 -0
- package/es/chat-engine/hooks/index.js.map +1 -0
- package/es/chat-engine/hooks/useAgentActivity.d.ts +15 -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 +39 -2
- 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 +3 -3
- package/es/chat-engine/hooks/useChat.js +41 -3
- package/es/chat-engine/hooks/useChat.js.map +1 -1
- package/es/chat-engine/hooks/useJsonRenderActivity.d.ts +56 -0
- package/es/chat-engine/hooks/useJsonRenderActivity.js +63 -0
- package/es/chat-engine/hooks/useJsonRenderActivity.js.map +1 -0
- package/es/chat-engine/index.d.ts +3 -3
- package/es/chat-engine/index.js +61 -5
- package/es/chat-engine/index.js.map +1 -1
- package/es/chat-filecard/_example-js/base.d.ts +1 -0
- package/es/chat-filecard/index.js +4 -6
- package/es/chat-filecard/index.js.map +1 -1
- package/es/chat-loading/_example-js/base.d.ts +2 -0
- package/es/chat-loading/_example-js/text.d.ts +2 -0
- package/es/chat-loading/index.js +4 -6
- package/es/chat-loading/index.js.map +1 -1
- package/es/chat-markdown/_example-js/base.d.ts +1 -0
- package/es/chat-markdown/_example-js/custom.d.ts +2 -0
- package/es/chat-markdown/_example-js/event.d.ts +1 -0
- package/es/chat-markdown/_example-js/footnote.d.ts +2 -0
- package/es/chat-markdown/_example-js/plugin.d.ts +2 -0
- package/es/chat-markdown/_example-js/theme.d.ts +2 -0
- package/es/chat-markdown/index.js +4 -6
- package/es/chat-markdown/index.js.map +1 -1
- package/es/chat-message/_example-js/action.d.ts +1 -0
- package/es/chat-message/_example-js/base.d.ts +1 -0
- package/es/chat-message/_example-js/configure.d.ts +1 -0
- package/es/chat-message/_example-js/content.d.ts +1 -0
- package/es/chat-message/_example-js/custom.d.ts +1 -0
- package/es/chat-message/_example-js/handle-actions.d.ts +7 -0
- package/es/chat-message/_example-js/status.d.ts +1 -0
- package/es/chat-message/_example-js/think.d.ts +1 -0
- package/es/chat-message/index.js +4 -6
- package/es/chat-message/index.js.map +1 -1
- package/es/chat-sender/_example-js/attachment.d.ts +2 -0
- package/es/chat-sender/_example-js/base.d.ts +2 -0
- package/es/chat-sender/_example-js/custom.d.ts +2 -0
- package/es/chat-sender/index.js +4 -6
- package/es/chat-sender/index.js.map +1 -1
- package/es/chat-thinking/_example-js/base.d.ts +1 -0
- package/es/chat-thinking/_example-js/style.d.ts +1 -0
- package/es/chat-thinking/index.js +4 -6
- package/es/chat-thinking/index.js.map +1 -1
- package/es/chatbot/_example-js/agent.d.ts +1 -0
- package/es/chatbot/_example-js/agui.d.ts +13 -0
- package/es/chatbot/_example-js/backup/travel.d.ts +1 -0
- package/es/chatbot/_example-js/basic.d.ts +1 -0
- package/es/chatbot/_example-js/code.d.ts +1 -0
- package/es/chatbot/_example-js/components/ItineraryCard.d.ts +3 -0
- package/es/chatbot/_example-js/components/login.d.ts +1 -0
- package/es/chatbot/_example-js/comprehensive.d.ts +1 -0
- package/es/chatbot/_example-js/custom-content.d.ts +1 -0
- package/es/chatbot/_example-js/custom-merge.d.ts +1 -0
- package/es/chatbot/_example-js/custom.d.ts +1 -0
- package/es/chatbot/_example-js/docs.d.ts +1 -0
- package/es/chatbot/_example-js/image.d.ts +1 -0
- package/es/chatbot/_example-js/initial-messages.d.ts +9 -0
- package/es/chatbot/_example-js/instance-methods.d.ts +14 -0
- package/es/chatbot/_example-js/nostream.d.ts +1 -0
- package/es/chatbot/_example-js/quick-start.d.ts +9 -0
- package/es/chatbot/_example-js/research.d.ts +1 -0
- package/es/chatbot/_example-js/role-message-config.d.ts +22 -0
- package/es/chatbot/_example-js/sender-config.d.ts +20 -0
- package/es/chatbot/_example-js/service-config.d.ts +17 -0
- package/es/chatbot/_example-js/simple.d.ts +1 -0
- package/es/chatbot/_example-js/utils/messageRenderer.d.ts +5 -0
- package/es/chatbot/docs/react-best-practice.d.ts +13 -0
- package/es/chatbot/index.js +4 -6
- package/es/chatbot/index.js.map +1 -1
- package/es/index.js +59 -9
- package/es/index.js.map +1 -1
- package/es/style/index.js +1 -1
- package/package.json +6 -3
- package/es/chatbot/components/provider/agent-state.d.ts +0 -5
- package/es/chatbot/components/provider/agent-state.js +0 -28
- package/es/chatbot/components/provider/agent-state.js.map +0 -1
- package/es/chatbot/components/toolcall/index.js +0 -19
- package/es/chatbot/components/toolcall/registry.d.ts +0 -35
- package/es/chatbot/components/toolcall/registry.js.map +0 -1
- package/es/chatbot/components/toolcall/render.d.ts +0 -13
- package/es/chatbot/components/toolcall/render.js +0 -207
- package/es/chatbot/components/toolcall/render.js.map +0 -1
- package/es/chatbot/components/toolcall/types.d.ts +0 -57
- package/es/chatbot/components/toolcall/types.js +0 -15
- package/es/chatbot/components/toolcall/types.js.map +0 -1
- package/es/chatbot/hooks/useAgentState.d.ts +0 -40
- package/es/chatbot/hooks/useAgentState.js +0 -76
- package/es/chatbot/hooks/useAgentState.js.map +0 -1
- package/es/chatbot/hooks/useAgentToolcall.d.ts +0 -28
- package/es/chatbot/hooks/useAgentToolcall.js +0 -78
- package/es/chatbot/hooks/useAgentToolcall.js.map +0 -1
- package/es/chatbot/hooks/useChat.d.ts +0 -11
- package/es/chatbot/hooks/useChat.js +0 -66
- package/es/chatbot/hooks/useChat.js.map +0 -1
- /package/es/{chatbot/components/toolcall → chat-engine/hooks/a2ui}/index.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ThinkContentDemo(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.2-alpha.
|
|
2
|
+
* tdesign v1.0.2-alpha.15
|
|
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';
|
|
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;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ChatBotReact(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AG-UI 协议示例
|
|
3
|
+
*
|
|
4
|
+
* 本示例展示如何使用 AG-UI 协议快速接入聊天服务。
|
|
5
|
+
* AG-UI 是一种标准化的 AI 对话协议,当后端服务符合该协议时,
|
|
6
|
+
* 前端无需编写 onMessage 进行数据转换,大大简化了接入流程。
|
|
7
|
+
* 可以通过查看网络输出的数据流来了解协议格式。
|
|
8
|
+
*
|
|
9
|
+
* 对比说明:
|
|
10
|
+
* - 自定义协议:需要配置 onMessage 进行数据转换(参考 service-config 示例)
|
|
11
|
+
* - AG-UI 协议:只需设置 protocol: 'agui',无需 onMessage
|
|
12
|
+
*/
|
|
13
|
+
export default function AguiProtocol(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function TravelPlannerChat(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function chatSample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function chatSample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function BaseForm(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function chatSample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function CustomContent(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function CustomMerge(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ChatBotReact(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function chatSample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function chatSample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 实例方法示例
|
|
3
|
+
*
|
|
4
|
+
* 学习目标:
|
|
5
|
+
* - 通过 ref 获取组件实例
|
|
6
|
+
* - 调用实例方法控制组件行为
|
|
7
|
+
* - 了解各种实例方法的使用场景
|
|
8
|
+
*
|
|
9
|
+
* 方法分类:
|
|
10
|
+
* 1. 消息设置:sendUserMessage、sendSystemMessage、setMessages
|
|
11
|
+
* 2. 发送控制: addPrompt、regenerate、abortChat、selectFile、scrollList
|
|
12
|
+
* 3. 获取状态
|
|
13
|
+
*/
|
|
14
|
+
export default function InstanceMethods(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function chatSample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function chatSample(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 角色消息配置示例
|
|
3
|
+
*
|
|
4
|
+
* 本示例展示如何通过 messageProps 配置不同角色的消息展示效果。
|
|
5
|
+
* messageProps 会透传给内部的 ChatMessage 组件,用于控制消息的渲染和交互。
|
|
6
|
+
*
|
|
7
|
+
* 配置内容包括:
|
|
8
|
+
* - 消息样式配置(气泡样式、位置、头像、昵称等)
|
|
9
|
+
* - 消息操作按钮配置(复制、点赞、点踩、重试)
|
|
10
|
+
* - 内容类型展示配置(思考过程、搜索结果、Markdown 等)
|
|
11
|
+
* - 静态配置 vs 动态配置的使用场景
|
|
12
|
+
*
|
|
13
|
+
* 学习目标:
|
|
14
|
+
* - 掌握 messageProps 动态配置函数的使用方式
|
|
15
|
+
* - 了解如何根据消息内容、状态动态调整配置
|
|
16
|
+
* - 学会配置消息操作按钮及其回调
|
|
17
|
+
* - 学会使用 chatContentProps 控制内容展示行为
|
|
18
|
+
*
|
|
19
|
+
* 相关文档:
|
|
20
|
+
* - ChatMessage 组件详细文档:https://tdesign.tencent.com/react-chat/components/chat-message
|
|
21
|
+
*/
|
|
22
|
+
export default function RoleMessageConfig(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 输入配置示例
|
|
3
|
+
*
|
|
4
|
+
* 本示例展示如何通过 senderProps 配置输入框的基础行为。
|
|
5
|
+
* senderProps 会透传给内部的 ChatSender 组件,用于控制输入框的功能和交互。
|
|
6
|
+
*
|
|
7
|
+
* 配置内容包括:
|
|
8
|
+
* - 输入框基础配置(占位符、自动高度等)
|
|
9
|
+
* - 附件上传配置(文件类型、附件展示等)
|
|
10
|
+
* - 输入事件回调(输入、聚焦、失焦等)
|
|
11
|
+
*
|
|
12
|
+
* 学习目标:
|
|
13
|
+
* - 掌握 senderProps 的常用配置项
|
|
14
|
+
* - 了解如何处理附件上传
|
|
15
|
+
* - 学会处理输入事件
|
|
16
|
+
*
|
|
17
|
+
* 相关文档:
|
|
18
|
+
* - ChatSender 组件详细文档:https://tdesign.tencent.com/react-chat/components/chat-sender
|
|
19
|
+
*/
|
|
20
|
+
export default function SenderConfig(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 自定义协议配置示例
|
|
3
|
+
*
|
|
4
|
+
* 本示例展示如何配置自定义协议的聊天服务。
|
|
5
|
+
* 当后端服务使用自定义数据格式时,需要通过 onMessage 进行数据转换。
|
|
6
|
+
*
|
|
7
|
+
* 配置内容包括:
|
|
8
|
+
* - 请求配置(endpoint、onRequest返回请求头、请求参数)
|
|
9
|
+
* - 数据转换(onMessage:将后端数据转换为组件所需格式)
|
|
10
|
+
* - 生命周期回调(onStart、onComplete、onError、onAbort)
|
|
11
|
+
*
|
|
12
|
+
* 学习目标:
|
|
13
|
+
* - 掌握 chatServiceConfig 的核心配置项
|
|
14
|
+
* - 理解 onMessage 的数据转换逻辑(自定义协议必需)
|
|
15
|
+
* - 学会使用生命周期回调处理不同阶段的业务逻辑
|
|
16
|
+
*/
|
|
17
|
+
export default function ServiceConfig(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function CompositeChat(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function SimpleCallbackExample(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export function HybridExample(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export function CrossComponentExample(): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export function AsyncWaitExample(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export function CustomEventExample(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare namespace _default {
|
|
7
|
+
export { SimpleCallbackExample };
|
|
8
|
+
export { HybridExample };
|
|
9
|
+
export { CrossComponentExample };
|
|
10
|
+
export { AsyncWaitExample };
|
|
11
|
+
export { CustomEventExample };
|
|
12
|
+
}
|
|
13
|
+
export default _default;
|
package/es/chatbot/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.2-alpha.
|
|
2
|
+
* tdesign v1.0.2-alpha.15
|
|
3
3
|
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -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.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* tdesign v1.0.2-alpha.
|
|
2
|
+
* tdesign v1.0.2-alpha.15
|
|
3
3
|
* (c) 2026 tdesign
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -17,30 +17,74 @@ 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 { e as A2UIButton, A as A2UIJsonRenderActivityRenderer, d as A2UITextField, J as JsonRenderActivityRenderer, g as JsonRenderInput, a as a2uiRegistry, j as createA2UIJsonRenderActivityConfig, b as createA2UIRegistry, c as createCustomRegistry, h as createJsonRenderActivityConfig, k as defaultA2UIJsonRenderActivityConfig, i as defaultJsonRenderActivityConfig, t as tdesignRegistry, f as withA2UIBinding, w as withStableProps } from './_chunks/dep-f2051ebd.js';
|
|
28
|
+
export { JsonRenderEngine, createJsonRenderEngine } from './chat-engine/components/json-render/engine.js';
|
|
29
|
+
export { PERFORMANCE_THRESHOLDS, PerformanceMonitor, checkPerformance, globalPerformanceMonitor } from './chat-engine/components/json-render/performance.js';
|
|
30
|
+
export { createCustomCatalog, tdesignActionList, tdesignCatalog, tdesignComponentList } from './chat-engine/components/json-render/catalog.js';
|
|
31
|
+
export { JsonRenderButton } from './chat-engine/components/json-render/catalog/button.js';
|
|
32
|
+
export { JsonRenderCard } from './chat-engine/components/json-render/catalog/card.js';
|
|
33
|
+
export { JsonRenderCol, JsonRenderDivider, JsonRenderRow, JsonRenderSpace } from './chat-engine/components/json-render/catalog/layout.js';
|
|
34
|
+
export { SurfaceStateManager, surfaceStateManager } from './chat-engine/components/json-render/SurfaceStateManager.js';
|
|
35
|
+
export { DataProvider, useData, useDataBinding, useDataValue } from './chat-engine/components/json-render/contexts/data.js';
|
|
36
|
+
export { VisibilityProvider, useIsVisible, useVisibility } from './chat-engine/components/json-render/contexts/visibility.js';
|
|
37
|
+
export { ActionProvider, ConfirmDialog, useAction, useActions } from './chat-engine/components/json-render/contexts/actions.js';
|
|
38
|
+
export { ValidationProvider, useFieldValidation, useValidation } from './chat-engine/components/json-render/contexts/validation.js';
|
|
39
|
+
export { JSONUIProvider, Renderer, createRendererFromCatalog } from './chat-engine/components/json-render/renderer.js';
|
|
40
|
+
export { default as A2UIAdapter, applyA2UIDataUpdate, applyA2UIUpdates, convertA2UIMessagesToJsonRender } from './chat-engine/components/json-render/adapters/a2ui-to-jsonrender.js';
|
|
41
|
+
export { StateManagerImpl, stateManager } from './chat-engine/core/adapters/agui/state-manager.js';
|
|
42
|
+
export { activityManager } from './chat-engine/core/adapters/agui/activity-manager.js';
|
|
43
|
+
export { applyJsonPatch, findTargetElement, getMessageContentForCopy, isAIMessage, isActivityContent, isAttachmentContent, isImageContent, isMarkdownContent, isReasoningContent, isSearchContent, isSuggestionContent, isTextContent, isThinkingContent, isToolCallContent, isUserMessage, safeParseJSON } from './chat-engine/core/utils/index.js';
|
|
44
|
+
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';
|
|
45
|
+
export { AGUIAdapter } from './chat-engine/core/adapters/agui/index.js';
|
|
46
|
+
export { ChatEventBus, createEventBus } from './chat-engine/core/event-bus/ChatEventBus.js';
|
|
47
|
+
export { ChatEngineEventType } from './chat-engine/core/event-bus/types.js';
|
|
25
48
|
import 'tdesign-web-components/lib/chatbot';
|
|
26
49
|
import 'tdesign-web-components/lib/chat-message/content/reasoning-content';
|
|
27
50
|
import 'tdesign-web-components/lib/chat-message/content/search-content';
|
|
28
51
|
import 'tdesign-web-components/lib/chat-message/content/suggestion-content';
|
|
29
52
|
import './_util/reactify.js';
|
|
53
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
30
54
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
31
|
-
import '@babel/runtime/helpers/
|
|
55
|
+
import '@babel/runtime/helpers/typeof';
|
|
56
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
32
57
|
import '@babel/runtime/helpers/classCallCheck';
|
|
33
58
|
import '@babel/runtime/helpers/createClass';
|
|
34
59
|
import '@babel/runtime/helpers/possibleConstructorReturn';
|
|
35
60
|
import '@babel/runtime/helpers/getPrototypeOf';
|
|
36
61
|
import '@babel/runtime/helpers/inherits';
|
|
37
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
38
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
39
|
-
import '@babel/runtime/helpers/typeof';
|
|
40
62
|
import 'react';
|
|
41
|
-
import 'react-dom';
|
|
42
63
|
import 'react-dom/client';
|
|
64
|
+
import './chat-engine/components/index.js';
|
|
43
65
|
import './chat-engine/components/toolcall/index.js';
|
|
66
|
+
import './chat-engine/components/activity/index.js';
|
|
67
|
+
import './chat-engine/components/activity/types.js';
|
|
68
|
+
import './chat-engine/core/index.js';
|
|
69
|
+
import '@babel/runtime/helpers/asyncToGenerator';
|
|
70
|
+
import '@babel/runtime/regenerator';
|
|
71
|
+
import './chat-engine/core/event-bus/index.js';
|
|
72
|
+
import './chat-engine/core/store/message.js';
|
|
73
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
74
|
+
import '@babel/runtime/helpers/get';
|
|
75
|
+
import './chat-engine/core/store/reactiveState.js';
|
|
76
|
+
import '@babel/runtime/helpers/wrapNativeSuper';
|
|
77
|
+
import './chat-engine/core/processor/index.js';
|
|
78
|
+
import './chat-engine/core/server/index.js';
|
|
79
|
+
import './chat-engine/core/server/llm-service.js';
|
|
80
|
+
import './chat-engine/core/utils/logger.js';
|
|
81
|
+
import './chat-engine/core/server/batch-client.js';
|
|
82
|
+
import './chat-engine/core/utils/eventEmitter.js';
|
|
83
|
+
import './chat-engine/core/server/errors.js';
|
|
84
|
+
import './chat-engine/core/server/sse-client.js';
|
|
85
|
+
import './chat-engine/core/server/connection-manager.js';
|
|
86
|
+
import './chat-engine/core/server/sse-parser.js';
|
|
87
|
+
import './chat-engine/core/server/types.js';
|
|
44
88
|
import 'tdesign-web-components/lib/chat-action';
|
|
45
89
|
import 'tdesign-web-components/lib/attachments';
|
|
46
90
|
import 'tdesign-web-components/lib/filecard';
|
|
@@ -50,6 +94,12 @@ import 'tdesign-web-components/lib/chat-message/content/markdown-content';
|
|
|
50
94
|
import 'tdesign-web-components/lib/chat-message';
|
|
51
95
|
import 'tdesign-web-components/lib/chat-sender';
|
|
52
96
|
import 'tdesign-web-components/lib/chat-message/content/thinking-content';
|
|
53
|
-
import '
|
|
54
|
-
import '
|
|
97
|
+
import './chat-engine/components/json-render/adapters/index.js';
|
|
98
|
+
import 'tdesign-react';
|
|
99
|
+
import '@json-render/core';
|
|
100
|
+
import './chat-engine/components/json-render/catalog/text.js';
|
|
101
|
+
import 'zod';
|
|
102
|
+
import './chat-engine/core/adapters/agui/types.js';
|
|
103
|
+
import './chat-engine/core/adapters/agui/event-mapper.js';
|
|
104
|
+
import './chat-engine/core/adapters/agui/utils.js';
|
|
55
105
|
//# 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
|
|
3
|
+
"version": "1.1.0-alpha.1",
|
|
4
4
|
"title": "@tdesign-react/chat",
|
|
5
5
|
"description": "TDesign Pro Component for AIGC",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -50,11 +50,14 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@babel/runtime": "~7.26.7",
|
|
53
|
-
"tdesign-web-components": "1.2.11-alpha.
|
|
53
|
+
"tdesign-web-components": "1.2.11-alpha.11",
|
|
54
54
|
"classnames": "~2.5.1",
|
|
55
55
|
"lodash-es": "^4.17.21",
|
|
56
56
|
"zod": "^3.24.2",
|
|
57
|
-
"cherry-markdown": "^0.10.0"
|
|
57
|
+
"cherry-markdown": "^0.10.0",
|
|
58
|
+
"@json-render/core": "^0.3.0",
|
|
59
|
+
"@json-render/react": "^0.2.0",
|
|
60
|
+
"tdesign-react": "workspace:^"
|
|
58
61
|
},
|
|
59
62
|
"devDependencies": {
|
|
60
63
|
"cors": "^2.8.5",
|
|
@@ -1,5 +0,0 @@
|
|
|
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;
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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,35 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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":";;;;;;;;;;;;;AAAkB,IAMZA,4BAA6B,gBAAA,YAAA;AAAA,EAAA,SAAAA,4BAAA,GAAA;AAAAC,IAAAA,eAAA,OAAAD,4BAAA,CAAA,CAAA;IAAAE,eAAA,CAAA,IAAA,EAAA,UAAA,EACS,EAAC,CAAA,CAAA;AAAAA,IAAAA,eAAA,CAGb,IAAA,EAAA,qBAAA,qBAAIC,GAGhC,EAAA,CAAA,CAAA;AAAA,GAAA;EAAA,OAAAC,YAAA,CAAAJ,4BAAA,EAAA,CAAA;IAAAK,GAAA,EAAA,UAAA;AAAAC,IAAAA,KAAA,EAKF,SAAAC,SACEC,MACM,EAAA;MACA,IAAAC,cAAA,GAAiB,IAAK,CAAAC,QAAA,CAASF,MAAO,CAAAG,IAAA,CAAA,CAAA;MAG5C,IAAIF,cAAkB,IAAAA,cAAA,CAAeG,SAAc,KAAAJ,MAAA,CAAOI,SAAW,EAAA;AAC9D,QAAA,IAAA,CAAAC,mBAAA,CAAA,QAAA,CAA2B,CAAAL,MAAA,CAAOG,IAAI,CAAA,CAAA;AAC7C,OAAA;MACK,IAAA,CAAAD,QAAA,CAASF,OAAOG,IAAQ,CAAA,GAAAH,MAAA,CAAA;AACtBM,MAAAA,MAAA,CAAAC,aAAA,CACL,IAAIC,YAAY,qBAAuB,EAAA;AACrCC,QAAAA,MAAQ,EAAA;UAAEN,IAAM,EAAAH,MAAA,CAAOG,IAAAA;AAAK,SAAA;AAC9B,OAAC,CACH,CAAA,CAAA;AACF,KAAA;AAAA,GAAA,EAAA;IAAAN,GAAA,EAAA,KAAA;AAAAC,IAAAA,KAAA,EAKA,SAAAY,IAAIP,IAA+C,EAAA;AACjD,MAAA,OAAO,KAAKD,QAAS,CAAAC,IAAA,CAAA,CAAA;AACvB,KAAA;AAAA,GAAA,EAAA;IAAAN,GAAA,EAAA,mBAAA;AAAAC,IAAAA,KAAA,EAKA,SAAAa,kBAAkBR,IAA6F,EAAA;AACvG,MAAA,IAAAH,MAAA,GAAS,KAAKE,QAAS,CAAAC,IAAA,CAAA,CAAA;AAC7B,MAAA,IAAI,CAACH,MAAA,EAAe,OAAA,IAAA,CAAA;MAGpB,IAAIY,iBAAoB,GAAA,IAAA,CAAKP,mBAAoB,CAAAK,GAAA,CAAIP,IAAI,CAAA,CAAA;MAEzD,IAAI,CAACS,iBAAmB,EAAA;AAEFA,QAAAA,iBAAA,gBAAAC,KAAA,CAAMC,KAAK,UAACC,KAAA,EAAA;UAAA,oBAAkCF,MAAMG,aAAc,CAAAhB,MAAA,CAAOI,SAAW,EAAAW,KAAK,CAAC,CAAA;SAAA,CAAA,CAAA;QAGzG,IAAA,CAAAV,mBAAA,CAAoBY,GAAI,CAAAd,IAAA,EAAMS,iBAAiB,CAAA,CAAA;AACtD,OAAA;AAEO,MAAA,OAAAA,iBAAA,CAAA;AACT,KAAA;AAAA,GAAA,EAAA;IAAAf,GAAA,EAAA,QAAA;AAAAC,IAAAA,KAAA,EAKA,SAAAoB,MAAgCA,GAAA;AACvB,MAAA,OAAAC,aAAA,CAAA,EAAA,EAAK,IAAA,CAAKjB,QAAS,CAAA,CAAA;AAC5B,KAAA;AAAA,GAAA,EAAA;IAAAL,GAAA,EAAA,YAAA;AAAAC,IAAAA,KAAA,EAKA,SAAAsB,WAAWjB,IAAoB,EAAA;AAC7B,MAAA,OAAO,KAAKD,QAAS,CAAAC,IAAA,CAAA,CAAA;AAChB,MAAA,IAAA,CAAAE,mBAAA,WAA2BF,IAAI,CAAA,CAAA;AACtC,KAAA;AAAA,GAAA,EAAA;IAAAN,GAAA,EAAA,OAAA;AAAAC,IAAAA,KAAA,EAKA,SAAAuB,KAAcA,GAAA;AACZ,MAAA,IAAA,CAAKnB,WAAW,EAAC,CAAA;AACjB,MAAA,IAAA,CAAKG,oBAAoBgB,KAAM,EAAA,CAAA;AACjC,KAAA;AAAA,GAAA,CAAA,CAAA,CAAA;AAAA,CAAA,EAAA,CAAA;IAIWC,qBAAA,GAAwB,IAAI9B,4BAA6B;;;;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
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 {};
|