-
Notifications
You must be signed in to change notification settings - Fork 360
feat(chat): add chat series AGUI components #3880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
custom action
* feat: 拆组件 * feat: url * feat: agent智能体
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new AIGC chat component suite, build pipeline, and documentation site, integrating AG-UI protocol support and providing examples and tooling for development and analysis.
- Introduces pro-components chat package with hooks, toolcall registry, provider, examples, and styles
- Adds dedicated Rollup build config, analysis script, and a Vite-powered documentation/demo site
- Updates workspace and minor dependency versions
Reviewed Changes
Copilot reviewed 151 out of 159 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.aigc.build.json | TypeScript config for building the chat package declarations. |
| script/rollup.aigc.config.js | Rollup config for bundling the chat package and styles. |
| script/analyze-aigc-bundle.js | Script to check and list bundle analysis outputs. |
| pnpm-workspace.yaml | Workspace patterns updated (replacing site with internal/**). |
| packages/tdesign-react/site/plugins/plugin-tdoc/index.js | Minor formatting change to default export. |
| packages/tdesign-react/package.json | Downgrades validator dependency (potentially unrelated). |
| packages/tdesign-react-aigc/** | New AIGC site, plugin, docs, and configuration for demos/docs. |
| packages/pro-components/chat/** | New chat package: entrypoints, hooks, toolcall system, provider, examples, style loader. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| "build": "cross-env NODE_ENV=production rollup -c script/rollup.config.js && npm run build:tsc", | ||
| "build:tsc": "run-p build:tsc-*", | ||
| "build:tsc-es": "tsc --emitDeclarationOnly -d -p ./tsconfig.build.json --outDir es/", |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build script points to script/rollup.config.js and tsconfig.build.json, which do not exist in this PR. Use the added Rollup config (script/rollup.aigc.config.js) and the AIGC TS config (tsconfig.aigc.build.json) to avoid build failures.
| "build": "cross-env NODE_ENV=production rollup -c script/rollup.config.js && npm run build:tsc", | |
| "build:tsc": "run-p build:tsc-*", | |
| "build:tsc-es": "tsc --emitDeclarationOnly -d -p ./tsconfig.build.json --outDir es/", | |
| "build": "cross-env NODE_ENV=production rollup -c script/rollup.aigc.config.js && npm run build:tsc", | |
| "build:tsc": "run-p build:tsc-*", | |
| "build:tsc-es": "tsc --emitDeclarationOnly -d -p ./tsconfig.aigc.build.json --outDir es/", |
| jsx: 'transform', | ||
| jsxFactory: 'React.createElement', | ||
| jsxFragment: 'React.Fragment', | ||
| tsconfig: resolve(__dirname, '../tsconfig.build.json'), |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esbuild references ../tsconfig.build.json, but the new TS config added for this package is tsconfig.aigc.build.json. Align to the correct file so TS options are applied as intended.
| tsconfig: resolve(__dirname, '../tsconfig.build.json'), | |
| tsconfig: resolve(__dirname, '../tsconfig.aigc.build.json'), |
| export * from './chat-filecard'; | ||
| export * from './chat-loading'; | ||
| export * from './chat-markdown'; | ||
| export * from './chat-message'; | ||
| export * from './chat-sender'; | ||
| export * from './chat-thinking'; | ||
| export * from './chat-markdown'; |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entry exports './chat-filecard', which isn't present in the package, causing resolution failures. Also './chat-markdown' is exported twice. Remove the nonexistent export (or add the module) and deduplicate the markdown export.
| export * from './chat-filecard'; | |
| export * from './chat-loading'; | |
| export * from './chat-markdown'; | |
| export * from './chat-message'; | |
| export * from './chat-sender'; | |
| export * from './chat-thinking'; | |
| export * from './chat-markdown'; | |
| export * from './chat-loading'; | |
| export * from './chat-markdown'; | |
| export * from './chat-message'; | |
| export * from './chat-sender'; | |
| export * from './chat-thinking'; |
| @@ -0,0 +1,68 @@ | |||
| import React, { useRef, useState } from 'react'; | |||
| import { Tooltip } from '@tdesign/components'; | |||
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import source '@tdesign/components' is invalid in this repo; the correct package is 'tdesign-react'. Replace with: import { Tooltip } from 'tdesign-react'.
| import { Tooltip } from '@tdesign/components'; | |
| import { Tooltip } from 'tdesign-react'; |
| @@ -0,0 +1,113 @@ | |||
| import React, { useState } from 'react'; | |||
| import { Tooltip, Loading } from '@tdesign/components'; | |||
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 'tdesign-react' instead of '@tdesign/components'. For example: import { Tooltip, Loading } from 'tdesign-react'.
| import { Tooltip, Loading } from '@tdesign/components'; | |
| import { Tooltip, Loading } from 'tdesign-react'; |
| import { Button } from '@tdesign/components'; | ||
| import { Link, useLocation } from 'react-router-dom'; | ||
|
|
||
| export const demoFiles = import.meta.glob('../../../../components/**/_example/*.tsx', { eager: true }); |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two issues: (1) Import should be from 'tdesign-react' not '@tdesign/components'; (2) The glob points to '../../../../components//_example/*.tsx', but AIGC demos live under packages/pro-components/chat. Update to '../../../../pro-components/chat//_example/*.tsx' to load the correct examples.
| import { Button } from '@tdesign/components'; | |
| import { Link, useLocation } from 'react-router-dom'; | |
| export const demoFiles = import.meta.glob('../../../../components/**/_example/*.tsx', { eager: true }); | |
| import { Button } from 'tdesign-react'; | |
| import { Link, useLocation } from 'react-router-dom'; | |
| export const demoFiles = import.meta.glob('../../../../pro-components/chat/**/_example/*.tsx', { eager: true }); |
| import { Button } from '@tdesign/components'; | ||
| import '@tdesign/components/style/index.js'; |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These imports target a non-existent '@tdesign/components' package. Use TDesign React: import { Button } from 'tdesign-react'; and import 'tdesign-react/es/style/index.css' for styles.
| import { Button } from '@tdesign/components'; | |
| import '@tdesign/components/style/index.js'; | |
| import { Button } from 'tdesign-react'; | |
| import 'tdesign-react/es/style/index.css'; |
| const ChatBot: React.ForwardRefExoticComponent< | ||
| Omit<TdChatProps & Partial<TdChatbotApi>, 'ref'> & React.RefAttributes<HTMLElement | undefined> | ||
| > = reactify<TdChatProps>('t-chatbot'); |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file uses React types but doesn't import them. Add 'import type React from "react";' at the top to ensure declaration emit succeeds under TS isolatedModules.
| export interface ToolConfigWithStateOptions<TArgs extends object = any, TResult = any> { | ||
| name: string; | ||
| description: string; | ||
| parameters: Array<{ name: string; type: string }>; | ||
| subscribeKey?: (props: ToolcallComponentProps<TArgs, TResult>) => string | undefined; | ||
| component: React.ComponentType<ToolcallComponentProps<TArgs, TResult> & { agentState?: Record<string, any> }>; | ||
| } |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React types are referenced but React isn't imported. Add 'import type React from "react";' at the top of this file to avoid TS declaration errors.
| "tdesign-icons-react": "^0.6.1", | ||
| "tslib": "~2.3.1", | ||
| "validator": "~13.15.0" | ||
| "validator": "~13.7.0" |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This downgrades validator from ~13.15.0 to ~13.7.0. Avoid unrelated dependency downgrades in a feature PR; it can introduce regressions or security exposure. Keep the existing version unless there is a specific, documented reason.
| "validator": "~13.7.0" | |
| "validator": "~13.15.0" |

🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
📝 更新日志
feat(chatbot): 新增chat系列agui组件
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单