@lobehub/chat 1.107.0 → 1.107.2

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 (114) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/apps/desktop/src/main/core/browser/Browser.ts +17 -4
  3. package/changelog/v1.json +18 -0
  4. package/locales/ar/models.json +21 -0
  5. package/locales/bg-BG/models.json +21 -0
  6. package/locales/de-DE/models.json +21 -0
  7. package/locales/en-US/models.json +21 -0
  8. package/locales/es-ES/models.json +21 -0
  9. package/locales/fa-IR/models.json +21 -0
  10. package/locales/fr-FR/models.json +21 -0
  11. package/locales/it-IT/models.json +21 -0
  12. package/locales/ja-JP/models.json +21 -0
  13. package/locales/ko-KR/models.json +21 -0
  14. package/locales/nl-NL/models.json +21 -0
  15. package/locales/pl-PL/models.json +21 -0
  16. package/locales/pt-BR/models.json +21 -0
  17. package/locales/ru-RU/models.json +21 -0
  18. package/locales/tr-TR/models.json +21 -0
  19. package/locales/vi-VN/models.json +21 -0
  20. package/locales/zh-CN/models.json +21 -0
  21. package/locales/zh-TW/models.json +21 -0
  22. package/package.json +2 -2
  23. package/packages/types/package.json +17 -0
  24. package/scripts/cdnWorkflow/utils.ts +1 -1
  25. package/src/libs/trpc/client/async.ts +2 -1
  26. package/src/libs/trpc/client/edge.ts +2 -1
  27. package/src/libs/trpc/client/lambda.ts +4 -2
  28. package/src/libs/trpc/client/tools.ts +2 -1
  29. package/tsconfig.json +1 -0
  30. package/vitest.config.server.ts +6 -3
  31. package/vitest.config.ts +3 -0
  32. package/{src/types → packages/types/src}/agent/chatConfig.ts +0 -0
  33. package/{src/types → packages/types/src}/agent/index.ts +0 -0
  34. package/{src/types → packages/types/src}/aiModel.ts +0 -0
  35. package/{src/types → packages/types/src}/aiProvider.ts +0 -0
  36. package/{src/types → packages/types/src}/apiKey.ts +0 -0
  37. package/{src/types → packages/types/src}/artifact.ts +0 -0
  38. package/{src/types → packages/types/src}/asyncTask.ts +0 -0
  39. package/{src/types → packages/types/src}/changelog.ts +0 -0
  40. package/{src/types → packages/types/src}/chunk/document.ts +0 -0
  41. package/{src/types → packages/types/src}/chunk/index.ts +0 -0
  42. package/{src/types → packages/types/src}/clientDB.ts +0 -0
  43. package/{src/types → packages/types/src}/discover/assistants.ts +0 -0
  44. package/{src/types → packages/types/src}/discover/index.ts +0 -0
  45. package/{src/types → packages/types/src}/discover/mcp.ts +0 -0
  46. package/{src/types → packages/types/src}/discover/models.ts +0 -0
  47. package/{src/types → packages/types/src}/discover/plugins.ts +0 -0
  48. package/{src/types → packages/types/src}/discover/providers.ts +0 -0
  49. package/{src/types → packages/types/src}/document/index.ts +0 -0
  50. package/{src/types → packages/types/src}/eval/dataset.ts +0 -0
  51. package/{src/types → packages/types/src}/eval/evaluation.ts +0 -0
  52. package/{src/types → packages/types/src}/eval/index.ts +0 -0
  53. package/{src/types → packages/types/src}/eval/ragas.ts +0 -0
  54. package/{src/types → packages/types/src}/export.ts +0 -0
  55. package/{src/types → packages/types/src}/exportConfig.ts +0 -0
  56. package/{src/types → packages/types/src}/fetch.ts +0 -0
  57. package/{src/types → packages/types/src}/files/index.ts +0 -0
  58. package/{src/types → packages/types/src}/files/list.ts +0 -0
  59. package/{src/types → packages/types/src}/files/upload.ts +0 -0
  60. package/{src/types → packages/types/src}/generation/index.ts +24 -24
  61. /package/{src/types → packages/types/src}/hotkey.ts +0 -0
  62. /package/{src/types → packages/types/src}/importer.ts +0 -0
  63. /package/{src/types → packages/types/src}/knowledgeBase/index.ts +0 -0
  64. /package/{src/types → packages/types/src}/llm.ts +0 -0
  65. /package/{src/types → packages/types/src}/locale.ts +0 -0
  66. /package/{src/types → packages/types/src}/message/base.ts +0 -0
  67. /package/{src/types → packages/types/src}/message/chat.ts +0 -0
  68. /package/{src/types → packages/types/src}/message/image.ts +0 -0
  69. /package/{src/types → packages/types/src}/message/index.ts +0 -0
  70. /package/{src/types → packages/types/src}/message/tools.ts +0 -0
  71. /package/{src/types → packages/types/src}/message/translate.ts +0 -0
  72. /package/{src/types → packages/types/src}/meta.ts +0 -0
  73. /package/{src/types → packages/types/src}/next.ts +0 -0
  74. /package/{src/types → packages/types/src}/openai/chat.ts +0 -0
  75. /package/{src/types → packages/types/src}/openai/functionCall.ts +0 -0
  76. /package/{src/types → packages/types/src}/openai/image.ts +0 -0
  77. /package/{src/types → packages/types/src}/openai/plugin.ts +0 -0
  78. /package/{src/types → packages/types/src}/plugins/index.ts +0 -0
  79. /package/{src/types → packages/types/src}/plugins/mcp.ts +0 -0
  80. /package/{src/types → packages/types/src}/plugins/mcpDeps.ts +0 -0
  81. /package/{src/types → packages/types/src}/rag.ts +0 -0
  82. /package/{src/types → packages/types/src}/search.ts +0 -0
  83. /package/{src/types → packages/types/src}/serverConfig.ts +0 -0
  84. /package/{src/types → packages/types/src}/service.ts +0 -0
  85. /package/{src/types → packages/types/src}/session/agentSession.ts +0 -0
  86. /package/{src/types → packages/types/src}/session/index.ts +0 -0
  87. /package/{src/types → packages/types/src}/session/sessionGroup.ts +0 -0
  88. /package/{src/types → packages/types/src}/share.ts +0 -0
  89. /package/{src/types → packages/types/src}/subscription.ts +0 -0
  90. /package/{src/types → packages/types/src}/sync.ts +0 -0
  91. /package/{src/types → packages/types/src}/tableViewer.ts +0 -0
  92. /package/{src/types → packages/types/src}/tool/builtin.ts +0 -0
  93. /package/{src/types → packages/types/src}/tool/crawler.ts +0 -0
  94. /package/{src/types → packages/types/src}/tool/dalle.ts +0 -0
  95. /package/{src/types → packages/types/src}/tool/index.ts +0 -0
  96. /package/{src/types → packages/types/src}/tool/plugin.ts +0 -0
  97. /package/{src/types → packages/types/src}/tool/search/index.ts +0 -0
  98. /package/{src/types → packages/types/src}/tool/tool.ts +0 -0
  99. /package/{src/types → packages/types/src}/topic/index.ts +0 -0
  100. /package/{src/types → packages/types/src}/topic/thread.ts +0 -0
  101. /package/{src/types → packages/types/src}/topic/topic.ts +0 -0
  102. /package/{src/types → packages/types/src}/trace/action.ts +0 -0
  103. /package/{src/types → packages/types/src}/trace/index.ts +0 -0
  104. /package/{src/types → packages/types/src}/user/index.ts +0 -0
  105. /package/{src/types → packages/types/src}/user/settings/filesConfig.ts +0 -0
  106. /package/{src/types → packages/types/src}/user/settings/general.ts +0 -0
  107. /package/{src/types → packages/types/src}/user/settings/hotkey.ts +0 -0
  108. /package/{src/types → packages/types/src}/user/settings/index.ts +0 -0
  109. /package/{src/types → packages/types/src}/user/settings/keyVaults.ts +0 -0
  110. /package/{src/types → packages/types/src}/user/settings/modelProvider.ts +0 -0
  111. /package/{src/types → packages/types/src}/user/settings/sync.ts +0 -0
  112. /package/{src/types → packages/types/src}/user/settings/systemAgent.ts +0 -0
  113. /package/{src/types → packages/types/src}/user/settings/tool.ts +0 -0
  114. /package/{src/types → packages/types/src}/user/settings/tts.ts +0 -0
