Add an "Export chat" button to the AI agent chat window header that downloads the active conversation as a Markdown file. The export is client-only: it serializes the already-loaded persisted message rows (no new network call, no server/DB change) and includes the request internals the chat already holds — tool calls with their input/output, per-message token usage, finish reason and error info. - New util apps/client/src/features/ai-chat/utils/export-chat.ts: buildChatMarkdown() + exportChatAsMarkdown(); reuses tool-parts helpers so tool labels match the on-screen labels; fence() escapes embedded code fences; slugify() yields a safe filename with a chatId fallback; downloads via file-saver's saveAs. - ai-chat-window.tsx: IconFileExport button in the header, shown only for a saved chat with loaded rows (canExport); drag is unaffected. - en-US: add "Export chat" and "You" i18n keys.
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist