@lobehub/chat 1.113.3 → 1.114.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.
- package/.eslintignore +17 -0
- package/.github/workflows/auto-i18n.yml +1 -1
- package/.github/workflows/claude.yml +1 -1
- package/.github/workflows/desktop-pr-build.yml +4 -4
- package/.github/workflows/docker-database.yml +3 -3
- package/.github/workflows/docker-pglite.yml +3 -3
- package/.github/workflows/docker.yml +3 -3
- package/.github/workflows/lighthouse.yml +2 -2
- package/.github/workflows/release-desktop-beta.yml +3 -3
- package/.github/workflows/release.yml +2 -2
- package/.github/workflows/sync-database-schema.yml +1 -1
- package/.github/workflows/sync.yml +1 -1
- package/.github/workflows/test.yml +1 -1
- package/.stylelintignore +39 -0
- package/CHANGELOG.md +50 -0
- package/changelog/v1.json +14 -0
- package/package.json +1 -1
- package/packages/const/src/index.ts +2 -0
- package/packages/model-runtime/src/RouterRuntime/createRuntime.ts +10 -5
- package/packages/model-runtime/src/openai/__snapshots__/index.test.ts.snap +29 -0
- package/packages/model-runtime/src/utils/modelParse.ts +29 -16
- package/packages/prompts/package.json +1 -0
- package/{src → packages/prompts/src}/chains/__tests__/langDetect.test.ts +1 -2
- package/{src → packages/prompts/src}/chains/__tests__/pickEmoji.test.ts +1 -2
- package/{src → packages/prompts/src}/chains/__tests__/summaryAgentName.test.ts +2 -15
- package/{src → packages/prompts/src}/chains/__tests__/summaryDescription.test.ts +2 -12
- package/{src → packages/prompts/src}/chains/__tests__/summaryHistory.test.ts +1 -5
- package/{src → packages/prompts/src}/chains/__tests__/summaryTags.test.ts +1 -14
- package/{src → packages/prompts/src}/chains/__tests__/summaryTitle.test.ts +2 -11
- package/{src → packages/prompts/src}/chains/abstractChunk.ts +2 -2
- package/{src → packages/prompts/src}/chains/answerWithContext.ts +1 -1
- package/packages/prompts/src/chains/index.ts +12 -0
- package/{src → packages/prompts/src}/chains/langDetect.ts +1 -1
- package/{src → packages/prompts/src}/chains/pickEmoji.ts +1 -1
- package/{src → packages/prompts/src}/chains/rewriteQuery.ts +2 -2
- package/{src → packages/prompts/src}/chains/summaryAgentName.ts +6 -5
- package/{src → packages/prompts/src}/chains/summaryDescription.ts +7 -5
- package/{src → packages/prompts/src}/chains/summaryGenerationTitle.ts +3 -5
- package/{src → packages/prompts/src}/chains/summaryHistory.ts +2 -3
- package/{src → packages/prompts/src}/chains/summaryTags.ts +3 -4
- package/{src → packages/prompts/src}/chains/summaryTitle.ts +5 -5
- package/{src → packages/prompts/src}/chains/translate.ts +1 -1
- package/packages/prompts/src/index.ts +2 -5
- package/packages/prompts/src/{files → prompts/files}/index.test.ts +1 -2
- package/packages/prompts/src/prompts/index.ts +5 -0
- package/packages/prompts/src/{knowledgeBaseQA → prompts/knowledgeBaseQA}/index.test.ts +1 -3
- package/packages/types/src/aiModel.ts +2 -2
- package/packages/types/src/index.ts +3 -0
- package/packages/types/src/llm.ts +3 -0
- package/src/app/[variants]/(main)/settings/provider/(detail)/[id]/index.tsx +5 -0
- package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx +2 -4
- package/src/config/aiModels/fal.ts +26 -1
- package/src/features/AgentSetting/store/action.ts +19 -7
- package/src/server/routers/async/ragEval.ts +1 -1
- package/src/store/aiInfra/slices/aiProvider/__tests__/action.test.ts +8 -2
- package/src/store/chat/slices/aiChat/actions/memory.ts +1 -1
- package/src/store/chat/slices/aiChat/actions/rag.ts +1 -1
- package/src/store/chat/slices/thread/action.ts +3 -2
- package/src/store/chat/slices/topic/action.ts +3 -2
- package/src/store/chat/slices/translate/action.test.ts +2 -2
- package/src/store/chat/slices/translate/action.ts +1 -2
- package/src/store/image/slices/generationTopic/action.ts +6 -2
- package/tsconfig.json +1 -1
- package/.github/workflows/claude-code-review.yml +0 -78
- package/.github/workflows/wiki-sync.yml +0 -19
- /package/{src → packages/prompts/src}/chains/__tests__/__snapshots__/summaryHistory.test.ts.snap +0 -0
- /package/{src → packages/prompts/src}/chains/__tests__/translate.test.ts +0 -0
- /package/packages/prompts/src/{chatMessages → prompts/chatMessages}/index.test.ts +0 -0
- /package/packages/prompts/src/{chatMessages → prompts/chatMessages}/index.ts +0 -0
- /package/packages/prompts/src/{files → prompts/files}/file.ts +0 -0
- /package/packages/prompts/src/{files → prompts/files}/image.ts +0 -0
- /package/packages/prompts/src/{files → prompts/files}/index.ts +0 -0
- /package/packages/prompts/src/{knowledgeBaseQA → prompts/knowledgeBaseQA}/__snapshots__/index.test.ts.snap +0 -0
- /package/packages/prompts/src/{knowledgeBaseQA → prompts/knowledgeBaseQA}/chunk.ts +0 -0
- /package/packages/prompts/src/{knowledgeBaseQA → prompts/knowledgeBaseQA}/index.ts +0 -0
- /package/packages/prompts/src/{knowledgeBaseQA → prompts/knowledgeBaseQA}/knowledge.ts +0 -0
- /package/packages/prompts/src/{knowledgeBaseQA → prompts/knowledgeBaseQA}/userQuery.ts +0 -0
- /package/packages/prompts/src/{plugin → prompts/plugin}/index.test.ts +0 -0
- /package/packages/prompts/src/{plugin → prompts/plugin}/index.ts +0 -0
- /package/packages/prompts/src/{plugin → prompts/plugin}/tools.test.ts +0 -0
- /package/packages/prompts/src/{plugin → prompts/plugin}/tools.ts +0 -0
- /package/packages/prompts/src/{systemRole → prompts/systemRole}/index.ts +0 -0
@@ -1,13 +1,14 @@
|
|
1
|
+
import { chainSummaryGenerationTitle } from '@lobechat/prompts';
|
1
2
|
import isEqual from 'fast-deep-equal';
|
2
3
|
import { SWRResponse, mutate } from 'swr';
|
3
4
|
import { StateCreator } from 'zustand/vanilla';
|
4
5
|
|
5
|
-
import { chainSummaryGenerationTitle } from '@/chains/summaryGenerationTitle';
|
6
6
|
import { LOADING_FLAT } from '@/const/message';
|
7
7
|
import { useClientDataSWR } from '@/libs/swr';
|
8
8
|
import { UpdateTopicValue } from '@/server/routers/lambda/generationTopic';
|
9
9
|
import { chatService } from '@/services/chat';
|
10
10
|
import { generationTopicService } from '@/services/generationTopic';
|
11
|
+
import { globalHelpers } from '@/store/global/helpers';
|
11
12
|
import { useUserStore } from '@/store/user';
|
12
13
|
import { systemAgentSelectors } from '@/store/user/selectors';
|
13
14
|
import { ImageGenerationTopic } from '@/types/generation';
|
@@ -115,7 +116,10 @@ export const createGenerationTopicSlice: StateCreator<
|
|
115
116
|
);
|
116
117
|
// Auto generate topic title from prompt by AI
|
117
118
|
await chatService.fetchPresetTaskResult({
|
118
|
-
params: merge(
|
119
|
+
params: merge(
|
120
|
+
generationTopicAgentConfig,
|
121
|
+
chainSummaryGenerationTitle(prompts, 'image', globalHelpers.getCurrentLanguage()),
|
122
|
+
),
|
119
123
|
onError: async () => {
|
120
124
|
const fallbackTitle = generateFallbackTitle();
|
121
125
|
internal_updateGenerationTopicTitleInSummary(topicId, fallbackTitle);
|
package/tsconfig.json
CHANGED
@@ -1,78 +0,0 @@
|
|
1
|
-
name: Claude Code Review
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
types: [opened, synchronize]
|
6
|
-
# Optional: Only run on specific file changes
|
7
|
-
# paths:
|
8
|
-
# - "src/**/*.ts"
|
9
|
-
# - "src/**/*.tsx"
|
10
|
-
# - "src/**/*.js"
|
11
|
-
# - "src/**/*.jsx"
|
12
|
-
|
13
|
-
jobs:
|
14
|
-
claude-review:
|
15
|
-
# Optional: Filter by PR author
|
16
|
-
# if: |
|
17
|
-
# github.event.pull_request.user.login == 'external-contributor' ||
|
18
|
-
# github.event.pull_request.user.login == 'new-developer' ||
|
19
|
-
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
20
|
-
|
21
|
-
runs-on: ubuntu-latest
|
22
|
-
permissions:
|
23
|
-
contents: read
|
24
|
-
pull-requests: read
|
25
|
-
issues: read
|
26
|
-
id-token: write
|
27
|
-
|
28
|
-
steps:
|
29
|
-
- name: Checkout repository
|
30
|
-
uses: actions/checkout@v4
|
31
|
-
with:
|
32
|
-
fetch-depth: 1
|
33
|
-
|
34
|
-
- name: Run Claude Code Review
|
35
|
-
id: claude-review
|
36
|
-
uses: anthropics/claude-code-action@beta
|
37
|
-
with:
|
38
|
-
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
39
|
-
|
40
|
-
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
|
41
|
-
model: 'claude-opus-4-1-20250805'
|
42
|
-
allowed_bots: 'bot'
|
43
|
-
|
44
|
-
# Direct prompt for automated review (no @claude mention needed)
|
45
|
-
direct_prompt: |
|
46
|
-
Please review this pull request and provide feedback on:
|
47
|
-
- Code quality and best practices
|
48
|
-
- Potential bugs or issues
|
49
|
-
- Performance considerations
|
50
|
-
- Security concerns
|
51
|
-
- Test coverage
|
52
|
-
|
53
|
-
Be constructive and helpful in your feedback.
|
54
|
-
|
55
|
-
# Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
|
56
|
-
# use_sticky_comment: true
|
57
|
-
|
58
|
-
# Optional: Customize review based on file types
|
59
|
-
# direct_prompt: |
|
60
|
-
# Review this PR focusing on:
|
61
|
-
# - For TypeScript files: Type safety and proper interface usage
|
62
|
-
# - For API endpoints: Security, input validation, and error handling
|
63
|
-
# - For React components: Performance, accessibility, and best practices
|
64
|
-
# - For tests: Coverage, edge cases, and test quality
|
65
|
-
|
66
|
-
# Optional: Different prompts for different authors
|
67
|
-
# direct_prompt: |
|
68
|
-
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
|
69
|
-
# 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
|
70
|
-
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
|
71
|
-
|
72
|
-
# Optional: Add specific tools for running tests or linting
|
73
|
-
allowed_tools: 'Bash(bun run:*),Bash(pnpm run:*),Bash(npm run:*),Bash(npx vitest:*),Bash(rg:*),Bash(find:*),Bash(sed:*),Bash(grep:*),Bash(awk:*),Bash(wc:*),Bash(xargs:*)'
|
74
|
-
|
75
|
-
# Optional: Skip review for certain conditions
|
76
|
-
# if: |
|
77
|
-
# !contains(github.event.pull_request.title, '[skip-review]') &&
|
78
|
-
# !contains(github.event.pull_request.title, '[WIP]')
|
@@ -1,19 +0,0 @@
|
|
1
|
-
name: Wiki Sync
|
2
|
-
|
3
|
-
on:
|
4
|
-
workflow_dispatch:
|
5
|
-
push:
|
6
|
-
paths:
|
7
|
-
- 'docs/wiki/**'
|
8
|
-
branches:
|
9
|
-
- main
|
10
|
-
|
11
|
-
jobs:
|
12
|
-
update-wiki:
|
13
|
-
runs-on: ubuntu-latest
|
14
|
-
name: Wiki sync
|
15
|
-
steps:
|
16
|
-
- uses: OrlovM/Wiki-Action@v1
|
17
|
-
with:
|
18
|
-
path: 'docs/wiki'
|
19
|
-
token: ${{ secrets.GH_TOKEN }}
|
/package/{src → packages/prompts/src}/chains/__tests__/__snapshots__/summaryHistory.test.ts.snap
RENAMED
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
|
File without changes
|
File without changes
|