@@ -17,12 +17,14 @@ const links = [
17
17
  if (isDesktop) {
18
18
  const { desktopRemoteRPCFetch } = await import('@/utils/electron/desktopRemoteRPCFetch');
19
19
 
20
- const res = await desktopRemoteRPCFetch(input as string, init);
20
+ // eslint-disable-next-line no-undef
21
+ const res = await desktopRemoteRPCFetch(input as string, init as RequestInit);
21
22
 
22
23
  if (res) return res;
23
24
  }
24
25
 
25
- const response = await fetch(input, init);
26
+ // eslint-disable-next-line no-undef
27
+ const response = await fetch(input, init as RequestInit);
26
28
 
27
29
  if (response.ok) return response;
28
30
 
@@ -9,7 +9,8 @@ export const toolsClient = createTRPCClient<ToolsRouter>({
9
9
  links: [
10
10
  httpBatchLink({
11
11
  fetch: isDesktop
12
- ? (input, init) => fetchWithDesktopRemoteRPC(input as string, init)
12
+ ? // eslint-disable-next-line no-undef
13
+ (input, init) => fetchWithDesktopRemoteRPC(input as string, init as RequestInit)
13
14
  : undefined,
14
15
  headers: async () => {
15
16
  // dynamic import to avoid circular dependency
package/tsconfig.json CHANGED
@@ -18,6 +18,7 @@
18
18
  "baseUrl": ".",
19
19
  "types": ["vitest/globals", "@serwist/next/typings"],
20
20
  "paths": {
21
+ "@/types/*": ["./packages/types/src/*"],
21
22
  "@/*": ["./src/*"],
22
23
  "~test-utils": ["./tests/utils.tsx"]
23
24
  },
@@ -4,7 +4,10 @@ import { coverageConfigDefaults, defineConfig } from 'vitest/config';
4
4
  export default defineConfig({
5
5
  test: {
6
6
  alias: {
7
+ /* eslint-disable sort-keys-fix/sort-keys-fix */
8
+ '@/types': resolve(__dirname, './packages/types/src'),
7
9
  '@': resolve(__dirname, './src'),
10
+ /* eslint-enable */
8
11
  },
9
12
  coverage: {
10
13
  all: false,
@@ -18,6 +21,9 @@ export default defineConfig({
18
21
  reporter: ['text', 'json', 'lcov', 'text-summary'],
19
22
  reportsDirectory: './coverage/server',
20
23
  },
24
+ env: {
25
+ TEST_SERVER_DB: '1',
26
+ },
21
27
  environment: 'node',
22
28
  include: ['src/database/models/**/**/*.test.ts', 'src/database/server/**/**/*.test.ts'],
23
29
  poolOptions: {
@@ -26,8 +32,5 @@ export default defineConfig({
26
32
  },
27
33
  },
28
34
  setupFiles: './tests/setup-db.ts',
29
- env: {
30
- TEST_SERVER_DB: '1',
31
- },
32
35
  },
33
36
  });
package/vitest.config.ts CHANGED
@@ -8,8 +8,11 @@ export default defineConfig({
8
8
  },
9
9
  test: {
10
10
  alias: {
11
+ /* eslint-disable sort-keys-fix/sort-keys-fix */
12
+ '@/types': resolve(__dirname, './packages/types/src'),
11
13
  '@': resolve(__dirname, './src'),
12
14
  '~test-utils': resolve(__dirname, './tests/utils.tsx'),
15
+ /* eslint-enable */
13
16
  },
14
17
  coverage: {
15
18
  all: false,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,10 +1,10 @@
1
1
  import { AsyncTaskError, AsyncTaskStatus } from '../asyncTask';
2
2
 
3
3
  export interface ImageGenerationTopic {
4
- id: string;
5
- title?: string | null;
6
4
  coverUrl?: string | null;
7
5
  createdAt: Date;
6
+ id: string;
7
+ title?: string | null;
8
8
  updatedAt: Date;
9
9
  }
10
10
 
@@ -14,68 +14,68 @@ export interface BaseGenerationAsset {
14
14
 
15
15
  export interface ImageGenerationAsset extends BaseGenerationAsset {
16
16
  /**
17
- * api provider 家的 cdn url,一般很快就会失效
17
+ * 图片/视频的高度
18
18
  */
19
- originalUrl?: string;
19
+ height?: number;
20
20
  /**
21
- * 存到自己 oss url, 只存了 key, 完整的 url 需要使用 FileService.getFullFileUrl 获取
21
+ * api provider 家的 cdn url,一般很快就会失效
22
22
  */
23
- url?: string;
23
+ originalUrl?: string;
24
24
  /**
25
25
  * 缩略图,图片那就是尺寸裁剪过的,视频那就是封面的缩略图
26
26
  */
27
27
  thumbnailUrl?: string;
28
28
  /**
29
- * 图片/视频的宽度
29
+ * 存到自己 oss 的 url, 只存了 key, 完整的 url 需要使用 FileService.getFullFileUrl 获取
30
30
  */
31
- width?: number;
31
+ url?: string;
32
32
  /**
33
- * 图片/视频的高度
33
+ * 图片/视频的宽度
34
34
  */
35
- height?: number;
35
+ width?: number;
36
36
  }
37
37
 
38
38
  export type GenerationAsset = ImageGenerationAsset;
39
39
 
40
40
  export interface GenerationConfig {
41
- prompt: string;
41
+ aspectRatio?: string;
42
+ cfg?: number;
43
+ height?: number;
42
44
  imageUrl?: string | null;
43
45
  imageUrls?: string[];
44
- width?: number;
45
- height?: number;
46
- aspectRatio?: string;
46
+ prompt: string;
47
47
  size?: string;
48
48
  steps?: number;
49
- cfg?: number;
49
+ width?: number;
50
50
  }
51
51
 
52
52
  export interface GenerationAsyncTask {
53
+ error?: AsyncTaskError;
53
54
  id: string;
54
55
  status: AsyncTaskStatus;
55
- error?: AsyncTaskError;
56
56
  }
57
57
 
58
58
  export interface Generation {
59
- id: string;
60
59
  /**
61
60
  * The asset associated with the generation, containing image URLs and dimensions.
62
61
  */
63
62
  asset?: GenerationAsset | null;
64
- seed?: number | null;
65
- createdAt: Date;
66
63
  asyncTaskId: string | null;
64
+ createdAt: Date;
65
+ id: string;
66
+ seed?: number | null;
67
67
 
68
68
  task: GenerationAsyncTask;
69
69
  }
70
70
 
71
71
  export interface GenerationBatch {
72
+ config?: GenerationConfig;
73
+ createdAt: Date;
74
+ generations: Generation[];
75
+ height?: number | null;
72
76
  id: string;
73
- provider: string;
74
77
  model: string;
75
78
  prompt: string;
79
+ provider: string;
76
80
  width?: number | null;
77
- height?: number | null;
78
- config?: GenerationConfig;
79
- createdAt: Date;
80
- generations: Generation[];
81
81
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes