@lobehub/chat 1.27.3 → 1.28.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/locales/ar/chat.json +7 -1
  3. package/locales/ar/models.json +3 -0
  4. package/locales/bg-BG/chat.json +7 -1
  5. package/locales/bg-BG/models.json +3 -0
  6. package/locales/de-DE/chat.json +7 -1
  7. package/locales/de-DE/models.json +3 -0
  8. package/locales/en-US/chat.json +7 -1
  9. package/locales/en-US/models.json +3 -0
  10. package/locales/es-ES/chat.json +7 -1
  11. package/locales/es-ES/models.json +3 -0
  12. package/locales/fa-IR/chat.json +7 -1
  13. package/locales/fa-IR/models.json +3 -0
  14. package/locales/fr-FR/chat.json +7 -1
  15. package/locales/fr-FR/models.json +3 -0
  16. package/locales/it-IT/chat.json +7 -1
  17. package/locales/it-IT/models.json +3 -0
  18. package/locales/ja-JP/chat.json +7 -1
  19. package/locales/ja-JP/models.json +3 -0
  20. package/locales/ko-KR/chat.json +7 -1
  21. package/locales/ko-KR/models.json +3 -0
  22. package/locales/nl-NL/chat.json +7 -1
  23. package/locales/nl-NL/models.json +3 -0
  24. package/locales/pl-PL/chat.json +7 -1
  25. package/locales/pl-PL/models.json +3 -0
  26. package/locales/pt-BR/chat.json +7 -1
  27. package/locales/pt-BR/models.json +3 -0
  28. package/locales/ru-RU/chat.json +7 -1
  29. package/locales/ru-RU/models.json +3 -0
  30. package/locales/tr-TR/chat.json +7 -1
  31. package/locales/tr-TR/models.json +3 -0
  32. package/locales/vi-VN/chat.json +7 -1
  33. package/locales/vi-VN/models.json +3 -0
  34. package/locales/zh-CN/chat.json +7 -1
  35. package/locales/zh-CN/models.json +3 -0
  36. package/locales/zh-TW/chat.json +7 -1
  37. package/locales/zh-TW/models.json +3 -0
  38. package/package.json +1 -1
  39. package/src/app/(main)/chat/(workspace)/features/ShareButton/index.tsx +2 -1
  40. package/src/database/server/migrations/0010_add_accessed_at_and_clean_tables.sql +26 -0
  41. package/src/database/server/migrations/meta/0010_snapshot.json +3184 -0
  42. package/src/database/server/migrations/meta/_journal.json +7 -0
  43. package/src/database/server/models/__tests__/session.test.ts +0 -2
  44. package/src/database/server/models/__tests__/topic.test.ts +2 -0
  45. package/src/database/server/schemas/lobechat/_helpers.ts +8 -0
  46. package/src/database/server/schemas/lobechat/agent.ts +6 -7
  47. package/src/database/server/schemas/lobechat/asyncTask.ts +2 -3
  48. package/src/database/server/schemas/lobechat/file.ts +5 -5
  49. package/src/database/server/schemas/lobechat/index.ts +0 -1
  50. package/src/database/server/schemas/lobechat/message.ts +2 -3
  51. package/src/database/server/schemas/lobechat/rag.ts +4 -6
  52. package/src/database/server/schemas/lobechat/ragEvals.ts +5 -7
  53. package/src/database/server/schemas/lobechat/relations.ts +0 -33
  54. package/src/database/server/schemas/lobechat/session.ts +3 -5
  55. package/src/database/server/schemas/lobechat/topic.ts +7 -8
  56. package/src/database/server/schemas/lobechat/user.ts +3 -5
  57. package/src/{app/(main)/chat/(workspace)/features/ShareButton → features/ShareModal/ShareImage}/Preview.tsx +5 -3
  58. package/src/features/ShareModal/ShareImage/index.tsx +103 -0
  59. package/src/{app/(main)/chat/(workspace)/features/ShareButton → features/ShareModal/ShareImage}/style.ts +1 -23
  60. package/src/features/ShareModal/ShareJSON/Preview.tsx +18 -0
  61. package/src/features/ShareModal/ShareJSON/generateMessages.test.ts +135 -0
  62. package/src/features/ShareModal/ShareJSON/generateMessages.ts +35 -0
  63. package/src/features/ShareModal/ShareJSON/index.tsx +99 -0
  64. package/src/features/ShareModal/ShareJSON/type.ts +4 -0
  65. package/src/features/ShareModal/ShareText/Preview.tsx +16 -0
  66. package/src/features/ShareModal/ShareText/index.tsx +119 -0
  67. package/src/features/ShareModal/ShareText/template.test.ts +178 -0
  68. package/src/features/ShareModal/ShareText/template.ts +79 -0
  69. package/src/features/ShareModal/ShareText/type.ts +6 -0
  70. package/src/features/ShareModal/index.tsx +69 -0
  71. package/src/features/ShareModal/style.ts +30 -0
  72. package/src/locales/default/chat.ts +7 -1
  73. package/src/services/__tests__/share.test.ts +35 -105
  74. package/src/services/share.ts +0 -30
  75. package/src/store/chat/slices/share/action.test.ts +7 -198
  76. package/src/store/chat/slices/share/action.ts +9 -113
  77. package/src/utils/client/exportFile.ts +20 -0
  78. package/src/app/(main)/chat/(workspace)/features/ShareButton/ShareModal.tsx +0 -164
  79. package/src/database/server/schemas/lobechat/discover.ts +0 -84
  80. /package/src/{app/(main)/chat/(workspace)/features/ShareButton → features/ShareModal/ShareImage}/type.ts +0 -0
  81. /package/src/{app/(main)/chat/(workspace)/features/ShareButton → features/ShareModal/ShareImage}/useScreenshot.ts +0 -0
