Skip to content

docs: x-request transformStream#1716

Closed
kimteayon wants to merge 132 commits intomainfrom
sdk-feature
Closed

docs: x-request transformStream#1716
kimteayon wants to merge 132 commits intomainfrom
sdk-feature

Conversation

@kimteayon
Copy link
Collaborator

@kimteayon kimteayon commented Jan 30, 2026

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English
🇨🇳 Chinese 更新流转换QA

Summary by CodeRabbit

发布说明

  • 新功能

    • 聊天提供商回调现可接收额外的消息数据和响应头信息,增强了请求处理的灵活性。
  • 文档

    • 新增OpenAI回调使用示例和详细文档说明。
    • 补充transformStream流锁定问题的FAQ及最佳实践指南。
    • 更新回调函数签名文档,说明Chat Provider场景下的参数扩展。

✏️ Tip: You can customize this high-level summary in your review settings.

jinyang and others added 30 commits November 4, 2025 17:06
* feat: theme

* docs: add custom components

* feat: theme

* feat: theme

* feat: add theme

* feat: antd

* fix: fix test case

* feat(XMarkdown): Support openLinksInNewTab (#1164)

* feat: add openLinksInNewTab & docs change & xss

* fix: fix CR

* fix: fix CR

* fix: fix CR

* feat: xmarkdown default less

* feat: default less

* feat: theme

* docs: add custom components

* feat: theme

* feat: theme

* feat: add theme

* feat: antd

* fix: fix test case

* test: less

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* feat(use-x-chat): add updating status (#833)

* feat(use-x-chat): add updating status

* test(use-x-chat): fix test error about on-update callback

* docs(use-x-chat): add loading for stream demo

* fix(use-x-chat): always set loadingMsg when init

* fix(use-x-chat): set placeholderMsg default value to empty string

* test(use-x-chat): fix check filed for case about loading placeholder msg

---------

Co-authored-by: Mickey <951203214@qq.com>

* fix(ThoughtChain): fix the issue where title block-level elements cannot be displayed when collapsible is enabled (#1172)

* fix(thought-chain): 修改title的结构

* fix(thought-chain): 修改title部分结构,满足传递ReactNode

* chore: update snapShot

* update docs case

* update docs case

* update checkTextOverflow

* chore: update snapShot

* fix: replace span with div and update snapShot

* chore: changelog of 1.6.1 (#1173)

* chore: changelog of 1.6.1

* chore: changelog of 1.6.1

* chore: changelog of 1.6.1

* chore: net merge main

* chore: next merge main

* chore: next merge main

* chore: next merge main

* chore: next merge main

* chore: next merge main

* chore: next merge main

* chore: next merge main

* chore: next merge main

* fix: fix Mermaid render

* feat: remove console

* fix: fix build error

* docs: remove performance docs

* fix: fix test error

* chore: changelog of 2.0.0-alpha.7 & fixed Semantic of Xmardown (#1178)

* chore: changelog of 2.0.0-alpha.7

* chore: update

* docs: 更新antdx文档

* docs: 更新changelog文档位置

* docs: 更新changelog文档位置

* feat: site

* feat: markdown Semantic

* chore: version

* chore: changelog of alpha7

* fix: markdown

* fix: lint

* fix: lint

* fix:dekkp

* fix:dekkp

* fix: update snapshot

* docs: remove numbers in footnote

* fix: markdown  theme & Unified Type Naming (#1182)

* feat: css

* feat: ts

* feat: ts

* docs: repair the type error in the useXChat document (#1183)

* feat: container

* docs: 移除非必要的 return

* chore: update playground (#1184)

* feat: css

* feat: ts

* feat: ts

* chore: toolIdList

* chore: playground

* feat: plugins type modify

* docs: 依赖 antd & docs

* fix: fix lint error

* chore: update site config (#1186)

* feat: css

* feat: ts

* feat: ts

* chore: toolIdList

* chore: playground

* chore: update site config

* chore: markdown

* chore: markdown

* feat: update antd version

* feat: 依赖调整

* chore: bump ora from 8.2.0 to 9.0.0 (#1189)

Bumps [ora](https://github.com/sindresorhus/ora) from 8.2.0 to 9.0.0.
- [Release notes](https://github.com/sindresorhus/ora/releases)
- [Commits](sindresorhus/ora@v8.2.0...v9.0.0)

---
updated-dependencies:
- dependency-name: ora
  dependency-version: 9.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump jsdom from 26.1.0 to 27.0.0 (#1180)

Bumps [jsdom](https://github.com/jsdom/jsdom) from 26.1.0 to 27.0.0.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/main/Changelog.md)
- [Commits](jsdom/jsdom@26.1.0...27.0.0)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-version: 27.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add comprehensive FAQ questions with Chinese and English versions covering markdown, Vue, think tags, and mobile adaptation (#1117)

* Initial plan

* Add FAQ questions about markdown, Vue, think tags, and mobile adaptation

Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>

* Update FAQ with 2.0 info and add English translations

Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>

* Add PR link to Think component announcement in FAQ

Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>

* docs & type: fix lint error

* chore: update tbox website (#1191)

* chore: update tbox website

* chore: update tbox website

* chore: update tbox website next (#1192)

* chore: update tbox website next

* chore: update tbox website next

* chore: update tbox website

* feat: revert version

* chore: update og:image (#1193)

* feat: css

* feat: ts

* feat: ts

* chore: toolIdList

* chore: playground

* chore: update site config

* chore: markdown

* chore: markdown

* chore: 删除title

* chore: 删除title

* chore: 删除title

* chore: 删除title

* chore: 删除title

* chore: 删除title

* feat: scroll

* feat: modify dompurify config and user config

* feat: update antd version

* feat: all update antd alpha3

* fix: update playground & fix Actions Semantic &  update OpenAI model (#1194)

* feat: bubble info

* feat: scroll

* feat: scroll

* feat: ahooks

* feat: ahooks

* feat: ahooks

* chore: 更新open ai模型

* chore: update

* chore: update

* chore: update

* Feat(XMarkdown): 类型调整 & 文档补充 & 依赖 antd (#1187)

* feat: plugins type modify

* docs: 依赖 antd & docs

* fix: fix lint error

* feat: update antd version

* feat: 依赖调整

* docs & type: fix lint error

* feat: revert version

* feat: modify dompurify config and user config

* feat: update antd version

* feat: all update antd alpha3

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* feat: animation 调整 & 类型修改

* fix: fix ts lint

* feat: remove html tags

* fix: fix lint error

* type: modify type

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix CR

* docs: change

* Feature(XMarkdown):动画调整 & 导出类型修改 (#1198)

* feat: plugins type modify

* docs: 依赖 antd & docs

* fix: fix lint error

* feat: update antd version

* feat: 依赖调整

* docs & type: fix lint error

* feat: revert version

* feat: modify dompurify config and user config

* feat: update antd version

* feat: all update antd alpha3

* feat: animation 调整 & 类型修改

* fix: fix ts lint

* feat: remove html tags

* fix: fix lint error

* type: modify type

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix CR

* docs: change

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* docs: component docs

* Docs(XMarkdown): Component Docs (#1199)

* feat: plugins type modify

* docs: 依赖 antd & docs

* fix: fix lint error

* feat: update antd version

* feat: 依赖调整

* docs & type: fix lint error

* feat: revert version

* feat: modify dompurify config and user config

* feat: update antd version

* feat: all update antd alpha3

* feat: animation 调整 & 类型修改

* fix: fix ts lint

* feat: remove html tags

* fix: fix lint error

* type: modify type

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix CR

* docs: change

* docs: component docs

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* chore(ci): use setup-utoo (#1197)

* chore: setup utoo

* chore: remove @ant-design/x-markdown dev deps

* chore: default value

* fix: antd deps

---------

Co-authored-by: Mickey <951203214@qq.com>

* chore: bump tbox-nodejs-sdk from 0.0.14 to 0.0.17 (#1190)

Bumps [tbox-nodejs-sdk](https://github.com/tbox/tbox-nodejs-sdk) from 0.0.14 to 0.0.17.
- [Commits](https://github.com/tbox/tbox-nodejs-sdk/commits)

---
updated-dependencies:
- dependency-name: tbox-nodejs-sdk
  dependency-version: 0.0.17
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: add Bubble extra & update playground & useXChat setMessage can use fun (#1195)

* feat: appid

* feat: bubble extra data

* feat: bubble extra data

* feat: bubble extra data

* fix: css

* feat: bubble

* feat: bubble

* feat: x-sdk

* feat: x-sdk useXChat

* feat: x-sdk useXChat

* feat: test

* feat: test

* feat: test

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: modify animation

* docs: format

* feat: change startWith to indexOf

* fix: fix test case

* docs: 更换图标 (#1205)

* fix: fix lint error

* docs: change docs

* feat: change style

* Feature(XMarkdown):Animation (#1204)

* feat: plugins type modify

* docs: 依赖 antd & docs

* fix: fix lint error

* feat: update antd version

* feat: 依赖调整

* docs & type: fix lint error

* feat: revert version

* feat: modify dompurify config and user config

* feat: update antd version

* feat: all update antd alpha3

* feat: animation 调整 & 类型修改

* fix: fix ts lint

* feat: remove html tags

* fix: fix lint error

* type: modify type

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix CR

* docs: change

* docs: component docs

* feat: modify animation

* docs: format

* feat: change startWith to indexOf

* fix: fix test case

* fix: fix lint error

* docs: change docs

* feat: change style

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* chore: bump tbox-nodejs-sdk from 0.0.17 to 0.0.18 (#1206)

Bumps [tbox-nodejs-sdk](https://github.com/tbox/tbox-nodejs-sdk) from 0.0.17 to 0.0.18.
- [Commits](https://github.com/tbox/tbox-nodejs-sdk/commits)

---
updated-dependencies:
- dependency-name: tbox-nodejs-sdk
  dependency-version: 0.0.18
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump actions/github-script from 7 to 8 (#1159)

Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@v7...v8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: Update README (#1208)

* docs: Update README

Signed-off-by: afc163 <afc163@gmail.com>

* Update README-zh_CN.md

Signed-off-by: afc163 <afc163@gmail.com>

---------

Signed-off-by: afc163 <afc163@gmail.com>

* docs: add packages badges (#1209)

* docs: add packages badges

Signed-off-by: afc163 <afc163@gmail.com>

* Fix formatting in README.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update README-zh_CN.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update README-zh_CN.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update README-zh_CN.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update README-zh_CN.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update npm version badge to alpha version

Signed-off-by: afc163 <afc163@gmail.com>

* Update README to include GitHub contributors badge

Signed-off-by: afc163 <afc163@gmail.com>

---------

Signed-off-by: afc163 <afc163@gmail.com>

* feat: 支持遍历children

* fix: fix cr

* feat: animation support div and remove table style

* feat: changelog

* docs: revert changelog

* chore: changelog of 2.0.0-alpha.9 (#1214)

* docs: alpha9 changelog

* chore: update version

* chore: changelog

* chore: merge next-alpha to next  (#1210)

* docs: 更换图标

* docs: 更换图标

* docs: 删除多余句号

* 透传CascaderProps其他参数 (#1110)

* feat: 透传CascaderProps其他参数

* feat: onOpenChange和onDropdownVisibleChange也排除

* fix: 重复的全部排除

* fix: 调整顺序

---------

Co-authored-by: 彭星 <xing_peng@fzzixun.com>
Co-authored-by: Mickey <951203214@qq.com>

* docs: 中英文空格

* chore: x-markdown path modify

* chore: editbutton url

* fix(docs): fixed the incorrect Semantic DOM component names in the think component (#1218)

* docs: update the XProvider theme demo (#1216)

* docs: 更新主题demo

* fix: think

* fix: think

* chore: change x-sdk path

* docs: fix docs cr

* feat: Sender focus add slot (#1221)

* feat: Sender focus add slot

* feat: Sender focus add slot

* feat: Sender focus add slot

* feat: Sender focus add slot

* test: snapshots

* test: snapshots

* test: sender

* feat: Semantic type of Attachments and FileCard  (#1220)

* feat: update components semantic

* feat: update components semantic

* test: sender

* test: sender

* docs: seeConf

* docs: seeConf

* docs: SeeConf link (#1224)

* docs: seeConf

* docs: seeConf

* chore: bump peter-evans/commit-comment from 3 to 4 (#1230)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump @types/jsdom from 21.1.7 to 27.0.0 (#1229)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump father from 4.6.3 to 4.6.5 (#1181)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>

* chore: bump @happy-dom/jest-environment from 18.0.1 to 19.0.2 (#1228)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump happy-dom from 18.0.1 to 19.0.2 (#1227)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: update site home page (#1233)

* feat: site home lottie

* feat: site home lottie

* test: snap

* test: snap

* chore: lazy site compontents

* fix: site home

* feat: image and json

* feat: image and json

* docs: fix the component names in semanticDom (#1232)

* chore: bump @happy-dom/jest-environment from 19.0.2 to 20.0.0 (#1236)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump happy-dom from 19.0.2 to 20.0.0 (#1237)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Optimize sender input parameters: onPasteFile (#1242)

* fix: update onPasteFile

* feat: update

* fix: Fix document references to internationalization &  Add internationalization to SVG (#1243)

* fix: fix the local config

* fix: fix the local config

* chore: ignore scripts (#1247)

* fix: antd-token-previewer updated (#1246)

* feat(FileCaed): support jfif format (#1248)

* fix: x-sdk requestFallback error (#1244)

* fix: x-sdk requestFallback error

* fix: x-sdk requestFallback error

* test: 新增测试用例

* test: 新增测试用例

* test: 新增测试用例

* test: 新增测试用例

* feat: update isStreaming

* feat: Bubble.System & Bubble.Divider (#1239)

* feat: Bubble.System & Bubble.Divider

* docs: Bubble

* feat: Bubble.List support Bubble.System and Bubble.Divider

* fix: lint

* fix: test

* test: snapshot

* fix(Bubble): semantic of Bubble

* fix: lint

* feat: bubble

* feat: agent

* test: 新增测试用例

* test: 新增测试用例

* test: 新增测试用例

---------

Co-authored-by: Mickey <951203214@qq.com>

* feat: add sources component (#1250)

* feat: add sources component

* fix: lint fix

* fix: lint fix

* fix: add display

* fix: update test

* fix: test fix

* fix: test fix

* fix: add test

* fix: update doc cover

* fix: update test

---------

Co-authored-by: jiyang.hy <jiyang.hy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* feat: add  and update SDK demos & add  useXConversations activeConversationKey (#1252)

* docs: x-sdk

* docs: x-sdk

* docs: x-sdk

* fix: md eror

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* docs: 更新文档

* fix(XMarkdown): openLinksInNewTab 属性配置失效 (#1253)

* fxi: fix openLinksInNewTab is filtered by dompurify

* fix: fix ci

---------

Co-authored-by: Mickey <951203214@qq.com>

* fix: onRequest messages& isResqesting & requestPlaceholder & requestFallback  (#1254)

* docs: x-sdk

* docs: x-sdk

* docs: x-sdk

* fix: md eror

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* docs: 更新文档

* fix: 修复onrequest 数据处理

* test: 修改测试用例

* feat: add

* feat(XMarkdown): 支持通过组件匹配未完成的Markdown语法 (#1223)

* feat: support map incomplete image and link to components

* chore: change x-markdown docs

* feat: 移除对 emphasis 语法的缓存,避免误识别导致的异常

* fix: fix lint error

* feat: modify useStreaming cache

* feat: modify useStreaming cache

* feat: modify streamging way

* feat: 基础功能完成

* fix: test cases and demo

* feat: beatify code

* docs: modify docs

---------

Co-authored-by: Mickey <951203214@qq.com>

* fix(XMarkdown): 动画重复渲染 (#1255)

* docs: docs change

* fix: 移除支持动画标签,避免闪动

* fix: fix animation flash and remove useanimation

* feat: support config animation

* feat: beatify code and modify test case

* feat(XMarkdown): latex support (#1256)

* feat: inline katex support 19761\n..\n19761 formart

* feat: support inline \[ \] math

* chore: docs and test case

* fix(XMarkdown):格式缓存 (#1257)

* fix: fix list inner empahsis

* fix: fix regex

* feat: Sender supports SlotConfig changes & Sender supports the function of inserting and replacing characters (#1259)

* docs: 更换图标

* docs: 更换图标

* docs: 删除多余句号

* chore: chengelog of 2.0.0-alpha.10

* feat: date

* feat: dumi

* feat: dumi

* feat: sender

* feat: sender

* feat: sender

* test: lint

* test: lint

* fix: tbox

* test: snapshots

* test: snapshots

* test:slot  test

* test:slot  test

* test:slot  test

* test: snapshots

* test:slot

* test:slot

* test:slot

* test:slot

* test:slot

* test:slot

* fix: skip render animation text when parent is custom component (#1260)

* feat: The source reference component implements the current data functionality (#1261)

* feat: 来源引用组件

* feat: 来源引用组件

* feat: 来源引用组件

* feat: CustomParagraph

* feat: CustomParagraph

* feat: CustomParagraph

* feat: CustomParagraph

* docs: 新增 markdown 文档示例 (#1262)

* docs: 新增docs

* docs: 新增docs

* feat: Bubble list scroll (#1263)

* feat: lit scroll

* docs: update text

* bubble.list

* feat: bubble.lost

* feat: bubble.list

* feat: bubble.list

* feat: bubble.lost

* feat: bubble.lost

* feat: bubble.lost

* feat(XMarkdown): default KaTeX to silent error mode (#1265)

* feat: set latex default throwOnError is false and aviod redos

* feat: set default inline displayMode true and overrride css

* fix: fix cr

* fix: fix cr

* chore: chengelog of 2.0.0-alpha.11 (#1264)

* feat: bubble.lost

* feat: css

* docs:更新change log

* feat: Attachments add ref fun: select to select files & fix maxcount error (#1266)

* feat: attachments

* feat: attachments

* chore: lint

* feat: attachments

* chore: test

* docs: fix used Bubble.List demo error (#1269)

* docs: site update

* docs: site update

* chore: lint

* chore: lint

* chore: test

* docs: Chinese Link Processing (#1270)

* docs: Chinese Link Processing

* docs: Chinese Link Processing

* fix: fix key repeat (#1273)

Co-authored-by: jinyang <jinyang.cy@antgroup.com>

* feat(XMarkdown): add block and streamstatus to code component (#1272)

* feat: code token support block and streamStatus

* fix: fix lint

* fix: fix cr

* docs: api desc

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* docs: Organize and optimize documents of chat provider (#1274)

* docs: site update

* docs: site update

* chore: lint

* chore: lint

* chore: test

* docs: Chinese Link Processing

* docs: Chinese Link Processing

* docs: Chinese Link Processing

* chore: changelog of 2.0.0-alpha.12 (#1275)

* feat: bubble.lost

* feat: css

* docs:更新change log

* chore: changelog of 2.0.0-alpha.12

* chore: changelog of 2.0.0-alpha.12

* fix: fix user code paragraph link renderer not work (#1276)

Co-authored-by: jinyang <jinyang.cy@antgroup.com>

* feat: ThoughtChain & Think add blink  (#1278)

* feat: add

* fix: css

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: add blink to ThoughtChain (#1286)

* feat: add

* fix: css

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: thoughtchain 闪动

* feat: thoughtchain 闪动

* feat: 更新文档

* feat: Actions fade in (#1288)

* feat: Actions fade in

* feat: Actions fade in

* feat: Actions fade in

* feat: 更新文档

* feat:  delete Bubble.List suffix (#1285)

* feat: blink

* feat: test

* feat: 更新文档

* feat: 更新文档

* feat: update

* feat: 更新测试用例

* docs: the style with ComponentChangelog in the site (#1290)

* feat: 修复更新日志样式问题

* fix: code reivew comment

---------

Co-authored-by: Mickey <951203214@qq.com>

* feat: Actions motions &  prompts motions (#1289)

* feat: Actions fade in

* feat: Actions fade in

* feat: Actions fade in

* feat: 更新文档

* feat: action motion

* feat: 更新测试用例

* feat: 更新测试用例

* feat: 更新测试用例

* feat: 更新测试用例

* chore: changelog of 2.0.0-alpha.13 (#1292)

* feat: bubble.lost

* feat: css

* docs:更新change log

* chore: changelog of 2.0.0-alpha.12

* chore: changelog of 2.0.0-alpha.12

* chore: changelog of 2.0.0-alpha.13

* chore: changelog of 2.0.0-alpha.13

* chore: changelog of 2.0.0-alpha.13

* chore: changelog of 2.0.0-alpha.13

* fix: fix dompurifyConfig ALLOWED_TAGS wrong merge to ADD_TAGS

* fix: fix fenced code streamStatus set wrong

* fix: fix ci

* feat: peer dependece antd

* chore: overrides antd

* chore: overrides

* chore: antd

* fix: fix ci

* chore: antd version

* chore: antd

* chore: update antd 6.00-alpha.4 (#1300)

* feat: link docs

* feat: link docs

* feat: link docs

* feat: link docs

* chore: update antdv6

* chore: update antdv6

* chore: update antdv6

* chore: update antdv6

* chore: update antdv6

* chore: update antdv6

* chore: update antdv6

* feat: link docs

* chore: update antdv6

* chore: revert antd 6.0.0alpha.4 type change

* refactor(types): rename SteamingOption to StreamingOption and modify docs

* docs: api description

* docs: document update error (#1303)

* feat: markdown theme (#1305)

* chore: 整理文件

* chore: 整理文件

* chore: css

* feat: link docs

* feat: link

* feat: link

* fix: fix set code streamStastus wrong when code after \n\n (#1307)

Co-authored-by: jinyang <jinyang.cy@antgroup.com>

* style(XMarkdown): migrate component styles from Less to CSS (#1306)

* style: covert .less to .css

* fix: fix style

* fix: fix css build error

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>

* feat: token of blinkMotion (#1318)

* feat: token of blinkMotion

* test: lint

* feat: lint

* chore: changelog of 2.0.0-alpha.15 (#1310)

* chore: version

* feat: update markdown

* feat: update

* feat: push

* chore:changelog of 2.0.0-alpha.15

* chore:changelog of 2.0.0-alpha.15

* feat: FileCard image load  (#1311)

* feat: card file image loading

* feat: card file image loading

* feat: card file image loading

* feat: token of blinkMotion

* feat: card file image loading

* test: file-card

* feat: lint

* feat(XMarkdown): cache incomplete table & HTML tokens in useStreaming (#1322)

* feat: useStreaming support cache table and support incomplete-html

* docs: format docs config

* docs: streaming syntax docs

* fix: fix code review

* feat: stream incomplete regex avoid redos attack

* feat: change function type

---------

Co-authored-by: Mickey <951203214@qq.com>

* fix(XMarkdown): deafult table style (#1324)

* fix: table can scroll when content width over width

* fix: fix cr

* feat(XMarkdown): 全类型缓存映射 & 透传缓存原文本 & 文档优化 (#1325)

* feat: pass cache raw data to incomplete-token and map all cache token to incomplete-token

* feat: modify testcase

---------

Co-authored-by: Mickey <951203214@qq.com>

* chore(XMarkdown): modify theme style and format docs (#1326)

* docs: modify docs style

* chore: modify demo and css

* feat(XMarkdown): pass true when disabled and checked props exist (#1328)

* feat: pass true when checkbox disabled and checked exist

* fix: fix test

* chore: Added notification capability and configured WearFox notifications (#1329)

* feat: wearfox

* feat: wearfox

* feat: wearfox

* feat: wearfox

* feat: wearfox

* feat: test

* feat: test

* feat: remove unnessary heading cache and modify demo

* docs: format docs

* chore: test case

* docs: modify custom plugin docs

* docs: format html skeleton width

* docs: update Doc model from siliconcloud to bigmodel (#1335)

* docs: update docs

* feat: updatemodel

* feat: updatemodel

* perf(XMarkdown): use useMemo to optimize docs render & reduce useless calc (#1337)

* feat: performance and docs

* docs: basic demo

* fix: fix ci

* refactoring: bubble delete components props & internal props enhancement  (#1338)

* refactor: delete components props & internal props enhancement

* feat: updatemodel

* test: snapshots update

* feat: 1

* feat: docs

* docs: Change demo image URL in README (#1340)

* chore: next merge  next-alpha (#1339)

* chore: version

* feat: update markdown

* feat: update

* feat: push

* chore:changelog of 2.0.0-alpha.15

* chore:changelog of 2.0.0-alpha.15

* docs: xmarkdown theme

* chore: changelog of 2.0.0-alpha.16

* chore: changelog of 2.0.0-alpha.16

* feat: updatemodel

* feat: updatemodel

* feat: updatemodel

* feat: updatemodel

* docs: update docs

* docs: update docs

* docs: update docs

* fix: pathname

* feat: updatemodel

* feat: docs

* feat: docs

* fix: fix lint

* docs: update

* docs: update demo (#1341)

* feat: 1

* feat: docs

* docs: update

* docs: update demo

* docs: update demo

* feat: Replace the operation icons of HighlightCode and Mermaid in XMarkdown (#1344)

* chore: remove unused devDependencies (#1350)

* chore: Update workflow to use test-utoo.yml (#1351)

Signed-off-by: afc163 <afc163@gmail.com>

* docs: update demo

* chore: bump actions/checkout from 5 to 6 (#1353)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump webpack-bundle-analyzer from 4.10.2 to 5.0.0 (#1333)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump happy-dom (#1354)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: changelog of 2.0.0 (#1355)

* chore: changelog 2.0.0

* chore: changelog 2.0.0

* chore: fix wrong of merge (#1359)

* feat: site

* feat: site

* feat: site

* chore: fix site home (#1361)

* feat: site

* feat: site

* feat: site

* feat: site

* feat: site

* docs: update badges in README.md (#1360)

* chore: fix main site (#1362)

* feat: site

* feat: site

* feat: site

* feat: site

* feat: site

* feat: site

* chore: update site-deploy (#1363)

* feat: site

* feat: site

* feat: site

* feat: site

* feat: site

* feat: site

* feat: site

* feat: site

* feat: site

* feat: site

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: afc163 <afc163@gmail.com>
Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Div627 <54497462+Div627@users.noreply.github.com>
Co-authored-by: wzc520pyfm <1528857653@qq.com>
Co-authored-by: doki- <95574719+IsDyh01@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Div627 <chenyang_nn@163.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
Co-authored-by: iamkun-2 <zhukun.zk@antgroup.com>
Co-authored-by: elrrrrrrr <elrrrrrrr@gmail.com>
Co-authored-by: anxLiang <29624088+anxLiang@users.noreply.github.com>
Co-authored-by: guxingke201 <523411605@qq.com>
Co-authored-by: 彭星 <xing_peng@fzzixun.com>
Co-authored-by: HongYang <33488114+hy993658052@users.noreply.github.com>
Co-authored-by: jiyang.hy <jiyang.hy@antgroup.com>
Co-authored-by: Rain120 <1085131904@qq.com>
Co-authored-by: BuHao <buwenhao.bwh@digital-engine.com>
…capabilities (#1377)

* chore: changelog of 2.0.0-alpha.7 & fixed Semantic of Xmardown (#1178)

* chore: changelog of 2.0.0-alpha.7

* chore: update

* docs: 更新antdx文档

* docs: 更新changelog文档位置

* docs: 更新changelog文档位置

* feat: site

* feat: markdown Semantic

* chore: version

* chore: changelog of alpha7

* fix: markdown

* fix: lint

* fix: lint

* fix:dekkp

* fix:dekkp

* fix: update snapshot

* docs: remove numbers in footnote

* fix: markdown  theme & Unified Type Naming (#1182)

* feat: css

* feat: ts

* feat: ts

* docs: repair the type error in the useXChat document (#1183)

* feat: container

* docs: 移除非必要的 return

* chore: update playground (#1184)

* feat: css

* feat: ts

* feat: ts

* chore: toolIdList

* chore: playground

* feat: plugins type modify

* docs: 依赖 antd & docs

* fix: fix lint error

* chore: update site config (#1186)

* feat: css

* feat: ts

* feat: ts

* chore: toolIdList

* chore: playground

* chore: update site config

* chore: markdown

* chore: markdown

* feat: update antd version

* feat: 依赖调整

* chore: bump ora from 8.2.0 to 9.0.0 (#1189)

Bumps [ora](https://github.com/sindresorhus/ora) from 8.2.0 to 9.0.0.
- [Release notes](https://github.com/sindresorhus/ora/releases)
- [Commits](sindresorhus/ora@v8.2.0...v9.0.0)

---
updated-dependencies:
- dependency-name: ora
  dependency-version: 9.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump jsdom from 26.1.0 to 27.0.0 (#1180)

Bumps [jsdom](https://github.com/jsdom/jsdom) from 26.1.0 to 27.0.0.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/main/Changelog.md)
- [Commits](jsdom/jsdom@26.1.0...27.0.0)

---
updated-dependencies:
- dependency-name: jsdom
  dependency-version: 27.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add comprehensive FAQ questions with Chinese and English versions covering markdown, Vue, think tags, and mobile adaptation (#1117)

* Initial plan

* Add FAQ questions about markdown, Vue, think tags, and mobile adaptation

Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>

* Update FAQ with 2.0 info and add English translations

Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>

* Add PR link to Think component announcement in FAQ

Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>

* docs & type: fix lint error

* chore: update tbox website (#1191)

* chore: update tbox website

* chore: update tbox website

* chore: update tbox website next (#1192)

* chore: update tbox website next

* chore: update tbox website next

* chore: update tbox website

* feat: revert version

* chore: update og:image (#1193)

* feat: css

* feat: ts

* feat: ts

* chore: toolIdList

* chore: playground

* chore: update site config

* chore: markdown

* chore: markdown

* chore: 删除title

* chore: 删除title

* chore: 删除title

* chore: 删除title

* chore: 删除title

* chore: 删除title

* feat: scroll

* feat: modify dompurify config and user config

* feat: update antd version

* feat: all update antd alpha3

* fix: update playground & fix Actions Semantic &  update OpenAI model (#1194)

* feat: bubble info

* feat: scroll

* feat: scroll

* feat: ahooks

* feat: ahooks

* feat: ahooks

* chore: 更新open ai模型

* chore: update

* chore: update

* chore: update

* Feat(XMarkdown): 类型调整 & 文档补充 & 依赖 antd (#1187)

* feat: plugins type modify

* docs: 依赖 antd & docs

* fix: fix lint error

* feat: update antd version

* feat: 依赖调整

* docs & type: fix lint error

* feat: revert version

* feat: modify dompurify config and user config

* feat: update antd version

* feat: all update antd alpha3

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* feat: animation 调整 & 类型修改

* fix: fix ts lint

* feat: remove html tags

* fix: fix lint error

* type: modify type

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix CR

* docs: change

* Feature(XMarkdown):动画调整 & 导出类型修改 (#1198)

* feat: plugins type modify

* docs: 依赖 antd & docs

* fix: fix lint error

* feat: update antd version

* feat: 依赖调整

* docs & type: fix lint error

* feat: revert version

* feat: modify dompurify config and user config

* feat: update antd version

* feat: all update antd alpha3

* feat: animation 调整 & 类型修改

* fix: fix ts lint

* feat: remove html tags

* fix: fix lint error

* type: modify type

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix CR

* docs: change

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* docs: component docs

* Docs(XMarkdown): Component Docs (#1199)

* feat: plugins type modify

* docs: 依赖 antd & docs

* fix: fix lint error

* feat: update antd version

* feat: 依赖调整

* docs & type: fix lint error

* feat: revert version

* feat: modify dompurify config and user config

* feat: update antd version

* feat: all update antd alpha3

* feat: animation 调整 & 类型修改

* fix: fix ts lint

* feat: remove html tags

* fix: fix lint error

* type: modify type

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix CR

* docs: change

* docs: component docs

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* chore(ci): use setup-utoo (#1197)

* chore: setup utoo

* chore: remove @ant-design/x-markdown dev deps

* chore: default value

* fix: antd deps

---------

Co-authored-by: Mickey <951203214@qq.com>

* chore: bump tbox-nodejs-sdk from 0.0.14 to 0.0.17 (#1190)

Bumps [tbox-nodejs-sdk](https://github.com/tbox/tbox-nodejs-sdk) from 0.0.14 to 0.0.17.
- [Commits](https://github.com/tbox/tbox-nodejs-sdk/commits)

---
updated-dependencies:
- dependency-name: tbox-nodejs-sdk
  dependency-version: 0.0.17
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: add Bubble extra & update playground & useXChat setMessage can use fun (#1195)

* feat: appid

* feat: bubble extra data

* feat: bubble extra data

* feat: bubble extra data

* fix: css

* feat: bubble

* feat: bubble

* feat: x-sdk

* feat: x-sdk useXChat

* feat: x-sdk useXChat

* feat: test

* feat: test

* feat: test

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: playground

* feat: modify animation

* docs: format

* feat: change startWith to indexOf

* fix: fix test case

* docs: 更换图标 (#1205)

* fix: fix lint error

* docs: change docs

* feat: change style

* Feature(XMarkdown):Animation (#1204)

* feat: plugins type modify

* docs: 依赖 antd & docs

* fix: fix lint error

* feat: update antd version

* feat: 依赖调整

* docs & type: fix lint error

* feat: revert version

* feat: modify dompurify config and user config

* feat: update antd version

* feat: all update antd alpha3

* feat: animation 调整 & 类型修改

* fix: fix ts lint

* feat: remove html tags

* fix: fix lint error

* type: modify type

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix lint error

* fix: fix CR

* docs: change

* docs: component docs

* feat: modify animation

* docs: format

* feat: change startWith to indexOf

* fix: fix test case

* fix: fix lint error

* docs: change docs

* feat: change style

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* chore: bump tbox-nodejs-sdk from 0.0.17 to 0.0.18 (#1206)

Bumps [tbox-nodejs-sdk](https://github.com/tbox/tbox-nodejs-sdk) from 0.0.17 to 0.0.18.
- [Commits](https://github.com/tbox/tbox-nodejs-sdk/commits)

---
updated-dependencies:
- dependency-name: tbox-nodejs-sdk
  dependency-version: 0.0.18
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump actions/github-script from 7 to 8 (#1159)

Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@v7...v8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: Update README (#1208)

* docs: Update README

Signed-off-by: afc163 <afc163@gmail.com>

* Update README-zh_CN.md

Signed-off-by: afc163 <afc163@gmail.com>

---------

Signed-off-by: afc163 <afc163@gmail.com>

* docs: add packages badges (#1209)

* docs: add packages badges

Signed-off-by: afc163 <afc163@gmail.com>

* Fix formatting in README.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update README-zh_CN.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update README-zh_CN.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update README-zh_CN.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update README-zh_CN.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update npm version badge to alpha version

Signed-off-by: afc163 <afc163@gmail.com>

* Update README to include GitHub contributors badge

Signed-off-by: afc163 <afc163@gmail.com>

---------

Signed-off-by: afc163 <afc163@gmail.com>

* feat: 支持遍历children

* fix: fix cr

* feat: animation support div and remove table style

* feat: changelog

* docs: revert changelog

* chore: changelog of 2.0.0-alpha.9 (#1214)

* docs: alpha9 changelog

* chore: update version

* chore: changelog

* chore: merge next-alpha to next  (#1210)

* docs: 更换图标

* docs: 更换图标

* docs: 删除多余句号

* 透传CascaderProps其他参数 (#1110)

* feat: 透传CascaderProps其他参数

* feat: onOpenChange和onDropdownVisibleChange也排除

* fix: 重复的全部排除

* fix: 调整顺序

---------

Co-authored-by: 彭星 <xing_peng@fzzixun.com>
Co-authored-by: Mickey <951203214@qq.com>

* docs: 中英文空格

* chore: x-markdown path modify

* chore: editbutton url

* fix(docs): fixed the incorrect Semantic DOM component names in the think component (#1218)

* docs: update the XProvider theme demo (#1216)

* docs: 更新主题demo

* fix: think

* fix: think

* chore: change x-sdk path

* docs: fix docs cr

* feat: Sender focus add slot (#1221)

* feat: Sender focus add slot

* feat: Sender focus add slot

* feat: Sender focus add slot

* feat: Sender focus add slot

* test: snapshots

* test: snapshots

* test: sender

* feat: Semantic type of Attachments and FileCard  (#1220)

* feat: update components semantic

* feat: update components semantic

* test: sender

* test: sender

* docs: seeConf

* docs: seeConf

* docs: SeeConf link (#1224)

* docs: seeConf

* docs: seeConf

* chore: bump peter-evans/commit-comment from 3 to 4 (#1230)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump @types/jsdom from 21.1.7 to 27.0.0 (#1229)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump father from 4.6.3 to 4.6.5 (#1181)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>

* chore: bump @happy-dom/jest-environment from 18.0.1 to 19.0.2 (#1228)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump happy-dom from 18.0.1 to 19.0.2 (#1227)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: update site home page (#1233)

* feat: site home lottie

* feat: site home lottie

* test: snap

* test: snap

* chore: lazy site compontents

* fix: site home

* feat: image and json

* feat: image and json

* docs: fix the component names in semanticDom (#1232)

* chore: bump @happy-dom/jest-environment from 19.0.2 to 20.0.0 (#1236)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: bump happy-dom from 19.0.2 to 20.0.0 (#1237)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Optimize sender input parameters: onPasteFile (#1242)

* fix: update onPasteFile

* feat: update

* fix: Fix document references to internationalization &  Add internationalization to SVG (#1243)

* fix: fix the local config

* fix: fix the local config

* chore: ignore scripts (#1247)

* fix: antd-token-previewer updated (#1246)

* feat(FileCaed): support jfif format (#1248)

* fix: x-sdk requestFallback error (#1244)

* fix: x-sdk requestFallback error

* fix: x-sdk requestFallback error

* test: 新增测试用例

* test: 新增测试用例

* test: 新增测试用例

* test: 新增测试用例

* feat: update isStreaming

* feat: Bubble.System & Bubble.Divider (#1239)

* feat: Bubble.System & Bubble.Divider

* docs: Bubble

* feat: Bubble.List support Bubble.System and Bubble.Divider

* fix: lint

* fix: test

* test: snapshot

* fix(Bubble): semantic of Bubble

* fix: lint

* feat: bubble

* feat: agent

* test: 新增测试用例

* test: 新增测试用例

* test: 新增测试用例

---------

Co-authored-by: Mickey <951203214@qq.com>

* feat: add sources component (#1250)

* feat: add sources component

* fix: lint fix

* fix: lint fix

* fix: add display

* fix: update test

* fix: test fix

* fix: test fix

* fix: add test

* fix: update doc cover

* fix: update test

---------

Co-authored-by: jiyang.hy <jiyang.hy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* feat: add  and update SDK demos & add  useXConversations activeConversationKey (#1252)

* docs: x-sdk

* docs: x-sdk

* docs: x-sdk

* fix: md eror

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* docs: 更新文档

* fix(XMarkdown): openLinksInNewTab 属性配置失效 (#1253)

* fxi: fix openLinksInNewTab is filtered by dompurify

* fix: fix ci

---------

Co-authored-by: Mickey <951203214@qq.com>

* fix: onRequest messages& isResqesting & requestPlaceholder & requestFallback  (#1254)

* docs: x-sdk

* docs: x-sdk

* docs: x-sdk

* fix: md eror

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* feat: activeConversationKey

* docs: 更新文档

* fix: 修复onrequest 数据处理

* test: 修改测试用例

* feat: add

* feat(XMarkdown): 支持通过组件匹配未完成的Markdown语法 (#1223)

* feat: support map incomplete image and link to components

* chore: change x-markdown docs

* feat: 移除对 emphasis 语法的缓存,避免误识别导致的异常

* fix: fix lint error

* feat: modify useStreaming cache

* feat: modify useStreaming cache

* feat: modify streamging way

* feat: 基础功能完成

* fix: test cases and demo

* feat: beatify code

* docs: modify docs

---------

Co-authored-by: Mickey <951203214@qq.com>

* fix(XMarkdown): 动画重复渲染 (#1255)

* docs: docs change

* fix: 移除支持动画标签,避免闪动

* fix: fix animation flash and remove useanimation

* feat: support config animation

* feat: beatify code and modify test case

* feat(XMarkdown): latex support (#1256)

* feat: inline katex support 19761\n..\n19761 formart

* feat: support inline \[ \] math

* chore: docs and test case

* fix(XMarkdown):格式缓存 (#1257)

* fix: fix list inner empahsis

* fix: fix regex

* feat: Sender supports SlotConfig changes & Sender supports the function of inserting and replacing characters (#1259)

* docs: 更换图标

* docs: 更换图标

* docs: 删除多余句号

* chore: chengelog of 2.0.0-alpha.10

* feat: date

* feat: dumi

* feat: dumi

* feat: sender

* feat: sender

* feat: sender

* test: lint

* test: lint

* fix: tbox

* test: snapshots

* test: snapshots

* test:slot  test

* test:slot  test

* test:slot  test

* test: snapshots

* test:slot

* test:slot

* test:slot

* test:slot

* test:slot

* test:slot

* fix: skip render animation text when parent is custom component (#1260)

* feat: The source reference component implements the current data functionality (#1261)

* feat: 来源引用组件

* feat: 来源引用组件

* feat: 来源引用组件

* feat: CustomParagraph

* feat: CustomParagraph

* feat: CustomParagraph

* feat: CustomParagraph

* docs: 新增 markdown 文档示例 (#1262)

* docs: 新增docs

* docs: 新增docs

* feat: Bubble list scroll (#1263)

* feat: lit scroll

* docs: update text

* bubble.list

* feat: bubble.lost

* feat: bubble.list

* feat: bubble.list

* feat: bubble.lost

* feat: bubble.lost

* feat: bubble.lost

* feat(XMarkdown): default KaTeX to silent error mode (#1265)

* feat: set latex default throwOnError is false and aviod redos

* feat: set default inline displayMode true and overrride css

* fix: fix cr

* fix: fix cr

* chore: chengelog of 2.0.0-alpha.11 (#1264)

* feat: bubble.lost

* feat: css

* docs:更新change log

* feat: Attachments add ref fun: select to select files & fix maxcount error (#1266)

* feat: attachments

* feat: attachments

* chore: lint

* feat: attachments

* chore: test

* docs: fix used Bubble.List demo error (#1269)

* docs: site update

* docs: site update

* chore: lint

* chore: lint

* chore: test

* docs: Chinese Link Processing (#1270)

* docs: Chinese Link Processing

* docs: Chinese Link Processing

* fix: fix key repeat (#1273)

Co-authored-by: jinyang <jinyang.cy@antgroup.com>

* feat(XMarkdown): add block and streamstatus to code component (#1272)

* feat: code token support block and streamStatus

* fix: fix lint

* fix: fix cr

* docs: api desc

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: Mickey <951203214@qq.com>

* docs: Organize and optimize documents of chat provider (#1274)

* docs: site update

* docs: site update

* chore: lint

* chore: lint

* chore: test

* docs: Chinese Link Processing

* docs: Chinese Link Processing

* docs: Chinese Link Processing

* chore: changelog of 2.0.0-alpha.12 (#1275)

* feat: bubble.lost

* feat: css

* docs:更新change log

* chore: changelog of 2.0.0-alpha.12

* chore: changelog of 2.0.0-alpha.12

* fix: fix user code paragraph link renderer not work (#1276)

Co-authored-by: jinyang <jinyang.cy@antgroup.com>

* feat: ThoughtChain & Think add blink  (#1278)

* feat: add

* fix: css

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: add blink to ThoughtChain (#1286)

* feat: add

* fix: css

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: blink

* feat: thoughtchain 闪动

* feat: thoughtchain 闪动

* feat: 更新文档

* feat: Actions fade in (#1288)

* feat: Actions fade in

* feat: Actions fade in

* feat: Actions fade in

* feat: 更新文档

* feat:  delete Bubble.List suffix (#1285)

* feat: blink

* feat: test

* feat: 更新文档

* feat: 更新文档

* feat: update

* feat: 更新测试用例

* docs: the style with ComponentChangelog in the site (#1290)

* feat: 修复更新日志样式问题

* fix: code reivew comment

---------

Co-authored-by: Mickey <951203214@qq.com>

* feat: Actions motions &  prompts motions (#1289)

* feat: Actions fade in

* feat: Actions fade in

* feat: Actions fade in

* feat: 更新文档

* feat: action motion

* feat: 更新测试用例

* feat: 更新测试用例

* feat: 更新测试用例

* feat: 更新测试用例

* chore: changelog of 2.0.0-alpha.13 (#1292)

* feat: bubble.lost

* feat: css

* docs:更新change log

* chore: changelog of 2.0.0-alpha.12

* chore: changelog of 2.0.0-alpha.12

* chore: changelog of 2.0.0-alpha.13

* chore: changelog of 2.0.0-alpha.13

* chore: changelog of 2.0.0-alpha.13

* chore: changelog of 2.0.0-alpha.13

* fix: fix dompurifyConfig ALLOWED_TAGS wrong merge to ADD_TAGS

* fix: fix fenced code streamStatus set wrong

* fix: fix ci

* feat: peer dependece antd

* chore: overrides antd

* chore: overrides

* chore: antd

* fix: fix ci

* chore: antd version

* chore: antd

* chore: update antd 6.00-alpha.4 (#1300)

* feat: link docs

* feat: link docs

* feat: link docs

* feat: link docs

* chore: update antdv6

* chore: update antdv6

* chore: update antdv6

* chore: update antdv6

* chore: update antdv6

* chore: update antdv6

* chore: update antdv6

* feat: link docs

* chore: update antdv6

* chore: revert antd 6.0.0alpha.4 type change

* refactor(types): rename SteamingOption to StreamingOption and modify docs

* docs: api description

* docs: document update error (#1303)

* feat: markdown theme (#1305)

* chore: 整理文件

* chore: 整理文件

* chore: css

* feat: link docs

* feat: link

* feat: link

* fix: fix set code streamStastus wrong when code after \n\n (#1307)

Co-authored-by: jinyang <jinyang.cy@antgroup.com>

* style(XMarkdown): migrate component styles from Less to CSS (#1306)

* style: covert .less to .css

* fix: fix style

* fix: fix css build error

---------

Co-authored-by: jinyang <jinyang.cy@antgroup.com>

* feat: commit

* feat: token of blinkMotion (#1318)

* feat: token of blinkMotion

* test: lint

* feat: lint

* chore: changelog of 2.0.0-alpha.15 (#1310)

* chore: version

* feat: update markdown

* feat: update

* feat: push

* chore:changelog of 2.0.0-alpha.15

* chore:changelog of 2.0.0-alpha.15

* feat: FileCard image load  (#1311)

* feat: card file image loading

* feat: card file image loading

* feat: card file image loading

* feat: token of blinkMotion

* feat: card file image loading

* test: file-card

* feat: lint

* feat(XMarkdown): cache incomplete table & HTML tokens in useStreaming (#1322)

* feat: useStreaming support cache table and support incomplete-html

* docs: format docs config

* docs: streaming syntax docs

* fix: fix code review

* feat: stream incomplete regex avoid redos attack

* feat: change function type

---------

Co-authored-by: Mickey <951203214@qq.com>

* feat: lint

* feat: lint

* fix(XMarkdown): deafult table style (#1324)

* fix: table can scroll when content width over width

* fix: fix cr

* feat(XMarkdown): 全类型缓存映射 & 透传缓存原文本 & 文档优化 (#1325)

* feat: pass cache raw data to incomplete-token and map all cache token to incomplete-token

* feat: modify testcase

---------

Co-authored-by: Mickey <951203214@qq.com>

* chore(XMarkdown): modify theme style and format docs (#1326)

* docs: modify docs style

* chore: modify demo and css

* feat: edit

* feat: sop

* feat: sop

* chore: changelog of 2.0.0-alpha.16

* feat: agent

* feat(XMarkdown): pass true when disabled and checked props exist (#1328)

* feat: pass true when checkbox disabled and checked exist

* fix: fix test

* chore: Added notification capability and configured WearFox notifications (#1329)

* feat: wearfox

* feat: wearfox

* feat: wearfox

* feat: wearfox

* feat: wearfox

* feat: test

* feat: test

* feat: sender

* feat: sender

* feat: remove unnessary heading cache and modify demo

* docs: format docs

* chore: test case

* docs: modify custom plugin docs

* docs: format html skeleton width

* docs: update Doc model from siliconcloud to bigmodel (#1335)

* docs: update docs

* feat: updatemodel

* feat: updatemodel

* perf(XMarkdown): use useMemo to optimize docs render & reduce useless calc (#1337)

* feat: performance and docs

* docs: basic demo

* fix: fix ci

* refactoring: bubble delete components props & internal props enhancement  (#1338)

* refactor: delete components props & internal props enhancement

* feat: updatemodel

* test: snapshots update

* feat: 1

* feat: docs

* docs: Change demo image URL in README (#1340)

* chore: next merge  next-alpha (#1339)

* chore: version

* feat: update markdown

* feat: update

* feat: push

* chore:changelog of 2.0.0-alpha.15

* chore:changelog of 2.0.0-alpha.15

* docs: xmarkdown theme

* chore: changelog of 2.0.0-alpha.16

* chore: changelog of 2.0.0-alpha.16

* feat: updatemodel

* feat: updatemodel

* feat: updatemodel

* feat: updatemodel

* docs: update docs

* docs: update docs

* docs: update docs

* fix: pathname

* feat: updatemodel

* feat: docs

* feat: docs

* fix: fix lint

* docs: update

* docs: update demo (#1341)

* feat: 1

* feat: docs

* docs: update

* docs: update demo

* docs: update demo

* feat: Replace the operation icons of HighlightCode and Mermaid in XMarkdown (#1344)

* chore: remove unused devDependencies (#1350)

* feat: sender

* feat: sender

* feat: sender

* feat: sender

* feat: sender

* feat: sender

* feat: skill

* feat: skill

* feat: sender

* feat: sender

* feat: sender

* fix: sender

* fix: sender lint

* fix: sender lint

* feat: update tsconfig

* feat: cnavas

* feat: cnavas

* feat: cnavas

* feat: cnavas

* feat: cnavas

* test: slote test

* feat: cnavas

* test: speech 覆盖率

* test: speech 覆盖率

* test: sender

* test: sender

* test: sender

* test: sender

* feat: test

* feat: test

* test: sende

* test: sende

* test: sende

* test: sende

* test: sendee

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: afc163 <afc163@gmail.com>
Co-authored-by: jinyang <jinyang.cy@antgroup.com>
Co-authored-by: doki- <95574719+IsDyh01@users.noreply.github.com>
Co-authored-by: Div627 <54497462+Div627@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
Co-authored-by: iamkun-2 <zhukun.zk@antgroup.com>
Co-authored-by: elrrrrrrr <elrrrrrrr@gmail.com>
Co-authored-by: anxLiang <29624088+anxLiang@users.noreply.github.com>
Co-authored-by: div627 <chenyang_nn@163.com>
Co-authored-by: guxingke201 <523411605@qq.com>
Co-authored-by: 彭星 <xing_peng@fzzixun.com>
Co-authored-by: HongYang <33488114+hy993658052@users.noreply.github.com>
Co-authored-by: jiyang.hy <jiyang.hy@antgroup.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rain120 <1085131904@qq.com>
Co-authored-by: BuHao <buwenhao.bwh@digital-engine.com>
fix(XMarkdown): fix truncated-emoji encoding error & strip incomplete HTML
@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

Preview is ready

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

概述

本次更改在整个 x-sdk 代码库中引入了新的通用 ChatMessage 类型参数,使其贯穿 AbstractChatProvider、XRequest 类和回调接口,并添加了新的抽象方法 transformLocalMessage 以支持消息转换。

变更内容

分组 / 文件 总结
核心请求框架
packages/x-sdk/src/x-request/index.ts, packages/x-sdk/src/x-request/__test__/index.test.ts
引入 ChatMessage extends SimpleType 泛型参数,扩展 XRequestCallbacks 接口使其在 onSuccess、onUpdate 和 onError 回调中传递消息和响应头,更新 AbstractXRequestClass、XRequestClass 及工厂函数签名以支持新的泛型参数,并调整测试用例验证新的三参数 onError 回调行为。
抽象聊天提供程序
packages/x-sdk/src/chat-providers/AbstractChatProvider.ts
添加 ChatMessage extends SimpleType 泛型参数到类、配置和回调,引入新的抽象方法 transformLocalMessage,增强 injectRequest 以传递转换后的消息到原始回调,并更新 transformParams 签名以支持新的泛型感知选项。
具体聊天提供程序实现
packages/x-sdk/src/chat-providers/DeepSeekChatProvider.ts, packages/x-sdk/src/chat-providers/DefaultChatProvider.ts, packages/x-sdk/src/chat-providers/OpenAIChatProvider.ts
更新 transformParams 方法签名以接受 XRequestOptions<Input, Output, ChatMessage> 参数,确保类泛型声明包含约束的 ChatMessage 类型。
聊天模块实现
packages/x-sdk/src/x-chat/index.ts, packages/x-sdk/src/x-chat/__test__/index.test.tsx
将 requestHandlerRef 更新为使用 AbstractXRequestClass<Input, Output, ChatMessage> 以支持消息传播,调整请求处理程序以捕获和返回更新的消息,修改测试用例的 DefaultChatProvider 泛型参数为 SimpleType。
演示和示例
packages/x/docs/x-sdk/demos/x-chat/openai-callback.tsx, packages/x/docs/x-sdk/demos/x-request/custom-transformer.tsx, packages/x/docs/playground/agent-tbox.tsx
添加完整的 OpenAI 聊天回调演示应用,展示手动请求流程和消息处理,将 custom-transformer 重构为工厂函数模式,更新 AgentTbox 以使用 content.ext_text。
文档更新
packages/x/docs/x-sdk/demos/x-chat/openai-callback.md, packages/x/docs/x-sdk/use-x-chat.en-US.md, packages/x/docs/x-sdk/use-x-chat.zh-CN.md, packages/x/docs/x-sdk/x-request.en-US.md, packages/x/docs/x-sdk/x-request.zh-CN.md
扩展 API 文档以描述更新的回调签名和 ChatMessage 参数,添加新的演示引用,增加 transformStream 流锁定问题的常见问题解答部分。

序列图

sequenceDiagram
    actor User
    participant ChatProvider as 聊天提供程序
    participant XRequest as XRequest 请求类
    participant Callbacks as 回调处理程序
    participant App as 应用界面

    User->>ChatProvider: 发送用户消息
    ChatProvider->>ChatProvider: transformLocalMessage()<br/>生成 ChatMessage
    ChatProvider->>XRequest: injectRequest(callbacks)
    XRequest->>XRequest: 发送请求并流式接收
    XRequest->>Callbacks: onUpdate(data, headers,<br/>chatMessage)
    Callbacks->>App: 更新 UI 消息流
    XRequest->>Callbacks: onSuccess(data[], headers,<br/>chatMessage)
    Callbacks->>App: 显示完整消息
    alt 请求失败
        XRequest->>Callbacks: onError(error, info,<br/>headers, fallbackMsg)
        Callbacks->>App: 显示错误和降级消息
    end
Loading

估计代码审查工作量

🎯 4 (复杂) | ⏱️ ~45 分钟

诗歌

🐰 聊天消息在流动,
通用 ChatMessage 添新彩,
回调参数齐参演,
从请求到界面更通透,
小兔庆贺架构妙!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sdk-feature

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dosubot dosubot bot added the documentation Improvements or additions to documentation label Jan 30, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kimteayon, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the x-sdk's request and chat provider functionalities by introducing a generic ChatMessage type parameter to improve type safety and flexibility in handling chat messages. It enhances the XRequest callback mechanisms to provide more comprehensive message context during different stages of a request (update, success, error) and addresses a critical stream locking issue by recommending transformStream to be a function that returns a new instance. These changes aim to make the SDK more robust and easier to integrate with diverse chat models and custom stream processing logic, complemented by updated documentation and a new demo.

Highlights

  • Enhanced Type Safety with ChatMessage Generic: The ChatMessage type parameter has been consistently applied across AbstractChatProvider, XRequestCallbacks, XRequestOptions, AbstractXRequestClass, and XRequestClass. This significantly improves type safety and allows for more specific message handling within the chat and request functionalities.
  • Expanded Callback Signatures for XRequest: The onSuccess, onError, and onUpdate callbacks in XRequestCallbacks now include additional parameters. onSuccess and onUpdate can receive an optional chatMessage parameter, while onError now includes responseHeaders and an optional fallbackMsg, providing richer context during request lifecycle events.
  • Improved transformStream Handling to Prevent Locking Issues: The transformStream option in XRequestOptions can now accept a function that returns a new TransformStream instance. This change, along with new documentation, addresses and provides a solution for potential stream locking issues that could occur when reusing TransformStream instances.
  • New Documentation and Demo for Callback Usage: A new documentation page and a demo (openai-callback.tsx, openai-callback.md) have been added to illustrate the enhanced XRequest callback functionality, specifically demonstrating how to utilize the ChatMessage data provided in the callbacks.
  • Updated Test Cases and Documentation for API Changes: Existing test cases for DefaultChatProvider and XRequestClass have been updated to align with the new SimpleType constraint for ChatMessage and the expanded onError callback signature. Additionally, the x-request documentation has been revised to reflect the new transformStream usage and callback details, including a new FAQ section on stream locking.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@kimteayon kimteayon closed this Jan 30, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant refactoring to enhance the x-request and x-chat integration by allowing ChatMessage objects to be passed through callbacks. This improves the developer experience by providing more context in the request lifecycle events. The changes are extensive, touching many files to propagate new generic types. Additionally, documentation has been updated with a new example and an important FAQ section about transformStream usage, which is a great addition.

I've identified a few areas for improvement: a critical bug related to potential runtime errors from unsafe type casting, an unsafe type assertion that bypasses TypeScript's safety checks, and a minor typo. Addressing these will improve the robustness and maintainability of the code.

Comment on lines +366 to +368
fallbackMsg = getMessages().find(
(info) => info.id !== loadingMsgId && info.id !== updatingMsgId,
) as ChatMessage;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

There's a potential critical issue here. getMessages().find(...) returns an object of type MessageInfo<ChatMessage> | undefined, but you are casting the entire object to ChatMessage. You should be accessing the .message property of the found object.

More importantly, find() can return undefined if no matching message is found. The optional chaining (?.) would make the expression undefined, and undefined as ChatMessage would result in fallbackMsg being undefined at runtime. Since fallbackMsg is declared as type ChatMessage, this could lead to runtime errors when it's used later.

Please ensure there's proper fallback handling for the case where no message is found.

Suggested change
fallbackMsg = getMessages().find(
(info) => info.id !== loadingMsgId && info.id !== updatingMsgId,
) as ChatMessage;
fallbackMsg = getMessages().find(
(info) => info.id !== loadingMsgId && info.id !== updatingMsgId,
)?.message as ChatMessage;

...(options?.params || {}),
...(requestParams || {}),
} as Input;
} as unknown as Input;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The type assertion as unknown as Input is unsafe as it completely bypasses TypeScript's type-checking. This can lead to runtime errors if the requestParams object (which is of type ChatMessage & Partial<Input>) has a shape that is not compatible with the Input type. It's better to ensure type safety through other means. If ChatMessage is expected to be compatible with Input, consider adding a generic constraint like ChatMessage extends Partial<Input> to the class definition to make this relationship explicit and safer.

...otherOptions
} = this.options;

const margeHeaders = Object.assign(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a typo in the variable name margeHeaders. It should probably be mergedHeaders for better readability and to avoid confusion.

Suggested change
const margeHeaders = Object.assign(
const mergedHeaders = Object.assign(

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
packages/x/dist/antdx.min.js 453.51 KB
packages/x-sdk/dist/x-sdk.min.js 7.91 KB (+33 B 🔺)
packages/x-markdown/dist/x-markdown.min.js 31.04 KB
packages/x-markdown/dist/plugins/latex.min.js 61.95 KB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants