Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🔧 chore: resolve all ESLint suppressions and remove suppression file (#12518)

Innei3112036b3836
diff --git a/eslint-suppressions.json b/eslint-suppressions.json
deleted file mode 100644
index 7236adb1c9d..00000000000
--- a/eslint-suppressions.json
+++ /dev/null
@@ -1,806 +0,0 @@
-{
- "src/app/(backend)/api/dev/memory-user-memory/benchmark-locomo/route.ts": {
- "no-console": {
- "count": 6
- }
- },
- "src/app/(backend)/api/webhooks/logto/route.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/app/(backend)/trpc/async/[trpc]/route.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/app/(backend)/trpc/mobile/[trpc]/route.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/app/(backend)/webapi/chat/[provider]/route.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/app/[variants]/(auth)/market-auth-callback/page.tsx": {
- "no-console": {
- "count": 2
- }
- },
- "src/app/[variants]/(desktop)/desktop-onboarding/features/WelcomeStep.tsx": {
- "@eslint-react/no-nested-component-definitions": {
- "count": 1
- }
- },
- "src/app/[variants]/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx": {
- "no-console": {
- "count": 1
- }
- },
- "src/app/[variants]/(main)/community/components/VirtuosoGridList/index.tsx": {
- "@eslint-react/no-nested-component-definitions": {
- "count": 2
- }
- },
- "src/app/[variants]/(main)/home/features/RecentPage/Item.tsx": {
- "regexp/no-super-linear-backtracking": {
- "count": 1
- }
- },
- "src/app/[variants]/(main)/home/features/index.tsx": {
- "@eslint-react/no-nested-component-definitions": {
- "count": 1
- }
- },
- "src/app/[variants]/(main)/memory/features/GridView/index.tsx": {
- "@eslint-react/no-nested-component-definitions": {
- "count": 1
- }
- },
- "src/app/[variants]/(main)/resource/features/hooks/useResourceManagerUrlSync.ts": {
- "react-hooks/exhaustive-deps": {
- "count": 1
- }
- },
- "src/app/[variants]/(main)/settings/provider/detail/ollama/CheckError.tsx": {
- "regexp/no-dupe-characters-character-class": {
- "count": 1
- },
- "regexp/no-obscure-range": {
- "count": 1
- }
- },
- "src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx": {
- "no-console": {
- "count": 2
- }
- },
- "src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx": {
- "no-console": {
- "count": 1
- }
- },
- "src/app/[variants]/onboarding/components/KlavisServerList/hooks/useKlavisOAuth.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/app/[variants]/onboarding/features/ResponseLanguageStep.tsx": {
- "@eslint-react/no-nested-component-definitions": {
- "count": 1
- }
- },
- "src/app/[variants]/onboarding/features/TelemetryStep.tsx": {
- "@eslint-react/no-nested-component-definitions": {
- "count": 1
- }
- },
- "src/components/AntdStaticMethods/index.tsx": {
- "import-x/no-mutable-exports": {
- "count": 3
- }
- },
- "src/components/ChatGroupWizard/index.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/components/DebugNode.tsx": {
- "no-console": {
- "count": 1
- }
- },
- "src/components/Loading/CircleLoading/index.tsx": {
- "unicorn/no-anonymous-default-export": {
- "count": 1
- }
- },
- "src/components/ModelSelect/index.tsx": {
- "no-shadow-restricted-names": {
- "count": 1
- }
- },
- "src/config/featureFlags/schema.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/envs/analytics.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/envs/app.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/envs/auth.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/envs/email.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/envs/langfuse.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/envs/llm.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/envs/redis.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/features/ChatInput/ActionBar/Tools/KlavisServerItem.tsx": {
- "no-console": {
- "count": 2
- }
- },
- "src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx": {
- "no-console": {
- "count": 3
- }
- },
- "src/features/CommandMenu/SearchResults.tsx": {
- "no-console": {
- "count": 1
- }
- },
- "src/features/Conversation/Error/OllamaBizError/index.tsx": {
- "regexp/no-dupe-characters-character-class": {
- "count": 1
- },
- "regexp/no-obscure-range": {
- "count": 1
- }
- },
- "src/features/Conversation/store/slices/message/action/sendMessage.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/features/Conversation/types/hooks.ts": {
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/features/Conversation/utils/markdown.ts": {
- "regexp/no-super-linear-backtracking": {
- "count": 3
- }
- },
- "src/features/PluginsUI/Render/utils/iframeOnReady.test.ts": {
- "unicorn/no-invalid-remove-event-listener": {
- "count": 1
- }
- },
- "src/features/PluginsUI/Render/utils/pluginSettings.test.ts": {
- "unicorn/no-invalid-remove-event-listener": {
- "count": 1
- }
- },
- "src/features/PluginsUI/Render/utils/pluginState.test.ts": {
- "unicorn/no-invalid-remove-event-listener": {
- "count": 1
- }
- },
- "src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx": {
- "prefer-const": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/ListView/index.tsx": {
- "@eslint-react/no-nested-component-definitions": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx": {
- "regexp/no-super-linear-backtracking": {
- "count": 1
- }
- },
- "src/features/ShareModal/ShareJSON/generateFullExport.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/helpers/parserPlaceholder/index.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/hooks/useAgentOwnershipCheck.ts": {
- "no-console": {
- "count": 6
- }
- },
- "src/hooks/useHotkeys/useHotkeyById.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/layout/AuthProvider/MarketAuth/oidc.ts": {
- "no-console": {
- "count": 17
- },
- "prefer-const": {
- "count": 1
- }
- },
- "src/libs/better-auth/define-config.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/libs/oidc-provider/http-adapter.ts": {
- "@typescript-eslint/ban-types": {
- "count": 1
- },
- "@typescript-eslint/no-unsafe-function-type": {
- "count": 1
- }
- },
- "src/libs/swr/localStorageProvider.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/libs/traces/index.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/locales/default/welcome.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/server/modules/ModelRuntime/apiKeyManager.test.ts": {
- "unicorn/no-new-array": {
- "count": 1
- }
- },
- "src/server/routers/lambda/__tests__/integration/aiAgent.createClientGroupAgentTaskThread.integration.test.ts": {
- "@typescript-eslint/no-non-null-asserted-optional-chain": {
- "count": 2
- }
- },
- "src/server/routers/lambda/__tests__/integration/aiAgent.createClientTaskThread.integration.test.ts": {
- "@typescript-eslint/no-non-null-asserted-optional-chain": {
- "count": 2
- }
- },
- "src/server/routers/lambda/agent.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/server/routers/lambda/aiChat.ts": {
- "prefer-const": {
- "count": 1
- }
- },
- "src/server/routers/lambda/chunk.ts": {
- "prefer-const": {
- "count": 1
- }
- },
- "src/server/routers/lambda/index.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/routers/lambda/knowledge.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/server/routers/lambda/ragEval.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/server/routers/lambda/sessionGroup.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/server/routers/tools/mcp.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/server/services/comfyui/config/fluxModelRegistry.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/config/modelRegistry.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/config/promptToolConst.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/config/sdModelRegistry.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/config/systemComponents.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/config/workflowRegistry.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/core/errorHandlerService.ts": {
- "regexp/no-dupe-disjunctions": {
- "count": 1
- },
- "regexp/no-super-linear-backtracking": {
- "count": 1
- }
- },
- "src/server/services/comfyui/errors/configError.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/errors/modelResolverError.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/errors/servicesError.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/errors/utilsError.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/errors/workflowError.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/utils/workflowUtils.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/workflows/flux-dev.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/workflows/flux-kontext.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/workflows/flux-schnell.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/workflows/sd35.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/comfyui/workflows/simple-sd.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 2
- }
- },
- "src/server/services/webhookUser/index.test.ts": {
- "unicorn/no-thenable": {
- "count": 7
- }
- },
- "src/server/services/webhookUser/index.ts": {
- "no-console": {
- "count": 2
- }
- },
- "src/services/_url.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/services/models.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/services/tableViewer/client.ts": {
- "no-console": {
- "count": 2
- }
- },
- "src/store/agent/slices/cron/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/agent/slices/knowledge/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/agent/slices/plugin/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/store/chat/slices/aiAgent/actions/groupOrchestration.ts": {
- "no-unused-private-class-members": {
- "count": 1
- },
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/aiAgent/actions/runAgent.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/chat/slices/aiChat/actions/conversationControl.ts": {
- "no-unused-private-class-members": {
- "count": 1
- },
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/aiChat/actions/conversationLifecycle.ts": {
- "no-unused-private-class-members": {
- "count": 1
- },
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/aiChat/actions/memory.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/chat/slices/message/actions/optimisticUpdate.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/chat/slices/message/actions/publicApi.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/message/supervisor.ts": {
- "no-console": {
- "count": 5
- }
- },
- "src/store/chat/slices/operation/types.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/plugin/actions/internals.ts": {
- "no-unused-private-class-members": {
- "count": 2
- },
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/plugin/actions/optimisticUpdate.ts": {
- "no-unused-private-class-members": {
- "count": 1
- },
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/plugin/actions/pluginTypes.ts": {
- "no-unused-private-class-members": {
- "count": 1
- },
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/plugin/actions/publicApi.ts": {
- "no-unused-private-class-members": {
- "count": 1
- },
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/plugin/actions/workflow.ts": {
- "no-unused-private-class-members": {
- "count": 1
- },
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/portal/selectors.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/thread/action.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/topic/action.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/chat/slices/translate/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/chat/slices/tts/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/discover/slices/assistant/action.ts": {
- "no-unused-private-class-members": {
- "count": 2
- }
- },
- "src/store/discover/slices/groupAgent/action.ts": {
- "no-unused-private-class-members": {
- "count": 2
- }
- },
- "src/store/discover/slices/mcp/action.ts": {
- "no-unused-private-class-members": {
- "count": 2
- }
- },
- "src/store/discover/slices/model/action.ts": {
- "no-unused-private-class-members": {
- "count": 2
- }
- },
- "src/store/discover/slices/plugin/action.ts": {
- "no-unused-private-class-members": {
- "count": 2
- }
- },
- "src/store/discover/slices/provider/action.ts": {
- "no-unused-private-class-members": {
- "count": 2
- }
- },
- "src/store/discover/slices/social/action.ts": {
- "no-unused-private-class-members": {
- "count": 2
- }
- },
- "src/store/discover/slices/user/action.ts": {
- "no-unused-private-class-members": {
- "count": 2
- }
- },
- "src/store/document/slices/editor/selectors.ts": {
- "sort-keys-fix/sort-keys-fix": {
- "count": 1
- }
- },
- "src/store/file/slices/chat/action.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/store/file/slices/chunk/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/file/slices/tts/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/file/slices/upload/action.ts": {
- "no-unused-private-class-members": {
- "count": 2
- }
- },
- "src/store/global/actions/workspacePane.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/global/initialState.ts": {
- "typescript-sort-keys/string-enum": {
- "count": 2
- }
- },
- "src/store/home/slices/group/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/home/slices/homeInput/action.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/store/library/slices/content/action.ts": {
- "no-unused-private-class-members": {
- "count": 2
- }
- },
- "src/store/mention/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/serverConfig/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/store/session/slices/homeInput/action.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/store/session/slices/session/action.ts": {
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/session/slices/sessionGroup/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- },
- "typescript-sort-keys/interface": {
- "count": 1
- }
- },
- "src/store/tool/slices/klavisStore/action.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/store/tool/slices/mcpStore/action.ts": {
- "no-console": {
- "count": 1
- }
- },
- "src/store/tool/slices/oldStore/initialState.ts": {
- "typescript-sort-keys/string-enum": {
- "count": 1
- }
- },
- "src/store/userMemory/slices/home/action.ts": {
- "no-unused-private-class-members": {
- "count": 1
- }
- },
- "src/styles/antdOverride.ts": {
- "unicorn/no-anonymous-default-export": {
- "count": 1
- }
- },
- "src/utils/server/parseModels.ts": {
- "prefer-const": {
- "count": 1
- }
- }
-}
\ No newline at end of file
diff --git a/eslint.config.mjs b/eslint.config.mjs
index bffd35af422..15feeacc5a7 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -54,10 +54,17 @@ export default eslint(
// Global rule overrides
{
rules: {
+ '@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 0,
+ '@eslint-react/jsx-key-before-spread': 0,
+ '@eslint-react/naming-convention/ref-name': 0,
+ '@eslint-react/naming-convention/use-state': 0,
+ '@eslint-react/no-array-index-key': 0,
'@next/next/no-img-element': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-useless-constructor': 0,
'no-extra-boolean-cast': 0,
+ 'no-restricted-syntax': 0,
+ 'react-refresh/only-export-components': 0,
'react/no-unknown-property': 0,
'regexp/match-any': 0,
'unicorn/better-regex': 0,
diff --git a/package.json b/package.json
index 42c0a93edd9..bb5932dac6d 100644
--- a/package.json
+++ b/package.json
@@ -80,9 +80,7 @@
"lint:md": "remark . --silent --output",
"lint:mdx": "npm run workflow:mdx && remark \"docs/**/*.mdx\" -r ./.remarkrc.mdx.mjs --silent --output && eslint \"docs/**/*.mdx\" --quiet --fix",
"lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
- "lint:ts": "bash scripts/lint-ts.sh",
- "lint:ts:prune": "eslint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --prune-suppressions --concurrency=auto",
- "lint:ts:suppress": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --suppress-all --concurrency=auto",
+ "lint:ts": "eslint src/ tests/ --concurrency=auto",
"lint:unused": "knip --include files,exports,types,enumMembers,duplicates",
"prepare": "husky",
"prettier": "prettier -c --write \"**/**\"",
@@ -125,27 +123,23 @@
],
"*.mdx": [
"remark -r ./.remarkrc.mdx.mjs --silent --output --",
- "eslint --quiet --fix --prune-suppressions",
- "git add eslint-suppressions.json"
+ "eslint --quiet --fix"
],
"*.json": [
"prettier --write --no-error-on-unmatched-pattern"
],
"*.{mjs,cjs}": [
- "eslint --fix --prune-suppressions",
- "git add eslint-suppressions.json",
+ "eslint --fix",
"prettier --write"
],
"*.{js,jsx}": [
- "eslint --fix --prune-suppressions",
- "git add eslint-suppressions.json",
+ "eslint --fix",
"stylelint --fix",
"prettier --write"
],
"*.{ts,tsx}": [
"stylelint --fix",
- "eslint --fix --prune-suppressions",
- "git add eslint-suppressions.json",
+ "eslint --fix",
"prettier --parser=typescript --write"
],
"*.{yml,yaml}": [
@@ -400,7 +394,7 @@
"@inquirer/prompts": "^8.2.0",
"@lobechat/types": "workspace:*",
"@lobehub/i18n-cli": "^1.26.0",
- "@lobehub/lint": "2.1.3",
+ "@lobehub/lint": "2.1.5",
"@lobehub/market-types": "^1.12.3",
"@lobehub/seo-cli": "^1.7.0",
"@peculiar/webcrypto": "^1.5.0",
@@ -449,8 +443,8 @@
"dpdm-fast": "^1.0.14",
"drizzle-dbml-generator": "^0.10.0",
"drizzle-kit": "^0.31.8",
- "eslint": "10.0.0",
- "eslint-plugin-mdx": "^3.6.2",
+ "eslint": "10.0.2",
+ "eslint-plugin-mdx": "^3.7.0",
"fake-indexeddb": "^6.2.5",
"fs-extra": "^11.3.3",
"glob": "^13.0.0",
diff --git a/scripts/lint-ts.sh b/scripts/lint-ts.sh
deleted file mode 100755
index ea32422cc25..00000000000
--- a/scripts/lint-ts.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-set -o pipefail
-
-eslint src/ tests/ --fix --concurrency=auto --prune-suppressions
-eslint src/ tests/ --concurrency=auto
diff --git a/src/app/(backend)/api/agent/route.ts b/src/app/(backend)/api/agent/route.ts
index b3e98e03cac..5d9341481a1 100644
--- a/src/app/(backend)/api/agent/route.ts
+++ b/src/app/(backend)/api/agent/route.ts
@@ -28,7 +28,7 @@ const verifyQStashSignature = async (request: NextRequest, rawBody: string): Pro
}
const { Receiver } = await import('@upstash/qstash');
- const receiver = new Receiver({ currentSigningKey, nextSigningKey: nextSigningKey });
+ const receiver = new Receiver({ currentSigningKey, nextSigningKey });
try {
return await receiver.verify({ body: rawBody, signature });
diff --git a/src/app/(backend)/api/dev/memory-user-memory/benchmark-locomo/route.ts b/src/app/(backend)/api/dev/memory-user-memory/benchmark-locomo/route.ts
index 7569f5403dc..f12db224923 100644
--- a/src/app/(backend)/api/dev/memory-user-memory/benchmark-locomo/route.ts
+++ b/src/app/(backend)/api/dev/memory-user-memory/benchmark-locomo/route.ts
@@ -44,8 +44,9 @@ export const POST = async (req: Request) => {
const json = await req.json();
const parsed = bodySchema.parse(json);
- console.log('[locomo-dev-search] parsed body', parsed);
- const userId = parsed.userId || (parsed.sampleId ? `locomo-user-${parsed.sampleId}` : undefined);
+ console.info('[locomo-dev-search] parsed body', parsed);
+ const userId =
+ parsed.userId || (parsed.sampleId ? `locomo-user-${parsed.sampleId}` : undefined);
if (!userId) {
return NextResponse.json({ error: 'userId or sampleId is required' }, { status: 400 });
}
@@ -65,11 +66,11 @@ export const POST = async (req: Request) => {
);
const [embedding] =
- (await runtime.embeddings({
- dimensions: DEFAULT_USER_MEMORY_EMBEDDING_DIMENSIONS,
- input: parsed.query,
- model: config.embedding.model,
- })) || [];
+ (await runtime.embeddings({
+ dimensions: DEFAULT_USER_MEMORY_EMBEDDING_DIMENSIONS,
+ input: parsed.query,
+ model: config.embedding.model,
+ })) || [];
if (!embedding) {
return NextResponse.json(
@@ -77,7 +78,7 @@ export const POST = async (req: Request) => {
{ status: 500 },
);
}
- console.log('[locomo-dev-search] generated embedding');
+ console.info('[locomo-dev-search] generated embedding');
const searchResult = await model.searchWithEmbedding({
embedding,
@@ -88,14 +89,16 @@ export const POST = async (req: Request) => {
preferences: topK,
},
});
- console.log('[locomo-dev-search] searched result');
+ console.info('[locomo-dev-search] searched result');
const identities = await model.getAllIdentities();
- console.log('[locomo-dev-search] fetched identities');
+ console.info('[locomo-dev-search] fetched identities');
const memoryIds = [
...searchResult.contexts
- .map((context) => Array.isArray(context.userMemoryIds) ? (context.userMemoryIds as string[])[0] : undefined)
+ .map((context) =>
+ Array.isArray(context.userMemoryIds) ? (context.userMemoryIds as string[])[0] : undefined,
+ )
.filter((id): id is string => !!id),
...searchResult.experiences
.map((experience) => experience.userMemoryId)
@@ -106,9 +109,7 @@ export const POST = async (req: Request) => {
...searchResult.activities
.map((activity) => activity.userMemoryId)
.filter((id): id is string => !!id),
- ...identities
- .map((identity) => identity.userMemoryId)
- .filter((id): id is string => !!id),
+ ...identities.map((identity) => identity.userMemoryId).filter((id): id is string => !!id),
];
const uniqueMemoryIds = Array.from(new Set(memoryIds));
@@ -117,10 +118,10 @@ export const POST = async (req: Request) => {
uniqueMemoryIds.length === 0
? []
: await db
- .select(selectNonVectorColumns(userMemories))
- .from(userMemories)
- .where(and(eq(userMemories.userId, userId), inArray(userMemories.id, uniqueMemoryIds)));
- console.log('[locomo-dev-search] fetched memories');
+ .select(selectNonVectorColumns(userMemories))
+ .from(userMemories)
+ .where(and(eq(userMemories.userId, userId), inArray(userMemories.id, uniqueMemoryIds)));
+ console.info('[locomo-dev-search] fetched memories');
const memoryMap = new Map(memories.map((memory) => [memory.id, memory]));
@@ -204,7 +205,7 @@ export const POST = async (req: Request) => {
...activityItems.slice(0, topK),
...identityItems,
];
- console.log('[locomo-dev-search] compiled items');
+ console.info('[locomo-dev-search] compiled items');
return NextResponse.json({
items,
diff --git a/src/app/(backend)/api/webhooks/casdoor/validateRequest.ts b/src/app/(backend)/api/webhooks/casdoor/validateRequest.ts
index 344047e38da..730bb2b8444 100644
--- a/src/app/(backend)/api/webhooks/casdoor/validateRequest.ts
+++ b/src/app/(backend)/api/webhooks/casdoor/validateRequest.ts
@@ -33,7 +33,7 @@ export const validateRequest = async (request: Request, secret?: string) => {
}
} catch (e) {
if (!authEnv.CASDOOR_WEBHOOK_SECRET) {
- throw new Error('`CASDOOR_WEBHOOK_SECRET` environment variable is missing.');
+ throw new Error('`CASDOOR_WEBHOOK_SECRET` environment variable is missing.', { cause: e });
}
console.error('[Casdoor]: incoming webhook failed in verification.\n', e, payloadString);
return;
diff --git a/src/app/(backend)/api/webhooks/logto/route.ts b/src/app/(backend)/api/webhooks/logto/route.ts
index cf038ece48d..d929856056b 100644
--- a/src/app/(backend)/api/webhooks/logto/route.ts
+++ b/src/app/(backend)/api/webhooks/logto/route.ts
@@ -18,7 +18,7 @@ export const POST = async (req: Request): Promise<NextResponse> => {
const { event, data } = payload;
- console.log(`logto webhook payload: ${{ data, event }}`);
+ console.info(`logto webhook payload: ${{ data, event }}`);
const webhookUserService = new WebhookUserService(serverDB);
switch (event) {
diff --git a/src/app/(backend)/api/webhooks/logto/validateRequest.ts b/src/app/(backend)/api/webhooks/logto/validateRequest.ts
index 62032854aa8..9aedc6540b4 100644
--- a/src/app/(backend)/api/webhooks/logto/validateRequest.ts
+++ b/src/app/(backend)/api/webhooks/logto/validateRequest.ts
@@ -43,7 +43,7 @@ export const validateRequest = async (request: Request, signingKey: string) => {
}
} catch (e) {
if (!authEnv.LOGTO_WEBHOOK_SIGNING_KEY) {
- throw new Error('`LOGTO_WEBHOOK_SIGNING_KEY` environment variable is missing.');
+ throw new Error('`LOGTO_WEBHOOK_SIGNING_KEY` environment variable is missing.', { cause: e });
}
console.error('[logto]: incoming webhook failed in verification.\n', e);
return;
diff --git a/src/app/(backend)/trpc/async/[trpc]/route.ts b/src/app/(backend)/trpc/async/[trpc]/route.ts
index 6ea1a954e9c..5829a47da8d 100644
--- a/src/app/(backend)/trpc/async/[trpc]/route.ts
+++ b/src/app/(backend)/trpc/async/[trpc]/route.ts
@@ -24,7 +24,7 @@ const handler = (req: NextRequest) => {
endpoint: '/trpc/async',
onError: ({ error, path, type }) => {
- console.log(`Error in tRPC handler (async) on path: ${path}, type: ${type}`);
+ console.info(`Error in tRPC handler (async) on path: ${path}, type: ${type}`);
console.error(error);
},
diff --git a/src/app/(backend)/trpc/mobile/[trpc]/route.ts b/src/app/(backend)/trpc/mobile/[trpc]/route.ts
index 43f1dc186df..dc9465a6435 100644
--- a/src/app/(backend)/trpc/mobile/[trpc]/route.ts
+++ b/src/app/(backend)/trpc/mobile/[trpc]/route.ts
@@ -20,7 +20,7 @@ const handler = (req: NextRequest) => {
endpoint: '/trpc/mobile',
onError: ({ error, path, type }) => {
- console.log(`Error in tRPC handler (mobile) on path: ${path}, type: ${type}`);
+ console.info(`Error in tRPC handler (mobile) on path: ${path}, type: ${type}`);
console.error(error);
},
diff --git a/src/app/(backend)/webapi/chat/[provider]/route.ts b/src/app/(backend)/webapi/chat/[provider]/route.ts
index b8e68e354cc..d7a7177f8a7 100644
--- a/src/app/(backend)/webapi/chat/[provider]/route.ts
+++ b/src/app/(backend)/webapi/chat/[provider]/route.ts
@@ -55,6 +55,7 @@ export const POST = checkAuth(
const logMethod = AGENT_RUNTIME_ERROR_SET.has(errorType as string) ? 'warn' : 'error';
// track the error at server side
+ // eslint-disable-next-line no-console
console[logMethod](`Route: [${provider}] ${errorType}:`, error);
return createErrorResponse(errorType, { error, ...res, provider });
diff --git a/src/app/[variants]/(auth)/auth-error/page.tsx b/src/app/[variants]/(auth)/auth-error/page.tsx
index 706819acbce..2a2d3eaaa82 100644
--- a/src/app/[variants]/(auth)/auth-error/page.tsx
+++ b/src/app/[variants]/(auth)/auth-error/page.tsx
@@ -4,12 +4,12 @@ import { SiDiscord } from '@icons-pack/react-simple-icons';
import { SOCIAL_URL } from '@lobechat/business-const';
import { Button, Flexbox, Icon, Text } from '@lobehub/ui';
import { cssVar } from 'antd-style';
+import Link from 'next/link';
import { parseAsString, useQueryState } from 'nuqs';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import AuthCard from '@/features/AuthCard';
-import Link from 'next/link';
const normalizeErrorCode = (code?: string | null) =>
(code || 'UNKNOWN').trim().toUpperCase().replaceAll('-', '_');
diff --git a/src/app/[variants]/(auth)/market-auth-callback/page.tsx b/src/app/[variants]/(auth)/market-auth-callback/page.tsx
index 1c78a0b49a8..41a91269938 100644
--- a/src/app/[variants]/(auth)/market-auth-callback/page.tsx
+++ b/src/app/[variants]/(auth)/market-auth-callback/page.tsx
@@ -18,7 +18,7 @@ const MarketAuthCallbackPage = () => {
const [countdown, setCountdown] = useState(3);
useEffect(() => {
- console.log('[MarketAuthCallback] Processing authorization callback');
+ console.info('[MarketAuthCallback] Processing authorization callback');
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code');
@@ -45,7 +45,7 @@ const MarketAuthCallbackPage = () => {
}
if (code && state) {
- console.log('[MarketAuthCallback] Authorization successful, code received');
+ console.info('[MarketAuthCallback] Authorization successful, code received');
setStatus('success');
setMessage(t('callback.messages.successWithRedirect'));
diff --git a/src/app/[variants]/(auth)/oauth/callback/error/page.tsx b/src/app/[variants]/(auth)/oauth/callback/error/page.tsx
index 2249597f67d..a33fa586a6c 100644
--- a/src/app/[variants]/(auth)/oauth/callback/error/page.tsx
+++ b/src/app/[variants]/(auth)/oauth/callback/error/page.tsx
@@ -2,12 +2,11 @@
import { Button, Flexbox, FluentEmoji, Highlighter, Text } from '@lobehub/ui';
import { Result } from 'antd';
+import Link from 'next/link';
import { parseAsString, useQueryState } from 'nuqs';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import Link from 'next/link';
-
const FailedPage = memo(() => {
const { t } = useTranslation('oauth');
const [reason] = useQueryState('reason');
diff --git a/src/app/[variants]/(auth)/oauth/callback/success/page.tsx b/src/app/[variants]/(auth)/oauth/callback/success/page.tsx
index 917c162e7fc..a3ee7b1fee0 100644
--- a/src/app/[variants]/(auth)/oauth/callback/success/page.tsx
+++ b/src/app/[variants]/(auth)/oauth/callback/success/page.tsx
@@ -2,11 +2,10 @@
import { FluentEmoji, Text } from '@lobehub/ui';
import { Result } from 'antd';
+import { useSearchParams } from 'next/navigation';
import React, { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { useSearchParams } from 'next/navigation';
-
const SuccessPage = memo(() => {
const { t } = useTranslation('oauth');
const searchParams = useSearchParams();
diff --git a/src/app/[variants]/(auth)/oauth/consent/[uid]/page.tsx b/src/app/[variants]/(auth)/oauth/consent/[uid]/page.tsx
index c6368897390..ef68a4f858c 100644
--- a/src/app/[variants]/(auth)/oauth/consent/[uid]/page.tsx
+++ b/src/app/[variants]/(auth)/oauth/consent/[uid]/page.tsx
@@ -1,5 +1,6 @@
-import { authEnv } from '@/envs/auth';
import { notFound } from 'next/navigation';
+
+import { authEnv } from '@/envs/auth';
import { defaultClients } from '@/libs/oidc-provider/config';
import { OIDCService } from '@/server/services/oidc';
diff --git a/src/app/[variants]/(auth)/reset-password/page.tsx b/src/app/[variants]/(auth)/reset-password/page.tsx
index 46a75bc680b..a04d5777ce6 100644
--- a/src/app/[variants]/(auth)/reset-password/page.tsx
+++ b/src/app/[variants]/(auth)/reset-password/page.tsx
@@ -2,10 +2,9 @@
import { Button } from '@lobehub/ui';
import { ChevronLeftIcon } from 'lucide-react';
-import { useTranslation } from 'react-i18next';
-
import Link from 'next/link';
import { useRouter, useSearchParams } from 'next/navigation';
+import { useTranslation } from 'react-i18next';
import AuthCard from '../../../../features/AuthCard';
import { ResetPasswordContent } from './ResetPasswordContent';
diff --git a/src/app/[variants]/(auth)/signup/[[...signup]]/BetterAuthSignUpForm.tsx b/src/app/[variants]/(auth)/signup/[[...signup]]/BetterAuthSignUpForm.tsx
index 51f47b5855f..fbf35c30381 100644
--- a/src/app/[variants]/(auth)/signup/[[...signup]]/BetterAuthSignUpForm.tsx
+++ b/src/app/[variants]/(auth)/signup/[[...signup]]/BetterAuthSignUpForm.tsx
@@ -3,11 +3,10 @@
import { Button, Icon, Text } from '@lobehub/ui';
import { Form, Input } from 'antd';
import { Lock, Mail } from 'lucide-react';
-import { useEffect } from 'react';
-import { useTranslation } from 'react-i18next';
-
import Link from 'next/link';
import { useSearchParams } from 'next/navigation';
+import { useEffect } from 'react';
+import { useTranslation } from 'react-i18next';
import { AuthCard } from '../../../../../features/AuthCard';
import { type SignUpFormValues } from './useSignUp';
diff --git a/src/app/[variants]/(auth)/verify-email/page.tsx b/src/app/[variants]/(auth)/verify-email/page.tsx
index 3b2d402bccd..1a5c518a4b0 100644
--- a/src/app/[variants]/(auth)/verify-email/page.tsx
+++ b/src/app/[variants]/(auth)/verify-email/page.tsx
@@ -2,10 +2,9 @@
import { Button } from '@lobehub/ui';
import { ChevronLeftIcon } from 'lucide-react';
-import { useTranslation } from 'react-i18next';
-
import Link from 'next/link';
import { useSearchParams } from 'next/navigation';
+import { useTranslation } from 'react-i18next';
import AuthCard from '../../../../features/AuthCard';
import { VerifyEmailContent } from './VerifyEmailContent';
diff --git a/src/app/[variants]/(desktop)/desktop-onboarding/features/WelcomeStep.tsx b/src/app/[variants]/(desktop)/desktop-onboarding/features/WelcomeStep.tsx
index 481c8bb7a0c..b79f4d834e1 100644
--- a/src/app/[variants]/(desktop)/desktop-onboarding/features/WelcomeStep.tsx
+++ b/src/app/[variants]/(desktop)/desktop-onboarding/features/WelcomeStep.tsx
@@ -28,6 +28,7 @@ const WelcomeStep = memo<WelcomeStepProps>(({ onNext }) => {
onNext();
};
+ // eslint-disable-next-line @eslint-react/no-nested-component-definitions
const IconAvatar = useCallback(({ icon }: { icon: IconProps['icon'] }) => {
return (
<Block
diff --git a/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Nav.tsx b/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Nav.tsx
index c954f6aa1df..2c867c18c15 100644
--- a/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Nav.tsx
+++ b/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Nav.tsx
@@ -46,26 +46,26 @@ const Nav = memo(() => {
<Flexbox gap={1} paddingInline={4}>
<NavItem
icon={MessageSquarePlusIcon}
- onClick={handleNewTopic}
title={tTopic('actions.addNewTopic')}
+ onClick={handleNewTopic}
/>
{!hideProfile && (
<NavItem
active={isProfileActive}
icon={BotPromptIcon}
+ title={t('tab.profile')}
onClick={() => {
switchTopic(null, { skipRefreshMessage: true });
router.push(urlJoin('/agent', agentId!, 'profile'));
}}
- title={t('tab.profile')}
/>
)}
<NavItem
icon={SearchIcon}
+ title={t('tab.search')}
onClick={() => {
toggleCommandMenu(true);
}}
- title={t('tab.search')}
/>
</Flexbox>
);
diff --git a/src/app/[variants]/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx b/src/app/[variants]/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
index ff5cb108de6..78dbd944000 100644
--- a/src/app/[variants]/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
+++ b/src/app/[variants]/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
@@ -102,7 +102,7 @@ const KlavisToolAuthItem = memo<KlavisToolAuthItemProps>(({ tool, onAuthComplete
try {
await refreshKlavisServerTools(identifier);
} catch (error) {
- console.debug('[Klavis] Polling check (expected during auth):', error);
+ console.info('[Klavis] Polling check (expected during auth):', error);
}
}, POLL_INTERVAL_MS);
diff --git a/src/app/[variants]/(main)/agent/features/Conversation/MainChatInput/index.tsx b/src/app/[variants]/(main)/agent/features/Conversation/MainChatInput/index.tsx
index 3da96acca46..36de906d864 100644
--- a/src/app/[variants]/(main)/agent/features/Conversation/MainChatInput/index.tsx
+++ b/src/app/[variants]/(main)/agent/features/Conversation/MainChatInput/index.tsx
@@ -33,14 +33,14 @@ const MainChatInput = memo(() => {
return (
<ChatInput
+ skipScrollMarginWithList
leftActions={leftActions}
+ rightActions={rightActions}
+ sendMenu={{ items: sendMenuItems }}
onEditorReady={(instance) => {
// Sync to global ChatStore for compatibility with other features
useChatStore.setState({ mainInputEditor: instance });
}}
- rightActions={rightActions}
- sendMenu={{ items: sendMenuItems }}
- skipScrollMarginWithList
/>
);
});
diff --git a/src/app/[variants]/(main)/agent/profile/features/Header/AgentPublishButton/PublishButton.tsx b/src/app/[variants]/(main)/agent/profile/features/Header/AgentPublishButton/PublishButton.tsx
index 2e033baaa3a..544144d57a8 100644
--- a/src/app/[variants]/(main)/agent/profile/features/Header/AgentPublishButton/PublishButton.tsx
+++ b/src/app/[variants]/(main)/agent/profile/features/Header/AgentPublishButton/PublishButton.tsx
@@ -80,7 +80,8 @@ const PublishButton = memo<MarketPublishButtonProps>(({ action, onPublishSuccess
if (isUnderReview) {
message.warning({
content: t('marketPublish.validation.underReview', {
- defaultValue: 'Your new version is currently under review. Please wait for approval before publishing a new version.',
+ defaultValue:
+ 'Your new version is currently under review. Please wait for approval before publishing a new version.',
}),
});
return;
@@ -144,6 +145,9 @@ const PublishButton = memo<MarketPublishButtonProps>(({ action, onPublishSuccess
<Popconfirm
arrow={false}
okButtonProps={{ type: 'primary' }}
+ open={confirmOpened}
+ placement="bottomRight"
+ title={t('marketPublish.validation.confirmPublish')}
onCancel={() => setConfirmOpened(false)}
onConfirm={handleConfirmPublish}
onOpenChange={(open) => {
@@ -151,25 +155,22 @@ const PublishButton = memo<MarketPublishButtonProps>(({ action, onPublishSuccess
setConfirmOpened(false);
}
}}
- open={confirmOpened}
- placement="bottomRight"
- title={t('marketPublish.validation.confirmPublish')}
>
<Button
icon={ShapesUploadIcon}
loading={loading}
- onClick={handleButtonClick}
title={buttonTitle}
+ onClick={handleButtonClick}
>
{t('publishToCommunity')}
</Button>
</Popconfirm>
<ForkConfirmModal
loading={isPublishing}
- onCancel={handleForkCancel}
- onConfirm={handleForkConfirm}
open={showForkModal}
originalAgent={originalAgentInfo}
+ onCancel={handleForkCancel}
+ onConfirm={handleForkConfirm}
/>
</>
);
diff --git a/src/app/[variants]/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts b/src/app/[variants]/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts
index 3480fe2e987..5764ee4dd2a 100644
--- a/src/app/[variants]/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts
+++ b/src/app/[variants]/(main)/agent/profile/features/Header/AgentPublishButton/useMarketPublish.ts
@@ -146,15 +146,15 @@ export const useMarketPublish = ({ action, onSuccess }: UseMarketPublishOptions)
return null;
}
}) || [],
- systemRole: systemRole,
+ systemRole,
},
description: meta?.description || '',
- editorData: editorData,
+ editorData,
// 传递现有的 identifier,后端会检查 ownership
identifier: meta?.marketIdentifier,
name: meta?.title || '',
tags: meta?.tags,
- tokenUsage: tokenUsage,
+ tokenUsage,
});
// 如果是新创建的 agent,需要更新 meta
diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/Header.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/Header.tsx
index 8bf2b3ae014..3e79cb47f5d 100644
--- a/src/app/[variants]/(main)/community/(detail)/agent/features/Header.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/agent/features/Header.tsx
@@ -15,9 +15,9 @@ import {
import { App } from 'antd';
import { createStaticStyles, cssVar, useResponsive } from 'antd-style';
import {
- BookTextIcon,
BookmarkCheckIcon,
BookmarkIcon,
+ BookTextIcon,
CoinsIcon,
DotIcon,
GitBranchIcon,
@@ -33,8 +33,8 @@ import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
import { socialService } from '@/services/social';
import { formatIntergerNumber } from '@/utils/format';
-import { useCategory } from '../../../(list)/agent/features/Category/useCategory';
import PublishedTime from '../../../../../../../components/PublishedTime';
+import { useCategory } from '../../../(list)/agent/features/Category/useCategory';
import AgentForkTag from './AgentForkTag';
import { useDetailContext } from './DetailProvider';
@@ -123,7 +123,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
return (
<Flexbox gap={12}>
- <Flexbox align={'flex-start'} gap={16} horizontal width={'100%'}>
+ <Flexbox horizontal align={'flex-start'} gap={16} width={'100%'}>
<Avatar avatar={avatar} shape={'square'} size={mobile ? 48 : 64} />
<Flexbox
flex={1}
@@ -133,9 +133,9 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
}}
>
<Flexbox
+ horizontal
align={'center'}
gap={8}
- horizontal
justify={'space-between'}
style={{
overflow: 'hidden',
@@ -143,18 +143,18 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
}}
>
<Flexbox
+ horizontal
align={'center'}
flex={1}
gap={12}
- horizontal
style={{
overflow: 'hidden',
position: 'relative',
}}
>
<Text
- as={'h1'}
ellipsis
+ as={'h1'}
style={{ fontSize: mobile ? 18 : 24, margin: 0 }}
title={identifier}
>
@@ -165,12 +165,12 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
<ActionIcon
icon={isFavorited ? BookmarkCheckIcon : BookmarkIcon}
loading={favoriteLoading}
- onClick={handleFavoriteClick}
variant={isFavorited ? 'outlined' : undefined}
+ onClick={handleFavoriteClick}
/>
</Tooltip>
</Flexbox>
- <Flexbox align={'center'} gap={8} horizontal wrap={'wrap'}>
+ <Flexbox horizontal align={'center'} gap={8} wrap={'wrap'}>
{author && userName ? (
<Link style={{ color: 'inherit' }} to={urlJoin('/community/user', userName)}>
{author}
@@ -179,11 +179,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
author
)}
<Icon icon={DotIcon} />
- <PublishedTime
- className={styles.time}
- date={createdAt as string}
-
- />
+ <PublishedTime className={styles.time} date={createdAt as string} />
<AgentForkTag />
{!!forkCount && forkCount > 0 && (
<Tag bordered={false} color="default" icon={<Icon icon={GitBranchIcon} />}>
@@ -195,9 +191,9 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
</Flexbox>
<TooltipGroup>
<Flexbox
+ horizontal
align={'center'}
gap={mobile ? 12 : 24}
- horizontal
style={{
color: cssVar.colorTextSecondary,
}}
@@ -208,7 +204,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
styles={{ root: { pointerEvents: 'none' } }}
title={t('assistants.tokenUsage')}
>
- <Flexbox align={'center'} gap={6} horizontal>
+ <Flexbox horizontal align={'center'} gap={6}>
<Icon icon={CoinsIcon} />
{formatIntergerNumber(tokenUsage)}
</Flexbox>
@@ -219,7 +215,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
styles={{ root: { pointerEvents: 'none' } }}
title={t('assistants.withPlugin')}
>
- <Flexbox align={'center'} gap={6} horizontal>
+ <Flexbox horizontal align={'center'} gap={6}>
<Icon fill={cssVar.colorTextSecondary} icon={MCP} />
{pluginCount}
</Flexbox>
@@ -230,7 +226,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
styles={{ root: { pointerEvents: 'none' } }}
title={t('assistants.withKnowledge')}
>
- <Flexbox align={'center'} gap={6} horizontal>
+ <Flexbox horizontal align={'center'} gap={6}>
<Icon icon={BookTextIcon} />
{knowledgeCount}
</Flexbox>
diff --git a/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/ActionButton/index.tsx b/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/ActionButton/index.tsx
index e10b347be9e..a953caa32d8 100644
--- a/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/ActionButton/index.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/agent/features/Sidebar/ActionButton/index.tsx
@@ -17,10 +17,10 @@ const ActionButton = memo<{ mobile?: boolean }>(({ mobile }) => {
<ForkAndChat mobile={mobile} />
<ShareButton
meta={{
- avatar: avatar,
+ avatar,
desc: description,
hashtags: tags,
- title: title,
+ title,
url: urlJoin(OFFICIAL_URL, '/community/agent', identifier as string),
}}
/>
diff --git a/src/app/[variants]/(main)/community/(detail)/group_agent/features/Header.tsx b/src/app/[variants]/(main)/community/(detail)/group_agent/features/Header.tsx
index e8d37ad2e6e..e041f6089f5 100644
--- a/src/app/[variants]/(main)/community/(detail)/group_agent/features/Header.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/group_agent/features/Header.tsx
@@ -13,13 +13,7 @@ import {
} from '@lobehub/ui';
import { App } from 'antd';
import { createStaticStyles, cssVar, useResponsive } from 'antd-style';
-import {
- BookmarkCheckIcon,
- BookmarkIcon,
- DotIcon,
- GitBranchIcon,
- UsersIcon,
-} from 'lucide-react';
+import { BookmarkCheckIcon, BookmarkIcon, DotIcon, GitBranchIcon, UsersIcon } from 'lucide-react';
import qs from 'query-string';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -119,7 +113,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
return (
<Flexbox gap={12}>
- <Flexbox align={'flex-start'} gap={16} horizontal width={'100%'}>
+ <Flexbox horizontal align={'flex-start'} gap={16} width={'100%'}>
<Avatar avatar={displayAvatar} shape={'square'} size={mobile ? 48 : 64} />
<Flexbox
flex={1}
@@ -129,9 +123,9 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
}}
>
<Flexbox
+ horizontal
align={'center'}
gap={8}
- horizontal
justify={'space-between'}
style={{
overflow: 'hidden',
@@ -139,18 +133,18 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
}}
>
<Flexbox
+ horizontal
align={'center'}
flex={1}
gap={12}
- horizontal
style={{
overflow: 'hidden',
position: 'relative',
}}
>
<Text
- as={'h1'}
ellipsis
+ as={'h1'}
style={{ fontSize: mobile ? 18 : 24, margin: 0 }}
title={identifier}
>
@@ -161,12 +155,12 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
<ActionIcon
icon={isFavorited ? BookmarkCheckIcon : BookmarkIcon}
loading={favoriteLoading}
- onClick={handleFavoriteClick}
variant={isFavorited ? 'outlined' : undefined}
+ onClick={handleFavoriteClick}
/>
</Tooltip>
</Flexbox>
- <Flexbox align={'center'} gap={8} horizontal wrap={'wrap'}>
+ <Flexbox horizontal align={'center'} gap={8} wrap={'wrap'}>
{(() => {
// API returns author as object {avatar, name, userName}, but type definition says string
const authorObj =
@@ -182,11 +176,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
);
})()}
<Icon icon={DotIcon} />
- <PublishedTime
- className={styles.time}
- date={createdAt as string}
-
- />
+ <PublishedTime className={styles.time} date={createdAt as string} />
<GroupAgentForkTag />
{!!forkCount && forkCount > 0 && (
<Tag bordered={false} color="default" icon={<Icon icon={GitBranchIcon} />}>
@@ -198,9 +188,9 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
</Flexbox>
<TooltipGroup>
<Flexbox
+ horizontal
align={'center'}
gap={mobile ? 12 : 24}
- horizontal
style={{
color: cssVar.colorTextSecondary,
}}
@@ -211,7 +201,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
styles={{ root: { pointerEvents: 'none' } }}
title={t('groupAgents.memberCount', { defaultValue: 'Members' })}
>
- <Flexbox align={'center'} gap={6} horizontal>
+ <Flexbox horizontal align={'center'} gap={6}>
<Icon icon={UsersIcon} />
{memberCount}
</Flexbox>
diff --git a/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/index.tsx b/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/index.tsx
index 028da80a219..4a92f492ecf 100644
--- a/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/index.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/index.tsx
@@ -19,10 +19,10 @@ const ActionButton = memo<{ mobile?: boolean }>(({ mobile }) => {
{identifier && (
<ShareButton
meta={{
- avatar: avatar,
+ avatar,
desc: description,
hashtags: tags,
- title: title,
+ title,
url: urlJoin(OFFICIAL_URL, '/community/group_agent', identifier),
}}
/>
diff --git a/src/app/[variants]/(main)/community/(detail)/user/features/StatusFilter.tsx b/src/app/[variants]/(main)/community/(detail)/user/features/StatusFilter.tsx
index 29bdf61046a..fe520585d88 100644
--- a/src/app/[variants]/(main)/community/(detail)/user/features/StatusFilter.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/user/features/StatusFilter.tsx
@@ -4,7 +4,13 @@ import { Select } from 'antd';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-export type StatusFilterValue = 'published' | 'unpublished' | 'deprecated' | 'archived' | 'forked' | 'favorite';
+export type StatusFilterValue =
+ | 'published'
+ | 'unpublished'
+ | 'deprecated'
+ | 'archived'
+ | 'forked'
+ | 'favorite';
interface StatusFilterProps {
onChange: (value: StatusFilterValue) => void;
@@ -23,14 +29,7 @@ const StatusFilter = memo<StatusFilterProps>(({ value, onChange }) => {
{ label: t('user.statusFilter.favorite'), value: 'favorite' as const },
];
- return (
- <Select
- onChange={onChange}
- options={options}
- style={{ minWidth: 120 }}
- value={value}
- />
- );
+ return <Select options={options} style={{ minWidth: 120 }} value={value} onChange={onChange} />;
});
export default StatusFilter;
diff --git a/src/app/[variants]/(main)/community/(detail)/user/features/UserAgentCard.tsx b/src/app/[variants]/(main)/community/(detail)/user/features/UserAgentCard.tsx
index 75c9d5c55e0..7b0c1a9dc9d 100644
--- a/src/app/[variants]/(main)/community/(detail)/user/features/UserAgentCard.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserAgentCard.tsx
@@ -6,12 +6,12 @@ import {
DropdownMenu,
Flexbox,
Icon,
+ stopPropagation,
Tag as AntTag,
Tag,
Text,
Tooltip,
TooltipGroup,
- stopPropagation,
} from '@lobehub/ui';
import { App } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
@@ -375,11 +375,7 @@ const UserAgentCard = memo<UserAgentCardProps>(
>
<Flexbox horizontal align={'center'} gap={4}>
<Icon icon={ClockIcon} size={14} />
- <PublishedTime
- className={styles.secondaryDesc}
- date={createdAt}
-
- />
+ <PublishedTime className={styles.secondaryDesc} date={createdAt} />
</Flexbox>
{category && t(`category.assistant.${category}` as any)}
</Flexbox>
diff --git a/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoriteAgents.tsx b/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoriteAgents.tsx
index 8ea6e6aa7bd..c2c9563b90d 100644
--- a/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoriteAgents.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoriteAgents.tsx
@@ -6,10 +6,10 @@ import {
Flexbox,
Grid,
Icon,
+ stopPropagation,
Tag,
Text,
Tooltip,
- stopPropagation,
} from '@lobehub/ui';
import { App } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
@@ -215,11 +215,7 @@ const FavoriteAgentCard = memo<FavoriteAgentCardProps>(
>
<Flexbox horizontal align={'center'} gap={4}>
<Icon icon={ClockIcon} size={14} />
- <PublishedTime
- className={styles.secondaryDesc}
- date={createdAt}
-
- />
+ <PublishedTime className={styles.secondaryDesc} date={createdAt} />
</Flexbox>
{category && t(`category.assistant.${category}` as any)}
</Flexbox>
diff --git a/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoritePlugins.tsx b/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoritePlugins.tsx
index c3e4bdc7730..fa151cb7ae8 100644
--- a/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoritePlugins.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserFavoritePlugins.tsx
@@ -6,10 +6,10 @@ import {
Flexbox,
Grid,
Icon,
+ stopPropagation,
Tag,
Text,
Tooltip,
- stopPropagation,
} from '@lobehub/ui';
import { App } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
@@ -190,11 +190,7 @@ const FavoritePluginCard = memo<FavoritePluginCardProps>(
>
<Flexbox horizontal align={'center'} gap={4}>
<Icon icon={ClockIcon} size={14} />
- <PublishedTime
- className={styles.secondaryDesc}
- date={createdAt}
-
- />
+ <PublishedTime className={styles.secondaryDesc} date={createdAt} />
</Flexbox>
{category && t(`category.plugin.${category}` as any)}
</Flexbox>
diff --git a/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupCard.tsx b/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupCard.tsx
index 788c3dd6e55..2c07c84ba61 100644
--- a/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupCard.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupCard.tsx
@@ -6,12 +6,12 @@ import {
DropdownMenu,
Flexbox,
Icon,
+ stopPropagation,
Tag as AntTag,
Tag,
Text,
Tooltip,
TooltipGroup,
- stopPropagation,
} from '@lobehub/ui';
import { createStaticStyles, cx } from 'antd-style';
import {
@@ -318,11 +318,7 @@ const UserGroupCard = memo<UserGroupCardProps>(
>
<Flexbox horizontal align={'center'} gap={4}>
<Icon icon={ClockIcon} size={14} />
- <PublishedTime
- className={styles.secondaryDesc}
- date={createdAt}
-
- />
+ <PublishedTime className={styles.secondaryDesc} date={createdAt} />
</Flexbox>
{category && t(`category.groupAgent.${category}` as any, { defaultValue: category })}
</Flexbox>
diff --git a/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupList.tsx b/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupList.tsx
index 2375c4723a1..3f2e496715d 100644
--- a/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupList.tsx
+++ b/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupList.tsx
@@ -16,7 +16,13 @@ interface UserGroupListProps {
const UserGroupList = memo<UserGroupListProps>(({ rows = 4, pageSize = 8 }) => {
const { t } = useTranslation('discover');
- const { agentGroups = [], groupCount, forkedAgentGroups = [], favoriteAgentGroups = [], isOwner } = useUserDetailContext();
+ const {
+ agentGroups = [],
+ groupCount,
+ forkedAgentGroups = [],
+ favoriteAgentGroups = [],
+ isOwner,
+ } = useUserDetailContext();
const [currentPage, setCurrentPage] = useState(1);
const [statusFilter, setStatusFilter] = useState<StatusFilterValue>('published');
const [searchQuery, setSearchQuery] = useState('');
@@ -67,26 +73,23 @@ const UserGroupList = memo<UserGroupListProps>(({ rows = 4, pageSize = 8 }) => {
return (
<Flexbox gap={16}>
- <Flexbox align={'center'} gap={8} horizontal justify={'space-between'}>
- <Flexbox align={'center'} gap={8} horizontal>
+ <Flexbox horizontal align={'center'} gap={8} justify={'space-between'}>
+ <Flexbox horizontal align={'center'} gap={8}>
<Text fontSize={16} weight={500}>
{t('user.publishedGroups', { defaultValue: '创作的群组' })}
</Text>
{groupCount > 0 && <Tag>{filteredGroups.length}</Tag>}
</Flexbox>
{isOwner && (
- <Flexbox align={'center'} gap={8} horizontal>
+ <Flexbox horizontal align={'center'} gap={8}>
<Input.Search
allowClear
- onChange={(e) => setSearchQuery(e.target.value)}
placeholder={t('user.searchPlaceholder')}
style={{ width: 200 }}
value={searchQuery}
+ onChange={(e) => setSearchQuery(e.target.value)}
/>
- <StatusFilter
- onChange={(value) => setStatusFilter(value)}
- value={statusFilter}
- />
+ <StatusFilter value={statusFilter} onChange={(value) => setStatusFilter(value)} />
</Flexbox>
)}
</Flexbox>
@@ -99,10 +102,10 @@ const UserGroupList = memo<UserGroupListProps>(({ rows = 4, pageSize = 8 }) => {
<Flexbox align={'center'} justify={'center'}>
<Pagination
current={currentPage}
- onChange={(page) => setCurrentPage(page)}
pageSize={pageSize}
showSizeChanger={false}
total={filteredGroups.length}
+ onChange={(page) => setCurrentPage(page)}
/>
</Flexbox>
)}
diff --git a/src/app/[variants]/(main)/community/(list)/(home)/loading.tsx b/src/app/[variants]/(main)/community/(list)/(home)/loading.tsx
index ae79add4bc6..93fd2e5dfb2 100644
--- a/src/app/[variants]/(main)/community/(list)/(home)/loading.tsx
+++ b/src/app/[variants]/(main)/community/(list)/(home)/loading.tsx
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
import ListLoading from '@/app/[variants]/(main)/community/components/ListLoading';
import Title from '@/app/[variants]/(main)/community/components/Title';
+
import CreatorRewardBanner from './features/CreatorRewardBanner';
const Loading = memo(() => {
diff --git a/src/app/[variants]/(main)/community/(list)/mcp/features/List/Item.tsx b/src/app/[variants]/(main)/community/(list)/mcp/features/List/Item.tsx
index 2d1d1999b82..a88bb5c90a3 100644
--- a/src/app/[variants]/(main)/community/(list)/mcp/features/List/Item.tsx
+++ b/src/app/[variants]/(main)/community/(list)/mcp/features/List/Item.tsx
@@ -7,10 +7,10 @@ import {
Block,
Flexbox,
Icon,
+ stopPropagation,
Tag,
Text,
Tooltip,
- stopPropagation,
} from '@lobehub/ui';
import { Spotlight } from '@lobehub/ui/awesome';
import { createStaticStyles, cssVar } from 'antd-style';
@@ -205,11 +205,7 @@ const McpItem = memo<DiscoverMcpItem>(
>
<Flexbox horizontal align={'center'} gap={4}>
<Icon icon={ClockIcon} size={14} />
- <PublishedTime
- className={styles.secondaryDesc}
- date={updatedAt}
-
- />
+ <PublishedTime className={styles.secondaryDesc} date={updatedAt} />
</Flexbox>
<Flexbox horizontal align={'center'} gap={8}>
{t(`mcp.categories.${category}.name` as any)}
diff --git a/src/app/[variants]/(main)/community/(list)/provider/features/List/Item.tsx b/src/app/[variants]/(main)/community/(list)/provider/features/List/Item.tsx
index 993f2bf9287..24b1b513c35 100644
--- a/src/app/[variants]/(main)/community/(list)/provider/features/List/Item.tsx
+++ b/src/app/[variants]/(main)/community/(list)/provider/features/List/Item.tsx
@@ -1,5 +1,5 @@
import { Github, ModelTag, ProviderCombine } from '@lobehub/icons';
-import { ActionIcon, Block, Flexbox, MaskShadow, Text, stopPropagation } from '@lobehub/ui';
+import { ActionIcon, Block, Flexbox, MaskShadow, stopPropagation, Text } from '@lobehub/ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { GlobeIcon } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/app/[variants]/(main)/community/components/VirtuosoGridList/index.tsx b/src/app/[variants]/(main)/community/components/VirtuosoGridList/index.tsx
index 062a1042b71..86ce7cc012e 100644
--- a/src/app/[variants]/(main)/community/components/VirtuosoGridList/index.tsx
+++ b/src/app/[variants]/(main)/community/components/VirtuosoGridList/index.tsx
@@ -17,6 +17,7 @@ export const VirtuosoList = memo<VirtuosoGridProps<any, any>>(({ data, ...rest }
initialItemCount={initialItemCount}
overscan={24}
components={{
+ // eslint-disable-next-line @eslint-react/no-nested-component-definitions
List: (({ ref, ...props }: DivProps & { ref?: React.RefObject<HTMLDivElement | null> }) => (
<Flexbox gap={16} ref={ref} {...props} />
)) as any,
@@ -42,6 +43,7 @@ const VirtuosoGridList = memo<VirtuosoGridProps<any, any>>(
initialItemCount={maxInitialItemCount || count}
overscan={24}
components={{
+ // eslint-disable-next-line @eslint-react/no-nested-component-definitions
List: (({
ref,
...props
diff --git a/src/app/[variants]/(main)/eval/_layout/Sidebar/Body/BenchmarkList.tsx b/src/app/[variants]/(main)/eval/_layout/Sidebar/Body/BenchmarkList.tsx
index 9523aea09c9..c24349cbea9 100644
--- a/src/app/[variants]/(main)/eval/_layout/Sidebar/Body/BenchmarkList.tsx
+++ b/src/app/[variants]/(main)/eval/_layout/Sidebar/Body/BenchmarkList.tsx
@@ -1,7 +1,19 @@
'use client';
import { AccordionItem, Flexbox, Text } from '@lobehub/ui';
-import { Activity, Award, BarChart3, Gauge, LoaderPinwheel, Server, Target, TrendingUp, Trophy, Volleyball, Zap } from 'lucide-react';
+import {
+ Activity,
+ Award,
+ BarChart3,
+ Gauge,
+ LoaderPinwheel,
+ Server,
+ Target,
+ TrendingUp,
+ Trophy,
+ Volleyball,
+ Zap,
+} from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Link, useNavigate } from 'react-router-dom';
@@ -10,7 +22,19 @@ import NavItem from '@/features/NavPanel/components/NavItem';
import SkeletonList from '@/features/NavPanel/components/SkeletonList';
import { useEvalStore } from '@/store/eval';
-const SYSTEM_ICONS = [LoaderPinwheel, Volleyball, Server, Target, Award, Trophy, Activity, BarChart3, TrendingUp, Gauge, Zap];
+const SYSTEM_ICONS = [
+ LoaderPinwheel,
+ Volleyball,
+ Server,
+ Target,
+ Award,
+ Trophy,
+ Activity,
+ BarChart3,
+ TrendingUp,
+ Gauge,
+ Zap,
+];
const getSystemIcon = (id: string) => {
const hash = id.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);
@@ -34,7 +58,7 @@ const BenchmarkList = memo<BenchmarkListProps>(({ activeKey, itemKey }) => {
paddingBlock={4}
paddingInline={'8px 4px'}
title={
- <Flexbox align="center" gap={4} horizontal>
+ <Flexbox horizontal align="center" gap={4}>
<Text ellipsis fontSize={12} type={'secondary'} weight={500}>
{t('sidebar.benchmarks')}
</Text>
@@ -53,11 +77,11 @@ const BenchmarkList = memo<BenchmarkListProps>(({ activeKey, itemKey }) => {
benchmarkList.map((b: any) => (
<Link
key={b.id}
+ to={`/eval/bench/${b.id}`}
onClick={(e) => {
e.preventDefault();
navigate(`/eval/bench/${b.id}`);
}}
- to={`/eval/bench/${b.id}`}
>
<NavItem
active={activeKey === `bench-${b.id}`}
@@ -68,11 +92,7 @@ const BenchmarkList = memo<BenchmarkListProps>(({ activeKey, itemKey }) => {
</Link>
))
) : (
- <Text
- fontSize={12}
- style={{ padding: '8px 12px' }}
- type="secondary"
- >
+ <Text fontSize={12} style={{ padding: '8px 12px' }} type="secondary">
{t('benchmark.empty')}
</Text>
)}
diff --git a/src/app/[variants]/(main)/eval/_layout/Sidebar/Body/index.tsx b/src/app/[variants]/(main)/eval/_layout/Sidebar/Body/index.tsx
index 9f8ab654859..32edbfc4fb4 100644
--- a/src/app/[variants]/(main)/eval/_layout/Sidebar/Body/index.tsx
+++ b/src/app/[variants]/(main)/eval/_layout/Sidebar/Body/index.tsx
@@ -33,13 +33,17 @@ const Body = memo(() => {
<Flexbox gap={8} paddingInline={4}>
<Flexbox gap={1}>
<Link
+ to="/eval"
onClick={(e) => {
e.preventDefault();
navigate('/eval');
}}
- to="/eval"
>
- <NavItem active={activeKey === 'dashboard'} icon={LayoutDashboardIcon} title={t('sidebar.dashboard')} />
+ <NavItem
+ active={activeKey === 'dashboard'}
+ icon={LayoutDashboardIcon}
+ title={t('sidebar.dashboard')}
+ />
</Link>
</Flexbox>
<Accordion defaultExpandedKeys={['benchmarks']} gap={8}>
diff --git a/src/app/[variants]/(main)/eval/_layout/Sidebar/Header/index.tsx b/src/app/[variants]/(main)/eval/_layout/Sidebar/Header/index.tsx
index 5126c91a019..8222f1914a8 100644
--- a/src/app/[variants]/(main)/eval/_layout/Sidebar/Header/index.tsx
+++ b/src/app/[variants]/(main)/eval/_layout/Sidebar/Header/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import { type PropsWithChildren, memo } from 'react';
+import { memo, type PropsWithChildren } from 'react';
import { useTranslation } from 'react-i18next';
import SideBarHeaderLayout from '@/features/NavPanel/SideBarHeaderLayout';
diff --git a/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/DatasetTabs/index.tsx b/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/DatasetTabs/index.tsx
index 0106070a18b..aeaddd21d82 100644
--- a/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/DatasetTabs/index.tsx
+++ b/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/DatasetTabs/index.tsx
@@ -20,9 +20,9 @@ const DatasetTabs = memo<DatasetTabsProps>(({ datasets, activeDatasetId, onChang
return (
<Segmented
- onChange={(value) => onChange(value as string)}
options={datasets.map((d: any) => ({ label: d.name, value: d.id }))}
value={activeDatasetId || datasets[0]?.id}
+ onChange={(value) => onChange(value as string)}
/>
);
});
diff --git a/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/RunCards/RunSummaryCard.tsx b/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/RunCards/RunSummaryCard.tsx
index 229389ea9cc..d3c3d905f56 100644
--- a/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/RunCards/RunSummaryCard.tsx
+++ b/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/RunCards/RunSummaryCard.tsx
@@ -20,48 +20,46 @@ interface RunSummaryCardProps {
status: string;
}
-const RunSummaryCard = memo<RunSummaryCardProps>(
- ({ id, name, status, metrics, benchmarkId }) => {
- const { t } = useTranslation('eval');
- const isActive = status === 'running' || status === 'pending';
+const RunSummaryCard = memo<RunSummaryCardProps>(({ id, name, status, metrics, benchmarkId }) => {
+ const { t } = useTranslation('eval');
+ const isActive = status === 'running' || status === 'pending';
- return (
- <Link
- style={{ color: 'inherit', textDecoration: 'none' }}
- to={`/eval/bench/${benchmarkId}/runs/${id}`}
- >
- <Card hoverable size="small">
- <Flexbox gap={8}>
- <Flexbox align="center" horizontal justify="space-between">
- <Typography.Text strong>{name || id.slice(0, 8)}</Typography.Text>
- <StatusBadge status={status} />
- </Flexbox>
- {!isActive && metrics && (
- <Flexbox gap={4}>
- {metrics.passRate !== undefined && (
- <Flexbox align="center" gap={8} horizontal>
- <Typography.Text style={{ fontSize: 12 }} type="secondary">
- {t('run.metrics.passRate')}
- </Typography.Text>
- <Progress
- percent={Math.round(metrics.passRate * 100)}
- size="small"
- style={{ flex: 1 }}
- />
- </Flexbox>
- )}
- {metrics.averageScore !== undefined && (
+ return (
+ <Link
+ style={{ color: 'inherit', textDecoration: 'none' }}
+ to={`/eval/bench/${benchmarkId}/runs/${id}`}
+ >
+ <Card hoverable size="small">
+ <Flexbox gap={8}>
+ <Flexbox horizontal align="center" justify="space-between">
+ <Typography.Text strong>{name || id.slice(0, 8)}</Typography.Text>
+ <StatusBadge status={status} />
+ </Flexbox>
+ {!isActive && metrics && (
+ <Flexbox gap={4}>
+ {metrics.passRate !== undefined && (
+ <Flexbox horizontal align="center" gap={8}>
<Typography.Text style={{ fontSize: 12 }} type="secondary">
- {t('run.metrics.avgScore')}: {metrics.averageScore.toFixed(2)}
+ {t('run.metrics.passRate')}
</Typography.Text>
- )}
- </Flexbox>
- )}
- </Flexbox>
- </Card>
- </Link>
- );
- },
-);
+ <Progress
+ percent={Math.round(metrics.passRate * 100)}
+ size="small"
+ style={{ flex: 1 }}
+ />
+ </Flexbox>
+ )}
+ {metrics.averageScore !== undefined && (
+ <Typography.Text style={{ fontSize: 12 }} type="secondary">
+ {t('run.metrics.avgScore')}: {metrics.averageScore.toFixed(2)}
+ </Typography.Text>
+ )}
+ </Flexbox>
+ )}
+ </Flexbox>
+ </Card>
+ </Link>
+ );
+});
export default RunSummaryCard;
diff --git a/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/RunsTab/EmptyState.tsx b/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/RunsTab/EmptyState.tsx
index 5e75a1855f2..d0f1d539b25 100644
--- a/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/RunsTab/EmptyState.tsx
+++ b/src/app/[variants]/(main)/eval/bench/[benchmarkId]/features/RunsTab/EmptyState.tsx
@@ -29,6 +29,7 @@ const EmptyState = memo<EmptyStateProps>(({ onCreate }) => {
return (
<Card className={styles.emptyCard}>
<Empty
+ icon={Activity}
description={
<Flexbox gap={4}>
<p
@@ -52,9 +53,14 @@ const EmptyState = memo<EmptyStateProps>(({ onCreate }) => {
</p>
</Flexbox>
}
- icon={Activity}
>
- <Button icon={Plus} onClick={onCreate} size="small" style={{ marginTop: 16 }} type="primary">
+ <Button
+ icon={Plus}
+ size="small"
+ style={{ marginTop: 16 }}
+ type="primary"
+ onClick={onCreate}
+ >
{t('run.actions.create')}
</Button>
</Empty>
diff --git a/src/app/[variants]/(main)/eval/config/datasetPresets.ts b/src/app/[variants]/(main)/eval/config/datasetPresets.ts
index 9e21d4e76c7..842ff1fda06 100644
--- a/src/app/[variants]/(main)/eval/config/datasetPresets.ts
+++ b/src/app/[variants]/(main)/eval/config/datasetPresets.ts
@@ -4,20 +4,10 @@ import { Database, Globe } from 'lucide-react';
export type PresetCategory = 'qa' | 'research' | 'tool-use' | 'memory' | 'reference' | 'custom';
export interface DatasetPreset {
- id: string;
category: PresetCategory;
- name: string;
description: string;
- icon: LucideIcon;
-
- // 格式说明
- formatDescription: string;
- requiredFields: string[];
- optionalFields: string[];
-
// 示例文件
exampleFileUrl?: string;
-
// 自动推断配置
fieldInference: {
input: string[];
@@ -26,6 +16,16 @@ export interface DatasetPreset {
category: string[];
sortOrder?: string[];
};
+ // 格式说明
+ formatDescription: string;
+
+ icon: LucideIcon;
+ id: string;
+ name: string;
+
+ optionalFields: string[];
+
+ requiredFields: string[];
// 验证规则
validation?: {
@@ -43,8 +43,7 @@ export const DATASET_PRESETS: Record<string, DatasetPreset> = {
name: 'BrowseComp-ZH',
description: 'Chinese web browsing: 289 multi-step reasoning questions',
icon: Globe,
- formatDescription:
- 'format: Topic (category/tags), Question (input), Answer (expected)',
+ formatDescription: 'format: Topic (category/tags), Question (input), Answer (expected)',
requiredFields: ['Question', 'Answer'],
optionalFields: ['Topic', 'canary'],
fieldInference: {
@@ -59,7 +58,7 @@ export const DATASET_PRESETS: Record<string, DatasetPreset> = {
},
},
- xbench: {
+ 'xbench': {
id: 'xbench',
category: 'research',
name: 'xbench',
@@ -83,7 +82,7 @@ export const DATASET_PRESETS: Record<string, DatasetPreset> = {
},
// === Reference Formats (low priority) ===
- mmlu: {
+ 'mmlu': {
id: 'mmlu',
category: 'reference',
name: 'MMLU (Reference)',
@@ -107,7 +106,7 @@ export const DATASET_PRESETS: Record<string, DatasetPreset> = {
},
// === Custom ===
- custom: {
+ 'custom': {
id: 'custom',
category: 'custom',
name: 'Custom',
@@ -133,11 +132,11 @@ export const getPresetById = (id?: string): DatasetPreset => {
// 按 category 分组获取 Presets
export const getPresetsByCategory = (): Record<PresetCategory, DatasetPreset[]> => {
const grouped: Record<string, DatasetPreset[]> = {
- research: [],
+ 'research': [],
'tool-use': [],
- memory: [],
- reference: [],
- custom: [],
+ 'memory': [],
+ 'reference': [],
+ 'custom': [],
};
Object.values(DATASET_PRESETS).forEach((preset) => {
diff --git a/src/app/[variants]/(main)/eval/features/BenchmarkCard/index.tsx b/src/app/[variants]/(main)/eval/features/BenchmarkCard/index.tsx
index 45f93d524a1..ea9c5a3f666 100644
--- a/src/app/[variants]/(main)/eval/features/BenchmarkCard/index.tsx
+++ b/src/app/[variants]/(main)/eval/features/BenchmarkCard/index.tsx
@@ -293,9 +293,6 @@ const BenchmarkCard = memo<BenchmarkCardProps>(
<RunRow
agentName={agentSnapshot?.title}
benchmarkId={id}
- completedCases={
- metrics?.completedCases ?? passedCases + failedCases + errorCases
- }
cost={metrics?.totalCost}
createdAt={run.createdAt}
errorCount={errorCases}
@@ -309,6 +306,9 @@ const BenchmarkCard = memo<BenchmarkCardProps>(
score={metrics?.averageScore}
status={run.status}
totalCases={metrics?.totalCases ?? 0}
+ completedCases={
+ metrics?.completedCases ?? passedCases + failedCases + errorCases
+ }
/>
);
})
diff --git a/src/app/[variants]/(main)/eval/features/BenchmarkEditModal/index.tsx b/src/app/[variants]/(main)/eval/features/BenchmarkEditModal/index.tsx
index 0c023e8dd7f..b7336207d11 100644
--- a/src/app/[variants]/(main)/eval/features/BenchmarkEditModal/index.tsx
+++ b/src/app/[variants]/(main)/eval/features/BenchmarkEditModal/index.tsx
@@ -63,6 +63,9 @@ const BenchmarkEditModal = memo<BenchmarkEditModalProps>(
destroyOnHidden
okButtonProps={{ loading }}
okText={t('benchmark.edit.confirm')}
+ open={open}
+ title={t('benchmark.edit.title')}
+ width={480}
onCancel={(e) => {
form.resetFields();
setIdentifierTouched(false);
@@ -92,9 +95,6 @@ const BenchmarkEditModal = memo<BenchmarkEditModalProps>(
setLoading(false);
}
}}
- open={open}
- title={t('benchmark.edit.title')}
- width={480}
>
<Form form={form} layout="vertical" style={{ paddingBlock: 16 }}>
<Form.Item
@@ -111,8 +111,8 @@ const BenchmarkEditModal = memo<BenchmarkEditModalProps>(
rules={[{ message: t('benchmark.create.identifierRequired'), required: true }]}
>
<Input
- onChange={() => setIdentifierTouched(true)}
placeholder={t('benchmark.create.identifier.placeholder')}
+ onChange={() => setIdentifierTouched(true)}
/>
</Form.Item>
@@ -120,7 +120,11 @@ const BenchmarkEditModal = memo<BenchmarkEditModalProps>(
<TextArea placeholder={t('benchmark.create.description.placeholder')} rows={3} />
</Form.Item>
- <Form.Item label={t('benchmark.create.tags.label')} name="tags" style={{ marginBottom: 0 }}>
+ <Form.Item
+ label={t('benchmark.create.tags.label')}
+ name="tags"
+ style={{ marginBottom: 0 }}
+ >
<Select
mode="tags"
open={false}
diff --git a/src/app/[variants]/(main)/eval/features/CreateBenchmarkModal/index.tsx b/src/app/[variants]/(main)/eval/features/CreateBenchmarkModal/index.tsx
index 2c5bfc30582..836caa253cf 100644
--- a/src/app/[variants]/(main)/eval/features/CreateBenchmarkModal/index.tsx
+++ b/src/app/[variants]/(main)/eval/features/CreateBenchmarkModal/index.tsx
@@ -41,6 +41,9 @@ const CreateBenchmarkModal = memo<CreateBenchmarkModalProps>(({ open, onCancel }
destroyOnHidden
okButtonProps={{ loading }}
okText={t('benchmark.create.confirm')}
+ open={open}
+ title={t('benchmark.create.title')}
+ width={480}
onCancel={(e) => {
form.resetFields();
setIdentifierTouched(false);
@@ -71,9 +74,6 @@ const CreateBenchmarkModal = memo<CreateBenchmarkModalProps>(({ open, onCancel }
setLoading(false);
}
}}
- open={open}
- title={t('benchmark.create.title')}
- width={480}
>
<Form form={form} layout="vertical" style={{ paddingBlock: 16 }}>
<Form.Item
@@ -90,8 +90,8 @@ const CreateBenchmarkModal = memo<CreateBenchmarkModalProps>(({ open, onCancel }
rules={[{ message: t('benchmark.create.identifierRequired'), required: true }]}
>
<Input
- onChange={() => setIdentifierTouched(true)}
placeholder={t('benchmark.create.identifier.placeholder')}
+ onChange={() => setIdentifierTouched(true)}
/>
</Form.Item>
diff --git a/src/app/[variants]/(main)/eval/index.tsx b/src/app/[variants]/(main)/eval/index.tsx
index 4b3f4b3663b..40683a2f30f 100644
--- a/src/app/[variants]/(main)/eval/index.tsx
+++ b/src/app/[variants]/(main)/eval/index.tsx
@@ -15,7 +15,8 @@ import CreateBenchmarkModal from './features/CreateBenchmarkModal';
const styles = createStaticStyles(({ css, cssVar }) => ({
container: css`
overflow-y: auto;
- padding: 24px 32px;
+ padding-block: 24px;
+ padding-inline: 32px;
`,
subtitle: css`
margin: 0;
@@ -24,6 +25,7 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
`,
title: css`
margin: 0;
+
font-size: 22px;
font-weight: 600;
line-height: 1.3;
@@ -42,13 +44,13 @@ const EvalOverview = memo(() => {
return (
<Flexbox className={styles.container} gap={32} height="100%" width="100%">
{/* Header */}
- <Flexbox align="center" horizontal justify="space-between">
+ <Flexbox horizontal align="center" justify="space-between">
<Flexbox gap={4}>
<h1 className={styles.title}>{t('overview.title')}</h1>
<p className={styles.subtitle}>{t('overview.subtitle')}</p>
</Flexbox>
{benchmarkList.length > 0 && (
- <Button icon={Plus} onClick={() => setCreateModalOpen(true)} type="primary">
+ <Button icon={Plus} type="primary" onClick={() => setCreateModalOpen(true)}>
{t('overview.createBenchmark')}
</Button>
)}
@@ -64,16 +66,22 @@ const EvalOverview = memo(() => {
<Empty description={t('benchmark.empty')} icon={FlaskConical}>
<Button
icon={Plus}
- onClick={() => setCreateModalOpen(true)}
style={{ marginTop: 16 }}
type="primary"
+ onClick={() => setCreateModalOpen(true)}
>
{t('overview.createBenchmark')}
</Button>
</Empty>
</Flexbox>
) : (
- <div style={{ display: 'grid', gap: 20, gridTemplateColumns: 'repeat(auto-fill, minmax(480px, 1fr))' }}>
+ <div
+ style={{
+ display: 'grid',
+ gap: 20,
+ gridTemplateColumns: 'repeat(auto-fill, minmax(480px, 1fr))',
+ }}
+ >
{benchmarkList.map((benchmark: any) => (
<BenchmarkCard
bestScore={benchmark.bestScore}
@@ -92,10 +100,7 @@ const EvalOverview = memo(() => {
</div>
)}
- <CreateBenchmarkModal
- onCancel={() => setCreateModalOpen(false)}
- open={createModalOpen}
- />
+ <CreateBenchmarkModal open={createModalOpen} onCancel={() => setCreateModalOpen(false)} />
</Flexbox>
);
});
diff --git a/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/index.tsx b/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/index.tsx
index 3da96acca46..36de906d864 100644
--- a/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/index.tsx
+++ b/src/app/[variants]/(main)/group/features/Conversation/MainChatInput/index.tsx
@@ -33,14 +33,14 @@ const MainChatInput = memo(() => {
return (
<ChatInput
+ skipScrollMarginWithList
leftActions={leftActions}
+ rightActions={rightActions}
+ sendMenu={{ items: sendMenuItems }}
onEditorReady={(instance) => {
// Sync to global ChatStore for compatibility with other features
useChatStore.setState({ mainInputEditor: instance });
}}
- rightActions={rightActions}
- sendMenu={{ items: sendMenuItems }}
- skipScrollMarginWithList
/>
);
});
diff --git a/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/useMarketPublish.ts b/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/useMarketPublish.ts
index 90aca7cee5b..815d41cfd36 100644
--- a/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/useMarketPublish.ts
+++ b/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/useMarketPublish.ts
@@ -105,14 +105,14 @@ export const useMarketPublish = ({ action, onSuccess }: UseMarketPublishOptions)
return null;
}
}) || [],
- systemRole: systemRole,
+ systemRole,
},
description: meta?.description || '',
- editorData: editorData,
- identifier: identifier,
+ editorData,
+ identifier,
name: meta?.title || '',
tags: meta?.tags,
- tokenUsage: tokenUsage,
+ tokenUsage,
};
try {
diff --git a/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/PublishButton.tsx b/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/PublishButton.tsx
index 3514875aed7..1f157116655 100644
--- a/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/PublishButton.tsx
+++ b/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/PublishButton.tsx
@@ -145,6 +145,9 @@ const PublishButton = memo<GroupPublishButtonProps>(({ action, onPublishSuccess
<Popconfirm
arrow={false}
okButtonProps={{ type: 'primary' }}
+ open={confirmOpened}
+ placement="bottomRight"
+ title={t('marketPublish.validation.confirmPublish')}
onCancel={() => setConfirmOpened(false)}
onConfirm={handleConfirmPublish}
onOpenChange={(open) => {
@@ -152,25 +155,22 @@ const PublishButton = memo<GroupPublishButtonProps>(({ action, onPublishSuccess
setConfirmOpened(false);
}
}}
- open={confirmOpened}
- placement="bottomRight"
- title={t('marketPublish.validation.confirmPublish')}
>
<Button
icon={ShapesUploadIcon}
loading={loading}
- onClick={handleButtonClick}
title={buttonTitle}
+ onClick={handleButtonClick}
>
{t('publishToCommunity')}
</Button>
</Popconfirm>
<GroupForkConfirmModal
loading={isPublishing}
- onCancel={handleForkCancel}
- onConfirm={handleForkConfirm}
open={showForkModal}
originalGroup={originalGroupInfo}
+ onCancel={handleForkCancel}
+ onConfirm={handleForkConfirm}
/>
</>
);
diff --git a/src/app/[variants]/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsx b/src/app/[variants]/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsx
index 14505f0a5c5..229b4f143cf 100644
--- a/src/app/[variants]/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsx
+++ b/src/app/[variants]/(main)/home/_layout/Body/Agent/Modals/ConfigGroupModal/GroupItem.tsx
@@ -35,9 +35,10 @@ const GroupItem = memo<SessionGroupItemBase>(({ id, name }) => {
{!editing ? (
<>
<span className={styles.title}>{name}</span>
- <ActionIcon icon={PencilLine} onClick={() => setEditing(true)} size={'small'} />
+ <ActionIcon icon={PencilLine} size={'small'} onClick={() => setEditing(true)} />
<ActionIcon
icon={Trash}
+ size={'small'}
onClick={() => {
modal.confirm({
centered: true,
@@ -51,12 +52,15 @@ const GroupItem = memo<SessionGroupItemBase>(({ id, name }) => {
title: t('sessionGroup.confirmRemoveGroupAlert'),
});
}}
- size={'small'}
/>
</>
) : (
<EditableText
editing={editing}
+ showEditIcon={false}
+ style={{ height: 28 }}
+ value={name}
+ onEditingChange={(e) => setEditing(e)}
onChangeEnd={async (input) => {
if (name !== input) {
if (!input) return;
@@ -68,10 +72,6 @@ const GroupItem = memo<SessionGroupItemBase>(({ id, name }) => {
}
setEditing(false);
}}
- onEditingChange={(e) => setEditing(e)}
- showEditIcon={false}
- style={{ height: 28 }}
- value={name}
/>
)}
</>
diff --git a/src/app/[variants]/(main)/home/features/RecentPage/Item.tsx b/src/app/[variants]/(main)/home/features/RecentPage/Item.tsx
index efc3e59f0b3..23d737d45df 100644
--- a/src/app/[variants]/(main)/home/features/RecentPage/Item.tsx
+++ b/src/app/[variants]/(main)/home/features/RecentPage/Item.tsx
@@ -15,6 +15,7 @@ const extractTitle = (content: string): string | null => {
if (!content) return null;
// Find first markdown header (# title)
+ // eslint-disable-next-line regexp/no-super-linear-backtracking
const match = content.match(/^#\s+(.+)$/m);
return match ? match[1].trim() : null;
};
diff --git a/src/app/[variants]/(main)/home/features/components/GroupSkeleton.tsx b/src/app/[variants]/(main)/home/features/components/GroupSkeleton.tsx
index 23d52ecaf8a..477f90d69de 100644
--- a/src/app/[variants]/(main)/home/features/components/GroupSkeleton.tsx
+++ b/src/app/[variants]/(main)/home/features/components/GroupSkeleton.tsx
@@ -16,7 +16,7 @@ export const GroupSkeleton = memo<{
size={'large'}
style={{
borderRadius: cssVar.borderRadiusLG,
- height: height,
+ height,
maxHeight: height,
maxWidth: width,
minWidth: width,
diff --git a/src/app/[variants]/(main)/home/features/index.tsx b/src/app/[variants]/(main)/home/features/index.tsx
index 2504f5f649f..cf8d6303568 100644
--- a/src/app/[variants]/(main)/home/features/index.tsx
+++ b/src/app/[variants]/(main)/home/features/index.tsx
@@ -23,6 +23,7 @@ const Home = memo(() => {
// Hide other modules when a starter mode is active
const hideOtherModules = inputActiveMode && ['agent', 'group', 'write'].includes(inputActiveMode);
+ // eslint-disable-next-line @eslint-react/no-nested-component-definitions
const Welcome = useCallback(() => <WelcomeText />, [i18n.language]);
return (
diff --git a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ImageUpload.tsx b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ImageUpload.tsx
index dadde5fe805..032f8fc403a 100644
--- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ImageUpload.tsx
+++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ImageUpload.tsx
@@ -316,13 +316,13 @@ const Placeholder: FC<PlaceholderProps> = memo(({ isDragOver, onClick, height })
<Center
gap={16}
horizontal={false}
+ style={height ? { height } : undefined}
className={cx(
styles.placeholder,
configStyles.dragTransition,
isDragOver && configStyles.dragOver,
)}
onClick={onClick}
- style={height ? { height } : undefined}
>
<ImageIcon className={styles.placeholderIcon} size={48} strokeWidth={1.5} />
<div className={styles.placeholderText}>
diff --git a/src/app/[variants]/(main)/image/_layout/ConfigPanel/utils/__tests__/imageValidation.test.ts b/src/app/[variants]/(main)/image/_layout/ConfigPanel/utils/__tests__/imageValidation.test.ts
index 3f4855cfc12..1c09ec114c7 100644
--- a/src/app/[variants]/(main)/image/_layout/ConfigPanel/utils/__tests__/imageValidation.test.ts
+++ b/src/app/[variants]/(main)/image/_layout/ConfigPanel/utils/__tests__/imageValidation.test.ts
@@ -166,7 +166,7 @@ describe('imageValidation', () => {
actualSize: maxSize + 1,
error: 'fileSizeExceeded',
fileName: 'over-limit.jpg',
- maxSize: maxSize,
+ maxSize,
valid: false,
});
});
diff --git a/src/app/[variants]/(main)/image/_layout/TopicSidebar.tsx b/src/app/[variants]/(main)/image/_layout/TopicSidebar.tsx
index 76f5ab3a9b4..41f7a3adcdc 100644
--- a/src/app/[variants]/(main)/image/_layout/TopicSidebar.tsx
+++ b/src/app/[variants]/(main)/image/_layout/TopicSidebar.tsx
@@ -1,4 +1,4 @@
-import { Suspense, memo } from 'react';
+import { memo, Suspense } from 'react';
import {
GenerationTopicStoreProvider,
diff --git a/src/app/[variants]/(main)/image/features/GenerationFeed/index.tsx b/src/app/[variants]/(main)/image/features/GenerationFeed/index.tsx
index a8c1de5b2e2..0ccc244b002 100644
--- a/src/app/[variants]/(main)/image/features/GenerationFeed/index.tsx
+++ b/src/app/[variants]/(main)/image/features/GenerationFeed/index.tsx
@@ -35,7 +35,7 @@ const GenerationFeed = memo(() => {
const scrollTop = scrollableParent.scrollTop + targetRect.bottom - scrollableRect.bottom + 999;
scrollableParent.scrollTo({
- behavior: behavior,
+ behavior,
top: scrollTop,
});
};
diff --git a/src/app/[variants]/(main)/memory/features/GridView/index.tsx b/src/app/[variants]/(main)/memory/features/GridView/index.tsx
index 0c543486972..a10b55dacdb 100644
--- a/src/app/[variants]/(main)/memory/features/GridView/index.tsx
+++ b/src/app/[variants]/(main)/memory/features/GridView/index.tsx
@@ -67,6 +67,7 @@ function GridViewInner<T extends { id: string }>({
Footer: isLoading
? () => <Loading rows={defaultColumnCount} viewMode={'grid'} />
: undefined,
+ // eslint-disable-next-line @eslint-react/no-nested-component-definitions
List: (({ ref, ...props }: DivProps & { ref?: React.RefObject<HTMLDivElement | null> }) => (
<Grid
gap={8}
diff --git a/src/app/[variants]/(main)/resource/features/hooks/useResourceManagerUrlSync.ts b/src/app/[variants]/(main)/resource/features/hooks/useResourceManagerUrlSync.ts
index 484970acf2b..2ac7a3b7b06 100644
--- a/src/app/[variants]/(main)/resource/features/hooks/useResourceManagerUrlSync.ts
+++ b/src/app/[variants]/(main)/resource/features/hooks/useResourceManagerUrlSync.ts
@@ -29,7 +29,6 @@ export const useResourceManagerUrlSync = () => {
setSorter(sorterParam);
setSortType(sortTypeParam);
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, []); // Only on mount
// Sync store changes to URL (Store → URL)
diff --git a/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx b/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx
index f091bed1b02..569346ebfeb 100644
--- a/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx
+++ b/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx
@@ -7,8 +7,8 @@ import {
Center,
DropdownMenu,
Skeleton,
- Text,
stopPropagation,
+ Text,
} from '@lobehub/ui';
import { createStaticStyles, cx } from 'antd-style';
import { ChevronsUpDownIcon } from 'lucide-react';
diff --git a/src/app/[variants]/(main)/settings/provider/ProviderMenu/List.tsx b/src/app/[variants]/(main)/settings/provider/ProviderMenu/List.tsx
index a9ea76362f7..b0d3bb96313 100644
--- a/src/app/[variants]/(main)/settings/provider/ProviderMenu/List.tsx
+++ b/src/app/[variants]/(main)/settings/provider/ProviderMenu/List.tsx
@@ -6,8 +6,8 @@ import {
ActionIcon,
ContextMenuTrigger,
Flexbox,
- Text,
stopPropagation,
+ Text,
} from '@lobehub/ui';
import isEqual from 'fast-deep-equal';
import { ArrowDownUpIcon } from 'lucide-react';
diff --git a/src/app/[variants]/(main)/settings/provider/detail/ollama/CheckError.tsx b/src/app/[variants]/(main)/settings/provider/detail/ollama/CheckError.tsx
index 0d318ca7bd2..27e448a8d77 100644
--- a/src/app/[variants]/(main)/settings/provider/detail/ollama/CheckError.tsx
+++ b/src/app/[variants]/(main)/settings/provider/detail/ollama/CheckError.tsx
@@ -29,7 +29,7 @@ interface OllamaErrorResponse {
error: OllamaError;
}
-const UNRESOLVED_MODEL_REGEXP = /model "([\w+,-_]+)" not found/;
+const UNRESOLVED_MODEL_REGEXP = /model "([\w+,.-]+)" not found/;
const CheckError = ({
defaultError,
diff --git a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx
index 7a22d8b3cb4..5e9a5c03b66 100644
--- a/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx
+++ b/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx
@@ -11,8 +11,8 @@ import {
Form,
Icon,
Skeleton,
- Tooltip,
stopPropagation,
+ Tooltip,
} from '@lobehub/ui';
import { useDebounceFn } from 'ahooks';
import { Form as AntdForm, Switch } from 'antd';
diff --git a/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx b/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx
index 062a2614596..f73940177bd 100644
--- a/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx
+++ b/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx
@@ -79,7 +79,7 @@ const KlavisSkillItem = memo<KlavisSkillItemProps>(({ serverType, server }) => {
try {
await refreshKlavisServerTools(serverName);
} catch (error) {
- console.debug('[Klavis] Polling check (expected during auth):', error);
+ console.info('[Klavis] Polling check (expected during auth):', error);
}
}, POLL_INTERVAL_MS);
@@ -108,7 +108,7 @@ const KlavisSkillItem = memo<KlavisSkillItemProps>(({ serverType, server }) => {
startFallbackPolling(serverName);
}
} catch {
- console.log('[Klavis] COOP blocked window.closed access, falling back to polling');
+ console.info('[Klavis] COOP blocked window.closed access, falling back to polling');
if (windowCheckIntervalRef.current) {
clearInterval(windowCheckIntervalRef.current);
windowCheckIntervalRef.current = null;
diff --git a/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx b/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx
index 8b6d0094040..8a832f31dc2 100644
--- a/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx
+++ b/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx
@@ -102,7 +102,7 @@ const LobehubSkillItem = memo<LobehubSkillItemProps>(({ provider, server }) => {
setIsWaitingAuth(false);
}
} catch {
- console.log('[LobehubSkill] COOP blocked window.closed access, falling back to polling');
+ console.info('[LobehubSkill] COOP blocked window.closed access, falling back to polling');
if (windowCheckIntervalRef.current) {
clearInterval(windowCheckIntervalRef.current);
windowCheckIntervalRef.current = null;
diff --git a/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/ActiveModels/ModelTable.tsx b/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/ActiveModels/ModelTable.tsx
index 6cc4aee3fab..8ad6d76e974 100644
--- a/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/ActiveModels/ModelTable.tsx
+++ b/src/app/[variants]/(main)/settings/stats/features/usage/UsageCards/ActiveModels/ModelTable.tsx
@@ -63,7 +63,7 @@ const formatData = (
return {
childrens: spendWithWeight.sort((a, b) => b.weight - a.weight),
id: key,
- totalSpend: totalSpend,
+ totalSpend,
};
})
.sort((a, b) => b.totalSpend - a.totalSpend);
diff --git a/src/app/[variants]/(main)/settings/stats/features/usage/UsageTrends.tsx b/src/app/[variants]/(main)/settings/stats/features/usage/UsageTrends.tsx
index 8ff2be83e66..4610f2f654e 100644
--- a/src/app/[variants]/(main)/settings/stats/features/usage/UsageTrends.tsx
+++ b/src/app/[variants]/(main)/settings/stats/features/usage/UsageTrends.tsx
@@ -17,7 +17,6 @@ const groupByType = (
groupBy: GroupBy,
): { categories: string[]; data: BarChartProps['data'] } => {
if (!data || data?.length === 0) return { categories: [], data: [] };
- let formattedData: BarChartProps['data'] = [];
const cate: Map<string, number> = data.reduce((acc, log) => {
if (log.records) {
for (const item of log.records) {
@@ -31,7 +30,7 @@ const groupByType = (
return acc;
}, new Map<string, number>());
const categories: string[] = Array.from(cate.keys());
- formattedData = data.map((log) => {
+ const formattedData = data.map((log) => {
const totalObj = {
day: log.day,
total: type === 'spend' ? log.totalSpend : log.totalTokens,
diff --git a/src/app/[variants]/(main)/video/_layout/ConfigPanel/VideoConfigSkeleton.tsx b/src/app/[variants]/(main)/video/_layout/ConfigPanel/VideoConfigSkeleton.tsx
index c85b60f05bd..4e00bb70a36 100644
--- a/src/app/[variants]/(main)/video/_layout/ConfigPanel/VideoConfigSkeleton.tsx
+++ b/src/app/[variants]/(main)/video/_layout/ConfigPanel/VideoConfigSkeleton.tsx
@@ -46,13 +46,13 @@ const VideoConfigSkeleton = memo(() => {
</Flexbox>
{/* generateAudio switch */}
- <Flexbox align="center" horizontal justify="space-between">
+ <Flexbox horizontal align="center" justify="space-between">
<Skeleton.Button active size="small" style={{ width: 70 }} />
<Skeleton.Button active size="small" style={{ borderRadius: 12, width: 44 }} />
</Flexbox>
{/* cameraFixed switch */}
- <Flexbox align="center" horizontal justify="space-between">
+ <Flexbox horizontal align="center" justify="space-between">
<Skeleton.Button active size="small" style={{ width: 70 }} />
<Skeleton.Button active size="small" style={{ borderRadius: 12, width: 44 }} />
</Flexbox>
diff --git a/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/FrameUpload.tsx b/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/FrameUpload.tsx
index 5864ced2585..b1092beb3c7 100644
--- a/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/FrameUpload.tsx
+++ b/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/FrameUpload.tsx
@@ -20,9 +20,9 @@ const FrameUpload = memo<FrameUploadProps>(({ paramName }) => {
return (
<ImageUpload
maxFileSize={maxFileSize}
- onChange={handleChange}
placeholderHeight={120}
value={value}
+ onChange={handleChange}
/>
);
});
diff --git a/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/ModelSelect/VideoModelItem.tsx b/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/ModelSelect/VideoModelItem.tsx
index 079452d27fd..8e0d6f09093 100644
--- a/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/ModelSelect/VideoModelItem.tsx
+++ b/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/ModelSelect/VideoModelItem.tsx
@@ -51,7 +51,7 @@ const VideoModelItem = memo<VideoModelItemProps>(
}, [description, isDarkMode]);
const content = (
- <Flexbox align={'center'} gap={8} horizontal style={{ overflow: 'hidden' }}>
+ <Flexbox horizontal align={'center'} gap={8} style={{ overflow: 'hidden' }}>
<ModelIcon model={model.id} size={20} />
<Text ellipsis title={model.displayName || model.id}>
{model.displayName || model.id}
diff --git a/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/ModelSelect/index.tsx b/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/ModelSelect/index.tsx
index d72af95e5d9..457a4c8e493 100644
--- a/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/ModelSelect/index.tsx
+++ b/src/app/[variants]/(main)/video/_layout/ConfigPanel/components/ModelSelect/index.tsx
@@ -56,7 +56,7 @@ const ModelSelect = memo(() => {
{
disabled: true,
label: (
- <Flexbox gap={8} horizontal style={{ color: cssVar.colorTextTertiary }}>
+ <Flexbox horizontal gap={8} style={{ color: cssVar.colorTextTertiary }}>
{t('ModelSwitchPanel.emptyModel')}
<Icon icon={LucideArrowRight} />
</Flexbox>
@@ -77,7 +77,7 @@ const ModelSelect = memo(() => {
{
disabled: true,
label: (
- <Flexbox gap={8} horizontal style={{ color: cssVar.colorTextTertiary }}>
+ <Flexbox horizontal gap={8} style={{ color: cssVar.colorTextTertiary }}>
{t('ModelSwitchPanel.emptyProvider')}
<Icon icon={LucideArrowRight} />
</Flexbox>
@@ -106,12 +106,12 @@ const ModelSelect = memo(() => {
/>
<ActionIcon
icon={LucideBolt}
+ size={'small'}
+ title={t('ModelSwitchPanel.goToSettings')}
onClick={(e) => {
e.stopPropagation();
navigate(`/settings/provider/${provider.id}`);
}}
- size={'small'}
- title={t('ModelSwitchPanel.goToSettings')}
/>
</Flexbox>
),
@@ -140,10 +140,17 @@ const ModelSelect = memo(() => {
return (
<Select
+ shadow
+ labelRender={labelRender}
+ options={options}
+ size={'large'}
+ value={currentProvider && currentModel ? `${currentProvider}/${currentModel}` : undefined}
classNames={{
root: styles.popup,
}}
- labelRender={labelRender}
+ style={{
+ width: '100%',
+ }}
onChange={(value, option) => {
if (value === 'no-provider' || value.includes('/empty')) return;
const model = value.split('/').slice(1).join('/');
@@ -152,13 +159,6 @@ const ModelSelect = memo(() => {
setModelAndProviderOnSelect(model, provider);
}
}}
- options={options}
- shadow
- size={'large'}
- style={{
- width: '100%',
- }}
- value={currentProvider && currentModel ? `${currentProvider}/${currentModel}` : undefined}
/>
);
});
diff --git a/src/app/[variants]/(main)/video/_layout/TopicSidebar.tsx b/src/app/[variants]/(main)/video/_layout/TopicSidebar.tsx
index c1949b60220..7962da627cb 100644
--- a/src/app/[variants]/(main)/video/_layout/TopicSidebar.tsx
+++ b/src/app/[variants]/(main)/video/_layout/TopicSidebar.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Suspense, memo } from 'react';
+import { memo, Suspense } from 'react';
import {
GenerationTopicStoreProvider,
@@ -23,10 +23,10 @@ const TopicSidebar = memo(() => {
return (
<GenerationTopicStoreProvider value={{ namespace: 'video', useStore: useVideoStore as any }}>
<GenerationTopicPanel
- onExpandChange={(expand) => updateSystemStatus({ showVideoTopicPanel: expand })}
- onSizeChange={(width) => updateSystemStatus({ videoTopicPanelWidth: width })}
panelWidth={videoTopicPanelWidth ?? 256}
showPanel={showVideoTopicPanel ?? true}
+ onExpandChange={(expand) => updateSystemStatus({ showVideoTopicPanel: expand })}
+ onSizeChange={(width) => updateSystemStatus({ videoTopicPanelWidth: width })}
>
<Suspense fallback={<SkeletonList />}>
<TopicList />
diff --git a/src/app/[variants]/(main)/video/features/GenerationFeed/BatchItem.tsx b/src/app/[variants]/(main)/video/features/GenerationFeed/BatchItem.tsx
index bfec5c75528..cd5fc88a844 100644
--- a/src/app/[variants]/(main)/video/features/GenerationFeed/BatchItem.tsx
+++ b/src/app/[variants]/(main)/video/features/GenerationFeed/BatchItem.tsx
@@ -148,7 +148,7 @@ export const VideoGenerationBatchItem = memo<VideoGenerationBatchItemProps>(({ b
const promptAndMetadata = (
<>
<Markdown variant={'chat'}>{batch.prompt}</Markdown>
- <Flexbox gap={4} horizontal style={{ marginBottom: 10 }}>
+ <Flexbox horizontal gap={4} style={{ marginBottom: 10 }}>
<ModelTag model={batch.model} />
{batch.config?.resolution && <Tag>{batch.config.resolution}</Tag>}
{displayAspectRatio && <Tag>{displayAspectRatio}</Tag>}
@@ -159,7 +159,7 @@ export const VideoGenerationBatchItem = memo<VideoGenerationBatchItemProps>(({ b
return (
<Block gap={8} variant={'borderless'}>
{hasReferenceFrames ? (
- <Flexbox align={'center'} gap={16} horizontal>
+ <Flexbox horizontal align={'center'} gap={16}>
<VideoReferenceFrames
endImageUrl={batch.config?.endImageUrl}
imageUrl={batch.config?.imageUrl}
diff --git a/src/app/[variants]/(main)/video/features/GenerationFeed/VideoLoadingItem.tsx b/src/app/[variants]/(main)/video/features/GenerationFeed/VideoLoadingItem.tsx
index 1174ac21641..1f030dc05fd 100644
--- a/src/app/[variants]/(main)/video/features/GenerationFeed/VideoLoadingItem.tsx
+++ b/src/app/[variants]/(main)/video/features/GenerationFeed/VideoLoadingItem.tsx
@@ -66,10 +66,10 @@ const VideoLoadingItem = memo<VideoLoadingItemProps>(
<Block
align={'center'}
justify={'center'}
+ variant={'filled'}
style={{
aspectRatio: aspectRatio?.includes(':') ? aspectRatio.replace(':', '/') : '16/9',
}}
- variant={'filled'}
>
<Center gap={8}>
{progress !== null ? (
@@ -77,9 +77,7 @@ const VideoLoadingItem = memo<VideoLoadingItemProps>(
) : (
<Spin indicator={<LoadingOutlined spin />} />
)}
- {progress === 99 && (
- <ElapsedTime generationId={generation.id} isActive={isGenerating} />
- )}
+ {progress === 99 && <ElapsedTime generationId={generation.id} isActive={isGenerating} />}
</Center>
</Block>
);
diff --git a/src/app/[variants]/(main)/video/features/GenerationFeed/VideoReferenceFrames.tsx b/src/app/[variants]/(main)/video/features/GenerationFeed/VideoReferenceFrames.tsx
index 3750b101937..e2fac599b65 100644
--- a/src/app/[variants]/(main)/video/features/GenerationFeed/VideoReferenceFrames.tsx
+++ b/src/app/[variants]/(main)/video/features/GenerationFeed/VideoReferenceFrames.tsx
@@ -85,7 +85,7 @@ const VideoReferenceFrames = memo<VideoReferenceFramesProps>(({ imageUrl, endIma
if (!imageUrl && !endImageUrl) return null;
return (
- <Flexbox align={'center'} gap={12} horizontal>
+ <Flexbox horizontal align={'center'} gap={12}>
{imageUrl && (
<div className={styles.frameStart}>
<div className={styles.frameInner}>
diff --git a/src/app/[variants]/(main)/video/features/GenerationFeed/VideoSuccessItem.tsx b/src/app/[variants]/(main)/video/features/GenerationFeed/VideoSuccessItem.tsx
index fd05971ab7e..9b916f23183 100644
--- a/src/app/[variants]/(main)/video/features/GenerationFeed/VideoSuccessItem.tsx
+++ b/src/app/[variants]/(main)/video/features/GenerationFeed/VideoSuccessItem.tsx
@@ -26,7 +26,7 @@ const VideoSuccessItem = memo<VideoSuccessItemProps>(({ generation, onDelete, on
src={asset.url}
style={{ display: 'block', maxHeight: '50vh', maxWidth: '100%' }}
/>
- <ActionButtons onDelete={onDelete} onDownload={onDownload} showDownload />
+ <ActionButtons showDownload onDelete={onDelete} onDownload={onDownload} />
</Block>
);
});
diff --git a/src/app/[variants]/(main)/video/features/GenerationFeed/index.tsx b/src/app/[variants]/(main)/video/features/GenerationFeed/index.tsx
index f7d0ba48233..534e4fd62f7 100644
--- a/src/app/[variants]/(main)/video/features/GenerationFeed/index.tsx
+++ b/src/app/[variants]/(main)/video/features/GenerationFeed/index.tsx
@@ -30,7 +30,7 @@ const GenerationFeed = memo(() => {
const scrollTop = scrollableParent.scrollTop + targetRect.bottom - scrollableRect.bottom + 999;
scrollableParent.scrollTo({
- behavior: behavior,
+ behavior,
top: scrollTop,
});
};
diff --git a/src/app/[variants]/(main)/video/features/PromptInput/Title.tsx b/src/app/[variants]/(main)/video/features/PromptInput/Title.tsx
index 84e090a7c14..45a60831fb6 100644
--- a/src/app/[variants]/(main)/video/features/PromptInput/Title.tsx
+++ b/src/app/[variants]/(main)/video/features/PromptInput/Title.tsx
@@ -9,15 +9,15 @@ const PromptTitle = () => {
const { t } = useTranslation('video');
return (
- <Center gap={16} horizontal style={{ width: '100%' }}>
+ <Center horizontal gap={16} style={{ width: '100%' }}>
<Center
flex={'none'}
height={54}
+ width={54}
style={{
backgroundColor: cssVar.colorText,
borderRadius: 16,
}}
- width={54}
>
<Icon color={cssVar.colorBgLayout} icon={Video} size={32} />
</Center>
diff --git a/src/app/[variants]/onboarding/components/KlavisServerList/hooks/useKlavisOAuth.ts b/src/app/[variants]/onboarding/components/KlavisServerList/hooks/useKlavisOAuth.ts
index a53e0afabf0..487c5c3d605 100644
--- a/src/app/[variants]/onboarding/components/KlavisServerList/hooks/useKlavisOAuth.ts
+++ b/src/app/[variants]/onboarding/components/KlavisServerList/hooks/useKlavisOAuth.ts
@@ -58,7 +58,7 @@ export const useKlavisOAuth = ({ serverStatus }: UseKlavisOAuthProps) => {
try {
await refreshKlavisServerTools(serverName);
} catch (error) {
- console.debug('[Klavis] Polling check (expected during auth):', error);
+ console.info('[Klavis] Polling check (expected during auth):', error);
}
}, POLL_INTERVAL_MS);
diff --git a/src/app/[variants]/onboarding/features/ResponseLanguageStep.tsx b/src/app/[variants]/onboarding/features/ResponseLanguageStep.tsx
index b76adecc0cf..6b6d7f9587f 100644
--- a/src/app/[variants]/onboarding/features/ResponseLanguageStep.tsx
+++ b/src/app/[variants]/onboarding/features/ResponseLanguageStep.tsx
@@ -44,6 +44,7 @@ const ResponseLanguageStep = memo<ResponseLanguageStepProps>(({ onBack, onNext }
}, [onBack]);
const Message = useCallback(
+ // eslint-disable-next-line @eslint-react/no-nested-component-definitions
() => (
<LobeMessage
sentences={[
diff --git a/src/app/[variants]/onboarding/features/TelemetryStep.tsx b/src/app/[variants]/onboarding/features/TelemetryStep.tsx
index 950a9e266ee..97419168587 100644
--- a/src/app/[variants]/onboarding/features/TelemetryStep.tsx
+++ b/src/app/[variants]/onboarding/features/TelemetryStep.tsx
@@ -38,6 +38,7 @@ const TelemetryStep = memo<TelemetryStepProps>(({ onNext }) => {
[updateGeneralConfig, onNext],
);
+ // eslint-disable-next-line @eslint-react/no-nested-component-definitions
const IconAvatar = useCallback(({ icon }: { icon: IconProps['icon'] }) => {
return (
<Block
diff --git a/src/components/AntdStaticMethods/index.tsx b/src/components/AntdStaticMethods/index.tsx
index f98eb8106cc..f31d42ca250 100644
--- a/src/components/AntdStaticMethods/index.tsx
+++ b/src/components/AntdStaticMethods/index.tsx
@@ -5,8 +5,11 @@ import { type ModalStaticFunctions } from 'antd/es/modal/confirm';
import { type NotificationInstance } from 'antd/es/notification/interface';
import { memo } from 'react';
+// eslint-disable-next-line import-x/no-mutable-exports
let message: MessageInstance;
+// eslint-disable-next-line import-x/no-mutable-exports
let notification: NotificationInstance;
+// eslint-disable-next-line import-x/no-mutable-exports
let modal: Omit<ModalStaticFunctions, 'warn'>;
export default memo(() => {
diff --git a/src/components/ChatGroupWizard/ChatGroupWizard.tsx b/src/components/ChatGroupWizard/ChatGroupWizard.tsx
index bb90e869e30..1525f9357f3 100644
--- a/src/components/ChatGroupWizard/ChatGroupWizard.tsx
+++ b/src/components/ChatGroupWizard/ChatGroupWizard.tsx
@@ -10,9 +10,9 @@ import {
List,
Modal,
SearchBar,
+ stopPropagation,
Text,
Tooltip,
- stopPropagation,
} from '@lobehub/ui';
import { Switch } from 'antd';
import { createStaticStyles, cssVar, cx } from 'antd-style';
diff --git a/src/components/ChatGroupWizard/index.ts b/src/components/ChatGroupWizard/index.ts
index 4e3ca8edb1e..24b8c268c9e 100644
--- a/src/components/ChatGroupWizard/index.ts
+++ b/src/components/ChatGroupWizard/index.ts
@@ -1,3 +1,2 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
export type { ChatGroupWizardProps } from './ChatGroupWizard';
export { default as ChatGroupWizard } from './ChatGroupWizard';
diff --git a/src/components/DebugNode.tsx b/src/components/DebugNode.tsx
index a47eb442eea..3ec8274e5e9 100644
--- a/src/components/DebugNode.tsx
+++ b/src/components/DebugNode.tsx
@@ -12,7 +12,7 @@ const DebugNode = ({ children, trace }: DebugNodeProps) => {
if (process.env.NODE_ENV !== 'development') return null;
// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect(() => {
- console.log(`[DebugNode] Suspense fallback active: ${trace}`);
+ console.info(`[DebugNode] Suspense fallback active: ${trace}`);
}, [trace]);
return children ?? null;
diff --git a/src/components/Loading/CircleLoading/index.tsx b/src/components/Loading/CircleLoading/index.tsx
index 0c47c9e2fa3..f4151d0f6cf 100644
--- a/src/components/Loading/CircleLoading/index.tsx
+++ b/src/components/Loading/CircleLoading/index.tsx
@@ -4,7 +4,7 @@ import { Center, Flexbox, Icon, Text } from '@lobehub/ui';
import { LoaderCircle } from 'lucide-react';
import { useTranslation } from 'react-i18next';
-export default () => {
+const CircleLoading = () => {
const { t } = useTranslation('common');
return (
<Center height={'100%'} width={'100%'}>
@@ -19,3 +19,5 @@ export default () => {
</Center>
);
};
+
+export default CircleLoading;
diff --git a/src/components/MCPStdioCommandInput/index.tsx b/src/components/MCPStdioCommandInput/index.tsx
index 7bcaa20f1d5..81e65e3c2ba 100644
--- a/src/components/MCPStdioCommandInput/index.tsx
+++ b/src/components/MCPStdioCommandInput/index.tsx
@@ -39,7 +39,7 @@ const MCPStdioCommandInput = memo<AutoCompleteProps>((props) => (
{value}
</Flexbox>
),
- value: value,
+ value,
}))}
{...props}
/>
diff --git a/src/components/MaxTokenSlider.tsx b/src/components/MaxTokenSlider.tsx
index f00e5e35f8f..fc5b3077e5f 100644
--- a/src/components/MaxTokenSlider.tsx
+++ b/src/components/MaxTokenSlider.tsx
@@ -24,7 +24,7 @@ const MaxTokenSlider = memo<MaxTokenSliderProps>(({ value, onChange, defaultValu
const [token, setTokens] = useMergeState(0, {
defaultValue,
onChange,
- value: value,
+ value,
});
const [powValue, setPowValue] = useMergeState(0, {
diff --git a/src/components/ModelSelect/index.tsx b/src/components/ModelSelect/index.tsx
index 42c2a432cbf..65c381f405c 100644
--- a/src/components/ModelSelect/index.tsx
+++ b/src/components/ModelSelect/index.tsx
@@ -4,7 +4,14 @@ import { LobeHub, ModelIcon, ProviderIcon } from '@lobehub/icons';
import { type FlexboxProps } from '@lobehub/ui';
import { Avatar, Flexbox, Icon, Tag, Text, Tooltip } from '@lobehub/ui';
import { createStaticStyles, useResponsive } from 'antd-style';
-import { Infinity, LucideEye, LucideImage, LucidePaperclip, Video, Wrench } from 'lucide-react';
+import {
+ Infinity as InfinityIcon,
+ LucideEye,
+ LucideImage,
+ LucidePaperclip,
+ Video,
+ Wrench,
+} from 'lucide-react';
import { type ModelAbilities } from 'model-bank';
import numeral from 'numeral';
import { type CSSProperties, type FC } from 'react';
@@ -175,7 +182,7 @@ const Context = memo(
const tag = (
<Tag className={styles.token} size={'small'}>
- {contextWindowTokens === 0 ? <Infinity size={17} strokeWidth={1.6} /> : tokensText}
+ {contextWindowTokens === 0 ? <InfinityIcon size={17} strokeWidth={1.6} /> : tokensText}
</Tag>
);
diff --git a/src/config/featureFlags/schema.ts b/src/config/featureFlags/schema.ts
index 9d6dc071162..6dfea8f5ce6 100644
--- a/src/config/featureFlags/schema.ts
+++ b/src/config/featureFlags/schema.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix */
import { z } from 'zod';
// Define a union type for feature flag values: either boolean or array of user IDs
diff --git a/src/envs/analytics.ts b/src/envs/analytics.ts
index 82629d45338..4cbec408c67 100644
--- a/src/envs/analytics.ts
+++ b/src/envs/analytics.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix */
import { createEnv } from '@t3-oss/env-core';
import { z } from 'zod';
diff --git a/src/envs/app.ts b/src/envs/app.ts
index f724d7cd117..b34c0cc5c5e 100644
--- a/src/envs/app.ts
+++ b/src/envs/app.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix */
import { createEnv } from '@t3-oss/env-core';
import { z } from 'zod';
diff --git a/src/envs/auth.ts b/src/envs/auth.ts
index 66730d4feb1..85361520c2b 100644
--- a/src/envs/auth.ts
+++ b/src/envs/auth.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
import { createEnv } from '@t3-oss/env-core';
import { z } from 'zod';
@@ -6,92 +5,83 @@ declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace NodeJS {
interface ProcessEnv {
- // ===== Better Auth ===== //
- AUTH_SECRET?: string;
- AUTH_EMAIL_VERIFICATION?: string;
- AUTH_ENABLE_MAGIC_LINK?: string;
- AUTH_SSO_PROVIDERS?: string;
- AUTH_TRUSTED_ORIGINS?: string;
AUTH_ALLOWED_EMAILS?: string;
- AUTH_DISABLE_EMAIL_PASSWORD?: string;
-
- // ===== Auth Provider Credentials ===== //
- AUTH_GOOGLE_ID?: string;
- AUTH_GOOGLE_SECRET?: string;
-
+ AUTH_APPLE_APP_BUNDLE_IDENTIFIER?: string;
AUTH_APPLE_CLIENT_ID?: string;
AUTH_APPLE_CLIENT_SECRET?: string;
- AUTH_APPLE_APP_BUNDLE_IDENTIFIER?: string;
-
- AUTH_GITHUB_ID?: string;
- AUTH_GITHUB_SECRET?: string;
-
- AUTH_COGNITO_ID?: string;
- AUTH_COGNITO_SECRET?: string;
- AUTH_COGNITO_ISSUER?: string;
- AUTH_COGNITO_DOMAIN?: string;
- AUTH_COGNITO_REGION?: string;
- AUTH_COGNITO_USERPOOL_ID?: string;
-
- AUTH_MICROSOFT_AUTHORITY_URL?: string;
- AUTH_MICROSOFT_ID?: string;
- AUTH_MICROSOFT_SECRET?: string;
- AUTH_MICROSOFT_TENANT_ID?: string;
-
AUTH_AUTH0_ID?: string;
- AUTH_AUTH0_SECRET?: string;
AUTH_AUTH0_ISSUER?: string;
+ AUTH_AUTH0_SECRET?: string;
AUTH_AUTHELIA_ID?: string;
- AUTH_AUTHELIA_SECRET?: string;
AUTH_AUTHELIA_ISSUER?: string;
+ AUTH_AUTHELIA_SECRET?: string;
AUTH_AUTHENTIK_ID?: string;
- AUTH_AUTHENTIK_SECRET?: string;
AUTH_AUTHENTIK_ISSUER?: string;
+ AUTH_AUTHENTIK_SECRET?: string;
AUTH_CASDOOR_ID?: string;
- AUTH_CASDOOR_SECRET?: string;
- AUTH_CASDOOR_ISSUER?: string;
+ AUTH_CASDOOR_ISSUER?: string;
+ AUTH_CASDOOR_SECRET?: string;
AUTH_CLOUDFLARE_ZERO_TRUST_ID?: string;
- AUTH_CLOUDFLARE_ZERO_TRUST_SECRET?: string;
AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER?: string;
+ AUTH_CLOUDFLARE_ZERO_TRUST_SECRET?: string;
+ AUTH_COGNITO_DOMAIN?: string;
+
+ AUTH_COGNITO_ID?: string;
+ AUTH_COGNITO_ISSUER?: string;
+ AUTH_COGNITO_REGION?: string;
+ AUTH_COGNITO_SECRET?: string;
+
+ AUTH_COGNITO_USERPOOL_ID?: string;
+ AUTH_DISABLE_EMAIL_PASSWORD?: string;
+ AUTH_EMAIL_VERIFICATION?: string;
+ AUTH_ENABLE_MAGIC_LINK?: string;
AUTH_FEISHU_APP_ID?: string;
AUTH_FEISHU_APP_SECRET?: string;
AUTH_GENERIC_OIDC_ID?: string;
- AUTH_GENERIC_OIDC_SECRET?: string;
AUTH_GENERIC_OIDC_ISSUER?: string;
+ AUTH_GENERIC_OIDC_SECRET?: string;
+ AUTH_GITHUB_ID?: string;
+ AUTH_GITHUB_SECRET?: string;
+ // ===== Auth Provider Credentials ===== //
+ AUTH_GOOGLE_ID?: string;
+
+ AUTH_GOOGLE_SECRET?: string;
AUTH_KEYCLOAK_ID?: string;
- AUTH_KEYCLOAK_SECRET?: string;
AUTH_KEYCLOAK_ISSUER?: string;
+ AUTH_KEYCLOAK_SECRET?: string;
AUTH_LOGTO_ID?: string;
- AUTH_LOGTO_SECRET?: string;
+
AUTH_LOGTO_ISSUER?: string;
+ AUTH_LOGTO_SECRET?: string;
+ AUTH_MICROSOFT_AUTHORITY_URL?: string;
+
+ AUTH_MICROSOFT_ID?: string;
+ AUTH_MICROSOFT_SECRET?: string;
+ AUTH_MICROSOFT_TENANT_ID?: string;
AUTH_OKTA_ID?: string;
- AUTH_OKTA_SECRET?: string;
AUTH_OKTA_ISSUER?: string;
+ AUTH_OKTA_SECRET?: string;
+
+ // ===== Better Auth ===== //
+ AUTH_SECRET?: string;
+ AUTH_SSO_PROVIDERS?: string;
+ AUTH_TRUSTED_ORIGINS?: string;
AUTH_WECHAT_ID?: string;
AUTH_WECHAT_SECRET?: string;
AUTH_ZITADEL_ID?: string;
- AUTH_ZITADEL_SECRET?: string;
AUTH_ZITADEL_ISSUER?: string;
-
- // ===== JWKS Key ===== //
- /**
- * Generic JWKS key for signing/verifying JWTs.
- * Used for internal service authentication and other cryptographic operations.
- * Must be a JWKS JSON string containing an RS256 RSA key pair.
- * Can be generated using `node scripts/generate-oidc-jwk.mjs`.
- */
- JWKS_KEY?: string;
+ AUTH_ZITADEL_SECRET?: string;
/**
* Internal JWT expiration time for lambda → async calls.
@@ -101,6 +91,15 @@ declare global {
* @default '30s'
*/
INTERNAL_JWT_EXPIRATION?: string;
+
+ // ===== JWKS Key ===== //
+ /**
+ * Generic JWKS key for signing/verifying JWTs.
+ * Used for internal service authentication and other cryptographic operations.
+ * Must be a JWKS JSON string containing an RS256 RSA key pair.
+ * Can be generated using `node scripts/generate-oidc-jwk.mjs`.
+ */
+ JWKS_KEY?: string;
}
}
}
diff --git a/src/envs/email.ts b/src/envs/email.ts
index 21cb08c9d99..604b1d1a122 100644
--- a/src/envs/email.ts
+++ b/src/envs/email.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix */
import { createEnv } from '@t3-oss/env-core';
import { z } from 'zod';
diff --git a/src/envs/langfuse.ts b/src/envs/langfuse.ts
index 7cdc306c7f1..6cbdeecc679 100644
--- a/src/envs/langfuse.ts
+++ b/src/envs/langfuse.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
import { createEnv } from '@t3-oss/env-core';
import { z } from 'zod';
diff --git a/src/envs/llm.ts b/src/envs/llm.ts
index 4dd409988d3..754b1d6f6f8 100644
--- a/src/envs/llm.ts
+++ b/src/envs/llm.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
import { createEnv } from '@t3-oss/env-core';
import { z } from 'zod';
diff --git a/src/envs/redis.ts b/src/envs/redis.ts
index e7f9fb12b74..a2b7b36b627 100644
--- a/src/envs/redis.ts
+++ b/src/envs/redis.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix */
import { createEnv } from '@t3-oss/env-core';
import { z } from 'zod';
diff --git a/src/features/ChatInput/ActionBar/Tools/KlavisServerItem.tsx b/src/features/ChatInput/ActionBar/Tools/KlavisServerItem.tsx
index 80468b547a3..5ab094f1680 100644
--- a/src/features/ChatInput/ActionBar/Tools/KlavisServerItem.tsx
+++ b/src/features/ChatInput/ActionBar/Tools/KlavisServerItem.tsx
@@ -98,7 +98,7 @@ const KlavisServerItem = memo<KlavisServerItemProps>(
try {
await refreshKlavisServerTools(serverName);
} catch (error) {
- console.debug('[Klavis] Polling check (expected during auth):', error);
+ console.info('[Klavis] Polling check (expected during auth):', error);
}
}, POLL_INTERVAL_MS);
@@ -136,7 +136,7 @@ const KlavisServerItem = memo<KlavisServerItemProps>(
}
} catch {
// COOP 阻止了访问,降级到轮询方案
- console.log('[Klavis] COOP blocked window.closed access, falling back to polling');
+ console.info('[Klavis] COOP blocked window.closed access, falling back to polling');
if (windowCheckIntervalRef.current) {
clearInterval(windowCheckIntervalRef.current);
windowCheckIntervalRef.current = null;
diff --git a/src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx b/src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx
index 8d90540c125..321ce8e19ba 100644
--- a/src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx
+++ b/src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx
@@ -109,7 +109,7 @@ const LobehubSkillServerItem = memo<LobehubSkillServerItemProps>(({ provider, la
checkStatus(provider);
}
} catch {
- console.log('[LobehubSkill] COOP blocked window.closed access, falling back to polling');
+ console.info('[LobehubSkill] COOP blocked window.closed access, falling back to polling');
if (windowCheckIntervalRef.current) {
clearInterval(windowCheckIntervalRef.current);
windowCheckIntervalRef.current = null;
@@ -163,7 +163,7 @@ const LobehubSkillServerItem = memo<LobehubSkillServerItemProps>(({ provider, la
if (event.origin !== window.location.origin) return;
if (event.data?.type === 'LOBEHUB_SKILL_AUTH_SUCCESS' && event.data?.provider === provider) {
- console.log('[LobehubSkill] OAuth success message received for provider:', provider);
+ console.info('[LobehubSkill] OAuth success message received for provider:', provider);
// Cleanup polling/window monitoring
cleanup();
@@ -183,7 +183,7 @@ const LobehubSkillServerItem = memo<LobehubSkillServerItemProps>(({ provider, la
?.plugins || [];
const isAlreadyEnabled = currentAgentPlugins.includes(newPluginId);
if (!isAlreadyEnabled) {
- console.log('[LobehubSkill] Auto-enabling plugin:', newPluginId);
+ console.info('[LobehubSkill] Auto-enabling plugin:', newPluginId);
togglePlugin(newPluginId);
}
}
diff --git a/src/features/CommandMenu/SearchResults.tsx b/src/features/CommandMenu/SearchResults.tsx
index 934e0597ea2..bce8ebd7631 100644
--- a/src/features/CommandMenu/SearchResults.tsx
+++ b/src/features/CommandMenu/SearchResults.tsx
@@ -72,7 +72,7 @@ const SearchResults = memo<SearchResultsProps>(
const fileUrl = result.knowledgeBaseId
? `/resource/library/${result.knowledgeBaseId}?file=${result.id}`
: `/resource?file=${result.id}`;
- console.log('[SearchResults] File navigation:', {
+ console.info('[SearchResults] File navigation:', {
fileDetails: result,
url: fileUrl,
});
diff --git a/src/features/Conversation/Error/OllamaBizError/index.tsx b/src/features/Conversation/Error/OllamaBizError/index.tsx
index ce2a0cdbe0c..5b2f0702c34 100644
--- a/src/features/Conversation/Error/OllamaBizError/index.tsx
+++ b/src/features/Conversation/Error/OllamaBizError/index.tsx
@@ -23,6 +23,7 @@ interface OllamaErrorResponse {
error: OllamaError;
}
+// eslint-disable-next-line regexp/no-dupe-characters-character-class, regexp/no-obscure-range
const UNRESOLVED_MODEL_REGEXP = /model "([\w+,-_]+)" not found/;
interface OllamaBizErrorProps {
diff --git a/src/features/Conversation/Messages/Assistant/Actions/index.tsx b/src/features/Conversation/Messages/Assistant/Actions/index.tsx
index e8c29706dd5..28e5620386f 100644
--- a/src/features/Conversation/Messages/Assistant/Actions/index.tsx
+++ b/src/features/Conversation/Messages/Assistant/Actions/index.tsx
@@ -1,14 +1,14 @@
import { type UIChatMessage } from '@lobechat/types';
-import { ActionIconGroup, Flexbox, createRawModal } from '@lobehub/ui';
import type { ActionIconGroupEvent, ActionIconGroupItemType } from '@lobehub/ui';
+import { ActionIconGroup, createRawModal, Flexbox } from '@lobehub/ui';
import { memo, useCallback, useMemo } from 'react';
import { ReactionPicker } from '../../../components/Reaction';
import ShareMessageModal, { type ShareModalProps } from '../../../components/ShareMessageModal';
import {
- Provider,
createStore,
messageStateSelectors,
+ Provider,
useConversationStore,
useConversationStoreApi,
} from '../../../store';
@@ -211,7 +211,7 @@ export const AssistantActionsBar = memo<AssistantActionsBarProps>(
if (error) return <ErrorActionsBar actions={defaultActions} onActionClick={handleAction} />;
return (
- <Flexbox align={'center'} gap={8} horizontal>
+ <Flexbox horizontal align={'center'} gap={8}>
<ReactionPicker messageId={id} />
<ActionIconGroup items={items} menu={menu} onActionClick={handleAction} />
</Flexbox>
diff --git a/src/features/Conversation/Messages/Assistant/components/MessageContent.tsx b/src/features/Conversation/Messages/Assistant/components/MessageContent.tsx
index 3a71fb89040..b2672f3014c 100644
--- a/src/features/Conversation/Messages/Assistant/components/MessageContent.tsx
+++ b/src/features/Conversation/Messages/Assistant/components/MessageContent.tsx
@@ -85,8 +85,8 @@ const MessageContent = memo<UIChatMessage>(
<ReactionDisplay
isActive={isActive}
messageId={id}
- onReactionClick={handleReactionClick}
reactions={reactions}
+ onReactionClick={handleReactionClick}
/>
)}
</Flexbox>
diff --git a/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx
index 2ea5dcea1dd..55da1a3ac5c 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx
@@ -1,14 +1,14 @@
import { type AssistantContentBlock, type UIChatMessage } from '@lobechat/types';
-import { ActionIconGroup, Flexbox, createRawModal } from '@lobehub/ui';
import type { ActionIconGroupEvent, ActionIconGroupItemType } from '@lobehub/ui';
+import { ActionIconGroup, createRawModal, Flexbox } from '@lobehub/ui';
import { memo, useCallback, useMemo } from 'react';
import { ReactionPicker } from '../../../components/Reaction';
import ShareMessageModal, { type ShareModalProps } from '../../../components/ShareMessageModal';
import {
- Provider,
createStore,
messageStateSelectors,
+ Provider,
useConversationStore,
useConversationStoreApi,
} from '../../../store';
@@ -164,7 +164,7 @@ const WithContentId = memo<GroupActionsProps>(({ actionsConfig, id, data, conten
);
return (
- <Flexbox align={'center'} gap={8} horizontal>
+ <Flexbox horizontal align={'center'} gap={8}>
<ReactionPicker messageId={id} />
<ActionIconGroup items={items} menu={menu} onActionClick={handleAction} />
</Flexbox>
diff --git a/src/features/Conversation/Messages/AssistantGroup/index.tsx b/src/features/Conversation/Messages/AssistantGroup/index.tsx
index 8445ce36f74..fc47e032081 100644
--- a/src/features/Conversation/Messages/AssistantGroup/index.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/index.tsx
@@ -2,8 +2,8 @@
import type { AssistantContentBlock, EmojiReaction } from '@lobechat/types';
import isEqual from 'fast-deep-equal';
-import type {MouseEventHandler} from 'react';
-import { memo, Suspense, useCallback, useMemo } from 'react';
+import type { MouseEventHandler } from 'react';
+import { memo, Suspense, useCallback, useMemo } from 'react';
import { MESSAGE_ACTION_BAR_PORTAL_ATTRIBUTES } from '@/const/messageActionPortal';
import { ChatItem } from '@/features/Conversation/ChatItem';
@@ -177,8 +177,8 @@ const GroupMessage = memo<GroupMessageProps>(({ id, index, disableEditing, isLat
<ReactionDisplay
isActive={isReactionActive}
messageId={id}
- onReactionClick={handleReactionClick}
reactions={reactions}
+ onReactionClick={handleReactionClick}
/>
)}
<Suspense fallback={null}>
diff --git a/src/features/Conversation/Messages/CompressedGroup/index.tsx b/src/features/Conversation/Messages/CompressedGroup/index.tsx
index 416ae841951..1bac3211473 100644
--- a/src/features/Conversation/Messages/CompressedGroup/index.tsx
+++ b/src/features/Conversation/Messages/CompressedGroup/index.tsx
@@ -148,26 +148,26 @@ const CompressedGroupMessage = memo<CompressedGroupMessageProps>(({ id }) => {
<StreamingMarkdown>{content}</StreamingMarkdown>
</>
) : (
- <Flexbox align={'center'} distribution={'space-between'} horizontal width={'100%'}>
+ <Flexbox horizontal align={'center'} distribution={'space-between'} width={'100%'}>
<Tabs
+ compact
activeKey={isGeneratingSummary ? 'summary' : activeTab}
className={styles.header}
- compact
items={tabItems}
- onChange={handleTabChange}
variant={'rounded'}
+ onChange={handleTabChange}
/>
- <Flexbox gap={4} horizontal>
+ <Flexbox horizontal gap={4}>
<ActionIcon
icon={Undo2}
- onClick={handleCancelCompression}
size={'small'}
title={t('compression.cancel')}
+ onClick={handleCancelCompression}
/>
<ActionIcon
icon={expanded ? ChevronUp : ChevronDown}
- onClick={() => toggleCompressedGroupExpanded(id)}
size={'small'}
+ onClick={() => toggleCompressedGroupExpanded(id)}
/>
</Flexbox>
</Flexbox>
diff --git a/src/features/Conversation/Messages/Supervisor/Actions/index.tsx b/src/features/Conversation/Messages/Supervisor/Actions/index.tsx
index 8572aca0e7b..be30448f328 100644
--- a/src/features/Conversation/Messages/Supervisor/Actions/index.tsx
+++ b/src/features/Conversation/Messages/Supervisor/Actions/index.tsx
@@ -1,14 +1,14 @@
-import type {AssistantContentBlock, UIChatMessage} from '@lobechat/types';
+import type { AssistantContentBlock, UIChatMessage } from '@lobechat/types';
import type { ActionIconGroupEvent, ActionIconGroupItemType } from '@lobehub/ui';
-import { ActionIconGroup, createRawModal , Flexbox} from '@lobehub/ui';
+import { ActionIconGroup, createRawModal, Flexbox } from '@lobehub/ui';
import { memo, useCallback, useMemo } from 'react';
import { ReactionPicker } from '../../../components/Reaction';
import ShareMessageModal, { type ShareModalProps } from '../../../components/ShareMessageModal';
import {
- Provider,
createStore,
messageStateSelectors,
+ Provider,
useConversationStore,
useConversationStoreApi,
} from '../../../store';
@@ -156,7 +156,7 @@ const WithContentId = memo<GroupActionsProps>(({ actionsConfig, id, data, conten
);
return (
- <Flexbox align={'center'} gap={8} horizontal>
+ <Flexbox horizontal align={'center'} gap={8}>
<ReactionPicker messageId={id} />
<ActionIconGroup items={items} menu={menu} onActionClick={handleAction} />
</Flexbox>
diff --git a/src/features/Conversation/Messages/Supervisor/components/ContentBlock.tsx b/src/features/Conversation/Messages/Supervisor/components/ContentBlock.tsx
index 91616a1d779..a90d3d81d3b 100644
--- a/src/features/Conversation/Messages/Supervisor/components/ContentBlock.tsx
+++ b/src/features/Conversation/Messages/Supervisor/components/ContentBlock.tsx
@@ -7,8 +7,8 @@ import { type AssistantContentBlock } from '@/types/index';
import ErrorContent from '../../../ChatItem/components/ErrorContent';
import { messageStateSelectors, useConversationStore } from '../../../store';
-import { Tools } from '../../AssistantGroup/Tools';
import MessageContent from '../../AssistantGroup/components/MessageContent';
+import { Tools } from '../../AssistantGroup/Tools';
import Reasoning from '../../components/Reasoning';
interface ContentBlockProps extends AssistantContentBlock {
diff --git a/src/features/Conversation/Messages/Supervisor/index.tsx b/src/features/Conversation/Messages/Supervisor/index.tsx
index 56048d6aa9a..59ac39fb6e0 100644
--- a/src/features/Conversation/Messages/Supervisor/index.tsx
+++ b/src/features/Conversation/Messages/Supervisor/index.tsx
@@ -156,8 +156,8 @@ const GroupMessage = memo<GroupMessageProps>(({ id, index, disableEditing, isLat
<ReactionDisplay
isActive={isReactionActive}
messageId={id}
- onReactionClick={handleReactionClick}
reactions={reactions}
+ onReactionClick={handleReactionClick}
/>
)}
</ChatItem>
diff --git a/src/features/Conversation/Messages/User/index.tsx b/src/features/Conversation/Messages/User/index.tsx
index d1a7a14ca4c..6cffaeb4bc6 100644
--- a/src/features/Conversation/Messages/User/index.tsx
+++ b/src/features/Conversation/Messages/User/index.tsx
@@ -46,13 +46,10 @@ const UserMessage = memo<UserMessageProps>(({ id, disableEditing, index }) => {
const dmIndicator = useMemo(() => {
if (!targetId) return undefined;
- let targetName = targetId;
- if (targetId === 'user') {
- targetName = userName;
- } else {
- const targetAgent = agents?.find((agent) => agent.id === targetId);
- targetName = targetAgent?.title || targetId;
- }
+ const targetName =
+ targetId === 'user'
+ ? userName
+ : agents?.find((agent) => agent.id === targetId)?.title || targetId;
return <Tag>{t('dm.visibleTo', { target: targetName })}</Tag>;
}, [targetId, userName, agents, t]);
diff --git a/src/features/Conversation/components/Reaction/ReactionDisplay.tsx b/src/features/Conversation/components/Reaction/ReactionDisplay.tsx
index ce3adea00aa..9a03e9d36f0 100644
--- a/src/features/Conversation/components/Reaction/ReactionDisplay.tsx
+++ b/src/features/Conversation/components/Reaction/ReactionDisplay.tsx
@@ -71,7 +71,7 @@ const ReactionDisplay = memo<ReactionDisplayProps>(
if (reactions.length === 0) return null;
return (
- <Flexbox align={'center'} className={styles.container} horizontal>
+ <Flexbox horizontal align={'center'} className={styles.container}>
{reactions.map((reaction) => (
<div
className={cx(styles.reactionTag, isActive?.(reaction.emoji) && styles.active)}
diff --git a/src/features/Conversation/components/Reaction/ReactionPicker.tsx b/src/features/Conversation/components/Reaction/ReactionPicker.tsx
index ff2694c1411..b76947d5d19 100644
--- a/src/features/Conversation/components/Reaction/ReactionPicker.tsx
+++ b/src/features/Conversation/components/Reaction/ReactionPicker.tsx
@@ -6,7 +6,7 @@ import { ActionIcon, Flexbox, Tooltip } from '@lobehub/ui';
import { Popover } from 'antd';
import { createStyles, useTheme } from 'antd-style';
import { PlusIcon, SmilePlus } from 'lucide-react';
-import { type FC, type ReactNode, memo, useState } from 'react';
+import { type FC, memo, type ReactNode, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useGlobalStore } from '@/store/global';
@@ -91,13 +91,13 @@ const ReactionPicker: FC<ReactionPickerProps> = memo(({ messageId, trigger }) =>
<Picker
data={data}
locale={locale?.split('-')[0] || 'en'}
- onEmojiSelect={(emoji: any) => handleSelect(emoji.native)}
previewPosition="none"
skinTonePosition="none"
theme={theme.appearance === 'dark' ? 'dark' : 'light'}
+ onEmojiSelect={(emoji: any) => handleSelect(emoji.native)}
/>
) : (
- <Flexbox className={styles.pickerContainer} gap={4} horizontal wrap="wrap">
+ <Flexbox horizontal className={styles.pickerContainer} gap={4} wrap="wrap">
{QUICK_REACTIONS.map((emoji) => (
<div className={styles.emojiButton} key={emoji} onClick={() => handleSelect(emoji)}>
{emoji}
@@ -113,11 +113,11 @@ const ReactionPicker: FC<ReactionPickerProps> = memo(({ messageId, trigger }) =>
<Popover
arrow={false}
content={content}
- onOpenChange={handleOpenChange}
open={open}
overlayInnerStyle={{ padding: 0 }}
placement="top"
trigger="click"
+ onOpenChange={handleOpenChange}
>
{trigger || (
<span {...(open ? { 'data-popup-open': '' } : {})}>
diff --git a/src/features/Conversation/store/slices/message/action/index.ts b/src/features/Conversation/store/slices/message/action/index.ts
index 94472209042..cbf44a45d8c 100644
--- a/src/features/Conversation/store/slices/message/action/index.ts
+++ b/src/features/Conversation/store/slices/message/action/index.ts
@@ -4,8 +4,8 @@ import type { Store as ConversationStore } from '../../../action';
import { type MessageCRUDAction, messageCRUDSlice } from './crud';
import { type MessageReactionAction, messageReactionSlice } from './reaction';
import { sendMessage } from './sendMessage';
-import type {MessageStateAction} from './state';
-import { messageStateSlice } from './state';
+import type { MessageStateAction } from './state';
+import { messageStateSlice } from './state';
/**
* Message Actions
@@ -16,7 +16,8 @@ import { messageStateSlice } from './state';
* - State management (loading, collapsed, editing)
* - Sending messages
*/
-export interface MessageAction extends MessageCRUDAction, MessageReactionAction, MessageStateAction {
+export interface MessageAction
+ extends MessageCRUDAction, MessageReactionAction, MessageStateAction {
/**
* Add an AI message (convenience method)
*/
@@ -59,7 +60,7 @@ export const messageSlice: StateCreator<
const parentId = displayMessages.length > 0 ? displayMessages.at(-1)?.id : undefined;
const id = await state.createMessage({
- agentId: agentId,
+ agentId,
content,
parentId,
role: 'assistant',
diff --git a/src/features/Conversation/store/slices/message/action/sendMessage.ts b/src/features/Conversation/store/slices/message/action/sendMessage.ts
index bbdbd6d1dec..d338c532735 100644
--- a/src/features/Conversation/store/slices/message/action/sendMessage.ts
+++ b/src/features/Conversation/store/slices/message/action/sendMessage.ts
@@ -26,7 +26,7 @@ export const sendMessage = (
if (hooks.onBeforeSendMessage) {
const result = await hooks.onBeforeSendMessage(params);
if (result === false) {
- console.log('[ConversationStore] sendMessage blocked by onBeforeSendMessage hook');
+ console.info('[ConversationStore] sendMessage blocked by onBeforeSendMessage hook');
return;
}
}
diff --git a/src/features/Conversation/types/hooks.ts b/src/features/Conversation/types/hooks.ts
index ddc4b45320f..4ffe9ec79fe 100644
--- a/src/features/Conversation/types/hooks.ts
+++ b/src/features/Conversation/types/hooks.ts
@@ -17,7 +17,6 @@ import {
* - Add analytics/logging
* - Implement custom approval flows
*/
-/* eslint-disable typescript-sort-keys/interface */
export interface ConversationHooks {
// ========================================
// Message Lifecycle Hooks
diff --git a/src/features/Conversation/utils/markdown.ts b/src/features/Conversation/utils/markdown.ts
index 3ba76b99207..a834f63628b 100644
--- a/src/features/Conversation/utils/markdown.ts
+++ b/src/features/Conversation/utils/markdown.ts
@@ -5,12 +5,14 @@ import { ARTIFACT_TAG_REGEX, ARTIFACT_THINKING_TAG_REGEX } from '@lobechat/const
*/
export const processWithArtifact = (input: string = '') => {
// First remove outer fenced code block if it exists
+ /* eslint-disable regexp/no-super-linear-backtracking */
let output = input.replace(
/^([\s\S]*?)\s*```[^\n]*\n((?:<lobeThinking>[\s\S]*?<\/lobeThinking>[\t\v\f\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\n\s*)?<lobeArtifact[\s\S]*?<\/lobeArtifact>\s*)\n```\s*([\s\S]*)$/,
(_, before = '', content, after = '') => {
return [before.trim(), content.trim(), after.trim()].filter(Boolean).join('\n\n');
},
);
+ /* eslint-enable regexp/no-super-linear-backtracking */
const thinkMatch = ARTIFACT_THINKING_TAG_REGEX.exec(output);
diff --git a/src/features/GenerationTopicList/SkeletonList.tsx b/src/features/GenerationTopicList/SkeletonList.tsx
index 43274cfa5c7..2873861d1a7 100644
--- a/src/features/GenerationTopicList/SkeletonList.tsx
+++ b/src/features/GenerationTopicList/SkeletonList.tsx
@@ -11,11 +11,11 @@ const SkeletonList = memo(() => {
<Flexbox align="center" gap={6} width={'100%'}>
<ActionIcon
icon={Plus}
+ variant={'filled'}
size={{
blockSize: 48,
size: 20,
}}
- variant={'filled'}
/>
{Array.from({ length: 5 }).map((_, index) => (
diff --git a/src/features/GenerationTopicList/StoreContext.tsx b/src/features/GenerationTopicList/StoreContext.tsx
index 5a9b462d6de..51585c03589 100644
--- a/src/features/GenerationTopicList/StoreContext.tsx
+++ b/src/features/GenerationTopicList/StoreContext.tsx
@@ -1,6 +1,6 @@
'use client';
-import { createContext, useContext } from 'react';
+import { createContext, use } from 'react';
import type { SWRResponse } from 'swr';
import type { StoreApi, UseBoundStore } from 'zustand';
@@ -25,7 +25,7 @@ export interface GenerationTopicContextValue {
const GenerationTopicContext = createContext<GenerationTopicContextValue | null>(null);
export const useGenerationTopicContext = () => {
- const ctx = useContext(GenerationTopicContext);
+ const ctx = use(GenerationTopicContext);
if (!ctx) {
throw new Error('useGenerationTopicContext must be used within GenerationTopicStoreProvider');
}
diff --git a/src/features/GenerationTopicPanel/index.tsx b/src/features/GenerationTopicPanel/index.tsx
index 6d7a68c2f19..0214aef26fd 100644
--- a/src/features/GenerationTopicPanel/index.tsx
+++ b/src/features/GenerationTopicPanel/index.tsx
@@ -3,7 +3,7 @@
import { DraggablePanel, DraggablePanelContainer, type DraggablePanelProps } from '@lobehub/ui';
import { createStaticStyles, cssVar, useResponsive } from 'antd-style';
import isEqual from 'fast-deep-equal';
-import { type PropsWithChildren, memo, useEffect, useState } from 'react';
+import { memo, type PropsWithChildren, useEffect, useState } from 'react';
export const styles = createStaticStyles(({ css }) => ({
content: css`
@@ -53,19 +53,19 @@ const GenerationTopicPanel = memo<GenerationTopicPanelProps>(
return (
<DraggablePanel
- classNames={{
- content: styles.content,
- handle: styles.handle,
- }}
defaultSize={{ width: tmpWidth }}
expand={showPanel}
maxWidth={320}
minWidth={80}
mode={md ? 'fixed' : 'float'}
- onExpandChange={handleExpand}
- onSizeChange={handleSizeChange}
placement="right"
size={{ height: '100%', width: panelWidth }}
+ classNames={{
+ content: styles.content,
+ handle: styles.handle,
+ }}
+ onExpandChange={handleExpand}
+ onSizeChange={handleSizeChange}
>
<DraggablePanelContainer
style={{
diff --git a/src/features/ImageTopicPanel/index.tsx b/src/features/ImageTopicPanel/index.tsx
index d1d01468456..36facc9ad76 100644
--- a/src/features/ImageTopicPanel/index.tsx
+++ b/src/features/ImageTopicPanel/index.tsx
@@ -16,10 +16,10 @@ const ImageTopicPanel = memo<PropsWithChildren>(({ children }) => {
return (
<GenerationTopicPanel
- onExpandChange={(expand) => updateSystemStatus({ showImageTopicPanel: expand })}
- onSizeChange={(width) => updateSystemStatus({ imageTopicPanelWidth: width })}
panelWidth={imageTopicPanelWidth ?? 256}
showPanel={showImageTopicPanel ?? true}
+ onExpandChange={(expand) => updateSystemStatus({ showImageTopicPanel: expand })}
+ onSizeChange={(width) => updateSystemStatus({ imageTopicPanelWidth: width })}
>
{children}
</GenerationTopicPanel>
diff --git a/src/features/LibraryModal/CreateNew/CreateForm.tsx b/src/features/LibraryModal/CreateNew/CreateForm.tsx
index 9ae207b7ed6..9dd745aa777 100644
--- a/src/features/LibraryModal/CreateNew/CreateForm.tsx
+++ b/src/features/LibraryModal/CreateNew/CreateForm.tsx
@@ -3,7 +3,6 @@ import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useKnowledgeBaseStore } from '@/store/library';
-import { type CreateKnowledgeBaseParams } from '@/types/knowledgeBase';
interface CreateFormProps {
id?: string;
@@ -67,7 +66,7 @@ const CreateForm = memo<CreateFormProps>(({ id, initialValues, onClose, onSucces
onChange={(e) => setDescription(e.target.value)}
/>
</Flexbox>
- <Button block loading={loading} onClick={handleSubmit} type={'primary'}>
+ <Button block loading={loading} type={'primary'} onClick={handleSubmit}>
{isEditMode ? t('createNew.edit.confirm') : t('createNew.confirm')}
</Button>
</Flexbox>
diff --git a/src/features/LibraryModal/CreateNew/index.tsx b/src/features/LibraryModal/CreateNew/index.tsx
index e7ac63cadcc..ea6a8cdd27c 100644
--- a/src/features/LibraryModal/CreateNew/index.tsx
+++ b/src/features/LibraryModal/CreateNew/index.tsx
@@ -1,5 +1,5 @@
-import { Flexbox, createModal, useModalContext } from '@lobehub/ui';
-import { Suspense, memo, useCallback } from 'react';
+import { createModal, Flexbox, useModalContext } from '@lobehub/ui';
+import { memo, Suspense, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import CreateForm from './CreateForm';
diff --git a/src/features/MCP/Scores.tsx b/src/features/MCP/Scores.tsx
index 6fcbbe60b61..df6f348125b 100644
--- a/src/features/MCP/Scores.tsx
+++ b/src/features/MCP/Scores.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Center, Flexbox, Icon, Tooltip, stopPropagation } from '@lobehub/ui';
+import { Center, Flexbox, Icon, stopPropagation, Tooltip } from '@lobehub/ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { CircleDashedIcon, HammerIcon, LayersIcon, MessageSquareQuoteIcon } from 'lucide-react';
import qs from 'query-string';
diff --git a/src/features/MCPPluginDetail/Header.tsx b/src/features/MCPPluginDetail/Header.tsx
index 985d9c76a06..15007f68683 100644
--- a/src/features/MCPPluginDetail/Header.tsx
+++ b/src/features/MCPPluginDetail/Header.tsx
@@ -7,10 +7,10 @@ import {
Button,
Flexbox,
Icon,
+ stopPropagation,
Tag,
Text,
Tooltip,
- stopPropagation,
} from '@lobehub/ui';
import { App } from 'antd';
import { createStaticStyles, cssVar, useResponsive } from 'antd-style';
@@ -231,11 +231,7 @@ const Header = memo<{ inModal?: boolean; mobile?: boolean }>(({ mobile: isMobile
)}
{isClaimed && <Tag size={'small'}>{t('isClaimed')}</Tag>}
<Icon icon={DotIcon} />
- <PublishedTime
- className={styles.time}
- date={(updatedAt || createdAt) as string}
-
- />
+ <PublishedTime className={styles.time} date={(updatedAt || createdAt) as string} />
</Flexbox>
</Flexbox>
</Flexbox>
diff --git a/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx b/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx
index 4cdc9963c46..ca0f79ecabf 100644
--- a/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx
+++ b/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx
@@ -67,7 +67,7 @@ const QuickImportSection = ({
// Update form fields even if duplicate, so user sees the pasted values
form.setFieldsValue({
customParams: { mcp: mcpConfig },
- identifier: identifier,
+ identifier,
});
// Trigger validation to show Form.Item error
form.validateFields(['identifier']);
@@ -79,7 +79,7 @@ const QuickImportSection = ({
// All checks passed, fill the form
form.setFieldsValue({
customParams: { mcp: mcpConfig },
- identifier: identifier,
+ identifier,
});
// Clear potential old validation error on identifier field
diff --git a/src/features/PluginDevModal/MCPManifestForm/utils.ts b/src/features/PluginDevModal/MCPManifestForm/utils.ts
index 9e2d541fd77..e0f20c90408 100644
--- a/src/features/PluginDevModal/MCPManifestForm/utils.ts
+++ b/src/features/PluginDevModal/MCPManifestForm/utils.ts
@@ -64,15 +64,12 @@ export const parseMcpInput = (value: string): ParseResult => {
const mcpConfig = parsedJson.mcpServers[identifier];
if (mcpConfig && typeof mcpConfig === 'object' && !Array.isArray(mcpConfig)) {
- let type: 'stdio' | 'http' | undefined;
- let resultMcpConfig: McpConfig & { type?: 'stdio' | 'http' } = {};
+ let resultMcpConfig: McpConfig & { type?: 'stdio' | 'http' };
if (mcpConfig.command && Array.isArray(mcpConfig.args)) {
- type = 'stdio';
- resultMcpConfig = { ...mcpConfig, type };
+ resultMcpConfig = { ...mcpConfig, type: 'stdio' };
} else if (mcpConfig.url) {
- type = 'http';
- resultMcpConfig = { type, url: mcpConfig.url };
+ resultMcpConfig = { type: 'http', url: mcpConfig.url };
} else {
return {
errorCode: McpParseErrorCode.InvalidMcpStructure,
@@ -90,7 +87,7 @@ export const parseMcpInput = (value: string): ParseResult => {
// mcpConfig is invalid or not an object
return {
errorCode: McpParseErrorCode.InvalidMcpStructure,
- identifier: identifier,
+ identifier,
status: 'error',
};
} else {
@@ -109,17 +106,14 @@ export const parseMcpInput = (value: string): ParseResult => {
const mcpConfig = (parsedJson as any)[identifier];
if (mcpConfig && typeof mcpConfig === 'object' && !Array.isArray(mcpConfig)) {
- let type: 'stdio' | 'http' | undefined;
- let resultMcpConfig: McpConfig & { type?: 'stdio' | 'http' } = {};
+ let resultMcpConfig: McpConfig & { type?: 'stdio' | 'http' };
// Explicitly check properties of mcpConfig
if (mcpConfig.command && Array.isArray(mcpConfig.args)) {
- type = 'stdio';
- resultMcpConfig = { ...mcpConfig, type };
+ resultMcpConfig = { ...mcpConfig, type: 'stdio' };
} else if (mcpConfig.url) {
- type = 'http';
// For the flat structure, ensure only 'url' is included for http type
- resultMcpConfig = { type, url: mcpConfig.url };
+ resultMcpConfig = { type: 'http', url: mcpConfig.url };
} else {
// Invalid structure within the identifier's value
return {
diff --git a/src/features/PluginsUI/Render/utils/iframeOnReady.test.ts b/src/features/PluginsUI/Render/utils/iframeOnReady.test.ts
index 0f34bc840b0..86589d4a6ec 100644
--- a/src/features/PluginsUI/Render/utils/iframeOnReady.test.ts
+++ b/src/features/PluginsUI/Render/utils/iframeOnReady.test.ts
@@ -9,6 +9,7 @@ describe('useOnPluginReadyForInteraction', () => {
afterEach(() => {
mockOnReady.mockReset();
+ // eslint-disable-next-line unicorn/no-invalid-remove-event-listener
window.removeEventListener('message', () => {});
});
diff --git a/src/features/PluginsUI/Render/utils/pluginSettings.test.ts b/src/features/PluginsUI/Render/utils/pluginSettings.test.ts
index 2385dbded0c..6326219d768 100644
--- a/src/features/PluginsUI/Render/utils/pluginSettings.test.ts
+++ b/src/features/PluginsUI/Render/utils/pluginSettings.test.ts
@@ -9,6 +9,7 @@ describe('useOnPluginSettingsUpdate', () => {
afterEach(() => {
mockCallback.mockReset();
+ // eslint-disable-next-line unicorn/no-invalid-remove-event-listener
window.removeEventListener('message', () => {});
});
diff --git a/src/features/PluginsUI/Render/utils/pluginState.test.ts b/src/features/PluginsUI/Render/utils/pluginState.test.ts
index a8e645c8b2b..52843ddcf41 100644
--- a/src/features/PluginsUI/Render/utils/pluginState.test.ts
+++ b/src/features/PluginsUI/Render/utils/pluginState.test.ts
@@ -12,6 +12,7 @@ describe('useOnPluginStateUpdate', () => {
// Reset the mock callback after each test
mockCallback.mockReset();
// Ensure no event listeners are left hanging after each test
+ // eslint-disable-next-line unicorn/no-invalid-remove-event-listener
window.removeEventListener('message', () => {});
});
diff --git a/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx b/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx
index ef0759e071a..ca926de8452 100644
--- a/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx
+++ b/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx
@@ -61,9 +61,6 @@ const CustomPluginInstallModal = memo<CustomPluginInstallModalProps>(
setLoading(true);
try {
- // 第三方市场和自定义插件:构建自定义插件数据
- let customPlugin: LobeToolCustomPlugin;
-
// 合并原始配置和用户更新的配置
const finalConfig = {
...schema.config,
@@ -74,7 +71,7 @@ const CustomPluginInstallModal = memo<CustomPluginInstallModalProps>(
// 自定义插件:先测试连接获取真实的 manifest
const testParams: McpConnectionParams = {
connection: finalConfig,
- identifier: identifier,
+ identifier,
metadata: {
avatar: schema.icon,
description: schema.description,
@@ -91,8 +88,9 @@ const CustomPluginInstallModal = memo<CustomPluginInstallModalProps>(
throw new Error(t('protocolInstall.messages.manifestNotFound'));
}
+ // 第三方市场和自定义插件:构建自定义插件数据
// 使用测试连接获取的真实 manifest
- customPlugin = {
+ const customPlugin: LobeToolCustomPlugin = {
customParams: {
avatar: schema.icon,
description: schema.description,
diff --git a/src/features/ResourceManager/components/Explorer/Header/SearchInput.tsx b/src/features/ResourceManager/components/Explorer/Header/SearchInput.tsx
index e2a2ec80410..e456de8927f 100644
--- a/src/features/ResourceManager/components/Explorer/Header/SearchInput.tsx
+++ b/src/features/ResourceManager/components/Explorer/Header/SearchInput.tsx
@@ -1,8 +1,8 @@
'use client';
import { ActionIcon } from '@lobehub/ui';
-import { Input } from 'antd';
import { useDebounce } from 'ahooks';
+import { Input } from 'antd';
import { SearchIcon, XIcon } from 'lucide-react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -60,29 +60,33 @@ const SearchInput = memo(() => {
return (
<>
<div
- onTransitionEnd={handleTransitionEnd}
style={{
opacity: expanded ? 1 : 0,
overflow: 'hidden',
transition: 'width 240ms ease-out, opacity 200ms ease-out',
width: expanded ? 200 : 0,
}}
+ onTransitionEnd={handleTransitionEnd}
>
<Input
- onBlur={handleBlur}
- onChange={(e) => setLocalQuery(e.target.value)}
- onKeyDown={handleKeyDown}
placeholder={t('FileManager.search.placeholder')}
prefix={<SearchIcon size={14} />}
ref={inputRef}
size="small"
style={{ width: 200 }}
- suffix={localQuery ? <XIcon onClick={handleCollapse} size={14} style={{ cursor: 'pointer' }} /> : undefined}
value={localQuery}
+ suffix={
+ localQuery ? (
+ <XIcon size={14} style={{ cursor: 'pointer' }} onClick={handleCollapse} />
+ ) : undefined
+ }
+ onBlur={handleBlur}
+ onChange={(e) => setLocalQuery(e.target.value)}
+ onKeyDown={handleKeyDown}
/>
</div>
{showIcon && (
- <ActionIcon icon={SearchIcon} onClick={handleExpand} style={{ marginRight: 4 }} />
+ <ActionIcon icon={SearchIcon} style={{ marginRight: 4 }} onClick={handleExpand} />
)}
</>
);
diff --git a/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx b/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx
index 079cbc1d7a4..02aedfbbaed 100644
--- a/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx
+++ b/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx
@@ -399,12 +399,12 @@ const FileListItem = memo<FileListItemProps>(
borderBlockEnd: `1px solid ${cssVar.colorBorderSecondary}`,
userSelect: 'none',
}}
+ onClick={handleItemClick}
onDragEnd={handleDragEnd}
onDragLeave={handleDragLeave}
onDragOver={handleDragOver}
onDragStart={handleDragStart}
onDrop={handleDrop}
- onClick={handleItemClick}
onMouseEnter={() => onHoverChange(true)}
onMouseLeave={() => onHoverChange(false)}
>
@@ -491,8 +491,8 @@ const FileListItem = memo<FileListItemProps>(
align={'center'}
gap={8}
paddingInline={8}
- onPointerDown={stopPropagation}
onClick={stopPropagation}
+ onPointerDown={stopPropagation}
>
{!isFolder &&
!isPage &&
diff --git a/src/features/ResourceManager/components/Explorer/ListView/index.tsx b/src/features/ResourceManager/components/Explorer/ListView/index.tsx
index bf1ba6f982e..36e5f31c2b6 100644
--- a/src/features/ResourceManager/components/Explorer/ListView/index.tsx
+++ b/src/features/ResourceManager/components/Explorer/ListView/index.tsx
@@ -323,6 +323,7 @@ const ListView = memo(function ListView() {
}, [clearScrollTimers]);
// Memoize footer component to show skeleton loaders when loading more
+ // eslint-disable-next-line @eslint-react/no-nested-component-definitions
const Footer = useCallback(() => {
if (isLoadingMore && hasMore) return <ListViewSkeleton columnWidths={columnWidths} />;
diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx
index 2de2d0f88c0..0a03778f18f 100644
--- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx
+++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx
@@ -1,4 +1,4 @@
-import { Button, Flexbox, Tooltip, stopPropagation } from '@lobehub/ui';
+import { Button, Flexbox, stopPropagation, Tooltip } from '@lobehub/ui';
import { createStaticStyles, cx } from 'antd-style';
import { isNull } from 'es-toolkit/compat';
import { FileBoxIcon, Folder } from 'lucide-react';
diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx
index 85fec8259bb..4335102d1c9 100644
--- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx
+++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx
@@ -1,4 +1,4 @@
-import { Button, Flexbox, Tooltip, stopPropagation } from '@lobehub/ui';
+import { Button, Flexbox, stopPropagation, Tooltip } from '@lobehub/ui';
import { Image } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
import { isNull } from 'es-toolkit/compat';
diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx
index bade3eb31ca..8ff504df1e6 100644
--- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx
+++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx
@@ -1,4 +1,4 @@
-import { Button, Tooltip, stopPropagation } from '@lobehub/ui';
+import { Button, stopPropagation, Tooltip } from '@lobehub/ui';
import { createStaticStyles, cx } from 'antd-style';
import { isNull } from 'es-toolkit/compat';
import { FileBoxIcon } from 'lucide-react';
diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx
index 2c59fefe5e3..0f3f2e8ee13 100644
--- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx
+++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx
@@ -1,4 +1,4 @@
-import { Button, Tooltip, stopPropagation } from '@lobehub/ui';
+import { Button, stopPropagation, Tooltip } from '@lobehub/ui';
import { createStaticStyles, cx } from 'antd-style';
import { isNull } from 'es-toolkit/compat';
import { FileBoxIcon } from 'lucide-react';
@@ -90,6 +90,7 @@ const extractTitle = (content: string): string | null => {
if (!content) return null;
// Find first markdown header (# title)
+ // eslint-disable-next-line regexp/no-super-linear-backtracking
const match = content.match(/^#\s+(.+)$/m);
return match ? match[1].trim() : null;
};
diff --git a/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx b/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx
index df949b9d00c..7cc7b57041d 100644
--- a/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx
+++ b/src/features/ResourceManager/components/Explorer/SearchResultsOverlay.tsx
@@ -116,8 +116,8 @@ const SearchResultsOverlay = memo(() => {
<Flexbox height={'100%'}>
<div style={{ flex: 1, overflow: 'auto hidden' }}>
<Flexbox
- align="center"
horizontal
+ align="center"
paddingInline={8}
style={{
borderBlockEnd: `1px solid ${cssVar.colorBorderSecondary}`,
@@ -129,7 +129,7 @@ const SearchResultsOverlay = memo(() => {
}}
>
<Center height={40} style={{ paddingInline: 4 }}>
- <Checkbox checked={false} disabled />
+ <Checkbox disabled checked={false} />
</Center>
<Flexbox
justify="center"
@@ -174,6 +174,7 @@ const SearchResultsOverlay = memo(() => {
<Virtuoso
data={data}
defaultItemHeight={48}
+ style={{ height: '100%' }}
itemContent={(index, item) => {
if (!item) return null;
return (
@@ -195,7 +196,6 @@ const SearchResultsOverlay = memo(() => {
/>
);
}}
- style={{ height: '100%' }}
/>
</div>
</div>
diff --git a/src/features/ShareModal/ShareJSON/generateFullExport.ts b/src/features/ShareModal/ShareJSON/generateFullExport.ts
index e10c2d8f36a..3b4518ba1b8 100644
--- a/src/features/ShareModal/ShareJSON/generateFullExport.ts
+++ b/src/features/ShareModal/ShareJSON/generateFullExport.ts
@@ -23,7 +23,6 @@ export const generateFullExport = ({
const exportedMessages: Record<string, any>[] = messages
.filter((m) => m.content !== LOADING_FLAT)
.map((m) =>
- /* eslint-disable sort-keys-fix/sort-keys-fix */
cleanObject({
// Core fields
content: m.content,
diff --git a/src/features/SkillStore/SkillList/Community/Item.tsx b/src/features/SkillStore/SkillList/Community/Item.tsx
index 25ca7412e4e..122d9ab1ac8 100644
--- a/src/features/SkillStore/SkillList/Community/Item.tsx
+++ b/src/features/SkillStore/SkillList/Community/Item.tsx
@@ -139,7 +139,7 @@ const Item = memo<DiscoverMcpItem>(({ name, description, icon, identifier }) =>
>
<PluginAvatar avatar={icon} size={40} />
<Flexbox flex={1} gap={4} style={{ minWidth: 0, overflow: 'hidden' }}>
- <Flexbox align="center" gap={8} horizontal>
+ <Flexbox horizontal align="center" gap={8}>
<span className={styles.title}>{name}</span>
<MCPTag showText={false} />
</Flexbox>
diff --git a/src/features/SkillStore/SkillList/Custom/Item.tsx b/src/features/SkillStore/SkillList/Custom/Item.tsx
index 32e478903d3..e53cbd67e64 100644
--- a/src/features/SkillStore/SkillList/Custom/Item.tsx
+++ b/src/features/SkillStore/SkillList/Custom/Item.tsx
@@ -89,7 +89,7 @@ const Item = memo<ItemProps>(({ identifier, title, description, avatar }) => {
>
<PluginAvatar avatar={avatar} size={40} />
<Flexbox flex={1} gap={4} style={{ minWidth: 0, overflow: 'hidden' }}>
- <Flexbox align="center" gap={8} horizontal>
+ <Flexbox horizontal align="center" gap={8}>
<span className={styles.title} onClick={() => setDetailOpen(true)}>
{title || identifier}
</span>
diff --git a/src/helpers/parserPlaceholder/index.ts b/src/helpers/parserPlaceholder/index.ts
index 15fd61b7585..6e079b2968e 100644
--- a/src/helpers/parserPlaceholder/index.ts
+++ b/src/helpers/parserPlaceholder/index.ts
@@ -12,7 +12,6 @@ import { globalAgentContextManager } from '../GlobalAgentContextManager';
const placeholderVariablesRegex = /\{\{(.*?)\}\}/g;
-/* eslint-disable sort-keys-fix/sort-keys-fix */
export const VARIABLE_GENERATORS = {
/**
* Time-related template variables
diff --git a/src/hooks/useAgentOwnershipCheck.ts b/src/hooks/useAgentOwnershipCheck.ts
index e30cd5fc532..4e0d6d2ac3c 100644
--- a/src/hooks/useAgentOwnershipCheck.ts
+++ b/src/hooks/useAgentOwnershipCheck.ts
@@ -26,7 +26,7 @@ function getCurrentAccountId(marketAuth: MarketAuthContextType): string | number
// First try to get user info from marketAuth
const userInfo = marketAuth.getCurrentUserInfo?.();
if (userInfo?.accountId !== null) {
- console.log('[useAgentOwnershipCheck] User ID from userInfo:', userInfo?.accountId);
+ console.info('[useAgentOwnershipCheck] User ID from userInfo:', userInfo?.accountId);
return userInfo?.accountId ?? null;
}
@@ -34,7 +34,7 @@ function getCurrentAccountId(marketAuth: MarketAuthContextType): string | number
const userInfoData = sessionStorage.getItem('market_user_info');
if (userInfoData) {
const parsedUserInfo = JSON.parse(userInfoData);
- console.log(
+ console.info(
'[useAgentOwnershipCheck] User ID from sessionStorage:',
parsedUserInfo.accountId,
);
@@ -84,7 +84,7 @@ export const checkOwnership = async ({
const cacheKey = buildCacheKey(marketIdentifier, accountId);
const cached = agentOwnershipCache.get(cacheKey);
if (!skipCache && cached && Date.now() - cached.timestamp < CACHE_DURATION) {
- console.log('[checkOwnership] Using cached result:', cached.result);
+ console.info('[checkOwnership] Using cached result:', cached.result);
return cached.result;
}
@@ -94,7 +94,7 @@ export const checkOwnership = async ({
}
const agentDetail = await marketApiService.getAgentDetail(marketIdentifier);
- console.log('[checkOwnership] Agent detail:', agentDetail);
+ console.info('[checkOwnership] Agent detail:', agentDetail);
const isOwner = `${agentDetail?.ownerId ?? ''}` === `${accountId}`;
agentOwnershipCache.set(cacheKey, {
@@ -126,11 +126,11 @@ export const useAgentOwnershipCheck = (marketIdentifier?: string): AgentOwnershi
const runOwnershipCheck = async () => {
try {
- console.log('[useAgentOwnershipCheck] Checking ownership for:', marketIdentifier);
+ console.info('[useAgentOwnershipCheck] Checking ownership for:', marketIdentifier);
// Get current user ID
const currentAccountId = getCurrentAccountId(marketAuth);
- console.log('[useAgentOwnershipCheck] Current user ID:', currentAccountId);
+ console.info('[useAgentOwnershipCheck] Current user ID:', currentAccountId);
if (!currentAccountId) {
console.warn('[useAgentOwnershipCheck] Could not get current user ID');
diff --git a/src/hooks/useFetchAiVideoConfig.ts b/src/hooks/useFetchAiVideoConfig.ts
index 788cb3db4df..a51e5635ae5 100644
--- a/src/hooks/useFetchAiVideoConfig.ts
+++ b/src/hooks/useFetchAiVideoConfig.ts
@@ -3,13 +3,13 @@ import { useEffect, useMemo } from 'react';
import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra';
import { useGlobalStore } from '@/store/global';
import { systemStatusSelectors } from '@/store/global/selectors';
+import { useUserStore } from '@/store/user';
+import { authSelectors } from '@/store/user/selectors';
import { useVideoStore } from '@/store/video';
import {
DEFAULT_AI_VIDEO_MODEL,
DEFAULT_AI_VIDEO_PROVIDER,
} from '@/store/video/slices/generationConfig/initialState';
-import { useUserStore } from '@/store/user';
-import { authSelectors } from '@/store/user/selectors';
const checkModelEnabled = (
enabledVideoModelList: ReturnType<typeof aiProviderSelectors.enabledVideoModelList>,
diff --git a/src/hooks/useHotkeys/useHotkeyById.ts b/src/hooks/useHotkeys/useHotkeyById.ts
index d4162fe8ec2..d86d0a404b0 100644
--- a/src/hooks/useHotkeys/useHotkeyById.ts
+++ b/src/hooks/useHotkeys/useHotkeyById.ts
@@ -38,7 +38,7 @@ export const useHotkeyById = (
const ref = useHotkeys(
hotkey,
(...props) => {
- if (isDev) console.log('[Hotkey]', hotkeyId);
+ if (isDev) console.info('[Hotkey]', hotkeyId);
return callback(...props);
},
{
diff --git a/src/layout/AuthProvider/MarketAuth/oidc.ts b/src/layout/AuthProvider/MarketAuth/oidc.ts
index 77f85cb881e..24fba824a8d 100644
--- a/src/layout/AuthProvider/MarketAuth/oidc.ts
+++ b/src/layout/AuthProvider/MarketAuth/oidc.ts
@@ -24,7 +24,7 @@ export class MarketOIDC {
* 生成 PKCE code verifier
*/
private generateCodeVerifier(): string {
- console.log('[MarketOIDC] Generating PKCE code verifier');
+ console.info('[MarketOIDC] Generating PKCE code verifier');
const array = new Uint8Array(32);
crypto.getRandomValues(array);
return btoa(String.fromCharCode.apply(null, Array.from(array)))
@@ -37,7 +37,7 @@ export class MarketOIDC {
* 生成 PKCE code challenge
*/
private async generateCodeChallenge(codeVerifier: string): Promise<string> {
- console.log('[MarketOIDC] Generating PKCE code challenge');
+ console.info('[MarketOIDC] Generating PKCE code challenge');
const encoder = new TextEncoder();
const data = encoder.encode(codeVerifier);
const digest = await crypto.subtle.digest('SHA-256', data);
@@ -51,7 +51,7 @@ export class MarketOIDC {
* 生成随机 state
*/
private generateState(): string {
- console.log('[MarketOIDC] Generating random state');
+ console.info('[MarketOIDC] Generating random state');
const array = new Uint8Array(16);
crypto.getRandomValues(array);
return btoa(String.fromCharCode.apply(null, Array.from(array)))
@@ -64,7 +64,7 @@ export class MarketOIDC {
* 生成 PKCE 参数
*/
async generatePKCEParams(): Promise<PKCEParams> {
- console.log('[MarketOIDC] Generating PKCE parameters');
+ console.info('[MarketOIDC] Generating PKCE parameters');
const codeVerifier = this.generateCodeVerifier();
const codeChallenge = await this.generateCodeChallenge(codeVerifier);
const state = this.generateState();
@@ -73,7 +73,7 @@ export class MarketOIDC {
sessionStorage.setItem('market_code_verifier', codeVerifier);
sessionStorage.setItem('market_state', state);
- console.log('[MarketOIDC] PKCE parameters generated and stored');
+ console.info('[MarketOIDC] PKCE parameters generated and stored');
return {
codeChallenge,
codeVerifier,
@@ -85,10 +85,10 @@ export class MarketOIDC {
* 构建授权 URL
*/
async buildAuthUrl(): Promise<string> {
- console.log('[MarketOIDC] Building authorization URL');
+ console.info('[MarketOIDC] Building authorization URL');
const pkceParams = await this.generatePKCEParams();
- console.log('[MarketOIDC] this.config:', this.config);
+ console.info('[MarketOIDC] this.config:', this.config);
const authUrl = new URL(MARKET_OIDC_ENDPOINTS.auth, this.config.baseUrl);
authUrl.searchParams.set('client_id', this.config.clientId);
@@ -99,7 +99,7 @@ export class MarketOIDC {
authUrl.searchParams.set('code_challenge', pkceParams.codeChallenge);
authUrl.searchParams.set('code_challenge_method', 'S256');
- console.log('[MarketOIDC] Authorization URL built:', authUrl.toString());
+ console.info('[MarketOIDC] Authorization URL built:', authUrl.toString());
return authUrl.toString();
}
@@ -107,7 +107,7 @@ export class MarketOIDC {
* 用授权码换取访问令牌
*/
async exchangeCodeForToken(code: string, state: string): Promise<TokenResponse> {
- console.log('[MarketOIDC] Exchanging authorization code for token');
+ console.info('[MarketOIDC] Exchanging authorization code for token');
// 验证 state 参数
const storedState = sessionStorage.getItem('market_state');
@@ -155,7 +155,7 @@ export class MarketOIDC {
}
const tokenData = (await response.json()) as TokenResponse;
- console.log('[MarketOIDC] Token exchange successful');
+ console.info('[MarketOIDC] Token exchange successful');
// 清理 sessionStorage 中的临时数据
sessionStorage.removeItem('market_code_verifier');
@@ -188,7 +188,7 @@ export class MarketOIDC {
let popup: Window | null = null;
if (isDesktop) {
// Electron 桌面端:使用 IPC 调用主进程打开系统浏览器
- console.log('[MarketOIDC] Desktop app detected, opening system browser via IPC');
+ console.info('[MarketOIDC] Desktop app detected, opening system browser via IPC');
const { remoteServerService } = await import('@/services/electron/remoteServer');
try {
@@ -200,7 +200,7 @@ export class MarketOIDC {
meta: { error: result.error },
});
}
- console.log('[MarketOIDC] System browser opened successfully');
+ console.info('[MarketOIDC] System browser opened successfully');
} catch (error) {
console.error('[MarketOIDC] Exception opening system browser:', error);
throw new MarketAuthError('openBrowserFailed', {
@@ -229,18 +229,9 @@ export class MarketOIDC {
return new Promise((resolve, reject) => {
let checkClosed: number | undefined;
- // 先声明,后定义,避免相互“定义前使用”
- let messageHandler: (event: MessageEvent) => void;
-
- // 清理函数
- function cleanup() {
- window.removeEventListener('message', messageHandler);
- if (checkClosed) clearInterval(checkClosed);
- }
-
// 监听消息事件,等待授权完成
- messageHandler = (event: MessageEvent) => {
- console.log('[MarketOIDC] Received message from popup:', event.data);
+ const messageHandler = (event: MessageEvent) => {
+ console.info('[MarketOIDC] Received message from popup:', event.data);
if (event.data.type === 'MARKET_AUTH_SUCCESS') {
cleanup();
@@ -263,6 +254,12 @@ export class MarketOIDC {
}
};
+ // 清理函数
+ function cleanup() {
+ window.removeEventListener('message', messageHandler);
+ if (checkClosed) clearInterval(checkClosed);
+ }
+
window.addEventListener('message', messageHandler);
// 检查弹窗是否被关闭
@@ -283,7 +280,7 @@ export class MarketOIDC {
* 轮询 handoff 接口获取桌面端授权结果
*/
private async pollDesktopHandoff(state: string): Promise<{ code: string; state: string }> {
- console.log('[MarketOIDC] Starting desktop handoff polling with state:', state);
+ console.info('[MarketOIDC] Starting desktop handoff polling with state:', state);
const startTime = Date.now();
@@ -291,7 +288,7 @@ export class MarketOIDC {
state,
)}&client=${encodeURIComponent(MarketOIDC.DESKTOP_HANDOFF_CLIENT)}`;
- console.log('[MarketOIDC] Poll URL:', pollUrl);
+ console.info('[MarketOIDC] Poll URL:', pollUrl);
while (Date.now() - startTime < MarketOIDC.DESKTOP_HANDOFF_TIMEOUT) {
try {
@@ -302,14 +299,14 @@ export class MarketOIDC {
const data = await response.json().catch(() => undefined);
- console.log('[MarketOIDC] Poll response:', response.status, data);
+ console.info('[MarketOIDC] Poll response:', response.status, data);
if (
response.status === 200 &&
data?.status === 'success' &&
typeof data?.code === 'string'
) {
- console.log('[MarketOIDC] Desktop handoff succeeded');
+ console.info('[MarketOIDC] Desktop handoff succeeded');
return {
code: data.code,
state,
diff --git a/src/libs/better-auth/define-config.ts b/src/libs/better-auth/define-config.ts
index c9d71e93ca5..80c9b2e57c2 100644
--- a/src/libs/better-auth/define-config.ts
+++ b/src/libs/better-auth/define-config.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import { expo } from '@better-auth/expo';
import { passkey } from '@better-auth/passkey';
import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const';
diff --git a/src/libs/better-auth/sso/index.ts b/src/libs/better-auth/sso/index.ts
index 36d120f0f6c..84eb425fa1c 100644
--- a/src/libs/better-auth/sso/index.ts
+++ b/src/libs/better-auth/sso/index.ts
@@ -114,6 +114,6 @@ export const initBetterAuthSSOProviders = () => {
return {
genericOAuthProviders,
- socialProviders: socialProviders,
+ socialProviders,
};
};
diff --git a/src/libs/langchain/loaders/epub/index.ts b/src/libs/langchain/loaders/epub/index.ts
index e4a9ac12b7d..524f053c55e 100644
--- a/src/libs/langchain/loaders/epub/index.ts
+++ b/src/libs/langchain/loaders/epub/index.ts
@@ -17,7 +17,7 @@ export const EPubLoader = async (content: Uint8Array) => {
const splitter = new RecursiveCharacterTextSplitter(loaderConfig);
return await splitter.splitDocuments(documents);
} catch (e) {
- throw new Error(`EPubLoader error: ${(e as Error).message}`);
+ throw new Error(`EPubLoader error: ${(e as Error).message}`, { cause: e });
} finally {
tempManager.cleanup(); // Ensure cleanup
}
diff --git a/src/libs/mcp/client.ts b/src/libs/mcp/client.ts
index 301917ac7be..feabe411fa7 100644
--- a/src/libs/mcp/client.ts
+++ b/src/libs/mcp/client.ts
@@ -322,7 +322,7 @@ export class MCPClient {
console.error('Listed tools error: %O', e);
if ((e as Error).message.includes('No valid session ID provided')) {
- throw new Error('NoValidSessionId');
+ throw new Error('NoValidSessionId', { cause: e });
}
return [];
diff --git a/src/libs/next/navigation.ts b/src/libs/next/navigation.ts
index 33b1d5c1bcc..0b516bba71c 100644
--- a/src/libs/next/navigation.ts
+++ b/src/libs/next/navigation.ts
@@ -6,8 +6,8 @@
export {
notFound,
- redirect,
type ReadonlyURLSearchParams,
+ redirect,
useParams,
usePathname,
useRouter,
diff --git a/src/libs/oidc-provider/http-adapter.ts b/src/libs/oidc-provider/http-adapter.ts
index c89dd00cdec..eea317b86bd 100644
--- a/src/libs/oidc-provider/http-adapter.ts
+++ b/src/libs/oidc-provider/http-adapter.ts
@@ -86,8 +86,7 @@ export const createNodeRequest = async (req: NextRequest): Promise<IncomingMessa
method: req.method,
// Simulate readable stream behavior (oidc-provider might not rely on this if body is pre-parsed)
- // eslint-disable-next-line @typescript-eslint/ban-types
- on: (event: string, handler: Function) => {
+ on: (event: string, handler: (...args: any[]) => any) => {
if (event === 'end') {
// Simulate end immediately as body is already processed or will be attached
handler();
@@ -287,7 +286,7 @@ export const createContextForInteractionDetails = async (
has: (name: string) => cookieStore.has(name),
},
geo: {},
- headers: headers,
+ headers,
ip: '127.0.0.1',
method: 'GET',
nextUrl: new URL(interactionUrl),
diff --git a/src/libs/oidc-provider/jwt.ts b/src/libs/oidc-provider/jwt.ts
index ae3ef719e47..3119fc91671 100644
--- a/src/libs/oidc-provider/jwt.ts
+++ b/src/libs/oidc-provider/jwt.ts
@@ -44,7 +44,7 @@ export const getJWKS = (): object => {
return jwks;
} catch (error) {
console.error('解析 JWKS 失败:', error);
- throw new Error(`JWKS_KEY 解析错误: ${(error as Error).message}`);
+ throw new Error(`JWKS_KEY 解析错误: ${(error as Error).message}`, { cause: error });
}
};
@@ -89,7 +89,7 @@ const getVerificationKey = async () => {
return await importJWK(publicKeyJwk, 'RS256');
} catch (error) {
log('获取 JWKS 公钥失败: %O', error);
- throw new Error(`JWKS_KEY 公钥获取失败: ${(error as Error).message}`);
+ throw new Error(`JWKS_KEY 公钥获取失败: ${(error as Error).message}`, { cause: error });
}
};
@@ -130,7 +130,7 @@ export const validateOIDCJWT = async (token: string) => {
clientId,
payload,
tokenData: {
- aud: aud,
+ aud,
client_id: clientId,
exp: payload.exp,
iat: payload.iat,
diff --git a/src/libs/swr/localStorageProvider.ts b/src/libs/swr/localStorageProvider.ts
index 42ea2dc0caa..0edac3243dd 100644
--- a/src/libs/swr/localStorageProvider.ts
+++ b/src/libs/swr/localStorageProvider.ts
@@ -256,7 +256,7 @@ export function clearSWRCache(cacheKey = 'lobechat-swr-cache'): void {
try {
localStorage.removeItem(cacheKey);
- console.log('[SWR Cache] Cache cleared');
+ console.info('[SWR Cache] Cache cleared');
} catch (error) {
console.error('[SWR Cache] Failed to clear cache:', error);
}
diff --git a/src/libs/traces/index.ts b/src/libs/traces/index.ts
index cc813e8d5a7..f131f2ee1f8 100644
--- a/src/libs/traces/index.ts
+++ b/src/libs/traces/index.ts
@@ -19,7 +19,7 @@ export class TraceClient {
// when enabled langfuse, make sure the key are ready in envs
if (!LANGFUSE_PUBLIC_KEY || !LANGFUSE_SECRET_KEY) {
- console.log('-----');
+ console.info('-----');
console.error(
"You are enabling langfuse but don't set the `LANGFUSE_PUBLIC_KEY` or `LANGFUSE_SECRET_KEY`. Please check your env",
);
diff --git a/src/libs/trpc/lambda/context.ts b/src/libs/trpc/lambda/context.ts
index fd9a6cf2ed7..dc6082fa716 100644
--- a/src/libs/trpc/lambda/context.ts
+++ b/src/libs/trpc/lambda/context.ts
@@ -118,7 +118,7 @@ export const createLambdaContext = async (request: NextRequest): Promise<LambdaC
log('LobeChat Authorization header: %s', authorization ? 'exists' : 'not found');
let userId;
- let oidcAuth = null;
+ let oidcAuth;
// Prioritize checking for OIDC authentication (both standard Authorization and custom Oidc-Auth headers)
if (authEnv.ENABLE_OIDC) {
diff --git a/src/locales/default/index.ts b/src/locales/default/index.ts
index 41e669221b5..acd1ff28609 100644
--- a/src/locales/default/index.ts
+++ b/src/locales/default/index.ts
@@ -9,9 +9,9 @@ import components from './components';
import desktopOnboarding from './desktop-onboarding';
import discover from './discover';
import editor from './editor';
-import eval_ from './eval';
import electron from './electron';
import error from './error';
+import eval_ from './eval';
import file from './file';
import home from './home';
import hotkey from './hotkey';
@@ -53,7 +53,7 @@ const resources = {
'desktop-onboarding': desktopOnboarding,
discover,
editor,
- eval: eval_,
+ 'eval': eval_,
electron,
error,
file,
diff --git a/src/locales/default/welcome.ts b/src/locales/default/welcome.ts
index fcd6902069a..0c78be7ca42 100644
--- a/src/locales/default/welcome.ts
+++ b/src/locales/default/welcome.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
export default {
'guide.agents.replaceBtn': 'Refresh',
'guide.agents.title': 'New Agent Recommendations:',
diff --git a/src/server/manifest.ts b/src/server/manifest.ts
index 1c6869db596..432df74d822 100644
--- a/src/server/manifest.ts
+++ b/src/server/manifest.ts
@@ -40,7 +40,7 @@ export class Manifest {
background_color: color,
cache_busting_mode: 'all',
categories: ['productivity', 'design', 'development', 'education'],
- description: description,
+ description,
display: 'standalone',
display_override: ['tabbed'],
edge_side_panel: {
@@ -48,10 +48,10 @@ export class Manifest {
},
handle_links: 'auto',
icons: icons.map((item) => this._getIcon(item)),
- id: id,
+ id,
immutable: 'true',
max_age: MAX_AGE,
- name: name,
+ name,
orientation: 'portrait',
related_applications: [
{
diff --git a/src/server/modules/GitHub/index.test.ts b/src/server/modules/GitHub/index.test.ts
index 90f7ef23634..8ff5481ca2d 100644
--- a/src/server/modules/GitHub/index.test.ts
+++ b/src/server/modules/GitHub/index.test.ts
@@ -3,10 +3,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import {
GitHub,
+ github,
GitHubDownloadError,
GitHubNotFoundError,
GitHubParseError,
- github,
} from './index';
describe('GitHub', () => {
diff --git a/src/server/modules/KeyVaultsEncrypt/index.ts b/src/server/modules/KeyVaultsEncrypt/index.ts
index bcc1d55a978..496014aeecc 100644
--- a/src/server/modules/KeyVaultsEncrypt/index.ts
+++ b/src/server/modules/KeyVaultsEncrypt/index.ts
@@ -41,7 +41,7 @@ If you don't have it, please run \`openssl rand -base64 32\` to create one.
const encryptedData = await crypto.subtle.encrypt(
{
- iv: iv,
+ iv,
name: 'AES-GCM',
},
this.aesKey,
@@ -72,7 +72,7 @@ If you don't have it, please run \`openssl rand -base64 32\` to create one.
try {
const decryptedBuffer = await crypto.subtle.decrypt(
{
- iv: iv,
+ iv,
name: 'AES-GCM',
},
this.aesKey,
diff --git a/src/server/modules/Mecha/ContextEngineering/types.ts b/src/server/modules/Mecha/ContextEngineering/types.ts
index f5e43964730..778e98e1b45 100644
--- a/src/server/modules/Mecha/ContextEngineering/types.ts
+++ b/src/server/modules/Mecha/ContextEngineering/types.ts
@@ -118,8 +118,8 @@ export interface ServerMessagesEngineParams {
export {
type AgentBuilderContext,
- type EvalContext,
type AgentManagementContext,
+ type EvalContext,
type FileContent,
type KnowledgeBaseInfo,
type UserMemoryData,
diff --git a/src/server/modules/ModelRuntime/apiKeyManager.test.ts b/src/server/modules/ModelRuntime/apiKeyManager.test.ts
index 0462c5d8f6d..b54dd19e9de 100644
--- a/src/server/modules/ModelRuntime/apiKeyManager.test.ts
+++ b/src/server/modules/ModelRuntime/apiKeyManager.test.ts
@@ -5,7 +5,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
import { ApiKeyManager } from './apiKeyManager';
function generateKeys(count: number = 1) {
- return new Array(count)
+ return Array.from({ length: count })
.fill('')
.map(() => {
return `sk-${nanoid()}`;
diff --git a/src/server/modules/ModelRuntime/trace.ts b/src/server/modules/ModelRuntime/trace.ts
index 3a92adecf47..3b01f799182 100644
--- a/src/server/modules/ModelRuntime/trace.ts
+++ b/src/server/modules/ModelRuntime/trace.ts
@@ -105,6 +105,6 @@ export const createTraceOptions = (
});
},
} as ChatStreamCallbacks,
- headers: headers,
+ headers,
};
};
diff --git a/src/server/modules/S3/index.ts b/src/server/modules/S3/index.ts
index 887a2cc5234..b55679b38c3 100644
--- a/src/server/modules/S3/index.ts
+++ b/src/server/modules/S3/index.ts
@@ -7,9 +7,8 @@ import {
S3Client,
} from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
-import { z } from 'zod';
-
import mime from 'mime';
+import { z } from 'zod';
import { fileEnv } from '@/envs/file';
import { YEAR } from '@/utils/units';
@@ -53,10 +52,10 @@ export class S3 {
this.client = new S3Client({
credentials: {
- accessKeyId: accessKeyId,
- secretAccessKey: secretAccessKey,
+ accessKeyId,
+ secretAccessKey,
},
- endpoint: endpoint,
+ endpoint,
forcePathStyle: options?.forcePathStyle,
region: options?.region || DEFAULT_S3_REGION,
// refs: https://github.com/lobehub/lobe-chat/pull/5479
diff --git a/src/server/routers/async/image.ts b/src/server/routers/async/image.ts
index f1baccb544a..3e3823386f9 100644
--- a/src/server/routers/async/image.ts
+++ b/src/server/routers/async/image.ts
@@ -380,7 +380,6 @@ export const imageRouter = router({
// Clean up timeout timer
if (timeoutId) {
clearTimeout(timeoutId);
- timeoutId = null;
}
log('Async image generation failed: %O', {
diff --git a/src/server/routers/lambda/__tests__/integration/aiAgent.createClientGroupAgentTaskThread.integration.test.ts b/src/server/routers/lambda/__tests__/integration/aiAgent.createClientGroupAgentTaskThread.integration.test.ts
index e29016511dd..abecf18501d 100644
--- a/src/server/routers/lambda/__tests__/integration/aiAgent.createClientGroupAgentTaskThread.integration.test.ts
+++ b/src/server/routers/lambda/__tests__/integration/aiAgent.createClientGroupAgentTaskThread.integration.test.ts
@@ -398,7 +398,9 @@ describe('createClientGroupAgentTaskThread Integration', () => {
expect(thread.metadata?.startedAt).toBeDefined();
expect(result.startedAt).toBe(thread.metadata?.startedAt);
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
expect(thread.metadata?.startedAt! >= beforeCall).toBe(true);
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
expect(thread.metadata?.startedAt! <= afterCall).toBe(true);
});
});
diff --git a/src/server/routers/lambda/__tests__/integration/aiAgent.createClientTaskThread.integration.test.ts b/src/server/routers/lambda/__tests__/integration/aiAgent.createClientTaskThread.integration.test.ts
index 894988d8082..156b4d2bcd6 100644
--- a/src/server/routers/lambda/__tests__/integration/aiAgent.createClientTaskThread.integration.test.ts
+++ b/src/server/routers/lambda/__tests__/integration/aiAgent.createClientTaskThread.integration.test.ts
@@ -431,7 +431,9 @@ describe('createClientTaskThread Integration', () => {
expect(result.startedAt).toBe(thread.metadata?.startedAt);
// Verify timestamp is within the call window
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
expect(thread.metadata?.startedAt! >= beforeCall).toBe(true);
+ // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
expect(thread.metadata?.startedAt! <= afterCall).toBe(true);
});
});
diff --git a/src/server/routers/lambda/__tests__/integration/message.integration.test.ts b/src/server/routers/lambda/__tests__/integration/message.integration.test.ts
index d4821edfacb..c1c5ddb3f86 100644
--- a/src/server/routers/lambda/__tests__/integration/message.integration.test.ts
+++ b/src/server/routers/lambda/__tests__/integration/message.integration.test.ts
@@ -110,7 +110,7 @@ describe('Message Router Integration Tests', () => {
id: result.id,
agentId: testAgentId, // sessionId 会解析为 agentId 存储
topicId: testTopicId,
- userId: userId,
+ userId,
content: 'Test message',
role: 'user',
});
diff --git a/src/server/routers/lambda/agent.ts b/src/server/routers/lambda/agent.ts
index 4057a50716c..0ad5cad4d7d 100644
--- a/src/server/routers/lambda/agent.ts
+++ b/src/server/routers/lambda/agent.ts
@@ -212,7 +212,7 @@ export const agentRouter = router({
if (!user) return DEFAULT_AGENT_CONFIG;
const res = await ctx.agentService.createInbox();
- console.log('create inbox session', res);
+ console.info('create inbox session', res);
}
}
diff --git a/src/server/routers/lambda/agentSkills.ts b/src/server/routers/lambda/agentSkills.ts
index 36516640b0b..916022023f1 100644
--- a/src/server/routers/lambda/agentSkills.ts
+++ b/src/server/routers/lambda/agentSkills.ts
@@ -1,4 +1,5 @@
-import { SkillManifest, skillManifestSchema } from '@lobechat/types';
+import type { SkillManifest } from '@lobechat/types';
+import { skillManifestSchema } from '@lobechat/types';
import { TRPCError } from '@trpc/server';
import { z } from 'zod';
@@ -9,8 +10,8 @@ import { serverDatabase } from '@/libs/trpc/lambda/middleware';
import { FileService } from '@/server/services/file';
import { MarketService } from '@/server/services/market';
import {
- SkillImportError,
SkillImporter,
+ SkillImportError,
SkillResourceError,
SkillResourceService,
} from '@/server/services/skill';
diff --git a/src/server/routers/lambda/aiChat.ts b/src/server/routers/lambda/aiChat.ts
index 57bfcdbe792..f0c1bee33b6 100644
--- a/src/server/routers/lambda/aiChat.ts
+++ b/src/server/routers/lambda/aiChat.ts
@@ -69,7 +69,6 @@ export const aiChatRouter = router({
if (!!context.sessionId) sessionId = context.sessionId;
}
- let messageId: string;
let topicId = input.topicId!;
let threadId = input.threadId;
let createdThreadId: string | undefined;
@@ -139,7 +138,7 @@ export const aiChatRouter = router({
topicId,
});
- messageId = userMessageItem.id;
+ const messageId = userMessageItem.id;
log('user message created with id: %s', messageId);
// create assistant message
diff --git a/src/server/routers/lambda/chunk.ts b/src/server/routers/lambda/chunk.ts
index 67965da63b0..9ab9ef38aff 100644
--- a/src/server/routers/lambda/chunk.ts
+++ b/src/server/routers/lambda/chunk.ts
@@ -245,8 +245,6 @@ export const chunkRouter = router({
try {
const { model, provider } =
getServerDefaultFilesConfig().embeddingModel || DEFAULT_FILE_EMBEDDING_MODEL_ITEM;
- let embedding: number[];
-
// Read user's provider config from database
const modelRuntime = await initModelRuntimeFromDB(ctx.serverDB, ctx.userId, provider);
@@ -259,7 +257,7 @@ export const chunkRouter = router({
model,
});
- embedding = embeddings![0];
+ const embedding = embeddings![0];
let finalFileIds = input.fileIds ?? [];
diff --git a/src/server/routers/lambda/index.ts b/src/server/routers/lambda/index.ts
index 2e39a99a5fb..2ae3401a165 100644
--- a/src/server/routers/lambda/index.ts
+++ b/src/server/routers/lambda/index.ts
@@ -95,13 +95,11 @@ export const lambdaRouter = router({
userMemories: userMemoriesRouter,
userMemory: userMemoryRouter,
video: videoRouter,
- /* eslint-disable sort-keys-fix/sort-keys-fix */
accountDeletion: accountDeletionRouter,
referral: referralRouter,
spend: spendRouter,
subscription: subscriptionRouter,
topUp: topUpRouter,
- /* eslint-enable sort-keys-fix/sort-keys-fix */
});
export type LambdaRouter = typeof lambdaRouter;
diff --git a/src/server/routers/lambda/knowledge.ts b/src/server/routers/lambda/knowledge.ts
index 202418864fa..4b9f39bede4 100644
--- a/src/server/routers/lambda/knowledge.ts
+++ b/src/server/routers/lambda/knowledge.ts
@@ -78,7 +78,7 @@ export const knowledgeRouter = router({
embeddingStatus: null,
finishEmbedding: false,
} as FileListItem;
- console.log('[API getKnowledgeItems] Processing document:', {
+ console.info('[API getKnowledgeItems] Processing document:', {
editorDataPreview: item.editorData ? JSON.stringify(item.editorData).slice(0, 100) : null,
hasEditorData: !!item.editorData,
id: item.id,
diff --git a/src/server/routers/lambda/ragEval.ts b/src/server/routers/lambda/ragEval.ts
index 2597f8ac46c..d4088eed3f7 100644
--- a/src/server/routers/lambda/ragEval.ts
+++ b/src/server/routers/lambda/ragEval.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix */
import {
type EvalDatasetRecord,
type InsertEvalDatasetRecord,
diff --git a/src/server/routers/lambda/sessionGroup.ts b/src/server/routers/lambda/sessionGroup.ts
index 93284d54b39..059e315f5df 100644
--- a/src/server/routers/lambda/sessionGroup.ts
+++ b/src/server/routers/lambda/sessionGroup.ts
@@ -69,7 +69,7 @@ export const sessionGroupRouter = router({
}),
)
.mutation(async ({ input, ctx }) => {
- console.log('sortMap:', input.sortMap);
+ console.info('sortMap:', input.sortMap);
return ctx.sessionGroupModel.updateOrder(input.sortMap);
}),
diff --git a/src/server/routers/lambda/user.ts b/src/server/routers/lambda/user.ts
index 4ee23c1705f..1ac564446f3 100644
--- a/src/server/routers/lambda/user.ts
+++ b/src/server/routers/lambda/user.ts
@@ -165,6 +165,7 @@ export const userRouter = router({
} catch (error) {
throw new Error(
'Error uploading avatar: ' + (error instanceof Error ? error.message : String(error)),
+ { cause: error },
);
}
}
diff --git a/src/server/routers/tools/_helpers/scheduleToolCallReport.test.ts b/src/server/routers/tools/_helpers/scheduleToolCallReport.test.ts
index c2402122d6b..eb5a6f75b15 100644
--- a/src/server/routers/tools/_helpers/scheduleToolCallReport.test.ts
+++ b/src/server/routers/tools/_helpers/scheduleToolCallReport.test.ts
@@ -6,8 +6,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { DiscoverService } from '@/server/services/discover';
import {
- type ScheduleToolCallReportParams,
scheduleToolCallReport,
+ type ScheduleToolCallReportParams,
} from './scheduleToolCallReport';
// Mock Next.js after() function
diff --git a/src/server/routers/tools/mcp.ts b/src/server/routers/tools/mcp.ts
index 9e01c039ffb..150eda9e102 100644
--- a/src/server/routers/tools/mcp.ts
+++ b/src/server/routers/tools/mcp.ts
@@ -86,7 +86,6 @@ export const mcpRouter = router({
input.headers,
);
}),
- /* eslint-disable sort-keys-fix/sort-keys-fix */
// --- MCP Interaction ---
// listTools now accepts MCPClientParams directly
listTools: mcpProcedure
diff --git a/src/server/services/chunk/index.ts b/src/server/services/chunk/index.ts
index 10434df8f30..6c2b4a5333d 100644
--- a/src/server/services/chunk/index.ts
+++ b/src/server/services/chunk/index.ts
@@ -88,7 +88,7 @@ export class ChunkService {
const asyncCaller = await createAsyncCaller({ userId: this.userId });
// trigger parse file task asynchronously
- asyncCaller.file.parseFileToChunks({ fileId: fileId, taskId: asyncTaskId }).catch(async (e) => {
+ asyncCaller.file.parseFileToChunks({ fileId, taskId: asyncTaskId }).catch(async (e) => {
console.error('[ParseFileToChunks] error:', e);
await this.asyncTaskModel.update(asyncTaskId, {
diff --git a/src/server/services/comfyui/config/fluxModelRegistry.ts b/src/server/services/comfyui/config/fluxModelRegistry.ts
index d0ae9918c67..4f2c2547369 100644
--- a/src/server/services/comfyui/config/fluxModelRegistry.ts
+++ b/src/server/services/comfyui/config/fluxModelRegistry.ts
@@ -4,7 +4,6 @@
*/
import { type ModelConfig } from './modelRegistry';
-/* eslint-disable sort-keys-fix/sort-keys-fix */
export const FLUX_MODEL_REGISTRY: Record<string, ModelConfig> = {
// === Priority 1: Official Models (4 models) ===
'flux1-dev.safetensors': {
@@ -840,4 +839,3 @@ export const FLUX_MODEL_REGISTRY: Record<string, ModelConfig> = {
recommendedDtype: 'default',
},
};
-/* eslint-enable sort-keys-fix/sort-keys-fix */
diff --git a/src/server/services/comfyui/config/modelRegistry.ts b/src/server/services/comfyui/config/modelRegistry.ts
index 80e61d3c865..68739481ddd 100644
--- a/src/server/services/comfyui/config/modelRegistry.ts
+++ b/src/server/services/comfyui/config/modelRegistry.ts
@@ -26,7 +26,6 @@ export const MODEL_REGISTRY: Record<string, ModelConfig> = {
* Maps actual frontend model IDs to their corresponding variants in registry
* Based on src/config/aiModels/comfyui.ts definitions
*/
-/* eslint-disable sort-keys-fix/sort-keys-fix */
export const MODEL_ID_VARIANT_MAP: Record<string, string> = {
// FLUX models
'flux-schnell': 'schnell', // comfyui/flux-schnell
@@ -45,4 +44,3 @@ export const MODEL_ID_VARIANT_MAP: Record<string, string> = {
'stable-diffusion-custom': 'custom-sd', // comfyui/stable-diffusion-custom
'stable-diffusion-custom-refiner': 'custom-sd', // comfyui/stable-diffusion-custom-refiner
};
-/* eslint-enable sort-keys-fix/sort-keys-fix */
diff --git a/src/server/services/comfyui/config/promptToolConst.ts b/src/server/services/comfyui/config/promptToolConst.ts
index 3d4af6a2922..3b60fc78f67 100644
--- a/src/server/services/comfyui/config/promptToolConst.ts
+++ b/src/server/services/comfyui/config/promptToolConst.ts
@@ -8,7 +8,6 @@
* Style keyword configuration - organized by category for easy maintenance and extension
*/
-/* eslint-disable sort-keys-fix/sort-keys-fix */
export const STYLE_KEYWORDS = {
// Artists and platforms
ARTISTS: [
@@ -571,8 +570,6 @@ export const STYLE_ADJECTIVE_PATTERNS = {
/^(professional|amateur|masterful|skilled|expert|novice|polished|raw|finished|unfinished|complete|incomplete|refined|rough)$/i,
} as const;
-/* eslint-enable sort-keys-fix/sort-keys-fix */
-
/**
* Get all style keywords as a flattened array
* Get all style keywords as a flattened array
diff --git a/src/server/services/comfyui/config/sdModelRegistry.ts b/src/server/services/comfyui/config/sdModelRegistry.ts
index df4d40d8abb..86b76abe717 100644
--- a/src/server/services/comfyui/config/sdModelRegistry.ts
+++ b/src/server/services/comfyui/config/sdModelRegistry.ts
@@ -4,7 +4,6 @@
*/
import { type ModelConfig } from './modelRegistry';
-/* eslint-disable sort-keys-fix/sort-keys-fix */
export const SD_MODEL_REGISTRY: Record<string, ModelConfig> = {
// ===================================================================
// SD3.5 Model Family Registry
@@ -505,4 +504,3 @@ export const SD_MODEL_REGISTRY: Record<string, ModelConfig> = {
modelFamily: 'SDXL',
},
};
-/* eslint-enable sort-keys-fix/sort-keys-fix */
diff --git a/src/server/services/comfyui/config/systemComponents.ts b/src/server/services/comfyui/config/systemComponents.ts
index a775e3c8288..ec47c9d81c1 100644
--- a/src/server/services/comfyui/config/systemComponents.ts
+++ b/src/server/services/comfyui/config/systemComponents.ts
@@ -44,7 +44,6 @@ export const CONTROLNET_TYPES = {
SEMANTIC: 'semantic',
} as const;
-/* eslint-disable sort-keys-fix/sort-keys-fix */
export const SYSTEM_COMPONENTS: Record<string, ComponentConfig> = {
// ===================================================================
// === ESSENTIAL COMPONENTS (Priority 1) ===
@@ -336,7 +335,6 @@ export const SYSTEM_COMPONENTS: Record<string, ComponentConfig> = {
type: 'controlnet',
},
} as const;
-/* eslint-enable sort-keys-fix/sort-keys-fix */
/**
* Get all components with names matching filters
diff --git a/src/server/services/comfyui/config/workflowRegistry.ts b/src/server/services/comfyui/config/workflowRegistry.ts
index 52219c626b4..60efccb9641 100644
--- a/src/server/services/comfyui/config/workflowRegistry.ts
+++ b/src/server/services/comfyui/config/workflowRegistry.ts
@@ -19,7 +19,6 @@ type WorkflowBuilder = (
* Variant to Workflow mapping
* Based on actual model registry variant values
*/
-/* eslint-disable sort-keys-fix/sort-keys-fix */
export const VARIANT_WORKFLOW_MAP: Record<string, WorkflowBuilder> = {
// FLUX variants
'dev': buildFluxDevWorkflow,
@@ -47,7 +46,6 @@ export const ARCHITECTURE_DEFAULT_MAP: Record<string, WorkflowBuilder> = {
SD1: buildSimpleSDWorkflow,
SDXL: buildSimpleSDWorkflow,
};
-/* eslint-enable sort-keys-fix/sort-keys-fix */
/**
* Get the appropriate workflow builder for a given architecture and variant
diff --git a/src/server/services/comfyui/core/errorHandlerService.ts b/src/server/services/comfyui/core/errorHandlerService.ts
index ab396272ca3..85aa23f3566 100644
--- a/src/server/services/comfyui/core/errorHandlerService.ts
+++ b/src/server/services/comfyui/core/errorHandlerService.ts
@@ -71,6 +71,7 @@ function extractMissingFileInfo(message: string): {
if (!message) return null;
// Check for "Expected one of:" pattern from enhanced model errors
+ // eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/no-dupe-disjunctions
const expectedPattern = /expected one of:\s*([^.]+\.(?:safetensors|ckpt|pt|pth))/i;
const expectedMatch = message.match(expectedPattern);
diff --git a/src/server/services/comfyui/errors/configError.ts b/src/server/services/comfyui/errors/configError.ts
index 12f73491b0e..b639293e382 100644
--- a/src/server/services/comfyui/errors/configError.ts
+++ b/src/server/services/comfyui/errors/configError.ts
@@ -15,12 +15,10 @@ export class ConfigError extends ComfyUIInternalError {
this.name = 'ConfigError';
}
- /* eslint-disable sort-keys-fix/sort-keys-fix */
static readonly Reasons = {
CONFIG_PARSE_ERROR: 'CONFIG_PARSE_ERROR',
INVALID_CONFIG: 'INVALID_CONFIG',
MISSING_CONFIG: 'MISSING_CONFIG',
REGISTRY_ERROR: 'REGISTRY_ERROR',
} as const;
- /* eslint-enable sort-keys-fix/sort-keys-fix */
}
diff --git a/src/server/services/comfyui/errors/modelResolverError.ts b/src/server/services/comfyui/errors/modelResolverError.ts
index 3d73b26ffa8..a2eac62140e 100644
--- a/src/server/services/comfyui/errors/modelResolverError.ts
+++ b/src/server/services/comfyui/errors/modelResolverError.ts
@@ -27,7 +27,6 @@ export class ModelResolverError extends Error {
}
}
- /* eslint-disable sort-keys-fix/sort-keys-fix */
static readonly Reasons = {
COMPONENT_NOT_FOUND: 'COMPONENT_NOT_FOUND',
CONNECTION_ERROR: 'CONNECTION_ERROR',
@@ -38,5 +37,4 @@ export class ModelResolverError extends Error {
PERMISSION_DENIED: 'PERMISSION_DENIED',
SERVICE_UNAVAILABLE: 'SERVICE_UNAVAILABLE',
} as const;
- /* eslint-enable sort-keys-fix/sort-keys-fix */
}
diff --git a/src/server/services/comfyui/errors/servicesError.ts b/src/server/services/comfyui/errors/servicesError.ts
index 37844b40392..c11493653c7 100644
--- a/src/server/services/comfyui/errors/servicesError.ts
+++ b/src/server/services/comfyui/errors/servicesError.ts
@@ -15,7 +15,6 @@ export class ServicesError extends ComfyUIInternalError {
super(message, reason, details);
this.name = 'ServicesError';
}
- /* eslint-disable sort-keys-fix/sort-keys-fix */
static readonly Reasons = {
// Client errors
INVALID_ARGS: 'INVALID_ARGS',
@@ -38,5 +37,4 @@ export class ServicesError extends ComfyUIInternalError {
// Workflow builder errors
WORKFLOW_BUILD_FAILED: 'WORKFLOW_BUILD_FAILED',
} as const;
- /* eslint-enable sort-keys-fix/sort-keys-fix */
}
diff --git a/src/server/services/comfyui/errors/utilsError.ts b/src/server/services/comfyui/errors/utilsError.ts
index 18f08997f10..30fa7667ce1 100644
--- a/src/server/services/comfyui/errors/utilsError.ts
+++ b/src/server/services/comfyui/errors/utilsError.ts
@@ -15,7 +15,6 @@ export class UtilsError extends ComfyUIInternalError {
super(message, reason, details);
this.name = 'UtilsError';
}
- /* eslint-disable sort-keys-fix/sort-keys-fix */
static readonly Reasons = {
CONNECTION_ERROR: 'CONNECTION_ERROR',
// Detector reasons
@@ -30,5 +29,4 @@ export class UtilsError extends ComfyUIInternalError {
ROUTING_FAILED: 'ROUTING_FAILED',
SERVICE_UNAVAILABLE: 'SERVICE_UNAVAILABLE',
} as const;
- /* eslint-enable sort-keys-fix/sort-keys-fix */
}
diff --git a/src/server/services/comfyui/errors/workflowError.ts b/src/server/services/comfyui/errors/workflowError.ts
index dfad5e935b9..e701a1c4c7e 100644
--- a/src/server/services/comfyui/errors/workflowError.ts
+++ b/src/server/services/comfyui/errors/workflowError.ts
@@ -14,7 +14,6 @@ export class WorkflowError extends ComfyUIInternalError {
super(message, reason, details);
this.name = 'WorkflowError';
}
- /* eslint-disable sort-keys-fix/sort-keys-fix */
static readonly Reasons = {
INVALID_CONFIG: 'INVALID_CONFIG',
INVALID_PARAMS: 'INVALID_PARAMS',
@@ -22,5 +21,4 @@ export class WorkflowError extends ComfyUIInternalError {
MISSING_ENCODER: 'MISSING_ENCODER',
UNSUPPORTED_MODEL: 'UNSUPPORTED_MODEL',
} as const;
- /* eslint-enable sort-keys-fix/sort-keys-fix */
}
diff --git a/src/server/services/comfyui/utils/workflowUtils.ts b/src/server/services/comfyui/utils/workflowUtils.ts
index 474efcb4aaf..ba9f4dfc13c 100644
--- a/src/server/services/comfyui/utils/workflowUtils.ts
+++ b/src/server/services/comfyui/utils/workflowUtils.ts
@@ -7,7 +7,6 @@ import { FLUX_MODEL_CONFIG, SD_MODEL_CONFIG } from '@/server/services/comfyui/co
/**
* Workflow function to default filename type mapping
*/
-/* eslint-disable sort-keys-fix/sort-keys-fix */
export const WORKFLOW_DEFAULT_TYPE: Record<string, string> = {
buildFluxDevWorkflow: 'DEV',
buildFluxSchnellWorkflow: 'SCHNELL',
@@ -36,7 +35,6 @@ export const VARIANT_TYPE_OVERRIDE: Record<string, string> = {
'SD1': 'SD15',
'SDXL': 'SDXL',
} as const;
-/* eslint-enable sort-keys-fix/sort-keys-fix */
/**
* Get the filename prefix for ComfyUI workflow output files
diff --git a/src/server/services/comfyui/workflows/flux-dev.ts b/src/server/services/comfyui/workflows/flux-dev.ts
index d62dd6c5bbf..90b324e6084 100644
--- a/src/server/services/comfyui/workflows/flux-dev.ts
+++ b/src/server/services/comfyui/workflows/flux-dev.ts
@@ -30,7 +30,6 @@ export async function buildFluxDevWorkflow(
// Process prompt splitting early in workflow construction
const { t5xxlPrompt, clipLPrompt } = splitPromptForDualCLIP(params.prompt);
- /* eslint-disable sort-keys-fix/sort-keys-fix */
const workflow = {
'1': {
_meta: {
@@ -184,8 +183,6 @@ export async function buildFluxDevWorkflow(
},
};
- /* eslint-enable sort-keys-fix/sort-keys-fix */
-
workflow['5'].inputs.clip_l = clipLPrompt;
workflow['5'].inputs.t5xxl = t5xxlPrompt;
diff --git a/src/server/services/comfyui/workflows/flux-kontext.ts b/src/server/services/comfyui/workflows/flux-kontext.ts
index fe4e21bc177..8ead2c5bbbb 100644
--- a/src/server/services/comfyui/workflows/flux-kontext.ts
+++ b/src/server/services/comfyui/workflows/flux-kontext.ts
@@ -30,7 +30,6 @@ export async function buildFluxKontextWorkflow(
// Check if there's an input image
const hasInputImage = Boolean(params.imageUrl || params.imageUrls?.[0]);
- /* eslint-disable sort-keys-fix/sort-keys-fix */
const workflow: any = {
'1': {
_meta: {
@@ -172,7 +171,6 @@ export async function buildFluxKontextWorkflow(
},
},
};
- /* eslint-enable sort-keys-fix/sort-keys-fix */
// If there's an input image, add image loading and encoding nodes
if (hasInputImage) {
diff --git a/src/server/services/comfyui/workflows/flux-schnell.ts b/src/server/services/comfyui/workflows/flux-schnell.ts
index cbe064efe99..160299903f8 100644
--- a/src/server/services/comfyui/workflows/flux-schnell.ts
+++ b/src/server/services/comfyui/workflows/flux-schnell.ts
@@ -30,7 +30,6 @@ export async function buildFluxSchnellWorkflow(
// Process prompt splitting early in workflow construction
const { t5xxlPrompt, clipLPrompt } = splitPromptForDualCLIP(params.prompt);
- /* eslint-disable sort-keys-fix/sort-keys-fix */
const workflow = {
'1': {
_meta: {
@@ -124,7 +123,6 @@ export async function buildFluxSchnellWorkflow(
},
},
};
- /* eslint-enable sort-keys-fix/sort-keys-fix */
// Set prompt values directly to workflow nodes instead of using PromptBuilder input mapping
workflow['4'].inputs.clip_l = clipLPrompt;
diff --git a/src/server/services/comfyui/workflows/sd35.ts b/src/server/services/comfyui/workflows/sd35.ts
index fffdf0d1331..520f60b46a4 100644
--- a/src/server/services/comfyui/workflows/sd35.ts
+++ b/src/server/services/comfyui/workflows/sd35.ts
@@ -87,7 +87,6 @@ export async function buildSD35Workflow(
const negativeConditioningNode: [string, number] = ['4', 0];
// Build complete static JSON structure with conditional values
- /* eslint-disable sort-keys-fix/sort-keys-fix */
const workflow = {
'1': {
_meta: { title: 'Load Checkpoint' },
@@ -190,7 +189,6 @@ export async function buildSD35Workflow(
},
},
};
- /* eslint-enable sort-keys-fix/sort-keys-fix */
// Create PromptBuilder
const builder = new PromptBuilder(
diff --git a/src/server/services/comfyui/workflows/simple-sd.ts b/src/server/services/comfyui/workflows/simple-sd.ts
index 5aa40a448b9..1933eb4c8e7 100644
--- a/src/server/services/comfyui/workflows/simple-sd.ts
+++ b/src/server/services/comfyui/workflows/simple-sd.ts
@@ -116,7 +116,6 @@ export async function buildSimpleSDWorkflow(
// If no VAE found or it's SD3, use built-in VAE (selectedVAE remains undefined)
// Base workflow for models with built-in CLIP/T5 encoders
- /* eslint-disable sort-keys-fix/sort-keys-fix */
const workflow: any = {
'1': {
_meta: { title: 'Load Checkpoint' },
@@ -174,7 +173,6 @@ export async function buildSimpleSDWorkflow(
},
},
};
- /* eslint-enable sort-keys-fix/sort-keys-fix */
// Add VAE Loader node if using external VAE
if (selectedVAE) {
diff --git a/src/server/services/file/impls/type.ts b/src/server/services/file/impls/type.ts
index b0f94bfb8c4..1cf604006b1 100644
--- a/src/server/services/file/impls/type.ts
+++ b/src/server/services/file/impls/type.ts
@@ -50,7 +50,7 @@ export interface FileServiceImpl {
/**
* Upload buffer with specified content type (for any file type)
*/
- uploadBuffer(key: string, buffer: Buffer, contentType: string): Promise<{ key: string }>;
+ uploadBuffer: (key: string, buffer: Buffer, contentType: string) => Promise<{ key: string }>;
/**
* Upload content
diff --git a/src/server/services/generation/index.ts b/src/server/services/generation/index.ts
index fe0ec27df5e..bc9fbd0912b 100644
--- a/src/server/services/generation/index.ts
+++ b/src/server/services/generation/index.ts
@@ -46,6 +46,7 @@ export async function fetchImageFromUrl(
} catch (error) {
throw new Error(
`Failed to decode base64 data: ${error instanceof Error ? error.message : String(error)}`,
+ { cause: error },
);
}
} else {
diff --git a/src/server/services/generation/video.ts b/src/server/services/generation/video.ts
index 4245bf4092b..b7b572e0bcc 100644
--- a/src/server/services/generation/video.ts
+++ b/src/server/services/generation/video.ts
@@ -213,7 +213,7 @@ export class VideoGenerationService {
const ffmpegPath = getFfmpegPath();
// ffmpeg -i exits with code 1 when no output is specified, but stderr contains metadata
- let stderr = '';
+ let stderr: string;
try {
const result = await execFileAsync(ffmpegPath, ['-i', videoPath, '-hide_banner']);
stderr = result.stderr;
diff --git a/src/server/services/mcp/deps/MCPSystemDepsCheckService.ts b/src/server/services/mcp/deps/MCPSystemDepsCheckService.ts
index 7e58f8bd101..31895b2d28a 100644
--- a/src/server/services/mcp/deps/MCPSystemDepsCheckService.ts
+++ b/src/server/services/mcp/deps/MCPSystemDepsCheckService.ts
@@ -6,7 +6,7 @@ import debug from 'debug';
import { type SystemDependencyCheckResult } from '@/types/plugins';
-import { type InstallationChecker, type PackageInstallCheckResult } from './types';
+import { type InstallationChecker } from './types';
const execPromise = promisify(exec);
const log = debug('lobe-mcp:deps-check');
@@ -183,11 +183,10 @@ class MCPSystemDepsCheckService {
// Get corresponding installation checker
const checker = this.checkers.get(option.installationMethod);
let packageInstalled = false;
- let packageResult: PackageInstallCheckResult | null = null;
if (checker) {
// Use specific installation checker to check package installation status
- packageResult = await checker.checkPackageInstalled(option.installationDetails);
+ const packageResult = await checker.checkPackageInstalled(option.installationDetails);
packageInstalled = packageResult.installed;
} else {
log(`Installation checker not found: ${option.installationMethod}`);
diff --git a/src/server/services/mcp/index.ts b/src/server/services/mcp/index.ts
index 54a0ca8bff9..c145f7969ed 100644
--- a/src/server/services/mcp/index.ts
+++ b/src/server/services/mcp/index.ts
@@ -256,7 +256,7 @@ export class MCPService {
return {
content: mcpError.message,
- error: error,
+ error,
state: {
content: [{ text: mcpError.message, type: 'text' }],
isError: true,
diff --git a/src/server/services/memory/userMemory/extract.ts b/src/server/services/memory/userMemory/extract.ts
index b8439457125..80144fd4d53 100644
--- a/src/server/services/memory/userMemory/extract.ts
+++ b/src/server/services/memory/userMemory/extract.ts
@@ -1223,7 +1223,7 @@ export class MemoryExtractionExecutor {
const topicContextProvider = new LobeChatTopicContextProvider({
conversations: extractorConversations,
- topic: topic,
+ topic,
topicId: topic.id,
});
const topicContext = await topicContextProvider.buildContext(extractionJob.userId);
@@ -1357,7 +1357,7 @@ export class MemoryExtractionExecutor {
: undefined,
contextProvider: topicContextProvider,
gatekeeperLanguage: this.privateConfig.agentGateKeeper.language || 'English',
- language: language,
+ language,
resultRecorder: resultRecorder as any,
retrievedContexts: trimmedRetrievedContexts,
retrievedIdentitiesContext: trimmedRetrievedIdentitiesContext,
@@ -2006,7 +2006,7 @@ export class MemoryExtractionExecutor {
async (span) => {
const startTime = Date.now();
let extractionJob: MemoryExtractionJob | null = null;
- let extraction: MemoryExtractionResult | null = null;
+ let extraction: MemoryExtractionResult | null;
try {
const db = await this.db;
diff --git a/src/server/services/message/__tests__/index.integration.test.ts b/src/server/services/message/__tests__/index.integration.test.ts
index f21990ddfd5..b375f35d59f 100644
--- a/src/server/services/message/__tests__/index.integration.test.ts
+++ b/src/server/services/message/__tests__/index.integration.test.ts
@@ -37,7 +37,7 @@ beforeEach(async () => {
await trx.insert(files).values({
id: 'f1',
- userId: userId,
+ userId,
url: 'abc',
name: 'file-1',
fileType: 'image/png',
diff --git a/src/server/services/oidc/index.ts b/src/server/services/oidc/index.ts
index a63641ccd5c..ae8c0b0ec4b 100644
--- a/src/server/services/oidc/index.ts
+++ b/src/server/services/oidc/index.ts
@@ -70,8 +70,8 @@ export class OIDCService {
if (!grant) {
// If not found or no existingGrantId, create a new one
grant = new this.provider.Grant({
- accountId: accountId,
- clientId: clientId,
+ accountId,
+ clientId,
});
log('Created new Grant for account %s and client %s', accountId, clientId);
}
diff --git a/src/server/services/queue/QueueService.ts b/src/server/services/queue/QueueService.ts
index 93beef821b2..70d610f9ccd 100644
--- a/src/server/services/queue/QueueService.ts
+++ b/src/server/services/queue/QueueService.ts
@@ -78,9 +78,8 @@ export class QueueService {
}): number {
const { stepIndex, hasErrors, hasToolCalls, priority } = params;
- let baseDelay = 1000; // 1 second base delay
-
// Adjust based on priority
+ let baseDelay: number;
switch (priority) {
case 'high': {
baseDelay = 200;
@@ -91,7 +90,7 @@ export class QueueService {
break;
}
default: {
- baseDelay = 1000;
+ baseDelay = 1000; // 1 second base delay
}
}
diff --git a/src/server/services/search/impls/anspire/index.ts b/src/server/services/search/impls/anspire/index.ts
index 3bc86b7dec2..af1ca332f81 100644
--- a/src/server/services/search/impls/anspire/index.ts
+++ b/src/server/services/search/impls/anspire/index.ts
@@ -65,7 +65,7 @@ export class AnspireImpl implements SearchServiceImpl {
let response: Response;
const startAt = Date.now();
- let costTime = 0;
+ let costTime: number;
try {
log('Sending request to endpoint: %s', endpoint);
response = await fetch(`${endpoint}?${searchParams.toString()}`, {
@@ -122,7 +122,7 @@ export class AnspireImpl implements SearchServiceImpl {
return {
costTime,
- query: query,
+ query,
resultNumbers: mappedResults.length,
results: mappedResults,
};
diff --git a/src/server/services/search/impls/bocha/index.ts b/src/server/services/search/impls/bocha/index.ts
index 7d7180fd7a8..0522bee095e 100644
--- a/src/server/services/search/impls/bocha/index.ts
+++ b/src/server/services/search/impls/bocha/index.ts
@@ -55,7 +55,7 @@ export class BochaImpl implements SearchServiceImpl {
let response: Response;
const startAt = Date.now();
- let costTime = 0;
+ let costTime: number;
try {
log('Sending request to endpoint: %s', endpoint);
response = await fetch(endpoint, {
@@ -111,7 +111,7 @@ export class BochaImpl implements SearchServiceImpl {
return {
costTime,
- query: query,
+ query,
resultNumbers: mappedResults.length,
results: mappedResults,
};
diff --git a/src/server/services/search/impls/brave/index.ts b/src/server/services/search/impls/brave/index.ts
index 0bc92d4d8c5..a7a119af2e9 100644
--- a/src/server/services/search/impls/brave/index.ts
+++ b/src/server/services/search/impls/brave/index.ts
@@ -60,7 +60,7 @@ export class BraveImpl implements SearchServiceImpl {
let response: Response;
const startAt = Date.now();
- let costTime = 0;
+ let costTime: number;
try {
log('Sending request to endpoint: %s', endpoint);
response = await fetch(`${endpoint}?${searchParams.toString()}`, {
@@ -116,7 +116,7 @@ export class BraveImpl implements SearchServiceImpl {
return {
costTime,
- query: query,
+ query,
resultNumbers: mappedResults.length,
results: mappedResults,
};
diff --git a/src/server/services/search/impls/exa/index.ts b/src/server/services/search/impls/exa/index.ts
index 8d80e72eeb5..537c3e369bb 100644
--- a/src/server/services/search/impls/exa/index.ts
+++ b/src/server/services/search/impls/exa/index.ts
@@ -59,7 +59,7 @@ export class ExaImpl implements SearchServiceImpl {
let response: Response;
const startAt = Date.now();
- let costTime = 0;
+ let costTime: number;
try {
log('Sending request to endpoint: %s', endpoint);
response = await fetch(endpoint, {
@@ -115,7 +115,7 @@ export class ExaImpl implements SearchServiceImpl {
return {
costTime,
- query: query,
+ query,
resultNumbers: mappedResults.length,
results: mappedResults,
};
diff --git a/src/server/services/search/impls/firecrawl/index.ts b/src/server/services/search/impls/firecrawl/index.ts
index 96a0d53758d..a8c538ae64a 100644
--- a/src/server/services/search/impls/firecrawl/index.ts
+++ b/src/server/services/search/impls/firecrawl/index.ts
@@ -60,7 +60,7 @@ export class FirecrawlImpl implements SearchServiceImpl {
let response: Response;
const startAt = Date.now();
- let costTime = 0;
+ let costTime: number;
try {
log('Sending request to endpoint: %s', endpoint);
response = await fetch(endpoint, {
@@ -155,7 +155,7 @@ export class FirecrawlImpl implements SearchServiceImpl {
return {
costTime,
- query: query,
+ query,
resultNumbers: allResults.length,
results: allResults,
};
diff --git a/src/server/services/search/impls/google/index.ts b/src/server/services/search/impls/google/index.ts
index 38c046bd506..51c0d445a3d 100644
--- a/src/server/services/search/impls/google/index.ts
+++ b/src/server/services/search/impls/google/index.ts
@@ -65,7 +65,7 @@ export class GoogleImpl implements SearchServiceImpl {
let response: Response;
const startAt = Date.now();
- let costTime = 0;
+ let costTime: number;
try {
log('Sending request to endpoint: %s', endpoint);
response = await fetch(`${endpoint}?${searchParams.toString()}`, {
@@ -116,7 +116,7 @@ export class GoogleImpl implements SearchServiceImpl {
return {
costTime,
- query: query,
+ query,
resultNumbers: mappedResults.length,
results: mappedResults,
};
diff --git a/src/server/services/search/impls/jina/index.ts b/src/server/services/search/impls/jina/index.ts
index ba382d102b2..a53dcaa51be 100644
--- a/src/server/services/search/impls/jina/index.ts
+++ b/src/server/services/search/impls/jina/index.ts
@@ -38,7 +38,7 @@ export class JinaImpl implements SearchServiceImpl {
let response: Response;
const startAt = Date.now();
- let costTime = 0;
+ let costTime: number;
try {
log('Sending request to endpoint: %s', endpoint);
response = await fetch(endpoint, {
@@ -96,7 +96,7 @@ export class JinaImpl implements SearchServiceImpl {
return {
costTime,
- query: query,
+ query,
resultNumbers: mappedResults.length,
results: mappedResults,
};
diff --git a/src/server/services/search/impls/kagi/index.ts b/src/server/services/search/impls/kagi/index.ts
index 7c35980ef80..27230eab180 100644
--- a/src/server/services/search/impls/kagi/index.ts
+++ b/src/server/services/search/impls/kagi/index.ts
@@ -44,7 +44,7 @@ export class KagiImpl implements SearchServiceImpl {
let response: Response;
const startAt = Date.now();
- let costTime = 0;
+ let costTime: number;
try {
log('Sending request to endpoint: %s', endpoint);
response = await fetch(`${endpoint}?${searchParams.toString()}`, {
@@ -98,7 +98,7 @@ export class KagiImpl implements SearchServiceImpl {
return {
costTime,
- query: query,
+ query,
resultNumbers: mappedResults.length,
results: mappedResults,
};
diff --git a/src/server/services/search/impls/search1api/index.ts b/src/server/services/search/impls/search1api/index.ts
index e10199d55b2..052ef466505 100644
--- a/src/server/services/search/impls/search1api/index.ts
+++ b/src/server/services/search/impls/search1api/index.ts
@@ -82,7 +82,7 @@ export class Search1APIImpl implements SearchServiceImpl {
let response: Response;
const startAt = Date.now();
- let costTime = 0;
+ let costTime: number;
try {
log('Sending request to endpoint: %s', endpoint);
response = await fetch(endpoint, {
@@ -141,7 +141,7 @@ export class Search1APIImpl implements SearchServiceImpl {
return {
costTime,
- query: query,
+ query,
resultNumbers: mappedResults.length,
results: mappedResults,
};
diff --git a/src/server/services/search/impls/tavily/index.ts b/src/server/services/search/impls/tavily/index.ts
index 5f5d3564183..b3064b46c74 100644
--- a/src/server/services/search/impls/tavily/index.ts
+++ b/src/server/services/search/impls/tavily/index.ts
@@ -54,7 +54,7 @@ export class TavilyImpl implements SearchServiceImpl {
let response: Response;
const startAt = Date.now();
- let costTime = 0;
+ let costTime: number;
try {
log('Sending request to endpoint: %s', endpoint);
response = await fetch(endpoint, {
@@ -110,7 +110,7 @@ export class TavilyImpl implements SearchServiceImpl {
return {
costTime,
- query: query,
+ query,
resultNumbers: mappedResults.length,
results: mappedResults,
};
diff --git a/src/server/services/skill/errors.ts b/src/server/services/skill/errors.ts
index 11e7080a0a2..ea4d0566e52 100644
--- a/src/server/services/skill/errors.ts
+++ b/src/server/services/skill/errors.ts
@@ -1,4 +1,4 @@
-import { z } from 'zod';
+import type { z } from 'zod';
export class SkillParseError extends Error {
cause?: Error;
diff --git a/src/server/services/skill/parser.test.ts b/src/server/services/skill/parser.test.ts
index 6ae17230970..ebe0d0f66bd 100644
--- a/src/server/services/skill/parser.test.ts
+++ b/src/server/services/skill/parser.test.ts
@@ -1,8 +1,9 @@
-import { unzip, zip } from 'fflate';
-import { sha256 } from 'js-sha256';
import { mkdir, rm, writeFile } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
+
+import { unzip, zip } from 'fflate';
+import { sha256 } from 'js-sha256';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
import { SkillManifestError, SkillParseError } from './errors';
diff --git a/src/server/services/skill/parser.ts b/src/server/services/skill/parser.ts
index 894606d6292..3ee6fff5243 100644
--- a/src/server/services/skill/parser.ts
+++ b/src/server/services/skill/parser.ts
@@ -1,3 +1,5 @@
+import { readFile } from 'node:fs/promises';
+
import {
type ParsedSkill,
type ParsedZipSkill,
@@ -7,7 +9,6 @@ import {
import { unzip as fflateUnzip, zip as fflateZip } from 'fflate';
import matter from 'gray-matter';
import { sha256 } from 'js-sha256';
-import { readFile } from 'node:fs/promises';
import { SkillManifestError, SkillParseError } from './errors';
diff --git a/src/server/services/usage/index.test.ts b/src/server/services/usage/index.test.ts
index 4c4ed2c70b0..a16ef7f3e88 100644
--- a/src/server/services/usage/index.test.ts
+++ b/src/server/services/usage/index.test.ts
@@ -38,7 +38,7 @@ describe('UsageRecordService', () => {
const mockMessages = [
{
id: 'msg-1',
- userId: userId,
+ userId,
role: 'assistant',
provider: 'openai',
model: 'gpt-4',
@@ -69,7 +69,7 @@ describe('UsageRecordService', () => {
tps: 10,
ttft: 500,
type: 'chat',
- userId: userId,
+ userId,
});
});
@@ -77,7 +77,7 @@ describe('UsageRecordService', () => {
const mockMessages = [
{
id: 'msg-1',
- userId: userId,
+ userId,
role: 'assistant',
provider: 'anthropic',
model: 'claude-3',
@@ -102,7 +102,7 @@ describe('UsageRecordService', () => {
const mockMessages = [
{
id: 'msg-1',
- userId: userId,
+ userId,
role: 'assistant',
provider: 'openai',
model: 'gpt-3.5-turbo',
@@ -143,7 +143,7 @@ describe('UsageRecordService', () => {
const mockMessages = [
{
id: 'msg-1',
- userId: userId,
+ userId,
role: 'assistant',
provider: 'openai',
model: 'gpt-4',
@@ -156,7 +156,7 @@ describe('UsageRecordService', () => {
},
{
id: 'msg-2',
- userId: userId,
+ userId,
role: 'assistant',
provider: 'openai',
model: 'gpt-4',
@@ -169,7 +169,7 @@ describe('UsageRecordService', () => {
},
{
id: 'msg-3',
- userId: userId,
+ userId,
role: 'assistant',
provider: 'anthropic',
model: 'claude-3',
@@ -203,7 +203,7 @@ describe('UsageRecordService', () => {
const mockMessages = [
{
id: 'msg-1',
- userId: userId,
+ userId,
role: 'assistant',
provider: 'openai',
model: 'gpt-4',
@@ -239,7 +239,7 @@ describe('UsageRecordService', () => {
const mockMessages = [
{
id: 'msg-1',
- userId: userId,
+ userId,
role: 'assistant',
provider: 'openai',
model: 'gpt-4',
@@ -252,7 +252,7 @@ describe('UsageRecordService', () => {
},
{
id: 'msg-2',
- userId: userId,
+ userId,
role: 'assistant',
provider: 'openai',
model: 'gpt-4',
@@ -283,7 +283,7 @@ describe('UsageRecordService', () => {
const mockMessages = [
{
id: 'msg-1',
- userId: userId,
+ userId,
role: 'assistant',
provider: 'openai',
model: 'gpt-4',
diff --git a/src/server/services/webhookUser/index.test.ts b/src/server/services/webhookUser/index.test.ts
index 53f3e1befa1..05f361ab32d 100644
--- a/src/server/services/webhookUser/index.test.ts
+++ b/src/server/services/webhookUser/index.test.ts
@@ -1,3 +1,4 @@
+/* eslint-disable unicorn/no-thenable */
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { UserModel } from '@/database/models/user';
@@ -228,7 +229,11 @@ describe('WebhookUserService', () => {
describe('getUserByAccount (via public methods)', () => {
it('should prioritize Better Auth account over NextAuth account', async () => {
- const betterAuthAccount = { userId: 'better-auth-user', providerId: 'logto', accountId: 'acc' };
+ const betterAuthAccount = {
+ userId: 'better-auth-user',
+ providerId: 'logto',
+ accountId: 'acc',
+ };
const betterAuthUser = { ...mockUser, id: 'better-auth-user' };
mockDb.query.account.findFirst.mockResolvedValue(betterAuthAccount);
diff --git a/src/server/services/webhookUser/index.ts b/src/server/services/webhookUser/index.ts
index 64311675f61..71a76a63da2 100644
--- a/src/server/services/webhookUser/index.ts
+++ b/src/server/services/webhookUser/index.ts
@@ -59,7 +59,7 @@ export class WebhookUserService {
{ accountId, providerId }: { accountId: string; providerId: string },
data: Partial<UserItem>,
) => {
- console.log(`updating user "${JSON.stringify({ accountId, providerId })}" due to webhook`);
+ console.info(`updating user "${JSON.stringify({ accountId, providerId })}" due to webhook`);
const user = await this.getUserByAccount({ accountId, providerId });
@@ -89,7 +89,7 @@ export class WebhookUserService {
accountId: string;
providerId: string;
}) => {
- console.log(`Signing out user "${JSON.stringify({ accountId, providerId })}"`);
+ console.info(`Signing out user "${JSON.stringify({ accountId, providerId })}"`);
const user = await this.getUserByAccount({ accountId, providerId });
diff --git a/src/server/utils/tempFileManager.ts b/src/server/utils/tempFileManager.ts
index c9528b13726..81aa75e0c79 100644
--- a/src/server/utils/tempFileManager.ts
+++ b/src/server/utils/tempFileManager.ts
@@ -29,7 +29,7 @@ export class TempFileManager {
return filePath;
} catch (error) {
this.cleanup(); // Immediately cleanup on write failure
- throw new Error(`Failed to write temp file: ${(error as Error).message}`);
+ throw new Error(`Failed to write temp file: ${(error as Error).message}`, { cause: error });
}
}
diff --git a/src/services/_url.ts b/src/services/_url.ts
index f0c2077d49b..5d76c38bd97 100644
--- a/src/services/_url.ts
+++ b/src/services/_url.ts
@@ -1,7 +1,5 @@
import { withElectronProtocolIfElectron } from '@/const/protocol';
-/* eslint-disable sort-keys-fix/sort-keys-fix */
-
export const API_ENDPOINTS = {
oauth: withElectronProtocolIfElectron('/api/auth'),
diff --git a/src/services/chat/index.ts b/src/services/chat/index.ts
index c03a2875d76..161c70c8ff5 100644
--- a/src/services/chat/index.ts
+++ b/src/services/chat/index.ts
@@ -423,7 +423,7 @@ class ChatService {
return fetchSSE(API_ENDPOINTS.chat(provider), {
body: JSON.stringify(payload),
- fetcher: fetcher,
+ fetcher,
headers,
method: 'POST',
onAbort: options?.onAbort,
diff --git a/src/services/import/index.test.ts b/src/services/import/index.test.ts
index 5556fe6d9bf..74e3a9ea420 100644
--- a/src/services/import/index.test.ts
+++ b/src/services/import/index.test.ts
@@ -46,7 +46,7 @@ describe('ImportService', () => {
beforeEach(() => {
vi.clearAllMocks();
vi.spyOn(Date, 'now').mockReturnValue(1000000);
- vi.spyOn(console, 'log').mockImplementation(() => {});
+ vi.spyOn(console, 'info').mockImplementation(() => {});
});
describe('importSettings', () => {
@@ -71,10 +71,10 @@ describe('ImportService', () => {
describe('small dataset (< 500 items)', () => {
it('should import via POST when total items < 500', async () => {
const mockData = {
- messages: Array.from({length: 100}).fill({ id: '1', content: 'test' }),
- sessionGroups: Array.from({length: 50}).fill({ id: '1', name: 'test' }),
- sessions: Array.from({length: 100}).fill({ id: '1', type: 'agent' }),
- topics: Array.from({length: 100}).fill({ id: '1', title: 'test' }),
+ messages: Array.from({ length: 100 }).fill({ id: '1', content: 'test' }),
+ sessionGroups: Array.from({ length: 50 }).fill({ id: '1', name: 'test' }),
+ sessions: Array.from({ length: 100 }).fill({ id: '1', type: 'agent' }),
+ topics: Array.from({ length: 100 }).fill({ id: '1', title: 'test' }),
version: 1,
};
@@ -107,7 +107,7 @@ describe('ImportService', () => {
it('should handle error during small dataset import', async () => {
const mockData = {
- messages: Array.from({length: 100}).fill({ id: '1', content: 'test' }),
+ messages: Array.from({ length: 100 }).fill({ id: '1', content: 'test' }),
version: 1,
};
@@ -143,7 +143,7 @@ describe('ImportService', () => {
it('should calculate duration correctly', async () => {
const mockData = {
- messages: Array.from({length: 10}).fill({ id: '1', content: 'test' }),
+ messages: Array.from({ length: 10 }).fill({ id: '1', content: 'test' }),
version: 1,
};
@@ -175,7 +175,7 @@ describe('ImportService', () => {
describe('large dataset (>= 500 items)', () => {
it('should upload to S3 and import via file when total items >= 500', async () => {
const mockData = {
- messages: Array.from({length: 500}).fill({ id: '1', content: 'test' }),
+ messages: Array.from({ length: 500 }).fill({ id: '1', content: 'test' }),
version: 1,
};
@@ -226,7 +226,7 @@ describe('ImportService', () => {
it('should handle upload error', async () => {
const mockData = {
- messages: Array.from({length: 500}).fill({ id: '1', content: 'test' }),
+ messages: Array.from({ length: 500 }).fill({ id: '1', content: 'test' }),
version: 1,
};
@@ -236,14 +236,16 @@ describe('ImportService', () => {
onStageChange: vi.fn(),
};
- await expect(importService.importData(mockData as any, callbacks)).rejects.toThrow('Upload Error');
+ await expect(importService.importData(mockData as any, callbacks)).rejects.toThrow(
+ 'Upload Error',
+ );
expect(callbacks.onStageChange).toHaveBeenCalledWith(ImportStage.Uploading);
});
it('should handle import error after successful upload', async () => {
const mockData = {
- messages: Array.from({length: 500}).fill({ id: '1', content: 'test' }),
+ messages: Array.from({ length: 500 }).fill({ id: '1', content: 'test' }),
version: 1,
};
@@ -287,7 +289,7 @@ describe('ImportService', () => {
it('should trigger file upload progress callback', async () => {
const mockData = {
- messages: Array.from({length: 500}).fill({ id: '1', content: 'test' }),
+ messages: Array.from({ length: 500 }).fill({ id: '1', content: 'test' }),
version: 1,
};
@@ -340,7 +342,7 @@ describe('ImportService', () => {
describe('edge cases', () => {
it('should handle data with exactly 499 items via POST', async () => {
const mockData = {
- messages: Array.from({length: 499}).fill({ id: '1', content: 'test' }),
+ messages: Array.from({ length: 499 }).fill({ id: '1', content: 'test' }),
version: 1,
};
@@ -361,7 +363,7 @@ describe('ImportService', () => {
it('should handle data with exactly 500 items via file upload', async () => {
const mockData = {
- messages: Array.from({length: 500}).fill({ id: '1', content: 'test' }),
+ messages: Array.from({ length: 500 }).fill({ id: '1', content: 'test' }),
version: 1,
};
@@ -410,7 +412,7 @@ describe('ImportService', () => {
it('should work without callbacks', async () => {
const mockData = {
- messages: Array.from({length: 10}).fill({ id: '1', content: 'test' }),
+ messages: Array.from({ length: 10 }).fill({ id: '1', content: 'test' }),
version: 1,
};
@@ -433,8 +435,8 @@ describe('ImportService', () => {
it('should import PostgreSQL data via POST when total items < 500', async () => {
const mockData = {
data: {
- users: Array.from({length: 100}).fill({ id: 1, name: 'test' }),
- sessions: Array.from({length: 200}).fill({ id: 1, name: 'test' }),
+ users: Array.from({ length: 100 }).fill({ id: 1, name: 'test' }),
+ sessions: Array.from({ length: 200 }).fill({ id: 1, name: 'test' }),
},
mode: 'postgres' as const,
schemaHash: 'hash123',
@@ -466,7 +468,7 @@ describe('ImportService', () => {
it('should handle error during PostgreSQL data import', async () => {
const mockData = {
data: {
- users: Array.from({length: 100}).fill({ id: 1, name: 'test' }),
+ users: Array.from({ length: 100 }).fill({ id: 1, name: 'test' }),
},
mode: 'pglite' as const,
schemaHash: 'hash123',
@@ -504,7 +506,7 @@ describe('ImportService', () => {
it('should upload to S3 and import via file when total items >= 500', async () => {
const mockData = {
data: {
- messages: Array.from({length: 500}).fill({ id: 1, content: 'test' }),
+ messages: Array.from({ length: 500 }).fill({ id: 1, content: 'test' }),
},
mode: 'postgres' as const,
schemaHash: 'hash123',
@@ -552,9 +554,9 @@ describe('ImportService', () => {
it('should handle multiple tables with varying sizes', async () => {
const mockData = {
data: {
- users: Array.from({length: 100}).fill({ id: 1 }),
- messages: Array.from({length: 300}).fill({ id: 1 }),
- sessions: Array.from({length: 150}).fill({ id: 1 }),
+ users: Array.from({ length: 100 }).fill({ id: 1 }),
+ messages: Array.from({ length: 300 }).fill({ id: 1 }),
+ sessions: Array.from({ length: 150 }).fill({ id: 1 }),
},
mode: 'postgres' as const,
schemaHash: 'hash123',
@@ -592,7 +594,7 @@ describe('ImportService', () => {
it('should work without options', async () => {
const mockData = {
data: {
- users: Array.from({length: 10}).fill({ id: 1, name: 'test' }),
+ users: Array.from({ length: 10 }).fill({ id: 1, name: 'test' }),
},
mode: 'pglite' as const,
schemaHash: 'hash123',
@@ -632,9 +634,9 @@ describe('ImportService', () => {
it('should calculate total length correctly across multiple tables', async () => {
const mockData = {
data: {
- table1: Array.from({length: 100}).fill({}),
- table2: Array.from({length: 200}).fill({}),
- table3: Array.from({length: 199}).fill({}),
+ table1: Array.from({ length: 100 }).fill({}),
+ table2: Array.from({ length: 200 }).fill({}),
+ table3: Array.from({ length: 199 }).fill({}),
},
mode: 'postgres' as const,
schemaHash: 'hash123',
diff --git a/src/services/mcp.ts b/src/services/mcp.ts
index b14a2426bba..d64f797652d 100644
--- a/src/services/mcp.ts
+++ b/src/services/mcp.ts
@@ -149,7 +149,6 @@ class MCPService {
success = true;
return result;
} catch (error) {
- success = false;
const err = error as Error;
errorCode = 'CALL_FAILED';
errorMessage = err.message;
diff --git a/src/services/models.ts b/src/services/models.ts
index ba816cf1cb2..32d22aaa61e 100644
--- a/src/services/models.ts
+++ b/src/services/models.ts
@@ -149,7 +149,7 @@ export class ModelsService {
}
if (progress.status === 'canceled') {
- console.log('progress:', progress);
+ console.info('progress:', progress);
}
if (progress.status === 'error') {
diff --git a/src/services/tableViewer/client.ts b/src/services/tableViewer/client.ts
index c34ceeead2b..b89ced8df3b 100644
--- a/src/services/tableViewer/client.ts
+++ b/src/services/tableViewer/client.ts
@@ -5,12 +5,12 @@ export class ClientService {
];
getTableDetails = async (tableName: string) => {
- console.log('getTableDetails:', tableName);
+ console.info('getTableDetails:', tableName);
return [{ name: 'test' }];
};
getTableData = async (tableName: string) => {
- console.log('getTableData:', tableName);
+ console.info('getTableData:', tableName);
return [{ name: 'test' }];
};
}
diff --git a/src/store/agent/slices/cron/action.ts b/src/store/agent/slices/cron/action.ts
index 75145d03824..f31b2d40ec0 100644
--- a/src/store/agent/slices/cron/action.ts
+++ b/src/store/agent/slices/cron/action.ts
@@ -36,11 +36,10 @@ export const createCronSlice = (set: Setter, get: () => AgentStore, _api?: unkno
export class CronSliceActionImpl {
readonly #get: () => AgentStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => AgentStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/agent/slices/knowledge/action.ts b/src/store/agent/slices/knowledge/action.ts
index ed4774229b5..d2cca56db1b 100644
--- a/src/store/agent/slices/knowledge/action.ts
+++ b/src/store/agent/slices/knowledge/action.ts
@@ -20,11 +20,10 @@ export const createKnowledgeSlice = (set: Setter, get: () => AgentStore, _api?:
export class KnowledgeSliceActionImpl {
readonly #get: () => AgentStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => AgentStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/agent/slices/plugin/action.ts b/src/store/agent/slices/plugin/action.ts
index 8035435d62b..a662673cffe 100644
--- a/src/store/agent/slices/plugin/action.ts
+++ b/src/store/agent/slices/plugin/action.ts
@@ -16,11 +16,10 @@ export const createPluginSlice = (set: Setter, get: () => AgentStore, _api?: unk
export class PluginSliceActionImpl {
readonly #get: () => AgentStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => AgentStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts b/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts
index a0eca2a1d8f..00e441317f9 100644
--- a/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts
+++ b/src/store/chat/agents/GroupOrchestration/createGroupOrchestrationExecutors.ts
@@ -88,8 +88,6 @@ export const createGroupOrchestrationExecutors = (
*/
const getMessages = () => dbMessageSelectors.getDbMessagesByKey(chatKey)(get());
- /* eslint-disable sort-keys-fix/sort-keys-fix */
-
return {
/**
* call_supervisor Executor
diff --git a/src/store/chat/agents/__tests__/createAgentExecutors/call-tool.test.ts b/src/store/chat/agents/__tests__/createAgentExecutors/call-tool.test.ts
index aad0c0a707a..12b4f0fa879 100644
--- a/src/store/chat/agents/__tests__/createAgentExecutors/call-tool.test.ts
+++ b/src/store/chat/agents/__tests__/createAgentExecutors/call-tool.test.ts
@@ -1445,7 +1445,7 @@ describe('call_tool executor', () => {
expect(payload).toMatchObject({
data: { data: 'search results', error: null },
isSuccess: true,
- toolCall: toolCall,
+ toolCall,
toolCallId: 'tool_context_test',
parentMessageId: createdMessage.id,
executionTime: expect.any(Number),
diff --git a/src/store/chat/slices/aiAgent/actions/groupOrchestration.ts b/src/store/chat/slices/aiAgent/actions/groupOrchestration.ts
index 986a22efd52..d39b90d65b3 100644
--- a/src/store/chat/slices/aiAgent/actions/groupOrchestration.ts
+++ b/src/store/chat/slices/aiAgent/actions/groupOrchestration.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import { type AgentState, type ExecutorResult } from '@lobechat/agent-runtime';
import { GroupOrchestrationRuntime, GroupOrchestrationSupervisor } from '@lobechat/agent-runtime';
import { type TaskStatusResult } from '@lobechat/types';
@@ -42,11 +41,10 @@ export const groupOrchestrationSlice = (set: Setter, get: () => ChatStore, _api?
export class GroupOrchestrationActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/aiAgent/actions/runAgent.ts b/src/store/chat/slices/aiAgent/actions/runAgent.ts
index 8de0fa89659..2497c6aedc4 100644
--- a/src/store/chat/slices/aiAgent/actions/runAgent.ts
+++ b/src/store/chat/slices/aiAgent/actions/runAgent.ts
@@ -27,11 +27,10 @@ export const agentSlice = (set: Setter, get: () => ChatStore, _api?: unknown) =>
export class AgentActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/aiChat/actions/conversationControl.ts b/src/store/chat/slices/aiChat/actions/conversationControl.ts
index cab53dd4ac9..586c314fced 100644
--- a/src/store/chat/slices/aiChat/actions/conversationControl.ts
+++ b/src/store/chat/slices/aiChat/actions/conversationControl.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
// Disable the auto sort key eslint rule to make the code more logic and readable
import { type AgentRuntimeContext } from '@lobechat/agent-runtime';
import { MESSAGE_CANCEL_FLAT } from '@lobechat/const';
@@ -22,11 +21,10 @@ export const conversationControl = (set: Setter, get: () => ChatStore, _api?: un
export class ConversationControlActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts b/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts
index 53e0b70d0b0..615f4d7dd89 100644
--- a/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts
+++ b/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
// Disable the auto sort key eslint rule to make the code more logic and readable
import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const';
import { LOADING_FLAT } from '@lobechat/const';
@@ -63,11 +62,10 @@ export const conversationLifecycle = (set: Setter, get: () => ChatStore, _api?:
export class ConversationLifecycleActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/aiChat/actions/memory.ts b/src/store/chat/slices/aiChat/actions/memory.ts
index fcdbd664272..b46fa0bef82 100644
--- a/src/store/chat/slices/aiChat/actions/memory.ts
+++ b/src/store/chat/slices/aiChat/actions/memory.ts
@@ -15,11 +15,10 @@ export const chatMemory = (set: Setter, get: () => ChatStore, _api?: unknown) =>
export class ChatMemoryActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/message/actions/optimisticUpdate.ts b/src/store/chat/slices/message/actions/optimisticUpdate.ts
index d7369ea5b99..58272174694 100644
--- a/src/store/chat/slices/message/actions/optimisticUpdate.ts
+++ b/src/store/chat/slices/message/actions/optimisticUpdate.ts
@@ -38,11 +38,10 @@ export const messageOptimisticUpdate = (set: Setter, get: () => ChatStore, _api?
export class MessageOptimisticUpdateActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/message/actions/publicApi.ts b/src/store/chat/slices/message/actions/publicApi.ts
index 5aaad5c82d9..9f1c18cc760 100644
--- a/src/store/chat/slices/message/actions/publicApi.ts
+++ b/src/store/chat/slices/message/actions/publicApi.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix,typescript-sort-keys/interface */
import { TraceEventType } from '@lobechat/types';
import { copyToClipboard } from '@lobehub/ui';
import isEqual from 'fast-deep-equal';
diff --git a/src/store/chat/slices/message/supervisor.test.ts b/src/store/chat/slices/message/supervisor.test.ts
index 7b239b51cd2..82637d3ee2e 100644
--- a/src/store/chat/slices/message/supervisor.test.ts
+++ b/src/store/chat/slices/message/supervisor.test.ts
@@ -58,7 +58,7 @@ describe('GroupChatSupervisor', () => {
});
it('should request structured completion and return filtered decisions', async () => {
- const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
+ const logSpy = vi.spyOn(console, 'info').mockImplementation(() => {});
vi.mocked(aiChatService.generateJSON).mockResolvedValue([
{ tool_name: 'create_todo', parameter: { content: 'Review action items' } },
@@ -118,7 +118,7 @@ describe('GroupChatSupervisor', () => {
});
it('should parse structured response from JSON string fallback', async () => {
- const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
+ const logSpy = vi.spyOn(console, 'info').mockImplementation(() => {});
const payload = [
'```json',
'[',
diff --git a/src/store/chat/slices/message/supervisor.ts b/src/store/chat/slices/message/supervisor.ts
index bde4047f403..837cb787581 100644
--- a/src/store/chat/slices/message/supervisor.ts
+++ b/src/store/chat/slices/message/supervisor.ts
@@ -72,13 +72,14 @@ export class GroupChatSupervisor {
const response = await this.callLLMForDecision(context);
const result = this.parseSupervisorResponse(response, availableAgents, context);
- console.log('Supervisor TODO list:', result.todos);
+ console.info('Supervisor TODO list:', result.todos);
return result;
} catch (error) {
// Re-throw the error so it can be caught and displayed to the user via toast
throw new Error(
`Supervisor decision failed: ${error instanceof Error ? error.message : String(error)}`,
+ { cause: error },
);
}
}
@@ -110,7 +111,7 @@ export class GroupChatSupervisor {
context.abortController || new AbortController(),
);
- console.log('SUPERVISOR RESPONSE', JSON.stringify(response, null, 2));
+ console.info('SUPERVISOR RESPONSE', JSON.stringify(response, null, 2));
// Parse the response to SupervisorToolCall[]
if (Array.isArray(response)) {
@@ -170,7 +171,7 @@ export class GroupChatSupervisor {
context: SupervisorContext,
): SupervisorDecisionResult {
const previousTodos = (context.todoList || []).map((item) => ({ ...item }));
- let primaryError: unknown = null;
+ let primaryError: unknown;
try {
const toolCalls = this.normalizeToolCalls(response);
@@ -193,7 +194,9 @@ export class GroupChatSupervisor {
const legacyMessage =
legacyError instanceof Error ? legacyError.message : String(legacyError);
- throw new Error(`Failed to parse supervisor response: ${primaryMessage} | ${legacyMessage}`);
+ throw new Error(`Failed to parse supervisor response: ${primaryMessage} | ${legacyMessage}`, {
+ cause: legacyError,
+ });
}
}
@@ -263,13 +266,13 @@ export class GroupChatSupervisor {
}
case 'wait_for_user_input': {
// Pause conversation - no action needed, just don't add any decisions
- console.log('DEBUG: Supervisor paused conversation:', call.parameter);
+ console.info('DEBUG: Supervisor paused conversation:', call.parameter);
break;
}
case 'trigger_agent':
case 'trigger_agent_dm': {
const decision = this.buildDecisionFromTool(call.parameter, availableAgents, context);
- console.log('DEBUG: Built decision from tool:', {
+ console.info('DEBUG: Built decision from tool:', {
decision,
parameter: call.parameter,
toolName: call.tool_name,
@@ -282,7 +285,7 @@ export class GroupChatSupervisor {
}
});
- console.log('DEBUG: Final decisions:', decisions);
+ console.info('DEBUG: Final decisions:', decisions);
return { decisions, todoUpdated, todos };
}
@@ -491,6 +494,7 @@ export class GroupChatSupervisor {
} catch (error) {
throw new Error(
`Failed to parse supervisor decision: ${error instanceof Error ? error.message : String(error)}`,
+ { cause: error },
);
}
}
diff --git a/src/store/chat/slices/operation/types.ts b/src/store/chat/slices/operation/types.ts
index ae631ea4a07..1ab321861d6 100644
--- a/src/store/chat/slices/operation/types.ts
+++ b/src/store/chat/slices/operation/types.ts
@@ -1,4 +1,3 @@
-/* eslint-disable typescript-sort-keys/interface, sort-keys-fix/sort-keys-fix */
import { type ConversationContext } from '@lobechat/types';
/**
diff --git a/src/store/chat/slices/plugin/action.test.ts b/src/store/chat/slices/plugin/action.test.ts
index fa02a6311af..65af8ec0aad 100644
--- a/src/store/chat/slices/plugin/action.test.ts
+++ b/src/store/chat/slices/plugin/action.test.ts
@@ -835,7 +835,7 @@ describe('ChatPluginAction', () => {
id: messageId,
role: 'tool',
content: 'Tool content',
- plugin: { identifier: identifier, arguments: '{"oldKey":"oldValue"}' },
+ plugin: { identifier, arguments: '{"oldKey":"oldValue"}' },
tool_call_id: toolCallId,
parentId,
} as UIChatMessage;
@@ -844,7 +844,7 @@ describe('ChatPluginAction', () => {
id: parentId,
role: 'assistant',
content: 'Assistant content',
- tools: [{ identifier: identifier, arguments: '{"oldKey":"oldValue"}', id: toolCallId }],
+ tools: [{ identifier, arguments: '{"oldKey":"oldValue"}', id: toolCallId }],
} as UIChatMessage;
act(() => {
@@ -1185,7 +1185,7 @@ describe('ChatPluginAction', () => {
id: messageId,
role: 'assistant',
content: 'Assistant content',
- tools: [{ identifier: identifier, arguments: '{"oldKey":"oldValue"}', id: toolCallId }],
+ tools: [{ identifier, arguments: '{"oldKey":"oldValue"}', id: toolCallId }],
} as UIChatMessage;
act(() => {
diff --git a/src/store/chat/slices/plugin/actions/internals.ts b/src/store/chat/slices/plugin/actions/internals.ts
index 1ab4e8b747e..d4455fa227e 100644
--- a/src/store/chat/slices/plugin/actions/internals.ts
+++ b/src/store/chat/slices/plugin/actions/internals.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import { builtinTools } from '@lobechat/builtin-tools';
import { ToolArgumentsRepairer, ToolNameResolver } from '@lobechat/context-engine';
import { type ChatToolPayload, type MessageToolCall } from '@lobechat/types';
@@ -23,13 +22,10 @@ export const pluginInternals = (set: Setter, get: () => ChatStore, _api?: unknow
new PluginInternalsActionImpl(set, get, _api);
export class PluginInternalsActionImpl {
- readonly #get: () => ChatStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
internal_transformToolCalls = (toolCalls: MessageToolCall[]): ChatToolPayload[] => {
diff --git a/src/store/chat/slices/plugin/actions/optimisticUpdate.ts b/src/store/chat/slices/plugin/actions/optimisticUpdate.ts
index 443edcc88d4..9fb2354db1b 100644
--- a/src/store/chat/slices/plugin/actions/optimisticUpdate.ts
+++ b/src/store/chat/slices/plugin/actions/optimisticUpdate.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import {
type ChatMessageError,
type ChatMessagePluginError,
@@ -41,11 +40,10 @@ export const pluginOptimisticUpdate = (set: Setter, get: () => ChatStore, _api?:
export class PluginOptimisticUpdateActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/plugin/actions/pluginTypes.ts b/src/store/chat/slices/plugin/actions/pluginTypes.ts
index ba697817832..e10771371d3 100644
--- a/src/store/chat/slices/plugin/actions/pluginTypes.ts
+++ b/src/store/chat/slices/plugin/actions/pluginTypes.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import { type ChatToolPayload, type RuntimeStepContext } from '@lobechat/types';
import { PluginErrorType } from '@lobehub/chat-plugin-sdk';
import debug from 'debug';
@@ -33,11 +32,10 @@ export const pluginTypes = (set: Setter, get: () => ChatStore, _api?: unknown) =
export class PluginTypesActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/plugin/actions/publicApi.ts b/src/store/chat/slices/plugin/actions/publicApi.ts
index 43a321d92a3..0ca61d5ec0d 100644
--- a/src/store/chat/slices/plugin/actions/publicApi.ts
+++ b/src/store/chat/slices/plugin/actions/publicApi.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import { type ChatToolPayload, type RuntimeStepContext, type UIChatMessage } from '@lobechat/types';
import i18n from 'i18next';
@@ -19,11 +18,10 @@ export const pluginPublicApi = (set: Setter, get: () => ChatStore, _api?: unknow
export class PluginPublicApiActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/plugin/actions/workflow.ts b/src/store/chat/slices/plugin/actions/workflow.ts
index f8bdf899540..f70ea93bde2 100644
--- a/src/store/chat/slices/plugin/actions/workflow.ts
+++ b/src/store/chat/slices/plugin/actions/workflow.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import { type CreateMessageParams } from '@lobechat/types';
import { messageService } from '@/services/message';
@@ -19,11 +18,10 @@ export const pluginWorkflow = (set: Setter, get: () => ChatStore, _api?: unknown
export class PluginWorkflowActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/portal/selectors.ts b/src/store/chat/slices/portal/selectors.ts
index 2d0c8651425..b1724d6165a 100644
--- a/src/store/chat/slices/portal/selectors.ts
+++ b/src/store/chat/slices/portal/selectors.ts
@@ -123,7 +123,6 @@ const toolUIIdentifier = (s: ChatStoreState) => currentToolUI(s)?.identifier;
const isPluginUIOpen = (id: string) => (s: ChatStoreState) =>
toolMessageId(s) === id && showPortal(s);
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
export const chatPortalSelectors = {
// Core stack selectors
currentView,
diff --git a/src/store/chat/slices/thread/action.ts b/src/store/chat/slices/thread/action.ts
index bccd35901e5..d25c92cdb9f 100644
--- a/src/store/chat/slices/thread/action.ts
+++ b/src/store/chat/slices/thread/action.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
// Disable the auto sort key eslint rule to make the code more logic and readable
import { LOADING_FLAT } from '@lobechat/const';
import { chainSummaryTitle } from '@lobechat/prompts';
diff --git a/src/store/chat/slices/topic/action.ts b/src/store/chat/slices/topic/action.ts
index 96979d04545..29e480b1c31 100644
--- a/src/store/chat/slices/topic/action.ts
+++ b/src/store/chat/slices/topic/action.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
// Note: To make the code more logic and readable, we just disable the auto sort key eslint rule
// DON'T REMOVE THE FIRST LINE
import { chainSummaryTitle } from '@lobechat/prompts';
diff --git a/src/store/chat/slices/translate/action.ts b/src/store/chat/slices/translate/action.ts
index 3f9ca1057bd..59aa43c292c 100644
--- a/src/store/chat/slices/translate/action.ts
+++ b/src/store/chat/slices/translate/action.ts
@@ -22,11 +22,10 @@ export const chatTranslate = (set: Setter, get: () => ChatStore, _api?: unknown)
export class ChatTranslateActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/chat/slices/tts/action.ts b/src/store/chat/slices/tts/action.ts
index ec8f65dabbf..d361ee36eba 100644
--- a/src/store/chat/slices/tts/action.ts
+++ b/src/store/chat/slices/tts/action.ts
@@ -14,11 +14,10 @@ export const chatTTS = (set: Setter, get: () => ChatStore, _api?: unknown) =>
export class ChatTTSActionImpl {
readonly #get: () => ChatStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => ChatStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/discover/slices/assistant/action.ts b/src/store/discover/slices/assistant/action.ts
index 6515c51af86..e9b228b3448 100644
--- a/src/store/discover/slices/assistant/action.ts
+++ b/src/store/discover/slices/assistant/action.ts
@@ -19,13 +19,10 @@ export const createAssistantSlice = (set: Setter, get: () => DiscoverStore, _api
new AssistantActionImpl(set, get, _api);
export class AssistantActionImpl {
- readonly #get: () => DiscoverStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => DiscoverStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
useAssistantCategories = (
diff --git a/src/store/discover/slices/groupAgent/action.ts b/src/store/discover/slices/groupAgent/action.ts
index b42c2a16b56..4a500af07ef 100644
--- a/src/store/discover/slices/groupAgent/action.ts
+++ b/src/store/discover/slices/groupAgent/action.ts
@@ -18,13 +18,10 @@ export const createGroupAgentSlice = (set: Setter, get: () => DiscoverStore, _ap
new GroupAgentActionImpl(set, get, _api);
export class GroupAgentActionImpl {
- readonly #get: () => DiscoverStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => DiscoverStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
useGroupAgentCategories = (params: CategoryListQuery = {}): SWRResponse<CategoryItem[]> => {
diff --git a/src/store/discover/slices/mcp/action.ts b/src/store/discover/slices/mcp/action.ts
index a84056a96b4..f1211b9a342 100644
--- a/src/store/discover/slices/mcp/action.ts
+++ b/src/store/discover/slices/mcp/action.ts
@@ -17,13 +17,10 @@ export const createMCPSlice = (set: Setter, get: () => DiscoverStore, _api?: unk
new MCPActionImpl(set, get, _api);
export class MCPActionImpl {
- readonly #get: () => DiscoverStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => DiscoverStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
useFetchMcpDetail = ({
diff --git a/src/store/discover/slices/model/action.ts b/src/store/discover/slices/model/action.ts
index 55038f4fa45..11c4d28bde8 100644
--- a/src/store/discover/slices/model/action.ts
+++ b/src/store/discover/slices/model/action.ts
@@ -18,13 +18,10 @@ export const createModelSlice = (set: Setter, get: () => DiscoverStore, _api?: u
new ModelActionImpl(set, get, _api);
export class ModelActionImpl {
- readonly #get: () => DiscoverStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => DiscoverStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
useModelCategories = (params: CategoryListQuery): SWRResponse<CategoryItem[]> => {
diff --git a/src/store/discover/slices/plugin/action.ts b/src/store/discover/slices/plugin/action.ts
index 521add4ddec..b6b95f716fa 100644
--- a/src/store/discover/slices/plugin/action.ts
+++ b/src/store/discover/slices/plugin/action.ts
@@ -18,13 +18,10 @@ export const createPluginSlice = (set: Setter, get: () => DiscoverStore, _api?:
new PluginActionImpl(set, get, _api);
export class PluginActionImpl {
- readonly #get: () => DiscoverStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => DiscoverStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
usePluginCategories = (params: CategoryListQuery): SWRResponse<CategoryItem[]> => {
diff --git a/src/store/discover/slices/provider/action.ts b/src/store/discover/slices/provider/action.ts
index e9b01b7918b..f9e8226c95a 100644
--- a/src/store/discover/slices/provider/action.ts
+++ b/src/store/discover/slices/provider/action.ts
@@ -17,13 +17,10 @@ export const createProviderSlice = (set: Setter, get: () => DiscoverStore, _api?
new ProviderActionImpl(set, get, _api);
export class ProviderActionImpl {
- readonly #get: () => DiscoverStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => DiscoverStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
useProviderDetail = (params: {
diff --git a/src/store/discover/slices/social/action.ts b/src/store/discover/slices/social/action.ts
index 0030abfbec1..77e33a737b6 100644
--- a/src/store/discover/slices/social/action.ts
+++ b/src/store/discover/slices/social/action.ts
@@ -19,13 +19,10 @@ export const createSocialSlice = (set: Setter, get: () => DiscoverStore, _api?:
new SocialActionImpl(set, get, _api);
export class SocialActionImpl {
- readonly #get: () => DiscoverStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => DiscoverStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
addFavorite = async (targetType: SocialTargetType, targetId: number): Promise<void> => {
diff --git a/src/store/discover/slices/user/action.ts b/src/store/discover/slices/user/action.ts
index 63b14d267d5..6ef47e4d3bf 100644
--- a/src/store/discover/slices/user/action.ts
+++ b/src/store/discover/slices/user/action.ts
@@ -12,13 +12,10 @@ export const createUserSlice = (set: Setter, get: () => DiscoverStore, _api?: un
new UserActionImpl(set, get, _api);
export class UserActionImpl {
- readonly #get: () => DiscoverStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => DiscoverStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
useUserProfile = (params: { username: string }): SWRResponse<DiscoverUserProfile | undefined> => {
diff --git a/src/store/document/slices/editor/selectors.ts b/src/store/document/slices/editor/selectors.ts
index 6d2134361b6..1335255f348 100644
--- a/src/store/document/slices/editor/selectors.ts
+++ b/src/store/document/slices/editor/selectors.ts
@@ -1,4 +1,3 @@
-/* eslint-disable sort-keys-fix/sort-keys-fix */
import { type DocumentStore } from '../../store';
import { type EditorContentState } from './initialState';
diff --git a/src/store/eval/initialState.ts b/src/store/eval/initialState.ts
index 09b2ea8b6e0..d54fbcbca8c 100644
--- a/src/store/eval/initialState.ts
+++ b/src/store/eval/initialState.ts
@@ -1,13 +1,10 @@
-import { type BenchmarkSliceState, benchmarkInitialState } from './slices/benchmark/initialState';
-import { type DatasetSliceState, datasetInitialState } from './slices/dataset/initialState';
-import { type RunSliceState, runInitialState } from './slices/run/initialState';
-import { type TestCaseSliceState, testCaseInitialState } from './slices/testCase/initialState';
+import { benchmarkInitialState, type BenchmarkSliceState } from './slices/benchmark/initialState';
+import { datasetInitialState, type DatasetSliceState } from './slices/dataset/initialState';
+import { runInitialState, type RunSliceState } from './slices/run/initialState';
+import { testCaseInitialState, type TestCaseSliceState } from './slices/testCase/initialState';
export interface EvalStoreState
- extends BenchmarkSliceState,
- DatasetSliceState,
- RunSliceState,
- TestCaseSliceState {}
+ extends BenchmarkSliceState, DatasetSliceState, RunSliceState, TestCaseSliceState {}
export const initialState: EvalStoreState = {
...benchmarkInitialState,
diff --git a/src/store/eval/store.ts b/src/store/eval/store.ts
index 416d03e4713..57d5bacd521 100644
--- a/src/store/eval/store.ts
+++ b/src/store/eval/store.ts
@@ -5,9 +5,9 @@ import type { StateCreator } from 'zustand/vanilla';
import { createDevtools } from '../middleware/createDevtools';
import { type EvalStoreState, initialState } from './initialState';
import { type BenchmarkAction, createBenchmarkSlice } from './slices/benchmark/action';
-import { type DatasetAction, createDatasetSlice } from './slices/dataset/action';
-import { type RunAction, createRunSlice } from './slices/run/action';
-import { type TestCaseAction, createTestCaseSlice } from './slices/testCase/action';
+import { createDatasetSlice, type DatasetAction } from './slices/dataset/action';
+import { createRunSlice, type RunAction } from './slices/run/action';
+import { createTestCaseSlice, type TestCaseAction } from './slices/testCase/action';
export type EvalStore = EvalStoreState &
BenchmarkAction &
@@ -15,11 +15,7 @@ export type EvalStore = EvalStoreState &
RunAction &
TestCaseAction;
-const createStore: StateCreator<EvalStore, [['zustand/devtools', never]]> = (
- set,
- get,
- store,
-) => ({
+const createStore: StateCreator<EvalStore, [['zustand/devtools', never]]> = (set, get, store) => ({
...initialState,
...createBenchmarkSlice(set, get, store),
...createDatasetSlice(set, get, store),
diff --git a/src/store/file/slices/chat/action.ts b/src/store/file/slices/chat/action.ts
index e1851804af7..2aba7c0384f 100644
--- a/src/store/file/slices/chat/action.ts
+++ b/src/store/file/slices/chat/action.ts
@@ -80,7 +80,7 @@ export class FileActionImpl {
// Poll task status every 2 seconds
await sleep(2000);
- let fileItem: FileListItem | undefined = undefined;
+ let fileItem: FileListItem | undefined;
try {
const result = await fileService.getKnowledgeItem(id);
@@ -164,7 +164,7 @@ export class FileActionImpl {
if (isChunkingUnsupported(file.type)) return;
const data = await ragService.parseFileContent(fileResult.id);
- console.log('parseFileContent data:', data);
+ console.info('parseFileContent data:', data);
});
await Promise.all(pools);
diff --git a/src/store/file/slices/chunk/action.ts b/src/store/file/slices/chunk/action.ts
index 908bf7c0d80..7c710c55e86 100644
--- a/src/store/file/slices/chunk/action.ts
+++ b/src/store/file/slices/chunk/action.ts
@@ -8,13 +8,12 @@ export const createFileChunkSlice = (set: Setter, get: () => FileStore, _api?: u
new FileChunkActionImpl(set, get, _api);
export class FileChunkActionImpl {
- readonly #get: () => FileStore;
readonly #set: Setter;
constructor(set: Setter, get: () => FileStore, _api?: unknown) {
void _api;
this.#set = set;
- this.#get = get;
+ void get;
}
closeChunkDrawer = (): void => {
diff --git a/src/store/file/slices/document/action.ts b/src/store/file/slices/document/action.ts
index 138aedfcb2e..55887d5b7c6 100644
--- a/src/store/file/slices/document/action.ts
+++ b/src/store/file/slices/document/action.ts
@@ -123,7 +123,7 @@ export class DocumentActionImpl {
metadata: {},
source: 'document',
sourceType: DocumentSourceType.EDITOR,
- title: title,
+ title,
totalCharCount: 0,
totalLineCount: 0,
updatedAt: now,
diff --git a/src/store/file/slices/tts/action.ts b/src/store/file/slices/tts/action.ts
index ff811656486..76d9af96e21 100644
--- a/src/store/file/slices/tts/action.ts
+++ b/src/store/file/slices/tts/action.ts
@@ -15,11 +15,10 @@ export const createTTSFileSlice = (set: Setter, get: () => FileStore, _api?: unk
export class TTSFileActionImpl {
readonly #get: () => FileStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => FileStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/file/slices/upload/action.ts b/src/store/file/slices/upload/action.ts
index d26a5580113..8ab82a20e76 100644
--- a/src/store/file/slices/upload/action.ts
+++ b/src/store/file/slices/upload/action.ts
@@ -57,13 +57,10 @@ export const createFileUploadSlice = (set: Setter, get: () => FileStore, _api?:
new FileUploadActionImpl(set, get, _api);
export class FileUploadActionImpl {
- readonly #get: () => FileStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => FileStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
uploadBase64FileWithProgress = async (
@@ -79,7 +76,7 @@ export class FileUploadActionImpl {
hash,
metadata,
name: metadata.filename,
- size: size,
+ size,
url: metadata.path,
});
return { ...res, dimensions, filename: metadata.filename };
diff --git a/src/store/global/actions/workspacePane.ts b/src/store/global/actions/workspacePane.ts
index 29910cd9719..087e003c8fe 100644
--- a/src/store/global/actions/workspacePane.ts
+++ b/src/store/global/actions/workspacePane.ts
@@ -14,11 +14,10 @@ export const globalWorkspaceSlice = (set: Setter, get: () => GlobalStore, _api?:
export class GlobalWorkspacePaneActionImpl {
readonly #get: () => GlobalStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => GlobalStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/global/initialState.ts b/src/store/global/initialState.ts
index b5bb083543b..f66fb48ea90 100644
--- a/src/store/global/initialState.ts
+++ b/src/store/global/initialState.ts
@@ -57,13 +57,11 @@ export enum SettingsTabs {
Security = 'security',
Skill = 'skill',
- /* eslint-disable typescript-sort-keys/string-enum */
Stats = 'stats',
Storage = 'storage',
SystemTools = 'system-tools',
TTS = 'tts',
Usage = 'usage',
- /* eslint-enable typescript-sort-keys/string-enum */
}
/**
diff --git a/src/store/home/slices/group/action.ts b/src/store/home/slices/group/action.ts
index f70b08ed315..c57c7b40089 100644
--- a/src/store/home/slices/group/action.ts
+++ b/src/store/home/slices/group/action.ts
@@ -7,11 +7,10 @@ export const createGroupSlice = (set: Setter, get: () => HomeStore, _api?: unkno
export class GroupActionImpl {
readonly #get: () => HomeStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => HomeStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/home/slices/homeInput/action.ts b/src/store/home/slices/homeInput/action.ts
index 34d7502b635..bc75791d21a 100644
--- a/src/store/home/slices/homeInput/action.ts
+++ b/src/store/home/slices/homeInput/action.ts
@@ -152,7 +152,7 @@ export class HomeInputActionImpl {
sendAsResearch = async (message: string): Promise<void> => {
// TODO: Implement DeepResearch mode
- console.log('sendAsResearch:', message);
+ console.info('sendAsResearch:', message);
// Clear mode
this.#set({ inputActiveMode: null }, false, n('sendAsResearch'));
diff --git a/src/store/image/slices/generationConfig/action.ts b/src/store/image/slices/generationConfig/action.ts
index 1f73032f064..543dc966f5f 100644
--- a/src/store/image/slices/generationConfig/action.ts
+++ b/src/store/image/slices/generationConfig/action.ts
@@ -95,12 +95,7 @@ export class GenerationConfigActionImpl {
setWidth = (width: number): void => {
this.#set(
(state) => {
- const {
- parameters,
- isAspectRatioLocked,
- activeAspectRatio,
- parametersSchema: parametersSchema,
- } = state;
+ const { parameters, isAspectRatioLocked, activeAspectRatio, parametersSchema } = state;
const newParams = { ...parameters, width };
if (isAspectRatioLocked && activeAspectRatio) {
@@ -126,12 +121,7 @@ export class GenerationConfigActionImpl {
setHeight = (height: number): void => {
this.#set(
(state) => {
- const {
- parameters,
- isAspectRatioLocked,
- activeAspectRatio,
- parametersSchema: parametersSchema,
- } = state;
+ const { parameters, isAspectRatioLocked, activeAspectRatio, parametersSchema } = state;
const newParams = { ...parameters, height };
if (isAspectRatioLocked && activeAspectRatio) {
@@ -157,12 +147,7 @@ export class GenerationConfigActionImpl {
toggleAspectRatioLock = (): void => {
this.#set(
(state) => {
- const {
- isAspectRatioLocked,
- activeAspectRatio,
- parameters,
- parametersSchema: parametersSchema,
- } = state;
+ const { isAspectRatioLocked, activeAspectRatio, parameters, parametersSchema } = state;
const newLockState = !isAspectRatioLocked;
// If transitioning from unlocked to locked and there's an active aspect ratio, adjust dimensions immediately
@@ -227,7 +212,7 @@ export class GenerationConfigActionImpl {
};
setAspectRatio = (aspectRatio: string): void => {
- const { parameters, parametersSchema: parametersSchema } = this.#get();
+ const { parameters, parametersSchema } = this.#get();
if (!parameters || !parametersSchema) return;
const defaultValues = extractDefaultValues(parametersSchema);
@@ -302,7 +287,7 @@ export class GenerationConfigActionImpl {
model,
provider,
parameters: { ...defaultValues, ...settings },
- parametersSchema: parametersSchema,
+ parametersSchema,
}),
false,
`reuseSettings/${model}/${provider}`,
diff --git a/src/store/library/slices/content/action.ts b/src/store/library/slices/content/action.ts
index af71b6d5d44..e657b55e89e 100644
--- a/src/store/library/slices/content/action.ts
+++ b/src/store/library/slices/content/action.ts
@@ -8,13 +8,10 @@ export const createContentSlice = (set: Setter, get: () => KnowledgeBaseStore, _
new KnowledgeBaseContentActionImpl(set, get, _api);
export class KnowledgeBaseContentActionImpl {
- readonly #get: () => KnowledgeBaseStore;
- readonly #set: Setter;
-
constructor(set: Setter, get: () => KnowledgeBaseStore, _api?: unknown) {
void _api;
- this.#set = set;
- this.#get = get;
+ void set;
+ void get;
}
addFilesToKnowledgeBase = async (knowledgeBaseId: string, ids: string[]): Promise<void> => {
diff --git a/src/store/mention/action.ts b/src/store/mention/action.ts
index 093fb123c2a..9017d6c4258 100644
--- a/src/store/mention/action.ts
+++ b/src/store/mention/action.ts
@@ -7,13 +7,12 @@ export const createMentionSlice = (set: Setter, get: () => MentionStore, _api?:
new MentionActionImpl(set, get, _api);
export class MentionActionImpl {
- readonly #get: () => MentionStore;
readonly #set: Setter;
constructor(set: Setter, get: () => MentionStore, _api?: unknown) {
void _api;
this.#set = set;
- this.#get = get;
+ void get;
}
addMentionedUser = (userId: string): void => {
diff --git a/src/store/page/slices/crud/action.ts b/src/store/page/slices/crud/action.ts
index fca12d4d328..2eebd960fff 100644
--- a/src/store/page/slices/crud/action.ts
+++ b/src/store/page/slices/crud/action.ts
@@ -104,7 +104,7 @@ export class CrudActionImpl {
metadata: {},
source: 'document',
sourceType: DocumentSourceType.EDITOR,
- title: title,
+ title,
totalCharCount: 0,
totalLineCount: 0,
updatedAt: now,
diff --git a/src/store/serverConfig/action.ts b/src/store/serverConfig/action.ts
index 9d877879ce4..25f566393b6 100644
--- a/src/store/serverConfig/action.ts
+++ b/src/store/serverConfig/action.ts
@@ -17,13 +17,12 @@ export const createServerConfigSlice = (
) => new ServerConfigActionImpl(set, get, _api);
export class ServerConfigActionImpl {
- readonly #get: () => ServerConfigStore;
readonly #set: Setter;
constructor(set: Setter, get: () => ServerConfigStore, _api?: unknown) {
void _api;
this.#set = set;
- this.#get = get;
+ void get;
}
useInitServerConfig = (): SWRResponse<GlobalRuntimeConfig> => {
diff --git a/src/store/session/slices/homeInput/action.test.ts b/src/store/session/slices/homeInput/action.test.ts
index 0547bafbd34..79081588493 100644
--- a/src/store/session/slices/homeInput/action.test.ts
+++ b/src/store/session/slices/homeInput/action.test.ts
@@ -411,7 +411,7 @@ describe('HomeInputAction', () => {
describe('sendAsResearch', () => {
it('should log message to console', async () => {
- const consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
+ const consoleSpy = vi.spyOn(console, 'info').mockImplementation(() => {});
const { result } = renderHook(() => useSessionStore());
diff --git a/src/store/session/slices/homeInput/action.ts b/src/store/session/slices/homeInput/action.ts
index d718e2c1419..34755b3270d 100644
--- a/src/store/session/slices/homeInput/action.ts
+++ b/src/store/session/slices/homeInput/action.ts
@@ -75,7 +75,7 @@ export class HomeInputActionImpl {
sendAsResearch = async (message: string): Promise<void> => {
// TODO: Implement DeepResearch mode
- console.log('sendAsResearch:', message);
+ console.info('sendAsResearch:', message);
// Clear mode
this.#set({ inputActiveMode: null }, false, n('sendAsResearch'));
diff --git a/src/store/session/slices/session/action.ts b/src/store/session/slices/session/action.ts
index d4798d30eeb..d5db99da85d 100644
--- a/src/store/session/slices/session/action.ts
+++ b/src/store/session/slices/session/action.ts
@@ -36,8 +36,6 @@ const n = setNamespace('session');
const FETCH_SESSIONS_KEY = 'fetchSessions';
const SEARCH_SESSIONS_KEY = 'searchSessions';
-/* eslint-disable typescript-sort-keys/interface */
-
type Setter = StoreSetter<SessionStore>;
export const createSessionSlice = (set: Setter, get: () => SessionStore, _api?: unknown) =>
new SessionActionImpl(set, get, _api);
@@ -108,7 +106,7 @@ export class SessionActionImpl {
if (!session) return;
const title = sessionMetaSelectors.getTitle(session.meta);
- const newTitle = t('duplicateSession.title', { ns: 'chat', title: title });
+ const newTitle = t('duplicateSession.title', { ns: 'chat', title });
const messageLoadingKey = 'duplicateSession.loading';
diff --git a/src/store/session/slices/sessionGroup/action.ts b/src/store/session/slices/sessionGroup/action.ts
index bdf9e6cd9e3..2722611eb91 100644
--- a/src/store/session/slices/sessionGroup/action.ts
+++ b/src/store/session/slices/sessionGroup/action.ts
@@ -9,19 +9,16 @@ import { type SessionGroupItem } from '@/types/session';
import { type SessionGroupsDispatch } from './reducer';
import { sessionGroupsReducer } from './reducer';
-/* eslint-disable typescript-sort-keys/interface */
-
type Setter = StoreSetter<SessionStore>;
export const createSessionGroupSlice = (set: Setter, get: () => SessionStore, _api?: unknown) =>
new SessionGroupActionImpl(set, get, _api);
export class SessionGroupActionImpl {
readonly #get: () => SessionStore;
- readonly #set: Setter;
constructor(set: Setter, get: () => SessionStore, _api?: unknown) {
void _api;
- this.#set = set;
+ void set;
this.#get = get;
}
diff --git a/src/store/tool/slices/klavisStore/action.ts b/src/store/tool/slices/klavisStore/action.ts
index 7fd778c4174..e1163143dd4 100644
--- a/src/store/tool/slices/klavisStore/action.ts
+++ b/src/store/tool/slices/klavisStore/action.ts
@@ -58,7 +58,7 @@ export class KlavisStoreActionImpl {
toolName,
});
- console.log('toolsClient.klavis.callTool-response', response);
+ console.info('toolsClient.klavis.callTool-response', response);
this.#set(
produce((draft: KlavisStoreState) => {
diff --git a/src/store/tool/slices/mcpStore/action.ts b/src/store/tool/slices/mcpStore/action.ts
index cb3bc8d6cc8..e1a87b292ac 100644
--- a/src/store/tool/slices/mcpStore/action.ts
+++ b/src/store/tool/slices/mcpStore/action.ts
@@ -561,7 +561,7 @@ export class PluginMCPStoreActionImpl {
// For mcp, store connection info in customParams field first
customParams: { mcp: finalConnection },
identifier: plugin.identifier,
- manifest: manifest,
+ manifest,
settings: normalizedConfig,
type: 'plugin',
});
@@ -622,7 +622,7 @@ export class PluginMCPStoreActionImpl {
} catch (e) {
// Silently handle errors caused by cancellation
if (abortController.signal.aborted) {
- console.log('MCP plugin installation cancelled for:', identifier);
+ console.info('MCP plugin installation cancelled for:', identifier);
return;
}
@@ -804,7 +804,7 @@ export class PluginMCPStoreActionImpl {
discoverService.reportMcpEvent({
event: 'activate',
- identifier: identifier,
+ identifier,
source: 'self',
});
@@ -841,7 +841,7 @@ export class PluginMCPStoreActionImpl {
discoverService.reportMcpEvent({
event: 'uninstall',
- identifier: identifier,
+ identifier,
source: 'self',
});
};
diff --git a/src/store/tool/slices/oldStore/initialState.ts b/src/store/tool/slices/oldStore/initialState.ts
index 3f2a131fb8d..ead30b93877 100644
--- a/src/store/tool/slices/oldStore/initialState.ts
+++ b/src/store/tool/slices/oldStore/initialState.ts
@@ -8,7 +8,6 @@ export enum PluginStoreTabs {
Plugin = 'old',
}
-/* eslint-disable typescript-sort-keys/string-enum */
export enum PluginInstallStep {
COMPLETED = 'COMPLETED',
ERROR = 'ERROR',
diff --git a/src/store/userMemory/slices/home/action.ts b/src/store/userMemory/slices/home/action.ts
index 4f83d51fc84..cd22e919d22 100644
--- a/src/store/userMemory/slices/home/action.ts
+++ b/src/store/userMemory/slices/home/action.ts
@@ -17,13 +17,12 @@ export const createHomeSlice = (set: Setter, get: () => UserMemoryStore, _api?:
new HomeActionImpl(set, get, _api);
export class HomeActionImpl {
- readonly #get: () => UserMemoryStore;
readonly #set: Setter;
constructor(set: Setter, get: () => UserMemoryStore, _api?: unknown) {
void _api;
this.#set = set;
- this.#get = get;
+ void get;
}
useFetchPersona = (): SWRResponse<PersonaData | null> => {
diff --git a/src/store/video/initialState.ts b/src/store/video/initialState.ts
index 59a507e181b..bb35ac5907c 100644
--- a/src/store/video/initialState.ts
+++ b/src/store/video/initialState.ts
@@ -4,8 +4,8 @@ import {
initialGenerationBatchState,
} from './slices/generationBatch/initialState';
import {
- type VideoGenerationConfigState,
initialGenerationConfigState,
+ type VideoGenerationConfigState,
} from './slices/generationConfig/initialState';
import {
type GenerationTopicState,
diff --git a/src/store/video/store.ts b/src/store/video/store.ts
index 2a971e37801..8ee36ab8704 100644
--- a/src/store/video/store.ts
+++ b/src/store/video/store.ts
@@ -4,19 +4,19 @@ import { createWithEqualityFn } from 'zustand/traditional';
import { type StateCreator } from 'zustand/vanilla';
import { createDevtools } from '../middleware/createDevtools';
-import { type VideoStoreState, initialState } from './initialState';
-import { type CreateVideoAction, createCreateVideoSlice } from './slices/createVideo/action';
+import { initialState, type VideoStoreState } from './initialState';
+import { createCreateVideoSlice, type CreateVideoAction } from './slices/createVideo/action';
import {
- type GenerationBatchAction,
createGenerationBatchSlice,
+ type GenerationBatchAction,
} from './slices/generationBatch/action';
import {
- type GenerationConfigAction,
createGenerationConfigSlice,
+ type GenerationConfigAction,
} from './slices/generationConfig/action';
import {
- type GenerationTopicAction,
createGenerationTopicSlice,
+ type GenerationTopicAction,
} from './slices/generationTopic/action';
// =============== aggregate createStoreFn ============ //
diff --git a/src/styles/antdOverride.ts b/src/styles/antdOverride.ts
index 8b8df0c1890..7a626449622 100644
--- a/src/styles/antdOverride.ts
+++ b/src/styles/antdOverride.ts
@@ -3,7 +3,7 @@ import { type Theme } from 'antd-style';
import { css } from 'antd-style';
import { rgba } from 'polished';
-export default ({ token }: { prefixCls: string; token: Theme }) => css`
+const antdOverride = ({ token }: { prefixCls: string; token: Theme }) => css`
.${token.prefixCls}-popover {
z-index: 1100;
}
@@ -27,3 +27,5 @@ export default ({ token }: { prefixCls: string; token: Theme }) => css`
}
`}
`;
+
+export default antdOverride;
diff --git a/src/utils/server/parseModels.ts b/src/utils/server/parseModels.ts
index 5847811624b..0bd926bc8e2 100644
--- a/src/utils/server/parseModels.ts
+++ b/src/utils/server/parseModels.ts
@@ -20,8 +20,9 @@ export const parseModelString = async (
const disable = item.startsWith('-');
const nameConfig = item.startsWith('+') || item.startsWith('-') ? item.slice(1) : item;
const [idAndDisplayName, ...capabilities] = nameConfig.split('<');
- let [id, displayName] = idAndDisplayName.split('=');
+ const [rawId, displayName] = idAndDisplayName.split('=');
+ let id = rawId;
let deploymentName: string | undefined;
if (withDeploymentName) {