@lobehub/lobehub 2.0.0-next.310 → 2.0.0-next.311

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 (42) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE.md +1 -1
  2. package/CHANGELOG.md +25 -0
  3. package/changelog/v1.json +9 -0
  4. package/docs/development/basic/chat-api.mdx +0 -1
  5. package/docs/development/basic/chat-api.zh-CN.mdx +0 -1
  6. package/package.json +1 -1
  7. package/packages/model-runtime/src/core/BaseAI.ts +0 -2
  8. package/packages/model-runtime/src/core/ModelRuntime.test.ts +0 -37
  9. package/packages/model-runtime/src/core/ModelRuntime.ts +0 -5
  10. package/packages/model-runtime/src/core/RouterRuntime/baseRuntimeMap.ts +4 -0
  11. package/packages/model-runtime/src/core/RouterRuntime/createRuntime.test.ts +325 -200
  12. package/packages/model-runtime/src/core/RouterRuntime/createRuntime.ts +205 -64
  13. package/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts +0 -14
  14. package/packages/model-runtime/src/providers/aihubmix/index.test.ts +14 -20
  15. package/packages/model-runtime/src/types/index.ts +0 -1
  16. package/packages/model-runtime/src/utils/createError.test.ts +0 -20
  17. package/packages/model-runtime/src/utils/createError.ts +0 -1
  18. package/src/app/(backend)/market/agent/[[...segments]]/route.ts +3 -33
  19. package/src/app/(backend)/market/oidc/[[...segments]]/route.ts +5 -6
  20. package/src/app/(backend)/market/social/[[...segments]]/route.ts +5 -52
  21. package/src/app/(backend)/market/user/[username]/route.ts +3 -9
  22. package/src/app/(backend)/market/user/me/route.ts +3 -34
  23. package/src/features/ChatMiniMap/useMinimapData.ts +1 -1
  24. package/src/features/Conversation/ChatList/components/VirtualizedList.tsx +20 -2
  25. package/src/features/Conversation/store/slices/virtuaList/action.ts +9 -0
  26. package/src/libs/trpc/lambda/middleware/marketSDK.ts +14 -23
  27. package/src/libs/trusted-client/index.ts +1 -1
  28. package/src/server/routers/lambda/market/index.ts +5 -0
  29. package/src/server/routers/lambda/market/oidc.ts +41 -61
  30. package/src/server/routers/tools/market.ts +12 -44
  31. package/src/server/services/agentRuntime/AgentRuntimeService.test.ts +7 -0
  32. package/src/server/services/agentRuntime/AgentRuntimeService.ts +1 -1
  33. package/src/server/services/aiAgent/__tests__/execAgent.threadId.test.ts +7 -0
  34. package/src/server/services/aiAgent/__tests__/execGroupSubAgentTask.test.ts +7 -0
  35. package/src/server/services/aiAgent/index.ts +9 -96
  36. package/src/server/services/discover/index.ts +11 -16
  37. package/src/server/services/market/index.ts +485 -0
  38. package/src/server/services/toolExecution/builtin.ts +11 -17
  39. package/src/server/services/toolExecution/index.ts +6 -2
  40. package/src/services/codeInterpreter.ts +0 -13
  41. package/packages/model-runtime/src/types/textToImage.ts +0 -36
  42. package/src/server/services/lobehubSkill/index.ts +0 -109
@@ -16,7 +16,7 @@
16
16
 
17
17
  <!-- Link to the issue that is fixed by this PR -->
18
18
 
19
- <!-- Example: Fixes #123, Closes #456, Related to #789 -->
19
+ <!-- Example: Fixes #xxx, Closes #xxx, Related to #xxx -->
20
20
 
21
21
  #### 🔀 Description of Change