@@ -100,14 +100,20 @@
100
100
  "tooLong": "分组名称长度需在 1-20 之内"
101
101
  },
102
102
  "shareModal": {
103
+ "copy": "复制",
103
104
  "download": "下载截图",
105
+ "downloadFile": "下载文件",
106
+ "exportTitle": "默认标题",
104
107
  "imageType": "图片格式",
108
+ "includeTool": "包含插件消息",
109
+ "includeUser": "包含用户消息",
105
110
  "screenshot": "截图",
106
111
  "settings": "导出设置",
107
- "shareToShareGPT": "生成 ShareGPT 分享链接",
112
+ "text": "文本",
108
113
  "withBackground": "包含背景图片",
109
114
  "withFooter": "包含页脚",
110
115
  "withPluginInfo": "包含插件信息",
116
+ "withRole": "包含消息角色",
111
117
  "withSystemRole": "包含助手角色设定"
112
118
  },
113
119
  "stt": {
@@ -320,6 +320,9 @@
320
320
  "claude-2.1": {
321
321
  "description": "Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。"
322
322
  },
323
+ "claude-3-5-haiku-20241022": {
324
+ "description": "Claude 3.5 Haiku 是 Anthropic 最快的下一代模型。与 Claude 3 Haiku 相比,Claude 3.5 Haiku 在各项技能上都有所提升,并在许多智力基准测试中超越了上一代最大的模型 Claude 3 Opus。"
325
+ },
323
326
  "claude-3-5-sonnet-20240620": {
324
327
  "description": "Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同时保持与 Sonnet 相同的价格。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。"
325
328
  },
@@ -100,14 +100,20 @@
100
100
  "tooLong": "分組名稱長度需在 1-20 之內"
101
101
  },