22
22
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 2.0.0-next.311](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.310...v2.0.0-next.311)
6
+
7
+ <sup>Released on **2026-01-19**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Refactor market sdk into market servers.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **misc**: Refactor market sdk into market servers, closes [#11604](https://github.com/lobehub/lobe-chat/issues/11604) ([858cc20](https://github.com/lobehub/lobe-chat/commit/858cc20))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ## [Version 2.0.0-next.310](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.309...v2.0.0-next.310)
6
31
 
7
32
  <sup>Released on **2026-01-19**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Refactor market sdk into market servers."
6
+ ]
7
+ },
8
+ "date": "2026-01-19",
9
+ "version": "2.0.0-next.311"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "improvements": [
@@ -223,7 +223,6 @@ AgentRuntime is a core abstraction layer in Lobe Chat that encapsulates a unifie
223
223
  chat(payload: ChatStreamPayload, options?: ChatCompetitionOptions): Promise<Response>;
224
224
  embeddings?(payload: EmbeddingsPayload, options?: EmbeddingsOptions): Promise<Embeddings[]>;
225
225
  models?(): Promise<any>;
226
- textToImage?: (payload: TextToImagePayload) => Promise<string[]>;
227
226
  textToSpeech?: (
228
227
  payload: TextToSpeechPayload,
229
228
  options?: TextToSpeechOptions,
@@ -223,7 +223,6 @@ AgentRuntime 是 Lobe Chat 中的一个核心抽象层,它封装了与不同 A
223
223
  chat(payload: ChatStreamPayload, options?: ChatCompetitionOptions): Promise<Response>;
224
224
  embeddings?(payload: EmbeddingsPayload, options?: EmbeddingsOptions): Promise<Embeddings[]>;
225
225
  models?(): Promise<any>;
226
- textToImage?: (payload: TextToImagePayload) => Promise<string[]>;
227
226
  textToSpeech?: (
228
227
  payload: TextToSpeechPayload,
229
228
  options?: TextToSpeechOptions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.310",
3
+ "version": "2.0.0-next.311",
4
4
  "description": "LobeHub - an open-source,comprehensive AI Agent 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",
@@ -13,7 +13,6 @@ import {
13
13
  GenerateObjectPayload,
14
14
  ModelRequestOptions,
15
15
  PullModelParams,
16
- TextToImagePayload,
17
16
  TextToSpeechOptions,
18
17
  TextToSpeechPayload,
19
18
  } from '../types';
@@ -28,7 +27,6 @@ export interface LobeRuntimeAI {
28
27
 
29
28
  models?(): Promise<any>;
30
29
 
31
- textToImage?: (payload: TextToImagePayload) => Promise<string[]>;
32
30
  createImage?: (payload: CreateImagePayload) => Promise<CreateImageResponse>;
33
31
 
34
32
  textToSpeech?: (
@@ -226,43 +226,6 @@ describe('ModelRuntime', () => {
226
226
  });
227
227
  });
228
228
 
229
- describe('ModelRuntime textToImage method', () => {
230
- it('should run correctly', async () => {
231
- const payload = {
232
- model: 'stable-diffusion',
233
- prompt: 'A beautiful landscape',
234
- };
235
-
236
- const mockResponse = ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'];
237
-
238
- vi.spyOn(LobeOpenAI.prototype, 'textToImage').mockResolvedValue(mockResponse);
239
-
240
- const result = await mockModelRuntime.textToImage(payload);
241
-
242
- expect(LobeOpenAI.prototype.textToImage).toHaveBeenCalledWith(payload);
243
- expect(result).toBe(mockResponse);
244
- });
245
-
246
- it('should handle undefined textToImage method gracefully', async () => {
247
- const payload = {
248
- model: 'stable-diffusion',
249
- prompt: 'A beautiful landscape',
250
- };
251
-
252
- // Mock runtime without textToImage method
253
- const runtimeWithoutTextToImage = {
254
- textToImage: undefined,
255
- };
256
-
257
- // @ts-ignore - testing edge case
258
- mockModelRuntime['_runtime'] = runtimeWithoutTextToImage;
259
-
260
- const result = await mockModelRuntime.textToImage(payload);
261
-
262
- expect(result).toBeUndefined();
263
- });
264
- });
265
-
266
229
  describe('ModelRuntime createImage method', () => {
267
230
  it('should run correctly', async () => {
268
231
  const payload: CreateImagePayload = {
@@ -13,7 +13,6 @@ import {
13
13
  GenerateObjectPayload,
14
14
  ModelRequestOptions,
15
15
  PullModelParams,
16
- TextToImagePayload,
17
16
  TextToSpeechPayload,
18
17
  } from '../types';
19
18
  import { AgentRuntimeErrorType } from '../types/error';
@@ -79,10 +78,6 @@ export class ModelRuntime {
79
78
  return this._runtime.generateObject!(payload);
80
79
  }
81
80
 
82
- async textToImage(payload: TextToImagePayload) {
83
- return this._runtime.textToImage?.(payload);
84
- }
85
-
86
81
  async createImage(payload: CreateImagePayload) {
87
82
  return this._runtime.createImage?.(payload);
88
83
  }
@@ -6,8 +6,10 @@ import { LobeDeepSeekAI } from '../../providers/deepseek';
6
6
  import { LobeFalAI } from '../../providers/fal';
7
7
  import { LobeGoogleAI } from '../../providers/google';
8
8
  import { LobeMinimaxAI } from '../../providers/minimax';
9
+ import { LobeMoonshotAI } from '../../providers/moonshot';
9
10
  import { LobeOpenAI } from '../../providers/openai';
10
11
  import { LobeQwenAI } from '../../providers/qwen';
12
+ import { LobeVertexAI } from '../../providers/vertexai';
11
13
  import { LobeXAI } from '../../providers/xai';
12
14
 
13
15
  export const baseRuntimeMap = {
@@ -19,7 +21,9 @@ export const baseRuntimeMap = {
19
21
  fal: LobeFalAI,
20
22
  google: LobeGoogleAI,
21
23
  minimax: LobeMinimaxAI,
24
+ moonshot: LobeMoonshotAI,
22
25
  openai: LobeOpenAI,
23
26
  qwen: LobeQwenAI,
27
+ vertexai: LobeVertexAI,
24
28
  xai: LobeXAI,
25
29
  };