102
102
  "shareModal": {
103
+ "copy": "複製",
103
104
  "download": "下載截圖",
105
+ "downloadFile": "下載檔案",
106
+ "exportTitle": "預設標題",
104
107
  "imageType": "圖片格式",
108
+ "includeTool": "包含插件訊息",
109
+ "includeUser": "包含使用者訊息",
105
110
  "screenshot": "截圖",
106
111
  "settings": "導出設置",
107
- "shareToShareGPT": "生成 ShareGPT 分享鏈接",
112
+ "text": "文本",
108
113
  "withBackground": "包含背景圖片",
109
114
  "withFooter": "包含頁腳",
110
115
  "withPluginInfo": "包含插件信息",
116
+ "withRole": "包含訊息角色",
111
117
  "withSystemRole": "包含助手角色設定"
112
118
  },
113
119
  "stt": {
@@ -320,6 +320,9 @@
320
320
  "claude-2.1": {
321
321
  "description": "Claude 2 為企業提供了關鍵能力的進步,包括業界領先的 200K token 上下文、大幅降低模型幻覺的發生率、系統提示以及一個新的測試功能:工具調用。"
322
322
  },
323
+ "claude-3-5-haiku-20241022": {
324
+ "description": "Claude 3.5 Haiku 是 Anthropic 最快的下一代模型。與 Claude 3 Haiku 相比,Claude 3.5 Haiku 在各項技能上都有所提升,並在許多智力基準測試中超越了上一代最大的模型 Claude 3 Opus。"
325
+ },
323
326
  "claude-3-5-sonnet-20240620": {
324
327
  "description": "Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同時保持與 Sonnet 相同的價格。Sonnet 特別擅長編程、數據科學、視覺處理、代理任務。"
325
328
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.27.3",
3
+ "version": "1.28.1",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -11,7 +11,8 @@ import { useChatStore } from '@/store/chat';
11
11
 
12
12
  import { useWorkspaceModal } from '../useWorkspaceModal';
13
13
 
14
- const ShareModal = dynamic(() => import('./ShareModal'));
14
+ const ShareModal = dynamic(() => import('@/features/ShareModal'));
15
+
15
16
  interface ShareButtonProps {
16
17
  mobile?: boolean;
17
18
  open?: boolean;
@@ -0,0 +1,26 @@
1
+ DROP TABLE "agents_tags" CASCADE;--> statement-breakpoint
2
+ DROP TABLE "market" CASCADE;--> statement-breakpoint
3
+ DROP TABLE "plugins" CASCADE;--> statement-breakpoint
4
+ DROP TABLE "plugins_tags" CASCADE;--> statement-breakpoint
5
+ DROP TABLE "tags" CASCADE;--> statement-breakpoint
6
+ ALTER TABLE "agents" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
7
+ ALTER TABLE "agents_files" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
8
+ ALTER TABLE "agents_knowledge_bases" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
9
+ ALTER TABLE "async_tasks" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
10
+ ALTER TABLE "files" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
11
+ ALTER TABLE "global_files" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
12
+ ALTER TABLE "knowledge_bases" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
13
+ ALTER TABLE "messages" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
14
+ ALTER TABLE "chunks" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
15
+ ALTER TABLE "unstructured_chunks" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
16
+ ALTER TABLE "rag_eval_dataset_records" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
17
+ ALTER TABLE "rag_eval_dataset_records" ADD COLUMN "updated_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
18
+ ALTER TABLE "rag_eval_datasets" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
19
+ ALTER TABLE "rag_eval_evaluations" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
20
+ ALTER TABLE "rag_eval_evaluation_records" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
21
+ ALTER TABLE "rag_eval_evaluation_records" ADD COLUMN "updated_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
22
+ ALTER TABLE "session_groups" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
23
+ ALTER TABLE "sessions" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
24
+ ALTER TABLE "topics" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
25
+ ALTER TABLE "user_installed_plugins" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;--> statement-breakpoint
26
+ ALTER TABLE "users" ADD COLUMN "accessed_at" timestamp with time zone DEFAULT now() NOT NULL;